@hearsay-tools/squawk 0.18.0-dev.6468 → 0.18.0-dev.6478

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/README.md +3 -5
  2. package/dist/contract/health.d.ts +0 -2
  3. package/dist/contract/index.d.ts +0 -1
  4. package/dist/contract/index.js +457 -595
  5. package/dist/contract/projects.d.ts +1 -9
  6. package/dist/data-gitignore.js +0 -2
  7. package/dist/data-gitignore.js.map +1 -1
  8. package/dist/delegation/routes.d.ts +11 -11
  9. package/dist/delegation/transport.d.ts +4 -4
  10. package/dist/server/capabilities.d.ts +0 -1
  11. package/dist/server/capabilities.js +0 -3
  12. package/dist/server/capabilities.js.map +1 -1
  13. package/dist/server/forge/github.d.ts +1 -2
  14. package/dist/server/forge/github.js +1 -2
  15. package/dist/server/forge/github.js.map +1 -1
  16. package/dist/server/forge/types.d.ts +1 -1
  17. package/dist/server/live-routes.d.ts +6 -6
  18. package/dist/server/project-context.d.ts +1 -3
  19. package/dist/server/project-context.js +1 -3
  20. package/dist/server/project-context.js.map +1 -1
  21. package/dist/server/server-deps.d.ts +1 -1
  22. package/dist/server/server-deps.js +1 -3
  23. package/dist/server/server-deps.js.map +1 -1
  24. package/dist/server/server.d.ts +1547 -1764
  25. package/dist/server/server.js +7 -23
  26. package/dist/server/server.js.map +1 -1
  27. package/dist/server/workspace-live-routes.d.ts +6 -6
  28. package/dist/workflows/continuation-admission.d.ts +72 -72
  29. package/dist/workflows/run/wait-engine.d.ts +72 -72
  30. package/package.json +4 -4
  31. package/web/dist/assets/activity-motion-Cd6HKRn5.js +2 -0
  32. package/web/dist/assets/{activity-route-su3KawLr.js → activity-route-Dgjznc_j.js} +1 -1
  33. package/web/dist/assets/agent-accounts-WZgtbThS.js +18 -0
  34. package/web/dist/assets/{alert-dialog-CPBKJTj_.js → alert-dialog-CH4SXGfX.js} +1 -1
  35. package/web/dist/assets/attention-C_kiJ1bk.js +1 -0
  36. package/web/dist/assets/button-DGwhwRuD.js +3 -0
  37. package/web/dist/assets/{centered-state-8l6wvu0C.js → centered-state-B5QmAy2y.js} +1 -1
  38. package/web/dist/assets/{cez-idle-xv7f96fc.js → cez-idle-TVRD1sce.js} +1 -1
  39. package/web/dist/assets/{commit-diff-panel-DmhrguZk.js → commit-diff-panel-Bsf9f2Cd.js} +1 -1
  40. package/web/dist/assets/{dialog-CkU56ywj.js → dialog-B7p5oc5r.js} +1 -1
  41. package/web/dist/assets/diff-BB8od2CB.js +3 -0
  42. package/web/dist/assets/{diff-controls-DzcrZF8L.js → diff-controls-CeYlCm_y.js} +1 -1
  43. package/web/dist/assets/{diff-view-BNL7l7Vp.js → diff-view-Bbf1guXZ.js} +4 -4
  44. package/web/dist/assets/{dist-D4TujV9O.js → dist-ClnpAEgV.js} +1 -1
  45. package/web/dist/assets/{dropdown-menu-BN2BI4R1.js → dropdown-menu-DPrTX-zi.js} +1 -1
  46. package/web/dist/assets/{es2015-DnySZnV4.js → es2015-DTn4s5Lh.js} +1 -1
  47. package/web/dist/assets/{file-preview-Cm1jWwBy.js → file-preview-DYaWK5Hi.js} +2 -2
  48. package/web/dist/assets/git-toolbar-CPxEOnk6.js +1 -0
  49. package/web/dist/assets/{github-wWGhoE3O.js → github-4ILuqTHS.js} +1 -1
  50. package/web/dist/assets/{global-activity-route-DpQr_eU9.js → global-activity-route-BaL40ikO.js} +1 -1
  51. package/web/dist/assets/{image-preview-DpaJAUA9.js → image-preview-cn57tA1m.js} +1 -1
  52. package/web/dist/assets/index-BXr2mRSZ.js +17 -0
  53. package/web/dist/assets/index-Bv_JpzCB.css +1 -0
  54. package/web/dist/assets/{live-protocol-DjH6ZQwI.js → live-protocol-aMLJJ0MQ.js} +1 -1
  55. package/web/dist/assets/{nav-row-styles-DoZBu-jT.js → nav-row-styles-DSBuSnEE.js} +1 -1
  56. package/web/dist/assets/preview-pane-connected-CVIYmAKK.js +3 -0
  57. package/web/dist/assets/project-router-_4jaKCY-.js +1 -0
  58. package/web/dist/assets/project-scope-context-BwaC58sQ.js +4 -0
  59. package/web/dist/assets/{prompt-template-menu-D5T9W-K3.js → prompt-template-menu-Q6yvBBX2.js} +1 -1
  60. package/web/dist/assets/queries-jqgF_s0L.js +1 -0
  61. package/web/dist/assets/{reference-chip-AZWOlSRV.js → reference-chip-BFXq2y0V.js} +1 -1
  62. package/web/dist/assets/repo-git-BXcJkKGQ.js +1 -0
  63. package/web/dist/assets/{report-reader-kzlovTso.js → report-reader-B2xFHTUH.js} +1 -1
  64. package/web/dist/assets/reports-JoaY6sCT.js +1 -0
  65. package/web/dist/assets/run-header-4CYT6aL6.js +2 -0
  66. package/web/dist/assets/skills-C1zxbSly.js +1 -0
  67. package/web/dist/assets/{tab-link-h4IjTsRH.js → tab-link-BmBr8sDS.js} +1 -1
  68. package/web/dist/assets/task-changes-DDHU2MYs.js +1 -0
  69. package/web/dist/assets/task-commits-ntmx-1wH.js +1 -0
  70. package/web/dist/assets/task-files-DlUIW3P5.js +1 -0
  71. package/web/dist/assets/task-github-item-Qg7SGfny.js +1 -0
  72. package/web/dist/assets/task-thread-BKdI_JXT.js +9 -0
  73. package/web/dist/assets/{thread-state-hhRCETQT.js → thread-state-D8yAejJN.js} +1 -1
  74. package/web/dist/assets/{toaster-2NK3PogQ.js → toaster-CoMJoQvk.js} +1 -1
  75. package/web/dist/assets/use-desktop-DpH_9i2n.js +1 -0
  76. package/web/dist/assets/use-hand-to-agent-state-DSRe0E7u.js +1 -0
  77. package/web/dist/assets/{useInfiniteQuery-BcY0ra-k.js → useInfiniteQuery-BK0ElV__.js} +1 -1
  78. package/web/dist/assets/useQuery-Qq5WoH8B.js +1 -0
  79. package/web/dist/assets/workflows-CK12d25D.js +7 -0
  80. package/web/dist/assets/ws-CayNmoGi.js +1 -0
  81. package/web/dist/assets/{zoomable-image-D0zshpve.js → zoomable-image-C7mEDZaS.js} +1 -1
  82. package/web/dist/index.html +24 -25
  83. package/web/dist/live-worker.js +1 -1
  84. package/dist/contract/voice.d.ts +0 -213
  85. package/dist/server/launch-key.d.ts +0 -5
  86. package/dist/server/launch-key.js +0 -35
  87. package/dist/server/launch-key.js.map +0 -1
  88. package/dist/voice/decide.d.ts +0 -35
  89. package/dist/voice/decide.js +0 -329
  90. package/dist/voice/decide.js.map +0 -1
  91. package/dist/voice/decision-log.d.ts +0 -48
  92. package/dist/voice/decision-log.js +0 -117
  93. package/dist/voice/decision-log.js.map +0 -1
  94. package/dist/voice/engine.d.ts +0 -119
  95. package/dist/voice/engine.js +0 -61
  96. package/dist/voice/engine.js.map +0 -1
  97. package/dist/voice/fake-engine.d.ts +0 -10
  98. package/dist/voice/fake-engine.js +0 -192
  99. package/dist/voice/fake-engine.js.map +0 -1
  100. package/dist/voice/jev-engine.d.ts +0 -17
  101. package/dist/voice/jev-engine.js +0 -110
  102. package/dist/voice/jev-engine.js.map +0 -1
  103. package/dist/voice/pending-ask.d.ts +0 -17
  104. package/dist/voice/pending-ask.js +0 -51
  105. package/dist/voice/pending-ask.js.map +0 -1
  106. package/dist/voice/routes.d.ts +0 -115
  107. package/dist/voice/routes.js +0 -92
  108. package/dist/voice/routes.js.map +0 -1
  109. package/dist/voice/sentence.d.ts +0 -21
  110. package/dist/voice/sentence.js +0 -61
  111. package/dist/voice/sentence.js.map +0 -1
  112. package/dist/voice/thresholds.d.ts +0 -28
  113. package/dist/voice/thresholds.js +0 -29
  114. package/dist/voice/thresholds.js.map +0 -1
  115. package/scripts/voice-replay.ts +0 -50
  116. package/web/dist/assets/activity-motion-BeswQRe1.js +0 -2
  117. package/web/dist/assets/agent-accounts-DseqHuGY.js +0 -18
  118. package/web/dist/assets/attention-DlfFfWoj.js +0 -1
  119. package/web/dist/assets/button-Czdi8NqC.js +0 -3
  120. package/web/dist/assets/diff-DDwr1gUX.js +0 -3
  121. package/web/dist/assets/git-toolbar-Dya9briW.js +0 -1
  122. package/web/dist/assets/index-DS1HIBHa.css +0 -1
  123. package/web/dist/assets/index-DYx21hr3.js +0 -17
  124. package/web/dist/assets/input-Dilvz-YI.js +0 -1
  125. package/web/dist/assets/preview-pane-connected-DSStovll.js +0 -3
  126. package/web/dist/assets/project-router-uJ3SkX70.js +0 -1
  127. package/web/dist/assets/project-scope-context-X6-LgbYE.js +0 -4
  128. package/web/dist/assets/queries-00V5jnAV.js +0 -1
  129. package/web/dist/assets/repo-git-DJPSn50o.js +0 -1
  130. package/web/dist/assets/reports-Ds7nog_M.js +0 -1
  131. package/web/dist/assets/run-header-skVwUvR-.js +0 -2
  132. package/web/dist/assets/skills-BJPLRZL5.js +0 -1
  133. package/web/dist/assets/task-changes-Db3dmYAT.js +0 -1
  134. package/web/dist/assets/task-commits-D4HdW5xE.js +0 -1
  135. package/web/dist/assets/task-files-sdaEBCfr.js +0 -1
  136. package/web/dist/assets/task-github-item-DyZdbhco.js +0 -1
  137. package/web/dist/assets/task-thread-QKAKHYiJ.js +0 -9
  138. package/web/dist/assets/use-desktop-C3yCutND.js +0 -1
  139. package/web/dist/assets/use-hand-to-agent-state-wGtVosbN.js +0 -1
  140. package/web/dist/assets/useQuery-C96hAjNV.js +0 -1
  141. package/web/dist/assets/workflows-DRO8PcD-.js +0 -7
  142. package/web/dist/assets/ws-BD6s7UXb.js +0 -1
