@ingit/cli-linux-arm64 0.2.0 → 0.2.1

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.
@@ -593,12 +593,12 @@ Error generating stack: `+e.message+`
593
593
  grid-template-columns: 1fr;
594
594
  }
595
595
  }
596
- `}),(0,y.jsxs)(`div`,{className:`repo-open-stack`,children:[ie.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-agents-card`,children:[(0,y.jsx)(`div`,{className:`repo-open-agents-brand`,children:(0,y.jsx)(`img`,{className:`repo-open-agents-logo`,src:`/press-kit/ingit-icon-mark-light.svg`,alt:`ingit`})}),(0,y.jsx)(`div`,{className:`repo-open-agents-title`,children:`Running agent sessions`}),(0,y.jsx)(`div`,{className:`repo-open-agents-grid`,children:ie.map(t=>(0,y.jsxs)(`div`,{className:`repo-open-list-button repo-open-claude-row`,children:[(0,y.jsxs)(`span`,{className:`repo-open-list-name repo-open-agent-name`,children:[[...new Set(t.sessions.map(e=>e.agent))].map(e=>(0,y.jsx)(_i,{agent:e,size:15,busy:t.sessions.some(t=>t.agent===e&&t.busy)},e)),yi(t.cwd)]}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t.cwd}),(0,y.jsx)(`span`,{className:`repo-open-claude-chips`,children:t.sessions.map(e=>(0,y.jsx)(`button`,{type:`button`,className:`repo-open-claude-chip${e.busy?` repo-open-claude-chip-busy`:``}`,disabled:!e.focusable||o!==null,title:e.focusable?`Focus this session's window — ${pi(e)} (pid ${e.pid})`:`${pi(e)} (pid ${e.pid}) — window focus unavailable for this session`,onClick:()=>void s(e),children:o===e.pid?`focusing…`:`${e.title??`${e.agent===`codex`?`codex `:``}${pi(e)}`}${e.count>1?` ×${e.count}`:``}`},`${e.pid}:${e.cwd}`))}),(0,y.jsx)(`button`,{type:`button`,className:`repo-open-row-action repo-open-claude-open`,onClick:()=>e(t.cwd),children:`Open`})]},t.cwd))})]}),(0,y.jsxs)(`div`,{className:`repo-open-shell`,children:[(0,y.jsxs)(`div`,{className:`repo-open-header`,children:[(0,y.jsx)(`h1`,{className:`repo-open-title`,children:`Open repository`}),(0,y.jsxs)(`form`,{onSubmit:ee,className:`repo-open-form`,children:[(0,y.jsxs)(`div`,{className:`repo-open-input-wrap`,children:[(0,y.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),onFocus:()=>{h(!0),S.length>0&&_(!0)},onBlur:()=>{h(!1),_(!1)},onKeyDown:te,placeholder:`/home/user/my-project`,className:`repo-open-input`,autoComplete:`off`,role:`combobox`,"aria-expanded":se,"aria-controls":`repo-open-path-suggestions`,"aria-autocomplete":`list`}),se&&(0,y.jsx)(`div`,{id:`repo-open-path-suggestions`,className:`repo-open-path-suggestions`,role:`listbox`,children:v&&S.length===0?(0,y.jsx)(`div`,{className:`repo-open-path-suggestions-loading`,children:`Loading...`}):S.map((e,t)=>(0,y.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===w,className:`repo-open-path-suggestion${t===w?` repo-open-path-suggestion-active`:``}`,onMouseEnter:()=>T(t),onMouseDown:t=>{t.preventDefault(),D(e)},children:[(0,y.jsxs)(`span`,{className:`repo-open-path-suggestion-main`,children:[(0,y.jsx)(`span`,{className:`repo-open-path-suggestion-name`,children:e.name}),(0,y.jsx)(`span`,{className:`repo-open-path-suggestion-path`,children:e.path})]}),e.isGitRepo&&(0,y.jsx)(`span`,{className:`repo-open-repo-badge`,children:`repo`})]},e.path))})]}),(0,y.jsx)(`button`,{type:`submit`,disabled:!c.trim(),className:`repo-open-button`,children:`Open`})]})]}),(0,y.jsxs)(`div`,{className:`repo-open-body`,children:[(0,y.jsxs)(`section`,{className:`repo-open-explorer`,"aria-label":`Folder tree`,children:[(0,y.jsxs)(`div`,{className:`repo-open-explorer-head`,children:[(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-nav`,disabled:!ae?.parentPath,onClick:()=>{ae?.parentPath&&E(ae.parentPath,{makeRoot:!0})},title:`Parent folder`,"aria-label":`Parent folder`,children:`..`}),(0,y.jsx)(`div`,{className:`repo-open-root-path`,children:ae?Si(ae.path).map((e,t,n)=>(0,y.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,minWidth:0},children:[t>0&&!/^(\/|[A-Za-z]:[\\/])$/.test(n[t-1].label)&&(0,y.jsx)(`span`,{className:`repo-open-root-separator`,children:`/`}),(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-crumb`,onClick:()=>void E(e.path,{makeRoot:!0}),title:e.path,children:e.label})]},e.path)):`Loading...`}),ae?.isGitRepo&&(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-action`,onClick:()=>e(ae.path),children:`Open`})]}),(0,y.jsxs)(`div`,{className:`repo-open-tree`,children:[oe&&(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:16},children:`Loading...`}),u&&!oe&&re(u,0)]})]}),(0,y.jsxs)(`aside`,{className:`repo-open-side`,children:[t&&(0,y.jsx)(`p`,{className:`repo-open-error`,children:t}),n.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-section`,children:[(0,y.jsx)(`div`,{className:`repo-open-section-title`,children:`Recent repositories`}),(0,y.jsx)(`div`,{className:`repo-open-list`,children:n.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`repo-open-list-button`,children:[(0,y.jsx)(`span`,{className:`repo-open-list-name`,children:yi(t)}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t})]},t))})]}),i.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-section`,children:[(0,y.jsx)(`div`,{className:`repo-open-section-title`,children:`Repositories`}),r&&(0,y.jsx)(`div`,{className:`repo-open-folder-caption`,children:r}),(0,y.jsx)(`div`,{className:`repo-open-list`,children:i.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`repo-open-list-button`,children:[(0,y.jsx)(`span`,{className:`repo-open-list-name`,children:yi(t)}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t})]},t))})]})]})]})]}),(0,y.jsxs)(`div`,{className:`repo-open-version`,children:[`v`,`0.2.0`]})]})]})}var wi={head:`Branches`,remote:`Remotes`,tag:`Tags`},Ti=[`head`,`remote`,`tag`];function Ei({refs:e,stashes:t,onSelectRef:n,onSelectStash:r,onSelectStashParent:i,selectedStashSha:a,selectedSha:o,onClose:s,onOpenSettings:c,settingsOpen:l=!1}){let[u,d]=(0,b.useState)({head:!0,remote:!0,tag:!0}),[f,p]=(0,b.useState)(``),[m,h]=(0,b.useState)(!1),g=f.toLowerCase(),_={head:[],remote:[],tag:[]};for(let t of e)g&&!t.shortName.toLowerCase().includes(g)||_[t.kind].push(t);function v(e){d(t=>({...t,[e]:!t[e]}))}return(0,y.jsxs)(`div`,{style:{width:250,flexShrink:0,height:`100%`,background:`#181825`,borderRight:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflowY:`auto`,userSelect:`none`},children:[(0,y.jsxs)(`div`,{style:{padding:`8px 14px`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,color:`#6c7086`,textTransform:`uppercase`,borderBottom:`1px solid #313244`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[`Refs`,(0,y.jsx)(`button`,{onClick:s,title:`Hide refs`,style:{background:`none`,border:`none`,color:`#6c7086`,cursor:`pointer`,fontSize:14,padding:`0 2px`,lineHeight:1},children:`✕`})]}),(0,y.jsx)(`div`,{style:{padding:`6px 10px`,borderBottom:`1px solid #313244`},children:(0,y.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`Filter branches...`,style:{width:`100%`,background:`#1e1e2e`,border:`1px solid #45475a`,borderRadius:4,color:`#cdd6f4`,fontSize:12,padding:`5px 8px`,outline:`none`,fontFamily:`inherit`},onFocus:e=>{e.currentTarget.style.borderColor=`#89b4fa`},onBlur:e=>{e.currentTarget.style.borderColor=`#45475a`}})}),(0,y.jsxs)(`div`,{style:{margin:`8px 10px 4px`,border:`1px solid #704752`,borderRadius:7,background:`#55323c`,overflow:`hidden`,flexShrink:0},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`stretch`},children:(0,y.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-expanded":m,style:{flex:1,minWidth:0,display:`flex`,alignItems:`center`,gap:7,padding:`7px 9px`,border:`none`,background:`transparent`,color:`#f5e0dc`,fontFamily:`inherit`,fontSize:12,fontWeight:700,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,transform:m?`rotate(90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,color:`#d7a6b2`,fontSize:9},children:`▶`}),`Stashes`,(0,y.jsx)(`span`,{style:{marginLeft:`auto`,minWidth:16,padding:`1px 5px`,borderRadius:8,background:`#311f25aa`,color:`#d7a6b2`,fontSize:10,fontWeight:600,textAlign:`center`},children:t.length})]})}),m&&(0,y.jsx)(`div`,{style:{borderTop:`1px solid #704752`},children:t.length===0?(0,y.jsx)(`div`,{style:{padding:`9px 10px 5px`,color:`#c4939f`,fontSize:11},children:`No stashed changes`}):(0,y.jsx)(`div`,{children:t.map(e=>{let t=Di(e.message);return(0,y.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":a===e.sha,onClick:()=>r(e.sha),onKeyDown:t=>{t.target===t.currentTarget&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e.sha))},style:{padding:`8px 9px`,borderBottom:`1px solid #704752`,display:`flex`,flexDirection:`column`,gap:5,background:a===e.sha?`#f5c2e71a`:`transparent`,boxShadow:a===e.sha?`inset 3px 0 #f5c2e7`:`none`,cursor:`pointer`},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:7},children:(0,y.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,y.jsx)(`div`,{title:e.message,style:{color:`#f5e0dc`,fontSize:11,fontWeight:650,lineHeight:1.35,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.message||e.selector}),(0,y.jsxs)(`div`,{style:{marginTop:2,color:`#c4939f`,fontSize:9.5},children:[e.selector,t.context?` · ${t.context}`:``,` · `,Oi(e.createdAt)]})]})}),(0,y.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),i(e.parentSha)},title:`Go to ${e.parentSha}`,style:{alignSelf:`flex-start`,padding:0,border:`none`,background:`none`,color:`#89b4fa`,fontFamily:`monospace`,fontSize:10,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:2},children:[`parent `,e.parentSha.slice(0,8)]})]},e.sha)})})})]}),Ti.map(e=>{let t=_[e];if(t.length===0)return null;let r=f?!1:u[e];return(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{onClick:()=>v(e),style:{width:`100%`,display:`flex`,alignItems:`center`,gap:6,padding:`6px 14px`,background:`none`,border:`none`,color:`#a6adc8`,fontSize:12,fontWeight:600,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,transform:r?`rotate(-90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,fontSize:10,lineHeight:1},children:`▼`}),wi[e],(0,y.jsx)(`span`,{style:{marginLeft:`auto`,background:`#313244`,borderRadius:8,padding:`1px 6px`,fontSize:10,color:`#6c7086`,fontWeight:500},children:t.length})]}),!r&&(0,y.jsx)(`div`,{children:t.map(e=>{let t=e.targetSha===o;return(0,y.jsxs)(`button`,{onClick:()=>n(e),title:e.name,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`5px 14px 5px 28px`,background:t?`#313244`:`none`,border:`none`,color:t?`#89b4fa`:`#cdd6f4`,fontSize:13,fontWeight:e.isCurrent?700:`normal`,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`,overflow:`hidden`},children:[(0,y.jsx)(ki,{kind:e.kind,isCurrent:e.isCurrent}),(0,y.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.shortName}),(e.ahead!=null||e.behind!=null)&&(0,y.jsxs)(`span`,{style:{display:`flex`,gap:4,flexShrink:0,fontSize:11},children:[e.ahead!=null&&e.ahead>0&&(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`↑`,e.ahead]}),e.behind!=null&&e.behind>0&&(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`↓`,e.behind]})]})]},e.name)})})]},e)}),(0,y.jsx)(`div`,{style:{marginTop:`auto`,padding:`10px`,borderTop:`1px solid #313244`},children:(0,y.jsxs)(`button`,{type:`button`,onClick:c,title:`Open settings`,"aria-label":`Open settings`,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,borderRadius:5,border:`1px solid #313244`,background:l?`#89b4fa20`:`transparent`,color:l?`#89b4fa`:`#a6adc8`,fontSize:12,fontWeight:600,fontFamily:`inherit`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{color:l?`#89b4fa`:`#6c7086`},children:`⚙`}),`Settings`]})})]})}function Di(e){let t=/^(?:WIP )?on ([^:]+):\s*(.*)$/i.exec(e);return t?{message:t[2]??e,context:`on ${t[1]}`}:{message:e,context:``}}function Oi(e){return new Date(e*1e3).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function ki({kind:e,isCurrent:t}){let n={flexShrink:0,fontSize:11,width:14,textAlign:`center`};return e===`head`?(0,y.jsx)(`span`,{style:{...n,color:t?`#a6e3a1`:`#89b4fa`},children:t?`●`:`⎇`}):e===`remote`?(0,y.jsx)(`span`,{style:{...n,color:`#94e2d5`},children:`◉`}):(0,y.jsx)(`span`,{style:{...n,color:`#f9e2af`},children:`◆`})}var Ai=g(),ji=Object.defineProperty,Mi=(e,t)=>{let n={};for(var r in e)ji(n,r,{get:e[r],enumerable:!0});return t||ji(n,Symbol.toStringTag,{value:`Module`}),n},Ni=Ji(),z=e=>Ui(e,Ni),B=Ji();z.write=e=>Ui(e,B);var Pi=Ji();z.onStart=e=>Ui(e,Pi);var Fi=Ji();z.onFrame=e=>Ui(e,Fi);var Ii=Ji();z.onFinish=e=>Ui(e,Ii);var Li=[];z.setTimeout=(e,t)=>{let n=z.now()+t,r=()=>{let e=Li.findIndex(e=>e.cancel==r);~e&&Li.splice(e,1),Vi-=+!!~e},i={time:n,handler:e,cancel:r};return Li.splice(Ri(n),0,i),Vi+=1,Wi(),i};var Ri=e=>~(~Li.findIndex(t=>t.time>e)||~Li.length);z.cancel=e=>{Pi.delete(e),Fi.delete(e),Ii.delete(e),Ni.delete(e),B.delete(e)},z.sync=e=>{Hi=!0,z.batchedUpdates(e),Hi=!1},z.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,z.onStart(n)}return r.handler=e,r.cancel=()=>{Pi.delete(n),t=null},r};var zi=typeof window<`u`?window.requestAnimationFrame:()=>{};z.use=e=>zi=e,z.now=typeof performance<`u`?()=>performance.now():Date.now,z.batchedUpdates=e=>e(),z.catch=console.error,z.frameLoop=`always`,z.onDemand=()=>{},z.advance=()=>{z.frameLoop===`demand`?qi():console.warn(`Cannot call the manual advancement of rafz whilst frameLoop is not set as demand`)};var Bi=-1,Vi=0,Hi=!1;function Ui(e,t){Hi?(t.delete(e),e(0)):(t.add(e),Wi(),z.frameLoop===`demand`&&z.onDemand())}function Wi(){Bi<0&&(Bi=0,z.frameLoop!==`demand`&&zi(Ki))}function Gi(){Bi=-1}function Ki(){~Bi&&(zi(Ki),z.batchedUpdates(qi))}function qi(){let e=Bi;Bi=z.now();let t=Ri(Bi);if(t&&(Yi(Li.splice(0,t),e=>e.handler()),Vi-=t),!Vi){Gi();return}Pi.flush(),Ni.flush(e?Math.min(64,Bi-e):16.667),Fi.flush(),B.flush(),Ii.flush(),z.frameLoop===`demand`&&Vi>0&&z.onDemand()}function Ji(){let e=new Set,t=e;return{add(n){Vi+=+(t==e&&!e.has(n)),e.add(n)},delete(n){return Vi-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Vi-=t.size,Yi(t,t=>t(n)&&e.add(t)),Vi+=e.size,t=e)}}}function Yi(e,t){e.forEach(e=>{try{t(e)}catch(e){z.catch(e)}})}function Xi(){}var Zi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),V={arr:Array.isArray,obj:e=>!!e&&e.constructor.name===`Object`,fun:(e=>typeof e==`function`),str:e=>typeof e==`string`,num:e=>typeof e==`number`,und:e=>e===void 0};function Qi(e,t){if(V.arr(e)){if(!V.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var H=(e,t)=>e.forEach(t);function $i(e,t,n){if(V.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var ea=e=>V.und(e)?[]:V.arr(e)?e:[e];function ta(e,t){if(e.size){let n=Array.from(e);e.clear(),H(n,t)}}var na=(e,...t)=>ta(e,e=>e(...t)),ra=()=>typeof window>`u`||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ia=Mi({assign:()=>ua,colors:()=>sa,createStringInterpolator:()=>aa,skipAnimation:()=>ca,to:()=>oa,willAdvance:()=>la}),aa,oa,sa=null,ca=!1,la=Xi,ua=e=>{e.to&&(oa=e.to),e.now&&(z.now=e.now),e.colors!==void 0&&(sa=e.colors),e.skipAnimation!=null&&(ca=e.skipAnimation),e.createStringInterpolator&&(aa=e.createStringInterpolator),e.requestAnimationFrame&&z.use(e.requestAnimationFrame),e.batchedUpdates&&(z.batchedUpdates=e.batchedUpdates),e.willAdvance&&(la=e.willAdvance),e.frameLoop&&(z.frameLoop=e.frameLoop),e.onDemand&&(z.onDemand=e.onDemand)},da=new Set,fa=[],pa=[],ma=0,ha={get idle(){return!da.size&&!fa.length},start(e){ma>e.priority?(da.add(e),z.onStart(ga)):(_a(e),z(ya))},advance:ya,sort(e){if(ma)z.onFrame(()=>ha.sort(e));else{let t=fa.indexOf(e);~t&&(fa.splice(t,1),va(e))}},clear(){fa=[],da.clear()}};function ga(){da.forEach(_a),da.clear(),z(ya)}function _a(e){fa.includes(e)||va(e)}function va(e){fa.splice(ba(fa,t=>t.priority>e.priority),0,e)}function ya(e){let t=pa;for(let n=0;n<fa.length;n++){let r=fa[n];ma=r.priority,r.idle||(la(r),r.advance(e),r.idle||t.push(r))}return ma=0,pa=fa,pa.length=0,fa=t,fa.length>0}function ba(e,t){let n=e.findIndex(t);return n<0?e.length:n}var xa=(e,t,n)=>Math.min(Math.max(n,e),t),Sa={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ca=`[-+]?\\d*\\.?\\d+`,wa=`[-+]?\\d*\\.?\\d+%`;function Ta(...e){return`\\(\\s*(`+e.join(`)\\s*,\\s*(`)+`)\\s*\\)`}var Ea=RegExp(`rgb`+Ta(Ca,Ca,Ca)),Da=RegExp(`rgba`+Ta(Ca,Ca,Ca,Ca)),Oa=RegExp(`hsl`+Ta(Ca,wa,wa)),ka=RegExp(`hsla`+Ta(Ca,wa,wa,Ca)),Aa=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ja=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ma=/^#([0-9a-fA-F]{6})$/,Na=/^#([0-9a-fA-F]{8})$/;function Pa(e){let t;return typeof e==`number`?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ma.exec(e))?parseInt(t[1]+`ff`,16)>>>0:sa&&sa[e]!==void 0?sa[e]:(t=Ea.exec(e))?(La(t[1])<<24|La(t[2])<<16|La(t[3])<<8|255)>>>0:(t=Da.exec(e))?(La(t[1])<<24|La(t[2])<<16|La(t[3])<<8|za(t[4]))>>>0:(t=Aa.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+`ff`,16)>>>0:(t=Na.exec(e))?parseInt(t[1],16)>>>0:(t=ja.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Oa.exec(e))?(Ia(Ra(t[1]),Ba(t[2]),Ba(t[3]))|255)>>>0:(t=ka.exec(e))?(Ia(Ra(t[1]),Ba(t[2]),Ba(t[3]))|za(t[4]))>>>0:null}function Fa(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ia(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=Fa(i,r,e+1/3),o=Fa(i,r,e),s=Fa(i,r,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function La(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Ra(e){return(parseFloat(e)%360+360)%360/360}function za(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Ba(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Va(e){let t=Pa(e);return t===null?e:(t||=0,`rgba(${(t&4278190080)>>>24}, ${(t&16711680)>>>16}, ${(t&65280)>>>8}, ${(t&255)/255})`)}var Ha=(e,t,n)=>{if(V.fun(e))return e;if(V.arr(e))return Ha({range:e,output:t,extrapolate:n});if(V.str(e.output[0]))return aa(e);let r=e,i=r.output,a=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||`extend`,s=r.extrapolateRight||r.extrapolate||`extend`,c=r.easing||(e=>e);return e=>{let t=Wa(e,a);return Ua(e,a[t],a[t+1],i[t],i[t+1],c,o,s,r.map)}};function Ua(e,t,n,r,i,a,o,s,c){let l=c?c(e):e;if(l<t){if(o===`identity`)return l;o===`clamp`&&(l=t)}if(l>n){if(s===`identity`)return l;s===`clamp`&&(l=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t),l=a(l),r===-1/0?l=-l:i===1/0?l+=r:l=l*(i-r)+r,l)}function Wa(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var Ga=(e,t=`end`)=>n=>{n=t===`end`?Math.min(n,.999):Math.max(n,.001);let r=n*e;return xa(0,1,(t===`end`?Math.floor(r):Math.ceil(r))/e)},Ka=1.70158,qa=Ka*1.525,Ja=2.70158,Ya=2*Math.PI/3,Xa=2*Math.PI/4.5,Za=e=>{let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},Qa={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-(-2*e+2)**2/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-(1-e)**4,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-(-2*e+2)**4/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-(1-e)**5,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-(-2*e+2)**5/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:2**(10*e-10),easeOutExpo:e=>e===1?1:1-2**(-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-e**2),easeOutCirc:e=>Math.sqrt(1-(e-1)**2),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2,easeInBack:e=>Ja*e*e*e-Ka*e*e,easeOutBack:e=>1+Ja*(e-1)**3+Ka*(e-1)**2,easeInOutBack:e=>e<.5?(2*e)**2*(3.5949095*2*e-qa)/2:((2*e-2)**2*(3.5949095*(e*2-2)+qa)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*Ya),easeOutElastic:e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*Ya)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Xa))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Xa)/2+1,easeInBounce:e=>1-Za(1-e),easeOutBounce:Za,easeInOutBounce:e=>e<.5?(1-Za(1-2*e))/2:(1+Za(2*e-1))/2,steps:Ga},$a=Symbol.for(`FluidValue.get`),eo=Symbol.for(`FluidValue.observers`),to=e=>!!(e&&e[$a]),no=e=>e&&e[$a]?e[$a]():e,ro=e=>e[eo]||null;function io(e,t){e.eventObserved?e.eventObserved(t):e(t)}function ao(e,t){let n=e[eo];n&&n.forEach(e=>{io(e,t)})}var oo=class{constructor(e){if(!e&&!(e=this.get))throw Error(`Unknown getter`);so(this,e)}},so=(e,t)=>U(e,$a,t);function co(e,t){if(e[$a]){let n=e[eo];n||U(e,eo,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function lo(e,t){let n=e[eo];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[eo]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var U=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),W=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,uo=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,fo=RegExp(`(${W.source})(%|[a-z]+)`,`i`),po=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,mo=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ho=e=>{let[t,n]=go(e);if(!t||ra())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith(`--`)?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&mo.test(n)?ho(n):n||e},go=e=>{let t=mo.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},_o,vo=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,yo=e=>e.match(W)??[],bo=e=>{_o||=sa?RegExp(`(${Object.keys(sa).join(`|`)})(?!\\w)`,`g`):/^\b$/;let t=e.output.map(e=>no(e).replace(mo,ho).replace(uo,Va).replace(_o,Va)),n=t.map(e=>yo(e).map(Number)),r=n[0].map((e,t)=>n.map(e=>{if(!(t in e))throw Error(`The arity of each "output" value must be equal`);return e[t]})).map(t=>Ha({...e,output:t})),i=e.range||[0,1],a=t.map(e=>yo(e)),o=a[0].map((e,t)=>{let n=a.map(e=>{let n=e[t],r=n.indexOf(`.`);return r===-1?0:n.length-r-1});return n.every(e=>e===n[0])&&n[0]>0?n[0]:null});return e=>{let n=i.indexOf(e);if(n!==-1)return t[n];let a=!fo.test(t[0])&&t.find(e=>fo.test(e))?.replace(W,``),s=0;return t[0].replace(W,()=>{let t=s++,n=r[t](e),i=o[t];return`${i==null?n:n.toFixed(i)}${a||``}`}).replace(po,vo)}},xo=`react-spring: `,So=e=>{let t=e,n=!1;if(typeof t!=`function`)throw TypeError(`${xo}once requires a function parameter`);return(...e)=>{n||=(t(...e),!0)}},Co=So(console.warn);function wo(){Co(`${xo}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var To=So(console.warn);function Eo(){To(`${xo}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Do(e){return V.str(e)&&(e[0]==`#`||/\d/.test(e)||!ra()&&mo.test(e)||e in(sa||{}))}var Oo=ra()?b.useEffect:b.useLayoutEffect,ko=()=>{let e=(0,b.useRef)(!1);return Oo(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Ao(){let e=(0,b.useState)()[1],t=ko();return()=>{t.current&&e(Math.random())}}var jo=e=>(0,b.useEffect)(e,Mo),Mo=[];function No(e){let t=(0,b.useRef)(void 0);return(0,b.useEffect)(()=>{t.current=e}),t.current}var Po=Symbol.for(`Animated:node`),Fo=e=>!!e&&e[Po]===e,Io=e=>e&&e[Po],Lo=(e,t)=>Zi(e,Po,t),Ro=e=>e&&e[Po]&&e[Po].getPayload(),zo=class{constructor(){Lo(this,this)}getPayload(){return this.payload||[]}},Bo=class e extends zo{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,V.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new e(t)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return V.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,V.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Vo=class e extends Bo{constructor(e){super(0),this._string=null,this._toString=Ha({output:[e,e]})}static create(t){return new e(t)}getValue(){return this._string??=this._toString(this._value)}setValue(e){if(V.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Ha({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ho={dependencies:null},Uo=class extends zo{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return $i(this.source,(n,r)=>{Fo(n)?t[r]=n.getValue(e):to(n)?t[r]=no(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&H(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return $i(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ho.dependencies&&to(e)&&Ho.dependencies.add(e);let t=Ro(e);t&&H(t,e=>this.add(e))}},Wo=class e extends Uo{constructor(e){super(e)}static create(t){return new e(t)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){let t=this.getPayload();return e.length==t.length?t.map((t,n)=>t.setValue(e[n])).some(Boolean):(super.setValue(e.map(Go)),!0)}};function Go(e){return(Do(e)?Vo:Bo).create(e)}function Ko(e){let t=Io(e);return t?t.constructor:V.arr(e)?Wo:Do(e)?Vo:Bo}var qo=(e,t)=>{let n=!V.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,b.forwardRef)((r,i)=>{let a=(0,b.useRef)(null),o=n&&(0,b.useCallback)(e=>{a.current=Xo(i,e)},[i]),[s,c]=Yo(r,t),l=Ao(),u=()=>{let e=a.current;n&&!e||(e?t.applyAnimatedValues(e,s.getValue(!0)):!1)===!1&&l()},d=new Jo(u,c),f=(0,b.useRef)(void 0);Oo(()=>(f.current=d,H(c,e=>co(e,d)),()=>{f.current&&(H(f.current.deps,e=>lo(e,f.current)),z.cancel(f.current.update))})),(0,b.useEffect)(u,[]),jo(()=>()=>{let e=f.current;H(e.deps,t=>lo(t,e))});let p=t.getComponentProps(s.getValue());return b.createElement(e,{...p,ref:o})})},Jo=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type==`change`&&z.write(this.update)}};function Yo(e,t){let n=new Set;return Ho.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Uo(e),Ho.dependencies=null,[e,n]}function Xo(e,t){return e&&(V.fun(e)?e(t):e.current=t),t}var Zo=Symbol.for(`AnimatedComponent`),Qo=new WeakMap,$o=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new Uo(e),getComponentProps:r=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},a=e=>{let t=es(e)||`Anonymous`;if(V.str(e))e=a[e]||(a[e]=qo(e,i));else{let t=e[Zo]??Qo.get(e);if(!t){t=qo(e,i);try{e[Zo]=t}catch{}Qo.set(e,t)}e=t}return e.displayName=`Animated(${t})`,e};return $i(e,(t,n)=>{V.arr(e)&&(n=es(t)),a[n]=a(t)}),{animated:a}},es=e=>V.str(e)?e:e&&V.str(e.displayName)?e.displayName:V.fun(e)&&e.name||null;function ts(e,...t){return V.fun(e)?e(...t):e}var ns=(e,t)=>e===!0||!!(t&&e&&(V.fun(e)?e(t):ea(e).includes(t))),rs=(e,t)=>V.obj(e)?t&&e[t]:e,is=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,as=e=>e,os=(e,t=as)=>{let n=ss;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));let r={};for(let i of n){let n=t(e[i],i);V.und(n)||(r[i]=n)}return r},ss=[`config`,`onProps`,`onStart`,`onChange`,`onPause`,`onResume`,`onRest`],cs={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function ls(e){let t={},n=0;if($i(e,(e,r)=>{cs[r]||(t[r]=e,n++)}),n)return t}function us(e){let t=ls(e);if(t){let n={to:t};return $i(e,(e,r)=>r in t||(n[r]=e)),n}return{...e}}function ds(e){let t=no(e);return V.arr(t)?t.map(ds):Do(t)?ia.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function fs(e){for(let t in e)return!0;return!1}function ps(e){return V.fun(e)||V.arr(e)&&V.obj(e[0])}function ms(e,t){e.ref?.delete(e),t?.delete(e)}function hs(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var gs={...{default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}}.default,mass:1,damping:1,easing:Qa.linear,clamp:!1},_s=class{constructor(){this.velocity=0,Object.assign(this,gs)}};function vs(e,t,n){n&&(n={...n},ys(n,t),t={...n,...t}),ys(e,t),Object.assign(e,t);for(let t in gs)e[t]??(e[t]=gs[t]);let{frequency:r,damping:i}=e,{mass:a}=e;return V.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=(2*Math.PI/r)**2*a,e.friction=4*Math.PI*i*a/r),e}function ys(e,t){if(!V.und(t.decay))e.duration=void 0;else{let n=!V.und(t.tension)||!V.und(t.friction);(n||!V.und(t.frequency)||!V.und(t.damping)||!V.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var bs=[],xs=class{constructor(){this.changed=!1,this.values=bs,this.toValues=null,this.fromValues=bs,this.config=new _s,this.immediate=!1}};function Ss(e,{key:t,props:n,defaultProps:r,state:i,actions:a}){return new Promise((o,s)=>{let c,l,u=ns(n.cancel??r?.cancel,t);if(u)p();else{V.und(n.pause)||(i.paused=ns(n.pause,t));let e=r?.pause;e!==!0&&(e=i.paused||ns(e,t)),c=ts(n.delay||0,t),e?(i.resumeQueue.add(f),a.pause()):(a.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(l),l.cancel(),c=l.time-z.now()}function f(){c>0&&!ia.skipAnimation?(i.delayed=!0,l=z.setTimeout(p,c),i.pauseQueue.add(d),i.timeouts.add(l)):p()}function p(){i.delayed&&=!1,i.pauseQueue.delete(d),i.timeouts.delete(l),e<=(i.cancelId||0)&&(u=!0);try{a.start({...n,callId:e,cancel:u},o)}catch(e){s(e)}}})}var Cs=(e,t)=>t.length==1?t[0]:t.some(e=>e.cancelled)?Es(e.get()):t.every(e=>e.noop)?ws(e.get()):Ts(e.get(),t.every(e=>e.finished)),ws=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ts=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Es=e=>({value:e,cancelled:!0,finished:!1});function Ds(e,t,n,r){let{callId:i,parentId:a,onRest:o}=t,{asyncTo:s,promise:c}=n;return!a&&e===s&&!t.reset?c:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;let l=os(t,(e,t)=>t===`onRest`?void 0:e),u,d,f=new Promise((e,t)=>(u=e,d=t)),p=e=>{let t=i<=(n.cancelId||0)&&Es(r)||i!==n.asyncId&&Ts(r,!1);if(t)throw e.result=t,d(e),e},m=0,h=(e,t)=>{let a=new ks,o=new As;return(async()=>{p(a);let s=V.obj(e)?{...e}:{...t,to:e};if(s.parentId=i,$i(l,(e,t)=>{V.und(s[t])&&(s[t]=e)}),ia.skipAnimation){if(++m>1024)throw Os(n),o.result=Ts(r,!1),d(o),o;return s.immediate=!0,await r.start(s)}let c=await r.start(s);return p(a),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),c})()},g;try{let t;t=V.arr(e)?(async e=>{for(let t of e)await h(t)})(e):Promise.resolve(e(h,r.stop.bind(r))),await Promise.all([t.then(u),f]),g=Ts(r.get(),!0,!1)}catch(e){if(e instanceof ks)g=e.result;else if(e instanceof As)g=e.result;else throw e}finally{i==n.asyncId&&(n.asyncId=a,n.asyncTo=a?s:void 0,n.promise=a?c:void 0)}return V.fun(o)&&z.batchedUpdates(()=>{o(g,r,r.item)}),g})()}function Os(e,t){ta(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var ks=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},As=class extends Error{constructor(){super(`SkipAnimationSignal`)}},js=e=>e instanceof Ns,Ms=1,Ns=class extends oo{constructor(...e){super(...e),this.id=Ms++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Io(this);return e&&e.getValue()}to(...e){return ia.to(this,e)}interpolate(...e){return wo(),ia.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){ao(this,{type:`change`,parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ha.sort(this),ao(this,{type:`priority`,parent:this,priority:e})}},Ps=Symbol.for(`SpringPhase`),Fs=1,Is=2,Ls=4,Rs=e=>(e[Ps]&Fs)>0,zs=e=>(e[Ps]&Is)>0,Bs=e=>(e[Ps]&Ls)>0,Vs=(e,t)=>t?e[Ps]|=3:e[Ps]&=-3,Hs=(e,t)=>t?e[Ps]|=Ls:e[Ps]&=-5,Us=class extends Ns{constructor(e,t){if(super(),this.animation=new xs,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!V.und(e)||!V.und(t)){let n=V.obj(e)?{...e}:{...t,from:e};V.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(zs(this)||this._state.asyncTo)||Bs(this)}get goal(){return no(this.animation.to)}get velocity(){let e=Io(this);return e instanceof Bo?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return Rs(this)}get isAnimating(){return zs(this)}get isPaused(){return Bs(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{toValues:i}=r,{config:a}=r,o=Ro(r.to);!o&&to(r.to)&&(i=ea(no(r.to))),r.values.forEach((s,c)=>{if(s.done)return;let l=s.constructor==Vo?1:o?o[c].lastPosition:i[c],u=r.immediate,d=l;if(!u){if(d=s.lastPosition,a.tension<=0){s.done=!0;return}let t=s.elapsedTime+=e,n=r.fromValues[c],i=s.v0==null?s.v0=V.arr(a.velocity)?a.velocity[c]:a.velocity:s.v0,o,f=a.precision||(n==l?.005:Math.max(Math.max(Math.abs(l),Math.abs(n),1)*2**-52,Math.min(1,Math.abs(l-n)*.001)));if(!V.und(a.duration)){let r=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,s.durationProgress>0&&(s.elapsedTime=a.duration*s.durationProgress,t=s.elapsedTime+=e)),r=(a.progress||0)+t/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),d=n+a.easing(r)*(l-n),o=(d-s.lastPosition)/e,u=r==1}else if(a.decay){let e=a.decay===!0?.998:a.decay,r=Math.exp(-(1-e)*t);d=n+i/(1-e)*(1-r),u=Math.abs(s.lastPosition-d)<=f,o=i*r}else{o=s.lastVelocity==null?i:s.lastVelocity;let t=a.restVelocity||f/10,r=a.clamp?0:a.bounce,c=!V.und(r),p=n==l?s.v0>0:n<l,m,h=!1,g=Math.ceil(e/1);for(let e=0;e<g&&(m=Math.abs(o)>t,!(!m&&(u=Math.abs(l-d)<=f,u)));++e){c&&(h=d==l||d>l==p,h&&(o=-o*r,d=l));let e=(-a.tension*1e-6*(d-l)+-a.friction*.001*o)/a.mass;o+=e*1,d+=o*1}}s.lastVelocity=o,Number.isNaN(d)&&(console.warn(`Got NaN while animating:`,this),u=!0)}o&&!o[c].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,a.round)&&(n=!0)});let s=Io(this),c=s.getValue();if(t){let e=no(r.to);(c!==e||n)&&!a.decay?(s.setValue(e),this._onChange(e)):n&&a.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return z.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(zs(this)){let{to:e,config:t}=this.animation;z.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||=[]).push(e),this}start(e,t){let n;return V.und(e)?(n=this.queue||[],this.queue=[]):n=[V.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>Cs(this,e))}stop(e){let{to:t}=this.animation;return V.und(t)||this._focus(this.get()),Os(this._state,e&&this._lastCallId),z.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type==`change`?this._start():e.type==`priority`&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||``,{to:n,from:r}=e;n=V.obj(n)?n[t]:n,(n==null||ps(n))&&(n=void 0),r=V.obj(r)?r[t]:r,r??=void 0;let i={to:n,from:r};return Rs(this)||(e.reverse&&([n,r]=[r,n]),r=no(r),V.und(r)?Io(this)||this._set(n):this._set(r)),i}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,os(e,(e,t)=>/^on/.test(t)?rs(e,n):e)),Xs(this,e,`onProps`),Zs(this,`onProps`,e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return Ss(++this._lastCallId,{key:n,props:e,defaultProps:r,state:a,actions:{pause:()=>{Bs(this)||(Hs(this,!0),na(a.pauseQueue),Zs(this,`onPause`,Ts(this,Ws(this,this.animation.to)),this))},resume:()=>{Bs(this)&&(Hs(this,!1),zs(this)&&this._resume(),na(a.resumeQueue),Zs(this,`onResume`,Ts(this,Ws(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(n=>{if(e.loop&&n.finished&&!(t&&n.noop)){let t=Gs(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Es(this));let r=!V.und(e.to),i=!V.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(Es(this));let{key:a,defaultProps:o,animation:s}=this,{to:c,from:l}=s,{to:u=c,from:d=l}=e;i&&!r&&(!t.default||V.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let f=!Qi(d,l);f&&(s.from=d),d=no(d);let p=!Qi(u,c);p&&this._focus(u);let m=ps(t.to),{config:h}=s,{decay:g,velocity:_}=h;(r||i)&&!h.decay&&(h.velocity=0),t.config&&!m&&vs(h,ts(t.config,a),t.config===o.config?void 0:ts(o.config,a));let v=Io(this);if(!v||V.und(u))return n(Ts(this,!0));let y=V.und(t.reset)?i&&!t.default:!V.und(d)&&ns(t.reset,a),b=y?d:this.get(),x=ds(u),S=V.num(x)||V.arr(x)||Do(x),C=!m&&(!S||ns(o.immediate||t.immediate,a));if(p){let e=Ko(u);if(e!==v.constructor)if(C)v=this._set(x);else throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`)}let w=v.constructor,T=to(u),E=!1;if(!T){let e=y||!Rs(this)&&f;(p||e)&&(E=Qi(ds(b),x),T=!E),(!Qi(s.immediate,C)&&!C||!Qi(h.decay,g)||!Qi(h.velocity,_))&&(T=!0)}if(E&&zs(this)&&(s.changed&&!y?T=!0:T||this._stop(c)),!m&&((T||to(c))&&(s.values=v.getPayload(),s.toValues=to(u)?null:w==Vo?[1]:ea(x)),s.immediate!=C&&(s.immediate=C,!C&&!y&&this._set(c)),T)){let{onRest:e}=s;H(Ys,e=>Xs(this,t,e));let r=Ts(this,Ws(this,c));na(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&z.batchedUpdates(()=>{s.changed=!y,e?.(r,this),y?ts(o.onRest,r):s.onStart?.(r,this)})}y&&this._set(b),m?n(Ds(t.to,t,this._state,this)):T?this._start():zs(this)&&!p?this._pendingCalls.add(n):n(ws(b))}_focus(e){let t=this.animation;e!==t.to&&(ro(this)&&this._detach(),t.to=e,ro(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;to(t)&&(co(t,this),js(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;to(e)&&lo(e,this)}_set(e,t=!0){let n=no(e);if(!V.und(n)){let e=Io(this);if(!e||!Qi(n,e.getValue())){let r=Ko(n);!e||e.constructor!=r?Lo(this,r.create(n)):e.setValue(n),e&&z.batchedUpdates(()=>{this._onChange(n,t)})}}return Io(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Zs(this,`onStart`,Ts(this,Ws(this,e.to)),this))}_onChange(e,t){let n=Ts(e,!1);t||(this._onStart(),ts(this.animation.onChange,n,this)),ts(this.defaultProps.onChange,n,this),super._onChange(e,t)}_start(){let e=this.animation;Io(this).reset(no(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),zs(this)||(Vs(this,!0),Bs(this)||this._resume())}_resume(){ia.skipAnimation?this.finish():ha.start(this)}_stop(e,t){if(zs(this)){Vs(this,!1);let n=this.animation;H(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),ao(this,{type:`idle`,parent:this});let r=t?Es(this.get()):Ts(this.get(),Ws(this,e??n.to));na(this._pendingCalls,r),n.changed=!1,Zs(this,`onRest`,r,this)}}};function Ws(e,t){let n=ds(t);return Qi(ds(e.get()),n)}function Gs(e,t=e.loop,n=e.to){let r=ts(t);if(r){let i=r!==!0&&us(r),a=(i||e).reverse,o=!i||i.reset;return Ks({...e,loop:t,default:!1,pause:void 0,to:!a||ps(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function Ks(e){let{to:t,from:n}=e=us(e),r=new Set;return V.obj(t)&&Js(t,r),V.obj(n)&&Js(n,r),e.keys=r.size?Array.from(r):null,e}function qs(e){let t=Ks(e);return V.und(t.default)&&(t.default=os(t)),t}function Js(e,t){$i(e,(e,n)=>e!=null&&t.add(n))}var Ys=[`onStart`,`onRest`,`onChange`,`onPause`,`onResume`];function Xs(e,t,n){e.animation[n]=t[n]===is(t,n)?void 0:rs(t[n],e.key)}function Zs(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Qs=[`onStart`,`onChange`,`onRest`],$s=1,ec=class{constructor(e,t){this.id=$s++,this.springs={},this.queue=[],this._lastAsyncId=0,this._lastLoopId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(let t in e){let n=e[t];V.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Ks(e)),this}start(e){let{queue:t}=this;return e?t=ea(e).map(Ks):this.queue=[],this._flush?this._flush(this,t):(sc(this,t),tc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;H(ea(t),t=>n[t].stop(!!e))}else Os(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(V.und(e))this.start({pause:!0});else{let t=this.springs;H(ea(e),e=>t[e].pause())}return this}resume(e){if(V.und(e))this.start({pause:!1});else{let t=this.springs;H(ea(e),e=>t[e].resume())}return this}each(e){$i(this.springs,e)}onLoopReset(e){let t=this._onLoopReset??=new Set;return t.add(e),()=>{t.delete(e)}}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,ta(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let a=!r&&this._started,o=i||a&&n.size?this.get():null;i&&t.size&&ta(t,([e,t])=>{t.value=o,e(t,this,this._item)}),a&&(this._started=!1,ta(n,([e,t])=>{t.value=o,e(t,this,this._item)}))}eventObserved(e){if(e.type==`change`)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type==`idle`)this._active.delete(e.parent);else return;z.onFrame(this._onFrame)}};function tc(e,t){return Promise.all(t.map(t=>nc(e,t))).then(t=>Cs(e,t))}async function nc(e,t,n){let{keys:r,to:i,from:a,loop:o,onRest:s,onResolve:c}=t,l=V.obj(t.default)&&t.default;o&&(t.loop=!1);let u=t,d=!n&&!u.parentId&&`loop`in t?++e._lastLoopId:n?u.loopId:e._lastLoopId;i===!1&&(t.to=null),a===!1&&(t.from=null);let f=V.arr(i)||V.fun(i)?i:void 0;f?(t.to=void 0,t.onRest=void 0,l&&(l.onRest=void 0)):H(Qs,n=>{let r=t[n];if(V.fun(r)){let i=e._events[n];t[n]=(({finished:e,cancelled:t})=>{let n=i.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.set(r,{value:null,finished:e||!1,cancelled:t||!1})}),l&&(l[n]=t[n])}});let p=e._state;t.pause===!p.paused?(p.paused=t.pause,na(t.pause?p.pauseQueue:p.resumeQueue)):p.paused&&(t.pause=!0);let m=(r||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),h=t.cancel===!0||is(t,`cancel`)===!0;(f||h&&p.asyncId)&&m.push(Ss(++e._lastAsyncId,{props:t,state:p,actions:{pause:Xi,resume:Xi,start(t,n){h?(Os(p,e._lastAsyncId),n(Es(e))):(t.onRest=s,n(Ds(f,t,p,e)))}}})),p.paused&&await new Promise(e=>{p.resumeQueue.add(e)});let g=Cs(e,await Promise.all(m));if(o&&g.finished&&!(n&&g.noop)&&d===e._lastLoopId){let n=Gs(t,o,i);if(n)return n.loopId=d,e._onLoopReset?.forEach(e=>e()),sc(e,[n]),nc(e,n,!0)}return c&&z.batchedUpdates(()=>c(g,e,e.item)),g}function rc(e,t){let n={...e.springs};return t&&H(ea(t),e=>{V.und(e.keys)&&(e=Ks(e)),V.obj(e.to)||(e={...e,to:void 0}),oc(n,e,e=>ac(e))}),ic(e,n),n}function ic(e,t){$i(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,co(t,e))})}function ac(e,t){let n=new Us;return n.key=e,t&&co(n,t),n}function oc(e,t,n){t.keys&&H(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function sc(e,t){H(t,t=>{oc(e.springs,t,t=>ac(t,e))})}var cc=b.createContext({pause:!1,immediate:!1}),lc=()=>{let e=[],t=function(t){Eo();let r=[];return H(e,(e,i)=>{if(V.und(t))r.push(e.start());else{let a=n(t,e,i);a&&r.push(e.start(a))}}),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return H(e,e=>e.pause(...arguments)),this},t.resume=function(){return H(e,e=>e.resume(...arguments)),this},t.set=function(t){H(e,(e,n)=>{let r=V.fun(t)?t(n,e):t;r&&e.set(r)})},t.start=function(t){let n=[];return H(e,(e,r)=>{if(V.und(t))n.push(e.start());else{let i=this._getProps(t,e,r);i&&n.push(e.start(i))}}),n},t.stop=function(){return H(e,e=>e.stop(...arguments)),this},t.update=function(t){return H(e,(e,n)=>e.update(this._getProps(t,e,n))),this};let n=function(e,t,n){return V.fun(e)?e(n,t):e};return t._getProps=n,t};function uc(e,t,n){let r=V.fun(t)&&t;r&&!n&&(n=[]);let i=(0,b.useMemo)(()=>r||arguments.length==3?lc():void 0,[]),a=(0,b.useRef)(0),o=Ao(),s=(0,b.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){let n=rc(e,t);return a.current>0&&!s.queue.length&&!Object.keys(n).some(t=>!e.springs[t])?tc(e,t):new Promise(r=>{ic(e,n),s.queue.push(()=>{r(tc(e,t))}),o()})}}),[]),c=(0,b.useRef)([...s.ctrls]),l=(0,b.useRef)([]),u=(0,b.useRef)([]);u.current=[];let d=No(e)||0;(0,b.useMemo)(()=>{H(c.current.slice(e,d),e=>{ms(e,i),e.stop(!0)}),c.current.length=e,f(d,e)},[e]),(0,b.useMemo)(()=>{f(0,Math.min(d,e))},n);function f(e,n){for(let i=e;i<n;i++){let e=c.current[i]||(c.current[i]=new ec(null,s.flush)),n=r?r(i,e):t[i];n&&(l.current[i]=qs(n))}}let p=c.current.map((e,t)=>rc(e,l.current[t])),m=(0,b.useContext)(cc),h=m!==No(m)&&fs(m);Oo(()=>{a.current++,s.ctrls=c.current;let{queue:e}=s;e.length&&(s.queue=[],H(e,e=>e()));let t=l.current.length>0?l.current:u.current;H(c.current,(e,n)=>{i?.add(e),h&&e.start({default:m});let r=t[n];r&&(hs(e,r.ref),e.ref?e.queue.push({...r,default:V.obj(r.default)?{...r.default}:r.default}):e.start(r))}),l.current.length>0&&(u.current=l.current),l.current=[]}),jo(()=>()=>{H(s.ctrls,e=>e.stop(!0))});let g=p.map(e=>({...e}));return i?[g,i]:g}function dc(e,t){let n=V.fun(e),[[r],i]=uc(1,n?e:[e],n?t||[]:t);return n||arguments.length==2?[r,i]:r}var fc=class extends Ns{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ha(...t);let n=this._get(),r=Ko(n);Lo(this,r.create(n))}advance(e){let t=this._get();Qi(t,this.get())||(Io(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&mc(this._active)&&hc(this)}_get(){let e=V.arr(this.source)?this.source.map(no):ea(no(this.source));return this.calc(...e)}_start(){this.idle&&!mc(this._active)&&(this.idle=!1,H(Ro(this),e=>{e.done=!1}),ia.skipAnimation?(z.batchedUpdates(()=>this.advance()),hc(this)):ha.start(this))}_attach(){let e=1;H(ea(this.source),t=>{to(t)&&co(t,this),js(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){H(ea(this.source),e=>{to(e)&&lo(e,this)}),this._active.clear(),hc(this)}eventObserved(e){e.type==`change`?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type==`idle`?this._active.delete(e.parent):e.type==`priority`&&(this.priority=ea(this.source).reduce((e,t)=>Math.max(e,(js(t)?t.priority:0)+1),0))}};function pc(e){return e.idle!==!1}function mc(e){return!e.size||Array.from(e).every(pc)}function hc(e){e.idle||(e.idle=!0,H(Ro(e),e=>{e.done=!0}),ao(e,{type:`idle`,parent:e}))}var gc=(e,...t)=>new fc(e,t);ia.assign({createStringInterpolator:bo,to:(e,t)=>new fc(e,t)}),ha.advance;var _c=/^--/;function vc(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t==`number`&&t!==0&&!_c.test(e)&&!(xc.hasOwnProperty(e)&&xc[e])?t+`px`:(``+t).trim()}var yc={};function bc(e,t){if(!e.nodeType||!e.setAttribute||!e.removeAttribute)return!1;let n=e.nodeName===`filter`||e.parentNode&&e.parentNode.nodeName===`filter`,{className:r,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:c,...l}=t,u=Object.values(l),d=Object.keys(l).map(t=>n||e.hasAttribute(t)?t:yc[t]||(yc[t]=t.replace(/([A-Z])/g,e=>`-`+e.toLowerCase())));t.hasOwnProperty(`children`)&&(e.textContent=a);for(let t in i)if(i.hasOwnProperty(t)){let n=vc(t,i[t]);_c.test(t)?e.style.setProperty(t,n):e.style[t]=n}d.forEach((t,n)=>{let r=u[n];r===void 0?e.removeAttribute(t):e.setAttribute(t,r)}),t.hasOwnProperty(`className`)&&(r===void 0?e.removeAttribute(`class`):e.className=r),o!==void 0&&(e.scrollTop=o),s!==void 0&&(e.scrollLeft=s),t.hasOwnProperty(`viewBox`)&&(c===void 0?e.removeAttribute(`viewBox`):e.setAttribute(`viewBox`,c))}var xc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Sc=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Cc=[`Webkit`,`Ms`,`Moz`,`O`];xc=Object.keys(xc).reduce((e,t)=>(Cc.forEach(n=>e[Sc(n,t)]=e[t]),e),xc);var wc=/^(matrix3d|matrix|translate3d|translate[XYZ]?|scale3d|scale[XYZ]?|rotate3d|rotate[XYZ]?|skew[XY]?)$/,Tc=/^(translate)/,Ec=/^(rotate|skew)/,Dc=(e,t)=>V.num(e)&&e!==0?e+t:e,Oc=(e,t)=>V.arr(e)?e.every(e=>Oc(e,t)):V.num(e)?e===t:parseFloat(e)===t,kc=class extends Uo{constructor({x:e,y:t,z:n,...r}){let i=[],a=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),a.push(e=>[`translate3d(${e.map(e=>Dc(e,`px`)).join(`,`)})`,Oc(e,0)])),$i(r,(e,t)=>{if(t===`transform`)i.push([e||``]),a.push(e=>[e,e===``]);else if(wc.test(t)){if(delete r[t],V.und(e))return;let n=Tc.test(t)?`px`:Ec.test(t)?`deg`:``;i.push(ea(e)),a.push(t===`rotate3d`?([e,t,r,i])=>[`rotate3d(${e},${t},${r},${Dc(i,n)})`,Oc(i,0)]:e=>[`${t}(${e.map(e=>Dc(e,n)).join(`,`)})`,Oc(e,+!!t.startsWith(`scale`))])}}),i.length&&(r.transform=new Ac(i,a)),super(r)}},Ac=class extends oo{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||=this._get()}_get(){let e=``,t=!0;return H(this.inputs,(n,r)=>{let i=no(n[0]),[a,o]=this.transforms[r](V.arr(i)?i:n.map(no));e+=` `+a,t&&=o}),t?`none`:e}observerAdded(e){e==1&&H(this.inputs,e=>H(e,e=>to(e)&&co(e,this)))}observerRemoved(e){e==0&&H(this.inputs,e=>H(e,e=>to(e)&&lo(e,this)))}eventObserved(e){e.type==`change`&&(this._value=null),ao(this,e)}},jc=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.big.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.foreignObject.g.image.line.linearGradient.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.text.tspan`.split(`.`);ia.assign({batchedUpdates:Ai.unstable_batchedUpdates,createStringInterpolator:bo,colors:Sa});var G=$o(jc,{applyAnimatedValues:bc,createAnimatedStyle:e=>new kc(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}).animated,Mc=`BN.BN.BN.BN.BN.BN.BN.BN.BN.S.B.S.WS.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.B.B.B.S.WS.ON.ON.ET.ET.ET.ON.ON.ON.ON.ON.ES.CS.ES.CS.CS.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.CS.ON.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.ON.ON.ON.BN.BN.BN.BN.BN.BN.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.CS.ON.ET.ET.ET.ET.ON.ON.ON.ON.L.ON.ON.BN.ON.ON.ET.ET.EN.EN.ON.L.ON.ON.ON.EN.L.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.L.L.L.L.L.L.L.L`.split(`.`),Nc=[[697,698,`ON`],[706,719,`ON`],[722,735,`ON`],[741,749,`ON`],[751,767,`ON`],[768,879,`NSM`],[884,885,`ON`],[894,894,`ON`],[900,901,`ON`],[903,903,`ON`],[1014,1014,`ON`],[1155,1161,`NSM`],[1418,1418,`ON`],[1421,1422,`ON`],[1423,1423,`ET`],[1424,1424,`R`],[1425,1469,`NSM`],[1470,1470,`R`],[1471,1471,`NSM`],[1472,1472,`R`],[1473,1474,`NSM`],[1475,1475,`R`],[1476,1477,`NSM`],[1478,1478,`R`],[1479,1479,`NSM`],[1480,1535,`R`],[1536,1541,`AN`],[1542,1543,`ON`],[1544,1544,`AL`],[1545,1546,`ET`],[1547,1547,`AL`],[1548,1548,`CS`],[1549,1549,`AL`],[1550,1551,`ON`],[1552,1562,`NSM`],[1563,1610,`AL`],[1611,1631,`NSM`],[1632,1641,`AN`],[1642,1642,`ET`],[1643,1644,`AN`],[1645,1647,`AL`],[1648,1648,`NSM`],[1649,1749,`AL`],[1750,1756,`NSM`],[1757,1757,`AN`],[1758,1758,`ON`],[1759,1764,`NSM`],[1765,1766,`AL`],[1767,1768,`NSM`],[1769,1769,`ON`],[1770,1773,`NSM`],[1774,1775,`AL`],[1776,1785,`EN`],[1786,1808,`AL`],[1809,1809,`NSM`],[1810,1839,`AL`],[1840,1866,`NSM`],[1867,1957,`AL`],[1958,1968,`NSM`],[1969,1983,`AL`],[1984,2026,`R`],[2027,2035,`NSM`],[2036,2037,`R`],[2038,2041,`ON`],[2042,2044,`R`],[2045,2045,`NSM`],[2046,2069,`R`],[2070,2073,`NSM`],[2074,2074,`R`],[2075,2083,`NSM`],[2084,2084,`R`],[2085,2087,`NSM`],[2088,2088,`R`],[2089,2093,`NSM`],[2094,2136,`R`],[2137,2139,`NSM`],[2140,2143,`R`],[2144,2191,`AL`],[2192,2193,`AN`],[2194,2198,`AL`],[2199,2207,`NSM`],[2208,2249,`AL`],[2250,2273,`NSM`],[2274,2274,`AN`],[2275,2306,`NSM`],[2362,2362,`NSM`],[2364,2364,`NSM`],[2369,2376,`NSM`],[2381,2381,`NSM`],[2385,2391,`NSM`],[2402,2403,`NSM`],[2433,2433,`NSM`],[2492,2492,`NSM`],[2497,2500,`NSM`],[2509,2509,`NSM`],[2530,2531,`NSM`],[2546,2547,`ET`],[2555,2555,`ET`],[2558,2558,`NSM`],[2561,2562,`NSM`],[2620,2620,`NSM`],[2625,2626,`NSM`],[2631,2632,`NSM`],[2635,2637,`NSM`],[2641,2641,`NSM`],[2672,2673,`NSM`],[2677,2677,`NSM`],[2689,2690,`NSM`],[2748,2748,`NSM`],[2753,2757,`NSM`],[2759,2760,`NSM`],[2765,2765,`NSM`],[2786,2787,`NSM`],[2801,2801,`ET`],[2810,2815,`NSM`],[2817,2817,`NSM`],[2876,2876,`NSM`],[2879,2879,`NSM`],[2881,2884,`NSM`],[2893,2893,`NSM`],[2901,2902,`NSM`],[2914,2915,`NSM`],[2946,2946,`NSM`],[3008,3008,`NSM`],[3021,3021,`NSM`],[3059,3064,`ON`],[3065,3065,`ET`],[3066,3066,`ON`],[3072,3072,`NSM`],[3076,3076,`NSM`],[3132,3132,`NSM`],[3134,3136,`NSM`],[3142,3144,`NSM`],[3146,3149,`NSM`],[3157,3158,`NSM`],[3170,3171,`NSM`],[3192,3198,`ON`],[3201,3201,`NSM`],[3260,3260,`NSM`],[3276,3277,`NSM`],[3298,3299,`NSM`],[3328,3329,`NSM`],[3387,3388,`NSM`],[3393,3396,`NSM`],[3405,3405,`NSM`],[3426,3427,`NSM`],[3457,3457,`NSM`],[3530,3530,`NSM`],[3538,3540,`NSM`],[3542,3542,`NSM`],[3633,3633,`NSM`],[3636,3642,`NSM`],[3647,3647,`ET`],[3655,3662,`NSM`],[3761,3761,`NSM`],[3764,3772,`NSM`],[3784,3790,`NSM`],[3864,3865,`NSM`],[3893,3893,`NSM`],[3895,3895,`NSM`],[3897,3897,`NSM`],[3898,3901,`ON`],[3953,3966,`NSM`],[3968,3972,`NSM`],[3974,3975,`NSM`],[3981,3991,`NSM`],[3993,4028,`NSM`],[4038,4038,`NSM`],[4141,4144,`NSM`],[4146,4151,`NSM`],[4153,4154,`NSM`],[4157,4158,`NSM`],[4184,4185,`NSM`],[4190,4192,`NSM`],[4209,4212,`NSM`],[4226,4226,`NSM`],[4229,4230,`NSM`],[4237,4237,`NSM`],[4253,4253,`NSM`],[4957,4959,`NSM`],[5008,5017,`ON`],[5120,5120,`ON`],[5760,5760,`WS`],[5787,5788,`ON`],[5906,5908,`NSM`],[5938,5939,`NSM`],[5970,5971,`NSM`],[6002,6003,`NSM`],[6068,6069,`NSM`],[6071,6077,`NSM`],[6086,6086,`NSM`],[6089,6099,`NSM`],[6107,6107,`ET`],[6109,6109,`NSM`],[6128,6137,`ON`],[6144,6154,`ON`],[6155,6157,`NSM`],[6158,6158,`BN`],[6159,6159,`NSM`],[6277,6278,`NSM`],[6313,6313,`NSM`],[6432,6434,`NSM`],[6439,6440,`NSM`],[6450,6450,`NSM`],[6457,6459,`NSM`],[6464,6464,`ON`],[6468,6469,`ON`],[6622,6655,`ON`],[6679,6680,`NSM`],[6683,6683,`NSM`],[6742,6742,`NSM`],[6744,6750,`NSM`],[6752,6752,`NSM`],[6754,6754,`NSM`],[6757,6764,`NSM`],[6771,6780,`NSM`],[6783,6783,`NSM`],[6832,6877,`NSM`],[6880,6891,`NSM`],[6912,6915,`NSM`],[6964,6964,`NSM`],[6966,6970,`NSM`],[6972,6972,`NSM`],[6978,6978,`NSM`],[7019,7027,`NSM`],[7040,7041,`NSM`],[7074,7077,`NSM`],[7080,7081,`NSM`],[7083,7085,`NSM`],[7142,7142,`NSM`],[7144,7145,`NSM`],[7149,7149,`NSM`],[7151,7153,`NSM`],[7212,7219,`NSM`],[7222,7223,`NSM`],[7376,7378,`NSM`],[7380,7392,`NSM`],[7394,7400,`NSM`],[7405,7405,`NSM`],[7412,7412,`NSM`],[7416,7417,`NSM`],[7616,7679,`NSM`],[8125,8125,`ON`],[8127,8129,`ON`],[8141,8143,`ON`],[8157,8159,`ON`],[8173,8175,`ON`],[8189,8190,`ON`],[8192,8202,`WS`],[8203,8205,`BN`],[8207,8207,`R`],[8208,8231,`ON`],[8232,8232,`WS`],[8233,8233,`B`],[8234,8238,`BN`],[8239,8239,`CS`],[8240,8244,`ET`],[8245,8259,`ON`],[8260,8260,`CS`],[8261,8286,`ON`],[8287,8287,`WS`],[8288,8303,`BN`],[8304,8304,`EN`],[8308,8313,`EN`],[8314,8315,`ES`],[8316,8318,`ON`],[8320,8329,`EN`],[8330,8331,`ES`],[8332,8334,`ON`],[8352,8399,`ET`],[8400,8432,`NSM`],[8448,8449,`ON`],[8451,8454,`ON`],[8456,8457,`ON`],[8468,8468,`ON`],[8470,8472,`ON`],[8478,8483,`ON`],[8485,8485,`ON`],[8487,8487,`ON`],[8489,8489,`ON`],[8494,8494,`ET`],[8506,8507,`ON`],[8512,8516,`ON`],[8522,8525,`ON`],[8528,8543,`ON`],[8585,8587,`ON`],[8592,8721,`ON`],[8722,8722,`ES`],[8723,8723,`ET`],[8724,9013,`ON`],[9083,9108,`ON`],[9110,9257,`ON`],[9280,9290,`ON`],[9312,9351,`ON`],[9352,9371,`EN`],[9450,9899,`ON`],[9901,10239,`ON`],[10496,11123,`ON`],[11126,11263,`ON`],[11493,11498,`ON`],[11503,11505,`NSM`],[11513,11519,`ON`],[11647,11647,`NSM`],[11744,11775,`NSM`],[11776,11869,`ON`],[11904,11929,`ON`],[11931,12019,`ON`],[12032,12245,`ON`],[12272,12287,`ON`],[12288,12288,`WS`],[12289,12292,`ON`],[12296,12320,`ON`],[12330,12333,`NSM`],[12336,12336,`ON`],[12342,12343,`ON`],[12349,12351,`ON`],[12441,12442,`NSM`],[12443,12444,`ON`],[12448,12448,`ON`],[12539,12539,`ON`],[12736,12773,`ON`],[12783,12783,`ON`],[12829,12830,`ON`],[12880,12895,`ON`],[12924,12926,`ON`],[12977,12991,`ON`],[13004,13007,`ON`],[13175,13178,`ON`],[13278,13279,`ON`],[13311,13311,`ON`],[19904,19967,`ON`],[42128,42182,`ON`],[42509,42511,`ON`],[42607,42610,`NSM`],[42611,42611,`ON`],[42612,42621,`NSM`],[42622,42623,`ON`],[42654,42655,`NSM`],[42736,42737,`NSM`],[42752,42785,`ON`],[42888,42888,`ON`],[43010,43010,`NSM`],[43014,43014,`NSM`],[43019,43019,`NSM`],[43045,43046,`NSM`],[43048,43051,`ON`],[43052,43052,`NSM`],[43064,43065,`ET`],[43124,43127,`ON`],[43204,43205,`NSM`],[43232,43249,`NSM`],[43263,43263,`NSM`],[43302,43309,`NSM`],[43335,43345,`NSM`],[43392,43394,`NSM`],[43443,43443,`NSM`],[43446,43449,`NSM`],[43452,43453,`NSM`],[43493,43493,`NSM`],[43561,43566,`NSM`],[43569,43570,`NSM`],[43573,43574,`NSM`],[43587,43587,`NSM`],[43596,43596,`NSM`],[43644,43644,`NSM`],[43696,43696,`NSM`],[43698,43700,`NSM`],[43703,43704,`NSM`],[43710,43711,`NSM`],[43713,43713,`NSM`],[43756,43757,`NSM`],[43766,43766,`NSM`],[43882,43883,`ON`],[44005,44005,`NSM`],[44008,44008,`NSM`],[44013,44013,`NSM`],[64285,64285,`R`],[64286,64286,`NSM`],[64287,64296,`R`],[64297,64297,`ES`],[64298,64335,`R`],[64336,64450,`AL`],[64451,64466,`ON`],[64467,64829,`AL`],[64830,64847,`ON`],[64848,64911,`AL`],[64912,64913,`ON`],[64914,64967,`AL`],[64968,64975,`ON`],[64976,65007,`BN`],[65008,65020,`AL`],[65021,65023,`ON`],[65024,65039,`NSM`],[65040,65049,`ON`],[65056,65071,`NSM`],[65072,65103,`ON`],[65104,65104,`CS`],[65105,65105,`ON`],[65106,65106,`CS`],[65108,65108,`ON`],[65109,65109,`CS`],[65110,65118,`ON`],[65119,65119,`ET`],[65120,65121,`ON`],[65122,65123,`ES`],[65124,65126,`ON`],[65128,65128,`ON`],[65129,65130,`ET`],[65131,65131,`ON`],[65136,65278,`AL`],[65279,65279,`BN`],[65281,65282,`ON`],[65283,65285,`ET`],[65286,65290,`ON`],[65291,65291,`ES`],[65292,65292,`CS`],[65293,65293,`ES`],[65294,65295,`CS`],[65296,65305,`EN`],[65306,65306,`CS`],[65307,65312,`ON`],[65339,65344,`ON`],[65371,65381,`ON`],[65504,65505,`ET`],[65506,65508,`ON`],[65509,65510,`ET`],[65512,65518,`ON`],[65520,65528,`BN`],[65529,65533,`ON`],[65534,65535,`BN`],[65793,65793,`ON`],[65856,65932,`ON`],[65936,65948,`ON`],[65952,65952,`ON`],[66045,66045,`NSM`],[66272,66272,`NSM`],[66273,66299,`EN`],[66422,66426,`NSM`],[67584,67870,`R`],[67871,67871,`ON`],[67872,68096,`R`],[68097,68099,`NSM`],[68100,68100,`R`],[68101,68102,`NSM`],[68103,68107,`R`],[68108,68111,`NSM`],[68112,68151,`R`],[68152,68154,`NSM`],[68155,68158,`R`],[68159,68159,`NSM`],[68160,68324,`R`],[68325,68326,`NSM`],[68327,68408,`R`],[68409,68415,`ON`],[68416,68863,`R`],[68864,68899,`AL`],[68900,68903,`NSM`],[68904,68911,`AL`],[68912,68921,`AN`],[68922,68927,`AL`],[68928,68937,`AN`],[68938,68968,`R`],[68969,68973,`NSM`],[68974,68974,`ON`],[68975,69215,`R`],[69216,69246,`AN`],[69247,69290,`R`],[69291,69292,`NSM`],[69293,69311,`R`],[69312,69327,`AL`],[69328,69336,`ON`],[69337,69369,`AL`],[69370,69375,`NSM`],[69376,69423,`R`],[69424,69445,`AL`],[69446,69456,`NSM`],[69457,69487,`AL`],[69488,69505,`R`],[69506,69509,`NSM`],[69510,69631,`R`],[69633,69633,`NSM`],[69688,69702,`NSM`],[69714,69733,`ON`],[69744,69744,`NSM`],[69747,69748,`NSM`],[69759,69761,`NSM`],[69811,69814,`NSM`],[69817,69818,`NSM`],[69826,69826,`NSM`],[69888,69890,`NSM`],[69927,69931,`NSM`],[69933,69940,`NSM`],[70003,70003,`NSM`],[70016,70017,`NSM`],[70070,70078,`NSM`],[70089,70092,`NSM`],[70095,70095,`NSM`],[70191,70193,`NSM`],[70196,70196,`NSM`],[70198,70199,`NSM`],[70206,70206,`NSM`],[70209,70209,`NSM`],[70367,70367,`NSM`],[70371,70378,`NSM`],[70400,70401,`NSM`],[70459,70460,`NSM`],[70464,70464,`NSM`],[70502,70508,`NSM`],[70512,70516,`NSM`],[70587,70592,`NSM`],[70606,70606,`NSM`],[70608,70608,`NSM`],[70610,70610,`NSM`],[70625,70626,`NSM`],[70712,70719,`NSM`],[70722,70724,`NSM`],[70726,70726,`NSM`],[70750,70750,`NSM`],[70835,70840,`NSM`],[70842,70842,`NSM`],[70847,70848,`NSM`],[70850,70851,`NSM`],[71090,71093,`NSM`],[71100,71101,`NSM`],[71103,71104,`NSM`],[71132,71133,`NSM`],[71219,71226,`NSM`],[71229,71229,`NSM`],[71231,71232,`NSM`],[71264,71276,`ON`],[71339,71339,`NSM`],[71341,71341,`NSM`],[71344,71349,`NSM`],[71351,71351,`NSM`],[71453,71453,`NSM`],[71455,71455,`NSM`],[71458,71461,`NSM`],[71463,71467,`NSM`],[71727,71735,`NSM`],[71737,71738,`NSM`],[71995,71996,`NSM`],[71998,71998,`NSM`],[72003,72003,`NSM`],[72148,72151,`NSM`],[72154,72155,`NSM`],[72160,72160,`NSM`],[72193,72198,`NSM`],[72201,72202,`NSM`],[72243,72248,`NSM`],[72251,72254,`NSM`],[72263,72263,`NSM`],[72273,72278,`NSM`],[72281,72283,`NSM`],[72330,72342,`NSM`],[72344,72345,`NSM`],[72544,72544,`NSM`],[72546,72548,`NSM`],[72550,72550,`NSM`],[72752,72758,`NSM`],[72760,72765,`NSM`],[72850,72871,`NSM`],[72874,72880,`NSM`],[72882,72883,`NSM`],[72885,72886,`NSM`],[73009,73014,`NSM`],[73018,73018,`NSM`],[73020,73021,`NSM`],[73023,73029,`NSM`],[73031,73031,`NSM`],[73104,73105,`NSM`],[73109,73109,`NSM`],[73111,73111,`NSM`],[73459,73460,`NSM`],[73472,73473,`NSM`],[73526,73530,`NSM`],[73536,73536,`NSM`],[73538,73538,`NSM`],[73562,73562,`NSM`],[73685,73692,`ON`],[73693,73696,`ET`],[73697,73713,`ON`],[78912,78912,`NSM`],[78919,78933,`NSM`],[90398,90409,`NSM`],[90413,90415,`NSM`],[92912,92916,`NSM`],[92976,92982,`NSM`],[94031,94031,`NSM`],[94095,94098,`NSM`],[94178,94178,`ON`],[94180,94180,`NSM`],[113821,113822,`NSM`],[113824,113827,`BN`],[117760,117973,`ON`],[118e3,118009,`EN`],[118010,118012,`ON`],[118016,118451,`ON`],[118458,118480,`ON`],[118496,118512,`ON`],[118528,118573,`NSM`],[118576,118598,`NSM`],[119143,119145,`NSM`],[119155,119162,`BN`],[119163,119170,`NSM`],[119173,119179,`NSM`],[119210,119213,`NSM`],[119273,119274,`ON`],[119296,119361,`ON`],[119362,119364,`NSM`],[119365,119365,`ON`],[119552,119638,`ON`],[120513,120513,`ON`],[120539,120539,`ON`],[120571,120571,`ON`],[120597,120597,`ON`],[120629,120629,`ON`],[120655,120655,`ON`],[120687,120687,`ON`],[120713,120713,`ON`],[120745,120745,`ON`],[120771,120771,`ON`],[120782,120831,`EN`],[121344,121398,`NSM`],[121403,121452,`NSM`],[121461,121461,`NSM`],[121476,121476,`NSM`],[121499,121503,`NSM`],[121505,121519,`NSM`],[122880,122886,`NSM`],[122888,122904,`NSM`],[122907,122913,`NSM`],[122915,122916,`NSM`],[122918,122922,`NSM`],[123023,123023,`NSM`],[123184,123190,`NSM`],[123566,123566,`NSM`],[123628,123631,`NSM`],[123647,123647,`ET`],[124140,124143,`NSM`],[124398,124399,`NSM`],[124643,124643,`NSM`],[124646,124646,`NSM`],[124654,124655,`NSM`],[124661,124661,`NSM`],[124928,125135,`R`],[125136,125142,`NSM`],[125143,125251,`R`],[125252,125258,`NSM`],[125259,126063,`R`],[126064,126143,`AL`],[126144,126207,`R`],[126208,126287,`AL`],[126288,126463,`R`],[126464,126703,`AL`],[126704,126705,`ON`],[126706,126719,`AL`],[126720,126975,`R`],[126976,127019,`ON`],[127024,127123,`ON`],[127136,127150,`ON`],[127153,127167,`ON`],[127169,127183,`ON`],[127185,127221,`ON`],[127232,127242,`EN`],[127243,127247,`ON`],[127279,127279,`ON`],[127338,127343,`ON`],[127405,127405,`ON`],[127584,127589,`ON`],[127744,128728,`ON`],[128732,128748,`ON`],[128752,128764,`ON`],[128768,128985,`ON`],[128992,129003,`ON`],[129008,129008,`ON`],[129024,129035,`ON`],[129040,129095,`ON`],[129104,129113,`ON`],[129120,129159,`ON`],[129168,129197,`ON`],[129200,129211,`ON`],[129216,129217,`ON`],[129232,129240,`ON`],[129280,129623,`ON`],[129632,129645,`ON`],[129648,129660,`ON`],[129664,129674,`ON`],[129678,129734,`ON`],[129736,129736,`ON`],[129741,129756,`ON`],[129759,129770,`ON`],[129775,129784,`ON`],[129792,129938,`ON`],[129940,130031,`ON`],[130032,130041,`EN`],[130042,130042,`ON`],[131070,131071,`BN`],[196606,196607,`BN`],[262142,262143,`BN`],[327678,327679,`BN`],[393214,393215,`BN`],[458750,458751,`BN`],[524286,524287,`BN`],[589822,589823,`BN`],[655358,655359,`BN`],[720894,720895,`BN`],[786430,786431,`BN`],[851966,851967,`BN`],[917502,917759,`BN`],[917760,917999,`NSM`],[918e3,921599,`BN`],[983038,983039,`BN`],[1048574,1048575,`BN`],[1114110,1114111,`BN`]];function Pc(e){if(e<=255)return Mc[e];let t=0,n=Nc.length-1;for(;t<=n;){let r=t+n>>1,i=Nc[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return`L`}function Fc(e){let t=e.length;if(t===0)return null;let n=Array(t),r=!1;for(let i=0;i<t;){let a=e.charCodeAt(i),o=a,s=1;if(a>=55296&&a<=56319&&i+1<t){let t=e.charCodeAt(i+1);t>=56320&&t<=57343&&(o=(a-55296<<10)+(t-56320)+65536,s=2)}let c=Pc(o);(c===`R`||c===`AL`||c===`AN`)&&(r=!0);for(let e=0;e<s;e++)n[i+e]=c;i+=s}if(!r)return null;let i=0;for(let e=0;e<t;e++){let t=n[e];if(t===`L`){i=0;break}if(t===`R`||t===`AL`){i=1;break}}let a=new Int8Array(t);for(let e=0;e<t;e++)a[e]=i;let o=i&1?`R`:`L`,s=o,c=s;for(let e=0;e<t;e++)n[e]===`NSM`?n[e]=c:c=n[e];c=s;for(let e=0;e<t;e++){let t=n[e];t===`EN`?n[e]=c===`AL`?`AN`:`EN`:(t===`R`||t===`L`||t===`AL`)&&(c=t)}for(let e=0;e<t;e++)n[e]===`AL`&&(n[e]=`R`);for(let e=1;e<t-1;e++)n[e]===`ES`&&n[e-1]===`EN`&&n[e+1]===`EN`&&(n[e]=`EN`),n[e]===`CS`&&(n[e-1]===`EN`||n[e-1]===`AN`)&&n[e+1]===n[e-1]&&(n[e]=n[e-1]);for(let e=0;e<t;e++){if(n[e]!==`EN`)continue;let r;for(r=e-1;r>=0&&n[r]===`ET`;r--)n[r]=`EN`;for(r=e+1;r<t&&n[r]===`ET`;r++)n[r]=`EN`}for(let e=0;e<t;e++){let t=n[e];(t===`WS`||t===`ES`||t===`ET`||t===`CS`)&&(n[e]=`ON`)}c=s;for(let e=0;e<t;e++){let t=n[e];t===`EN`?n[e]=c===`L`?`L`:`EN`:(t===`R`||t===`L`)&&(c=t)}for(let e=0;e<t;e++){if(n[e]!==`ON`)continue;let r=e+1;for(;r<t&&n[r]===`ON`;)r++;let i=e>0?n[e-1]:s,a=r<t?n[r]:s,o=i===`L`?`L`:`R`;if(o===(a===`L`?`L`:`R`))for(let t=e;t<r;t++)n[t]=o;e=r-1}for(let e=0;e<t;e++)n[e]===`ON`&&(n[e]=o);for(let e=0;e<t;e++){let t=n[e];a[e]&1?(t===`L`||t===`AN`||t===`EN`)&&a[e]++:t===`R`?a[e]++:(t===`AN`||t===`EN`)&&(a[e]+=2)}return a}function Ic(e,t){let n=Fc(e);if(n===null)return null;let r=new Int8Array(t.length);for(let e=0;e<t.length;e++)r[e]=n[t[e]];return r}var Lc=/[ \t\n\r\f]+/g,Rc=/[\t\n\r\f]| {2,}|^ | $/;function zc(e){let t=e??`normal`;return t===`pre-wrap`?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Bc(e){if(!Rc.test(e))return e;let t=e.replace(Lc,` `);return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Vc(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
596
+ `}),(0,y.jsxs)(`div`,{className:`repo-open-stack`,children:[ie.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-agents-card`,children:[(0,y.jsx)(`div`,{className:`repo-open-agents-brand`,children:(0,y.jsx)(`img`,{className:`repo-open-agents-logo`,src:`/press-kit/ingit-icon-mark-light.svg`,alt:`ingit`})}),(0,y.jsx)(`div`,{className:`repo-open-agents-title`,children:`Running agent sessions`}),(0,y.jsx)(`div`,{className:`repo-open-agents-grid`,children:ie.map(t=>(0,y.jsxs)(`div`,{className:`repo-open-list-button repo-open-claude-row`,children:[(0,y.jsxs)(`span`,{className:`repo-open-list-name repo-open-agent-name`,children:[[...new Set(t.sessions.map(e=>e.agent))].map(e=>(0,y.jsx)(_i,{agent:e,size:15,busy:t.sessions.some(t=>t.agent===e&&t.busy)},e)),yi(t.cwd)]}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t.cwd}),(0,y.jsx)(`span`,{className:`repo-open-claude-chips`,children:t.sessions.map(e=>(0,y.jsx)(`button`,{type:`button`,className:`repo-open-claude-chip${e.busy?` repo-open-claude-chip-busy`:``}`,disabled:!e.focusable||o!==null,title:e.focusable?`Focus this session's window — ${pi(e)} (pid ${e.pid})`:`${pi(e)} (pid ${e.pid}) — window focus unavailable for this session`,onClick:()=>void s(e),children:o===e.pid?`focusing…`:`${e.title??`${e.agent===`codex`?`codex `:``}${pi(e)}`}${e.count>1?` ×${e.count}`:``}`},`${e.pid}:${e.cwd}`))}),(0,y.jsx)(`button`,{type:`button`,className:`repo-open-row-action repo-open-claude-open`,onClick:()=>e(t.cwd),children:`Open`})]},t.cwd))})]}),(0,y.jsxs)(`div`,{className:`repo-open-shell`,children:[(0,y.jsxs)(`div`,{className:`repo-open-header`,children:[(0,y.jsx)(`h1`,{className:`repo-open-title`,children:`Open repository`}),(0,y.jsxs)(`form`,{onSubmit:ee,className:`repo-open-form`,children:[(0,y.jsxs)(`div`,{className:`repo-open-input-wrap`,children:[(0,y.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),onFocus:()=>{h(!0),S.length>0&&_(!0)},onBlur:()=>{h(!1),_(!1)},onKeyDown:te,placeholder:`/home/user/my-project`,className:`repo-open-input`,autoComplete:`off`,role:`combobox`,"aria-expanded":se,"aria-controls":`repo-open-path-suggestions`,"aria-autocomplete":`list`}),se&&(0,y.jsx)(`div`,{id:`repo-open-path-suggestions`,className:`repo-open-path-suggestions`,role:`listbox`,children:v&&S.length===0?(0,y.jsx)(`div`,{className:`repo-open-path-suggestions-loading`,children:`Loading...`}):S.map((e,t)=>(0,y.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===w,className:`repo-open-path-suggestion${t===w?` repo-open-path-suggestion-active`:``}`,onMouseEnter:()=>T(t),onMouseDown:t=>{t.preventDefault(),D(e)},children:[(0,y.jsxs)(`span`,{className:`repo-open-path-suggestion-main`,children:[(0,y.jsx)(`span`,{className:`repo-open-path-suggestion-name`,children:e.name}),(0,y.jsx)(`span`,{className:`repo-open-path-suggestion-path`,children:e.path})]}),e.isGitRepo&&(0,y.jsx)(`span`,{className:`repo-open-repo-badge`,children:`repo`})]},e.path))})]}),(0,y.jsx)(`button`,{type:`submit`,disabled:!c.trim(),className:`repo-open-button`,children:`Open`})]})]}),(0,y.jsxs)(`div`,{className:`repo-open-body`,children:[(0,y.jsxs)(`section`,{className:`repo-open-explorer`,"aria-label":`Folder tree`,children:[(0,y.jsxs)(`div`,{className:`repo-open-explorer-head`,children:[(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-nav`,disabled:!ae?.parentPath,onClick:()=>{ae?.parentPath&&E(ae.parentPath,{makeRoot:!0})},title:`Parent folder`,"aria-label":`Parent folder`,children:`..`}),(0,y.jsx)(`div`,{className:`repo-open-root-path`,children:ae?Si(ae.path).map((e,t,n)=>(0,y.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,minWidth:0},children:[t>0&&!/^(\/|[A-Za-z]:[\\/])$/.test(n[t-1].label)&&(0,y.jsx)(`span`,{className:`repo-open-root-separator`,children:`/`}),(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-crumb`,onClick:()=>void E(e.path,{makeRoot:!0}),title:e.path,children:e.label})]},e.path)):`Loading...`}),ae?.isGitRepo&&(0,y.jsx)(`button`,{type:`button`,className:`repo-open-root-action`,onClick:()=>e(ae.path),children:`Open`})]}),(0,y.jsxs)(`div`,{className:`repo-open-tree`,children:[oe&&(0,y.jsx)(`div`,{className:`repo-open-tree-empty`,style:{paddingLeft:16},children:`Loading...`}),u&&!oe&&re(u,0)]})]}),(0,y.jsxs)(`aside`,{className:`repo-open-side`,children:[t&&(0,y.jsx)(`p`,{className:`repo-open-error`,children:t}),n.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-section`,children:[(0,y.jsx)(`div`,{className:`repo-open-section-title`,children:`Recent repositories`}),(0,y.jsx)(`div`,{className:`repo-open-list`,children:n.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`repo-open-list-button`,children:[(0,y.jsx)(`span`,{className:`repo-open-list-name`,children:yi(t)}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t})]},t))})]}),i.length>0&&(0,y.jsxs)(`section`,{className:`repo-open-section`,children:[(0,y.jsx)(`div`,{className:`repo-open-section-title`,children:`Repositories`}),r&&(0,y.jsx)(`div`,{className:`repo-open-folder-caption`,children:r}),(0,y.jsx)(`div`,{className:`repo-open-list`,children:i.map(t=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`repo-open-list-button`,children:[(0,y.jsx)(`span`,{className:`repo-open-list-name`,children:yi(t)}),(0,y.jsx)(`span`,{className:`repo-open-list-path`,children:t})]},t))})]})]})]})]}),(0,y.jsxs)(`div`,{className:`repo-open-version`,children:[`v`,`0.2.1`]})]})]})}var wi={head:`Branches`,remote:`Remotes`,tag:`Tags`},Ti=[`head`,`remote`,`tag`];function Ei({refs:e,stashes:t,onSelectRef:n,onSelectStash:r,onSelectStashParent:i,selectedStashSha:a,selectedSha:o,onClose:s,onOpenSettings:c,settingsOpen:l=!1}){let[u,d]=(0,b.useState)({head:!0,remote:!0,tag:!0}),[f,p]=(0,b.useState)(``),[m,h]=(0,b.useState)(!1),g=f.toLowerCase(),_={head:[],remote:[],tag:[]};for(let t of e)g&&!t.shortName.toLowerCase().includes(g)||_[t.kind].push(t);function v(e){d(t=>({...t,[e]:!t[e]}))}return(0,y.jsxs)(`div`,{style:{width:250,flexShrink:0,height:`100%`,background:`#181825`,borderRight:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflowY:`auto`,userSelect:`none`},children:[(0,y.jsxs)(`div`,{style:{padding:`8px 14px`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,color:`#6c7086`,textTransform:`uppercase`,borderBottom:`1px solid #313244`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[`Refs`,(0,y.jsx)(`button`,{onClick:s,title:`Hide refs`,style:{background:`none`,border:`none`,color:`#6c7086`,cursor:`pointer`,fontSize:14,padding:`0 2px`,lineHeight:1},children:`✕`})]}),(0,y.jsx)(`div`,{style:{padding:`6px 10px`,borderBottom:`1px solid #313244`},children:(0,y.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`Filter branches...`,style:{width:`100%`,background:`#1e1e2e`,border:`1px solid #45475a`,borderRadius:4,color:`#cdd6f4`,fontSize:12,padding:`5px 8px`,outline:`none`,fontFamily:`inherit`},onFocus:e=>{e.currentTarget.style.borderColor=`#89b4fa`},onBlur:e=>{e.currentTarget.style.borderColor=`#45475a`}})}),(0,y.jsxs)(`div`,{style:{margin:`8px 10px 4px`,border:`1px solid #704752`,borderRadius:7,background:`#55323c`,overflow:`hidden`,flexShrink:0},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`stretch`},children:(0,y.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-expanded":m,style:{flex:1,minWidth:0,display:`flex`,alignItems:`center`,gap:7,padding:`7px 9px`,border:`none`,background:`transparent`,color:`#f5e0dc`,fontFamily:`inherit`,fontSize:12,fontWeight:700,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,transform:m?`rotate(90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,color:`#d7a6b2`,fontSize:9},children:`▶`}),`Stashes`,(0,y.jsx)(`span`,{style:{marginLeft:`auto`,minWidth:16,padding:`1px 5px`,borderRadius:8,background:`#311f25aa`,color:`#d7a6b2`,fontSize:10,fontWeight:600,textAlign:`center`},children:t.length})]})}),m&&(0,y.jsx)(`div`,{style:{borderTop:`1px solid #704752`},children:t.length===0?(0,y.jsx)(`div`,{style:{padding:`9px 10px 5px`,color:`#c4939f`,fontSize:11},children:`No stashed changes`}):(0,y.jsx)(`div`,{children:t.map(e=>{let t=Di(e.message);return(0,y.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":a===e.sha,onClick:()=>r(e.sha),onKeyDown:t=>{t.target===t.currentTarget&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e.sha))},style:{padding:`8px 9px`,borderBottom:`1px solid #704752`,display:`flex`,flexDirection:`column`,gap:5,background:a===e.sha?`#f5c2e71a`:`transparent`,boxShadow:a===e.sha?`inset 3px 0 #f5c2e7`:`none`,cursor:`pointer`},children:[(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:7},children:(0,y.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,y.jsx)(`div`,{title:e.message,style:{color:`#f5e0dc`,fontSize:11,fontWeight:650,lineHeight:1.35,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.message||e.selector}),(0,y.jsxs)(`div`,{style:{marginTop:2,color:`#c4939f`,fontSize:9.5},children:[e.selector,t.context?` · ${t.context}`:``,` · `,Oi(e.createdAt)]})]})}),(0,y.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),i(e.parentSha)},title:`Go to ${e.parentSha}`,style:{alignSelf:`flex-start`,padding:0,border:`none`,background:`none`,color:`#89b4fa`,fontFamily:`monospace`,fontSize:10,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:2},children:[`parent `,e.parentSha.slice(0,8)]})]},e.sha)})})})]}),Ti.map(e=>{let t=_[e];if(t.length===0)return null;let r=f?!1:u[e];return(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{onClick:()=>v(e),style:{width:`100%`,display:`flex`,alignItems:`center`,gap:6,padding:`6px 14px`,background:`none`,border:`none`,color:`#a6adc8`,fontSize:12,fontWeight:600,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,transform:r?`rotate(-90deg)`:`rotate(0deg)`,transition:`transform 0.15s`,fontSize:10,lineHeight:1},children:`▼`}),wi[e],(0,y.jsx)(`span`,{style:{marginLeft:`auto`,background:`#313244`,borderRadius:8,padding:`1px 6px`,fontSize:10,color:`#6c7086`,fontWeight:500},children:t.length})]}),!r&&(0,y.jsx)(`div`,{children:t.map(e=>{let t=e.targetSha===o;return(0,y.jsxs)(`button`,{onClick:()=>n(e),title:e.name,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`5px 14px 5px 28px`,background:t?`#313244`:`none`,border:`none`,color:t?`#89b4fa`:`#cdd6f4`,fontSize:13,fontWeight:e.isCurrent?700:`normal`,cursor:`pointer`,textAlign:`left`,fontFamily:`inherit`,overflow:`hidden`},children:[(0,y.jsx)(ki,{kind:e.kind,isCurrent:e.isCurrent}),(0,y.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.shortName}),(e.ahead!=null||e.behind!=null)&&(0,y.jsxs)(`span`,{style:{display:`flex`,gap:4,flexShrink:0,fontSize:11},children:[e.ahead!=null&&e.ahead>0&&(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`↑`,e.ahead]}),e.behind!=null&&e.behind>0&&(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`↓`,e.behind]})]})]},e.name)})})]},e)}),(0,y.jsx)(`div`,{style:{marginTop:`auto`,padding:`10px`,borderTop:`1px solid #313244`},children:(0,y.jsxs)(`button`,{type:`button`,onClick:c,title:`Open settings`,"aria-label":`Open settings`,style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`7px 10px`,borderRadius:5,border:`1px solid #313244`,background:l?`#89b4fa20`:`transparent`,color:l?`#89b4fa`:`#a6adc8`,fontSize:12,fontWeight:600,fontFamily:`inherit`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{color:l?`#89b4fa`:`#6c7086`},children:`⚙`}),`Settings`]})})]})}function Di(e){let t=/^(?:WIP )?on ([^:]+):\s*(.*)$/i.exec(e);return t?{message:t[2]??e,context:`on ${t[1]}`}:{message:e,context:``}}function Oi(e){return new Date(e*1e3).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function ki({kind:e,isCurrent:t}){let n={flexShrink:0,fontSize:11,width:14,textAlign:`center`};return e===`head`?(0,y.jsx)(`span`,{style:{...n,color:t?`#a6e3a1`:`#89b4fa`},children:t?`●`:`⎇`}):e===`remote`?(0,y.jsx)(`span`,{style:{...n,color:`#94e2d5`},children:`◉`}):(0,y.jsx)(`span`,{style:{...n,color:`#f9e2af`},children:`◆`})}var Ai=g(),ji=Object.defineProperty,Mi=(e,t)=>{let n={};for(var r in e)ji(n,r,{get:e[r],enumerable:!0});return t||ji(n,Symbol.toStringTag,{value:`Module`}),n},Ni=Ji(),z=e=>Ui(e,Ni),B=Ji();z.write=e=>Ui(e,B);var Pi=Ji();z.onStart=e=>Ui(e,Pi);var Fi=Ji();z.onFrame=e=>Ui(e,Fi);var Ii=Ji();z.onFinish=e=>Ui(e,Ii);var Li=[];z.setTimeout=(e,t)=>{let n=z.now()+t,r=()=>{let e=Li.findIndex(e=>e.cancel==r);~e&&Li.splice(e,1),Vi-=+!!~e},i={time:n,handler:e,cancel:r};return Li.splice(Ri(n),0,i),Vi+=1,Wi(),i};var Ri=e=>~(~Li.findIndex(t=>t.time>e)||~Li.length);z.cancel=e=>{Pi.delete(e),Fi.delete(e),Ii.delete(e),Ni.delete(e),B.delete(e)},z.sync=e=>{Hi=!0,z.batchedUpdates(e),Hi=!1},z.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,z.onStart(n)}return r.handler=e,r.cancel=()=>{Pi.delete(n),t=null},r};var zi=typeof window<`u`?window.requestAnimationFrame:()=>{};z.use=e=>zi=e,z.now=typeof performance<`u`?()=>performance.now():Date.now,z.batchedUpdates=e=>e(),z.catch=console.error,z.frameLoop=`always`,z.onDemand=()=>{},z.advance=()=>{z.frameLoop===`demand`?qi():console.warn(`Cannot call the manual advancement of rafz whilst frameLoop is not set as demand`)};var Bi=-1,Vi=0,Hi=!1;function Ui(e,t){Hi?(t.delete(e),e(0)):(t.add(e),Wi(),z.frameLoop===`demand`&&z.onDemand())}function Wi(){Bi<0&&(Bi=0,z.frameLoop!==`demand`&&zi(Ki))}function Gi(){Bi=-1}function Ki(){~Bi&&(zi(Ki),z.batchedUpdates(qi))}function qi(){let e=Bi;Bi=z.now();let t=Ri(Bi);if(t&&(Yi(Li.splice(0,t),e=>e.handler()),Vi-=t),!Vi){Gi();return}Pi.flush(),Ni.flush(e?Math.min(64,Bi-e):16.667),Fi.flush(),B.flush(),Ii.flush(),z.frameLoop===`demand`&&Vi>0&&z.onDemand()}function Ji(){let e=new Set,t=e;return{add(n){Vi+=+(t==e&&!e.has(n)),e.add(n)},delete(n){return Vi-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Vi-=t.size,Yi(t,t=>t(n)&&e.add(t)),Vi+=e.size,t=e)}}}function Yi(e,t){e.forEach(e=>{try{t(e)}catch(e){z.catch(e)}})}function Xi(){}var Zi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),V={arr:Array.isArray,obj:e=>!!e&&e.constructor.name===`Object`,fun:(e=>typeof e==`function`),str:e=>typeof e==`string`,num:e=>typeof e==`number`,und:e=>e===void 0};function Qi(e,t){if(V.arr(e)){if(!V.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var H=(e,t)=>e.forEach(t);function $i(e,t,n){if(V.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var ea=e=>V.und(e)?[]:V.arr(e)?e:[e];function ta(e,t){if(e.size){let n=Array.from(e);e.clear(),H(n,t)}}var na=(e,...t)=>ta(e,e=>e(...t)),ra=()=>typeof window>`u`||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ia=Mi({assign:()=>ua,colors:()=>sa,createStringInterpolator:()=>aa,skipAnimation:()=>ca,to:()=>oa,willAdvance:()=>la}),aa,oa,sa=null,ca=!1,la=Xi,ua=e=>{e.to&&(oa=e.to),e.now&&(z.now=e.now),e.colors!==void 0&&(sa=e.colors),e.skipAnimation!=null&&(ca=e.skipAnimation),e.createStringInterpolator&&(aa=e.createStringInterpolator),e.requestAnimationFrame&&z.use(e.requestAnimationFrame),e.batchedUpdates&&(z.batchedUpdates=e.batchedUpdates),e.willAdvance&&(la=e.willAdvance),e.frameLoop&&(z.frameLoop=e.frameLoop),e.onDemand&&(z.onDemand=e.onDemand)},da=new Set,fa=[],pa=[],ma=0,ha={get idle(){return!da.size&&!fa.length},start(e){ma>e.priority?(da.add(e),z.onStart(ga)):(_a(e),z(ya))},advance:ya,sort(e){if(ma)z.onFrame(()=>ha.sort(e));else{let t=fa.indexOf(e);~t&&(fa.splice(t,1),va(e))}},clear(){fa=[],da.clear()}};function ga(){da.forEach(_a),da.clear(),z(ya)}function _a(e){fa.includes(e)||va(e)}function va(e){fa.splice(ba(fa,t=>t.priority>e.priority),0,e)}function ya(e){let t=pa;for(let n=0;n<fa.length;n++){let r=fa[n];ma=r.priority,r.idle||(la(r),r.advance(e),r.idle||t.push(r))}return ma=0,pa=fa,pa.length=0,fa=t,fa.length>0}function ba(e,t){let n=e.findIndex(t);return n<0?e.length:n}var xa=(e,t,n)=>Math.min(Math.max(n,e),t),Sa={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ca=`[-+]?\\d*\\.?\\d+`,wa=`[-+]?\\d*\\.?\\d+%`;function Ta(...e){return`\\(\\s*(`+e.join(`)\\s*,\\s*(`)+`)\\s*\\)`}var Ea=RegExp(`rgb`+Ta(Ca,Ca,Ca)),Da=RegExp(`rgba`+Ta(Ca,Ca,Ca,Ca)),Oa=RegExp(`hsl`+Ta(Ca,wa,wa)),ka=RegExp(`hsla`+Ta(Ca,wa,wa,Ca)),Aa=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ja=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ma=/^#([0-9a-fA-F]{6})$/,Na=/^#([0-9a-fA-F]{8})$/;function Pa(e){let t;return typeof e==`number`?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ma.exec(e))?parseInt(t[1]+`ff`,16)>>>0:sa&&sa[e]!==void 0?sa[e]:(t=Ea.exec(e))?(La(t[1])<<24|La(t[2])<<16|La(t[3])<<8|255)>>>0:(t=Da.exec(e))?(La(t[1])<<24|La(t[2])<<16|La(t[3])<<8|za(t[4]))>>>0:(t=Aa.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+`ff`,16)>>>0:(t=Na.exec(e))?parseInt(t[1],16)>>>0:(t=ja.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Oa.exec(e))?(Ia(Ra(t[1]),Ba(t[2]),Ba(t[3]))|255)>>>0:(t=ka.exec(e))?(Ia(Ra(t[1]),Ba(t[2]),Ba(t[3]))|za(t[4]))>>>0:null}function Fa(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ia(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=Fa(i,r,e+1/3),o=Fa(i,r,e),s=Fa(i,r,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function La(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function Ra(e){return(parseFloat(e)%360+360)%360/360}function za(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Ba(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function Va(e){let t=Pa(e);return t===null?e:(t||=0,`rgba(${(t&4278190080)>>>24}, ${(t&16711680)>>>16}, ${(t&65280)>>>8}, ${(t&255)/255})`)}var Ha=(e,t,n)=>{if(V.fun(e))return e;if(V.arr(e))return Ha({range:e,output:t,extrapolate:n});if(V.str(e.output[0]))return aa(e);let r=e,i=r.output,a=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||`extend`,s=r.extrapolateRight||r.extrapolate||`extend`,c=r.easing||(e=>e);return e=>{let t=Wa(e,a);return Ua(e,a[t],a[t+1],i[t],i[t+1],c,o,s,r.map)}};function Ua(e,t,n,r,i,a,o,s,c){let l=c?c(e):e;if(l<t){if(o===`identity`)return l;o===`clamp`&&(l=t)}if(l>n){if(s===`identity`)return l;s===`clamp`&&(l=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t),l=a(l),r===-1/0?l=-l:i===1/0?l+=r:l=l*(i-r)+r,l)}function Wa(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var Ga=(e,t=`end`)=>n=>{n=t===`end`?Math.min(n,.999):Math.max(n,.001);let r=n*e;return xa(0,1,(t===`end`?Math.floor(r):Math.ceil(r))/e)},Ka=1.70158,qa=Ka*1.525,Ja=2.70158,Ya=2*Math.PI/3,Xa=2*Math.PI/4.5,Za=e=>{let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},Qa={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-(-2*e+2)**2/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-(1-e)**4,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-(-2*e+2)**4/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-(1-e)**5,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-(-2*e+2)**5/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:2**(10*e-10),easeOutExpo:e=>e===1?1:1-2**(-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-e**2),easeOutCirc:e=>Math.sqrt(1-(e-1)**2),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2,easeInBack:e=>Ja*e*e*e-Ka*e*e,easeOutBack:e=>1+Ja*(e-1)**3+Ka*(e-1)**2,easeInOutBack:e=>e<.5?(2*e)**2*(3.5949095*2*e-qa)/2:((2*e-2)**2*(3.5949095*(e*2-2)+qa)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*Ya),easeOutElastic:e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*Ya)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*Xa))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*Xa)/2+1,easeInBounce:e=>1-Za(1-e),easeOutBounce:Za,easeInOutBounce:e=>e<.5?(1-Za(1-2*e))/2:(1+Za(2*e-1))/2,steps:Ga},$a=Symbol.for(`FluidValue.get`),eo=Symbol.for(`FluidValue.observers`),to=e=>!!(e&&e[$a]),no=e=>e&&e[$a]?e[$a]():e,ro=e=>e[eo]||null;function io(e,t){e.eventObserved?e.eventObserved(t):e(t)}function ao(e,t){let n=e[eo];n&&n.forEach(e=>{io(e,t)})}var oo=class{constructor(e){if(!e&&!(e=this.get))throw Error(`Unknown getter`);so(this,e)}},so=(e,t)=>U(e,$a,t);function co(e,t){if(e[$a]){let n=e[eo];n||U(e,eo,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function lo(e,t){let n=e[eo];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[eo]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var U=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),W=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,uo=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,fo=RegExp(`(${W.source})(%|[a-z]+)`,`i`),po=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,mo=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ho=e=>{let[t,n]=go(e);if(!t||ra())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith(`--`)?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&mo.test(n)?ho(n):n||e},go=e=>{let t=mo.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},_o,vo=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,yo=e=>e.match(W)??[],bo=e=>{_o||=sa?RegExp(`(${Object.keys(sa).join(`|`)})(?!\\w)`,`g`):/^\b$/;let t=e.output.map(e=>no(e).replace(mo,ho).replace(uo,Va).replace(_o,Va)),n=t.map(e=>yo(e).map(Number)),r=n[0].map((e,t)=>n.map(e=>{if(!(t in e))throw Error(`The arity of each "output" value must be equal`);return e[t]})).map(t=>Ha({...e,output:t})),i=e.range||[0,1],a=t.map(e=>yo(e)),o=a[0].map((e,t)=>{let n=a.map(e=>{let n=e[t],r=n.indexOf(`.`);return r===-1?0:n.length-r-1});return n.every(e=>e===n[0])&&n[0]>0?n[0]:null});return e=>{let n=i.indexOf(e);if(n!==-1)return t[n];let a=!fo.test(t[0])&&t.find(e=>fo.test(e))?.replace(W,``),s=0;return t[0].replace(W,()=>{let t=s++,n=r[t](e),i=o[t];return`${i==null?n:n.toFixed(i)}${a||``}`}).replace(po,vo)}},xo=`react-spring: `,So=e=>{let t=e,n=!1;if(typeof t!=`function`)throw TypeError(`${xo}once requires a function parameter`);return(...e)=>{n||=(t(...e),!0)}},Co=So(console.warn);function wo(){Co(`${xo}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var To=So(console.warn);function Eo(){To(`${xo}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Do(e){return V.str(e)&&(e[0]==`#`||/\d/.test(e)||!ra()&&mo.test(e)||e in(sa||{}))}var Oo=ra()?b.useEffect:b.useLayoutEffect,ko=()=>{let e=(0,b.useRef)(!1);return Oo(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Ao(){let e=(0,b.useState)()[1],t=ko();return()=>{t.current&&e(Math.random())}}var jo=e=>(0,b.useEffect)(e,Mo),Mo=[];function No(e){let t=(0,b.useRef)(void 0);return(0,b.useEffect)(()=>{t.current=e}),t.current}var Po=Symbol.for(`Animated:node`),Fo=e=>!!e&&e[Po]===e,Io=e=>e&&e[Po],Lo=(e,t)=>Zi(e,Po,t),Ro=e=>e&&e[Po]&&e[Po].getPayload(),zo=class{constructor(){Lo(this,this)}getPayload(){return this.payload||[]}},Bo=class e extends zo{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,V.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new e(t)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return V.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,V.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Vo=class e extends Bo{constructor(e){super(0),this._string=null,this._toString=Ha({output:[e,e]})}static create(t){return new e(t)}getValue(){return this._string??=this._toString(this._value)}setValue(e){if(V.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Ha({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ho={dependencies:null},Uo=class extends zo{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return $i(this.source,(n,r)=>{Fo(n)?t[r]=n.getValue(e):to(n)?t[r]=no(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&H(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return $i(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ho.dependencies&&to(e)&&Ho.dependencies.add(e);let t=Ro(e);t&&H(t,e=>this.add(e))}},Wo=class e extends Uo{constructor(e){super(e)}static create(t){return new e(t)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){let t=this.getPayload();return e.length==t.length?t.map((t,n)=>t.setValue(e[n])).some(Boolean):(super.setValue(e.map(Go)),!0)}};function Go(e){return(Do(e)?Vo:Bo).create(e)}function Ko(e){let t=Io(e);return t?t.constructor:V.arr(e)?Wo:Do(e)?Vo:Bo}var qo=(e,t)=>{let n=!V.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,b.forwardRef)((r,i)=>{let a=(0,b.useRef)(null),o=n&&(0,b.useCallback)(e=>{a.current=Xo(i,e)},[i]),[s,c]=Yo(r,t),l=Ao(),u=()=>{let e=a.current;n&&!e||(e?t.applyAnimatedValues(e,s.getValue(!0)):!1)===!1&&l()},d=new Jo(u,c),f=(0,b.useRef)(void 0);Oo(()=>(f.current=d,H(c,e=>co(e,d)),()=>{f.current&&(H(f.current.deps,e=>lo(e,f.current)),z.cancel(f.current.update))})),(0,b.useEffect)(u,[]),jo(()=>()=>{let e=f.current;H(e.deps,t=>lo(t,e))});let p=t.getComponentProps(s.getValue());return b.createElement(e,{...p,ref:o})})},Jo=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type==`change`&&z.write(this.update)}};function Yo(e,t){let n=new Set;return Ho.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Uo(e),Ho.dependencies=null,[e,n]}function Xo(e,t){return e&&(V.fun(e)?e(t):e.current=t),t}var Zo=Symbol.for(`AnimatedComponent`),Qo=new WeakMap,$o=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new Uo(e),getComponentProps:r=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},a=e=>{let t=es(e)||`Anonymous`;if(V.str(e))e=a[e]||(a[e]=qo(e,i));else{let t=e[Zo]??Qo.get(e);if(!t){t=qo(e,i);try{e[Zo]=t}catch{}Qo.set(e,t)}e=t}return e.displayName=`Animated(${t})`,e};return $i(e,(t,n)=>{V.arr(e)&&(n=es(t)),a[n]=a(t)}),{animated:a}},es=e=>V.str(e)?e:e&&V.str(e.displayName)?e.displayName:V.fun(e)&&e.name||null;function ts(e,...t){return V.fun(e)?e(...t):e}var ns=(e,t)=>e===!0||!!(t&&e&&(V.fun(e)?e(t):ea(e).includes(t))),rs=(e,t)=>V.obj(e)?t&&e[t]:e,is=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,as=e=>e,os=(e,t=as)=>{let n=ss;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));let r={};for(let i of n){let n=t(e[i],i);V.und(n)||(r[i]=n)}return r},ss=[`config`,`onProps`,`onStart`,`onChange`,`onPause`,`onResume`,`onRest`],cs={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function ls(e){let t={},n=0;if($i(e,(e,r)=>{cs[r]||(t[r]=e,n++)}),n)return t}function us(e){let t=ls(e);if(t){let n={to:t};return $i(e,(e,r)=>r in t||(n[r]=e)),n}return{...e}}function ds(e){let t=no(e);return V.arr(t)?t.map(ds):Do(t)?ia.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function fs(e){for(let t in e)return!0;return!1}function ps(e){return V.fun(e)||V.arr(e)&&V.obj(e[0])}function ms(e,t){e.ref?.delete(e),t?.delete(e)}function hs(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var gs={...{default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}}.default,mass:1,damping:1,easing:Qa.linear,clamp:!1},_s=class{constructor(){this.velocity=0,Object.assign(this,gs)}};function vs(e,t,n){n&&(n={...n},ys(n,t),t={...n,...t}),ys(e,t),Object.assign(e,t);for(let t in gs)e[t]??(e[t]=gs[t]);let{frequency:r,damping:i}=e,{mass:a}=e;return V.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=(2*Math.PI/r)**2*a,e.friction=4*Math.PI*i*a/r),e}function ys(e,t){if(!V.und(t.decay))e.duration=void 0;else{let n=!V.und(t.tension)||!V.und(t.friction);(n||!V.und(t.frequency)||!V.und(t.damping)||!V.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var bs=[],xs=class{constructor(){this.changed=!1,this.values=bs,this.toValues=null,this.fromValues=bs,this.config=new _s,this.immediate=!1}};function Ss(e,{key:t,props:n,defaultProps:r,state:i,actions:a}){return new Promise((o,s)=>{let c,l,u=ns(n.cancel??r?.cancel,t);if(u)p();else{V.und(n.pause)||(i.paused=ns(n.pause,t));let e=r?.pause;e!==!0&&(e=i.paused||ns(e,t)),c=ts(n.delay||0,t),e?(i.resumeQueue.add(f),a.pause()):(a.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(l),l.cancel(),c=l.time-z.now()}function f(){c>0&&!ia.skipAnimation?(i.delayed=!0,l=z.setTimeout(p,c),i.pauseQueue.add(d),i.timeouts.add(l)):p()}function p(){i.delayed&&=!1,i.pauseQueue.delete(d),i.timeouts.delete(l),e<=(i.cancelId||0)&&(u=!0);try{a.start({...n,callId:e,cancel:u},o)}catch(e){s(e)}}})}var Cs=(e,t)=>t.length==1?t[0]:t.some(e=>e.cancelled)?Es(e.get()):t.every(e=>e.noop)?ws(e.get()):Ts(e.get(),t.every(e=>e.finished)),ws=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ts=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Es=e=>({value:e,cancelled:!0,finished:!1});function Ds(e,t,n,r){let{callId:i,parentId:a,onRest:o}=t,{asyncTo:s,promise:c}=n;return!a&&e===s&&!t.reset?c:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;let l=os(t,(e,t)=>t===`onRest`?void 0:e),u,d,f=new Promise((e,t)=>(u=e,d=t)),p=e=>{let t=i<=(n.cancelId||0)&&Es(r)||i!==n.asyncId&&Ts(r,!1);if(t)throw e.result=t,d(e),e},m=0,h=(e,t)=>{let a=new ks,o=new As;return(async()=>{p(a);let s=V.obj(e)?{...e}:{...t,to:e};if(s.parentId=i,$i(l,(e,t)=>{V.und(s[t])&&(s[t]=e)}),ia.skipAnimation){if(++m>1024)throw Os(n),o.result=Ts(r,!1),d(o),o;return s.immediate=!0,await r.start(s)}let c=await r.start(s);return p(a),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),c})()},g;try{let t;t=V.arr(e)?(async e=>{for(let t of e)await h(t)})(e):Promise.resolve(e(h,r.stop.bind(r))),await Promise.all([t.then(u),f]),g=Ts(r.get(),!0,!1)}catch(e){if(e instanceof ks)g=e.result;else if(e instanceof As)g=e.result;else throw e}finally{i==n.asyncId&&(n.asyncId=a,n.asyncTo=a?s:void 0,n.promise=a?c:void 0)}return V.fun(o)&&z.batchedUpdates(()=>{o(g,r,r.item)}),g})()}function Os(e,t){ta(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var ks=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},As=class extends Error{constructor(){super(`SkipAnimationSignal`)}},js=e=>e instanceof Ns,Ms=1,Ns=class extends oo{constructor(...e){super(...e),this.id=Ms++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Io(this);return e&&e.getValue()}to(...e){return ia.to(this,e)}interpolate(...e){return wo(),ia.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){ao(this,{type:`change`,parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ha.sort(this),ao(this,{type:`priority`,parent:this,priority:e})}},Ps=Symbol.for(`SpringPhase`),Fs=1,Is=2,Ls=4,Rs=e=>(e[Ps]&Fs)>0,zs=e=>(e[Ps]&Is)>0,Bs=e=>(e[Ps]&Ls)>0,Vs=(e,t)=>t?e[Ps]|=3:e[Ps]&=-3,Hs=(e,t)=>t?e[Ps]|=Ls:e[Ps]&=-5,Us=class extends Ns{constructor(e,t){if(super(),this.animation=new xs,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!V.und(e)||!V.und(t)){let n=V.obj(e)?{...e}:{...t,from:e};V.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(zs(this)||this._state.asyncTo)||Bs(this)}get goal(){return no(this.animation.to)}get velocity(){let e=Io(this);return e instanceof Bo?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return Rs(this)}get isAnimating(){return zs(this)}get isPaused(){return Bs(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{toValues:i}=r,{config:a}=r,o=Ro(r.to);!o&&to(r.to)&&(i=ea(no(r.to))),r.values.forEach((s,c)=>{if(s.done)return;let l=s.constructor==Vo?1:o?o[c].lastPosition:i[c],u=r.immediate,d=l;if(!u){if(d=s.lastPosition,a.tension<=0){s.done=!0;return}let t=s.elapsedTime+=e,n=r.fromValues[c],i=s.v0==null?s.v0=V.arr(a.velocity)?a.velocity[c]:a.velocity:s.v0,o,f=a.precision||(n==l?.005:Math.max(Math.max(Math.abs(l),Math.abs(n),1)*2**-52,Math.min(1,Math.abs(l-n)*.001)));if(!V.und(a.duration)){let r=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,s.durationProgress>0&&(s.elapsedTime=a.duration*s.durationProgress,t=s.elapsedTime+=e)),r=(a.progress||0)+t/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),d=n+a.easing(r)*(l-n),o=(d-s.lastPosition)/e,u=r==1}else if(a.decay){let e=a.decay===!0?.998:a.decay,r=Math.exp(-(1-e)*t);d=n+i/(1-e)*(1-r),u=Math.abs(s.lastPosition-d)<=f,o=i*r}else{o=s.lastVelocity==null?i:s.lastVelocity;let t=a.restVelocity||f/10,r=a.clamp?0:a.bounce,c=!V.und(r),p=n==l?s.v0>0:n<l,m,h=!1,g=Math.ceil(e/1);for(let e=0;e<g&&(m=Math.abs(o)>t,!(!m&&(u=Math.abs(l-d)<=f,u)));++e){c&&(h=d==l||d>l==p,h&&(o=-o*r,d=l));let e=(-a.tension*1e-6*(d-l)+-a.friction*.001*o)/a.mass;o+=e*1,d+=o*1}}s.lastVelocity=o,Number.isNaN(d)&&(console.warn(`Got NaN while animating:`,this),u=!0)}o&&!o[c].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,a.round)&&(n=!0)});let s=Io(this),c=s.getValue();if(t){let e=no(r.to);(c!==e||n)&&!a.decay?(s.setValue(e),this._onChange(e)):n&&a.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return z.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(zs(this)){let{to:e,config:t}=this.animation;z.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||=[]).push(e),this}start(e,t){let n;return V.und(e)?(n=this.queue||[],this.queue=[]):n=[V.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>Cs(this,e))}stop(e){let{to:t}=this.animation;return V.und(t)||this._focus(this.get()),Os(this._state,e&&this._lastCallId),z.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type==`change`?this._start():e.type==`priority`&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||``,{to:n,from:r}=e;n=V.obj(n)?n[t]:n,(n==null||ps(n))&&(n=void 0),r=V.obj(r)?r[t]:r,r??=void 0;let i={to:n,from:r};return Rs(this)||(e.reverse&&([n,r]=[r,n]),r=no(r),V.und(r)?Io(this)||this._set(n):this._set(r)),i}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,os(e,(e,t)=>/^on/.test(t)?rs(e,n):e)),Xs(this,e,`onProps`),Zs(this,`onProps`,e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return Ss(++this._lastCallId,{key:n,props:e,defaultProps:r,state:a,actions:{pause:()=>{Bs(this)||(Hs(this,!0),na(a.pauseQueue),Zs(this,`onPause`,Ts(this,Ws(this,this.animation.to)),this))},resume:()=>{Bs(this)&&(Hs(this,!1),zs(this)&&this._resume(),na(a.resumeQueue),Zs(this,`onResume`,Ts(this,Ws(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(n=>{if(e.loop&&n.finished&&!(t&&n.noop)){let t=Gs(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Es(this));let r=!V.und(e.to),i=!V.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(Es(this));let{key:a,defaultProps:o,animation:s}=this,{to:c,from:l}=s,{to:u=c,from:d=l}=e;i&&!r&&(!t.default||V.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let f=!Qi(d,l);f&&(s.from=d),d=no(d);let p=!Qi(u,c);p&&this._focus(u);let m=ps(t.to),{config:h}=s,{decay:g,velocity:_}=h;(r||i)&&!h.decay&&(h.velocity=0),t.config&&!m&&vs(h,ts(t.config,a),t.config===o.config?void 0:ts(o.config,a));let v=Io(this);if(!v||V.und(u))return n(Ts(this,!0));let y=V.und(t.reset)?i&&!t.default:!V.und(d)&&ns(t.reset,a),b=y?d:this.get(),x=ds(u),S=V.num(x)||V.arr(x)||Do(x),C=!m&&(!S||ns(o.immediate||t.immediate,a));if(p){let e=Ko(u);if(e!==v.constructor)if(C)v=this._set(x);else throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`)}let w=v.constructor,T=to(u),E=!1;if(!T){let e=y||!Rs(this)&&f;(p||e)&&(E=Qi(ds(b),x),T=!E),(!Qi(s.immediate,C)&&!C||!Qi(h.decay,g)||!Qi(h.velocity,_))&&(T=!0)}if(E&&zs(this)&&(s.changed&&!y?T=!0:T||this._stop(c)),!m&&((T||to(c))&&(s.values=v.getPayload(),s.toValues=to(u)?null:w==Vo?[1]:ea(x)),s.immediate!=C&&(s.immediate=C,!C&&!y&&this._set(c)),T)){let{onRest:e}=s;H(Ys,e=>Xs(this,t,e));let r=Ts(this,Ws(this,c));na(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&z.batchedUpdates(()=>{s.changed=!y,e?.(r,this),y?ts(o.onRest,r):s.onStart?.(r,this)})}y&&this._set(b),m?n(Ds(t.to,t,this._state,this)):T?this._start():zs(this)&&!p?this._pendingCalls.add(n):n(ws(b))}_focus(e){let t=this.animation;e!==t.to&&(ro(this)&&this._detach(),t.to=e,ro(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;to(t)&&(co(t,this),js(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;to(e)&&lo(e,this)}_set(e,t=!0){let n=no(e);if(!V.und(n)){let e=Io(this);if(!e||!Qi(n,e.getValue())){let r=Ko(n);!e||e.constructor!=r?Lo(this,r.create(n)):e.setValue(n),e&&z.batchedUpdates(()=>{this._onChange(n,t)})}}return Io(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,Zs(this,`onStart`,Ts(this,Ws(this,e.to)),this))}_onChange(e,t){let n=Ts(e,!1);t||(this._onStart(),ts(this.animation.onChange,n,this)),ts(this.defaultProps.onChange,n,this),super._onChange(e,t)}_start(){let e=this.animation;Io(this).reset(no(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),zs(this)||(Vs(this,!0),Bs(this)||this._resume())}_resume(){ia.skipAnimation?this.finish():ha.start(this)}_stop(e,t){if(zs(this)){Vs(this,!1);let n=this.animation;H(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),ao(this,{type:`idle`,parent:this});let r=t?Es(this.get()):Ts(this.get(),Ws(this,e??n.to));na(this._pendingCalls,r),n.changed=!1,Zs(this,`onRest`,r,this)}}};function Ws(e,t){let n=ds(t);return Qi(ds(e.get()),n)}function Gs(e,t=e.loop,n=e.to){let r=ts(t);if(r){let i=r!==!0&&us(r),a=(i||e).reverse,o=!i||i.reset;return Ks({...e,loop:t,default:!1,pause:void 0,to:!a||ps(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function Ks(e){let{to:t,from:n}=e=us(e),r=new Set;return V.obj(t)&&Js(t,r),V.obj(n)&&Js(n,r),e.keys=r.size?Array.from(r):null,e}function qs(e){let t=Ks(e);return V.und(t.default)&&(t.default=os(t)),t}function Js(e,t){$i(e,(e,n)=>e!=null&&t.add(n))}var Ys=[`onStart`,`onRest`,`onChange`,`onPause`,`onResume`];function Xs(e,t,n){e.animation[n]=t[n]===is(t,n)?void 0:rs(t[n],e.key)}function Zs(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var Qs=[`onStart`,`onChange`,`onRest`],$s=1,ec=class{constructor(e,t){this.id=$s++,this.springs={},this.queue=[],this._lastAsyncId=0,this._lastLoopId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(let t in e){let n=e[t];V.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Ks(e)),this}start(e){let{queue:t}=this;return e?t=ea(e).map(Ks):this.queue=[],this._flush?this._flush(this,t):(sc(this,t),tc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;H(ea(t),t=>n[t].stop(!!e))}else Os(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(V.und(e))this.start({pause:!0});else{let t=this.springs;H(ea(e),e=>t[e].pause())}return this}resume(e){if(V.und(e))this.start({pause:!1});else{let t=this.springs;H(ea(e),e=>t[e].resume())}return this}each(e){$i(this.springs,e)}onLoopReset(e){let t=this._onLoopReset??=new Set;return t.add(e),()=>{t.delete(e)}}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,ta(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let a=!r&&this._started,o=i||a&&n.size?this.get():null;i&&t.size&&ta(t,([e,t])=>{t.value=o,e(t,this,this._item)}),a&&(this._started=!1,ta(n,([e,t])=>{t.value=o,e(t,this,this._item)}))}eventObserved(e){if(e.type==`change`)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type==`idle`)this._active.delete(e.parent);else return;z.onFrame(this._onFrame)}};function tc(e,t){return Promise.all(t.map(t=>nc(e,t))).then(t=>Cs(e,t))}async function nc(e,t,n){let{keys:r,to:i,from:a,loop:o,onRest:s,onResolve:c}=t,l=V.obj(t.default)&&t.default;o&&(t.loop=!1);let u=t,d=!n&&!u.parentId&&`loop`in t?++e._lastLoopId:n?u.loopId:e._lastLoopId;i===!1&&(t.to=null),a===!1&&(t.from=null);let f=V.arr(i)||V.fun(i)?i:void 0;f?(t.to=void 0,t.onRest=void 0,l&&(l.onRest=void 0)):H(Qs,n=>{let r=t[n];if(V.fun(r)){let i=e._events[n];t[n]=(({finished:e,cancelled:t})=>{let n=i.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.set(r,{value:null,finished:e||!1,cancelled:t||!1})}),l&&(l[n]=t[n])}});let p=e._state;t.pause===!p.paused?(p.paused=t.pause,na(t.pause?p.pauseQueue:p.resumeQueue)):p.paused&&(t.pause=!0);let m=(r||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),h=t.cancel===!0||is(t,`cancel`)===!0;(f||h&&p.asyncId)&&m.push(Ss(++e._lastAsyncId,{props:t,state:p,actions:{pause:Xi,resume:Xi,start(t,n){h?(Os(p,e._lastAsyncId),n(Es(e))):(t.onRest=s,n(Ds(f,t,p,e)))}}})),p.paused&&await new Promise(e=>{p.resumeQueue.add(e)});let g=Cs(e,await Promise.all(m));if(o&&g.finished&&!(n&&g.noop)&&d===e._lastLoopId){let n=Gs(t,o,i);if(n)return n.loopId=d,e._onLoopReset?.forEach(e=>e()),sc(e,[n]),nc(e,n,!0)}return c&&z.batchedUpdates(()=>c(g,e,e.item)),g}function rc(e,t){let n={...e.springs};return t&&H(ea(t),e=>{V.und(e.keys)&&(e=Ks(e)),V.obj(e.to)||(e={...e,to:void 0}),oc(n,e,e=>ac(e))}),ic(e,n),n}function ic(e,t){$i(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,co(t,e))})}function ac(e,t){let n=new Us;return n.key=e,t&&co(n,t),n}function oc(e,t,n){t.keys&&H(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function sc(e,t){H(t,t=>{oc(e.springs,t,t=>ac(t,e))})}var cc=b.createContext({pause:!1,immediate:!1}),lc=()=>{let e=[],t=function(t){Eo();let r=[];return H(e,(e,i)=>{if(V.und(t))r.push(e.start());else{let a=n(t,e,i);a&&r.push(e.start(a))}}),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return H(e,e=>e.pause(...arguments)),this},t.resume=function(){return H(e,e=>e.resume(...arguments)),this},t.set=function(t){H(e,(e,n)=>{let r=V.fun(t)?t(n,e):t;r&&e.set(r)})},t.start=function(t){let n=[];return H(e,(e,r)=>{if(V.und(t))n.push(e.start());else{let i=this._getProps(t,e,r);i&&n.push(e.start(i))}}),n},t.stop=function(){return H(e,e=>e.stop(...arguments)),this},t.update=function(t){return H(e,(e,n)=>e.update(this._getProps(t,e,n))),this};let n=function(e,t,n){return V.fun(e)?e(n,t):e};return t._getProps=n,t};function uc(e,t,n){let r=V.fun(t)&&t;r&&!n&&(n=[]);let i=(0,b.useMemo)(()=>r||arguments.length==3?lc():void 0,[]),a=(0,b.useRef)(0),o=Ao(),s=(0,b.useMemo)(()=>({ctrls:[],queue:[],flush(e,t){let n=rc(e,t);return a.current>0&&!s.queue.length&&!Object.keys(n).some(t=>!e.springs[t])?tc(e,t):new Promise(r=>{ic(e,n),s.queue.push(()=>{r(tc(e,t))}),o()})}}),[]),c=(0,b.useRef)([...s.ctrls]),l=(0,b.useRef)([]),u=(0,b.useRef)([]);u.current=[];let d=No(e)||0;(0,b.useMemo)(()=>{H(c.current.slice(e,d),e=>{ms(e,i),e.stop(!0)}),c.current.length=e,f(d,e)},[e]),(0,b.useMemo)(()=>{f(0,Math.min(d,e))},n);function f(e,n){for(let i=e;i<n;i++){let e=c.current[i]||(c.current[i]=new ec(null,s.flush)),n=r?r(i,e):t[i];n&&(l.current[i]=qs(n))}}let p=c.current.map((e,t)=>rc(e,l.current[t])),m=(0,b.useContext)(cc),h=m!==No(m)&&fs(m);Oo(()=>{a.current++,s.ctrls=c.current;let{queue:e}=s;e.length&&(s.queue=[],H(e,e=>e()));let t=l.current.length>0?l.current:u.current;H(c.current,(e,n)=>{i?.add(e),h&&e.start({default:m});let r=t[n];r&&(hs(e,r.ref),e.ref?e.queue.push({...r,default:V.obj(r.default)?{...r.default}:r.default}):e.start(r))}),l.current.length>0&&(u.current=l.current),l.current=[]}),jo(()=>()=>{H(s.ctrls,e=>e.stop(!0))});let g=p.map(e=>({...e}));return i?[g,i]:g}function dc(e,t){let n=V.fun(e),[[r],i]=uc(1,n?e:[e],n?t||[]:t);return n||arguments.length==2?[r,i]:r}var fc=class extends Ns{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ha(...t);let n=this._get(),r=Ko(n);Lo(this,r.create(n))}advance(e){let t=this._get();Qi(t,this.get())||(Io(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&mc(this._active)&&hc(this)}_get(){let e=V.arr(this.source)?this.source.map(no):ea(no(this.source));return this.calc(...e)}_start(){this.idle&&!mc(this._active)&&(this.idle=!1,H(Ro(this),e=>{e.done=!1}),ia.skipAnimation?(z.batchedUpdates(()=>this.advance()),hc(this)):ha.start(this))}_attach(){let e=1;H(ea(this.source),t=>{to(t)&&co(t,this),js(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){H(ea(this.source),e=>{to(e)&&lo(e,this)}),this._active.clear(),hc(this)}eventObserved(e){e.type==`change`?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type==`idle`?this._active.delete(e.parent):e.type==`priority`&&(this.priority=ea(this.source).reduce((e,t)=>Math.max(e,(js(t)?t.priority:0)+1),0))}};function pc(e){return e.idle!==!1}function mc(e){return!e.size||Array.from(e).every(pc)}function hc(e){e.idle||(e.idle=!0,H(Ro(e),e=>{e.done=!0}),ao(e,{type:`idle`,parent:e}))}var gc=(e,...t)=>new fc(e,t);ia.assign({createStringInterpolator:bo,to:(e,t)=>new fc(e,t)}),ha.advance;var _c=/^--/;function vc(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t==`number`&&t!==0&&!_c.test(e)&&!(xc.hasOwnProperty(e)&&xc[e])?t+`px`:(``+t).trim()}var yc={};function bc(e,t){if(!e.nodeType||!e.setAttribute||!e.removeAttribute)return!1;let n=e.nodeName===`filter`||e.parentNode&&e.parentNode.nodeName===`filter`,{className:r,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:c,...l}=t,u=Object.values(l),d=Object.keys(l).map(t=>n||e.hasAttribute(t)?t:yc[t]||(yc[t]=t.replace(/([A-Z])/g,e=>`-`+e.toLowerCase())));t.hasOwnProperty(`children`)&&(e.textContent=a);for(let t in i)if(i.hasOwnProperty(t)){let n=vc(t,i[t]);_c.test(t)?e.style.setProperty(t,n):e.style[t]=n}d.forEach((t,n)=>{let r=u[n];r===void 0?e.removeAttribute(t):e.setAttribute(t,r)}),t.hasOwnProperty(`className`)&&(r===void 0?e.removeAttribute(`class`):e.className=r),o!==void 0&&(e.scrollTop=o),s!==void 0&&(e.scrollLeft=s),t.hasOwnProperty(`viewBox`)&&(c===void 0?e.removeAttribute(`viewBox`):e.setAttribute(`viewBox`,c))}var xc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Sc=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Cc=[`Webkit`,`Ms`,`Moz`,`O`];xc=Object.keys(xc).reduce((e,t)=>(Cc.forEach(n=>e[Sc(n,t)]=e[t]),e),xc);var wc=/^(matrix3d|matrix|translate3d|translate[XYZ]?|scale3d|scale[XYZ]?|rotate3d|rotate[XYZ]?|skew[XY]?)$/,Tc=/^(translate)/,Ec=/^(rotate|skew)/,Dc=(e,t)=>V.num(e)&&e!==0?e+t:e,Oc=(e,t)=>V.arr(e)?e.every(e=>Oc(e,t)):V.num(e)?e===t:parseFloat(e)===t,kc=class extends Uo{constructor({x:e,y:t,z:n,...r}){let i=[],a=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),a.push(e=>[`translate3d(${e.map(e=>Dc(e,`px`)).join(`,`)})`,Oc(e,0)])),$i(r,(e,t)=>{if(t===`transform`)i.push([e||``]),a.push(e=>[e,e===``]);else if(wc.test(t)){if(delete r[t],V.und(e))return;let n=Tc.test(t)?`px`:Ec.test(t)?`deg`:``;i.push(ea(e)),a.push(t===`rotate3d`?([e,t,r,i])=>[`rotate3d(${e},${t},${r},${Dc(i,n)})`,Oc(i,0)]:e=>[`${t}(${e.map(e=>Dc(e,n)).join(`,`)})`,Oc(e,+!!t.startsWith(`scale`))])}}),i.length&&(r.transform=new Ac(i,a)),super(r)}},Ac=class extends oo{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||=this._get()}_get(){let e=``,t=!0;return H(this.inputs,(n,r)=>{let i=no(n[0]),[a,o]=this.transforms[r](V.arr(i)?i:n.map(no));e+=` `+a,t&&=o}),t?`none`:e}observerAdded(e){e==1&&H(this.inputs,e=>H(e,e=>to(e)&&co(e,this)))}observerRemoved(e){e==0&&H(this.inputs,e=>H(e,e=>to(e)&&lo(e,this)))}eventObserved(e){e.type==`change`&&(this._value=null),ao(this,e)}},jc=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.big.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.foreignObject.g.image.line.linearGradient.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.text.tspan`.split(`.`);ia.assign({batchedUpdates:Ai.unstable_batchedUpdates,createStringInterpolator:bo,colors:Sa});var G=$o(jc,{applyAnimatedValues:bc,createAnimatedStyle:e=>new kc(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}).animated,Mc=`BN.BN.BN.BN.BN.BN.BN.BN.BN.S.B.S.WS.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.B.B.B.S.WS.ON.ON.ET.ET.ET.ON.ON.ON.ON.ON.ES.CS.ES.CS.CS.EN.EN.EN.EN.EN.EN.EN.EN.EN.EN.CS.ON.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.ON.ON.ON.BN.BN.BN.BN.BN.BN.B.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.BN.CS.ON.ET.ET.ET.ET.ON.ON.ON.ON.L.ON.ON.BN.ON.ON.ET.ET.EN.EN.ON.L.ON.ON.ON.EN.L.ON.ON.ON.ON.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.L.ON.L.L.L.L.L.L.L.L`.split(`.`),Nc=[[697,698,`ON`],[706,719,`ON`],[722,735,`ON`],[741,749,`ON`],[751,767,`ON`],[768,879,`NSM`],[884,885,`ON`],[894,894,`ON`],[900,901,`ON`],[903,903,`ON`],[1014,1014,`ON`],[1155,1161,`NSM`],[1418,1418,`ON`],[1421,1422,`ON`],[1423,1423,`ET`],[1424,1424,`R`],[1425,1469,`NSM`],[1470,1470,`R`],[1471,1471,`NSM`],[1472,1472,`R`],[1473,1474,`NSM`],[1475,1475,`R`],[1476,1477,`NSM`],[1478,1478,`R`],[1479,1479,`NSM`],[1480,1535,`R`],[1536,1541,`AN`],[1542,1543,`ON`],[1544,1544,`AL`],[1545,1546,`ET`],[1547,1547,`AL`],[1548,1548,`CS`],[1549,1549,`AL`],[1550,1551,`ON`],[1552,1562,`NSM`],[1563,1610,`AL`],[1611,1631,`NSM`],[1632,1641,`AN`],[1642,1642,`ET`],[1643,1644,`AN`],[1645,1647,`AL`],[1648,1648,`NSM`],[1649,1749,`AL`],[1750,1756,`NSM`],[1757,1757,`AN`],[1758,1758,`ON`],[1759,1764,`NSM`],[1765,1766,`AL`],[1767,1768,`NSM`],[1769,1769,`ON`],[1770,1773,`NSM`],[1774,1775,`AL`],[1776,1785,`EN`],[1786,1808,`AL`],[1809,1809,`NSM`],[1810,1839,`AL`],[1840,1866,`NSM`],[1867,1957,`AL`],[1958,1968,`NSM`],[1969,1983,`AL`],[1984,2026,`R`],[2027,2035,`NSM`],[2036,2037,`R`],[2038,2041,`ON`],[2042,2044,`R`],[2045,2045,`NSM`],[2046,2069,`R`],[2070,2073,`NSM`],[2074,2074,`R`],[2075,2083,`NSM`],[2084,2084,`R`],[2085,2087,`NSM`],[2088,2088,`R`],[2089,2093,`NSM`],[2094,2136,`R`],[2137,2139,`NSM`],[2140,2143,`R`],[2144,2191,`AL`],[2192,2193,`AN`],[2194,2198,`AL`],[2199,2207,`NSM`],[2208,2249,`AL`],[2250,2273,`NSM`],[2274,2274,`AN`],[2275,2306,`NSM`],[2362,2362,`NSM`],[2364,2364,`NSM`],[2369,2376,`NSM`],[2381,2381,`NSM`],[2385,2391,`NSM`],[2402,2403,`NSM`],[2433,2433,`NSM`],[2492,2492,`NSM`],[2497,2500,`NSM`],[2509,2509,`NSM`],[2530,2531,`NSM`],[2546,2547,`ET`],[2555,2555,`ET`],[2558,2558,`NSM`],[2561,2562,`NSM`],[2620,2620,`NSM`],[2625,2626,`NSM`],[2631,2632,`NSM`],[2635,2637,`NSM`],[2641,2641,`NSM`],[2672,2673,`NSM`],[2677,2677,`NSM`],[2689,2690,`NSM`],[2748,2748,`NSM`],[2753,2757,`NSM`],[2759,2760,`NSM`],[2765,2765,`NSM`],[2786,2787,`NSM`],[2801,2801,`ET`],[2810,2815,`NSM`],[2817,2817,`NSM`],[2876,2876,`NSM`],[2879,2879,`NSM`],[2881,2884,`NSM`],[2893,2893,`NSM`],[2901,2902,`NSM`],[2914,2915,`NSM`],[2946,2946,`NSM`],[3008,3008,`NSM`],[3021,3021,`NSM`],[3059,3064,`ON`],[3065,3065,`ET`],[3066,3066,`ON`],[3072,3072,`NSM`],[3076,3076,`NSM`],[3132,3132,`NSM`],[3134,3136,`NSM`],[3142,3144,`NSM`],[3146,3149,`NSM`],[3157,3158,`NSM`],[3170,3171,`NSM`],[3192,3198,`ON`],[3201,3201,`NSM`],[3260,3260,`NSM`],[3276,3277,`NSM`],[3298,3299,`NSM`],[3328,3329,`NSM`],[3387,3388,`NSM`],[3393,3396,`NSM`],[3405,3405,`NSM`],[3426,3427,`NSM`],[3457,3457,`NSM`],[3530,3530,`NSM`],[3538,3540,`NSM`],[3542,3542,`NSM`],[3633,3633,`NSM`],[3636,3642,`NSM`],[3647,3647,`ET`],[3655,3662,`NSM`],[3761,3761,`NSM`],[3764,3772,`NSM`],[3784,3790,`NSM`],[3864,3865,`NSM`],[3893,3893,`NSM`],[3895,3895,`NSM`],[3897,3897,`NSM`],[3898,3901,`ON`],[3953,3966,`NSM`],[3968,3972,`NSM`],[3974,3975,`NSM`],[3981,3991,`NSM`],[3993,4028,`NSM`],[4038,4038,`NSM`],[4141,4144,`NSM`],[4146,4151,`NSM`],[4153,4154,`NSM`],[4157,4158,`NSM`],[4184,4185,`NSM`],[4190,4192,`NSM`],[4209,4212,`NSM`],[4226,4226,`NSM`],[4229,4230,`NSM`],[4237,4237,`NSM`],[4253,4253,`NSM`],[4957,4959,`NSM`],[5008,5017,`ON`],[5120,5120,`ON`],[5760,5760,`WS`],[5787,5788,`ON`],[5906,5908,`NSM`],[5938,5939,`NSM`],[5970,5971,`NSM`],[6002,6003,`NSM`],[6068,6069,`NSM`],[6071,6077,`NSM`],[6086,6086,`NSM`],[6089,6099,`NSM`],[6107,6107,`ET`],[6109,6109,`NSM`],[6128,6137,`ON`],[6144,6154,`ON`],[6155,6157,`NSM`],[6158,6158,`BN`],[6159,6159,`NSM`],[6277,6278,`NSM`],[6313,6313,`NSM`],[6432,6434,`NSM`],[6439,6440,`NSM`],[6450,6450,`NSM`],[6457,6459,`NSM`],[6464,6464,`ON`],[6468,6469,`ON`],[6622,6655,`ON`],[6679,6680,`NSM`],[6683,6683,`NSM`],[6742,6742,`NSM`],[6744,6750,`NSM`],[6752,6752,`NSM`],[6754,6754,`NSM`],[6757,6764,`NSM`],[6771,6780,`NSM`],[6783,6783,`NSM`],[6832,6877,`NSM`],[6880,6891,`NSM`],[6912,6915,`NSM`],[6964,6964,`NSM`],[6966,6970,`NSM`],[6972,6972,`NSM`],[6978,6978,`NSM`],[7019,7027,`NSM`],[7040,7041,`NSM`],[7074,7077,`NSM`],[7080,7081,`NSM`],[7083,7085,`NSM`],[7142,7142,`NSM`],[7144,7145,`NSM`],[7149,7149,`NSM`],[7151,7153,`NSM`],[7212,7219,`NSM`],[7222,7223,`NSM`],[7376,7378,`NSM`],[7380,7392,`NSM`],[7394,7400,`NSM`],[7405,7405,`NSM`],[7412,7412,`NSM`],[7416,7417,`NSM`],[7616,7679,`NSM`],[8125,8125,`ON`],[8127,8129,`ON`],[8141,8143,`ON`],[8157,8159,`ON`],[8173,8175,`ON`],[8189,8190,`ON`],[8192,8202,`WS`],[8203,8205,`BN`],[8207,8207,`R`],[8208,8231,`ON`],[8232,8232,`WS`],[8233,8233,`B`],[8234,8238,`BN`],[8239,8239,`CS`],[8240,8244,`ET`],[8245,8259,`ON`],[8260,8260,`CS`],[8261,8286,`ON`],[8287,8287,`WS`],[8288,8303,`BN`],[8304,8304,`EN`],[8308,8313,`EN`],[8314,8315,`ES`],[8316,8318,`ON`],[8320,8329,`EN`],[8330,8331,`ES`],[8332,8334,`ON`],[8352,8399,`ET`],[8400,8432,`NSM`],[8448,8449,`ON`],[8451,8454,`ON`],[8456,8457,`ON`],[8468,8468,`ON`],[8470,8472,`ON`],[8478,8483,`ON`],[8485,8485,`ON`],[8487,8487,`ON`],[8489,8489,`ON`],[8494,8494,`ET`],[8506,8507,`ON`],[8512,8516,`ON`],[8522,8525,`ON`],[8528,8543,`ON`],[8585,8587,`ON`],[8592,8721,`ON`],[8722,8722,`ES`],[8723,8723,`ET`],[8724,9013,`ON`],[9083,9108,`ON`],[9110,9257,`ON`],[9280,9290,`ON`],[9312,9351,`ON`],[9352,9371,`EN`],[9450,9899,`ON`],[9901,10239,`ON`],[10496,11123,`ON`],[11126,11263,`ON`],[11493,11498,`ON`],[11503,11505,`NSM`],[11513,11519,`ON`],[11647,11647,`NSM`],[11744,11775,`NSM`],[11776,11869,`ON`],[11904,11929,`ON`],[11931,12019,`ON`],[12032,12245,`ON`],[12272,12287,`ON`],[12288,12288,`WS`],[12289,12292,`ON`],[12296,12320,`ON`],[12330,12333,`NSM`],[12336,12336,`ON`],[12342,12343,`ON`],[12349,12351,`ON`],[12441,12442,`NSM`],[12443,12444,`ON`],[12448,12448,`ON`],[12539,12539,`ON`],[12736,12773,`ON`],[12783,12783,`ON`],[12829,12830,`ON`],[12880,12895,`ON`],[12924,12926,`ON`],[12977,12991,`ON`],[13004,13007,`ON`],[13175,13178,`ON`],[13278,13279,`ON`],[13311,13311,`ON`],[19904,19967,`ON`],[42128,42182,`ON`],[42509,42511,`ON`],[42607,42610,`NSM`],[42611,42611,`ON`],[42612,42621,`NSM`],[42622,42623,`ON`],[42654,42655,`NSM`],[42736,42737,`NSM`],[42752,42785,`ON`],[42888,42888,`ON`],[43010,43010,`NSM`],[43014,43014,`NSM`],[43019,43019,`NSM`],[43045,43046,`NSM`],[43048,43051,`ON`],[43052,43052,`NSM`],[43064,43065,`ET`],[43124,43127,`ON`],[43204,43205,`NSM`],[43232,43249,`NSM`],[43263,43263,`NSM`],[43302,43309,`NSM`],[43335,43345,`NSM`],[43392,43394,`NSM`],[43443,43443,`NSM`],[43446,43449,`NSM`],[43452,43453,`NSM`],[43493,43493,`NSM`],[43561,43566,`NSM`],[43569,43570,`NSM`],[43573,43574,`NSM`],[43587,43587,`NSM`],[43596,43596,`NSM`],[43644,43644,`NSM`],[43696,43696,`NSM`],[43698,43700,`NSM`],[43703,43704,`NSM`],[43710,43711,`NSM`],[43713,43713,`NSM`],[43756,43757,`NSM`],[43766,43766,`NSM`],[43882,43883,`ON`],[44005,44005,`NSM`],[44008,44008,`NSM`],[44013,44013,`NSM`],[64285,64285,`R`],[64286,64286,`NSM`],[64287,64296,`R`],[64297,64297,`ES`],[64298,64335,`R`],[64336,64450,`AL`],[64451,64466,`ON`],[64467,64829,`AL`],[64830,64847,`ON`],[64848,64911,`AL`],[64912,64913,`ON`],[64914,64967,`AL`],[64968,64975,`ON`],[64976,65007,`BN`],[65008,65020,`AL`],[65021,65023,`ON`],[65024,65039,`NSM`],[65040,65049,`ON`],[65056,65071,`NSM`],[65072,65103,`ON`],[65104,65104,`CS`],[65105,65105,`ON`],[65106,65106,`CS`],[65108,65108,`ON`],[65109,65109,`CS`],[65110,65118,`ON`],[65119,65119,`ET`],[65120,65121,`ON`],[65122,65123,`ES`],[65124,65126,`ON`],[65128,65128,`ON`],[65129,65130,`ET`],[65131,65131,`ON`],[65136,65278,`AL`],[65279,65279,`BN`],[65281,65282,`ON`],[65283,65285,`ET`],[65286,65290,`ON`],[65291,65291,`ES`],[65292,65292,`CS`],[65293,65293,`ES`],[65294,65295,`CS`],[65296,65305,`EN`],[65306,65306,`CS`],[65307,65312,`ON`],[65339,65344,`ON`],[65371,65381,`ON`],[65504,65505,`ET`],[65506,65508,`ON`],[65509,65510,`ET`],[65512,65518,`ON`],[65520,65528,`BN`],[65529,65533,`ON`],[65534,65535,`BN`],[65793,65793,`ON`],[65856,65932,`ON`],[65936,65948,`ON`],[65952,65952,`ON`],[66045,66045,`NSM`],[66272,66272,`NSM`],[66273,66299,`EN`],[66422,66426,`NSM`],[67584,67870,`R`],[67871,67871,`ON`],[67872,68096,`R`],[68097,68099,`NSM`],[68100,68100,`R`],[68101,68102,`NSM`],[68103,68107,`R`],[68108,68111,`NSM`],[68112,68151,`R`],[68152,68154,`NSM`],[68155,68158,`R`],[68159,68159,`NSM`],[68160,68324,`R`],[68325,68326,`NSM`],[68327,68408,`R`],[68409,68415,`ON`],[68416,68863,`R`],[68864,68899,`AL`],[68900,68903,`NSM`],[68904,68911,`AL`],[68912,68921,`AN`],[68922,68927,`AL`],[68928,68937,`AN`],[68938,68968,`R`],[68969,68973,`NSM`],[68974,68974,`ON`],[68975,69215,`R`],[69216,69246,`AN`],[69247,69290,`R`],[69291,69292,`NSM`],[69293,69311,`R`],[69312,69327,`AL`],[69328,69336,`ON`],[69337,69369,`AL`],[69370,69375,`NSM`],[69376,69423,`R`],[69424,69445,`AL`],[69446,69456,`NSM`],[69457,69487,`AL`],[69488,69505,`R`],[69506,69509,`NSM`],[69510,69631,`R`],[69633,69633,`NSM`],[69688,69702,`NSM`],[69714,69733,`ON`],[69744,69744,`NSM`],[69747,69748,`NSM`],[69759,69761,`NSM`],[69811,69814,`NSM`],[69817,69818,`NSM`],[69826,69826,`NSM`],[69888,69890,`NSM`],[69927,69931,`NSM`],[69933,69940,`NSM`],[70003,70003,`NSM`],[70016,70017,`NSM`],[70070,70078,`NSM`],[70089,70092,`NSM`],[70095,70095,`NSM`],[70191,70193,`NSM`],[70196,70196,`NSM`],[70198,70199,`NSM`],[70206,70206,`NSM`],[70209,70209,`NSM`],[70367,70367,`NSM`],[70371,70378,`NSM`],[70400,70401,`NSM`],[70459,70460,`NSM`],[70464,70464,`NSM`],[70502,70508,`NSM`],[70512,70516,`NSM`],[70587,70592,`NSM`],[70606,70606,`NSM`],[70608,70608,`NSM`],[70610,70610,`NSM`],[70625,70626,`NSM`],[70712,70719,`NSM`],[70722,70724,`NSM`],[70726,70726,`NSM`],[70750,70750,`NSM`],[70835,70840,`NSM`],[70842,70842,`NSM`],[70847,70848,`NSM`],[70850,70851,`NSM`],[71090,71093,`NSM`],[71100,71101,`NSM`],[71103,71104,`NSM`],[71132,71133,`NSM`],[71219,71226,`NSM`],[71229,71229,`NSM`],[71231,71232,`NSM`],[71264,71276,`ON`],[71339,71339,`NSM`],[71341,71341,`NSM`],[71344,71349,`NSM`],[71351,71351,`NSM`],[71453,71453,`NSM`],[71455,71455,`NSM`],[71458,71461,`NSM`],[71463,71467,`NSM`],[71727,71735,`NSM`],[71737,71738,`NSM`],[71995,71996,`NSM`],[71998,71998,`NSM`],[72003,72003,`NSM`],[72148,72151,`NSM`],[72154,72155,`NSM`],[72160,72160,`NSM`],[72193,72198,`NSM`],[72201,72202,`NSM`],[72243,72248,`NSM`],[72251,72254,`NSM`],[72263,72263,`NSM`],[72273,72278,`NSM`],[72281,72283,`NSM`],[72330,72342,`NSM`],[72344,72345,`NSM`],[72544,72544,`NSM`],[72546,72548,`NSM`],[72550,72550,`NSM`],[72752,72758,`NSM`],[72760,72765,`NSM`],[72850,72871,`NSM`],[72874,72880,`NSM`],[72882,72883,`NSM`],[72885,72886,`NSM`],[73009,73014,`NSM`],[73018,73018,`NSM`],[73020,73021,`NSM`],[73023,73029,`NSM`],[73031,73031,`NSM`],[73104,73105,`NSM`],[73109,73109,`NSM`],[73111,73111,`NSM`],[73459,73460,`NSM`],[73472,73473,`NSM`],[73526,73530,`NSM`],[73536,73536,`NSM`],[73538,73538,`NSM`],[73562,73562,`NSM`],[73685,73692,`ON`],[73693,73696,`ET`],[73697,73713,`ON`],[78912,78912,`NSM`],[78919,78933,`NSM`],[90398,90409,`NSM`],[90413,90415,`NSM`],[92912,92916,`NSM`],[92976,92982,`NSM`],[94031,94031,`NSM`],[94095,94098,`NSM`],[94178,94178,`ON`],[94180,94180,`NSM`],[113821,113822,`NSM`],[113824,113827,`BN`],[117760,117973,`ON`],[118e3,118009,`EN`],[118010,118012,`ON`],[118016,118451,`ON`],[118458,118480,`ON`],[118496,118512,`ON`],[118528,118573,`NSM`],[118576,118598,`NSM`],[119143,119145,`NSM`],[119155,119162,`BN`],[119163,119170,`NSM`],[119173,119179,`NSM`],[119210,119213,`NSM`],[119273,119274,`ON`],[119296,119361,`ON`],[119362,119364,`NSM`],[119365,119365,`ON`],[119552,119638,`ON`],[120513,120513,`ON`],[120539,120539,`ON`],[120571,120571,`ON`],[120597,120597,`ON`],[120629,120629,`ON`],[120655,120655,`ON`],[120687,120687,`ON`],[120713,120713,`ON`],[120745,120745,`ON`],[120771,120771,`ON`],[120782,120831,`EN`],[121344,121398,`NSM`],[121403,121452,`NSM`],[121461,121461,`NSM`],[121476,121476,`NSM`],[121499,121503,`NSM`],[121505,121519,`NSM`],[122880,122886,`NSM`],[122888,122904,`NSM`],[122907,122913,`NSM`],[122915,122916,`NSM`],[122918,122922,`NSM`],[123023,123023,`NSM`],[123184,123190,`NSM`],[123566,123566,`NSM`],[123628,123631,`NSM`],[123647,123647,`ET`],[124140,124143,`NSM`],[124398,124399,`NSM`],[124643,124643,`NSM`],[124646,124646,`NSM`],[124654,124655,`NSM`],[124661,124661,`NSM`],[124928,125135,`R`],[125136,125142,`NSM`],[125143,125251,`R`],[125252,125258,`NSM`],[125259,126063,`R`],[126064,126143,`AL`],[126144,126207,`R`],[126208,126287,`AL`],[126288,126463,`R`],[126464,126703,`AL`],[126704,126705,`ON`],[126706,126719,`AL`],[126720,126975,`R`],[126976,127019,`ON`],[127024,127123,`ON`],[127136,127150,`ON`],[127153,127167,`ON`],[127169,127183,`ON`],[127185,127221,`ON`],[127232,127242,`EN`],[127243,127247,`ON`],[127279,127279,`ON`],[127338,127343,`ON`],[127405,127405,`ON`],[127584,127589,`ON`],[127744,128728,`ON`],[128732,128748,`ON`],[128752,128764,`ON`],[128768,128985,`ON`],[128992,129003,`ON`],[129008,129008,`ON`],[129024,129035,`ON`],[129040,129095,`ON`],[129104,129113,`ON`],[129120,129159,`ON`],[129168,129197,`ON`],[129200,129211,`ON`],[129216,129217,`ON`],[129232,129240,`ON`],[129280,129623,`ON`],[129632,129645,`ON`],[129648,129660,`ON`],[129664,129674,`ON`],[129678,129734,`ON`],[129736,129736,`ON`],[129741,129756,`ON`],[129759,129770,`ON`],[129775,129784,`ON`],[129792,129938,`ON`],[129940,130031,`ON`],[130032,130041,`EN`],[130042,130042,`ON`],[131070,131071,`BN`],[196606,196607,`BN`],[262142,262143,`BN`],[327678,327679,`BN`],[393214,393215,`BN`],[458750,458751,`BN`],[524286,524287,`BN`],[589822,589823,`BN`],[655358,655359,`BN`],[720894,720895,`BN`],[786430,786431,`BN`],[851966,851967,`BN`],[917502,917759,`BN`],[917760,917999,`NSM`],[918e3,921599,`BN`],[983038,983039,`BN`],[1048574,1048575,`BN`],[1114110,1114111,`BN`]];function Pc(e){if(e<=255)return Mc[e];let t=0,n=Nc.length-1;for(;t<=n;){let r=t+n>>1,i=Nc[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return`L`}function Fc(e){let t=e.length;if(t===0)return null;let n=Array(t),r=!1;for(let i=0;i<t;){let a=e.charCodeAt(i),o=a,s=1;if(a>=55296&&a<=56319&&i+1<t){let t=e.charCodeAt(i+1);t>=56320&&t<=57343&&(o=(a-55296<<10)+(t-56320)+65536,s=2)}let c=Pc(o);(c===`R`||c===`AL`||c===`AN`)&&(r=!0);for(let e=0;e<s;e++)n[i+e]=c;i+=s}if(!r)return null;let i=0;for(let e=0;e<t;e++){let t=n[e];if(t===`L`){i=0;break}if(t===`R`||t===`AL`){i=1;break}}let a=new Int8Array(t);for(let e=0;e<t;e++)a[e]=i;let o=i&1?`R`:`L`,s=o,c=s;for(let e=0;e<t;e++)n[e]===`NSM`?n[e]=c:c=n[e];c=s;for(let e=0;e<t;e++){let t=n[e];t===`EN`?n[e]=c===`AL`?`AN`:`EN`:(t===`R`||t===`L`||t===`AL`)&&(c=t)}for(let e=0;e<t;e++)n[e]===`AL`&&(n[e]=`R`);for(let e=1;e<t-1;e++)n[e]===`ES`&&n[e-1]===`EN`&&n[e+1]===`EN`&&(n[e]=`EN`),n[e]===`CS`&&(n[e-1]===`EN`||n[e-1]===`AN`)&&n[e+1]===n[e-1]&&(n[e]=n[e-1]);for(let e=0;e<t;e++){if(n[e]!==`EN`)continue;let r;for(r=e-1;r>=0&&n[r]===`ET`;r--)n[r]=`EN`;for(r=e+1;r<t&&n[r]===`ET`;r++)n[r]=`EN`}for(let e=0;e<t;e++){let t=n[e];(t===`WS`||t===`ES`||t===`ET`||t===`CS`)&&(n[e]=`ON`)}c=s;for(let e=0;e<t;e++){let t=n[e];t===`EN`?n[e]=c===`L`?`L`:`EN`:(t===`R`||t===`L`)&&(c=t)}for(let e=0;e<t;e++){if(n[e]!==`ON`)continue;let r=e+1;for(;r<t&&n[r]===`ON`;)r++;let i=e>0?n[e-1]:s,a=r<t?n[r]:s,o=i===`L`?`L`:`R`;if(o===(a===`L`?`L`:`R`))for(let t=e;t<r;t++)n[t]=o;e=r-1}for(let e=0;e<t;e++)n[e]===`ON`&&(n[e]=o);for(let e=0;e<t;e++){let t=n[e];a[e]&1?(t===`L`||t===`AN`||t===`EN`)&&a[e]++:t===`R`?a[e]++:(t===`AN`||t===`EN`)&&(a[e]+=2)}return a}function Ic(e,t){let n=Fc(e);if(n===null)return null;let r=new Int8Array(t.length);for(let e=0;e<t.length;e++)r[e]=n[t[e]];return r}var Lc=/[ \t\n\r\f]+/g,Rc=/[\t\n\r\f]| {2,}|^ | $/;function zc(e){let t=e??`normal`;return t===`pre-wrap`?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Bc(e){if(!Rc.test(e))return e;let t=e.replace(Lc,` `);return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function Vc(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
597
597
  `).replace(/[\r\f]/g,`
598
598
  `):e}var Hc=null,Uc;function Wc(){return Hc===null&&(Hc=new Intl.Segmenter(Uc,{granularity:`word`})),Hc}var Gc=/\p{Script=Arabic}/u,Kc=/\p{M}/u,qc=/\p{Nd}/u;function Jc(e){return Gc.test(e)}function Yc(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function Xc(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){if(Yc((n-55296<<10)+(r-56320)+65536))return!0;t++;continue}}if(Yc(n))return!0}}return!1}function Zc(e){let t=hl(e);return t!==null&&(rl.has(t)||ol.has(t))}var Qc=new Set([`\xA0`,` `,`⁠`,``]),$c=new Set([`-`,`‐`,`–`,`—`]);function el(e){let t=hl(e);return t!==null&&Qc.has(t)}function tl(e){let t=hl(e);return t!==null&&$c.has(t)}function nl(e,t){return el(e)?!1:t?!(Zc(e)||tl(e)):!0}var rl=new Set(`,...!.:.;.?.、.。.・.).〕.〉.》.」.』.】.〗.〙.〛.ー.々.〻.ゝ.ゞ.ヽ.ヾ`.split(`.`)),il=new Set([`"`,`(`,`[`,`{`,`¡`,`¿`,`“`,`‘`,`‚`,`„`,`«`,`‹`,`⸘`,`(`,`〔`,`〈`,`《`,`「`,`『`,`【`,`〖`,`〘`,`〚`]),al=new Set([`'`,`’`]),ol=new Set(`.(,(!(?(:(;(،(؛(؟(।(॥(၊(။(၌(၍(၏()(](}(%("(”(’(»(›(…`.split(`(`)),sl=new Set([`:`,`.`,`،`,`؛`]),cl=new Set([`၏`]),ll=new Set([`”`,`’`,`»`,`›`,`」`,`』`,`】`,`》`,`〉`,`〕`,`)`]);function ul(e){if(pl(e))return!0;let t=!1;for(let n of e){if(ol.has(n)||bl(n)){t=!0;continue}if(!(t&&Kc.test(n)))return!1}return t}function dl(e){for(let t of e)if(!rl.has(t)&&!ol.has(t))return!1;return e.length>0}function fl(e){if(pl(e))return!0;for(let t of e)if(!il.has(t)&&!al.has(t)&&!Kc.test(t)&&!bl(t))return!1;return e.length>0}function pl(e){let t=!1;for(let n of e)if(!(n===`\\`||Kc.test(n))){if(il.has(n)||ol.has(n)||al.has(n)){t=!0;continue}return!1}return t}function ml(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let i=n-1;if(i<0)return n;let a=e.charCodeAt(i);return a>=55296&&a<=56319?i:n}function hl(e){if(e.length===0)return null;let t=ml(e,e.length);return e.slice(t)}function gl(e){for(let t of e)if(!Kc.test(t))return t;return null}function _l(e){for(let t=e.length;t>0;){let n=ml(e,t),r=e.slice(n,t);if(!Kc.test(r))return r;t=n}return null}var vl=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function yl(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function bl(e){let t=e.codePointAt(0);return t!==void 0&&yl(t,vl)}function xl(e){let t=_l(e);return t!==null&&bl(t)}function Sl(e){let t=gl(e);return t!==null&&qc.test(t)}function Cl(e){let t=Array.from(e),n=t.length;for(;n>0;){let e=t[n-1];if(Kc.test(e)){n--;continue}if(il.has(e)||al.has(e)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(``),tail:t.slice(n).join(``)}}function wl(e,t,n){return n===`text`&&!t&&e.length===1&&e!==`-`&&e!==`—`?e:null}function Tl(e,t,n,r){let i=t[r],a=e[r];if(i==null)return a;let o=n[r];if(a.length===o)return a;let s=i.repeat(o);return e[r]=s,s}function El(e,t){return e&&t!==null&&sl.has(t)}function Dl(e){let t=hl(e);return t!==null&&cl.has(t)}function Ol(e){if(e.length<2||e[0]!==` `)return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:` `,marks:t}:null}function kl(e){let t=e.length;for(;t>0;){let n=ml(e,t),r=e.slice(n,t);if(ll.has(r))return!0;if(!ol.has(r))return!1;t=n}return!1}function Al(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===` `)return`preserved-space`;if(e===` `)return`tab`;if(t.preserveHardBreaks&&e===`
599
- `)return`hard-break`}return e===` `?`space`:e===`\xA0`||e===` `||e===`⁠`||e===``?`glue`:e===`​`?`zero-width-break`:e===`­`?`soft-hyphen`:`text`}var jl=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ml(e){return e.length===1?e[0]:e.join(``)}function Nl(e,t){let n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);return n.push(t),Ml(n)}function Pl(e,t,n,r){if(!jl.test(e))return[{text:e,isWordLike:t,kind:`text`,start:n}];let i=[],a=null,o=[],s=n,c=!1,l=0;for(let u of e){let e=Al(u,r),d=e===`text`&&t;if(a!==null&&e===a&&d===c){o.push(u),l+=u.length;continue}a!==null&&i.push({text:Ml(o),isWordLike:c,kind:a,start:s}),a=e,o=[u],s=n+l,c=d,l+=u.length}return a!==null&&i.push({text:Ml(o),isWordLike:c,kind:a,start:s}),i}function Fl(e){return e===`space`||e===`preserved-space`||e===`zero-width-break`||e===`hard-break`}var Il=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Ll(e,t){let n=e.texts[t];return n.startsWith(`www.`)?!0:Il.test(n)&&t+1<e.len&&e.kinds[t+1]===`text`&&e.texts[t+1]===`//`}function Rl(e){return e.includes(`?`)&&(e.includes(`://`)||e.startsWith(`www.`))}function zl(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let i=0;i<e.len;i++){if(r[i]!==`text`||!Ll(e,i))continue;let a=[t[i]],o=i+1;for(;o<e.len&&!Fl(r[o]);){a.push(t[o]),n[i]=!0;let e=t[o].includes(`?`);if(r[o]=`text`,t[o]=``,o++,e)break}t[i]=Ml(a)}let a=0;for(let e=0;e<t.length;e++){let o=t[e];o.length!==0&&(a!==e&&(t[a]=o,n[a]=n[e],r[a]=r[e],i[a]=i[e]),a++)}return t.length=a,n.length=a,r.length=a,i.length=a,{len:a,texts:t,isWordLike:n,kinds:r,starts:i}}function Bl(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a];if(t.push(o),n.push(e.isWordLike[a]),r.push(e.kinds[a]),i.push(e.starts[a]),!Rl(o))continue;let s=a+1;if(s>=e.len||Fl(e.kinds[s]))continue;let c=[],l=e.starts[s],u=s;for(;u<e.len&&!Fl(e.kinds[u]);)c.push(e.texts[u]),u++;c.length>0&&(t.push(Ml(c)),n.push(!0),r.push(`text`),i.push(l),a=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var K=new Set([`:`,`-`,`/`,`×`,`,`,`.`,`+`,`–`,`—`]),q=/[\p{P}\p{S}\p{Co}]/u,Vl=/\p{Emoji_Presentation}/u,Hl=new Set([`?`,`֊`,`-`,`‐`,`‒`,`–`,`—`,`…`,`‼`,`‽`,`⁉`]);function Ul(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function Wl(e){let t=e.charCodeAt(0);return t<128?Ul(t):!Hl.has(e)&&!Vl.test(e)&&q.test(e)}function Gl(e){let t=!1;for(let n of e)if(!Kc.test(n)){if(!Wl(n))return!1;t=!0}return t}function Kl(e){for(let t=e.length;t>0;){let n=ml(e,t),r=e.slice(n,t);if(Kc.test(r)){t=n;continue}return Wl(r)||bl(r)}return!1}function ql(e,t,n,r){let i=!t&&Gl(e),a=!r&&Gl(n),o=xl(e),s=(t||o)&&Kl(e);return!i&&!a&&!s||Xc(e)||Xc(n)?!1:(t||i||o)&&(r||a)}function Jl(e){for(let t of e)if(qc.test(t))return!0;return!1}function Yl(e){if(e.length===0)return!1;for(let t of e)if(!(qc.test(t)||K.has(t)))return!1;return!0}function Xl(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a],s=e.kinds[a];if(s===`text`&&Yl(o)&&Jl(o)){let s=[o],c=a+1;for(;c<e.len&&e.kinds[c]===`text`&&Yl(e.texts[c]);)s.push(e.texts[c]),c++;t.push(Ml(s)),n.push(!0),r.push(`text`),i.push(e.starts[a]),a=c-1;continue}t.push(o),n.push(e.isWordLike[a]),r.push(s),i.push(e.starts[a])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Zl(e){let t=[],n=[],r=[],i=[],a=0;for(;a<e.len;){let o=e.texts[a],s=e.kinds[a],c=e.isWordLike[a];if(s===`text`){let s=[o],l=a+1,u=c;for(;l<e.len&&e.kinds[l]===`text`&&ql(e.texts[l-1],e.isWordLike[l-1],e.texts[l],e.isWordLike[l]);){let t=e.texts[l];s.push(t),u||=e.isWordLike[l],l++}if(l>a+1){t.push(Ml(s)),n.push(u),r.push(`text`),i.push(e.starts[a]),a=l;continue}}t.push(o),n.push(c),r.push(s),i.push(e.starts[a]),a++}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Ql(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a];if(e.kinds[a]===`text`&&o.includes(`-`)){let s=o.split(`-`),c=s.length>1;for(let e=0;e<s.length;e++){let t=s[e];if(!c)break;(t.length===0||!Jl(t)||!Yl(t))&&(c=!1)}if(c){let o=0;for(let c=0;c<s.length;c++){let l=s[c],u=c<s.length-1?`${l}-`:l;t.push(u),n.push(!0),r.push(`text`),i.push(e.starts[a]+o),o+=u.length}continue}}t.push(o),n.push(e.isWordLike[a]),r.push(e.kinds[a]),i.push(e.starts[a])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function $l(e){let t=[],n=[],r=[],i=[],a=0;for(;a<e.len;){let o=[e.texts[a]],s=e.isWordLike[a],c=e.kinds[a],l=e.starts[a];if(c===`glue`){let u=[o[0]],d=l;for(a++;a<e.len&&e.kinds[a]===`glue`;)u.push(e.texts[a]),a++;let f=Ml(u);if(a<e.len&&e.kinds[a]===`text`)o[0]=f,o.push(e.texts[a]),s=e.isWordLike[a],c=`text`,l=d,a++;else{t.push(f),n.push(!1),r.push(`glue`),i.push(d);continue}}else a++;if(c===`text`)for(;a<e.len&&e.kinds[a]===`glue`;){let t=[];for(;a<e.len&&e.kinds[a]===`glue`;)t.push(e.texts[a]),a++;let n=Ml(t);if(a<e.len&&e.kinds[a]===`text`){o.push(n,e.texts[a]),s||=e.isWordLike[a],a++;continue}o.push(n)}t.push(Ml(o)),n.push(s),r.push(c),i.push(l)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function eu(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let e=0;e<t.length-1;e++){if(r[e]!==`text`||r[e+1]!==`text`||!Xc(t[e])||!Xc(t[e+1]))continue;let n=Cl(t[e]);n!==null&&(t[e]=n.head,t[e+1]=n.tail+t[e+1],i[e+1]=i[e]+n.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function tu(e,t,n){let r=Wc(),i=0,a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=[];for(let _ of r.segment(e))for(let e of Pl(_.segment,_.isWordLike??!1,_.index,n)){let n=e.kind===`text`,r=wl(e.text,e.isWordLike,e.kind),_=Xc(e.text),v=Jc(e.text),y=hl(e.text),b=kl(e.text),x=Dl(e.text),S=i-1;function C(){u[S]!==null&&(o[S]=[Tl(a,u,d,S)],u[S]=null),o[S].push(e.text),s[S]=s[S]||e.isWordLike,f[S]=f[S]||_,p[S]=p[S]||v,m[S]=b,h[S]=x,g[S]=El(p[S],y)}t.carryCJKAfterClosingQuote&&n&&i>0&&c[S]===`text`&&_&&f[S]&&m[S]||n&&i>0&&c[S]===`text`&&dl(e.text)&&f[S]||n&&i>0&&c[S]===`text`&&h[S]?C():n&&i>0&&c[S]===`text`&&e.isWordLike&&v&&g[S]?(C(),s[S]=!0):r!==null&&i>0&&c[S]===`text`&&u[S]===r?d[S]=(d[S]??1)+1:n&&!e.isWordLike&&i>0&&c[S]===`text`&&!f[S]&&(ul(e.text)||e.text===`-`&&s[S])?C():(a[i]=e.text,o[i]=[e.text],s[i]=e.isWordLike,c[i]=e.kind,l[i]=e.start,u[i]=r,d[i]=r===null?0:1,f[i]=_,p[i]=v,m[i]=b,h[i]=x,g[i]=El(v,y),i++)}for(let e=0;e<i;e++){if(u[e]!==null){a[e]=Tl(a,u,d,e);continue}a[e]=Ml(o[e])}for(let e=1;e<i;e++)c[e]===`text`&&!s[e]&&pl(a[e])&&c[e-1]===`text`&&!f[e-1]&&(a[e-1]+=a[e],s[e-1]=s[e-1]||s[e],a[e]=``);let _=Array.from({length:i},()=>null),v=-1;for(let e=i-1;e>=0;e--){let t=a[e];if(t.length!==0){if(c[e]===`text`&&!s[e]&&v>=0&&c[v]===`text`&&(fl(t)||t===`-`&&Sl(a[v]))){let n=_[v]??[];n.push(t),_[v]=n,l[v]=l[e],a[e]=``;continue}v=e}}for(let e=0;e<i;e++){let t=_[e];t!=null&&(a[e]=Nl(t,a[e]))}let y=0;for(let e=0;e<i;e++){let t=a[e];t.length!==0&&(y!==e&&(a[y]=t,s[y]=s[e],c[y]=c[e],l[y]=l[e]),y++)}a.length=y,s.length=y,c.length=y,l.length=y;let b=eu(Zl(Ql(Xl(Bl(zl($l({len:y,texts:a,isWordLike:s,kinds:c,starts:l})))))));for(let e=0;e<b.len-1;e++){let t=Ol(b.texts[e]);t!==null&&(b.kinds[e]!==`space`&&b.kinds[e]!==`preserved-space`||b.kinds[e+1]!==`text`||!Jc(b.texts[e+1])||(b.texts[e]=t.space,b.isWordLike[e]=!1,b.kinds[e]=b.kinds[e]===`preserved-space`?`preserved-space`:`space`,b.texts[e+1]=t.marks+b.texts[e+1],b.starts[e+1]=b.starts[e]+t.space.length))}return b}function nu(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let t=0;t<e.len;t++)e.kinds[t]===`hard-break`&&(n.push({startSegmentIndex:r,endSegmentIndex:t,consumedEndSegmentIndex:t+1}),r=t+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function ru(e,t,n){if(t.len<=1)return t;let r=[],i=[],a=[],o=[],s=-1,c=!1;function l(e){r.push(t.texts[e]),i.push(t.isWordLike[e]),a.push(`text`),o.push(t.starts[e])}function u(n,s){let c=!1;for(let e=n;e<s;e++)c||=t.isWordLike[e];let l=t.starts[n],u=s<t.len?t.starts[s]:e.length;r.push(e.slice(l,u)),i.push(c),a.push(`text`),o.push(l)}function d(e){if(!(s<0)){if(c)s+1===e?l(s):u(s,e);else for(let t=s;t<e;t++)l(t);s=-1,c=!1}}for(let e=0;e<t.len;e++){let l=t.texts[e],u=t.kinds[e];if(u===`text`){s>=0&&!nl(t.texts[e-1],n)&&d(e),s<0&&(s=e),c||=Xc(l);continue}d(e),r.push(l),i.push(t.isWordLike[e]),a.push(u),o.push(t.starts[e])}return d(t.len),{len:r.length,texts:r,isWordLike:i,kinds:a,starts:o}}function iu(e,t,n=`normal`,r=`normal`){let i=zc(n),a=i.mode===`pre-wrap`?Vc(e):Bc(e);if(a.length===0)return{normalized:a,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let o=tu(a,t,i),s=r===`keep-all`?ru(a,o,t.breakKeepAllAfterPunctuation):o;return{normalized:a,chunks:nu(s,i),...s}}var au=null,ou=new Map,su=null,cu=96,lu=/\p{Emoji_Presentation}/u,uu=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,du=null,fu=new Map;function pu(){if(au!==null)return au;if(typeof OffscreenCanvas<`u`)return au=new OffscreenCanvas(1,1).getContext(`2d`),au;if(typeof document<`u`)return au=document.createElement(`canvas`).getContext(`2d`),au;throw Error(`Text measurement requires OffscreenCanvas or a DOM canvas context.`)}function mu(e){let t=ou.get(e);return t||(t=new Map,ou.set(e,t)),t}function hu(e,t){let n=t.get(e);return n===void 0&&(n={width:pu().measureText(e).width,containsCJK:Xc(e)},t.set(e,n)),n}function gu(){if(su!==null)return su;if(typeof navigator>`u`)return su={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},su;let e=navigator.userAgent,t=navigator.vendor===`Apple Computer, Inc.`&&e.includes(`Safari/`)&&!e.includes(`Chrome/`)&&!e.includes(`Chromium/`)&&!e.includes(`CriOS/`)&&!e.includes(`FxiOS/`)&&!e.includes(`EdgiOS/`),n=e.includes(`Chrome/`)||e.includes(`Chromium/`)||e.includes(`CriOS/`)||e.includes(`Edg/`);return su={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},su}function _u(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function vu(){return du===null&&(du=new Intl.Segmenter(void 0,{granularity:`grapheme`})),du}function yu(e){return lu.test(e)||e.includes(`️`)}function bu(e){return uu.test(e)}function xu(e,t){let n=fu.get(e);if(n!==void 0)return n;let r=pu();r.font=e;let i=r.measureText(`😀`).width;if(n=0,i>t+.5&&typeof document<`u`&&document.body!==null){let t=document.createElement(`span`);t.style.font=e,t.style.display=`inline-block`,t.style.visibility=`hidden`,t.style.position=`absolute`,t.textContent=`😀`,document.body.appendChild(t);let r=t.getBoundingClientRect().width;document.body.removeChild(t),i-r>.5&&(n=i-r)}return fu.set(e,n),n}function Su(e){let t=0,n=vu();for(let r of n.segment(e))yu(r.segment)&&t++;return t}function Cu(e,t){return t.emojiCount===void 0&&(t.emojiCount=Su(e)),t.emojiCount}function wu(e,t,n){return n===0?t.width:t.width-Cu(e,t)*n}function Tu(e,t,n,r,i){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===i)return t.breakableFitAdvances;t.breakableFitMode=i;let a=vu(),o=[];for(let t of a.segment(e))o.push(t.segment);if(o.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i===`sum-graphemes`){let e=[];for(let t of o){let i=hu(t,n);e.push(wu(t,i,r))}return t.breakableFitAdvances=e,t.breakableFitAdvances}if(i===`pair-context`||o.length>cu){let e=[],i=null,a=0;for(let t of o){let o=wu(t,hu(t,n),r);if(i===null)e.push(o);else{let o=i+t,s=hu(o,n);e.push(wu(o,s,r)-a)}i=t,a=o}return t.breakableFitAdvances=e,t.breakableFitAdvances}let s=[],c=``,l=0;for(let e of o){c+=e;let t=hu(c,n),i=wu(c,t,r);s.push(i-l),l=i}return t.breakableFitAdvances=s,t.breakableFitAdvances}function Eu(e,t){let n=pu();n.font=e;let r=mu(e),i=_u(e);return{cache:r,fontSize:i,emojiCorrection:t?xu(e,i):0}}function Du(e){return e===`space`||e===`zero-width-break`||e===`soft-hyphen`}function Ou(e){return e===`space`||e===`preserved-space`||e===`tab`||e===`zero-width-break`||e===`soft-hyphen`}function ku(e,t,n=e.widths.length){for(;t<n;){let n=e.kinds[t];if(!Du(n))break;t++}return t}function Au(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function ju(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Mu(e,t){return t===0?0:e+t}function Nu(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Pu(e,t,n,r,i){return Mu(r,t===`tab`?i+Nu(e,n):e.lineEndFitAdvances[n])}function Fu(e,t,n,r){return Mu(r,t===`tab`?0:e.lineEndFitAdvances[n])}function Iu(e,t,n,r,i){return Mu(r,t===`tab`?i:e.lineEndPaintAdvances[n])}function Lu(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Ru(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function zu(e,t,n){let r=t;for(;r<e.length&&e[r]<n;)r++;return r}function Bu(e,t,n,r,i){if(e.letterSpacing===0)return 0;if(i>0)return e.spacingGraphemeCounts[r]>0?e.letterSpacing:0;for(let i=r-1;i>=t;i--){let a=e.kinds[i];if(!(a===`space`||a===`zero-width-break`||a===`hard-break`)){if(a===`soft-hyphen`){if(i===r-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Vu(e,t,n,r,i,a){return t+Bu(e,n,r,i,a)}function Hu(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:o}=e;if(r.length===0)return 0;let s=t+gu().lineFitEpsilon,c=0,l=0,u=!1,d=0,f=0,p=0,m=0,h=-1,g=0;function _(){h=-1,g=0}function v(e=p,t=m,r=l){c++,n?.(r,d,f,e,t),l=0,u=!1,_()}function y(e,t){u=!0,d=e,f=0,p=e+1,m=0,l=t}function b(e,t,n){u=!0,d=e,f=t,p=e,m=t+1,l=n}function x(e,t){if(!u){y(e,t);return}l+=t,p=e+1,m=0}function S(e,t){let n=a[e],r=o[e]??null,i=r===null?-1:zu(r,0,t+1),c=-1,d=0,f=t;for(;f<n.length;){let a=n[f];if(!u)b(e,f,a);else if(l+a>s){if(r!==null&&c>t){v(e,c,d),f=c,i=zu(r,i,f+1),c=-1,d=0;continue}v(),b(e,f,a)}else l+=a,p=e,m=f+1;let o=f+1;r!==null&&r[i]===o&&(c=o,d=l,i++),f++}u&&p===e&&m===n.length&&(p=e+1,m=0)}let C=0;for(;C<r.length&&!(!u&&(C=ku(e,C),C>=r.length));){let e=r[C],t=i[C],n=Ou(t);if(!u){e>s&&a[C]!==null?S(C,0):y(C,e),n&&(h=C+1,g=l-e),C++;continue}if(l+e>s){if(n){x(C,e),v(C+1,0,l-e),C++;continue}if(h>=0){if(p>h||p===h&&m>0){v();continue}v(h,0,g);continue}if(e>s&&a[C]!==null){v(),S(C,0),C++;continue}v();continue}x(C,e),n&&(h=C+1,g=l-e),C++}return u&&v(),c}function Uu(e,t,n){if(e.simpleLineWalkFastPath)return Hu(e,t,n);let{widths:r,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:o,discretionaryHyphenWidth:s,chunks:c}=e;if(r.length===0||c.length===0)return 0;let l=gu(),u=t+l.lineFitEpsilon,d=0,f=0,p=!1,m=0,h=0,g=0,_=0,v=-1,y=0,b=0,x=null;function S(){v=-1,y=0,b=0,x=null}function C(){return x===`soft-hyphen`&&v===g&&_===0?b:f}function w(t=g,r=_,i){d++,n!==void 0&&n(Vu(e,i??C(),m,h,t,r),m,h,t,r),f=0,p=!1,S()}function T(e,t){p=!0,m=e,h=0,g=e+1,_=0,f=t}function E(e,t,n){p=!0,m=e,h=t,g=e,_=t+1,f=n}function ee(e,t){if(!p){T(e,t);return}f+=t,g=e+1,_=0}function D(t,n,r,i,a,o){if(!n)return;let s=Fu(e,t,r,a),c=Iu(e,t,r,a,i);v=r+1,y=f-o+s,b=f-o+c,x=t}function te(t,n){let r=a[t],i=o[t]??null,s=i===null?-1:zu(i,0,n+1),c=-1,l=0,d=n;for(;d<r.length;){let a=r[d];if(!p)E(t,d,a);else{let r=Lu(e,!0,a),o=f+r;if(Ru(e,o)>u){if(i!==null&&c>n){w(t,c,l),d=c,s=zu(i,s,d+1),c=-1,l=0;continue}w(),E(t,d,a)}else f=o,g=t,_=d+1}let o=d+1;i!==null&&i[s]===o&&(c=o,l=f,s++),d++}p&&g===t&&_===r.length&&(g=t+1,_=0)}function ne(e){d++,n?.(0,e.startSegmentIndex,0,e.consumedEndSegmentIndex,0),S()}for(let t=0;t<c.length;t++){let n=c[t];if(n.startSegmentIndex===n.endSegmentIndex){ne(n);continue}p=!1,f=0,m=n.startSegmentIndex,h=0,g=n.startSegmentIndex,_=0,S();let o=n.startSegmentIndex;for(;o<n.endSegmentIndex&&!(!p&&(o=ku(e,o,n.endSegmentIndex),o>=n.endSegmentIndex));){let t=i[o],n=Ou(t),c=ju(e,p,o),d=t===`tab`?Au(f+c,e.tabStopAdvance):r[o],m=c+d,h=Pu(e,t,o,c,d);if(t===`soft-hyphen`){p&&(g=o+1,_=0,v=o+1,y=f+s,b=f+s,x=t),o++;continue}if(!p){h>u&&a[o]!==null?te(o,0):T(o,d),D(t,n,o,d,c,m),o++;continue}if(f+h>u){let r=f+Fu(e,t,o,c),i=f+Iu(e,t,o,c,d);if(x===`soft-hyphen`&&l.preferEarlySoftHyphenBreak&&y<=u){w(v,0,b);continue}if(n&&r<=u){ee(o,m),w(o+1,0,i),o++;continue}if(v>=0&&y<=u){if(g>v||g===v&&_>0){w();continue}let e=v;w(e,0,b),o=e;continue}if(h>u&&a[o]!==null){w(),te(o,0),o++;continue}w();continue}ee(o,m),D(t,n,o,d,c,m),o++}if(p){let e=v===n.consumedEndSegmentIndex?b:f;w(n.consumedEndSegmentIndex,0,e)}}return d}var Wu=null;function Gu(){return Wu===null&&(Wu=new Intl.Segmenter(void 0,{granularity:`grapheme`})),Wu}function Ku(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function qu(e,t){let n=[],r=[],i=0,a=!1,o=!1,s=!1;function c(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(``),start:i}),r=[],a=!1,o=!1,s=!1)}function l(e,t,n){r=[e],i=t,a=n,o=kl(e),s=il.has(e)}function u(e,t){r.push(e),a||=t;let n=kl(e);e.length===1&&ol.has(e)?o||=n:o=n,s=!1}for(let n of Gu().segment(e)){let e=n.segment,i=Xc(e);if(r.length===0){l(e,n.index,i);continue}if(s||rl.has(e)||ol.has(e)||t.carryCJKAfterClosingQuote&&i&&o){u(e,i);continue}if(!a&&!i){u(e,i);continue}c(),l(e,n.index,i)}return c(),n}function Ju(e,t,n){if(t.length<=1)return t;let r=[],i=-1,a=!1;function o(n,i){let a=t[n].start,o=i<t.length?t[i].start:e.length;r.push({text:e.slice(a,o),start:a})}function s(e){if(!(i<0)){if(a)i+1===e?r.push(t[i]):o(i,e);else for(let n=i;n<e;n++)r.push(t[n]);i=-1,a=!1}}for(let e=0;e<t.length;e++){let r=t[e];i>=0&&!nl(t[e-1].text,n)&&s(e),i<0&&(i=e),a||=Xc(r.text)}return s(t.length),r}function Yu(e,t){if(t===`zero-width-break`||t===`soft-hyphen`||t===`hard-break`)return 0;if(t===`tab`)return 1;let n=0,r=Gu();for(let t of r.segment(e))n++;return n}function Xu(e){return e===`-`||e===`֊`||e===`‐`||e===`‒`||e===`–`||e===`—`}function Zu(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;let t=[],n=0;for(let r of Gu().segment(e))n++,Xu(r.segment)&&t.push(n);return t.length===0?null:t}function Qu(e,t,n){return t>1?e+(t-1)*n:e}function $u(e,t,n,r,i){let a=gu(),{cache:o,emojiCorrection:s}=Eu(t,bu(e.normalized)),c=wu(`-`,hu(`-`,o),s)+(i===0?0:i*2),l=wu(` `,hu(` `,o),s)*8,u=i!==0;if(e.len===0)return Ku(n);let d=[],f=[],p=[],m=[],h=e.chunks.length<=1&&!u,g=n?[]:null,_=[],v=[],y=[],b=n?[]:null,x=Array.from({length:e.len});function S(e,t,n,r,i,a,o,s,c){i!==`text`&&i!==`space`&&i!==`zero-width-break`&&(h=!1),d.push(t),f.push(n),p.push(r),m.push(i),g?.push(a),_.push(o),v.push(s),u&&y.push(c),b!==null&&b.push(e)}function C(e,t,n,c,l){let d=hu(e,o),f=u?Yu(e,t):0,p=Qu(wu(e,d,s),f,i),m=t===`space`||t===`preserved-space`||t===`zero-width-break`?0:p,h=m===0?0:m+(f>0?i:0),g=t===`space`||t===`zero-width-break`?0:p;if(l&&c&&e.length>1){let c=`sum-graphemes`;i===0?Yl(e)?c=`pair-context`:a.preferPrefixWidthsForBreakableRuns&&(c=`segment-prefixes`):c=`segment-prefixes`;let l=Tu(e,d,o,s,c);S(e,p,h,g,t,n,l,l===null||r===`keep-all`?null:Zu(e),f);return}S(e,p,h,g,t,n,null,null,f)}for(let t=0;t<e.len;t++){x[t]=d.length;let n=e.texts[t],i=e.isWordLike[t],s=e.kinds[t],l=e.starts[t];if(s===`soft-hyphen`){S(n,0,c,c,s,l,null,null,0);continue}if(s===`hard-break`){S(n,0,0,0,s,l,null,null,0);continue}if(s===`tab`){S(n,0,0,0,s,l,null,null,u?Yu(n,s):0);continue}let f=hu(n,o);if(s===`text`&&f.containsCJK){let e=qu(n,a),t=r===`keep-all`?Ju(n,e,a.breakKeepAllAfterPunctuation):e;for(let e=0;e<t.length;e++){let n=t[e];C(n.text,`text`,l+n.start,i,r===`keep-all`||!Xc(n.text))}continue}C(n,s,l,i,!0)}let w=ed(e.chunks,x,d.length),T=g===null?null:Ic(e.normalized,g);return b===null?{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:h,segLevels:T,breakableFitAdvances:_,breakablePreferredBreaks:v,letterSpacing:i,spacingGraphemeCounts:y,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:w}:{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:h,segLevels:T,breakableFitAdvances:_,breakablePreferredBreaks:v,letterSpacing:i,spacingGraphemeCounts:y,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:w,segments:b}}function ed(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a.startSegmentIndex<t.length?t[a.startSegmentIndex]:n,s=a.endSegmentIndex<t.length?t[a.endSegmentIndex]:n,c=a.consumedEndSegmentIndex<t.length?t[a.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:c})}return r}function td(e,t,n,r){let i=r?.wordBreak??`normal`,a=r?.letterSpacing??0;return $u(iu(e,gu(),r?.whiteSpace,i),t,n,i,a)}function nd(e,t,n){return td(e,t,!0,n)}function rd(e){return e}function id(e){let t=0;return Uu(rd(e),1/0,e=>{e>t&&(t=e)}),t}function ad(e){let t=e.toLowerCase().replace(/^←\s*/,``);return t.includes(`force push`)?`force-push`:t.includes(`cherry`)?`cherry-pick`:t.includes(`uncommit`)?`uncommit`:t.includes(`revert`)?`revert`:t.includes(`rebase`)?`rebase`:t.includes(`merge`)?`merge`:t.includes(`checkout`)?`checkout`:t.includes(`fetch`)?`fetch`:t.includes(`push`)?`push`:t.includes(`delete`)||t.includes(`discard`)?`delete`:t.includes(`unstage`)?`unstage`:t.includes(`stage`)?`stage`:t.includes(`stash`)?`stash`:t.includes(`move`)?`move`:t.includes(`reset`)?`reset`:t.includes(`branch`)?`branch`:t.includes(`tag`)?`tag`:`checkout`}function od({name:e,size:t=14}){let n={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};return(0,y.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:t,height:t,viewBox:`0 0 24 24`,style:{flex:`0 0 auto`},children:[e===`branch`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`18`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v9`}),(0,y.jsx)(`path`,{...n,d:`M9 18h6`})]}),e===`checkout`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M5 12h14`}),(0,y.jsx)(`path`,{...n,d:`m13 6 6 6-6 6`}),(0,y.jsx)(`path`,{...n,d:`M5 5v14`})]}),e===`cherry-pick`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`7`,cy:`7`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`17`,cy:`17`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M10 7h2a5 5 0 0 1 5 5v2`})]}),e===`delete`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 6h18`}),(0,y.jsx)(`path`,{...n,d:`M8 6V4h8v2`}),(0,y.jsx)(`path`,{...n,d:`m19 6-1 14H6L5 6`}),(0,y.jsx)(`path`,{...n,d:`M10 11v5`}),(0,y.jsx)(`path`,{...n,d:`M14 11v5`})]}),e===`fetch`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 5v12`}),(0,y.jsx)(`path`,{...n,d:`m7 12 5 5 5-5`}),(0,y.jsx)(`path`,{...n,d:`M5 20h14`})]}),e===`force-push`&&(0,y.jsx)(`path`,{...n,d:`M13 2 4 14h7l-1 8 10-13h-7l0-7Z`}),e===`merge`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`18`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`18`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v6`}),(0,y.jsx)(`path`,{...n,d:`M9 6h1a8 8 0 0 1 8 8v1`})]}),e===`move`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 12h18`}),(0,y.jsx)(`path`,{...n,d:`m8 7-5 5 5 5`}),(0,y.jsx)(`path`,{...n,d:`m16 7 5 5-5 5`})]}),e===`push`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 19V5`}),(0,y.jsx)(`path`,{...n,d:`m7 10 5-5 5 5`}),(0,y.jsx)(`path`,{...n,d:`M5 20h14`})]}),e===`rebase`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`18`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`12`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v6`}),(0,y.jsx)(`path`,{...n,d:`M9 6h2a7 7 0 0 1 7 7`})]}),e===`reset`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M4 7v6h6`}),(0,y.jsx)(`path`,{...n,d:`M20 17a8 8 0 0 1-14.9-4`}),(0,y.jsx)(`path`,{...n,d:`M4 13A8 8 0 0 1 19 8`})]}),e===`revert`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.7 2.7L3 8`}),(0,y.jsx)(`path`,{...n,d:`M3 3v5h5`})]}),e===`stage`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 5v14`}),(0,y.jsx)(`path`,{...n,d:`M5 12h14`})]}),e===`stash`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M4 4h16v6H4z`}),(0,y.jsx)(`path`,{...n,d:`M6 10v10h12V10`}),(0,y.jsx)(`path`,{...n,d:`M9 14h6`})]}),e===`tag`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M20 10 10 20 4 14V4h10l6 6Z`}),(0,y.jsx)(`circle`,{...n,cx:`9`,cy:`9`,r:`1`})]}),e===`unstage`&&(0,y.jsx)(`path`,{...n,d:`M5 12h14`}),e===`uncommit`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M9 14 4 9l5-5`}),(0,y.jsx)(`path`,{...n,d:`M4 9h10a6 6 0 0 1 0 12h-1`})]})]})}function sd({size:e=13}){return(0,y.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:e,height:e,viewBox:`0 0 24 24`,style:{flex:`0 0 auto`},children:(0,y.jsx)(`path`,{d:`M12 3a9 9 0 0 1 9 9`,fill:`none`,stroke:`currentColor`,strokeWidth:2.4,strokeLinecap:`round`,children:(0,y.jsx)(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 12 12`,to:`360 12 12`,dur:`0.8s`,repeatCount:`indefinite`})})})}function cd({label:e,onClick:t,tone:n,onMouseEnter:r,onMouseLeave:i}){let a=n===`success`?`#0b1020`:n===`warning`?`#fff7d6`:n===`merge`?`#fff7ff`:`#fff7ed`,o=n===`success`?`#6d9658`:n===`warning`?`#d8a43a`:n===`merge`?`#b764d9`:`#9a3412`,s=n===`success`?`#8dcf78`:n===`warning`?`#b88a25`:n===`merge`?`#c77de4`:`#b45309`,c=n===`success`?`#9cda89`:n===`warning`?`#c99a30`:n===`merge`?`#d08bea`:`#c26115`;return(0,y.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),t()},style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:104,height:30,padding:`0 12px`,background:s,border:`1px solid ${o}`,borderRadius:7,color:a,fontSize:10,fontWeight:700,cursor:`pointer`,fontFamily:`inherit`,whiteSpace:`nowrap`,position:`relative`,zIndex:8,boxShadow:`0 10px 24px rgba(0,0,0,0.35)`,gap:6,lineHeight:1},onMouseEnter:e=>{e.currentTarget.style.background=c},onMouseLeave:e=>{e.currentTarget.style.background=s},onPointerEnter:r,onPointerLeave:i,children:[(0,y.jsx)(od,{name:ad(e)}),(0,y.jsx)(`span`,{children:e})]})}function ld({label:e,onClick:t,tone:n,size:r=`default`,variant:i=`solid`,disabled:a=!1,loading:o=!1,iconOnly:s=!1}){let c=r===`compact`,l=i===`ghost`,u=a||o,d=n===`danger`?`#5c2430`:n===`warning`?`#7a4e11`:n===`success`?`#2c4231`:`#2f3348`,f=n===`danger`?`#6a2b39`:n===`warning`?`#8a5a16`:n===`success`?`#37523d`:`#3a4058`,p=n===`danger`?`#8b3a4a`:n===`warning`?`#d19128`:n===`success`?`#588a5c`:`#4a4f68`,m=n===`danger`?`#f5a6b8`:n===`warning`?`#f9d28b`:n===`success`?`#a6e3a1`:l?`#bac2de`:`#cdd6f4`;return(0,y.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),!u&&t()},disabled:u,"aria-busy":o||void 0,"aria-label":s?e:void 0,title:s?e:void 0,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:s?c?24:30:c?72:84,height:c?20:28,padding:s?0:c?`0 8px`:`0 10px`,background:l?`rgba(24,24,37,0.5)`:d,border:l?`1px solid transparent`:`1px solid ${p}`,color:m,fontSize:10,fontWeight:600,cursor:u?`default`:`pointer`,opacity:a&&!o?.62:1,borderRadius:c?6:7,fontFamily:`inherit`,whiteSpace:`nowrap`,gap:c?5:6,lineHeight:1},onMouseEnter:e=>{u||(e.currentTarget.style.background=l?`rgba(49,50,68,0.8)`:f)},onMouseLeave:e=>{u||(e.currentTarget.style.background=l?`rgba(24,24,37,0.5)`:d)},children:[o?(0,y.jsx)(sd,{size:c?12:13}):(0,y.jsx)(od,{name:ad(e),size:c?12:13}),!s&&(0,y.jsx)(`span`,{children:e})]})}var ud=2e4,dd=new Set([`g`,`path`,`circle`,`ellipse`,`line`,`polyline`,`polygon`,`rect`]),fd=new Set([`title`,`desc`,`metadata`]),pd={d:`d`,fill:`fill`,stroke:`stroke`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"stroke-miterlimit":`strokeMiterlimit`,"stroke-dasharray":`strokeDasharray`,"stroke-dashoffset":`strokeDashoffset`,"fill-rule":`fillRule`,"clip-rule":`clipRule`,opacity:`opacity`,"fill-opacity":`fillOpacity`,"stroke-opacity":`strokeOpacity`,transform:`transform`,cx:`cx`,cy:`cy`,r:`r`,rx:`rx`,ry:`ry`,x:`x`,y:`y`,x1:`x1`,x2:`x2`,y1:`y1`,y2:`y2`,width:`width`,height:`height`,points:`points`,"vector-effect":`vectorEffect`},md=new Set([`fill`,`stroke`]),hd=/^[+\-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?(?:px)?$/i,gd=/^[\d\s,.+\-eE]+$/,_d=/^[\d\s,.+\-eEa-zA-Z]+$/,vd=/^[\d\s,.+\-eEa-zA-Z()]+$/,yd=new Map;function bd(e){let t=e.trim().toLowerCase();return t===`none`||t===`transparent`?`none`:`currentColor`}function xd(e,t){let n=t.trim();return!n||n.length>5e3?null:md.has(e)?bd(n):e===`d`?_d.test(n)?n:null:e===`points`?gd.test(n)?n:null:e===`transform`?vd.test(n)?n:null:e===`vector-effect`?n===`non-scaling-stroke`?n:null:e===`fill-rule`||e===`clip-rule`?n===`evenodd`||n===`nonzero`?n:null:e===`stroke-linecap`?[`butt`,`round`,`square`].includes(n)?n:null:e===`stroke-linejoin`?[`arcs`,`bevel`,`miter`,`miter-clip`,`round`].includes(n)?n:null:e===`stroke-dasharray`?n===`none`||gd.test(n)?n:null:hd.test(n)?n.replace(/px$/i,``):null}function Sd(e){let t={};for(let n of e.attributes){let e=n.name.toLowerCase();if(e.startsWith(`on`)||e===`href`||e===`xlink:href`)continue;if(e===`style`){for(let e of n.value.split(`;`)){let n=e.indexOf(`:`);if(n===-1)continue;let r=e.slice(0,n).trim().toLowerCase(),i=pd[r];if(!i)continue;let a=xd(r,e.slice(n+1));a!==null&&(t[i]=a)}continue}let r=pd[e];if(!r)continue;let i=xd(e,n.value);i!==null&&(t[r]=i)}return t}function Cd(e){let t=e.getAttribute(`viewBox`);if(t){let e=t.trim().split(/[\s,]+/).map(Number);if(e.length===4&&e.every(Number.isFinite)&&e[2]>0&&e[3]>0)return e.join(` `)}let n=Number.parseFloat(e.getAttribute(`width`)??``),r=Number.parseFloat(e.getAttribute(`height`)??``);return Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0?`0 0 ${n} ${r}`:`0 0 24 24`}function J(e){let t=yd.get(e);if(t)return t;let n;if(!e.trim())n={value:null,error:`Paste a complete <svg> element.`};else if(e.length>2e4)n={value:null,error:`SVG must be smaller than ${ud.toLocaleString()} characters.`};else if(typeof DOMParser>`u`)n={value:null,error:`SVG parsing is unavailable in this environment.`};else try{let t=new DOMParser().parseFromString(e,`image/svg+xml`),r=t.querySelector(`parsererror`),i=t.documentElement;if(r||i.localName.toLowerCase()!==`svg`)n={value:null,error:`Paste one valid <svg> element.`};else{let e=0,t=null,r=n=>{let i=[];for(let a of n.children){let n=a.localName.toLowerCase();if(fd.has(n))continue;if(!dd.has(n))return t=`Unsupported SVG element: <${n}>.`,[];if(e+=1,e>250)return t=`SVG contains too many elements (maximum 250).`,[];let o=r(a);if(t)return[];i.push({tag:n,props:Sd(a),children:o})}return i},a=r(i);n=t?{value:null,error:t}:a.length===0?{value:null,error:`SVG does not contain a supported shape.`}:{value:{viewBox:Cd(i),rootProps:Sd(i),children:a},error:null}}}catch{n={value:null,error:`Could not parse this SVG.`}}return yd.size>=100&&yd.clear(),yd.set(e,n),n}function wd(e){return J(e).error}function Td(e,t){return(0,b.createElement)(e.tag,{...e.props,key:t},e.children.map((e,n)=>Td(e,`${t}-${n}`)))}function Ed({source:e,color:t,size:n=13}){let r=J(e);return r.value?(0,y.jsx)(`svg`,{fill:`currentColor`,stroke:`none`,...r.value.rootProps,"aria-hidden":`true`,focusable:`false`,x:-n/2,y:-n/2,width:n,height:n,viewBox:r.value.viewBox,style:{color:t,overflow:`visible`},children:r.value.children.map((e,t)=>Td(e,`custom-svg-${t}`))}):null}var Dd=[`accessibility`,`api`,`build`,`chore`,`ci`,`config`,`database`,`dependencies`,`docs`,`feature`,`fix`,`i18n`,`infra`,`merge`,`move`,`performance`,`refactor`,`release`,`rename`,`revert`,`security`,`style`,`test`,`ui`];function Od(e,t,n,...r){return{id:e,icon:e,label:t,enabled:!0,types:n,patterns:r}}var kd=[Od(`revert`,`Revert`,[`revert`],String.raw`\b(?:revert(?:ed|ing)?|rollbacks?)\b`),Od(`merge`,`Merge`,[`merge`],String.raw`\bmerg(?:e|ed|ing)\b`),Od(`security`,`Security`,[`security`,`sec`],String.raw`\b(?:security|vulnerabilit(?:y|ies)|cve|xss|csrf)\b`),Od(`fix`,`Fix`,[`fix`,`bugfix`,`hotfix`],String.raw`\b(?:fix(?:es|ed|ing)?|bugs?|bugfix(?:es)?|hotfix(?:es)?)\b`),Od(`feature`,`Feature`,[`feat`,`feature`],String.raw`\b(?:feat|feature)s?\b`),Od(`performance`,`Performance`,[`perf`,`performance`],String.raw`\b(?:perf|performance|optimi[sz](?:e[ds]?|ing|ation)|speedups?)\b`),Od(`refactor`,`Refactor`,[`refactor`],String.raw`\b(?:refactor(?:s|ed|ing)?|restructur(?:e[ds]?|ing))\b`),Od(`move`,`Move`,[`move`],String.raw`\b(?:move[ds]?|moving|relocat(?:e[ds]?|ing))\b`),Od(`rename`,`Rename`,[`rename`],String.raw`\b(?:rename[ds]?|renaming)\b`),Od(`test`,`Tests`,[`test`,`tests`],String.raw`\b(?:tests?|specs?|coverage|e2e)\b`),Od(`docs`,`Documentation`,[`docs`,`doc`],String.raw`\b(?:docs?|documentation|readme|changelog)\b`),Od(`accessibility`,`Accessibility`,[`a11y`,`accessibility`],String.raw`\b(?:a11y|accessibility|aria|screen[\s-]?reader)\b`),Od(`i18n`,`Localization`,[`i18n`,`l10n`],String.raw`\b(?:i18n|l10n|internationali[sz]ation|locali[sz]ation|translations?)\b`),Od(`database`,`Database`,[`db`,`database`,`migration`],String.raw`\b(?:database|db|sql|schemas?|migrations?)\b`),Od(`api`,`API`,[`api`],String.raw`\b(?:apis?|graphql|grpc|rpc|endpoints?|webhooks?)\b`),Od(`ui`,`UI`,[`ui`,`ux`],String.raw`\b(?:ui|ux|frontend|layouts?|responsive)\b`),Od(`infra`,`Infrastructure`,[`infra`,`infrastructure`,`deploy`],String.raw`\b(?:infra|infrastructure|terraform|kubernetes|k8s|docker|deploy(?:ment|s|ed|ing)?)\b`),Od(`ci`,`CI`,[`ci`],String.raw`\b(?:ci|continuous[\s-]integration|github[\s-]actions?|workflows?|pipelines?)\b`),Od(`build`,`Build`,[`build`],String.raw`\b(?:builds?|built|bundl(?:e[ds]?|er|ing)|compil(?:e[ds]?|er|ing)|webpack|vite)\b`),Od(`dependencies`,`Dependencies`,[`deps`,`dependencies`,`dependency`],String.raw`\b(?:deps?|dependencies|dependency|packages?|lockfiles?|bump(?:s|ed|ing)?)\b`),Od(`release`,`Release`,[`release`],String.raw`\b(?:releases?|version(?:ing)?|publish(?:es|ed|ing)?)\b`),Od(`config`,`Configuration`,[`config`],String.raw`\b(?:config|configuration|settings?|environment)\b`,String.raw`(?:^|\s)\.env(?:\s|$)`),Od(`style`,`Style`,[`style`,`format`,`lint`],String.raw`\b(?:styles?|styling|css|themes?|format(?:ted|ting)?|lint(?:ed|ing)?)\b`),Od(`chore`,`Chore`,[`chore`],String.raw`\b(?:chores?|cleanup|housekeeping|maintenance)\b`)],Ad=/^([a-z][a-z0-9-]*)(?:\([^)]*\))?!?:/i,jd=new Map;function Md(e){if(jd.has(e))return jd.get(e)??null;try{let t=new RegExp(e,`i`);return jd.set(e,t),t}catch{return jd.set(e,null),null}}function Nd(e){if(!e.trim())return`Pattern cannot be empty.`;try{return new RegExp(e,`i`),null}catch(e){return e instanceof Error?e.message:`Invalid regular expression.`}}function Pd(e,t=kd){let n=Ad.exec(e.trim())?.[1]?.toLowerCase();if(n){let e=t.find(e=>e.enabled&&e.types.some(e=>e.toLowerCase()===n));if(e)return e}return t.find(t=>t.enabled&&t.patterns.some(t=>Md(t)?.test(e)===!0))??null}var Fd=`ingit.commitIconRules`,Id=1,Ld=200,Rd=50,zd=500;function Bd(e){return e.map(e=>({...e,types:[...e.types],patterns:[...e.patterns]}))}function Vd(e){return JSON.stringify({version:Id,rules:e})}function Hd(e){return typeof e==`string`&&Dd.includes(e)}function Ud(e,t){if(!Array.isArray(e)||e.length>Rd)return null;let n=[];for(let r of e){if(typeof r!=`string`)return null;let e=r.trim();if(!e||e.length>t)return null;n.push(e)}return n}function Wd(e){if(e===null)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return null;let{version:n,rules:r}=t;if(n!==Id||!Array.isArray(r)||r.length>Ld)return null;let i=new Set,a=[];for(let e of r){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.id==`string`?t.id.trim():``,r=typeof t.label==`string`?t.label.trim():``,o=Ud(t.types,80),s=Ud(t.patterns,zd),c=t.customSvg===void 0?void 0:typeof t.customSvg==`string`?t.customSvg.trim():null;if(!n||n.length>100||i.has(n)||!r||r.length>100||!Hd(t.icon)||typeof t.enabled!=`boolean`||o===null||s===null||c===null||c!==void 0&&(!c||c.length>2e4)||c!==void 0&&typeof DOMParser<`u`&&wd(c)!==null||s.some(e=>Nd(e)!==null))return null;i.add(n),a.push({id:n,label:r,icon:t.icon,enabled:t.enabled,types:o,patterns:s,...c===void 0?{}:{customSvg:c}})}return a}catch{return null}}function Gd(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function Kd(){let e=Gd();if(!e)return Bd(kd);try{return Wd(e.getItem(Fd))??Bd(kd)}catch{return Bd(kd)}}var qd=Kd(),Jd=new Set;function Yd(e){qd=e;for(let e of Jd)e()}function Xd(e){e.key!==null&&e.key!==Fd||Yd(Wd(e.newValue)??Bd(kd))}function Zd(e){let t=Jd.size===0;return Jd.add(e),t&&typeof window<`u`&&window.addEventListener(`storage`,Xd),()=>{Jd.delete(e),Jd.size===0&&typeof window<`u`&&window.removeEventListener(`storage`,Xd)}}function Qd(){return(0,b.useSyncExternalStore)(Zd,()=>qd,()=>kd)}function $d(e){let t=Wd(Vd(e));if(!t)return!1;let n=Gd();if(!n)return!1;try{n.setItem(Fd,Vd(t))}catch{return!1}return Yd(t),!0}function ef(){let e=Gd();if(!e)return!1;try{e.removeItem(Fd)}catch{return!1}return Yd(Bd(kd)),!0}var Y={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function tf({icon:e,color:t,size:n=13,customSvg:r}){return r?(0,y.jsx)(Ed,{source:r,color:t,size:n}):(0,y.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,x:-n/2,y:-n/2,width:n,height:n,viewBox:`0 0 24 24`,style:{color:t,overflow:`visible`},children:[e===`accessibility`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`4`,r:`2`}),(0,y.jsx)(`path`,{...Y,d:`M5 8h14M12 6v7M8 21l4-8 4 8M7 13l5-2 5 2`})]}),e===`api`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M9 3v5M15 3v5M7 8h10v3a5 5 0 0 1-5 5v5`}),(0,y.jsx)(`path`,{...Y,d:`M8 12h8`})]}),e===`build`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m14 5 5 5M16 3l5 5-3 3-5-5 3-3Z`}),(0,y.jsx)(`path`,{...Y,d:`M14.5 8.5 4 19l1 1L15.5 9.5`})]}),e===`chore`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m20 3-9 9M11 10l3 3`}),(0,y.jsx)(`path`,{...Y,d:`m11 10-7 7 3 3 7-7-3-3ZM3 21h9`})]}),e===`ci`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`6`,r:`2.5`}),(0,y.jsx)(`circle`,{...Y,cx:`18`,cy:`6`,r:`2.5`}),(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`18`,r:`2.5`}),(0,y.jsx)(`path`,{...Y,d:`M8.5 6h7M7.4 8.2l3.2 7.6M16.6 8.2l-3.2 7.6`})]}),e===`config`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M4 6h10M18 6h2M4 12h2M10 12h10M4 18h8M16 18h4`}),(0,y.jsx)(`circle`,{...Y,cx:`16`,cy:`6`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`8`,cy:`12`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`14`,cy:`18`,r:`2`})]}),e===`database`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`ellipse`,{...Y,cx:`12`,cy:`5`,rx:`7`,ry:`3`}),(0,y.jsx)(`path`,{...Y,d:`M5 5v6c0 1.7 3.1 3 7 3s7-1.3 7-3V5M5 11v6c0 1.7 3.1 3 7 3s7-1.3 7-3v-6`})]}),e===`dependencies`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m12 3 9 5-9 5-9-5 9-5Z`}),(0,y.jsx)(`path`,{...Y,d:`M3 8v8l9 5 9-5V8M12 13v8`})]}),e===`docs`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 6a6 6 0 0 0-8-2v15a6 6 0 0 1 8 2V6Z`}),(0,y.jsx)(`path`,{...Y,d:`M12 6a6 6 0 0 1 8-2v15a6 6 0 0 0-8 2V6Z`})]}),e===`feature`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3c.6 3.2 1.8 4.4 5 5-3.2.6-4.4 1.8-5 5-.6-3.2-1.8-4.4-5-5 3.2-.6 4.4-1.8 5-5Z`}),(0,y.jsx)(`path`,{...Y,d:`M19 15c.3 1.7 1 2.4 2.7 2.7-1.7.3-2.4 1-2.7 2.7-.3-1.7-1-2.4-2.7-2.7 1.7-.3 2.4-1 2.7-2.7Z`})]}),e===`fix`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`7`,y:`6`,width:`10`,height:`14`,rx:`5`}),(0,y.jsx)(`path`,{...Y,d:`M9 6 7 3M15 6l2-3M3 10h4M17 10h4M3 15h4M17 15h4M9 11h.01M15 11h.01M12 14v6`})]}),e===`i18n`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`12`,r:`9`}),(0,y.jsx)(`path`,{...Y,d:`M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18`})]}),e===`infra`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`3`,y:`4`,width:`18`,height:`6`,rx:`2`}),(0,y.jsx)(`rect`,{...Y,x:`3`,y:`14`,width:`18`,height:`6`,rx:`2`}),(0,y.jsx)(`path`,{...Y,d:`M7 7h.01M7 17h.01M11 7h7M11 17h7`})]}),e===`merge`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`5`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`18`,cy:`19`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`19`,r:`2`}),(0,y.jsx)(`path`,{...Y,d:`M6 7v10M8 5h2a8 8 0 0 1 8 8v4`})]}),e===`move`&&(0,y.jsx)(`path`,{...Y,d:`M12 3v18M3 12h18M8 7l4-4 4 4M8 17l4 4 4-4M7 8l-4 4 4 4M17 8l4 4-4 4`}),e===`performance`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M4 18a8 8 0 1 1 16 0M12 18l4-5M6.5 10l1 1M12 7v2M17.5 10l-1 1`}),(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`18`,r:`1`})]}),e===`refactor`&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`path`,{...Y,d:`m8 7 4-4 4 4M12 3v7M18 10l3 4-3 4M21 14h-7M8 21l-4-4 4-4M4 17h7`})}),e===`release`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M14 4c3-2 5-1 6 0s2 3 0 6l-6 6-6-6 6-6Z`}),(0,y.jsx)(`circle`,{...Y,cx:`16`,cy:`8`,r:`1.5`}),(0,y.jsx)(`path`,{...Y,d:`M8 10H5l-2 4 5 1M14 16v3l-4 2-1-5M7 17l-2 2`})]}),e===`rename`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m14 5 5 5M4 20l3.5-.8L20 6.7 17.3 4 4.8 16.5 4 20Z`}),(0,y.jsx)(`path`,{...Y,d:`M3 22h9`})]}),e===`revert`&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`path`,{...Y,d:`m9 7-5 5 5 5M4 12h10a6 6 0 0 1 6 6v2`})}),e===`security`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3 20 6v6c0 5-3.4 8-8 10-4.6-2-8-5-8-10V6l8-3Z`}),(0,y.jsx)(`path`,{...Y,d:`m8.5 12 2.2 2.2 4.8-5`})]}),e===`style`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3a9 9 0 0 0 0 18h1.5a2 2 0 0 0 0-4H12a2 2 0 0 1 0-4h3a6 6 0 0 0 0-12h-3Z`}),(0,y.jsx)(`path`,{...Y,d:`M7.5 10h.01M9 6.5h.01M14 6.5h.01M17 9h.01`})]}),e===`test`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M9 3h6M10 3v6l-5 9a2 2 0 0 0 2 3h10a2 2 0 0 0 2-3l-5-9V3`}),(0,y.jsx)(`path`,{...Y,d:`M7.5 15h9`})]}),e===`ui`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,y.jsx)(`path`,{...Y,d:`M9 4v16M9 10h12`})]})]})}function nf(e,t,n,r,i){if(e.length===0)return null;let a=Math.min(t,n),o=Math.max(t,n),s=[...new Set(e.map(e=>e.x))].sort((e,t)=>e-t),c=new Set(e.filter(e=>e.idx>a&&e.idx<o).map(e=>e.x)),l=e.find(e=>e.idx===n)?.x,u=l===void 0?[]:s.filter(e=>i===`left`?e<=l:e>=l).sort((e,t)=>i===`left`?t-e:e-t);for(let e of u)if(!c.has(e))return e;return i===`left`?s[0]-r:s[s.length-1]+r}function rf(e,t,n){return e.map((r,i)=>{let a=e.length-i;return{...r,y:t.y-a*n,idx:t.idx-a}})}function af({baseZoom:e,bounds:t,viewport:n,scroll:r,margin:i}){let a=t.minX*e-r.x,o=t.maxX*e-r.x,s=t.minY*e-r.y,c=t.maxY*e-r.y;if(a>=i&&o<=n.width-i&&s>=i&&c<=n.height-i)return{zoom:e,translateX:0,translateY:0};let l=Math.max(1,t.maxX-t.minX),u=Math.max(1,t.maxY-t.minY),d=Math.max(1,n.width-i*2),f=Math.max(1,n.height-i*2),p=Math.max(.05,Math.min(e,d/l,f/u)),m=t.minX*p-r.x,h=t.maxX*p-r.x,g=t.minY*p-r.y,_=t.maxY*p-r.y,v=(e,t,n)=>{let r=i-e,a=n-i-t;return Math.min(a,Math.max(r,0))};return{zoom:p,translateX:v(m,h,n.width),translateY:v(g,_,n.height)}}function of(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1;return{x:e.x+r/a*n,y:e.y+i/a*n}}function sf(e,t,n,r,i){let a=1-i,o=a**3,s=3*a**2*i,c=3*a*i**2,l=i**3;return{x:e.x*o+t.x*s+n.x*c+r.x*l,y:e.y*o+t.y*s+n.y*c+r.y*l}}function cf(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return(e.x-t.x)**2+(e.y-t.y)**2;let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a)),s=t.x+o*r,c=t.y+o*i;return(e.x-s)**2+(e.y-c)**2}function lf(e,t,n,r,i){let a=r.nodeRadius-1,o=of(e,t,a),s=of(t,e,a),c=s.y-o.y,l={x:o.x,y:o.y+c*r.curveControlRatio},u={x:s.x,y:s.y-c*r.curveControlRatio},d=(r.nodeRadius+r.clearance)**2,f=Math.max(32,Math.ceil(Math.hypot(s.x-o.x,s.y-o.y)/4)),p=Math.min(e.idx,t.idx)+1,m=Math.max(e.idx,t.idx)-1,h=[];for(let t=p;t<=m;t++){let a=n[t],o=[...a===void 0?[]:[a],...i?.get(t)??[]];for(let n of o)h.push({x:e.x+(n-e.lane)*r.laneWidth,y:e.y+(t-e.idx)*r.rowHeight})}let g=o;for(let e=1;e<=f;e++){let t=sf(o,l,u,s,e/f);if(h.some(e=>cf(e,g,t)<=d))return!0;g=t}return!1}function uf(e,t,n,r,i){let a=r===`from`?e.lane:t.lane,o=Math.min(e.idx,t.idx)+1,s=Math.max(e.idx,t.idx)-1;for(let e=o;e<=s;e++)if(n[e]===a||i?.get(e)?.includes(a))return!1;return!0}function df(e,t,n,r,i){if(!uf(e,t,n,r,i))return null;let a=r===`from`?e:t,o=r===`from`?t:e;return{side:a.x<=o.x?`left`:`right`,anchorLane:a.lane,innerLane:o.lane,outerRailX:a.x}}function ff(e,t,n,r,i,a){if(Math.abs(t.idx-e.idx)<2||!lf(e,t,n,r,a))return null;if(uf(e,t,n,i,a))return i;let o=i===`from`?`to`:`from`;return uf(e,t,n,o,a)?o:null}var pf={position:`fixed`,inset:0,margin:`auto`,width:`min(420px, calc(100vw - 32px))`,padding:0,border:`1px solid #45475a`,borderRadius:8,background:`#1e1e2e`,color:`#cdd6f4`,boxShadow:`0 22px 64px rgba(0,0,0,0.58)`},mf={display:`flex`,flexDirection:`column`,gap:14,padding:18,fontFamily:`system-ui, -apple-system, sans-serif`},hf={margin:0,color:`#f5e0dc`,fontSize:16,fontWeight:700,lineHeight:1.25},gf={height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #45475a`,background:`#181825`,color:`#bac2de`,fontSize:12,fontWeight:700,fontFamily:`inherit`,cursor:`pointer`},_f={height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #6d9658`,background:`#8dcf78`,color:`#0b1020`,fontSize:12,fontWeight:800,fontFamily:`inherit`,cursor:`pointer`};function vf({open:e,title:t,label:n,initialValue:r=``,confirmLabel:i,allowEmpty:a=!1,placeholder:o,onSubmit:s,onClose:c}){let l=(0,b.useRef)(null),u=(0,b.useRef)(null),[d,f]=(0,b.useState)(r);return(0,b.useEffect)(()=>{e&&f(r)},[r,e]),(0,b.useEffect)(()=>{let t=l.current;if(t){if(e){t.open||t.showModal(),requestAnimationFrame(()=>u.current?.focus());return}t.open&&t.close()}},[e]),(0,y.jsx)(`dialog`,{ref:l,"aria-labelledby":`text-input-dialog-title`,onCancel:c,onClose:c,onClick:e=>{e.target===e.currentTarget&&c()},style:pf,children:(0,y.jsxs)(`form`,{method:`dialog`,onSubmit:e=>{e.preventDefault();let t=d.trim();if(!a&&!t){u.current?.focus();return}s(t)},onClick:e=>e.stopPropagation(),style:mf,children:[(0,y.jsx)(`h2`,{id:`text-input-dialog-title`,style:hf,children:t}),(0,y.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:7,color:`#bac2de`,fontSize:12,fontWeight:700},children:[n,(0,y.jsx)(`input`,{ref:u,value:d,onChange:e=>f(e.target.value),required:!a,placeholder:o,autoComplete:`off`,spellCheck:!1,style:{height:34,padding:`0 10px`,borderRadius:6,border:`1px solid #45475a`,background:`#11111b`,color:`#cdd6f4`,fontSize:13,fontFamily:`inherit`,outline:`none`}})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,paddingTop:2},children:[(0,y.jsx)(`button`,{type:`button`,onClick:c,style:gf,children:`Cancel`}),(0,y.jsx)(`button`,{type:`submit`,value:`confirm`,style:_f,children:i})]})]})})}function yf({open:e,title:t,message:n,confirmLabel:r,onConfirm:i,onClose:a}){let o=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let t=o.current;if(t){if(e){t.open||t.showModal();return}t.open&&t.close()}},[e]),(0,y.jsx)(`dialog`,{ref:o,"aria-labelledby":`confirm-dialog-title`,onCancel:a,onClose:a,onClick:e=>{e.target===e.currentTarget&&a()},style:pf,children:(0,y.jsxs)(`form`,{method:`dialog`,onSubmit:e=>{e.preventDefault(),i()},onClick:e=>e.stopPropagation(),style:mf,children:[(0,y.jsx)(`h2`,{id:`confirm-dialog-title`,style:hf,children:t}),(0,y.jsx)(`p`,{style:{margin:0,color:`#bac2de`,fontSize:13,lineHeight:1.45},children:n}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,paddingTop:2},children:[(0,y.jsx)(`button`,{type:`button`,onClick:a,style:gf,children:`Cancel`}),(0,y.jsx)(`button`,{type:`submit`,value:`confirm`,style:_f,children:r})]})]})})}var bf=20,X=16,xf=`#11111b`,Sf=20,Cf=30,wf=28,Tf=24,Ef=112,Df=X-5,Of=`#1e1e2e`,kf=`#45475a`,Af=`#cdd6f455`,jf=`#cdd6f422`,Mf=`#a6e3a1`,Nf=`#f38ba8`,Pf=`#a6e3a1`,Ff=2,If=.85,Lf=12,Rf=6,zf=30,Bf=6,Vf=6,Hf=3,Uf={mass:2.1,tension:180,friction:28},Wf=220,Gf=900,Kf=`cubic-bezier(0.22, 1, 0.36, 1)`,qf=6,Jf=14,Yf=`600 11px system-ui, -apple-system, sans-serif`,Xf=56*.55,Zf=56*.3,Qf=54,$f={laneWidth:80,rowHeight:56,nodeRadius:X,clearance:2,curveControlRatio:.3},ep=new Map;function tp(e){return Math.round((Sf-e)/2)}function np(e,t){return!!e&&e.action===t.action&&e.refName===t.refName&&e.sha===t.sha&&e.force===t.force}function rp(e){return!!e&&typeof e==`object`&&e.code===`CONFLICT`}function ip(e){if(!e||typeof e!=`object`)return null;let t=e.data;if(!t||typeof t!=`object`)return null;let n=t;return n.reason===`branch-in-use`&&typeof n.worktreePath==`string`?n.worktreePath:null}function ap(e){return e.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e}function op(e){let t=/^(v?)(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?{hasVPrefix:t[1]===`v`,major:Number(t[2]),minor:Number(t[3]),patch:Number(t[4])}:null}function sp(e,t){return e.major-t.major||e.minor-t.minor||e.patch-t.patch||Number(e.hasVPrefix)-Number(t.hasVPrefix)}function cp(e){let t=null;for(let n of e){if(n.kind!==`tag`)continue;let e=op(n.shortName);e&&(!t||sp(e,t)>0)&&(t=e)}return t?`${t.hasVPrefix?`v`:``}${t.major}.${t.minor}.${t.patch+1}`:``}function lp(e){return e?e.startsWith(`refs/remotes/`)?e.slice(13):e:null}function up(e,t){let n=lp(e.upstream);if(n)return t.find(e=>e.kind===`remote`&&e.shortName===n)??null;let r=t.find(t=>t.kind===`remote`&&t.shortName===`origin/${e.shortName}`);if(r)return r;let i=t.filter(t=>t.kind===`remote`&&t.shortName.endsWith(`/${e.shortName}`));return i.length===1?i[0]:null}function dp(e,t){return e.parentShas.length===t.parentShas.length&&e.parentShas.every((e,n)=>e===t.parentShas[n])}function fp(e,t,n,r){let i=rr(t.rows,n);if(r.kind===`commit`){let t=i.nodes.find(t=>!e.shaToNode.has(t.row.sha));if(!t)return null;let n=e.shaToNode.get(t.row.parentShas[0]);if(!n)return null;let r=e.nodes[0]??n,a={...t,x:n.x,y:r.y-56,idx:r.idx-1},o=`${a.row.sha}-${n.row.sha}`,s=wp(a,n,o,e.nodes.map(e=>e.row.lane));return{nodes:[{node:a,color:Pf}],edges:[{key:o,path:Ep(a,n,s,0),color:Pf,dashed:!0}]}}let a=new Set;for(let t of i.nodes){let n=e.shaToNode.get(t.row.sha);(!n||!dp(n.row,t.row))&&a.add(t.row.sha)}let o=t.refs.find(e=>e.kind===`head`&&e.isCurrent),s=[],c=new Set,l=o?.targetSha;for(;l&&!c.has(l);){c.add(l);let e=i.shaToNode.get(l);if(!e)break;s.push(e),l=e.row.parentShas[0]}let u=s.findIndex(e=>a.has(e.row.sha)),d=u>=0?s.slice(0,u+1):t.headSha?[i.shaToNode.get(t.headSha)].filter(e=>!!e):[];if(d.length===0)return null;let f=t.refs.find(e=>e.shortName===r.targetRefName),p=f?.peeledSha??f?.targetSha,m=p?e.shaToNode.get(p)??i.shaToNode.get(p):null,h=m?d.map(e=>({...e,x:m.x,row:{...e.row,lane:m.row.lane}})):d,g=m??e.nodes[0];if(!g)return null;let _=rf(h,g,56),v=new Set(_.map(e=>e.row.sha)),y=new Map(_.map(e=>[e.row.sha,e])),b=i.nodes.map(e=>e.row.lane),x=[];for(let t of _)for(let n=0;n<t.row.parentShas.length;n++){let r=t.row.parentShas[n],a=v.has(r)?y.get(r):e.shaToNode.get(r)??i.shaToNode.get(r);if(!a)continue;let o=`action-preview:${t.row.sha}-${a.row.sha}`,s=wp(t,a,o,b,{adjacentTrack:n>0?`to`:`from`});x.push({key:o,path:Ep(t,a,s,0),color:Pf,dashed:!0})}return{nodes:[..._.map(e=>({node:e,color:Pf}))],edges:x,gutterX:m?m.x-Qf/2:void 0}}function pp(e,t,n,r){if(e===n)return`M${e},${t}L${n},${r}`;let i=r-t;return`M${e},${t}C${e},${t+i*.3} ${n},${r-i*.3} ${n},${r}`}function mp(e,t,n,r,i){let a=n-e,o=r-t,s=Math.hypot(a,o)||1;return{x:e+a/s*i,y:t+o/s*i}}function hp(e,t){if(e.length===0)return``;if(e.length===1)return`M${e[0].x},${e[0].y}`;let n=`M${e[0].x},${e[0].y}`;for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=a.x-i.x,c=a.y-i.y,l=o.x-a.x,u=o.y-a.y,d=Math.hypot(s,c),f=Math.hypot(l,u);if(d<.001||f<.001){n+=`L${a.x},${a.y}`;continue}let p=Math.min(t,d/2,f/2),m=a.x-s/d*p,h=a.y-c/d*p,g=a.x+l/f*p,_=a.y+u/f*p;n+=`L${m},${h}Q${a.x},${a.y} ${g},${_}`}let r=e[e.length-1];return n+=`L${r.x},${r.y}`,n}function gp(e,t,n){let r=Math.abs(t.idx-e.idx),i=Math.min(e.y,t.y),a=Qn(n),o=r>12?[.28,.42,.56,.7]:[.35,.5,.65],s=o[a%o.length]??.5,c=Math.max(0,Math.min(r-1,Math.round((r-1)*s))),l=((a>>3)%3-1)*4;return i+56*(c+.5)+l}function _p(e,t,n,r){let i=Math.max(0,Math.min(t,n)+1),a=Math.min(e.length-1,Math.max(t,n)-1),o=0;for(let t=i;t<=a;t++){let n=e[t];r(n,t)&&o++}return o}function vp(e,t,n,r,i){let a=Math.max(0,Math.min(t,n)),o=Math.min(r.length-1,Math.max(t,n));for(let t=a;t<=o;t++)if(r[t]===e||i?.get(t)?.includes(e))return!1;return!0}function yp(e,t,n,r=!1,i=0,a=X){let o=t.y>e.y?1:-1,s=e.y+o*24,c=Math.max(1,a-1);if(!r&&Math.abs(n-t.x)<.001&&Math.abs(e.x-t.x)>.001){let n=e.x<t.x?-1:1,r=-o,i=c*Math.SQRT1_2,a={x:t.x+n*i,y:t.y+r*i},l={x:a.x+n*18*Math.SQRT1_2,y:a.y+r*18*Math.SQRT1_2},u=l.x;return hp([mp(e.x,e.y,u,s,X-1),{x:u,y:s},l,a],5)}let l=Math.abs(n-e.x)<.001&&Math.abs(e.x-t.x)>.001,u=n,d;if(l){let n=t.x<e.x?-1:1,r=(X-1)*Math.SQRT1_2,i={x:e.x+n*r,y:e.y+o*r},a={x:i.x+n*18*Math.SQRT1_2,y:i.y+o*18*Math.SQRT1_2};u=a.x,d=[i,a]}else d=[mp(e.x,e.y,n,s,X-1),{x:n,y:s}];let f=r?Math.max(-c,Math.min(c,i)):i,p=r?t.y+f:t.y-o*24,m=r?{x:t.x+Math.sign(u-t.x||1)*Math.sqrt(Math.max(0,c**2-f**2)),y:p}:mp(t.x,t.y,u,p,c);return hp([...d,{x:u,y:p},m],Lf)}function bp(e,t,n,r=0,i=X){let a=t.y>e.y?1:-1,o=e.y+a*24,s=Math.abs(n-t.x)>.001,c=Math.max(1,i-1);if(!s&&Math.abs(e.x-t.x)>.001){let n=e.x<t.x?-1:1,r=-a,i=c*Math.SQRT1_2,s={x:t.x+n*i,y:t.y+r*i},l={x:s.x+n*18*Math.SQRT1_2,y:s.y+r*18*Math.SQRT1_2},u=l.x;return hp([mp(e.x,e.y,u,o,X-1),{x:u,y:o},l,s],5)}let l=Math.abs(n-e.x)<.001&&Math.abs(e.x-t.x)>.001,u=n,d;if(l){let n=t.x<e.x?-1:1,r=(X-1)*Math.SQRT1_2,i={x:e.x+n*r,y:e.y+a*r},o={x:i.x+n*18*Math.SQRT1_2,y:i.y+a*18*Math.SQRT1_2};u=o.x,d=[i,o]}else d=[mp(e.x,e.y,n,t.y,X-1),{x:n,y:o}];let f=s?Math.max(-c,Math.min(c,r)):0,p=t.y+f,m=s?{x:t.x+Math.sign(u-t.x)*Math.sqrt(Math.max(0,c**2-f**2)),y:p}:mp(t.x,t.y,u,p,c);return hp([...d,{x:u,y:p},m],Lf)}function xp(e,t,n,r,i){let a=mp(e.x,e.y,t.x,t.y,X-1),o=mp(t.x,t.y,e.x,e.y,X-1),s=t.y>e.y?1:-1,c=e.y+s*24,l=t.y-s*24;return hp([a,{x:n,y:c},{x:n,y:i},{x:r,y:i},{x:r,y:l},o],Lf)}function Sp(e,t,n=0,r=X,i){if(Math.abs(e.x-t.x)<.001&&Math.abs(n)>.001){let a=t.y>e.y?1:-1,o=X-1,s=Math.max(1,r-1),c=Math.max(-Math.min(o,s),Math.min(Math.min(o,s),n)),l=Math.sqrt(Math.max(0,s**2-c**2)),u=Math.abs(t.y-e.y),d=i===void 0?34:Math.abs(i-e.y),f=Math.min(u/2,34),p=Math.max(f,u-l-8),m=Math.max(f,Math.min(p,d)),h=e.y+a*m,g=h-a*10,_={x:t.x+c,y:t.y-a*l};return hp([{x:e.x,y:e.y+a*o},{x:e.x,y:g},{x:e.x+c,y:h},_],Math.min(Lf,6))}let a=mp(e.x,e.y,t.x,t.y,X-1),o=mp(t.x,t.y,e.x,e.y,Math.max(1,r-1));return`M${a.x},${a.y}L${o.x},${o.y}`}function Cp(e,t,n,r=X,i){if(n){let a=Math.max(1,r-1),o=t.y>=e.y?1:-1,s=X-1,c=s*Math.SQRT1_2,l=i?{x:e.x+(i===`left`?-c:c),y:e.y+o*c}:{x:e.x,y:e.y+o*s},u={x:t.x+(n===`left`?-a:a),y:t.y},d=Math.min(18,Math.hypot(u.x-l.x,u.y-l.y)*.2);return hp([l,{x:l.x+(i===`left`?-d*Math.SQRT1_2:i===`right`?d*Math.SQRT1_2:0),y:l.y+o*(i?d*Math.SQRT1_2:d)},{x:u.x+(n===`left`?-d:d),y:u.y},u],Math.min(5,d/2))}let a=mp(e.x,e.y,t.x,t.y,X-1),o=mp(t.x,t.y,e.x,e.y,X-1);return pp(a.x,a.y,o.x,o.y)}function wp(e,t,n,r,i={}){let a=Math.abs(e.row.lane-t.row.lane),o=Math.abs(t.idx-e.idx);if(a===0)return{mode:`straight`};if(a===1&&o>=Rf)return{mode:`adjacent-hook`,laneA:Math.min(e.row.lane,t.row.lane),laneB:Math.max(e.row.lane,t.row.lane),track:i.adjacentTrack??`from`};if(o<Rf){let n=i.adjacentTrack??`from`,a=ff({x:e.x,y:e.y,idx:e.idx,lane:e.row.lane},{x:t.x,y:t.y,idx:t.idx,lane:t.row.lane},r,$f,n,i.additionalOccupiedLanes);return a?{mode:`occlusion-hook`,laneA:Math.min(e.row.lane,t.row.lane),laneB:Math.max(e.row.lane,t.row.lane),track:a}:{mode:`curve`}}let s=i.adjacentTrack??`from`,c={x:e.x,y:e.y,idx:e.idx,lane:e.row.lane},l={x:t.x,y:t.y,idx:t.idx,lane:t.row.lane};if(s===`to`&&e.row.lane*t.row.lane<0){let n=e.row.lane<0?-1:1,a=e.row.lane+n;if(vp(a,e.idx,t.idx,r,i.additionalOccupiedLanes))return{mode:`outer-rail`,side:n<0?`left`:`right`,anchorLane:a,innerLane:t.row.lane,outerRailX:e.x+n*80,horizontalTargetJoin:!0}}let u=df(c,l,r,s,i.additionalOccupiedLanes);if(u)return{mode:`outer-rail`,...u,horizontalTargetJoin:!0};let d=Math.min(e.row.lane,t.row.lane),f=Math.max(e.row.lane,t.row.lane),p=Qn(n)%3*Bf,m=t.x>e.x?1:-1,h=zf+p,g=e.x+m*h,_=t.x-m*h,v=gp(e,t,n),y=Math.max(e.x,t.x),b=Math.min(e.x,t.x),x=_p(r,e.idx,t.idx,e=>e>d&&e<f),S=_p(r,e.idx,t.idx,e=>e<d),C=_p(r,e.idx,t.idx,e=>e>f),w=e.x<t.x?`left`:(e.x,t.x,`right`),T=x*5+a,E=S*2+(w===`left`?0:.5),ee=C*2+(w===`right`?0:.5);return ee<=E&&ee<T?{mode:`outer-rail`,side:`right`,anchorLane:f,innerLane:d,outerRailX:y}:E<T?{mode:`outer-rail`,side:`left`,anchorLane:d,innerLane:f,outerRailX:b}:{mode:`inside-rail`,minLane:d,maxLane:f,sourceRailX:g,targetRailX:_,crossoverY:v}}function Tp(e,t){let n=e=>`vertical:${Math.round(e*1e3)/1e3}`;switch(t.mode){case`straight`:return n(e.from.x);case`outer-rail`:return n(t.outerRailX);case`inside-rail`:return`${t.mode}:${t.minLane}:${t.maxLane}`;case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return n(t.track===`to`?e.to.x:e.from.x);default:return null}}function Ep(e,t,n,r,i=0,a=X){switch(n.mode){case`straight`:return Sp(e,t,r,a,n.bundleJoinY);case`curve`:return Cp(e,t,n.targetSide,a,n.sourceSide);case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return bp(e,t,(n.track===`to`?t.x:e.x)+r,i,a);case`inside-rail`:return xp(e,t,n.sourceRailX+r,n.targetRailX+r,n.crossoverY);case`outer-rail`:return yp(e,t,n.outerRailX+r,n.horizontalTargetJoin,i,a)}}function Dp(e,t,n){if(e.mode!==t.mode)return n<.5?e:t;switch(t.mode){case`straight`:{let r=e;return{mode:`straight`,bundleJoinY:r.bundleJoinY===void 0?t.bundleJoinY:t.bundleJoinY===void 0?r.bundleJoinY:Z(r.bundleJoinY,t.bundleJoinY,n)}}case`curve`:return t;case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return t;case`inside-rail`:{let r=e;return{...t,sourceRailX:Z(r.sourceRailX,t.sourceRailX,n),targetRailX:Z(r.targetRailX,t.targetRailX,n),crossoverY:Z(r.crossoverY,t.crossoverY,n)}}case`outer-rail`:{let r=e;return{...t,outerRailX:Z(r.outerRailX,t.outerRailX,n)}}}}function Op(e,t){return Ep({x:Z(e.fromX1,e.toX1,t),y:Z(e.fromY1,e.toY1,t)},{x:Z(e.fromX2,e.toX2,t),y:Z(e.fromY2,e.toY2,t)},Dp(e.fromPlan,e.toPlan,t),Z(e.fromBundleOffset,e.toBundleOffset,t),Z(e.fromTargetJoinOffset,e.toTargetJoinOffset,t),Z(e.fromTargetNodeRadius,e.toTargetNodeRadius,t))}function kp(e){if(e.length===0)return 0;let t=e.map(e=>e.locChanged).sort((e,t)=>e-t);return t[Math.max(0,Math.ceil(t.length*If)-1)]??t[t.length-1]??0}function Ap(e,t,n,r){let i=+(r===`right`);return`M ${e} ${t-n} A ${n} ${n} 0 0 ${i} ${e} ${t+n} L ${e} ${t-n} Z`}function jp(e,t,n,r){let i=+(r===`right`);return`M ${e} ${t-n} A ${n} ${n} 0 0 ${i} ${e} ${t+n}`}function Mp(e,t,n){if(e<=0||t<=0)return 0;let r=n*Math.min(e/t,1);return Math.max(Ff,r)}var Np=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Pp(e){return e>=1.4}function Fp(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Ip(e,t){return Fp(e,t)&&e.getHours()===t.getHours()}function Lp(e){return`${Np[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`}function Rp(e){return`${`${e.getHours()}`.padStart(2,`0`)}:${`${e.getMinutes()}`.padStart(2,`0`)}`}function zp(e,t){return Pp(t)?`${Lp(e)} ${Rp(e)}`:Lp(e)}function Bp(e,t){if(e.length===0)return[];let n=Pp(t),r=[],i=null,a=-1/0;for(let o of e){let e=new Date(o.row.committerUnix*1e3),s=o.y*t,c=!i||!Fp(e,i),l=!i||e.getMonth()!==i.getMonth()||e.getFullYear()!==i.getFullYear(),u=!i||!Ip(e,i);i=e;let d=null;if(n?c?d={key:`${o.row.sha}:day`,text:Lp(e),y:s,kind:`month`}:u&&(d={key:`${o.row.sha}:hour`,text:Rp(e),y:s,kind:`hour`}):c&&(d={key:`${o.row.sha}:day`,text:l?Lp(e):`${e.getDate()}`,y:s,kind:l?`month`:`day`}),!d)continue;let f=d.kind===`hour`?34:22;s-a<f||(r.push(d),a=s)}return r}function Vp(e,t,n){if(e.length===0)return null;let r=t/n,i=Math.max(0,Math.min(e.length-1,Math.floor((r-40-112)/56)));for(;i+1<e.length&&e[i+1].y*n<=t;)i++;return e[i]??e[0]??null}function Hp(e){return e.includes(`/`)}function Up(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Wp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.sha!==i.sha||r.row!==i.row||r.lane!==i.lane||r.parentShas.length!==i.parentShas.length||!Up(r.refNames,i.refNames))return!1;for(let e=0;e<r.parentShas.length;e++)if(r.parentShas[e]!==i.parentShas[e])return!1}return!0}function Gp(e,t){if(t.length<=e.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.sha!==i.sha||r.row!==i.row||r.lane!==i.lane||!Up(r.refNames,i.refNames))return!1}return!0}function Kp(e,t){return!(!e||!t||e.length===0||t.length===0||Wp(e,t)||Gp(e,t))}function qp(e,t){return e?`☁ `:t?`● `:`⎇ `}var Jp=new Map;function Yp(e){let t=Jp.get(e);if(t!==void 0)return t;let n=id(nd(e,Yf));return Jp.set(e,n),n}function Xp(e){return e.map(e=>` ▣ ${ap(e.path)}`).join(``)}function Zp(e,t,n,r){let i=qp(t,n)+e+Xp(r);return Jf+Math.ceil(Yp(i))}function Qp(e,t,n,r,i,a){let o=[],s=new Map;for(let c of e){let e=c.x+(a?.get(c.row.sha)??X)+8,l=c.y-10,u=e;for(let e of c.row.refNames){let a=t!==null&&e===t,s=Hp(e),d=i.filter(t=>!t.isCurrent&&!t.bare&&!t.prunable&&t.branchShortName===e);o.push({refName:e,nodeSha:c.row.sha,x:u,y:l,color:r.get(c.row.sha)??$n(c.row.lane),isCurrent:a,isSelected:e===n,isRemote:s,linkedWorktrees:d}),u+=Zp(e,s,a,d)+qf}s.set(c.row.sha,c.row.refNames.length>0?u-e-qf:0)}return{placements:o,rowWidths:s}}function Z(e,t,n){return e+(t-e)*n}function $p(e,t,n,r){let i=t*3,a=e-i,o=e+t+i,s=56*r,c=152*r;return{firstIdx:Math.max(0,Math.floor((a-c)/s)),lastIdx:Math.min(n-1,Math.ceil((o-c)/s))}}function em(e,t,n,r){return Math.max(e,t)>=n&&Math.min(e,t)<=r}function tm(e,t,n){let r=e.nodes.slice(t,n+1),i=[];for(let r of e.nodes)for(let a=0;a<r.row.parentShas.length;a++){let o=r.row.parentShas[a],s=e.shaToNode.get(o)??{row:{...r.row,sha:o,parentShas:[],refNames:[]},x:r.x,y:e.totalHeight,idx:e.nodes.length};em(r.idx,s.idx,t,n)&&i.push({from:r,to:s,isMerge:a>0,key:`${r.row.sha}-${s.row.sha}`})}return{visibleNodes:r,visibleEdges:i}}function nm(e,t){let n=new Set;if(!e||!t)return n;let r=e.nodes.find(e=>e.row.refNames.includes(t));if(!r)return n;let i=r.row.sha,a=new Set;for(;i&&!a.has(i);){a.add(i);let t=e.shaToNode.get(i),r=t?.row.parentShas[0];if(!t||!r)break;n.add(`${t.row.sha}-${r}`);let o=e.shaToNode.get(r);if(!o)break;i=o.row.sha}return n}function rm(e,t){let n=new Set;if(!e||!t)return n;let r=e.nodes.find(e=>e.row.refNames.includes(t));if(!r)return n;let i=r.row.sha;for(;i&&!n.has(i);){n.add(i);let t=e.shaToNode.get(i),r=t?.row.parentShas[0];if(!t||!r||!e.shaToNode.get(r))break;i=r}return n}function im(e,t){if(!e||!t)return null;let n=e.nodes.find(e=>e.row.refNames.includes(t));return n?{key:t,x:n.x-Qf/2,color:e.shaToColor.get(n.row.sha)??$n(n.row.lane)}:null}function am(e){return new Set(e.unstaged.filter(e=>e.status===`U`).map(e=>e.path)).size}function om(e,t){return Math.max(e.topIdx,t.topIdx)<Math.min(e.bottomIdx,t.bottomIdx)}function sm(e,t=Hf){let n=new Map;for(let t of e){let e=n.get(t.railKey);e?e.push(t):n.set(t.railKey,[t])}let r=new Map;for(let e of n.values()){e.sort((e,t)=>e.topIdx-t.topIdx||e.bottomIdx-t.bottomIdx||e.key.localeCompare(t.key));let n=e.map((e,t)=>t),i=e=>n[e]===e?e:(n[e]=i(n[e]),n[e]),a=(e,t)=>{let r=i(e),a=i(t);r!==a&&(n[a]=r)};for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length&&!(e[n].topIdx>e[t].bottomIdx);n++)om(e[t],e[n])&&a(t,n);let o=new Map;for(let t=0;t<e.length;t++){let n=i(t),r=o.get(n);r?r.push(e[t]):o.set(n,[e[t]])}for(let e of o.values()){let n=[...e].sort((e,t)=>(e.bundleOrder??0)-(t.bundleOrder??0)||e.topIdx-t.topIdx||e.bottomIdx-t.bottomIdx||e.key.localeCompare(t.key)),i=[],a=[],o=[];for(let e of n){let t=i.findIndex(t=>t.every(t=>!om(t,e)));t<0&&(t=i.length,i.push([])),i[t].push(e),a[t]=Math.max(a[t]??0,e.strokeWidth??3),o.push({key:e.key,slot:t})}let s=[0];for(let e=1;e<a.length;e++)s[e]=s[e-1]+a[e-1]/2+t+a[e]/2;let c=Math.floor(s.length/2),l=s.length%2==1?s[c]:(s[c-1]+s[c])/2;for(let e of o)r.set(e.key,s[e.slot]-l)}}return r}function cm(e,t=Vf){let n=new Map;for(let t of e){let e=`${t.targetKey}:${t.side}`,r=n.get(e);r?r.push(t):n.set(e,[t])}let r=new Map;for(let e of n.values()){e.sort((e,t)=>(e.side===`right`?e.railX-t.railX:t.railX-e.railX)||e.key.localeCompare(t.key));let n=(e.length-1)/2;for(let i=0;i<e.length;i++)r.set(e[i].key,(i-n)*t)}return r}function lm(e,t=Vf){let n=new Map;for(let t of e){let e=`${t.targetKey}:${t.side}`,r=n.get(e);r?r.count++:n.set(e,{targetKey:t.targetKey,count:1})}let r=new Map;for(let{targetKey:e,count:i}of n.values()){if(i<5)continue;let n=X+Math.ceil((i-4)*t/2);r.set(e,Math.max(r.get(e)??X,n))}return r}function um(e,t,n=0){return t?.mode===`outer-rail`&&t.horizontalTargetJoin?t.outerRailX+n:t?.mode===`adjacent-hook`||t?.mode===`occlusion-hook`||t?.mode===`target-hook`?(t.track===`to`?e.to.x:e.from.x)+n:null}function dm(e,t,n){let r=new Map;for(let i of e){let e=wp(i.from,i.to,i.key,t,{adjacentTrack:i.isMerge?`to`:`from`,additionalOccupiedLanes:n});r.set(i.key,e)}let i=new Set,a=new Map;for(let t of e){let e=um(t,r.get(t.key));if(e===null||Math.abs(e-t.to.x)<.001)continue;let n=e<t.to.x?`left`:`right`;i.add(`${t.to.row.sha}:${n}`)}for(let t of e){if(r.get(t.key)?.mode!==`curve`)continue;let e=t.from.x<t.to.x?`left`:t.from.x>t.to.x?`right`:null;if(!e)continue;let n=`${t.to.row.sha}:${e}`;a.set(n,(a.get(n)??0)+1)}for(let[e,t]of a)t>1&&i.add(e);for(let a of e){if(r.get(a.key)?.mode!==`curve`)continue;let e=a.from.x<a.to.x?`left`:a.from.x>a.to.x?`right`:null;if(!e||!i.has(`${a.to.row.sha}:${e}`))continue;let o=df({x:a.from.x,y:a.from.y,idx:a.from.idx,lane:a.from.row.lane},{x:a.to.x,y:a.to.y,idx:a.to.idx,lane:a.to.row.lane},t,`from`,n);!o||o.side!==e||r.set(a.key,{mode:`target-hook`,laneA:Math.min(a.from.row.lane,a.to.row.lane),laneB:Math.max(a.from.row.lane,a.to.row.lane),track:`from`})}let o=e.flatMap(e=>{let t=r.get(e.key);if(!t)return[];let n=Tp(e,t);return n?[{key:e.key,railKey:n,topIdx:Math.min(e.from.idx,e.to.idx),bottomIdx:Math.max(e.from.idx,e.to.idx),bundleOrder:+!!e.isMerge,railStartY:Math.min(e.from.y,e.to.y)+X+8,strokeWidth:e.isMerge?2:4.5}]:[]}),s=sm(o);for(let e of o){if(r.get(e.key)?.mode!==`straight`||Math.abs(s.get(e.key)??0)<.001)continue;let t=o.filter(t=>t.key!==e.key&&t.railKey===e.railKey&&t.topIdx>e.topIdx&&t.topIdx<e.bottomIdx&&om(e,t)).sort((e,t)=>e.topIdx-t.topIdx||e.key.localeCompare(t.key))[0];t?.railStartY!==void 0&&r.set(e.key,{mode:`straight`,bundleJoinY:t.railStartY-8})}let c=new Map,l=new Set;for(let t of e){let e=r.get(t.key);if(e?.mode===`straight`&&t.from.idx<t.to.idx&&Math.abs(t.from.x-t.to.x)<.001&&l.add(t.from.row.sha),t.from.idx>=t.to.idx||!Tp(t,e??{mode:`curve`}))continue;let n=c.get(t.to.row.sha);n?n.push(t.key):c.set(t.to.row.sha,[t.key])}for(let t of e){if(r.get(t.key)?.mode!==`curve`||Math.abs(t.from.x-t.to.x)<.001)continue;let e=c.get(t.to.row.sha)??[];!(!(e.length<2)&&e.some(e=>Math.abs(s.get(e)??0)>.001))&&!l.has(t.to.row.sha)||r.set(t.key,{mode:`curve`,targetSide:t.from.x<t.to.x?`left`:`right`,...l.has(t.from.row.sha)?{sourceSide:t.to.x<t.from.x?`left`:`right`}:{}})}let u=e.flatMap(e=>{let t=um(e,r.get(e.key),s.get(e.key)??0);return t===null||Math.abs(t-e.to.x)<.001?[]:[{key:e.key,targetKey:e.to.row.sha,side:t<e.to.x?`left`:`right`,railX:t}]});return{plans:r,bundleOffsets:s,targetJoinOffsets:cm(u),targetNodeRadii:lm(u)}}function fm(e,t,n,r,i){return e.map(e=>{let a=r.has(e.key),o=t.plans.get(e.key)??wp(e.from,e.to,e.key,n,{adjacentTrack:e.isMerge?`to`:`from`}),s=t.bundleOffsets.get(e.key)??0,c=t.targetJoinOffsets.get(e.key)??0,l=t.targetNodeRadii.get(e.to.row.sha)??X,u=e.isMerge?e.to:e.from;return{key:e.key,fromSha:e.from.row.sha,toSha:e.to.row.sha,path:Ep(e.from,e.to,o,s,c,l),plan:o,bundleOffset:s,targetJoinOffset:c,targetNodeRadius:l,x1:e.from.x,y1:e.from.y,x2:e.to.x,y2:e.to.y,isMerge:e.isMerge,stroke:i.get(u.row.sha)??$n(u.row.lane),strokeWidth:a?4.5:e.isMerge?2:3,opacity:a?.95:.8}})}function pm(e,t,n,r,i,a){return Kp(e,t)?!0:!i||!a?!1:n!==r}function mm(){let e=Qd(),t=R(e=>e.historyWindow),n=R(e=>e.graphModel),r=R(e=>e.refs),i=R(e=>e.selectedSha),a=R(e=>e.selectedRefName),o=R(e=>e.mergePreview),s=R(e=>e.scrollToSha),c=R(e=>e.scrollToKey),l=R(e=>e.selectCommit),u=R(e=>e.selectGraphRef),d=R(e=>e.clearGraphRefSelection),f=R(e=>e.ensureMergePreview),p=R(e=>e.requestMore),m=R(e=>e.performRefAction),h=R(e=>e.performCommitAction),g=R(e=>e.performMergeRef),_=R(e=>e.performRebaseRef),v=R(e=>e.pendingMutation),x=R(e=>e.pendingCheckout),S=R(e=>e.graphAnimationSuppressToken),C=R(e=>e.showCommitMessages),w=R(e=>e.showGutterColors),T=R(e=>e.showError),E=R(e=>e.commitCIStatus),ee=R(e=>e.fetchCommitCIStatusesIfNeeded),D=R(e=>e.worktreeChanges),te=R(e=>e.worktrees),ne=R(e=>e.worktreeSelected),re=R(e=>e.selectWorktree),ie=R(e=>e.openRepoByPath),[ae,oe]=(0,b.useState)(null),se=(0,b.useRef)(null),O=(0,b.useRef)(null),k=(0,b.useRef)(null),ce=(0,b.useRef)({scrollTop:0,clientHeight:0}),le=(0,b.useRef)(0),ue=(0,b.useRef)(null),de=(0,b.useRef)(null),fe=(0,b.useRef)(null),A=(0,b.useRef)(!1),pe=(0,b.useRef)(null),me=(0,b.useRef)(0),[he,ge]=(0,b.useState)(1),[_e,ve]=(0,b.useState)(0),[ye,be]=(0,b.useState)(0),[j,xe]=(0,b.useState)(null),Se=(0,b.useRef)(null),[Ce,we]=(0,b.useState)(!1),[Te,Ee]=(0,b.useState)(null),[De,Oe]=(0,b.useState)(null),[ke,Ae]=(0,b.useState)(!1),[je,Me]=(0,b.useState)(null),[Ne,Pe]=(0,b.useState)(null),[Fe,Ie]=(0,b.useState)(null),[Le,Re]=(0,b.useState)(null),[{graphProgress:ze},Be]=dc(()=>({graphProgress:1,config:Uf})),Ve=(0,b.useRef)(1),He=(0,b.useRef)(0),Ue=(0,b.useRef)(null),We=(0,b.useRef)(0),Ge=(0,b.useRef)(null),Ke=(0,b.useRef)(null),qe=(0,b.useRef)(null),Je=(0,b.useRef)(S),[,Ye]=(0,b.useReducer)(e=>e+1,0),Xe=(0,b.useRef)({firstIdx:0,lastIdx:100}),M=n?.currentBranch??r.find(e=>e.isCurrent)?.shortName??null,N=n?.layout??null,Ze=(0,b.useMemo)(()=>new Map(r.map(e=>[e.shortName,e])),[r]),Qe=(0,b.useMemo)(()=>{let e=new Map;for(let t of te){if(!t.branchShortName||t.bare||t.prunable)continue;let n=e.get(t.branchShortName)??[];n.push(t),e.set(t.branchShortName,n)}return e},[te]),P=(0,b.useMemo)(()=>a?Ze.get(a)??null:null,[Ze,a]),$e=(0,b.useMemo)(()=>{if(!P)return null;if(P.kind===`head`)return Qe.get(P.shortName)?.find(e=>!e.isCurrent)??null;if(P.kind===`remote`){let e=r.find(e=>e.kind===`head`&&e.upstream===P.name);return e?Qe.get(e.shortName)?.find(e=>!e.isCurrent)??null:null}return null},[P,r,Qe]),et=(0,b.useMemo)(()=>cp(r),[r]),tt=(0,b.useMemo)(()=>{if(!Te||!t)return null;if(Te.kind===`rebase`)return qn(t.rows,r,Te.targetRefName);let e=t.rows.find(e=>e.sha===Te.sha);if(!e)return null;let n=Te.action===`revert`?`Revert "${e.subject}"`:e.subject;return Wn(t.rows,r,n,Te.action)},[Te,t,r]),nt=(0,b.useMemo)(()=>!N||!Te||!tt?null:fp(N,tt,C?260:0,Te),[N,Te,tt,C]),rt=(0,b.useMemo)(()=>{if(Te?.kind!==`rebase`||!De||De.targetRefName!==Te.targetRefName||!nt||nt.nodes.length===0)return null;let e=X*2,t=[...nt.nodes.map(({node:e})=>e),De.targetNode];return af({baseZoom:De.baseZoom,bounds:{minX:Math.min(...t.map(e=>e.x))-e,minY:Math.min(...t.map(e=>e.y))-e,maxX:Math.max(...t.map(e=>e.x))+e,maxY:Math.max(...t.map(e=>e.y))+e},viewport:De.viewport,scroll:De.scroll,margin:12})},[Te,nt,De]),it=rt?.zoom??he,at=rt?.translateX??0,ot=rt?.translateY??0,st=`${ke?Gf:Wf}ms ${Kf}`,ct=(0,b.useMemo)(()=>{if(!N||!D)return null;let e=D.staged.length+D.unstaged.length;if(e===0)return null;let t=(M?N.nodes.find(e=>e.row.refNames.includes(M)):void 0)??N.shaToNode.get(D.headSha);if(!t)return null;let n=D.mergeHeadShas?.length?`merge`:D.rebaseHeadSha?`rebase`:`worktree`,r=am(D),i=t.y-56,a=n===`worktree`?N.shaToColor.get(t.row.sha)??$n(t.row.lane):`#fab387`,o={row:{row:t.row.row-1,sha:`${n}:${D.headSha}:${D.mergeHeadShas?.[0]??D.rebaseHeadSha??`dirty`}`,parentShas:[t.row.sha,...D.mergeHeadShas?.slice(0,1)??[]],authorName:``,authorEmail:``,authorUnix:0,committerUnix:0,subject:n===`merge`?`Merge in progress`:n===`rebase`?`Rebase in progress`:`Uncommitted changes`,additions:0,deletions:0,locChanged:0,refNames:[],lane:t.row.lane},x:t.x,y:i,idx:t.idx-1},s=N.nodes.map(e=>e.row.lane),c=wp(o,t,`${o.row.sha}-${t.row.sha}`,s),l=D.mergeHeadShas?.[0],u=l?N.shaToNode.get(l)??null:null,d=u?Ep(o,u,wp(o,u,`${o.row.sha}-${u.row.sha}`,s,{adjacentTrack:`to`}),0):null;return{kind:n,x:o.x,y:o.y,idx:o.idx,lane:o.row.lane,headX:t.x,headY:t.y,color:a,count:e,conflictedCount:r,targetPlan:c,sourcePath:d}},[N,D,M]),F=ct??(x?fe.current:null),lt=!!F&&!A.current,{worktreeX:ut,worktreeY:dt,worktreeHeadX:ft,worktreeHeadY:pt,worktreeOpacity:mt}=dc({worktreeX:F?.x??0,worktreeY:F?.y??0,worktreeHeadX:F?.headX??0,worktreeHeadY:F?.headY??0,worktreeOpacity:F?x?.5:1:0,immediate:e=>e!==`worktreeOpacity`&&lt,config:e=>e===`worktreeOpacity`?{mass:1,tension:210,friction:26,clamp:!0}:Uf});(0,b.useEffect)(()=>{ct?fe.current=ct:x||(fe.current=null),F?A.current=!0:x||(A.current=!1)},[ct,F,x]);let ht=(0,b.useCallback)(e=>{me.current=e,de.current===null&&(de.current=requestAnimationFrame(()=>{de.current=null,ve(me.current)}))},[]),gt=(0,b.useCallback)(()=>{ue.current!==null&&(cancelAnimationFrame(ue.current),ue.current=null),Se.current&&(Be.stop(),Be.set({graphProgress:1}),Se.current=null,xe(null))},[Be]),_t=(0,b.useCallback)(e=>{ue.current!==null&&(cancelAnimationFrame(ue.current),ue.current=null),Be.stop(),Be.set({graphProgress:0}),Se.current=e,xe(e),ue.current=requestAnimationFrame(()=>{ue.current=requestAnimationFrame(()=>{ue.current=null,Se.current===e&&Be.start({graphProgress:1,immediate:!1,config:Uf,onRest:t=>{t.finished&&xe(t=>t===e?(Se.current=null,null):t)}})})})},[Be]),vt=(0,b.useCallback)(()=>{pe.current!==null&&(clearTimeout(pe.current),pe.current=null)},[]),yt=(0,b.useCallback)(e=>{vt(),Me(e)},[vt]),bt=(0,b.useCallback)(e=>{vt(),pe.current=setTimeout(()=>{Me(t=>t===e?null:t),pe.current=null},120)},[vt]);(0,b.useEffect)(()=>{we(!1),Ee(null),Oe(null),Pe(null)},[a,i]),(0,b.useEffect)(()=>{if(De||!ke)return;let e=window.setTimeout(()=>Ae(!1),Gf);return()=>window.clearTimeout(e)},[De,ke]),(0,b.useEffect)(()=>()=>{vt()},[vt]),(0,b.useEffect)(()=>{if(!N||!t){Ge.current=t?.rows??null,Ke.current=N,qe.current=M,gt();return}let e=S!==Je.current;if(Je.current=S,e){Ge.current=t.rows,Ke.current=N,qe.current=M;return}pm(Ge.current,t.rows,qe.current,M,Ke.current,N)&&Ke.current?_t({fromLayout:Ke.current,toLayout:N,fromCurrentBranch:qe.current,toCurrentBranch:M}):gt(),Ge.current=t.rows,Ke.current=N,qe.current=M},[M,t,N,S,_t,gt]),(0,b.useEffect)(()=>()=>{Be.stop(),ue.current!==null&&cancelAnimationFrame(ue.current),de.current!==null&&cancelAnimationFrame(de.current)},[Be]);let xt=(0,b.useMemo)(()=>t?kp(t.rows):0,[t]),I=(0,b.useMemo)(()=>N?N.nodes.map(e=>e.row.lane):[],[N]),St=(0,b.useMemo)(()=>F?new Map([[F.idx,[F.lane]]]):void 0,[F]),Ct=(0,b.useMemo)(()=>{if(!N||!w)return[];let e=new Map;for(let t of N.nodes)e.set(t.row.lane,t.x);return[...e].sort(([e],[t])=>e-t).map(([e,t])=>({lane:e,x:t,color:$n(e)}))},[N,w]),wt=(0,b.useMemo)(()=>nm(N,M),[N,M]),Tt=(0,b.useCallback)((e,t)=>{if(!N)return;ce.current={scrollTop:e.scrollTop,clientHeight:e.clientHeight},le.current=e.scrollTop,ht(e.scrollTop),O.current&&(O.current.style.transform=`translateY(${-e.scrollTop}px)`);let{firstIdx:n,lastIdx:r}=$p(e.scrollTop,e.clientHeight,N.nodes.length,t);Xe.current={firstIdx:n,lastIdx:r},Ye()},[N,ht]);(0,b.useEffect)(()=>{if(!s||!N||!se.current||Date.now()<He.current)return;let e=N.shaToNode.get(s);if(!Yn(Ue.current,c,!!e)||!e)return;Ue.current=c;let t=se.current,n=e.y*he-t.clientHeight/2;We.current=Date.now()+700,t.scrollTo({top:Math.max(0,n),behavior:`smooth`})},[s,c,N,he]),(0,b.useEffect)(()=>{let e=se.current;if(!e)return;let n=()=>{if(!N)return;let n=e.scrollTop,r=Math.abs(n-le.current)>.5;ce.current={scrollTop:e.scrollTop,clientHeight:e.clientHeight},be(e.clientHeight),le.current=n,r&&Date.now()>=We.current&&gt(),ht(e.scrollTop),O.current&&(O.current.style.transform=`translateY(${-e.scrollTop}px)`),k.current&&(k.current.style.transform=`translateY(${-e.scrollTop}px)`);let{firstIdx:i,lastIdx:a}=$p(e.scrollTop,e.clientHeight,N.nodes.length,Ve.current),o=Xe.current,s=Math.floor((o.lastIdx-o.firstIdx)*.25);if((i<o.firstIdx+s||a>o.lastIdx-s)&&(Xe.current={firstIdx:i,lastIdx:a},Ye()),t&&t.hasMoreAfter&&N){let t=N.totalHeight*Ve.current;Jn(e.scrollTop,e.clientHeight,t)&&p(`down`)}};e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(()=>n());return r.observe(e),n(),()=>{e.removeEventListener(`scroll`,n),r.disconnect()}},[N,t,p,gt,ht]),(0,b.useEffect)(()=>{let e=se.current;!e||!O.current||Tt(e,he)},[N,he,Tt]),(0,b.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey)return;let t=se.current;if(!t||!t.contains(e.target))return;e.preventDefault(),e.stopPropagation();let n=t.getBoundingClientRect(),r=e.clientY-n.top+t.scrollTop,i=Ve.current,a=e.deltaY>0?-.1:.1,o=Math.max(.1,Math.min(3,i+a));Ve.current=o,ge(o);let s=r/i*o-(e.clientY-n.top);t.scrollTop=Math.max(0,s)};return document.addEventListener(`wheel`,e,{passive:!1,capture:!0}),()=>document.removeEventListener(`wheel`,e,{capture:!0})},[]),(0,b.useEffect)(()=>{!N||!se.current||!t?.hasMoreAfter||se.current.clientHeight/he>N.nodes.length*56*.8&&p(`down`)},[he,N,t,p]);let{visibleNodes:Et,visibleEdges:Dt}=(0,b.useMemo)(()=>{if(!N)return{visibleNodes:[],visibleEdges:[]};let{firstIdx:e,lastIdx:t}=Xe.current;return tm(N,e,t)},[N,Xe.current.firstIdx,Xe.current.lastIdx]),Ot=(0,b.useMemo)(()=>dm(Dt,I,St),[Dt,I,St]),{placements:kt,rowWidths:At}=(0,b.useMemo)(()=>Qp(Et,M,a,N?.shaToColor??ep,te,Ot.targetNodeRadii),[Et,M,a,N,te,Ot]),{detachedWorktreePlacements:jt,rowWidths:Mt}=(0,b.useMemo)(()=>{let e=[],t=new Map(At),n=new Map;for(let e of te){if(!e.detached||!e.headSha||e.bare||e.prunable)continue;let t=n.get(e.headSha)??[];t.push(e),n.set(e.headSha,t)}for(let r of Et){let i=n.get(r.row.sha)??[];if(i.length===0)continue;let a=r.x+(Ot.targetNodeRadii.get(r.row.sha)??X)+8,o=t.get(r.row.sha)??0,s=a+o+(o>0?qf:0);for(let t of i){let n=`▣ ${ap(t.path)}`;e.push({worktree:t,nodeSha:r.row.sha,x:s,y:r.y-10});let i=Jf+Math.ceil(Yp(n));o=s-a+i,s+=i+qf}t.set(r.row.sha,o)}return{detachedWorktreePlacements:e,rowWidths:t}},[Et,At,te,Ot]),Nt=(0,b.useMemo)(()=>fm(Dt,Ot,I,wt,N?.shaToColor??ep),[Dt,Ot,I,wt,N]),Pt=(0,b.useMemo)(()=>im(N,M),[N,M]),Ft=(0,b.useMemo)(()=>{if(!j)return null;let e=ce.current.scrollTop,t=ce.current.clientHeight||se.current?.clientHeight||0,n=j.fromLayout.nodes.map(e=>e.row.lane),r=j.toLayout.nodes.map(e=>e.row.lane),i=$p(e,t,j.fromLayout.nodes.length,he),o=$p(e,t,j.toLayout.nodes.length,he),s=tm(j.fromLayout,i.firstIdx,i.lastIdx),c=tm(j.toLayout,o.firstIdx,o.lastIdx),l=dm(s.visibleEdges,n),u=dm(c.visibleEdges,r),d=fm(s.visibleEdges,l,n,nm(j.fromLayout,j.fromCurrentBranch),j.fromLayout.shaToColor),f=fm(c.visibleEdges,u,r,nm(j.toLayout,j.toCurrentBranch),j.toLayout.shaToColor),p=Qp(s.visibleNodes,j.fromCurrentBranch,a,j.fromLayout.shaToColor,te,l.targetNodeRadii).placements,m=Qp(c.visibleNodes,j.toCurrentBranch,a,j.toLayout.shaToColor,te,u.targetNodeRadii).placements,h=im(j.fromLayout,j.fromCurrentBranch),g=im(j.toLayout,j.toCurrentBranch),_=new Map(s.visibleNodes.map(e=>[e.row.sha,e])),v=new Map(c.visibleNodes.map(e=>[e.row.sha,e])),y=new Map(d.map(e=>[e.key,e])),b=new Map(f.map(e=>[e.key,e])),x=new Map(p.map(e=>[e.refName,e])),S=new Map(m.map(e=>[e.refName,e]));return{nodes:[...new Set([..._.keys(),...v.keys()])].map(e=>{let t=_.get(e),n=v.get(e),r=n??t;if(!r)return null;let i=n?j.toLayout:j.fromLayout;return{sortIdx:n?.idx??t?.idx??0,item:{key:e,row:r.row,interactive:!!n,color:i.shaToColor.get(e)??$n(r.row.lane),fromX:t?.x??r.x,fromY:t?t.y:r.y+Xf,toX:n?.x??r.x,toY:n?n.y:r.y-Zf,fromOpacity:+!!t,toOpacity:+!!n,fromRadius:t?l.targetNodeRadii.get(e)??X:u.targetNodeRadii.get(e)??X,toRadius:n?u.targetNodeRadii.get(e)??X:l.targetNodeRadii.get(e)??X}}}).filter(e=>e!==null).sort((e,t)=>e.sortIdx-t.sortIdx).map(e=>e.item),edges:[...new Set([...y.keys(),...b.keys()])].map(e=>{let t=y.get(e),n=b.get(e),r=n??t;if(!r)return null;let i=n?j.fromLayout.shaToNode.get(n.fromSha):void 0,a=n?j.fromLayout.shaToNode.get(n.toSha):void 0,o=t?j.toLayout.shaToNode.get(t.fromSha):void 0,s=t?j.toLayout.shaToNode.get(t.toSha):void 0;return{sortY:Math.min(n?.y1??t?.y1??0,n?.y2??t?.y2??0),item:{key:e,fromSha:r.fromSha,toSha:r.toSha,path:n?.path??t?.path??``,fromPlan:t?.plan??n?.plan??{mode:`curve`},toPlan:n?.plan??t?.plan??{mode:`curve`},fromBundleOffset:t?.bundleOffset??n?.bundleOffset??0,toBundleOffset:n?.bundleOffset??t?.bundleOffset??0,fromTargetJoinOffset:t?.targetJoinOffset??n?.targetJoinOffset??0,toTargetJoinOffset:n?.targetJoinOffset??t?.targetJoinOffset??0,fromTargetNodeRadius:t?.targetNodeRadius??n?.targetNodeRadius??X,toTargetNodeRadius:n?.targetNodeRadius??t?.targetNodeRadius??X,stroke:n?.stroke??t?.stroke??`#cdd6f4`,fromStrokeWidth:t?.strokeWidth??r.strokeWidth,toStrokeWidth:n?.strokeWidth??r.strokeWidth,fromOpacity:t?.opacity??0,toOpacity:n?.opacity??0,fromX1:t?.x1??i?.x??r.x1,fromY1:t?.y1??i?.y??r.y1+Xf,fromX2:t?.x2??a?.x??r.x2,fromY2:t?.y2??a?.y??r.y2+Xf,toX1:n?.x1??o?.x??r.x1,toY1:n?.y1??o?.y??r.y1-Zf,toX2:n?.x2??s?.x??r.x2,toY2:n?.y2??s?.y??r.y2-Zf}}}).filter(e=>e!==null).sort((e,t)=>e.sortY-t.sortY).map(e=>e.item),refs:[...new Set([...x.keys(),...S.keys()])].map(e=>{let t=x.get(e),n=S.get(e),r=n??t;return r?{sortY:n?.y??t?.y??0,item:{key:e,placement:r,fromX:t?.x??r.x,fromY:t?t.y:r.y+Xf,toX:n?.x??r.x,toY:n?n.y:r.y-Zf,fromOpacity:+!!t,toOpacity:+!!n,fromScale:t?1:.9,toScale:n?1:.92}}:null}).filter(e=>e!==null).sort((e,t)=>e.sortY-t.sortY).map(e=>e.item),lane:h||g?{key:g?.key??h?.key??`current-lane`,color:g?.color??h?.color??`#89b4fa`,fromX:h?.x??g?.x??0,toX:g?.x??h?.x??0,fromOpacity:+!!h,toOpacity:+!!g}:null}},[j,a,he,te]),L=(0,b.useMemo)(()=>Ft?.nodes??Et.map(e=>({key:e.row.sha,row:e.row,interactive:!0,color:N?.shaToColor.get(e.row.sha)??$n(e.row.lane),fromX:e.x,fromY:e.y,toX:e.x,toY:e.y,fromOpacity:1,toOpacity:1,fromRadius:Ot.targetNodeRadii.get(e.row.sha)??X,toRadius:Ot.targetNodeRadii.get(e.row.sha)??X})),[Ft,Et,N]),It=(0,b.useMemo)(()=>Ft?.edges??Nt.map(e=>({key:e.key,fromSha:e.fromSha,toSha:e.toSha,path:e.path,fromPlan:e.plan,toPlan:e.plan,fromBundleOffset:e.bundleOffset,toBundleOffset:e.bundleOffset,fromTargetJoinOffset:e.targetJoinOffset,toTargetJoinOffset:e.targetJoinOffset,fromTargetNodeRadius:e.targetNodeRadius,toTargetNodeRadius:e.targetNodeRadius,stroke:e.stroke,fromStrokeWidth:e.strokeWidth,toStrokeWidth:e.strokeWidth,fromOpacity:e.opacity,toOpacity:e.opacity,fromX1:e.x1,fromY1:e.y1,fromX2:e.x2,fromY2:e.y2,toX1:e.x1,toY1:e.y1,toX2:e.x2,toY2:e.y2})),[Ft,Nt]),Lt=(0,b.useMemo)(()=>Ft?.refs??kt.map(e=>({key:e.refName,placement:e,fromX:e.x,fromY:e.y,toX:e.x,toY:e.y,fromOpacity:1,toOpacity:1,fromScale:1,toScale:1})),[Ft,kt]),Rt=(0,b.useMemo)(()=>nt?.gutterX===void 0?Ft?Ft.lane:Pt?{key:Pt.key,color:Pt.color,fromX:Pt.x,toX:Pt.x,fromOpacity:1,toOpacity:1}:null:{key:`action-preview-gutter`,color:Pf,fromX:nt.gutterX,toX:nt.gutterX,fromOpacity:1,toOpacity:1},[nt,Ft,Pt]),zt=(0,b.useMemo)(()=>N&&M?N.nodes.find(e=>e.row.refNames.includes(M))??null:null,[N,M]),Bt=(0,b.useMemo)(()=>!P||P.kind!==`head`?null:up(P,r),[P,r]),Vt=(0,b.useMemo)(()=>!P||P.kind!==`head`?!1:!Bt||Bt.targetSha!==P.targetSha,[P,Bt]),Ht=(0,b.useMemo)(()=>!P||P.kind!==`head`||!Bt||Bt.targetSha===P.targetSha?!1:(P.ahead??0)>0,[P,Bt]),Ut=(0,b.useMemo)(()=>{if(!P)return[];if(P.kind===`head`){let e=(P.behind??0)>0?{action:`push`,label:`Force push`,tone:`warning`,force:!0}:{action:`push`,label:`Push`,tone:`neutral`};return P.isCurrent?[...Vt?[e]:[],...Ht?[{action:`reset`,label:`Reset`,tone:`warning`}]:[]]:$e?[{action:`open-worktree`,label:`Open worktree`,tone:`neutral`,worktreePath:$e.path},...Vt?[e]:[]]:[{action:`checkout`,label:`Checkout`,tone:`neutral`},...Vt?[e]:[],...Ht?[{action:`reset`,label:`Reset`,tone:`warning`}]:[],{action:`delete`,label:`Delete`,tone:`danger`}]}return P.kind===`remote`?[...$e?[{action:`open-worktree`,label:`Open worktree`,tone:`neutral`,worktreePath:$e.path}]:[{action:`checkout`,label:`Checkout`,tone:`neutral`}],{action:`delete`,label:`Delete`,tone:`danger`}]:[{action:`push`,label:`Push`,tone:`neutral`}]},[P,$e,Vt,Ht]),Wt=(0,b.useMemo)(()=>!P||P.kind!==`head`||P.isCurrent||$e?null:P.shortName,[P,$e]),Gt=(0,b.useMemo)(()=>!!zt&&!!M&&!!a&&a!==M&&o?.sourceRefName===a&&o.mergeable,[zt,M,a,o]),Kt=(0,b.useMemo)(()=>P&&P.kind===`head`&&P.isCurrent?P:null,[P]),qt=(0,b.useMemo)(()=>{if(!N||!a||!o?.mergeable||o.sourceRefName!==a||!o.sourceSha||!o.targetSha)return null;let e=N.shaToNode.get(o.sourceSha),t=N.shaToNode.get(o.targetSha);if(!e||!t)return null;let n=N.nodes[0]??t,r={row:{row:n.row.row-1,sha:`preview:${o.sourceSha}:${o.targetSha}`,parentShas:[t.row.sha,e.row.sha],authorName:``,authorEmail:``,authorUnix:0,committerUnix:0,subject:`Merge preview`,additions:0,deletions:0,locChanged:0,refNames:[],lane:t.row.lane},x:t.x,y:n.y-56,idx:n.idx-1},i=`${r.row.sha}-${t.row.sha}`,s=`${r.row.sha}-${e.row.sha}`,c=wp(r,t,i,I),l=e.x<r.x?`left`:`right`,u=nf(N.nodes,r.idx,e.idx,80,l),d=N.nodes.find(e=>e.x===u),f=u!==null&&u<Math.min(r.x,e.x)?`left`:`right`;return{previewNode:r,sourceNode:e,targetNode:t,sourcePath:Ep(r,e,u===null?wp(r,e,s,I,{adjacentTrack:`to`}):{mode:`outer-rail`,side:f,anchorLane:d?.row.lane??(f===`left`?Math.min(...I)-1:Math.max(...I)+1),innerLane:f===`left`?Math.max(r.row.lane,e.row.lane):Math.min(r.row.lane,e.row.lane),outerRailX:u},Ot.bundleOffsets.get(s)??0),targetPath:Ep(r,t,c,Ot.bundleOffsets.get(i)??0),color:N.shaToColor.get(t.row.sha)??$n(t.row.lane)}},[N,a,o,I,Ot.bundleOffsets]),Jt=(0,b.useMemo)(()=>Ce?qt:null,[Ce,qt]),Yt=(0,b.useCallback)((e,t)=>{e.stopPropagation(),we(!1),Ee(null),Oe(null),u(t)},[u]),Xt=(0,b.useCallback)(e=>(oe(e),m(e.action,e.refName,e.sha,e.force).finally(()=>{oe(t=>np(t,e)?null:t)})),[m]),Zt=(0,b.useCallback)(e=>{if(!a||!P||v)return;if(we(!1),e.action===`open-worktree`){e.worktreePath&&ie(e.worktreePath);return}let t=e.action,n=P.targetSha,r=a,i={action:t,label:e.label,tone:e.tone,refName:r,sha:n,force:!!e.force};Xt(i).catch(t=>{if(e.action===`push`&&!e.force&&rp(t))T(`Push rejected`,t,{label:`Force push`,run:()=>{Xt({action:`push`,label:`Force push`,tone:`warning`,force:!0,refName:r,sha:n}).catch(e=>T(`Force push failed`,e))}});else{let n=e.action===`checkout`?ip(t):null;if(n){T(`Branch is already checked out`,t,{label:`Open worktree`,run:()=>{ie(n)}});return}T(`${e.action} failed`,t)}})},[a,P,Xt,T,v,ie]),Qt=(0,b.useCallback)(e=>{Wt&&(v||Re({title:`Move branch`,message:`Move branch ${Wt} to commit ${e.slice(0,8)}?`,confirmLabel:`Move`,onConfirm:()=>{we(!1),m(`move`,Wt,e).catch(e=>{T(`Move failed`,e)})}}))},[Wt,m,T,v]),$t=(0,b.useCallback)((e,t)=>{v||(we(!1),Pe(null),Me(null),Ie({kind:e,targetSha:t}))},[v]),en=(0,b.useCallback)(e=>{if(!Fe)return;let{kind:t,targetSha:n}=Fe;Ie(null),m(t===`branch`?`create`:`create-tag`,e,n).catch(e=>{T(`Create ${t} failed`,e)})},[Fe,m,T]),tn=(0,b.useCallback)(()=>Ie(null),[]),nn=Fe?.kind===`branch`?`Branch name`:`Tag name`,rn=Fe?`Create ${Fe.kind} at ${Fe.targetSha.slice(0,8)}`:`Create ref`,an=Fe?.kind===`tag`?et:``,on=(0,b.useCallback)(()=>{a&&(Ee(null),Oe(null),we(!0),(!o||o.sourceRefName!==a)&&f(a))},[a,o,f]),sn=(0,b.useCallback)(()=>{we(!1)},[]),cn=(0,b.useCallback)((e,t)=>{e!==`uncommit`&&(we(!1),Oe(null),Ee({kind:`commit`,action:e,sha:t}))},[]),ln=(0,b.useCallback)((e,t,n)=>{let r=se.current;if(!r)return;let i=n.currentTarget.getBoundingClientRect(),a=Ve.current;we(!1),Ae(!0),Oe({targetRefName:e,buttonRect:{left:i.left,top:i.top,width:i.width,height:i.height},buttonScale:i.height/Cf,baseZoom:a,viewport:{width:r.clientWidth,height:r.clientHeight},scroll:{x:r.scrollLeft,y:r.scrollTop},targetNode:{x:t.x,y:t.y}}),Ee({kind:`rebase`,targetRefName:e})},[]),un=(0,b.useCallback)(()=>{Ee(null),Oe(null)},[]),dn=(0,b.useCallback)(()=>{Ee(e=>e?.kind===`rebase`?null:e),Oe(null)},[]),fn=(0,b.useCallback)(()=>{let e=se.current;if(!e||!qt)return;let t=Math.max(qt.previewNode.y+X,qt.sourceNode.y+X,qt.targetNode.y+X),n=Math.max(t+40,224),r=Math.min(Ve.current,Math.max(.18,Math.min(1,e.clientHeight/n)));He.current=Date.now()+500,Ve.current=r,ge(r),e.scrollTo({top:0,behavior:`smooth`}),requestAnimationFrame(()=>Tt(e,r))},[qt,Tt]),pn=(0,b.useCallback)(()=>{a&&(v||(we(!0),fn(),g(a).catch(e=>{T(`Merge failed`,e)})))},[a,g,fn,T,v]),mn=(0,b.useCallback)(e=>{we(!1),Ee(null),Oe(null),_(e).catch(e=>{T(`Rebase failed`,e)})},[_,T]),hn=(0,b.useCallback)(e=>{Kt&&(v||mn(e))},[Kt,mn,v]),gn=(0,b.useMemo)(()=>{if(!N||!se.current)return[];let e=se.current.scrollTop,t=new Map;for(let e of Et){let n=t.get(e.row.lane);(!n||e.y<n.y)&&t.set(e.row.lane,e)}let n=new Map;for(let r of N.nodes){if(r.row.refNames.length===0||r.y*it+ot>=e)continue;let i=r.row.lane;if(n.has(i))continue;let a=t.get(i);if(!a)continue;let o=nr(r.row.refNames);o&&N.shaToBranch.get(a.row.sha)===o&&n.set(i,{name:o,x:r.x,color:er(o)})}let r=[...n.values()].sort((e,t)=>e.x-t.x),i=[],a=[];for(let e of r){let t=e.x*it+at-4,n=e.name.length*7+20,r=0;for(let e=0;e<a.length;e++){if(t>=a[e]){r=e;break}r=e+1}r>=a.length&&a.push(0),a[r]=t+n+4,i.push({...e,row:r})}return i},[N,Et,it,at,ot]),_n=(0,b.useMemo)(()=>N?Bp(N.nodes,it).map(e=>({...e,y:e.y+ot})):[],[N,it,ot]),vn=(0,b.useMemo)(()=>{if(!N)return null;let e=Vp(N.nodes,Math.max(0,_e-ot),it);return e?zp(new Date(e.row.committerUnix*1e3),it):null},[N,_e,it,ot]),yn=(0,b.useMemo)(()=>_n.filter(e=>e.y-_e>28),[_n,_e]),bn=(0,b.useMemo)(()=>rm(N,M),[N,M]),xn=(0,b.useMemo)(()=>!N||bn.size===0||!C?[]:N.nodes.filter(e=>bn.has(e.row.sha)).map(e=>({key:e.row.sha,sha:e.row.sha,y:e.y*it+ot,text:e.row.subject})),[N,bn,it,ot,C]),Sn=(0,b.useMemo)(()=>xn.filter(e=>e.y-_e>28),[xn,_e]),Cn=(0,b.useMemo)(()=>ye===0?[]:xn.filter(e=>{let t=e.y-_e;return t>0&&t<ye}),[xn,_e,ye]);(0,b.useEffect)(()=>{if(Cn.length===0)return;let e=window.setTimeout(()=>{let e=Cn.slice(0,bf).map(e=>e.sha);ee(e)},200);return()=>window.clearTimeout(e)},[Cn,ee]);let wn=(0,b.useMemo)(()=>N&&i?N.shaToNode.get(i)??null:null,[N,i]),Tn=(0,b.useMemo)(()=>{if(!N||!wn||!M)return!1;let e=N.nodes.find(e=>e.row.refNames.includes(M));if(!e)return!1;let t=e.row.sha,n=new Set;for(;t&&!n.has(t);){if(t===wn.row.sha)return!0;n.add(t);let e=N.shaToNode.get(t);if(!e||e.row.parentShas.length===0)break;t=e.row.parentShas[0]}return!1},[N,wn,M]),En=(0,b.useMemo)(()=>!wn||!M?!1:wn.row.refNames.includes(M),[wn,M]),Dn=(0,b.useMemo)(()=>{if(!wn)return[];let e=[],t=wn.row.parentShas.length===1;return En?(e.push({action:`uncommit`,label:`Uncommit`,tone:`uncommit`}),t&&e.push({action:`revert`,label:`Revert`,tone:`warning`}),e):Tn?(t&&e.push({action:`revert`,label:`Revert`,tone:`warning`}),e):(t&&(e.push({action:`cherry-pick`,label:`Cherry pick`,tone:`success`}),e.push({action:`revert`,label:`Revert`,tone:`warning`})),e)},[wn,En,Tn]),On=(0,b.useCallback)(e=>{if(!wn||v)return;if(Ee(null),Oe(null),e===`cherry-pick`){h(e,wn.row.sha).catch(t=>{T(`${e} failed`,t)});return}let t=wn.row.sha.slice(0,8),n=e===`uncommit`?`Uncommit`:`Revert commit`,r=e===`uncommit`?`Uncommit ${t}? This will move HEAD to its parent and keep the changes in your working tree.`:`Revert commit ${t} on the current branch?`;Re({title:n,message:r,confirmLabel:e===`uncommit`?`Uncommit`:`Revert`,onConfirm:()=>{h(e,wn.row.sha).catch(t=>{T(`${e} failed`,t)})}})},[wn,h,T,v]),kn=j!==null;if(!N)return(0,y.jsx)(`div`,{style:{flex:1,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#45475a`,fontSize:13},children:`No commits to display`});let An=N.totalWidth,jn=N.totalHeight,Mn=An*he,Nn=jn*he,Pn=F?Math.max(22,String(F.conflictedCount).length*7+14):0,Fn=F?.kind===`merge`?F.conflictedCount>0?`Merge conflicts`:`Merge in progress`:F?.kind===`rebase`?F.conflictedCount>0?`Rebase conflicts`:`Rebase in progress`:`Uncommitted changes`,In=F?.kind===`worktree`?`Uncommitted changes — ${F.count} file${F.count===1?``:`s`}\nClick to stage / unstage`:`${Fn} — ${F?.conflictedCount??0} conflict${F?.conflictedCount===1?``:`s`}\nClick to review files`;return(0,y.jsxs)(`div`,{ref:se,style:{flex:1,height:`100%`,overflow:`auto`,position:`relative`,background:`#1e1e2e`,touchAction:`pan-x pan-y`},onClick:()=>{we(!1),Ee(null),Oe(null),Pe(null),Me(null),vt(),d()},children:[(0,y.jsx)(vf,{open:!!Fe,title:rn,label:nn,initialValue:an,confirmLabel:`Create`,onSubmit:en,onClose:tn}),(0,y.jsx)(yf,{open:!!Le,title:Le?.title??``,message:Le?.message??``,confirmLabel:Le?.confirmLabel??`Confirm`,onConfirm:()=>{let e=Le?.onConfirm;Re(null),e?.()},onClose:()=>Re(null)}),De&&(0,Ai.createPortal)((0,y.jsx)(`div`,{style:{position:`fixed`,left:De.buttonRect.left,top:De.buttonRect.top,width:De.buttonRect.width,height:De.buttonRect.height,zIndex:1e4,pointerEvents:`auto`},children:(0,y.jsx)(`div`,{style:{width:De.buttonRect.width/De.buttonScale,height:De.buttonRect.height/De.buttonScale,transform:`scale(${De.buttonScale})`,transformOrigin:`top left`},children:(0,y.jsx)(cd,{label:`Rebase`,tone:`success`,onClick:()=>hn(De.targetRefName),onMouseLeave:dn})})}),document.body),(0,y.jsx)(`div`,{style:{position:`sticky`,top:0,left:0,zIndex:20,height:0,overflow:`visible`,pointerEvents:`none`},children:gn.map(e=>(0,y.jsx)(`div`,{onClick:t=>Yt(t,e.name),style:{position:`absolute`,left:e.x*it+at-4,top:4+e.row*22,padding:`2px 8px`,borderRadius:4,background:a===e.name?e.color+`35`:e.color+`20`,border:`1px solid ${a===e.name?e.color:e.color+`50`}`,color:e.color,fontSize:10,fontWeight:600,whiteSpace:`nowrap`,pointerEvents:`auto`,transform:`scale(${Math.min(it,1)})`,transformOrigin:`top left`,transition:`left ${st}, transform ${st}`,cursor:`pointer`,boxShadow:a===e.name?`0 0 8px ${e.color}40`:`none`},children:e.name},e.name))}),(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,left:0,width:`100%`,height:0,overflow:`visible`,zIndex:5,pointerEvents:`none`},children:[vn&&(0,y.jsx)(`div`,{style:{position:`absolute`,right:20,top:6,padding:`3px 8px`,borderRadius:6,background:`#181825`,border:`1px solid #313244`,color:`#9399b2`,fontSize:11,fontWeight:600,whiteSpace:`nowrap`,boxShadow:`0 4px 12px rgba(0,0,0,0.2)`},children:vn}),(0,y.jsxs)(`div`,{ref:k,style:{position:`relative`},children:[F&&F.y*it+ot-_e>28&&(0,y.jsxs)(G.div,{style:{position:`absolute`,left:20,top:gc(dt,e=>e*it+ot-7),opacity:mt,maxWidth:380*it,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:ne?F.color:`#a6adc8`,fontSize:12,fontWeight:600,pointerEvents:`none`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:6,transition:`max-width ${st}`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,background:F.color,flexShrink:0}}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:Fn})]}),Sn.map(e=>{let t=E[e.sha],n=t?{success:`#a6e3a1`,pending:`#f9e2af`,failure:`#f38ba8`,error:`#f38ba8`,neutral:`#6c7086`,loading:`#585b70`,none:`#45475a`}[t.state]:void 0;return(0,y.jsxs)(`div`,{style:{position:`absolute`,left:20,top:e.y-7,maxWidth:380*it,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#a6adc8`,fontSize:12,pointerEvents:`none`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:6,transition:`top ${st}, max-width ${st}`},children:[n&&(0,y.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,background:n,flexShrink:0}}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:e.text})]},e.key)})]}),(0,y.jsx)(`div`,{ref:O,style:{position:`relative`},children:yn.map(e=>(0,y.jsxs)(`div`,{style:{position:`absolute`,right:20,top:e.y-7,padding:`2px 6px`,borderRadius:6,background:`#1e1e2e`,color:e.kind===`month`?`#6c7086`:e.kind===`hour`?`#585b70`:`#45475a`,fontSize:e.kind===`month`?11:10,fontWeight:e.kind===`month`?600:e.kind===`hour`?500:400,whiteSpace:`nowrap`,pointerEvents:`none`,userSelect:`none`,transition:`top ${st}`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,width:e.kind===`month`?16:e.kind===`hour`?6:8,height:1,background:e.kind===`month`?`#585b70`:e.kind===`hour`?`#45475a`:`#313244`,verticalAlign:`middle`,marginRight:4}}),e.text]},e.key))})]}),(0,y.jsx)(`div`,{style:{width:Mn,height:Nn,position:`relative`,zIndex:10},children:(0,y.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,width:An,height:jn,transform:`translate(${at}px, ${ot}px) scale(${it})`,transformOrigin:`top left`,transition:`transform ${st}`,willChange:De?`transform`:void 0},children:[(0,y.jsxs)(`svg`,{width:An,height:jn,style:{position:`absolute`,top:0,left:0,zIndex:10,pointerEvents:`none`,overflow:`visible`},children:[Ct.map(e=>(0,y.jsx)(`rect`,{x:e.x-80/2+2,y:0,width:76,height:jn,rx:16,fill:`${e.color}16`,stroke:`${e.color}24`,strokeWidth:1},`gutter-${e.lane}`)),Rt&&(0,y.jsxs)(G.g,{opacity:kn?gc(ze,e=>Z(Rt.fromOpacity,Rt.toOpacity,e)*.95):Rt.toOpacity*.95,children:[(0,y.jsx)(G.rect,{x:kn?gc(ze,e=>Z(Rt.fromX,Rt.toX,e)):Rt.toX,y:0,width:Qf,height:jn,rx:18,fill:`${Rt.color}10`}),(0,y.jsx)(G.rect,{x:kn?gc(ze,e=>Z(Rt.fromX,Rt.toX,e)+2):Rt.toX+2,y:0,width:Qf-4,height:jn,rx:16,fill:`${Rt.color}06`})]},Rt.key),Jt&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{d:Jt.targetPath,stroke:Jt.color,strokeWidth:3,fill:`none`,strokeLinecap:`round`,strokeDasharray:`8 6`,opacity:.7}),(0,y.jsx)(`path`,{d:Jt.sourcePath,stroke:Jt.color,strokeWidth:2.5,fill:`none`,strokeLinecap:`round`,strokeDasharray:`8 6`,opacity:.55})]}),It.map(e=>(0,y.jsx)(G.path,{d:kn?gc(ze,t=>t>=.999?e.path:Op(e,t)):e.path,stroke:e.stroke,strokeWidth:kn?gc(ze,t=>Z(e.fromStrokeWidth,e.toStrokeWidth,t)):e.toStrokeWidth,fill:`none`,strokeLinecap:`round`,opacity:kn?gc(ze,t=>Z(e.fromOpacity,e.toOpacity,t)):e.toOpacity},e.key)),nt?.edges.map(e=>(0,y.jsx)(`path`,{d:e.path,stroke:e.color,strokeWidth:3,fill:`none`,strokeLinecap:`round`,strokeDasharray:e.dashed?`7 6`:void 0,opacity:.9},e.key))]}),(0,y.jsxs)(`svg`,{width:An,height:jn,style:{position:`absolute`,top:0,left:0,zIndex:30,pointerEvents:`none`,overflow:`visible`},children:[Jt&&(0,y.jsxs)(`g`,{children:[(0,y.jsx)(`circle`,{cx:Jt.previewNode.x,cy:Jt.previewNode.y,r:X*1.9,fill:Jt.color,opacity:.12}),(0,y.jsx)(`circle`,{cx:Jt.previewNode.x,cy:Jt.previewNode.y,r:X,fill:xf,stroke:Jt.color,strokeWidth:3,strokeDasharray:`6 4`}),(0,y.jsx)(`circle`,{cx:Jt.previewNode.x,cy:Jt.previewNode.y,r:2.5,fill:Jt.color})]}),L.map(t=>{let{row:n}=t,r=n.sha===i,a=t.color,o=Df*2,s=Mp(n.additions,xt,o),c=Mp(n.deletions,xt,o),u=`gauge-${n.sha}`,d=`${u}-left`,f=`${u}-right`,p=r?Af:kf,m=r?jf:Of,h=Pd(n.subject,e),g=kn?gc(ze,e=>Z(t.fromX,t.toX,e)):t.toX,_=kn?gc(ze,e=>Z(t.fromY,t.toY,e)):t.toY,v=kn?gc(ze,e=>Z(t.fromOpacity,t.toOpacity,e)):t.toOpacity,b=kn?gc(ze,e=>Z(t.fromRadius,t.toRadius,e)):t.toRadius,x=kn?gc(ze,e=>Z(t.fromRadius,t.toRadius,e)*2.5):t.toRadius*2.5,S=kn?gc(ze,e=>`translate(${Z(t.fromX,t.toX,e)} ${Z(t.fromY,t.toY,e)})`):`translate(${t.toX} ${t.toY})`,C=kn?gc(ze,e=>Ap(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Df,`left`)):Ap(t.toX,t.toY,Df,`left`),w=kn?gc(ze,e=>Ap(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Df,`right`)):Ap(t.toX,t.toY,Df,`right`),T=kn?gc(ze,e=>jp(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Df,`left`)):jp(t.toX,t.toY,Df,`left`),E=kn?gc(ze,e=>jp(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Df,`right`)):jp(t.toX,t.toY,Df,`right`);return(0,y.jsxs)(G.g,{onClick:t.interactive?e=>{e.stopPropagation(),l(n.sha)}:void 0,onPointerEnter:t.interactive?()=>yt(n.sha):void 0,onPointerLeave:t.interactive?()=>bt(n.sha):void 0,opacity:v,style:{cursor:t.interactive?`pointer`:`default`,pointerEvents:t.interactive?`auto`:`none`},children:[(0,y.jsx)(`title`,{children:`${n.subject}${h?`\n${h.label} commit`:``}\n+${n.additions} / -${n.deletions} (${n.locChanged} LOC changed)`}),r&&(0,y.jsx)(G.circle,{cx:g,cy:_,r:x,fill:a,opacity:.15}),(0,y.jsx)(G.circle,{cx:g,cy:_,r:b,fill:xf,stroke:a,strokeWidth:r?3.5:2.75}),(0,y.jsxs)(`defs`,{children:[(0,y.jsx)(`clipPath`,{id:d,clipPathUnits:`userSpaceOnUse`,children:(0,y.jsx)(G.path,{d:C})}),(0,y.jsx)(`clipPath`,{id:f,clipPathUnits:`userSpaceOnUse`,children:(0,y.jsx)(G.path,{d:w})})]}),(0,y.jsx)(G.path,{d:C,fill:m}),(0,y.jsx)(G.path,{d:w,fill:m}),s>0&&(0,y.jsx)(G.rect,{x:kn?gc(ze,e=>Z(t.fromX,t.toX,e)-Df):t.toX-Df,y:kn?gc(ze,e=>Z(t.fromY,t.toY,e)+Df-s):t.toY+Df-s,width:Df,height:s,fill:Mf,clipPath:`url(#${d})`}),c>0&&(0,y.jsx)(G.rect,{x:g,y:kn?gc(ze,e=>Z(t.fromY,t.toY,e)+Df-c):t.toY+Df-c,width:Df,height:c,fill:Nf,clipPath:`url(#${f})`}),(0,y.jsx)(G.path,{d:T,stroke:p,strokeWidth:1.6,fill:`none`}),(0,y.jsx)(G.path,{d:E,stroke:p,strokeWidth:1.6,fill:`none`}),(0,y.jsx)(G.line,{x1:g,y1:kn?gc(ze,e=>Z(t.fromY,t.toY,e)-Df):t.toY-Df,x2:g,y2:kn?gc(ze,e=>Z(t.fromY,t.toY,e)+Df):t.toY+Df,stroke:p,strokeWidth:1.6}),!h&&n.parentShas.length>1&&(0,y.jsx)(G.circle,{cx:g,cy:_,r:2,fill:a}),h&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G.circle,{cx:g,cy:_,r:7.4,fill:xf,opacity:.9}),(0,y.jsx)(G.g,{transform:S,children:(0,y.jsx)(tf,{icon:h.icon,color:a,customSvg:h.customSvg})})]})]},t.key)}),nt?.nodes.map(({node:e,color:t})=>(0,y.jsxs)(`g`,{children:[(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:X*1.9,fill:t,opacity:.12}),(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:X,fill:xf,stroke:t,strokeWidth:3,strokeDasharray:`6 4`}),(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:2.5,fill:t})]},`action-preview:${e.row.sha}`)),F&&(0,y.jsxs)(G.g,{onClick:e=>{e.stopPropagation(),re()},opacity:mt,style:{cursor:`pointer`,pointerEvents:`auto`},children:[(0,y.jsx)(`title`,{children:In}),F.sourcePath&&(0,y.jsx)(`path`,{d:F.sourcePath,stroke:F.color,strokeWidth:2.25,strokeLinecap:`round`,strokeDasharray:`3 5`,fill:`none`,opacity:.55}),(0,y.jsx)(G.path,{d:gc([ut,dt,ft,pt],(e,t,n,r)=>Ep({x:e,y:t},{x:n,y:r},F.targetPlan,0)),stroke:F.color,strokeWidth:2.5,strokeLinecap:`round`,strokeDasharray:`3 5`,fill:`none`,opacity:.7}),ne&&(0,y.jsx)(G.circle,{cx:ut,cy:dt,r:X*2.5,fill:F.color,opacity:.15}),(0,y.jsx)(G.circle,{cx:ut,cy:dt,r:X,fill:xf,stroke:F.color,strokeWidth:ne?3.5:2.75,strokeDasharray:`4 3`}),F.kind===`worktree`?(0,y.jsx)(G.text,{x:ut,y:dt,textAnchor:`middle`,dominantBaseline:`central`,fontSize:12,fontWeight:700,fill:F.color,style:{pointerEvents:`none`,userSelect:`none`},children:F.count}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G.circle,{cx:ut,cy:dt,r:2.5,fill:F.color}),F.conflictedCount>0&&(0,y.jsxs)(`g`,{style:{pointerEvents:`none`,userSelect:`none`},children:[(0,y.jsx)(G.rect,{x:gc(ut,e=>e+X+6),y:gc(dt,e=>e-10),width:Pn,height:20,rx:10,fill:`#fab38722`,stroke:`#fab387`,strokeWidth:1.4}),(0,y.jsx)(G.text,{x:gc(ut,e=>e+X+6+Pn/2),y:dt,textAnchor:`middle`,dominantBaseline:`central`,fontSize:11,fontWeight:800,fill:`#fab387`,children:F.conflictedCount})]})]})]})]}),Lt.map(e=>{let{placement:t}=e,n=t.isSelected||t.isCurrent,r=t.isSelected?t.color+`35`:t.isCurrent?t.color+`2a`:t.color+`18`,i=[`inset 0 1px 0 rgba(255, 255, 255, 0.14)`,`inset 0 -1px 0 ${t.color}18`,n?`0 0 8px ${t.color}38`:`0 2px 5px rgba(0, 0, 0, 0.18)`].join(`, `);return(0,y.jsxs)(G.div,{onClick:e=>Yt(e,t.refName),onPointerEnter:()=>yt(t.nodeSha),onPointerLeave:()=>bt(t.nodeSha),style:{position:`absolute`,left:0,top:0,zIndex:20,height:20,padding:`0 7px`,borderRadius:4,background:`linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.015) 38%, ${t.color}18 100%), linear-gradient(${r}, ${r}), rgba(24, 24, 37, 0.5)`,backdropFilter:`blur(3px) saturate(145%) contrast(103%)`,WebkitBackdropFilter:`blur(3px) saturate(145%) contrast(103%)`,border:`1px solid ${n?t.color:t.color+`66`}`,color:t.color,fontSize:11,fontWeight:600,lineHeight:`20px`,whiteSpace:`nowrap`,cursor:`pointer`,userSelect:`none`,boxShadow:i,transformOrigin:`top left`,opacity:kn?gc(ze,t=>Z(e.fromOpacity,e.toOpacity,t)):e.toOpacity,transform:kn?gc(ze,t=>`translate(${Z(e.fromX,e.toX,t)}px, ${Z(e.fromY,e.toY,t)}px) scale(${Z(e.fromScale,e.toScale,t)})`):`translate(${e.toX}px, ${e.toY}px) scale(${e.toScale})`},children:[qp(t.isRemote,t.isCurrent),t.refName,t.linkedWorktrees.map(e=>(0,y.jsxs)(`span`,{title:`Open linked worktree\n${e.path}${e.lockedReason?`\nLocked: ${e.lockedReason}`:``}`,onClick:t=>{t.stopPropagation(),ie(e.path)},style:{display:`inline-block`,marginLeft:7,paddingLeft:7,borderLeft:`1px solid ${t.color}55`,color:`#a6adc8`},children:[`▣ `,ap(e.path)]},e.path))]},e.key)}),!kn&&jt.map(e=>{let{worktree:t}=e;return(0,y.jsxs)(`div`,{title:`${t.isCurrent?`Current detached worktree`:`Open detached worktree`}\n${t.path}\n${t.headSha?.slice(0,12)??``}`,onClick:e=>{e.stopPropagation(),t.isCurrent||ie(t.path)},onPointerEnter:()=>yt(e.nodeSha),onPointerLeave:()=>bt(e.nodeSha),style:{position:`absolute`,left:e.x,top:e.y,zIndex:20,height:20,padding:`0 7px`,borderRadius:4,border:`1px solid ${t.isCurrent?`#f9e2af99`:`#6c708666`}`,background:t.isCurrent?`#f9e2af18`:`rgba(24,24,37,0.72)`,color:t.isCurrent?`#f9e2af`:`#a6adc8`,fontSize:11,fontWeight:600,lineHeight:`20px`,whiteSpace:`nowrap`,cursor:t.isCurrent?`default`:`pointer`,userSelect:`none`,boxShadow:`0 2px 5px rgba(0,0,0,0.18)`},children:[`▣ `,ap(t.path)]},`detached-worktree:${t.path}`)}),Et.map(e=>{let t=Mt.get(e.row.sha)??0,n=Ot.targetNodeRadii.get(e.row.sha)??X,r=e.x+n+8+t+(t>0?8:0),o=e.y-10,s=ae!==null,c=!s&&e.row.sha===i?Dn:[],l=!!a&&e.row.refNames.includes(a),u=l?Ut:[],d=s&&l&&ae?u.find(e=>e.action===ae.action)??ae:null,f=s?d?[d]:[]:u,p=!s&&!!M&&e.row.refNames.includes(M)&&Gt,m=!s&&!!Wt&&e.row.sha!==P?.targetSha,h=!v&&!s&&!kn&&(je===e.row.sha||Ne===e.row.sha),g=!s&&Kt&&e.row.sha!==Kt.targetSha?nr(e.row.refNames.filter(e=>e!==Kt.shortName)):null,_=g&&(Te?.kind!==`rebase`||Te.targetRefName===g)?g:null,x=f.length>0||p||m||h||!!_;return c.length===0&&!x?null:(0,y.jsxs)(b.Fragment,{children:[c.length>0&&(0,y.jsx)(`div`,{style:{position:`absolute`,left:e.x-X-12,top:e.y,transform:`translate(-100%, -50%)`,display:`flex`,alignItems:`center`,gap:10,flexWrap:`nowrap`,zIndex:40},children:c.map(t=>(0,y.jsx)(cd,{label:t.label,tone:t.tone,onClick:()=>On(t.action),onMouseEnter:()=>cn(t.action,e.row.sha),onMouseLeave:un},t.action))}),x&&(0,y.jsxs)(`div`,{onPointerEnter:()=>yt(e.row.sha),onPointerLeave:()=>bt(e.row.sha),style:{position:`absolute`,left:r,top:o,display:`flex`,alignItems:`flex-start`,gap:10,flexWrap:`nowrap`,zIndex:Ne===e.row.sha?40:20},children:[f.length>0&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,position:`relative`,top:tp(wf),zIndex:7},children:f.map(e=>(0,y.jsx)(ld,{label:e.label,tone:e.tone,loading:!!d&&e.action===d.action,onClick:()=>Zt(e)},e.action))}),m&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,zIndex:7},children:(0,y.jsx)(ld,{label:`Move`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>Qt(e.row.sha)})}),_&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,top:tp(Cf),zIndex:7},children:(0,y.jsx)(cd,{label:`Rebase`,tone:`success`,onClick:()=>hn(_),onMouseEnter:t=>ln(_,e,t),onMouseLeave:De?.targetRefName===_?void 0:dn})}),p&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,top:tp(Cf),zIndex:7},children:(0,y.jsx)(cd,{label:`Merge`,tone:`merge`,onClick:pn,onMouseEnter:on,onMouseLeave:sn})}),h&&(0,y.jsxs)(`div`,{style:{position:`relative`,top:tp(Tf),zIndex:8},children:[(0,y.jsx)(`button`,{type:`button`,title:`Create branch or tag`,"aria-label":`Create branch or tag`,onClick:t=>{t.stopPropagation(),we(!1),Pe(t=>t===e.row.sha?null:e.row.sha),Me(e.row.sha)},style:{width:Tf,height:Tf,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:0,borderRadius:6,border:`1px solid #4a4f68`,background:`#2f3348`,color:`#cdd6f4`,fontSize:21,fontWeight:600,lineHeight:1,cursor:`pointer`,fontFamily:`inherit`,boxShadow:`0 8px 20px rgba(0,0,0,0.28)`},onMouseEnter:e=>{e.currentTarget.style.background=`#3a4058`},onMouseLeave:e=>{e.currentTarget.style.background=`#2f3348`},children:`+`}),Ne===e.row.sha&&(0,y.jsx)(`div`,{onClick:e=>e.stopPropagation(),style:{position:`absolute`,right:0,top:30,width:Ef,padding:5,borderRadius:7,border:`1px solid #4a4f68`,background:`#181825`,boxShadow:`0 14px 30px rgba(0,0,0,0.42)`,display:`flex`,flexDirection:`column`,gap:4},children:[`branch`,`tag`].map(t=>(0,y.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),$t(t,e.row.sha)},style:{height:28,padding:`0 9px`,borderRadius:5,border:`1px solid transparent`,background:`transparent`,color:`#cdd6f4`,fontSize:12,fontWeight:600,fontFamily:`inherit`,textAlign:`left`,cursor:`pointer`},onMouseEnter:e=>{e.currentTarget.style.background=`#313244`,e.currentTarget.style.borderColor=`#45475a`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`,e.currentTarget.style.borderColor=`transparent`},children:t===`branch`?`Branch`:`Tag`},t))})]})]})]},`${e.row.sha}-actions`)})]})})]})}var hm=56,gm=56,_m=12,vm=`#11111b`,ym=56,bm=80,xm=110,Sm=150,Cm=28,wm=640,Tm=[`#89b4fa`,`#a6e3a1`,`#f9e2af`,`#f38ba8`,`#cba6f7`,`#94e2d5`,`#fab387`,`#74c7ec`,`#f5c2e7`,`#b4befe`];function Em(e){return Tm[(e%Tm.length+Tm.length)%Tm.length]}var Dm=`#f9e2af`,Om={commit:`#a6e3a1`,amend:`#f9e2af`,checkout:`#89b4fa`,reset:`#f38ba8`,rebase:`#fab387`,merge:`#cba6f7`,"cherry-pick":`#94e2d5`,revert:`#f5c2e7`,pull:`#74c7ec`,branch:`#b4befe`,clone:`#9399b2`,other:`#9399b2`},km=new Set([`reset`,`rebase`,`amend`]),Am={reset:`reset moved HEAD away — commits only on the old position may be unreachable`,rebase:`rebase rewrote history — the original commits live on only in the reflog`,amend:`amend replaced the previous commit — the original version is only in the reflog`};function jm(e,t,n,r){if(e===n)return`M${e},${t}L${n},${r}`;let i=r-t;return`M${e},${t}C${e},${t+i*.3} ${n},${r-i*.3} ${n},${r}`}function Mm(e){let t=new Map;e.forEach((e,n)=>t.set(e.sha,n));let n=new Map,r=[],i=[],a=0;for(let o=0;o<e.length;o++){let s=e[o],c=n.get(s.sha);c===void 0&&(c=r.indexOf(null),c===-1?(c=r.length,r.push(s.sha)):r[c]=s.sha,n.set(s.sha,c)),i.push(c),c>a&&(a=c),t.get(s.sha)===o&&(r[c]=null)}return{lanes:i,maxLane:a}}function Nm(e){if(!e)return``;let t=Math.floor(Date.now()/1e3-e);if(t<60)return`just now`;if(t<3600)return`${Math.floor(t/60)}m ago`;if(t<86400)return`${Math.floor(t/3600)}h ago`;if(t<172800)return`yesterday`;if(t<14*86400)return`${Math.floor(t/86400)}d ago`;let n=new Date(e*1e3),r=n.toLocaleDateString(void 0,{month:`short`,day:`numeric`});return n.getFullYear()===new Date().getFullYear()?r:`${r} ${n.getFullYear()}`}function Pm(){let e=R(e=>e.reflog),t=R(e=>e.reflogLoading),n=R(e=>e.reflogMaxCount),r=R(e=>e.selectedSha),i=R(e=>e.selectCommit),a=R(e=>e.recoverBranch),o=R(e=>e.checkoutSha),s=R(e=>e.performCommitAction),c=R(e=>e.loadMoreReflog),l=R(e=>e.showError),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(null);(0,b.useEffect)(()=>{d(null)},[e]);let g=e?.entries??[],{lanes:_,maxLane:v}=(0,b.useMemo)(()=>Mm(g),[g]),x=(0,b.useMemo)(()=>{let e=new Set;for(let t of g)t.isReachable||e.add(t.sha);return e},[g]),S=e=>Sm+e*gm,C=e=>ym+e*hm,w=Sm+(v+1)*gm+Cm,T=w+wm,E=ym+g.length*hm+bm,ee=(0,b.useMemo)(()=>{let e=``;return g.map(t=>{let n=Nm(t.entryUnix);return n===e?``:(e=n,n)})},[g]),D=e=>{p({entry:e,defaultName:`recovered-${e.sha.slice(0,7)}`})},te=e=>{h({title:`Checkout commit`,message:`Checkout ${e.sha.slice(0,8)}? This detaches HEAD at that state.`,confirmLabel:`Checkout`,onConfirm:()=>{o(e.sha).catch(e=>l(`Checkout failed`,e))}})},ne=e=>{h({title:`Cherry pick commit`,message:`Cherry-pick ${e.sha.slice(0,8)} onto the current branch?`,confirmLabel:`Cherry pick`,onConfirm:()=>{s(`cherry-pick`,e.sha).catch(e=>l(`Cherry-pick failed`,e))}})},re=e=>{if(!f)return;let{entry:t}=f;p(null),a(e,t.sha).catch(e=>l(`Recover failed`,e))},ie=e=>{navigator.clipboard?.writeText(e.sha)};return!e&&t?(0,y.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#6c7086`,fontSize:13},children:`Reading reflog…`}):g.length===0?(0,y.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#45475a`,fontSize:13},children:`No reflog entries — this repository has no recorded HEAD movements yet`}):(0,y.jsxs)(`div`,{style:{flex:1,height:`100%`,overflow:`auto`,position:`relative`,background:`#1e1e2e`},onClick:()=>d(null),children:[(0,y.jsx)(vf,{open:!!f,title:f?`Create branch at ${f.entry.sha.slice(0,8)}`:`Create branch`,label:`Branch name`,initialValue:f?.defaultName??``,confirmLabel:`Create`,onSubmit:re,onClose:()=>p(null)}),(0,y.jsx)(yf,{open:!!m,title:m?.title??``,message:m?.message??``,confirmLabel:m?.confirmLabel??`Confirm`,onConfirm:()=>{let e=m?.onConfirm;h(null),e?.()},onClose:()=>h(null)}),x.size>0&&(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,zIndex:30,margin:`10px 14px 0`,padding:`8px 14px`,borderRadius:6,background:`#f9e2af18`,border:`1px solid ${Dm}55`,color:Dm,fontSize:12,display:`flex`,alignItems:`center`,gap:8},children:[(0,y.jsx)(`span`,{style:{fontSize:14},children:`⚠`}),(0,y.jsxs)(`span`,{children:[x.size===1?`1 commit in your reflog is no longer reachable from any branch.`:`${x.size} commits in your reflog are no longer reachable from any branch.`,` `,`Select a dashed entry below to recover it.`]})]}),(0,y.jsxs)(`div`,{style:{width:T,height:E,position:`relative`},children:[(0,y.jsxs)(`div`,{style:{position:`absolute`,left:150-_m,top:16,color:`#585b70`,fontSize:11,whiteSpace:`nowrap`,userSelect:`none`},children:[e?.refName??`HEAD`,` time machine — every state HEAD has pointed to, newest first`]}),(0,y.jsxs)(`svg`,{width:T,height:E,style:{position:`absolute`,top:0,left:0,pointerEvents:`none`,overflow:`visible`},children:[g.slice(0,-1).map((e,t)=>{let n=S(_[t]),r=C(t);return(0,y.jsx)(`path`,{d:jm(S(_[t+1]),C(t+1),n,r),stroke:Em(_[t]),strokeWidth:2.25,fill:`none`,strokeLinecap:`round`,opacity:.85},`edge-${t}`)}),g.map((e,t)=>{let n=S(_[t]),a=C(t),o=Em(_[t]),s=u===t||u===null&&e.sha===r,c=!e.isReachable;return(0,y.jsxs)(`g`,{onClick:n=>{n.stopPropagation(),d(t),i(e.sha)},style:{cursor:`pointer`,pointerEvents:`auto`},children:[(0,y.jsx)(`title`,{children:`${e.selector} — ${e.message}`}),s&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:_m*2.3,fill:o,opacity:.15}),c&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:17,fill:`none`,stroke:Dm,strokeWidth:1.5,strokeDasharray:`4 3`,opacity:.9}),(0,y.jsx)(`circle`,{cx:n,cy:a,r:_m,fill:vm,stroke:o,strokeWidth:s?3:2.25}),t===0&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:3,fill:o})]},`node-${t}`)})]}),g.map((e,t)=>{let n=C(t);return ee[t]?(0,y.jsx)(`div`,{style:{position:`absolute`,left:0,top:n-7,width:xm,textAlign:`right`,color:`#585b70`,fontSize:11,whiteSpace:`nowrap`,pointerEvents:`none`,userSelect:`none`},children:ee[t]},`time-${t}`):null}),g.map((e,t)=>{let n=C(t),r=u===t,a=!e.isReachable,o=Om[e.kind],s=km.has(e.kind),c=Am[e.kind];return(0,y.jsxs)(`div`,{onClick:n=>{n.stopPropagation(),d(t),i(e.sha)},style:{position:`absolute`,left:w,top:n-10,cursor:`pointer`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,height:20,whiteSpace:`nowrap`},children:[(0,y.jsxs)(`span`,{title:c??e.message,style:{height:18,padding:`0 8px`,borderRadius:4,background:o+`20`,border:`1px solid ${o}55`,color:o,fontSize:10,fontWeight:700,lineHeight:`18px`,textTransform:`uppercase`,letterSpacing:.4},children:[s?`⚠ `:``,e.kind]}),a&&(0,y.jsx)(`span`,{title:`Not reachable from any branch — only the reflog still knows this commit`,style:{height:18,padding:`0 8px`,borderRadius:4,background:`#f9e2af20`,border:`1px solid ${Dm}`,color:Dm,fontSize:10,fontWeight:700,lineHeight:`18px`},children:`LOST`}),e.refNames.slice(0,3).map(e=>(0,y.jsx)(`span`,{style:{height:18,padding:`0 7px`,borderRadius:4,background:`#89b4fa18`,border:`1px solid #89b4fa55`,color:`#89b4fa`,fontSize:10,fontWeight:600,lineHeight:`18px`},children:e},e)),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:11,fontFamily:`monospace`},children:e.sha.slice(0,7)}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`,fontSize:12,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:360},children:e.subject})]}),r?(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:4},children:[a?(0,y.jsx)(cd,{label:`Recover branch`,tone:`success`,onClick:()=>D(e)}):(0,y.jsx)(ld,{label:`Branch here`,tone:`neutral`,size:`compact`,onClick:()=>D(e)}),(0,y.jsx)(ld,{label:`Checkout`,tone:`warning`,size:`compact`,onClick:()=>te(e)}),(0,y.jsx)(ld,{label:`Cherry-pick`,tone:`neutral`,size:`compact`,onClick:()=>ne(e)}),(0,y.jsx)(ld,{label:`Copy sha`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>ie(e)})]}):(0,y.jsx)(`div`,{style:{marginTop:4,color:`#6c7086`,fontSize:10,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:wm-40},children:e.message})]},`row-${t}`)}),g.length>=n&&(0,y.jsx)(`div`,{style:{position:`absolute`,left:w,top:C(g.length)+4},children:(0,y.jsx)(ld,{label:t?`Loading…`:`Load older entries`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>{c()}})})]})]})}var Fm=Object.defineProperty,Im=e=>t=>{var n=e[t];if(n)return n();throw Error(`Module not found in bundle: `+t)},Q=(e,t)=>()=>(e&&(t=e(e=0)),t),$=(e,t)=>{for(var n in t)Fm(e,n,{get:t[n],enumerable:!0})},Lm={};$(Lm,{default:()=>Rm});var Rm,zm=Q(()=>{Rm=[{type:`cmnt`,match:/(;|#).*/gm},{expand:`str`},{expand:`num`},{type:`num`,match:/\$[\da-fA-F]*\b/g},{type:`kwd`,match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:`func`,match:/^[a-z]+/g}]},{type:`kwd`,match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:`oper`}]}),Bm={};$(Bm,{default:()=>Hm});var Vm,Hm,Um=Q(()=>{Vm={type:`var`,match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},Hm=[{sub:`todo`,match:/#.*/g},{type:`str`,match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[Vm]},{type:`oper`,match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:`kwd`,match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:`num`},{type:`func`,match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gim},{type:`bool`,match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:`oper`,match:/[=(){}<>!]+/g},{type:`var`,match:/(?<=\s|^)[\w_]+(?=\s*=)/g},Vm]}),Wm={};$(Wm,{default:()=>Gm});var Gm,Km=Q(()=>{Gm=[{match:/[^\[\->+.<\]\s].*/g,sub:`todo`},{type:`func`,match:/\.+/g},{type:`kwd`,match:/[<>]+/g},{type:`oper`,match:/[+-]+/g}]}),qm={};$(qm,{default:()=>Jm});var Jm,Ym=Q(()=>{Jm=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/#\s*include (<.*>|".*")/g,sub:[{type:`str`,match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:`kwd`,match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:`asm`}]},{type:`kwd`,match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Xm={};$(Xm,{default:()=>Zm});var Zm,Qm=Q(()=>{Zm=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:`var`,match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:`func`,match:/#[\w-]+(?=[^{}]*{)/g},{type:`num`,match:/#[\da-f]{3,8}/g},{type:`num`,match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:`var`,match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:`func`,match:/url(?=\()/g},{type:`str`,match:/[^()]+/g}]},{type:`func`,match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:`num`,match:/\b[a-z-]+\b/g}]}),$m={};$($m,{default:()=>eh});var eh,th=Q(()=>{eh=[{expand:`strDouble`},{type:`oper`,match:/,/g}]}),nh={};$(nh,{default:()=>rh});var rh,ih=Q(()=>{rh=[{type:`deleted`,match:/^[-<].*/gm},{type:`insert`,match:/^[+>].*/gm},{type:`kwd`,match:/!.*/gm},{type:`section`,match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]}),ah={};$(ah,{default:()=>oh});var oh,sh=Q(()=>{Um(),oh=[{type:`kwd`,match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gim},...Hm]}),ch={};$(ch,{default:()=>lh});var lh,uh=Q(()=>{ih(),lh=[{match:/^#.*/gm,sub:`todo`},{expand:`str`},...rh,{type:`func`,match:/^(\$ )?git(\s.*)?$/gm},{type:`kwd`,match:/^commit \w+$/gm}]}),dh={};$(dh,{default:()=>fh});var fh,ph=Q(()=>{fh=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`oper`,match:/[+\-*\/%&|^~=!<>.^-]+/g}]}),mh={};$(mh,{default:()=>bh,name:()=>_h,properties:()=>vh,xmlElement:()=>yh});var hh,gh,_h,vh,yh,bh,xh=Q(()=>{hh=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`,gh=hh+`\\-\\.0-9·̀-ͯ‿-⁀`,_h=`[${hh}][${gh}]*`,vh=`\\s*(\\s+${_h}\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,yh={match:RegExp(`<[/!?]?${_h}${vh}[/!?]?>`,`g`),sub:[{type:`var`,match:RegExp(`^<[/!?]?${_h}`,`g`),sub:[{type:`oper`,match:/^<[\/!?]?/g}]},{type:`str`,match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:`oper`,match:/^=/g}]},{type:`oper`,match:/[\/!?]?>/g},{type:`class`,match:RegExp(_h,`g`)}]},bh=[{match:/<!--[^]*?-->/g,sub:`todo`},{type:`class`,match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},yh,{type:`str`,match:RegExp(`<\\?${_h}([^?]|\\?[^?>])*\\?+>`,`g`),sub:[{type:`var`,match:RegExp(`^<\\?${_h}`,`g`),sub:[{type:`oper`,match:/^<\?/g}]},{type:`oper`,match:/\?+>$/g}]},{type:`var`,match:/&(#x?)?[\da-z]{1,8};/gi}]}),Sh={};$(Sh,{default:()=>Ch});var Ch,wh=Q(()=>{xh(),Ch=[{type:`class`,match:/<!DOCTYPE("[^"]*"|'[^']*'|[^"'>])*>/gi,sub:[{type:`str`,match:/"[^"]*"|'[^']*'/g},{type:`oper`,match:/^<!|>$/g},{type:`var`,match:/DOCTYPE/gi}]},{match:RegExp(`<style${vh}>[^]*?</style\\s*>`,`g`),sub:[{match:RegExp(`^<style${vh}>`,`g`),sub:yh.sub},{match:RegExp(`${yh.match}|[^]*(?=</style\\s*>$)`,`g`),sub:`css`},yh]},{match:RegExp(`<script${vh}>[^]*?<\/script\\s*>`,`g`),sub:[{match:RegExp(`^<script${vh}>`,`g`),sub:yh.sub},{match:RegExp(`${yh.match}|[^]*(?=<\/script\\s*>$)`,`g`),sub:`js`},yh]},...bh]}),Th,Eh,Dh=Q(()=>{Th=[[`bash`,[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],[`html`,[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<!DOCTYPE\s+html/g,500]],[`http`,[/^(GET|HEAD|POST|PUT|DELETE|PATCH|HTTP)\b/g,500]],[`js`,[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|document|window)\b/g,10]],[`ts`,[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|document|window|implements|interface|namespace)\b/g,10]],[`py`,[/\b(def|print|await|async|class|and|or|lambda|import|from|self|asyncio|pass|True|False|None|__init__)\b/g,10]],[`sql`,[/\b(SELECT|INSERT|FROM)\b/g,50]],[`pl`,[/#!(\/usr)?\/bin\/perl/g,500],[/\b(use|print)\b|\$/g,10]],[`lua`,[/#!(\/usr)?\/bin\/lua/g,500]],[`make`,[/\b(ifneq|endif|if|elif|then|fi|echo|.PHONY|^[a-z]+ ?:$)\b|\$/gm,10]],[`uri`,[/https?:|mailto:|tel:|ftp:/g,30]],[`css`,[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],[`diff`,[/^[+><-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],[`md`,[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],[`docker`,[/^(FROM|ENTRYPOINT|RUN)/gm,500]],[`xml`,[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],[`c`,[/#include\b|\bprintf\s+\(/g,100]],[`rs`,[/^\s+(use|fn|mut|match)\b/gm,100]],[`go`,[/\b(func|fmt|package)\b/g,100]],[`java`,[/^import\s+java/gm,500]],[`asm`,[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],[`css`,[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],[`json`,[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],[`yaml`,[/^(\s+)?[a-z][a-z0-9]*:/gim,10]]],Eh=e=>Th.map(([t,...n])=>[t,n.reduce((t,[n,r])=>t+[...e.matchAll(n)].length*r,0)]).filter(([e,t])=>t>20).sort((e,t)=>t[1]-e[1])[0]?.[0]||`plain`}),Oh={};$(Oh,{default:()=>kh});var kh,Ah=Q(()=>{Dh(),kh=[{type:`kwd`,match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:`str`},{type:`section`,match:/\bHTTP\/[\d.]+\b/g},{expand:`num`},{type:`oper`,match:/[,;:=]/g},{type:`var`,match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:Eh}]}),jh={};$(jh,{default:()=>Mh});var Mh,Nh=Q(()=>{Mh=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:`todo`},{type:`var`,match:/.*(?==)/g},{type:`section`,match:/^\s*\[.+\]\s*$/gm},{type:`oper`,match:/=/g},{type:`str`,match:/.*/g}]}),Ph={};$(Ph,{default:()=>Fh});var Fh,Ih=Q(()=>{Fh=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Lh={};$(Lh,{default:()=>Rh});var Rh,zh=Q(()=>{Rh=[{match:/(("|')([^\r\n\\]|\\[^])*?\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:`jsdoc`},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{match:/`((?!`)[^]|\\[^])*`?/g,sub:`js_template_literals`},{type:`kwd`,match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:`regex`},{expand:`num`},{type:`num`,match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:`bool`,match:/\b(true|false)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`func`,match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]}),Bh={};$(Bh,{default:()=>Vh,type:()=>Hh});var Vh,Hh,Uh=Q(()=>{Vh=[{match:new class{exec(e){let t=this.lastIndex,n,r=n=>{for(;++t<e.length-2;)if(e[t]==`{`)r();else if(e[t]==`}`)return};for(;t<e.length;++t)if(e[t-1]!=`\\`&&e[t]==`$`&&e[t+1]==`{`)return n=t++,r(t),this.lastIndex=t+1,{index:n,0:e.slice(n,t+1)};return null}},sub:[{type:`kwd`,match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:`js`}]}],Hh=`str`}),Wh={};$(Wh,{default:()=>Gh,type:()=>Kh});var Gh,Kh,qh=Q(()=>{Gh=[{type:`err`,match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:`class`,match:/\bIDEA\b/g},{type:`insert`,match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:`oper`,match:/\bQUESTION\b/g}],Kh=`cmnt`}),Jh={};$(Jh,{default:()=>Yh,type:()=>Xh});var Yh,Xh,Zh=Q(()=>{qh(),Yh=[{type:`kwd`,match:/@\w+/g},{type:`class`,match:/{[\w\s|<>,.@\[\]]+}/g},{type:`var`,match:/\[[\w\s="']+\]/g},...Gh],Xh=`cmnt`}),Qh={};$(Qh,{default:()=>$h});var $h,eg=Q(()=>{$h=[{type:`var`,match:/(("|')([^\r\n\\]|\\[^])*?\2|[a-zA-Z]\w*)(?=\s*:)/g},{expand:`str`},{expand:`num`},{type:`num`,match:/\bnull\b/g},{type:`bool`,match:/\b(true|false)\b/g}]}),tg={};$(tg,{default:()=>ng});var ng,rg=Q(()=>{Dh(),ng=[{type:`cmnt`,match:/^>.*|(=|-)\1+/gm},{type:`class`,match:/\*\*.*?\*\*/g},{match:/^(`{3,})(.*)\n[^]*?^\1[ \t]*$/gm,sub:e=>({type:`kwd`,sub:[{match:/\n[^]*(?=```)/g,sub:e.split(`
600
- `)[0].slice(3)||Eh(e)}]})},{type:`str`,match:/`[^`]*`/g},{type:`var`,match:/~~.*?~~/g},{type:`kwd`,match:/\b_\S([^\n]*?\S)?_\b|\*\S([^\n]*?\S)?\*/g},{type:`kwd`,match:/^\s*(\*|\d+\.)\s/gm},{type:`func`,match:/\[[^\]]*]\([^)]*\)|<[^>]*>/g,sub:[{type:`oper`,match:/^\[[^\]]*]/g}]}]}),ig={};$(ig,{default:()=>ag});var ag,og=Q(()=>{rg(),Dh(),ag=[{type:`insert`,match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:`insert`,match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:Eh}]},{type:`deleted`,match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:`deleted`,match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:Eh}]},...ng]}),sg={};$(sg,{default:()=>cg});var cg,lg=Q(()=>{cg=[{type:`cmnt`,match:/^#.*/gm},{expand:`strDouble`},{expand:`num`},{type:`err`,match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:`num`,match:/\b(null|undefined)\b/gi},{type:`bool`,match:/\b(false|true|yes|no)\b/gi},{type:`oper`,match:/\.|,/g}]}),ug={};$(ug,{default:()=>dg});var dg,fg=Q(()=>{dg=[{match:/^#!.*|--(\[(=*)\[[^]*?--\]\2\]|.*)/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:`bool`,match:/\b(true|false|nil)\b/g},{type:`oper`,match:/[+*/%^#=~<>:,.-]+/g},{expand:`num`},{type:`func`,match:/[a-z_]+(?=\s*[({])/g}]}),pg={};$(pg,{default:()=>mg});var mg,hg=Q(()=>{mg=[{match:/^\s*#.*/gm,sub:`todo`},{expand:`str`},{type:`oper`,match:/[${}()]+/g},{type:`class`,match:/.PHONY:/gm},{type:`section`,match:/^[\w.]+:/gm},{type:`kwd`,match:/\b(ifneq|endif)\b/g},{expand:`num`},{type:`var`,match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:`bash`}]}),gg={};$(gg,{default:()=>_g});var _g,vg=Q(()=>{_g=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:`num`},{type:`kwd`,match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:`oper`,match:/[-+*/%~!&<>|=?,]+/g},{type:`func`,match:/[a-z_]+(?=\s*\()/g}]}),yg={};$(yg,{default:()=>bg});var bg,xg=Q(()=>{bg=[{expand:`strDouble`}]}),Sg={};$(Sg,{default:()=>Cg});var Cg,wg=Q(()=>{Cg=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/f("""|''')(\\[^]|(?!\1)[^])*\1?|f("|')(\\[^]|(?!\3).)*\3?/gi,sub:[{type:`var`,match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:`py`}]}]},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:`bool`,match:/\b(False|True|None)\b/g},{expand:`num`},{type:`func`,match:/[a-z_]\w*(?=\s*\()/gi},{type:`oper`,match:/[-/*+<>,=!&|^%]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Tg={};$(Tg,{default:()=>Eg,type:()=>Dg});var Eg,Dg,Og=Q(()=>{Eg=[{match:/^(?!\/).*/gm,sub:`todo`},{type:`num`,match:/\[((?!\])[^\\]|\\.)*\]/g},{type:`kwd`,match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:`var`,match:/\*|\+|\{\d+,\d+\}/g}],Dg=`oper`}),kg={};$(kg,{default:()=>Ag});var Ag,jg=Q(()=>{Ag=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]}),Mg={};$(Mg,{default:()=>Ng});var Ng,Pg=Q(()=>{Ng=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{type:`func`,match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:`kwd`,match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:`num`,match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:`bool`,match:/\b(TRUE|FALSE)\b/g},{type:`oper`,match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:`var`,match:/@\S+/g}]}),Fg={};$(Fg,{default:()=>Ig});var Ig,Lg=Q(()=>{Ig=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:`str`},{type:`section`,match:/^\[.+\]\s*$/gm},{type:`num`,match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:`num`},{type:`bool`,match:/\b(true|false)\b/g},{type:`oper`,match:/[+,.=-]/g},{type:`var`,match:/\w+(?= \=)/g}]}),Rg={};$(Rg,{default:()=>zg});var zg,Bg=Q(()=>{zh(),zg=[{type:`type`,match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:`kwd`,match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...Rh]}),Vg={};$(Vg,{default:()=>Hg});var Hg,Ug=Q(()=>{Hg=[{match:/^#.*/gm,sub:`todo`},{type:`class`,match:/^\w+(?=:?)/gm},{type:`num`,match:/:\d+/g},{type:`oper`,match:/[:/&?]|\w+=/g},{type:`func`,match:/[.\w]+@|#[\w]+$/gm},{type:`var`,match:/\w+\.\w+(\.\w+)*/g}]}),Wg={};$(Wg,{default:()=>Gg});var Gg,Kg=Q(()=>{Gg=[{match:/#.*/g,sub:`todo`},{expand:`str`},{type:`str`,match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:`type`,match:/!![a-z]+/g},{type:`bool`,match:/\b(Yes|No)\b/g},{type:`oper`,match:/[+:-]/g},{expand:`num`},{type:`var`,match:/[a-zA-Z]\w*(?=:)/g}]}),qg={num:{type:`num`,match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:`str`,match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:`str`,match:/"((?!")[^\r\n\\]|\\[^])*"?/g}},Jg=Im({"./languages/asm.js":()=>Promise.resolve().then(()=>(zm(),Lm)),"./languages/bash.js":()=>Promise.resolve().then(()=>(Um(),Bm)),"./languages/bf.js":()=>Promise.resolve().then(()=>(Km(),Wm)),"./languages/c.js":()=>Promise.resolve().then(()=>(Ym(),qm)),"./languages/css.js":()=>Promise.resolve().then(()=>(Qm(),Xm)),"./languages/csv.js":()=>Promise.resolve().then(()=>(th(),$m)),"./languages/diff.js":()=>Promise.resolve().then(()=>(ih(),nh)),"./languages/docker.js":()=>Promise.resolve().then(()=>(sh(),ah)),"./languages/git.js":()=>Promise.resolve().then(()=>(uh(),ch)),"./languages/go.js":()=>Promise.resolve().then(()=>(ph(),dh)),"./languages/html.js":()=>Promise.resolve().then(()=>(wh(),Sh)),"./languages/http.js":()=>Promise.resolve().then(()=>(Ah(),Oh)),"./languages/ini.js":()=>Promise.resolve().then(()=>(Nh(),jh)),"./languages/java.js":()=>Promise.resolve().then(()=>(Ih(),Ph)),"./languages/js.js":()=>Promise.resolve().then(()=>(zh(),Lh)),"./languages/js_template_literals.js":()=>Promise.resolve().then(()=>(Uh(),Bh)),"./languages/jsdoc.js":()=>Promise.resolve().then(()=>(Zh(),Jh)),"./languages/json.js":()=>Promise.resolve().then(()=>(eg(),Qh)),"./languages/leanpub-md.js":()=>Promise.resolve().then(()=>(og(),ig)),"./languages/log.js":()=>Promise.resolve().then(()=>(lg(),sg)),"./languages/lua.js":()=>Promise.resolve().then(()=>(fg(),ug)),"./languages/make.js":()=>Promise.resolve().then(()=>(hg(),pg)),"./languages/md.js":()=>Promise.resolve().then(()=>(rg(),tg)),"./languages/pl.js":()=>Promise.resolve().then(()=>(vg(),gg)),"./languages/plain.js":()=>Promise.resolve().then(()=>(xg(),yg)),"./languages/py.js":()=>Promise.resolve().then(()=>(wg(),Sg)),"./languages/regex.js":()=>Promise.resolve().then(()=>(Og(),Tg)),"./languages/rs.js":()=>Promise.resolve().then(()=>(jg(),kg)),"./languages/sql.js":()=>Promise.resolve().then(()=>(Pg(),Mg)),"./languages/todo.js":()=>Promise.resolve().then(()=>(qh(),Wh)),"./languages/toml.js":()=>Promise.resolve().then(()=>(Lg(),Fg)),"./languages/ts.js":()=>Promise.resolve().then(()=>(Bg(),Rg)),"./languages/uri.js":()=>Promise.resolve().then(()=>(Ug(),Vg)),"./languages/xml.js":()=>Promise.resolve().then(()=>(xh(),mh)),"./languages/yaml.js":()=>Promise.resolve().then(()=>(Kg(),Wg))}),Yg={},Xg=(e=``)=>e.replaceAll(`&`,`&#38;`).replaceAll?.(`<`,`&lt;`).replaceAll?.(`>`,`&gt;`),Zg=(e,t)=>t?`<span class="shj-syn-${t}">${e}</span>`:e;async function Qg(e,t,n){try{let r,i,a={},o,s=[],c=0,l=typeof t==`string`?await(Yg[t]??(Yg[t]=Jg(`./languages/${t}.js`))):t,u=[...typeof t==`string`?l.default:t.sub];for(;c<e.length;){for(a.index=null,r=u.length;r-->0;){if(i=u[r].expand?qg[u[r].expand]:u[r],s[r]===void 0||s[r].match.index<c){if(i.match.lastIndex=c,o=i.match.exec(e),o===null){u.splice(r,1),s.splice(r,1);continue}s[r]={match:o,lastIndex:i.match.lastIndex}}s[r].match[0]&&(s[r].match.index<=a.index||a.index===null)&&(a={part:i,index:s[r].match.index,match:s[r].match[0],end:s[r].lastIndex})}if(a.index===null)break;n(e.slice(c,a.index),l.type),c=a.end,a.part.sub?await Qg(a.match,typeof a.part.sub==`string`?a.part.sub:typeof a.part.sub==`function`?a.part.sub(a.match):a.part,n):n(a.match,a.part.type)}n(e.slice(c,e.length),l.type)}catch{n(e)}}async function $g(e,t,n=!0,r={}){let i=``;return await Qg(e,t,(e,t)=>i+=Zg(Xg(e),t)),n?`<div><div class="shj-numbers">${`<div></div>`.repeat(!r.hideLineNumbers&&e.split(`
601
- `).length)}</div><div>${i}</div></div>`:i}var e_=5e4,t_={ts:`ts`,tsx:`ts`,mts:`ts`,cts:`ts`,js:`js`,jsx:`js`,mjs:`js`,cjs:`js`,py:`py`,rs:`rs`,go:`go`,java:`java`,lua:`lua`,pl:`pl`,c:`c`,h:`c`,cpp:`c`,cc:`c`,hpp:`c`,css:`css`,scss:`css`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,json:`json`,md:`md`,markdown:`md`,yml:`yaml`,yaml:`yaml`,toml:`toml`,ini:`ini`,sh:`bash`,bash:`bash`,zsh:`bash`,sql:`sql`,dockerfile:`docker`,makefile:`make`};function n_(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===`dockerfile`?`docker`:t===`makefile`?`make`:t_[t.slice(t.lastIndexOf(`.`)+1)]??`plain`}var r_=`
599
+ `)return`hard-break`}return e===` `?`space`:e===`\xA0`||e===` `||e===`⁠`||e===``?`glue`:e===`​`?`zero-width-break`:e===`­`?`soft-hyphen`:`text`}var jl=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ml(e){return e.length===1?e[0]:e.join(``)}function Nl(e,t){let n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);return n.push(t),Ml(n)}function Pl(e,t,n,r){if(!jl.test(e))return[{text:e,isWordLike:t,kind:`text`,start:n}];let i=[],a=null,o=[],s=n,c=!1,l=0;for(let u of e){let e=Al(u,r),d=e===`text`&&t;if(a!==null&&e===a&&d===c){o.push(u),l+=u.length;continue}a!==null&&i.push({text:Ml(o),isWordLike:c,kind:a,start:s}),a=e,o=[u],s=n+l,c=d,l+=u.length}return a!==null&&i.push({text:Ml(o),isWordLike:c,kind:a,start:s}),i}function Fl(e){return e===`space`||e===`preserved-space`||e===`zero-width-break`||e===`hard-break`}var Il=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Ll(e,t){let n=e.texts[t];return n.startsWith(`www.`)?!0:Il.test(n)&&t+1<e.len&&e.kinds[t+1]===`text`&&e.texts[t+1]===`//`}function Rl(e){return e.includes(`?`)&&(e.includes(`://`)||e.startsWith(`www.`))}function zl(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let i=0;i<e.len;i++){if(r[i]!==`text`||!Ll(e,i))continue;let a=[t[i]],o=i+1;for(;o<e.len&&!Fl(r[o]);){a.push(t[o]),n[i]=!0;let e=t[o].includes(`?`);if(r[o]=`text`,t[o]=``,o++,e)break}t[i]=Ml(a)}let a=0;for(let e=0;e<t.length;e++){let o=t[e];o.length!==0&&(a!==e&&(t[a]=o,n[a]=n[e],r[a]=r[e],i[a]=i[e]),a++)}return t.length=a,n.length=a,r.length=a,i.length=a,{len:a,texts:t,isWordLike:n,kinds:r,starts:i}}function Bl(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a];if(t.push(o),n.push(e.isWordLike[a]),r.push(e.kinds[a]),i.push(e.starts[a]),!Rl(o))continue;let s=a+1;if(s>=e.len||Fl(e.kinds[s]))continue;let c=[],l=e.starts[s],u=s;for(;u<e.len&&!Fl(e.kinds[u]);)c.push(e.texts[u]),u++;c.length>0&&(t.push(Ml(c)),n.push(!0),r.push(`text`),i.push(l),a=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var K=new Set([`:`,`-`,`/`,`×`,`,`,`.`,`+`,`–`,`—`]),q=/[\p{P}\p{S}\p{Co}]/u,Vl=/\p{Emoji_Presentation}/u,Hl=new Set([`?`,`֊`,`-`,`‐`,`‒`,`–`,`—`,`…`,`‼`,`‽`,`⁉`]);function Ul(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function Wl(e){let t=e.charCodeAt(0);return t<128?Ul(t):!Hl.has(e)&&!Vl.test(e)&&q.test(e)}function Gl(e){let t=!1;for(let n of e)if(!Kc.test(n)){if(!Wl(n))return!1;t=!0}return t}function Kl(e){for(let t=e.length;t>0;){let n=ml(e,t),r=e.slice(n,t);if(Kc.test(r)){t=n;continue}return Wl(r)||bl(r)}return!1}function ql(e,t,n,r){let i=!t&&Gl(e),a=!r&&Gl(n),o=xl(e),s=(t||o)&&Kl(e);return!i&&!a&&!s||Xc(e)||Xc(n)?!1:(t||i||o)&&(r||a)}function Jl(e){for(let t of e)if(qc.test(t))return!0;return!1}function Yl(e){if(e.length===0)return!1;for(let t of e)if(!(qc.test(t)||K.has(t)))return!1;return!0}function Xl(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a],s=e.kinds[a];if(s===`text`&&Yl(o)&&Jl(o)){let s=[o],c=a+1;for(;c<e.len&&e.kinds[c]===`text`&&Yl(e.texts[c]);)s.push(e.texts[c]),c++;t.push(Ml(s)),n.push(!0),r.push(`text`),i.push(e.starts[a]),a=c-1;continue}t.push(o),n.push(e.isWordLike[a]),r.push(s),i.push(e.starts[a])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Zl(e){let t=[],n=[],r=[],i=[],a=0;for(;a<e.len;){let o=e.texts[a],s=e.kinds[a],c=e.isWordLike[a];if(s===`text`){let s=[o],l=a+1,u=c;for(;l<e.len&&e.kinds[l]===`text`&&ql(e.texts[l-1],e.isWordLike[l-1],e.texts[l],e.isWordLike[l]);){let t=e.texts[l];s.push(t),u||=e.isWordLike[l],l++}if(l>a+1){t.push(Ml(s)),n.push(u),r.push(`text`),i.push(e.starts[a]),a=l;continue}}t.push(o),n.push(c),r.push(s),i.push(e.starts[a]),a++}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Ql(e){let t=[],n=[],r=[],i=[];for(let a=0;a<e.len;a++){let o=e.texts[a];if(e.kinds[a]===`text`&&o.includes(`-`)){let s=o.split(`-`),c=s.length>1;for(let e=0;e<s.length;e++){let t=s[e];if(!c)break;(t.length===0||!Jl(t)||!Yl(t))&&(c=!1)}if(c){let o=0;for(let c=0;c<s.length;c++){let l=s[c],u=c<s.length-1?`${l}-`:l;t.push(u),n.push(!0),r.push(`text`),i.push(e.starts[a]+o),o+=u.length}continue}}t.push(o),n.push(e.isWordLike[a]),r.push(e.kinds[a]),i.push(e.starts[a])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function $l(e){let t=[],n=[],r=[],i=[],a=0;for(;a<e.len;){let o=[e.texts[a]],s=e.isWordLike[a],c=e.kinds[a],l=e.starts[a];if(c===`glue`){let u=[o[0]],d=l;for(a++;a<e.len&&e.kinds[a]===`glue`;)u.push(e.texts[a]),a++;let f=Ml(u);if(a<e.len&&e.kinds[a]===`text`)o[0]=f,o.push(e.texts[a]),s=e.isWordLike[a],c=`text`,l=d,a++;else{t.push(f),n.push(!1),r.push(`glue`),i.push(d);continue}}else a++;if(c===`text`)for(;a<e.len&&e.kinds[a]===`glue`;){let t=[];for(;a<e.len&&e.kinds[a]===`glue`;)t.push(e.texts[a]),a++;let n=Ml(t);if(a<e.len&&e.kinds[a]===`text`){o.push(n,e.texts[a]),s||=e.isWordLike[a],a++;continue}o.push(n)}t.push(Ml(o)),n.push(s),r.push(c),i.push(l)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function eu(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let e=0;e<t.length-1;e++){if(r[e]!==`text`||r[e+1]!==`text`||!Xc(t[e])||!Xc(t[e+1]))continue;let n=Cl(t[e]);n!==null&&(t[e]=n.head,t[e+1]=n.tail+t[e+1],i[e+1]=i[e]+n.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function tu(e,t,n){let r=Wc(),i=0,a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=[];for(let _ of r.segment(e))for(let e of Pl(_.segment,_.isWordLike??!1,_.index,n)){let n=e.kind===`text`,r=wl(e.text,e.isWordLike,e.kind),_=Xc(e.text),v=Jc(e.text),y=hl(e.text),b=kl(e.text),x=Dl(e.text),S=i-1;function C(){u[S]!==null&&(o[S]=[Tl(a,u,d,S)],u[S]=null),o[S].push(e.text),s[S]=s[S]||e.isWordLike,f[S]=f[S]||_,p[S]=p[S]||v,m[S]=b,h[S]=x,g[S]=El(p[S],y)}t.carryCJKAfterClosingQuote&&n&&i>0&&c[S]===`text`&&_&&f[S]&&m[S]||n&&i>0&&c[S]===`text`&&dl(e.text)&&f[S]||n&&i>0&&c[S]===`text`&&h[S]?C():n&&i>0&&c[S]===`text`&&e.isWordLike&&v&&g[S]?(C(),s[S]=!0):r!==null&&i>0&&c[S]===`text`&&u[S]===r?d[S]=(d[S]??1)+1:n&&!e.isWordLike&&i>0&&c[S]===`text`&&!f[S]&&(ul(e.text)||e.text===`-`&&s[S])?C():(a[i]=e.text,o[i]=[e.text],s[i]=e.isWordLike,c[i]=e.kind,l[i]=e.start,u[i]=r,d[i]=r===null?0:1,f[i]=_,p[i]=v,m[i]=b,h[i]=x,g[i]=El(v,y),i++)}for(let e=0;e<i;e++){if(u[e]!==null){a[e]=Tl(a,u,d,e);continue}a[e]=Ml(o[e])}for(let e=1;e<i;e++)c[e]===`text`&&!s[e]&&pl(a[e])&&c[e-1]===`text`&&!f[e-1]&&(a[e-1]+=a[e],s[e-1]=s[e-1]||s[e],a[e]=``);let _=Array.from({length:i},()=>null),v=-1;for(let e=i-1;e>=0;e--){let t=a[e];if(t.length!==0){if(c[e]===`text`&&!s[e]&&v>=0&&c[v]===`text`&&(fl(t)||t===`-`&&Sl(a[v]))){let n=_[v]??[];n.push(t),_[v]=n,l[v]=l[e],a[e]=``;continue}v=e}}for(let e=0;e<i;e++){let t=_[e];t!=null&&(a[e]=Nl(t,a[e]))}let y=0;for(let e=0;e<i;e++){let t=a[e];t.length!==0&&(y!==e&&(a[y]=t,s[y]=s[e],c[y]=c[e],l[y]=l[e]),y++)}a.length=y,s.length=y,c.length=y,l.length=y;let b=eu(Zl(Ql(Xl(Bl(zl($l({len:y,texts:a,isWordLike:s,kinds:c,starts:l})))))));for(let e=0;e<b.len-1;e++){let t=Ol(b.texts[e]);t!==null&&(b.kinds[e]!==`space`&&b.kinds[e]!==`preserved-space`||b.kinds[e+1]!==`text`||!Jc(b.texts[e+1])||(b.texts[e]=t.space,b.isWordLike[e]=!1,b.kinds[e]=b.kinds[e]===`preserved-space`?`preserved-space`:`space`,b.texts[e+1]=t.marks+b.texts[e+1],b.starts[e+1]=b.starts[e]+t.space.length))}return b}function nu(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let t=0;t<e.len;t++)e.kinds[t]===`hard-break`&&(n.push({startSegmentIndex:r,endSegmentIndex:t,consumedEndSegmentIndex:t+1}),r=t+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function ru(e,t,n){if(t.len<=1)return t;let r=[],i=[],a=[],o=[],s=-1,c=!1;function l(e){r.push(t.texts[e]),i.push(t.isWordLike[e]),a.push(`text`),o.push(t.starts[e])}function u(n,s){let c=!1;for(let e=n;e<s;e++)c||=t.isWordLike[e];let l=t.starts[n],u=s<t.len?t.starts[s]:e.length;r.push(e.slice(l,u)),i.push(c),a.push(`text`),o.push(l)}function d(e){if(!(s<0)){if(c)s+1===e?l(s):u(s,e);else for(let t=s;t<e;t++)l(t);s=-1,c=!1}}for(let e=0;e<t.len;e++){let l=t.texts[e],u=t.kinds[e];if(u===`text`){s>=0&&!nl(t.texts[e-1],n)&&d(e),s<0&&(s=e),c||=Xc(l);continue}d(e),r.push(l),i.push(t.isWordLike[e]),a.push(u),o.push(t.starts[e])}return d(t.len),{len:r.length,texts:r,isWordLike:i,kinds:a,starts:o}}function iu(e,t,n=`normal`,r=`normal`){let i=zc(n),a=i.mode===`pre-wrap`?Vc(e):Bc(e);if(a.length===0)return{normalized:a,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let o=tu(a,t,i),s=r===`keep-all`?ru(a,o,t.breakKeepAllAfterPunctuation):o;return{normalized:a,chunks:nu(s,i),...s}}var au=null,ou=new Map,su=null,cu=96,lu=/\p{Emoji_Presentation}/u,uu=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,du=null,fu=new Map;function pu(){if(au!==null)return au;if(typeof OffscreenCanvas<`u`)return au=new OffscreenCanvas(1,1).getContext(`2d`),au;if(typeof document<`u`)return au=document.createElement(`canvas`).getContext(`2d`),au;throw Error(`Text measurement requires OffscreenCanvas or a DOM canvas context.`)}function mu(e){let t=ou.get(e);return t||(t=new Map,ou.set(e,t)),t}function hu(e,t){let n=t.get(e);return n===void 0&&(n={width:pu().measureText(e).width,containsCJK:Xc(e)},t.set(e,n)),n}function gu(){if(su!==null)return su;if(typeof navigator>`u`)return su={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},su;let e=navigator.userAgent,t=navigator.vendor===`Apple Computer, Inc.`&&e.includes(`Safari/`)&&!e.includes(`Chrome/`)&&!e.includes(`Chromium/`)&&!e.includes(`CriOS/`)&&!e.includes(`FxiOS/`)&&!e.includes(`EdgiOS/`),n=e.includes(`Chrome/`)||e.includes(`Chromium/`)||e.includes(`CriOS/`)||e.includes(`Edg/`);return su={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},su}function _u(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function vu(){return du===null&&(du=new Intl.Segmenter(void 0,{granularity:`grapheme`})),du}function yu(e){return lu.test(e)||e.includes(`️`)}function bu(e){return uu.test(e)}function xu(e,t){let n=fu.get(e);if(n!==void 0)return n;let r=pu();r.font=e;let i=r.measureText(`😀`).width;if(n=0,i>t+.5&&typeof document<`u`&&document.body!==null){let t=document.createElement(`span`);t.style.font=e,t.style.display=`inline-block`,t.style.visibility=`hidden`,t.style.position=`absolute`,t.textContent=`😀`,document.body.appendChild(t);let r=t.getBoundingClientRect().width;document.body.removeChild(t),i-r>.5&&(n=i-r)}return fu.set(e,n),n}function Su(e){let t=0,n=vu();for(let r of n.segment(e))yu(r.segment)&&t++;return t}function Cu(e,t){return t.emojiCount===void 0&&(t.emojiCount=Su(e)),t.emojiCount}function wu(e,t,n){return n===0?t.width:t.width-Cu(e,t)*n}function Tu(e,t,n,r,i){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===i)return t.breakableFitAdvances;t.breakableFitMode=i;let a=vu(),o=[];for(let t of a.segment(e))o.push(t.segment);if(o.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i===`sum-graphemes`){let e=[];for(let t of o){let i=hu(t,n);e.push(wu(t,i,r))}return t.breakableFitAdvances=e,t.breakableFitAdvances}if(i===`pair-context`||o.length>cu){let e=[],i=null,a=0;for(let t of o){let o=wu(t,hu(t,n),r);if(i===null)e.push(o);else{let o=i+t,s=hu(o,n);e.push(wu(o,s,r)-a)}i=t,a=o}return t.breakableFitAdvances=e,t.breakableFitAdvances}let s=[],c=``,l=0;for(let e of o){c+=e;let t=hu(c,n),i=wu(c,t,r);s.push(i-l),l=i}return t.breakableFitAdvances=s,t.breakableFitAdvances}function Eu(e,t){let n=pu();n.font=e;let r=mu(e),i=_u(e);return{cache:r,fontSize:i,emojiCorrection:t?xu(e,i):0}}function Du(e){return e===`space`||e===`zero-width-break`||e===`soft-hyphen`}function Ou(e){return e===`space`||e===`preserved-space`||e===`tab`||e===`zero-width-break`||e===`soft-hyphen`}function ku(e,t,n=e.widths.length){for(;t<n;){let n=e.kinds[t];if(!Du(n))break;t++}return t}function Au(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function ju(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Mu(e,t){return t===0?0:e+t}function Nu(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Pu(e,t,n,r,i){return Mu(r,t===`tab`?i+Nu(e,n):e.lineEndFitAdvances[n])}function Fu(e,t,n,r){return Mu(r,t===`tab`?0:e.lineEndFitAdvances[n])}function Iu(e,t,n,r,i){return Mu(r,t===`tab`?i:e.lineEndPaintAdvances[n])}function Lu(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Ru(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function zu(e,t,n){let r=t;for(;r<e.length&&e[r]<n;)r++;return r}function Bu(e,t,n,r,i){if(e.letterSpacing===0)return 0;if(i>0)return e.spacingGraphemeCounts[r]>0?e.letterSpacing:0;for(let i=r-1;i>=t;i--){let a=e.kinds[i];if(!(a===`space`||a===`zero-width-break`||a===`hard-break`)){if(a===`soft-hyphen`){if(i===r-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Vu(e,t,n,r,i,a){return t+Bu(e,n,r,i,a)}function Hu(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:o}=e;if(r.length===0)return 0;let s=t+gu().lineFitEpsilon,c=0,l=0,u=!1,d=0,f=0,p=0,m=0,h=-1,g=0;function _(){h=-1,g=0}function v(e=p,t=m,r=l){c++,n?.(r,d,f,e,t),l=0,u=!1,_()}function y(e,t){u=!0,d=e,f=0,p=e+1,m=0,l=t}function b(e,t,n){u=!0,d=e,f=t,p=e,m=t+1,l=n}function x(e,t){if(!u){y(e,t);return}l+=t,p=e+1,m=0}function S(e,t){let n=a[e],r=o[e]??null,i=r===null?-1:zu(r,0,t+1),c=-1,d=0,f=t;for(;f<n.length;){let a=n[f];if(!u)b(e,f,a);else if(l+a>s){if(r!==null&&c>t){v(e,c,d),f=c,i=zu(r,i,f+1),c=-1,d=0;continue}v(),b(e,f,a)}else l+=a,p=e,m=f+1;let o=f+1;r!==null&&r[i]===o&&(c=o,d=l,i++),f++}u&&p===e&&m===n.length&&(p=e+1,m=0)}let C=0;for(;C<r.length&&!(!u&&(C=ku(e,C),C>=r.length));){let e=r[C],t=i[C],n=Ou(t);if(!u){e>s&&a[C]!==null?S(C,0):y(C,e),n&&(h=C+1,g=l-e),C++;continue}if(l+e>s){if(n){x(C,e),v(C+1,0,l-e),C++;continue}if(h>=0){if(p>h||p===h&&m>0){v();continue}v(h,0,g);continue}if(e>s&&a[C]!==null){v(),S(C,0),C++;continue}v();continue}x(C,e),n&&(h=C+1,g=l-e),C++}return u&&v(),c}function Uu(e,t,n){if(e.simpleLineWalkFastPath)return Hu(e,t,n);let{widths:r,kinds:i,breakableFitAdvances:a,breakablePreferredBreaks:o,discretionaryHyphenWidth:s,chunks:c}=e;if(r.length===0||c.length===0)return 0;let l=gu(),u=t+l.lineFitEpsilon,d=0,f=0,p=!1,m=0,h=0,g=0,_=0,v=-1,y=0,b=0,x=null;function S(){v=-1,y=0,b=0,x=null}function C(){return x===`soft-hyphen`&&v===g&&_===0?b:f}function w(t=g,r=_,i){d++,n!==void 0&&n(Vu(e,i??C(),m,h,t,r),m,h,t,r),f=0,p=!1,S()}function T(e,t){p=!0,m=e,h=0,g=e+1,_=0,f=t}function E(e,t,n){p=!0,m=e,h=t,g=e,_=t+1,f=n}function ee(e,t){if(!p){T(e,t);return}f+=t,g=e+1,_=0}function D(t,n,r,i,a,o){if(!n)return;let s=Fu(e,t,r,a),c=Iu(e,t,r,a,i);v=r+1,y=f-o+s,b=f-o+c,x=t}function te(t,n){let r=a[t],i=o[t]??null,s=i===null?-1:zu(i,0,n+1),c=-1,l=0,d=n;for(;d<r.length;){let a=r[d];if(!p)E(t,d,a);else{let r=Lu(e,!0,a),o=f+r;if(Ru(e,o)>u){if(i!==null&&c>n){w(t,c,l),d=c,s=zu(i,s,d+1),c=-1,l=0;continue}w(),E(t,d,a)}else f=o,g=t,_=d+1}let o=d+1;i!==null&&i[s]===o&&(c=o,l=f,s++),d++}p&&g===t&&_===r.length&&(g=t+1,_=0)}function ne(e){d++,n?.(0,e.startSegmentIndex,0,e.consumedEndSegmentIndex,0),S()}for(let t=0;t<c.length;t++){let n=c[t];if(n.startSegmentIndex===n.endSegmentIndex){ne(n);continue}p=!1,f=0,m=n.startSegmentIndex,h=0,g=n.startSegmentIndex,_=0,S();let o=n.startSegmentIndex;for(;o<n.endSegmentIndex&&!(!p&&(o=ku(e,o,n.endSegmentIndex),o>=n.endSegmentIndex));){let t=i[o],n=Ou(t),c=ju(e,p,o),d=t===`tab`?Au(f+c,e.tabStopAdvance):r[o],m=c+d,h=Pu(e,t,o,c,d);if(t===`soft-hyphen`){p&&(g=o+1,_=0,v=o+1,y=f+s,b=f+s,x=t),o++;continue}if(!p){h>u&&a[o]!==null?te(o,0):T(o,d),D(t,n,o,d,c,m),o++;continue}if(f+h>u){let r=f+Fu(e,t,o,c),i=f+Iu(e,t,o,c,d);if(x===`soft-hyphen`&&l.preferEarlySoftHyphenBreak&&y<=u){w(v,0,b);continue}if(n&&r<=u){ee(o,m),w(o+1,0,i),o++;continue}if(v>=0&&y<=u){if(g>v||g===v&&_>0){w();continue}let e=v;w(e,0,b),o=e;continue}if(h>u&&a[o]!==null){w(),te(o,0),o++;continue}w();continue}ee(o,m),D(t,n,o,d,c,m),o++}if(p){let e=v===n.consumedEndSegmentIndex?b:f;w(n.consumedEndSegmentIndex,0,e)}}return d}var Wu=null;function Gu(){return Wu===null&&(Wu=new Intl.Segmenter(void 0,{granularity:`grapheme`})),Wu}function Ku(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function qu(e,t){let n=[],r=[],i=0,a=!1,o=!1,s=!1;function c(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(``),start:i}),r=[],a=!1,o=!1,s=!1)}function l(e,t,n){r=[e],i=t,a=n,o=kl(e),s=il.has(e)}function u(e,t){r.push(e),a||=t;let n=kl(e);e.length===1&&ol.has(e)?o||=n:o=n,s=!1}for(let n of Gu().segment(e)){let e=n.segment,i=Xc(e);if(r.length===0){l(e,n.index,i);continue}if(s||rl.has(e)||ol.has(e)||t.carryCJKAfterClosingQuote&&i&&o){u(e,i);continue}if(!a&&!i){u(e,i);continue}c(),l(e,n.index,i)}return c(),n}function Ju(e,t,n){if(t.length<=1)return t;let r=[],i=-1,a=!1;function o(n,i){let a=t[n].start,o=i<t.length?t[i].start:e.length;r.push({text:e.slice(a,o),start:a})}function s(e){if(!(i<0)){if(a)i+1===e?r.push(t[i]):o(i,e);else for(let n=i;n<e;n++)r.push(t[n]);i=-1,a=!1}}for(let e=0;e<t.length;e++){let r=t[e];i>=0&&!nl(t[e-1].text,n)&&s(e),i<0&&(i=e),a||=Xc(r.text)}return s(t.length),r}function Yu(e,t){if(t===`zero-width-break`||t===`soft-hyphen`||t===`hard-break`)return 0;if(t===`tab`)return 1;let n=0,r=Gu();for(let t of r.segment(e))n++;return n}function Xu(e){return e===`-`||e===`֊`||e===`‐`||e===`‒`||e===`–`||e===`—`}function Zu(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;let t=[],n=0;for(let r of Gu().segment(e))n++,Xu(r.segment)&&t.push(n);return t.length===0?null:t}function Qu(e,t,n){return t>1?e+(t-1)*n:e}function $u(e,t,n,r,i){let a=gu(),{cache:o,emojiCorrection:s}=Eu(t,bu(e.normalized)),c=wu(`-`,hu(`-`,o),s)+(i===0?0:i*2),l=wu(` `,hu(` `,o),s)*8,u=i!==0;if(e.len===0)return Ku(n);let d=[],f=[],p=[],m=[],h=e.chunks.length<=1&&!u,g=n?[]:null,_=[],v=[],y=[],b=n?[]:null,x=Array.from({length:e.len});function S(e,t,n,r,i,a,o,s,c){i!==`text`&&i!==`space`&&i!==`zero-width-break`&&(h=!1),d.push(t),f.push(n),p.push(r),m.push(i),g?.push(a),_.push(o),v.push(s),u&&y.push(c),b!==null&&b.push(e)}function C(e,t,n,c,l){let d=hu(e,o),f=u?Yu(e,t):0,p=Qu(wu(e,d,s),f,i),m=t===`space`||t===`preserved-space`||t===`zero-width-break`?0:p,h=m===0?0:m+(f>0?i:0),g=t===`space`||t===`zero-width-break`?0:p;if(l&&c&&e.length>1){let c=`sum-graphemes`;i===0?Yl(e)?c=`pair-context`:a.preferPrefixWidthsForBreakableRuns&&(c=`segment-prefixes`):c=`segment-prefixes`;let l=Tu(e,d,o,s,c);S(e,p,h,g,t,n,l,l===null||r===`keep-all`?null:Zu(e),f);return}S(e,p,h,g,t,n,null,null,f)}for(let t=0;t<e.len;t++){x[t]=d.length;let n=e.texts[t],i=e.isWordLike[t],s=e.kinds[t],l=e.starts[t];if(s===`soft-hyphen`){S(n,0,c,c,s,l,null,null,0);continue}if(s===`hard-break`){S(n,0,0,0,s,l,null,null,0);continue}if(s===`tab`){S(n,0,0,0,s,l,null,null,u?Yu(n,s):0);continue}let f=hu(n,o);if(s===`text`&&f.containsCJK){let e=qu(n,a),t=r===`keep-all`?Ju(n,e,a.breakKeepAllAfterPunctuation):e;for(let e=0;e<t.length;e++){let n=t[e];C(n.text,`text`,l+n.start,i,r===`keep-all`||!Xc(n.text))}continue}C(n,s,l,i,!0)}let w=ed(e.chunks,x,d.length),T=g===null?null:Ic(e.normalized,g);return b===null?{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:h,segLevels:T,breakableFitAdvances:_,breakablePreferredBreaks:v,letterSpacing:i,spacingGraphemeCounts:y,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:w}:{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:h,segLevels:T,breakableFitAdvances:_,breakablePreferredBreaks:v,letterSpacing:i,spacingGraphemeCounts:y,discretionaryHyphenWidth:c,tabStopAdvance:l,chunks:w,segments:b}}function ed(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a.startSegmentIndex<t.length?t[a.startSegmentIndex]:n,s=a.endSegmentIndex<t.length?t[a.endSegmentIndex]:n,c=a.consumedEndSegmentIndex<t.length?t[a.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:c})}return r}function td(e,t,n,r){let i=r?.wordBreak??`normal`,a=r?.letterSpacing??0;return $u(iu(e,gu(),r?.whiteSpace,i),t,n,i,a)}function nd(e,t,n){return td(e,t,!0,n)}function rd(e){return e}function id(e){let t=0;return Uu(rd(e),1/0,e=>{e>t&&(t=e)}),t}function ad(e){let t=e.toLowerCase().replace(/^←\s*/,``);return t.includes(`force push`)?`force-push`:t.includes(`cherry`)?`cherry-pick`:t.includes(`uncommit`)?`uncommit`:t.includes(`revert`)?`revert`:t.includes(`rebase`)?`rebase`:t.includes(`merge`)?`merge`:t.includes(`checkout`)?`checkout`:t.includes(`fetch`)?`fetch`:t.includes(`push`)?`push`:t.includes(`delete`)||t.includes(`discard`)?`delete`:t.includes(`unstage`)?`unstage`:t.includes(`stage`)?`stage`:t.includes(`stash`)?`stash`:t.includes(`move`)?`move`:t.includes(`reset`)?`reset`:t.includes(`branch`)?`branch`:t.includes(`tag`)?`tag`:`checkout`}function od({name:e,size:t=14}){let n={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};return(0,y.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:t,height:t,viewBox:`0 0 24 24`,style:{flex:`0 0 auto`},children:[e===`branch`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`18`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v9`}),(0,y.jsx)(`path`,{...n,d:`M9 18h6`})]}),e===`checkout`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M5 12h14`}),(0,y.jsx)(`path`,{...n,d:`m13 6 6 6-6 6`}),(0,y.jsx)(`path`,{...n,d:`M5 5v14`})]}),e===`cherry-pick`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`7`,cy:`7`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`17`,cy:`17`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M10 7h2a5 5 0 0 1 5 5v2`})]}),e===`delete`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 6h18`}),(0,y.jsx)(`path`,{...n,d:`M8 6V4h8v2`}),(0,y.jsx)(`path`,{...n,d:`m19 6-1 14H6L5 6`}),(0,y.jsx)(`path`,{...n,d:`M10 11v5`}),(0,y.jsx)(`path`,{...n,d:`M14 11v5`})]}),e===`fetch`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 5v12`}),(0,y.jsx)(`path`,{...n,d:`m7 12 5 5 5-5`}),(0,y.jsx)(`path`,{...n,d:`M5 20h14`})]}),e===`force-push`&&(0,y.jsx)(`path`,{...n,d:`M13 2 4 14h7l-1 8 10-13h-7l0-7Z`}),e===`merge`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`18`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`18`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v6`}),(0,y.jsx)(`path`,{...n,d:`M9 6h1a8 8 0 0 1 8 8v1`})]}),e===`move`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 12h18`}),(0,y.jsx)(`path`,{...n,d:`m8 7-5 5 5 5`}),(0,y.jsx)(`path`,{...n,d:`m16 7 5 5-5 5`})]}),e===`push`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 19V5`}),(0,y.jsx)(`path`,{...n,d:`m7 10 5-5 5 5`}),(0,y.jsx)(`path`,{...n,d:`M5 20h14`})]}),e===`rebase`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`6`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`6`,cy:`18`,r:`3`}),(0,y.jsx)(`circle`,{...n,cx:`18`,cy:`12`,r:`3`}),(0,y.jsx)(`path`,{...n,d:`M6 9v6`}),(0,y.jsx)(`path`,{...n,d:`M9 6h2a7 7 0 0 1 7 7`})]}),e===`reset`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M4 7v6h6`}),(0,y.jsx)(`path`,{...n,d:`M20 17a8 8 0 0 1-14.9-4`}),(0,y.jsx)(`path`,{...n,d:`M4 13A8 8 0 0 1 19 8`})]}),e===`revert`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.7 2.7L3 8`}),(0,y.jsx)(`path`,{...n,d:`M3 3v5h5`})]}),e===`stage`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M12 5v14`}),(0,y.jsx)(`path`,{...n,d:`M5 12h14`})]}),e===`stash`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M4 4h16v6H4z`}),(0,y.jsx)(`path`,{...n,d:`M6 10v10h12V10`}),(0,y.jsx)(`path`,{...n,d:`M9 14h6`})]}),e===`tag`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M20 10 10 20 4 14V4h10l6 6Z`}),(0,y.jsx)(`circle`,{...n,cx:`9`,cy:`9`,r:`1`})]}),e===`unstage`&&(0,y.jsx)(`path`,{...n,d:`M5 12h14`}),e===`uncommit`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...n,d:`M9 14 4 9l5-5`}),(0,y.jsx)(`path`,{...n,d:`M4 9h10a6 6 0 0 1 0 12h-1`})]})]})}function sd({size:e=13}){return(0,y.jsx)(`svg`,{"aria-hidden":`true`,focusable:`false`,width:e,height:e,viewBox:`0 0 24 24`,style:{flex:`0 0 auto`},children:(0,y.jsx)(`path`,{d:`M12 3a9 9 0 0 1 9 9`,fill:`none`,stroke:`currentColor`,strokeWidth:2.4,strokeLinecap:`round`,children:(0,y.jsx)(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 12 12`,to:`360 12 12`,dur:`0.8s`,repeatCount:`indefinite`})})})}function cd({label:e,onClick:t,tone:n,onMouseEnter:r,onMouseLeave:i}){let a=n===`success`?`#0b1020`:n===`warning`?`#fff7d6`:n===`merge`?`#fff7ff`:`#fff7ed`,o=n===`success`?`#6d9658`:n===`warning`?`#d8a43a`:n===`merge`?`#b764d9`:`#9a3412`,s=n===`success`?`#8dcf78`:n===`warning`?`#b88a25`:n===`merge`?`#c77de4`:`#b45309`,c=n===`success`?`#9cda89`:n===`warning`?`#c99a30`:n===`merge`?`#d08bea`:`#c26115`;return(0,y.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),t()},style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:104,height:30,padding:`0 12px`,background:s,border:`1px solid ${o}`,borderRadius:7,color:a,fontSize:10,fontWeight:700,cursor:`pointer`,fontFamily:`inherit`,whiteSpace:`nowrap`,position:`relative`,zIndex:8,boxShadow:`0 10px 24px rgba(0,0,0,0.35)`,gap:6,lineHeight:1},onMouseEnter:e=>{e.currentTarget.style.background=c},onMouseLeave:e=>{e.currentTarget.style.background=s},onPointerEnter:r,onPointerLeave:i,children:[(0,y.jsx)(od,{name:ad(e)}),(0,y.jsx)(`span`,{children:e})]})}function ld({label:e,onClick:t,tone:n,size:r=`default`,variant:i=`solid`,disabled:a=!1,loading:o=!1,iconOnly:s=!1}){let c=r===`compact`,l=i===`ghost`,u=a||o,d=n===`danger`?`#5c2430`:n===`warning`?`#7a4e11`:n===`success`?`#2c4231`:`#2f3348`,f=n===`danger`?`#6a2b39`:n===`warning`?`#8a5a16`:n===`success`?`#37523d`:`#3a4058`,p=n===`danger`?`#8b3a4a`:n===`warning`?`#d19128`:n===`success`?`#588a5c`:`#4a4f68`,m=n===`danger`?`#f5a6b8`:n===`warning`?`#f9d28b`:n===`success`?`#a6e3a1`:l?`#bac2de`:`#cdd6f4`;return(0,y.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),!u&&t()},disabled:u,"aria-busy":o||void 0,"aria-label":s?e:void 0,title:s?e:void 0,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:s?c?24:30:c?72:84,height:c?20:28,padding:s?0:c?`0 8px`:`0 10px`,background:l?`rgba(24,24,37,0.5)`:d,border:l?`1px solid transparent`:`1px solid ${p}`,color:m,fontSize:10,fontWeight:600,cursor:u?`default`:`pointer`,opacity:a&&!o?.62:1,borderRadius:c?6:7,fontFamily:`inherit`,whiteSpace:`nowrap`,gap:c?5:6,lineHeight:1},onMouseEnter:e=>{u||(e.currentTarget.style.background=l?`rgba(49,50,68,0.8)`:f)},onMouseLeave:e=>{u||(e.currentTarget.style.background=l?`rgba(24,24,37,0.5)`:d)},children:[o?(0,y.jsx)(sd,{size:c?12:13}):(0,y.jsx)(od,{name:ad(e),size:c?12:13}),!s&&(0,y.jsx)(`span`,{children:e})]})}var ud=2e4,dd=new Set([`g`,`path`,`circle`,`ellipse`,`line`,`polyline`,`polygon`,`rect`]),fd=new Set([`title`,`desc`,`metadata`]),pd={d:`d`,fill:`fill`,stroke:`stroke`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"stroke-miterlimit":`strokeMiterlimit`,"stroke-dasharray":`strokeDasharray`,"stroke-dashoffset":`strokeDashoffset`,"fill-rule":`fillRule`,"clip-rule":`clipRule`,opacity:`opacity`,"fill-opacity":`fillOpacity`,"stroke-opacity":`strokeOpacity`,transform:`transform`,cx:`cx`,cy:`cy`,r:`r`,rx:`rx`,ry:`ry`,x:`x`,y:`y`,x1:`x1`,x2:`x2`,y1:`y1`,y2:`y2`,width:`width`,height:`height`,points:`points`,"vector-effect":`vectorEffect`},md=new Set([`fill`,`stroke`]),hd=/^[+\-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?(?:px)?$/i,gd=/^[\d\s,.+\-eE]+$/,_d=/^[\d\s,.+\-eEa-zA-Z]+$/,vd=/^[\d\s,.+\-eEa-zA-Z()]+$/,yd=new Map;function bd(e){let t=e.trim().toLowerCase();return t===`none`||t===`transparent`?`none`:`currentColor`}function xd(e,t){let n=t.trim();return!n||n.length>5e3?null:md.has(e)?bd(n):e===`d`?_d.test(n)?n:null:e===`points`?gd.test(n)?n:null:e===`transform`?vd.test(n)?n:null:e===`vector-effect`?n===`non-scaling-stroke`?n:null:e===`fill-rule`||e===`clip-rule`?n===`evenodd`||n===`nonzero`?n:null:e===`stroke-linecap`?[`butt`,`round`,`square`].includes(n)?n:null:e===`stroke-linejoin`?[`arcs`,`bevel`,`miter`,`miter-clip`,`round`].includes(n)?n:null:e===`stroke-dasharray`?n===`none`||gd.test(n)?n:null:hd.test(n)?n.replace(/px$/i,``):null}function Sd(e){let t={};for(let n of e.attributes){let e=n.name.toLowerCase();if(e.startsWith(`on`)||e===`href`||e===`xlink:href`)continue;if(e===`style`){for(let e of n.value.split(`;`)){let n=e.indexOf(`:`);if(n===-1)continue;let r=e.slice(0,n).trim().toLowerCase(),i=pd[r];if(!i)continue;let a=xd(r,e.slice(n+1));a!==null&&(t[i]=a)}continue}let r=pd[e];if(!r)continue;let i=xd(e,n.value);i!==null&&(t[r]=i)}return t}function Cd(e){let t=e.getAttribute(`viewBox`);if(t){let e=t.trim().split(/[\s,]+/).map(Number);if(e.length===4&&e.every(Number.isFinite)&&e[2]>0&&e[3]>0)return e.join(` `)}let n=Number.parseFloat(e.getAttribute(`width`)??``),r=Number.parseFloat(e.getAttribute(`height`)??``);return Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0?`0 0 ${n} ${r}`:`0 0 24 24`}function J(e){let t=yd.get(e);if(t)return t;let n;if(!e.trim())n={value:null,error:`Paste a complete <svg> element.`};else if(e.length>2e4)n={value:null,error:`SVG must be smaller than ${ud.toLocaleString()} characters.`};else if(typeof DOMParser>`u`)n={value:null,error:`SVG parsing is unavailable in this environment.`};else try{let t=new DOMParser().parseFromString(e,`image/svg+xml`),r=t.querySelector(`parsererror`),i=t.documentElement;if(r||i.localName.toLowerCase()!==`svg`)n={value:null,error:`Paste one valid <svg> element.`};else{let e=0,t=null,r=n=>{let i=[];for(let a of n.children){let n=a.localName.toLowerCase();if(fd.has(n))continue;if(!dd.has(n))return t=`Unsupported SVG element: <${n}>.`,[];if(e+=1,e>250)return t=`SVG contains too many elements (maximum 250).`,[];let o=r(a);if(t)return[];i.push({tag:n,props:Sd(a),children:o})}return i},a=r(i);n=t?{value:null,error:t}:a.length===0?{value:null,error:`SVG does not contain a supported shape.`}:{value:{viewBox:Cd(i),rootProps:Sd(i),children:a},error:null}}}catch{n={value:null,error:`Could not parse this SVG.`}}return yd.size>=100&&yd.clear(),yd.set(e,n),n}function wd(e){return J(e).error}function Td(e,t){return(0,b.createElement)(e.tag,{...e.props,key:t},e.children.map((e,n)=>Td(e,`${t}-${n}`)))}function Ed({source:e,color:t,size:n=13}){let r=J(e);return r.value?(0,y.jsx)(`svg`,{fill:`currentColor`,stroke:`none`,...r.value.rootProps,"aria-hidden":`true`,focusable:`false`,x:-n/2,y:-n/2,width:n,height:n,viewBox:r.value.viewBox,style:{color:t,overflow:`visible`},children:r.value.children.map((e,t)=>Td(e,`custom-svg-${t}`))}):null}var Dd=[`accessibility`,`api`,`build`,`chore`,`ci`,`config`,`database`,`dependencies`,`docs`,`feature`,`fix`,`i18n`,`infra`,`merge`,`move`,`performance`,`refactor`,`release`,`rename`,`revert`,`security`,`style`,`test`,`ui`];function Od(e,t,n,...r){return{id:e,icon:e,label:t,enabled:!0,types:n,patterns:r}}var kd=[Od(`revert`,`Revert`,[`revert`],String.raw`\b(?:revert(?:ed|ing)?|rollbacks?)\b`),Od(`merge`,`Merge`,[`merge`],String.raw`\bmerg(?:e|ed|ing)\b`),Od(`security`,`Security`,[`security`,`sec`],String.raw`\b(?:security|vulnerabilit(?:y|ies)|cve|xss|csrf)\b`),Od(`fix`,`Fix`,[`fix`,`bugfix`,`hotfix`],String.raw`\b(?:fix(?:es|ed|ing)?|bugs?|bugfix(?:es)?|hotfix(?:es)?)\b`),Od(`feature`,`Feature`,[`feat`,`feature`],String.raw`\b(?:feat|feature)s?\b`),Od(`performance`,`Performance`,[`perf`,`performance`],String.raw`\b(?:perf|performance|optimi[sz](?:e[ds]?|ing|ation)|speedups?)\b`),Od(`refactor`,`Refactor`,[`refactor`],String.raw`\b(?:refactor(?:s|ed|ing)?|restructur(?:e[ds]?|ing))\b`),Od(`move`,`Move`,[`move`],String.raw`\b(?:move[ds]?|moving|relocat(?:e[ds]?|ing))\b`),Od(`rename`,`Rename`,[`rename`],String.raw`\b(?:rename[ds]?|renaming)\b`),Od(`test`,`Tests`,[`test`,`tests`],String.raw`\b(?:tests?|specs?|coverage|e2e)\b`),Od(`docs`,`Documentation`,[`docs`,`doc`],String.raw`\b(?:docs?|documentation|readme|changelog)\b`),Od(`accessibility`,`Accessibility`,[`a11y`,`accessibility`],String.raw`\b(?:a11y|accessibility|aria|screen[\s-]?reader)\b`),Od(`i18n`,`Localization`,[`i18n`,`l10n`],String.raw`\b(?:i18n|l10n|internationali[sz]ation|locali[sz]ation|translations?)\b`),Od(`database`,`Database`,[`db`,`database`,`migration`],String.raw`\b(?:database|db|sql|schemas?|migrations?)\b`),Od(`api`,`API`,[`api`],String.raw`\b(?:apis?|graphql|grpc|rpc|endpoints?|webhooks?)\b`),Od(`ui`,`UI`,[`ui`,`ux`],String.raw`\b(?:ui|ux|frontend|layouts?|responsive)\b`),Od(`infra`,`Infrastructure`,[`infra`,`infrastructure`,`deploy`],String.raw`\b(?:infra|infrastructure|terraform|kubernetes|k8s|docker|deploy(?:ment|s|ed|ing)?)\b`),Od(`ci`,`CI`,[`ci`],String.raw`\b(?:ci|continuous[\s-]integration|github[\s-]actions?|workflows?|pipelines?)\b`),Od(`build`,`Build`,[`build`],String.raw`\b(?:builds?|built|bundl(?:e[ds]?|er|ing)|compil(?:e[ds]?|er|ing)|webpack|vite)\b`),Od(`dependencies`,`Dependencies`,[`deps`,`dependencies`,`dependency`],String.raw`\b(?:deps?|dependencies|dependency|packages?|lockfiles?|bump(?:s|ed|ing)?)\b`),Od(`release`,`Release`,[`release`],String.raw`\b(?:releases?|version(?:ing)?|publish(?:es|ed|ing)?)\b`),Od(`config`,`Configuration`,[`config`],String.raw`\b(?:config|configuration|settings?|environment)\b`,String.raw`(?:^|\s)\.env(?:\s|$)`),Od(`style`,`Style`,[`style`,`format`,`lint`],String.raw`\b(?:styles?|styling|css|themes?|format(?:ted|ting)?|lint(?:ed|ing)?)\b`),Od(`chore`,`Chore`,[`chore`],String.raw`\b(?:chores?|cleanup|housekeeping|maintenance)\b`)],Ad=/^([a-z][a-z0-9-]*)(?:\([^)]*\))?!?:/i,jd=new Map;function Md(e){if(jd.has(e))return jd.get(e)??null;try{let t=new RegExp(e,`i`);return jd.set(e,t),t}catch{return jd.set(e,null),null}}function Nd(e){if(!e.trim())return`Pattern cannot be empty.`;try{return new RegExp(e,`i`),null}catch(e){return e instanceof Error?e.message:`Invalid regular expression.`}}function Pd(e,t=kd){let n=Ad.exec(e.trim())?.[1]?.toLowerCase();if(n){let e=t.find(e=>e.enabled&&e.types.some(e=>e.toLowerCase()===n));if(e)return e}return t.find(t=>t.enabled&&t.patterns.some(t=>Md(t)?.test(e)===!0))??null}var Fd=`ingit.commitIconRules`,Id=1,Ld=200,Rd=50,zd=500;function Bd(e){return e.map(e=>({...e,types:[...e.types],patterns:[...e.patterns]}))}function Vd(e){return JSON.stringify({version:Id,rules:e})}function Hd(e){return typeof e==`string`&&Dd.includes(e)}function Ud(e,t){if(!Array.isArray(e)||e.length>Rd)return null;let n=[];for(let r of e){if(typeof r!=`string`)return null;let e=r.trim();if(!e||e.length>t)return null;n.push(e)}return n}function Wd(e){if(e===null)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return null;let{version:n,rules:r}=t;if(n!==Id||!Array.isArray(r)||r.length>Ld)return null;let i=new Set,a=[];for(let e of r){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.id==`string`?t.id.trim():``,r=typeof t.label==`string`?t.label.trim():``,o=Ud(t.types,80),s=Ud(t.patterns,zd),c=t.customSvg===void 0?void 0:typeof t.customSvg==`string`?t.customSvg.trim():null;if(!n||n.length>100||i.has(n)||!r||r.length>100||!Hd(t.icon)||typeof t.enabled!=`boolean`||o===null||s===null||c===null||c!==void 0&&(!c||c.length>2e4)||c!==void 0&&typeof DOMParser<`u`&&wd(c)!==null||s.some(e=>Nd(e)!==null))return null;i.add(n),a.push({id:n,label:r,icon:t.icon,enabled:t.enabled,types:o,patterns:s,...c===void 0?{}:{customSvg:c}})}return a}catch{return null}}function Gd(){try{return typeof window>`u`?null:window.localStorage}catch{return null}}function Kd(){let e=Gd();if(!e)return Bd(kd);try{return Wd(e.getItem(Fd))??Bd(kd)}catch{return Bd(kd)}}var qd=Kd(),Jd=new Set;function Yd(e){qd=e;for(let e of Jd)e()}function Xd(e){e.key!==null&&e.key!==Fd||Yd(Wd(e.newValue)??Bd(kd))}function Zd(e){let t=Jd.size===0;return Jd.add(e),t&&typeof window<`u`&&window.addEventListener(`storage`,Xd),()=>{Jd.delete(e),Jd.size===0&&typeof window<`u`&&window.removeEventListener(`storage`,Xd)}}function Qd(){return(0,b.useSyncExternalStore)(Zd,()=>qd,()=>kd)}function $d(e){let t=Wd(Vd(e));if(!t)return!1;let n=Gd();if(!n)return!1;try{n.setItem(Fd,Vd(t))}catch{return!1}return Yd(t),!0}function ef(){let e=Gd();if(!e)return!1;try{e.removeItem(Fd)}catch{return!1}return Yd(Bd(kd)),!0}var Y={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function tf({icon:e,color:t,size:n=13,customSvg:r}){return r?(0,y.jsx)(Ed,{source:r,color:t,size:n}):(0,y.jsxs)(`svg`,{"aria-hidden":`true`,focusable:`false`,x:-n/2,y:-n/2,width:n,height:n,viewBox:`0 0 24 24`,style:{color:t,overflow:`visible`},children:[e===`accessibility`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`4`,r:`2`}),(0,y.jsx)(`path`,{...Y,d:`M5 8h14M12 6v7M8 21l4-8 4 8M7 13l5-2 5 2`})]}),e===`api`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M9 3v5M15 3v5M7 8h10v3a5 5 0 0 1-5 5v5`}),(0,y.jsx)(`path`,{...Y,d:`M8 12h8`})]}),e===`build`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m14 5 5 5M16 3l5 5-3 3-5-5 3-3Z`}),(0,y.jsx)(`path`,{...Y,d:`M14.5 8.5 4 19l1 1L15.5 9.5`})]}),e===`chore`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m20 3-9 9M11 10l3 3`}),(0,y.jsx)(`path`,{...Y,d:`m11 10-7 7 3 3 7-7-3-3ZM3 21h9`})]}),e===`ci`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`6`,r:`2.5`}),(0,y.jsx)(`circle`,{...Y,cx:`18`,cy:`6`,r:`2.5`}),(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`18`,r:`2.5`}),(0,y.jsx)(`path`,{...Y,d:`M8.5 6h7M7.4 8.2l3.2 7.6M16.6 8.2l-3.2 7.6`})]}),e===`config`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M4 6h10M18 6h2M4 12h2M10 12h10M4 18h8M16 18h4`}),(0,y.jsx)(`circle`,{...Y,cx:`16`,cy:`6`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`8`,cy:`12`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`14`,cy:`18`,r:`2`})]}),e===`database`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`ellipse`,{...Y,cx:`12`,cy:`5`,rx:`7`,ry:`3`}),(0,y.jsx)(`path`,{...Y,d:`M5 5v6c0 1.7 3.1 3 7 3s7-1.3 7-3V5M5 11v6c0 1.7 3.1 3 7 3s7-1.3 7-3v-6`})]}),e===`dependencies`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m12 3 9 5-9 5-9-5 9-5Z`}),(0,y.jsx)(`path`,{...Y,d:`M3 8v8l9 5 9-5V8M12 13v8`})]}),e===`docs`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 6a6 6 0 0 0-8-2v15a6 6 0 0 1 8 2V6Z`}),(0,y.jsx)(`path`,{...Y,d:`M12 6a6 6 0 0 1 8-2v15a6 6 0 0 0-8 2V6Z`})]}),e===`feature`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3c.6 3.2 1.8 4.4 5 5-3.2.6-4.4 1.8-5 5-.6-3.2-1.8-4.4-5-5 3.2-.6 4.4-1.8 5-5Z`}),(0,y.jsx)(`path`,{...Y,d:`M19 15c.3 1.7 1 2.4 2.7 2.7-1.7.3-2.4 1-2.7 2.7-.3-1.7-1-2.4-2.7-2.7 1.7-.3 2.4-1 2.7-2.7Z`})]}),e===`fix`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`7`,y:`6`,width:`10`,height:`14`,rx:`5`}),(0,y.jsx)(`path`,{...Y,d:`M9 6 7 3M15 6l2-3M3 10h4M17 10h4M3 15h4M17 15h4M9 11h.01M15 11h.01M12 14v6`})]}),e===`i18n`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`12`,r:`9`}),(0,y.jsx)(`path`,{...Y,d:`M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18`})]}),e===`infra`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`3`,y:`4`,width:`18`,height:`6`,rx:`2`}),(0,y.jsx)(`rect`,{...Y,x:`3`,y:`14`,width:`18`,height:`6`,rx:`2`}),(0,y.jsx)(`path`,{...Y,d:`M7 7h.01M7 17h.01M11 7h7M11 17h7`})]}),e===`merge`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`5`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`18`,cy:`19`,r:`2`}),(0,y.jsx)(`circle`,{...Y,cx:`6`,cy:`19`,r:`2`}),(0,y.jsx)(`path`,{...Y,d:`M6 7v10M8 5h2a8 8 0 0 1 8 8v4`})]}),e===`move`&&(0,y.jsx)(`path`,{...Y,d:`M12 3v18M3 12h18M8 7l4-4 4 4M8 17l4 4 4-4M7 8l-4 4 4 4M17 8l4 4-4 4`}),e===`performance`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M4 18a8 8 0 1 1 16 0M12 18l4-5M6.5 10l1 1M12 7v2M17.5 10l-1 1`}),(0,y.jsx)(`circle`,{...Y,cx:`12`,cy:`18`,r:`1`})]}),e===`refactor`&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`path`,{...Y,d:`m8 7 4-4 4 4M12 3v7M18 10l3 4-3 4M21 14h-7M8 21l-4-4 4-4M4 17h7`})}),e===`release`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M14 4c3-2 5-1 6 0s2 3 0 6l-6 6-6-6 6-6Z`}),(0,y.jsx)(`circle`,{...Y,cx:`16`,cy:`8`,r:`1.5`}),(0,y.jsx)(`path`,{...Y,d:`M8 10H5l-2 4 5 1M14 16v3l-4 2-1-5M7 17l-2 2`})]}),e===`rename`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`m14 5 5 5M4 20l3.5-.8L20 6.7 17.3 4 4.8 16.5 4 20Z`}),(0,y.jsx)(`path`,{...Y,d:`M3 22h9`})]}),e===`revert`&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(`path`,{...Y,d:`m9 7-5 5 5 5M4 12h10a6 6 0 0 1 6 6v2`})}),e===`security`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3 20 6v6c0 5-3.4 8-8 10-4.6-2-8-5-8-10V6l8-3Z`}),(0,y.jsx)(`path`,{...Y,d:`m8.5 12 2.2 2.2 4.8-5`})]}),e===`style`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M12 3a9 9 0 0 0 0 18h1.5a2 2 0 0 0 0-4H12a2 2 0 0 1 0-4h3a6 6 0 0 0 0-12h-3Z`}),(0,y.jsx)(`path`,{...Y,d:`M7.5 10h.01M9 6.5h.01M14 6.5h.01M17 9h.01`})]}),e===`test`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{...Y,d:`M9 3h6M10 3v6l-5 9a2 2 0 0 0 2 3h10a2 2 0 0 0 2-3l-5-9V3`}),(0,y.jsx)(`path`,{...Y,d:`M7.5 15h9`})]}),e===`ui`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`rect`,{...Y,x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,y.jsx)(`path`,{...Y,d:`M9 4v16M9 10h12`})]})]})}function nf(e,t,n,r,i){if(e.length===0)return null;let a=Math.min(t,n),o=Math.max(t,n),s=[...new Set(e.map(e=>e.x))].sort((e,t)=>e-t),c=new Set(e.filter(e=>e.idx>a&&e.idx<o).map(e=>e.x)),l=e.find(e=>e.idx===n)?.x,u=l===void 0?[]:s.filter(e=>i===`left`?e<=l:e>=l).sort((e,t)=>i===`left`?t-e:e-t);for(let e of u)if(!c.has(e))return e;return i===`left`?s[0]-r:s[s.length-1]+r}function rf(e,t,n){return e.map((r,i)=>{let a=e.length-i;return{...r,y:t.y-a*n,idx:t.idx-a}})}function af({baseZoom:e,bounds:t,viewport:n,scroll:r,margin:i}){let a=t.minX*e-r.x,o=t.maxX*e-r.x,s=t.minY*e-r.y,c=t.maxY*e-r.y;if(a>=i&&o<=n.width-i&&s>=i&&c<=n.height-i)return{zoom:e,translateX:0,translateY:0};let l=Math.max(1,t.maxX-t.minX),u=Math.max(1,t.maxY-t.minY),d=Math.max(1,n.width-i*2),f=Math.max(1,n.height-i*2),p=Math.max(.05,Math.min(e,d/l,f/u)),m=t.minX*p-r.x,h=t.maxX*p-r.x,g=t.minY*p-r.y,_=t.maxY*p-r.y,v=(e,t,n)=>{let r=i-e,a=n-i-t;return Math.min(a,Math.max(r,0))};return{zoom:p,translateX:v(m,h,n.width),translateY:v(g,_,n.height)}}function of(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1;return{x:e.x+r/a*n,y:e.y+i/a*n}}function sf(e,t,n,r,i){let a=1-i,o=a**3,s=3*a**2*i,c=3*a*i**2,l=i**3;return{x:e.x*o+t.x*s+n.x*c+r.x*l,y:e.y*o+t.y*s+n.y*c+r.y*l}}function cf(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return(e.x-t.x)**2+(e.y-t.y)**2;let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a)),s=t.x+o*r,c=t.y+o*i;return(e.x-s)**2+(e.y-c)**2}function lf(e,t,n,r,i){let a=r.nodeRadius-1,o=of(e,t,a),s=of(t,e,a),c=s.y-o.y,l={x:o.x,y:o.y+c*r.curveControlRatio},u={x:s.x,y:s.y-c*r.curveControlRatio},d=(r.nodeRadius+r.clearance)**2,f=Math.max(32,Math.ceil(Math.hypot(s.x-o.x,s.y-o.y)/4)),p=Math.min(e.idx,t.idx)+1,m=Math.max(e.idx,t.idx)-1,h=[];for(let t=p;t<=m;t++){let a=n[t],o=[...a===void 0?[]:[a],...i?.get(t)??[]];for(let n of o)h.push({x:e.x+(n-e.lane)*r.laneWidth,y:e.y+(t-e.idx)*r.rowHeight})}let g=o;for(let e=1;e<=f;e++){let t=sf(o,l,u,s,e/f);if(h.some(e=>cf(e,g,t)<=d))return!0;g=t}return!1}function uf(e,t,n,r,i){let a=r===`from`?e.lane:t.lane,o=Math.min(e.idx,t.idx)+1,s=Math.max(e.idx,t.idx)-1;for(let e=o;e<=s;e++)if(n[e]===a||i?.get(e)?.includes(a))return!1;return!0}function df(e,t,n,r,i){if(!uf(e,t,n,r,i))return null;let a=r===`from`?e:t,o=r===`from`?t:e;return{side:a.x<=o.x?`left`:`right`,anchorLane:a.lane,innerLane:o.lane,outerRailX:a.x}}function ff(e,t,n,r,i,a){if(Math.abs(t.idx-e.idx)<2||!lf(e,t,n,r,a))return null;if(uf(e,t,n,i,a))return i;let o=i===`from`?`to`:`from`;return uf(e,t,n,o,a)?o:null}var pf={position:`fixed`,inset:0,margin:`auto`,width:`min(420px, calc(100vw - 32px))`,padding:0,border:`1px solid #45475a`,borderRadius:8,background:`#1e1e2e`,color:`#cdd6f4`,boxShadow:`0 22px 64px rgba(0,0,0,0.58)`},mf={display:`flex`,flexDirection:`column`,gap:14,padding:18,fontFamily:`system-ui, -apple-system, sans-serif`},hf={margin:0,color:`#f5e0dc`,fontSize:16,fontWeight:700,lineHeight:1.25},gf={height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #45475a`,background:`#181825`,color:`#bac2de`,fontSize:12,fontWeight:700,fontFamily:`inherit`,cursor:`pointer`},_f={height:30,padding:`0 12px`,borderRadius:6,border:`1px solid #6d9658`,background:`#8dcf78`,color:`#0b1020`,fontSize:12,fontWeight:800,fontFamily:`inherit`,cursor:`pointer`};function vf({open:e,title:t,label:n,initialValue:r=``,confirmLabel:i,allowEmpty:a=!1,placeholder:o,onSubmit:s,onClose:c}){let l=(0,b.useRef)(null),u=(0,b.useRef)(null),[d,f]=(0,b.useState)(r);return(0,b.useEffect)(()=>{e&&f(r)},[r,e]),(0,b.useEffect)(()=>{let t=l.current;if(t){if(e){t.open||t.showModal(),requestAnimationFrame(()=>u.current?.focus());return}t.open&&t.close()}},[e]),(0,y.jsx)(`dialog`,{ref:l,"aria-labelledby":`text-input-dialog-title`,onCancel:c,onClose:c,onClick:e=>{e.target===e.currentTarget&&c()},style:pf,children:(0,y.jsxs)(`form`,{method:`dialog`,onSubmit:e=>{e.preventDefault();let t=d.trim();if(!a&&!t){u.current?.focus();return}s(t)},onClick:e=>e.stopPropagation(),style:mf,children:[(0,y.jsx)(`h2`,{id:`text-input-dialog-title`,style:hf,children:t}),(0,y.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:7,color:`#bac2de`,fontSize:12,fontWeight:700},children:[n,(0,y.jsx)(`input`,{ref:u,value:d,onChange:e=>f(e.target.value),required:!a,placeholder:o,autoComplete:`off`,spellCheck:!1,style:{height:34,padding:`0 10px`,borderRadius:6,border:`1px solid #45475a`,background:`#11111b`,color:`#cdd6f4`,fontSize:13,fontFamily:`inherit`,outline:`none`}})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,paddingTop:2},children:[(0,y.jsx)(`button`,{type:`button`,onClick:c,style:gf,children:`Cancel`}),(0,y.jsx)(`button`,{type:`submit`,value:`confirm`,style:_f,children:i})]})]})})}function yf({open:e,title:t,message:n,confirmLabel:r,onConfirm:i,onClose:a}){let o=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let t=o.current;if(t){if(e){t.open||t.showModal();return}t.open&&t.close()}},[e]),(0,y.jsx)(`dialog`,{ref:o,"aria-labelledby":`confirm-dialog-title`,onCancel:a,onClose:a,onClick:e=>{e.target===e.currentTarget&&a()},style:pf,children:(0,y.jsxs)(`form`,{method:`dialog`,onSubmit:e=>{e.preventDefault(),i()},onClick:e=>e.stopPropagation(),style:mf,children:[(0,y.jsx)(`h2`,{id:`confirm-dialog-title`,style:hf,children:t}),(0,y.jsx)(`p`,{style:{margin:0,color:`#bac2de`,fontSize:13,lineHeight:1.45},children:n}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,paddingTop:2},children:[(0,y.jsx)(`button`,{type:`button`,onClick:a,style:gf,children:`Cancel`}),(0,y.jsx)(`button`,{type:`submit`,value:`confirm`,style:_f,children:r})]})]})})}var bf=20,X=16,xf=`#11111b`,Sf=20,Cf=30,wf=28,Tf=Cf,Ef=400,Df=112,Of=X-5,kf=`#1e1e2e`,Af=`#45475a`,jf=`#cdd6f455`,Mf=`#cdd6f422`,Nf=`#a6e3a1`,Pf=`#f38ba8`,Ff=`#a6e3a1`,If=2,Lf=.85,Rf=12,zf=6,Bf=30,Vf=6,Hf=6,Uf=3,Wf={mass:2.1,tension:180,friction:28},Gf=220,Kf=900,qf=`cubic-bezier(0.22, 1, 0.36, 1)`,Jf=6,Yf=14,Xf=`600 11px system-ui, -apple-system, sans-serif`,Zf=56*.55,Qf=56*.3,$f=54,ep={laneWidth:80,rowHeight:56,nodeRadius:X,clearance:2,curveControlRatio:.3},tp=new Map;function np(e){return Math.round((Sf-e)/2)}function rp(e,t){return!!e&&e.action===t.action&&e.refName===t.refName&&e.sha===t.sha&&e.force===t.force}function ip(e){return!!e&&typeof e==`object`&&e.code===`CONFLICT`}function ap(e){if(!e||typeof e!=`object`)return null;let t=e.data;if(!t||typeof t!=`object`)return null;let n=t;return n.reason===`branch-in-use`&&typeof n.worktreePath==`string`?n.worktreePath:null}function op(e){return e.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e}function sp(e){let t=/^(v?)(\d+)\.(\d+)\.(\d+)$/.exec(e);return t?{hasVPrefix:t[1]===`v`,major:Number(t[2]),minor:Number(t[3]),patch:Number(t[4])}:null}function cp(e,t){return e.major-t.major||e.minor-t.minor||e.patch-t.patch||Number(e.hasVPrefix)-Number(t.hasVPrefix)}function lp(e){let t=null;for(let n of e){if(n.kind!==`tag`)continue;let e=sp(n.shortName);e&&(!t||cp(e,t)>0)&&(t=e)}return t?`${t.hasVPrefix?`v`:``}${t.major}.${t.minor}.${t.patch+1}`:``}function up(e){return e?e.startsWith(`refs/remotes/`)?e.slice(13):e:null}function dp(e,t){let n=up(e.upstream);if(n)return t.find(e=>e.kind===`remote`&&e.shortName===n)??null;let r=t.find(t=>t.kind===`remote`&&t.shortName===`origin/${e.shortName}`);if(r)return r;let i=t.filter(t=>t.kind===`remote`&&t.shortName.endsWith(`/${e.shortName}`));return i.length===1?i[0]:null}function fp(e,t){return e.parentShas.length===t.parentShas.length&&e.parentShas.every((e,n)=>e===t.parentShas[n])}function pp(e,t,n,r){let i=rr(t.rows,n);if(r.kind===`commit`){let t=i.nodes.find(t=>!e.shaToNode.has(t.row.sha));if(!t)return null;let n=e.shaToNode.get(t.row.parentShas[0]);if(!n)return null;let r=e.nodes[0]??n,a={...t,x:n.x,y:r.y-56,idx:r.idx-1},o=`${a.row.sha}-${n.row.sha}`,s=Tp(a,n,o,e.nodes.map(e=>e.row.lane));return{nodes:[{node:a,color:Ff}],edges:[{key:o,path:Dp(a,n,s,0),color:Ff,dashed:!0}]}}let a=new Set;for(let t of i.nodes){let n=e.shaToNode.get(t.row.sha);(!n||!fp(n.row,t.row))&&a.add(t.row.sha)}let o=t.refs.find(e=>e.kind===`head`&&e.isCurrent),s=[],c=new Set,l=o?.targetSha;for(;l&&!c.has(l);){c.add(l);let e=i.shaToNode.get(l);if(!e)break;s.push(e),l=e.row.parentShas[0]}let u=s.findIndex(e=>a.has(e.row.sha)),d=u>=0?s.slice(0,u+1):t.headSha?[i.shaToNode.get(t.headSha)].filter(e=>!!e):[];if(d.length===0)return null;let f=t.refs.find(e=>e.shortName===r.targetRefName),p=f?.peeledSha??f?.targetSha,m=p?e.shaToNode.get(p)??i.shaToNode.get(p):null,h=m?d.map(e=>({...e,x:m.x,row:{...e.row,lane:m.row.lane}})):d,g=m??e.nodes[0];if(!g)return null;let _=rf(h,g,56),v=new Set(_.map(e=>e.row.sha)),y=new Map(_.map(e=>[e.row.sha,e])),b=i.nodes.map(e=>e.row.lane),x=[];for(let t of _)for(let n=0;n<t.row.parentShas.length;n++){let r=t.row.parentShas[n],a=v.has(r)?y.get(r):e.shaToNode.get(r)??i.shaToNode.get(r);if(!a)continue;let o=`action-preview:${t.row.sha}-${a.row.sha}`,s=Tp(t,a,o,b,{adjacentTrack:n>0?`to`:`from`});x.push({key:o,path:Dp(t,a,s,0),color:Ff,dashed:!0})}return{nodes:[..._.map(e=>({node:e,color:Ff}))],edges:x,gutterX:m?m.x-$f/2:void 0}}function mp(e,t,n,r){if(e===n)return`M${e},${t}L${n},${r}`;let i=r-t;return`M${e},${t}C${e},${t+i*.3} ${n},${r-i*.3} ${n},${r}`}function hp(e,t,n,r,i){let a=n-e,o=r-t,s=Math.hypot(a,o)||1;return{x:e+a/s*i,y:t+o/s*i}}function gp(e,t){if(e.length===0)return``;if(e.length===1)return`M${e[0].x},${e[0].y}`;let n=`M${e[0].x},${e[0].y}`;for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=a.x-i.x,c=a.y-i.y,l=o.x-a.x,u=o.y-a.y,d=Math.hypot(s,c),f=Math.hypot(l,u);if(d<.001||f<.001){n+=`L${a.x},${a.y}`;continue}let p=Math.min(t,d/2,f/2),m=a.x-s/d*p,h=a.y-c/d*p,g=a.x+l/f*p,_=a.y+u/f*p;n+=`L${m},${h}Q${a.x},${a.y} ${g},${_}`}let r=e[e.length-1];return n+=`L${r.x},${r.y}`,n}function _p(e,t,n){let r=Math.abs(t.idx-e.idx),i=Math.min(e.y,t.y),a=Qn(n),o=r>12?[.28,.42,.56,.7]:[.35,.5,.65],s=o[a%o.length]??.5,c=Math.max(0,Math.min(r-1,Math.round((r-1)*s))),l=((a>>3)%3-1)*4;return i+56*(c+.5)+l}function vp(e,t,n,r){let i=Math.max(0,Math.min(t,n)+1),a=Math.min(e.length-1,Math.max(t,n)-1),o=0;for(let t=i;t<=a;t++){let n=e[t];r(n,t)&&o++}return o}function yp(e,t,n,r,i){let a=Math.max(0,Math.min(t,n)),o=Math.min(r.length-1,Math.max(t,n));for(let t=a;t<=o;t++)if(r[t]===e||i?.get(t)?.includes(e))return!1;return!0}function bp(e,t,n,r=!1,i=0,a=X){let o=t.y>e.y?1:-1,s=e.y+o*24,c=Math.max(1,a-1);if(!r&&Math.abs(n-t.x)<.001&&Math.abs(e.x-t.x)>.001){let n=e.x<t.x?-1:1,r=-o,i=c*Math.SQRT1_2,a={x:t.x+n*i,y:t.y+r*i},l={x:a.x+n*18*Math.SQRT1_2,y:a.y+r*18*Math.SQRT1_2},u=l.x;return gp([hp(e.x,e.y,u,s,X-1),{x:u,y:s},l,a],5)}let l=Math.abs(n-e.x)<.001&&Math.abs(e.x-t.x)>.001,u=n,d;if(l){let n=t.x<e.x?-1:1,r=(X-1)*Math.SQRT1_2,i={x:e.x+n*r,y:e.y+o*r},a={x:i.x+n*18*Math.SQRT1_2,y:i.y+o*18*Math.SQRT1_2};u=a.x,d=[i,a]}else d=[hp(e.x,e.y,n,s,X-1),{x:n,y:s}];let f=r?Math.max(-c,Math.min(c,i)):i,p=r?t.y+f:t.y-o*24,m=r?{x:t.x+Math.sign(u-t.x||1)*Math.sqrt(Math.max(0,c**2-f**2)),y:p}:hp(t.x,t.y,u,p,c);return gp([...d,{x:u,y:p},m],Rf)}function xp(e,t,n,r=0,i=X){let a=t.y>e.y?1:-1,o=e.y+a*24,s=Math.abs(n-t.x)>.001,c=Math.max(1,i-1);if(!s&&Math.abs(e.x-t.x)>.001){let n=e.x<t.x?-1:1,r=-a,i=c*Math.SQRT1_2,s={x:t.x+n*i,y:t.y+r*i},l={x:s.x+n*18*Math.SQRT1_2,y:s.y+r*18*Math.SQRT1_2},u=l.x;return gp([hp(e.x,e.y,u,o,X-1),{x:u,y:o},l,s],5)}let l=Math.abs(n-e.x)<.001&&Math.abs(e.x-t.x)>.001,u=n,d;if(l){let n=t.x<e.x?-1:1,r=(X-1)*Math.SQRT1_2,i={x:e.x+n*r,y:e.y+a*r},o={x:i.x+n*18*Math.SQRT1_2,y:i.y+a*18*Math.SQRT1_2};u=o.x,d=[i,o]}else d=[hp(e.x,e.y,n,t.y,X-1),{x:n,y:o}];let f=s?Math.max(-c,Math.min(c,r)):0,p=t.y+f,m=s?{x:t.x+Math.sign(u-t.x)*Math.sqrt(Math.max(0,c**2-f**2)),y:p}:hp(t.x,t.y,u,p,c);return gp([...d,{x:u,y:p},m],Rf)}function Sp(e,t,n,r,i){let a=hp(e.x,e.y,t.x,t.y,X-1),o=hp(t.x,t.y,e.x,e.y,X-1),s=t.y>e.y?1:-1,c=e.y+s*24,l=t.y-s*24;return gp([a,{x:n,y:c},{x:n,y:i},{x:r,y:i},{x:r,y:l},o],Rf)}function Cp(e,t,n=0,r=X,i){if(Math.abs(e.x-t.x)<.001&&Math.abs(n)>.001){let a=t.y>e.y?1:-1,o=X-1,s=Math.max(1,r-1),c=Math.max(-Math.min(o,s),Math.min(Math.min(o,s),n)),l=Math.sqrt(Math.max(0,s**2-c**2)),u=Math.abs(t.y-e.y),d=i===void 0?34:Math.abs(i-e.y),f=Math.min(u/2,34),p=Math.max(f,u-l-8),m=Math.max(f,Math.min(p,d)),h=e.y+a*m,g=h-a*10,_={x:t.x+c,y:t.y-a*l};return gp([{x:e.x,y:e.y+a*o},{x:e.x,y:g},{x:e.x+c,y:h},_],Math.min(Rf,6))}let a=hp(e.x,e.y,t.x,t.y,X-1),o=hp(t.x,t.y,e.x,e.y,Math.max(1,r-1));return`M${a.x},${a.y}L${o.x},${o.y}`}function wp(e,t,n,r=X,i){if(n){let a=Math.max(1,r-1),o=t.y>=e.y?1:-1,s=X-1,c=s*Math.SQRT1_2,l=i?{x:e.x+(i===`left`?-c:c),y:e.y+o*c}:{x:e.x,y:e.y+o*s},u={x:t.x+(n===`left`?-a:a),y:t.y},d=Math.min(18,Math.hypot(u.x-l.x,u.y-l.y)*.2);return gp([l,{x:l.x+(i===`left`?-d*Math.SQRT1_2:i===`right`?d*Math.SQRT1_2:0),y:l.y+o*(i?d*Math.SQRT1_2:d)},{x:u.x+(n===`left`?-d:d),y:u.y},u],Math.min(5,d/2))}let a=hp(e.x,e.y,t.x,t.y,X-1),o=hp(t.x,t.y,e.x,e.y,X-1);return mp(a.x,a.y,o.x,o.y)}function Tp(e,t,n,r,i={}){let a=Math.abs(e.row.lane-t.row.lane),o=Math.abs(t.idx-e.idx);if(a===0)return{mode:`straight`};if(a===1&&o>=zf)return{mode:`adjacent-hook`,laneA:Math.min(e.row.lane,t.row.lane),laneB:Math.max(e.row.lane,t.row.lane),track:i.adjacentTrack??`from`};if(o<zf){let n=i.adjacentTrack??`from`,a=ff({x:e.x,y:e.y,idx:e.idx,lane:e.row.lane},{x:t.x,y:t.y,idx:t.idx,lane:t.row.lane},r,ep,n,i.additionalOccupiedLanes);return a?{mode:`occlusion-hook`,laneA:Math.min(e.row.lane,t.row.lane),laneB:Math.max(e.row.lane,t.row.lane),track:a}:{mode:`curve`}}let s=i.adjacentTrack??`from`,c={x:e.x,y:e.y,idx:e.idx,lane:e.row.lane},l={x:t.x,y:t.y,idx:t.idx,lane:t.row.lane};if(s===`to`&&e.row.lane*t.row.lane<0){let n=e.row.lane<0?-1:1,a=e.row.lane+n;if(yp(a,e.idx,t.idx,r,i.additionalOccupiedLanes))return{mode:`outer-rail`,side:n<0?`left`:`right`,anchorLane:a,innerLane:t.row.lane,outerRailX:e.x+n*80,horizontalTargetJoin:!0}}let u=df(c,l,r,s,i.additionalOccupiedLanes);if(u)return{mode:`outer-rail`,...u,horizontalTargetJoin:!0};let d=Math.min(e.row.lane,t.row.lane),f=Math.max(e.row.lane,t.row.lane),p=Qn(n)%3*Vf,m=t.x>e.x?1:-1,h=Bf+p,g=e.x+m*h,_=t.x-m*h,v=_p(e,t,n),y=Math.max(e.x,t.x),b=Math.min(e.x,t.x),x=vp(r,e.idx,t.idx,e=>e>d&&e<f),S=vp(r,e.idx,t.idx,e=>e<d),C=vp(r,e.idx,t.idx,e=>e>f),w=e.x<t.x?`left`:(e.x,t.x,`right`),T=x*5+a,E=S*2+(w===`left`?0:.5),ee=C*2+(w===`right`?0:.5);return ee<=E&&ee<T?{mode:`outer-rail`,side:`right`,anchorLane:f,innerLane:d,outerRailX:y}:E<T?{mode:`outer-rail`,side:`left`,anchorLane:d,innerLane:f,outerRailX:b}:{mode:`inside-rail`,minLane:d,maxLane:f,sourceRailX:g,targetRailX:_,crossoverY:v}}function Ep(e,t){let n=e=>`vertical:${Math.round(e*1e3)/1e3}`;switch(t.mode){case`straight`:return n(e.from.x);case`outer-rail`:return n(t.outerRailX);case`inside-rail`:return`${t.mode}:${t.minLane}:${t.maxLane}`;case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return n(t.track===`to`?e.to.x:e.from.x);default:return null}}function Dp(e,t,n,r,i=0,a=X){switch(n.mode){case`straight`:return Cp(e,t,r,a,n.bundleJoinY);case`curve`:return wp(e,t,n.targetSide,a,n.sourceSide);case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return xp(e,t,(n.track===`to`?t.x:e.x)+r,i,a);case`inside-rail`:return Sp(e,t,n.sourceRailX+r,n.targetRailX+r,n.crossoverY);case`outer-rail`:return bp(e,t,n.outerRailX+r,n.horizontalTargetJoin,i,a)}}function Op(e,t,n){if(e.mode!==t.mode)return n<.5?e:t;switch(t.mode){case`straight`:{let r=e;return{mode:`straight`,bundleJoinY:r.bundleJoinY===void 0?t.bundleJoinY:t.bundleJoinY===void 0?r.bundleJoinY:Z(r.bundleJoinY,t.bundleJoinY,n)}}case`curve`:return t;case`adjacent-hook`:case`occlusion-hook`:case`target-hook`:return t;case`inside-rail`:{let r=e;return{...t,sourceRailX:Z(r.sourceRailX,t.sourceRailX,n),targetRailX:Z(r.targetRailX,t.targetRailX,n),crossoverY:Z(r.crossoverY,t.crossoverY,n)}}case`outer-rail`:{let r=e;return{...t,outerRailX:Z(r.outerRailX,t.outerRailX,n)}}}}function kp(e,t){return Dp({x:Z(e.fromX1,e.toX1,t),y:Z(e.fromY1,e.toY1,t)},{x:Z(e.fromX2,e.toX2,t),y:Z(e.fromY2,e.toY2,t)},Op(e.fromPlan,e.toPlan,t),Z(e.fromBundleOffset,e.toBundleOffset,t),Z(e.fromTargetJoinOffset,e.toTargetJoinOffset,t),Z(e.fromTargetNodeRadius,e.toTargetNodeRadius,t))}function Ap(e){if(e.length===0)return 0;let t=e.map(e=>e.locChanged).sort((e,t)=>e-t);return t[Math.max(0,Math.ceil(t.length*Lf)-1)]??t[t.length-1]??0}function jp(e,t,n,r){let i=+(r===`right`);return`M ${e} ${t-n} A ${n} ${n} 0 0 ${i} ${e} ${t+n} L ${e} ${t-n} Z`}function Mp(e,t,n,r){let i=+(r===`right`);return`M ${e} ${t-n} A ${n} ${n} 0 0 ${i} ${e} ${t+n}`}function Np(e,t,n){if(e<=0||t<=0)return 0;let r=n*Math.min(e/t,1);return Math.max(If,r)}var Pp=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Fp(e){return e>=1.4}function Ip(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Lp(e,t){return Ip(e,t)&&e.getHours()===t.getHours()}function Rp(e){return`${Pp[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`}function zp(e){return`${`${e.getHours()}`.padStart(2,`0`)}:${`${e.getMinutes()}`.padStart(2,`0`)}`}function Bp(e,t){return Fp(t)?`${Rp(e)} ${zp(e)}`:Rp(e)}function Vp(e,t){if(e.length===0)return[];let n=Fp(t),r=[],i=null,a=-1/0;for(let o of e){let e=new Date(o.row.committerUnix*1e3),s=o.y*t,c=!i||!Ip(e,i),l=!i||e.getMonth()!==i.getMonth()||e.getFullYear()!==i.getFullYear(),u=!i||!Lp(e,i);i=e;let d=null;if(n?c?d={key:`${o.row.sha}:day`,text:Rp(e),y:s,kind:`month`}:u&&(d={key:`${o.row.sha}:hour`,text:zp(e),y:s,kind:`hour`}):c&&(d={key:`${o.row.sha}:day`,text:l?Rp(e):`${e.getDate()}`,y:s,kind:l?`month`:`day`}),!d)continue;let f=d.kind===`hour`?34:22;s-a<f||(r.push(d),a=s)}return r}function Hp(e,t,n){if(e.length===0)return null;let r=t/n,i=Math.max(0,Math.min(e.length-1,Math.floor((r-40-112)/56)));for(;i+1<e.length&&e[i+1].y*n<=t;)i++;return e[i]??e[0]??null}function Up(e){return e.includes(`/`)}function Wp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Gp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.sha!==i.sha||r.row!==i.row||r.lane!==i.lane||r.parentShas.length!==i.parentShas.length||!Wp(r.refNames,i.refNames))return!1;for(let e=0;e<r.parentShas.length;e++)if(r.parentShas[e]!==i.parentShas[e])return!1}return!0}function Kp(e,t){if(t.length<=e.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.sha!==i.sha||r.row!==i.row||r.lane!==i.lane||!Wp(r.refNames,i.refNames))return!1}return!0}function qp(e,t){return!(!e||!t||e.length===0||t.length===0||Gp(e,t)||Kp(e,t))}function Jp(e,t){return e?`☁ `:t?`● `:`⎇ `}var Yp=new Map;function Xp(e){let t=Yp.get(e);if(t!==void 0)return t;let n=id(nd(e,Xf));return Yp.set(e,n),n}function Zp(e){return e.map(e=>` ▣ ${op(e.path)}`).join(``)}function Qp(e,t,n,r){let i=Jp(t,n)+e+Zp(r);return Yf+Math.ceil(Xp(i))}function $p(e,t,n,r,i,a){let o=[],s=new Map;for(let c of e){let e=c.x+(a?.get(c.row.sha)??X)+8,l=c.y-10,u=e;for(let e of c.row.refNames){let a=t!==null&&e===t,s=Up(e),d=i.filter(t=>!t.isCurrent&&!t.bare&&!t.prunable&&t.branchShortName===e);o.push({refName:e,nodeSha:c.row.sha,x:u,y:l,color:r.get(c.row.sha)??$n(c.row.lane),isCurrent:a,isSelected:e===n,isRemote:s,linkedWorktrees:d}),u+=Qp(e,s,a,d)+Jf}s.set(c.row.sha,c.row.refNames.length>0?u-e-Jf:0)}return{placements:o,rowWidths:s}}function Z(e,t,n){return e+(t-e)*n}function em(e,t,n,r){let i=t*3,a=e-i,o=e+t+i,s=56*r,c=152*r;return{firstIdx:Math.max(0,Math.floor((a-c)/s)),lastIdx:Math.min(n-1,Math.ceil((o-c)/s))}}function tm(e,t,n,r){return Math.max(e,t)>=n&&Math.min(e,t)<=r}function nm(e,t,n){let r=e.nodes.slice(t,n+1),i=[];for(let r of e.nodes)for(let a=0;a<r.row.parentShas.length;a++){let o=r.row.parentShas[a],s=e.shaToNode.get(o)??{row:{...r.row,sha:o,parentShas:[],refNames:[]},x:r.x,y:e.totalHeight,idx:e.nodes.length};tm(r.idx,s.idx,t,n)&&i.push({from:r,to:s,isMerge:a>0,key:`${r.row.sha}-${s.row.sha}`})}return{visibleNodes:r,visibleEdges:i}}function rm(e,t){let n=new Set;if(!e||!t)return n;let r=e.nodes.find(e=>e.row.refNames.includes(t));if(!r)return n;let i=r.row.sha,a=new Set;for(;i&&!a.has(i);){a.add(i);let t=e.shaToNode.get(i),r=t?.row.parentShas[0];if(!t||!r)break;n.add(`${t.row.sha}-${r}`);let o=e.shaToNode.get(r);if(!o)break;i=o.row.sha}return n}function im(e,t){let n=new Set;if(!e||!t)return n;let r=e.nodes.find(e=>e.row.refNames.includes(t));if(!r)return n;let i=r.row.sha;for(;i&&!n.has(i);){n.add(i);let t=e.shaToNode.get(i),r=t?.row.parentShas[0];if(!t||!r||!e.shaToNode.get(r))break;i=r}return n}function am(e,t){if(!e||!t)return null;let n=e.nodes.find(e=>e.row.refNames.includes(t));return n?{key:t,x:n.x-$f/2,color:e.shaToColor.get(n.row.sha)??$n(n.row.lane)}:null}function om(e){return new Set(e.unstaged.filter(e=>e.status===`U`).map(e=>e.path)).size}function sm(e,t){return Math.max(e.topIdx,t.topIdx)<Math.min(e.bottomIdx,t.bottomIdx)}function cm(e,t=Uf){let n=new Map;for(let t of e){let e=n.get(t.railKey);e?e.push(t):n.set(t.railKey,[t])}let r=new Map;for(let e of n.values()){e.sort((e,t)=>e.topIdx-t.topIdx||e.bottomIdx-t.bottomIdx||e.key.localeCompare(t.key));let n=e.map((e,t)=>t),i=e=>n[e]===e?e:(n[e]=i(n[e]),n[e]),a=(e,t)=>{let r=i(e),a=i(t);r!==a&&(n[a]=r)};for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length&&!(e[n].topIdx>e[t].bottomIdx);n++)sm(e[t],e[n])&&a(t,n);let o=new Map;for(let t=0;t<e.length;t++){let n=i(t),r=o.get(n);r?r.push(e[t]):o.set(n,[e[t]])}for(let e of o.values()){let n=[...e].sort((e,t)=>(e.bundleOrder??0)-(t.bundleOrder??0)||e.topIdx-t.topIdx||e.bottomIdx-t.bottomIdx||e.key.localeCompare(t.key)),i=[],a=[],o=[];for(let e of n){let t=i.findIndex(t=>t.every(t=>!sm(t,e)));t<0&&(t=i.length,i.push([])),i[t].push(e),a[t]=Math.max(a[t]??0,e.strokeWidth??3),o.push({key:e.key,slot:t})}let s=[0];for(let e=1;e<a.length;e++)s[e]=s[e-1]+a[e-1]/2+t+a[e]/2;let c=Math.floor(s.length/2),l=s.length%2==1?s[c]:(s[c-1]+s[c])/2;for(let e of o)r.set(e.key,s[e.slot]-l)}}return r}function lm(e,t=Hf){let n=new Map;for(let t of e){let e=`${t.targetKey}:${t.side}`,r=n.get(e);r?r.push(t):n.set(e,[t])}let r=new Map;for(let e of n.values()){e.sort((e,t)=>(e.side===`right`?e.railX-t.railX:t.railX-e.railX)||e.key.localeCompare(t.key));let n=(e.length-1)/2;for(let i=0;i<e.length;i++)r.set(e[i].key,(i-n)*t)}return r}function um(e,t=Hf){let n=new Map;for(let t of e){let e=`${t.targetKey}:${t.side}`,r=n.get(e);r?r.count++:n.set(e,{targetKey:t.targetKey,count:1})}let r=new Map;for(let{targetKey:e,count:i}of n.values()){if(i<5)continue;let n=X+Math.ceil((i-4)*t/2);r.set(e,Math.max(r.get(e)??X,n))}return r}function dm(e,t,n=0){return t?.mode===`outer-rail`&&t.horizontalTargetJoin?t.outerRailX+n:t?.mode===`adjacent-hook`||t?.mode===`occlusion-hook`||t?.mode===`target-hook`?(t.track===`to`?e.to.x:e.from.x)+n:null}function fm(e,t,n){let r=new Map;for(let i of e){let e=Tp(i.from,i.to,i.key,t,{adjacentTrack:i.isMerge?`to`:`from`,additionalOccupiedLanes:n});r.set(i.key,e)}let i=new Set,a=new Map;for(let t of e){let e=dm(t,r.get(t.key));if(e===null||Math.abs(e-t.to.x)<.001)continue;let n=e<t.to.x?`left`:`right`;i.add(`${t.to.row.sha}:${n}`)}for(let t of e){if(r.get(t.key)?.mode!==`curve`)continue;let e=t.from.x<t.to.x?`left`:t.from.x>t.to.x?`right`:null;if(!e)continue;let n=`${t.to.row.sha}:${e}`;a.set(n,(a.get(n)??0)+1)}for(let[e,t]of a)t>1&&i.add(e);for(let a of e){if(r.get(a.key)?.mode!==`curve`)continue;let e=a.from.x<a.to.x?`left`:a.from.x>a.to.x?`right`:null;if(!e||!i.has(`${a.to.row.sha}:${e}`))continue;let o=df({x:a.from.x,y:a.from.y,idx:a.from.idx,lane:a.from.row.lane},{x:a.to.x,y:a.to.y,idx:a.to.idx,lane:a.to.row.lane},t,`from`,n);!o||o.side!==e||r.set(a.key,{mode:`target-hook`,laneA:Math.min(a.from.row.lane,a.to.row.lane),laneB:Math.max(a.from.row.lane,a.to.row.lane),track:`from`})}let o=e.flatMap(e=>{let t=r.get(e.key);if(!t)return[];let n=Ep(e,t);return n?[{key:e.key,railKey:n,topIdx:Math.min(e.from.idx,e.to.idx),bottomIdx:Math.max(e.from.idx,e.to.idx),bundleOrder:+!!e.isMerge,railStartY:Math.min(e.from.y,e.to.y)+X+8,strokeWidth:e.isMerge?2:4.5}]:[]}),s=cm(o);for(let e of o){if(r.get(e.key)?.mode!==`straight`||Math.abs(s.get(e.key)??0)<.001)continue;let t=o.filter(t=>t.key!==e.key&&t.railKey===e.railKey&&t.topIdx>e.topIdx&&t.topIdx<e.bottomIdx&&sm(e,t)).sort((e,t)=>e.topIdx-t.topIdx||e.key.localeCompare(t.key))[0];t?.railStartY!==void 0&&r.set(e.key,{mode:`straight`,bundleJoinY:t.railStartY-8})}let c=new Map,l=new Set;for(let t of e){let e=r.get(t.key);if(e?.mode===`straight`&&t.from.idx<t.to.idx&&Math.abs(t.from.x-t.to.x)<.001&&l.add(t.from.row.sha),t.from.idx>=t.to.idx||!Ep(t,e??{mode:`curve`}))continue;let n=c.get(t.to.row.sha);n?n.push(t.key):c.set(t.to.row.sha,[t.key])}for(let t of e){if(r.get(t.key)?.mode!==`curve`||Math.abs(t.from.x-t.to.x)<.001)continue;let e=c.get(t.to.row.sha)??[];!(!(e.length<2)&&e.some(e=>Math.abs(s.get(e)??0)>.001))&&!l.has(t.to.row.sha)||r.set(t.key,{mode:`curve`,targetSide:t.from.x<t.to.x?`left`:`right`,...l.has(t.from.row.sha)?{sourceSide:t.to.x<t.from.x?`left`:`right`}:{}})}let u=e.flatMap(e=>{let t=dm(e,r.get(e.key),s.get(e.key)??0);return t===null||Math.abs(t-e.to.x)<.001?[]:[{key:e.key,targetKey:e.to.row.sha,side:t<e.to.x?`left`:`right`,railX:t}]});return{plans:r,bundleOffsets:s,targetJoinOffsets:lm(u),targetNodeRadii:um(u)}}function pm(e,t,n,r,i){return e.map(e=>{let a=r.has(e.key),o=t.plans.get(e.key)??Tp(e.from,e.to,e.key,n,{adjacentTrack:e.isMerge?`to`:`from`}),s=t.bundleOffsets.get(e.key)??0,c=t.targetJoinOffsets.get(e.key)??0,l=t.targetNodeRadii.get(e.to.row.sha)??X,u=e.isMerge?e.to:e.from;return{key:e.key,fromSha:e.from.row.sha,toSha:e.to.row.sha,path:Dp(e.from,e.to,o,s,c,l),plan:o,bundleOffset:s,targetJoinOffset:c,targetNodeRadius:l,x1:e.from.x,y1:e.from.y,x2:e.to.x,y2:e.to.y,isMerge:e.isMerge,stroke:i.get(u.row.sha)??$n(u.row.lane),strokeWidth:a?4.5:e.isMerge?2:3,opacity:a?.95:.8}})}function mm(e,t,n,r,i,a){return qp(e,t)?!0:!i||!a?!1:n!==r}function hm(){let e=Qd(),t=R(e=>e.historyWindow),n=R(e=>e.graphModel),r=R(e=>e.refs),i=R(e=>e.selectedSha),a=R(e=>e.selectedRefName),o=R(e=>e.mergePreview),s=R(e=>e.scrollToSha),c=R(e=>e.scrollToKey),l=R(e=>e.selectCommit),u=R(e=>e.selectGraphRef),d=R(e=>e.clearGraphRefSelection),f=R(e=>e.ensureMergePreview),p=R(e=>e.requestMore),m=R(e=>e.performRefAction),h=R(e=>e.performCommitAction),g=R(e=>e.performMergeRef),_=R(e=>e.performRebaseRef),v=R(e=>e.pendingMutation),x=R(e=>e.pendingCheckout),S=R(e=>e.graphAnimationSuppressToken),C=R(e=>e.showCommitMessages),w=R(e=>e.showGutterColors),T=R(e=>e.showError),E=R(e=>e.commitCIStatus),ee=R(e=>e.fetchCommitCIStatusesIfNeeded),D=R(e=>e.worktreeChanges),te=R(e=>e.worktrees),ne=R(e=>e.worktreeSelected),re=R(e=>e.selectWorktree),ie=R(e=>e.openRepoByPath),[ae,oe]=(0,b.useState)(null),se=(0,b.useRef)(null),O=(0,b.useRef)(null),k=(0,b.useRef)(null),ce=(0,b.useRef)({scrollTop:0,clientHeight:0}),le=(0,b.useRef)(0),ue=(0,b.useRef)(null),de=(0,b.useRef)(null),fe=(0,b.useRef)(null),A=(0,b.useRef)(!1),pe=(0,b.useRef)(null),me=(0,b.useRef)(0),[he,ge]=(0,b.useState)(1),[_e,ve]=(0,b.useState)(0),[ye,be]=(0,b.useState)(0),[j,xe]=(0,b.useState)(null),Se=(0,b.useRef)(null),[Ce,we]=(0,b.useState)(!1),[Te,Ee]=(0,b.useState)(null),[De,Oe]=(0,b.useState)(null),[ke,Ae]=(0,b.useState)(!1),[je,Me]=(0,b.useState)(null),[Ne,Pe]=(0,b.useState)(null),[Fe,Ie]=(0,b.useState)(null),[Le,Re]=(0,b.useState)(null),[{graphProgress:ze},Be]=dc(()=>({graphProgress:1,config:Wf})),Ve=(0,b.useRef)(1),He=(0,b.useRef)(0),Ue=(0,b.useRef)(null),We=(0,b.useRef)(0),Ge=(0,b.useRef)(null),Ke=(0,b.useRef)(null),qe=(0,b.useRef)(null),Je=(0,b.useRef)(S),[,Ye]=(0,b.useReducer)(e=>e+1,0),Xe=(0,b.useRef)({firstIdx:0,lastIdx:100}),M=n?.currentBranch??r.find(e=>e.isCurrent)?.shortName??null,N=n?.layout??null,Ze=(0,b.useMemo)(()=>new Map(r.map(e=>[e.shortName,e])),[r]),Qe=(0,b.useMemo)(()=>{let e=new Map;for(let t of te){if(!t.branchShortName||t.bare||t.prunable)continue;let n=e.get(t.branchShortName)??[];n.push(t),e.set(t.branchShortName,n)}return e},[te]),P=(0,b.useMemo)(()=>a?Ze.get(a)??null:null,[Ze,a]),$e=(0,b.useMemo)(()=>{if(!P)return null;if(P.kind===`head`)return Qe.get(P.shortName)?.find(e=>!e.isCurrent)??null;if(P.kind===`remote`){let e=r.find(e=>e.kind===`head`&&e.upstream===P.name);return e?Qe.get(e.shortName)?.find(e=>!e.isCurrent)??null:null}return null},[P,r,Qe]),et=(0,b.useMemo)(()=>lp(r),[r]),tt=(0,b.useMemo)(()=>{if(!Te||!t)return null;if(Te.kind===`rebase`)return qn(t.rows,r,Te.targetRefName);let e=t.rows.find(e=>e.sha===Te.sha);if(!e)return null;let n=Te.action===`revert`?`Revert "${e.subject}"`:e.subject;return Wn(t.rows,r,n,Te.action)},[Te,t,r]),nt=(0,b.useMemo)(()=>!N||!Te||!tt?null:pp(N,tt,C?260:0,Te),[N,Te,tt,C]),rt=(0,b.useMemo)(()=>{if(Te?.kind!==`rebase`||!De||De.targetRefName!==Te.targetRefName||!nt||nt.nodes.length===0)return null;let e=X*2,t=[...nt.nodes.map(({node:e})=>e),De.targetNode];return af({baseZoom:De.baseZoom,bounds:{minX:Math.min(...t.map(e=>e.x))-e,minY:Math.min(...t.map(e=>e.y))-e,maxX:Math.max(...t.map(e=>e.x))+e,maxY:Math.max(...t.map(e=>e.y))+e},viewport:De.viewport,scroll:De.scroll,margin:12})},[Te,nt,De]),it=rt?.zoom??he,at=rt?.translateX??0,ot=rt?.translateY??0,st=`${ke?Kf:Gf}ms ${qf}`,ct=(0,b.useMemo)(()=>{if(!N||!D)return null;let e=D.staged.length+D.unstaged.length;if(e===0)return null;let t=(M?N.nodes.find(e=>e.row.refNames.includes(M)):void 0)??N.shaToNode.get(D.headSha);if(!t)return null;let n=D.mergeHeadShas?.length?`merge`:D.rebaseHeadSha?`rebase`:`worktree`,r=om(D),i=t.y-56,a=n===`worktree`?N.shaToColor.get(t.row.sha)??$n(t.row.lane):`#fab387`,o={row:{row:t.row.row-1,sha:`${n}:${D.headSha}:${D.mergeHeadShas?.[0]??D.rebaseHeadSha??`dirty`}`,parentShas:[t.row.sha,...D.mergeHeadShas?.slice(0,1)??[]],authorName:``,authorEmail:``,authorUnix:0,committerUnix:0,subject:n===`merge`?`Merge in progress`:n===`rebase`?`Rebase in progress`:`Uncommitted changes`,additions:0,deletions:0,locChanged:0,refNames:[],lane:t.row.lane},x:t.x,y:i,idx:t.idx-1},s=N.nodes.map(e=>e.row.lane),c=Tp(o,t,`${o.row.sha}-${t.row.sha}`,s),l=D.mergeHeadShas?.[0],u=l?N.shaToNode.get(l)??null:null,d=u?Dp(o,u,Tp(o,u,`${o.row.sha}-${u.row.sha}`,s,{adjacentTrack:`to`}),0):null;return{kind:n,x:o.x,y:o.y,idx:o.idx,lane:o.row.lane,headX:t.x,headY:t.y,color:a,count:e,conflictedCount:r,targetPlan:c,sourcePath:d}},[N,D,M]),F=ct??(x?fe.current:null),lt=!!F&&!A.current,{worktreeX:ut,worktreeY:dt,worktreeHeadX:ft,worktreeHeadY:pt,worktreeOpacity:mt}=dc({worktreeX:F?.x??0,worktreeY:F?.y??0,worktreeHeadX:F?.headX??0,worktreeHeadY:F?.headY??0,worktreeOpacity:F?x?.5:1:0,immediate:e=>e!==`worktreeOpacity`&&lt,config:e=>e===`worktreeOpacity`?{mass:1,tension:210,friction:26,clamp:!0}:Wf});(0,b.useEffect)(()=>{ct?fe.current=ct:x||(fe.current=null),F?A.current=!0:x||(A.current=!1)},[ct,F,x]);let ht=(0,b.useCallback)(e=>{me.current=e,de.current===null&&(de.current=requestAnimationFrame(()=>{de.current=null,ve(me.current)}))},[]),gt=(0,b.useCallback)(()=>{ue.current!==null&&(cancelAnimationFrame(ue.current),ue.current=null),Se.current&&(Be.stop(),Be.set({graphProgress:1}),Se.current=null,xe(null))},[Be]),_t=(0,b.useCallback)(e=>{ue.current!==null&&(cancelAnimationFrame(ue.current),ue.current=null),Be.stop(),Be.set({graphProgress:0}),Se.current=e,xe(e),ue.current=requestAnimationFrame(()=>{ue.current=requestAnimationFrame(()=>{ue.current=null,Se.current===e&&Be.start({graphProgress:1,immediate:!1,config:Wf,onRest:t=>{t.finished&&xe(t=>t===e?(Se.current=null,null):t)}})})})},[Be]),vt=(0,b.useCallback)(()=>{pe.current!==null&&(clearTimeout(pe.current),pe.current=null)},[]),yt=(0,b.useCallback)(e=>{vt(),Me(e)},[vt]),bt=(0,b.useCallback)(e=>{vt(),pe.current=setTimeout(()=>{Me(t=>t===e?null:t),pe.current=null},Ef)},[vt]);(0,b.useEffect)(()=>{we(!1),Ee(null),Oe(null),Pe(null)},[a,i]),(0,b.useEffect)(()=>{if(De||!ke)return;let e=window.setTimeout(()=>Ae(!1),Kf);return()=>window.clearTimeout(e)},[De,ke]),(0,b.useEffect)(()=>()=>{vt()},[vt]),(0,b.useEffect)(()=>{if(!N||!t){Ge.current=t?.rows??null,Ke.current=N,qe.current=M,gt();return}let e=S!==Je.current;if(Je.current=S,e){Ge.current=t.rows,Ke.current=N,qe.current=M;return}mm(Ge.current,t.rows,qe.current,M,Ke.current,N)&&Ke.current?_t({fromLayout:Ke.current,toLayout:N,fromCurrentBranch:qe.current,toCurrentBranch:M}):gt(),Ge.current=t.rows,Ke.current=N,qe.current=M},[M,t,N,S,_t,gt]),(0,b.useEffect)(()=>()=>{Be.stop(),ue.current!==null&&cancelAnimationFrame(ue.current),de.current!==null&&cancelAnimationFrame(de.current)},[Be]);let xt=(0,b.useMemo)(()=>t?Ap(t.rows):0,[t]),I=(0,b.useMemo)(()=>N?N.nodes.map(e=>e.row.lane):[],[N]),St=(0,b.useMemo)(()=>F?new Map([[F.idx,[F.lane]]]):void 0,[F]),Ct=(0,b.useMemo)(()=>{if(!N||!w)return[];let e=new Map;for(let t of N.nodes)e.set(t.row.lane,t.x);return[...e].sort(([e],[t])=>e-t).map(([e,t])=>({lane:e,x:t,color:$n(e)}))},[N,w]),wt=(0,b.useMemo)(()=>rm(N,M),[N,M]),Tt=(0,b.useCallback)((e,t)=>{if(!N)return;ce.current={scrollTop:e.scrollTop,clientHeight:e.clientHeight},le.current=e.scrollTop,ht(e.scrollTop),O.current&&(O.current.style.transform=`translateY(${-e.scrollTop}px)`);let{firstIdx:n,lastIdx:r}=em(e.scrollTop,e.clientHeight,N.nodes.length,t);Xe.current={firstIdx:n,lastIdx:r},Ye()},[N,ht]);(0,b.useEffect)(()=>{if(!s||!N||!se.current||Date.now()<He.current)return;let e=N.shaToNode.get(s);if(!Yn(Ue.current,c,!!e)||!e)return;Ue.current=c;let t=se.current,n=e.y*he-t.clientHeight/2;We.current=Date.now()+700,t.scrollTo({top:Math.max(0,n),behavior:`smooth`})},[s,c,N,he]),(0,b.useEffect)(()=>{let e=se.current;if(!e)return;let n=()=>{if(!N)return;let n=e.scrollTop,r=Math.abs(n-le.current)>.5;ce.current={scrollTop:e.scrollTop,clientHeight:e.clientHeight},be(e.clientHeight),le.current=n,r&&Date.now()>=We.current&&gt(),ht(e.scrollTop),O.current&&(O.current.style.transform=`translateY(${-e.scrollTop}px)`),k.current&&(k.current.style.transform=`translateY(${-e.scrollTop}px)`);let{firstIdx:i,lastIdx:a}=em(e.scrollTop,e.clientHeight,N.nodes.length,Ve.current),o=Xe.current,s=Math.floor((o.lastIdx-o.firstIdx)*.25);if((i<o.firstIdx+s||a>o.lastIdx-s)&&(Xe.current={firstIdx:i,lastIdx:a},Ye()),t&&t.hasMoreAfter&&N){let t=N.totalHeight*Ve.current;Jn(e.scrollTop,e.clientHeight,t)&&p(`down`)}};e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(()=>n());return r.observe(e),n(),()=>{e.removeEventListener(`scroll`,n),r.disconnect()}},[N,t,p,gt,ht]),(0,b.useEffect)(()=>{let e=se.current;!e||!O.current||Tt(e,he)},[N,he,Tt]),(0,b.useEffect)(()=>{let e=e=>{if(!e.ctrlKey&&!e.metaKey)return;let t=se.current;if(!t||!t.contains(e.target))return;e.preventDefault(),e.stopPropagation();let n=t.getBoundingClientRect(),r=e.clientY-n.top+t.scrollTop,i=Ve.current,a=e.deltaY>0?-.1:.1,o=Math.max(.1,Math.min(3,i+a));Ve.current=o,ge(o);let s=r/i*o-(e.clientY-n.top);t.scrollTop=Math.max(0,s)};return document.addEventListener(`wheel`,e,{passive:!1,capture:!0}),()=>document.removeEventListener(`wheel`,e,{capture:!0})},[]),(0,b.useEffect)(()=>{!N||!se.current||!t?.hasMoreAfter||se.current.clientHeight/he>N.nodes.length*56*.8&&p(`down`)},[he,N,t,p]);let{visibleNodes:Et,visibleEdges:Dt}=(0,b.useMemo)(()=>{if(!N)return{visibleNodes:[],visibleEdges:[]};let{firstIdx:e,lastIdx:t}=Xe.current;return nm(N,e,t)},[N,Xe.current.firstIdx,Xe.current.lastIdx]),Ot=(0,b.useMemo)(()=>fm(Dt,I,St),[Dt,I,St]),{placements:kt,rowWidths:At}=(0,b.useMemo)(()=>$p(Et,M,a,N?.shaToColor??tp,te,Ot.targetNodeRadii),[Et,M,a,N,te,Ot]),{detachedWorktreePlacements:jt,rowWidths:Mt}=(0,b.useMemo)(()=>{let e=[],t=new Map(At),n=new Map;for(let e of te){if(!e.detached||!e.headSha||e.bare||e.prunable)continue;let t=n.get(e.headSha)??[];t.push(e),n.set(e.headSha,t)}for(let r of Et){let i=n.get(r.row.sha)??[];if(i.length===0)continue;let a=r.x+(Ot.targetNodeRadii.get(r.row.sha)??X)+8,o=t.get(r.row.sha)??0,s=a+o+(o>0?Jf:0);for(let t of i){let n=`▣ ${op(t.path)}`;e.push({worktree:t,nodeSha:r.row.sha,x:s,y:r.y-10});let i=Yf+Math.ceil(Xp(n));o=s-a+i,s+=i+Jf}t.set(r.row.sha,o)}return{detachedWorktreePlacements:e,rowWidths:t}},[Et,At,te,Ot]),Nt=(0,b.useMemo)(()=>pm(Dt,Ot,I,wt,N?.shaToColor??tp),[Dt,Ot,I,wt,N]),Pt=(0,b.useMemo)(()=>am(N,M),[N,M]),Ft=(0,b.useMemo)(()=>{if(!j)return null;let e=ce.current.scrollTop,t=ce.current.clientHeight||se.current?.clientHeight||0,n=j.fromLayout.nodes.map(e=>e.row.lane),r=j.toLayout.nodes.map(e=>e.row.lane),i=em(e,t,j.fromLayout.nodes.length,he),o=em(e,t,j.toLayout.nodes.length,he),s=nm(j.fromLayout,i.firstIdx,i.lastIdx),c=nm(j.toLayout,o.firstIdx,o.lastIdx),l=fm(s.visibleEdges,n),u=fm(c.visibleEdges,r),d=pm(s.visibleEdges,l,n,rm(j.fromLayout,j.fromCurrentBranch),j.fromLayout.shaToColor),f=pm(c.visibleEdges,u,r,rm(j.toLayout,j.toCurrentBranch),j.toLayout.shaToColor),p=$p(s.visibleNodes,j.fromCurrentBranch,a,j.fromLayout.shaToColor,te,l.targetNodeRadii).placements,m=$p(c.visibleNodes,j.toCurrentBranch,a,j.toLayout.shaToColor,te,u.targetNodeRadii).placements,h=am(j.fromLayout,j.fromCurrentBranch),g=am(j.toLayout,j.toCurrentBranch),_=new Map(s.visibleNodes.map(e=>[e.row.sha,e])),v=new Map(c.visibleNodes.map(e=>[e.row.sha,e])),y=new Map(d.map(e=>[e.key,e])),b=new Map(f.map(e=>[e.key,e])),x=new Map(p.map(e=>[e.refName,e])),S=new Map(m.map(e=>[e.refName,e]));return{nodes:[...new Set([..._.keys(),...v.keys()])].map(e=>{let t=_.get(e),n=v.get(e),r=n??t;if(!r)return null;let i=n?j.toLayout:j.fromLayout;return{sortIdx:n?.idx??t?.idx??0,item:{key:e,row:r.row,interactive:!!n,color:i.shaToColor.get(e)??$n(r.row.lane),fromX:t?.x??r.x,fromY:t?t.y:r.y+Zf,toX:n?.x??r.x,toY:n?n.y:r.y-Qf,fromOpacity:+!!t,toOpacity:+!!n,fromRadius:t?l.targetNodeRadii.get(e)??X:u.targetNodeRadii.get(e)??X,toRadius:n?u.targetNodeRadii.get(e)??X:l.targetNodeRadii.get(e)??X}}}).filter(e=>e!==null).sort((e,t)=>e.sortIdx-t.sortIdx).map(e=>e.item),edges:[...new Set([...y.keys(),...b.keys()])].map(e=>{let t=y.get(e),n=b.get(e),r=n??t;if(!r)return null;let i=n?j.fromLayout.shaToNode.get(n.fromSha):void 0,a=n?j.fromLayout.shaToNode.get(n.toSha):void 0,o=t?j.toLayout.shaToNode.get(t.fromSha):void 0,s=t?j.toLayout.shaToNode.get(t.toSha):void 0;return{sortY:Math.min(n?.y1??t?.y1??0,n?.y2??t?.y2??0),item:{key:e,fromSha:r.fromSha,toSha:r.toSha,path:n?.path??t?.path??``,fromPlan:t?.plan??n?.plan??{mode:`curve`},toPlan:n?.plan??t?.plan??{mode:`curve`},fromBundleOffset:t?.bundleOffset??n?.bundleOffset??0,toBundleOffset:n?.bundleOffset??t?.bundleOffset??0,fromTargetJoinOffset:t?.targetJoinOffset??n?.targetJoinOffset??0,toTargetJoinOffset:n?.targetJoinOffset??t?.targetJoinOffset??0,fromTargetNodeRadius:t?.targetNodeRadius??n?.targetNodeRadius??X,toTargetNodeRadius:n?.targetNodeRadius??t?.targetNodeRadius??X,stroke:n?.stroke??t?.stroke??`#cdd6f4`,fromStrokeWidth:t?.strokeWidth??r.strokeWidth,toStrokeWidth:n?.strokeWidth??r.strokeWidth,fromOpacity:t?.opacity??0,toOpacity:n?.opacity??0,fromX1:t?.x1??i?.x??r.x1,fromY1:t?.y1??i?.y??r.y1+Zf,fromX2:t?.x2??a?.x??r.x2,fromY2:t?.y2??a?.y??r.y2+Zf,toX1:n?.x1??o?.x??r.x1,toY1:n?.y1??o?.y??r.y1-Qf,toX2:n?.x2??s?.x??r.x2,toY2:n?.y2??s?.y??r.y2-Qf}}}).filter(e=>e!==null).sort((e,t)=>e.sortY-t.sortY).map(e=>e.item),refs:[...new Set([...x.keys(),...S.keys()])].map(e=>{let t=x.get(e),n=S.get(e),r=n??t;return r?{sortY:n?.y??t?.y??0,item:{key:e,placement:r,fromX:t?.x??r.x,fromY:t?t.y:r.y+Zf,toX:n?.x??r.x,toY:n?n.y:r.y-Qf,fromOpacity:+!!t,toOpacity:+!!n,fromScale:t?1:.9,toScale:n?1:.92}}:null}).filter(e=>e!==null).sort((e,t)=>e.sortY-t.sortY).map(e=>e.item),lane:h||g?{key:g?.key??h?.key??`current-lane`,color:g?.color??h?.color??`#89b4fa`,fromX:h?.x??g?.x??0,toX:g?.x??h?.x??0,fromOpacity:+!!h,toOpacity:+!!g}:null}},[j,a,he,te]),L=(0,b.useMemo)(()=>Ft?.nodes??Et.map(e=>({key:e.row.sha,row:e.row,interactive:!0,color:N?.shaToColor.get(e.row.sha)??$n(e.row.lane),fromX:e.x,fromY:e.y,toX:e.x,toY:e.y,fromOpacity:1,toOpacity:1,fromRadius:Ot.targetNodeRadii.get(e.row.sha)??X,toRadius:Ot.targetNodeRadii.get(e.row.sha)??X})),[Ft,Et,N]),It=(0,b.useMemo)(()=>Ft?.edges??Nt.map(e=>({key:e.key,fromSha:e.fromSha,toSha:e.toSha,path:e.path,fromPlan:e.plan,toPlan:e.plan,fromBundleOffset:e.bundleOffset,toBundleOffset:e.bundleOffset,fromTargetJoinOffset:e.targetJoinOffset,toTargetJoinOffset:e.targetJoinOffset,fromTargetNodeRadius:e.targetNodeRadius,toTargetNodeRadius:e.targetNodeRadius,stroke:e.stroke,fromStrokeWidth:e.strokeWidth,toStrokeWidth:e.strokeWidth,fromOpacity:e.opacity,toOpacity:e.opacity,fromX1:e.x1,fromY1:e.y1,fromX2:e.x2,fromY2:e.y2,toX1:e.x1,toY1:e.y1,toX2:e.x2,toY2:e.y2})),[Ft,Nt]),Lt=(0,b.useMemo)(()=>Ft?.refs??kt.map(e=>({key:e.refName,placement:e,fromX:e.x,fromY:e.y,toX:e.x,toY:e.y,fromOpacity:1,toOpacity:1,fromScale:1,toScale:1})),[Ft,kt]),Rt=(0,b.useMemo)(()=>nt?.gutterX===void 0?Ft?Ft.lane:Pt?{key:Pt.key,color:Pt.color,fromX:Pt.x,toX:Pt.x,fromOpacity:1,toOpacity:1}:null:{key:`action-preview-gutter`,color:Ff,fromX:nt.gutterX,toX:nt.gutterX,fromOpacity:1,toOpacity:1},[nt,Ft,Pt]),zt=(0,b.useMemo)(()=>N&&M?N.nodes.find(e=>e.row.refNames.includes(M))??null:null,[N,M]),Bt=(0,b.useMemo)(()=>!P||P.kind!==`head`?null:dp(P,r),[P,r]),Vt=(0,b.useMemo)(()=>!P||P.kind!==`head`?!1:!Bt||Bt.targetSha!==P.targetSha,[P,Bt]),Ht=(0,b.useMemo)(()=>!P||P.kind!==`head`||!Bt||Bt.targetSha===P.targetSha?!1:(P.ahead??0)>0,[P,Bt]),Ut=(0,b.useMemo)(()=>{if(!P)return[];if(P.kind===`head`){let e=(P.behind??0)>0?{action:`push`,label:`Force push`,tone:`warning`,force:!0}:{action:`push`,label:`Push`,tone:`neutral`};return P.isCurrent?[...Vt?[e]:[],...Ht?[{action:`reset`,label:`Reset`,tone:`warning`}]:[]]:$e?[{action:`open-worktree`,label:`Open worktree`,tone:`neutral`,worktreePath:$e.path},...Vt?[e]:[]]:[{action:`checkout`,label:`Checkout`,tone:`neutral`},...Vt?[e]:[],...Ht?[{action:`reset`,label:`Reset`,tone:`warning`}]:[],{action:`delete`,label:`Delete`,tone:`danger`}]}return P.kind===`remote`?[...$e?[{action:`open-worktree`,label:`Open worktree`,tone:`neutral`,worktreePath:$e.path}]:[{action:`checkout`,label:`Checkout`,tone:`neutral`}],{action:`delete`,label:`Delete`,tone:`danger`}]:[{action:`push`,label:`Push`,tone:`neutral`}]},[P,$e,Vt,Ht]),Wt=(0,b.useMemo)(()=>!P||P.kind!==`head`||P.isCurrent||$e?null:P.shortName,[P,$e]),Gt=(0,b.useMemo)(()=>!!zt&&!!M&&!!a&&a!==M&&o?.sourceRefName===a&&o.mergeable,[zt,M,a,o]),Kt=(0,b.useMemo)(()=>P&&P.kind===`head`&&P.isCurrent?P:null,[P]),qt=(0,b.useMemo)(()=>{if(!N||!a||!o?.mergeable||o.sourceRefName!==a||!o.sourceSha||!o.targetSha)return null;let e=N.shaToNode.get(o.sourceSha),t=N.shaToNode.get(o.targetSha);if(!e||!t)return null;let n=N.nodes[0]??t,r={row:{row:n.row.row-1,sha:`preview:${o.sourceSha}:${o.targetSha}`,parentShas:[t.row.sha,e.row.sha],authorName:``,authorEmail:``,authorUnix:0,committerUnix:0,subject:`Merge preview`,additions:0,deletions:0,locChanged:0,refNames:[],lane:t.row.lane},x:t.x,y:n.y-56,idx:n.idx-1},i=`${r.row.sha}-${t.row.sha}`,s=`${r.row.sha}-${e.row.sha}`,c=Tp(r,t,i,I),l=e.x<r.x?`left`:`right`,u=nf(N.nodes,r.idx,e.idx,80,l),d=N.nodes.find(e=>e.x===u),f=u!==null&&u<Math.min(r.x,e.x)?`left`:`right`;return{previewNode:r,sourceNode:e,targetNode:t,sourcePath:Dp(r,e,u===null?Tp(r,e,s,I,{adjacentTrack:`to`}):{mode:`outer-rail`,side:f,anchorLane:d?.row.lane??(f===`left`?Math.min(...I)-1:Math.max(...I)+1),innerLane:f===`left`?Math.max(r.row.lane,e.row.lane):Math.min(r.row.lane,e.row.lane),outerRailX:u},Ot.bundleOffsets.get(s)??0),targetPath:Dp(r,t,c,Ot.bundleOffsets.get(i)??0),color:N.shaToColor.get(t.row.sha)??$n(t.row.lane)}},[N,a,o,I,Ot.bundleOffsets]),Jt=(0,b.useMemo)(()=>Ce?qt:null,[Ce,qt]),Yt=(0,b.useCallback)((e,t)=>{e.stopPropagation(),we(!1),Ee(null),Oe(null),u(t)},[u]),Xt=(0,b.useCallback)(e=>(oe(e),m(e.action,e.refName,e.sha,e.force).finally(()=>{oe(t=>rp(t,e)?null:t)})),[m]),Zt=(0,b.useCallback)(e=>{if(!a||!P||v)return;if(we(!1),e.action===`open-worktree`){e.worktreePath&&ie(e.worktreePath);return}let t=e.action,n=P.targetSha,r=a,i={action:t,label:e.label,tone:e.tone,refName:r,sha:n,force:!!e.force};Xt(i).catch(t=>{if(e.action===`push`&&!e.force&&ip(t))T(`Push rejected`,t,{label:`Force push`,run:()=>{Xt({action:`push`,label:`Force push`,tone:`warning`,force:!0,refName:r,sha:n}).catch(e=>T(`Force push failed`,e))}});else{let n=e.action===`checkout`?ap(t):null;if(n){T(`Branch is already checked out`,t,{label:`Open worktree`,run:()=>{ie(n)}});return}T(`${e.action} failed`,t)}})},[a,P,Xt,T,v,ie]),Qt=(0,b.useCallback)(e=>{Wt&&(v||Re({title:`Move branch`,message:`Move branch ${Wt} to commit ${e.slice(0,8)}?`,confirmLabel:`Move`,onConfirm:()=>{we(!1),m(`move`,Wt,e).catch(e=>{T(`Move failed`,e)})}}))},[Wt,m,T,v]),$t=(0,b.useCallback)((e,t)=>{v||(we(!1),Pe(null),Me(null),Ie({kind:e,targetSha:t}))},[v]),en=(0,b.useCallback)(e=>{if(!Fe)return;let{kind:t,targetSha:n}=Fe;Ie(null),m(t===`branch`?`create`:`create-tag`,e,n).catch(e=>{T(`Create ${t} failed`,e)})},[Fe,m,T]),tn=(0,b.useCallback)(()=>Ie(null),[]),nn=Fe?.kind===`branch`?`Branch name`:`Tag name`,rn=Fe?`Create ${Fe.kind} at ${Fe.targetSha.slice(0,8)}`:`Create ref`,an=Fe?.kind===`tag`?et:``,on=(0,b.useCallback)(()=>{a&&(Ee(null),Oe(null),we(!0),(!o||o.sourceRefName!==a)&&f(a))},[a,o,f]),sn=(0,b.useCallback)(()=>{we(!1)},[]),cn=(0,b.useCallback)((e,t)=>{e!==`uncommit`&&(we(!1),Oe(null),Ee({kind:`commit`,action:e,sha:t}))},[]),ln=(0,b.useCallback)((e,t,n)=>{let r=se.current;if(!r)return;let i=n.currentTarget.getBoundingClientRect(),a=Ve.current;we(!1),Ae(!0),Oe({targetRefName:e,buttonRect:{left:i.left,top:i.top,width:i.width,height:i.height},buttonScale:i.height/Cf,baseZoom:a,viewport:{width:r.clientWidth,height:r.clientHeight},scroll:{x:r.scrollLeft,y:r.scrollTop},targetNode:{x:t.x,y:t.y}}),Ee({kind:`rebase`,targetRefName:e})},[]),un=(0,b.useCallback)(()=>{Ee(null),Oe(null)},[]),dn=(0,b.useCallback)(()=>{Ee(e=>e?.kind===`rebase`?null:e),Oe(null)},[]),fn=(0,b.useCallback)(()=>{let e=se.current;if(!e||!qt)return;let t=Math.max(qt.previewNode.y+X,qt.sourceNode.y+X,qt.targetNode.y+X),n=Math.max(t+40,224),r=Math.min(Ve.current,Math.max(.18,Math.min(1,e.clientHeight/n)));He.current=Date.now()+500,Ve.current=r,ge(r),e.scrollTo({top:0,behavior:`smooth`}),requestAnimationFrame(()=>Tt(e,r))},[qt,Tt]),pn=(0,b.useCallback)(()=>{a&&(v||(we(!0),fn(),g(a).catch(e=>{T(`Merge failed`,e)})))},[a,g,fn,T,v]),mn=(0,b.useCallback)(e=>{we(!1),Ee(null),Oe(null),_(e).catch(e=>{T(`Rebase failed`,e)})},[_,T]),hn=(0,b.useCallback)(e=>{Kt&&(v||mn(e))},[Kt,mn,v]),gn=(0,b.useMemo)(()=>{if(!N||!se.current)return[];let e=se.current.scrollTop,t=new Map;for(let e of Et){let n=t.get(e.row.lane);(!n||e.y<n.y)&&t.set(e.row.lane,e)}let n=new Map;for(let r of N.nodes){if(r.row.refNames.length===0||r.y*it+ot>=e)continue;let i=r.row.lane;if(n.has(i))continue;let a=t.get(i);if(!a)continue;let o=nr(r.row.refNames);o&&N.shaToBranch.get(a.row.sha)===o&&n.set(i,{name:o,x:r.x,color:er(o)})}let r=[...n.values()].sort((e,t)=>e.x-t.x),i=[],a=[];for(let e of r){let t=e.x*it+at-4,n=e.name.length*7+20,r=0;for(let e=0;e<a.length;e++){if(t>=a[e]){r=e;break}r=e+1}r>=a.length&&a.push(0),a[r]=t+n+4,i.push({...e,row:r})}return i},[N,Et,it,at,ot]),_n=(0,b.useMemo)(()=>N?Vp(N.nodes,it).map(e=>({...e,y:e.y+ot})):[],[N,it,ot]),vn=(0,b.useMemo)(()=>{if(!N)return null;let e=Hp(N.nodes,Math.max(0,_e-ot),it);return e?Bp(new Date(e.row.committerUnix*1e3),it):null},[N,_e,it,ot]),yn=(0,b.useMemo)(()=>_n.filter(e=>e.y-_e>28),[_n,_e]),bn=(0,b.useMemo)(()=>im(N,M),[N,M]),xn=(0,b.useMemo)(()=>!N||bn.size===0||!C?[]:N.nodes.filter(e=>bn.has(e.row.sha)).map(e=>({key:e.row.sha,sha:e.row.sha,y:e.y*it+ot,text:e.row.subject})),[N,bn,it,ot,C]),Sn=(0,b.useMemo)(()=>xn.filter(e=>e.y-_e>28),[xn,_e]),Cn=(0,b.useMemo)(()=>ye===0?[]:xn.filter(e=>{let t=e.y-_e;return t>0&&t<ye}),[xn,_e,ye]);(0,b.useEffect)(()=>{if(Cn.length===0)return;let e=window.setTimeout(()=>{let e=Cn.slice(0,bf).map(e=>e.sha);ee(e)},200);return()=>window.clearTimeout(e)},[Cn,ee]);let wn=(0,b.useMemo)(()=>N&&i?N.shaToNode.get(i)??null:null,[N,i]),Tn=(0,b.useMemo)(()=>{if(!N||!wn||!M)return!1;let e=N.nodes.find(e=>e.row.refNames.includes(M));if(!e)return!1;let t=e.row.sha,n=new Set;for(;t&&!n.has(t);){if(t===wn.row.sha)return!0;n.add(t);let e=N.shaToNode.get(t);if(!e||e.row.parentShas.length===0)break;t=e.row.parentShas[0]}return!1},[N,wn,M]),En=(0,b.useMemo)(()=>!wn||!M?!1:wn.row.refNames.includes(M),[wn,M]),Dn=(0,b.useMemo)(()=>{if(!wn)return[];let e=[],t=wn.row.parentShas.length===1;return En?(e.push({action:`uncommit`,label:`Uncommit`,tone:`uncommit`}),t&&e.push({action:`revert`,label:`Revert`,tone:`warning`}),e):Tn?(t&&e.push({action:`revert`,label:`Revert`,tone:`warning`}),e):(t&&(e.push({action:`cherry-pick`,label:`Cherry pick`,tone:`success`}),e.push({action:`revert`,label:`Revert`,tone:`warning`})),e)},[wn,En,Tn]),On=(0,b.useCallback)(e=>{if(!wn||v)return;if(Ee(null),Oe(null),e===`cherry-pick`){h(e,wn.row.sha).catch(t=>{T(`${e} failed`,t)});return}let t=wn.row.sha.slice(0,8),n=e===`uncommit`?`Uncommit`:`Revert commit`,r=e===`uncommit`?`Uncommit ${t}? This will move HEAD to its parent and keep the changes in your working tree.`:`Revert commit ${t} on the current branch?`;Re({title:n,message:r,confirmLabel:e===`uncommit`?`Uncommit`:`Revert`,onConfirm:()=>{h(e,wn.row.sha).catch(t=>{T(`${e} failed`,t)})}})},[wn,h,T,v]),kn=j!==null;if(!N)return(0,y.jsx)(`div`,{style:{flex:1,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#45475a`,fontSize:13},children:`No commits to display`});let An=N.totalWidth,jn=N.totalHeight,Mn=An*he,Nn=jn*he,Pn=F?Math.max(22,String(F.conflictedCount).length*7+14):0,Fn=F?.kind===`merge`?F.conflictedCount>0?`Merge conflicts`:`Merge in progress`:F?.kind===`rebase`?F.conflictedCount>0?`Rebase conflicts`:`Rebase in progress`:`Uncommitted changes`,In=F?.kind===`worktree`?`Uncommitted changes — ${F.count} file${F.count===1?``:`s`}\nClick to stage / unstage`:`${Fn} — ${F?.conflictedCount??0} conflict${F?.conflictedCount===1?``:`s`}\nClick to review files`;return(0,y.jsxs)(`div`,{ref:se,style:{flex:1,height:`100%`,overflow:`auto`,position:`relative`,background:`#1e1e2e`,touchAction:`pan-x pan-y`},onClick:()=>{we(!1),Ee(null),Oe(null),Pe(null),Me(null),vt(),d()},children:[(0,y.jsx)(vf,{open:!!Fe,title:rn,label:nn,initialValue:an,confirmLabel:`Create`,onSubmit:en,onClose:tn}),(0,y.jsx)(yf,{open:!!Le,title:Le?.title??``,message:Le?.message??``,confirmLabel:Le?.confirmLabel??`Confirm`,onConfirm:()=>{let e=Le?.onConfirm;Re(null),e?.()},onClose:()=>Re(null)}),De&&(0,Ai.createPortal)((0,y.jsx)(`div`,{style:{position:`fixed`,left:De.buttonRect.left,top:De.buttonRect.top,width:De.buttonRect.width,height:De.buttonRect.height,zIndex:1e4,pointerEvents:`auto`},children:(0,y.jsx)(`div`,{style:{width:De.buttonRect.width/De.buttonScale,height:De.buttonRect.height/De.buttonScale,transform:`scale(${De.buttonScale})`,transformOrigin:`top left`},children:(0,y.jsx)(cd,{label:`Rebase`,tone:`success`,onClick:()=>hn(De.targetRefName),onMouseLeave:dn})})}),document.body),(0,y.jsx)(`div`,{style:{position:`sticky`,top:0,left:0,zIndex:20,height:0,overflow:`visible`,pointerEvents:`none`},children:gn.map(e=>(0,y.jsx)(`div`,{onClick:t=>Yt(t,e.name),style:{position:`absolute`,left:e.x*it+at-4,top:4+e.row*22,padding:`2px 8px`,borderRadius:4,background:a===e.name?e.color+`35`:e.color+`20`,border:`1px solid ${a===e.name?e.color:e.color+`50`}`,color:e.color,fontSize:10,fontWeight:600,whiteSpace:`nowrap`,pointerEvents:`auto`,transform:`scale(${Math.min(it,1)})`,transformOrigin:`top left`,transition:`left ${st}, transform ${st}`,cursor:`pointer`,boxShadow:a===e.name?`0 0 8px ${e.color}40`:`none`},children:e.name},e.name))}),(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,left:0,width:`100%`,height:0,overflow:`visible`,zIndex:5,pointerEvents:`none`},children:[vn&&(0,y.jsx)(`div`,{style:{position:`absolute`,right:20,top:6,padding:`3px 8px`,borderRadius:6,background:`#181825`,border:`1px solid #313244`,color:`#9399b2`,fontSize:11,fontWeight:600,whiteSpace:`nowrap`,boxShadow:`0 4px 12px rgba(0,0,0,0.2)`},children:vn}),(0,y.jsxs)(`div`,{ref:k,style:{position:`relative`},children:[F&&F.y*it+ot-_e>28&&(0,y.jsxs)(G.div,{style:{position:`absolute`,left:20,top:gc(dt,e=>e*it+ot-7),opacity:mt,maxWidth:380*it,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:ne?F.color:`#a6adc8`,fontSize:12,fontWeight:600,pointerEvents:`none`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:6,transition:`max-width ${st}`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,background:F.color,flexShrink:0}}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:Fn})]}),Sn.map(e=>{let t=E[e.sha],n=t?{success:`#a6e3a1`,pending:`#f9e2af`,failure:`#f38ba8`,error:`#f38ba8`,neutral:`#6c7086`,loading:`#585b70`,none:`#45475a`}[t.state]:void 0;return(0,y.jsxs)(`div`,{style:{position:`absolute`,left:20,top:e.y-7,maxWidth:380*it,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#a6adc8`,fontSize:12,pointerEvents:`none`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:6,transition:`top ${st}, max-width ${st}`},children:[n&&(0,y.jsx)(`span`,{style:{display:`inline-block`,width:8,height:8,borderRadius:`50%`,background:n,flexShrink:0}}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:e.text})]},e.key)})]}),(0,y.jsx)(`div`,{ref:O,style:{position:`relative`},children:yn.map(e=>(0,y.jsxs)(`div`,{style:{position:`absolute`,right:20,top:e.y-7,padding:`2px 6px`,borderRadius:6,background:`#1e1e2e`,color:e.kind===`month`?`#6c7086`:e.kind===`hour`?`#585b70`:`#45475a`,fontSize:e.kind===`month`?11:10,fontWeight:e.kind===`month`?600:e.kind===`hour`?500:400,whiteSpace:`nowrap`,pointerEvents:`none`,userSelect:`none`,transition:`top ${st}`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,width:e.kind===`month`?16:e.kind===`hour`?6:8,height:1,background:e.kind===`month`?`#585b70`:e.kind===`hour`?`#45475a`:`#313244`,verticalAlign:`middle`,marginRight:4}}),e.text]},e.key))})]}),(0,y.jsx)(`div`,{style:{width:Mn,height:Nn,position:`relative`,zIndex:10},children:(0,y.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,width:An,height:jn,transform:`translate(${at}px, ${ot}px) scale(${it})`,transformOrigin:`top left`,transition:`transform ${st}`,willChange:De?`transform`:void 0},children:[(0,y.jsxs)(`svg`,{width:An,height:jn,style:{position:`absolute`,top:0,left:0,zIndex:10,pointerEvents:`none`,overflow:`visible`},children:[Ct.map(e=>(0,y.jsx)(`rect`,{x:e.x-80/2+2,y:0,width:76,height:jn,rx:16,fill:`${e.color}16`,stroke:`${e.color}24`,strokeWidth:1},`gutter-${e.lane}`)),Rt&&(0,y.jsxs)(G.g,{opacity:kn?gc(ze,e=>Z(Rt.fromOpacity,Rt.toOpacity,e)*.95):Rt.toOpacity*.95,children:[(0,y.jsx)(G.rect,{x:kn?gc(ze,e=>Z(Rt.fromX,Rt.toX,e)):Rt.toX,y:0,width:$f,height:jn,rx:18,fill:`${Rt.color}10`}),(0,y.jsx)(G.rect,{x:kn?gc(ze,e=>Z(Rt.fromX,Rt.toX,e)+2):Rt.toX+2,y:0,width:$f-4,height:jn,rx:16,fill:`${Rt.color}06`})]},Rt.key),Jt&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`path`,{d:Jt.targetPath,stroke:Jt.color,strokeWidth:3,fill:`none`,strokeLinecap:`round`,strokeDasharray:`8 6`,opacity:.7}),(0,y.jsx)(`path`,{d:Jt.sourcePath,stroke:Jt.color,strokeWidth:2.5,fill:`none`,strokeLinecap:`round`,strokeDasharray:`8 6`,opacity:.55})]}),It.map(e=>(0,y.jsx)(G.path,{d:kn?gc(ze,t=>t>=.999?e.path:kp(e,t)):e.path,stroke:e.stroke,strokeWidth:kn?gc(ze,t=>Z(e.fromStrokeWidth,e.toStrokeWidth,t)):e.toStrokeWidth,fill:`none`,strokeLinecap:`round`,opacity:kn?gc(ze,t=>Z(e.fromOpacity,e.toOpacity,t)):e.toOpacity},e.key)),nt?.edges.map(e=>(0,y.jsx)(`path`,{d:e.path,stroke:e.color,strokeWidth:3,fill:`none`,strokeLinecap:`round`,strokeDasharray:e.dashed?`7 6`:void 0,opacity:.9},e.key))]}),(0,y.jsxs)(`svg`,{width:An,height:jn,style:{position:`absolute`,top:0,left:0,zIndex:30,pointerEvents:`none`,overflow:`visible`},children:[Jt&&(0,y.jsxs)(`g`,{children:[(0,y.jsx)(`circle`,{cx:Jt.previewNode.x,cy:Jt.previewNode.y,r:X*1.9,fill:Jt.color,opacity:.12}),(0,y.jsx)(`circle`,{cx:Jt.previewNode.x,cy:Jt.previewNode.y,r:X,fill:xf,stroke:Jt.color,strokeWidth:3,strokeDasharray:`6 4`}),(0,y.jsx)(`circle`,{cx:Jt.previewNode.x,cy:Jt.previewNode.y,r:2.5,fill:Jt.color})]}),L.map(t=>{let{row:n}=t,r=n.sha===i,a=t.color,o=Of*2,s=Np(n.additions,xt,o),c=Np(n.deletions,xt,o),u=`gauge-${n.sha}`,d=`${u}-left`,f=`${u}-right`,p=r?jf:Af,m=r?Mf:kf,h=Pd(n.subject,e),g=kn?gc(ze,e=>Z(t.fromX,t.toX,e)):t.toX,_=kn?gc(ze,e=>Z(t.fromY,t.toY,e)):t.toY,v=kn?gc(ze,e=>Z(t.fromOpacity,t.toOpacity,e)):t.toOpacity,b=kn?gc(ze,e=>Z(t.fromRadius,t.toRadius,e)):t.toRadius,x=kn?gc(ze,e=>Z(t.fromRadius,t.toRadius,e)*2.5):t.toRadius*2.5,S=kn?gc(ze,e=>`translate(${Z(t.fromX,t.toX,e)} ${Z(t.fromY,t.toY,e)})`):`translate(${t.toX} ${t.toY})`,C=kn?gc(ze,e=>jp(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Of,`left`)):jp(t.toX,t.toY,Of,`left`),w=kn?gc(ze,e=>jp(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Of,`right`)):jp(t.toX,t.toY,Of,`right`),T=kn?gc(ze,e=>Mp(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Of,`left`)):Mp(t.toX,t.toY,Of,`left`),E=kn?gc(ze,e=>Mp(Z(t.fromX,t.toX,e),Z(t.fromY,t.toY,e),Of,`right`)):Mp(t.toX,t.toY,Of,`right`);return(0,y.jsxs)(G.g,{onClick:t.interactive?e=>{e.stopPropagation(),l(n.sha)}:void 0,onPointerEnter:t.interactive?()=>yt(n.sha):void 0,onPointerLeave:t.interactive?()=>bt(n.sha):void 0,opacity:v,style:{cursor:t.interactive?`pointer`:`default`,pointerEvents:t.interactive?`auto`:`none`},children:[(0,y.jsx)(`title`,{children:`${n.subject}${h?`\n${h.label} commit`:``}\n+${n.additions} / -${n.deletions} (${n.locChanged} LOC changed)`}),r&&(0,y.jsx)(G.circle,{cx:g,cy:_,r:x,fill:a,opacity:.15}),(0,y.jsx)(G.circle,{cx:g,cy:_,r:b,fill:xf,stroke:a,strokeWidth:r?3.5:2.75}),(0,y.jsxs)(`defs`,{children:[(0,y.jsx)(`clipPath`,{id:d,clipPathUnits:`userSpaceOnUse`,children:(0,y.jsx)(G.path,{d:C})}),(0,y.jsx)(`clipPath`,{id:f,clipPathUnits:`userSpaceOnUse`,children:(0,y.jsx)(G.path,{d:w})})]}),(0,y.jsx)(G.path,{d:C,fill:m}),(0,y.jsx)(G.path,{d:w,fill:m}),s>0&&(0,y.jsx)(G.rect,{x:kn?gc(ze,e=>Z(t.fromX,t.toX,e)-Of):t.toX-Of,y:kn?gc(ze,e=>Z(t.fromY,t.toY,e)+Of-s):t.toY+Of-s,width:Of,height:s,fill:Nf,clipPath:`url(#${d})`}),c>0&&(0,y.jsx)(G.rect,{x:g,y:kn?gc(ze,e=>Z(t.fromY,t.toY,e)+Of-c):t.toY+Of-c,width:Of,height:c,fill:Pf,clipPath:`url(#${f})`}),(0,y.jsx)(G.path,{d:T,stroke:p,strokeWidth:1.6,fill:`none`}),(0,y.jsx)(G.path,{d:E,stroke:p,strokeWidth:1.6,fill:`none`}),(0,y.jsx)(G.line,{x1:g,y1:kn?gc(ze,e=>Z(t.fromY,t.toY,e)-Of):t.toY-Of,x2:g,y2:kn?gc(ze,e=>Z(t.fromY,t.toY,e)+Of):t.toY+Of,stroke:p,strokeWidth:1.6}),!h&&n.parentShas.length>1&&(0,y.jsx)(G.circle,{cx:g,cy:_,r:2,fill:a}),h&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G.circle,{cx:g,cy:_,r:7.4,fill:xf,opacity:.9}),(0,y.jsx)(G.g,{transform:S,children:(0,y.jsx)(tf,{icon:h.icon,color:a,customSvg:h.customSvg})})]})]},t.key)}),nt?.nodes.map(({node:e,color:t})=>(0,y.jsxs)(`g`,{children:[(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:X*1.9,fill:t,opacity:.12}),(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:X,fill:xf,stroke:t,strokeWidth:3,strokeDasharray:`6 4`}),(0,y.jsx)(`circle`,{cx:e.x,cy:e.y,r:2.5,fill:t})]},`action-preview:${e.row.sha}`)),F&&(0,y.jsxs)(G.g,{onClick:e=>{e.stopPropagation(),re()},opacity:mt,style:{cursor:`pointer`,pointerEvents:`auto`},children:[(0,y.jsx)(`title`,{children:In}),F.sourcePath&&(0,y.jsx)(`path`,{d:F.sourcePath,stroke:F.color,strokeWidth:2.25,strokeLinecap:`round`,strokeDasharray:`3 5`,fill:`none`,opacity:.55}),(0,y.jsx)(G.path,{d:gc([ut,dt,ft,pt],(e,t,n,r)=>Dp({x:e,y:t},{x:n,y:r},F.targetPlan,0)),stroke:F.color,strokeWidth:2.5,strokeLinecap:`round`,strokeDasharray:`3 5`,fill:`none`,opacity:.7}),ne&&(0,y.jsx)(G.circle,{cx:ut,cy:dt,r:X*2.5,fill:F.color,opacity:.15}),(0,y.jsx)(G.circle,{cx:ut,cy:dt,r:X,fill:xf,stroke:F.color,strokeWidth:ne?3.5:2.75,strokeDasharray:`4 3`}),F.kind===`worktree`?(0,y.jsx)(G.text,{x:ut,y:dt,textAnchor:`middle`,dominantBaseline:`central`,fontSize:12,fontWeight:700,fill:F.color,style:{pointerEvents:`none`,userSelect:`none`},children:F.count}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(G.circle,{cx:ut,cy:dt,r:2.5,fill:F.color}),F.conflictedCount>0&&(0,y.jsxs)(`g`,{style:{pointerEvents:`none`,userSelect:`none`},children:[(0,y.jsx)(G.rect,{x:gc(ut,e=>e+X+6),y:gc(dt,e=>e-10),width:Pn,height:20,rx:10,fill:`#fab38722`,stroke:`#fab387`,strokeWidth:1.4}),(0,y.jsx)(G.text,{x:gc(ut,e=>e+X+6+Pn/2),y:dt,textAnchor:`middle`,dominantBaseline:`central`,fontSize:11,fontWeight:800,fill:`#fab387`,children:F.conflictedCount})]})]})]})]}),Lt.map(e=>{let{placement:t}=e,n=t.isSelected||t.isCurrent,r=t.isSelected?t.color+`35`:t.isCurrent?t.color+`2a`:t.color+`18`,i=[`inset 0 1px 0 rgba(255, 255, 255, 0.14)`,`inset 0 -1px 0 ${t.color}18`,n?`0 0 8px ${t.color}38`:`0 2px 5px rgba(0, 0, 0, 0.18)`].join(`, `);return(0,y.jsxs)(G.div,{onClick:e=>Yt(e,t.refName),onPointerEnter:()=>yt(t.nodeSha),onPointerLeave:()=>bt(t.nodeSha),style:{position:`absolute`,left:0,top:0,zIndex:20,height:20,padding:`0 7px`,borderRadius:4,background:`linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.015) 38%, ${t.color}18 100%), linear-gradient(${r}, ${r}), rgba(24, 24, 37, 0.5)`,backdropFilter:`blur(3px) saturate(145%) contrast(103%)`,WebkitBackdropFilter:`blur(3px) saturate(145%) contrast(103%)`,border:`1px solid ${n?t.color:t.color+`66`}`,color:t.color,fontSize:11,fontWeight:600,lineHeight:`20px`,whiteSpace:`nowrap`,cursor:`pointer`,userSelect:`none`,boxShadow:i,transformOrigin:`top left`,opacity:kn?gc(ze,t=>Z(e.fromOpacity,e.toOpacity,t)):e.toOpacity,transform:kn?gc(ze,t=>`translate(${Z(e.fromX,e.toX,t)}px, ${Z(e.fromY,e.toY,t)}px) scale(${Z(e.fromScale,e.toScale,t)})`):`translate(${e.toX}px, ${e.toY}px) scale(${e.toScale})`},children:[Jp(t.isRemote,t.isCurrent),t.refName,t.linkedWorktrees.map(e=>(0,y.jsxs)(`span`,{title:`Open linked worktree\n${e.path}${e.lockedReason?`\nLocked: ${e.lockedReason}`:``}`,onClick:t=>{t.stopPropagation(),ie(e.path)},style:{display:`inline-block`,marginLeft:7,paddingLeft:7,borderLeft:`1px solid ${t.color}55`,color:`#a6adc8`},children:[`▣ `,op(e.path)]},e.path))]},e.key)}),!kn&&jt.map(e=>{let{worktree:t}=e;return(0,y.jsxs)(`div`,{title:`${t.isCurrent?`Current detached worktree`:`Open detached worktree`}\n${t.path}\n${t.headSha?.slice(0,12)??``}`,onClick:e=>{e.stopPropagation(),t.isCurrent||ie(t.path)},onPointerEnter:()=>yt(e.nodeSha),onPointerLeave:()=>bt(e.nodeSha),style:{position:`absolute`,left:e.x,top:e.y,zIndex:20,height:20,padding:`0 7px`,borderRadius:4,border:`1px solid ${t.isCurrent?`#f9e2af99`:`#6c708666`}`,background:t.isCurrent?`#f9e2af18`:`rgba(24,24,37,0.72)`,color:t.isCurrent?`#f9e2af`:`#a6adc8`,fontSize:11,fontWeight:600,lineHeight:`20px`,whiteSpace:`nowrap`,cursor:t.isCurrent?`default`:`pointer`,userSelect:`none`,boxShadow:`0 2px 5px rgba(0,0,0,0.18)`},children:[`▣ `,op(t.path)]},`detached-worktree:${t.path}`)}),Et.map(e=>{let t=Mt.get(e.row.sha)??0,n=Ot.targetNodeRadii.get(e.row.sha)??X,r=e.x+n+8+t+(t>0?8:0),o=e.y-10,s=ae!==null,c=!s&&e.row.sha===i?Dn:[],l=!!a&&e.row.refNames.includes(a),u=l?Ut:[],d=s&&l&&ae?u.find(e=>e.action===ae.action)??ae:null,f=s?d?[d]:[]:u,p=!s&&!!M&&e.row.refNames.includes(M)&&Gt,m=!s&&!!Wt&&e.row.sha!==P?.targetSha,h=!v&&!s&&!kn&&(je===e.row.sha||Ne===e.row.sha),g=!s&&Kt&&e.row.sha!==Kt.targetSha?nr(e.row.refNames.filter(e=>e!==Kt.shortName)):null,_=g&&(Te?.kind!==`rebase`||Te.targetRefName===g)?g:null,x=f.length>0||p||m||h||!!_;return c.length===0&&!x?null:(0,y.jsxs)(b.Fragment,{children:[c.length>0&&(0,y.jsx)(`div`,{style:{position:`absolute`,left:e.x-X-12,top:e.y,transform:`translate(-100%, -50%)`,display:`flex`,alignItems:`center`,gap:10,flexWrap:`nowrap`,zIndex:40},children:c.map(t=>(0,y.jsx)(cd,{label:t.label,tone:t.tone,onClick:()=>On(t.action),onMouseEnter:()=>cn(t.action,e.row.sha),onMouseLeave:un},t.action))}),x&&(0,y.jsxs)(`div`,{onPointerEnter:()=>yt(e.row.sha),onPointerLeave:()=>bt(e.row.sha),style:{position:`absolute`,left:r,top:o,display:`flex`,alignItems:`flex-start`,gap:10,flexWrap:`nowrap`,zIndex:h||Ne===e.row.sha?40:20},children:[f.length>0&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,position:`relative`,top:np(wf),zIndex:7},children:f.map(e=>(0,y.jsx)(ld,{label:e.label,tone:e.tone,loading:!!d&&e.action===d.action,onClick:()=>Zt(e)},e.action))}),m&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,zIndex:7},children:(0,y.jsx)(ld,{label:`Move`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>Qt(e.row.sha)})}),_&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,top:np(Cf),zIndex:7},children:(0,y.jsx)(cd,{label:`Rebase`,tone:`success`,onClick:()=>hn(_),onMouseEnter:t=>ln(_,e,t),onMouseLeave:De?.targetRefName===_?void 0:dn})}),p&&(0,y.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,position:`relative`,top:np(Cf),zIndex:7},children:(0,y.jsx)(cd,{label:`Merge`,tone:`merge`,onClick:pn,onMouseEnter:on,onMouseLeave:sn})}),h&&(0,y.jsxs)(`div`,{style:{position:`relative`,top:np(Tf),zIndex:8},children:[(0,y.jsx)(`button`,{type:`button`,title:`Create branch or tag`,"aria-label":`Create branch or tag`,onClick:t=>{t.stopPropagation(),we(!1),Pe(t=>t===e.row.sha?null:e.row.sha),Me(e.row.sha)},style:{width:Tf,height:Tf,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,padding:0,borderRadius:6,border:`1px solid #4a4f68`,background:`#2f3348`,color:`#cdd6f4`,fontSize:21,fontWeight:600,lineHeight:1,cursor:`pointer`,fontFamily:`inherit`,boxShadow:`0 8px 20px rgba(0,0,0,0.28)`},onMouseEnter:e=>{e.currentTarget.style.background=`#3a4058`},onMouseLeave:e=>{e.currentTarget.style.background=`#2f3348`},children:`+`}),Ne===e.row.sha&&(0,y.jsx)(`div`,{onClick:e=>e.stopPropagation(),style:{position:`absolute`,right:0,top:36,width:Df,padding:5,borderRadius:7,border:`1px solid #4a4f68`,background:`#181825`,boxShadow:`0 14px 30px rgba(0,0,0,0.42)`,display:`flex`,flexDirection:`column`,gap:4},children:[`branch`,`tag`].map(t=>(0,y.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),$t(t,e.row.sha)},style:{height:28,padding:`0 9px`,borderRadius:5,border:`1px solid transparent`,background:`transparent`,color:`#cdd6f4`,fontSize:12,fontWeight:600,fontFamily:`inherit`,textAlign:`left`,cursor:`pointer`},onMouseEnter:e=>{e.currentTarget.style.background=`#313244`,e.currentTarget.style.borderColor=`#45475a`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`,e.currentTarget.style.borderColor=`transparent`},children:t===`branch`?`Branch`:`Tag`},t))})]})]})]},`${e.row.sha}-actions`)})]})})]})}var gm=56,_m=56,vm=12,ym=`#11111b`,bm=56,xm=80,Sm=110,Cm=150,wm=28,Tm=640,Em=[`#89b4fa`,`#a6e3a1`,`#f9e2af`,`#f38ba8`,`#cba6f7`,`#94e2d5`,`#fab387`,`#74c7ec`,`#f5c2e7`,`#b4befe`];function Dm(e){return Em[(e%Em.length+Em.length)%Em.length]}var Om=`#f9e2af`,km={commit:`#a6e3a1`,amend:`#f9e2af`,checkout:`#89b4fa`,reset:`#f38ba8`,rebase:`#fab387`,merge:`#cba6f7`,"cherry-pick":`#94e2d5`,revert:`#f5c2e7`,pull:`#74c7ec`,branch:`#b4befe`,clone:`#9399b2`,other:`#9399b2`},Am=new Set([`reset`,`rebase`,`amend`]),jm={reset:`reset moved HEAD away — commits only on the old position may be unreachable`,rebase:`rebase rewrote history — the original commits live on only in the reflog`,amend:`amend replaced the previous commit — the original version is only in the reflog`};function Mm(e,t,n,r){if(e===n)return`M${e},${t}L${n},${r}`;let i=r-t;return`M${e},${t}C${e},${t+i*.3} ${n},${r-i*.3} ${n},${r}`}function Nm(e){let t=new Map;e.forEach((e,n)=>t.set(e.sha,n));let n=new Map,r=[],i=[],a=0;for(let o=0;o<e.length;o++){let s=e[o],c=n.get(s.sha);c===void 0&&(c=r.indexOf(null),c===-1?(c=r.length,r.push(s.sha)):r[c]=s.sha,n.set(s.sha,c)),i.push(c),c>a&&(a=c),t.get(s.sha)===o&&(r[c]=null)}return{lanes:i,maxLane:a}}function Pm(e){if(!e)return``;let t=Math.floor(Date.now()/1e3-e);if(t<60)return`just now`;if(t<3600)return`${Math.floor(t/60)}m ago`;if(t<86400)return`${Math.floor(t/3600)}h ago`;if(t<172800)return`yesterday`;if(t<14*86400)return`${Math.floor(t/86400)}d ago`;let n=new Date(e*1e3),r=n.toLocaleDateString(void 0,{month:`short`,day:`numeric`});return n.getFullYear()===new Date().getFullYear()?r:`${r} ${n.getFullYear()}`}function Fm(){let e=R(e=>e.reflog),t=R(e=>e.reflogLoading),n=R(e=>e.reflogMaxCount),r=R(e=>e.selectedSha),i=R(e=>e.selectCommit),a=R(e=>e.recoverBranch),o=R(e=>e.checkoutSha),s=R(e=>e.performCommitAction),c=R(e=>e.loadMoreReflog),l=R(e=>e.showError),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(null);(0,b.useEffect)(()=>{d(null)},[e]);let g=e?.entries??[],{lanes:_,maxLane:v}=(0,b.useMemo)(()=>Nm(g),[g]),x=(0,b.useMemo)(()=>{let e=new Set;for(let t of g)t.isReachable||e.add(t.sha);return e},[g]),S=e=>Cm+e*_m,C=e=>bm+e*gm,w=Cm+(v+1)*_m+wm,T=w+Tm,E=bm+g.length*gm+xm,ee=(0,b.useMemo)(()=>{let e=``;return g.map(t=>{let n=Pm(t.entryUnix);return n===e?``:(e=n,n)})},[g]),D=e=>{p({entry:e,defaultName:`recovered-${e.sha.slice(0,7)}`})},te=e=>{h({title:`Checkout commit`,message:`Checkout ${e.sha.slice(0,8)}? This detaches HEAD at that state.`,confirmLabel:`Checkout`,onConfirm:()=>{o(e.sha).catch(e=>l(`Checkout failed`,e))}})},ne=e=>{h({title:`Cherry pick commit`,message:`Cherry-pick ${e.sha.slice(0,8)} onto the current branch?`,confirmLabel:`Cherry pick`,onConfirm:()=>{s(`cherry-pick`,e.sha).catch(e=>l(`Cherry-pick failed`,e))}})},re=e=>{if(!f)return;let{entry:t}=f;p(null),a(e,t.sha).catch(e=>l(`Recover failed`,e))},ie=e=>{navigator.clipboard?.writeText(e.sha)};return!e&&t?(0,y.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#6c7086`,fontSize:13},children:`Reading reflog…`}):g.length===0?(0,y.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#45475a`,fontSize:13},children:`No reflog entries — this repository has no recorded HEAD movements yet`}):(0,y.jsxs)(`div`,{style:{flex:1,height:`100%`,overflow:`auto`,position:`relative`,background:`#1e1e2e`},onClick:()=>d(null),children:[(0,y.jsx)(vf,{open:!!f,title:f?`Create branch at ${f.entry.sha.slice(0,8)}`:`Create branch`,label:`Branch name`,initialValue:f?.defaultName??``,confirmLabel:`Create`,onSubmit:re,onClose:()=>p(null)}),(0,y.jsx)(yf,{open:!!m,title:m?.title??``,message:m?.message??``,confirmLabel:m?.confirmLabel??`Confirm`,onConfirm:()=>{let e=m?.onConfirm;h(null),e?.()},onClose:()=>h(null)}),x.size>0&&(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,zIndex:30,margin:`10px 14px 0`,padding:`8px 14px`,borderRadius:6,background:`#f9e2af18`,border:`1px solid ${Om}55`,color:Om,fontSize:12,display:`flex`,alignItems:`center`,gap:8},children:[(0,y.jsx)(`span`,{style:{fontSize:14},children:`⚠`}),(0,y.jsxs)(`span`,{children:[x.size===1?`1 commit in your reflog is no longer reachable from any branch.`:`${x.size} commits in your reflog are no longer reachable from any branch.`,` `,`Select a dashed entry below to recover it.`]})]}),(0,y.jsxs)(`div`,{style:{width:T,height:E,position:`relative`},children:[(0,y.jsxs)(`div`,{style:{position:`absolute`,left:150-vm,top:16,color:`#585b70`,fontSize:11,whiteSpace:`nowrap`,userSelect:`none`},children:[e?.refName??`HEAD`,` time machine — every state HEAD has pointed to, newest first`]}),(0,y.jsxs)(`svg`,{width:T,height:E,style:{position:`absolute`,top:0,left:0,pointerEvents:`none`,overflow:`visible`},children:[g.slice(0,-1).map((e,t)=>{let n=S(_[t]),r=C(t);return(0,y.jsx)(`path`,{d:Mm(S(_[t+1]),C(t+1),n,r),stroke:Dm(_[t]),strokeWidth:2.25,fill:`none`,strokeLinecap:`round`,opacity:.85},`edge-${t}`)}),g.map((e,t)=>{let n=S(_[t]),a=C(t),o=Dm(_[t]),s=u===t||u===null&&e.sha===r,c=!e.isReachable;return(0,y.jsxs)(`g`,{onClick:n=>{n.stopPropagation(),d(t),i(e.sha)},style:{cursor:`pointer`,pointerEvents:`auto`},children:[(0,y.jsx)(`title`,{children:`${e.selector} — ${e.message}`}),s&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:vm*2.3,fill:o,opacity:.15}),c&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:17,fill:`none`,stroke:Om,strokeWidth:1.5,strokeDasharray:`4 3`,opacity:.9}),(0,y.jsx)(`circle`,{cx:n,cy:a,r:vm,fill:ym,stroke:o,strokeWidth:s?3:2.25}),t===0&&(0,y.jsx)(`circle`,{cx:n,cy:a,r:3,fill:o})]},`node-${t}`)})]}),g.map((e,t)=>{let n=C(t);return ee[t]?(0,y.jsx)(`div`,{style:{position:`absolute`,left:0,top:n-7,width:Sm,textAlign:`right`,color:`#585b70`,fontSize:11,whiteSpace:`nowrap`,pointerEvents:`none`,userSelect:`none`},children:ee[t]},`time-${t}`):null}),g.map((e,t)=>{let n=C(t),r=u===t,a=!e.isReachable,o=km[e.kind],s=Am.has(e.kind),c=jm[e.kind];return(0,y.jsxs)(`div`,{onClick:n=>{n.stopPropagation(),d(t),i(e.sha)},style:{position:`absolute`,left:w,top:n-10,cursor:`pointer`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,height:20,whiteSpace:`nowrap`},children:[(0,y.jsxs)(`span`,{title:c??e.message,style:{height:18,padding:`0 8px`,borderRadius:4,background:o+`20`,border:`1px solid ${o}55`,color:o,fontSize:10,fontWeight:700,lineHeight:`18px`,textTransform:`uppercase`,letterSpacing:.4},children:[s?`⚠ `:``,e.kind]}),a&&(0,y.jsx)(`span`,{title:`Not reachable from any branch — only the reflog still knows this commit`,style:{height:18,padding:`0 8px`,borderRadius:4,background:`#f9e2af20`,border:`1px solid ${Om}`,color:Om,fontSize:10,fontWeight:700,lineHeight:`18px`},children:`LOST`}),e.refNames.slice(0,3).map(e=>(0,y.jsx)(`span`,{style:{height:18,padding:`0 7px`,borderRadius:4,background:`#89b4fa18`,border:`1px solid #89b4fa55`,color:`#89b4fa`,fontSize:10,fontWeight:600,lineHeight:`18px`},children:e},e)),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:11,fontFamily:`monospace`},children:e.sha.slice(0,7)}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`,fontSize:12,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:360},children:e.subject})]}),r?(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:4},children:[a?(0,y.jsx)(cd,{label:`Recover branch`,tone:`success`,onClick:()=>D(e)}):(0,y.jsx)(ld,{label:`Branch here`,tone:`neutral`,size:`compact`,onClick:()=>D(e)}),(0,y.jsx)(ld,{label:`Checkout`,tone:`warning`,size:`compact`,onClick:()=>te(e)}),(0,y.jsx)(ld,{label:`Cherry-pick`,tone:`neutral`,size:`compact`,onClick:()=>ne(e)}),(0,y.jsx)(ld,{label:`Copy sha`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>ie(e)})]}):(0,y.jsx)(`div`,{style:{marginTop:4,color:`#6c7086`,fontSize:10,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:Tm-40},children:e.message})]},`row-${t}`)}),g.length>=n&&(0,y.jsx)(`div`,{style:{position:`absolute`,left:w,top:C(g.length)+4},children:(0,y.jsx)(ld,{label:t?`Loading…`:`Load older entries`,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:()=>{c()}})})]})]})}var Im=Object.defineProperty,Lm=e=>t=>{var n=e[t];if(n)return n();throw Error(`Module not found in bundle: `+t)},Q=(e,t)=>()=>(e&&(t=e(e=0)),t),$=(e,t)=>{for(var n in t)Im(e,n,{get:t[n],enumerable:!0})},Rm={};$(Rm,{default:()=>zm});var zm,Bm=Q(()=>{zm=[{type:`cmnt`,match:/(;|#).*/gm},{expand:`str`},{expand:`num`},{type:`num`,match:/\$[\da-fA-F]*\b/g},{type:`kwd`,match:/^[a-z]+\s+[a-z.]+\b/gm,sub:[{type:`func`,match:/^[a-z]+/g}]},{type:`kwd`,match:/^\t*[a-z][a-z\d]*\b/gm},{match:/%|\$/g,type:`oper`}]}),Vm={};$(Vm,{default:()=>Um});var Hm,Um,Wm=Q(()=>{Hm={type:`var`,match:/\$\w+|\${[^}]*}|\$\([^)]*\)/g},Um=[{sub:`todo`,match:/#.*/g},{type:`str`,match:/(["'])((?!\1)[^\r\n\\]|\\[^])*\1?/g,sub:[Hm]},{type:`oper`,match:/(?<=\s|^)\.*\/[a-z/_.-]+/gi},{type:`kwd`,match:/\s-[a-zA-Z]+|$<|[&|;]+|\b(unset|readonly|shift|export|if|fi|else|elif|while|do|done|for|until|case|esac|break|continue|exit|return|trap|wait|eval|exec|then|declare|enable|local|select|typeset|time|add|remove|install|update|delete)(?=\s|$)/g},{expand:`num`},{type:`func`,match:/(?<=(^|\||\&\&|\;)\s*)[a-z_.-]+(?=\s|$)/gim},{type:`bool`,match:/(?<=\s|^)(true|false)(?=\s|$)/g},{type:`oper`,match:/[=(){}<>!]+/g},{type:`var`,match:/(?<=\s|^)[\w_]+(?=\s*=)/g},Hm]}),Gm={};$(Gm,{default:()=>Km});var Km,qm=Q(()=>{Km=[{match:/[^\[\->+.<\]\s].*/g,sub:`todo`},{type:`func`,match:/\.+/g},{type:`kwd`,match:/[<>]+/g},{type:`oper`,match:/[+-]+/g}]}),Jm={};$(Jm,{default:()=>Ym});var Ym,Xm=Q(()=>{Ym=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/#\s*include (<.*>|".*")/g,sub:[{type:`str`,match:/(<|").*/g}]},{match:/asm\s*{[^}]*}/g,sub:[{type:`kwd`,match:/^asm/g},{match:/[^{}]*(?=}$)/g,sub:`asm`}]},{type:`kwd`,match:/\*|&|#[a-z]+\b|\b(asm|auto|double|int|struct|break|else|long|switch|case|enum|register|typedef|char|extern|return|union|const|float|short|unsigned|continue|for|signed|void|default|goto|sizeof|volatile|do|if|static|while)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Zm={};$(Zm,{default:()=>Qm});var Qm,$m=Q(()=>{Qm=[{match:/\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/@\w+\b|\b(and|not|only|or)\b|\b[a-z-]+(?=[^{}]*{)/g},{type:`var`,match:/\b[\w-]+(?=\s*:)|(::?|\.)[\w-]+(?=[^{}]*{)/g},{type:`func`,match:/#[\w-]+(?=[^{}]*{)/g},{type:`num`,match:/#[\da-f]{3,8}/g},{type:`num`,match:/\d+(\.\d+)?(cm|mm|in|px|pt|pc|em|ex|ch|rem|vm|vh|vmin|vmax|%)?/g,sub:[{type:`var`,match:/[a-z]+|%/g}]},{match:/url\([^)]*\)/g,sub:[{type:`func`,match:/url(?=\()/g},{type:`str`,match:/[^()]+/g}]},{type:`func`,match:/\b[a-zA-Z]\w*(?=\s*\()/g},{type:`num`,match:/\b[a-z-]+\b/g}]}),eh={};$(eh,{default:()=>th});var th,nh=Q(()=>{th=[{expand:`strDouble`},{type:`oper`,match:/,/g}]}),rh={};$(rh,{default:()=>ih});var ih,ah=Q(()=>{ih=[{type:`deleted`,match:/^[-<].*/gm},{type:`insert`,match:/^[+>].*/gm},{type:`kwd`,match:/!.*/gm},{type:`section`,match:/^@@.*@@$|^\d.*|^([*-+])\1\1.*/gm}]}),oh={};$(oh,{default:()=>sh});var sh,ch=Q(()=>{Wm(),sh=[{type:`kwd`,match:/^(FROM|RUN|CMD|LABEL|MAINTAINER|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)\b/gim},...Um]}),lh={};$(lh,{default:()=>uh});var uh,dh=Q(()=>{ah(),uh=[{match:/^#.*/gm,sub:`todo`},{expand:`str`},...ih,{type:`func`,match:/^(\$ )?git(\s.*)?$/gm},{type:`kwd`,match:/^commit \w+$/gm}]}),fh={};$(fh,{default:()=>ph});var ph,mh=Q(()=>{ph=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\*|&|\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`oper`,match:/[+\-*\/%&|^~=!<>.^-]+/g}]}),hh={};$(hh,{default:()=>xh,name:()=>vh,properties:()=>yh,xmlElement:()=>bh});var gh,_h,vh,yh,bh,xh,Sh=Q(()=>{gh=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�`,_h=gh+`\\-\\.0-9·̀-ͯ‿-⁀`,vh=`[${gh}][${_h}]*`,yh=`\\s*(\\s+${vh}\\s*(=\\s*([^"']\\S*|("|')(\\\\[^]|(?!\\4)[^])*\\4?)?)?\\s*)*`,bh={match:RegExp(`<[/!?]?${vh}${yh}[/!?]?>`,`g`),sub:[{type:`var`,match:RegExp(`^<[/!?]?${vh}`,`g`),sub:[{type:`oper`,match:/^<[\/!?]?/g}]},{type:`str`,match:/=\s*([^"']\S*|("|')(\\[^]|(?!\2)[^])*\2?)/g,sub:[{type:`oper`,match:/^=/g}]},{type:`oper`,match:/[\/!?]?>/g},{type:`class`,match:RegExp(vh,`g`)}]},xh=[{match:/<!--[^]*?-->/g,sub:`todo`},{type:`class`,match:/<!\[CDATA\[[\s\S]*?\]\]>/gi},bh,{type:`str`,match:RegExp(`<\\?${vh}([^?]|\\?[^?>])*\\?+>`,`g`),sub:[{type:`var`,match:RegExp(`^<\\?${vh}`,`g`),sub:[{type:`oper`,match:/^<\?/g}]},{type:`oper`,match:/\?+>$/g}]},{type:`var`,match:/&(#x?)?[\da-z]{1,8};/gi}]}),Ch={};$(Ch,{default:()=>wh});var wh,Th=Q(()=>{Sh(),wh=[{type:`class`,match:/<!DOCTYPE("[^"]*"|'[^']*'|[^"'>])*>/gi,sub:[{type:`str`,match:/"[^"]*"|'[^']*'/g},{type:`oper`,match:/^<!|>$/g},{type:`var`,match:/DOCTYPE/gi}]},{match:RegExp(`<style${yh}>[^]*?</style\\s*>`,`g`),sub:[{match:RegExp(`^<style${yh}>`,`g`),sub:bh.sub},{match:RegExp(`${bh.match}|[^]*(?=</style\\s*>$)`,`g`),sub:`css`},bh]},{match:RegExp(`<script${yh}>[^]*?<\/script\\s*>`,`g`),sub:[{match:RegExp(`^<script${yh}>`,`g`),sub:bh.sub},{match:RegExp(`${bh.match}|[^]*(?=<\/script\\s*>$)`,`g`),sub:`js`},bh]},...xh]}),Eh,Dh,Oh=Q(()=>{Eh=[[`bash`,[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],[`html`,[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<!DOCTYPE\s+html/g,500]],[`http`,[/^(GET|HEAD|POST|PUT|DELETE|PATCH|HTTP)\b/g,500]],[`js`,[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|document|window)\b/g,10]],[`ts`,[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|document|window|implements|interface|namespace)\b/g,10]],[`py`,[/\b(def|print|await|async|class|and|or|lambda|import|from|self|asyncio|pass|True|False|None|__init__)\b/g,10]],[`sql`,[/\b(SELECT|INSERT|FROM)\b/g,50]],[`pl`,[/#!(\/usr)?\/bin\/perl/g,500],[/\b(use|print)\b|\$/g,10]],[`lua`,[/#!(\/usr)?\/bin\/lua/g,500]],[`make`,[/\b(ifneq|endif|if|elif|then|fi|echo|.PHONY|^[a-z]+ ?:$)\b|\$/gm,10]],[`uri`,[/https?:|mailto:|tel:|ftp:/g,30]],[`css`,[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],[`diff`,[/^[+><-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],[`md`,[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],[`docker`,[/^(FROM|ENTRYPOINT|RUN)/gm,500]],[`xml`,[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],[`c`,[/#include\b|\bprintf\s+\(/g,100]],[`rs`,[/^\s+(use|fn|mut|match)\b/gm,100]],[`go`,[/\b(func|fmt|package)\b/g,100]],[`java`,[/^import\s+java/gm,500]],[`asm`,[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],[`css`,[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],[`json`,[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],[`yaml`,[/^(\s+)?[a-z][a-z0-9]*:/gim,10]]],Dh=e=>Eh.map(([t,...n])=>[t,n.reduce((t,[n,r])=>t+[...e.matchAll(n)].length*r,0)]).filter(([e,t])=>t>20).sort((e,t)=>t[1]-e[1])[0]?.[0]||`plain`}),kh={};$(kh,{default:()=>Ah});var Ah,jh=Q(()=>{Oh(),Ah=[{type:`kwd`,match:/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\b/gm},{expand:`str`},{type:`section`,match:/\bHTTP\/[\d.]+\b/g},{expand:`num`},{type:`oper`,match:/[,;:=]/g},{type:`var`,match:/[a-zA-Z][\w-]*(?=:)/g},{match:/\n\n[^]*/g,sub:Dh}]}),Mh={};$(Mh,{default:()=>Nh});var Nh,Ph=Q(()=>{Nh=[{match:/(^[ \f\t\v]*)[#;].*/gm,sub:`todo`},{type:`var`,match:/.*(?==)/g},{type:`section`,match:/^\s*\[.+\]\s*$/gm},{type:`oper`,match:/=/g},{type:`str`,match:/.*/g}]}),Fh={};$(Fh,{default:()=>Ih});var Ih,Lh=Q(()=>{Ih=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\b(abstract|assert|boolean|break|byte|case|catch|char|class|continue|const|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|package|private|protected|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*\()/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Rh={};$(Rh,{default:()=>zh});var zh,Bh=Q(()=>{zh=[{match:/(("|')([^\r\n\\]|\\[^])*?\2|[a-zA-Z]\w*)(?=\s*:)/g},{match:/\/\*\*((?!\*\/)[^])*(\*\/)?/g,sub:`jsdoc`},{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{match:/`((?!`)[^]|\\[^])*`?/g,sub:`js_template_literals`},{type:`kwd`,match:/=>|\b(this|set|get|as|async|await|break|case|catch|class|const|constructor|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|var|of|new|package|private|protected|public|return|static|super|switch|throw|throws|try|typeof|void|while|with|yield)\b/g},{match:/\/((?!\/)[^\r\n\\]|\\.)+\/[dgimsuy]*/g,sub:`regex`},{expand:`num`},{type:`num`,match:/\b(NaN|null|undefined|[A-Z][A-Z_]*)\b/g},{type:`bool`,match:/\b(true|false)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`func`,match:/[a-zA-Z$_][\w$_]*(?=\s*((\?\.)?\s*\(|=\s*(\(?[\w,{}\[\])]+\)? =>|function\b)))/g}]}),Vh={};$(Vh,{default:()=>Hh,type:()=>Uh});var Hh,Uh,Wh=Q(()=>{Hh=[{match:new class{exec(e){let t=this.lastIndex,n,r=n=>{for(;++t<e.length-2;)if(e[t]==`{`)r();else if(e[t]==`}`)return};for(;t<e.length;++t)if(e[t-1]!=`\\`&&e[t]==`$`&&e[t+1]==`{`)return n=t++,r(t),this.lastIndex=t+1,{index:n,0:e.slice(n,t+1)};return null}},sub:[{type:`kwd`,match:/^\${|}$/g},{match:/(?!^\$|{)[^]+(?=}$)/g,sub:`js`}]}],Uh=`str`}),Gh={};$(Gh,{default:()=>Kh,type:()=>qh});var Kh,qh,Jh=Q(()=>{Kh=[{type:`err`,match:/\b(TODO|FIXME|DEBUG|OPTIMIZE|WARNING|XXX|BUG)\b/g},{type:`class`,match:/\bIDEA\b/g},{type:`insert`,match:/\b(CHANGED|FIX|CHANGE)\b/g},{type:`oper`,match:/\bQUESTION\b/g}],qh=`cmnt`}),Yh={};$(Yh,{default:()=>Xh,type:()=>Zh});var Xh,Zh,Qh=Q(()=>{Jh(),Xh=[{type:`kwd`,match:/@\w+/g},{type:`class`,match:/{[\w\s|<>,.@\[\]]+}/g},{type:`var`,match:/\[[\w\s="']+\]/g},...Kh],Zh=`cmnt`}),$h={};$($h,{default:()=>eg});var eg,tg=Q(()=>{eg=[{type:`var`,match:/(("|')([^\r\n\\]|\\[^])*?\2|[a-zA-Z]\w*)(?=\s*:)/g},{expand:`str`},{expand:`num`},{type:`num`,match:/\bnull\b/g},{type:`bool`,match:/\b(true|false)\b/g}]}),ng={};$(ng,{default:()=>rg});var rg,ig=Q(()=>{Oh(),rg=[{type:`cmnt`,match:/^>.*|(=|-)\1+/gm},{type:`class`,match:/\*\*.*?\*\*/g},{match:/^(`{3,})(.*)\n[^]*?^\1[ \t]*$/gm,sub:e=>({type:`kwd`,sub:[{match:/\n[^]*(?=```)/g,sub:e.split(`
600
+ `)[0].slice(3)||Dh(e)}]})},{type:`str`,match:/`[^`]*`/g},{type:`var`,match:/~~.*?~~/g},{type:`kwd`,match:/\b_\S([^\n]*?\S)?_\b|\*\S([^\n]*?\S)?\*/g},{type:`kwd`,match:/^\s*(\*|\d+\.)\s/gm},{type:`func`,match:/\[[^\]]*]\([^)]*\)|<[^>]*>/g,sub:[{type:`oper`,match:/^\[[^\]]*]/g}]}]}),ag={};$(ag,{default:()=>og});var og,sg=Q(()=>{ig(),Oh(),og=[{type:`insert`,match:/(leanpub-start-insert)((?!leanpub-end-insert)[^])*(leanpub-end-insert)?/g,sub:[{type:`insert`,match:/leanpub-(start|end)-insert/g},{match:/(?!leanpub-start-insert)((?!leanpub-end-insert)[^])*/g,sub:Dh}]},{type:`deleted`,match:/(leanpub-start-delete)((?!leanpub-end-delete)[^])*(leanpub-end-delete)?/g,sub:[{type:`deleted`,match:/leanpub-(start|end)-delete/g},{match:/(?!leanpub-start-delete)((?!leanpub-end-delete)[^])*/g,sub:Dh}]},...rg]}),cg={};$(cg,{default:()=>lg});var lg,ug=Q(()=>{lg=[{type:`cmnt`,match:/^#.*/gm},{expand:`strDouble`},{expand:`num`},{type:`err`,match:/\b(err(or)?|[a-z_-]*exception|warn|warning|failed|ko|invalid|not ?found|alert|fatal)\b/gi},{type:`num`,match:/\b(null|undefined)\b/gi},{type:`bool`,match:/\b(false|true|yes|no)\b/gi},{type:`oper`,match:/\.|,/g}]}),dg={};$(dg,{default:()=>fg});var fg,pg=Q(()=>{fg=[{match:/^#!.*|--(\[(=*)\[[^]*?--\]\2\]|.*)/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/\b(and|break|do|else|elseif|end|for|function|if|in|local|not|or|repeat|return|then|until|while)\b/g},{type:`bool`,match:/\b(true|false|nil)\b/g},{type:`oper`,match:/[+*/%^#=~<>:,.-]+/g},{expand:`num`},{type:`func`,match:/[a-z_]+(?=\s*[({])/g}]}),mg={};$(mg,{default:()=>hg});var hg,gg=Q(()=>{hg=[{match:/^\s*#.*/gm,sub:`todo`},{expand:`str`},{type:`oper`,match:/[${}()]+/g},{type:`class`,match:/.PHONY:/gm},{type:`section`,match:/^[\w.]+:/gm},{type:`kwd`,match:/\b(ifneq|endif)\b/g},{expand:`num`},{type:`var`,match:/[A-Z_]+(?=\s*=)/g},{match:/^.*$/gm,sub:`bash`}]}),_g={};$(_g,{default:()=>vg});var vg,yg=Q(()=>{vg=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/(["'])(\\[^]|(?!\1)[^])*\1?/g},{expand:`num`},{type:`kwd`,match:/\b(any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while|not|and|or|xor)\b/g},{type:`oper`,match:/[-+*/%~!&<>|=?,]+/g},{type:`func`,match:/[a-z_]+(?=\s*\()/g}]}),bg={};$(bg,{default:()=>xg});var xg,Sg=Q(()=>{xg=[{expand:`strDouble`}]}),Cg={};$(Cg,{default:()=>wg});var wg,Tg=Q(()=>{wg=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/f("""|''')(\\[^]|(?!\1)[^])*\1?|f("|')(\\[^]|(?!\3).)*\3?/gi,sub:[{type:`var`,match:/{[^{}]*}/g,sub:[{match:/(?!^{)[^]*(?=}$)/g,sub:`py`}]}]},{match:/("""|''')(\\[^]|(?!\1)[^])*\1?/g,sub:`todo`},{expand:`str`},{type:`kwd`,match:/\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b/g},{type:`bool`,match:/\b(False|True|None)\b/g},{expand:`num`},{type:`func`,match:/[a-z_]\w*(?=\s*\()/gi},{type:`oper`,match:/[-/*+<>,=!&|^%]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g}]}),Eg={};$(Eg,{default:()=>Dg,type:()=>Og});var Dg,Og,kg=Q(()=>{Dg=[{match:/^(?!\/).*/gm,sub:`todo`},{type:`num`,match:/\[((?!\])[^\\]|\\.)*\]/g},{type:`kwd`,match:/\||\^|\$|\\.|\w+($|\r|\n)/g},{type:`var`,match:/\*|\+|\{\d+,\d+\}/g}],Og=`oper`}),Ag={};$(Ag,{default:()=>jg});var jg,Mg=Q(()=>{jg=[{match:/\/\/.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{expand:`num`},{type:`kwd`,match:/\b(as|break|const|continue|crate|else|enum|extern|false|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|true|type|unsafe|use|where|while|async|await|dyn|abstract|become|box|do|final|macro|override|priv|typeof|unsized|virtual|yield|try)\b/g},{type:`oper`,match:/[/*+:?&|%^~=!,<>.^-]+/g},{type:`class`,match:/\b[A-Z][\w_]*\b/g},{type:`func`,match:/[a-zA-Z_][\w_]*(?=\s*!?\s*\()/g}]}),Ng={};$(Ng,{default:()=>Pg});var Pg,Fg=Q(()=>{Pg=[{match:/--.*\n?|\/\*((?!\*\/)[^])*(\*\/)?/g,sub:`todo`},{expand:`str`},{type:`func`,match:/\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/g},{type:`kwd`,match:/\b(ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|kwdS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:S|ING)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/g},{type:`num`,match:/\.?\d[\d.oxa-fA-F-]*|\bNULL\b/g},{type:`bool`,match:/\b(TRUE|FALSE)\b/g},{type:`oper`,match:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|IN|ILIKE|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/g},{type:`var`,match:/@\S+/g}]}),Ig={};$(Ig,{default:()=>Lg});var Lg,Rg=Q(()=>{Lg=[{match:/#.*/g,sub:`todo`},{type:`str`,match:/("""|''')((?!\1)[^]|\\[^])*\1?/g},{expand:`str`},{type:`section`,match:/^\[.+\]\s*$/gm},{type:`num`,match:/\b(inf|nan)\b|\d[\d:ZT.-]*/g},{expand:`num`},{type:`bool`,match:/\b(true|false)\b/g},{type:`oper`,match:/[+,.=-]/g},{type:`var`,match:/\w+(?= \=)/g}]}),zg={};$(zg,{default:()=>Bg});var Bg,Vg=Q(()=>{Bh(),Bg=[{type:`type`,match:/:\s*(any|void|number|boolean|string|object|never|enum)\b/g},{type:`kwd`,match:/\b(type|namespace|typedef|interface|public|private|protected|implements|declare|abstract|readonly)\b/g},...zh]}),Hg={};$(Hg,{default:()=>Ug});var Ug,Wg=Q(()=>{Ug=[{match:/^#.*/gm,sub:`todo`},{type:`class`,match:/^\w+(?=:?)/gm},{type:`num`,match:/:\d+/g},{type:`oper`,match:/[:/&?]|\w+=/g},{type:`func`,match:/[.\w]+@|#[\w]+$/gm},{type:`var`,match:/\w+\.\w+(\.\w+)*/g}]}),Gg={};$(Gg,{default:()=>Kg});var Kg,qg=Q(()=>{Kg=[{match:/#.*/g,sub:`todo`},{expand:`str`},{type:`str`,match:/(>|\|)\r?\n((\s[^\n]*)?(\r?\n|$))*/g},{type:`type`,match:/!![a-z]+/g},{type:`bool`,match:/\b(Yes|No)\b/g},{type:`oper`,match:/[+:-]/g},{expand:`num`},{type:`var`,match:/[a-zA-Z]\w*(?=:)/g}]}),Jg={num:{type:`num`,match:/(\.e?|\b)\d(e-|[\d.oxa-fA-F_])*(\.|\b)/g},str:{type:`str`,match:/(["'])(\\[^]|(?!\1)[^\r\n\\])*\1?/g},strDouble:{type:`str`,match:/"((?!")[^\r\n\\]|\\[^])*"?/g}},Yg=Lm({"./languages/asm.js":()=>Promise.resolve().then(()=>(Bm(),Rm)),"./languages/bash.js":()=>Promise.resolve().then(()=>(Wm(),Vm)),"./languages/bf.js":()=>Promise.resolve().then(()=>(qm(),Gm)),"./languages/c.js":()=>Promise.resolve().then(()=>(Xm(),Jm)),"./languages/css.js":()=>Promise.resolve().then(()=>($m(),Zm)),"./languages/csv.js":()=>Promise.resolve().then(()=>(nh(),eh)),"./languages/diff.js":()=>Promise.resolve().then(()=>(ah(),rh)),"./languages/docker.js":()=>Promise.resolve().then(()=>(ch(),oh)),"./languages/git.js":()=>Promise.resolve().then(()=>(dh(),lh)),"./languages/go.js":()=>Promise.resolve().then(()=>(mh(),fh)),"./languages/html.js":()=>Promise.resolve().then(()=>(Th(),Ch)),"./languages/http.js":()=>Promise.resolve().then(()=>(jh(),kh)),"./languages/ini.js":()=>Promise.resolve().then(()=>(Ph(),Mh)),"./languages/java.js":()=>Promise.resolve().then(()=>(Lh(),Fh)),"./languages/js.js":()=>Promise.resolve().then(()=>(Bh(),Rh)),"./languages/js_template_literals.js":()=>Promise.resolve().then(()=>(Wh(),Vh)),"./languages/jsdoc.js":()=>Promise.resolve().then(()=>(Qh(),Yh)),"./languages/json.js":()=>Promise.resolve().then(()=>(tg(),$h)),"./languages/leanpub-md.js":()=>Promise.resolve().then(()=>(sg(),ag)),"./languages/log.js":()=>Promise.resolve().then(()=>(ug(),cg)),"./languages/lua.js":()=>Promise.resolve().then(()=>(pg(),dg)),"./languages/make.js":()=>Promise.resolve().then(()=>(gg(),mg)),"./languages/md.js":()=>Promise.resolve().then(()=>(ig(),ng)),"./languages/pl.js":()=>Promise.resolve().then(()=>(yg(),_g)),"./languages/plain.js":()=>Promise.resolve().then(()=>(Sg(),bg)),"./languages/py.js":()=>Promise.resolve().then(()=>(Tg(),Cg)),"./languages/regex.js":()=>Promise.resolve().then(()=>(kg(),Eg)),"./languages/rs.js":()=>Promise.resolve().then(()=>(Mg(),Ag)),"./languages/sql.js":()=>Promise.resolve().then(()=>(Fg(),Ng)),"./languages/todo.js":()=>Promise.resolve().then(()=>(Jh(),Gh)),"./languages/toml.js":()=>Promise.resolve().then(()=>(Rg(),Ig)),"./languages/ts.js":()=>Promise.resolve().then(()=>(Vg(),zg)),"./languages/uri.js":()=>Promise.resolve().then(()=>(Wg(),Hg)),"./languages/xml.js":()=>Promise.resolve().then(()=>(Sh(),hh)),"./languages/yaml.js":()=>Promise.resolve().then(()=>(qg(),Gg))}),Xg={},Zg=(e=``)=>e.replaceAll(`&`,`&#38;`).replaceAll?.(`<`,`&lt;`).replaceAll?.(`>`,`&gt;`),Qg=(e,t)=>t?`<span class="shj-syn-${t}">${e}</span>`:e;async function $g(e,t,n){try{let r,i,a={},o,s=[],c=0,l=typeof t==`string`?await(Xg[t]??(Xg[t]=Yg(`./languages/${t}.js`))):t,u=[...typeof t==`string`?l.default:t.sub];for(;c<e.length;){for(a.index=null,r=u.length;r-->0;){if(i=u[r].expand?Jg[u[r].expand]:u[r],s[r]===void 0||s[r].match.index<c){if(i.match.lastIndex=c,o=i.match.exec(e),o===null){u.splice(r,1),s.splice(r,1);continue}s[r]={match:o,lastIndex:i.match.lastIndex}}s[r].match[0]&&(s[r].match.index<=a.index||a.index===null)&&(a={part:i,index:s[r].match.index,match:s[r].match[0],end:s[r].lastIndex})}if(a.index===null)break;n(e.slice(c,a.index),l.type),c=a.end,a.part.sub?await $g(a.match,typeof a.part.sub==`string`?a.part.sub:typeof a.part.sub==`function`?a.part.sub(a.match):a.part,n):n(a.match,a.part.type)}n(e.slice(c,e.length),l.type)}catch{n(e)}}async function e_(e,t,n=!0,r={}){let i=``;return await $g(e,t,(e,t)=>i+=Qg(Zg(e),t)),n?`<div><div class="shj-numbers">${`<div></div>`.repeat(!r.hideLineNumbers&&e.split(`
601
+ `).length)}</div><div>${i}</div></div>`:i}var t_=5e4,n_={ts:`ts`,tsx:`ts`,mts:`ts`,cts:`ts`,js:`js`,jsx:`js`,mjs:`js`,cjs:`js`,py:`py`,rs:`rs`,go:`go`,java:`java`,lua:`lua`,pl:`pl`,c:`c`,h:`c`,cpp:`c`,cc:`c`,hpp:`c`,css:`css`,scss:`css`,html:`html`,htm:`html`,xml:`xml`,svg:`xml`,json:`json`,md:`md`,markdown:`md`,yml:`yaml`,yaml:`yaml`,toml:`toml`,ini:`ini`,sh:`bash`,bash:`bash`,zsh:`bash`,sql:`sql`,dockerfile:`docker`,makefile:`make`};function r_(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===`dockerfile`?`docker`:t===`makefile`?`make`:n_[t.slice(t.lastIndexOf(`.`)+1)]??`plain`}var i_=`
602
602
  .file-diff .shj-syn-cmnt { color: #6c7086; font-style: italic; }
603
603
  .file-diff .shj-syn-kwd { color: #cba6f7; }
604
604
  .file-diff .shj-syn-num { color: #fab387; }
@@ -611,5 +611,5 @@ Error generating stack: `+e.message+`
611
611
  .file-diff .shj-syn-var { color: #cdd6f4; }
612
612
  .file-diff .shj-syn-esc { color: #f5c2e7; }
613
613
  .file-diff .shj-syn-err { color: #f38ba8; }
614
- `;function i_(e){let t=[],n=!1;for(let r of e.split(`
615
- `)){if(r.startsWith(`@@`)){n=!0,t.push({kind:`hunk`,content:r,marker:``});continue}n&&(r.startsWith(`+`)?t.push({kind:`add`,content:r.slice(1),marker:`+`}):r.startsWith(`-`)?t.push({kind:`del`,content:r.slice(1),marker:`-`}):r.startsWith(` `)||r===``?t.push({kind:`ctx`,content:r.slice(1),marker:` `}):r.startsWith(`\\`)&&t.push({kind:`ctx`,content:r,marker:``}))}return t}var a_={add:`#a6e3a114`,del:`#f38ba814`,hunk:`transparent`,ctx:`transparent`},o_={add:`#a6e3a1`,del:`#f38ba8`,hunk:`#89b4fa`,ctx:`#45475a`};function s_({entry:e,path:t}){let n=(0,b.useMemo)(()=>e.patchText?i_(e.patchText):[],[e.patchText]),r=(0,b.useMemo)(()=>n_(t),[t]),i=r!==`plain`&&n.length<=e_,[a,o]=(0,b.useState)(null);return(0,b.useEffect)(()=>{if(o(null),!i||n.length===0)return;let e=!1;return Promise.all(n.map(e=>e.kind===`hunk`||e.content.length===0?Promise.resolve(null):$g(e.content,r,!1).catch(()=>null))).then(t=>{e||o(t)}),()=>{e=!0}},[n,r,i]),e.loading?(0,y.jsx)(l_,{text:`Loading diff...`}):e.error?(0,y.jsx)(l_,{text:e.error,color:`#f38ba8`}):e.imageDiff?(0,y.jsx)(c_,{imageDiff:e.imageDiff,path:t}):e.isBinary?(0,y.jsx)(l_,{text:`Binary file`}):n.length===0?(0,y.jsx)(l_,{text:`No textual changes`}):(0,y.jsxs)(`div`,{className:`file-diff`,style:{margin:`2px 0 6px 24px`,border:`1px solid #313244`,borderRadius:6,background:`#11111b`,overflow:`auto`,maxHeight:420,fontSize:11,fontFamily:`monospace`,lineHeight:1.5},children:[(0,y.jsx)(`style`,{children:r_}),(0,y.jsx)(`div`,{style:{minWidth:`fit-content`},children:n.map((e,t)=>{let n=a?.[t]??null;return(0,y.jsxs)(`div`,{style:{display:`flex`,background:a_[e.kind],color:e.kind===`hunk`?`#89b4fa`:`#cdd6f4`,whiteSpace:`pre`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:16,textAlign:`center`,color:o_[e.kind],userSelect:`none`},children:e.marker}),n===null?(0,y.jsx)(`span`,{children:e.content}):(0,y.jsx)(`span`,{dangerouslySetInnerHTML:{__html:n}})]},t)})})]})}function c_({imageDiff:e,path:t}){let n=[];return e.before&&n.push({label:e.after?`Before`:`Deleted image`,preview:e.before}),e.after&&n.push({label:e.before?`After`:`Added image`,preview:e.after}),(0,y.jsx)(`div`,{style:{margin:`2px 0 6px 24px`,padding:10,display:`flex`,flexWrap:`wrap`,gap:10,border:`1px solid #313244`,borderRadius:6,background:`#11111b`,overflow:`auto`,maxHeight:520},children:n.map(({label:e,preview:n})=>(0,y.jsxs)(`figure`,{style:{flex:`1 1 220px`,minWidth:0,margin:0,display:`flex`,flexDirection:`column`,gap:6},children:[(0,y.jsx)(`figcaption`,{style:{color:`#a6adc8`,fontSize:10,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`},children:e}),(0,y.jsx)(`div`,{style:{minHeight:80,padding:8,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:4,backgroundColor:`#181825`,backgroundImage:[`linear-gradient(45deg, #242435 25%, transparent 25%)`,`linear-gradient(-45deg, #242435 25%, transparent 25%)`,`linear-gradient(45deg, transparent 75%, #242435 75%)`,`linear-gradient(-45deg, transparent 75%, #242435 75%)`].join(`,`),backgroundPosition:`0 0, 0 8px, 8px -8px, -8px 0`,backgroundSize:`16px 16px`},children:(0,y.jsx)(`img`,{src:n.dataUrl,alt:`${t} ${e.toLowerCase()}`,draggable:!1,style:{display:`block`,maxWidth:`100%`,maxHeight:410,objectFit:`contain`}})})]},e))})}function l_({text:e,color:t}){return(0,y.jsx)(`div`,{style:{margin:`2px 0 6px 24px`,padding:`6px 10px`,fontSize:11,color:t??`#6c7086`,border:`1px solid #313244`,borderRadius:6,background:`#11111b`},children:e})}var u_={success:`#a6e3a1`,failure:`#f38ba8`,error:`#f38ba8`,pending:`#f9e2af`,neutral:`#6c7086`},d_={success:`✓`,failure:`✗`,error:`✗`,pending:`◔`,neutral:`–`},f_={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`},p_={A:`A`,M:`M`,D:`D`,R:`R`,C:`C`,T:`T`,U:`U`};function m_(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function h_({commit:e,diff:t,branchName:n,prs:r,authorAvatarUrl:i,ciState:a,ciRuns:o,githubUrl:s,onCheckout:c,onNavigate:l}){return e?(0,y.jsxs)(`div`,{style:{width:400,flexShrink:0,height:`100%`,background:`#181825`,borderLeft:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{padding:`14px 16px 12px`,borderBottom:`1px solid #313244`,flexShrink:0},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:8},children:[(0,y.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:11,color:`#89b4fa`,letterSpacing:`0.04em`},children:e.sha.slice(0,12)}),l&&(0,y.jsx)(x_,{label:`Navigate to`,onClick:()=>l(e.sha)}),c&&(0,y.jsx)(x_,{label:`Checkout`,onClick:()=>c(e.sha)})]}),(0,y.jsx)(`p`,{style:{fontSize:14,fontWeight:600,color:`#cdd6f4`,lineHeight:1.4,margin:0,marginBottom:10},children:e.subject}),(0,y.jsx)(g_,{label:`Author`,value:`${e.authorName} <${e.authorEmail}>`,leading:(0,y.jsx)(__,{name:e.authorName,url:i})}),(0,y.jsx)(g_,{label:`Date`,value:m_(e.authorUnix)}),n&&(0,y.jsx)(g_,{label:`Branch`,value:n}),(e.committerName!==e.authorName||e.committerUnix!==e.authorUnix)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(g_,{label:`Committer`,value:`${e.committerName} <${e.committerEmail}>`}),(0,y.jsx)(g_,{label:`Commit date`,value:m_(e.committerUnix)})]}),e.parents.length>0&&(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,minWidth:76,flexShrink:0},children:`Parents`}),(0,y.jsx)(`span`,{style:{display:`flex`,gap:4,flexWrap:`wrap`},children:e.parents.map(e=>(0,y.jsx)(`span`,{onClick:()=>l?.(e),style:{fontFamily:`monospace`,color:`#89b4fa`,cursor:l?`pointer`:`default`,textDecoration:l?`underline`:`none`},children:e.slice(0,8)},e))})]}),e.parents.length>1&&(0,y.jsxs)(`div`,{style:{fontSize:12,color:`#a6adc8`,marginBottom:3},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`},children:`Merge: `}),`merged into`,` `,(0,y.jsx)(`span`,{onClick:()=>l?.(e.parents[0]),style:{color:`#89b4fa`,cursor:`pointer`,textDecoration:`underline`,fontFamily:`monospace`},children:e.parents[0].slice(0,8)}),` `,`from`,` `,(0,y.jsx)(`span`,{onClick:()=>l?.(e.parents[1]),style:{color:`#a6e3a1`,cursor:`pointer`,textDecoration:`underline`,fontFamily:`monospace`},children:e.parents[1].slice(0,8)})]}),r&&r.length>0&&(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:4,marginTop:6,marginBottom:4},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:12,marginRight:4},children:r.length===1?`Pull request`:`Pull requests`}),r.map(e=>(0,y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open pull request #${e.number}: ${e.title}`,title:`Open pull request #${e.number}: ${e.title}`,style:{color:e.mergedAt?`#a6e3a1`:`#89b4fa`,fontSize:12,textDecoration:`underline`},children:[`PR #`,e.number,` ↗`,e.title?`: ${e.title.length>40?`${e.title.slice(0,40)}…`:e.title}`:``]},e.number))]}),s&&e.isPushed&&(0,y.jsxs)(`div`,{style:{marginTop:4,marginBottom:4,display:`flex`,gap:12},children:[(0,y.jsx)(`a`,{href:`${s}/commit/${e.sha}`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`#6c7086`,textDecoration:`underline`},children:`View on GitHub`}),(0,y.jsx)(`a`,{href:`${s}/commit/${e.sha}/checks`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`#6c7086`,textDecoration:`underline`},children:`CI runs`})]}),a===`loading`&&(0,y.jsx)(`div`,{style:{marginTop:8},children:(0,y.jsx)(b_,{})}),o&&o.length>0&&(0,y.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexDirection:`column`,gap:3},children:o.map((e,t)=>(0,y.jsx)(y_,{run:e},`${e.name}-${t}`))}),e.refs.length>0&&(0,y.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexWrap:`wrap`,gap:4},children:e.refs.map(e=>(0,y.jsx)(`span`,{style:{background:`#313244`,color:`#89b4fa`,fontSize:11,borderRadius:4,padding:`2px 6px`,fontWeight:500},children:e},e))})]}),e.body&&(0,y.jsx)(`div`,{style:{padding:`10px 16px`,borderBottom:`1px solid #313244`,flexShrink:0,maxHeight:200,overflowY:`auto`},children:(0,y.jsx)(`pre`,{style:{fontSize:12,color:`#a6adc8`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,fontFamily:`inherit`,margin:0,lineHeight:1.5},children:e.body})}),(0,y.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:t&&t.changedPaths.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`8px 16px 4px`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,color:`#6c7086`,textTransform:`uppercase`,position:`sticky`,top:0,background:`#181825`},children:[(0,y.jsxs)(`span`,{children:[`Changed files (`,t.changedPaths.length,`)`]}),(0,y.jsxs)(`span`,{style:{display:`flex`,gap:10,fontSize:10,letterSpacing:`0.04em`},children:[(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`+`,t.additions]}),(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`-`,t.deletions]})]})]}),t.changedPaths.map((t,n)=>(0,y.jsx)(v_,{sha:e.sha,cp:t},`${t.status}:${t.oldPath??``}:${t.path}:${n}`))]}):t?(0,y.jsx)(`div`,{style:{padding:`16px`,fontSize:13,color:`#45475a`},children:`No changed files`}):null})]}):null}function g_({label:e,value:t,mono:n,leading:r}){return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:r?`center`:void 0,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,minWidth:76,flexShrink:0},children:e}),(0,y.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:7,minWidth:0,color:`#a6adc8`,fontFamily:n?`monospace`:`inherit`},children:[r,(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t})]})]})}function __({name:e,url:t}){let[n,r]=(0,b.useState)(!1);(0,b.useEffect)(()=>r(!1),[t]);let i={width:24,height:24,borderRadius:`50%`,flexShrink:0};return t&&!n?(0,y.jsx)(`img`,{src:t,alt:`${e} avatar`,width:24,height:24,onError:()=>r(!0),style:{...i,display:`block`,objectFit:`cover`,background:`#313244`}}):(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{...i,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`#313244`,color:`#cdd6f4`,fontSize:11,fontWeight:700},children:e.trim().charAt(0).toUpperCase()||`?`})}function v_({sha:e,cp:t}){let[n,r]=(0,b.useState)(!1),i=R(e=>e.loadCommitFileDiff),a=R(n=>n.commitFileDiffs[br(e,t.path)]),o=f_[t.status]??`#cdd6f4`,s=p_[t.status]??t.status,c=t.oldPath?`${t.oldPath} → ${t.path}`:t.path;return(0,b.useEffect)(()=>{n&&!a&&i(e,t)},[n,a,e,t,i]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`5px 16px`,fontSize:12,color:`#cdd6f4`,borderBottom:`1px solid #1e1e2e`,cursor:`pointer`},onClick:()=>{let a=!n;r(a),a&&i(e,t)},onMouseEnter:e=>{e.currentTarget.style.background=`#1e1e2e`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:10,fontSize:9,color:`#6c7086`,userSelect:`none`},children:n?`▼`:`▶`}),(0,y.jsx)(`span`,{style:{flexShrink:0,width:18,height:18,borderRadius:3,background:o+`33`,color:o,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:10,fontWeight:700},children:s}),(0,y.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`monospace`,fontSize:12,color:`#a6adc8`},title:c,children:c})]}),n&&a&&(0,y.jsx)(s_,{entry:a,path:t.path})]})}function y_({run:e}){let t=u_[e.state],n=d_[e.state],r=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{style:{color:t,fontSize:12,fontWeight:700,width:12,textAlign:`center`,flexShrink:0},children:n}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`,fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flexShrink:0,maxWidth:`55%`},children:e.name}),e.description&&(0,y.jsx)(`span`,{style:{color:`#6c7086`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1},children:e.description})]}),i={display:`flex`,alignItems:`center`,gap:8,fontSize:12,padding:`2px 0`,textDecoration:`none`};return e.url?(0,y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,style:i,title:e.description??e.name,children:r}):(0,y.jsx)(`div`,{style:i,title:e.description??e.name,children:r})}function b_(){return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:12,padding:`2px 0`,color:`#6c7086`},title:`Loading CI status`,children:[(0,y.jsx)(`span`,{style:{width:10,height:10,borderRadius:`50%`,border:`2px solid #45475a`,borderTopColor:`#89b4fa`,flexShrink:0,animation:`ci-spin 0.8s linear infinite`}}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`,fontWeight:500},children:`CI status`}),(0,y.jsx)(`span`,{children:`Loading...`}),(0,y.jsx)(`style`,{children:`@keyframes ci-spin { to { transform: rotate(360deg); } }`})]})}function x_({label:e,onClick:t}){return(0,y.jsx)(`button`,{onClick:t,title:e,style:{background:`#313244`,border:`1px solid #45475a`,borderRadius:4,color:`#cdd6f4`,fontSize:11,padding:`2px 8px`,cursor:`pointer`,fontFamily:`inherit`},onMouseEnter:e=>{e.currentTarget.style.background=`#45475a`},onMouseLeave:e=>{e.currentTarget.style.background=`#313244`},children:e})}var S_={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`,"?":`#94e2d5`},C_={A:`Added`,M:`Modified`,D:`Deleted`,R:`Renamed`,C:`Copied`,T:`Type changed`,U:`Conflicted`,"?":`Untracked`};function w_({file:e,area:t,actionLabel:n,onAction:r,onDiscard:i}){let[a,o]=(0,b.useState)(!1),s=R(e=>e.loadWorktreeFileDiff),c=R(n=>n.worktreeFileDiffs[yr(t,e.path)]),l=e.path.lastIndexOf(`/`),u=l>=0?e.path.slice(0,l+1):``,d=l>=0?e.path.slice(l+1):e.path,f=S_[e.status]??`#cdd6f4`;return(0,b.useEffect)(()=>{a&&!c&&s(e,t)},[a,c,e,t,s]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`4px 6px`,borderRadius:6,cursor:`pointer`},onClick:()=>{let n=!a;o(n),n&&s(e,t)},onMouseEnter:e=>{e.currentTarget.style.background=`#1e1e2e`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:10,fontSize:9,color:`#6c7086`,userSelect:`none`},children:a?`▼`:`▶`}),(0,y.jsx)(`span`,{title:C_[e.status]??e.status,style:{flexShrink:0,width:16,height:16,borderRadius:3,background:f+`22`,color:f,fontSize:10,fontWeight:700,fontFamily:`monospace`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:e.status}),(0,y.jsxs)(`span`,{title:e.path,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontSize:12,fontFamily:`monospace`,direction:`rtl`,textAlign:`left`},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`},children:u}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`},children:d})]}),(0,y.jsxs)(`span`,{onClick:e=>e.stopPropagation(),style:{display:`flex`,gap:4},children:[(0,y.jsx)(ld,{label:n,tone:`neutral`,size:`compact`,variant:`ghost`,iconOnly:!0,onClick:r}),(0,y.jsx)(ld,{label:`Discard`,tone:`danger`,size:`compact`,variant:`ghost`,iconOnly:!0,onClick:i})]})]}),a&&c&&(0,y.jsx)(s_,{entry:c,path:e.path})]})}function T_({title:e,files:t,area:n,bulkLabel:r,onBulk:i,secondaryBulkLabel:a,onSecondaryBulk:o,rowActionLabel:s,onRowAction:c,onDiscard:l}){return t.length===0?null:(0,y.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 6px 4px`},children:[(0,y.jsxs)(`span`,{style:{fontSize:11,fontWeight:700,letterSpacing:.4,textTransform:`uppercase`,color:`#a6adc8`},children:[e,` `,(0,y.jsxs)(`span`,{style:{color:`#6c7086`},children:[`(`,t.length,`)`]})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,y.jsx)(ld,{label:r,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:i}),a&&o&&(0,y.jsx)(ld,{label:a,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:o})]})]}),t.map(e=>(0,y.jsx)(w_,{file:e,area:n,actionLabel:typeof s==`function`?s(e):s,onAction:()=>c(e),onDiscard:()=>l(e)},`${e.status}:${e.path}`))]})}function E_({stagedCount:e,headSha:t,branch:n,amendable:r}){let i=R(e=>e.performCommit),a=R(e=>e.performRefAction),o=R(e=>e.runStageAction),s=R(e=>e.showError),c=R(e=>e.pendingMutation),l=R(e=>e.repoId),u=R(e=>e.worktreeCommitMessage),d=R(e=>e.setWorktreeCommitMessage),[f,p]=(0,b.useState)(()=>{try{return localStorage.getItem(`commitNoVerify`)===`true`}catch{return!1}}),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!1),[v,x]=(0,b.useState)(()=>{try{return localStorage.getItem(`commitSubmitAction`)===`commit-and-push`?`commit-and-push`:`commit`}catch{return`commit`}}),[S,C]=(0,b.useState)(!1),[w,T]=(0,b.useState)(!1),E=(0,b.useRef)(null),[ee,D]=(0,b.useState)(``),te=m&&r;(0,b.useEffect)(()=>{if(!S)return;let e=e=>{E.current?.contains(e.target)||C(!1)},t=e=>{e.key===`Escape`&&C(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[S]);let ne=e=>{try{localStorage.setItem(`commitNoVerify`,String(e))}catch{}p(e)},re=async e=>{if(h(e),e){_(!0);let e=await o(`stage-all`,[]);if(_(!1),!e){h(!1);return}if(u.trim().length===0&&l&&t)try{let e=await en(l,t),n=e.body?`${e.subject}\n\n${e.body}`:e.subject;R.getState().worktreeCommitMessage.trim().length===0&&(d(n),D(n))}catch{}}else u===ee&&(d(``),D(``))},ie=e>0&&u.trim().length>0&&!g&&!c,ae=ie&&(v===`commit`||!!n),oe=e=>{try{localStorage.setItem(`commitSubmitAction`,e)}catch{}x(e),C(!1)},se=async()=>{if(!ae||!await i(u.trim(),f,te)||(d(``),D(``),h(!1),v!==`commit-and-push`||!n))return;let e=R.getState(),r=e.refs.find(e=>e.kind===`head`&&e.isCurrent),o=r?.shortName??n,c=r?.targetSha??e.worktreeChanges?.headSha??t;if(!c){s(`Push failed`,`Could not determine the committed revision to push`);return}T(!0);try{await a(`push`,o,c)}catch(e){e&&typeof e==`object`&&e.code===`CONFLICT`?s(`Push rejected`,e,{label:`Force push`,run:()=>{a(`push`,o,c,!0).catch(e=>s(`Force push failed`,e))}}):s(`Push failed`,e)}finally{T(!1)}},O=g?`Staging…`:w?`Pushing…`:c?te?`Amending…`:`Committing…`:`${te?`Amend`:`Commit`}${v===`commit-and-push`?` & push`:``}${e>0?` (${e})`:``}`;return(0,y.jsxs)(`div`,{style:{borderBottom:`1px solid #313244`,padding:`10px 12px`,display:`flex`,flexDirection:`column`,gap:8,flexShrink:0},children:[(0,y.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),se())},placeholder:te?`Amend commit message`:e>0?`Commit message`:`Stage files to commit`,rows:3,style:{resize:`vertical`,minHeight:54,background:`#11111b`,border:`1px solid #313244`,borderRadius:6,color:`#cdd6f4`,fontSize:12,fontFamily:`inherit`,padding:`8px 10px`,outline:`none`},onFocus:e=>{e.currentTarget.style.borderColor=`#89b4fa`},onBlur:e=>{e.currentTarget.style.borderColor=`#313244`}}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,minWidth:0},children:[r&&(0,y.jsxs)(`label`,{title:`Replace the previous commit (git commit --amend) instead of creating a new one`,style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`#a6adc8`,cursor:`pointer`,userSelect:`none`},children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:m,disabled:g,onChange:e=>void re(e.target.checked),style:{accentColor:`#cba6f7`,cursor:g?`default`:`pointer`}}),`Amend`]}),(0,y.jsxs)(`label`,{title:`Commit with --no-verify (skips pre-commit and commit-msg hooks)`,style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`#a6adc8`,cursor:`pointer`,userSelect:`none`},children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>ne(e.target.checked),style:{accentColor:`#fab387`,cursor:`pointer`}}),`Skip git hooks`]})]}),(0,y.jsxs)(`div`,{ref:E,style:{display:`flex`,position:`relative`,flexShrink:0},children:[(0,y.jsx)(`button`,{onClick:()=>void se(),disabled:!ae,title:v===`commit-and-push`&&!n?`Check out a branch before committing and pushing`:void 0,style:{background:ae?`#a6e3a1`:`#313244`,color:ae?`#11111b`:`#6c7086`,border:`none`,borderRadius:`6px 0 0 6px`,fontSize:12,fontWeight:700,padding:`6px 12px 6px 14px`,cursor:ae?`pointer`:`default`,fontFamily:`inherit`,whiteSpace:`nowrap`},children:O}),(0,y.jsx)(`button`,{type:`button`,"aria-label":`Choose commit action`,"aria-haspopup":`menu`,"aria-expanded":S,disabled:g||c||w,onClick:()=>C(e=>!e),style:{width:28,background:ie?`#a6e3a1`:`#313244`,color:ie?`#11111b`:`#6c7086`,border:`none`,borderLeft:`1px solid ${ie?`#11111b33`:`#45475a`}`,borderRadius:`0 6px 6px 0`,cursor:g||c||w?`default`:`pointer`,fontFamily:`inherit`,fontSize:10,fontWeight:700},children:`▼`}),S&&(0,y.jsx)(`div`,{role:`menu`,"aria-label":`Commit action`,style:{position:`absolute`,right:0,bottom:`calc(100% + 6px)`,zIndex:50,minWidth:154,padding:4,border:`1px solid #45475a`,borderRadius:7,background:`#1e1e2e`,boxShadow:`0 8px 24px #00000066`},children:[[`commit`,`Commit`],[`commit-and-push`,`Commit & push`]].map(([e,t])=>(0,y.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":v===e,onClick:()=>oe(e),style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,padding:`7px 9px`,border:`none`,borderRadius:5,background:v===e?`#313244`:`transparent`,color:`#cdd6f4`,cursor:`pointer`,fontFamily:`inherit`,fontSize:12,textAlign:`left`,whiteSpace:`nowrap`},children:[(0,y.jsx)(`span`,{style:{width:12,color:`#a6e3a1`},children:v===e?`✓`:``}),t]},e))})]})]})]})}function D_({operation:e,conflictedCount:t}){let n=R(e=>e.abortInProgressOperation),r=R(e=>e.continueInProgressOperation),i=R(e=>e.pendingMutation),a=e===`rebase`?`Rebase`:`Merge`,o=t>0?`${a} conflict`:`${a} in progress`,s=t>0?`${t} conflicted file${t===1?``:`s`} — resolve and stage them, then continue`:`All conflicts resolved — continue the ${e} to finish.`,c=!i&&t===0;return(0,y.jsxs)(`div`,{style:{border:`1px solid #8b3a4a`,background:`#5c243033`,borderRadius:7,padding:`10px 10px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12},children:[(0,y.jsxs)(`div`,{style:{minWidth:0,display:`flex`,flexDirection:`column`,gap:2},children:[(0,y.jsx)(`span`,{style:{color:`#f5a6b8`,fontSize:13,fontWeight:700},children:o}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`,fontSize:11},children:s})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flexShrink:0},children:[(0,y.jsx)(`span`,{title:c?void 0:t>0?`Stage all conflicted files first`:void 0,children:(0,y.jsx)(ld,{label:i?`Working…`:`Continue ${a}`,tone:`success`,onClick:()=>void r(e),disabled:!c})}),(0,y.jsx)(ld,{label:i?`Aborting…`:`Abort ${a}`,tone:`danger`,onClick:()=>void n(e),disabled:i})]})]})}function O_(){let e=R(e=>e.worktreeChanges),t=R(e=>e.runStageAction),n=R(e=>e.createStash),r=R(e=>e.pendingMutation),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(null),c=e?.staged??[],l=e?.unstaged??[],u=(0,b.useMemo)(()=>new Set([...c,...l].map(e=>e.path)).size,[c,l]),d=e?.mergeHeadShas?.length?`merge`:e?.rebaseHeadSha?`rebase`:null,f=(0,b.useMemo)(()=>new Set(l.filter(e=>e.status===`U`).map(e=>e.path)).size,[l]),p=e=>{s({title:`Discard file changes?`,message:`Discard all staged and unstaged changes to “${e.path}”? This cannot be undone.`,paths:e.oldPath?[e.path,e.oldPath]:[e.path],all:!1})};return(0,y.jsxs)(`div`,{style:{width:480,flexShrink:0,height:`100%`,borderLeft:`1px solid #313244`,background:`#181825`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsx)(vf,{open:i,title:`Stash changes`,label:`Message (optional)`,placeholder:`Describe these changes`,confirmLabel:`Stash`,allowEmpty:!0,onSubmit:e=>{a(!1),n(e||void 0)},onClose:()=>a(!1)}),(0,y.jsx)(yf,{open:!!o,title:o?.title??``,message:o?.message??``,confirmLabel:`Discard`,onConfirm:()=>{let e=o;s(null),e&&t(e.all?`discard-all`:`discard`,e.paths)},onClose:()=>s(null)}),(0,y.jsxs)(`div`,{style:{padding:`14px 16px 10px`,borderBottom:`1px solid #313244`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:8,minWidth:0},children:[(0,y.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`#cdd6f4`,flexShrink:0},children:`Working tree`}),e?.branch&&(0,y.jsxs)(`span`,{style:{fontSize:12,color:`#89b4fa`,fontFamily:`monospace`,overflow:`hidden`,textOverflow:`ellipsis`},children:[`⎇ `,e.branch]})]}),u>0&&(0,y.jsx)(ld,{label:`Discard all`,tone:`danger`,size:`compact`,variant:`ghost`,disabled:r,onClick:()=>{s({title:`Discard all changes?`,message:`Permanently discard changes in ${u} file${u===1?``:`s`}, including untracked files? This cannot be undone.`,paths:[],all:!0})}})]}),(0,y.jsx)(`div`,{style:{fontSize:11,color:`#6c7086`,marginTop:2},children:u===0?`No changes`:`${u} changed file${u===1?``:`s`}`})]}),(0,y.jsx)(E_,{stagedCount:c.length,headSha:e?.headSha,branch:e?.branch,amendable:!d&&!!e?.headSha}),(0,y.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:`12px 10px`,display:`flex`,flexDirection:`column`,gap:16},children:[d&&(0,y.jsx)(D_,{operation:d,conflictedCount:f}),u===0?(0,y.jsx)(`div`,{style:{color:`#45475a`,fontSize:13,textAlign:`center`,marginTop:28},children:`Working tree clean`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(T_,{title:`Staged`,files:c,area:`staged`,bulkLabel:`Unstage all`,onBulk:()=>t(`unstage-all`,[]),rowActionLabel:`Unstage`,onRowAction:e=>t(`unstage`,[e.path]),onDiscard:p}),(0,y.jsx)(T_,{title:`Changes`,files:l,area:`unstaged`,bulkLabel:`Stage all`,onBulk:()=>t(`stage-all`,[]),secondaryBulkLabel:`Stash`,onSecondaryBulk:()=>a(!0),rowActionLabel:e=>e.status===`U`?`Mark resolved`:`Stage`,onRowAction:e=>t(`stage`,[e.path]),onDiscard:p})]})]})]})}var k_={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`};function A_(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function j_({stash:e,diff:t,busy:n,onApply:r,onDrop:i,onNavigate:a}){let[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(!1),u=async()=>{if(!n){s(!0);try{await r(e.sha)}finally{s(!1)}}},d=async()=>{if(!n&&window.confirm(`Drop ${e.selector}? This permanently deletes the stashed changes.`)){l(!0);try{await i(e.sha)}finally{l(!1)}}};return(0,y.jsxs)(`div`,{style:{width:400,flexShrink:0,height:`100%`,background:`#181825`,borderLeft:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{padding:`14px 16px 12px`,borderBottom:`1px solid #313244`,flexShrink:0},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,y.jsx)(`span`,{style:{padding:`2px 6px`,borderRadius:4,background:`#55323c`,color:`#f5c2e7`,fontFamily:`monospace`,fontSize:11,fontWeight:700},children:e.selector}),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontFamily:`monospace`,fontSize:10},children:e.sha.slice(0,10)})]}),(0,y.jsx)(`p`,{style:{margin:`0 0 11px`,color:`#cdd6f4`,fontSize:14,fontWeight:600,lineHeight:1.4},children:e.message||`Stashed changes`}),(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{minWidth:58,color:`#6c7086`},children:`Created`}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`},children:A_(e.createdAt)})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12,fontSize:12},children:[(0,y.jsx)(`span`,{style:{minWidth:58,color:`#6c7086`},children:`Parent`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>a(e.parentSha),title:`Navigate to ${e.parentSha}`,style:{padding:0,border:`none`,background:`none`,color:`#89b4fa`,fontFamily:`monospace`,fontSize:11,textDecoration:`underline`,textUnderlineOffset:2,cursor:`pointer`},children:e.parentSha.slice(0,12)})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>void u(),disabled:n,style:{padding:`5px 11px`,border:`1px solid #b87b89`,borderRadius:4,background:n?`#55323c`:`#f5c2e7`,color:n?`#a77b86`:`#311f25`,fontSize:11,fontWeight:750,cursor:n?`default`:`pointer`},children:o?`Applying…`:`Apply stash`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>void d(),disabled:n,style:{padding:`5px 11px`,border:`1px solid #f38ba866`,borderRadius:4,background:`#311f25`,color:n?`#8b626c`:`#f38ba8`,fontSize:11,fontWeight:700,cursor:n?`default`:`pointer`},children:c?`Dropping…`:`Drop stash`})]})]}),(0,y.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:t?t.changedPaths.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`8px 16px 4px`,background:`#181825`,color:`#6c7086`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`,zIndex:1},children:[(0,y.jsxs)(`span`,{children:[`Stashed files (`,t.changedPaths.length,`)`]}),(0,y.jsxs)(`span`,{style:{display:`flex`,gap:10,fontSize:10,letterSpacing:`0.04em`},children:[(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`+`,t.additions]}),(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`-`,t.deletions]})]})]}),t.changedPaths.map((t,n)=>(0,y.jsx)(M_,{stashSha:e.sha,file:t},`${t.status}:${t.oldPath??``}:${t.path}:${n}`))]}):(0,y.jsx)(`div`,{style:{padding:16,color:`#6c7086`,fontSize:13},children:`No changed files`}):(0,y.jsx)(`div`,{style:{padding:16,color:`#6c7086`,fontSize:12},children:`Loading stashed files…`})})]})}function M_({stashSha:e,file:t}){let[n,r]=(0,b.useState)(!1),i=R(e=>e.loadStashFileDiff),a=R(n=>n.stashFileDiffs[xr(e,t.path)]),o=t.oldPath?`${t.oldPath} → ${t.path}`:t.path,s=k_[t.status]??`#cdd6f4`;return(0,b.useEffect)(()=>{n&&!a&&i(e,t)},[n,a,e,t,i]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{let a=!n;r(a),a&&i(e,t)},style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`5px 16px`,border:`none`,borderBottom:`1px solid #1e1e2e`,background:`transparent`,color:`#cdd6f4`,fontFamily:`inherit`,fontSize:12,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{style:{width:10,flexShrink:0,color:`#6c7086`,fontSize:9},children:n?`▼`:`▶`}),(0,y.jsx)(`span`,{style:{width:18,height:18,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:3,background:`${s}33`,color:s,fontSize:10,fontWeight:700},children:t.status}),(0,y.jsx)(`span`,{title:o,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:12},children:o})]}),n&&a&&(0,y.jsx)(s_,{entry:a,path:t.path})]})}function N_({error:e,onDismiss:t}){let[n,r]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!e)return;r(!1);let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,y.jsx)(`div`,{onClick:t,style:{position:`fixed`,inset:0,background:`rgba(17, 17, 27, 0.75)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:24},children:(0,y.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`error-dialog-title`,style:{background:`#1e1e2e`,border:`1px solid #45475a`,borderRadius:8,boxShadow:`0 12px 40px rgba(0, 0, 0, 0.5)`,maxWidth:760,width:`100%`,maxHeight:`80vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`14px 18px`,borderBottom:`1px solid #313244`,background:`#181825`},children:[(0,y.jsx)(`span`,{id:`error-dialog-title`,style:{fontSize:14,fontWeight:600,color:`#f38ba8`},children:e.title}),(0,y.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close`,style:{background:`transparent`,border:`none`,color:`#6c7086`,fontSize:20,lineHeight:1,cursor:`pointer`,padding:4},children:`×`})]}),(0,y.jsx)(`pre`,{style:{margin:0,padding:`16px 18px`,overflow:`auto`,flex:1,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,fontSize:12.5,lineHeight:1.5,color:`#cdd6f4`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,userSelect:`text`},children:e.message}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,padding:`12px 18px`,borderTop:`1px solid #313244`,background:`#181825`},children:[(0,y.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e.message),r(!0),setTimeout(()=>r(!1),1500)}catch{}},style:{background:`#313244`,color:`#cdd6f4`,border:`1px solid #45475a`,borderRadius:6,padding:`6px 14px`,fontSize:13,cursor:`pointer`},children:n?`Copied`:`Copy`}),e.action&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.run(),t()},style:{background:`#f9e2af`,color:`#1e1e2e`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:13,fontWeight:600,cursor:`pointer`},children:e.action.label}),(0,y.jsx)(`button`,{type:`button`,onClick:t,style:{background:`#89b4fa`,color:`#1e1e2e`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:13,fontWeight:600,cursor:`pointer`},children:`Close`})]})]})}):null}function P_(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function F_(e){let t=new Set(e.map(e=>e.agent)).size>1?`Agents ×${e.length}`:`${e[0].agent[0].toUpperCase()}${e[0].agent.slice(1)} ×${e.length}`,n=e.filter(e=>e.busy).length;return n>0?`${t} · ${n} working`:t}function I_(){let{sessions:e,capabilities:t,focusingPid:n,installing:r,focus:i,install:a,canInstallWindowCalls:o}=mi(),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(()=>{try{return localStorage.getItem(`agentSessionsShowAll`)===`true`}catch{return!1}}),d=e=>{try{localStorage.setItem(`agentSessionsShowAll`,String(e))}catch{}u(e)},[f,p]=(0,b.useState)(null),m=R(e=>e.repoPath),h=R(e=>e.openRepoByPath),g=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(!s)return;let e=e=>{g.current&&!g.current.contains(e.target)&&c(!1)};return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[s]);let _=async e=>{await i(e)&&c(!1)},v=e=>{!e.gitRoot||e.gitRoot===m||(c(!1),h(e.gitRoot))};if(e.length===0)return null;let x=di(e),S=m?x.filter(e=>e.gitRoot===m||e.cwd===m):[],C=x.filter(e=>!S.includes(e)),w=m===null||l?[...S,...C]:S,T=m!==null&&!l?C.length:0;return(0,y.jsxs)(`div`,{ref:g,style:{position:`relative`,flexShrink:0},children:[(0,y.jsxs)(`button`,{onClick:e=>{let t=e.currentTarget.getBoundingClientRect();p({top:t.bottom+4,right:window.innerWidth-t.right}),c(e=>!e)},title:`${e.length} agent session${e.length===1?``:`s`} running`,"aria-label":`Agent sessions`,style:{display:`flex`,alignItems:`center`,gap:5,padding:`4px 10px`,borderRadius:4,border:`1px solid ${S.length>0?`#a6e3a155`:`#313244`}`,background:S.length>0?`#a6e3a115`:`transparent`,color:S.length>0?`#a6e3a1`:`#6c7086`,fontSize:11,cursor:`pointer`},children:[[...new Set(e.map(e=>e.agent))].map(t=>(0,y.jsx)(_i,{agent:t,size:12,busy:e.some(e=>e.agent===t&&e.busy)},t)),F_(e)]}),s&&f&&(0,y.jsxs)(`div`,{style:{position:`fixed`,top:f.top,right:f.right,width:480,maxWidth:`calc(100vw - 16px)`,maxHeight:320,overflowY:`auto`,background:`#181825`,border:`1px solid #313244`,borderRadius:6,boxShadow:`0 8px 24px #00000088`,zIndex:100,padding:4},children:[o&&(0,y.jsxs)(`div`,{style:{padding:`8px 8px 10px`,borderBottom:`1px solid #313244`,marginBottom:4},children:[(0,y.jsx)(`div`,{style:{color:`#a6adc8`,fontSize:11,marginBottom:6,lineHeight:1.4},children:`Focusing terminal windows needs the “Activate Window By Title” GNOME\xA0Shell extension.`}),(0,y.jsx)(`button`,{onClick:()=>void a(),disabled:r,style:{padding:`4px 10px`,borderRadius:4,border:`1px solid #89b4fa55`,background:`#89b4fa20`,color:r?`#45475a`:`#89b4fa`,fontSize:11,cursor:r?`default`:`pointer`},children:r?`Waiting for GNOME confirmation…`:`Install extension`})]}),w.length===0&&(0,y.jsx)(`div`,{style:{padding:`8px`,color:`#585b70`,fontSize:11},children:`No agents running in this repository`}),w.map(e=>{let r=m!==null&&(e.gitRoot===m||e.cwd===m),i=e.gitRoot!==null&&!r,a=!e.focusable,o=a?e.kind===`terminal`?t?.displayServer===`wayland`?`Can't focus terminal windows on Wayland — install the 'Activate Window By Title' GNOME Shell extension`:`Can't focus terminal windows — install wmctrl`:`This session has no window to focus`:`Focus ${e.agent} window · ${pi(e)} (pid ${e.pid})`;return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,width:`100%`,borderRadius:4,background:`transparent`,opacity:n!==null&&n!==e.pid?.5:1},onMouseEnter:e=>{e.currentTarget.style.background=`#31324466`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsxs)(`button`,{onClick:()=>v(e),disabled:!i,title:r?`${e.cwd} · currently open repository`:e.gitRoot?`Switch to ${e.gitRoot}`:`${e.cwd} · not inside a Git repository`,style:{display:`flex`,alignItems:`center`,gap:8,flex:1,minWidth:0,padding:`6px 8px`,border:`none`,background:`transparent`,color:`#a6adc8`,fontSize:11,textAlign:`left`,cursor:i?`pointer`:`default`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,display:`inline-flex`},children:(0,y.jsx)(_i,{agent:e.agent,size:13,busy:e.busy??!1})}),(0,y.jsxs)(`span`,{style:{flexShrink:0,fontFamily:`monospace`},children:[P_(e.cwd),e.count>1?` ×${e.count}`:``]}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1,color:`#7f849c`,textAlign:`right`},children:e.title??pi(e)}),e.busy&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#f9e2af`,fontSize:10},children:`working`}),r&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#a6e3a1`,fontSize:10},children:`this repo`})]}),(0,y.jsx)(`button`,{onClick:()=>!a&&void _(e),disabled:a||n!==null,title:o,style:{flexShrink:0,marginRight:6,padding:`3px 7px`,border:`1px solid #89b4fa55`,borderRadius:4,background:`#89b4fa18`,color:a?`#45475a`:`#89b4fa`,fontSize:10,cursor:a||n!==null?`default`:`pointer`},children:n===e.pid?`Focusing…`:`Focus on window`})]},`${e.pid}:${e.cwd}`)}),T>0&&(0,y.jsxs)(`button`,{onClick:()=>d(!0),style:{display:`block`,width:`100%`,padding:`6px 8px`,marginTop:w.length>0?2:0,border:`none`,borderTop:w.length>0?`1px solid #313244`:`none`,background:`transparent`,color:`#6c7086`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:[`▸ Show `,T,` agent`,T===1?``:`s`,` in other repositories`]}),m!==null&&l&&C.length>0&&(0,y.jsx)(`button`,{onClick:()=>d(!1),style:{display:`block`,width:`100%`,padding:`6px 8px`,border:`none`,borderTop:`1px solid #313244`,background:`transparent`,color:`#6c7086`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:`▾ Hide agents in other repositories`})]})]})}var L_=`modulepreload`,R_=function(e){return`/`+e},z_={},B_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=R_(t,n),t=s(t),t in z_)return;z_[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:L_,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},V_=(0,b.lazy)(async()=>({default:(await B_(()=>import(`./SettingsDialog-Dkux36N-.js`),[])).SettingsDialog})),H_=`ingit`,U_=8;function W_(e){if(e.trim().length===0)return null;let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));if(t===-1)return{folder:`.`,prefix:e};let n=e.slice(t+1),r=e[t],i=e.slice(0,t);return/^[A-Za-z]:$/.test(i)&&(i+=r),i||=e.startsWith(`/`)||e.startsWith(`\\`)?r:`.`,{folder:i,prefix:n}}function G_(e){return e.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e}function K_(e){if(!e)return 0;let t=new Set;for(let n of e.staged)t.add(n.path);for(let n of e.unstaged)t.add(n.path);return t.size}function q_(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(!1),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(!1),[f,p]=(0,b.useState)(!1),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)([]),[v,x]=(0,b.useState)(0),[S,C]=(0,b.useState)(null),w=(0,b.useRef)(null),{status:T,repoPath:E,currentWorktreePath:D,worktrees:te,recentRepos:ne,discoveredFolder:re,discoveredRepos:ie,openError:ae,errorDialog:oe,dismissError:se,showError:O,openRepoByPath:k,closeRepo:ce,openFromUrl:le,performRefAction:ue,showCommitMessages:de,setShowCommitMessages:fe,viewMode:A,setViewMode:pe,worktreeChanges:me,reloadFromServer:he}=R(ee(e=>({status:e.status,repoPath:e.repoPath,currentWorktreePath:e.currentWorktreePath,worktrees:e.worktrees,recentRepos:e.recentRepos,discoveredFolder:e.discoveredFolder,discoveredRepos:e.discoveredRepos,openError:e.openError,errorDialog:e.errorDialog,dismissError:e.dismissError,showError:e.showError,openRepoByPath:e.openRepoByPath,closeRepo:e.closeRepo,openFromUrl:e.openFromUrl,performRefAction:e.performRefAction,showCommitMessages:e.showCommitMessages,setShowCommitMessages:e.setShowCommitMessages,viewMode:e.viewMode,setViewMode:e.setViewMode,worktreeChanges:e.worktreeChanges,reloadFromServer:e.reloadFromServer}))),ge=async()=>{if(!i){a(!0);try{await ue(`fetch`,``,``)}catch(e){O(`Fetch failed`,e)}finally{a(!1)}}};(0,b.useEffect)(()=>{let e=()=>le();return window.addEventListener(`hashchange`,e),le(),()=>window.removeEventListener(`hashchange`,e)},[le]),(0,b.useEffect)(()=>{s(E??``),d(!1),p(!1)},[E]),(0,b.useEffect)(()=>{if(!c||!u){p(!1),h(!1);return}let e=W_(o);if(!e){_([]),p(!1),h(!1);return}let t=!1,n=window.setTimeout(()=>{h(!0),Bt(e.folder).then(n=>{if(t)return;let r=e.prefix.toLowerCase(),i=n.entries.filter(e=>r.length===0||e.name.toLowerCase().startsWith(r)).slice(0,U_);_(i),x(0),p(i.length>0)}).catch(()=>{t||(_([]),p(!1))}).finally(()=>{t||h(!1)})},120);return()=>{t=!0,window.clearTimeout(n)}},[u,c,o]),(0,b.useEffect)(()=>{if(T!==`ready`||!E){document.title=H_;return}document.title=`${G_(E)} (${K_(me)})`},[T,E,me]),(0,b.useEffect)(()=>{let e=document.visibilityState===`hidden`?Date.now():null,t=()=>{e=Date.now()},n=()=>{document.visibilityState!==`hidden`&&(e!==null&&Date.now()-e>3e4&&he(),e=null)},r=()=>{document.visibilityState===`hidden`?t():n()};return window.addEventListener(`blur`,t),window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,r),()=>{window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,r)}},[he]);let _e=e=>{e.preventDefault();let t=o.trim();if(!t||t===E){s(E??``),l(!1),e.currentTarget.querySelector(`input`)?.blur();return}k(t)},ve=()=>{let e=w.current?.getBoundingClientRect();e&&C({top:e.bottom+4,left:e.left,width:e.width})},ye=e=>{s(e.path),d(!1),p(!1),x(0)},be=c&&S!==null&&(m||f&&g.length>0);return T===`no-repo`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Ci,{onOpen:k,error:ae,recentRepos:ne,discoveredFolder:re,discoveredRepos:ie}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>r(!0),title:`Open settings`,"aria-label":`Open settings`,style:{position:`fixed`,top:14,right:14,zIndex:20,padding:`6px 11px`,border:`1px solid #45475a`,borderRadius:6,background:`#181825`,color:`#a6adc8`,fontSize:11,fontWeight:700,cursor:`pointer`},children:`Settings`}),n&&(0,y.jsx)(b.Suspense,{fallback:null,children:(0,y.jsx)(V_,{open:!0,onClose:()=>r(!1)})}),(0,y.jsx)(N_,{error:oe,onDismiss:se})]}):T===`loading`?(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,width:`100%`,background:`#1e1e2e`,flexDirection:`column`,gap:16},children:[(0,y.jsx)(X_,{}),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:13},children:`Opening repository…`})]}):(0,y.jsxs)(`div`,{style:{display:`flex`,height:`100%`,width:`100%`,overflow:`hidden`,background:`#1e1e2e`},children:[e&&(0,y.jsx)(J_,{onClose:()=>t(!1),onOpenSettings:()=>r(!0),settingsOpen:n}),(0,y.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{height:36,flexShrink:0,display:`flex`,alignItems:`center`,padding:`0 14px`,borderBottom:`1px solid #313244`,background:`#181825`,fontSize:12,color:`#6c7086`,gap:8,overflow:`hidden`},children:[!e&&(0,y.jsx)(`button`,{onClick:()=>t(!0),title:`Show refs`,"aria-label":`Show refs`,style:{width:24,height:20,flexShrink:0,padding:0,borderRadius:3,border:`1px solid #313244`,background:`#1e1e2e`,color:`#6c7086`,fontSize:13,lineHeight:`18px`,cursor:`pointer`},children:`☰`}),A===`history`&&(0,y.jsx)(`button`,{onClick:()=>fe(!de),style:{flexShrink:0,padding:`4px 10px`,borderRadius:4,border:`1px solid ${de?`#89b4fa55`:`#313244`}`,background:de?`#89b4fa20`:`transparent`,color:de?`#89b4fa`:`#6c7086`,fontSize:11,cursor:`pointer`},title:de?`Hide commit messages`:`Show commit messages`,children:de?`Hide messages`:`Show messages`}),(0,y.jsxs)(`div`,{style:{flexShrink:0,display:`flex`,borderRadius:4,border:`1px solid #313244`,overflow:`hidden`},children:[(0,y.jsx)(`button`,{onClick:()=>pe(`history`),style:{padding:`4px 10px`,border:`none`,background:A===`history`?`#89b4fa20`:`transparent`,color:A===`history`?`#89b4fa`:`#6c7086`,fontSize:11,cursor:`pointer`},title:`Branch history graph`,children:`History`}),(0,y.jsx)(`button`,{onClick:()=>pe(`reflog`),style:{padding:`4px 10px`,border:`none`,borderLeft:`1px solid #313244`,background:A===`reflog`?`#f9e2af20`:`transparent`,color:A===`reflog`?`#f9e2af`:`#6c7086`,fontSize:11,cursor:`pointer`},title:`Reflog time machine — recover lost commits and see where HEAD has been`,children:`Time Machine`})]}),te.filter(e=>!e.bare).length>1&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{style:{color:`#45475a`,marginLeft:8},children:`worktree`}),(0,y.jsx)(`select`,{value:D??``,onChange:e=>{e.target.value&&e.target.value!==D&&k(e.target.value)},title:`Switch linked worktree`,"aria-label":`Current linked worktree`,style:{maxWidth:220,flexShrink:1,minWidth:90,padding:`3px 5px`,border:`1px solid #313244`,borderRadius:4,outline:`none`,background:`#1e1e2e`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:11},children:te.filter(e=>!e.bare).map(e=>(0,y.jsxs)(`option`,{value:e.path,disabled:e.prunable,children:[G_(e.path),` — `,e.branchShortName??(e.detached?`detached ${e.headSha?.slice(0,8)??``}`:`no branch`)]},e.path))})]}),(0,y.jsx)(`span`,{style:{color:`#45475a`,marginLeft:8},children:`repo`}),(0,y.jsx)(`form`,{onSubmit:_e,style:{display:`flex`,flex:1,minWidth:0},children:(0,y.jsx)(`input`,{ref:w,value:o,onChange:e=>{s(e.target.value),d(!0),ve()},onFocus:e=>{l(!0),d(!1),ve(),e.currentTarget.select()},onBlur:()=>{l(!1),d(!1),p(!1)},onKeyDown:e=>{if(f&&g.length>0){if(e.key===`ArrowDown`){e.preventDefault(),x(e=>(e+1)%g.length);return}if(e.key===`ArrowUp`){e.preventDefault(),x(e=>(e-1+g.length)%g.length);return}if(e.key===`Tab`||e.key===`Enter`){e.preventDefault(),ye(g[v]);return}if(e.key===`Escape`){e.preventDefault(),d(!1),p(!1);return}}e.key===`Escape`&&(s(E??``),e.currentTarget.blur())},"aria-label":`Repository path`,title:`Type a repository path and press Enter to open it`,spellCheck:!1,autoComplete:`off`,role:`combobox`,"aria-expanded":be,"aria-controls":`header-repo-path-suggestions`,"aria-autocomplete":`list`,style:{width:`100%`,minWidth:0,padding:`3px 5px`,border:`1px solid ${c?`#89b4fa88`:`transparent`}`,borderRadius:3,outline:`none`,background:c?`#1e1e2e`:`transparent`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:12}})}),be&&(0,y.jsx)(`div`,{id:`header-repo-path-suggestions`,role:`listbox`,style:{position:`fixed`,zIndex:100,top:S.top,left:S.left,width:S.width,maxHeight:238,overflowY:`auto`,padding:4,border:`1px solid #3d4253`,borderRadius:5,background:`#181825`,boxShadow:`0 8px 24px #00000088`},children:m&&g.length===0?(0,y.jsx)(`div`,{style:{padding:`7px 8px`,color:`#7f849c`,fontSize:11},children:`Loading…`}):g.map((e,t)=>(0,y.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===v,onMouseEnter:()=>x(t),onMouseDown:t=>{t.preventDefault(),ye(e)},style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,minWidth:0,padding:`6px 8px`,border:`none`,borderRadius:4,background:t===v?`#313244`:`transparent`,color:`#cdd6f4`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`monospace`},children:e.path}),e.isGitRepo&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#a6e3a1`,fontSize:10},children:`repo`})]},e.path))}),(0,y.jsx)(I_,{}),(0,y.jsxs)(`button`,{onClick:ge,disabled:i,title:`Fetch all remotes`,"aria-label":`Fetch all remotes`,style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,padding:`4px 10px`,borderRadius:4,border:`1px solid #313244`,background:`transparent`,color:i?`#45475a`:`#6c7086`,fontSize:11,cursor:i?`default`:`pointer`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,animation:i?`spin 0.7s linear infinite`:`none`},children:`⟳`}),i?`Fetching…`:`Fetch`,(0,y.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}),(0,y.jsx)(`button`,{onClick:ce,title:`Close repository`,"aria-label":`Close repository`,style:{flexShrink:0,padding:`4px 10px`,borderRadius:4,border:`1px solid #313244`,background:`transparent`,color:`#6c7086`,fontSize:11,cursor:`pointer`},children:`Close`})]}),A===`reflog`?(0,y.jsx)(Pm,{}):(0,y.jsx)(mm,{})]}),(0,y.jsx)(Y_,{}),(0,y.jsx)(N_,{error:oe,onDismiss:se}),n&&(0,y.jsx)(b.Suspense,{fallback:null,children:(0,y.jsx)(V_,{open:!0,onClose:()=>r(!1)})})]})}function J_({onClose:e,onOpenSettings:t,settingsOpen:n}){let{refs:r,stashes:i,selectRef:a,selectStash:o,navigateTo:s,selectedStashSha:c,selectedSha:l}=R(ee(e=>({refs:e.refs,stashes:e.stashes,selectRef:e.selectRef,selectStash:e.selectStash,navigateTo:e.navigateTo,selectedStashSha:e.selectedStashSha,selectedSha:e.selectedSha})));return(0,y.jsx)(Ei,{refs:r,stashes:i,onSelectRef:a,onSelectStash:o,onSelectStashParent:e=>{s(e)},selectedStashSha:c,selectedSha:l,onClose:e,onOpenSettings:t,settingsOpen:n})}function Y_(){let{selectedStashSha:e,stashes:t,stashDiff:n,pendingMutation:r,applyStash:i,dropStash:a,navigateTo:o,worktreeSelected:s,selectedSha:c,historyWindow:l,commitDetail:u,commitDiff:d,commitPRs:f,commitAuthorAvatars:p,commitCIStatus:m,githubUrl:h,checkoutSha:g,showError:_}=R(ee(e=>({selectedStashSha:e.selectedStashSha,stashes:e.stashes,stashDiff:e.stashDiff,pendingMutation:e.pendingMutation,applyStash:e.applyStash,dropStash:e.dropStash,navigateTo:e.navigateTo,worktreeSelected:e.worktreeSelected,selectedSha:e.selectedSha,historyWindow:e.historyWindow,commitDetail:e.commitDetail,commitDiff:e.commitDiff,commitPRs:e.commitPRs,commitAuthorAvatars:e.commitAuthorAvatars,commitCIStatus:e.commitCIStatus,githubUrl:e.githubUrl,checkoutSha:e.checkoutSha,showError:e.showError}))),v=e?t.find(t=>t.sha===e)??null:null,x=c?m[c]:void 0,S=x?.runs??[],C=(0,b.useMemo)(()=>{if(!c||!l)return null;let e=l.rows,t=new Map(e.map(e=>[e.sha,e]));for(let n of e){if(n.refNames.length===0)continue;let e=n.refNames.find(e=>!e.includes(`/`)),r=n.refNames.find(e=>e.includes(`/`)&&e!==`origin`&&e!==`HEAD`),i=e??r;if(!i)continue;let a=n.sha,o=new Set;for(;a&&!o.has(a);){if(a===c)return i;o.add(a);let e=t.get(a);if(!e||e.parentShas.length===0)break;a=e.parentShas[0]}}return null},[c,l]);return v?(0,y.jsx)(j_,{stash:v,diff:n,busy:r,onApply:i,onDrop:a,onNavigate:e=>{o(e)}}):s?(0,y.jsx)(O_,{}):(0,y.jsx)(h_,{commit:u,diff:d,branchName:C,prs:f,authorAvatarUrl:u?p[u.sha]:void 0,ciState:x?.state,ciRuns:S,githubUrl:h,onNavigate:o,onCheckout:async e=>{try{await g(e)}catch(e){_(`Checkout failed`,e)}}})}function X_(){return(0,y.jsx)(`div`,{style:{width:32,height:32,border:`3px solid #313244`,borderTopColor:`#89b4fa`,borderRadius:`50%`,animation:`spin 0.7s linear infinite`},children:(0,y.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})})}(0,x.createRoot)(document.getElementById(`root`)).render((0,y.jsx)(b.StrictMode,{children:(0,y.jsx)(q_,{})}));export{Nd as a,$d as c,wd as d,R as f,c as h,Bd as i,Vd as l,u as m,tf as n,Pd as o,f as p,kd as r,ef as s,Dd as t,Qd as u};
614
+ `;function a_(e){let t=[],n=!1;for(let r of e.split(`
615
+ `)){if(r.startsWith(`@@`)){n=!0,t.push({kind:`hunk`,content:r,marker:``});continue}n&&(r.startsWith(`+`)?t.push({kind:`add`,content:r.slice(1),marker:`+`}):r.startsWith(`-`)?t.push({kind:`del`,content:r.slice(1),marker:`-`}):r.startsWith(` `)||r===``?t.push({kind:`ctx`,content:r.slice(1),marker:` `}):r.startsWith(`\\`)&&t.push({kind:`ctx`,content:r,marker:``}))}return t}var o_={add:`#a6e3a114`,del:`#f38ba814`,hunk:`transparent`,ctx:`transparent`},s_={add:`#a6e3a1`,del:`#f38ba8`,hunk:`#89b4fa`,ctx:`#45475a`};function c_({entry:e,path:t}){let n=(0,b.useMemo)(()=>e.patchText?a_(e.patchText):[],[e.patchText]),r=(0,b.useMemo)(()=>r_(t),[t]),i=r!==`plain`&&n.length<=t_,[a,o]=(0,b.useState)(null);return(0,b.useEffect)(()=>{if(o(null),!i||n.length===0)return;let e=!1;return Promise.all(n.map(e=>e.kind===`hunk`||e.content.length===0?Promise.resolve(null):e_(e.content,r,!1).catch(()=>null))).then(t=>{e||o(t)}),()=>{e=!0}},[n,r,i]),e.loading?(0,y.jsx)(u_,{text:`Loading diff...`}):e.error?(0,y.jsx)(u_,{text:e.error,color:`#f38ba8`}):e.imageDiff?(0,y.jsx)(l_,{imageDiff:e.imageDiff,path:t}):e.isBinary?(0,y.jsx)(u_,{text:`Binary file`}):n.length===0?(0,y.jsx)(u_,{text:`No textual changes`}):(0,y.jsxs)(`div`,{className:`file-diff`,style:{margin:`2px 0 6px 24px`,border:`1px solid #313244`,borderRadius:6,background:`#11111b`,overflow:`auto`,maxHeight:420,fontSize:11,fontFamily:`monospace`,lineHeight:1.5},children:[(0,y.jsx)(`style`,{children:i_}),(0,y.jsx)(`div`,{style:{minWidth:`fit-content`},children:n.map((e,t)=>{let n=a?.[t]??null;return(0,y.jsxs)(`div`,{style:{display:`flex`,background:o_[e.kind],color:e.kind===`hunk`?`#89b4fa`:`#cdd6f4`,whiteSpace:`pre`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:16,textAlign:`center`,color:s_[e.kind],userSelect:`none`},children:e.marker}),n===null?(0,y.jsx)(`span`,{children:e.content}):(0,y.jsx)(`span`,{dangerouslySetInnerHTML:{__html:n}})]},t)})})]})}function l_({imageDiff:e,path:t}){let n=[];return e.before&&n.push({label:e.after?`Before`:`Deleted image`,preview:e.before}),e.after&&n.push({label:e.before?`After`:`Added image`,preview:e.after}),(0,y.jsx)(`div`,{style:{margin:`2px 0 6px 24px`,padding:10,display:`flex`,flexWrap:`wrap`,gap:10,border:`1px solid #313244`,borderRadius:6,background:`#11111b`,overflow:`auto`,maxHeight:520},children:n.map(({label:e,preview:n})=>(0,y.jsxs)(`figure`,{style:{flex:`1 1 220px`,minWidth:0,margin:0,display:`flex`,flexDirection:`column`,gap:6},children:[(0,y.jsx)(`figcaption`,{style:{color:`#a6adc8`,fontSize:10,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`},children:e}),(0,y.jsx)(`div`,{style:{minHeight:80,padding:8,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:4,backgroundColor:`#181825`,backgroundImage:[`linear-gradient(45deg, #242435 25%, transparent 25%)`,`linear-gradient(-45deg, #242435 25%, transparent 25%)`,`linear-gradient(45deg, transparent 75%, #242435 75%)`,`linear-gradient(-45deg, transparent 75%, #242435 75%)`].join(`,`),backgroundPosition:`0 0, 0 8px, 8px -8px, -8px 0`,backgroundSize:`16px 16px`},children:(0,y.jsx)(`img`,{src:n.dataUrl,alt:`${t} ${e.toLowerCase()}`,draggable:!1,style:{display:`block`,maxWidth:`100%`,maxHeight:410,objectFit:`contain`}})})]},e))})}function u_({text:e,color:t}){return(0,y.jsx)(`div`,{style:{margin:`2px 0 6px 24px`,padding:`6px 10px`,fontSize:11,color:t??`#6c7086`,border:`1px solid #313244`,borderRadius:6,background:`#11111b`},children:e})}var d_={success:`#a6e3a1`,failure:`#f38ba8`,error:`#f38ba8`,pending:`#f9e2af`,neutral:`#6c7086`},f_={success:`✓`,failure:`✗`,error:`✗`,pending:`◔`,neutral:`–`},p_={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`},m_={A:`A`,M:`M`,D:`D`,R:`R`,C:`C`,T:`T`,U:`U`};function h_(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function g_({commit:e,diff:t,branchName:n,prs:r,authorAvatarUrl:i,ciState:a,ciRuns:o,githubUrl:s,onCheckout:c,onNavigate:l}){return e?(0,y.jsxs)(`div`,{style:{width:400,flexShrink:0,height:`100%`,background:`#181825`,borderLeft:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{padding:`14px 16px 12px`,borderBottom:`1px solid #313244`,flexShrink:0},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:8},children:[(0,y.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:11,color:`#89b4fa`,letterSpacing:`0.04em`},children:e.sha.slice(0,12)}),l&&(0,y.jsx)(S_,{label:`Navigate to`,onClick:()=>l(e.sha)}),c&&(0,y.jsx)(S_,{label:`Checkout`,onClick:()=>c(e.sha)})]}),(0,y.jsx)(`p`,{style:{fontSize:14,fontWeight:600,color:`#cdd6f4`,lineHeight:1.4,margin:0,marginBottom:10},children:e.subject}),(0,y.jsx)(__,{label:`Author`,value:`${e.authorName} <${e.authorEmail}>`,leading:(0,y.jsx)(v_,{name:e.authorName,url:i})}),(0,y.jsx)(__,{label:`Date`,value:h_(e.authorUnix)}),n&&(0,y.jsx)(__,{label:`Branch`,value:n}),(e.committerName!==e.authorName||e.committerUnix!==e.authorUnix)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(__,{label:`Committer`,value:`${e.committerName} <${e.committerEmail}>`}),(0,y.jsx)(__,{label:`Commit date`,value:h_(e.committerUnix)})]}),e.parents.length>0&&(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,minWidth:76,flexShrink:0},children:`Parents`}),(0,y.jsx)(`span`,{style:{display:`flex`,gap:4,flexWrap:`wrap`},children:e.parents.map(e=>(0,y.jsx)(`span`,{onClick:()=>l?.(e),style:{fontFamily:`monospace`,color:`#89b4fa`,cursor:l?`pointer`:`default`,textDecoration:l?`underline`:`none`},children:e.slice(0,8)},e))})]}),e.parents.length>1&&(0,y.jsxs)(`div`,{style:{fontSize:12,color:`#a6adc8`,marginBottom:3},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`},children:`Merge: `}),`merged into`,` `,(0,y.jsx)(`span`,{onClick:()=>l?.(e.parents[0]),style:{color:`#89b4fa`,cursor:`pointer`,textDecoration:`underline`,fontFamily:`monospace`},children:e.parents[0].slice(0,8)}),` `,`from`,` `,(0,y.jsx)(`span`,{onClick:()=>l?.(e.parents[1]),style:{color:`#a6e3a1`,cursor:`pointer`,textDecoration:`underline`,fontFamily:`monospace`},children:e.parents[1].slice(0,8)})]}),r&&r.length>0&&(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:4,marginTop:6,marginBottom:4},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:12,marginRight:4},children:r.length===1?`Pull request`:`Pull requests`}),r.map(e=>(0,y.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open pull request #${e.number}: ${e.title}`,title:`Open pull request #${e.number}: ${e.title}`,style:{color:e.mergedAt?`#a6e3a1`:`#89b4fa`,fontSize:12,textDecoration:`underline`},children:[`PR #`,e.number,` ↗`,e.title?`: ${e.title.length>40?`${e.title.slice(0,40)}…`:e.title}`:``]},e.number))]}),s&&e.isPushed&&(0,y.jsxs)(`div`,{style:{marginTop:4,marginBottom:4,display:`flex`,gap:12},children:[(0,y.jsx)(`a`,{href:`${s}/commit/${e.sha}`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`#6c7086`,textDecoration:`underline`},children:`View on GitHub`}),(0,y.jsx)(`a`,{href:`${s}/commit/${e.sha}/checks`,target:`_blank`,rel:`noopener noreferrer`,style:{fontSize:11,color:`#6c7086`,textDecoration:`underline`},children:`CI runs`})]}),a===`loading`&&(0,y.jsx)(`div`,{style:{marginTop:8},children:(0,y.jsx)(x_,{})}),o&&o.length>0&&(0,y.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexDirection:`column`,gap:3},children:o.map((e,t)=>(0,y.jsx)(b_,{run:e},`${e.name}-${t}`))}),e.refs.length>0&&(0,y.jsx)(`div`,{style:{marginTop:8,display:`flex`,flexWrap:`wrap`,gap:4},children:e.refs.map(e=>(0,y.jsx)(`span`,{style:{background:`#313244`,color:`#89b4fa`,fontSize:11,borderRadius:4,padding:`2px 6px`,fontWeight:500},children:e},e))})]}),e.body&&(0,y.jsx)(`div`,{style:{padding:`10px 16px`,borderBottom:`1px solid #313244`,flexShrink:0,maxHeight:200,overflowY:`auto`},children:(0,y.jsx)(`pre`,{style:{fontSize:12,color:`#a6adc8`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,fontFamily:`inherit`,margin:0,lineHeight:1.5},children:e.body})}),(0,y.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:t&&t.changedPaths.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`8px 16px 4px`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,color:`#6c7086`,textTransform:`uppercase`,position:`sticky`,top:0,background:`#181825`},children:[(0,y.jsxs)(`span`,{children:[`Changed files (`,t.changedPaths.length,`)`]}),(0,y.jsxs)(`span`,{style:{display:`flex`,gap:10,fontSize:10,letterSpacing:`0.04em`},children:[(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`+`,t.additions]}),(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`-`,t.deletions]})]})]}),t.changedPaths.map((t,n)=>(0,y.jsx)(y_,{sha:e.sha,cp:t},`${t.status}:${t.oldPath??``}:${t.path}:${n}`))]}):t?(0,y.jsx)(`div`,{style:{padding:`16px`,fontSize:13,color:`#45475a`},children:`No changed files`}):null})]}):null}function __({label:e,value:t,mono:n,leading:r}){return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:r?`center`:void 0,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`,minWidth:76,flexShrink:0},children:e}),(0,y.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:7,minWidth:0,color:`#a6adc8`,fontFamily:n?`monospace`:`inherit`},children:[r,(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t})]})]})}function v_({name:e,url:t}){let[n,r]=(0,b.useState)(!1);(0,b.useEffect)(()=>r(!1),[t]);let i={width:24,height:24,borderRadius:`50%`,flexShrink:0};return t&&!n?(0,y.jsx)(`img`,{src:t,alt:`${e} avatar`,width:24,height:24,onError:()=>r(!0),style:{...i,display:`block`,objectFit:`cover`,background:`#313244`}}):(0,y.jsx)(`span`,{"aria-hidden":`true`,style:{...i,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,background:`#313244`,color:`#cdd6f4`,fontSize:11,fontWeight:700},children:e.trim().charAt(0).toUpperCase()||`?`})}function y_({sha:e,cp:t}){let[n,r]=(0,b.useState)(!1),i=R(e=>e.loadCommitFileDiff),a=R(n=>n.commitFileDiffs[br(e,t.path)]),o=p_[t.status]??`#cdd6f4`,s=m_[t.status]??t.status,c=t.oldPath?`${t.oldPath} → ${t.path}`:t.path;return(0,b.useEffect)(()=>{n&&!a&&i(e,t)},[n,a,e,t,i]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`5px 16px`,fontSize:12,color:`#cdd6f4`,borderBottom:`1px solid #1e1e2e`,cursor:`pointer`},onClick:()=>{let a=!n;r(a),a&&i(e,t)},onMouseEnter:e=>{e.currentTarget.style.background=`#1e1e2e`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:10,fontSize:9,color:`#6c7086`,userSelect:`none`},children:n?`▼`:`▶`}),(0,y.jsx)(`span`,{style:{flexShrink:0,width:18,height:18,borderRadius:3,background:o+`33`,color:o,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:10,fontWeight:700},children:s}),(0,y.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`monospace`,fontSize:12,color:`#a6adc8`},title:c,children:c})]}),n&&a&&(0,y.jsx)(c_,{entry:a,path:t.path})]})}function b_({run:e}){let t=d_[e.state],n=f_[e.state],r=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{style:{color:t,fontSize:12,fontWeight:700,width:12,textAlign:`center`,flexShrink:0},children:n}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`,fontWeight:500,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flexShrink:0,maxWidth:`55%`},children:e.name}),e.description&&(0,y.jsx)(`span`,{style:{color:`#6c7086`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1},children:e.description})]}),i={display:`flex`,alignItems:`center`,gap:8,fontSize:12,padding:`2px 0`,textDecoration:`none`};return e.url?(0,y.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,style:i,title:e.description??e.name,children:r}):(0,y.jsx)(`div`,{style:i,title:e.description??e.name,children:r})}function x_(){return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:12,padding:`2px 0`,color:`#6c7086`},title:`Loading CI status`,children:[(0,y.jsx)(`span`,{style:{width:10,height:10,borderRadius:`50%`,border:`2px solid #45475a`,borderTopColor:`#89b4fa`,flexShrink:0,animation:`ci-spin 0.8s linear infinite`}}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`,fontWeight:500},children:`CI status`}),(0,y.jsx)(`span`,{children:`Loading...`}),(0,y.jsx)(`style`,{children:`@keyframes ci-spin { to { transform: rotate(360deg); } }`})]})}function S_({label:e,onClick:t}){return(0,y.jsx)(`button`,{onClick:t,title:e,style:{background:`#313244`,border:`1px solid #45475a`,borderRadius:4,color:`#cdd6f4`,fontSize:11,padding:`2px 8px`,cursor:`pointer`,fontFamily:`inherit`},onMouseEnter:e=>{e.currentTarget.style.background=`#45475a`},onMouseLeave:e=>{e.currentTarget.style.background=`#313244`},children:e})}var C_={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`,"?":`#94e2d5`},w_={A:`Added`,M:`Modified`,D:`Deleted`,R:`Renamed`,C:`Copied`,T:`Type changed`,U:`Conflicted`,"?":`Untracked`};function T_({file:e,area:t,actionLabel:n,onAction:r,onDiscard:i}){let[a,o]=(0,b.useState)(!1),s=R(e=>e.loadWorktreeFileDiff),c=R(n=>n.worktreeFileDiffs[yr(t,e.path)]),l=e.path.lastIndexOf(`/`),u=l>=0?e.path.slice(0,l+1):``,d=l>=0?e.path.slice(l+1):e.path,f=C_[e.status]??`#cdd6f4`;return(0,b.useEffect)(()=>{a&&!c&&s(e,t)},[a,c,e,t,s]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`4px 6px`,borderRadius:6,cursor:`pointer`},onClick:()=>{let n=!a;o(n),n&&s(e,t)},onMouseEnter:e=>{e.currentTarget.style.background=`#1e1e2e`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,width:10,fontSize:9,color:`#6c7086`,userSelect:`none`},children:a?`▼`:`▶`}),(0,y.jsx)(`span`,{title:w_[e.status]??e.status,style:{flexShrink:0,width:16,height:16,borderRadius:3,background:f+`22`,color:f,fontSize:10,fontWeight:700,fontFamily:`monospace`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:e.status}),(0,y.jsxs)(`span`,{title:e.path,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontSize:12,fontFamily:`monospace`,direction:`rtl`,textAlign:`left`},children:[(0,y.jsx)(`span`,{style:{color:`#6c7086`},children:u}),(0,y.jsx)(`span`,{style:{color:`#cdd6f4`},children:d})]}),(0,y.jsxs)(`span`,{onClick:e=>e.stopPropagation(),style:{display:`flex`,gap:4},children:[(0,y.jsx)(ld,{label:n,tone:`neutral`,size:`compact`,variant:`ghost`,iconOnly:!0,onClick:r}),(0,y.jsx)(ld,{label:`Discard`,tone:`danger`,size:`compact`,variant:`ghost`,iconOnly:!0,onClick:i})]})]}),a&&c&&(0,y.jsx)(c_,{entry:c,path:e.path})]})}function E_({title:e,files:t,area:n,bulkLabel:r,onBulk:i,secondaryBulkLabel:a,onSecondaryBulk:o,rowActionLabel:s,onRowAction:c,onDiscard:l}){return t.length===0?null:(0,y.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 6px 4px`},children:[(0,y.jsxs)(`span`,{style:{fontSize:11,fontWeight:700,letterSpacing:.4,textTransform:`uppercase`,color:`#a6adc8`},children:[e,` `,(0,y.jsxs)(`span`,{style:{color:`#6c7086`},children:[`(`,t.length,`)`]})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,y.jsx)(ld,{label:r,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:i}),a&&o&&(0,y.jsx)(ld,{label:a,tone:`neutral`,size:`compact`,variant:`ghost`,onClick:o})]})]}),t.map(e=>(0,y.jsx)(T_,{file:e,area:n,actionLabel:typeof s==`function`?s(e):s,onAction:()=>c(e),onDiscard:()=>l(e)},`${e.status}:${e.path}`))]})}function D_({stagedCount:e,headSha:t,branch:n,amendable:r}){let i=R(e=>e.performCommit),a=R(e=>e.performRefAction),o=R(e=>e.runStageAction),s=R(e=>e.showError),c=R(e=>e.pendingMutation),l=R(e=>e.repoId),u=R(e=>e.worktreeCommitMessage),d=R(e=>e.setWorktreeCommitMessage),[f,p]=(0,b.useState)(()=>{try{return localStorage.getItem(`commitNoVerify`)===`true`}catch{return!1}}),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!1),[v,x]=(0,b.useState)(()=>{try{return localStorage.getItem(`commitSubmitAction`)===`commit-and-push`?`commit-and-push`:`commit`}catch{return`commit`}}),[S,C]=(0,b.useState)(!1),[w,T]=(0,b.useState)(!1),E=(0,b.useRef)(null),[ee,D]=(0,b.useState)(``),te=m&&r;(0,b.useEffect)(()=>{if(!S)return;let e=e=>{E.current?.contains(e.target)||C(!1)},t=e=>{e.key===`Escape`&&C(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[S]);let ne=e=>{try{localStorage.setItem(`commitNoVerify`,String(e))}catch{}p(e)},re=async e=>{if(h(e),e){_(!0);let e=await o(`stage-all`,[]);if(_(!1),!e){h(!1);return}if(u.trim().length===0&&l&&t)try{let e=await en(l,t),n=e.body?`${e.subject}\n\n${e.body}`:e.subject;R.getState().worktreeCommitMessage.trim().length===0&&(d(n),D(n))}catch{}}else u===ee&&(d(``),D(``))},ie=e>0&&u.trim().length>0&&!g&&!c,ae=ie&&(v===`commit`||!!n),oe=e=>{try{localStorage.setItem(`commitSubmitAction`,e)}catch{}x(e),C(!1)},se=async()=>{if(!ae||!await i(u.trim(),f,te)||(d(``),D(``),h(!1),v!==`commit-and-push`||!n))return;let e=R.getState(),r=e.refs.find(e=>e.kind===`head`&&e.isCurrent),o=r?.shortName??n,c=r?.targetSha??e.worktreeChanges?.headSha??t;if(!c){s(`Push failed`,`Could not determine the committed revision to push`);return}T(!0);try{await a(`push`,o,c)}catch(e){e&&typeof e==`object`&&e.code===`CONFLICT`?s(`Push rejected`,e,{label:`Force push`,run:()=>{a(`push`,o,c,!0).catch(e=>s(`Force push failed`,e))}}):s(`Push failed`,e)}finally{T(!1)}},O=g?`Staging…`:w?`Pushing…`:c?te?`Amending…`:`Committing…`:`${te?`Amend`:`Commit`}${v===`commit-and-push`?` & push`:``}${e>0?` (${e})`:``}`;return(0,y.jsxs)(`div`,{style:{borderBottom:`1px solid #313244`,padding:`10px 12px`,display:`flex`,flexDirection:`column`,gap:8,flexShrink:0},children:[(0,y.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),se())},placeholder:te?`Amend commit message`:e>0?`Commit message`:`Stage files to commit`,rows:3,style:{resize:`vertical`,minHeight:54,background:`#11111b`,border:`1px solid #313244`,borderRadius:6,color:`#cdd6f4`,fontSize:12,fontFamily:`inherit`,padding:`8px 10px`,outline:`none`},onFocus:e=>{e.currentTarget.style.borderColor=`#89b4fa`},onBlur:e=>{e.currentTarget.style.borderColor=`#313244`}}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,minWidth:0},children:[r&&(0,y.jsxs)(`label`,{title:`Replace the previous commit (git commit --amend) instead of creating a new one`,style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`#a6adc8`,cursor:`pointer`,userSelect:`none`},children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:m,disabled:g,onChange:e=>void re(e.target.checked),style:{accentColor:`#cba6f7`,cursor:g?`default`:`pointer`}}),`Amend`]}),(0,y.jsxs)(`label`,{title:`Commit with --no-verify (skips pre-commit and commit-msg hooks)`,style:{display:`flex`,alignItems:`center`,gap:6,fontSize:11,color:`#a6adc8`,cursor:`pointer`,userSelect:`none`},children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>ne(e.target.checked),style:{accentColor:`#fab387`,cursor:`pointer`}}),`Skip git hooks`]})]}),(0,y.jsxs)(`div`,{ref:E,style:{display:`flex`,position:`relative`,flexShrink:0},children:[(0,y.jsx)(`button`,{onClick:()=>void se(),disabled:!ae,title:v===`commit-and-push`&&!n?`Check out a branch before committing and pushing`:void 0,style:{background:ae?`#a6e3a1`:`#313244`,color:ae?`#11111b`:`#6c7086`,border:`none`,borderRadius:`6px 0 0 6px`,fontSize:12,fontWeight:700,padding:`6px 12px 6px 14px`,cursor:ae?`pointer`:`default`,fontFamily:`inherit`,whiteSpace:`nowrap`},children:O}),(0,y.jsx)(`button`,{type:`button`,"aria-label":`Choose commit action`,"aria-haspopup":`menu`,"aria-expanded":S,disabled:g||c||w,onClick:()=>C(e=>!e),style:{width:28,background:ie?`#a6e3a1`:`#313244`,color:ie?`#11111b`:`#6c7086`,border:`none`,borderLeft:`1px solid ${ie?`#11111b33`:`#45475a`}`,borderRadius:`0 6px 6px 0`,cursor:g||c||w?`default`:`pointer`,fontFamily:`inherit`,fontSize:10,fontWeight:700},children:`▼`}),S&&(0,y.jsx)(`div`,{role:`menu`,"aria-label":`Commit action`,style:{position:`absolute`,right:0,bottom:`calc(100% + 6px)`,zIndex:50,minWidth:154,padding:4,border:`1px solid #45475a`,borderRadius:7,background:`#1e1e2e`,boxShadow:`0 8px 24px #00000066`},children:[[`commit`,`Commit`],[`commit-and-push`,`Commit & push`]].map(([e,t])=>(0,y.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":v===e,onClick:()=>oe(e),style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,padding:`7px 9px`,border:`none`,borderRadius:5,background:v===e?`#313244`:`transparent`,color:`#cdd6f4`,cursor:`pointer`,fontFamily:`inherit`,fontSize:12,textAlign:`left`,whiteSpace:`nowrap`},children:[(0,y.jsx)(`span`,{style:{width:12,color:`#a6e3a1`},children:v===e?`✓`:``}),t]},e))})]})]})]})}function O_({operation:e,conflictedCount:t}){let n=R(e=>e.abortInProgressOperation),r=R(e=>e.continueInProgressOperation),i=R(e=>e.pendingMutation),a=e===`rebase`?`Rebase`:`Merge`,o=t>0?`${a} conflict`:`${a} in progress`,s=t>0?`${t} conflicted file${t===1?``:`s`} — resolve and stage them, then continue`:`All conflicts resolved — continue the ${e} to finish.`,c=!i&&t===0;return(0,y.jsxs)(`div`,{style:{border:`1px solid #8b3a4a`,background:`#5c243033`,borderRadius:7,padding:`10px 10px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12},children:[(0,y.jsxs)(`div`,{style:{minWidth:0,display:`flex`,flexDirection:`column`,gap:2},children:[(0,y.jsx)(`span`,{style:{color:`#f5a6b8`,fontSize:13,fontWeight:700},children:o}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`,fontSize:11},children:s})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flexShrink:0},children:[(0,y.jsx)(`span`,{title:c?void 0:t>0?`Stage all conflicted files first`:void 0,children:(0,y.jsx)(ld,{label:i?`Working…`:`Continue ${a}`,tone:`success`,onClick:()=>void r(e),disabled:!c})}),(0,y.jsx)(ld,{label:i?`Aborting…`:`Abort ${a}`,tone:`danger`,onClick:()=>void n(e),disabled:i})]})]})}function k_(){let e=R(e=>e.worktreeChanges),t=R(e=>e.runStageAction),n=R(e=>e.createStash),r=R(e=>e.pendingMutation),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(null),c=e?.staged??[],l=e?.unstaged??[],u=(0,b.useMemo)(()=>new Set([...c,...l].map(e=>e.path)).size,[c,l]),d=e?.mergeHeadShas?.length?`merge`:e?.rebaseHeadSha?`rebase`:null,f=(0,b.useMemo)(()=>new Set(l.filter(e=>e.status===`U`).map(e=>e.path)).size,[l]),p=e=>{s({title:`Discard file changes?`,message:`Discard all staged and unstaged changes to “${e.path}”? This cannot be undone.`,paths:e.oldPath?[e.path,e.oldPath]:[e.path],all:!1})};return(0,y.jsxs)(`div`,{style:{width:480,flexShrink:0,height:`100%`,borderLeft:`1px solid #313244`,background:`#181825`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsx)(vf,{open:i,title:`Stash changes`,label:`Message (optional)`,placeholder:`Describe these changes`,confirmLabel:`Stash`,allowEmpty:!0,onSubmit:e=>{a(!1),n(e||void 0)},onClose:()=>a(!1)}),(0,y.jsx)(yf,{open:!!o,title:o?.title??``,message:o?.message??``,confirmLabel:`Discard`,onConfirm:()=>{let e=o;s(null),e&&t(e.all?`discard-all`:`discard`,e.paths)},onClose:()=>s(null)}),(0,y.jsxs)(`div`,{style:{padding:`14px 16px 10px`,borderBottom:`1px solid #313244`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:8,minWidth:0},children:[(0,y.jsx)(`span`,{style:{fontSize:14,fontWeight:700,color:`#cdd6f4`,flexShrink:0},children:`Working tree`}),e?.branch&&(0,y.jsxs)(`span`,{style:{fontSize:12,color:`#89b4fa`,fontFamily:`monospace`,overflow:`hidden`,textOverflow:`ellipsis`},children:[`⎇ `,e.branch]})]}),u>0&&(0,y.jsx)(ld,{label:`Discard all`,tone:`danger`,size:`compact`,variant:`ghost`,disabled:r,onClick:()=>{s({title:`Discard all changes?`,message:`Permanently discard changes in ${u} file${u===1?``:`s`}, including untracked files? This cannot be undone.`,paths:[],all:!0})}})]}),(0,y.jsx)(`div`,{style:{fontSize:11,color:`#6c7086`,marginTop:2},children:u===0?`No changes`:`${u} changed file${u===1?``:`s`}`})]}),(0,y.jsx)(D_,{stagedCount:c.length,headSha:e?.headSha,branch:e?.branch,amendable:!d&&!!e?.headSha}),(0,y.jsxs)(`div`,{style:{flex:1,overflow:`auto`,padding:`12px 10px`,display:`flex`,flexDirection:`column`,gap:16},children:[d&&(0,y.jsx)(O_,{operation:d,conflictedCount:f}),u===0?(0,y.jsx)(`div`,{style:{color:`#45475a`,fontSize:13,textAlign:`center`,marginTop:28},children:`Working tree clean`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(E_,{title:`Staged`,files:c,area:`staged`,bulkLabel:`Unstage all`,onBulk:()=>t(`unstage-all`,[]),rowActionLabel:`Unstage`,onRowAction:e=>t(`unstage`,[e.path]),onDiscard:p}),(0,y.jsx)(E_,{title:`Changes`,files:l,area:`unstaged`,bulkLabel:`Stage all`,onBulk:()=>t(`stage-all`,[]),secondaryBulkLabel:`Stash`,onSecondaryBulk:()=>a(!0),rowActionLabel:e=>e.status===`U`?`Mark resolved`:`Stage`,onRowAction:e=>t(`stage`,[e.path]),onDiscard:p})]})]})]})}var A_={A:`#a6e3a1`,M:`#f9e2af`,D:`#f38ba8`,R:`#cba6f7`,C:`#94e2d5`,T:`#89b4fa`,U:`#fab387`};function j_(e){return new Date(e*1e3).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function M_({stash:e,diff:t,busy:n,onApply:r,onDrop:i,onNavigate:a}){let[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(!1),u=async()=>{if(!n){s(!0);try{await r(e.sha)}finally{s(!1)}}},d=async()=>{if(!n&&window.confirm(`Drop ${e.selector}? This permanently deletes the stashed changes.`)){l(!0);try{await i(e.sha)}finally{l(!1)}}};return(0,y.jsxs)(`div`,{style:{width:400,flexShrink:0,height:`100%`,background:`#181825`,borderLeft:`1px solid #313244`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{padding:`14px 16px 12px`,borderBottom:`1px solid #313244`,flexShrink:0},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,y.jsx)(`span`,{style:{padding:`2px 6px`,borderRadius:4,background:`#55323c`,color:`#f5c2e7`,fontFamily:`monospace`,fontSize:11,fontWeight:700},children:e.selector}),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontFamily:`monospace`,fontSize:10},children:e.sha.slice(0,10)})]}),(0,y.jsx)(`p`,{style:{margin:`0 0 11px`,color:`#cdd6f4`,fontSize:14,fontWeight:600,lineHeight:1.4},children:e.message||`Stashed changes`}),(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:3,fontSize:12},children:[(0,y.jsx)(`span`,{style:{minWidth:58,color:`#6c7086`},children:`Created`}),(0,y.jsx)(`span`,{style:{color:`#a6adc8`},children:j_(e.createdAt)})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12,fontSize:12},children:[(0,y.jsx)(`span`,{style:{minWidth:58,color:`#6c7086`},children:`Parent`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>a(e.parentSha),title:`Navigate to ${e.parentSha}`,style:{padding:0,border:`none`,background:`none`,color:`#89b4fa`,fontFamily:`monospace`,fontSize:11,textDecoration:`underline`,textUnderlineOffset:2,cursor:`pointer`},children:e.parentSha.slice(0,12)})]}),(0,y.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,y.jsx)(`button`,{type:`button`,onClick:()=>void u(),disabled:n,style:{padding:`5px 11px`,border:`1px solid #b87b89`,borderRadius:4,background:n?`#55323c`:`#f5c2e7`,color:n?`#a77b86`:`#311f25`,fontSize:11,fontWeight:750,cursor:n?`default`:`pointer`},children:o?`Applying…`:`Apply stash`}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>void d(),disabled:n,style:{padding:`5px 11px`,border:`1px solid #f38ba866`,borderRadius:4,background:`#311f25`,color:n?`#8b626c`:`#f38ba8`,fontSize:11,fontWeight:700,cursor:n?`default`:`pointer`},children:c?`Dropping…`:`Drop stash`})]})]}),(0,y.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:t?t.changedPaths.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{style:{position:`sticky`,top:0,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,padding:`8px 16px 4px`,background:`#181825`,color:`#6c7086`,fontSize:11,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`,zIndex:1},children:[(0,y.jsxs)(`span`,{children:[`Stashed files (`,t.changedPaths.length,`)`]}),(0,y.jsxs)(`span`,{style:{display:`flex`,gap:10,fontSize:10,letterSpacing:`0.04em`},children:[(0,y.jsxs)(`span`,{style:{color:`#a6e3a1`},children:[`+`,t.additions]}),(0,y.jsxs)(`span`,{style:{color:`#f38ba8`},children:[`-`,t.deletions]})]})]}),t.changedPaths.map((t,n)=>(0,y.jsx)(N_,{stashSha:e.sha,file:t},`${t.status}:${t.oldPath??``}:${t.path}:${n}`))]}):(0,y.jsx)(`div`,{style:{padding:16,color:`#6c7086`,fontSize:13},children:`No changed files`}):(0,y.jsx)(`div`,{style:{padding:16,color:`#6c7086`,fontSize:12},children:`Loading stashed files…`})})]})}function N_({stashSha:e,file:t}){let[n,r]=(0,b.useState)(!1),i=R(e=>e.loadStashFileDiff),a=R(n=>n.stashFileDiffs[xr(e,t.path)]),o=t.oldPath?`${t.oldPath} → ${t.path}`:t.path,s=A_[t.status]??`#cdd6f4`;return(0,b.useEffect)(()=>{n&&!a&&i(e,t)},[n,a,e,t,i]),(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{let a=!n;r(a),a&&i(e,t)},style:{width:`100%`,display:`flex`,alignItems:`center`,gap:8,padding:`5px 16px`,border:`none`,borderBottom:`1px solid #1e1e2e`,background:`transparent`,color:`#cdd6f4`,fontFamily:`inherit`,fontSize:12,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{style:{width:10,flexShrink:0,color:`#6c7086`,fontSize:9},children:n?`▼`:`▶`}),(0,y.jsx)(`span`,{style:{width:18,height:18,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:3,background:`${s}33`,color:s,fontSize:10,fontWeight:700},children:t.status}),(0,y.jsx)(`span`,{title:o,style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:12},children:o})]}),n&&a&&(0,y.jsx)(c_,{entry:a,path:t.path})]})}function P_({error:e,onDismiss:t}){let[n,r]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!e)return;r(!1);let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,y.jsx)(`div`,{onClick:t,style:{position:`fixed`,inset:0,background:`rgba(17, 17, 27, 0.75)`,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:1e3,padding:24},children:(0,y.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`error-dialog-title`,style:{background:`#1e1e2e`,border:`1px solid #45475a`,borderRadius:8,boxShadow:`0 12px 40px rgba(0, 0, 0, 0.5)`,maxWidth:760,width:`100%`,maxHeight:`80vh`,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`14px 18px`,borderBottom:`1px solid #313244`,background:`#181825`},children:[(0,y.jsx)(`span`,{id:`error-dialog-title`,style:{fontSize:14,fontWeight:600,color:`#f38ba8`},children:e.title}),(0,y.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close`,style:{background:`transparent`,border:`none`,color:`#6c7086`,fontSize:20,lineHeight:1,cursor:`pointer`,padding:4},children:`×`})]}),(0,y.jsx)(`pre`,{style:{margin:0,padding:`16px 18px`,overflow:`auto`,flex:1,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,fontSize:12.5,lineHeight:1.5,color:`#cdd6f4`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,userSelect:`text`},children:e.message}),(0,y.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,padding:`12px 18px`,borderTop:`1px solid #313244`,background:`#181825`},children:[(0,y.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e.message),r(!0),setTimeout(()=>r(!1),1500)}catch{}},style:{background:`#313244`,color:`#cdd6f4`,border:`1px solid #45475a`,borderRadius:6,padding:`6px 14px`,fontSize:13,cursor:`pointer`},children:n?`Copied`:`Copy`}),e.action&&(0,y.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.run(),t()},style:{background:`#f9e2af`,color:`#1e1e2e`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:13,fontWeight:600,cursor:`pointer`},children:e.action.label}),(0,y.jsx)(`button`,{type:`button`,onClick:t,style:{background:`#89b4fa`,color:`#1e1e2e`,border:`none`,borderRadius:6,padding:`6px 14px`,fontSize:13,fontWeight:600,cursor:`pointer`},children:`Close`})]})]})}):null}function F_(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function I_(e){let t=new Set(e.map(e=>e.agent)).size>1?`Agents ×${e.length}`:`${e[0].agent[0].toUpperCase()}${e[0].agent.slice(1)} ×${e.length}`,n=e.filter(e=>e.busy).length;return n>0?`${t} · ${n} working`:t}function L_(){let{sessions:e,capabilities:t,focusingPid:n,installing:r,focus:i,install:a,canInstallWindowCalls:o}=mi(),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(()=>{try{return localStorage.getItem(`agentSessionsShowAll`)===`true`}catch{return!1}}),d=e=>{try{localStorage.setItem(`agentSessionsShowAll`,String(e))}catch{}u(e)},[f,p]=(0,b.useState)(null),m=R(e=>e.repoPath),h=R(e=>e.openRepoByPath),g=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(!s)return;let e=e=>{g.current&&!g.current.contains(e.target)&&c(!1)};return window.addEventListener(`pointerdown`,e),()=>window.removeEventListener(`pointerdown`,e)},[s]);let _=async e=>{await i(e)&&c(!1)},v=e=>{!e.gitRoot||e.gitRoot===m||(c(!1),h(e.gitRoot))};if(e.length===0)return null;let x=di(e),S=m?x.filter(e=>e.gitRoot===m||e.cwd===m):[],C=x.filter(e=>!S.includes(e)),w=m===null||l?[...S,...C]:S,T=m!==null&&!l?C.length:0;return(0,y.jsxs)(`div`,{ref:g,style:{position:`relative`,flexShrink:0},children:[(0,y.jsxs)(`button`,{onClick:e=>{let t=e.currentTarget.getBoundingClientRect();p({top:t.bottom+4,right:window.innerWidth-t.right}),c(e=>!e)},title:`${e.length} agent session${e.length===1?``:`s`} running`,"aria-label":`Agent sessions`,style:{display:`flex`,alignItems:`center`,gap:5,padding:`4px 10px`,borderRadius:4,border:`1px solid ${S.length>0?`#a6e3a155`:`#313244`}`,background:S.length>0?`#a6e3a115`:`transparent`,color:S.length>0?`#a6e3a1`:`#6c7086`,fontSize:11,cursor:`pointer`},children:[[...new Set(e.map(e=>e.agent))].map(t=>(0,y.jsx)(_i,{agent:t,size:12,busy:e.some(e=>e.agent===t&&e.busy)},t)),I_(e)]}),s&&f&&(0,y.jsxs)(`div`,{style:{position:`fixed`,top:f.top,right:f.right,width:480,maxWidth:`calc(100vw - 16px)`,maxHeight:320,overflowY:`auto`,background:`#181825`,border:`1px solid #313244`,borderRadius:6,boxShadow:`0 8px 24px #00000088`,zIndex:100,padding:4},children:[o&&(0,y.jsxs)(`div`,{style:{padding:`8px 8px 10px`,borderBottom:`1px solid #313244`,marginBottom:4},children:[(0,y.jsx)(`div`,{style:{color:`#a6adc8`,fontSize:11,marginBottom:6,lineHeight:1.4},children:`Focusing terminal windows needs the “Activate Window By Title” GNOME\xA0Shell extension.`}),(0,y.jsx)(`button`,{onClick:()=>void a(),disabled:r,style:{padding:`4px 10px`,borderRadius:4,border:`1px solid #89b4fa55`,background:`#89b4fa20`,color:r?`#45475a`:`#89b4fa`,fontSize:11,cursor:r?`default`:`pointer`},children:r?`Waiting for GNOME confirmation…`:`Install extension`})]}),w.length===0&&(0,y.jsx)(`div`,{style:{padding:`8px`,color:`#585b70`,fontSize:11},children:`No agents running in this repository`}),w.map(e=>{let r=m!==null&&(e.gitRoot===m||e.cwd===m),i=e.gitRoot!==null&&!r,a=!e.focusable,o=a?e.kind===`terminal`?t?.displayServer===`wayland`?`Can't focus terminal windows on Wayland — install the 'Activate Window By Title' GNOME Shell extension`:`Can't focus terminal windows — install wmctrl`:`This session has no window to focus`:`Focus ${e.agent} window · ${pi(e)} (pid ${e.pid})`;return(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,width:`100%`,borderRadius:4,background:`transparent`,opacity:n!==null&&n!==e.pid?.5:1},onMouseEnter:e=>{e.currentTarget.style.background=`#31324466`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,y.jsxs)(`button`,{onClick:()=>v(e),disabled:!i,title:r?`${e.cwd} · currently open repository`:e.gitRoot?`Switch to ${e.gitRoot}`:`${e.cwd} · not inside a Git repository`,style:{display:`flex`,alignItems:`center`,gap:8,flex:1,minWidth:0,padding:`6px 8px`,border:`none`,background:`transparent`,color:`#a6adc8`,fontSize:11,textAlign:`left`,cursor:i?`pointer`:`default`},children:[(0,y.jsx)(`span`,{style:{flexShrink:0,display:`inline-flex`},children:(0,y.jsx)(_i,{agent:e.agent,size:13,busy:e.busy??!1})}),(0,y.jsxs)(`span`,{style:{flexShrink:0,fontFamily:`monospace`},children:[F_(e.cwd),e.count>1?` ×${e.count}`:``]}),(0,y.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1,color:`#7f849c`,textAlign:`right`},children:e.title??pi(e)}),e.busy&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#f9e2af`,fontSize:10},children:`working`}),r&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#a6e3a1`,fontSize:10},children:`this repo`})]}),(0,y.jsx)(`button`,{onClick:()=>!a&&void _(e),disabled:a||n!==null,title:o,style:{flexShrink:0,marginRight:6,padding:`3px 7px`,border:`1px solid #89b4fa55`,borderRadius:4,background:`#89b4fa18`,color:a?`#45475a`:`#89b4fa`,fontSize:10,cursor:a||n!==null?`default`:`pointer`},children:n===e.pid?`Focusing…`:`Focus on window`})]},`${e.pid}:${e.cwd}`)}),T>0&&(0,y.jsxs)(`button`,{onClick:()=>d(!0),style:{display:`block`,width:`100%`,padding:`6px 8px`,marginTop:w.length>0?2:0,border:`none`,borderTop:w.length>0?`1px solid #313244`:`none`,background:`transparent`,color:`#6c7086`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:[`▸ Show `,T,` agent`,T===1?``:`s`,` in other repositories`]}),m!==null&&l&&C.length>0&&(0,y.jsx)(`button`,{onClick:()=>d(!1),style:{display:`block`,width:`100%`,padding:`6px 8px`,border:`none`,borderTop:`1px solid #313244`,background:`transparent`,color:`#6c7086`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:`▾ Hide agents in other repositories`})]})]})}var R_=`modulepreload`,z_=function(e){return`/`+e},B_={},V_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=z_(t,n),t=s(t),t in B_)return;B_[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:R_,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},H_=(0,b.lazy)(async()=>({default:(await V_(()=>import(`./SettingsDialog-BZRf9cj0.js`),[])).SettingsDialog})),U_=`ingit`,W_=8;function G_(e){if(e.trim().length===0)return null;let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));if(t===-1)return{folder:`.`,prefix:e};let n=e.slice(t+1),r=e[t],i=e.slice(0,t);return/^[A-Za-z]:$/.test(i)&&(i+=r),i||=e.startsWith(`/`)||e.startsWith(`\\`)?r:`.`,{folder:i,prefix:n}}function K_(e){return e.replace(/[\\/]+$/,``).split(/[\\/]+/).at(-1)||e}function q_(e){if(!e)return 0;let t=new Set;for(let n of e.staged)t.add(n.path);for(let n of e.unstaged)t.add(n.path);return t.size}function J_(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(!1),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(``),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(!1),[f,p]=(0,b.useState)(!1),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)([]),[v,x]=(0,b.useState)(0),[S,C]=(0,b.useState)(null),w=(0,b.useRef)(null),{status:T,repoPath:E,currentWorktreePath:D,worktrees:te,recentRepos:ne,discoveredFolder:re,discoveredRepos:ie,openError:ae,errorDialog:oe,dismissError:se,showError:O,openRepoByPath:k,closeRepo:ce,openFromUrl:le,performRefAction:ue,showCommitMessages:de,setShowCommitMessages:fe,viewMode:A,setViewMode:pe,worktreeChanges:me,reloadFromServer:he}=R(ee(e=>({status:e.status,repoPath:e.repoPath,currentWorktreePath:e.currentWorktreePath,worktrees:e.worktrees,recentRepos:e.recentRepos,discoveredFolder:e.discoveredFolder,discoveredRepos:e.discoveredRepos,openError:e.openError,errorDialog:e.errorDialog,dismissError:e.dismissError,showError:e.showError,openRepoByPath:e.openRepoByPath,closeRepo:e.closeRepo,openFromUrl:e.openFromUrl,performRefAction:e.performRefAction,showCommitMessages:e.showCommitMessages,setShowCommitMessages:e.setShowCommitMessages,viewMode:e.viewMode,setViewMode:e.setViewMode,worktreeChanges:e.worktreeChanges,reloadFromServer:e.reloadFromServer}))),ge=async()=>{if(!i){a(!0);try{await ue(`fetch`,``,``)}catch(e){O(`Fetch failed`,e)}finally{a(!1)}}};(0,b.useEffect)(()=>{let e=()=>le();return window.addEventListener(`hashchange`,e),le(),()=>window.removeEventListener(`hashchange`,e)},[le]),(0,b.useEffect)(()=>{s(E??``),d(!1),p(!1)},[E]),(0,b.useEffect)(()=>{if(!c||!u){p(!1),h(!1);return}let e=G_(o);if(!e){_([]),p(!1),h(!1);return}let t=!1,n=window.setTimeout(()=>{h(!0),Bt(e.folder).then(n=>{if(t)return;let r=e.prefix.toLowerCase(),i=n.entries.filter(e=>r.length===0||e.name.toLowerCase().startsWith(r)).slice(0,W_);_(i),x(0),p(i.length>0)}).catch(()=>{t||(_([]),p(!1))}).finally(()=>{t||h(!1)})},120);return()=>{t=!0,window.clearTimeout(n)}},[u,c,o]),(0,b.useEffect)(()=>{if(T!==`ready`||!E){document.title=U_;return}document.title=`${K_(E)} (${q_(me)})`},[T,E,me]),(0,b.useEffect)(()=>{let e=document.visibilityState===`hidden`?Date.now():null,t=()=>{e=Date.now()},n=()=>{document.visibilityState!==`hidden`&&(e!==null&&Date.now()-e>3e4&&he(),e=null)},r=()=>{document.visibilityState===`hidden`?t():n()};return window.addEventListener(`blur`,t),window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,r),()=>{window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,r)}},[he]);let _e=e=>{e.preventDefault();let t=o.trim();if(!t||t===E){s(E??``),l(!1),e.currentTarget.querySelector(`input`)?.blur();return}k(t)},ve=()=>{let e=w.current?.getBoundingClientRect();e&&C({top:e.bottom+4,left:e.left,width:e.width})},ye=e=>{s(e.path),d(!1),p(!1),x(0)},be=c&&S!==null&&(m||f&&g.length>0);return T===`no-repo`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Ci,{onOpen:k,error:ae,recentRepos:ne,discoveredFolder:re,discoveredRepos:ie}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>r(!0),title:`Open settings`,"aria-label":`Open settings`,style:{position:`fixed`,top:14,right:14,zIndex:20,padding:`6px 11px`,border:`1px solid #45475a`,borderRadius:6,background:`#181825`,color:`#a6adc8`,fontSize:11,fontWeight:700,cursor:`pointer`},children:`Settings`}),n&&(0,y.jsx)(b.Suspense,{fallback:null,children:(0,y.jsx)(H_,{open:!0,onClose:()=>r(!1)})}),(0,y.jsx)(P_,{error:oe,onDismiss:se})]}):T===`loading`?(0,y.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:`100%`,width:`100%`,background:`#1e1e2e`,flexDirection:`column`,gap:16},children:[(0,y.jsx)(Z_,{}),(0,y.jsx)(`span`,{style:{color:`#6c7086`,fontSize:13},children:`Opening repository…`})]}):(0,y.jsxs)(`div`,{style:{display:`flex`,height:`100%`,width:`100%`,overflow:`hidden`,background:`#1e1e2e`},children:[e&&(0,y.jsx)(Y_,{onClose:()=>t(!1),onOpenSettings:()=>r(!0),settingsOpen:n}),(0,y.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,y.jsxs)(`div`,{style:{height:36,flexShrink:0,display:`flex`,alignItems:`center`,padding:`0 14px`,borderBottom:`1px solid #313244`,background:`#181825`,fontSize:12,color:`#6c7086`,gap:8,overflow:`hidden`},children:[!e&&(0,y.jsx)(`button`,{onClick:()=>t(!0),title:`Show refs`,"aria-label":`Show refs`,style:{width:24,height:20,flexShrink:0,padding:0,borderRadius:3,border:`1px solid #313244`,background:`#1e1e2e`,color:`#6c7086`,fontSize:13,lineHeight:`18px`,cursor:`pointer`},children:`☰`}),A===`history`&&(0,y.jsx)(`button`,{onClick:()=>fe(!de),style:{flexShrink:0,padding:`4px 10px`,borderRadius:4,border:`1px solid ${de?`#89b4fa55`:`#313244`}`,background:de?`#89b4fa20`:`transparent`,color:de?`#89b4fa`:`#6c7086`,fontSize:11,cursor:`pointer`},title:de?`Hide commit messages`:`Show commit messages`,children:de?`Hide messages`:`Show messages`}),(0,y.jsxs)(`div`,{style:{flexShrink:0,display:`flex`,borderRadius:4,border:`1px solid #313244`,overflow:`hidden`},children:[(0,y.jsx)(`button`,{onClick:()=>pe(`history`),style:{padding:`4px 10px`,border:`none`,background:A===`history`?`#89b4fa20`:`transparent`,color:A===`history`?`#89b4fa`:`#6c7086`,fontSize:11,cursor:`pointer`},title:`Branch history graph`,children:`History`}),(0,y.jsx)(`button`,{onClick:()=>pe(`reflog`),style:{padding:`4px 10px`,border:`none`,borderLeft:`1px solid #313244`,background:A===`reflog`?`#f9e2af20`:`transparent`,color:A===`reflog`?`#f9e2af`:`#6c7086`,fontSize:11,cursor:`pointer`},title:`Reflog time machine — recover lost commits and see where HEAD has been`,children:`Time Machine`})]}),te.filter(e=>!e.bare).length>1&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{style:{color:`#45475a`,marginLeft:8},children:`worktree`}),(0,y.jsx)(`select`,{value:D??``,onChange:e=>{e.target.value&&e.target.value!==D&&k(e.target.value)},title:`Switch linked worktree`,"aria-label":`Current linked worktree`,style:{maxWidth:220,flexShrink:1,minWidth:90,padding:`3px 5px`,border:`1px solid #313244`,borderRadius:4,outline:`none`,background:`#1e1e2e`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:11},children:te.filter(e=>!e.bare).map(e=>(0,y.jsxs)(`option`,{value:e.path,disabled:e.prunable,children:[K_(e.path),` — `,e.branchShortName??(e.detached?`detached ${e.headSha?.slice(0,8)??``}`:`no branch`)]},e.path))})]}),(0,y.jsx)(`span`,{style:{color:`#45475a`,marginLeft:8},children:`repo`}),(0,y.jsx)(`form`,{onSubmit:_e,style:{display:`flex`,flex:1,minWidth:0},children:(0,y.jsx)(`input`,{ref:w,value:o,onChange:e=>{s(e.target.value),d(!0),ve()},onFocus:e=>{l(!0),d(!1),ve(),e.currentTarget.select()},onBlur:()=>{l(!1),d(!1),p(!1)},onKeyDown:e=>{if(f&&g.length>0){if(e.key===`ArrowDown`){e.preventDefault(),x(e=>(e+1)%g.length);return}if(e.key===`ArrowUp`){e.preventDefault(),x(e=>(e-1+g.length)%g.length);return}if(e.key===`Tab`||e.key===`Enter`){e.preventDefault(),ye(g[v]);return}if(e.key===`Escape`){e.preventDefault(),d(!1),p(!1);return}}e.key===`Escape`&&(s(E??``),e.currentTarget.blur())},"aria-label":`Repository path`,title:`Type a repository path and press Enter to open it`,spellCheck:!1,autoComplete:`off`,role:`combobox`,"aria-expanded":be,"aria-controls":`header-repo-path-suggestions`,"aria-autocomplete":`list`,style:{width:`100%`,minWidth:0,padding:`3px 5px`,border:`1px solid ${c?`#89b4fa88`:`transparent`}`,borderRadius:3,outline:`none`,background:c?`#1e1e2e`:`transparent`,color:`#a6adc8`,fontFamily:`monospace`,fontSize:12}})}),be&&(0,y.jsx)(`div`,{id:`header-repo-path-suggestions`,role:`listbox`,style:{position:`fixed`,zIndex:100,top:S.top,left:S.left,width:S.width,maxHeight:238,overflowY:`auto`,padding:4,border:`1px solid #3d4253`,borderRadius:5,background:`#181825`,boxShadow:`0 8px 24px #00000088`},children:m&&g.length===0?(0,y.jsx)(`div`,{style:{padding:`7px 8px`,color:`#7f849c`,fontSize:11},children:`Loading…`}):g.map((e,t)=>(0,y.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===v,onMouseEnter:()=>x(t),onMouseDown:t=>{t.preventDefault(),ye(e)},style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,minWidth:0,padding:`6px 8px`,border:`none`,borderRadius:4,background:t===v?`#313244`:`transparent`,color:`#cdd6f4`,fontSize:11,textAlign:`left`,cursor:`pointer`},children:[(0,y.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`monospace`},children:e.path}),e.isGitRepo&&(0,y.jsx)(`span`,{style:{flexShrink:0,color:`#a6e3a1`,fontSize:10},children:`repo`})]},e.path))}),(0,y.jsx)(L_,{}),(0,y.jsxs)(`button`,{onClick:ge,disabled:i,title:`Fetch all remotes`,"aria-label":`Fetch all remotes`,style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,padding:`4px 10px`,borderRadius:4,border:`1px solid #313244`,background:`transparent`,color:i?`#45475a`:`#6c7086`,fontSize:11,cursor:i?`default`:`pointer`},children:[(0,y.jsx)(`span`,{style:{display:`inline-block`,animation:i?`spin 0.7s linear infinite`:`none`},children:`⟳`}),i?`Fetching…`:`Fetch`,(0,y.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})]}),(0,y.jsx)(`button`,{onClick:ce,title:`Close repository`,"aria-label":`Close repository`,style:{flexShrink:0,padding:`4px 10px`,borderRadius:4,border:`1px solid #313244`,background:`transparent`,color:`#6c7086`,fontSize:11,cursor:`pointer`},children:`Close`})]}),A===`reflog`?(0,y.jsx)(Fm,{}):(0,y.jsx)(hm,{})]}),(0,y.jsx)(X_,{}),(0,y.jsx)(P_,{error:oe,onDismiss:se}),n&&(0,y.jsx)(b.Suspense,{fallback:null,children:(0,y.jsx)(H_,{open:!0,onClose:()=>r(!1)})})]})}function Y_({onClose:e,onOpenSettings:t,settingsOpen:n}){let{refs:r,stashes:i,selectRef:a,selectStash:o,navigateTo:s,selectedStashSha:c,selectedSha:l}=R(ee(e=>({refs:e.refs,stashes:e.stashes,selectRef:e.selectRef,selectStash:e.selectStash,navigateTo:e.navigateTo,selectedStashSha:e.selectedStashSha,selectedSha:e.selectedSha})));return(0,y.jsx)(Ei,{refs:r,stashes:i,onSelectRef:a,onSelectStash:o,onSelectStashParent:e=>{s(e)},selectedStashSha:c,selectedSha:l,onClose:e,onOpenSettings:t,settingsOpen:n})}function X_(){let{selectedStashSha:e,stashes:t,stashDiff:n,pendingMutation:r,applyStash:i,dropStash:a,navigateTo:o,worktreeSelected:s,selectedSha:c,historyWindow:l,commitDetail:u,commitDiff:d,commitPRs:f,commitAuthorAvatars:p,commitCIStatus:m,githubUrl:h,checkoutSha:g,showError:_}=R(ee(e=>({selectedStashSha:e.selectedStashSha,stashes:e.stashes,stashDiff:e.stashDiff,pendingMutation:e.pendingMutation,applyStash:e.applyStash,dropStash:e.dropStash,navigateTo:e.navigateTo,worktreeSelected:e.worktreeSelected,selectedSha:e.selectedSha,historyWindow:e.historyWindow,commitDetail:e.commitDetail,commitDiff:e.commitDiff,commitPRs:e.commitPRs,commitAuthorAvatars:e.commitAuthorAvatars,commitCIStatus:e.commitCIStatus,githubUrl:e.githubUrl,checkoutSha:e.checkoutSha,showError:e.showError}))),v=e?t.find(t=>t.sha===e)??null:null,x=c?m[c]:void 0,S=x?.runs??[],C=(0,b.useMemo)(()=>{if(!c||!l)return null;let e=l.rows,t=new Map(e.map(e=>[e.sha,e]));for(let n of e){if(n.refNames.length===0)continue;let e=n.refNames.find(e=>!e.includes(`/`)),r=n.refNames.find(e=>e.includes(`/`)&&e!==`origin`&&e!==`HEAD`),i=e??r;if(!i)continue;let a=n.sha,o=new Set;for(;a&&!o.has(a);){if(a===c)return i;o.add(a);let e=t.get(a);if(!e||e.parentShas.length===0)break;a=e.parentShas[0]}}return null},[c,l]);return v?(0,y.jsx)(M_,{stash:v,diff:n,busy:r,onApply:i,onDrop:a,onNavigate:e=>{o(e)}}):s?(0,y.jsx)(k_,{}):(0,y.jsx)(g_,{commit:u,diff:d,branchName:C,prs:f,authorAvatarUrl:u?p[u.sha]:void 0,ciState:x?.state,ciRuns:S,githubUrl:h,onNavigate:o,onCheckout:async e=>{try{await g(e)}catch(e){_(`Checkout failed`,e)}}})}function Z_(){return(0,y.jsx)(`div`,{style:{width:32,height:32,border:`3px solid #313244`,borderTopColor:`#89b4fa`,borderRadius:`50%`,animation:`spin 0.7s linear infinite`},children:(0,y.jsx)(`style`,{children:`@keyframes spin { to { transform: rotate(360deg); } }`})})}(0,x.createRoot)(document.getElementById(`root`)).render((0,y.jsx)(b.StrictMode,{children:(0,y.jsx)(J_,{})}));export{Nd as a,$d as c,wd as d,R as f,c as h,Bd as i,Vd as l,u as m,tf as n,Pd as o,f as p,kd as r,ef as s,Dd as t,Qd as u};