@puddle-code/cli 0.4.9 → 0.4.10

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 (75) hide show
  1. package/CHANGELOG.md +34 -36
  2. package/dist/host-control.mjs +13 -6
  3. package/dist/index.js +17 -9
  4. package/dist/public/assets/App-DZPlytdY.js +63 -0
  5. package/dist/public/assets/{CompilationCommandForm-CipGdjjH.js → CompilationCommandForm-B-CEimt-.js} +1 -1
  6. package/dist/public/assets/Dashboard-D0qSbNc_.js +1 -0
  7. package/dist/public/assets/EditorTabClose-DoclvCbs.js +1 -0
  8. package/dist/public/assets/FindWidget-CNxi2b9L.js +1 -0
  9. package/dist/public/assets/LazyTerminal-BffV6rzu.js +2 -0
  10. package/dist/public/assets/{NotebookWidget-Bcavj7Lb.js → NotebookWidget-CpzrWj4z.js} +1 -1
  11. package/dist/public/assets/{PaneEditorBody-DRA4WG0A.js → PaneEditorBody-C5SVOXKv.js} +6 -6
  12. package/dist/public/assets/{PdfViewer-Cr5306nr.js → PdfViewer-BH-FXEVV.js} +1 -1
  13. package/dist/public/assets/{ReleaseNotesDialog-CbFYKoYM.js → ReleaseNotesDialog-CN7W2Evg.js} +1 -1
  14. package/dist/public/assets/SettingsDialog-D5CH5-vH.js +8 -0
  15. package/dist/public/assets/{Terminal-Bo8hyZj7.js → Terminal-D7rw4Zu8.js} +2 -2
  16. package/dist/public/assets/{Workspace-Bf0VMnaa.css → Workspace-CuAYZ1-B.css} +1 -1
  17. package/dist/public/assets/Workspace-Cvhx3oi9.js +20 -0
  18. package/dist/public/assets/{api-B90WKMKj.js → api-CULxlzTe.js} +1 -1
  19. package/dist/public/assets/archive-i9DnVa-v.js +1 -0
  20. package/dist/public/assets/{auth-CdosKReE.js → auth-C3ruG3fE.js} +1 -1
  21. package/dist/public/assets/button-C-dovHYo.js +1 -0
  22. package/dist/public/assets/client-settings-Cy225e3b.js +1 -0
  23. package/dist/public/assets/command-klU_3huY.js +1 -0
  24. package/dist/public/assets/{context-CG70lLa4.js → context-D1MuDP6X.js} +1 -1
  25. package/dist/public/assets/dialog-B0poBDCr.js +41 -0
  26. package/dist/public/assets/dist-C4YjL9GW.js +1 -0
  27. package/dist/public/assets/{dist-Dge3wHdO.js → dist-DDTfSNTu.js} +1 -1
  28. package/dist/public/assets/dist-Duc5nm48.js +1 -0
  29. package/dist/public/assets/{errors-tuvbq1a_.js → errors-efDAjyqa.js} +1 -1
  30. package/dist/public/assets/expanding-content-Bens1wCS.js +1 -0
  31. package/dist/public/assets/{forward-link-BspnTVuc.js → forward-link-DWN_hZ7A.js} +1 -1
  32. package/dist/public/assets/index-CHGSBAX2.css +2 -0
  33. package/dist/public/assets/{index-Doe7MhnI.js → index-OKzoyhKK.js} +3 -3
  34. package/dist/public/assets/media-refresh-store-odkzJbkh.js +1 -0
  35. package/dist/public/assets/motion-CxPWS8Fa.js +1 -0
  36. package/dist/public/assets/notification-delivery-BHHCcyI1.js +1 -0
  37. package/dist/public/assets/popover-Cv4S_Eut.js +1 -0
  38. package/dist/public/assets/{protocol-support-TSI4Ig6W.js → protocol-support-BwRR1kRO.js} +1 -1
  39. package/dist/public/assets/{scroll-restoration-6GVbekSz.js → scroll-restoration-wdDB8mmu.js} +1 -1
  40. package/dist/public/assets/select-C0AnT3e9.js +1 -0
  41. package/dist/public/assets/{selection-actions-CvYaucrm.js → selection-actions-gU_r-7v_.js} +1 -1
  42. package/dist/public/assets/session-order-rnLHD6HV.js +1 -0
  43. package/dist/public/assets/switch-DllF_QQT.js +1 -0
  44. package/dist/public/assets/use-ui-state-2r7YwqCy.js +1 -0
  45. package/dist/public/assets/{view-state-store-DbQ7YOPe.js → view-state-store-DVvLMbeY.js} +1 -1
  46. package/dist/public/assets/whole-word-BJjKpISQ.js +1 -0
  47. package/dist/public/assets/{ws-Cp1eCJaM.js → ws-B_QsPbsD.js} +1 -1
  48. package/dist/public/index.html +4 -4
  49. package/dist/pudl.js +13 -6
  50. package/package.json +1 -1
  51. package/dist/public/assets/App-UQXXCAJF.js +0 -65
  52. package/dist/public/assets/Dashboard-6pSi_1fH.js +0 -1
  53. package/dist/public/assets/EditorTabClose-TixDVxvl.js +0 -1
  54. package/dist/public/assets/FindWidget-DG1YP6Zx.js +0 -1
  55. package/dist/public/assets/LazyTerminal-B88WIvyh.js +0 -2
  56. package/dist/public/assets/NewProjectDialog-C1TVzOvJ.js +0 -1
  57. package/dist/public/assets/SettingsDialog-BvaE3Ue8.js +0 -8
  58. package/dist/public/assets/Workspace-Bf2zQC6v.js +0 -20
  59. package/dist/public/assets/button-C_Rvtcwg.js +0 -1
  60. package/dist/public/assets/chevron-right-BEy-IXEZ.js +0 -1
  61. package/dist/public/assets/client-settings-DhfHheKR.js +0 -1
  62. package/dist/public/assets/command-BV8ZEhQz.js +0 -1
  63. package/dist/public/assets/context-menu-D3ZhKA9s.js +0 -1
  64. package/dist/public/assets/dialog-D-Axqpzg.js +0 -41
  65. package/dist/public/assets/dist-BmSuHjIq.js +0 -1
  66. package/dist/public/assets/dist-Cq-O0n8n.js +0 -1
  67. package/dist/public/assets/index-4XrK4Fes.css +0 -2
  68. package/dist/public/assets/media-refresh-store-CiyvSvEu.js +0 -1
  69. package/dist/public/assets/motion-OSLfKoC0.js +0 -1
  70. package/dist/public/assets/notification-delivery-CegOQxcZ.js +0 -1
  71. package/dist/public/assets/popover-D-jcaKGN.js +0 -1
  72. package/dist/public/assets/select-p5KTVHbg.js +0 -1
  73. package/dist/public/assets/session-order-CiDVvIU5.js +0 -1
  74. package/dist/public/assets/switch-oBD5uCTu.js +0 -1
  75. package/dist/public/assets/use-ui-state-D4FsRK2R.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import"./auth-C3ruG3fE.js";import{t as n}from"./jsx-runtime-By8HlURe.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{n as i,t as a}from"./motion-CxPWS8Fa.js";import{n as o,t as s}from"./createLucideIcon-C9A1vLE-.js";import{C as c,E as l,T as u,g as d}from"./dialog-B0poBDCr.js";import{d as f,f as p,r as m,u as h}from"./dist-C4YjL9GW.js";import{_ as g,a as _,c as v,d as y,f as b,g as x,h as S,i as ee,l as C,m as te,n as ne,o as re,p as ie,r as ae,s as oe,t as se,u as ce}from"./dist-Duc5nm48.js";var le=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ue=/^[\\/]{2}/;function de(e,t){return t+e.replace(/\\/g,`/`)}var fe=`popstate`;function pe(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function me(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return _e(``,{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:E(t)}return ve(t,n,null,e)}function w(e,t){if(e===!1||e==null)throw Error(t)}function T(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function he(){return Math.random().toString(36).substring(2,10)}function ge(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 _e(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?D(t):t,state:n,key:t&&t.key||r||he(),mask:i}}function E({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 D(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 ve(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=pe(e)?e:_e(h.location,e,t);n&&n(r,e),l=u()+1;let d=ge(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=pe(e)?e:_e(h.location,e,t);n&&n(r,e),l=u();let i=ge(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 ye(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(fe,d),c=e,()=>{i.removeEventListener(fe,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 ye(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),w(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:E(t);return i=i.replace(/ $/,`%20`),!n&&ue.test(i)&&(i=r+i),new URL(i,r)}var O=e(t(),1);function be(e,t,n=`/`){return xe(e,t,n,!1)}function xe(e,t,n,r,i){let a=A((typeof t==`string`?D(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Ce(e),s=null,c=Ve(a);for(let e=0;s==null&&e<o.length;++e)s=Re(o[e],c,r);return s}function Se(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function Ce(e){let t=we(e);return Ee(t),t}function we(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;w(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=j([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(w(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),we(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ie(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Be(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 Te(e.path))a(e,t,!0,n)}),t}function Te(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=Te(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 Ee(e){e.sort((e,t)=>e.score===t.score?Le(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var De=/^:[\w-]+$/,Oe=/^:[\w-]+/,ke=3.5,Ae=3,je=2,Me=1,Ne=10,Pe=-2,Fe=e=>e===`*`;function Ie(e,t){let n=e.split(`/`),r=n.length;return n.some(Fe)&&(r+=Pe),t&&(r+=je),n.filter(e=>!Fe(e)).reduce((e,t)=>e+(De.test(t)?Ae:Oe.test(t)?ke:t===``?Me:Ne),r)}function Le(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 Re(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?ze(u,l,s.matcher,s.compiledParams):k(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=k({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:j([a,d.pathname]),pathnameBase:Xe(j([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=j([a,d.pathnameBase]))}return o}function k(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Be(e.path,e.caseSensitive,e.end);return ze(e,t,n,r)}function ze(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 Be(e,t=!1,n=!0){T(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)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ve(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return T(!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 A(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 He(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?D(e):e,a;return n?(n=Je(n),a=n.startsWith(`/`)?Ue(n.substring(1),`/`):Ue(n,t)):a=t,{pathname:a,search:Ze(r),hash:Qe(i)}}function Ue(e,t){let n=Ye(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function We(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 Ge(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ke(e){let t=Ge(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function qe(e,t,n,r=!1){let i;typeof e==`string`?i=D(e):(i={...e},w(!i.pathname||!i.pathname.includes(`?`),We(`?`,`pathname`,`search`,i)),w(!i.pathname||!i.pathname.includes(`#`),We(`#`,`pathname`,`hash`,i)),w(!i.search||!i.search.includes(`#`),We(`#`,`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=He(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Je=e=>e.replace(/[\\/]{2,}/g,`/`),j=e=>Je(e.join(`/`)),Ye=e=>e.replace(/\/+$/,``),Xe=e=>Ye(e).replace(/^\/*/,`/`),Ze=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Qe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,$e=class{status;statusText;data;error;internal;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 et(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function tt(e){return j(e.map(e=>e.route.path).filter(Boolean))||`/`}var nt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function rt(e,t){let n=e;if(typeof n!=`string`||!le.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(nt)try{let e=new URL(window.location.href),r=ue.test(n)?new URL(de(n,e.protocol)):new URL(n),a=A(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{T(!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}}var it=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(it);var at=[`GET`,...it];new Set(at);var ot=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function st(e){try{return ot.includes(new URL(e).protocol)}catch{return!1}}var M=O.createContext(null);M.displayName=`DataRouter`;var N=O.createContext(null);N.displayName=`DataRouterState`;var ct=O.createContext(!1);function lt(){return O.useContext(ct)}var ut=O.createContext({isTransitioning:!1});ut.displayName=`ViewTransition`;var dt=O.createContext(new Map);dt.displayName=`Fetchers`;var ft=O.createContext(null);ft.displayName=`Await`;var P=O.createContext(null);P.displayName=`Navigation`;var F=O.createContext(null);F.displayName=`Location`;var I=O.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName=`Route`;var pt=O.createContext(null);pt.displayName=`RouteError`;var mt=`REACT_ROUTER_ERROR`,ht=`REDIRECT`,gt=`ROUTE_ERROR_RESPONSE`;function _t(e){if(e.startsWith(`${mt}:${ht}:{`))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 vt(e){if(e.startsWith(`${mt}:${gt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new $e(t.status,t.statusText,t.data)}catch{}}function yt(e,{relative:t}={}){w(L(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=O.useContext(P),{hash:i,pathname:a,search:o}=z(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:j([n,a])),r.createHref({pathname:s,search:o,hash:i})}function L(){return O.useContext(F)!=null}function R(){return w(L(),`useLocation() may be used only in the context of a <Router> component.`),O.useContext(F).location}var bt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function xt(){let{isDataRoute:e}=O.useContext(I);return e?Ut():St()}function St(){w(L(),`useNavigate() may be used only in the context of a <Router> component.`);let e=O.useContext(M),{basename:t,navigator:n}=O.useContext(P),{matches:r}=O.useContext(I),{pathname:i}=R(),a=JSON.stringify(Ke(r)),o=O.useRef(!1);return O.useLayoutEffect(()=>{o.current=!0}),O.useCallback((r,s={})=>{if(T(o.current,bt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=qe(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:j([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Ct=O.createContext(null);function wt(e){let t=O.useContext(I).outlet;return O.useMemo(()=>t&&O.createElement(Ct.Provider,{value:e},t),[t,e])}function Tt(){let{matches:e}=O.useContext(I);return e[e.length-1]?.params??{}}function z(e,{relative:t}={}){let{matches:n}=O.useContext(I),{pathname:r}=R(),i=JSON.stringify(Ke(n));return O.useMemo(()=>qe(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Et(e,t){return Dt(e,t)}function Dt(e,t,n){w(L(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=O.useContext(P),{matches:i}=O.useContext(I),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=R(),l;if(t){let e=typeof t==`string`?D(t):t;w(s===`/`||e.pathname?.startsWith(s),`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 "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):be(e,{pathname:d}),p=Pt(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:j([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:j([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?O.createElement(F.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Ot(){let e=Ht(),t=et(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return O.createElement(O.Fragment,null,O.createElement(`h2`,null,`Unexpected Application Error!`),O.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?O.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var kt=O.createElement(Ot,null),At=class extends O.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=ct;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=vt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:O.createElement(I.Provider,{value:this.props.routeContext},O.createElement(pt.Provider,{value:e,children:this.props.component}));return this.context?O.createElement(Mt,{error:e},t):t}},jt=new WeakMap;function Mt({children:e,error:t}){let{basename:n}=O.useContext(P);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=_t(t.digest);if(e){let r=jt.get(t);if(r)throw r;let i=rt(e.location,n),a=i.absoluteURL||i.to;if(st(a))throw Error(`Invalid redirect location`);if(nt&&!jt.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 jt.set(t,n),n}return O.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Nt({routeContext:e,match:t,children:n}){let r=O.useContext(M);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),O.createElement(I.Provider,{value:e},n)}function Pt(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);w(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:tt(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||kt,o&&(s<0&&c===0?(Gt(`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?O.createElement(n.route.Component,null):n.route.element?n.route.element:e,O.createElement(Nt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?O.createElement(At,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Ft(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function It(e){let t=O.useContext(M);return w(t,Ft(e)),t}function Lt(e){let t=O.useContext(N);return w(t,Ft(e)),t}function Rt(e){let t=O.useContext(I);return w(t,Ft(e)),t}function B(e){let t=Rt(e),n=t.matches[t.matches.length-1];return w(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function zt(){return B(`useRouteId`)}function Bt(){let e=Lt(`useNavigation`);return O.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Vt(){let{matches:e,loaderData:t}=Lt(`useMatches`);return O.useMemo(()=>e.map(e=>Se(e,t)),[e,t])}function Ht(){let e=O.useContext(pt),t=Lt(`useRouteError`),n=B(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ut(){let{router:e}=It(`useNavigate`),t=B(`useNavigate`),n=O.useRef(!1);return O.useLayoutEffect(()=>{n.current=!0}),O.useCallback(async(r,i={})=>{T(n.current,bt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Wt={};function Gt(e,t,n){!t&&!Wt[e]&&(Wt[e]=!0,T(!1,n))}O.memo(Kt);function Kt({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 qt(e){return wt(e.context)}function Jt(e){w(!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 Yt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){w(!L(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=O.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=D(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=O.useMemo(()=>{let e=A(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 T(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:O.createElement(P.Provider,{value:c},O.createElement(F.Provider,{children:t,value:h}))}function Xt({children:e,location:t}){return Et(V(e),t)}O.Component;function V(e,t=[]){let n=[];return O.Children.forEach(e,(e,r)=>{if(!O.isValidElement(e))return;let i=[...t,r];if(e.type===O.Fragment){n.push.apply(n,V(e.props.children,i));return}w(e.type===Jt,`[${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>`);let a=e.props;w(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=V(a.children,i)),n.push(o)}),n}var H=`application/x-www-form-urlencoded`;function U(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Zt(e){return U(e)&&e.tagName.toLowerCase()===`button`}function Qt(e){return U(e)&&e.tagName.toLowerCase()===`form`}function $t(e){return U(e)&&e.tagName.toLowerCase()===`input`}function en(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tn(e,t){return e.button===0&&(!t||t===`_self`)&&!en(e)}var W=null;function nn(){if(W===null)try{new FormData(document.createElement(`form`),0),W=!1}catch{W=!0}return W}var rn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function an(e){return e!=null&&!rn.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${H}"`),null):e}function on(e,t){let n,r,i,a,o;if(Qt(e)){let o=e.getAttribute(`action`);r=o?A(o,t):null,n=e.getAttribute(`method`)||`get`,i=an(e.getAttribute(`enctype`))||H,a=new FormData(e)}else if(Zt(e)||$t(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?A(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=an(e.getAttribute(`formenctype`))||an(o.getAttribute(`enctype`))||H,a=new FormData(o,e),!nn()){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(U(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=H,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function sn(e,t){if(e===!1||e==null)throw Error(t)}var cn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ln=/[&><\u2028\u2029]/g;function un(e){return e.replace(ln,e=>cn[e])}function dn(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname.endsWith(`/`)?n.pathname=`${n.pathname}_.${t}`:n.pathname=`${n.pathname}.${t}`,n}async function fn(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 pn(e){return e!=null&&typeof e.page==`string`}function mn(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 hn(e,t,n){return bn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await fn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(mn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function gn(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 _n(e,t,{includeHydrateFallback:n}={}){return vn(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 vn(e){return[...new Set(e)]}function yn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function bn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!pn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(yn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function xn(){let e=O.useContext(M);return sn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Sn(){let e=O.useContext(N);return sn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var G=O.createContext(void 0);G.displayName=`FrameworkContext`;function Cn(){let e=O.useContext(G);return sn(e,`You must render this element inside a <HydratedRouter> element`),e}function wn(e,t){let n=O.useContext(G),[r,i]=O.useState(!1),[a,o]=O.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=O.useRef(null);O.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]),O.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:K(s,p),onBlur:K(c,m),onMouseEnter:K(l,p),onMouseLeave:K(u,m),onTouchStart:K(d,p)}]:[a,f,{}]:[!1,f,{}]}function K(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Tn({page:e,...t}){let n=lt(),{nonce:r}=Cn(),{router:i}=xn(),a=O.useMemo(()=>be(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?O.createElement(Dn,{page:e,matches:a,...t}):O.createElement(On,{page:e,matches:a,...t})):null}function En(e){let{manifest:t,routeModules:n}=Cn(),[r,i]=O.useState([]);return O.useEffect(()=>{let r=!1;return hn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Dn({page:e,matches:t,...n}){let r=R(),i=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=dn(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return O.createElement(O.Fragment,null,i.map(e=>O.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function On({page:e,matches:t,...n}){let r=R(),{manifest:i,routeModules:a}=Cn(),{loaderData:o,matches:s}=Sn(),c=O.useMemo(()=>gn(e,t,s,i,r,`data`),[e,t,s,i,r]),l=O.useMemo(()=>gn(e,t,s,i,r,`assets`),[e,t,s,i,r]),u=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];!t||!t.hasLoader||(!c.some(t=>t.route.id===e.route.id)&&e.route.id in o&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let l=dn(e,`data`);return s&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[o,r,i,c,t,e,a]),d=O.useMemo(()=>_n(l,i),[l,i]),f=En(l);return O.createElement(O.Fragment,null,u.map(e=>O.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>O.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>O.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function kn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{An&&(window.__reactRouterVersion=`8.2.0`)}catch{}function jn({basename:e,children:t,useTransitions:n,window:r}){let i=O.useRef(null);i.current??=me({window:r,v5Compat:!0});let a=i.current,[o,s]=O.useState({action:a.action,location:a.location}),c=O.useCallback(e=>{n===!1?s(e):O.startTransition(()=>s(e))},[n]);return O.useLayoutEffect(()=>a.listen(c),[a,c]),O.createElement(Yt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Mn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=O.useState({action:n.action,location:n.location}),o=O.useCallback(e=>{r===!1?a(e):O.startTransition(()=>a(e))},[r]);return O.useLayoutEffect(()=>n.listen(o),[n,o]),O.createElement(Yt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Mn.displayName=`unstable_HistoryRouter`;var Nn=O.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:_}=O.useContext(P),v=typeof l==`string`&&le.test(l),y=rt(l,h);l=y.to;let b=yt(l,{relative:r}),x=R(),S=null;if(o){let e=qe(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:j([h,e.pathname])),S=g.createHref(e)}let[ee,C,te]=wn(n,p),ne=Bn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function re(t){e&&e(t),t.defaultPrevented||ne(t)}let ie=!(y.isExternal||i),ae=O.createElement(`a`,{...p,...te,href:(ie?S:void 0)||y.absoluteURL||b,onClick:ie?re:e,ref:kn(m,C),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return ee&&!v?O.createElement(O.Fragment,null,ae,O.createElement(Tn,{page:b})):ae});Nn.displayName=`Link`;var Pn=O.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=z(a,{relative:c.relative}),d=R(),f=O.useContext(N),{navigator:p,basename:m}=O.useContext(P),h=f!=null&&Jn(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=A(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)===`/`),S={isActive:b,isPending:x,isTransitioning:h},ee=b?e:void 0,C;C=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let te=typeof i==`function`?i(S):i;return O.createElement(Nn,{...c,"aria-current":ee,className:C,ref:l,style:te,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Pn.displayName=`NavLink`;var Fn=O.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=O.useContext(P),g=Un(),_=Wn(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&le.test(s);return O.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?O.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Fn.displayName=`Form`;function In({getKey:e,storageKey:t,...n}){let r=O.useContext(G),{basename:i}=O.useContext(P),a=R(),o=Vt();Kn({getKey:e,storageKey:t});let s=O.useMemo(()=>{if(!r||!e)return null;let t=Gn(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),O.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${un(JSON.stringify(t||q))}, ${un(JSON.stringify(s))})`}})}In.displayName=`ScrollRestoration`;function Ln(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rn(e){let t=O.useContext(M);return w(t,Ln(e)),t}function zn(e){let t=O.useContext(N);return w(t,Ln(e)),t}function Bn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=xt(),d=R(),f=z(e,{relative:o});return O.useCallback(p=>{if(tn(p,t)){p.preventDefault();let t=n===void 0?E(d)===E(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?O.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Vn=0,Hn=()=>`__${String(++Vn)}__`;function Un(){let{router:e}=Rn(`useSubmit`),{basename:t}=O.useContext(P),n=zt(),r=e.fetch,i=e.navigate;return O.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=on(e,t);a.navigate===!1?await r(a.fetcherKey||Hn(),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}):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 Wn(e,{relative:t}={}){let{basename:n}=O.useContext(P),r=O.useContext(I);w(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...z(e||`.`,{relative:t})},o=R();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:j([n,a.pathname])),E(a)}var q=`react-router-scroll-positions`,J={};function Gn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:A(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Kn({getKey:e,storageKey:t}={}){let{router:n}=Rn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=zn(`useScrollRestoration`),{basename:a}=O.useContext(P),o=R(),s=Vt(),c=Bt();O.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),qn(O.useCallback(()=>{if(c.state===`idle`){let t=Gn(o,s,a,e);J[t]=window.scrollY}try{sessionStorage.setItem(t||q,JSON.stringify(J))}catch(e){T(!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`&&(O.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||q);e&&(J=JSON.parse(e))}catch{}},[t]),O.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(J,()=>window.scrollY,e?(t,n)=>Gn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),O.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{T(!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 qn(e,t){let{capture:n}=t||{};O.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Jn(e,{relative:t}={}){let n=O.useContext(ut);w(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Rn(`useViewTransitionState`),i=z(e,{relative:t});if(!n.isTransitioning)return!1;let a=A(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=A(n.nextLocation.pathname,r)||n.nextLocation.pathname;return k(i.pathname,o)!=null||k(i.pathname,a)!=null}var Yn=0,Y=new Set,Xn=()=>Yn>0;function Zn(e,t,n){if(a()||!t){e();return}for(let e of Y)e.cancel();Y.clear();let r=new Map([...document.querySelectorAll(`[data-workspace-pane]`)].filter(e=>!e.closest(`[data-motion-snapshot]`)).map(e=>[e.dataset.workspacePane,e.getBoundingClientRect()]));Yn++;try{e()}finally{requestAnimationFrame(()=>{if(Yn--,a())return;let e=n();if(!e)return;let i=e.closest(`[data-workspace-pane]`),o=(e,t,n)=>{let r=e.getBoundingClientRect();if(!r.width||!r.height)return;let i=t.left-r.left,a=t.top-r.top,o=Math.max(.02,t.width/r.width),s=Math.max(.02,t.height/r.height),c=e.animate((n?[{transform:`translate(${i}px, ${a}px) scale(${o}, ${s})`,opacity:.4,offset:0},{transform:`translate(${i*.25}px, ${a*.35}px) scale(${o+(1-o)*.85}, ${s+(1-s)*.5})`,opacity:1,offset:.55},{transform:`none`,opacity:1,offset:1}]:[{transform:`translate(${i}px, ${a}px)`,width:`${t.width}px`,height:`${t.height}px`},{transform:`none`,width:`${r.width}px`,height:`${r.height}px`}]).map(e=>({...e,transformOrigin:`top left`})),{duration:320,easing:`cubic-bezier(0.2, 0.7, 0.2, 1)`});c.effect?.updateTiming({fill:`none`}),Y.add(c),c.finished.then(()=>Y.delete(c),()=>Y.delete(c))};for(let e of document.querySelectorAll(`[data-workspace-pane]`)){if(e.closest(`[data-motion-snapshot]`))continue;let n=r.get(e.dataset.workspacePane);if(e===i&&!n)o(e,t,!0);else if(n){let t=e.getBoundingClientRect();(n.x!==t.x||n.y!==t.y||n.width!==t.width||n.height!==t.height)&&o(e,n,!1)}}i&&e!==i&&r.has(i.dataset.workspacePane)&&o(e,t,!0);let s=new MutationObserver(()=>{if(a())for(let e of Y)e.cancel()});s.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-reduce-motion`]}),Promise.allSettled([...Y].map(e=>e.finished)).then(()=>s.disconnect())})}}var X=n(),Qn=class extends O.Component{live=(0,O.createRef)();layers=(0,O.createRef)();animations=[];clear=()=>{this.animations.forEach(e=>e.cancel()),this.animations=[],this.layers.current?.replaceChildren()};getSnapshotBeforeUpdate(e){if(e.motionKey===this.props.motionKey||e.preview&&this.props.preview||this.props.reduced||Xn())return null;let t=this.live.current;if(!t||!t.getBoundingClientRect().width)return null;let n=t.cloneNode(!0),r=t.querySelectorAll(`canvas`);n.querySelectorAll(`canvas`).forEach((e,t)=>{let n=r[t];if(!(!n||!n.width||!n.height))try{e.getContext(`2d`)?.drawImage(n,0,0)}catch{}}),n.querySelectorAll(`[data-motion-snapshot]`).forEach(e=>e.remove()),n.querySelectorAll(`iframe, audio, video, object, embed`).forEach(e=>e.remove());for(let e of[n,...n.querySelectorAll(`*`)])for(let t of e.getAttributeNames())(t===`id`||t===`autofocus`||t.startsWith(`data-`))&&e.removeAttribute(t);n.inert=!0,n.setAttribute(`aria-hidden`,`true`),n.dataset.motionSnapshot=``;let i=getComputedStyle(t),a=t.getBoundingClientRect();return n.style.width=`${a.width}px`,n.style.height=`${a.height}px`,n.style.opacity=i.opacity,n.style.scale=i.scale,n}componentDidUpdate(e,t,n){if(this.props.reduced||Xn()||e.preview&&this.props.preview&&e.motionKey!==this.props.motionKey){this.clear();return}if(e.motionKey===this.props.motionKey)return;this.clear();let r=this.live.current;if(!r)return;n&&(this.layers.current?.append(n),this.animations.push(n.animate([{opacity:n.style.opacity,scale:n.style.scale},{opacity:0,scale:`0.97`}],{duration:180,easing:`ease-in`,fill:`forwards`})));let i=r.animate([{opacity:0,scale:`0.97`},{opacity:1,scale:`1`}],{duration:180,easing:`ease-out`});this.animations.push(i),i.finished.then(()=>{this.animations.includes(i)&&this.clear()},()=>{})}componentWillUnmount(){this.clear()}render(){return(0,X.jsxs)(`div`,{className:o(`relative min-h-0 min-w-0`,this.props.className),"data-content-motion":!0,children:[(0,X.jsx)(`div`,{ref:this.live,className:`size-full min-h-0 min-w-0`,children:this.props.children}),(0,X.jsx)(`div`,{ref:this.layers,className:`pointer-events-none absolute inset-0 z-30 overflow-hidden`,inert:!0,"aria-hidden":`true`})]})}};function $n(e){return(0,X.jsx)(Qn,{...e,reduced:i()})}var er=s(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),tr=s(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Z=`ContextMenu`,[nr,rr]=u(Z,[g]),Q=g(),[ir,ar]=nr(Z),or=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=O.useRef(!1);{let e=O.useRef(!1);O.useEffect(()=>{i===!0&&!s.current&&!e.current&&(e.current=!0,console.warn("ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport."))},[i])}let[c,l]=d({prop:i,defaultProp:!1,onChange:r,caller:Z}),u=Q(t);return(0,X.jsx)(ir,{scope:t,open:c,onOpenChange:l,modal:o,hasInteractedRef:s,children:(0,X.jsx)(b,{...u,dir:a,open:c,onOpenChange:l,modal:o,children:n})})};or.displayName=Z;var sr=`ContextMenuTrigger`,cr=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=ar(sr,n),o=Q(n),[s,u]=O.useState({x:0,y:0}),d=O.useMemo(()=>({current:{getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s})}}),[s]),f=O.useRef(0),p=O.useCallback(()=>window.clearTimeout(f.current),[]),m=e=>{a.hasInteractedRef.current=!0,u({x:e.clientX,y:e.clientY}),a.onOpenChange(!0)};return O.useEffect(()=>p,[p]),O.useEffect(()=>void(r&&p()),[r,p]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(se,{...o,virtualRef:d}),(0,X.jsx)(c.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:l(e.onContextMenu,e=>{p(),m(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:l(e.onPointerDown,$(e=>{p(),a.open&&a.onOpenChange(!1),f.current=window.setTimeout(()=>m(e),700)})),onPointerMove:r?e.onPointerMove:l(e.onPointerMove,$(p)),onPointerCancel:r?e.onPointerCancel:l(e.onPointerCancel,$(p)),onPointerUp:r?e.onPointerUp:l(e.onPointerUp,$(p))})]})});cr.displayName=sr;var lr=`ContextMenuPortal`,ur=e=>{let{__scopeContextMenu:t,...n}=e,r=Q(t);return(0,X.jsx)(C,{...r,...n})};ur.displayName=lr;var dr=`ContextMenuContent`,fr=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=ar(dr,n),a=Q(n),o=O.useRef(!1);return(0,X.jsx)(ee,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});fr.displayName=dr;var pr=`ContextMenuGroup`,mr=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(_,{...i,...r,ref:t})});mr.displayName=pr;var hr=`ContextMenuLabel`,gr=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(v,{...i,...r,ref:t})});gr.displayName=hr;var _r=`ContextMenuItem`,vr=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(re,{...i,...r,ref:t})});vr.displayName=_r;var yr=`ContextMenuCheckboxItem`,br=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(ae,{...i,...r,ref:t})});br.displayName=yr;var xr=`ContextMenuRadioGroup`,Sr=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(ce,{...i,...r,ref:t})});Sr.displayName=xr;var Cr=`ContextMenuRadioItem`,wr=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(y,{...i,...r,ref:t})});wr.displayName=Cr;var Tr=`ContextMenuItemIndicator`,Er=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(oe,{...i,...r,ref:t})});Er.displayName=Tr;var Dr=`ContextMenuSeparator`,Or=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(ie,{...i,...r,ref:t})});Or.displayName=Dr;var kr=`ContextMenuArrow`,Ar=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(ne,{...i,...r,ref:t})});Ar.displayName=kr;var jr=`ContextMenuSub`,Mr=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=Q(t),[s,c]=d({prop:i,defaultProp:a??!1,onChange:r,caller:jr});return(0,X.jsx)(te,{...o,open:s,onOpenChange:c,children:n})};Mr.displayName=jr;var Nr=`ContextMenuSubTrigger`,Pr=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(x,{...i,...r,ref:t})});Pr.displayName=Nr;var Fr=`ContextMenuSubContent`,Ir=O.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,X.jsx)(S,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Ir.displayName=Fr;function $(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var Lr=or,Rr=cr,zr=ur,Br=fr,Vr=vr,Hr=Or,Ur=Mr,Wr=Pr,Gr=Ir,Kr=Lr,qr=Rr,Jr=Ur;function Yr({className:e,...t}){return(0,X.jsx)(zr,{children:(0,X.jsx)(Br,{className:o(`z-50 min-w-36 overflow-hidden`,p,`overlay-context-menu-motion`,e),...t})})}function Xr({className:e,...t}){return(0,X.jsx)(Vr,{className:o(f,h,`[&_svg]:size-3.5`,e),...t})}function Zr({className:e,children:t,...n}){return(0,X.jsxs)(Wr,{className:o(f,h,`data-[state=open]:bg-action data-[state=open]:text-action-ink [&_svg]:size-3.5`,e),...n,children:[t,(0,X.jsx)(m,{className:`ml-auto`})]})}function Qr({className:e,...t}){return(0,X.jsx)(zr,{children:(0,X.jsx)(Gr,{className:o(`z-50 min-w-36 overflow-hidden`,p,`overlay-context-menu-motion`,e),...t})})}function $r({className:e,...t}){return(0,X.jsx)(Hr,{className:o(`-mx-1 my-1 h-px bg-border`,e),...t})}function ei(){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:e=>{e.preventDefault(),e.currentTarget.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,clientX:e.clientX,clientY:e.clientY,button:2}))}}}function ti(e){let t=Date.parse(e.created_at);return Number.isNaN(t)?0:t}function ni(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=[],i=[];for(let t of e)(n.has(t.id)?r:i).push(t);return r.sort((e,t)=>n.get(e.id)-n.get(t.id)),i.sort((e,t)=>ti(t)-ti(e)),[...i,...r]}function ri(e,t,n){if(t===n)return[...e];let r=e.filter(e=>e!==t),i=r.indexOf(n);return i===-1?[...e]:(r.splice(i,0,t),r)}function ii(e,t,n){if(t===n)return null;let r=e.find(e=>e.sessions.some(e=>e.id===t));if(!r||!r.sessions.some(e=>e.id===n))return null;let i=e.flatMap(e=>e.sessions.map(e=>e.id)),a=ri(i,t,n);return a.some((e,t)=>e!==i[t])?a:null}function ai(e,t){let n=new Set(e);return[...e,...t.filter(e=>!n.has(e))]}export{R as C,Xt as S,Tt as T,Zn as _,Kr as a,qt as b,$r as c,Zr as d,qr as f,$n as g,er as h,ri as i,Jr as l,tr as m,ii as n,Yr as o,ei as p,ni as r,Xr as s,ai as t,Qr as u,jn as v,xt as w,Jt as x,Nn as y};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{U as n}from"./auth-C3ruG3fE.js";import{t as r}from"./jsx-runtime-By8HlURe.js";import{n as i,t as a}from"./createLucideIcon-C9A1vLE-.js";import{C as o,E as s,T as c,g as l}from"./dialog-B0poBDCr.js";import{o as u}from"./x-Dq6POV20.js";import{r as d,x as f}from"./dist-C4YjL9GW.js";import{t as p}from"./dist-DDTfSNTu.js";var m=a(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),h=a(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),g=a(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),_=a(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),v=a(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),y=r();function b({summary:e,summaryClassName:t,className:n,children:r,...a}){return(0,y.jsxs)(`details`,{className:i(`[&[open]>summary>svg]:rotate-90`,n),...a,children:[(0,y.jsxs)(`summary`,{className:i(`flex cursor-pointer select-none list-none items-center gap-1 text-fg-secondary transition-colors hover:text-fg [&::-webkit-details-marker]:hidden`,t),children:[(0,y.jsx)(d,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),e]}),r]})}var x=e(t(),1),S=new Set;function C(e){let t=/^#settings\/([\w-]+)$/.exec(e);return t?t[1]:null}var w=C(window.location.hash);function T(){let e=w?`#settings/${w}`:``;window.location.hash!==e&&history.replaceState(null,``,window.location.pathname+window.location.search+e)}function E(e){if(e!==w){w=e;for(let e of S)e()}queueMicrotask(T)}window.addEventListener(`hashchange`,()=>E(C(window.location.hash))),window.addEventListener(`popstate`,()=>E(C(window.location.hash)));function D(){return(0,x.useSyncExternalStore)(e=>(S.add(e),()=>{S.delete(e)}),()=>w)}function O(e=`appearance`){E(e)}function k(){E(null)}function A(e){return e.title??e.agent_title??e.osc_title??e.id.slice(0,8)}var j=` — `;function M(e){return e.replace(/\/+$/,``).split(`/`).pop()??``}function N(e){return{name:A(e),title:e.title??``,agentName:e.agent_title??``,sequence:e.osc_title??``,branch:e.branch,cwd:M(e.worktree_path),id:e.id.slice(0,8),status:e.status,agent:e.agent_type??``}}function P(e,t){let r=t&&t.length>0?t:n,i=N(e),a=[];for(let e of r.split(/(\$\{[a-zA-Z]+\})/)){if(e===``)continue;let t=/^\$\{([a-zA-Z]+)\}$/.exec(e)?.[1];t===void 0?a.push({text:e,sep:!1}):t===`separator`?a.push({text:j,sep:!0}):a.push({text:i[t]??e,sep:!1})}let o=[];a.forEach((e,t)=>{if(!e.sep){o.push(e.text);return}let n=o.join(``).trim().length>0,r=a.slice(t+1).some(e=>!e.sep&&e.text.trim().length>0);n&&r&&o.push(e.text)});let s=o.join(``).trim();return s.length>0?s:e.id.slice(0,8)}var F=`Switch`,[I,L]=c(F),[R,z]=I(F);function B(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=l({prop:n,defaultProp:i??!1,onChange:c,caller:F}),[h,g]=x.useState(null),[_,v]=x.useState(null),b={checked:p,setChecked:m,disabled:a,control:h,setControl:g,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:x.useRef(!1),required:u,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,y.jsx)(R,{scope:t,...b,children:J(f)?f(b):r})}var V=`SwitchTrigger`,H=x.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{let{control:i,form:a,value:c,disabled:l,checked:d,required:f,setControl:p,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:g,bubbleInput:_}=z(V,e),v=u(r,p),b=x.useRef(d);return x.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=()=>m(b.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,m]),(0,y.jsx)(o.button,{type:`button`,role:`switch`,"aria-checked":d,"aria-required":f,"data-state":Y(d),"data-disabled":l?``:void 0,disabled:l,value:c,...n,ref:v,onClick:s(t,e=>{m(e=>!e),_&&g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})})});H.displayName=V;var U=x.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,y.jsx)(B,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(H,{...d,ref:t,__scopeSwitch:n}),e&&(0,y.jsx)(q,{__scopeSwitch:n})]})})});U.displayName=F;var W=`SwitchThumb`,G=x.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=z(W,n);return(0,y.jsx)(o.span,{"data-state":Y(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});G.displayName=W;var K=`SwitchBubbleInput`,q=x.forwardRef(({__scopeSwitch:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:s,required:c,disabled:l,name:d,value:m,form:h,bubbleInput:g,setBubbleInput:_}=z(K,e),v=u(n,_),b=p(a),S=f(r);x.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(b!==a&&n){let t=new Event(`click`,{bubbles:r});n.call(e,a),e.dispatchEvent(t)}},[g,b,a,i]);let C=x.useRef(a);return(0,y.jsx)(o.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??C.current,required:c,disabled:l,name:d,value:m,form:h,...t,tabIndex:-1,ref:v,style:{...t.style,...S,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});q.displayName=K;function J(e){return typeof e==`function`}function Y(e){return e?`checked`:`unchecked`}function X({className:e,...t}){return(0,y.jsx)(U,{className:i(`peer group/switch inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,y.jsx)(`span`,{className:`pointer-events-none inline-flex h-5 w-9 shrink-0 items-center rounded-full bg-border transition-colors group-hover/switch:bg-border/70 group-data-[state=checked]/switch:bg-action`,children:(0,y.jsx)(G,{className:`block size-4 rounded-full bg-ground shadow-sm transition-[translate] duration-200 ease-out data-[state=checked]:translate-x-[1.125rem] data-[state=unchecked]:translate-x-0.5`})})})}export{D as a,_ as c,m as d,O as i,g as l,P as n,b as o,k as r,v as s,X as t,h as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{E as n,lt as r,w as i}from"./protocol-support-BwRR1kRO.js";import{F as a}from"./auth-C3ruG3fE.js";import{t as o}from"./jsx-runtime-By8HlURe.js";import{v as s}from"./ws-B_QsPbsD.js";import{n as c,t as l}from"./createLucideIcon-C9A1vLE-.js";import{C as u,E as d,T as f,_ as p,g as ee,v as m,x as h,y as te}from"./dialog-B0poBDCr.js";import{i as g,o as _}from"./x-Dq6POV20.js";import{_ as v,b as y,g as b,p as x,s as S,v as ne,y as re}from"./dist-C4YjL9GW.js";import{i as ie}from"./dist-DDTfSNTu.js";import{c as ae,n as oe}from"./switch-DllF_QQT.js";import{a as C,n as se,o as w}from"./preview-kind-CPkO-rSz.js";import{t as ce}from"./debounce-B9DrqirV.js";var T=e(t(),1),E=o(),[D,le]=f(`Tooltip`,[y]),O=y(),ue=`TooltipProvider`,de=700,fe=`tooltip.open`,[pe,k]=D(ue),me=e=>{let{__scopeTooltip:t,delayDuration:n=de,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=T.useRef(!0),s=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,E.jsx)(pe,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:T.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:T.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:T.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};me.displayName=ue;var A=`Tooltip`,[he,j]=D(A),ge=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=k(A,e.__scopeTooltip),l=O(t),[u,d]=T.useState(null),f=te(),p=T.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=T.useRef(!1),[_,v]=ee({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(fe))):c.onClose(),a?.(e)},caller:A}),y=T.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=T.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=T.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=T.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return T.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,E.jsx)(re,{...l,children:(0,E.jsx)(he,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:T.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:T.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};ge.displayName=A;var M=`TooltipTrigger`,_e=T.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=j(M,n),a=k(M,n),o=O(n),s=_(t,T.useRef(null),i.onTriggerChange),c=T.useRef(!1),l=T.useRef(!1),f=T.useCallback(()=>c.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,E.jsx)(b,{asChild:!0,...o,children:(0,E.jsx)(u.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:d(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:d(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:d(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:d(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:d(e.onBlur,i.onClose),onClick:d(e.onClick,i.onClose)})})});_e.displayName=M;var N=`TooltipPortal`,[ve,ye]=D(N,{forceMount:void 0}),be=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=j(N,t);return(0,E.jsx)(ve,{scope:t,forceMount:n,children:(0,E.jsx)(p,{present:n||a.open,children:(0,E.jsx)(m,{asChild:!0,container:i,children:r})})})};be.displayName=N;var P=`TooltipContent`,xe=T.forwardRef((e,t)=>{let n=ye(P,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=j(P,e.__scopeTooltip);return(0,E.jsx)(p,{present:r||o.open,children:o.disableHoverableContent?(0,E.jsx)(Ee,{side:i,...a,ref:t}):(0,E.jsx)(Se,{side:i,...a,ref:t})})}),Se=T.forwardRef((e,t)=>{let n=j(P,e.__scopeTooltip),r=k(P,e.__scopeTooltip),i=T.useRef(null),a=_(t,i),[o,s]=T.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=T.useCallback(()=>{s(null),d(!1)},[d]),p=T.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Ae(r,ke(r,n.getBoundingClientRect())),a=je(t.getBoundingClientRect()),o=Ne([...i,...a]);s(o),d(!0)},[d]);return T.useEffect(()=>()=>f(),[f]),T.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),T.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Me(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,E.jsx)(Ee,{...e,ref:a})}),[Ce,we]=D(A,{isInside:!1}),Te=g(`TooltipContent`),Ee=T.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=j(P,n),l=O(n),{onClose:u}=c;return T.useEffect(()=>(document.addEventListener(fe,u),()=>document.removeEventListener(fe,u)),[u]),T.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,E.jsx)(h,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,E.jsxs)(ne,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,E.jsx)(Te,{children:r}),(0,E.jsx)(Ce,{scope:n,isInside:!0,children:(0,E.jsx)(ie,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});xe.displayName=P;var De=`TooltipArrow`,Oe=T.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=O(n);return we(De,n).isInside?null:(0,E.jsx)(v,{...i,...r,ref:t})});Oe.displayName=De;function ke(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Ae(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function je(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Me(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ne(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Pe(t)}function Pe(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Fe=me,Ie=ge,Le=_e,Re=be,ze=xe,Be=Fe,Ve=Ie,He=Le;function Ue({className:e,sideOffset:t=4,...n}){return(0,E.jsx)(Re,{children:(0,E.jsx)(ze,{sideOffset:t,className:c(`z-50 overflow-hidden px-2 py-1 text-xs text-fg`,S,x,`overlay-tooltip-motion`,e),...n})})}var We=l(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);function Ge({initial:e,maxLength:t,className:n,fitContent:r=!1,onCommit:i,onCancel:a}){let[o,s]=(0,T.useState)(e),l=(0,E.jsx)(`input`,{autoFocus:!0,value:o,maxLength:t,onFocus:e=>e.currentTarget.select(),onChange:e=>s(e.target.value),onBlur:()=>i(o),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?i(o):e.key===`Escape`&&a()},className:c(`bg-transparent outline-none`,r?`col-start-1 row-start-1 w-0 min-w-full p-0`:n)});return r?(0,E.jsxs)(`span`,{className:c(`inline-grid min-w-px`,n),children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`invisible col-start-1 row-start-1 whitespace-pre`,children:o||`​`}),l]}):l}function Ke(e){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:t=>{t.preventDefault(),e()}}}var F=null;function qe(e){return F=e,()=>{F===e&&(F=null)}}function Je(){F?.()}var I=null;function Ye(e){return I=e,()=>{I===e&&(I=null)}}async function Xe(e){if(!I)throw Error(`Open a project before opening a path.`);await I(e)}function Ze(){let e=r(s()??void 0).data?.tabTitleTemplate;return(0,T.useCallback)(t=>oe(t,e),[e])}var Qe=(0,T.createContext)({open:()=>void 0,handler:null,setHandler:()=>void 0});function $e({children:e}){let[t,n]=(0,T.useState)(null),r=(0,T.useCallback)(e=>n(()=>e),[]),i=(0,T.useCallback)(e=>t?.(e),[t]),a=(0,T.useMemo)(()=>({open:i,handler:t,setHandler:r}),[i,t,r]);return(0,E.jsx)(Qe.Provider,{value:a,children:e})}function et(){return(0,T.useContext)(Qe)}function tt({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,"aria-hidden":!0,children:[(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`22`,y2:`12`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`20.66`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`20.66`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`2`,y2:`12`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`7`,y2:`3.34`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17`,y2:`3.34`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`15.25`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`18.5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`15.25`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6.37`,y2:`8.75`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`5.5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`12`,x2:`17.63`,y2:`8.75`})]})}function nt({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.6*t,"aria-hidden":!0,children:[(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(60 12 12)`}),(0,E.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`,transform:`rotate(120 12 12)`})]})}function rt({className:e,strokeScale:t=1}){return(0,E.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`none`,stroke:`currentColor`,strokeWidth:1.8*t,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,E.jsx)(`path`,{d:`M8 4H4v16h4`}),(0,E.jsx)(`path`,{d:`M16 4h4v16h-4`}),(0,E.jsx)(`rect`,{x:`10.5`,y:`10.5`,width:`3`,height:`3`,fill:`currentColor`,stroke:`none`})]})}function it({className:e}){return(0,E.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,"aria-hidden":!0,children:(0,E.jsx)(`path`,{d:`M12 1.5c0 5.8 4.7 10.5 10.5 10.5C16.7 12 12 16.7 12 22.5 12 16.7 7.3 12 1.5 12 7.3 12 12 7.3 12 1.5Z`})})}function at({type:e,className:t,strokeScale:n=1}){switch(e){case`claude-code`:return(0,E.jsx)(tt,{className:t,strokeScale:n});case`codex`:return(0,E.jsx)(nt,{className:t,strokeScale:n});case`opencode`:return(0,E.jsx)(rt,{className:t,strokeScale:n});case`gemini-cli`:return(0,E.jsx)(it,{className:t});default:return(0,E.jsx)(ae,{className:t,strokeWidth:2*n})}}var L=new Set,R=!1,ot=null;function st(){for(let e of L)e()}function ct(e){return L.add(e),()=>L.delete(e)}function lt(e){R!==e&&(R=e,st())}function ut(){lt(!R)}function dt(){return(0,T.useSyncExternalStore)(ct,()=>R)}function ft(e){ot=e,st()}function pt(){return(0,T.useSyncExternalStore)(ct,()=>ot)}function z(){return crypto.randomUUID()}function B(e){return e.type===`terminal`?`term:${e.session}`:`editor:${C(e.tab)}`}function V(e,t){return B(e)===B(t)}function mt(e){return e.type===`terminal`}function ht(e){return e.type===`editor`&&(e.tab.view===`linked`||e.tab.view===`locked`)}function H(e=[],t){let n=e.map(B),r=t&&n.includes(t)?t:n.length>0?n[0]:null;return{kind:`leaf`,id:z(),tabs:e,activeKey:r,previewKey:null}}function U(e,t,n){return{kind:`split`,id:z(),direction:e,children:t,sizes:n??t.map(()=>100/Math.max(1,t.length))}}function W(e,t){if(e.kind===`leaf`)return e.id===t?e:null;for(let n of e.children){let e=W(n,t);if(e)return e}return null}function G(e,t){if(e.kind===`leaf`)return e.tabs.some(e=>B(e)===t)?e:null;for(let n of e.children){let e=G(n,t);if(e)return e}return null}function K(e){return e.kind===`leaf`?[e]:e.children.flatMap(K)}function q(e){return K(e).flatMap(e=>e.tabs)}function gt(e){return e.kind===`leaf`?[e.id]:[e.id,...e.children.flatMap(gt)]}function _t(e){let t=gt(e);return new Set(t).size!==t.length}function vt(e){return e.kind===`leaf`?{...e,id:z()}:{...e,id:z(),children:e.children.map(vt)}}function yt(e){if(!_t(e))return e;let t=new Set,n=e=>{let r=t.has(e.id)?z():e.id;return t.add(r),e.kind===`leaf`?{...e,id:r}:{...e,id:r,children:e.children.map(n)}};return n(e)}function bt(e){let t=e.tabs.map(B),n=e.activeKey&&t.includes(e.activeKey)?e.activeKey:t[0]??null,r=e.previewKey&&t.includes(e.previewKey)?e.previewKey:null;return n===e.activeKey&&r===(e.previewKey??null)?e:{...e,activeKey:n,previewKey:r}}function J(e){if(e.kind===`leaf`)return bt(e);let t=e.children.map(J),n=[],r=[];t.forEach((t,i)=>{let a=e.sizes[i]??1;if(t.kind===`split`&&t.direction===e.direction){let e=t.sizes.reduce((e,t)=>e+t,0)||t.children.length;t.children.forEach((i,o)=>{n.push(i),r.push(a*(t.sizes[o]??1)/e)})}else n.push(t),r.push(a)});let i=[],a=[];return n.forEach((e,t)=>{e.kind===`leaf`&&e.tabs.length===0||(i.push(e),a.push(r[t]??1))}),i.length===0?H([]):i.length===1?i[0]:{...e,children:i,sizes:a}}function Y(e,t,n){return e.kind===`leaf`?e.id===t?n(e):e:{...e,children:e.children.map(e=>Y(e,t,n))}}function xt(e,t,n){return Y(e,t,e=>{if(!e.tabs.some(e=>B(e)===n))return e;let t=e.tabs.filter(e=>B(e)!==n),r=e.activeKey===n?St(e,n):e.activeKey;return{...e,tabs:t,activeKey:r}})}function St(e,t){let n=e.tabs.findIndex(e=>B(e)===t);if(n===-1)return e.activeKey;let r=e.tabs.filter(e=>B(e)!==t);return r.length===0?null:B(r[Math.min(n,r.length-1)])}function Ct(e,t,n){let r=e.tabs.filter(e=>!V(e,t)),i=n===void 0?r.length:Math.max(0,Math.min(n,r.length)),a=[...r.slice(0,i),t,...r.slice(i)];return{...e,tabs:a,activeKey:B(t)}}function wt(e,t,n,r){let i=n===`left`||n===`right`?`row`:`col`,a=n===`left`||n===`top`;return J(Y(e,t,e=>{let t=H([r]);return U(i,a?[t,e]:[e,t],[50,50])}))}function Tt(e,t){let{fromLeafId:n,toLeafId:r,edge:i}=t;if(n===r)return e;let a=W(e,n),o=W(e,r);if(!a||!o)return e;if(i===`center`){let t=e=>e.kind===`leaf`?e.id===n?o:e.id===r?a:e:{...e,children:e.children.map(t)};return t(e)}let s=J(Y(e,n,e=>({...e,tabs:[],activeKey:null,previewKey:null}))),c=i===`left`||i===`right`?`row`:`col`,l=i===`left`||i===`top`;return J(Y(s,r,e=>U(c,l?[a,e]:[e,a],[50,50])))}function Et(e,t){let{ref:n,toLeafId:r,edge:i}=t,a=B(n),o=t.copy===!0&&!mt(n),s=t.index;if(i===`center`&&s!==void 0){let t=W(e,r)?.tabs.findIndex(e=>B(e)===a)??-1;t!==-1&&t<s&&--s}let c=o?e:xt(e,t.fromLeafId,a);if(i===`center`){let e=Y(c,r,e=>Ct(e,n,s));return!W(e,r)&&!G(e,a)?X(J(Dt(e,n)),a):X(J(e),a)}return W(c,r)?X(wt(c,r,i,n),a):J(H([n]))}function Dt(e,t){let n=K(e)[0];return n?Y(e,n.id,e=>Ct(e,t)):H([t])}function Ot(e,t,n){return J(Y(e,t,e=>e.tabs.some(e=>B(e)===n)?{...e,tabs:e.tabs.filter(e=>B(e)!==n),activeKey:e.activeKey===n?St(e,n):e.activeKey}:e))}function kt(e,t,n){let r=B(n);return J(Y(e,t,e=>{let t=e.previewKey===r?null:e.previewKey;return e.tabs.some(e=>V(e,n))?{...e,activeKey:r,previewKey:t}:{...e,tabs:[...e.tabs,n],activeKey:r,previewKey:t}}))}function At(e,t,n){let r=B(n);return J(Y(e,t,e=>e.tabs.some(e=>B(e)===r)?{...e,tabs:e.tabs.map(e=>B(e)===r?n:e),previewKey:e.previewKey===r?null:e.previewKey}:{...e,tabs:[...e.tabs,n]}))}function jt(e,t,n){let r=B(n);return Y(e,t,e=>({...e,tabs:e.tabs.map(e=>B(e)===r?n:e)}))}function Mt(e,t,n){let r=C(t),i=e=>e.kind===`split`?{...e,children:e.children.map(i)}:{...e,tabs:e.tabs.map(e=>e.type===`editor`&&C(e.tab)===r?{...e,tab:{...e.tab,compile_mode:n}}:e)};return i(e)}function Nt(e,t){return e.type!==`editor`||t.type!==`editor`||e.tab.view!==`preview`||t.tab.view!==void 0||se(t.tab.path)===null?t:{...t,tab:{...t.tab,view:`preview`}}}function Pt(e,t,n){let r=B(n);return J(Y(e,t,e=>{if(e.tabs.some(e=>V(e,n)))return{...e,activeKey:r};let t=e.previewKey?e.tabs.findIndex(t=>B(t)===e.previewKey):-1,i=t>=0?e.tabs[t]:void 0,a=e.tabs.length>1&&i!==void 0&&!mt(i)&&!ht(i),o=i?Nt(i,n):n,s=a?e.tabs.map((e,n)=>n===t?o:e):[...e.tabs,o];return{...e,tabs:s,activeKey:r,previewKey:r}}))}function X(e,t){let n=e=>e.kind===`leaf`?e.previewKey===t?{...e,previewKey:null}:e:{...e,children:e.children.map(n)};return n(e)}function Ft(e,t,n,r){return Y(e,t,e=>{let t=e.tabs.findIndex(e=>e.type===`editor`&&B(e)===n),i=t>=0?e.tabs[t]:void 0;if(i===void 0||i.type!==`editor`)return e;let a={...i,tab:{...i.tab,view:r}},o=B(a);if(o===n)return{...e,tabs:e.tabs.map((e,n)=>n===t?a:e)};let s=e.tabs.some((e,n)=>n!==t&&B(e)===o),c=s?e.tabs.filter((e,n)=>n!==t):e.tabs.map((e,n)=>n===t?a:e);return{...e,tabs:c,activeKey:e.activeKey===n?o:e.activeKey,previewKey:e.previewKey===n?s?null:o:e.previewKey??null}})}function It(e,t){let n=w(e);return n!==`commit`&&n!==`untitled`&&e.session===t.session&&e.path===t.path&&e.root===t.root}function Lt(e,t,n){if(n===t.path)return e;let r=!1,i=e=>{if(e.kind===`split`){let t=e.children.map(i);return t.some((t,n)=>t!==e.children[n])?{...e,children:t}:e}let a=new Map,o=!1,s=e.tabs.map(e=>{if(e.type!==`editor`||!It(e.tab,t))return e;let r={...e,tab:{...e.tab,path:n}};return a.set(B(e),B(r)),o=!0,r});if(!o)return e;r=!0;let c=e.activeKey,l=e.previewKey??null;return{...e,tabs:s,activeKey:c===null?null:a.get(c)??c,previewKey:l===null?null:a.get(l)??l}},a=i(e);return r?a:e}function Rt(e){if(e.type!==`editor`)return null;let t=e.tab,n=w(t);return n!==`file`&&n!==`external`||t.view===`linked`||t.view===`locked`||se(t.path)===null?null:t}function zt(e,t){let n=Rt(t);if(!n)return e;let r=!1,i=e=>{if(e.kind===`split`)return{...e,children:e.children.map(i)};let t=!1,a=e.tabs.map(e=>{if(e.type!==`editor`||!ht(e))return e;let r=e.tab;return r.session===n.session&&r.path===n.path&&(r.root??``)===(n.root??``)&&w(r)===w(n)?e:(t=!0,{type:`editor`,tab:{session:n.session,path:n.path,...n.kind===void 0?{}:{kind:n.kind},...n.root===void 0?{}:{root:n.root},view:r.view}})});return t?(r=!0,{...e,tabs:a}):e},a=i(e);return r?a:e}function Bt(e,t){return e.session===t.session&&e.path===t.path&&(e.root??``)===(t.root??``)&&w(e)===w(t)}function Vt(e,t,n){let r=K(e).flatMap(e=>e.tabs.flatMap(n=>n.type!==`editor`||n.tab.view===`linked`||n.tab.view===`locked`||!Bt(n.tab,t)?[]:[{leafId:e.id,ref:n}]));return r.find(({leafId:e})=>e===n)??r.find(({ref:e})=>(e.tab.view??`source`)===`source`)??r[0]??null}function Ht(e,t,n){return Y(e,t,e=>e.tabs.some(e=>B(e)===n)?{...e,activeKey:n}:e)}function Ut(e,t,n){function r(e){return e.kind===`leaf`?e:e.id===t&&n.length===e.children.length?{...e,children:e.children.map(r),sizes:[...n]}:{...e,children:e.children.map(r)}}return r(e)}function Wt(e){let t=e.type===`terminal`?e.session:e.tab.session;return t===`00000000-0000-0000-0000-000000000000`?null:t}function Gt(e){return t=>{let n=Wt(t);return n===null||e.has(n)}}function Z(e,t){let n=e=>e.kind===`leaf`?{...e,tabs:e.tabs.filter(t)}:{...e,children:e.children.map(n)};return J(n(e))}function Kt(e){let t=new Set,n=[];for(let r of e){let e=J(Z(r,e=>!t.has(B(e)))),i=q(e);if(i.length!==0){for(let e of i)t.add(B(e));n.push(e)}}return n.length===0?H([]):yt(n.length===1?n[0]:J(U(`row`,n)))}function qt(e){let t=e.editor_tabs.map(e=>({type:`editor`,tab:e})),n=e.session_tabs.map(e=>({type:`terminal`,session:e})),r=e.active_editor_tab?B({type:`editor`,tab:e.active_editor_tab}):null,i=e.active_session?`term:${e.active_session}`:null;if(t.length===0&&n.length===0)return H([]);if(t.length===0)return H(n,i);if(n.length===0)return H(t,r);let a=e.layout,o=typeof a.editor==`number`?a.editor:40,s=typeof a.session==`number`?a.session:60;return J(U(`col`,[H(t,r),H(n,i)],[o,s]))}function Jt(e){return JSON.stringify(Yt(e))}function Yt(e){return e===null?null:e.kind===`leaf`?e.tabs.length===0?null:{t:e.tabs.map(B)}:{d:e.direction,s:e.sizes.map(e=>Math.round(e*10)/10),c:e.children.map(Yt)}}var Q=new Set,$=!1,Xt=null;function Zt(){for(let e of Q)e()}function Qt(e){return Q.add(e),()=>Q.delete(e)}function $t(e){$!==e&&($=e,Zt())}function en(){$t(!$)}function tn(){return(0,T.useSyncExternalStore)(Qt,()=>$)}function nn(e){Xt=e,Zt()}function rn(){return(0,T.useSyncExternalStore)(Qt,()=>Xt)}var an={layout_tree:null,active_session:null,layout_ref:null};function on(e){return e.type===`terminal`?e.session:e.tab.session}function sn(e,t){let n=new Set;for(let[r,i]of Object.entries(e))if(!(r===t||!i.layout_tree))for(let e of q(i.layout_tree))e.type===`terminal`&&n.add(e.session);return[...n]}function cn(e,t){let n=e.project_layouts[t];return{...e,layout_tree:n?.layout_tree??null,active_session:n?.active_session??null,layout_ref:n?.layout_ref??null,session_tabs:[],editor_tabs:[],active_editor_tab:null}}function ln(e,t,n){return n?{loaded:e.loaded,snapshot:cn(e.snapshot,t),current:()=>cn(e.current(),t),update(n){let r={},i={...n};if(`layout_tree`in n&&(r.layout_tree=n.layout_tree??null,delete i.layout_tree),`active_session`in n&&(r.active_session=n.active_session??null,delete i.active_session),`layout_ref`in n&&(r.layout_ref=n.layout_ref??null,delete i.layout_ref),Object.keys(r).length>0){let n=e.current().project_layouts;i.project_layouts={...n,[t]:{...n[t]??an,...r}}}Object.keys(i).length>0&&e.update(i)}}:e}function un(e,t,n,r){let i=e.layout_tree??qt(e),a={};for(let o of t)a[o]={layout_tree:vt(Z(i,e=>{let i=on(e);return i===`00000000-0000-0000-0000-000000000000`?o===(r??t[0]):n.get(i)===o})),active_session:e.active_session!==null&&n.get(e.active_session)===o?e.active_session:null,layout_ref:null};return{layout_mode:`project`,project_layouts:a}}function dn(e,t,n={}){return{...e,...t,...n}}function fn(e,t,n){let r=t.layout_tree?Z(t.layout_tree,e=>{let t=on(e);return t===`00000000-0000-0000-0000-000000000000`||n.alive.has(t)}):null,i=t.active_session!==null&&n.alive.has(t.active_session)?t.active_session:null;if(t.scope===`profile`)return{projectBased:!1,patch:{layout_mode:`profile`,layout_tree:r,active_session:i,layout_ref:t.id}};let a=t.project_id??n.currentProject??n.projectIds[0]??``,o={layout_tree:r,active_session:i,layout_ref:t.id};if((e.layout_mode??`profile`)===`project`)return{projectBased:!0,patch:{project_layouts:{...e.project_layouts,[a]:o}}};let s=un(e,n.projectIds,n.sessionProject,a);return{projectBased:!0,patch:{...s,project_layouts:dn(s.project_layouts??{},e.project_layouts,{[a]:o})}}}function pn(e,t){let n=e.project_layouts,r=[...t.filter(e=>e in n),...Object.keys(n).filter(e=>!t.includes(e))].map(e=>n[e]);return{layout_mode:`profile`,project_layouts:{},layout_tree:Kt(r.map(e=>e.layout_tree).filter(e=>e!==null)),active_session:r.map(e=>e.active_session).find(e=>e!==null)??null,layout_ref:null}}var mn=2e3,hn=a.parse({});function gn(e){return`puddle.ws.${e}`}function _n(e){if(e===null)return{kind:`absent`};try{return{kind:`present`,snapshot:a.parse(JSON.parse(e))}}catch{return{kind:`corrupt`}}}function vn(){let e=s(),[t,r]=(0,T.useState)(!1),[a,o]=(0,T.useState)(hn),c=(0,T.useRef)(a);c.current=a;let l=(0,T.useRef)(null),u=(0,T.useMemo)(()=>ce((e,t)=>{n(e,t).catch(e=>console.warn(`ui-state save failed: ${e.message}`))},mn),[]);return(0,T.useEffect)(()=>{if(e===null){l.current=null;return}let t=gn(e);l.current=t;let n=!1;r(!1),o(hn);let a;try{a=_n(sessionStorage.getItem(t)),a.kind===`corrupt`&&sessionStorage.removeItem(t)}catch(e){console.warn(`ui-state read failed: ${e.message}`),a={kind:`absent`}}return a.kind===`present`?(o(a.snapshot),r(!0)):i(e).then(e=>{n||(e&&o(e.ui_state),r(!0))}).catch(e=>{console.warn(`ui-state load failed: ${e.message}`),n||r(!0)}),()=>{n=!0,u.flush()}},[e,u]),{loaded:t,snapshot:a,current:()=>c.current,update(t){if(e===null)return;let n={...c.current,...t};c.current=n,o(n);let r=l.current??gn(e);u(e,n);try{sessionStorage.setItem(r,JSON.stringify(n))}catch(e){console.warn(`ui-state write failed: ${e.message}`)}}}}export{Je as $,H as A,B,Tt as C,Ht as D,q as E,Ut as F,pt as G,ft as H,zt as I,$e as J,dt as K,Mt as L,X as M,Z as N,G as O,Lt as P,Ye as Q,Ft as R,yt as S,W as T,lt as U,jt as V,ut as W,Ze as X,et as Y,Xe as Z,kt as _,dn as a,Ue as at,qt as b,un as c,$t as d,qe as et,en as f,At as g,Jt as h,fn as i,Ve as it,Pt as j,Rt as k,pn as l,tn as m,vn as n,Ke as nt,sn as o,Be as ot,rn as p,at as q,gn as r,We as rt,ln as s,He as st,_n as t,Ge as tt,nn as u,K as v,Et as w,Ot as x,Gt as y,Vt as z};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{a as n}from"./auth-CdosKReE.js";var r=e(t(),1),i=(0,r.createContext)(``);function a(e,t){let a=(0,r.useContext)(i);return n(JSON.stringify([a,e,t]))}var o=class{limit;entries=new Map;constructor(e=500){this.limit=e}get(e){let t=this.entries.get(e);return t!==void 0&&(this.entries.delete(e),this.entries.set(e,t)),t}set(e,t){for(this.entries.delete(e),this.entries.set(e,t);this.entries.size>this.limit;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}};export{i as n,a as r,o as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{a as n}from"./auth-C3ruG3fE.js";var r=e(t(),1),i=(0,r.createContext)(``);function a(e,t){let a=(0,r.useContext)(i);return n(JSON.stringify([a,e,t]))}var o=class{limit;entries=new Map;constructor(e=500){this.limit=e}get(e){let t=this.entries.get(e);return t!==void 0&&(this.entries.delete(e),this.entries.set(e,t)),t}set(e,t){for(this.entries.delete(e),this.entries.set(e,t);this.entries.size>this.limit;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}};export{i as n,a as r,o as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-C9A1vLE-.js";var t=e(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),n=e(`regex`,[[`path`,{d:`M17 3v10`,key:`15fgeh`}],[`path`,{d:`m12.67 5.5 8.66 5`,key:`1gpheq`}],[`path`,{d:`m12.67 10.5 8.66-5`,key:`1dkfa6`}],[`path`,{d:`M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z`,key:`swwfx4`}]]),r=e(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]);export{n,t as r,r as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{i as n,n as r,o as i,r as a}from"./auth-CdosKReE.js";import{n as o}from"./dist-BOS6OKSE.js";var s=e(t(),1);function c(){return window.puddleDesktop}function l(){let[e,t]=(0,s.useState)({fullScreen:!1,animate:!1});return(0,s.useEffect)(()=>{let e=c();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var u=n(`puddle.profile-id`);function d(){let e=(0,s.useSyncExternalStore)(u.subscribe,u.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function f(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),u.set(e)}var p=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],m=[{id:`host.peek`,label:`Show host identity (hold)`,group:`Layout & tabs`,defaultBinding:typeof navigator<`u`&&/Mac/.test(navigator.platform)?`alt+meta+Slash`:`ctrl+alt+Slash`,hold:!0},{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],h=new Map(m.map(e=>[e.id,e])),g=typeof window<`u`&&c()!==void 0;function _(e,t=g){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function v(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var y={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},b={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function x(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):b[e]??e}function S(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>y[e]??e).join(``)+x(n)}var C=new Map;function w(e,t){return C.set(e,t),()=>{C.get(e)===t&&C.delete(e)}}var T=e=>C.get(e),E=e=>h.get(e);function D(e,t){return e.hold===!0||e.id===`editor.save`||t&&e.editor!==!0}var O={},k=new Set,A=j();function j(){let e={};for(let t of m)e[t.id]=O[t.id]||_(t);return e}function M(e){O=e??{},A=j(),k.forEach(e=>e())}var N=e=>A[e]??``;function P(e){for(let[t,n]of Object.entries(A))if(n===e)return t}function F(e){return S(I()[e]??``)}function I(){return(0,s.useSyncExternalStore)(e=>(k.add(e),()=>k.delete(e)),()=>A)}var L=500,R=1e4;function z(e,t){return`${e} ${t}`}var B=new class{ws=null;open=!1;backoff=L;reconnectTimer=null;theme=null;terminals=new Map;notificationListeners=new Set;statusListeners=new Set;renameListeners=new Set;accountListeners=new Set;switchListeners=new Set;sessionsChangedListeners=new Set;hostUpdatesListeners=new Set;connectionListeners=new Set;shellWaiters=new Map;attach(e,t,n,r,i){let a={session:e,term:t,cols:n,rows:r,handlers:i,ready:!1,live:!1,pendingResize:!1};return this.terminals.set(z(e,t),a),this.ensureConnected(),this.open&&this.send({t:`attach`,session:e,term:t,cols:n,rows:r}),()=>this.detach(e,t)}detach(e,t){this.terminals.delete(z(e,t))&&this.open&&this.send({t:`detach`,session:e,term:t})}write(e,t,n){this.open&&this.terminals.get(z(e,t))?.ready&&this.send({t:`stdin`,session:e,term:t,data:n})}resize(e,t,n,r){let i=this.terminals.get(z(e,t));i&&(i.cols=n,i.rows=r,this.open&&i.ready?this.send({t:`resize`,session:e,term:t,cols:n,rows:r}):i.pendingResize=!0)}spawnShell(e){return this.ensureConnected(),this.open?new Promise((t,n)=>{let r=this.shellWaiters.get(e)??[];r.push({resolve:t,reject:n}),this.shellWaiters.set(e,r),this.open&&this.send({t:`spawn-shell`,session:e})}):Promise.reject(Error(`Connection is unavailable`))}killShell(e,t){this.open&&this.send({t:`kill-shell`,session:e,term:t})}onStatus(e){return this.statusListeners.add(e),this.ensureConnected(),()=>this.statusListeners.delete(e)}onAgentNotification(e){return this.notificationListeners.add(e),this.ensureConnected(),()=>this.notificationListeners.delete(e)}onRenamed(e){return this.renameListeners.add(e),this.ensureConnected(),()=>this.renameListeners.delete(e)}onAccount(e){return this.accountListeners.add(e),this.ensureConnected(),()=>this.accountListeners.delete(e)}onSessionSwitched(e){return this.switchListeners.add(e),this.ensureConnected(),()=>this.switchListeners.delete(e)}onSessionsChanged(e){return this.sessionsChangedListeners.add(e),this.ensureConnected(),()=>this.sessionsChangedListeners.delete(e)}onConnectionChange(e){return this.connectionListeners.add(e),()=>this.connectionListeners.delete(e)}onHostUpdatesChanged(e){return this.hostUpdatesListeners.add(e),this.ensureConnected(),()=>this.hostUpdatesListeners.delete(e)}isConnected(){return this.open}reportTheme(e,t){this.theme&&this.theme.fg===e&&this.theme.bg===t||(this.theme={fg:e,bg:t},this.open&&this.send({t:`theme`,fg:e,bg:t}))}reset(){this.ws?.close()}switchHost(){let e=this.ws;this.ws=null,this.open=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.terminals.clear();for(let e of this.shellWaiters.values())for(let t of e)t.reject(Error(`Host changed`));this.shellWaiters.clear(),e?.close();for(let e of this.connectionListeners)e(!1)}ensureConnected(){this.ws||this.reconnectTimer||this.connect()}connect(){let e=a.get(),t=i();if(!e&&!t)return;let n=window.location.protocol===`https:`?`wss`:`ws`,o=t?t.socket():new WebSocket(`${n}://${window.location.host}/ws`);this.ws=o,o.addEventListener(`open`,()=>{if(this.ws!==o){o.close();return}t||o.send(JSON.stringify({t:`auth`,token:e}))}),o.addEventListener(`message`,e=>{if(this.ws!==o)return;let t;try{t=JSON.parse(String(e.data))}catch{return}if(t.t===`authenticated`){if(this.open)return;this.open=!0,this.backoff=L,this.send({t:`subscribe-status`}),this.theme&&this.send({t:`theme`,...this.theme});for(let e of this.terminals.values()){e.ready=!1,e.pendingResize=!1;let{session:t,term:n,cols:r,rows:i}=e;this.send({t:`attach`,session:t,term:n,cols:r,rows:i})}for(let e of this.connectionListeners)e(!0)}else this.open&&this.handle(t)}),o.addEventListener(`close`,e=>{if(this.ws!==o)return;let t=this.open;this.open=!1,this.ws=null;for(let e of this.shellWaiters.values())for(let t of e)t.reject(Error(`Connection lost; operation outcome is unknown`));if(this.shellWaiters.clear(),t)for(let e of this.connectionListeners)e(!1);if(e.code===4401&&e.reason===`browser_rejected`){r();return}this.scheduleReconnect()})}scheduleReconnect(){this.reconnectTimer||this.terminals.size===0&&this.statusListeners.size===0&&this.notificationListeners.size===0&&this.renameListeners.size===0&&this.accountListeners.size===0&&this.switchListeners.size===0&&this.sessionsChangedListeners.size===0||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.backoff),this.backoff=Math.min(this.backoff*2,R))}send(e){this.open&&this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}handle(e){switch(e.t){case`agent-notification`:for(let t of this.notificationListeners)t(e);break;case`replay`:{let t=this.terminals.get(z(e.session,e.term));if(!t)break;if(t.ready=!0,t.pendingResize){t.pendingResize=!1;let{session:e,term:n,cols:r,rows:i}=t;this.send({t:`resize`,session:e,term:n,cols:r,rows:i})}t.handlers.onData(e.data,e.t);break}case`output`:this.terminals.get(z(e.session,e.term))?.handlers.onData(e.data,e.t);break;case`exit`:{let t=this.terminals.get(z(e.session,e.term));t&&(t.ready=!1,t.handlers.onExit?.(e.code)),e.term===`agent`&&t&&(t.live=!1);break}case`status`:{let t=[`starting`,`running`,`waiting_input`].includes(e.status);for(let n of this.terminals.values())if(!(n.session!==e.session||n.term!==`agent`)){if(t&&!n.live){n.ready=!1,n.pendingResize=!1;let{session:e,term:t,cols:r,rows:i}=n;this.send({t:`attach`,session:e,term:t,cols:r,rows:i})}n.live=t}for(let t of this.statusListeners)t({session:e.session,status:e.status,last_activity_at:e.last_activity_at});break}case`renamed`:for(let t of this.renameListeners)t({session:e.session,title:e.title,agent_title:e.agent_title,osc_title:e.osc_title});break;case`account`:for(let t of this.accountListeners)t({account_id:e.account_id,profile_id:e.profile_id,logged_in:e.logged_in});break;case`session-switched`:for(let t of this.switchListeners)t(e);break;case`sessions-changed`:for(let t of this.sessionsChangedListeners)t(e);break;case`host-updates-changed`:for(let e of this.hostUpdatesListeners)e();break;case`shell-spawned`:{let t=this.shellWaiters.get(e.session)?.shift();t&&t.resolve(e.term);break}case`notice`:(e.level===`warning`?o.warning:o.error)(e.title,{...e.detail===void 0?{}:{description:e.detail},duration:12e3});break;case`error`:o.error(`Connection error`,{description:e.message});break}}};export{f as _,v as a,l as b,T as c,w as d,M as f,u as g,F as h,P as i,N as l,I as m,m as n,S as o,_ as p,p as r,E as s,B as t,D as u,d as v,c as y};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{i as n,n as r,o as i,r as a}from"./auth-C3ruG3fE.js";import{n as o}from"./dist-BOS6OKSE.js";var s=e(t(),1);function c(){return window.puddleDesktop}function l(){let[e,t]=(0,s.useState)({fullScreen:!1,animate:!1});return(0,s.useEffect)(()=>{let e=c();if(!e)return;let n=!0;e.isFullScreen?.()?.then(e=>{n&&t({fullScreen:e,animate:!1})});let r=e.onFullScreenChange?.(e=>t({fullScreen:e,animate:!0}));return()=>{n=!1,r?.()}},[]),e}var u=n(`puddle.profile-id`);function d(){let e=(0,s.useSyncExternalStore)(u.subscribe,u.get);return e!==null&&/^[0-9a-f]{10}$/.test(e)?e:null}function f(e){window.location.pathname!==`/`&&window.history.replaceState(null,``,`/`),u.set(e)}var p=[`Layout & tabs`,`Editor`,`Left sidebar`,`Right sidebar`],m=[{id:`host.peek`,label:`Show host identity (hold)`,group:`Layout & tabs`,defaultBinding:typeof navigator<`u`&&/Mac/.test(navigator.platform)?`alt+meta+Slash`:`ctrl+alt+Slash`,hold:!0},{id:`palette.toggle`,label:`Command palette`,group:`Layout & tabs`,defaultBinding:`meta+KeyK`},{id:`tab.close`,label:`Close current tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyW`,desktopBinding:`meta+KeyW`},{id:`tab.reopen`,label:`Reopen last closed tab`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyT`,desktopBinding:`shift+meta+KeyT`},{id:`tab.newUntitled`,label:`New untitled file`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+KeyN`,desktopBinding:`meta+KeyN`},{id:`tab.next`,label:`Next tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketRight`,desktopBinding:`ctrl+Tab`},{id:`tab.prev`,label:`Previous tab in pane`,group:`Layout & tabs`,defaultBinding:`ctrl+alt+BracketLeft`,desktopBinding:`ctrl+shift+Tab`},{id:`window.close`,label:`Close window`,group:`Layout & tabs`,defaultBinding:`meta+KeyW`,desktopBinding:`shift+meta+KeyW`},{id:`sidebar.left`,label:`Toggle left sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Comma`,desktopBinding:`meta+KeyB`},{id:`sidebar.right`,label:`Toggle right sidebar`,group:`Layout & tabs`,defaultBinding:`alt+meta+Period`,desktopBinding:`shift+meta+KeyB`},{id:`editor.save`,label:`Save`,group:`Editor`,defaultBinding:`meta+KeyS`,editor:!0},{id:`editor.wordWrap`,label:`Toggle word wrap`,group:`Editor`,defaultBinding:`alt+KeyZ`,editor:!0},{id:`nav.files`,label:`Open Files`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyE`},{id:`nav.search`,label:`Open Search`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyF`},{id:`nav.changes`,label:`Open Changes`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyV`},{id:`nav.worktrees`,label:`Open Worktrees`,group:`Left sidebar`,defaultBinding:`alt+meta+KeyB`},{id:`session.newAgent`,label:`New agent`,group:`Right sidebar`,defaultBinding:`ctrl+alt+Backquote`,desktopBinding:`meta+KeyT`},{id:`session.newTerminal`,label:`New terminal`,group:`Right sidebar`,defaultBinding:`ctrl+Backquote`},{id:`scratchpad.toggle`,label:`Toggle Scratchpad`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyS`},{id:`layouts.toggle`,label:`Toggle Layouts`,group:`Right sidebar`,defaultBinding:`alt+meta+KeyL`}],h=new Map(m.map(e=>[e.id,e])),g=typeof window<`u`&&c()!==void 0;function _(e,t=g){return t&&e.desktopBinding?e.desktopBinding:e.defaultBinding}function v(e){let t=e.code;if(!t||/^(Control|Alt|Shift|Meta)(Left|Right)$/.test(t))return null;let n=[];return e.ctrlKey&&n.push(`ctrl`),e.altKey&&n.push(`alt`),e.shiftKey&&n.push(`shift`),e.metaKey&&n.push(`meta`),n.length===0?null:(n.push(t),n.join(`+`))}var y={ctrl:`⌃`,alt:`⌥`,shift:`⇧`,meta:`⌘`},b={Comma:`,`,Period:`.`,Backquote:"`",Slash:`/`,Backslash:`\\`,Minus:`-`,Equal:`=`,Space:`␣`,Enter:`↵`,Escape:`Esc`,Tab:`⇥`,BracketLeft:`[`,BracketRight:`]`};function x(e){return e.startsWith(`Key`)?e.slice(3):e.startsWith(`Digit`)?e.slice(5):b[e]??e}function S(e){if(!e)return`—`;let t=e.split(`+`),n=t.pop()??``;return t.map(e=>y[e]??e).join(``)+x(n)}var C=new Map;function w(e,t){return C.set(e,t),()=>{C.get(e)===t&&C.delete(e)}}var T=e=>C.get(e),E=e=>h.get(e);function D(e,t){return e.hold===!0||e.id===`editor.save`||t&&e.editor!==!0}var O={},k=new Set,A=j();function j(){let e={};for(let t of m)e[t.id]=O[t.id]||_(t);return e}function M(e){O=e??{},A=j(),k.forEach(e=>e())}var N=e=>A[e]??``;function P(e){for(let[t,n]of Object.entries(A))if(n===e)return t}function F(e){return S(I()[e]??``)}function I(){return(0,s.useSyncExternalStore)(e=>(k.add(e),()=>k.delete(e)),()=>A)}var L=500,R=1e4;function z(e,t){return`${e} ${t}`}var B=new class{ws=null;open=!1;backoff=L;reconnectTimer=null;theme=null;terminals=new Map;notificationListeners=new Set;statusListeners=new Set;renameListeners=new Set;accountListeners=new Set;switchListeners=new Set;sessionsChangedListeners=new Set;hostUpdatesListeners=new Set;connectionListeners=new Set;shellWaiters=new Map;attach(e,t,n,r,i){let a={session:e,term:t,cols:n,rows:r,handlers:i,ready:!1,live:!1,pendingResize:!1};return this.terminals.set(z(e,t),a),this.ensureConnected(),this.open&&this.send({t:`attach`,session:e,term:t,cols:n,rows:r}),()=>this.detach(e,t)}detach(e,t){this.terminals.delete(z(e,t))&&this.open&&this.send({t:`detach`,session:e,term:t})}write(e,t,n){this.open&&this.terminals.get(z(e,t))?.ready&&this.send({t:`stdin`,session:e,term:t,data:n})}resize(e,t,n,r){let i=this.terminals.get(z(e,t));i&&(i.cols=n,i.rows=r,this.open&&i.ready?this.send({t:`resize`,session:e,term:t,cols:n,rows:r}):i.pendingResize=!0)}spawnShell(e){return this.ensureConnected(),this.open?new Promise((t,n)=>{let r=this.shellWaiters.get(e)??[];r.push({resolve:t,reject:n}),this.shellWaiters.set(e,r),this.open&&this.send({t:`spawn-shell`,session:e})}):Promise.reject(Error(`Connection is unavailable`))}killShell(e,t){this.open&&this.send({t:`kill-shell`,session:e,term:t})}onStatus(e){return this.statusListeners.add(e),this.ensureConnected(),()=>this.statusListeners.delete(e)}onAgentNotification(e){return this.notificationListeners.add(e),this.ensureConnected(),()=>this.notificationListeners.delete(e)}onRenamed(e){return this.renameListeners.add(e),this.ensureConnected(),()=>this.renameListeners.delete(e)}onAccount(e){return this.accountListeners.add(e),this.ensureConnected(),()=>this.accountListeners.delete(e)}onSessionSwitched(e){return this.switchListeners.add(e),this.ensureConnected(),()=>this.switchListeners.delete(e)}onSessionsChanged(e){return this.sessionsChangedListeners.add(e),this.ensureConnected(),()=>this.sessionsChangedListeners.delete(e)}onConnectionChange(e){return this.connectionListeners.add(e),()=>this.connectionListeners.delete(e)}onHostUpdatesChanged(e){return this.hostUpdatesListeners.add(e),this.ensureConnected(),()=>this.hostUpdatesListeners.delete(e)}isConnected(){return this.open}reportTheme(e,t){this.theme&&this.theme.fg===e&&this.theme.bg===t||(this.theme={fg:e,bg:t},this.open&&this.send({t:`theme`,fg:e,bg:t}))}reset(){this.ws?.close()}switchHost(){let e=this.ws;this.ws=null,this.open=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.terminals.clear();for(let e of this.shellWaiters.values())for(let t of e)t.reject(Error(`Host changed`));this.shellWaiters.clear(),e?.close();for(let e of this.connectionListeners)e(!1)}ensureConnected(){this.ws||this.reconnectTimer||this.connect()}connect(){let e=a.get(),t=i();if(!e&&!t)return;let n=window.location.protocol===`https:`?`wss`:`ws`,o=t?t.socket():new WebSocket(`${n}://${window.location.host}/ws`);this.ws=o,o.addEventListener(`open`,()=>{if(this.ws!==o){o.close();return}t||o.send(JSON.stringify({t:`auth`,token:e}))}),o.addEventListener(`message`,e=>{if(this.ws!==o)return;let t;try{t=JSON.parse(String(e.data))}catch{return}if(t.t===`authenticated`){if(this.open)return;this.open=!0,this.backoff=L,this.send({t:`subscribe-status`}),this.theme&&this.send({t:`theme`,...this.theme});for(let e of this.terminals.values()){e.ready=!1,e.pendingResize=!1;let{session:t,term:n,cols:r,rows:i}=e;this.send({t:`attach`,session:t,term:n,cols:r,rows:i})}for(let e of this.connectionListeners)e(!0)}else this.open&&this.handle(t)}),o.addEventListener(`close`,e=>{if(this.ws!==o)return;let t=this.open;this.open=!1,this.ws=null;for(let e of this.shellWaiters.values())for(let t of e)t.reject(Error(`Connection lost; operation outcome is unknown`));if(this.shellWaiters.clear(),t)for(let e of this.connectionListeners)e(!1);if(e.code===4401&&e.reason===`browser_rejected`){r();return}this.scheduleReconnect()})}scheduleReconnect(){this.reconnectTimer||this.terminals.size===0&&this.statusListeners.size===0&&this.notificationListeners.size===0&&this.renameListeners.size===0&&this.accountListeners.size===0&&this.switchListeners.size===0&&this.sessionsChangedListeners.size===0||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},this.backoff),this.backoff=Math.min(this.backoff*2,R))}send(e){this.open&&this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}handle(e){switch(e.t){case`agent-notification`:for(let t of this.notificationListeners)t(e);break;case`replay`:{let t=this.terminals.get(z(e.session,e.term));if(!t)break;if(t.ready=!0,t.pendingResize){t.pendingResize=!1;let{session:e,term:n,cols:r,rows:i}=t;this.send({t:`resize`,session:e,term:n,cols:r,rows:i})}t.handlers.onData(e.data,e.t);break}case`output`:this.terminals.get(z(e.session,e.term))?.handlers.onData(e.data,e.t);break;case`exit`:{let t=this.terminals.get(z(e.session,e.term));t&&(t.ready=!1,t.handlers.onExit?.(e.code)),e.term===`agent`&&t&&(t.live=!1);break}case`status`:{let t=[`starting`,`running`,`waiting_input`].includes(e.status);for(let n of this.terminals.values())if(!(n.session!==e.session||n.term!==`agent`)){if(t&&!n.live){n.ready=!1,n.pendingResize=!1;let{session:e,term:t,cols:r,rows:i}=n;this.send({t:`attach`,session:e,term:t,cols:r,rows:i})}n.live=t}for(let t of this.statusListeners)t({session:e.session,status:e.status,last_activity_at:e.last_activity_at});break}case`renamed`:for(let t of this.renameListeners)t({session:e.session,title:e.title,agent_title:e.agent_title,osc_title:e.osc_title});break;case`account`:for(let t of this.accountListeners)t({account_id:e.account_id,profile_id:e.profile_id,logged_in:e.logged_in});break;case`session-switched`:for(let t of this.switchListeners)t(e);break;case`sessions-changed`:for(let t of this.sessionsChangedListeners)t(e);break;case`host-updates-changed`:for(let e of this.hostUpdatesListeners)e();break;case`shell-spawned`:{let t=this.shellWaiters.get(e.session)?.shift();t&&t.resolve(e.term);break}case`notice`:(e.level===`warning`?o.warning:o.error)(e.title,{...e.detail===void 0?{}:{description:e.detail},duration:12e3});break;case`error`:o.error(`Connection error`,{description:e.message});break}}};export{f as _,v as a,l as b,T as c,w as d,M as f,u as g,F as h,P as i,N as l,I as m,m as n,S as o,_ as p,p as r,E as s,B as t,D as u,d as v,c as y};
@@ -47,16 +47,16 @@
47
47
  // Storage disabled or unreadable: the module's own init still runs.
48
48
  }
49
49
  </script>
50
- <script type="module" crossorigin src="/assets/index-Doe7MhnI.js"></script>
50
+ <script type="module" crossorigin src="/assets/index-OKzoyhKK.js"></script>
51
51
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-QTnfLwEv.js">
52
52
  <link rel="modulepreload" crossorigin href="/assets/react-CZI7_Jkm.js">
53
53
  <link rel="modulepreload" crossorigin href="/assets/react-dom-cJyBB_A4.js">
54
- <link rel="modulepreload" crossorigin href="/assets/auth-CdosKReE.js">
55
- <link rel="modulepreload" crossorigin href="/assets/client-settings-DhfHheKR.js">
54
+ <link rel="modulepreload" crossorigin href="/assets/auth-C3ruG3fE.js">
55
+ <link rel="modulepreload" crossorigin href="/assets/client-settings-Cy225e3b.js">
56
56
  <link rel="modulepreload" crossorigin href="/assets/theme-swfNLod9.js">
57
57
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-By8HlURe.js">
58
58
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
59
- <link rel="stylesheet" crossorigin href="/assets/index-4XrK4Fes.css">
59
+ <link rel="stylesheet" crossorigin href="/assets/index-CHGSBAX2.css">
60
60
  </head>
61
61
  <body>
62
62
  <div id="root"></div>
package/dist/pudl.js CHANGED
@@ -14,7 +14,7 @@ import { parseArgs } from "node:util";
14
14
  import { setTimeout as delay } from "node:timers/promises";
15
15
 
16
16
  // ../shared/src/protocol.ts
17
- var PROTOCOL_VERSION = { major: 26, minor: 3 };
17
+ var PROTOCOL_VERSION = { major: 26, minor: 6 };
18
18
  function supportsApplicationFeature(peer, introduced, client = PROTOCOL_VERSION) {
19
19
  return peer?.major === client.major && (peer.major > introduced.major || peer.major === introduced.major && peer.minor >= introduced.minor);
20
20
  }
@@ -15012,7 +15012,7 @@ var profileSchema = external_exports.object({
15012
15012
  branch_prefix: external_exports.string(),
15013
15013
  /** Lucide icon name (kebab-case, e.g. `rocket`); null → the default person glyph. */
15014
15014
  icon: external_exports.string().nullable().default(null),
15015
- /** A `PROFILE_ICON_COLOURS` key; null → the default heading colour. */
15015
+ /** A `PROFILE_ICON_COLOURS` key or six-digit hex colour; null → the default colour. */
15016
15016
  icon_colour: external_exports.string().nullable().default(null),
15017
15017
  created_at: isoTimestamp
15018
15018
  });
@@ -15025,7 +15025,7 @@ var patchProfileRequestSchema = external_exports.object({
15025
15025
  branch_prefix: external_exports.string().max(64).optional(),
15026
15026
  /** Set/clear the profile's lucide icon (kebab-case name); null clears it. */
15027
15027
  icon: external_exports.string().max(64).nullable().optional(),
15028
- /** Set/clear the icon colour (a `PROFILE_ICON_COLOURS` key); null clears it. */
15028
+ /** Set/clear the icon colour (a palette key or six-digit hex); null clears it. */
15029
15029
  icon_colour: external_exports.string().max(32).nullable().optional()
15030
15030
  });
15031
15031
  var sessionSeedSchema = external_exports.looseObject({
@@ -15040,7 +15040,7 @@ var sessionDefaultsSchema = external_exports.looseObject({
15040
15040
  var profileSettingsSchema = external_exports.looseObject({
15041
15041
  /** Host identity for this profile on this daemon; deliberately excluded from sync. */
15042
15042
  hostIcon: external_exports.string().max(64).nullable().optional(),
15043
- hostColour: external_exports.enum(PROFILE_ICON_COLOURS).nullable().optional(),
15043
+ hostColour: external_exports.union([external_exports.enum(PROFILE_ICON_COLOURS), external_exports.string().regex(/^#[0-9a-fA-F]{6}$/)]).nullable().optional(),
15044
15044
  allowSkipPermissions: external_exports.boolean().default(false),
15045
15045
  /**
15046
15046
  * Captured session environment (SPEC §4): whether this profile's session
@@ -15433,7 +15433,10 @@ var archiveRequestSchema = external_exports.object({
15433
15433
 
15434
15434
  // ../shared/src/api/workspace/projects.ts
15435
15435
  var projectAbbrev2 = external_exports.string().min(1).max(5);
15436
- var projectColourSchema = external_exports.enum(PROFILE_ICON_COLOURS);
15436
+ var projectColourSchema = external_exports.union([
15437
+ external_exports.enum(PROFILE_ICON_COLOURS),
15438
+ external_exports.string().regex(/^#[0-9a-f]{6}$/i)
15439
+ ]);
15437
15440
  var projectSchema = external_exports.object({
15438
15441
  id: projectId,
15439
15442
  profile_id: profileId,
@@ -16040,6 +16043,10 @@ var gitRepositoryRequestSchema = external_exports.object({ repository: external_
16040
16043
  var gitPathsRequestSchema = gitRepositoryRequestSchema.extend({
16041
16044
  paths: external_exports.array(external_exports.string().min(1)).min(1)
16042
16045
  });
16046
+ var gitRestoreRequestSchema = gitRepositoryRequestSchema.extend({
16047
+ path: external_exports.string().min(1),
16048
+ delete_untracked: external_exports.boolean().optional()
16049
+ });
16043
16050
  var gitCommitRequestSchema = gitRepositoryRequestSchema.extend({
16044
16051
  message: external_exports.string().trim().min(1),
16045
16052
  /** Stage every change immediately before committing, under the same repo lock. */
@@ -17071,7 +17078,7 @@ var storageStatusSchema = external_exports.object({
17071
17078
  });
17072
17079
 
17073
17080
  // ../shared/src/runtime/protocol.ts
17074
- var RUNTIME_PROTOCOL_VERSION = { major: 1, minor: 0 };
17081
+ var RUNTIME_PROTOCOL_VERSION = { major: 1, minor: 1 };
17075
17082
  var RUNTIME_LIMITS = {
17076
17083
  frameBytes: 8 * 1024 * 1024,
17077
17084
  inputBytes: 64 * 1024,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puddle-code/cli",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "puddle \u2014 self-hosted orchestrator for CLI coding agents: serves the cockpit UI and connects it to local or SSH hosts.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/PerceptronV/puddle-code#readme",