@@ -0,0 +1,18 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{l as t,o as n,u as r}from"./button-DGwhwRuD.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{$ as o,F as s,N as c,P as l,X as u,Z as d,at as f,it as p,nt as m,z as h}from"./live-protocol-aMLJJ0MQ.js";import{c as g,ut as _}from"./queries-jqgF_s0L.js";import{Q as v,u as ee}from"./design-icons-DmYTv2r1.js";import{h as y,l as b}from"./es2015-DTn4s5Lh.js";import{c as x,i as S,p as C,r as w,s as T,t as E}from"./dropdown-menu-DPrTX-zi.js";import{d as D,l as O,m as k,p as A}from"./alert-dialog-CH4SXGfX.js";import{i as j,o as M,r as N,s as P,t as F}from"./dialog-B7p5oc5r.js";var I=e(i(),1),L=1,te=.9,ne=.8,re=.17,ie=.1,ae=.999,oe=.9999,se=.99,ce=/[\\\/_+.#"@\[\(\{&]/,le=/[\\\/_+.#"@\[\(\{&]/g,ue=/[\s-]/,de=/[\s-]/g;function fe(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?L:se;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=fe(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=L:ce.test(e.charAt(l-1))?(d*=ne,p=e.slice(i,l-1).match(le),p&&i>0&&(d*=ae**+p.length)):ue.test(e.charAt(l-1))?(d*=te,m=e.slice(i,l-1).match(de),m&&i>0&&(d*=ae**+m.length)):(d*=re,i>0&&(d*=ae**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=oe)),(d<ie&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=fe(e,t,n,r,l+1,a+2,o),f*ie>d&&(d=f*ie)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function pe(e){return e.toLowerCase().replace(de,` `)}function me(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,fe(e,t,pe(e),pe(t),0,0,{})}var R=`[cmdk-group=""]`,he=`[cmdk-group-items=""]`,ge=`[cmdk-group-heading=""]`,_e=`[cmdk-item=""]`,ve=`${_e}:not([aria-disabled="true"])`,z=`cmdk-item-select`,B=`data-value`,ye=(e,t,n)=>me(e,t,n),be=I.createContext(void 0),V=()=>I.useContext(be),xe=I.createContext(void 0),H=()=>I.useContext(xe),Se=I.createContext(void 0),Ce=I.forwardRef((e,t)=>{let n=G(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=G(()=>new Set),i=G(()=>new Map),a=G(()=>new Map),o=G(()=>new Set),s=Pe(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=b(),ee=b(),x=b(),S=I.useRef(null),C=Ie();W(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),W(()=>{C(6,A)},[]);let w=I.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`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=I.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,E(t,r)),C(2,()=>{D(),w.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]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:x,labelId:ee,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??ye;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.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=S.current;M().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(he);t?t.appendChild(e.parentElement===t?e:e.closest(`${he} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${he} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${R}[${B}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(B);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.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=E(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 A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(R)?.querySelector(ge))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${_e}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(ve)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(B))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(B))}function F(e){let t=j()?.closest(R),n;for(;t&&!n;)t=e>0?Me(t,R):Ne(t,R),n=t?.querySelector(ve);n?w.setState(`value`,n.getAttribute(B)):P(e)}let L=()=>N(M().length-1),te=e=>{e.preventDefault(),e.metaKey?L():e.altKey?F(1):P(1)},ne=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return I.createElement(y.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&te(e);break;case`ArrowDown`:te(e);break;case`p`:case`k`:g&&e.ctrlKey&&ne(e);break;case`ArrowUp`:ne(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(z);t.dispatchEvent(e)}}}}},I.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Re},c),q(e,e=>I.createElement(xe.Provider,{value:w},I.createElement(be.Provider,{value:T},e))))}),we=I.forwardRef((e,t)=>{let r=b(),i=I.useRef(null),a=I.useContext(Se),o=V(),s=Pe(e),c=s.current?.forceMount??a?.forceMount;W(()=>{if(!c)return o.item(r,a?.id)},[c]);let l=Fe(r,i,[e.value,e.children,i],e.keywords),u=H(),d=K(e=>e.value&&e.value===l.current),f=K(e=>c||o.filter()===!1?!0:!e.search||e.filtered.items.get(r)>0);I.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(z,p),()=>t.removeEventListener(z,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=s.current).onSelect)==null||t.call(e,l.current)}function m(){u.setState(`value`,l.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:ee,...x}=e;return I.createElement(y.div,{ref:n(i,t),...x,id:r,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||o.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),Te=I.forwardRef((e,t)=>{let{heading:r,children:i,forceMount:a,...o}=e,s=b(),c=I.useRef(null),l=I.useRef(null),u=b(),d=V(),f=K(e=>a||d.filter()===!1?!0:!e.search||e.filtered.groups.has(s));W(()=>d.group(s),[]),Fe(s,c,[e.value,e.heading,l]);let p=I.useMemo(()=>({id:s,forceMount:a}),[a]);return I.createElement(y.div,{ref:n(c,t),...o,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},r&&I.createElement(`div`,{ref:l,"cmdk-group-heading":``,"aria-hidden":!0,id:u},r),q(e,e=>I.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":r?u:void 0},I.createElement(Se.Provider,{value:p},e))))}),Ee=I.forwardRef((e,t)=>{let{alwaysRender:r,...i}=e,a=I.useRef(null),o=K(e=>!e.search);return!r&&!o?null:I.createElement(y.div,{ref:n(a,t),...i,"cmdk-separator":``,role:`separator`})}),De=I.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=H(),o=K(e=>e.search),s=K(e=>e.selectedItemId),c=V();return I.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),I.createElement(y.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Oe=I.forwardRef((e,t)=>{let{children:r,label:i=`Suggestions`,...a}=e,o=I.useRef(null),s=I.useRef(null),c=K(e=>e.selectedItemId),l=V();return I.useEffect(()=>{if(s.current&&o.current){let e=s.current,t=o.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)}}},[]),I.createElement(y.div,{ref:n(o,t),...a,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":c,"aria-label":i,id:l.listId},q(e,e=>I.createElement(`div`,{ref:n(s,l.listInnerRef),"cmdk-list-sizer":``},e)))}),ke=I.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return I.createElement(O,{open:n,onOpenChange:r},I.createElement(k,{container:o},I.createElement(A,{"cmdk-overlay":``,className:i}),I.createElement(D,{"aria-label":e.label,"cmdk-dialog":``,className:a},I.createElement(Ce,{ref:t,...s}))))}),Ae=I.forwardRef((e,t)=>K(e=>e.filtered.count===0)?I.createElement(y.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),je=I.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return I.createElement(y.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},q(e,e=>I.createElement(`div`,{"aria-hidden":!0},e)))}),U=Object.assign(Ce,{List:Oe,Item:we,Input:De,Group:Te,Separator:Ee,Dialog:ke,Empty:Ae,Loading:je});function Me(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ne(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pe(e){let t=I.useRef(e);return W(()=>{t.current=e}),t}var W=typeof window>`u`?I.useEffect:I.useLayoutEffect;function G(e){let t=I.useRef();return t.current===void 0&&(t.current=e()),t}function K(e){let t=H(),n=()=>e(t.snapshot());return I.useSyncExternalStore(t.subscribe,n,n)}function Fe(e,t,n,r=[]){let i=I.useRef(),a=V();return W(()=>{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(B,s),i.current=s}),i}var Ie=()=>{let[e,t]=I.useState(),n=G(()=>new Map);return W(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Le(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&&I.isValidElement(t)?I.cloneElement(Le(t),{ref:t.ref},n(t.props.children)):n(t)}var Re={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},J=a();function ze({className:e,...t}){return(0,J.jsx)(U,{"data-slot":`command`,className:r(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t})}function Be({title:e=`Command Palette`,description:n=`Search for a command to run...`,children:i,className:a,showCloseButton:o=!0,filter:s,...c}){return(0,J.jsxs)(F,{...c,children:[(0,J.jsxs)(M,{className:`sr-only`,children:[(0,J.jsx)(P,{children:e}),(0,J.jsx)(j,{children:n})]}),(0,J.jsx)(N,{className:r(`overflow-hidden p-0`,a),showCloseButton:o,children:(0,J.jsx)(ze,{...t({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:i})})]})}function Ve({className:e,...t}){return(0,J.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,J.jsx)(v,{className:`size-4 shrink-0 opacity-50`}),(0,J.jsx)(U.Input,{"data-slot":`command-input`,className:r(`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 He({className:e,onPointerMoveCapture:t,...n}){return(0,J.jsx)(U.List,{"data-slot":`command-list`,onPointerMoveCapture:e=>{t?.(e),e.pointerType===`touch`&&e.stopPropagation()},className:r(`max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...n})}function Ue({...e}){return(0,J.jsx)(U.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function We({className:e,...t}){return(0,J.jsx)(U.Group,{"data-slot":`command-group`,className:r(`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 Ge({className:e,...t}){return(0,J.jsx)(U.Separator,{"data-slot":`command-separator`,className:r(`-mx-1 h-px bg-border`,e),...t})}function Ke({className:e,...t}){return(0,J.jsx)(U.Item,{"data-slot":`command-item`,className:r(`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 qe({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`command-shortcut`,className:r(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var Je=`default`,Ye=m({id:f(),label:f(),path:f(),exists:d()}),Xe=m({id:f(),provider:c,label:f(),configDir:f(),path:f(),exists:d(),looksValid:d(),isDefault:d(),status:l.optional(),files:u(Ye)});function Ze(e){return e.isDefault?`default:${e.provider}`:e.id}var Y=h();m({editable:d(),profiles:u(Xe),profileCapableProviders:u(c),selections:p(f(),Y),defaults:Y}),m({projectId:f().min(1).max(64).nullable(),provider:c,profileId:f().max(64).nullable()}),m({selections:p(f(),Y),defaults:Y}),m({status:l}),m({available:d(),reason:f().optional(),fields:u(m({label:f(),value:f()}))}),m({file:f().min(1).max(200),target:f().min(1).max(64).optional()}),m({opened:o(!0),path:f()}),m({provider:c,label:f().trim().max(200).optional(),configDir:f().trim().min(1).max(4096)}),m({profile:Xe}),m({label:f().trim().max(200).optional(),configDir:f().trim().min(1).max(4096).optional()}),m({removed:o(!0),id:f()});var Qe=`quick-task`;function $e(e,t,n=24){return[t,...(e??[]).filter(e=>!(e.source===t.source&&e.ref===t.ref))].slice(0,n)}var et=[{id:`claude`,label:`claude`,desc:`Claude Code CLI`},{id:`codex`,label:`codex`,desc:`OpenAI Codex (app-server)`},{id:`opencode`,label:`opencode`,desc:`OpenCode (serve)`},{id:`pi`,label:`pi`,desc:`pi CLI (provider/model)`},{id:`cursor`,label:`Cursor`,desc:`Cursor CLI`},{id:`omp`,label:`OMP`,desc:`Oh My Pi CLI (provider/model)`}],X={claude:[{id:``,label:`auto`,desc:`Pick the best model per step`},{id:`opus`,label:`opus`,desc:`Deep reasoning for hard tasks`},{id:`sonnet`,label:`sonnet`,desc:`Fast and cheap`},{id:`haiku`,label:`haiku`,desc:`Fastest — simple, scoped tasks`}],codex:[{id:``,label:`auto`,desc:`Use your Codex default model`}],opencode:[{id:``,label:`auto`,desc:`Use your OpenCode default model`}],cursor:[{id:``,label:`auto`,desc:`Use your Cursor default model`}],pi:[{id:``,label:`auto`,desc:`Use your pi default model`}],omp:[{id:``,label:`auto`,desc:`Use your OMP default model`}]},Z=[{value:``,label:`auto`,desc:`Harness default`},{value:`low`,label:`low`,desc:`Less reasoning, faster replies`},{value:`medium`,label:`medium`,desc:`Balanced reasoning`},{value:`high`,label:`high`,desc:`More reasoning for hard tasks`},{value:`xhigh`,label:`xhigh`,desc:`Extra-high reasoning`},{value:`max`,label:`max`,desc:`Maximum reasoning`}];function tt(e,t,n){let r=e===`cursor`?[Z[0]]:Z,i=s(e)&&(e!==`cursor`||n?.runner===e)?n?.models.find(e=>e.id===t)?.effortLevels:void 0;if(!i?.length)return r;let a=[Z[0]],o=new Set;for(let e of i){if(o.has(e))continue;let t=Z.find(t=>t.value===e);t&&(o.add(e),a.push(t))}return a.length>1?a:r}function nt(e,t){let n=e??``;return t.some(e=>e.value===n)?n:``}var rt=[`opencode`,`pi`,`omp`];function it(e,t){return t===`cursor`||!e||X[t].some(t=>t.id===e)?!1:t!==`claude`&&[`claude-fable-5`,`claude-opus-4-8`,`claude-sonnet-5`,`claude-haiku-4-5`].includes(e)?!0:Object.entries(X).some(([n,r])=>n!==t&&!rt.includes(n)&&r.some(t=>t.id!==``&&t.id===e))}function at(e,t,n=[]){let r=t?.runner===e?t.models:[],i=X[e]??X.claude,a=[...r.length?i.slice(0,1):i],o=new Set(a.map(e=>e.id));if(s(e))for(let e of r)!e.id||o.has(e.id)||(o.add(e.id),a.push({id:e.id,label:e.label||e.id,desc:e.description}));for(let t of n)!t||o.has(t)||it(t,e)||(o.add(t),a.push({id:t,label:t,desc:`Custom or legacy model`}));return a}var ot={claude:`Claude`,codex:`Codex`,opencode:`OpenCode`,pi:`Pi`,cursor:`Cursor`,omp:`OMP`};function st(e,t,n=!1,r=!1){if(!s(e))return;let i=ot[e];if(t?.stale)return`Using cached ${i} model list`;if(n||t?.source===`unavailable`)return`Latest ${i} models unavailable`;if(r&&!t)return`Loading ${i} models…`}function ct(e){let t=et.map(e=>e.id).filter(t=>e.some(e=>e.name===t&&e.available));return t.length>0?t:[`claude`]}function lt(e,t,n){return e!==null&&t.includes(e)?e:t.includes(n)?n:t[0]??`claude`}function ut(e,t,n=!1){return!n&&e===t?void 0:e}function dt(e,t,n,r){let i=at(t,r,[e,n?.[t]]);if(e!==null&&i.some(t=>t.id===e))return e;let a=n?.[t];return a!==void 0&&i.some(e=>e.id===a)?a:``}function ft(e,t,n){return e.source===`skill`?t.some(t=>t.name===e.ref):n.some(t=>t.name===e.ref)}function pt(e,t,n){return e&&ft(e,t,n)?e:null}function mt(e){let{task:t,source:n,model:r,modelsLocked:i,effort:a,runner:o,runnerExplicit:s,defaultRunner:c,agentProfile:l,images:u,worktree:d,autonomous:f,archiveWhenDone:p,autoMergePr:m,allowWorkers:h,allowMessaging:g}=e;return{task:t,...n?.source===`skill`?{steps:[{id:`task`,name:n.ref,skill:n.ref,prompt:`{{task}}`}]}:{workflow:n?.ref??`quick-task`},model:i?void 0:r||void 0,effort:i?void 0:a||void 0,runner:ut(o,c,s),agentProfile:l||void 0,images:u.length>0?[...u]:void 0,worktree:d!==!1&&void 0,autonomous:f===!0||void 0,...ht({archiveWhenDone:p,autoMergePr:m,allowWorkers:h,allowMessaging:g})}}function ht(e){return{...e.archiveWhenDone?{archiveWhenDone:!0}:{},...e.autoMergePr?{autoMergePr:!0}:{},...e.allowWorkers===!1?{allowWorkers:!1}:{},...e.allowMessaging===!1?{allowMessaging:!1}:{}}}function gt(e,t){return t?{...e,notify:!0}:e}function _t(e){return`/tasks/${e.id}`}var vt=80,yt=2e3,bt=50,xt=200,St=50,Ct=[{id:`add-tests`,label:`Add tests`,text:`Also add or update tests covering this change.`},{id:`explain-change`,label:`Explain the change`,text:`Explain what changed and why before finishing.`},{id:`keep-minimal`,label:`Keep it minimal`,text:`Keep the change as small and targeted as possible — no unrelated refactors.`},{id:`update-docs`,label:`Update docs`,text:`Also update any relevant documentation or comments.`},{id:`check-edge-cases`,label:`Double-check edge cases`,text:`Double-check edge cases and error handling before finishing.`},{id:`create-automation`,label:`Create an automation`,skills:[`create-cezarion-automation`],text:`Create an automation for this repository.
2
+ Trigger: <a GitHub event or a schedule, e.g. every new pull request; every issue labelled \`needs-agent\`; every day at 04:00; weekdays at 07:30; every 6 hours>.
3
+ Task for each run: <what the launched task must do, e.g. review the diff, run the tests and post findings as a review comment>.
4
+ Leave it paused and, for a GitHub trigger, preview its matches so I can check the filter before enabling it.`}],wt=new Set([`create-automation`]);function Tt(e,t){return t.automations===!0?e:e.filter(e=>!wt.has(e.id))}function Et(e){return!!e&&typeof e==`object`}function Dt(e){if(e===void 0||!Array.isArray(e))return Ct.map(e=>({...e}));let t=new Set,n=[];for(let r of e){if(!Et(r))continue;let e=typeof r.id==`string`?r.id.trim():``,i=typeof r.label==`string`?r.label.trim():``,a=typeof r.text==`string`?r.text.trim():``;if(!e||!i||!a||t.has(e))continue;t.add(e);let o=Ot(r.skills);if(n.push({id:e,label:i.slice(0,vt),text:a.slice(0,yt),...o.length>0?{skills:o}:{}}),n.length>=bt)break}return n}function Ot(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(!(!e||t.has(e))&&(t.add(e.slice(0,xt)),t.size>=St))break}return[...t]}function kt(e,t){if(t.length===0)return[];let n=new Set(t);return e.filter(e=>e.skills?.some(e=>n.has(e)))}function At(e,t){return kt(e,t).map(e=>e.text).join(`
5
+
6
+ `)}function jt(e,t,n,r=``){if(e===``||e===r||e===t){let e=r&&n?`${r}\n\n${n}`:r||n;return{text:e,applied:n?e:``}}return{text:e,applied:t}}function Mt(){return`tpl-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Nt(e,t,n){let r=Math.max(0,Math.min(t,e.length)),i=e.slice(0,r),a=e.slice(r),o=``;i.length>0&&(o=i.endsWith(`
7
+
8
+ `)?``:i.endsWith(`
9
+ `)?`
10
+ `:`
11
+
12
+ `);let s=a.replace(/^[ \t]+/,``),c=``;return s.length>0&&(c=s.startsWith(`
13
+
14
+ `)?``:s.startsWith(`
15
+ `)?`
16
+ `:`
17
+
18
+ `),{text:i+o+n+c+s,caret:i.length+o.length+n.length}}function Pt({prompt:e,base:t,selectionStart:n,focused:r,remembered:i}){return e===t?e.length:r&&n!=null||n!=null&&n>0?n:i??e.length}var Ft=`inline-flex h-[26px] min-w-0 max-w-full items-center gap-1.5 rounded-full border border-control-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-link-foreground hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:border-dashed disabled:bg-muted`,It=(0,J.jsx)(ee,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-supporting-foreground`}),Lt=(0,I.createContext)(null),Q=e=>Number.parseFloat(e)||0;function Rt({pill:e,box:t,full:n}){let r=getComputedStyle(e),i=[...e.children].filter(e=>{if(e===t)return!1;let n=getComputedStyle(e);return n.display!==`none`&&n.position!==`absolute`});return i.reduce((e,t)=>e+t.getBoundingClientRect().width,0)+Q(r.columnGap)*i.length+n.getBoundingClientRect().width+Q(r.paddingLeft)+Q(r.paddingRight)+Q(r.borderLeftWidth)+Q(r.borderRightWidth)}function zt(e){for(let t=e.parentElement;t;t=t.parentElement){if(t.dataset.slot===`picker-pill-disabled-wrapper`)continue;let e=getComputedStyle(t).display;if(e===`grid`||e===`flex`)return t}return e.parentElement}function Bt(e){let t=new Map;for(let n of e){let e=zt(n.pill),r=t.get(e)??new Map,i=Math.round(n.pill.getBoundingClientRect().top);r.set(i,[...r.get(i)??[],n]),t.set(e,r)}for(let[e,n]of t){let t=getComputedStyle(e),r=e.clientWidth-Q(t.paddingLeft)-Q(t.paddingRight);for(let e of n.values())if(e.reduce((e,t)=>e+Rt(t),0)+Q(t.columnGap)*(e.length-1)>r+.5)return!1}return!0}function Vt({children:e}){let t=(0,I.useRef)(new Map),n=(0,I.useRef)(null),[r,i]=(0,I.useState)(!0),a=(0,I.useCallback)(()=>i(Bt([...t.current.values()])),[]),o=(0,I.useCallback)((e,r)=>{if(t.current.set(e,r),typeof ResizeObserver<`u`){n.current??=new ResizeObserver(a);for(let e of[r.box,r.full,zt(r.pill)])n.current.observe(e)}return a(),()=>{if(t.current.delete(e),typeof ResizeObserver<`u`)for(let e of[r.box,r.full])n.current?.unobserve(e);a()}},[a]);(0,I.useLayoutEffect)(()=>()=>n.current?.disconnect(),[]);let s=(0,I.useMemo)(()=>({register:o,showPrefixes:r}),[o,r]);return(0,J.jsx)(Lt.Provider,{value:s,children:e})}function Ht({field:e,children:t}){let n=(0,I.useRef)(null),i=(0,I.useRef)(null),a=(0,I.useContext)(Lt),o=a?.register,s=(0,I.useId)(),[c,l]=(0,I.useState)(!0);(0,I.useLayoutEffect)(()=>{let e=n.current,t=i.current;if(o){let n=e.closest(`[data-slot$="pill"]`);return n?o(s,{pill:n,box:e,full:t}):void 0}let r=()=>l(t.getBoundingClientRect().width<=e.getBoundingClientRect().width+.5);if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(e),a.observe(t),()=>a.disconnect()},[e,t,s,o]);let u=a!==null,d=u?a.showPrefixes:c,f=u&&!d;return(0,J.jsxs)(`span`,{ref:n,className:`relative min-w-0 overflow-hidden`,"aria-hidden":`true`,children:[(0,J.jsxs)(`span`,{ref:i,className:r(`invisible w-max whitespace-nowrap`,f?`absolute left-0 top-0`:`block`),children:[e,` · `,t]}),(0,J.jsxs)(`span`,{"data-slot":`picker-label`,className:r(`block truncate`,f?`relative`:`absolute inset-0`),children:[d?(0,J.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,` · `]}):null,t]})]})}function Ut({fieldLabel:e,ariaLabel:t,label:n,options:r,value:i}){return e?`${t} · ${typeof n==`string`?n:r.find(e=>e.value===i)?.label??i}`:t}function Wt({readOnly:e,disabled:t,hint:n,disabledHint:r}){return e?r??n:t?r:n}function Gt({fieldLabel:e,fullLabel:t,explanation:n}){return e?[t,n].filter(Boolean).join(` — `):n}function Kt({icon:e,fieldLabel:t,ariaLabel:n,label:r}){return(0,J.jsxs)(J.Fragment,{children:[e,t?(0,J.jsx)(Ht,{field:n,children:r}):(0,J.jsx)(`span`,{className:`min-w-0 truncate`,title:typeof r==`string`?r:void 0,children:r})]})}function qt({slot:e,ariaLabel:t,label:n,value:i,options:a,onPick:o,disabled:s=!1,readOnly:c=!1,hint:l,disabledHint:u,status:d,searchPlaceholder:f,icon:p,fieldLabel:m=!1}){let[h,g]=(0,I.useState)(!1),[_,y]=(0,I.useState)(``),b=(0,I.useRef)(null),D=(0,I.useRef)(null),O=f?a.filter(e=>e.label.toLowerCase().includes(_.trim().toLowerCase())):a;(0,I.useEffect)(()=>{if(!h||!f)return;let e=window.setTimeout(()=>b.current?.focus());return()=>window.clearTimeout(e)},[h,f]);let k=e=>{b.current&&document.activeElement===b.current&&e.preventDefault()},A=p?` h-11 gap-2 rounded-lg border-border px-3 text-foreground`:``,j=Ut({fieldLabel:m,ariaLabel:t,label:n,options:a,value:i}),M=Gt({fieldLabel:m,fullLabel:j,explanation:Wt({readOnly:c,disabled:s,hint:l,disabledHint:u})}),N=Kt({icon:p,fieldLabel:m,ariaLabel:t,label:n});if(c)return(0,J.jsxs)(`span`,{"data-slot":e,"aria-label":j,title:M,className:r(Ft,A,`cursor-default hover:bg-card hover:text-muted-foreground`),children:[N,m?(0,J.jsx)(`span`,{className:`sr-only`,children:j}):null]});let P=(0,J.jsxs)(`button`,{type:`button`,"data-slot":e,"aria-label":j,disabled:s,title:M,className:r(Ft,A),children:[N,p?(0,J.jsx)(ee,{"aria-hidden":`true`,className:`size-[13px] shrink-0 text-muted-foreground`}):It]});return s?(0,J.jsx)(`span`,{"data-slot":`picker-pill-disabled-wrapper`,title:M,className:`inline-flex min-w-0 max-w-full`,children:P}):(0,J.jsxs)(E,{open:h,onOpenChange:e=>{g(e),e||y(``)},children:[(0,J.jsx)(C,{asChild:!0,children:P}),(0,J.jsxs)(w,{ref:D,align:`start`,"data-testid":`${e}-menu`,children:[f?(0,J.jsxs)(`div`,{"data-slot":`picker-search`,className:`mbe-1 flex min-h-11 min-w-56 items-center gap-2 border-b border-border px-2`,children:[(0,J.jsx)(v,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,J.jsx)(`input`,{ref:b,type:`search`,"aria-label":f,placeholder:f,value:_,onChange:e=>y(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=D.current?.querySelectorAll(`[role="menuitemradio"]:not([data-disabled])`);(e.key===`ArrowDown`?t?.[0]:t?.[t.length-1])?.focus()}else e.key!==`Escape`&&e.stopPropagation()},className:`h-11 w-0 min-w-0 flex-1 bg-transparent text-sm placeholder:text-muted-foreground`})]}):null,(0,J.jsx)(T,{value:i,onValueChange:o,children:O.map(e=>(0,J.jsx)(x,{value:e.value,className:r(`gap-2.5`,f&&`min-h-11`),onPointerMove:k,onPointerLeave:k,onKeyDown:t=>{b.current&&(t.key===`ArrowUp`&&e===O[0]||t.key===`Tab`&&t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),b.current.focus())},children:(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`text-[13px] font-medium`,children:e.label}),e.desc?(0,J.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.desc}):null]})},e.value))}),f&&O.length===0?(0,J.jsx)(`p`,{role:`status`,className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:`No matches found.`}):null,d?(0,J.jsx)(S,{disabled:!0,onPointerMove:k,onPointerLeave:k,className:`border-t border-border text-[11px] text-muted-foreground`,children:d}):null]})]})}var $=(e,t)=>t===null?e:`${e}:${t}`;function Jt({runners:e,value:t,onPick:n,disabled:r=!1,accounts:i=[],account:a=null,repoAccount:o,icon:s,fieldLabel:c}){let l=et.filter(t=>e.includes(t.id)).flatMap(e=>{let t=i.filter(t=>t.provider===e.id);return t.length<2?[{value:$(e.id,null),label:e.id,desc:e.desc}]:t.map(t=>({value:$(e.id,t.id),label:`${e.id} · ${t.label}`,desc:t.configDir}))}),u=a??o?.[t]??`default`,d=l.some(e=>e.value===$(t,u))?$(t,u):$(t,null);return(0,J.jsx)(qt,{icon:s,fieldLabel:c,slot:`runner-pill`,ariaLabel:`Runner`,label:l.find(e=>e.value===d)?.label??t,value:d,disabled:r,onPick:e=>{let[t,r]=e.split(`:`);n(t,r??null)},options:l})}function Yt(){let e=g(),t=_(),n=(e.data?.profiles??[]).map(e=>({provider:e.provider,id:e.id,label:e.label,configDir:e.configDir})),r=t.data?.info?.root;return{accounts:n,repoAccount:r?e.data?.selections?.[r]:void 0}}function Xt(e,t){return e.filter(e=>e.provider===t).length>1}export{ht as A,He as B,$e as C,pt as D,lt as E,Be as F,qe as H,Ue as I,We as L,Je as M,Ze as N,ut as O,ze as P,Ve as R,at as S,dt as T,Ge as V,et as _,Jt as a,tt as b,Ct as c,Mt as d,Dt as f,Qe as g,Tt as h,Vt as i,gt as j,_t as k,At as l,Pt as m,Yt as n,It as o,jt as p,qt as r,Ft as s,Xt as t,Nt as u,ct as v,nt as w,st as x,mt as y,Ke as z};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,n,s as r,u as i}from"./button-Czdi8NqC.js";import{i as a,t as o}from"./react-runtime-CCIEwYL0.js";import{a as s,d as c,h as l,i as u,l as d,m as f,n as ee,o as te,p,r as m,s as ne,t as re,u as h}from"./es2015-DnySZnV4.js";var g=e(a(),1),_=o(),v=`Dialog`,[y,b]=f(v),[x,S]=y(v),C=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=g.useRef(null),l=g.useRef(null),[u,f]=c({prop:r,defaultProp:i??!1,onChange:a,caller:v});return(0,_.jsx)(x,{scope:t,triggerRef:s,contentRef:l,contentId:d(),titleId:d(),descriptionId:d(),open:u,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(e=>!e),[f]),modal:o,children:n})};C.displayName=v;var w=`DialogTrigger`,T=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=S(w,n),o=r(t,a.triggerRef);return(0,_.jsx)(l.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":B(a.open),...i,ref:o,onClick:p(e.onClick,a.onOpenToggle)})});T.displayName=w;var E=`DialogPortal`,[ie,D]=y(E,{forceMount:void 0}),O=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=S(E,t);return(0,_.jsx)(ie,{scope:t,forceMount:n,children:g.Children.map(r,e=>(0,_.jsx)(h,{present:n||a.open,children:(0,_.jsx)(u,{asChild:!0,container:i,children:e})}))})};O.displayName=E;var k=`DialogOverlay`,A=g.forwardRef((e,t)=>{let n=D(k,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=S(k,e.__scopeDialog);return a.modal?(0,_.jsx)(h,{present:r||a.open,children:(0,_.jsx)(oe,{...i,ref:t})}):null});A.displayName=k;var ae=t(`DialogOverlay.RemoveScroll`),oe=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=S(k,n),o=r(t,ne());return(0,_.jsx)(ee,{as:ae,allowPinchZoom:!0,shards:[a.contentRef],children:(0,_.jsx)(l.div,{"data-state":B(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})}),j=`DialogContent`,M=g.forwardRef((e,t)=>{let n=D(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=S(j,e.__scopeDialog);return(0,_.jsx)(h,{present:r||a.open,children:a.modal?(0,_.jsx)(se,{...i,ref:t}):(0,_.jsx)(ce,{...i,ref:t})})});M.displayName=j;var se=g.forwardRef((e,t)=>{let n=S(j,e.__scopeDialog),i=g.useRef(null),a=r(t,n.contentRef,i);return g.useEffect(()=>{let e=i.current;if(e)return re(e)},[]),(0,_.jsx)(N,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:p(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:p(e.onFocusOutside,e=>e.preventDefault())})}),ce=g.forwardRef((e,t)=>{let n=S(j,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return(0,_.jsx)(N,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),N=g.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=S(j,n);return m(),(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,_.jsx)(te,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":B(c.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),P=`DialogTitle`,F=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=S(P,n);return(0,_.jsx)(l.h2,{id:i.titleId,...r,ref:t})});F.displayName=P;var I=`DialogDescription`,L=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=S(I,n);return(0,_.jsx)(l.p,{id:i.descriptionId,...r,ref:t})});L.displayName=I;var R=`DialogClose`,z=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=S(R,n);return(0,_.jsx)(l.button,{type:`button`,...r,ref:t,onClick:p(e.onClick,()=>i.onOpenChange(!1))})});z.displayName=R;function B(e){return e?`open`:`closed`}var V=`AlertDialog`,[le,ue]=f(V,[b]),H=b(),U=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(C,{...r,...n,modal:!0})};U.displayName=V;var de=`AlertDialogTrigger`,fe=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(T,{...i,...r,ref:t})});fe.displayName=de;var pe=`AlertDialogPortal`,W=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(O,{...r,...n})};W.displayName=pe;var me=`AlertDialogOverlay`,G=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(A,{...i,...r,ref:t})});G.displayName=me;var K=`AlertDialogContent`,[he,ge]=le(K),q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:i,...a}=e,o=H(n),s=r(t,g.useRef(null)),c=g.useRef(null);return(0,_.jsx)(he,{scope:n,cancelRef:c,children:(0,_.jsx)(M,{role:`alertdialog`,...o,...a,ref:s,onOpenAutoFocus:p(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:i})})});q.displayName=K;var _e=`AlertDialogTitle`,J=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(F,{...i,...r,ref:t})});J.displayName=_e;var ve=`AlertDialogDescription`,Y=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(L,{...i,...r,ref:t})});Y.displayName=ve;var ye=`AlertDialogAction`,X=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(z,{...i,...r,ref:t})});X.displayName=ye;var Z=`AlertDialogCancel`,Q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...i}=e,{cancelRef:a}=ge(Z,n),o=H(n),s=r(t,a);return(0,_.jsx)(z,{...o,...i,ref:s})});Q.displayName=Z;var be=U,xe=W,Se=G,Ce=q,we=X,Te=Q,Ee=J,De=Y;function $({...e}){return(0,_.jsx)(be,{"data-slot":`alert-dialog`,...e})}function Oe({...e}){return(0,_.jsx)(xe,{"data-slot":`alert-dialog-portal`,...e})}function ke({className:e,...t}){return(0,_.jsx)(Se,{"data-slot":`alert-dialog-overlay`,className:i(`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 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none`,e),...t})}function Ae({className:e,...t}){return(0,_.jsxs)(Oe,{children:[(0,_.jsx)(ke,{}),(0,_.jsx)(Ce,{"data-slot":`alert-dialog-content`,className:i(`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 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none sm:max-w-md`,e),...t})]})}function je({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:i(`flex flex-col gap-2 text-center sm:text-start`,e),...t})}function Me({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:i(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Ne({className:e,...t}){return(0,_.jsx)(Ee,{"data-slot":`alert-dialog-title`,className:i(`text-lg leading-none font-semibold`,e),...t})}function Pe({className:e,...t}){return(0,_.jsx)(De,{"data-slot":`alert-dialog-description`,className:i(`text-sm text-muted-foreground`,e),...t})}function Fe({className:e,...t}){return(0,_.jsx)(we,{"data-slot":`alert-dialog-action`,className:i(n({variant:`contrast`}),e),...t})}function Ie({className:e,...t}){return(0,_.jsx)(Te,{"data-slot":`alert-dialog-cancel`,className:i(n({variant:`outline`}),e),...t})}export{Pe as a,Ne as c,M as d,L as f,T as g,F as h,Ae as i,C as l,O as m,Fe as n,Me as o,A as p,Ie as r,je as s,$ as t,z as u};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,n,s as r,u as i}from"./button-DGwhwRuD.js";import{i as a,t as o}from"./react-runtime-CCIEwYL0.js";import{a as s,d as c,h as l,i as u,l as d,m as f,n as ee,o as te,p,r as m,s as ne,t as re,u as h}from"./es2015-DTn4s5Lh.js";var g=e(a(),1),_=o(),v=`Dialog`,[y,b]=f(v),[x,S]=y(v),C=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=g.useRef(null),l=g.useRef(null),[u,f]=c({prop:r,defaultProp:i??!1,onChange:a,caller:v});return(0,_.jsx)(x,{scope:t,triggerRef:s,contentRef:l,contentId:d(),titleId:d(),descriptionId:d(),open:u,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(e=>!e),[f]),modal:o,children:n})};C.displayName=v;var w=`DialogTrigger`,T=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=S(w,n),o=r(t,a.triggerRef);return(0,_.jsx)(l.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":B(a.open),...i,ref:o,onClick:p(e.onClick,a.onOpenToggle)})});T.displayName=w;var E=`DialogPortal`,[ie,D]=y(E,{forceMount:void 0}),O=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=S(E,t);return(0,_.jsx)(ie,{scope:t,forceMount:n,children:g.Children.map(r,e=>(0,_.jsx)(h,{present:n||a.open,children:(0,_.jsx)(u,{asChild:!0,container:i,children:e})}))})};O.displayName=E;var k=`DialogOverlay`,A=g.forwardRef((e,t)=>{let n=D(k,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=S(k,e.__scopeDialog);return a.modal?(0,_.jsx)(h,{present:r||a.open,children:(0,_.jsx)(oe,{...i,ref:t})}):null});A.displayName=k;var ae=t(`DialogOverlay.RemoveScroll`),oe=g.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=S(k,n),o=r(t,ne());return(0,_.jsx)(ee,{as:ae,allowPinchZoom:!0,shards:[a.contentRef],children:(0,_.jsx)(l.div,{"data-state":B(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})}),j=`DialogContent`,M=g.forwardRef((e,t)=>{let n=D(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=S(j,e.__scopeDialog);return(0,_.jsx)(h,{present:r||a.open,children:a.modal?(0,_.jsx)(se,{...i,ref:t}):(0,_.jsx)(ce,{...i,ref:t})})});M.displayName=j;var se=g.forwardRef((e,t)=>{let n=S(j,e.__scopeDialog),i=g.useRef(null),a=r(t,n.contentRef,i);return g.useEffect(()=>{let e=i.current;if(e)return re(e)},[]),(0,_.jsx)(N,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:p(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:p(e.onFocusOutside,e=>e.preventDefault())})}),ce=g.forwardRef((e,t)=>{let n=S(j,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return(0,_.jsx)(N,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),N=g.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=S(j,n);return m(),(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,_.jsx)(te,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":B(c.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),P=`DialogTitle`,F=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=S(P,n);return(0,_.jsx)(l.h2,{id:i.titleId,...r,ref:t})});F.displayName=P;var I=`DialogDescription`,L=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=S(I,n);return(0,_.jsx)(l.p,{id:i.descriptionId,...r,ref:t})});L.displayName=I;var R=`DialogClose`,z=g.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=S(R,n);return(0,_.jsx)(l.button,{type:`button`,...r,ref:t,onClick:p(e.onClick,()=>i.onOpenChange(!1))})});z.displayName=R;function B(e){return e?`open`:`closed`}var V=`AlertDialog`,[le,ue]=f(V,[b]),H=b(),U=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(C,{...r,...n,modal:!0})};U.displayName=V;var de=`AlertDialogTrigger`,fe=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(T,{...i,...r,ref:t})});fe.displayName=de;var pe=`AlertDialogPortal`,W=e=>{let{__scopeAlertDialog:t,...n}=e,r=H(t);return(0,_.jsx)(O,{...r,...n})};W.displayName=pe;var me=`AlertDialogOverlay`,G=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(A,{...i,...r,ref:t})});G.displayName=me;var K=`AlertDialogContent`,[he,ge]=le(K),q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:i,...a}=e,o=H(n),s=r(t,g.useRef(null)),c=g.useRef(null);return(0,_.jsx)(he,{scope:n,cancelRef:c,children:(0,_.jsx)(M,{role:`alertdialog`,...o,...a,ref:s,onOpenAutoFocus:p(a.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:i})})});q.displayName=K;var _e=`AlertDialogTitle`,J=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(F,{...i,...r,ref:t})});J.displayName=_e;var ve=`AlertDialogDescription`,Y=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(L,{...i,...r,ref:t})});Y.displayName=ve;var ye=`AlertDialogAction`,X=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=H(n);return(0,_.jsx)(z,{...i,...r,ref:t})});X.displayName=ye;var Z=`AlertDialogCancel`,Q=g.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...i}=e,{cancelRef:a}=ge(Z,n),o=H(n),s=r(t,a);return(0,_.jsx)(z,{...o,...i,ref:s})});Q.displayName=Z;var be=U,xe=W,Se=G,Ce=q,we=X,Te=Q,Ee=J,De=Y;function $({...e}){return(0,_.jsx)(be,{"data-slot":`alert-dialog`,...e})}function Oe({...e}){return(0,_.jsx)(xe,{"data-slot":`alert-dialog-portal`,...e})}function ke({className:e,...t}){return(0,_.jsx)(Se,{"data-slot":`alert-dialog-overlay`,className:i(`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 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none`,e),...t})}function Ae({className:e,...t}){return(0,_.jsxs)(Oe,{children:[(0,_.jsx)(ke,{}),(0,_.jsx)(Ce,{"data-slot":`alert-dialog-content`,className:i(`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 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none sm:max-w-md`,e),...t})]})}function je({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:i(`flex flex-col gap-2 text-center sm:text-start`,e),...t})}function Me({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:i(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function Ne({className:e,...t}){return(0,_.jsx)(Ee,{"data-slot":`alert-dialog-title`,className:i(`text-lg leading-none font-semibold`,e),...t})}function Pe({className:e,...t}){return(0,_.jsx)(De,{"data-slot":`alert-dialog-description`,className:i(`text-sm text-muted-foreground`,e),...t})}function Fe({className:e,...t}){return(0,_.jsx)(we,{"data-slot":`alert-dialog-action`,className:i(n({variant:`contrast`}),e),...t})}function Ie({className:e,...t}){return(0,_.jsx)(Te,{"data-slot":`alert-dialog-cancel`,className:i(n({variant:`outline`}),e),...t})}export{Pe as a,Ne as c,M as d,L as f,T as g,F as h,Ae as i,C as l,O as m,Fe as n,Me as o,A as p,Ie as r,je as s,$ as t,z as u};
@@ -0,0 +1 @@
1
+ import{Ln as e,Mn as t}from"./project-scope-context-BwaC58sQ.js";function n(n){return t[e(n).bucket]<=t.waiting}export{n as t};
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{i as r,r as i,t as a}from"./bundle-mjs-BT31bpU6.js";function o(e,t={displayName:`Squawk`,command:`hsq`,npx:`npx -p @hearsay-tools/squawk hsq`}){return t.displayName}function s(e={displayName:`Squawk`,command:`hsq`,npx:`npx -p @hearsay-tools/squawk hsq`}){return e.command}var c=`/api/v1`,l=``;function u(e){l=e.replace(/\/+$/,``)}function d(){return l}var f=null;function p(e){f=e===``?null:e}function m(){return f}function h(){return f??`default`}var g=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function _(e){return`${l}${c}${v(e)}`}function v(e){return f===null||g.test(e)?e:`/p/${encodeURIComponent(f)}${e}`}var y=/^\/api(?:\/v1)?(\/.*)$/;function b(e){let t=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(t){let n=e.indexOf(`//`,t[0].length);if(n!==t[0].length)return e;let r=e.indexOf(`/`,n+2);if(r===-1)return e;let i=e.slice(0,r),a=x(e.slice(r));return a===null?e:`${i}${a}`}let n=x(l&&e.startsWith(l)?e.slice(l.length):e);return n===null?e:`${l}${n}`}function x(e){let t=y.exec(e);if(!t)return null;let n=t[1];return n.startsWith(`/p/`)?`${c}${n}`:`${c}${v(n)}`}var S=e(t(),1),C=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,w=/^[\\/]{2}/;function T(e,t){return t+e.replace(/\\/g,`/`)}var E=`popstate`;function ee(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function te(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return ie(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return ae(t,n,null,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ne(){return Math.random().toString(36).substring(2,10)}function re(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ie(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?A(t):t,state:n,key:t&&t.key||r||ne(),mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function A(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ae(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ee(e)?e:ie(h.location,e,t);n&&n(r,e),l=u()+1;let d=re(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ee(e)?e:ie(h.location,e,t);n&&n(r,e),l=u();let i=re(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return oe(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(E,d),c=e,()=>{i.removeEventListener(E,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function oe(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),D(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:k(t);return i=i.replace(/ $/,`%20`),!n&&w.test(i)&&(i=r+i),new URL(i,r)}function se(e,t,n=`/`){return ce(e,t,n,!1)}function ce(e,t,n,r,i){let a=M((typeof t==`string`?A(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ue(e),s=null,c=Ee(a);for(let e=0;s==null&&e<o.length;++e)s=Ce(o[e],c,r);return s}function le(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ue(e){let t=de(e);return pe(t),t}function de(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;D(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=P([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),de(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:xe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Te(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of fe(e.path))a(e,t,!0,n)}),t}function fe(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=fe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function pe(e){e.sort((e,t)=>e.score===t.score?Se(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var me=/^:[\w-]+$/,he=3,ge=2,_e=1,ve=10,ye=-2,be=e=>e===`*`;function xe(e,t){let n=e.split(`/`),r=n.length;return n.some(be)&&(r+=ye),t&&(r+=ge),n.filter(e=>!be(e)).reduce((e,t)=>e+(me.test(t)?he:t===``?_e:ve),r)}function Se(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ce(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?we(u,l,s.matcher,s.compiledParams):j(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=j({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:P([a,d.pathname]),pathnameBase:Ne(P([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=P([a,d.pathnameBase]))}return o}function j(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Te(e.path,e.caseSensitive,e.end);return we(e,t,n,r)}function we(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Te(e,t=!1,n=!0){O(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ee(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function M(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function De(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?A(e):e,a;return n?(n=Me(n),a=n.startsWith(`/`)?Oe(n.substring(1),`/`):Oe(n,t)):a=t,{pathname:a,search:Pe(r),hash:Fe(i)}}function Oe(e,t){let n=F(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ke(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ae(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function je(e){let t=Ae(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function N(e,t,n,r=!1){let i;typeof e==`string`?i=A(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),ke(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),ke(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),ke(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=De(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Me=e=>e.replace(/[\\/]{2,}/g,`/`),P=e=>Me(e.join(`/`)),F=e=>e.replace(/\/+$/,``),Ne=e=>F(e).replace(/^\/*/,`/`),Pe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Fe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ie=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Le(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Re(e){return P(e.map(e=>e.route.path).filter(Boolean))||`/`}var ze=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Be(e,t){let n=e;if(typeof n!=`string`||!C.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ze)try{let e=new URL(window.location.href),r=w.test(n)?new URL(T(n,e.protocol)):new URL(n),a=M(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ve=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ve);var He=[`GET`,...Ve];new Set(He);var Ue=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function We(e){try{return Ue.includes(new URL(e).protocol)}catch{return!1}}var I=S.createContext(null);I.displayName=`DataRouter`;var L=S.createContext(null);L.displayName=`DataRouterState`;var Ge=S.createContext(!1);function Ke(){return S.useContext(Ge)}var qe=S.createContext({isTransitioning:!1});qe.displayName=`ViewTransition`;var Je=S.createContext(new Map);Je.displayName=`Fetchers`;var Ye=S.createContext(null);Ye.displayName=`Await`;var R=S.createContext(null);R.displayName=`Navigation`;var z=S.createContext(null);z.displayName=`Location`;var B=S.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName=`Route`;var Xe=S.createContext(null);Xe.displayName=`RouteError`;var Ze=`REACT_ROUTER_ERROR`,Qe=`REDIRECT`,$e=`ROUTE_ERROR_RESPONSE`;function et(e){if(e.startsWith(`${Ze}:${Qe}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function tt(e){if(e.startsWith(`${Ze}:${$e}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ie(t.status,t.statusText,t.data)}catch{}}function nt(e,{relative:t}={}){D(V(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=S.useContext(R),{hash:i,pathname:a,search:o}=W(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:P([n,a])),r.createHref({pathname:s,search:o,hash:i})}function V(){return S.useContext(z)!=null}function H(){return D(V(),`useLocation() may be used only in the context of a <Router> component.`),S.useContext(z).location}function rt(){return S.useContext(z).navigationType}var it=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function at(e){S.useContext(R).static||S.useLayoutEffect(e)}function U(){let{isDataRoute:e}=S.useContext(B);return e?Ot():ot()}function ot(){D(V(),`useNavigate() may be used only in the context of a <Router> component.`);let e=S.useContext(I),{basename:t,navigator:n}=S.useContext(R),{matches:r}=S.useContext(B),{pathname:i}=H(),a=JSON.stringify(je(r)),o=S.useRef(!1);return at(()=>{o.current=!0}),S.useCallback((r,s={})=>{if(O(o.current,it),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=N(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:P([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var st=S.createContext(null);function ct(e){let t=S.useContext(B).outlet;return S.useMemo(()=>t&&S.createElement(st.Provider,{value:e},t),[t,e])}function lt(){let{matches:e}=S.useContext(B);return e[e.length-1]?.params??{}}function W(e,{relative:t}={}){let{matches:n}=S.useContext(B),{pathname:r}=H(),i=JSON.stringify(je(n));return S.useMemo(()=>N(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ut(e,t){return dt(e,t)}function dt(e,t,n){D(V(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=S.useContext(R),{matches:i}=S.useContext(B),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;At(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=H(),d;if(t){let e=typeof t==`string`?A(t):t;D(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):se(e,{pathname:p});O(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=vt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:P([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:P([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?S.createElement(z.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function ft(){let e=Dt(),t=Le(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=S.createElement(S.Fragment,null,S.createElement(`p`,null,`💿 Hey developer 👋`),S.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,S.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,S.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),S.createElement(S.Fragment,null,S.createElement(`h2`,null,`Unexpected Application Error!`),S.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?S.createElement(`pre`,{style:i},n):null,o)}var pt=S.createElement(ft,null),mt=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=tt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:S.createElement(B.Provider,{value:this.props.routeContext},S.createElement(Xe.Provider,{value:e,children:this.props.component}));return this.context?S.createElement(gt,{error:e},t):t}};mt.contextType=Ge;var ht=new WeakMap;function gt({children:e,error:t}){let{basename:n}=S.useContext(R);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=et(t.digest);if(e){let r=ht.get(t);if(r)throw r;let i=Be(e.location,n),a=i.absoluteURL||i.to;if(We(a))throw Error(`Invalid redirect location`);if(ze&&!ht.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ht.set(t,n),n}return S.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function _t({routeContext:e,match:t,children:n}){let r=S.useContext(I);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(B.Provider,{value:e},n)}function vt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);D(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Re(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||pt,o&&(s<0&&c===0?(At(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?S.createElement(n.route.Component,null):n.route.element?n.route.element:e,S.createElement(_t,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?S.createElement(mt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function yt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bt(e){let t=S.useContext(I);return D(t,yt(e)),t}function xt(e){let t=S.useContext(L);return D(t,yt(e)),t}function St(e){let t=S.useContext(B);return D(t,yt(e)),t}function Ct(e){let t=St(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function wt(){return Ct(`useRouteId`)}function Tt(){let e=xt(`useNavigation`);return S.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Et(){let{matches:e,loaderData:t}=xt(`useMatches`);return S.useMemo(()=>e.map(e=>le(e,t)),[e,t])}function Dt(){let e=S.useContext(Xe),t=xt(`useRouteError`),n=Ct(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ot(){let{router:e}=bt(`useNavigate`),t=Ct(`useNavigate`),n=S.useRef(!1);return at(()=>{n.current=!0}),S.useCallback(async(r,i={})=>{O(n.current,it),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var kt={};function At(e,t,n){!t&&!kt[e]&&(kt[e]=!0,O(!1,n))}S.memo(jt);function jt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return dt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Mt({to:e,replace:t,state:n,relative:r}){D(V(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=S.useContext(R);O(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=S.useContext(B),{pathname:o}=H(),s=U(),c=N(e,je(a),o,r===`path`),l=JSON.stringify(c);return S.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Nt(e){return ct(e.context)}function Pt(e){D(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ft({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){D(!V(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=S.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=A(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=S.useMemo(()=>{let e=M(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return O(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:S.createElement(R.Provider,{value:c},S.createElement(z.Provider,{children:t,value:h}))}function It({children:e,location:t}){return ut(G(e),t)}S.Component;function G(e,t=[]){let n=[];return S.Children.forEach(e,(e,r)=>{if(!S.isValidElement(e))return;let i=[...t,r];if(e.type===S.Fragment){n.push.apply(n,G(e.props.children,i));return}D(e.type===Pt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),D(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=G(e.props.children,i)),n.push(a)}),n}var Lt=G,K=`get`,q=`application/x-www-form-urlencoded`;function J(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Rt(e){return J(e)&&e.tagName.toLowerCase()===`button`}function zt(e){return J(e)&&e.tagName.toLowerCase()===`form`}function Bt(e){return J(e)&&e.tagName.toLowerCase()===`input`}function Vt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ht(e,t){return e.button===0&&(!t||t===`_self`)&&!Vt(e)}function Ut(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Wt(e,t){let n=Ut(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Y=null;function Gt(){if(Y===null)try{new FormData(document.createElement(`form`),0),Y=!1}catch{Y=!0}return Y}var Kt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function qt(e){return e!=null&&!Kt.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${q}"`),null):e}function Jt(e,t){let n,r,i,a,o;if(zt(e)){let o=e.getAttribute(`action`);r=o?M(o,t):null,n=e.getAttribute(`method`)||K,i=qt(e.getAttribute(`enctype`))||q,a=new FormData(e)}else if(Rt(e)||Bt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?M(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||K,i=qt(e.getAttribute(`formenctype`))||qt(o.getAttribute(`enctype`))||q,a=new FormData(o,e),!Gt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(J(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=K,r=null,i=q,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Yt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Xt=/[&><\u2028\u2029]/g;function Zt(e){return e.replace(Xt,e=>Yt[e])}function Qt(e,t){if(e===!1||e==null)throw Error(t)}function $t(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&M(i.pathname,t)===`/`?i.pathname=`${F(t)}/_root.${r}`:i.pathname=`${F(i.pathname)}.${r}`,i}async function en(e,t){if(e.id in t)return t[e.id];try{let n=await r(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tn(e){return e!=null&&typeof e.page==`string`}function nn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function rn(e,t,n){return ln((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await en(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(nn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function an(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function on(e,t,{includeHydrateFallback:n}={}){return sn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function sn(e){return[...new Set(e)]}function cn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ln(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!tn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(cn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function un(){let e=S.useContext(I);return Qt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function dn(){let e=S.useContext(L);return Qt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var X=S.createContext(void 0);X.displayName=`FrameworkContext`;function Z(){let e=S.useContext(X);return Qt(e,`You must render this element inside a <HydratedRouter> element`),e}function fn(e,t){let n=S.useContext(X),[r,i]=S.useState(!1),[a,o]=S.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=S.useRef(null);S.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),S.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Q(s,p),onBlur:Q(c,m),onMouseEnter:Q(l,p),onMouseLeave:Q(u,m),onTouchStart:Q(d,p)}]:[a,f,{}]:[!1,f,{}]}function Q(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function pn({page:e,...t}){let n=Ke(),{nonce:r}=Z(),{router:i}=un(),a=S.useMemo(()=>se(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?S.createElement(hn,{page:e,matches:a,...t}):S.createElement(gn,{page:e,matches:a,...t})):null}function mn(e){let{manifest:t,routeModules:n}=Z(),[r,i]=S.useState([]);return S.useEffect(()=>{let r=!1;return rn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function hn({page:e,matches:t,...n}){let r=H(),{future:i}=Z(),{basename:a}=un(),o=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=$t(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return S.createElement(S.Fragment,null,o.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function gn({page:e,matches:t,...n}){let r=H(),{future:i,manifest:a,routeModules:o}=Z(),{basename:s}=un(),{loaderData:c,matches:l}=dn(),u=S.useMemo(()=>an(e,t,l,a,r,`data`),[e,t,l,a,r]),d=S.useMemo(()=>an(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=$t(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=S.useMemo(()=>on(d,a),[d,a]),m=mn(d);return S.createElement(S.Fragment,null,f.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>S.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>S.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function _n(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}S.Component;var vn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{vn&&(window.__reactRouterVersion=`7.18.1`)}catch{}function yn({basename:e,children:t,useTransitions:n,window:r}){let i=S.useRef();i.current??=te({window:r,v5Compat:!0});let a=i.current,[o,s]=S.useState({action:a.action,location:a.location}),c=S.useCallback(e=>{n===!1?s(e):S.startTransition(()=>s(e))},[n]);return S.useLayoutEffect(()=>a.listen(c),[a,c]),S.createElement(Ft,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function bn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=S.useState({action:n.action,location:n.location}),o=S.useCallback(e=>{r===!1?a(e):S.startTransition(()=>a(e))},[r]);return S.useLayoutEffect(()=>n.listen(o),[n,o]),S.createElement(Ft,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}bn.displayName=`unstable_HistoryRouter`;var xn=S.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=S.useContext(R),v=typeof l==`string`&&C.test(l),y=Be(l,h);l=y.to;let b=nt(l,{relative:r}),x=H(),w=null;if(o){let e=N(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:P([h,e.pathname])),w=g.createHref(e)}let[T,E,ee]=fn(n,p),te=On(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||te(t)}let O=!(y.isExternal||i),ne=S.createElement(`a`,{...p,...ee,href:(O?w:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:_n(m,E),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return T&&!v?S.createElement(S.Fragment,null,ne,S.createElement(pn,{page:b})):ne});xn.displayName=`Link`;var Sn=S.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=W(a,{relative:c.relative}),d=H(),f=S.useContext(L),{navigator:p,basename:m}=S.useContext(R),h=f!=null&&Rn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=M(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:x,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return S.createElement(xn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Sn.displayName=`NavLink`;var Cn=S.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=K,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=S.useContext(R),g=Mn(),_=Nn(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&C.test(s);return S.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?S.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Cn.displayName=`Form`;function wn({getKey:e,storageKey:t,...n}){let r=S.useContext(X),{basename:i}=S.useContext(R),a=H(),o=Et();In({getKey:e,storageKey:t});let s=S.useMemo(()=>{if(!r||!e)return null;let t=Fn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),S.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Zt(JSON.stringify(t||Pn))}, ${Zt(JSON.stringify(s))})`}})}wn.displayName=`ScrollRestoration`;function Tn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function En(e){let t=S.useContext(I);return D(t,Tn(e)),t}function Dn(e){let t=S.useContext(L);return D(t,Tn(e)),t}function On(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=U(),d=H(),f=W(e,{relative:o});return S.useCallback(p=>{if(Ht(p,t)){p.preventDefault();let t=n===void 0?k(d)===k(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?S.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function kn(e){O(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=S.useRef(Ut(e)),n=S.useRef(!1),r=H(),i=S.useMemo(()=>Wt(r.search,n.current?null:t.current),[r.search]),a=U();return[i,S.useCallback((e,t)=>{let r=Ut(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var An=0,jn=()=>`__${String(++An)}__`;function Mn(){let{router:e}=En(`useSubmit`),{basename:t}=S.useContext(R),n=wt(),r=e.fetch,i=e.navigate;return S.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Jt(e,t);if(a.navigate===!1){let e=a.fetcherKey||jn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Nn(e,{relative:t}={}){let{basename:n}=S.useContext(R),r=S.useContext(B);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...W(e||`.`,{relative:t})},o=H();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:P([n,a.pathname])),k(a)}var Pn=`react-router-scroll-positions`,$={};function Fn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:M(e.pathname,n)||e.pathname},t)),i??=e.key,i}function In({getKey:e,storageKey:t}={}){let{router:n}=En(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Dn(`useScrollRestoration`),{basename:a}=S.useContext(R),o=H(),s=Et(),c=Tt();S.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ln(S.useCallback(()=>{if(c.state===`idle`){let t=Fn(o,s,a,e);$[t]=window.scrollY}try{sessionStorage.setItem(t||Pn,JSON.stringify($))}catch(e){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(S.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Pn);e&&($=JSON.parse(e))}catch{}},[t]),S.useLayoutEffect(()=>{let t=n?.enableScrollRestoration($,()=>window.scrollY,e?(t,n)=>Fn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),S.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{O(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Ln(e,t){let{capture:n}=t||{};S.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Rn(e,{relative:t}={}){let n=S.useContext(qe);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=En(`useViewTransitionState`),i=W(e,{relative:t});if(!n.isTransitioning)return!1;let a=M(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=M(n.nextLocation.pathname,r)||n.nextLocation.pathname;return j(i.pathname,o)!=null||j(i.pathname,a)!=null}var zn=a({extend:{classGroups:{shadow:[`shadow-modal`]}}});function Bn(...e){return zn(i(e))}function Vn(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}function Hn(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Un=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Wn=i,Gn=(e,t)=>n=>{if(t?.variants==null)return Wn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Un(t)||Un(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Wn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Kn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function qn(...e){return t=>{let n=!1,r=e.map(e=>{let r=Kn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Kn(e[t],null)}}}}function Jn(...e){return S.useCallback(qn(...e),e)}function Yn(e){let t=S.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ir(r)&&typeof cr==`function`&&(r=cr(r._payload)),S.Children.forEach(r,e=>{if(nr(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ir(n)&&typeof cr==`function`&&(n=cr(n._payload)),a=$n(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=S.cloneElement(a,void 0,s):!o&&S.Children.count(r)===1&&S.isValidElement(r)&&(a=r);let c=a?tr(a):void 0,l=Jn(n,c);if(!a){if(r||r===0)throw Error(o?sr(e):or(e));return r}let u=er(i,a.props??{});return a.type!==S.Fragment&&(u.ref=n?l:c),S.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Xn=Yn(`Slot`),Zn=Symbol.for(`radix.slottable`);function Qn(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=Zn,t}var $n=(e,t)=>{if(`child`in e.props){let t=e.props.child;return S.isValidElement(t)?S.cloneElement(t,void 0,e.props.children(t.props.children)):null}return S.isValidElement(t)?t:null};function er(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function tr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function nr(e){return S.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Zn}var rr=Symbol.for(`react.lazy`);function ir(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===rr&&`_payload`in e&&ar(e._payload)}function ar(e){return typeof e==`object`&&!!e&&`then`in e}var or=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,sr=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,cr=S.use,lr=n(),ur=Gn(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-hidden focus-visible:ring-[3px] focus-visible:ring-ring/50 enabled:active:brightness-90 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-action text-action-foreground pointer-hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground pointer-hover:brightness-[0.96]`,outline:`border border-border bg-card text-foreground pointer-hover:bg-muted`,ghost:`text-muted-foreground pointer-hover:bg-muted pointer-hover:text-foreground`,"danger-ghost":`text-danger pointer-hover:bg-danger/10`},size:{default:`h-11 px-3.5 text-[13px]`,sm:`h-[30px] rounded-sm px-2.5 text-[13px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function dr({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,lr.jsx)(r?Xn:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:Bn(ur({variant:t,size:n,className:e})),...i})}export{d as A,H as C,kn as D,lt as E,p as F,s as I,o as L,h as M,b as N,c as O,u as P,V as S,rt as T,Pt as _,Qn as a,j as b,Gn as c,Vn as d,yn as f,Nt as g,Mt as h,Yn as i,m as j,_ as k,Hn as l,Sn as m,ur as n,qn as o,xn as p,Xn as r,Jn as s,dr as t,Bn as u,It as v,U as w,se as x,Lt as y};
@@ -1 +1 @@
1
- import{u as e}from"./button-Czdi8NqC.js";import{t}from"./react-runtime-CCIEwYL0.js";var n=t(),r={primary:`border-accent-strong/25 bg-accent-strong/15 text-link-foreground`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function i({icon:t,tone:i=`neutral`,title:a,subtitle:o,children:c,actions:l,backdrop:u=!1,heading:d=`h1`,className:f}){return(0,n.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":i,className:e(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,f),children:[u?(0,n.jsx)(s,{}):null,(0,n.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,n.jsx)(`div`,{"data-slot":`centered-state-tile`,className:e(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,r[i]),children:t}),(0,n.jsx)(d,{className:`text-2xl font-semibold text-balance text-foreground`,children:a}),o?(0,n.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:o}):null,c?(0,n.jsx)(`div`,{className:`w-full pt-2`,children:c}):null,l?(0,n.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:l}):null]})]})}var a=[{top:`6%`,left:`14%`,size:2,tone:`accent`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`accent`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`accent`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`accent`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`accent`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`accent`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`accent`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`accent`,opacity:.22}],o={accent:`bg-accent-strong`,primary:`bg-action`,pending:`bg-pending`};function s({className:t}){return(0,n.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:e(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,t),children:a.map((t,r)=>(0,n.jsx)(`span`,{className:e(`absolute rounded-[1px] motion-safe:animate-pulse`,t.size===3?`size-[3px]`:`size-0.5`,o[t.tone]),style:{top:t.top,left:t.left,opacity:t.opacity,animationDuration:`3.5s`,animationDelay:`${r%5*700}ms`}},r))})}export{s as n,i as t};
1
+ import{u as e}from"./button-DGwhwRuD.js";import{t}from"./react-runtime-CCIEwYL0.js";var n=t(),r={primary:`border-accent-strong/25 bg-accent-strong/15 text-link-foreground`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function i({icon:t,tone:i=`neutral`,title:a,subtitle:o,children:c,actions:l,backdrop:u=!1,heading:d=`h1`,className:f}){return(0,n.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":i,className:e(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,f),children:[u?(0,n.jsx)(s,{}):null,(0,n.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,n.jsx)(`div`,{"data-slot":`centered-state-tile`,className:e(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,r[i]),children:t}),(0,n.jsx)(d,{className:`text-2xl font-semibold text-balance text-foreground`,children:a}),o?(0,n.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:o}):null,c?(0,n.jsx)(`div`,{className:`w-full pt-2`,children:c}):null,l?(0,n.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:l}):null]})]})}var a=[{top:`6%`,left:`14%`,size:2,tone:`accent`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`accent`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`accent`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`accent`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`accent`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`accent`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`accent`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`accent`,opacity:.22}],o={accent:`bg-accent-strong`,primary:`bg-action`,pending:`bg-pending`};function s({className:t}){return(0,n.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:e(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,t),children:a.map((t,r)=>(0,n.jsx)(`span`,{className:e(`absolute rounded-[1px] motion-safe:animate-pulse`,t.size===3?`size-[3px]`:`size-0.5`,o[t.tone]),style:{top:t.top,left:t.left,opacity:t.opacity,animationDuration:`3.5s`,animationDelay:`${r%5*700}ms`}},r))})}export{s as n,i as t};
@@ -1 +1 @@
1
- import{ft as e}from"./live-protocol-DjH6ZQwI.js";var t={queries:!1,sse:!1,ws:!1};function n(){return!t.queries&&!t.sse&&!t.ws}function r(){typeof window>`u`||Object.getOwnPropertyDescriptor(window,`__cezIdle`)?.get||Object.defineProperty(window,"__cezIdle",{configurable:!0,enumerable:!1,get:n})}function i(e,n){t[e]=n,r()}var a=!1;function o(e){a=e,!(typeof window>`u`)&&(Object.getOwnPropertyDescriptor(window,`__cezLive`)?.get||Object.defineProperty(window,"__cezLive",{configurable:!0,enumerable:!1,get:()=>a}))}function s(t){let n=0,r=!0;i(`queries`,t.isFetching()>0);let a=t.getQueryCache().subscribe(()=>{let a=++n;i(`queries`,!0),!(t.isFetching()>0)&&e.schedule(()=>{e.schedule(()=>{r&&a===n&&t.isFetching()===0&&i(`queries`,!1)})})});return()=>{r=!1,a(),i(`queries`,!1)}}function c(e){i(`sse`,!0);let t=e().filter(e=>e instanceof Promise);return Promise.allSettled(t).then(()=>i(`sse`,!1))}export{c as i,i as n,o as r,s as t};
1
+ import{dt as e}from"./live-protocol-aMLJJ0MQ.js";var t={queries:!1,sse:!1,ws:!1};function n(){return!t.queries&&!t.sse&&!t.ws}function r(){typeof window>`u`||Object.getOwnPropertyDescriptor(window,`__cezIdle`)?.get||Object.defineProperty(window,"__cezIdle",{configurable:!0,enumerable:!1,get:n})}function i(e,n){t[e]=n,r()}var a=!1;function o(e){a=e,!(typeof window>`u`)&&(Object.getOwnPropertyDescriptor(window,`__cezLive`)?.get||Object.defineProperty(window,"__cezLive",{configurable:!0,enumerable:!1,get:()=>a}))}function s(t){let n=0,r=!0;i(`queries`,t.isFetching()>0);let a=t.getQueryCache().subscribe(()=>{let a=++n;i(`queries`,!0),!(t.isFetching()>0)&&e.schedule(()=>{e.schedule(()=>{r&&a===n&&t.isFetching()===0&&i(`queries`,!1)})})});return()=>{r=!1,a(),i(`queries`,!1)}}function c(e){i(`sse`,!0);let t=e().filter(e=>e instanceof Promise);return Promise.allSettled(t).then(()=>i(`sse`,!1))}export{c as i,i as n,o as r,s as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./button-Czdi8NqC.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./project-scope-context-X6-LgbYE.js";import{n as a}from"./use-desktop-C3yCutND.js";import{M as o,ct as s,r as c}from"./design-icons-DmYTv2r1.js";import{n as l}from"./diff-controls-DzcrZF8L.js";import{u}from"./reference-chip-AZWOlSRV.js";import{t as d}from"./project-router-uJ3SkX70.js";import{t as f}from"./centered-state-8l6wvu0C.js";import{Mt as p}from"./index-DYx21hr3.js";import{t as m}from"./diff-DDwr1gUX.js";var h=e(n(),1),g=r();function _({commit:e,sha:n,backTo:r,backLabel:_,slot:v,className:y,diffClassName:b}){let x=a(),[S,C]=(0,h.useState)(`unified`),[w,T]=(0,h.useState)(!1),E=e.isError&&e.error instanceof i&&e.error.status===409,D=x?S:`unified`,O=!x||w;return(0,g.jsxs)(`section`,{"data-slot":v,"data-sha":n,className:y,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,g.jsx)(t,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,g.jsxs)(d,{to:r,children:[(0,g.jsx)(c,{size:16,"aria-hidden":`true`}),_]})}),e.data?(0,g.jsx)(p,{stat:e.data.stat}):null,(0,g.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,g.jsx)(l,{mode:S,wrap:w,onModeChange:C,onWrapChange:T})})]}),e.isPending?(0,g.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):e.isError?(0,g.jsx)(f,{icon:E?(0,g.jsx)(u,{}):(0,g.jsx)(s,{size:16}),tone:E?`neutral`:`danger`,heading:`h2`,title:E?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,g.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[e.data.author,` · `,e.data.when,` ·`,` `,(0,g.jsx)(`span`,{className:`font-mono select-all`,children:e.data.sha})]})]}),e.data.files.length===0?(0,g.jsx)(f,{icon:(0,g.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,g.jsx)(`div`,{className:b,children:(0,g.jsx)(m,{files:e.data.files,mode:D,wrap:O,className:`min-w-0`})})]})]})}export{_ as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./button-DGwhwRuD.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./project-scope-context-BwaC58sQ.js";import{n as a}from"./use-desktop-DpH_9i2n.js";import{M as o,ct as s,r as c}from"./design-icons-DmYTv2r1.js";import{n as l}from"./diff-controls-CeYlCm_y.js";import{u}from"./reference-chip-BFXq2y0V.js";import{t as d}from"./project-router-_4jaKCY-.js";import{t as f}from"./centered-state-B5QmAy2y.js";import{jt as p}from"./index-BXr2mRSZ.js";import{t as m}from"./diff-BB8od2CB.js";var h=e(n(),1),g=r();function _({commit:e,sha:n,backTo:r,backLabel:_,slot:v,className:y,diffClassName:b}){let x=a(),[S,C]=(0,h.useState)(`unified`),[w,T]=(0,h.useState)(!1),E=e.isError&&e.error instanceof i&&e.error.status===409,D=x?S:`unified`,O=!x||w;return(0,g.jsxs)(`section`,{"data-slot":v,"data-sha":n,className:y,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,g.jsx)(t,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,g.jsxs)(d,{to:r,children:[(0,g.jsx)(c,{size:16,"aria-hidden":`true`}),_]})}),e.data?(0,g.jsx)(p,{stat:e.data.stat}):null,(0,g.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,g.jsx)(l,{mode:S,wrap:w,onModeChange:C,onWrapChange:T})})]}),e.isPending?(0,g.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):e.isError?(0,g.jsx)(f,{icon:E?(0,g.jsx)(u,{}):(0,g.jsx)(s,{size:16}),tone:E?`neutral`:`danger`,heading:`h2`,title:E?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,g.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[e.data.author,` · `,e.data.when,` ·`,` `,(0,g.jsx)(`span`,{className:`font-mono select-all`,children:e.data.sha})]})]}),e.data.files.length===0?(0,g.jsx)(f,{icon:(0,g.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,g.jsx)(`div`,{className:b,children:(0,g.jsx)(m,{files:e.data.files,mode:D,wrap:O,className:`min-w-0`})})]})]})}export{_ as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-QTnfLwEv.js";import{t as e,u as t}from"./button-Czdi8NqC.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{mt as i}from"./design-icons-DmYTv2r1.js";import{d as a,f as o,h as s,l as c,m as l,p as u,u as d}from"./alert-dialog-CPBKJTj_.js";n();var f=r();function p({...e}){return(0,f.jsx)(c,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(l,{"data-slot":`dialog-portal`,...e})}function h({className:e,...n}){return(0,f.jsx)(u,{"data-slot":`dialog-overlay`,className:t(`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),...n})}function g({className:e,children:n,showCloseButton:r=!0,overlayClassName:o,...s}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{className:o}),(0,f.jsxs)(a,{"data-slot":`dialog-content`,className:t(`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),...s,children:[n,r&&(0,f.jsxs)(d,{"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)(i,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...n}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:t(`flex shrink-0 flex-col gap-2 text-center sm:text-start`,e),...n})}function v({className:e,...n}){return(0,f.jsx)(`div`,{"data-slot":`dialog-body`,className:t(`min-h-0 min-w-0 overflow-y-auto overscroll-contain`,e),...n})}function y({className:n,showCloseButton:r=!1,children:i,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:t(`flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n),...a,children:[i,r&&(0,f.jsx)(d,{asChild:!0,children:(0,f.jsx)(e,{variant:`outline`,children:`Close`})})]})}function b({className:e,...n}){return(0,f.jsx)(s,{"data-slot":`dialog-title`,className:t(`text-lg leading-none font-semibold`,e),...n})}function x({className:e,...n}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:t(`text-sm text-muted-foreground`,e),...n})}export{y as a,x as i,v as n,_ as o,g as r,b as s,p as t};
1
+ import"./rolldown-runtime-QTnfLwEv.js";import{t as e,u as t}from"./button-DGwhwRuD.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{mt as i}from"./design-icons-DmYTv2r1.js";import{d as a,f as o,h as s,l as c,m as l,p as u,u as d}from"./alert-dialog-CH4SXGfX.js";n();var f=r();function p({...e}){return(0,f.jsx)(c,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(l,{"data-slot":`dialog-portal`,...e})}function h({className:e,...n}){return(0,f.jsx)(u,{"data-slot":`dialog-overlay`,className:t(`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),...n})}function g({className:e,children:n,showCloseButton:r=!0,overlayClassName:o,...s}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{className:o}),(0,f.jsxs)(a,{"data-slot":`dialog-content`,className:t(`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),...s,children:[n,r&&(0,f.jsxs)(d,{"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)(i,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...n}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:t(`flex shrink-0 flex-col gap-2 text-center sm:text-start`,e),...n})}function v({className:e,...n}){return(0,f.jsx)(`div`,{"data-slot":`dialog-body`,className:t(`min-h-0 min-w-0 overflow-y-auto overscroll-contain`,e),...n})}function y({className:n,showCloseButton:r=!1,children:i,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:t(`flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n),...a,children:[i,r&&(0,f.jsx)(d,{asChild:!0,children:(0,f.jsx)(e,{variant:`outline`,children:`Close`})})]})}function b({className:e,...n}){return(0,f.jsx)(s,{"data-slot":`dialog-title`,className:t(`text-lg leading-none font-semibold`,e),...n})}function x({className:e,...n}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:t(`text-sm text-muted-foreground`,e),...n})}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-Bbf1guXZ.js","assets/rolldown-runtime-QTnfLwEv.js","assets/button-DGwhwRuD.js","assets/react-runtime-CCIEwYL0.js","assets/bundle-mjs-BT31bpU6.js","assets/eye-B8okNWXU.js","assets/createLucideIcon-BHp8sXmF.js","assets/index-BXr2mRSZ.js","assets/live-refetch-CZb2VOyu.js","assets/project-scope-context-BwaC58sQ.js","assets/live-protocol-aMLJJ0MQ.js","assets/useInfiniteQuery-BK0ElV__.js","assets/queries-jqgF_s0L.js","assets/useQuery-Qq5WoH8B.js","assets/ws-CayNmoGi.js","assets/toaster-CoMJoQvk.js","assets/cez-idle-TVRD1sce.js","assets/use-desktop-DpH_9i2n.js","assets/es2015-DTn4s5Lh.js","assets/dropdown-menu-DPrTX-zi.js","assets/design-icons-DmYTv2r1.js","assets/dist-ClnpAEgV.js","assets/attention-C_kiJ1bk.js","assets/nav-row-styles-DSBuSnEE.js","assets/format-BNCkW110.js","assets/play-CmVAj_fu.js","assets/reference-chip-BFXq2y0V.js","assets/alert-dialog-CH4SXGfX.js","assets/dialog-B7p5oc5r.js","assets/prompt-template-menu-Q6yvBBX2.js","assets/project-router-_4jaKCY-.js","assets/agent-accounts-WZgtbThS.js","assets/skills-DFBiAuJG.js","assets/sortable.esm-zp_qkYGV.js","assets/centered-state-B5QmAy2y.js","assets/chunk-BO2N2NFS-DE6qKn3r.js","assets/lib-BxQXEXDF.js","assets/index-Bv_JpzCB.css","assets/image-preview-cn57tA1m.js","assets/zoomable-image-C7mEDZaS.js","assets/markdown-BBDDg-4t.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-DGwhwRuD.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{jt as a}from"./index-BXr2mRSZ.js";import{n as o,t as s}from"./image-preview-cn57tA1m.js";var c=e(n(),1),l=r();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-Bbf1guXZ.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`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])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:n=!1,imageSrc:r,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:t(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:n,imageSrc:r,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:n,imageSrc:r,onOpenInApp:i}){return(0,l.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,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:r,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:t(`py-2 font-mono text-xs leading-[1.7]`,n?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
3
+ `).map((e,n)=>(0,l.jsxs)(`span`,{className:t(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},n))})]})}export{u as t};
@@ -1 +1 @@
1
- import{t as e,u as t}from"./button-Czdi8NqC.js";import{t as n}from"./react-runtime-CCIEwYL0.js";import{j as r,v as i}from"./design-icons-DmYTv2r1.js";import{t as a}from"./createLucideIcon-BHp8sXmF.js";import{t as o}from"./eye-B8okNWXU.js";var s=a(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c=a(`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=n();function u({mode:n,wrap:r,onModeChange:i,onWrapChange:a}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center gap-2`,children:[(0,l.jsx)(f,{current:n,value:`unified`,onModeChange:i}),(0,l.jsx)(f,{current:n,value:`split`,onModeChange:i})]}),(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":r,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:t(`size-11`,r&&`bg-muted text-foreground`),onClick:()=>a(!r),children:(0,l.jsx)(c,{"aria-hidden":`true`})})]})}function d({preview:n,onPreviewChange:r}){return(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":n,"aria-label":`Preview Markdown`,title:n?`Show Markdown as a diff`:`Preview Markdown`,className:t(`size-11`,n&&`bg-muted text-foreground`),onClick:()=>r(!n),children:(0,l.jsx)(o,{"aria-hidden":`true`})})}function f({current:e,value:n,onModeChange:r}){let a=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":a,onClick:()=>r(n),className:t(`inline-flex items-center gap-2 min-h-11 rounded-lg border border-border bg-card px-3 text-xs font-medium capitalize`,a?`border-accent-text/40 text-accent-text`:`text-muted-foreground hover:text-foreground`),children:[n===`unified`?(0,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function p({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)(r,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{u as n,d as r,p as t};
1
+ import{t as e,u as t}from"./button-DGwhwRuD.js";import{t as n}from"./react-runtime-CCIEwYL0.js";import{j as r,v as i}from"./design-icons-DmYTv2r1.js";import{t as a}from"./createLucideIcon-BHp8sXmF.js";import{t as o}from"./eye-B8okNWXU.js";var s=a(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c=a(`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=n();function u({mode:n,wrap:r,onModeChange:i,onWrapChange:a}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center gap-2`,children:[(0,l.jsx)(f,{current:n,value:`unified`,onModeChange:i}),(0,l.jsx)(f,{current:n,value:`split`,onModeChange:i})]}),(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":r,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:t(`size-11`,r&&`bg-muted text-foreground`),onClick:()=>a(!r),children:(0,l.jsx)(c,{"aria-hidden":`true`})})]})}function d({preview:n,onPreviewChange:r}){return(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":n,"aria-label":`Preview Markdown`,title:n?`Show Markdown as a diff`:`Preview Markdown`,className:t(`size-11`,n&&`bg-muted text-foreground`),onClick:()=>r(!n),children:(0,l.jsx)(o,{"aria-hidden":`true`})})}function f({current:e,value:n,onModeChange:r}){let a=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":a,onClick:()=>r(n),className:t(`inline-flex items-center gap-2 min-h-11 rounded-lg border border-border bg-card px-3 text-xs font-medium capitalize`,a?`border-accent-text/40 text-accent-text`:`text-muted-foreground hover:text-foreground`),children:[n===`unified`?(0,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function p({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)(r,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{u as n,d as r,p as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-Czdi8NqC.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{t as i}from"./eye-B8okNWXU.js";import{L as a,Mt as o,nt as s,pn as c,rt as l,s as u,tt as d}from"./index-DYx21hr3.js";import{n as f,t as p}from"./image-preview-DpaJAUA9.js";import{n as m,t as h}from"./markdown-BBDDg-4t.js";var g=e(n(),1),_=44;function v(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-DGwhwRuD.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{t as i}from"./eye-B8okNWXU.js";import{L as a,dn as o,et as s,jt as c,nt as l,s as u,tt as d}from"./index-BXr2mRSZ.js";import{n as f,t as p}from"./image-preview-cn57tA1m.js";import{n as m,t as h}from"./markdown-BBDDg-4t.js";var g=e(n(),1),_=44;function v(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
2
2
  `),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function y(e){return v(e)*20+_}function b(e){return e.reduce((e,t)=>e+v(t),0)}function x(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function S(e){return`${e.oldPath??``}→${e.path}`}function C(e){let t=0;for(let n of e.split(`
3
3
  `))n.length>t&&(t=n.length);return t}var w=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,T=300,E=.3;function D(e,t){if(e===t)return null;let n=e.match(w)??[],r=t.match(w)??[];if(n.length===0||r.length===0||n.length>T||r.length>T)return null;let i=O(n,r),a=r.length+1;return(i[n.length*a+r.length]??0)/Math.max(n.length,r.length)<E?null:k(n,r,i)}function O(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 k(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:A(e,i),add:A(t,a)}}function A(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 j(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 M=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,N=`… (patch truncated)`;function P(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
4
4
  `);o.at(-1)===``&&o.pop();for(let e of o){let o=M.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(N)){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 F(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 I(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 L(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=D(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 R(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(L(t,i))}else t(i),r++}}function z(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}),R(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 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:`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}),R(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 V=r();function H({file:e,loadFileText:t,imageSrc:n}){let r=(0,g.useMemo)(()=>U(e),[e]),i=(0,g.useRef)(t);i.current=t;let o=(0,g.useRef)(n);o.current=n;let s=t!==void 0,[c,l]=(0,g.useState)(null);(0,g.useEffect)(()=>{let t=i.current;if(!t)return;let n=!1;return t(e.path).then(t=>!n&&l({path:e.path,text:t}),()=>!n&&l({path:e.path,text:null})),()=>{n=!0}},[e.path,e.patch,s]);let u=(0,g.useCallback)(t=>{let n=o.current,r=n?m(e.path,t):null;return r===null||!n?null:n(r)},[e.path]),d=c?.path===e.path?c:null;if(s&&d===null)return(0,V.jsx)(`p`,{role:`status`,className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Loading preview…`});let f=d?.text??null;if(f===null&&r.text===``)return(0,V.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes to preview.`});let p=f!==null||r.complete?null:s?`The full file could not be loaded. Showing the changed sections only.`:`Showing the changed sections only.`;return(0,V.jsx)(`div`,{"data-slot":`diff-markdown-preview`,className:`px-4 py-5 md:px-6`,children:(0,V.jsxs)(`div`,{className:`mx-auto max-w-[72ch]`,children:[p?(0,V.jsx)(`p`,{className:`mb-4 text-xs text-soft-foreground`,children:p}):null,(0,V.jsx)(a,{document:!0,imageSrc:u,children:f??r.text})]})})}function U(e){let t=P(e.patch);return{text:t.hunks.map(e=>e.lines.filter(e=>e.kind!==`del`).map(e=>e.text).join(`
@@ -6,6 +6,6 @@ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-C
6
6
 
7
7
  ---
8
8
 
9
- `),complete:e.status===`added`&&!t.truncated}}var W=1500,G=new Map;function ee(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function te({files:e,mode:n=`unified`,wrap:r=!1,preview:i,loadFileText:a,imageSrc:s,onOpenInApp:c,viewRef:l,className:u}){let d=(0,g.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[f,p]=(0,g.useState)(()=>new Set),[m,_]=(0,g.useState)(()=>new Map),[v,C]=(0,g.useState)(()=>new Map),[w,T]=(0,g.useState)(i);w!==i&&(T(i),C(new Map));let E=(0,g.useCallback)((e,t)=>{C(n=>new Map(n).set(e,t))},[]),D=(0,g.useCallback)(e=>{p(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),O=(0,g.useCallback)(async(e,t)=>{if(!a)return;let n=await a(e.path);if(n===null)return;let r=I(t,n.split(`
10
- `));_(n=>{let i=S(e);return new Map(n).set(i,new Map(n.get(i)??G).set(t.beforeHunk,r))})},[a]),k=(0,g.useMemo)(()=>b(e),[e]),[A]=(0,g.useState)(()=>typeof window>`u`?``:window.location.search),j=x(A,k),M=(0,g.useRef)(null),N=(0,g.useRef)(null),P=(0,g.useRef)(null);(0,g.useImperativeHandle)(l,()=>({scrollToPath:t=>{let n=e.findIndex(e=>e.path===t);if(n===-1)return;let r=N.current;r?r.scrollToIndex(n,{align:`start`}):ee(P.current,t)?.scrollIntoView({block:`start`,behavior:`smooth`})}}),[e]);let F=e=>{let t=S(e),o=i!==void 0&&h(e),l=o&&(v.get(t)??i);return(0,V.jsx)(ie,{file:e,open:!f.has(t),onToggle:()=>D(t),preview:l,onPreviewChange:o?e=>E(t,e):void 0,loadFileText:a,expanded:m.get(t)??G,onExpand:t=>void O(e,t),mode:n,wrap:r,canExpand:a!==void 0,imageSrc:s,onOpenInApp:c})};return(0,V.jsxs)(`div`,{ref:e=>{P.current=e,e&&(M.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff`,"data-mode":n,className:t(`flex min-w-0 flex-col`,u),children:[(0,V.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 pb-3 text-xs text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[d.files,` `,d.files===1?`file`:`files`,` changed`]}),(0,V.jsx)(o,{stat:d})]}),j===`virtual`?(0,V.jsx)(ne,{files:e,handleRef:N,scrollElRef:M,card:F}):(0,V.jsx)(`div`,{"data-slot":`diff-files`,"data-virtualized":`false`,children:e.map(e=>(0,V.jsx)(`div`,{"data-slot":`diff-file-slot`,style:{containIntrinsicBlockSize:`auto ${y(e)}px`},className:`pb-3 [content-visibility:auto]`,children:F(e)},S(e)))})]})}function ne({files:e,handleRef:t,scrollElRef:n,card:r}){let i=(0,g.useRef)(null),[a,o]=(0,g.useState)(0);return(0,g.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,V.jsx)(`div`,{ref:e=>{i.current=e,e&&(n.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff-files`,"data-virtualized":`true`,children:(0,V.jsx)(u,{ref:t,scrollRef:n,startMargin:a,children:e.map(e=>(0,V.jsx)(`div`,{"data-slot":`diff-file-slot`,className:`pb-3`,children:r(e)},S(e)))})})}var re={added:`added`,deleted:`deleted`,renamed:`renamed`,copied:`copied`};function ie({file:e,open:n,onToggle:r,expanded:a,onExpand:s,mode:l,wrap:u,preview:d,onPreviewChange:f,loadFileText:p,canExpand:m,imageSrc:h,onOpenInApp:g}){let _=re[e.status];return(0,V.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,V.jsxs)(`header`,{className:`sticky top-[var(--diff-sticky-top,0px)] z-10 flex items-center rounded-t-md border-b border-border/50 bg-card`,children:[(0,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-header`,"aria-expanded":n,onClick:r,className:`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,V.jsx)(c,{className:t(`size-3.5 shrink-0 text-soft-foreground transition-transform`,n&&`rotate-90`),"aria-hidden":`true`}),(0,V.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),_?(0,V.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,V.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,V.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,V.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,V.jsx)(o,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),f?(0,V.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:t(`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-soft-foreground hover:bg-muted/50 hover:text-foreground`),children:[(0,V.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),`Preview`]}):null]}),n&&d?(0,V.jsx)(H,{file:e,loadFileText:p,imageSrc:h}):n?(0,V.jsx)(ae,{file:e,expanded:a,onExpand:s,mode:l,wrap:u,canExpand:m,imageSrc:h,onOpenInApp:g}):null]})}function ae({file:e,expanded:n,onExpand:r,mode:i,wrap:a,canExpand:o,imageSrc:s,onOpenInApp:c}){let l=(0,g.useMemo)(()=>P(e.patch),[e.patch]),u=o&&e.status!==`added`&&e.status!==`deleted`,d=(0,g.useMemo)(()=>F(l.hunks,u),[l.hunks,u]),m=(0,g.useMemo)(()=>{let e=[];l.hunks.forEach((t,r)=>{let i=n.get(r);i&&e.push(...i),e.push(...t.lines)});let t=n.get(l.hunks.length);return t&&e.push(...t),e},[l.hunks,n]),h=(0,g.useMemo)(()=>new Map(m.map((e,t)=>[e,t])),[m]),_=oe(e.path,m),v=(0,g.useMemo)(()=>i===`unified`?z(l.hunks,d,n):null,[i,l.hunks,d,n]),y=(0,g.useMemo)(()=>i===`split`?B(l.hunks,d,n):null,[i,l.hunks,d,n]),b=(0,g.useMemo)(()=>i===`unified`&&!a?{minInlineSize:`calc(${C(e.patch)}ch + 7rem)`}:void 0,[i,a,e.patch]);if(f(e))return(0,V.jsx)(p,{file:e,imageSrc:s,onOpenInApp:c});if(e.binary)return(0,V.jsx)(K,{children:`Binary file — no text diff.`});if(l.hunks.length===0)return(0,V.jsx)(K,{children:l.truncated?`Patch truncated by the server.`:`No content changes (metadata only).`});let x=e=>{if(!_)return null;let t=h.get(e);return t===void 0?null:_[t]??null};return(0,V.jsxs)(`div`,{"data-slot":`diff-file-body`,"data-wrap":a||void 0,className:t(`py-1 font-mono text-xs leading-[1.7]`,!a&&`overflow-x-auto`),children:[(0,V.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,V.jsx)(se,{row:e,wrap:a,tokensFor:x,onExpand:u?r:void 0},t)):null,y?y.map((e,t)=>(0,V.jsx)(ce,{row:e,wrap:a,tokensFor:x,onExpand:u?r:void 0},t)):null]}),l.truncated?(0,V.jsx)(K,{children:`Patch truncated by the server — counts above remain exact.`}):null]})}function oe(e,t){let n=(0,g.useMemo)(()=>t.length>W?null:t.map(e=>e.text).join(`
11
- `),[t]),r=(0,g.useMemo)(()=>l(e),[e]),[i,a]=(0,g.useState)(null);return(0,g.useEffect)(()=>{if(n===null||r===null)return;let e=!1;return d(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:s(n,r)?.tokens??null}function K({children:e}){return(0,V.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}var q={add:`bg-diff-add`,del:`bg-diff-del`,context:void 0},J={add:`+`,del:`−`,context:` `};function Y({hunk:e}){return(0,V.jsx)(`div`,{"data-slot":`diff-hunk`,className:`bg-muted/40 px-4 py-0.5 whitespace-pre text-soft-foreground`,children:e.header})}function X({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,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-gap`,onClick:()=>t(e),className:`block w-full border-y border-border/40 bg-muted/20 px-4 py-0.5 text-left text-[11px] text-soft-foreground hover:bg-muted/50 hover:text-foreground`,children:[n,` — expand`]}):(0,V.jsx)(`div`,{"data-slot":`diff-gap`,className:`border-y border-border/40 bg-muted/20 px-4 py-0.5 text-[11px] text-soft-foreground`,children:n})}function Z({cell:e,tokens:n,wrap:r}){let i=j(n,e.spans,e.line.text),a=e.line.kind===`add`?`bg-diff-add-strong`:`bg-diff-del-strong`;return(0,V.jsxs)(`span`,{className:t(`min-w-0 flex-1 pr-4`,r?`break-words whitespace-pre-wrap`:`whitespace-pre`),children:[i.map((n,r)=>(0,V.jsx)(`span`,{"data-word":n.changed?e.line.kind:void 0,style:n.color===void 0?void 0:{color:n.color},className:n.changed?t(`rounded-[2px]`,a):void 0,children:n.text},r)),e.line.text===``?` `:``]})}function Q({value:e}){return(0,V.jsx)(`span`,{className:`w-10 shrink-0 pr-2 text-right text-soft-foreground/70 tabular-nums select-none`,children:e??``})}function se({row:e,wrap:n,tokensFor:r,onExpand:i}){if(e.type===`hunk`)return(0,V.jsx)(Y,{hunk:e.hunk});if(e.type===`gap`)return(0,V.jsx)(X,{gap:e.gap,onExpand:i});let{line:a}=e.cell;return(0,V.jsxs)(`div`,{"data-slot":`diff-line`,"data-line":a.kind,className:t(`flex`,q[a.kind]),children:[(0,V.jsx)(Q,{value:a.oldLine}),(0,V.jsx)(Q,{value:a.newLine}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:J[a.kind]}),(0,V.jsx)(Z,{cell:e.cell,tokens:r(a),wrap:n})]})}function ce({row:e,wrap:t,tokensFor:n,onExpand:r}){return e.type===`hunk`?(0,V.jsx)(Y,{hunk:e.hunk}):e.type===`gap`?(0,V.jsx)(X,{gap:e.gap,onExpand:r}):(0,V.jsxs)(`div`,{"data-slot":`diff-pair`,className:`grid grid-cols-2`,children:[(0,V.jsx)($,{cell:e.left,side:`old`,tokensFor:n,wrap:t}),(0,V.jsx)($,{cell:e.right,side:`new`,tokensFor:n,wrap:t})]})}function $({cell:e,side:n,tokensFor:r,wrap:i}){if(!e)return(0,V.jsx)(`div`,{"data-slot":`diff-cell-empty`,className:t(`bg-muted/20`,n===`new`&&`border-l border-border/40`)});let{line:a}=e;return(0,V.jsxs)(`div`,{"data-slot":`diff-cell`,"data-line":a.kind,className:t(`flex min-w-0 overflow-x-auto`,q[a.kind],n===`new`&&`border-l border-border/40`),children:[(0,V.jsx)(Q,{value:n===`old`?a.oldLine:a.newLine}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:J[a.kind]}),(0,V.jsx)(Z,{cell:e,tokens:r(a),wrap:i})]})}export{te as DiffView};
9
+ `),complete:e.status===`added`&&!t.truncated}}var W=1500,G=new Map;function ee(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function te({files:e,mode:n=`unified`,wrap:r=!1,preview:i,loadFileText:a,imageSrc:o,onOpenInApp:s,viewRef:l,className:u}){let d=(0,g.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[f,p]=(0,g.useState)(()=>new Set),[m,_]=(0,g.useState)(()=>new Map),[v,C]=(0,g.useState)(()=>new Map),[w,T]=(0,g.useState)(i);w!==i&&(T(i),C(new Map));let E=(0,g.useCallback)((e,t)=>{C(n=>new Map(n).set(e,t))},[]),D=(0,g.useCallback)(e=>{p(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),O=(0,g.useCallback)(async(e,t)=>{if(!a)return;let n=await a(e.path);if(n===null)return;let r=I(t,n.split(`
10
+ `));_(n=>{let i=S(e);return new Map(n).set(i,new Map(n.get(i)??G).set(t.beforeHunk,r))})},[a]),k=(0,g.useMemo)(()=>b(e),[e]),[A]=(0,g.useState)(()=>typeof window>`u`?``:window.location.search),j=x(A,k),M=(0,g.useRef)(null),N=(0,g.useRef)(null),P=(0,g.useRef)(null);(0,g.useImperativeHandle)(l,()=>({scrollToPath:t=>{let n=e.findIndex(e=>e.path===t);if(n===-1)return;let r=N.current;r?r.scrollToIndex(n,{align:`start`}):ee(P.current,t)?.scrollIntoView({block:`start`,behavior:`smooth`})}}),[e]);let F=e=>{let t=S(e),c=i!==void 0&&h(e),l=c&&(v.get(t)??i);return(0,V.jsx)(ie,{file:e,open:!f.has(t),onToggle:()=>D(t),preview:l,onPreviewChange:c?e=>E(t,e):void 0,loadFileText:a,expanded:m.get(t)??G,onExpand:t=>void O(e,t),mode:n,wrap:r,canExpand:a!==void 0,imageSrc:o,onOpenInApp:s})};return(0,V.jsxs)(`div`,{ref:e=>{P.current=e,e&&(M.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff`,"data-mode":n,className:t(`flex min-w-0 flex-col`,u),children:[(0,V.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 pb-3 text-xs text-muted-foreground`,children:[(0,V.jsxs)(`span`,{children:[d.files,` `,d.files===1?`file`:`files`,` changed`]}),(0,V.jsx)(c,{stat:d})]}),j===`virtual`?(0,V.jsx)(ne,{files:e,handleRef:N,scrollElRef:M,card:F}):(0,V.jsx)(`div`,{"data-slot":`diff-files`,"data-virtualized":`false`,children:e.map(e=>(0,V.jsx)(`div`,{"data-slot":`diff-file-slot`,style:{containIntrinsicBlockSize:`auto ${y(e)}px`},className:`pb-3 [content-visibility:auto]`,children:F(e)},S(e)))})]})}function ne({files:e,handleRef:t,scrollElRef:n,card:r}){let i=(0,g.useRef)(null),[a,o]=(0,g.useState)(0);return(0,g.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,V.jsx)(`div`,{ref:e=>{i.current=e,e&&(n.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff-files`,"data-virtualized":`true`,children:(0,V.jsx)(u,{ref:t,scrollRef:n,startMargin:a,children:e.map(e=>(0,V.jsx)(`div`,{"data-slot":`diff-file-slot`,className:`pb-3`,children:r(e)},S(e)))})})}var re={added:`added`,deleted:`deleted`,renamed:`renamed`,copied:`copied`};function ie({file:e,open:n,onToggle:r,expanded:a,onExpand:s,mode:l,wrap:u,preview:d,onPreviewChange:f,loadFileText:p,canExpand:m,imageSrc:h,onOpenInApp:g}){let _=re[e.status];return(0,V.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,V.jsxs)(`header`,{className:`sticky top-[var(--diff-sticky-top,0px)] z-10 flex items-center rounded-t-md border-b border-border/50 bg-card`,children:[(0,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-header`,"aria-expanded":n,onClick:r,className:`flex min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,V.jsx)(o,{className:t(`size-3.5 shrink-0 text-soft-foreground transition-transform`,n&&`rotate-90`),"aria-hidden":`true`}),(0,V.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),_?(0,V.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,V.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,V.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,V.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,V.jsx)(c,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),f?(0,V.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:t(`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-soft-foreground hover:bg-muted/50 hover:text-foreground`),children:[(0,V.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),`Preview`]}):null]}),n&&d?(0,V.jsx)(H,{file:e,loadFileText:p,imageSrc:h}):n?(0,V.jsx)(ae,{file:e,expanded:a,onExpand:s,mode:l,wrap:u,canExpand:m,imageSrc:h,onOpenInApp:g}):null]})}function ae({file:e,expanded:n,onExpand:r,mode:i,wrap:a,canExpand:o,imageSrc:s,onOpenInApp:c}){let l=(0,g.useMemo)(()=>P(e.patch),[e.patch]),u=o&&e.status!==`added`&&e.status!==`deleted`,d=(0,g.useMemo)(()=>F(l.hunks,u),[l.hunks,u]),m=(0,g.useMemo)(()=>{let e=[];l.hunks.forEach((t,r)=>{let i=n.get(r);i&&e.push(...i),e.push(...t.lines)});let t=n.get(l.hunks.length);return t&&e.push(...t),e},[l.hunks,n]),h=(0,g.useMemo)(()=>new Map(m.map((e,t)=>[e,t])),[m]),_=oe(e.path,m),v=(0,g.useMemo)(()=>i===`unified`?z(l.hunks,d,n):null,[i,l.hunks,d,n]),y=(0,g.useMemo)(()=>i===`split`?B(l.hunks,d,n):null,[i,l.hunks,d,n]),b=(0,g.useMemo)(()=>i===`unified`&&!a?{minInlineSize:`calc(${C(e.patch)}ch + 7rem)`}:void 0,[i,a,e.patch]);if(f(e))return(0,V.jsx)(p,{file:e,imageSrc:s,onOpenInApp:c});if(e.binary)return(0,V.jsx)(K,{children:`Binary file — no text diff.`});if(l.hunks.length===0)return(0,V.jsx)(K,{children:l.truncated?`Patch truncated by the server.`:`No content changes (metadata only).`});let x=e=>{if(!_)return null;let t=h.get(e);return t===void 0?null:_[t]??null};return(0,V.jsxs)(`div`,{"data-slot":`diff-file-body`,"data-wrap":a||void 0,className:t(`py-1 font-mono text-xs leading-[1.7]`,!a&&`overflow-x-auto`),children:[(0,V.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,V.jsx)(se,{row:e,wrap:a,tokensFor:x,onExpand:u?r:void 0},t)):null,y?y.map((e,t)=>(0,V.jsx)(ce,{row:e,wrap:a,tokensFor:x,onExpand:u?r:void 0},t)):null]}),l.truncated?(0,V.jsx)(K,{children:`Patch truncated by the server — counts above remain exact.`}):null]})}function oe(e,t){let n=(0,g.useMemo)(()=>t.length>W?null:t.map(e=>e.text).join(`
11
+ `),[t]),r=(0,g.useMemo)(()=>l(e),[e]),[i,a]=(0,g.useState)(null);return(0,g.useEffect)(()=>{if(n===null||r===null)return;let e=!1;return s(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:d(n,r)?.tokens??null}function K({children:e}){return(0,V.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}var q={add:`bg-diff-add`,del:`bg-diff-del`,context:void 0},J={add:`+`,del:`−`,context:` `};function Y({hunk:e}){return(0,V.jsx)(`div`,{"data-slot":`diff-hunk`,className:`bg-muted/40 px-4 py-0.5 whitespace-pre text-soft-foreground`,children:e.header})}function X({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,V.jsxs)(`button`,{type:`button`,"data-slot":`diff-gap`,onClick:()=>t(e),className:`block w-full border-y border-border/40 bg-muted/20 px-4 py-0.5 text-left text-[11px] text-soft-foreground hover:bg-muted/50 hover:text-foreground`,children:[n,` — expand`]}):(0,V.jsx)(`div`,{"data-slot":`diff-gap`,className:`border-y border-border/40 bg-muted/20 px-4 py-0.5 text-[11px] text-soft-foreground`,children:n})}function Z({cell:e,tokens:n,wrap:r}){let i=j(n,e.spans,e.line.text),a=e.line.kind===`add`?`bg-diff-add-strong`:`bg-diff-del-strong`;return(0,V.jsxs)(`span`,{className:t(`min-w-0 flex-1 pr-4`,r?`break-words whitespace-pre-wrap`:`whitespace-pre`),children:[i.map((n,r)=>(0,V.jsx)(`span`,{"data-word":n.changed?e.line.kind:void 0,style:n.color===void 0?void 0:{color:n.color},className:n.changed?t(`rounded-[2px]`,a):void 0,children:n.text},r)),e.line.text===``?` `:``]})}function Q({value:e}){return(0,V.jsx)(`span`,{className:`w-10 shrink-0 pr-2 text-right text-soft-foreground/70 tabular-nums select-none`,children:e??``})}function se({row:e,wrap:n,tokensFor:r,onExpand:i}){if(e.type===`hunk`)return(0,V.jsx)(Y,{hunk:e.hunk});if(e.type===`gap`)return(0,V.jsx)(X,{gap:e.gap,onExpand:i});let{line:a}=e.cell;return(0,V.jsxs)(`div`,{"data-slot":`diff-line`,"data-line":a.kind,className:t(`flex`,q[a.kind]),children:[(0,V.jsx)(Q,{value:a.oldLine}),(0,V.jsx)(Q,{value:a.newLine}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:J[a.kind]}),(0,V.jsx)(Z,{cell:e.cell,tokens:r(a),wrap:n})]})}function ce({row:e,wrap:t,tokensFor:n,onExpand:r}){return e.type===`hunk`?(0,V.jsx)(Y,{hunk:e.hunk}):e.type===`gap`?(0,V.jsx)(X,{gap:e.gap,onExpand:r}):(0,V.jsxs)(`div`,{"data-slot":`diff-pair`,className:`grid grid-cols-2`,children:[(0,V.jsx)($,{cell:e.left,side:`old`,tokensFor:n,wrap:t}),(0,V.jsx)($,{cell:e.right,side:`new`,tokensFor:n,wrap:t})]})}function $({cell:e,side:n,tokensFor:r,wrap:i}){if(!e)return(0,V.jsx)(`div`,{"data-slot":`diff-cell-empty`,className:t(`bg-muted/20`,n===`new`&&`border-l border-border/40`)});let{line:a}=e;return(0,V.jsxs)(`div`,{"data-slot":`diff-cell`,"data-line":a.kind,className:t(`flex min-w-0 overflow-x-auto`,q[a.kind],n===`new`&&`border-l border-border/40`),children:[(0,V.jsx)(Q,{value:n===`old`?a.oldLine:a.newLine}),(0,V.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:J[a.kind]}),(0,V.jsx)(Z,{cell:e,tokens:r(a),wrap:i})]})}export{te as DiffView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{f as n}from"./es2015-DnySZnV4.js";var r=e(t(),1);function i(e){let[t,i]=r.useState(void 0);return n(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let n=t[0],r,a;if(`borderBoxSize`in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;i({width:r,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else i(void 0)},[e]),t}export{i as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{f as n}from"./es2015-DTn4s5Lh.js";var r=e(t(),1);function i(e){let[t,i]=r.useState(void 0);return n(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let n=t[0],r,a;if(`borderBoxSize`in n){let e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;i({width:r,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else i(void 0)},[e]),t}export{i as t};