cezarion 0.18.0-dev.8566 → 0.18.0-dev.8576
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/web/dist/assets/accounts-section-COizLyTO.js +1 -0
- package/web/dist/assets/{activity-motion-0wHCeUs7.css → activity-motion-DcKVM8fM.css} +1 -1
- package/web/dist/assets/activity-motion-DfI5xoMG.js +2 -0
- package/web/dist/assets/activity-route-BQs2vBeo.js +1 -0
- package/web/dist/assets/agent-config-section-BwBo-HRw.js +7 -0
- package/web/dist/assets/agent-defaults-section-h-Gjb_gh.js +1 -0
- package/web/dist/assets/appearance-Bcl2amXv.js +1 -0
- package/web/dist/assets/archive-on-merge-field-Bm8miJjt.js +1 -0
- package/web/dist/assets/attention-8bNiiAFt.js +1 -0
- package/web/dist/assets/automations-route-CutF-cGn.css +1 -0
- package/web/dist/assets/automations-route-rSezHxBp.js +2 -0
- package/web/dist/assets/{badge-D9JrXe0o.js → badge-DQ3U69Ht.js} +1 -1
- package/web/dist/assets/{button-BQ2y4XRB.js → button-B7MKxYjT.js} +1 -1
- package/web/dist/assets/change-counts-CW7O8g5Y.js +1 -0
- package/web/dist/assets/check-OP-CVgZG.js +1 -0
- package/web/dist/assets/circle-x-7nTlobAF.js +1 -0
- package/web/dist/assets/{command-CDt1BsZy.js → command-KdW7aO0N.js} +1 -1
- package/web/dist/assets/commit-list-DtEqtn9o.js +1 -0
- package/web/dist/assets/{dialog-BVF6dIeS.js → dialog-B531GGAo.js} +1 -1
- package/web/dist/assets/diff-BK789dS0.js +3 -0
- package/web/dist/assets/diff-controls-BFqQNxRu.js +1 -0
- package/web/dist/assets/diff-view-BEgQ7jZV.js +11 -0
- package/web/dist/assets/dist-Czz3Y5qH.js +1 -0
- package/web/dist/assets/file-preview-CDWTFZ4P.js +2 -0
- package/web/dist/assets/{folder-browser-CbWAXTsX.js → folder-browser-BfclRPcX.js} +1 -1
- package/web/dist/assets/format-BU7D3IfE.js +1 -0
- package/web/dist/assets/git-toolbar-Pugtjt-9.js +1 -0
- package/web/dist/assets/github-CvpaGHe6.js +1 -0
- package/web/dist/assets/global-activity-route-Di_ICsRI.js +1 -0
- package/web/dist/assets/hourglass-CikYdGGQ.js +1 -0
- package/web/dist/assets/image-preview-Dx2w5oIn.js +1 -0
- package/web/dist/assets/index-CGjknHnV.css +1 -0
- package/web/dist/assets/index-CJFT0IZP.js +21 -0
- package/web/dist/assets/{label-Dbp-6aiT.js → label-DEH7fJN4.js} +1 -1
- package/web/dist/assets/{live-reads-CR3-q01w.js → live-reads-BJ9eDISf.js} +1 -1
- package/web/dist/assets/live-refetch-VoLPvzhe.js +1 -0
- package/web/dist/assets/loader-circle-CPBhhDbB.js +1 -0
- package/web/dist/assets/{markdown-CzP2Mv9j.js → markdown-Dv0r75AX.js} +1 -1
- package/web/dist/assets/{notifications-section-BsHRSzNs.js → notifications-section-DCiqPl3M.js} +1 -1
- package/web/dist/assets/open-in-menu-HM5l7Bwk.js +1 -0
- package/web/dist/assets/{preview-pane-connected-dvf7gtbB.js → preview-pane-connected-WV9oolnn.js} +3 -3
- package/web/dist/assets/{project-location-c1oHm2yu.js → project-location-CfJLc6aJ.js} +1 -1
- package/web/dist/assets/{project-router-DucFIl_x.js → project-router-Bii3ofOk.js} +1 -1
- package/web/dist/assets/{project-scope-context-C912rTJP.js → project-scope-context-BdqKyBHa.js} +3 -3
- package/web/dist/assets/projects-section-D2cACaaG.js +1 -0
- package/web/dist/assets/prompt-templates-section-toLPd5u2.js +1 -0
- package/web/dist/assets/queries-C7VNk-nW.js +1 -0
- package/web/dist/assets/{reference-chip-1BEDWxcS.js → reference-chip-rylFalfg.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-BD9jRcE6.js → remote-settings-notice-N9vtBTIK.js} +1 -1
- package/web/dist/assets/repo-git-DJym0aRY.js +1 -0
- package/web/dist/assets/{report-reader-P41jUFxW.js → report-reader-CjskGtxS.js} +1 -1
- package/web/dist/assets/reports-B-G9HA48.js +1 -0
- package/web/dist/assets/reports-CNFNb36Z.css +1 -0
- package/web/dist/assets/resources-section-B88h1y0Q.js +1 -0
- package/web/dist/assets/run-header-B-olCSdg.js +2 -0
- package/web/dist/assets/{run-header-CC7VUTg9.css → run-header-Ccnr9k0X.css} +1 -1
- package/web/dist/assets/save-cue-Cd3ZAPBS.js +1 -0
- package/web/dist/assets/select-BaydzE-I.js +1 -0
- package/web/dist/assets/{session-context-section-BsT7MXjZ.js → session-context-section-BJKRXbss.js} +2 -2
- package/web/dist/assets/settings-agent-picker-6xZMIC_D.js +1 -0
- package/web/dist/assets/settings-field-DP9sYv5a.js +1 -0
- package/web/dist/assets/settings-select-CCIMGnyA.js +1 -0
- package/web/dist/assets/settings-shell-BkTgs1S9.js +1 -0
- package/web/dist/assets/settings-shell-iSd4xMWS.css +1 -0
- package/web/dist/assets/{sidebar-section-ekWNCGBw.js → sidebar-section-B57HIEgv.js} +1 -1
- package/web/dist/assets/skills-pBrfwrKF.js +1 -0
- package/web/dist/assets/{status-dot-DtAOFiIi.js → status-dot-BRzVlF2X.js} +1 -1
- package/web/dist/assets/switch-SP8pw5uU.js +1 -0
- package/web/dist/assets/{tab-link-Bh6CcIR7.js → tab-link-B1CULYRs.js} +1 -1
- package/web/dist/assets/task-changes-CXldTh93.js +1 -0
- package/web/dist/assets/task-commits-BZ3B_GPB.js +1 -0
- package/web/dist/assets/task-files-BSfmCkJc.js +1 -0
- package/web/dist/assets/{task-github-item-aab_QTS3.js → task-github-item-v2bygvdO.js} +1 -1
- package/web/dist/assets/{task-groups-Ziytm1Sm.js → task-groups-BbnYlkYj.js} +1 -1
- package/web/dist/assets/task-thread-BPWnJ7Qx.js +9 -0
- package/web/dist/assets/task-thread-DzADOhZd.css +1 -0
- package/web/dist/assets/{tasks-table-wTQZb7nJ.js → tasks-table-Cx7AM7lZ.js} +1 -1
- package/web/dist/assets/thread-state-R0MTvwlo.js +4 -0
- package/web/dist/assets/use-hand-to-agent-state-B6h6kcQg.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-BckHuhr8.js +1 -0
- package/web/dist/assets/{useInfiniteQuery-CPEWc6dl.js → useInfiniteQuery--iQKfpUQ.js} +1 -1
- package/web/dist/assets/useQuery-BSyhc3l3.js +1 -0
- package/web/dist/assets/workflows-BBc2PFDB.js +7 -0
- package/web/dist/assets/workflows-C6suai0L.css +1 -0
- package/web/dist/assets/workspace-tools-CiTG-ArW.js +1 -0
- package/web/dist/assets/worktrees-section-C07tNayi.js +4 -0
- package/web/dist/index.html +26 -24
- package/web/dist/assets/accounts-section-W97a1ty2.js +0 -1
- package/web/dist/assets/activity-motion-zWlkG-V_.js +0 -2
- package/web/dist/assets/activity-route-CHfp3gWS.js +0 -1
- package/web/dist/assets/agent-config-section-Ulvfv3n6.js +0 -1
- package/web/dist/assets/agent-defaults-section-DuReu1Ob.js +0 -1
- package/web/dist/assets/appearance-DpMIBP4Y.js +0 -1
- package/web/dist/assets/archive-on-merge-field-C83q8HKD.js +0 -1
- package/web/dist/assets/attention-BFUaj1mU.js +0 -1
- package/web/dist/assets/automations-route-Kro31C3p.js +0 -1
- package/web/dist/assets/commit-diff-panel-CE7372Fz.js +0 -1
- package/web/dist/assets/diff-DUljAzi_.js +0 -3
- package/web/dist/assets/diff-controls-BSWICnsb.js +0 -1
- package/web/dist/assets/diff-view-CYusqV5H.js +0 -11
- package/web/dist/assets/dist-C28wFbz0.js +0 -1
- package/web/dist/assets/file-preview-Cj3QRSUt.js +0 -2
- package/web/dist/assets/format-BNCkW110.js +0 -1
- package/web/dist/assets/git-toolbar-B9t94bg6.js +0 -1
- package/web/dist/assets/github-D0U0_v8D.js +0 -1
- package/web/dist/assets/global-activity-route-Co9vGT5h.js +0 -1
- package/web/dist/assets/hourglass-B0lPAJvT.js +0 -1
- package/web/dist/assets/image-preview-CNBuRrK5.js +0 -1
- package/web/dist/assets/index-2DP8fWMQ.css +0 -1
- package/web/dist/assets/index-BNqZkH0S.js +0 -21
- package/web/dist/assets/live-refetch-CZb2VOyu.js +0 -1
- package/web/dist/assets/open-in-menu-mDtfa4ES.js +0 -1
- package/web/dist/assets/projects-section-ds7mvM9K.js +0 -1
- package/web/dist/assets/prompt-templates-section-DsBj0E0U.js +0 -1
- package/web/dist/assets/queries-dOBokhuR.js +0 -1
- package/web/dist/assets/repo-git-j8MdHS3x.js +0 -1
- package/web/dist/assets/reports-B7QAzibP.css +0 -1
- package/web/dist/assets/reports-C-Zop07b.js +0 -1
- package/web/dist/assets/resources-section-Cy0EShrb.js +0 -1
- package/web/dist/assets/run-header-Cd6Z_Juw.js +0 -2
- package/web/dist/assets/settings-agent-picker-B8jmxleN.js +0 -1
- package/web/dist/assets/settings-field-Bl6WuvGX.js +0 -1
- package/web/dist/assets/settings-shell-f9o6rKSB.js +0 -1
- package/web/dist/assets/settings-shell-xK8txSJo.css +0 -1
- package/web/dist/assets/skills-DweafQfi.js +0 -1
- package/web/dist/assets/switch-Bv2Zf1uU.js +0 -1
- package/web/dist/assets/task-changes-Db7mjsBc.js +0 -1
- package/web/dist/assets/task-commits-A0qKHFEp.js +0 -1
- package/web/dist/assets/task-files-Cf4k3GXd.js +0 -1
- package/web/dist/assets/task-thread-Di1O-QIZ.js +0 -9
- package/web/dist/assets/task-thread-DtQ6uGfQ.css +0 -1
- package/web/dist/assets/thread-state-BLpB8owZ.js +0 -4
- package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +0 -1
- package/web/dist/assets/use-hand-to-agent-state-Dkln0aUg.js +0 -1
- package/web/dist/assets/useQuery-BOEhMTCg.js +0 -1
- package/web/dist/assets/workflows-C21NystW.css +0 -1
- package/web/dist/assets/workflows-D0FFSZRo.js +0 -7
- package/web/dist/assets/workspace-tools-Bc-FDfxj.js +0 -1
- package/web/dist/assets/worktrees-section-KHsxVu0L.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r,t as i}from"./utils-DSMR_WLb.js";import{X as a}from"./design-icons-CzEoMH9c.js";import{i as o}from"./dist-BW234Kg5.js";import{a as s}from"./dist-C5mlVBmd.js";import{l as c}from"./es2015-CQth82uv.js";import{a as l,o as u,r as d,t as f}from"./dist-Da4ckcJG.js";import{i as p,o as m,r as h,s as g,t as _}from"./dialog-BVF6dIeS.js";var v=e(t(),1),y=1,b=.9,x=.8,S=.17,C=.1,w=.999,T=.9999,E=.99,D=/[\\\/_+.#"@\[\(\{&]/,O=/[\\\/_+.#"@\[\(\{&]/g,k=/[\s-]/,A=/[\s-]/g;function j(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?y:E;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=j(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=y:D.test(e.charAt(l-1))?(d*=x,p=e.slice(i,l-1).match(O),p&&i>0&&(d*=w**+p.length)):k.test(e.charAt(l-1))?(d*=b,m=e.slice(i,l-1).match(A),m&&i>0&&(d*=w**+m.length)):(d*=S,i>0&&(d*=w**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=T)),(d<C&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=j(e,t,n,r,l+1,a+2,o),f*C>d&&(d=f*C)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function M(e){return e.toLowerCase().replace(A,` `)}function N(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,j(e,t,M(e),M(t),0,0,{})}var P=`[cmdk-group=""]`,F=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,I=`[cmdk-item=""]`,L=`${I}:not([aria-disabled="true"])`,R=`cmdk-item-select`,z=`data-value`,te=(e,t,n)=>N(e,t,n),ne=v.createContext(void 0),B=()=>v.useContext(ne),re=v.createContext(void 0),V=()=>v.useContext(re),H=v.createContext(void 0),U=v.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),l=J(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:y=!0,...b}=e,x=c(),S=c(),C=c(),w=v.useRef(null),T=fe();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,E.emit()}},[f]),Y(()=>{T(6,M)},[]);let E=v.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)j(),k(),T(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(C);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(T(7,()=>{n.current.selectedItemId=N()?.id,E.emit()}),r||T(5,M),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),D=v.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),T(3,()=>{j(),k(),n.current.value||A(),E.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=N();T(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),E.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=l.current?.filter??te;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=w.current;B().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(F);t?t.appendChild(e.parentElement===t?e:e.closest(`${F} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${F} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${P}[${z}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=B().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(z);E.setState(`value`,e||void 0)}function j(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function M(){var e;let t=N();t&&(t.parentElement?.firstChild===t&&((e=t.closest(P)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function N(){return w.current?.querySelector(`${I}[aria-selected="true"]`)}function B(){return Array.from(w.current?.querySelectorAll(L)||[])}function V(e){let t=B()[e];t&&E.setState(`value`,t.getAttribute(z))}function H(e){var t;let n=N(),r=B(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&E.setState(`value`,a.getAttribute(z))}function U(e){let t=N()?.closest(P),n;for(;t&&!n;)t=e>0?le(t,P):ue(t,P),n=t?.querySelector(L);n?E.setState(`value`,n.getAttribute(z)):H(e)}let W=()=>V(B().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):H(1)},K=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?U(-1):H(-1)};return v.createElement(s.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{var t;(t=b.onKeyDown)==null||t.call(b,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:y&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:y&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=N();if(t){let e=new Event(R);t.dispatchEvent(e)}}}}},v.createElement(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:me},u),Q(e,e=>v.createElement(re.Provider,{value:E},v.createElement(ne.Provider,{value:D},e))))}),W=v.forwardRef((e,t)=>{let n=c(),r=v.useRef(null),i=v.useContext(H),a=B(),l=J(e),u=l.current?.forceMount??i?.forceMount;Y(()=>{if(!u)return a.item(n,i?.id)},[u]);let d=de(n,r,[e.value,e.children,r],e.keywords),f=V(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);v.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(R,h),()=>t.removeEventListener(R,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:y,onSelect:b,forceMount:x,keywords:S,...C}=e;return v.createElement(s.div,{ref:o(r,t),...C,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),G=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,l=c(),u=v.useRef(null),d=v.useRef(null),f=c(),p=B(),m=Z(e=>i||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));Y(()=>p.group(l),[]),de(l,u,[e.value,e.heading,d]);let h=v.useMemo(()=>({id:l,forceMount:i}),[i]);return v.createElement(s.div,{ref:o(u,t),...a,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&v.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>v.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},v.createElement(H.Provider,{value:h},e))))}),K=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:v.createElement(s.div,{ref:o(i,t),...r,"cmdk-separator":``,role:`separator`})}),ie=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=V(),o=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=B();return v.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),v.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),ae=v.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=v.useRef(null),c=v.useRef(null),l=Z(e=>e.selectedItemId),u=B();return v.useEffect(()=>{if(c.current&&a.current){let e=c.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),v.createElement(s.div,{ref:o(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Q(e,e=>v.createElement(`div`,{ref:o(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),oe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return v.createElement(f,{open:n,onOpenChange:r},v.createElement(u,{container:o},v.createElement(l,{"cmdk-overlay":``,className:i}),v.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},v.createElement(U,{ref:t,...s}))))}),se=v.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?v.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ce=v.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return v.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>v.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(U,{List:ae,Item:W,Input:ie,Group:G,Separator:K,Dialog:oe,Empty:se,Loading:ce});function le(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=v.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?v.useEffect:v.useLayoutEffect;function X(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=V(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function de(e,t,n,r=[]){let i=v.useRef(),a=B();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(z,s),i.current=s}),i}var fe=()=>{let[e,t]=v.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function pe(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(pe(t),{ref:t.ref},n(t.props.children)):n(t)}var me={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function he({className:e,...t}){return(0,$.jsx)(q,{"data-slot":`command`,className:i(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ge({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:a,showCloseButton:o=!0,filter:s,...c}){return(0,$.jsxs)(_,{...c,children:[(0,$.jsxs)(m,{className:`sr-only`,children:[(0,$.jsx)(g,{children:e}),(0,$.jsx)(p,{children:t})]}),(0,$.jsx)(h,{className:i(`overflow-hidden p-0`,a),showCloseButton:o,children:(0,$.jsx)(he,{...r({filter:s}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function _e({className:e,...t}){return(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,$.jsx)(a,{className:`size-4 shrink-0 opacity-50`}),(0,$.jsx)(q.Input,{"data-slot":`command-input`,className:i(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function ve({className:e,onPointerMoveCapture:t,...n}){return(0,$.jsx)(q.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:i(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ye({...e}){return(0,$.jsx)(q.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function be({className:e,...t}){return(0,$.jsx)(q.Group,{"data-slot":`command-group`,className:i(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(q.Separator,{"data-slot":`command-separator`,className:i(`-mx-1 h-px bg-border`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(q.Item,{"data-slot":`command-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:i(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}export{_e as a,xe as c,be as i,Ce as l,ge as n,Se as o,ye as r,ve as s,he as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r,t as i}from"./utils-DSMR_WLb.js";import{X as a}from"./design-icons-CzEoMH9c.js";import{i as o}from"./dist-BW234Kg5.js";import{a as s}from"./dist-C5mlVBmd.js";import{l as c}from"./es2015-CQth82uv.js";import{a as l,o as u,r as d,t as f}from"./dist-Da4ckcJG.js";import{i as p,o as m,r as h,s as g,t as _}from"./dialog-B531GGAo.js";var v=e(t(),1),y=1,b=.9,x=.8,S=.17,C=.1,w=.999,T=.9999,E=.99,D=/[\\\/_+.#"@\[\(\{&]/,O=/[\\\/_+.#"@\[\(\{&]/g,k=/[\s-]/,A=/[\s-]/g;function j(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?y:E;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=j(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=y:D.test(e.charAt(l-1))?(d*=x,p=e.slice(i,l-1).match(O),p&&i>0&&(d*=w**+p.length)):k.test(e.charAt(l-1))?(d*=b,m=e.slice(i,l-1).match(A),m&&i>0&&(d*=w**+m.length)):(d*=S,i>0&&(d*=w**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=T)),(d<C&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=j(e,t,n,r,l+1,a+2,o),f*C>d&&(d=f*C)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function M(e){return e.toLowerCase().replace(A,` `)}function N(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,j(e,t,M(e),M(t),0,0,{})}var P=`[cmdk-group=""]`,F=`[cmdk-group-items=""]`,ee=`[cmdk-group-heading=""]`,I=`[cmdk-item=""]`,L=`${I}:not([aria-disabled="true"])`,R=`cmdk-item-select`,z=`data-value`,te=(e,t,n)=>N(e,t,n),ne=v.createContext(void 0),B=()=>v.useContext(ne),re=v.createContext(void 0),V=()=>v.useContext(re),H=v.createContext(void 0),U=v.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),l=J(e),{label:u,children:d,value:f,onValueChange:p,filter:m,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:y=!0,...b}=e,x=c(),S=c(),C=c(),w=v.useRef(null),T=fe();Y(()=>{if(f!==void 0){let e=f.trim();n.current.value=e,E.emit()}},[f]),Y(()=>{T(6,M)},[]);let E=v.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)j(),k(),T(1,A);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(C);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(T(7,()=>{n.current.selectedItemId=N()?.id,E.emit()}),r||T(5,M),l.current?.value!==void 0){let e=t??``;(o=(a=l.current).onValueChange)==null||o.call(a,e);return}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),D=v.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,O(t,r)),T(2,()=>{k(),E.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),T(3,()=>{j(),k(),n.current.value||A(),E.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=N();T(4,()=>{j(),t?.getAttribute(`id`)===e&&A(),E.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e[`aria-label`],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:x,inputId:C,labelId:S,listInnerRef:w}),[]);function O(e,t){let r=l.current?.filter??te;return e?r(e,n.current.search,t):0}function k(){if(!n.current.search||l.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=w.current;B().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(F);t?t.appendChild(e.parentElement===t?e:e.closest(`${F} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${F} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=w.current?.querySelector(`${P}[${z}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function A(){let e=B().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(z);E.setState(`value`,e||void 0)}function j(){if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=O(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function M(){var e;let t=N();t&&(t.parentElement?.firstChild===t&&((e=t.closest(P)?.querySelector(ee))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function N(){return w.current?.querySelector(`${I}[aria-selected="true"]`)}function B(){return Array.from(w.current?.querySelectorAll(L)||[])}function V(e){let t=B()[e];t&&E.setState(`value`,t.getAttribute(z))}function H(e){var t;let n=N(),r=B(),i=r.findIndex(e=>e===n),a=r[i+e];(t=l.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&E.setState(`value`,a.getAttribute(z))}function U(e){let t=N()?.closest(P),n;for(;t&&!n;)t=e>0?le(t,P):ue(t,P),n=t?.querySelector(L);n?E.setState(`value`,n.getAttribute(z)):H(e)}let W=()=>V(B().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):H(1)},K=e=>{e.preventDefault(),e.metaKey?V(0):e.altKey?U(-1):H(-1)};return v.createElement(s.div,{ref:t,tabIndex:-1,...b,"cmdk-root":``,onKeyDown:e=>{var t;(t=b.onKeyDown)==null||t.call(b,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:y&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:y&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),V(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=N();if(t){let e=new Event(R);t.dispatchEvent(e)}}}}},v.createElement(`label`,{"cmdk-label":``,htmlFor:D.inputId,id:D.labelId,style:me},u),Q(e,e=>v.createElement(re.Provider,{value:E},v.createElement(ne.Provider,{value:D},e))))}),W=v.forwardRef((e,t)=>{let n=c(),r=v.useRef(null),i=v.useContext(H),a=B(),l=J(e),u=l.current?.forceMount??i?.forceMount;Y(()=>{if(!u)return a.item(n,i?.id)},[u]);let d=de(n,r,[e.value,e.children,r],e.keywords),f=V(),p=Z(e=>e.value&&e.value===d.current),m=Z(e=>u||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);v.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(R,h),()=>t.removeEventListener(R,h)},[m,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=l.current).onSelect)==null||t.call(e,d.current)}function g(){f.setState(`value`,d.current,!0)}if(!m)return null;let{disabled:_,value:y,onSelect:b,forceMount:x,keywords:S,...C}=e;return v.createElement(s.div,{ref:o(r,t),...C,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!p,"data-disabled":!!_,"data-selected":!!p,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),G=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,l=c(),u=v.useRef(null),d=v.useRef(null),f=c(),p=B(),m=Z(e=>i||p.filter()===!1?!0:!e.search||e.filtered.groups.has(l));Y(()=>p.group(l),[]),de(l,u,[e.value,e.heading,d]);let h=v.useMemo(()=>({id:l,forceMount:i}),[i]);return v.createElement(s.div,{ref:o(u,t),...a,"cmdk-group":``,role:`presentation`,hidden:!m||void 0},n&&v.createElement(`div`,{ref:d,"cmdk-group-heading":``,"aria-hidden":!0,id:f},n),Q(e,e=>v.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?f:void 0},v.createElement(H.Provider,{value:h},e))))}),K=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:v.createElement(s.div,{ref:o(i,t),...r,"cmdk-separator":``,role:`separator`})}),ie=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=V(),o=Z(e=>e.search),c=Z(e=>e.selectedItemId),l=B();return v.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),v.createElement(s.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),ae=v.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=v.useRef(null),c=v.useRef(null),l=Z(e=>e.selectedItemId),u=B();return v.useEffect(()=>{if(c.current&&a.current){let e=c.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),v.createElement(s.div,{ref:o(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Q(e,e=>v.createElement(`div`,{ref:o(c,u.listInnerRef),"cmdk-list-sizer":``},e)))}),oe=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return v.createElement(f,{open:n,onOpenChange:r},v.createElement(u,{container:o},v.createElement(l,{"cmdk-overlay":``,className:i}),v.createElement(d,{"aria-label":e.label,"cmdk-dialog":``,className:a},v.createElement(U,{ref:t,...s}))))}),se=v.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?v.createElement(s.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ce=v.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return v.createElement(s.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>v.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(U,{List:ae,Item:W,Input:ie,Group:G,Separator:K,Dialog:oe,Empty:se,Loading:ce});function le(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ue(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=v.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?v.useEffect:v.useLayoutEffect;function X(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=V(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function de(e,t,n,r=[]){let i=v.useRef(),a=B();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(z,s),i.current=s}),i}var fe=()=>{let[e,t]=v.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function pe(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(pe(t),{ref:t.ref},n(t.props.children)):n(t)}var me={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function he({className:e,...t}){return(0,$.jsx)(q,{"data-slot":`command`,className:i(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function ge({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:a,showCloseButton:o=!0,filter:s,...c}){return(0,$.jsxs)(_,{...c,children:[(0,$.jsxs)(m,{className:`sr-only`,children:[(0,$.jsx)(g,{children:e}),(0,$.jsx)(p,{children:t})]}),(0,$.jsx)(h,{className:i(`overflow-hidden p-0`,a),showCloseButton:o,children:(0,$.jsx)(he,{...r({filter:s}),className:`**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function _e({className:e,...t}){return(0,$.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex min-h-11 shrink-0 items-center gap-2 rounded-ss-[inherit] rounded-se-[inherit] border-b px-3`,children:[(0,$.jsx)(a,{className:`size-4 shrink-0 opacity-50`}),(0,$.jsx)(q.Input,{"data-slot":`command-input`,className:i(`flex h-11 min-w-0 flex-1 rounded-md bg-transparent py-3 text-base md:text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function ve({className:e,onPointerMoveCapture:t,...n}){return(0,$.jsx)(q.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:i(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function ye({...e}){return(0,$.jsx)(q.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function be({className:e,...t}){return(0,$.jsx)(q.Group,{"data-slot":`command-group`,className:i(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(q.Separator,{"data-slot":`command-separator`,className:i(`-mx-1 h-px bg-border`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(q.Item,{"data-slot":`command-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(`span`,{"data-slot":`command-shortcut`,className:i(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}export{_e as a,xe as c,be as i,Ce as l,ge as n,Se as o,ye as r,ve as s,he as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Nn as i}from"./project-scope-context-BdqKyBHa.js";import{X as a,j as o,ot as s,r as c}from"./design-icons-CzEoMH9c.js";import{n as l}from"./diff-controls-BFqQNxRu.js";import{u}from"./reference-chip-rylFalfg.js";import{t as d}from"./button-B7MKxYjT.js";import{t as f}from"./project-router-Bii3ofOk.js";import{t as p}from"./centered-state-V15AR_qo.js";import{Bt as m,Wn as h,en as g,hn as _,s as v,zt as y}from"./index-CJFT0IZP.js";import{t as b}from"./diff-BK789dS0.js";var x=e(t(),1),S=n();function C({commit:e,sha:t,backTo:n,backLabel:r,slot:a,className:m,diffClassName:h}){let v=g(),[C,w]=(0,x.useState)(`unified`),[T,E]=(0,x.useState)(!0),D=e.isError&&e.error instanceof i&&e.error.status===409,O=v?C:`unified`;return(0,S.jsxs)(`section`,{"data-slot":a,"data-sha":t,className:m,children:[(0,S.jsxs)(`div`,{className:`mx-4 flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border py-2 md:mx-9`,children:[(0,S.jsx)(d,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,S.jsxs)(f,{to:n,children:[(0,S.jsx)(c,{size:16,"aria-hidden":`true`}),r]})}),(0,S.jsx)(`span`,{className:`ml-auto flex items-center gap-1`,children:(0,S.jsx)(l,{mode:C,wrap:T,onModeChange:w,onWrapChange:E})})]}),e.isPending?(0,S.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-muted-foreground md:px-9`,children:`Loading commit…`}):e.isError?(0,S.jsx)(p,{icon:D?(0,S.jsx)(u,{}):(0,S.jsx)(s,{size:16}),tone:D?`neutral`:`danger`,heading:`h2`,title:D?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{"data-slot":`commit-meta`,className:`mx-4 border-b border-border py-3 md:mx-9`,children:[(0,S.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,S.jsxs)(`p`,{className:`mt-0.5 flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,S.jsx)(`span`,{children:e.data.author}),(0,S.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,S.jsx)(`span`,{title:e.data.when,children:y(e.data.when)}),(0,S.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,S.jsx)(`span`,{className:`font-mono select-all`,title:e.data.sha,children:e.data.sha.slice(0,8)}),(0,S.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,S.jsx)(`span`,{"data-slot":`commit-stat`,children:(0,S.jsx)(_,{stat:e.data.stat})})]})]}),e.data.files.length===0?(0,S.jsx)(p,{icon:(0,S.jsx)(o,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,S.jsx)(`div`,{className:h,children:(0,S.jsx)(b,{files:e.data.files,mode:O,wrap:T,totals:!1,className:`min-w-0`})})]})]})}var w=56;function T({slot:e,commits:t,selectedSha:n,className:i,heading:o}){let[s,c]=(0,x.useState)(``),l=s.trim().toLowerCase(),u=l?t.filter(e=>e.subject.toLowerCase().includes(l)):t,d=u.length>150,f=(0,x.useRef)(null),p=(0,x.useRef)(null),[m,g]=(0,x.useState)(0);(0,x.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=f.current,t=p.current;!e||!t||g(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[d]);let _=u.map(e=>(0,S.jsx)(E,{commit:e,selected:n!==void 0&&e.sha===n},e.sha));return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`label`,{className:`relative mb-3 block`,children:[(0,S.jsx)(a,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3 left-3 size-4 text-muted-foreground`}),(0,S.jsx)(h,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:s,onChange:e=>c(e.target.value),className:`h-10 rounded-lg border-border bg-card pl-10`})]}),(0,S.jsxs)(`div`,{ref:e=>{f.current=e,e&&(p.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":d,className:r(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-3 py-1 md:px-4`,i),children:[o?(0,S.jsx)(`div`,{className:`flex min-h-11 flex-wrap items-center gap-2 py-2.5`,children:o}):null,u.length===0?(0,S.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,d?(0,S.jsx)(v,{scrollRef:p,startMargin:m,itemSize:w,children:_}):_]})]})}function E({commit:e,selected:t}){return(0,S.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_56px] [content-visibility:auto]`,children:(0,S.jsxs)(f,{"data-slot":`commit-row`,"data-sha":e.sha,"data-selected":t?`true`:void 0,"aria-current":t?`true`:void 0,to:e.href,className:r(`flex min-h-11 min-w-0 items-start gap-2.5 rounded-md px-2 py-2.5 transition-colors hover:bg-muted`,t&&`bg-muted/70`),children:[(0,S.jsx)(o,{size:16,"aria-hidden":`true`,className:`mt-px size-4 shrink-0 text-accent-text`}),(0,S.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,S.jsx)(`span`,{"data-slot":`commit-row-subject`,title:e.subject,className:`line-clamp-2 text-[13px] leading-snug font-medium break-words text-foreground`,children:e.subject}),(0,S.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,S.jsx)(D,{sha:e.sha}),(0,S.jsxs)(`span`,{className:`min-w-0 truncate`,children:[e.author,` · `,(0,S.jsx)(`span`,{title:m(e.when,e.at),children:y(e.when,e.at)})]}),e.stat?(0,S.jsx)(_,{stat:e.stat}):null]})]})]})})}function D({sha:e}){return(0,S.jsx)(`span`,{"data-slot":`commit-sha`,className:`shrink-0 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-xs text-muted-foreground`,title:e,children:e.slice(0,8)})}export{D as n,C as r,T as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{ft as r}from"./design-icons-CzEoMH9c.js";import{t as i}from"./button-
|
|
1
|
+
import"./rolldown-runtime-QTnfLwEv.js";import{i as e,t}from"./react-runtime-CCIEwYL0.js";import{t as n}from"./utils-DSMR_WLb.js";import{ft as r}from"./design-icons-CzEoMH9c.js";import{t as i}from"./button-B7MKxYjT.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-Da4ckcJG.js";e();var f=t();function p({...e}){return(0,f.jsx)(d,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(c,{"data-slot":`dialog-portal`,...e})}function h({className:e,...t}){return(0,f.jsx)(a,{"data-slot":`dialog-overlay`,className:n(`fixed inset-0 z-50 bg-black/50 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function g({className:e,children:t,showCloseButton:i=!0,overlayClassName:a,...o}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{className:a}),(0,f.jsxs)(l,{"data-slot":`dialog-content`,className:n(`fixed inset-bs-[50%] start-[50%] z-50 grid max-h-[calc(100dvh-2rem)] overflow-y-auto overscroll-contain w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-hidden motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...o,children:[t,i&&(0,f.jsxs)(s,{"data-slot":`dialog-close`,className:`absolute inset-bs-4 end-4 rounded-sm opacity-70 ring-offset-background transition-opacity pointer-hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(r,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:n(`flex shrink-0 flex-col gap-2 text-center sm:text-start`,e),...t})}function v({className:e,...t}){return(0,f.jsx)(`div`,{"data-slot":`dialog-body`,className:n(`min-h-0 min-w-0 overflow-y-auto overscroll-contain`,e),...t})}function y({className:e,showCloseButton:t=!1,children:r,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:n(`flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...a,children:[r,t&&(0,f.jsx)(s,{asChild:!0,children:(0,f.jsx)(i,{variant:`outline`,children:`Close`})})]})}function b({className:e,...t}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:n(`text-lg leading-none font-semibold`,e),...t})}function x({className:e,...t}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:n(`text-sm text-muted-foreground`,e),...t})}export{y as a,x as i,v as n,_ as o,g as r,b as s,p as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-BEgQ7jZV.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/utils-DSMR_WLb.js","assets/bundle-mjs-rHxsej31.js","assets/chevron-right-BENZ-1ZN.js","assets/createLucideIcon-BHp8sXmF.js","assets/eye-B8okNWXU.js","assets/index-CJFT0IZP.js","assets/live-refetch-VoLPvzhe.js","assets/project-scope-context-BdqKyBHa.js","assets/live-protocol-DMhTnCmf.js","assets/useQuery-BSyhc3l3.js","assets/useInfiniteQuery--iQKfpUQ.js","assets/queries-C7VNk-nW.js","assets/live-reads-BJ9eDISf.js","assets/toaster-Bo5vCbz-.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-Cg8l-LDN.js","assets/label-DEH7fJN4.js","assets/cez-idle-CdswdDRd.js","assets/dist-C5mlVBmd.js","assets/dist-BW234Kg5.js","assets/tasks-table-Cx7AM7lZ.js","assets/task-groups-BbnYlkYj.js","assets/attention-8bNiiAFt.js","assets/design-icons-CzEoMH9c.js","assets/open-in-menu-HM5l7Bwk.js","assets/bot-TkDIw4y-.js","assets/external-link-BE6y205O.js","assets/folder-o-AvL3y3.js","assets/smartphone-Lr8Ug2z_.js","assets/square-terminal-B6RYYieR.js","assets/button-B7MKxYjT.js","assets/dropdown-menu-4e2iKSMT.js","assets/es2015-CQth82uv.js","assets/dist-BAoXdNsT.js","assets/dist-DXO3xwbC.js","assets/own-lookup-DS54wXvD.js","assets/check-OP-CVgZG.js","assets/chevron-down-CHGyCDBH.js","assets/nav-row-styles-DqKjMToI.js","assets/folder-browser-BfclRPcX.js","assets/loader-circle-CPBhhDbB.js","assets/play-CmVAj_fu.js","assets/reference-chip-rylFalfg.js","assets/popover-BPgUYFyu.js","assets/dist-Da4ckcJG.js","assets/switch-SP8pw5uU.js","assets/dist-Czz3Y5qH.js","assets/badge-DQ3U69Ht.js","assets/dialog-B531GGAo.js","assets/project-router-Bii3ofOk.js","assets/status-dot-BRzVlF2X.js","assets/command-KdW7aO0N.js","assets/format-BU7D3IfE.js","assets/project-order-AcHI4Dcl.js","assets/skills-pM_PouEs.js","assets/agents-settings-path-7X6_cvUg.js","assets/centered-state-V15AR_qo.js","assets/index-CGjknHnV.css","assets/highlighter-DvLzHjjY.js","assets/image-preview-Dx2w5oIn.js","assets/zoomable-image-CIQl1Wpe.js","assets/markdown-BBDDg-4t.js","assets/markdown-Dv0r75AX.js","assets/chunk-BO2N2NFS-DQrpGzb-.js","assets/lib-DrPFkMXk.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{hn as a}from"./index-CJFT0IZP.js";import{n as o,r as s,t as c}from"./image-preview-Dx2w5oIn.js";var l=e(t(),1),u=n();function d(e){let[t,n]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-BEgQ7jZV.js`).then(t=>{e||n({View:t.DiffView})},()=>{e||n(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67])),()=>{e=!0}},[]),e.files.length===0?(0,u.jsx)(`p`,{"data-slot":`diff-empty`,className:r(`px-1 text-xs text-muted-foreground`,e.className),children:`No changes.`}):t===`failed`?(0,u.jsx)(f,{...e}):t===null?(0,u.jsx)(`p`,{"data-slot":`diff-loading`,className:r(`px-1 text-xs text-muted-foreground`,e.className),children:`Loading diff…`}):(0,u.jsx)(t.View,{...e})}function f({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:i,viewRef:a,totals:o=!0,actions:c,className:d}){let f={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},m=(0,l.useRef)(null);return(0,l.useImperativeHandle)(a,()=>({scrollToPath:e=>{for(let t of m.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,u.jsxs)(`div`,{ref:m,"data-slot":`diff`,"data-fallback":`true`,className:r(`flex min-w-0 flex-col gap-3`,d),children:[(0,u.jsxs)(`div`,{"data-slot":`diff-header`,hidden:!o&&!c,className:`flex min-h-9 flex-wrap items-center gap-x-2 gap-y-1.5 px-1`,children:[(0,u.jsx)(s,{stat:f,hidden:!o}),c?(0,u.jsx)(`div`,{"data-slot":`diff-actions`,className:`ms-auto flex items-center gap-1.5`,children:c}):null]}),e.map(e=>(0,u.jsx)(p,{file:e,wrap:t,imageSrc:n,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function p({file:e,wrap:t,imageSrc:n,onOpenInApp:i}){let s=e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,u.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,u.jsxs)(`header`,{className:`flex items-start gap-2 border-b border-border px-3 py-2`,children:[(0,u.jsx)(`span`,{"data-slot":`diff-file-path`,title:s,className:`min-w-0 wrap-anywhere font-mono text-xs font-medium`,children:s}),(0,u.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,u.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-xs`})})]}),o(e)?(0,u.jsx)(c,{file:e,imageSrc:n,onOpenInApp:i}):e.binary?(0,u.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,u.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`No content changes (metadata only).`}):(0,u.jsx)(`pre`,{className:r(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
|
+
`).map((e,t)=>(0,u.jsxs)(`span`,{className:r(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-muted-foreground`),children:[e,e===``?` `:``]},t))})]})}export{d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{A as n,_ as r}from"./design-icons-CzEoMH9c.js";import{t as i}from"./createLucideIcon-BHp8sXmF.js";import{t as a}from"./button-B7MKxYjT.js";import{$n as o}from"./index-CJFT0IZP.js";var s=i(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),c=i(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),l=e();function u({mode:e,wrap:t,onModeChange:n,onWrapChange:r}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`inline-flex items-center rounded-lg border border-border bg-card p-0.5 max-md:hidden`,children:[(0,l.jsx)(p,{current:e,value:`unified`,onModeChange:n}),(0,l.jsx)(p,{current:e,value:`split`,onModeChange:n})]}),(0,l.jsx)(d,{wrap:t,onWrapChange:r})]})}function d({wrap:e,onWrapChange:n,className:r=`size-11 rounded-lg`}){return(0,l.jsx)(a,{variant:`outline`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":e,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:t(r,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:(0,l.jsx)(c,{"aria-hidden":`true`})})}function f({preview:e,onPreviewChange:n}){return(0,l.jsxs)(a,{variant:`outline`,size:`sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":e,"aria-label":`Preview Markdown`,title:e?`Show Markdown as a diff`:`Preview Markdown`,className:t(`h-11 min-w-11 gap-1.5 rounded-lg px-0 text-xs font-medium sm:px-3`,e?`border-accent-text/40 bg-muted text-accent-text`:`text-muted-foreground hover:text-foreground`),onClick:()=>n(!e),children:[(0,l.jsx)(o,{"aria-hidden":`true`,className:`size-4`}),(0,l.jsx)(`span`,{"aria-hidden":`true`,className:`max-sm:hidden`,children:`Preview MD`})]})}function p({current:e,value:n,onModeChange:i}){let a=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":a,onClick:()=>i(n),className:t(`inline-flex min-h-11 items-center gap-1.5 rounded-md px-3 text-xs font-medium capitalize transition-colors outline-hidden focus-visible:ring-2 focus-visible:ring-ring/50`,a?`bg-muted text-foreground`:`text-muted-foreground pointer-hover:text-foreground`),children:[n===`unified`?(0,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function m({branch:e}){return(0,l.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,l.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{d as i,u as n,f as r,m as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./eye-B8okNWXU.js";import{hn as o,s}from"./index-CJFT0IZP.js";import{a as c,i as l,r as u}from"./highlighter-DvLzHjjY.js";import{n as d,r as f,t as p}from"./image-preview-Dx2w5oIn.js";import{n as m,t as h}from"./markdown-BBDDg-4t.js";import{t as g}from"./markdown-Dv0r75AX.js";var _=e(t(),1),v=44;function y(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
|
|
2
|
+
`),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function b(e){return y(e)*20+v}function x(e){return e.reduce((e,t)=>e+y(t),0)}function S(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function C(e){return`${e.oldPath??``}→${e.path}`}function w(e){let t=0;for(let n of e.split(`
|
|
3
|
+
`))n.length>t&&(t=n.length);return t}var T=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,E=300,D=.3;function O(e,t){if(e===t)return null;let n=e.match(T)??[],r=t.match(T)??[];if(n.length===0||r.length===0||n.length>E||r.length>E)return null;let i=k(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<D?null:A(n,r,i)}function k(e,t){let n=t.length+1,r=new Uint16Array((e.length+1)*n);for(let i=1;i<=e.length;i++)for(let a=1;a<=t.length;a++)r[i*n+a]=e[i-1]===t[a-1]?(r[(i-1)*n+(a-1)]??0)+1:Math.max(r[(i-1)*n+a]??0,r[i*n+(a-1)]??0);return r}function A(e,t,n){let r=t.length+1,i=Array.from({length:e.length},()=>!1),a=Array.from({length:t.length},()=>!1),o=e.length,s=t.length;for(;o>0&&s>0;)e[o-1]===t[s-1]?(i[o-1]=!0,a[s-1]=!0,o--,s--):(n[(o-1)*r+s]??0)>=(n[o*r+(s-1)]??0)?o--:s--;return{del:j(e,i),add:j(t,a)}}function j(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function M(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var N=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,P=`… (patch truncated)`;function F(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
|
|
4
|
+
`);o.at(-1)===``&&o.pop();for(let e of o){let o=N.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(P)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function I(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function L(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function R(e,t){let n=Array.from({length:e.length}),r=Array.from({length:t.length}),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=O(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function z(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(R(t,i))}else t(i),r++}}function B(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),z(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function V(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),z(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var H=n();function U({file:e,loadFileText:t,imageSrc:n}){let r=(0,_.useMemo)(()=>W(e),[e]),i=(0,_.useRef)(t);i.current=t;let a=(0,_.useRef)(n);a.current=n;let o=t!==void 0,[s,c]=(0,_.useState)(null);(0,_.useEffect)(()=>{let t=i.current;if(!t)return;let n=!1;return t(e.path).then(t=>!n&&c({path:e.path,text:t}),()=>!n&&c({path:e.path,text:null})),()=>{n=!0}},[e.path,e.patch,o]);let l=(0,_.useCallback)(t=>{let n=a.current,r=n?m(e.path,t):null;return r===null||!n?null:n(r)},[e.path]),u=s?.path===e.path?s:null;if(o&&u===null)return(0,H.jsx)(`p`,{role:`status`,className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`Loading preview…`});let d=u?.text??null;if(d===null&&r.text===``)return(0,H.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:`No content changes to preview.`});let f=d!==null||r.complete?null:o?`The full file could not be loaded. Showing the changed sections only.`:`Showing the changed sections only.`;return(0,H.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[f?(0,H.jsx)(`p`,{className:`mb-4 text-xs text-muted-foreground`,children:f}):null,(0,H.jsx)(g,{document:!0,imageSrc:l,children:d??r.text})]})})}function W(e){let t=F(e.patch);return{text:t.hunks.map(e=>e.lines.filter(e=>e.kind!==`del`).map(e=>e.text).join(`
|
|
5
|
+
`)).join(`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
`),complete:e.status===`added`&&!t.truncated}}var ee=1500,G=new Map;function te(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function ne({files:e,mode:t=`unified`,wrap:n=!1,preview:i,loadFileText:a,imageSrc:o,onOpenInApp:s,viewRef:c,totals:l=!0,actions:u,className:d}){let p=(0,_.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[m,g]=(0,_.useState)(()=>new Set),[v,y]=(0,_.useState)(()=>new Map),[w,T]=(0,_.useState)(()=>new Map),[E,D]=(0,_.useState)(i);E!==i&&(D(i),T(new Map));let O=(0,_.useCallback)((e,t)=>{T(n=>new Map(n).set(e,t))},[]),k=(0,_.useCallback)(e=>{g(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),A=(0,_.useCallback)(async(e,t)=>{if(!a)return;let n=await a(e.path);if(n===null)return;let r=L(t,n.split(`
|
|
10
|
+
`));y(n=>{let i=C(e);return new Map(n).set(i,new Map(n.get(i)??G).set(t.beforeHunk,r))})},[a]),j=(0,_.useMemo)(()=>x(e),[e]),[M]=(0,_.useState)(()=>typeof window>`u`?``:window.location.search),N=S(M,j),P=(0,_.useRef)(null),F=(0,_.useRef)(null),I=(0,_.useRef)(null);(0,_.useImperativeHandle)(c,()=>({scrollToPath:t=>{let n=e.findIndex(e=>e.path===t);if(n===-1)return;let r=F.current;r?r.scrollToIndex(n,{align:`start`}):te(I.current,t)?.scrollIntoView({block:`start`,behavior:`smooth`})}}),[e]);let R=e=>{let r=C(e),c=i!==void 0&&h(e),l=c&&(w.get(r)??i);return(0,H.jsx)(ae,{file:e,open:!m.has(r),onToggle:()=>k(r),preview:l,onPreviewChange:c?e=>O(r,e):void 0,loadFileText:a,expanded:v.get(r)??G,onExpand:t=>void A(e,t),mode:t,wrap:n,canExpand:a!==void 0,imageSrc:o,onOpenInApp:s})};return(0,H.jsxs)(`div`,{ref:e=>{I.current=e,e&&(P.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff`,"data-mode":t,className:r(`flex min-w-0 flex-col`,d),children:[(0,H.jsxs)(`div`,{"data-slot":`diff-header`,hidden:!l&&!u,className:`flex min-h-9 flex-wrap items-center gap-x-2 gap-y-1.5 px-1 pb-3`,children:[(0,H.jsx)(f,{stat:p,hidden:!l}),u?(0,H.jsx)(`div`,{"data-slot":`diff-actions`,className:`ms-auto flex items-center gap-1.5`,children:u}):null]}),N===`virtual`?(0,H.jsx)(re,{files:e,handleRef:F,scrollElRef:P,card:R}):(0,H.jsx)(`div`,{"data-slot":`diff-files`,"data-virtualized":`false`,children:e.map(e=>(0,H.jsx)(`div`,{"data-slot":`diff-file-slot`,style:{containIntrinsicBlockSize:`auto ${b(e)}px`},className:`pb-3 [content-visibility:auto]`,children:R(e)},C(e)))})]})}function re({files:e,handleRef:t,scrollElRef:n,card:r}){let i=(0,_.useRef)(null),[a,o]=(0,_.useState)(0);return(0,_.useLayoutEffect)(()=>{let e=()=>{let e=i.current,t=n.current;!e||!t||o(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n]),(0,H.jsx)(`div`,{ref:e=>{i.current=e,e&&(n.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff-files`,"data-virtualized":`true`,children:(0,H.jsx)(s,{ref:t,scrollRef:n,startMargin:a,children:e.map(e=>(0,H.jsx)(`div`,{"data-slot":`diff-file-slot`,className:`pb-3`,children:r(e)},C(e)))})})}var ie={added:`added`,deleted:`deleted`,renamed:`renamed`,copied:`copied`};function ae({file:e,open:t,onToggle:n,expanded:s,onExpand:c,mode:l,wrap:u,preview:d,onPreviewChange:f,loadFileText:p,canExpand:m,imageSrc:h,onOpenInApp:g}){let _=ie[e.status],v=e.oldPath?`${e.oldPath} → ${e.path}`:e.path;return(0,H.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,H.jsxs)(`header`,{className:`sticky top-[var(--diff-sticky-top,0px)] z-10 flex items-center rounded-t-md border-b border-border bg-card`,children:[(0,H.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-header`,"aria-expanded":t,onClick:n,className:`flex min-w-0 flex-1 items-start gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,H.jsx)(i,{className:r(`mbs-[1px] size-3.5 shrink-0 text-muted-foreground motion-safe:transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,H.jsx)(`span`,{"data-slot":`diff-file-path`,title:v,className:`min-w-0 wrap-anywhere font-mono text-xs font-medium`,children:e.oldPath?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),_?(0,H.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:_}):null,e.image?(0,H.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`image`}):e.binary?(0,H.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[12px] font-medium text-muted-foreground`,children:`binary`}):null,(0,H.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,H.jsx)(o,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-xs`})})]}),f?(0,H.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-preview-toggle`,"aria-pressed":d,"aria-label":`Preview ${e.path} as a document`,title:d?`Show this file as a diff`:`Preview this file as a document`,onClick:()=>f(!d),className:r(`mr-1.5 inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[12px] font-medium max-md:h-11 max-md:px-3 pointer-coarse:h-11 pointer-coarse:px-3`,`focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring`,d?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`),children:[(0,H.jsx)(a,{"aria-hidden":`true`,className:`size-3.5`}),`Preview`]}):null]}),t&&d?(0,H.jsx)(U,{file:e,loadFileText:p,imageSrc:h}):t?(0,H.jsx)(oe,{file:e,expanded:s,onExpand:c,mode:l,wrap:u,canExpand:m,imageSrc:h,onOpenInApp:g}):null]})}function oe({file:e,expanded:t,onExpand:n,mode:i,wrap:a,canExpand:o,imageSrc:s,onOpenInApp:c}){let l=(0,_.useMemo)(()=>F(e.patch),[e.patch]),u=o&&e.status!==`added`&&e.status!==`deleted`,f=(0,_.useMemo)(()=>I(l.hunks,u),[l.hunks,u]),m=(0,_.useMemo)(()=>{let e=[];l.hunks.forEach((n,r)=>{let i=t.get(r);i&&e.push(...i),e.push(...n.lines)});let n=t.get(l.hunks.length);return n&&e.push(...n),e},[l.hunks,t]),h=(0,_.useMemo)(()=>new Map(m.map((e,t)=>[e,t])),[m]),g=se(e.path,m),v=(0,_.useMemo)(()=>i===`unified`?B(l.hunks,f,t):null,[i,l.hunks,f,t]),y=(0,_.useMemo)(()=>i===`split`?V(l.hunks,f,t):null,[i,l.hunks,f,t]),b=(0,_.useMemo)(()=>i===`unified`&&!a?{minInlineSize:`calc(${w(e.patch)}ch + 7rem)`}:void 0,[i,a,e.patch]);if(d(e))return(0,H.jsx)(p,{file:e,imageSrc:s,onOpenInApp:c});if(e.binary)return(0,H.jsx)(K,{children:`Binary file — no text diff.`});if(l.hunks.length===0)return(0,H.jsx)(K,{children:l.truncated?`Patch truncated by the server.`:`No content changes (metadata only).`});let x=e=>{if(!g)return null;let t=h.get(e);return t===void 0?null:g[t]??null};return(0,H.jsxs)(`div`,{"data-slot":`diff-file-body`,"data-wrap":a||void 0,className:r(`py-1 font-mono text-xs leading-[1.7]`,!a&&`overflow-x-auto`),children:[(0,H.jsxs)(`div`,{"data-slot":`diff-rows`,style:b,className:`[&>*]:[contain-intrinsic-block-size:auto_20px] [&>*]:[content-visibility:auto]`,children:[v?v.map((e,t)=>(0,H.jsx)(le,{row:e,wrap:a,tokensFor:x,onExpand:u?n:void 0},t)):null,y?y.map((e,t)=>(0,H.jsx)(ue,{row:e,wrap:a,tokensFor:x,onExpand:u?n:void 0},t)):null]}),l.truncated?(0,H.jsx)(K,{children:`Patch truncated by the server — counts above remain exact.`}):null]})}function se(e,t){let n=(0,_.useMemo)(()=>t.length>ee?null:t.map(e=>e.text).join(`
|
|
11
|
+
`),[t]),r=(0,_.useMemo)(()=>c(e),[e]),[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(n===null||r===null)return;let e=!1;return u(n,r).then(t=>{e||a({text:n,tokens:t.tokens})}),()=>{e=!0}},[n,r]),n===null||r===null?null:i?.text===n?i.tokens:l(n,r)?.tokens??null}function K({children:e}){return(0,H.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:e})}var q={add:`bg-diff-add`,del:`bg-diff-del`,context:void 0},ce={add:`+`,del:`−`,context:` `};function J({hunk:e,wrap:t}){return(0,H.jsx)(`div`,{"data-slot":`diff-hunk`,title:t?void 0:e.header,className:r(`border-y border-border/70 bg-muted/60 px-4 py-0.5 text-muted-foreground max-sm:px-2`,t?`break-words whitespace-pre-wrap`:`truncate`),children:e.header})}function Y({gap:e,onExpand:t}){let n=e.count===void 0?`⋯ unchanged lines to end of file`:`⋯ ${e.count} unchanged ${e.count===1?`line`:`lines`}`;return t?(0,H.jsxs)(`button`,{type:`button`,"data-slot":`diff-gap`,onClick:()=>t(e),className:`block w-full border-y border-border/70 bg-muted/40 px-4 py-1 text-left text-xs text-muted-foreground hover:bg-muted hover:text-foreground`,children:[n,` — expand`]}):(0,H.jsx)(`div`,{"data-slot":`diff-gap`,className:`border-y border-border/70 bg-muted/40 px-4 py-1 text-xs text-muted-foreground`,children:n})}function X({cell:e,tokens:t,wrap:n}){let i=M(t,e.spans,e.line.text),a=e.line.kind===`add`?`bg-diff-add-strong`:`bg-diff-del-strong`;return(0,H.jsxs)(`span`,{className:r(`min-w-0 flex-1 pr-4 max-sm:pr-1 max-sm:pl-1.5`,n?`break-words whitespace-pre-wrap`:`whitespace-pre`),children:[i.map((t,n)=>(0,H.jsx)(`span`,{"data-word":t.changed?e.line.kind:void 0,style:t.color===void 0?void 0:{color:t.color},className:t.changed?r(`rounded-[2px]`,a):void 0,children:t.text},n)),e.line.text===``?` `:``]})}function Z({value:e,className:t}){return(0,H.jsx)(`span`,{"data-slot":`diff-gutter`,className:r(`w-10 shrink-0 pr-2 text-right text-muted-foreground tabular-nums select-none max-sm:w-7 max-sm:pr-1.5`,t),children:e??``})}function Q({kind:e}){return(0,H.jsx)(`span`,{"data-slot":`diff-marker`,className:`w-4 shrink-0 text-muted-foreground select-none max-sm:text-center`,children:ce[e]})}function le({row:e,wrap:t,tokensFor:n,onExpand:i}){if(e.type===`hunk`)return(0,H.jsx)(J,{hunk:e.hunk,wrap:t});if(e.type===`gap`)return(0,H.jsx)(Y,{gap:e.gap,onExpand:i});let{line:a}=e.cell;return(0,H.jsxs)(`div`,{"data-slot":`diff-line`,"data-line":a.kind,className:r(`flex`,q[a.kind]),children:[(0,H.jsx)(Z,{value:a.oldLine,className:`max-sm:hidden`}),(0,H.jsx)(Z,{value:a.newLine,className:`max-sm:hidden`}),(0,H.jsx)(Z,{value:a.newLine??a.oldLine,className:`sm:hidden`}),(0,H.jsx)(Q,{kind:a.kind}),(0,H.jsx)(X,{cell:e.cell,tokens:n(a),wrap:t})]})}function ue({row:e,wrap:t,tokensFor:n,onExpand:r}){return e.type===`hunk`?(0,H.jsx)(J,{hunk:e.hunk,wrap:t}):e.type===`gap`?(0,H.jsx)(Y,{gap:e.gap,onExpand:r}):(0,H.jsxs)(`div`,{"data-slot":`diff-pair`,className:`grid grid-cols-2`,children:[(0,H.jsx)($,{cell:e.left,side:`old`,tokensFor:n,wrap:t}),(0,H.jsx)($,{cell:e.right,side:`new`,tokensFor:n,wrap:t})]})}function $({cell:e,side:t,tokensFor:n,wrap:i}){if(!e)return(0,H.jsx)(`div`,{"data-slot":`diff-cell-empty`,className:r(`bg-muted/20`,t===`new`&&`border-l border-border/70`)});let{line:a}=e;return(0,H.jsxs)(`div`,{"data-slot":`diff-cell`,"data-line":a.kind,className:r(`flex min-w-0 overflow-x-auto`,q[a.kind],t===`new`&&`border-l border-border/70`),children:[(0,H.jsx)(Z,{value:t===`old`?a.oldLine:a.newLine}),(0,H.jsx)(Q,{kind:a.kind}),(0,H.jsx)(X,{cell:e,tokens:n(a),wrap:i})]})}export{ne as DiffView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";var n=e(t(),1);function r(e){let t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}export{r as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{Bt as i,Nn as a}from"./project-scope-context-BdqKyBHa.js";import{et as o}from"./queries-C7VNk-nW.js";import{f as s,p as c}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{ot as l,w as u}from"./design-icons-CzEoMH9c.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{i as f}from"./diff-controls-BFqQNxRu.js";import{t as p}from"./centered-state-V15AR_qo.js";import{a as m,i as h,r as g}from"./highlighter-DvLzHjjY.js";import{a as _,c as v,d as y,l as b,n as x,o as S,s as C,t as w,u as T}from"./markdown-Dv0r75AX.js";var E=d(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),D=d(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),O=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),k=e(t(),1),A=n(),j=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function M(e){let t=j.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var N={};function P(e){let t=(0,k.useMemo)(()=>T(e),[e]).join(` `),[n,r]=(0,k.useState)(null);return(0,k.useEffect)(()=>{if(!t)return;let e=!0;return y(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:N}function F({html:e,title:t,fragment:n,className:i}){let a=P(e);return a?(0,A.jsx)(I,{html:e,title:t,fragment:n,className:i,libraries:a}):(0,A.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:r(`flex min-h-0 flex-col`,i)})}function I({html:e,title:t,fragment:n,className:i,libraries:a}){let{srcdoc:o,blocked:s}=(0,k.useMemo)(()=>{let n=v(e,a);return{srcdoc:b(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},l=M(s);return(0,A.jsxs)(`div`,{"data-slot":`html-report`,className:r(`flex min-h-0 flex-col`,i),children:[l?(0,A.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,A.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:S,allow:_,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var L=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:L.has(t.slice(n+1).toLowerCase())}function z(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return R(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function B(e){return e.tooLarge?`too-large`:z(e.path)?`image`:e.binary?`binary`:`text`}function V(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function H({runId:e,path:t,className:n}){let r=o(e,t??void 0);if(t===null)return(0,A.jsx)(Y,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(u,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,A.jsx)(Y,{className:n,children:(0,A.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof a&&r.error.status===409;return(0,A.jsx)(Y,{className:n,children:(0,A.jsx)(p,{icon:e?(0,A.jsx)(O,{}):(0,A.jsx)(l,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,A.jsx)(G,{runId:e,entry:r.data,className:n}):(0,A.jsx)(Y,{className:n,children:(0,A.jsx)(p,{icon:(0,A.jsx)(D,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function U(e,t,n){let r=t?.replace(/\/+$/,``);if(r&&e.startsWith(`${r}/`))return e.slice(r.length+1);let i=/^.*\/\.ai\/(?:cezar|squawk)\/worktrees\/[^/]+\/(.+)$/.exec(e);if(i?.[1])return i[1];if(e.startsWith(`/`)&&n&&!n.startsWith(`/`)){let t=n.replace(/^\.?\//,``);if(t&&(e===`/${t}`||e.endsWith(`/${t}`)))return t}return e}function W(e,t,n){let r=t&&/\.(?:md|markdown)$/i.test(e.path),i=t&&C(e.path),a=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(e.path),o=t&&a&&e.size<=10*1024*1024?`image`:B(e);return{html:i,kind:o,toggle:(r||i)&&o===`text`,showImage:o===`image`&&(!t||a),rendered:n?null:r?`markdown`:i?`html`:null}}function G({runId:e,entry:t,displayPath:n,className:i,imageUrl:a,downloadUrl:o,snapshot:s,readerHref:c,documentPreview:l=!1}){let[u,d]=(0,k.useState)(!1),[p,m]=(0,k.useState)(!0),h=n??U(t.path),g=W(t,l,u),_=!!(s||o||g.toggle),v=!g.showImage&&g.kind===`text`&&g.rendered===null;return(0,A.jsxs)(Y,{className:i,children:[(0,A.jsxs)(`header`,{"data-slot":`file-preview-head`,className:r(`flex min-h-11 items-center gap-2 border-b border-border bg-muted/40 ps-4 text-xs`,v?`pe-2 py-1`:`pe-4 py-2.5`),children:[(0,A.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium text-foreground`,title:h,children:h}),(0,A.jsx)(`span`,{"data-slot":`file-preview-size`,className:`ml-auto shrink-0 font-mono text-xs tabular-nums text-muted-foreground`,children:V(t.size)}),v?(0,A.jsx)(f,{wrap:p,onWrapChange:m,className:`size-8 rounded-md max-md:size-11 pointer-coarse:size-11`}):null]}),_?(0,A.jsx)(q,{snapshot:s,downloadUrl:o,source:g.toggle?u:null,onSource:()=>d(e=>!e),readerHref:g.html&&g.kind===`text`?c:void 0}):null,(0,A.jsx)(K,{runId:e,entry:t,kind:g.kind,showImage:g.showImage,rendered:g.rendered,imageUrl:a,wrap:p})]})}function K({runId:e,entry:t,kind:n,showImage:r,rendered:a,imageUrl:o,wrap:s}){return r?(0,A.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,A.jsx)(`img`,{"data-slot":`file-preview-image`,src:o??i(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,A.jsx)(p,{icon:(0,A.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${V(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,A.jsx)(p,{icon:(0,A.jsx)(D,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${V(t.size)} of binary data — no text preview.`}):a===`markdown`?(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(w,{document:!0,children:t.content??``})}):a===`html`?(0,A.jsx)(F,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,A.jsx)(Q,{path:t.path,text:t.content??``,wrap:s})}function q({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,A.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,A.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,A.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,A.jsx)(J,{href:i}):null]})}function J({href:e}){let t=c(),n=s();return(0,A.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:r=>x(r,t,e,n),children:`Open reader`})}function Y({className:e,children:t}){return(0,A.jsx)(`section`,{"data-slot":`file-preview`,className:r(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var X=1500;function Z(e,t){let n=(0,k.useMemo)(()=>t.split(`
|
|
2
|
+
`).map(e=>[{content:e}]),[t]),r=(0,k.useMemo)(()=>m(e),[e]),i=n.length>X,[a,o]=(0,k.useState)(null);return(0,k.useEffect)(()=>{if(r===null||i)return;let n=!1;return g(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:h(t,r)?.tokens??n}function Q({path:e,text:t,wrap:n=!1}){let i=Z(e,t);return(0,A.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":m(e)??`plaintext`,className:`overflow-x-auto overscroll-x-contain py-2 font-mono text-xs leading-[1.7] [scrollbar-width:thin]`,children:(0,A.jsx)(`div`,{className:n?`min-w-0`:`w-max min-w-full`,children:i.map((e,t)=>(0,A.jsxs)(`div`,{className:`flex`,children:[(0,A.jsx)(`span`,{className:`sticky left-0 w-14 shrink-0 select-none bg-card pr-3 pl-4 text-right tabular-nums text-muted-foreground`,children:t+1}),(0,A.jsx)(`span`,{className:r(`min-w-0 flex-1 pr-6`,n?`whitespace-pre-wrap wrap-anywhere`:`whitespace-pre`),children:e.map((e,t)=>(0,A.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})})}export{V as a,O as c,U as i,D as l,G as n,z as o,H as r,F as s,Q as t,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{Nn as n}from"./project-scope-context-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DSMR_WLb.js";import{Nn as n}from"./project-scope-context-BdqKyBHa.js";import{gt as r}from"./queries-C7VNk-nW.js";import{t as i}from"./createLucideIcon-BHp8sXmF.js";import{t as a}from"./chevron-right-BENZ-1ZN.js";import{t as o}from"./folder-o-AvL3y3.js";var s=i(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),c=e(),l=`x-apple.systempreferences:com.apple.preference.security?Privacy_FilesAndFolders`,u=`inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-foreground hover:bg-muted`;function d(e){let t=e.replace(/[\\/]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<0?null:n===0?t.slice(0,1):t.slice(0,n)}function f({path:e,selected:n,onSelect:i,onEnter:l,decorate:u,emptyHint:d,showHidden:f=!1}){let m=r(e,f),h=m.data?.parent??null;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`p`,{"data-slot":`fs-breadcrumb`,className:`truncate font-mono text-[11px] text-soft-foreground`,title:m.data?.path??void 0,children:m.data?.path??(m.isError?``:`Loading…`)}),m.isError?(0,c.jsx)(p,{error:m.error,path:e,onEnter:l,onRetry:()=>void m.refetch()}):(0,c.jsxs)(`ul`,{"data-slot":`fs-listing`,className:`max-h-64 divide-y divide-border/60 overflow-y-auto overscroll-contain rounded-md border border-border`,children:[h===null?null:(0,c.jsx)(`li`,{className:`flex`,children:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-up`,onClick:()=>l(h),className:`flex flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,children:[(0,c.jsx)(s,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),`Up one level`]})}),(m.data?.dirs??[]).map(e=>(0,c.jsxs)(`li`,{className:`flex items-stretch`,children:[(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-dir`,"aria-pressed":n?.path===e.path,onClick:()=>i(e),onDoubleClick:()=>l(e.path),className:t(`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left text-[13px] hover:bg-muted`,n?.path===e.path&&`bg-muted`),children:[(0,c.jsx)(o,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`truncate`,children:e.name}),u?.(e)]}),(0,c.jsx)(`button`,{type:`button`,"data-slot":`fs-enter`,"aria-label":`Open ${e.name}`,onClick:()=>l(e.path),className:`flex shrink-0 items-center px-2.5 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,c.jsx)(a,{className:`size-3.5`,"aria-hidden":`true`})})]},e.path)),m.data&&m.data.dirs.length===0?(0,c.jsx)(`li`,{className:`px-3 py-2 text-[13px] text-muted-foreground`,children:d}):null]}),m.data?.truncated?(0,c.jsx)(`p`,{"data-slot":`fs-truncated`,className:`text-[11px] text-muted-foreground`,children:`Too many folders to list — only the first ones are shown.`}):null]})}function p({error:e,path:t,onEnter:r,onRetry:i}){let a=e instanceof n&&e.status===403,o=t===null?null:d(t);return(0,c.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,c.jsx)(`p`,{"data-slot":`fs-error`,className:`min-w-0 break-words text-[13px] text-danger`,children:e instanceof Error?e.message:`could not list that folder`}),a?(0,c.jsx)(`p`,{"data-slot":`fs-privacy-hint`,className:`text-[12.5px] text-soft-foreground`,children:`Allow it under Privacy & Security ▸ Files & Folders, then try again.`}):null,(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-[12.5px]`,children:[o===null?null:(0,c.jsxs)(`button`,{type:`button`,"data-slot":`fs-error-back`,onClick:()=>r(o),className:u,children:[(0,c.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),`Back`]}),a?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`a`,{"data-slot":`fs-privacy-settings`,href:l,target:`_blank`,rel:`noreferrer`,className:u,children:`Open Privacy Settings`}),(0,c.jsx)(`button`,{type:`button`,"data-slot":`fs-retry`,onClick:i,className:u,children:`Try again`})]}):null]})]})}function m(e,t,n=!1){let i=r(e,n);return t?.path??i.data?.path??null}export{m as n,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,n=Date.now()){if(!e)return``;let r=new Date(e).getTime();return Number.isNaN(r)?``:t(Math.max(0,(n-r)/1e3))}function t(e){if(e<10)return`just now`;if(e<60)return`${Math.floor(e)}s`;if(e<3600)return`${Math.floor(e/60)}m`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return t<6&&n>0?`${t}h ${n}m`:e<86400?`${t}h`:`${Math.floor(e/86400)}d`}function n(e){return!e||e===`just now`?e:`${e} ago`}function r(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${(Math.floor(e/1e5)/10).toFixed(1)}M`:e>=1e3?`${(Math.floor(e/100)/10).toFixed(1)}k`:String(Math.floor(e))}function i(e,t=new Date){let n=e.toDateString()===t.toDateString();return new Intl.DateTimeFormat(void 0,n?{timeStyle:`short`}:{dateStyle:`medium`,timeStyle:`short`}).format(e)}function a(e,t){let n=e?Date.parse(e):NaN;if(!Number.isFinite(n)||n<=t)return`scheduled`;let r=Math.max(1,Math.floor((n-t)/6e4));if(r<60)return`resumes in ${r}m`;let i=new Date(n),a=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`}).format(i);return n-t<864e5?`resumes ${a}`:`resumes ${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(i)} ${a}`}export{e as a,a as i,t as n,n as o,r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{n as r,t as i}from"./utils-DSMR_WLb.js";import{F as a,T as o,j as s,st as c,u as l}from"./design-icons-CzEoMH9c.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";import{t as d}from"./external-link-BE6y205O.js";import{i as f,n as p,r as m,t as h}from"./diff-controls-BFqQNxRu.js";import{t as g}from"./square-terminal-B6RYYieR.js";import{t as _}from"./button-B7MKxYjT.js";import{i as v,p as y,r as b,t as x}from"./dropdown-menu-4e2iKSMT.js";import{hn as S}from"./index-CJFT0IZP.js";var C=u(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),w=u(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),T=e(t(),1),E=n();function D({root:e,selected:t,onSelect:n}){return(0,E.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,E.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,E.jsx)(k,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,E.jsx)(j,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function O({adds:e,dels:t}){return(0,E.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-xs font-medium tabular-nums`,children:[e>0?(0,E.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,E.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function k({dir:e,depth:t,selected:n,onSelect:r}){let[a,s]=(0,T.useState)(!0);return(0,E.jsxs)(`li`,{children:[(0,E.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>s(e=>!e),className:`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,E.jsx)(l,{size:16,"aria-hidden":`true`,className:i(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,E.jsx)(o,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,E.jsx)(O,{adds:e.adds,dels:e.dels})]}),a?(0,E.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,E.jsx)(k,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,E.jsx)(j,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var A={added:`text-success`,deleted:`text-danger`};function j({file:e,depth:t,selected:n,onSelect:r}){let a=n===e.path;return(0,E.jsx)(`li`,{children:(0,E.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":a?`true`:void 0,onClick:()=>r(e.path),className:i(`flex min-h-11 md:min-h-8 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,a?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,E.jsx)(w,{"aria-hidden":`true`,className:i(`size-3.5 shrink-0`,A[e.status])}),(0,E.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,E.jsx)(O,{adds:e.adds,dels:e.dels})]})})}function M(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function N(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(N)}}var P=(e,t)=>e.name.localeCompare(t.name);function F(e){let t=M(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=M(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(P),e.files.sort(P)};return i(t),{...t,dirs:t.dirs.map(N)}}function I({bar:e,healthReady:t,branch:n,stat:r,mode:a,wrap:o,preview:s=!1,onModeChange:c,onWrapChange:l,onPreviewChange:u,onAction:d}){return(0,E.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-3 gap-y-2 px-4 py-4 md:px-9 [&_button]:min-h-11`,children:[(0,E.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[n?(0,E.jsx)(h,{branch:n}):null,r?(0,E.jsx)(z,{stat:r}):null]}),(0,E.jsxs)(`span`,{className:i(`ml-auto flex items-center gap-1.5`,!u&&`md:hidden`),children:[(0,E.jsx)(`span`,{className:`flex md:hidden`,children:(0,E.jsx)(f,{wrap:o,onWrapChange:l})}),u?(0,E.jsx)(m,{preview:s,onPreviewChange:u}):null]}),(0,E.jsxs)(`span`,{className:i(`flex items-center gap-2 max-md:w-full`,!u&&`md:ml-auto`),children:[(0,E.jsx)(`span`,{className:`hidden items-center gap-1.5 md:flex`,children:(0,E.jsx)(p,{mode:a,wrap:o,onModeChange:c,onWrapChange:l})}),(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`hidden h-5 w-px bg-border md:block`}),(0,E.jsxs)(`span`,{"data-slot":`git-toolbar-actions`,className:`flex items-center gap-1.5 max-md:flex-1 max-md:[&>*]:flex-1`,children:[e.secondary.map(e=>(0,E.jsx)(R,{action:e,variant:`outline`,onAction:d},e.id)),(0,E.jsx)(R,{action:e.primary,variant:`primary`,onAction:d})]}),e.menu.length>0?(0,E.jsxs)(x,{children:[(0,E.jsx)(y,{asChild:!0,children:(0,E.jsx)(_,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,className:`max-md:min-w-11 max-md:border max-md:border-border max-md:bg-card`,children:(0,E.jsx)(C,{"aria-hidden":`true`})})}),(0,E.jsx)(b,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,E.jsxs)(v,{disabled:!e.enabled,title:e.reason,onSelect:()=>d(e.id),children:[L[e.id],e.label]},e.id))})]}):null]})]})}var L={commit:(0,E.jsx)(s,{size:16,"aria-hidden":`true`}),push:(0,E.jsx)(c,{size:16,"aria-hidden":`true`}),"create-pr":(0,E.jsx)(a,{size:16,"aria-hidden":`true`}),"view-pr":(0,E.jsx)(d,{"aria-hidden":`true`}),"open-terminal":(0,E.jsx)(g,{"aria-hidden":`true`})};function R({action:e,variant:t,onAction:n}){return e.id===`view-pr`?r(e.href)?(0,E.jsx)(_,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,E.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[L[e.id],e.label]})}):(0,E.jsxs)(_,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[L[e.id],e.label]}):(0,E.jsxs)(_,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[L[e.id],e.label]})}function z({stat:e}){return(0,E.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,E.jsx)(S,{stat:{adds:B(e.adds),dels:B(e.dels),files:e.files}})})}function B(e){let[t,n]=(0,T.useState)(e),r=(0,T.useRef)(e);return(0,T.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{D as i,I as n,F as r,z as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{c as r,t as i}from"./utils-DSMR_WLb.js";import{G as a,On as o,P as s,U as c,V as l,W as u,bi as d,di as f}from"./project-scope-context-BdqKyBHa.js";import{Bt as p,M as m,Qt as h,Yt as g,i as _,k as ee,l as v,o as y,r as b,s as te}from"./queries-C7VNk-nW.js";import{h as ne}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{n as x}from"./toaster-Bo5vCbz-.js";import{F as S,I as C,X as w,Y as T,c as E,ct as D,l as O,ot as k,p as A,r as j}from"./design-icons-CzEoMH9c.js";import{t as re}from"./chevron-down-CHGyCDBH.js";import{t as M}from"./chevron-right-BENZ-1ZN.js";import{l as ie,n as ae}from"./nav-row-styles-DqKjMToI.js";import{t as N}from"./loader-circle-CPBhhDbB.js";import{t as oe}from"./play-CmVAj_fu.js";import{t as P}from"./button-B7MKxYjT.js";import{a as se,i as ce,n as F,r as I,t as L}from"./select-BaydzE-I.js";import{i as R,r as z,t as B}from"./popover-BPgUYFyu.js";import{r as le,t as V}from"./project-router-Bii3ofOk.js";import"./attention-8bNiiAFt.js";import{f as ue,v as de}from"./task-groups-BbnYlkYj.js";import{t as fe}from"./status-dot-BRzVlF2X.js";import{a as pe,o as H,r as me,s as he,t as ge}from"./command-KdW7aO0N.js";import{a as U}from"./format-BU7D3IfE.js";import{t as W}from"./centered-state-V15AR_qo.js";import{Ct as _e,Dt as ve,Et as ye,St as be,Tn as xe,Tt as Se,_t as Ce,b as we,bt as Te,en as Ee,gt as De,ht as Oe,mt as ke,ot as Ae,s as je,vt as Me,wt as Ne,xt as G,yt as Pe}from"./index-CJFT0IZP.js";import{a as Fe,d as Ie,f as Le,i as Re,l as ze,n as Be,o as Ve,r as He,s as Ue,t as We,u as K}from"./use-hand-to-agent-state-BckHuhr8.js";import{t as q}from"./tab-link-B1CULYRs.js";var J=e(t(),1),Ge=`cez-github-list-width`;function Y(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function Ke(){try{let e=localStorage.getItem(Ge);return e===null?360:Y(e)}catch{return 360}}function qe(e){try{localStorage.setItem(Ge,String(Y(e)))}catch{}}var X=n();function Je({number:e,repo:t}){let n=r();return(0,X.jsx)(Ye,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function Ye({number:e,repo:t,scope:n}){let r=(0,J.useId)(),a=(0,J.useId)(),[s,c]=(0,J.useState)(!1),l=s?re:M,u=g(n,!0,n==="default"),d=m(`#${e}`,!0),f=(0,J.useMemo)(()=>Ne(de(u.data??[],d.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[u.data,d.data,e,t,n]);return(0,X.jsxs)(`section`,{"aria-labelledby":r,className:i(`mt-4 min-w-0 rounded-lg border border-border`,s?`p-3`:`p-0.5`),children:[(0,X.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":s,"aria-controls":a,onClick:()=>c(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2.5 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(l,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,X.jsxs)(`span`,{children:[`Linked tasks`,u.data?` (${f.length}${d.hasNextPage||d.isError?`+`:``})`:``]})]})}),(0,X.jsx)(`div`,{id:a,children:s?(0,X.jsxs)(X.Fragment,{children:[u.isPending?(0,X.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,u.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,X.jsx)(P,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void u.refetch(),disabled:u.isFetching,children:`Retry linked tasks`})]}):null,u.data&&f.length===0&&!u.isError?(0,X.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,f.length>0?(0,X.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:f.map(e=>{let t=o(e);return(0,X.jsx)(`li`,{children:(0,X.jsxs)(V,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:ue(e)}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(fe,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,X.jsx)(`span`,{className:`rounded border border-border px-1`,children:`Archived`}):null,(0,X.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,d.isError?(0,X.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,X.jsx)(P,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.refetch(),disabled:d.isFetching,children:`Retry older linked tasks`})]}):d.hasNextPage?(0,X.jsx)(P,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void d.fetchNextPage(),disabled:d.isFetchingNextPage,children:d.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var Xe=`w-44 max-w-full`,Z=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-ring disabled:opacity-60`,Q=`__all__`;function Ze(e,t){let n=new Map;for(let t of e)for(let e of t.assignees??[])n.set(e.toLowerCase(),e);for(let e of t)n.set(e.toLowerCase(),e);return[...n.values()].sort((e,t)=>e.localeCompare(t))}function Qe(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function $e(e){let t=` Previous memberships are shown; issues with unknown membership remain visible.`;return e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${t}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${t}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`)}function et(e){return[e.viewerLogin?``:`GitHub login unavailable.`,$e(e)].filter(Boolean).join(` `)}function tt({options:e,assignees:t,onAssigneesChange:n}){return(0,X.jsxs)(B,{children:[(0,X.jsx)(R,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:`${Z} inline-flex items-center gap-1.5`,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,X.jsx)(O,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(z,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,X.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,X.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),e.map(e=>{let r=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,X.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,X.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function nt({data:e,projectId:t,onProjectChange:n,pickerRef:r}){if(e.projects?.length)return(0,X.jsxs)(L,{value:t||Q,onValueChange:e=>n(e===Q?``:e),children:[(0,X.jsx)(ce,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":t,className:`${Z} ${Xe} justify-between`,children:(0,X.jsx)(se,{placeholder:`All boards`})}),(0,X.jsxs)(F,{align:`start`,children:[(0,X.jsx)(I,{value:Q,children:`All boards`}),e.projects.map(e=>(0,X.jsx)(I,{value:e.id,"data-board":e.id,children:e.title},e.id))]})]});if(e.projects||e.projectsState){let t=e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`;return(0,X.jsxs)(L,{disabled:!0,value:Q,children:[(0,X.jsx)(ce,{ref:r,"aria-label":`Project board`,"data-slot":`gh-board-filter`,"data-value":``,className:`${Z} ${Xe} justify-between`,children:(0,X.jsx)(se,{placeholder:t,children:t})}),(0,X.jsx)(F,{align:`start`,children:(0,X.jsx)(I,{value:Q,children:t})})]})}return null}function rt({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,X.jsxs)(B,{open:i,onOpenChange:a,children:[(0,X.jsx)(R,{asChild:!0,children:(0,X.jsx)(`button`,{ref:o,type:`button`,className:`${Z} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,X.jsx)(T,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,X.jsx)(k,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,X.jsx)(z,{ref:s,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{r||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:t||n.current})]})]})}function it({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,J.useState)(!1),s=(0,J.useRef)(null),c=(0,J.useRef)(null),l=(0,J.useRef)(null),u=(0,J.useRef)(null),d=Ze(e.issues,t),f=Qe(e.viewerLogin,t),p=et(e),m=p!==``,h=(0,J.useRef)(p);m&&(h.current=p);let g=(0,J.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,J.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{g.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&_()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,J.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,X.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,X.jsx)(tt,{options:d,assignees:t,onAssigneesChange:r}),(0,X.jsxs)(`button`,{ref:u,type:`button`,"data-slot":`gh-assigned-me`,className:`${Z} inline-flex items-center gap-1.5 rounded-full aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:[(0,X.jsx)(D,{size:14,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`Assigned to me`]}),(0,X.jsx)(nt,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,X.jsx)(rt,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function at({onRefresh:e,refreshing:t}){let n=ke(r());return(0,X.jsxs)(`div`,{"data-route":`github`,"data-slot":`github-filter-screen`,className:ae,children:[(0,X.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,X.jsx)(`h1`,{className:i(ie,`min-w-0 flex-1`),children:`GitHub`}),(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,X.jsx)(T,{size:17,"aria-hidden":`true`,className:i(`size-[17px]`,t&&`motion-safe:animate-spin`)})})]}),(0,X.jsx)(Oe,{model:n,variant:`screen`})]})}function ot({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a,actions:o}){return(0,X.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2`,children:[(0,X.jsx)(`h1`,{className:`min-w-0 text-[26px] leading-[1.2] font-semibold tracking-tight text-foreground md:text-[28px]`,children:n?(0,X.jsxs)(X.Fragment,{children:[e===`issues`?`Issues`:`Pull requests`,` `,(0,X.jsx)(`span`,{"data-slot":`gh-title-qualifier`,className:`font-normal text-muted-foreground`,children:`· ${De[t]}`})]}):`GitHub`}),(0,X.jsx)(st,{...o})]}),r!==null&&i===void 0?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`mt-1 flex min-w-0 items-center gap-3 md:hidden`,children:[(0,X.jsxs)(V,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,X.jsx)(j,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,X.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-muted-foreground`,children:[...Me,...Pe].find(e=>e.id===t)?.label})]}):null,a.repo?(0,X.jsxs)(`p`,{className:`mt-1 min-w-0 truncate text-[13px] text-muted-foreground`,children:[(0,X.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,X.jsxs)(`span`,{"data-slot":`gh-synced`,title:a.syncedAt?new Date(a.syncedAt).toLocaleString():void 0,children:[` · `,a.syncedAt?`Synced ${U(a.syncedAt)}`:`Not synced yet`]})]}):null]})}function st({automationsAvailable:e,refreshing:t,onRefresh:n}){return(0,X.jsxs)(`div`,{"data-slot":`gh-page-actions`,className:`flex shrink-0 flex-wrap items-center gap-2`,children:[e?(0,X.jsx)(V,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:t,onClick:n,className:`gh-utility`,children:[(0,X.jsx)(T,{size:16,"aria-hidden":`true`,className:i(`size-3.5`,t&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function ct({item:e,view:t,filter:n,colors:r,active:a,queued:o,checks:s,comments:c}){let l=e.kind===`issue`?A:S,d=f(),m=()=>{d.prefetchQuery({queryKey:p.githubComments(e.kind,e.number),queryFn:({signal:t})=>u(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,X.jsxs)(V,{to:G(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,He(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:m,onFocus:m,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":a?`page`:void 0,title:`Drag into the composer to prefill a task`,className:i(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,a&&`bg-accent-strong/10 text-accent-text`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,X.jsx)(l,{"aria-hidden":`true`,"data-slot":`gh-row-icon`,className:i(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,X.jsx)(`span`,{"data-slot":`gh-row-title`,className:i(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,a&&`font-semibold`),children:e.title})]}),(0,X.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 pl-[22px] text-xs text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,X.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[`#`,e.number]}),(0,X.jsx)($,{}),(0,X.jsx)(`span`,{"data-slot":`gh-row-author`,className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,X.jsx)($,{}),(0,X.jsx)(`time`,{className:`shrink-0`,dateTime:e.createdAt,title:new Date(e.createdAt).toLocaleString(),children:U(e.createdAt)}),c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(Fe,{count:c})]}):null,s?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(Re,{checks:s})]}):null,o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{}),(0,X.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`shrink-0 font-sans font-medium text-accent-text`,children:`↗ run queued`})]}):null]}),e.labels.length>0?(0,X.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,X.jsx)(Ue,{label:e,color:r[e],plain:!0},e))}):null]})}function $(){return(0,X.jsx)(`span`,{"data-slot":`gh-row-dot`,"aria-hidden":`true`,className:`shrink-0`,children:`·`})}function lt(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function ut(e){let[t,n]=(0,J.useState)(null);return(0,J.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n(lt(e));t();let r=typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 768px)`):null;r?.addEventListener(`change`,t);let i=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return i?.observe(e),()=>{r?.removeEventListener(`change`,t),i?.disconnect()}},[e]),t}function dt(e,t){let[n,r]=(0,J.useState)(0);return(0,J.useLayoutEffect)(()=>{let n=()=>{!e||!t||r(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return n(),window.addEventListener(`resize`,n),()=>window.removeEventListener(`resize`,n)},[e,t]),n}function ft(e,t,n){let[r,i]=(0,J.useState)(null),a=(0,J.useRef)(n);return(0,J.useEffect)(()=>{a.current=n}),(0,J.useEffect)(()=>{if(!e||!r||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&a.current()},{root:t.getAttribute(`data-slot`)===`main`?null:t,rootMargin:`0px 0px 600px 0px`});return n.observe(r),()=>n.disconnect()},[e,r,t]),i}function pt(e,t,n,r,i){let[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(null),l=ut(a),u=(0,J.useRef)(null);u.current=l;let d=dt(s,l),f=e===`issues`?n?.issues.length??0:n?.prs.length??0,p=t.hasNextPage&&r===null&&f>0;return{listEl:a,setListEl:o,setRowsEl:c,scrollOwner:l,scrollOwnerRef:u,startMargin:d,pagingAvailable:p,manualPaging:p&&i,loadMoreRef:ft(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}function mt({item:e,queuedRunId:t}){return t?(0,X.jsx)(P,{asChild:!0,variant:`outline`,size:`sm`,className:`max-md:h-11 no-hover:h-11`,children:(0,X.jsxs)(V,{to:`/tasks/${t}`,"data-action":`gh-header-view-task`,children:[(0,X.jsx)(E,{size:16,"aria-hidden":`true`,className:`size-3.5 text-success`}),`Open queued task`]})}):(0,X.jsxs)(P,{type:`button`,variant:`primary`,size:`sm`,"data-action":`gh-header-handoff`,title:`Write the prompt and pick the workflow and runner for this ${e.kind===`pr`?`PR`:`issue`}`,className:`max-md:h-11 no-hover:h-11`,onClick:ht,children:[(0,X.jsx)(oe,{"aria-hidden":`true`,className:`size-3.5`}),`Hand to agent`]})}function ht(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}var gt=100;function _t(e,t,n,r,i){if(!e?.available||t!==`prs`)return[];let a=new Set;n!==null&&Number.isInteger(n)&&a.add(n);for(let t of[...r,...i,...e.prs]){if(a.size>=gt)break;a.add(t.number)}return[...a]}function vt(e,t,n,r,i,a){let o=_t(n,e,r,i,a),s=b(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=_(e===`issues`?`issue`:`pr`,(0,J.useMemo)(()=>(t.data?.pages??[]).map(t=>(e===`issues`?t.issues:t.prs).map(e=>e.number)),[t.data,e]),n?.available===!0&&n.commentsDeferred===!0),u=(0,J.useMemo)(()=>new Set(n?.commentsDeferred?(e===`issues`?n.issues:n.prs).map(e=>e.number):[]),[n,e]);return{checkPrNumbers:o,checksMap:c,commentsOf:e=>l[e.number]??(u.has(e.number)?void 0:e.comments)}}function yt(e){let[t,n]=we(),r=t.get(`filter`),i=Se(e,r);return{rawFilterParam:r,filter:i,activeFilter:i??`all`,setFilterParam:e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n})}}function bt(e,t,{filter:n,activeFilter:r,setFilterParam:i}){let[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)([]),[l,u]=(0,J.useState)([]),{setProjectFilter:d,activeProject:f}=xt(t),p=e===`issues`&&r===`assigned`,m=p?t?.viewerLogin?[t.viewerLogin]:[]:l;return{query:a,setQuery:o,labelFilter:s,setLabelFilter:c,setProjectFilter:d,activeProject:f,isAssignedFilter:p,effectiveAssignees:m,changeAssignees:e=>{u(e),p&&i(`all`)},clearFilters:()=>{o(``),c([]),u([]),d(``),n!==null&&n!==`all`&&i(`all`)},filtering:a.trim()!==``||s.length>0||e===`issues`&&(m.length>0||f!==``)||n!==null&&n!==`all`,narrowing:a.trim()!==``||s.length>0||e===`issues`&&(!p&&l.length>0||f!==``)}}function xt(e){let[t,n]=(0,J.useState)(``),r=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,i=r||e?.projects?.some(e=>e.id===t)?t:``;return(0,J.useEffect)(()=>{e&&!r&&t&&!i&&n(``)},[e,t,i,r]),{setProjectFilter:n,activeProject:i}}function St(e,t,{filter:n,activeFilter:i},a){let o=r(),s=e===`issues`&&(i===`no-task`||i===`has-task`),c=g(o,s,o==="default"),l=(0,J.useMemo)(()=>c.data?_e(c.data,t?.repo,o):null,[c.data,t?.repo,o]),u=be(e,n)?ve(n):null,d=v(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,J.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,J.useMemo)(()=>f?ye(f,p):null,[f,p]),h=Ct({view:e,gh:t,activeFilter:i,isAssignedFilter:a,taskFilter:s,taskNumbers:l,runsQuery:c,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,J.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,J.useMemo)(()=>e===`issues`?i===`no-task`&&l?{excludeNumbers:l}:i===`has-task`&&l?{includeNumbers:l}:{}:i===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,i,l,t?.viewerLogin,f])}}function Ct({view:e,gh:t,activeFilter:n,isAssignedFilter:r,taskFilter:i,taskNumbers:a,runsQuery:o,backedQuery:s,filterHits:c,filterSearch:l}){return t?.available?(r||e===`prs`&&n===`mine`)&&!t.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:i&&!a?o.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:s!==null&&!c?l.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${l.data.reason??`unknown reason`}.`}:l.isError?{kind:`blocked`,message:`GitHub could not be searched: ${l.error instanceof Error?l.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null}function wt(e,t){return t?a(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function Tt(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=p.github()[0],s=t===void 0?null:Number.parseInt(t,10),c=!r&&n.data?.available?n.data.items.find(e=>e.number===s):void 0,l=i&&s!==null&&!a.some(e=>e.number===s)?i.find(e=>e.number===s):void 0,u=c??l,[d,f]=(0,J.useState)(null);return(0,J.useEffect)(()=>{u&&f({scope:o,view:e,item:u})},[o,e,u]),{selectedNumber:s,remoteDetail:u??(d?.scope===o&&d.view===e&&d.item.number===s?d.item:null)}}function Et(e,t,n,{fullList:r,filterRows:i},a){let o=f(),s=(0,J.useRef)(null),c=e===`issues`?`issue`:`pr`,l=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,u=y(c,n??0,l),d=l&&u.data?.available&&u.data.item?.kind===c?u.data.item:null;s.current=l&&n!==null?{kind:c,number:n,key:p.githubItem(c,n)}:null;let[m,h]=(0,J.useState)(!1);return{exactWanted:l,exactItem:u,exactDetail:d,exactTargetRef:s,retryingExact:m,retryExact:()=>{h(!0),wt(o,s.current).then(e=>{h(!1),e||x(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function Dt(e,t,n){let r=f(),i=(0,J.useRef)(null);return{refresh:h({mutationFn:e=>(wt(r,e),l({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:p.githubPages(50),exact:!0}),r.setQueryData(p.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:p.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),l=p.githubCommentCounts(o,s);r.removeQueries({queryKey:p.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==d(l)}),a.available&&a.commentsDeferred&&s.length>0&&c(o,s,{refresh:!0}).then(e=>r.setQueryData(l,e)).catch(()=>{}),r.invalidateQueries({queryKey:p.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:p.githubSearch(`pr`,Te)}),r.invalidateQueries({queryKey:p.githubSearch(`pr`,Ce)});let f=i.current,m=p.githubComments(`issue`,0).slice(0,3);if(!f){r.removeQueries({queryKey:m});return}let h=p.githubComments(f.kind,f.number);u(f.kind,f.number,{refresh:!0}).then(e=>r.setQueryData(h,e)).catch(()=>{}),r.removeQueries({queryKey:m,predicate:e=>e.queryHash!==d(h)})},onError:e=>x(e.message,{tone:`danger`})}),openThreadRef:i}}var Ot=350;function kt(e,t){let[n,r]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function At(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=kt(n,Ot),u=(0,J.useMemo)(()=>K(o,{query:l,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,l,r,e,i,a,s]),d=n.trim()===l.trim(),f=t?.available===!0&&!c&&d&&Le(l,u),p=v(e===`issues`?`issue`:`pr`,l,f),m=K(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),h=f&&p.data?.available?p.data:null,g=new Set(m.map(e=>e.number)),_=jt(e,h,a,i);return{debouncedQuery:l,searchWanted:f,forgeSearch:p,items:m,searchPayload:h,metadataFailure:_,searchHits:h&&!_?K(h.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!g.has(e.number)):[],...Mt(n,d,f,p)}}function jt(e,t,n,r){return e===`issues`&&t?n&&t.items.some(e=>e.projectIds===void 0)?t.projectsReason??`Project board data is incomplete. Refresh to try again.`:r.length&&t.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null}function Mt(e,t,n,r){return{searching:e.trim()!==``&&!t||n&&r.isPending,searchFailed:n&&(r.data?.available===!1||r.isError),searchFailureReason:r.data?.available===!1?r.data.reason??`unknown reason`:r.error instanceof Error?r.error.message:`the search request failed`}}function Nt({width:e,onWidthChange:t}){let n=(0,J.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(Y(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,X.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(Y(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function Pt({view:e,changes:t=!1,index:n=!1}){let{n:r}=ne(),i=yt(e),{rawFilterParam:a,activeFilter:o}=i,s=Ee(),{pages:c,data:l}=te(50),u=xe(),d=It(),f=We(),p=Ft({index:n,isDesktop:s,rawFilterParam:a,n:r,rememberedView:ee().data?.githubView}),m=Lt(l?.available===!0&&!p.filterScreen),[h,g]=(0,J.useState)(!1),_=bt(e,l,i),v=St(e,l,i,_.isAssignedFilter),y=At(e,l,_,v),b=Tt(e,r,y.forgeSearch,v),x=Et(e,l,b.selectedNumber,v,b.remoteDetail),S=vt(e,c,l,b.selectedNumber,y.searchHits,v.openItems),{refresh:C,openThreadRef:w}=Dt(e,S.checkPrNumbers,y.debouncedQuery),T=pt(e,c,l,v.backedQuery,_.narrowing);if(p.restorePrs)return(0,X.jsx)(le,{to:`/github/prs`,replace:!0});if(!l)return c.isError?(0,X.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,X.jsx)(W,{icon:(0,X.jsx)(k,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:c.error.message})}):(0,X.jsx)(Ae,{});w.current=null;let E=()=>C.mutate(x.exactTargetRef.current);if(p.filterScreen&&l.available)return(0,X.jsx)(at,{onRefresh:E,refreshing:C.isPending});if(!l.available)return(0,X.jsx)(Ht,{reason:l.reason,refreshing:C.isPending,onRetry:E});let{labelColors:D,labelOptions:O}=Rt(l,y.searchPayload,v.openItems,v.fullList),A=zt({number:b.selectedNumber,items:y.items,searchHits:y.searchHits,fullList:v.fullList,filterRows:v.filterRows,remoteDetail:b.remoteDetail,exactDetail:x.exactDetail});w.current=A?{kind:A.kind,number:A.number}:null;let{linkFilter:j,listPath:re}=Bt(e,a,o,s),M={view:e,filter:j,colors:D,selected:A,queued:f.queued,checksMap:S.checksMap,commentsOf:S.commentsOf},ie=Vt(e,_,v.filterGate,y);return(0,X.jsxs)(`div`,{ref:m.routeRef,"data-route":`github`,className:`flex min-h-full flex-col gap-2.5 px-4 pt-7 pb-[calc(90px+env(safe-area-inset-bottom))] md:px-9 md:pt-7 md:pb-4`,children:[(0,X.jsx)(ot,{view:e,activeFilter:o,isDesktop:s,rawFilterParam:a,n:r,gh:l,actions:{automationsAvailable:u,refreshing:C.isPending,onRefresh:E}}),(0,X.jsxs)(`div`,{ref:m.workspaceRef,"data-slot":`gh-workspace`,"data-stacked":m.panesStacked,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 md:h-[calc(var(--gh-workspace-height,calc(100dvh-4rem))-1rem)] md:flex-none md:gap-5`,children:[(0,X.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-4`,children:[(0,X.jsx)(Ut,{view:e,isDesktop:s,gh:l,onSaveView:d}),(0,X.jsx)(Wt,{view:e,gh:l,filters:_,labelOptions:O,labelColors:D,searchPayload:y.searchPayload})]}),(0,X.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row md:items-stretch md:overflow-hidden`,children:[(0,X.jsx)(qt,{view:e,n:r,rows:M,verdict:ie,search:y,sidebar:v,list:c,paging:T,width:m.githubListWidth,onWidthChange:m.changeGithubListWidth,expanded:h,onExpandedChange:g}),(0,X.jsx)($t,{view:e,n:r,selected:A,selectedNumber:b.selectedNumber,exact:x,repo:l.repo,rows:M,listPath:re,changes:t,handToAgent:f})]})]})]})}function Ft({index:e,isDesktop:t,rawFilterParam:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&n===null&&r===void 0,restorePrs:e&&t&&n===null&&i===`prs`}}function It(){let e=f();return t=>{e.setQueryData(p.uiState,e=>({...e,githubView:t})),s({githubView:t}).then(t=>e.setQueryData(p.uiState,t)).catch(t=>{x(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:p.uiState})})}}function Lt(e){let[t,n]=(0,J.useState)(Ke),[r,i]=(0,J.useState)(!0),a=(0,J.useRef)(null),o=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(!e)return;let n=a.current,r=o.current,s=n?.closest(`[data-slot="main"]`);if(!n||!r||!s)return;let c=window.matchMedia(`(min-width: 768px)`),l=!1,u=()=>{if(l=c.matches&&r.clientWidth>=t+22+360,i(!l),!l||s.clientHeight<1){n.style.removeProperty(`--gh-workspace-height`);return}n.style.setProperty(`--gh-workspace-height`,`${Math.round(s.clientHeight)}px`)};u();let d=new ResizeObserver(u);d.observe(s),d.observe(r);let f=e=>{if(!l||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||r.getBoundingClientRect().top<=s.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let t=e.deltaMode===1?16:e.deltaMode===2?s.clientHeight:1;s.scrollTop+=e.deltaY*t};return r.addEventListener(`wheel`,f,{passive:!1}),c.addEventListener(`change`,u),()=>{r.removeEventListener(`wheel`,f),d.disconnect(),c.removeEventListener(`change`,u)}},[e,t]),{githubListWidth:t,changeGithubListWidth:e=>{let t=Y(e);n(t),qe(t)},panesStacked:r,routeRef:a,workspaceRef:o}}function Rt(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:ze([...n,...r,...t?.items??[]])}}function zt({number:e,items:t,searchHits:n,fullList:r,filterRows:i,remoteDetail:a,exactDetail:o}){return e===null?t[0]??n[0]??null:r.find(t=>t.number===e)??i?.find(t=>t.number===e)??a??o??null}function Bt(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:G(e,i??(e===`issues`&&!r?`all`:null))}}function Vt(e,{query:t,filtering:n},r,{searching:i,searchFailed:a,searchFailureReason:o,metadataFailure:s,searchHits:c,searchPayload:l,items:u}){let d=e===`issues`?`issues`:`pull requests`;return r?(0,X.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":r.kind,children:[r.kind===`loading`?(0,X.jsx)(N,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,X.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(N,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,X.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,X.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,X.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,X.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,X.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,X.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,X.jsxs)(`p`,{children:[`No open `,d,`.`]})}function Ht({reason:e,refreshing:t,onRetry:n}){return(0,X.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,X.jsx)(W,{icon:(0,X.jsx)(C,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,X.jsx)(P,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:n,children:`Try again`}),children:(0,X.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`The tab needs the `,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in Squawk works without it.`]})})})}function Ut({view:e,isDesktop:t,gh:n,onSaveView:r}){return(0,X.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,X.jsxs)(q,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>r(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,X.jsxs)(q,{to:`/github/prs`,active:e===`prs`,onClick:()=>r(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]})]})}function Wt({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,X.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,X.jsx)(w,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,X.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:n.query,onChange:e=>n.setQuery(e.target.value),className:`min-h-11 w-full rounded-lg border border-border bg-card py-1 pr-2.5 pl-8 text-[13px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,X.jsx)(rn,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,X.jsx)(it,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,X.jsx)(`button`,{type:`button`,disabled:!n.filtering,"data-slot":`gh-clear-filters`,className:`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:border-border disabled:bg-transparent disabled:text-muted-foreground`,onClick:n.clearFilters,children:`Clear filters`})]})}function Gt(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Kt(e,t){return(0,X.jsx)(ct,{item:e,view:t.view,filter:t.filter,colors:t.colors,active:t.selected?.url===e.url,queued:t.queued.has(e.url),checks:Gt(e,t.checksMap),comments:t.commentsOf(e)})}function qt({view:e,n:t,rows:n,verdict:r,search:i,sidebar:a,list:o,paging:s,width:c,onWidthChange:l,expanded:u,onExpandedChange:d}){let{items:f,searchHits:p}=i,m=e===`issues`&&t!==void 0&&!u;return(0,X.jsxs)(`section`,{ref:s.setListEl,"data-slot":`gh-list`,"data-mobile-preview":m||void 0,style:{"--github-list-width":`${c}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-border bg-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[f.length===0?r&&(0,X.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-muted-foreground`,children:r}):(0,X.jsx)(Jt,{items:f,rows:n,compactPreview:m,paging:s}),s.pagingAvailable?(0,X.jsx)(Yt,{view:e,list:o,paging:s}):null,(0,X.jsx)(Xt,{backedQuery:a.backedQuery,filterSearch:a.filterSearch}),(0,X.jsx)(Zt,{view:e,n:t,count:f.length,expanded:u,onExpandedChange:d}),f.length>0&&i.searchWanted&&r?(0,X.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-muted-foreground`,children:r}):null,p.length>0?(0,X.jsx)(Qt,{hits:p,searchPayload:i.searchPayload,rows:n}):null,(0,X.jsx)(Nt,{width:c,onWidthChange:l})]})}function Jt({items:e,rows:t,compactPreview:n,paging:r}){let{setRowsEl:i,scrollOwner:a,listEl:o,scrollOwnerRef:s,startMargin:c}=r,l=e.map((e,r)=>(0,X.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":r>0||void 0,"data-compact-hidden":n&&r>=2&&t.selected?.url!==e.url||void 0,children:Kt(e,t)},e.url));return(0,X.jsx)(`div`,{ref:i,"data-slot":`gh-rows`,"data-virtualized":a?`true`:void 0,role:`list`,children:a?(0,X.jsx)(je,{scrollRef:s,startMargin:c,children:l},a===o?`list`:`main`):l})}function Yt({view:e,list:t,paging:n}){return(0,X.jsx)(`div`,{ref:n.loadMoreRef,"data-slot":`gh-load-more`,className:`flex min-h-6 items-center justify-center gap-1.5 px-4 pb-3 text-xs text-muted-foreground`,children:t.isFetchingNextPage?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(N,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,X.jsxs)(X.Fragment,{children:[`Could not load more.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-retry`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Retry`})]}):n.manualPaging?(0,X.jsxs)(X.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-manual`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Load more`})]}):null})}function Xt({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,X.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-muted-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function Zt({view:e,n:t,count:n,expanded:r,onExpandedChange:i}){return e===`issues`&&t!==void 0&&n>2?(0,X.jsx)(P,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":r,onClick:()=>i(e=>!e),children:r?`Show fewer issues`:`View all ${n} issues`}):null}function Qt({hits:e,searchPayload:t,rows:n}){return(0,X.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,X.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,X.jsx)(`li`,{children:Kt(e,n)},e.url))})]})}function $t({view:e,n:t,selected:n,selectedNumber:r,exact:a,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}){let{exactWanted:d,exactItem:f}=a;return(0,X.jsx)(`section`,{"data-slot":`gh-detail`,className:i(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-border bg-card md:overflow-y-auto`,t===void 0?`hidden md:flex`:`flex`),children:n?(0,X.jsx)(en,{item:n,n:t,repo:o,rows:s,listPath:c,changes:l,handToAgent:u}):d&&f.isPending?(0,X.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,X.jsx)(W,{icon:(0,X.jsx)(N,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${r}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):d&&(f.isError||f.data?.available===!1)?(0,X.jsx)(tn,{number:r,exact:a}):(0,X.jsx)(nn,{view:e,number:r})})}function en({item:e,n:t,repo:n,rows:r,listPath:i,changes:a,handToAgent:o}){let{workflows:s,skillList:c,workflow:l,setWorkflow:u,selectedSkills:d,setSelectedSkills:f,engine:p,setEngine:m,queued:h,onQueued:g}=o;return(0,X.jsx)(Ve,{item:e,comments:r.commentsOf(e),afterHeading:e.kind===`issue`?(0,X.jsx)(Je,{number:e.number,repo:n},t??`list`):void 0,backLink:{to:i},subNav:{filter:r.filter,changes:a},onRunAgent:ht,headerAction:(0,X.jsx)(mt,{item:e,queuedRunId:h.get(e.url)??null}),colors:r.colors,checks:Gt(e,r.checksMap),children:(0,X.jsx)(Be,{item:e,workflows:s.data?.workflows??[],skills:c,workflow:l,onWorkflowChange:u,selectedSkills:d,onSkillsChange:f,engine:p,onEngineChange:m,queuedRunId:h.get(e.url)??null,onQueued:g},e.url)})}function tn({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,X.jsx)(W,{icon:(0,X.jsx)(k,{size:16}),tone:n.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${e}`,subtitle:n.data?.available===!1?n.data.reason:n.error instanceof Error?n.error.message:`The request failed.`,actions:(0,X.jsx)(P,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function nn({view:e,number:t}){return(0,X.jsx)(W,{icon:e===`issues`?(0,X.jsx)(A,{size:16}):(0,X.jsx)(S,{size:16}),tone:`neutral`,heading:`h2`,title:t===null?`Nothing selected`:`Not found`,subtitle:t===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${t} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${t} above to look it up on GitHub, closed and merged included.`})}function rn({options:e,colors:t,selected:n,onChange:r}){let[a,o]=(0,J.useState)(!1),s=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,X.jsxs)(B,{open:a,onOpenChange:o,children:[(0,X.jsx)(R,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:i(`inline-flex min-h-11 min-w-11 shrink-0 items-center gap-1.5 rounded-md border border-input bg-card px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,X.jsx)(O,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground`})]})}),(0,X.jsx)(z,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,X.jsxs)(ge,{children:[(0,X.jsx)(pe,{placeholder:`Filter labels…`}),(0,X.jsxs)(he,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,X.jsx)(me,{children:`No labels.`}),n.length>0?(0,X.jsxs)(H,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,X.jsxs)(H,{value:e,onSelect:()=>s(e),className:`min-h-11`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:Ie(t[e])}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,X.jsx)(E,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{Pt as GithubRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DSMR_WLb.js";import{vt as i,xt as a}from"./queries-C7VNk-nW.js";import{f as o,n as s}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{$ as c,A as l,B as u,D as d,F as f,I as p,J as m,K as h,M as g,O as _,P as v,Q as y,R as b,S as x,V as S,W as ee,X as C,Z as w,_ as te,a as ne,b as T,d as E,et as re,f as ie,h as ae,i as oe,j as D,k as O,l as k,n as A,o as j,p as M,q as N,r as P,t as F,u as I,v as L,x as R,y as z,z as B}from"./activity-motion-DfI5xoMG.js";import{t as V}from"./button-B7MKxYjT.js";import{i as H}from"./project-order-AcHI4Dcl.js";import{Sn as U}from"./index-CJFT0IZP.js";var W=e(t(),1);function G(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function K(e){let t=[],n=[];for(let r of e)S(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function q(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function se(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function ce(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>N(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function le(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var J=n(),ue={w:104,h:20};function de(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,T(r.getBoundingClientRect(),t))}return n}function fe(e,t,n=[]){let r=de(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...L(e),kind:`wait`}))],o=R(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...z(t,n,i,o.get(e.requestId))})}let c=x(s.map(e=>({id:e.id,at:e.label})),ue,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function pe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var Y=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-[10.5px] whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function me({arc:e,wait:t,now:n,motion:i}){return(0,J.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:r(Y,`border-dashed border-message-peer-accent`,t.id in i.waitsClosing&&`activity-line-out`),children:[(0,J.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,C(y(t.since,n))]})}function he({arc:e,request:t,now:n,motion:i}){let a=ie(i,e.id);return(0,J.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:r(Y,a?`border-success`:`border-message-peer-accent`,E(i,e.id)===`fade`&&`activity-line-out`),children:[a?(0,J.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,J.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,C(y(t.createdAt,n))]})}var ge=[],_e=new Set;function ve({arcs:e,waits:t=ge,active:n=_e,layoutKey:i,now:a,motion:o=f,paused:s=!1}){let c=W.useRef(null),l=ae(c,W.useCallback(n=>fe(n,e,t),[e,t]),pe,`[data-activity-pill]`,i),u=W.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=te(o.comets,u,s),p=new Map(e.map(e=>[e.requestId,e])),m=new Map(t.map(e=>[e.id,e])),h=W.useId().replace(/[^a-zA-Z0-9_-]/g,``),g=`activity-arrow-arc-${h}`,_=`activity-ring-arc-${h}`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsx)(`marker`,{id:g,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,J.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,J.jsx)(k,{id:_})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,J.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${_})`,className:r(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,M(o,e.id))},e.id)}let t=E(o,e.id);return(0,J.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${g})`,className:r(`stroke-message-peer-accent`,I(t,e.id in o.opening))},e.id)}),(0,J.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?m.get(e.id):void 0;if(t)return(0,J.jsx)(me,{arc:e,wait:t,now:a,motion:o},e.id);let n=p.get(e.id);return n?(0,J.jsx)(he,{arc:e,request:n,now:a,motion:o},e.id):null})]})}var X=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,ye=[],be=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function xe({task:e}){let t=e.workers.filter(e=>N(e.status));return t.length===0?null:(0,J.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[t.map(e=>(0,J.jsx)(g,{run:e,role:`worker`},e.runId)),(0,J.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function Se({projectId:e,task:t,requests:n,waits:i=ye,index:a,ctx:o,motion:u=f,linked:p=!1,onHover:h}){let x=m(t,o);return(0,J.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":x.action,"data-linked":p?`true`:void 0,...O(t.runId,h),className:r(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,x.action?`border-pending/70`:t.rung===`running`&&N(t.status)?`border-status-running/60`:`border-border`,p&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in u.entering&&`activity-card-enter`),children:[(0,J.jsx)(d,{task:t,motion:u,glow:x.action!==void 0}),(0,J.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,J.jsx)(g,{run:t,role:`root`}),(0,J.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,J.jsx)(s,{to:X(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,J.jsx)(l,{rate:t.rate,className:`h-3 w-10`})]}),(0,J.jsxs)(`div`,{className:`mt-[3px] ml-[19px] flex items-center gap-2`,children:[(0,J.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`min-w-0 flex-1 truncate text-[11.5px] text-muted-foreground tabular-nums`,children:[(0,J.jsx)(v,{"data-slot":`activity-verb`,tone:x.tone,className:`font-semibold`,children:x.verb}),x.action&&x.since?(0,J.jsxs)(J.Fragment,{children:[` · `,(0,J.jsx)(`span`,{"data-slot":`activity-pill-age`,title:w(x.since),children:c(y(x.since,o.now))})]}):null,` · `,(0,J.jsx)(`span`,{"data-slot":`activity-main`,className:r(x.mono&&`font-mono text-[11px]`),children:x.main})]}),x.action?(0,J.jsx)(V,{asChild:!0,size:`sm`,variant:x.action===`answer`?`primary`:`outline`,className:`relative z-[1] h-7 px-2 text-[12px] max-md:min-h-11`,children:(0,J.jsx)(s,{"data-slot":`activity-pill-action`,to:X(e,t.runId),children:x.action===`answer`?`Answer`:`Open task`})}):null]}),(0,J.jsx)(_,{texts:b(t.runId,n,a,i)}),(0,J.jsx)(xe,{task:t}),(0,J.jsx)(D,{runId:t.runId,requests:n,waits:i,index:a,link:s,pathOf:t=>X(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:be})]})}var Z=e=>`/p/${encodeURIComponent(e)}/activity`,Ce=e=>`/p/${encodeURIComponent(e)}/`,Q=`rounded-xl border border-border bg-card px-4 pt-3.5 pb-4`,we=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function $({project:e,headingId:t,detail:n,to:r,label:i}){return(0,J.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,J.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,J.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,J.jsx)(s,{to:r,className:we,children:i})]})}function Te({project:e,notice:t}){let n=W.useId();return(0,J.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Q,children:(0,J.jsx)($,{project:e,headingId:n,detail:t,to:Ce(e.projectId),label:`Open project →`})})}function Ee(e,t){return W.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return q({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function De({project:e,now:t,motion:n=f,paused:i=!1}){let a=W.useId(),o=W.useMemo(()=>ee(e),[e]),s=Ee(e,n),c=W.useMemo(()=>u(e.tasks),[e.tasks]),l=W.useMemo(()=>se(e.tasks,[...c,...p(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=j(c),m={now:t,titleOf:e=>B(o,e)},h=`${e.tasks.map(e=>e.runId).join(`,`)}:${s.map(e=>e.requestId).join(`,`)}:${l.map(e=>e.id).join(`,`)}`,g=s.length>0||l.length>0;return(0,J.jsxs)(`section`,{"aria-labelledby":a,"data-slot":`activity-panel`,"data-project":e.projectId,className:Q,children:[(0,J.jsx)($,{project:e,headingId:a,detail:ce(e),to:Z(e.projectId),label:`Open project activity →`}),(0,J.jsxs)(`div`,{className:r(`relative mt-3`,g&&`md:mt-1 md:pt-10`),children:[(0,J.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:r(`grid grid-cols-[repeat(auto-fit,minmax(min(100%,300px),1fr))] items-start gap-3.5`,g&&`md:gap-y-11`),children:e.tasks.map(t=>(0,J.jsx)(Se,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:o,ctx:m,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),g?(0,J.jsx)(ve,{arcs:s,waits:l,active:d.active,layoutKey:h,now:t,motion:n,paused:i}):null]})]})}function Oe(e){let t=S(e.project);return t===void 0?(0,J.jsx)(De,{...e}):(0,J.jsx)(Te,{project:e.project,notice:t})}function ke({projects:e,belowPanels:t}){return e.length===0?null:(0,J.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[le(e.length,t),` `,e.map((e,t)=>(0,J.jsxs)(W.Fragment,{children:[t>0?`, `:null,(0,J.jsx)(s,{to:Z(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Ae={kind:`workspace`};function je(){let e=a().data?.projects,{order:t}=U();return W.useMemo(()=>e?H(e,t).map(e=>e.id):void 0,[e,t])}function Me(){let e=a().data,t=i(),n=o().state?.activityProjectId,r=e?.bootProject??t.data?.bootProject??null,s=typeof n==`string`&&e?.projects.some(e=>e.id===n&&e.status!==`missing`)?n:r;return{id:s,name:e?.projects.find(e=>e.id===s)?.name}}function Ne(){let e=re(Ae),t=Me(),n=je(),r=F(e.data?.generatedAt,e.dataUpdatedAt),i=e.data?.projects,a=W.useMemo(()=>K(G(i??[],n)),[i,n]),{motion:o,paused:s,reduced:c}=A(e.data,`workspace`);return(0,J.jsxs)(`div`,{"data-route":`activity-global`,"data-activity-paused":s?`true`:void 0,className:`flex min-h-full w-full flex-col gap-3.5 px-4 pb-6 md:px-9`,children:[(0,J.jsx)(P,{name:`All projects`,now:e.data?r:void 0,updatedAt:e.data?.generatedAt,stale:e.isError,children:(0,J.jsx)(oe,{scope:`all`,projectId:t.id,projectName:t.name})}),i?(0,J.jsx)(ne,{summary:h(i),tasksTo:`/tasks`,bumps:o.bumps}):null,e.isPending?(0,J.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!i?(0,J.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,J.jsx)(V,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),className:`max-md:min-h-11`,children:`Retry`})]}):null,i&&a.panels.length===0&&a.idle.length===0?(0,J.jsx)(`p`,{"data-slot":`activity-empty`,className:`py-6 text-[13px] text-muted-foreground`,children:`No projects to show.`}):null,(0,J.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3`,children:a.panels.map(e=>(0,J.jsx)(Oe,{project:e,now:r,motion:o,paused:s||c},e.projectId))}),(0,J.jsx)(ke,{projects:a.idle,belowPanels:a.panels.length>0})]})}export{Ne as GlobalActivityRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BHp8sXmF.js";var t=e(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{hn as t}from"./index-CJFT0IZP.js";import{t as n}from"./zoomable-image-CIQl1Wpe.js";var r=e();function i({stat:e,hidden:n=!1}){return(0,r.jsxs)(`p`,{"data-slot":`diff-totals`,hidden:n,className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,r.jsxs)(`span`,{children:[e.files,` `,e.files===1?`file`:`files`,` changed`]}),(0,r.jsx)(t,{stat:e})]})}function a(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function o({file:e,imageSrc:t,onOpenInApp:i}){return e.status===`deleted`?(0,r.jsx)(s,{children:`Image deleted — only the new side can be previewed.`}):t?(0,r.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,r.jsx)(n,{src:t(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,r.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-[11px] font-medium text-muted-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,r.jsx)(s,{children:`Binary file — no text diff.`})}function s({children:e}){return(0,r.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-muted-foreground`,children:e})}export{a as n,i as r,o as t};
|