@edspencer/paddock 0.59.0 → 0.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/server/dist/cli/args.d.ts +56 -0
- package/packages/server/dist/cli/args.js +159 -0
- package/packages/server/dist/cli/paddock.d.ts +1 -30
- package/packages/server/dist/cli/paddock.js +6 -146
- package/packages/server/package.json +1 -1
- package/packages/web/dist/assets/{InstanceConfigPage-Cli_WHsM.js → InstanceConfigPage-CAwSnyga.js} +1 -1
- package/packages/web/dist/assets/{MarkdownRenderer-BYK9nmr4.js → MarkdownRenderer-DpGpkMzG.js} +1 -1
- package/packages/web/dist/assets/{ProjectRedirect-DWcMpdZJ.js → ProjectRedirect-D1ipv4jr.js} +1 -1
- package/packages/web/dist/assets/{ProjectView-CvD9WQsW.js → ProjectView-BI1TtrOK.js} +3 -3
- package/packages/web/dist/assets/{ProjectsGrid-Bf2cx9-Z.js → ProjectsGrid-Dwngb-m1.js} +1 -1
- package/packages/web/dist/assets/{arc-CZ9CFd-g.js → arc-BZh6Z9_D.js} +1 -1
- package/packages/web/dist/assets/{architectureDiagram-3BPJPVTR-BzOXUlLu.js → architectureDiagram-3BPJPVTR-iCtJiW4k.js} +1 -1
- package/packages/web/dist/assets/{blockDiagram-GPEHLZMM-Bnkcx-Fn.js → blockDiagram-GPEHLZMM-BeI9Wi0h.js} +1 -1
- package/packages/web/dist/assets/{c4Diagram-AAUBKEIU-C-nqckPS.js → c4Diagram-AAUBKEIU-D_j2LKZ-.js} +1 -1
- package/packages/web/dist/assets/channel-DszBVZgr.js +2 -0
- package/packages/web/dist/assets/{chunk-2J33WTMH-jVn7J_5N.js → chunk-2J33WTMH-DRlfPROq.js} +1 -1
- package/packages/web/dist/assets/{chunk-4BX2VUAB-D5eys7Hi.js → chunk-4BX2VUAB-BMY66MLs.js} +1 -1
- package/packages/web/dist/assets/{chunk-55IACEB6-CqpdXIoL.js → chunk-55IACEB6-BAQ92trf.js} +1 -1
- package/packages/web/dist/assets/{chunk-727SXJPM-SQikk09l.js → chunk-727SXJPM-Dxgb_nNN.js} +1 -1
- package/packages/web/dist/assets/{chunk-AQP2D5EJ-rfBNpUwD.js → chunk-AQP2D5EJ-D5cqv3Jv.js} +1 -1
- package/packages/web/dist/assets/{chunk-FMBD7UC4-CnL0tA20.js → chunk-FMBD7UC4-BOEqxzyA.js} +1 -1
- package/packages/web/dist/assets/{chunk-ND2GUHAM-CZGi4swC.js → chunk-ND2GUHAM-CkTZgv_W.js} +1 -1
- package/packages/web/dist/assets/{chunk-QZHKN3VN-Du4WKuCj.js → chunk-QZHKN3VN-DIr8TL7M.js} +1 -1
- package/packages/web/dist/assets/classDiagram-4FO5ZUOK-DuGqlnbT.js +2 -0
- package/packages/web/dist/assets/classDiagram-v2-Q7XG4LA2-DuGqlnbT.js +2 -0
- package/packages/web/dist/assets/{core-LJ--cHnT.js → core-DyOZ2e1O.js} +1 -1
- package/packages/web/dist/assets/{cose-bilkent-S5V4N54A-CEovKrYZ.js → cose-bilkent-S5V4N54A-D8Muyf4o.js} +1 -1
- package/packages/web/dist/assets/{dagre-BM42HDAG-jQhK8147.js → dagre-BM42HDAG-B_EUbUz6.js} +1 -1
- package/packages/web/dist/assets/{diagram-2AECGRRQ-BmiauiWQ.js → diagram-2AECGRRQ-DpAM0K6Q.js} +1 -1
- package/packages/web/dist/assets/{diagram-5GNKFQAL-VYdTkqGm.js → diagram-5GNKFQAL-Dhs9RMKk.js} +1 -1
- package/packages/web/dist/assets/{diagram-KO2AKTUF-DcOTKmwo.js → diagram-KO2AKTUF-LBeTHReu.js} +1 -1
- package/packages/web/dist/assets/{diagram-LMA3HP47-DaehIKcD.js → diagram-LMA3HP47-CxboRwue.js} +1 -1
- package/packages/web/dist/assets/{diagram-OG6HWLK6-DTqk6D4N.js → diagram-OG6HWLK6-BK_P-OSi.js} +1 -1
- package/packages/web/dist/assets/{erDiagram-TEJ5UH35-Dj4rI8M1.js → erDiagram-TEJ5UH35-CPSKRHI5.js} +1 -1
- package/packages/web/dist/assets/{flowDiagram-I6XJVG4X-D0FWSohH.js → flowDiagram-I6XJVG4X-CbUumAP5.js} +1 -1
- package/packages/web/dist/assets/{format-CgkZTf5F.js → format-DDL0Q7H2.js} +1 -1
- package/packages/web/dist/assets/{ganttDiagram-6RSMTGT7-DgaRh12R.js → ganttDiagram-6RSMTGT7-l-p25ckA.js} +1 -1
- package/packages/web/dist/assets/{gitGraphDiagram-PVQCEYII-5qiry4ao.js → gitGraphDiagram-PVQCEYII-i8kDIgga.js} +1 -1
- package/packages/web/dist/assets/{index-CcYeBUNk.js → index-DKDgTDXa.js} +2 -2
- package/packages/web/dist/assets/{infoDiagram-5YYISTIA-CZmDwouw.js → infoDiagram-5YYISTIA-CbyLnHIe.js} +1 -1
- package/packages/web/dist/assets/{ishikawaDiagram-YF4QCWOH-knkHstDa.js → ishikawaDiagram-YF4QCWOH-C1_3z8-9.js} +1 -1
- package/packages/web/dist/assets/{journeyDiagram-JHISSGLW-ByfdmIVy.js → journeyDiagram-JHISSGLW-BzyAtQdy.js} +1 -1
- package/packages/web/dist/assets/{kanban-definition-UN3LZRKU-DSzly2xb.js → kanban-definition-UN3LZRKU-Fp2VVm-b.js} +1 -1
- package/packages/web/dist/assets/{linear-BX6qYIpB.js → linear-6ZKEeWQ5.js} +1 -1
- package/packages/web/dist/assets/{mermaid.core-BXPz6_-1.js → mermaid.core-Dorg4Dl2.js} +4 -4
- package/packages/web/dist/assets/{mindmap-definition-RKZ34NQL-fzfZWy91.js → mindmap-definition-RKZ34NQL-Bk4Ax0bI.js} +1 -1
- package/packages/web/dist/assets/{pieDiagram-4H26LBE5-M99j1K9t.js → pieDiagram-4H26LBE5-DoTn5jHm.js} +1 -1
- package/packages/web/dist/assets/{quadrantDiagram-W4KKPZXB-B7fKq1ce.js → quadrantDiagram-W4KKPZXB-ClNmIKCj.js} +1 -1
- package/packages/web/dist/assets/{requirementDiagram-4Y6WPE33-xCBFrXav.js → requirementDiagram-4Y6WPE33-DMF7i5KW.js} +1 -1
- package/packages/web/dist/assets/{sankeyDiagram-5OEKKPKP-Dp9KLMhd.js → sankeyDiagram-5OEKKPKP-C-ALbVLg.js} +1 -1
- package/packages/web/dist/assets/{sequenceDiagram-3UESZ5HK-CNNVWpta.js → sequenceDiagram-3UESZ5HK-DsUxj8IQ.js} +1 -1
- package/packages/web/dist/assets/{stateDiagram-AJRCARHV-CzKRXREb.js → stateDiagram-AJRCARHV-OCZiRRsz.js} +1 -1
- package/packages/web/dist/assets/stateDiagram-v2-BHNVJYJU-BwcJspgG.js +2 -0
- package/packages/web/dist/assets/{timeline-definition-PNZ67QCA-DfvQTe5J.js → timeline-definition-PNZ67QCA-5ifjxa-s.js} +1 -1
- package/packages/web/dist/assets/{vennDiagram-CIIHVFJN-2PBM01eq.js → vennDiagram-CIIHVFJN-Bqvqpot5.js} +1 -1
- package/packages/web/dist/assets/{wardley-L42UT6IY-DC1EIjci.js → wardley-L42UT6IY-DwgnVd48.js} +1 -1
- package/packages/web/dist/assets/{wardleyDiagram-YWT4CUSO-4kYoKkfS.js → wardleyDiagram-YWT4CUSO-F-VCH-oE.js} +1 -1
- package/packages/web/dist/assets/{xychartDiagram-2RQKCTM6-Bin8O1V8.js → xychartDiagram-2RQKCTM6-L4q6oV_7.js} +1 -1
- package/packages/web/dist/index.html +1 -1
- package/packages/web/dist/sw.js +1 -1
- package/packages/web/dist/assets/channel-By51cUN7.js +0 -2
- package/packages/web/dist/assets/classDiagram-4FO5ZUOK-sIDgFl-L.js +0 -2
- package/packages/web/dist/assets/classDiagram-v2-Q7XG4LA2-sIDgFl-L.js +0 -2
- package/packages/web/dist/assets/stateDiagram-v2-BHNVJYJU-LKJwobEd.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectsGrid-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectsGrid-Dwngb-m1.js","assets/format-DDL0Q7H2.js","assets/ProjectView-BI1TtrOK.js","assets/queued-LamEU0GH.js","assets/lastTab-CU1zsF0j.js","assets/ProjectRedirect-D1ipv4jr.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function $c(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(r,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();const Jh="modulepreload",Yh=function(e){return"/"+e},ou={},Sl=function(t,n,r){let l=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));l=Promise.allSettled(n.map(s=>{if(s=Yh(s),s in ou)return;ou[s]=!0;const u=s.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${f}`))return;const c=document.createElement("link");if(c.rel=u?"stylesheet":Jh,u||(c.as="script"),c.crossOrigin="",c.href=s,a&&c.setAttribute("nonce",a),document.head.appendChild(c),u)return new Promise((p,x)=>{c.addEventListener("load",p),c.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${s}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return l.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};var p0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bc={exports:{}},Vo={},Wc={exports:{}},X={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -67,5 +67,5 @@ Error generating stack: `+o.message+`
|
|
|
67
67
|
* LICENSE.md file in the root directory of this source tree.
|
|
68
68
|
*
|
|
69
69
|
* @license MIT
|
|
70
|
-
*/function Er(){return Er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Er.apply(this,arguments)}function gh(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,o;for(o=0;o<r.length;o++)l=r[o],!(t.indexOf(l)>=0)&&(n[l]=e[l]);return n}function Bg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wg(e,t){return e.button===0&&(!t||t==="_self")&&!Bg(e)}const Vg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Hg=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],Qg="6";try{window.__reactRouterVersion=Qg}catch{}function Kg(e,t){return eg({basename:void 0,future:Er({},void 0,{v7_prependBasename:!0}),history:Cv({window:void 0}),hydrationData:bg(),routes:e,mapRouteProperties:Ag,unstable_dataStrategy:void 0,unstable_patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function bg(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Er({},t,{errors:Jg(t.errors)})),t}function Jg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,l]of t)if(l&&l.__type==="RouteErrorResponse")n[r]=new Bo(l.status,l.statusText,l.data,l.internal===!0);else if(l&&l.__type==="Error"){if(l.__subType){let o=window[l.__subType];if(typeof o=="function")try{let i=new o(l.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(l.message);o.stack="",n[r]=o}}else n[r]=l;return n}const yh=C.createContext({isTransitioning:!1}),Yg=C.createContext(new Map),Gg="startTransition",Tc=dp[Gg],Xg="flushSync",Lc=Ev[Xg];function Zg(e){Tc?Tc(e):e()}function Ar(e){Lc?Lc(e):e()}class qg{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function ey(e){let{fallbackElement:t,router:n,future:r}=e,[l,o]=C.useState(n.state),[i,a]=C.useState(),[s,u]=C.useState({isTransitioning:!1}),[f,c]=C.useState(),[p,x]=C.useState(),[E,k]=C.useState(),T=C.useRef(new Map),{v7_startTransition:m}=r||{},d=C.useCallback(y=>{m?Zg(y):y()},[m]),g=C.useCallback((y,F)=>{let{deletedFetchers:O,unstable_flushSync:Q,unstable_viewTransitionOpts:te}=F;O.forEach(se=>T.current.delete(se)),y.fetchers.forEach((se,et)=>{se.data!==void 0&&T.current.set(et,se.data)});let pe=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!te||pe){Q?Ar(()=>o(y)):d(()=>o(y));return}if(Q){Ar(()=>{p&&(f&&f.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:te.currentLocation,nextLocation:te.nextLocation})});let se=n.window.document.startViewTransition(()=>{Ar(()=>o(y))});se.finished.finally(()=>{Ar(()=>{c(void 0),x(void 0),a(void 0),u({isTransitioning:!1})})}),Ar(()=>x(se));return}p?(f&&f.resolve(),p.skipTransition(),k({state:y,currentLocation:te.currentLocation,nextLocation:te.nextLocation})):(a(y),u({isTransitioning:!0,flushSync:!1,currentLocation:te.currentLocation,nextLocation:te.nextLocation}))},[n.window,p,f,T,d]);C.useLayoutEffect(()=>n.subscribe(g),[n,g]),C.useEffect(()=>{s.isTransitioning&&!s.flushSync&&c(new qg)},[s]),C.useEffect(()=>{if(f&&i&&n.window){let y=i,F=f.promise,O=n.window.document.startViewTransition(async()=>{d(()=>o(y)),await F});O.finished.finally(()=>{c(void 0),x(void 0),a(void 0),u({isTransitioning:!1})}),x(O)}},[d,i,f,n.window]),C.useEffect(()=>{f&&i&&l.location.key===i.location.key&&f.resolve()},[f,p,l.location,i]),C.useEffect(()=>{!s.isTransitioning&&E&&(a(E.state),u({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),k(void 0))},[s.isTransitioning,E]),C.useEffect(()=>{},[]);let S=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:y=>n.navigate(y),push:(y,F,O)=>n.navigate(y,{state:F,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(y,F,O)=>n.navigate(y,{replace:!0,state:F,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),P=n.basename||"/",_=C.useMemo(()=>({router:n,navigator:S,static:!1,basename:P}),[n,S,P]),L=C.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return C.createElement(C.Fragment,null,C.createElement(Nl.Provider,{value:_},C.createElement(Fs.Provider,{value:l},C.createElement(Yg.Provider,{value:T.current},C.createElement(yh.Provider,{value:s},C.createElement($g,{basename:P,location:l.location,navigationType:l.historyAction,navigator:S,future:L},l.initialized||n.future.v7_partialHydration?C.createElement(ty,{routes:n.routes,future:n.future,state:l}):t))))),null)}const ty=C.memo(ny);function ny(e){let{routes:t,future:n,state:r}=e;return Ng(t,void 0,r,n)}const ry=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ly=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oy=C.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:o,replace:i,state:a,target:s,to:u,preventScrollReset:f,unstable_viewTransition:c}=t,p=gh(t,Vg),{basename:x}=C.useContext(bt),E,k=!1;if(typeof u=="string"&&ly.test(u)&&(E=u,ry))try{let g=new URL(window.location.href),S=u.startsWith("//")?new URL(g.protocol+u):new URL(u),P=Qt(S.pathname,x);S.origin===g.origin&&P!=null?u=P+S.search+S.hash:k=!0}catch{}let T=Eg(u,{relative:l}),m=ay(u,{replace:i,state:a,target:s,preventScrollReset:f,relative:l,unstable_viewTransition:c});function d(g){r&&r(g),g.defaultPrevented||m(g)}return C.createElement("a",Er({},p,{href:E||T,onClick:k||o?r:d,ref:n,target:s}))}),bn=C.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:o="",end:i=!1,style:a,to:s,unstable_viewTransition:u,children:f}=t,c=gh(t,Hg),p=ui(s,{relative:c.relative}),x=Wn(),E=C.useContext(Fs),{navigator:k,basename:T}=C.useContext(bt),m=E!=null&&sy(p)&&u===!0,d=k.encodeLocation?k.encodeLocation(p).pathname:p.pathname,g=x.pathname,S=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;l||(g=g.toLowerCase(),S=S?S.toLowerCase():null,d=d.toLowerCase()),S&&T&&(S=Qt(S,T)||S);const P=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let _=g===d||!i&&g.startsWith(d)&&g.charAt(P)==="/",L=S!=null&&(S===d||!i&&S.startsWith(d)&&S.charAt(d.length)==="/"),y={isActive:_,isPending:L,isTransitioning:m},F=_?r:void 0,O;typeof o=="function"?O=o(y):O=[o,_?"active":null,L?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let Q=typeof a=="function"?a(y):a;return C.createElement(oy,Er({},c,{"aria-current":F,className:O,ref:n,style:Q,to:s,unstable_viewTransition:u}),typeof f=="function"?f(y):f)});var Ua;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ua||(Ua={}));var Mc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mc||(Mc={}));function iy(e){let t=C.useContext(Nl);return t||Y(!1),t}function ay(e,t){let{target:n,replace:r,state:l,preventScrollReset:o,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,s=si(),u=Wn(),f=ui(e,{relative:i});return C.useCallback(c=>{if(Wg(c,n)){c.preventDefault();let p=r!==void 0?r:$n(u)===$n(f);s(e,{replace:p,state:l,preventScrollReset:o,relative:i,unstable_viewTransition:a})}},[u,s,f,r,l,n,e,o,i,a])}function sy(e,t){t===void 0&&(t={});let n=C.useContext(yh);n==null&&Y(!1);let{basename:r}=iy(Ua.useViewTransitionState),l=ui(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Qt(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Qt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ao(l.pathname,i)!=null||Ao(l.pathname,o)!=null}const wh="";function As(e){return e===wh}function b(e){return As(e)?"/api/root":`/api/projects/${encodeURIComponent(e)}`}function g0(e){return As(e)?"":`/projects/${e}`}function y0(e){return e===""?"/":`${e}/home`}function uy(){return"/projects"}function w0(e,t){const n=e.startsWith(t)?e.slice(t.length):e;return n.startsWith("/files")?"files":n.startsWith("/changes")?"changes":n.startsWith("/history")?"history":n.startsWith("/settings")?"settings":n.startsWith("/triggers")||n.startsWith("/hooks")?"triggers":n.startsWith("/home")?"home":n.startsWith("/chat")?"chat":t===""?"home":"chat"}function x0(e,t){const n=`${t}/files`;if(!e.startsWith(n))return"";const r=e.slice(n.length).replace(/^\//,"");return r?r.split("/").filter(Boolean).map(l=>{try{return decodeURIComponent(l)}catch{return l}}).join("/"):""}function S0(e){if(!e)return"#";const t=e.trim().replace(/\.git$/i,"");if(/^https?:\/\//i.test(t))return t;const n=/^git@([^:]+):(.+)$/.exec(t);if(n)return`https://${n[1]}/${n[2]}`;const r=/^ssh:\/\/git@([^/]+)\/(.+)$/i.exec(t);return r?`https://${r[1]}/${r[2]}`:"#"}const ar="";async function H(e,t){const n=await fetch(`${ar}${e}`,{headers:{"content-type":"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!n.ok){let r=n.statusText;try{const l=await n.json();l.error&&(r=l.error)}catch{}throw new xl(r,n.status)}return await n.json()}async function cy(e,t){const n=await fetch(`${ar}${e}`,t);if(!n.ok){let r=n.statusText;try{const l=JSON.parse(await n.text());l.error&&(r=l.error)}catch{}throw new xl(r,n.status)}return n.text()}class xl extends Error{constructor(t,n){super(t),this.status=n,this.name="ApiError"}}const Bs={async me(){return H("/api/me")},async markChatSeen(e,t,n){const r=`${b(e)}/chats/${encodeURIComponent(t)}/seen`;await H(r,{method:"POST",body:JSON.stringify(n!==void 0?{when:n}:{})})},async markChatUnread(e,t,n){const r=`${b(e)}/chats/${encodeURIComponent(t)}/unread`;await H(r,{method:"POST",body:JSON.stringify({unread:n})})},async projectRuns(e,t){const n=t!==void 0?`?limit=${encodeURIComponent(t)}`:"";return H(`${b(e)}/runs${n}`)},async markRunsSeen(e,t){await H(`${b(e)}/runs/seen`,{method:"POST",body:JSON.stringify(t!==void 0?{when:t}:{})})},async getModels(){return H("/api/models")},async getInstanceConfig(){return H("/api/instance-config")},async updateInstanceConfig(e){return H("/api/instance-config",{method:"PUT",body:JSON.stringify({patch:e})})},async uploadAttachments(e,t,n){const r=new FormData;for(const o of n)r.append("files",o,o.name);const l=await fetch(`${ar}${b(e)}/chats/${encodeURIComponent(t)}/upload`,{method:"POST",body:r});if(!l.ok){let o=l.statusText;try{const i=await l.json();i.error&&(o=i.error)}catch{}throw new xl(o,l.status)}return await l.json()},async projectCommands(e){const{commands:t}=await H(`${b(e)}/commands`);return t},async listProjects(){const{projects:e,root:t}=await H("/api/projects");return{projects:e,root:t??null}},async getProjectDetail(e){return H(`${b(e)}`)},async attentionChats(e){const t=await H(`${b(e)}/chats/attention`);return{running:t.running??[],unread:t.unread??[]}},async createProject(e){const{project:t}=await H("/api/projects",{method:"POST",body:JSON.stringify(e)});return t},async updateProject(e,t){const{project:n}=await H(`${b(e)}`,{method:"PATCH",body:JSON.stringify(t)});return n},async promoteProject(e,t){const{project:n}=await H(`${b(e)}/promote`,{method:"POST",body:JSON.stringify({repo:t})});return n},async deleteProject(e){await H(`${b(e)}`,{method:"DELETE"})},async deleteProjectChat(e,t){await H(`${b(e)}/chats/${encodeURIComponent(t)}`,{method:"DELETE"})},async renameProjectChat(e,t,n){await H(`${b(e)}/chats/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({name:n})})},async archiveProjectChat(e,t,n){await H(`${b(e)}/chats/${encodeURIComponent(t)}/archive`,{method:"POST",body:JSON.stringify({archived:n})})},async starProjectChat(e,t,n){await H(`${b(e)}/chats/${encodeURIComponent(t)}/star`,{method:"POST",body:JSON.stringify({starred:n})})},async archiveProjectChats(e,t,n){await H(`${b(e)}/chats/batch/archive`,{method:"POST",body:JSON.stringify({sessionIds:t,archived:n})})},async markChatsUnread(e,t,n){await H(`${b(e)}/chats/batch/unread`,{method:"POST",body:JSON.stringify({sessionIds:t,unread:n})})},async deleteProjectChats(e,t){const n=await H(`${b(e)}/chats/batch/delete`,{method:"POST",body:JSON.stringify({sessionIds:t})});return{removed:n.removed??[],failed:n.failed??[]}},async detachProjectChat(e,t,n){await H(`${b(e)}/chats/${encodeURIComponent(t)}/detach`,{method:"POST",body:JSON.stringify({detached:n})})},async promoteChat(e,t,n){return H(`${b(e)}/chats/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify(n)})},async forkChat(e,t,n,r){const{sessionId:l}=await H(`${b(e)}/chats/${encodeURIComponent(t)}/fork`,{method:"POST",body:JSON.stringify({name:n,fromUuid:r})});return l},async revertChat(e,t,n){const{removed:r}=await H(`${b(e)}/chats/${encodeURIComponent(t)}/revert`,{method:"POST",body:JSON.stringify({uuid:n})});return r},async listProjectDir(e,t=""){const n=t?`?path=${encodeURIComponent(t)}`:"";return H(`${b(e)}/files${n}`)},async listProjectFiles(e){const{entries:t}=await this.listProjectDir(e);return t.filter(n=>n.kind==="file").map(n=>n.name)},async getProjectFile(e,t){return H(`${b(e)}/files/${encodeURIComponent(t)}`)},projectFileRawUrl(e,t){return`${ar}${b(e)}/files/${encodeURIComponent(t)}?raw=1`},chatFileRawUrl(e){return`${ar}/api/chat-files/${encodeURIComponent(e)}`},async pinFile(e,t){const{project:n}=await H(`${b(e)}/pins`,{method:"PUT",body:JSON.stringify({file:t})});return n},async unpinFile(e,t){const{project:n}=await H(`${b(e)}/pins/${encodeURIComponent(t)}`,{method:"DELETE"});return n},async listProjectChats(e){const{chats:t}=await H(`${b(e)}/chats`);return t},async getAdoptableChats(e){return H(`${b(e)}/adoptable-chats`)},async adoptChats(e,t){return H(`${b(e)}/adopt-chats`,{method:"POST",body:JSON.stringify(t??{})})},async chatUsage(e,t){const n=t?`?scope=${t}`:"",{usage:r}=await H(`${b(e)}/chats/usage${n}`);return r},async projectChatMessages(e,t){const{messages:n}=await H(`${b(e)}/chats/${encodeURIComponent(t)}/messages`);return n},async subagentMessages(e,t,n){const r=`${b(e)}/chats/${encodeURIComponent(t)}`,{messages:l}=await H(`${r}/subagents/${encodeURIComponent(n)}/messages`);return l},async chatContext(e,t){const n=`${b(e)}/chats/${encodeURIComponent(t)}/context`,{usage:r}=await H(n);return r},async listTriggers(e){return H(`${b(e)}/triggers`)},async putTrigger(e,t,n){const{trigger:r}=await H(`${b(e)}/triggers/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(n)});return r},async deleteTrigger(e,t){await H(`${b(e)}/triggers/${encodeURIComponent(t)}`,{method:"DELETE"})},async triggerRuntime(e){return H(`${b(e)}/triggers/runtime`)},async runTrigger(e,t){const{sessionId:n}=await H(`${b(e)}/triggers/${encodeURIComponent(t)}/run`,{method:"POST",body:"{}"});return n},async gitInfo(){return H("/api/git")},async gitStatus(e){return H(`${b(e)}/git/status`)},async gitDiff(e,t){const n=t?`?file=${encodeURIComponent(t)}`:"";return cy(`${b(e)}/git/diff${n}`)},async gitCommit(e,t,n){return H(`${b(e)}/git/commit`,{method:"POST",body:JSON.stringify(n?{message:t,files:n}:{message:t})})},async gitPush(){return H("/api/git/push",{method:"POST"})},async githubConnect(){return H("/api/git/github/connect",{method:"POST"})},async githubPoll(e){return H("/api/git/github/poll",{method:"POST",body:JSON.stringify({deviceCode:e})})},async githubDisconnect(){await H("/api/git/github/disconnect",{method:"POST"})},async transcriptionStatus(){return H("/api/transcription")},async transcribe(e,t="dictation.webm",n){const r=new FormData;r.append("file",e,t);const l=await fetch(`${ar}/api/transcribe`,{method:"POST",body:r,signal:n});if(!l.ok){let i=l.statusText;try{const a=await l.json();a.error&&(i=a.error)}catch{}throw new xl(i,l.status)}const{text:o}=await l.json();return o}},xh=C.createContext(null);function dy({children:e}){const[t,n]=C.useState([]),[r,l]=C.useState(null),[o,i]=C.useState(!0),[a,s]=C.useState(null),u=C.useCallback(async()=>{i(!0),s(null);try{const{projects:x,root:E}=await Bs.listProjects();n(x),E&&l(E)}catch(x){s(x instanceof Error?x.message:"Failed to load projects")}finally{i(!1)}},[]),f=C.useCallback(x=>{if(As(x.slug)){l(x);return}n(E=>[x,...E.filter(k=>k.slug!==x.slug)])},[]),c=C.useCallback(x=>{n(E=>E.filter(k=>k.slug!==x))},[]);C.useEffect(()=>{u()},[u]);const p=C.useMemo(()=>({projects:t,rootWorkspace:r,loading:o,error:a,refresh:u,upsert:f,remove:c}),[t,r,o,a,u,f,c]);return h.jsx(xh.Provider,{value:p,children:e})}function fy(){const e=C.useContext(xh);if(!e)throw new Error("useProjects must be used within ProjectsProvider");return e}const hy="paddock:theme";function py(){return typeof document<"u"&&document.documentElement.classList.contains("dark")}function my(){const[e,t]=C.useState(py),n=C.useCallback(()=>{t(r=>{const l=!r;document.documentElement.classList.toggle("dark",l);try{localStorage.setItem(hy,l?"dark":"light")}catch{}return l})},[]);return{dark:e,toggle:n}}const vy={name:"Paddock",logo:"🐎",accent:"#c2603c"},gy={enabled:!1,path:"/open-api"};function yy(){const e=globalThis.__PADDOCK_CONFIG__;return{...vy,...(e==null?void 0:e.brand)??{}}}function wy(){const e=globalThis.__PADDOCK_CONFIG__;return{...gy,...(e==null?void 0:e.openapi)??{}}}function xy(e){return/^(https?:\/\/|\/)/i.test(e.trim())}const Ws=[{slug:"homelab",label:"Homelab",blurb:"Servers, networking, self-hosted services."},{slug:"house",label:"House",blurb:"Physical home systems — water, climate, power, garden."},{slug:"side-projects",label:"Side Projects",blurb:"Apps and ideas of your own."}],Dc="",Sh=new Map(Ws.map(e=>[e.slug,e]));function Sy(e){if(!e)return"Unsorted";const t=Sh.get(e);return t?t.label:e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function k0(e){var t;return(t=Sh.get(e))==null?void 0:t.blurb}function ky(e){const t=new Set(e),n=[];for(const l of Ws)t.has(l.slug)&&(n.push(l.slug),t.delete(l.slug));const r=t.delete(Dc);return n.push(...[...t].sort()),r&&n.push(Dc),n}const kh=25e3,Eh=1e4,Ey=kh+Eh+5e3,Cy=500,jy=1e4;class Py{constructor(){this.ws=null,this.outbox=[],this.subs=new Map,this.pingTimer=null,this.pongTimer=null,this.awaitingPong=!1,this.lastPongAt=0,this.reconnectTimer=null,this.reconnectAttempts=0,this.manualClose=!1,this.stateListeners=new Set,this._state="closed",this.activeSessions=new Map,this.activeListeners=new Set,this.activeInfoListeners=new Set,this.knownSessions=new Set;const n=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}`;if(this.url=`${n.replace(/^http/,"ws")}/ws`,typeof window<"u"){const r=()=>this.ensureLive();window.addEventListener("online",r),window.addEventListener("focus",r),typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.ensureLive()})}}get state(){return this._state}onState(t){return this.stateListeners.add(t),t(this._state),()=>this.stateListeners.delete(t)}setState(t){if(this._state!==t){this._state=t;for(const n of this.stateListeners)n(t)}}onActiveSessions(t){return this.activeListeners.add(t),t(new Set(this.activeSessions.keys())),this.connect(),()=>this.activeListeners.delete(t)}onActiveInfos(t){return this.activeInfoListeners.add(t),t(new Map(this.activeSessions)),this.connect(),()=>this.activeInfoListeners.delete(t)}setActive(t,n,r){const l=this.activeSessions.has(t);if(n?this.activeSessions.set(t,r):this.activeSessions.delete(t),this.activeSessions.has(t)!==l){const o=new Set(this.activeSessions.keys());for(const a of this.activeListeners)a(o);const i=new Map(this.activeSessions);for(const a of this.activeInfoListeners)a(i)}}subscribe(t,n,r){const l=Symbol("chat-sub"),o={projectSlug:t,sessionId:n,handlers:r,lastSeq:-1,turnActive:!1};return this.subs.set(l,o),this.connect(),n&&this.attachSession(o,!1),{setSessionId:i=>{const a=this.subs.get(l);a&&(a.sessionId=i,i&&this.attachSession(a,!1))},unsubscribe:()=>{this.subs.delete(l)}}}attachSession(t,n){t.sessionId&&(this.knownSessions.add(t.sessionId),this.transmit(JSON.stringify({type:"chat:subscribe",payload:{projectSlug:t.projectSlug,sessionId:t.sessionId,wantReplay:n,lastSeq:t.lastSeq}})))}send(t,n,r,l){const o={projectSlug:t,sessionId:r,message:n};l!=null&&l.preloadContext&&(o.preloadContext=!0),l!=null&&l.model&&(o.model=l.model),l!=null&&l.attachments&&l.attachments.length>0&&(o.attachments=l.attachments),this.markTurnStart(t,r),this.transmit(JSON.stringify({type:"chat:send",payload:o}))}setQueued(t,n,r,l){const o={projectSlug:t,sessionId:n,text:r,ts:l};this.transmit(JSON.stringify({type:"chat:set_queue",payload:o}))}markTurnStart(t,n){for(const r of this.subs.values())r.projectSlug===t&&r.sessionId===n&&(r.lastSeq=-1,r.turnActive=!0)}sendCommand(t,n,r){this.markTurnStart(t,r),this.transmit(JSON.stringify({type:"chat:command",payload:{projectSlug:t,sessionId:r,command:n}}))}cancel(t){this.transmit(JSON.stringify({type:"chat:cancel",payload:{jobId:t}}))}continueChat(t,n){this.markTurnStart(t,n),this.transmit(JSON.stringify({type:"chat:continue",payload:{projectSlug:t,sessionId:n}}))}transmit(t){this.isLive()?this.ws.send(t):(this.outbox.push(t),this.ensureLive())}isLive(){var t;return((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN?!1:Date.now()-this.lastPongAt<Ey}wantsSocket(){return this.subs.size>0||this.activeListeners.size>0||this.activeInfoListeners.size>0}ensureLive(){var n;if(!this.wantsSocket())return;const t=(n=this.ws)==null?void 0:n.readyState;t===WebSocket.OPEN?this.sendPing():t!==WebSocket.CONNECTING&&(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectAttempts=0,this.connect())}flushOutbox(){var n;if(((n=this.ws)==null?void 0:n.readyState)!==WebSocket.OPEN||this.outbox.length===0)return;const t=this.outbox;this.outbox=[];for(const r of t)this.ws.send(r)}connect(){if(this.manualClose=!1,this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))return;this.setState("connecting");let t;try{t=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws=t,t.onopen=()=>{this.reconnectAttempts=0,this.awaitingPong=!1,this.lastPongAt=Date.now(),this.setState("open"),this.flushOutbox();for(const n of this.subs.values())n.sessionId&&this.attachSession(n,n.turnActive);this.startPing()},t.onclose=()=>{this.stopPing(),this.setState("closed"),this.manualClose||this.scheduleReconnect()},t.onerror=()=>{t.close()},t.onmessage=n=>this.dispatch(n.data)}startPing(){this.stopPing(),this.pingTimer=setInterval(()=>this.sendPing(),kh)}sendPing(){var t;if(!(((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN||this.awaitingPong)){this.awaitingPong=!0;try{this.ws.send(JSON.stringify({type:"ping"}))}catch{this.awaitingPong=!1,this.ws.close();return}this.pongTimer=setTimeout(()=>{var n;this.pongTimer=null,this.awaitingPong&&((n=this.ws)==null||n.close())},Eh)}}stopPing(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.pongTimer&&clearTimeout(this.pongTimer),this.pongTimer=null,this.awaitingPong=!1}scheduleReconnect(){if(this.reconnectTimer)return;const t=Math.min(jy,Cy*2**this.reconnectAttempts);this.reconnectAttempts+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}route(t,n){const r=[...this.subs.values()].filter(o=>o.projectSlug===t);if(r.length===0)return;if(n){const o=r.find(i=>i.sessionId===n);if(o)return o;if(this.knownSessions.has(n))return}const l=r.find(o=>o.sessionId===null);if(l)return l;if(n===null&&r.length===1)return r[0]}dispatch(t){var u,f,c,p,x,E,k,T,m,d,g,S,P,_,L,y,F,O,Q,te,pe,se,et,Ke;let n;try{n=JSON.parse(t)}catch{return}if(n.type==="pong"){this.awaitingPong=!1,this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null),this.lastPongAt=Date.now(),this.flushOutbox();return}const r=n.payload.projectSlug;if(r==null)return;if(n.type==="chat:error"){const le=this.route(r,null);(f=le==null?void 0:(u=le.handlers).onError)==null||f.call(u,n.payload.error);return}if(n.type==="chat:resync"){const le=this.route(r,n.payload.sessionId);(p=le==null?void 0:(c=le.handlers).onResync)==null||p.call(c);return}if(n.type==="chat:active"){this.setActive(n.payload.sessionId,n.payload.running,r);for(const le of this.subs.values())le.projectSlug===r&&le.sessionId===n.payload.sessionId&&((E=(x=le.handlers).onActive)==null||E.call(x,{running:n.payload.running,jobId:n.payload.jobId}));return}if(n.type==="chat:queued_flushed"){const{sessionId:le,text:D}=n.payload;if(le){Sl(async()=>{const{writeQueued:I,writeQueuedTs:W}=await import("./queued-LamEU0GH.js");return{writeQueued:I,writeQueuedTs:W}},[]).then(({writeQueued:I,writeQueuedTs:W})=>{I(le,r,null),W(le,r,null)});for(const I of this.subs.values())I.projectSlug===r&&I.sessionId===le&&((T=(k=I.handlers).onQueuedFlushed)==null||T.call(k,{text:D}))}return}if(n.type==="chat:killed_task"){const{sessionId:le,summary:D,timestamp:I}=n.payload;if(le)for(const W of this.subs.values())W.projectSlug===r&&W.sessionId===le&&((d=(m=W.handlers).onKilledTask)==null||d.call(m,{summary:D??"",timestamp:I??""}));return}const{sessionId:l,jobId:o}=n.payload,i=this.route(r,l);if(!i)return;const a={sessionId:l,jobId:o},s=n.payload.seq;switch(typeof s=="number"&&s>i.lastSeq&&(i.lastSeq=s),i.turnActive=n.type!=="chat:complete",n.type){case"chat:response":(S=(g=i.handlers).onResponse)==null||S.call(g,n.payload.chunk,a);break;case"chat:tool_call":(_=(P=i.handlers).onToolCall)==null||_.call(P,{toolName:n.payload.toolName,inputSummary:n.payload.inputSummary,output:n.payload.output,isError:n.payload.isError,durationMs:n.payload.durationMs,toolUseId:n.payload.toolUseId,subagentType:n.payload.subagentType,description:n.payload.description,hasSubagent:n.payload.hasSubagent},a);break;case"chat:tool_start":(y=(L=i.handlers).onToolStart)==null||y.call(L,{toolName:n.payload.toolName,inputSummary:n.payload.inputSummary,toolUseId:n.payload.toolUseId,output:"",isError:!1,pending:!0,subagentType:n.payload.subagentType,description:n.payload.description,hasSubagent:n.payload.hasSubagent},a);break;case"chat:message_boundary":(O=(F=i.handlers).onMessageBoundary)==null||O.call(F,a);break;case"chat:injected":(te=(Q=i.handlers).onInjected)==null||te.call(Q,{sender:n.payload.sender,content:n.payload.content,timestamp:n.payload.timestamp},a);break;case"chat:notice":(se=(pe=i.handlers).onNotice)==null||se.call(pe,n.payload.notice,a);break;case"chat:complete":(Ke=(et=i.handlers).onComplete)==null||Ke.call(et,{...a,success:n.payload.success,error:n.payload.error,model:n.payload.model,usage:n.payload.usage});break}}}const Ny=new Py,Fa="paddock:lastSeen:",mn=new Map,$a="paddock:lastSeen-changed";function Ry(e){return Fa+e}function Vs(e){try{window.dispatchEvent(new CustomEvent($a,{detail:{sessionId:e}}))}catch{}}function _y(e){return mn.get(e)??0}function Ch(e,t){!t||!Number.isFinite(t)||t<=(mn.get(e)??0)||(mn.set(e,t),Vs(e))}function E0(e,t=Date.now()){const n=mn.get(e)??0;return t<=n||(mn.set(e,t),Vs(e)),n}function C0(e,t,n){mn.get(e)===n&&(t?mn.set(e,t):mn.delete(e),Vs(e))}function Ty(){const e=new Map;try{for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);if(!n||!n.startsWith(Fa))continue;const r=Number(localStorage.getItem(n));Number.isFinite(r)&&r>0&&e.set(n.slice(Fa.length),r)}}catch{}return e}function Ly(e){for(const t of e)try{localStorage.removeItem(Ry(t))}catch{}}const My=4;let Ic=!1;async function Dy(e){if(Ic)return;const t=Ty();if(t.size===0)return;const n=new Map;for(const u of e)for(const f of u.chatTurns??[])t.has(f.sessionId)&&n.set(f.sessionId,{slug:u.slug,serverLastSeen:f.lastSeen??0});if(n.size===0)return;Ic=!0;const r=[...n].filter(([u,{serverLastSeen:f}])=>t.get(u)>f).map(([u,{slug:f}])=>({sid:u,slug:f,when:t.get(u)})),l=[];let o=0;const i=async()=>{for(;o<r.length;){const u=r[o++];try{await Bs.markChatSeen(u.slug,u.sid,u.when),Ch(u.sid,u.when),l.push(u.sid)}catch{}}};await Promise.all(Array.from({length:Math.min(My,r.length)},()=>i()));const a=new Set(r.map(u=>u.sid)),s=[...n.keys()].filter(u=>!a.has(u));Ly([...l,...s])}function Iy({tag:e,className:t=""}){const n=si();return h.jsx("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),n(`/tags/${encodeURIComponent(e)}`)},title:`Show projects tagged ${e}`,className:`tag relative z-10 transition-colors hover:bg-paddock-300/70 dark:hover:bg-paddock-700 ${t}`,children:e})}function G(e){return{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",...e}}const Oy=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M12 5v14M5 12h14"})}),j0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),zy=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M3 10.5 12 3l9 7.5"}),h.jsx("path",{d:"M5 9.5V20a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9.5"})]}),P0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),N0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"11",cy:"11",r:"7"}),h.jsx("path",{d:"m21 21-4.3-4.3"})]}),R0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M4 5h16"}),h.jsx("path",{d:"M8 5v6h12"}),h.jsx("path",{d:"M8 11v6h12"})]}),_0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),Uy=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"})}),T0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"m22 2-7 20-4-9-9-4Z"}),h.jsx("path",{d:"M22 2 11 13"})]}),L0=e=>h.jsx("svg",{...G(e),children:h.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),M0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),h.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),h.jsx("path",{d:"M12 17v4M8 21h8"})]}),D0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"m9 18 6-6-6-6"})}),I0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2-2 2.6-2.6Z"})}),Fy=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"12",cy:"12",r:"3"}),h.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z"})]}),O0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"}),h.jsx("path",{d:"M12 9v4M12 17h.01"})]}),z0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M5.6 18.4l2.8-2.8M15.6 8.4l2.8-2.8"})}),jh=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),U0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M13 2 4.5 13.5H11l-1 8.5 8.5-11.5H12z"})}),F0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M6 4.5v15l13-7.5z"})}),$y=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M3 6h18M3 12h18M3 18h18"})}),$0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M12 7v5l3 2"})]}),A0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"12",cy:"5",r:"1"}),h.jsx("circle",{cx:"12",cy:"12",r:"1"}),h.jsx("circle",{cx:"12",cy:"19",r:"1"})]}),B0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M10 11v6M14 11v6"})}),W0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M12 20h9"}),h.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),V0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),h.jsx("path",{d:"M14 2v6h6"})]}),H0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M12 17v5"}),h.jsx("path",{d:"M9 10.76V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v6.76a2 2 0 0 0 .59 1.42l1.12 1.12A1 1 0 0 1 17 15H7a1 1 0 0 1-.71-1.7l1.12-1.12A2 2 0 0 0 9 10.76Z"})]}),Q0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M20 6 9 17l-5-5"})}),K0=({open:e,...t})=>e?h.jsxs("svg",{...G(t),children:[h.jsx("path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z"}),h.jsx("path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10"})]}):h.jsxs("svg",{...G(t),children:[h.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),h.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),b0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"6",cy:"6",r:"3"}),h.jsx("circle",{cx:"6",cy:"18",r:"3"}),h.jsx("circle",{cx:"18",cy:"6",r:"3"}),h.jsx("path",{d:"M6 9v6M18 9a9 9 0 0 1-9 9"})]}),J0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M9.5 14.5l-1.7 1.7a4 4 0 0 1-5.66-5.66l1.7-1.7"}),h.jsx("path",{d:"M14.5 9.5l1.7-1.7a4 4 0 0 1 5.66 5.66l-1.7 1.7"}),h.jsx("path",{d:"M8 3.5v2M3.5 8h2M16 20.5v-2M20.5 16h-2"})]}),Y0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),h.jsx("path",{d:"M17 8l-5-5-5 5M12 3v12"})]}),G0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M4 17l6-5-6-5M12 19h8"})}),X0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.9a3.4 3.4 0 0 0-1-2.6c3-.3 6.2-1.5 6.2-6.6a5.2 5.2 0 0 0-1.4-3.6 4.8 4.8 0 0 0-.1-3.6s-1.1-.3-3.7 1.4a12.6 12.6 0 0 0-6.6 0C6.5 1.3 5.4 1.6 5.4 1.6a4.8 4.8 0 0 0-.1 3.6 5.2 5.2 0 0 0-1.4 3.6c0 5.1 3.2 6.3 6.2 6.6a3.4 3.4 0 0 0-1 2.6V22"})}),Ay=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"12",cy:"12",r:"4"}),h.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),By=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})}),Wy=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.5 1.5"}),h.jsx("path",{d:"M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.5-1.5"})]}),Z0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"m6 9 6 6 6-6"})}),q0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("rect",{x:"3",y:"4",width:"18",height:"4",rx:"1"}),h.jsx("path",{d:"M5 8v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V8"}),h.jsx("path",{d:"M10 12h4"})]}),e1=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M12 2.5l2.9 5.88 6.49.94-4.7 4.58 1.11 6.46L12 17.8l-5.8 3.05 1.11-6.46-4.7-4.58 6.49-.94z"})}),Vy=["idea","active","paused","blocked","done"];function Hy({open:e,onClose:t,onCreated:n}){const[r,l]=C.useState(""),[o,i]=C.useState(""),[a,s]=C.useState(""),[u,f]=C.useState(""),[c,p]=C.useState("active"),[x,E]=C.useState(""),[k,T]=C.useState(!1),[m,d]=C.useState(null);if(C.useEffect(()=>{e&&(l(""),i(""),s(""),f(""),p("active"),E(""),d(null))},[e]),C.useEffect(()=>{const S=P=>{P.key==="Escape"&&e&&!k&&t()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e,k,t]),!e)return null;const g=async S=>{if(S.preventDefault(),!!r.trim()){T(!0),d(null);try{const P=await Bs.createProject({name:r.trim(),status:c,group:u||void 0,summary:o.trim()||void 0,repo:x.trim()||void 0,domain:a.split(",").map(_=>_.trim()).filter(Boolean)});n(P)}catch(P){d(P instanceof xl?P.message:"Failed to create project")}finally{T(!1)}}};return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 backdrop-blur-sm",onClick:()=>!k&&t(),children:h.jsxs("form",{className:"w-full max-w-md animate-scale-in rounded-2xl border border-paddock-200 bg-white p-6 shadow-2xl dark:border-paddock-800 dark:bg-paddock-900",onClick:S=>S.stopPropagation(),onSubmit:g,children:[h.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[h.jsx("h2",{className:"text-lg font-semibold",children:"New project"}),h.jsx("button",{type:"button",onClick:t,className:"rounded-lg p-1 text-paddock-400 hover:bg-paddock-100 hover:text-paddock-600 dark:hover:bg-paddock-800","aria-label":"Close",children:h.jsx(jh,{width:18,height:18})})]}),h.jsxs("label",{className:"mb-4 block",children:[h.jsx("span",{className:"field-label",children:"Name"}),h.jsx("input",{autoFocus:!0,className:"input",value:r,onChange:S=>l(S.target.value),placeholder:"Garage Water Heater Replacement"})]}),h.jsxs("label",{className:"mb-4 block",children:[h.jsx("span",{className:"field-label",children:"Summary (optional)"}),h.jsx("input",{className:"input",value:o,onChange:S=>i(S.target.value),placeholder:"One line on what this project is about"})]}),h.jsxs("label",{className:"mb-4 block",children:[h.jsx("span",{className:"field-label",children:"Area"}),h.jsxs("select",{className:"input",value:u,onChange:S=>f(S.target.value),children:[h.jsx("option",{value:"",children:"Unsorted"}),Ws.map(S=>h.jsx("option",{value:S.slug,children:S.label},S.slug))]})]}),h.jsxs("label",{className:"mb-4 block",children:[h.jsx("span",{className:"field-label",children:"Git repository URL (optional)"}),h.jsx("input",{className:"input",value:x,onChange:S=>E(S.target.value),placeholder:"https://github.com/owner/repo.git"}),h.jsx("span",{className:"mt-1 block text-xs text-paddock-400 dark:text-paddock-500",children:"Link an external repo and Paddock clones it as the project's working directory — the repo's own CLAUDE.md, branches & PR flow apply. Leave blank for a notebook project."})]}),h.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3",children:[h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"field-label",children:"Domain tags"}),h.jsx("input",{className:"input",value:a,onChange:S=>s(S.target.value),placeholder:"home, plumbing"})]}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"field-label",children:"Status"}),h.jsx("select",{className:"input capitalize",value:c,onChange:S=>p(S.target.value),children:Vy.map(S=>h.jsx("option",{value:S,className:"capitalize",children:S},S))})]})]}),m&&h.jsx("p",{className:"mb-4 rounded-lg bg-rose-50 px-3 py-2 text-sm text-rose-600 dark:bg-rose-950/40 dark:text-rose-300",children:m}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{type:"button",className:"btn-ghost",onClick:t,disabled:k,children:"Cancel"}),h.jsx("button",{type:"submit",className:"btn-primary",disabled:k||!r.trim(),children:k?"Creating…":"Create project"})]})]})})}function Oc(e){if(typeof window>"u"||typeof window.matchMedia!="function")return null;try{return window.matchMedia(e)??null}catch{return null}}function Qy(e){const[t,n]=C.useState(()=>{var r;return((r=Oc(e))==null?void 0:r.matches)??!1});return C.useEffect(()=>{var o;const r=Oc(e);if(!r)return;const l=()=>n(!!r.matches);return l(),typeof r.addEventListener=="function"?(r.addEventListener("change",l),()=>r.removeEventListener("change",l)):((o=r.addListener)==null||o.call(r,l),()=>{var i;return(i=r.removeListener)==null?void 0:i.call(r,l)})},[e]),t}const Hs="paddock:panewidth:",Ky={key:"sidenav",def:288,min:200,max:480},t1={key:"chatlist",def:256,min:220,max:520},by="(min-width: 1024px)";function pr(e,t){return Math.min(Math.max(t,e.min),e.max)}function zc(e,t,n){return pr(n,e+t)}function Jy(e){try{const t=localStorage.getItem(Hs+e.key);if(t==null)return null;const n=Number.parseFloat(t);return Number.isFinite(n)?pr(e,n):null}catch{return null}}function Yy(e,t){try{localStorage.setItem(Hs+e.key,String(pr(e,t)))}catch{}}function Gy(e){try{localStorage.removeItem(Hs+e.key)}catch{}}function Xy(e){const t=Qy(by),[n,r]=C.useState(()=>Jy(e)),l=pr(e,n??e.def);return{isDesktop:t,width:l,style:t?{width:l}:void 0,preview:o=>r(pr(e,o)),commit:o=>{const i=pr(e,o);r(i),Yy(e,i)},reset:()=>{r(null),Gy(e)},spec:e}}function Zy({spec:e,width:t,onPreview:n,onCommit:r,onReset:l,label:o}){const i=C.useRef(null),a=C.useRef(t);a.current=t;const s=16;return h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":Math.round(t),"aria-valuemin":e.min,"aria-valuemax":e.max,tabIndex:0,onPointerDown:u=>{i.current={startX:u.clientX,startWidth:t},u.currentTarget.setPointerCapture(u.pointerId)},onPointerMove:u=>{i.current&&n(zc(i.current.startWidth,u.clientX-i.current.startX,e))},onPointerUp:u=>{if(i.current){i.current=null;try{u.currentTarget.releasePointerCapture(u.pointerId)}catch{}r(a.current)}},onDoubleClick:l,onKeyDown:u=>{if(u.key==="ArrowLeft"||u.key==="ArrowRight"){u.preventDefault();const f=zc(t,u.key==="ArrowRight"?s:-s,e);n(f),r(f)}},title:"Drag to resize · double-click to reset",className:"group/resizer absolute inset-y-0 right-0 z-10 hidden w-1.5 -mr-0.5 cursor-ew-resize touch-none lg:block",children:h.jsx("span",{className:"absolute inset-y-0 right-0 w-px bg-paddock-200 transition group-hover/resizer:w-0.5 group-hover/resizer:bg-accent group-focus/resizer:w-0.5 group-focus/resizer:bg-accent dark:bg-paddock-800"})})}function qy(e){const[t,n]=C.useState(new Map),r=C.useRef(new Map),[l,o]=C.useState(0);return C.useEffect(()=>{const i=r.current;for(const a of e)for(const s of a.chatTurns??[]){Ch(s.sessionId,s.lastSeen);const u=Date.parse(s.lastTurnCompletedAt);if(!Number.isFinite(u))continue;const f=i.get(s.sessionId);!f||u>f.at?i.set(s.sessionId,{slug:a.slug,at:u,unread:s.unread}):f.unread=s.unread}o(a=>a+1),Dy(e).catch(()=>{})},[e]),C.useEffect(()=>{const i=new Map;return Ny.onActiveInfos(a=>{for(const[s,u]of i)a.has(s)||r.current.set(s,{slug:u,at:Date.now()});i.clear();for(const[s,u]of a)i.set(s,u);n(new Map(a)),o(s=>s+1)})},[]),C.useEffect(()=>{const i=()=>o(a=>a+1);return window.addEventListener($a,i),()=>window.removeEventListener($a,i)},[]),C.useMemo(()=>{const i=new Map,a=s=>{let u=i.get(s);return u||(u={unread:0,inflight:0},i.set(s,u)),u};for(const[s,{slug:u,at:f,unread:c}]of r.current)!t.has(s)&&(c||f>_y(s))&&(a(u).unread+=1);for(const s of t.values())a(s).inflight+=1;return i},[t,l])}function e0(){const{projects:e,rootWorkspace:t,loading:n,upsert:r}=fy(),{dark:l,toggle:o}=my(),[i,a]=C.useState(!1),[s,u]=C.useState(!1),f=si(),c=Wn(),p=yy(),x=wy(),E=Xy(Ky),k=c.pathname==="/"||c.pathname==="/projects"||c.pathname.startsWith("/chat"),T=c.pathname.startsWith("/projects/")||k;C.useEffect(()=>{a(!1)},[c.pathname]),C.useEffect(()=>{document.title=p.name},[p.name]);const m=C.useMemo(()=>{const P=new Map;for(const _ of e){const L=_.group??"",y=P.get(L);y?y.push(_):P.set(L,[_])}return ky(P.keys()).map(_=>[_,P.get(_)??[]])},[e]),d=C.useMemo(()=>t?[...e,t]:e,[e,t]),g=qy(d),S=g.get(wh);return h.jsxs("div",{className:"flex h-[100dvh] flex-col overflow-hidden bg-canvas dark:bg-canvas-dark lg:flex-row",children:[!T&&h.jsxs("header",{className:"pt-safe flex items-center gap-2 border-b border-paddock-200 px-3 pb-2 dark:border-paddock-800 lg:hidden",children:[h.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":"Open menu",className:"btn-subtle -ml-1 px-2 py-2",children:h.jsx($y,{width:20,height:20})}),h.jsxs(bn,{to:"/",className:"flex items-center gap-2",children:[h.jsx(Uc,{brand:p,className:"h-7 w-7 text-sm"}),h.jsx("span",{className:"text-[15px] font-semibold tracking-tight",children:p.name})]})]}),i&&h.jsx("div",{className:"fixed inset-0 z-30 bg-black/40 backdrop-blur-sm lg:hidden","aria-hidden":"true",onClick:()=>a(!1)}),h.jsxs("aside",{style:E.style,className:`fixed inset-y-0 left-0 z-40 flex w-72 max-w-[85%] shrink-0 flex-col border-r border-paddock-200 bg-canvas shadow-2xl transition-transform duration-200 ease-out dark:border-paddock-800 dark:bg-paddock-900 lg:relative lg:z-auto lg:max-w-none lg:translate-x-0 lg:bg-white/50 lg:shadow-none dark:lg:bg-paddock-900/30 ${i?"translate-x-0":"-translate-x-full"}`,children:[E.isDesktop&&h.jsx(Zy,{spec:E.spec,width:E.width,onPreview:E.preview,onCommit:E.commit,onReset:E.reset,label:"Resize sidebar"}),h.jsxs("div",{className:"flex items-center gap-2 px-5 py-4",children:[h.jsxs(bn,{to:"/",className:"group flex items-center gap-2",children:[h.jsx(Uc,{brand:p,className:"h-8 w-8 text-base"}),h.jsx("span",{className:"text-[17px] font-semibold tracking-tight",children:p.name})]}),h.jsx("button",{type:"button",onClick:()=>a(!1),"aria-label":"Close menu",className:"btn-subtle ml-auto px-2 py-2 lg:hidden",children:h.jsx(jh,{width:18,height:18})})]}),h.jsx("div",{className:"px-3 pb-1",children:h.jsxs(bn,{to:"/",end:!0,className:({isActive:P})=>`btn-subtle w-full justify-start ${P?"bg-paddock-200/80 dark:bg-paddock-800":""}`,title:"The root workspace — every project, and the instance's own chats",children:[h.jsx(zy,{width:16,height:16}),"Home",h.jsx(Ph,{badge:S,className:"ml-auto"})]})}),h.jsxs("div",{className:"mt-5 mb-1 flex items-center justify-between pr-3",children:[h.jsx(bn,{to:uy(),className:"section-label hover:text-accent",children:"Projects"}),h.jsx("button",{type:"button",onClick:()=>u(!0),"aria-label":"New Project",title:"New Project",className:"btn-subtle -mr-1 px-1.5 py-1 text-paddock-400 hover:text-accent",children:h.jsx(Oy,{width:14,height:14})})]}),h.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 pb-4",children:[n&&h.jsx("div",{className:"space-y-2 px-2 py-2",children:[0,1,2].map(P=>h.jsx("div",{className:"h-10 animate-pulse rounded-lg bg-paddock-200/60 dark:bg-paddock-800/50"},P))}),!n&&e.length===0&&h.jsx("p",{className:"px-3 py-2 text-sm text-paddock-500",children:"No projects yet."}),!n&&e.length>0&&m.map(([P,_])=>h.jsxs("div",{className:"mb-2",children:[m.length>1&&h.jsx("div",{className:"px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-paddock-400",children:Sy(P)}),_.map(L=>h.jsx(n0,{project:L,badge:g.get(L.slug)},L.slug))]},P||"unsorted"))]}),h.jsxs("div",{className:"border-t border-paddock-200 px-3 py-3 dark:border-paddock-800",children:[h.jsxs(bn,{to:"/config",className:({isActive:P})=>`btn-subtle w-full justify-start ${P?"bg-paddock-200/80 dark:bg-paddock-800":""}`,title:"Instance config — paddock.config.yaml (restart required)",children:[h.jsx(Fy,{width:15,height:15}),"Config"]}),x.enabled&&h.jsxs("a",{href:x.path,target:"_blank",rel:"noreferrer",className:"btn-subtle mt-1 w-full justify-start",title:"OpenAPI / Swagger reference (opens in a new tab)",children:[h.jsx(Wy,{width:15,height:15}),"Swagger API"]}),h.jsxs("button",{type:"button",onClick:o,className:"btn-subtle mt-1 w-full justify-start","aria-label":l?"Switch to light mode":"Switch to dark mode",title:"Toggle light / dark theme",children:[l?h.jsx(Ay,{width:15,height:15}):h.jsx(By,{width:15,height:15}),l?"Light mode":"Dark mode"]}),h.jsxs("p",{className:"mt-2 px-2 text-[11px] text-paddock-400",children:["v","0.59.0"]})]})]}),h.jsx("main",{className:"min-w-0 flex-1 overflow-hidden",children:h.jsx(C.Suspense,{fallback:h.jsx(t0,{}),children:h.jsx(Fg,{context:{openNav:()=>a(!0)}})})}),h.jsx(Hy,{open:s,onClose:()=>u(!1),onCreated:P=>{r(P),u(!1),f(`/projects/${P.slug}/chat`)}})]})}function Uc({brand:e,className:t=""}){return h.jsx("span",{className:`flex shrink-0 items-center justify-center overflow-hidden rounded-lg bg-accent text-white shadow-sm ${t}`,children:xy(e.logo)?h.jsx("img",{src:e.logo,alt:"",className:"h-full w-full object-cover"}):e.logo})}function t0(){return h.jsxs("div",{className:"flex h-full items-center justify-center","aria-busy":"true","aria-live":"polite",children:[h.jsx("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-paddock-300 border-t-accent dark:border-paddock-700 dark:border-t-accent"}),h.jsx("span",{className:"sr-only",children:"Loading…"})]})}function n0({project:e,badge:t}){return h.jsxs(bn,{to:`/projects/${e.slug}`,className:({isActive:n})=>`group mb-0.5 flex flex-col gap-1 rounded-lg px-2.5 py-2 text-sm transition-colors ${n?"bg-paddock-200/80 dark:bg-paddock-800":"hover:bg-paddock-200/50 dark:hover:bg-paddock-800/50"}`,children:[h.jsxs("span",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx(Uy,{width:13,height:13,className:"shrink-0 text-paddock-400 group-hover:text-paddock-500"}),h.jsx("span",{className:"truncate font-medium",children:e.name})]}),h.jsx(Ph,{badge:t})]}),e.domain.length>0&&h.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden pl-[18px]",children:[e.domain.slice(0,2).map(n=>h.jsx(Iy,{tag:n,className:"max-w-[7rem] truncate"},n)),e.domain.length>2&&h.jsxs("span",{className:"shrink-0 text-[11px] text-paddock-400",children:["+",e.domain.length-2]})]})]})}function Ph({badge:e,className:t=""}){const n=(e==null?void 0:e.unread)??0,r=(e==null?void 0:e.inflight)??0;return n===0&&r===0?null:h.jsxs("span",{className:`flex shrink-0 items-center gap-1.5 ${t}`,children:[r>0&&h.jsxs("span",{className:"flex items-center gap-1 text-[11px] tabular-nums text-paddock-500 dark:text-paddock-400",title:`${r} chat${r===1?"":"s"} in flight`,"aria-label":`${r} chat${r===1?"":"s"} in flight`,children:[h.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 spin-eco rounded-full border-[1.5px] border-paddock-400 border-t-transparent dark:border-paddock-500 dark:border-t-transparent"}),r]}),n>0&&h.jsx("span",{className:"inline-flex min-w-[1.1rem] items-center justify-center rounded-full bg-accent px-1.5 py-0.5 text-[11px] font-semibold leading-none tabular-nums text-white",title:`${n} unread ${n===1?"reply":"replies"}`,"aria-label":`${n} unread ${n===1?"reply":"replies"}`,children:n})]})}const Nh="paddock:chunkReloadAt",r0=1e4,Fc=/dynamically imported module|module script|importing a module|failed to fetch|unable to preload|load failed|error loading/i;function l0(e){return e?e instanceof Error?e.name==="ChunkLoadError"?!0:Fc.test(e.message):Fc.test(String(e)):!1}function Qs(){try{return typeof sessionStorage<"u"?sessionStorage:void 0}catch{return}}function o0(e=Date.now(),t=Qs()){if(!t)return!1;const n=t.getItem(Nh);if(!n)return!1;const r=Number(n);return Number.isFinite(r)&&e-r<r0}function i0(e=Date.now(),t=Qs()){try{t==null||t.setItem(Nh,String(e))}catch{}}function a0(e,t=Date.now(),n=Qs()){return l0(e)&&!o0(t,n)?"reload":"show"}function s0(){const e=vh(),t=a0(e);if(C.useEffect(()=>{t==="reload"&&(i0(),window.location.reload())},[t]),t==="reload")return h.jsxs("div",{className:"flex h-[100dvh] items-center justify-center bg-canvas dark:bg-canvas-dark","aria-busy":"true","aria-live":"polite",children:[h.jsx("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-paddock-300 border-t-accent dark:border-paddock-700 dark:border-t-accent"}),h.jsx("span",{className:"sr-only",children:"Updating…"})]});const n=e instanceof Error?e.message:typeof e=="string"?e:"";return h.jsxs("div",{className:"flex h-[100dvh] flex-col items-center justify-center gap-4 bg-canvas px-6 text-center dark:bg-canvas-dark",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"Something went wrong"}),h.jsx("p",{className:"mt-1 max-w-md text-sm text-paddock-500 dark:text-paddock-400",children:"The app hit an unexpected error. Reloading usually fixes it."}),n?h.jsx("p",{className:"mt-2 max-w-md break-words font-mono text-[11px] text-paddock-400",children:n}):null]}),h.jsx("button",{className:"btn-primary",onClick:()=>window.location.reload(),children:"Reload"})]})}function u0(){typeof navigator>"u"||!("serviceWorker"in navigator)||window.addEventListener("load",()=>{const e=navigator.serviceWorker,t=!!e.controller;let n=!1;e.addEventListener("controllerchange",()=>{n||!t||(n=!0,window.location.reload())}),e.register("/sw.js").catch(()=>{})})}const Rh=C.lazy(()=>Sl(()=>import("./ProjectsGrid-Bf2cx9-Z.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ProjectsGrid}))),ke=C.lazy(()=>Sl(()=>import("./ProjectView-CvD9WQsW.js").then(e=>e.P),__vite__mapDeps([2,1,3,4])).then(e=>({default:e.ProjectView}))),c0=C.lazy(()=>Sl(()=>import("./ProjectRedirect-DWcMpdZJ.js"),__vite__mapDeps([5,4])).then(e=>({default:e.ProjectRedirect}))),d0=C.lazy(()=>Sl(()=>import("./InstanceConfigPage-Cli_WHsM.js"),[]).then(e=>({default:e.InstanceConfigPage}))),_h=()=>document.documentElement.setAttribute("data-tab-hidden",document.hidden?"true":"false");document.addEventListener("visibilitychange",_h);_h();function f0(){const{tag:e}=Pg();return h.jsx(Rh,{filterTag:e?decodeURIComponent(e):void 0})}const h0=Kg([{path:"/",element:h.jsx(e0,{}),errorElement:h.jsx(s0,{}),children:[{index:!0,element:h.jsx(ke,{root:!0})},{path:"projects",element:h.jsx(Rh,{})},{path:"tags/:tag",element:h.jsx(f0,{})},{path:"projects/:slug",element:h.jsx(c0,{})},{path:"projects/:slug/home",element:h.jsx(ke,{})},{path:"projects/:slug/chat",element:h.jsx(ke,{})},{path:"projects/:slug/chat/:sessionId",element:h.jsx(ke,{})},{path:"projects/:slug/files",element:h.jsx(ke,{})},{path:"projects/:slug/files/*",element:h.jsx(ke,{})},{path:"projects/:slug/changes",element:h.jsx(ke,{})},{path:"projects/:slug/changes/:file",element:h.jsx(ke,{})},{path:"projects/:slug/history",element:h.jsx(ke,{})},{path:"projects/:slug/settings",element:h.jsx(ke,{})},{path:"projects/:slug/triggers",element:h.jsx(ke,{})},{path:"projects/:slug/hooks",element:h.jsx(ke,{})},{path:"chat",element:h.jsx(ke,{root:!0})},{path:"chat/:sessionId",element:h.jsx(ke,{root:!0})},{path:"files",element:h.jsx(ke,{root:!0})},{path:"files/*",element:h.jsx(ke,{root:!0})},{path:"changes",element:h.jsx(ke,{root:!0})},{path:"changes/:file",element:h.jsx(ke,{root:!0})},{path:"history",element:h.jsx(ke,{root:!0})},{path:"triggers",element:h.jsx(ke,{root:!0})},{path:"settings",element:h.jsx(ke,{root:!0})},{path:"config",element:h.jsx(d0,{})}]}]);Wi.createRoot(document.getElementById("root")).render(h.jsx(Xc.StrictMode,{children:h.jsx(dy,{children:h.jsx(ey,{router:h0})})}));u0();export{Zy as $,O0 as A,b0 as B,P0 as C,T0 as D,Uy as E,V0 as F,Is as G,N0 as H,Ny as I,j0 as J,X0 as K,oy as L,$y as M,Hy as N,G0 as O,Oy as P,H0 as Q,Ws as R,z0 as S,Iy as T,Y0 as U,F0 as V,I0 as W,jh as X,_0 as Y,R0 as Z,Sl as _,si as a,Z0 as a0,J0 as a1,q0 as a2,K0 as a3,e1 as a4,E0 as a5,C0 as a6,Ch as a7,_y as a8,wh as a9,Wn as aa,w0 as ab,x0 as ac,Xy as ad,y0 as ae,g0 as af,S0 as ag,t1 as ah,Bs as b,$0 as c,k0 as d,Sy as e,D0 as f,uy as g,Pg as h,v0 as i,h as j,Q0 as k,xl as l,m0 as m,Fy as n,ky as o,Ac as p,A0 as q,C as r,W0 as s,B0 as t,fy as u,p0 as v,M0 as w,L0 as x,U0 as y,Wy as z};
|
|
70
|
+
*/function Er(){return Er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Er.apply(this,arguments)}function gh(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,o;for(o=0;o<r.length;o++)l=r[o],!(t.indexOf(l)>=0)&&(n[l]=e[l]);return n}function Bg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wg(e,t){return e.button===0&&(!t||t==="_self")&&!Bg(e)}const Vg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Hg=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],Qg="6";try{window.__reactRouterVersion=Qg}catch{}function Kg(e,t){return eg({basename:void 0,future:Er({},void 0,{v7_prependBasename:!0}),history:Cv({window:void 0}),hydrationData:bg(),routes:e,mapRouteProperties:Ag,unstable_dataStrategy:void 0,unstable_patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function bg(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Er({},t,{errors:Jg(t.errors)})),t}function Jg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,l]of t)if(l&&l.__type==="RouteErrorResponse")n[r]=new Bo(l.status,l.statusText,l.data,l.internal===!0);else if(l&&l.__type==="Error"){if(l.__subType){let o=window[l.__subType];if(typeof o=="function")try{let i=new o(l.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(l.message);o.stack="",n[r]=o}}else n[r]=l;return n}const yh=C.createContext({isTransitioning:!1}),Yg=C.createContext(new Map),Gg="startTransition",Tc=dp[Gg],Xg="flushSync",Lc=Ev[Xg];function Zg(e){Tc?Tc(e):e()}function Ar(e){Lc?Lc(e):e()}class qg{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function ey(e){let{fallbackElement:t,router:n,future:r}=e,[l,o]=C.useState(n.state),[i,a]=C.useState(),[s,u]=C.useState({isTransitioning:!1}),[f,c]=C.useState(),[p,x]=C.useState(),[E,k]=C.useState(),T=C.useRef(new Map),{v7_startTransition:m}=r||{},d=C.useCallback(y=>{m?Zg(y):y()},[m]),g=C.useCallback((y,F)=>{let{deletedFetchers:O,unstable_flushSync:Q,unstable_viewTransitionOpts:te}=F;O.forEach(se=>T.current.delete(se)),y.fetchers.forEach((se,et)=>{se.data!==void 0&&T.current.set(et,se.data)});let pe=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!te||pe){Q?Ar(()=>o(y)):d(()=>o(y));return}if(Q){Ar(()=>{p&&(f&&f.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:te.currentLocation,nextLocation:te.nextLocation})});let se=n.window.document.startViewTransition(()=>{Ar(()=>o(y))});se.finished.finally(()=>{Ar(()=>{c(void 0),x(void 0),a(void 0),u({isTransitioning:!1})})}),Ar(()=>x(se));return}p?(f&&f.resolve(),p.skipTransition(),k({state:y,currentLocation:te.currentLocation,nextLocation:te.nextLocation})):(a(y),u({isTransitioning:!0,flushSync:!1,currentLocation:te.currentLocation,nextLocation:te.nextLocation}))},[n.window,p,f,T,d]);C.useLayoutEffect(()=>n.subscribe(g),[n,g]),C.useEffect(()=>{s.isTransitioning&&!s.flushSync&&c(new qg)},[s]),C.useEffect(()=>{if(f&&i&&n.window){let y=i,F=f.promise,O=n.window.document.startViewTransition(async()=>{d(()=>o(y)),await F});O.finished.finally(()=>{c(void 0),x(void 0),a(void 0),u({isTransitioning:!1})}),x(O)}},[d,i,f,n.window]),C.useEffect(()=>{f&&i&&l.location.key===i.location.key&&f.resolve()},[f,p,l.location,i]),C.useEffect(()=>{!s.isTransitioning&&E&&(a(E.state),u({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),k(void 0))},[s.isTransitioning,E]),C.useEffect(()=>{},[]);let S=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:y=>n.navigate(y),push:(y,F,O)=>n.navigate(y,{state:F,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(y,F,O)=>n.navigate(y,{replace:!0,state:F,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),P=n.basename||"/",_=C.useMemo(()=>({router:n,navigator:S,static:!1,basename:P}),[n,S,P]),L=C.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return C.createElement(C.Fragment,null,C.createElement(Nl.Provider,{value:_},C.createElement(Fs.Provider,{value:l},C.createElement(Yg.Provider,{value:T.current},C.createElement(yh.Provider,{value:s},C.createElement($g,{basename:P,location:l.location,navigationType:l.historyAction,navigator:S,future:L},l.initialized||n.future.v7_partialHydration?C.createElement(ty,{routes:n.routes,future:n.future,state:l}):t))))),null)}const ty=C.memo(ny);function ny(e){let{routes:t,future:n,state:r}=e;return Ng(t,void 0,r,n)}const ry=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ly=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oy=C.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:o,replace:i,state:a,target:s,to:u,preventScrollReset:f,unstable_viewTransition:c}=t,p=gh(t,Vg),{basename:x}=C.useContext(bt),E,k=!1;if(typeof u=="string"&&ly.test(u)&&(E=u,ry))try{let g=new URL(window.location.href),S=u.startsWith("//")?new URL(g.protocol+u):new URL(u),P=Qt(S.pathname,x);S.origin===g.origin&&P!=null?u=P+S.search+S.hash:k=!0}catch{}let T=Eg(u,{relative:l}),m=ay(u,{replace:i,state:a,target:s,preventScrollReset:f,relative:l,unstable_viewTransition:c});function d(g){r&&r(g),g.defaultPrevented||m(g)}return C.createElement("a",Er({},p,{href:E||T,onClick:k||o?r:d,ref:n,target:s}))}),bn=C.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:o="",end:i=!1,style:a,to:s,unstable_viewTransition:u,children:f}=t,c=gh(t,Hg),p=ui(s,{relative:c.relative}),x=Wn(),E=C.useContext(Fs),{navigator:k,basename:T}=C.useContext(bt),m=E!=null&&sy(p)&&u===!0,d=k.encodeLocation?k.encodeLocation(p).pathname:p.pathname,g=x.pathname,S=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;l||(g=g.toLowerCase(),S=S?S.toLowerCase():null,d=d.toLowerCase()),S&&T&&(S=Qt(S,T)||S);const P=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let _=g===d||!i&&g.startsWith(d)&&g.charAt(P)==="/",L=S!=null&&(S===d||!i&&S.startsWith(d)&&S.charAt(d.length)==="/"),y={isActive:_,isPending:L,isTransitioning:m},F=_?r:void 0,O;typeof o=="function"?O=o(y):O=[o,_?"active":null,L?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let Q=typeof a=="function"?a(y):a;return C.createElement(oy,Er({},c,{"aria-current":F,className:O,ref:n,style:Q,to:s,unstable_viewTransition:u}),typeof f=="function"?f(y):f)});var Ua;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ua||(Ua={}));var Mc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mc||(Mc={}));function iy(e){let t=C.useContext(Nl);return t||Y(!1),t}function ay(e,t){let{target:n,replace:r,state:l,preventScrollReset:o,relative:i,unstable_viewTransition:a}=t===void 0?{}:t,s=si(),u=Wn(),f=ui(e,{relative:i});return C.useCallback(c=>{if(Wg(c,n)){c.preventDefault();let p=r!==void 0?r:$n(u)===$n(f);s(e,{replace:p,state:l,preventScrollReset:o,relative:i,unstable_viewTransition:a})}},[u,s,f,r,l,n,e,o,i,a])}function sy(e,t){t===void 0&&(t={});let n=C.useContext(yh);n==null&&Y(!1);let{basename:r}=iy(Ua.useViewTransitionState),l=ui(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Qt(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Qt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ao(l.pathname,i)!=null||Ao(l.pathname,o)!=null}const wh="";function As(e){return e===wh}function b(e){return As(e)?"/api/root":`/api/projects/${encodeURIComponent(e)}`}function g0(e){return As(e)?"":`/projects/${e}`}function y0(e){return e===""?"/":`${e}/home`}function uy(){return"/projects"}function w0(e,t){const n=e.startsWith(t)?e.slice(t.length):e;return n.startsWith("/files")?"files":n.startsWith("/changes")?"changes":n.startsWith("/history")?"history":n.startsWith("/settings")?"settings":n.startsWith("/triggers")||n.startsWith("/hooks")?"triggers":n.startsWith("/home")?"home":n.startsWith("/chat")?"chat":t===""?"home":"chat"}function x0(e,t){const n=`${t}/files`;if(!e.startsWith(n))return"";const r=e.slice(n.length).replace(/^\//,"");return r?r.split("/").filter(Boolean).map(l=>{try{return decodeURIComponent(l)}catch{return l}}).join("/"):""}function S0(e){if(!e)return"#";const t=e.trim().replace(/\.git$/i,"");if(/^https?:\/\//i.test(t))return t;const n=/^git@([^:]+):(.+)$/.exec(t);if(n)return`https://${n[1]}/${n[2]}`;const r=/^ssh:\/\/git@([^/]+)\/(.+)$/i.exec(t);return r?`https://${r[1]}/${r[2]}`:"#"}const ar="";async function H(e,t){const n=await fetch(`${ar}${e}`,{headers:{"content-type":"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!n.ok){let r=n.statusText;try{const l=await n.json();l.error&&(r=l.error)}catch{}throw new xl(r,n.status)}return await n.json()}async function cy(e,t){const n=await fetch(`${ar}${e}`,t);if(!n.ok){let r=n.statusText;try{const l=JSON.parse(await n.text());l.error&&(r=l.error)}catch{}throw new xl(r,n.status)}return n.text()}class xl extends Error{constructor(t,n){super(t),this.status=n,this.name="ApiError"}}const Bs={async me(){return H("/api/me")},async markChatSeen(e,t,n){const r=`${b(e)}/chats/${encodeURIComponent(t)}/seen`;await H(r,{method:"POST",body:JSON.stringify(n!==void 0?{when:n}:{})})},async markChatUnread(e,t,n){const r=`${b(e)}/chats/${encodeURIComponent(t)}/unread`;await H(r,{method:"POST",body:JSON.stringify({unread:n})})},async projectRuns(e,t){const n=t!==void 0?`?limit=${encodeURIComponent(t)}`:"";return H(`${b(e)}/runs${n}`)},async markRunsSeen(e,t){await H(`${b(e)}/runs/seen`,{method:"POST",body:JSON.stringify(t!==void 0?{when:t}:{})})},async getModels(){return H("/api/models")},async getInstanceConfig(){return H("/api/instance-config")},async updateInstanceConfig(e){return H("/api/instance-config",{method:"PUT",body:JSON.stringify({patch:e})})},async uploadAttachments(e,t,n){const r=new FormData;for(const o of n)r.append("files",o,o.name);const l=await fetch(`${ar}${b(e)}/chats/${encodeURIComponent(t)}/upload`,{method:"POST",body:r});if(!l.ok){let o=l.statusText;try{const i=await l.json();i.error&&(o=i.error)}catch{}throw new xl(o,l.status)}return await l.json()},async projectCommands(e){const{commands:t}=await H(`${b(e)}/commands`);return t},async listProjects(){const{projects:e,root:t}=await H("/api/projects");return{projects:e,root:t??null}},async getProjectDetail(e){return H(`${b(e)}`)},async attentionChats(e){const t=await H(`${b(e)}/chats/attention`);return{running:t.running??[],unread:t.unread??[]}},async createProject(e){const{project:t}=await H("/api/projects",{method:"POST",body:JSON.stringify(e)});return t},async updateProject(e,t){const{project:n}=await H(`${b(e)}`,{method:"PATCH",body:JSON.stringify(t)});return n},async promoteProject(e,t){const{project:n}=await H(`${b(e)}/promote`,{method:"POST",body:JSON.stringify({repo:t})});return n},async deleteProject(e){await H(`${b(e)}`,{method:"DELETE"})},async deleteProjectChat(e,t){await H(`${b(e)}/chats/${encodeURIComponent(t)}`,{method:"DELETE"})},async renameProjectChat(e,t,n){await H(`${b(e)}/chats/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({name:n})})},async archiveProjectChat(e,t,n){await H(`${b(e)}/chats/${encodeURIComponent(t)}/archive`,{method:"POST",body:JSON.stringify({archived:n})})},async starProjectChat(e,t,n){await H(`${b(e)}/chats/${encodeURIComponent(t)}/star`,{method:"POST",body:JSON.stringify({starred:n})})},async archiveProjectChats(e,t,n){await H(`${b(e)}/chats/batch/archive`,{method:"POST",body:JSON.stringify({sessionIds:t,archived:n})})},async markChatsUnread(e,t,n){await H(`${b(e)}/chats/batch/unread`,{method:"POST",body:JSON.stringify({sessionIds:t,unread:n})})},async deleteProjectChats(e,t){const n=await H(`${b(e)}/chats/batch/delete`,{method:"POST",body:JSON.stringify({sessionIds:t})});return{removed:n.removed??[],failed:n.failed??[]}},async detachProjectChat(e,t,n){await H(`${b(e)}/chats/${encodeURIComponent(t)}/detach`,{method:"POST",body:JSON.stringify({detached:n})})},async promoteChat(e,t,n){return H(`${b(e)}/chats/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify(n)})},async forkChat(e,t,n,r){const{sessionId:l}=await H(`${b(e)}/chats/${encodeURIComponent(t)}/fork`,{method:"POST",body:JSON.stringify({name:n,fromUuid:r})});return l},async revertChat(e,t,n){const{removed:r}=await H(`${b(e)}/chats/${encodeURIComponent(t)}/revert`,{method:"POST",body:JSON.stringify({uuid:n})});return r},async listProjectDir(e,t=""){const n=t?`?path=${encodeURIComponent(t)}`:"";return H(`${b(e)}/files${n}`)},async listProjectFiles(e){const{entries:t}=await this.listProjectDir(e);return t.filter(n=>n.kind==="file").map(n=>n.name)},async getProjectFile(e,t){return H(`${b(e)}/files/${encodeURIComponent(t)}`)},projectFileRawUrl(e,t){return`${ar}${b(e)}/files/${encodeURIComponent(t)}?raw=1`},chatFileRawUrl(e){return`${ar}/api/chat-files/${encodeURIComponent(e)}`},async pinFile(e,t){const{project:n}=await H(`${b(e)}/pins`,{method:"PUT",body:JSON.stringify({file:t})});return n},async unpinFile(e,t){const{project:n}=await H(`${b(e)}/pins/${encodeURIComponent(t)}`,{method:"DELETE"});return n},async listProjectChats(e){const{chats:t}=await H(`${b(e)}/chats`);return t},async getAdoptableChats(e){return H(`${b(e)}/adoptable-chats`)},async adoptChats(e,t){return H(`${b(e)}/adopt-chats`,{method:"POST",body:JSON.stringify(t??{})})},async chatUsage(e,t){const n=t?`?scope=${t}`:"",{usage:r}=await H(`${b(e)}/chats/usage${n}`);return r},async projectChatMessages(e,t){const{messages:n}=await H(`${b(e)}/chats/${encodeURIComponent(t)}/messages`);return n},async subagentMessages(e,t,n){const r=`${b(e)}/chats/${encodeURIComponent(t)}`,{messages:l}=await H(`${r}/subagents/${encodeURIComponent(n)}/messages`);return l},async chatContext(e,t){const n=`${b(e)}/chats/${encodeURIComponent(t)}/context`,{usage:r}=await H(n);return r},async listTriggers(e){return H(`${b(e)}/triggers`)},async putTrigger(e,t,n){const{trigger:r}=await H(`${b(e)}/triggers/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(n)});return r},async deleteTrigger(e,t){await H(`${b(e)}/triggers/${encodeURIComponent(t)}`,{method:"DELETE"})},async triggerRuntime(e){return H(`${b(e)}/triggers/runtime`)},async runTrigger(e,t){const{sessionId:n}=await H(`${b(e)}/triggers/${encodeURIComponent(t)}/run`,{method:"POST",body:"{}"});return n},async gitInfo(){return H("/api/git")},async gitStatus(e){return H(`${b(e)}/git/status`)},async gitDiff(e,t){const n=t?`?file=${encodeURIComponent(t)}`:"";return cy(`${b(e)}/git/diff${n}`)},async gitCommit(e,t,n){return H(`${b(e)}/git/commit`,{method:"POST",body:JSON.stringify(n?{message:t,files:n}:{message:t})})},async gitPush(){return H("/api/git/push",{method:"POST"})},async githubConnect(){return H("/api/git/github/connect",{method:"POST"})},async githubPoll(e){return H("/api/git/github/poll",{method:"POST",body:JSON.stringify({deviceCode:e})})},async githubDisconnect(){await H("/api/git/github/disconnect",{method:"POST"})},async transcriptionStatus(){return H("/api/transcription")},async transcribe(e,t="dictation.webm",n){const r=new FormData;r.append("file",e,t);const l=await fetch(`${ar}/api/transcribe`,{method:"POST",body:r,signal:n});if(!l.ok){let i=l.statusText;try{const a=await l.json();a.error&&(i=a.error)}catch{}throw new xl(i,l.status)}const{text:o}=await l.json();return o}},xh=C.createContext(null);function dy({children:e}){const[t,n]=C.useState([]),[r,l]=C.useState(null),[o,i]=C.useState(!0),[a,s]=C.useState(null),u=C.useCallback(async()=>{i(!0),s(null);try{const{projects:x,root:E}=await Bs.listProjects();n(x),E&&l(E)}catch(x){s(x instanceof Error?x.message:"Failed to load projects")}finally{i(!1)}},[]),f=C.useCallback(x=>{if(As(x.slug)){l(x);return}n(E=>[x,...E.filter(k=>k.slug!==x.slug)])},[]),c=C.useCallback(x=>{n(E=>E.filter(k=>k.slug!==x))},[]);C.useEffect(()=>{u()},[u]);const p=C.useMemo(()=>({projects:t,rootWorkspace:r,loading:o,error:a,refresh:u,upsert:f,remove:c}),[t,r,o,a,u,f,c]);return h.jsx(xh.Provider,{value:p,children:e})}function fy(){const e=C.useContext(xh);if(!e)throw new Error("useProjects must be used within ProjectsProvider");return e}const hy="paddock:theme";function py(){return typeof document<"u"&&document.documentElement.classList.contains("dark")}function my(){const[e,t]=C.useState(py),n=C.useCallback(()=>{t(r=>{const l=!r;document.documentElement.classList.toggle("dark",l);try{localStorage.setItem(hy,l?"dark":"light")}catch{}return l})},[]);return{dark:e,toggle:n}}const vy={name:"Paddock",logo:"🐎",accent:"#c2603c"},gy={enabled:!1,path:"/open-api"};function yy(){const e=globalThis.__PADDOCK_CONFIG__;return{...vy,...(e==null?void 0:e.brand)??{}}}function wy(){const e=globalThis.__PADDOCK_CONFIG__;return{...gy,...(e==null?void 0:e.openapi)??{}}}function xy(e){return/^(https?:\/\/|\/)/i.test(e.trim())}const Ws=[{slug:"homelab",label:"Homelab",blurb:"Servers, networking, self-hosted services."},{slug:"house",label:"House",blurb:"Physical home systems — water, climate, power, garden."},{slug:"side-projects",label:"Side Projects",blurb:"Apps and ideas of your own."}],Dc="",Sh=new Map(Ws.map(e=>[e.slug,e]));function Sy(e){if(!e)return"Unsorted";const t=Sh.get(e);return t?t.label:e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function k0(e){var t;return(t=Sh.get(e))==null?void 0:t.blurb}function ky(e){const t=new Set(e),n=[];for(const l of Ws)t.has(l.slug)&&(n.push(l.slug),t.delete(l.slug));const r=t.delete(Dc);return n.push(...[...t].sort()),r&&n.push(Dc),n}const kh=25e3,Eh=1e4,Ey=kh+Eh+5e3,Cy=500,jy=1e4;class Py{constructor(){this.ws=null,this.outbox=[],this.subs=new Map,this.pingTimer=null,this.pongTimer=null,this.awaitingPong=!1,this.lastPongAt=0,this.reconnectTimer=null,this.reconnectAttempts=0,this.manualClose=!1,this.stateListeners=new Set,this._state="closed",this.activeSessions=new Map,this.activeListeners=new Set,this.activeInfoListeners=new Set,this.knownSessions=new Set;const n=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}`;if(this.url=`${n.replace(/^http/,"ws")}/ws`,typeof window<"u"){const r=()=>this.ensureLive();window.addEventListener("online",r),window.addEventListener("focus",r),typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.ensureLive()})}}get state(){return this._state}onState(t){return this.stateListeners.add(t),t(this._state),()=>this.stateListeners.delete(t)}setState(t){if(this._state!==t){this._state=t;for(const n of this.stateListeners)n(t)}}onActiveSessions(t){return this.activeListeners.add(t),t(new Set(this.activeSessions.keys())),this.connect(),()=>this.activeListeners.delete(t)}onActiveInfos(t){return this.activeInfoListeners.add(t),t(new Map(this.activeSessions)),this.connect(),()=>this.activeInfoListeners.delete(t)}setActive(t,n,r){const l=this.activeSessions.has(t);if(n?this.activeSessions.set(t,r):this.activeSessions.delete(t),this.activeSessions.has(t)!==l){const o=new Set(this.activeSessions.keys());for(const a of this.activeListeners)a(o);const i=new Map(this.activeSessions);for(const a of this.activeInfoListeners)a(i)}}subscribe(t,n,r){const l=Symbol("chat-sub"),o={projectSlug:t,sessionId:n,handlers:r,lastSeq:-1,turnActive:!1};return this.subs.set(l,o),this.connect(),n&&this.attachSession(o,!1),{setSessionId:i=>{const a=this.subs.get(l);a&&(a.sessionId=i,i&&this.attachSession(a,!1))},unsubscribe:()=>{this.subs.delete(l)}}}attachSession(t,n){t.sessionId&&(this.knownSessions.add(t.sessionId),this.transmit(JSON.stringify({type:"chat:subscribe",payload:{projectSlug:t.projectSlug,sessionId:t.sessionId,wantReplay:n,lastSeq:t.lastSeq}})))}send(t,n,r,l){const o={projectSlug:t,sessionId:r,message:n};l!=null&&l.preloadContext&&(o.preloadContext=!0),l!=null&&l.model&&(o.model=l.model),l!=null&&l.attachments&&l.attachments.length>0&&(o.attachments=l.attachments),this.markTurnStart(t,r),this.transmit(JSON.stringify({type:"chat:send",payload:o}))}setQueued(t,n,r,l){const o={projectSlug:t,sessionId:n,text:r,ts:l};this.transmit(JSON.stringify({type:"chat:set_queue",payload:o}))}markTurnStart(t,n){for(const r of this.subs.values())r.projectSlug===t&&r.sessionId===n&&(r.lastSeq=-1,r.turnActive=!0)}sendCommand(t,n,r){this.markTurnStart(t,r),this.transmit(JSON.stringify({type:"chat:command",payload:{projectSlug:t,sessionId:r,command:n}}))}cancel(t){this.transmit(JSON.stringify({type:"chat:cancel",payload:{jobId:t}}))}continueChat(t,n){this.markTurnStart(t,n),this.transmit(JSON.stringify({type:"chat:continue",payload:{projectSlug:t,sessionId:n}}))}transmit(t){this.isLive()?this.ws.send(t):(this.outbox.push(t),this.ensureLive())}isLive(){var t;return((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN?!1:Date.now()-this.lastPongAt<Ey}wantsSocket(){return this.subs.size>0||this.activeListeners.size>0||this.activeInfoListeners.size>0}ensureLive(){var n;if(!this.wantsSocket())return;const t=(n=this.ws)==null?void 0:n.readyState;t===WebSocket.OPEN?this.sendPing():t!==WebSocket.CONNECTING&&(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectAttempts=0,this.connect())}flushOutbox(){var n;if(((n=this.ws)==null?void 0:n.readyState)!==WebSocket.OPEN||this.outbox.length===0)return;const t=this.outbox;this.outbox=[];for(const r of t)this.ws.send(r)}connect(){if(this.manualClose=!1,this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))return;this.setState("connecting");let t;try{t=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws=t,t.onopen=()=>{this.reconnectAttempts=0,this.awaitingPong=!1,this.lastPongAt=Date.now(),this.setState("open"),this.flushOutbox();for(const n of this.subs.values())n.sessionId&&this.attachSession(n,n.turnActive);this.startPing()},t.onclose=()=>{this.stopPing(),this.setState("closed"),this.manualClose||this.scheduleReconnect()},t.onerror=()=>{t.close()},t.onmessage=n=>this.dispatch(n.data)}startPing(){this.stopPing(),this.pingTimer=setInterval(()=>this.sendPing(),kh)}sendPing(){var t;if(!(((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN||this.awaitingPong)){this.awaitingPong=!0;try{this.ws.send(JSON.stringify({type:"ping"}))}catch{this.awaitingPong=!1,this.ws.close();return}this.pongTimer=setTimeout(()=>{var n;this.pongTimer=null,this.awaitingPong&&((n=this.ws)==null||n.close())},Eh)}}stopPing(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.pongTimer&&clearTimeout(this.pongTimer),this.pongTimer=null,this.awaitingPong=!1}scheduleReconnect(){if(this.reconnectTimer)return;const t=Math.min(jy,Cy*2**this.reconnectAttempts);this.reconnectAttempts+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}route(t,n){const r=[...this.subs.values()].filter(o=>o.projectSlug===t);if(r.length===0)return;if(n){const o=r.find(i=>i.sessionId===n);if(o)return o;if(this.knownSessions.has(n))return}const l=r.find(o=>o.sessionId===null);if(l)return l;if(n===null&&r.length===1)return r[0]}dispatch(t){var u,f,c,p,x,E,k,T,m,d,g,S,P,_,L,y,F,O,Q,te,pe,se,et,Ke;let n;try{n=JSON.parse(t)}catch{return}if(n.type==="pong"){this.awaitingPong=!1,this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null),this.lastPongAt=Date.now(),this.flushOutbox();return}const r=n.payload.projectSlug;if(r==null)return;if(n.type==="chat:error"){const le=this.route(r,null);(f=le==null?void 0:(u=le.handlers).onError)==null||f.call(u,n.payload.error);return}if(n.type==="chat:resync"){const le=this.route(r,n.payload.sessionId);(p=le==null?void 0:(c=le.handlers).onResync)==null||p.call(c);return}if(n.type==="chat:active"){this.setActive(n.payload.sessionId,n.payload.running,r);for(const le of this.subs.values())le.projectSlug===r&&le.sessionId===n.payload.sessionId&&((E=(x=le.handlers).onActive)==null||E.call(x,{running:n.payload.running,jobId:n.payload.jobId}));return}if(n.type==="chat:queued_flushed"){const{sessionId:le,text:D}=n.payload;if(le){Sl(async()=>{const{writeQueued:I,writeQueuedTs:W}=await import("./queued-LamEU0GH.js");return{writeQueued:I,writeQueuedTs:W}},[]).then(({writeQueued:I,writeQueuedTs:W})=>{I(le,r,null),W(le,r,null)});for(const I of this.subs.values())I.projectSlug===r&&I.sessionId===le&&((T=(k=I.handlers).onQueuedFlushed)==null||T.call(k,{text:D}))}return}if(n.type==="chat:killed_task"){const{sessionId:le,summary:D,timestamp:I}=n.payload;if(le)for(const W of this.subs.values())W.projectSlug===r&&W.sessionId===le&&((d=(m=W.handlers).onKilledTask)==null||d.call(m,{summary:D??"",timestamp:I??""}));return}const{sessionId:l,jobId:o}=n.payload,i=this.route(r,l);if(!i)return;const a={sessionId:l,jobId:o},s=n.payload.seq;switch(typeof s=="number"&&s>i.lastSeq&&(i.lastSeq=s),i.turnActive=n.type!=="chat:complete",n.type){case"chat:response":(S=(g=i.handlers).onResponse)==null||S.call(g,n.payload.chunk,a);break;case"chat:tool_call":(_=(P=i.handlers).onToolCall)==null||_.call(P,{toolName:n.payload.toolName,inputSummary:n.payload.inputSummary,output:n.payload.output,isError:n.payload.isError,durationMs:n.payload.durationMs,toolUseId:n.payload.toolUseId,subagentType:n.payload.subagentType,description:n.payload.description,hasSubagent:n.payload.hasSubagent},a);break;case"chat:tool_start":(y=(L=i.handlers).onToolStart)==null||y.call(L,{toolName:n.payload.toolName,inputSummary:n.payload.inputSummary,toolUseId:n.payload.toolUseId,output:"",isError:!1,pending:!0,subagentType:n.payload.subagentType,description:n.payload.description,hasSubagent:n.payload.hasSubagent},a);break;case"chat:message_boundary":(O=(F=i.handlers).onMessageBoundary)==null||O.call(F,a);break;case"chat:injected":(te=(Q=i.handlers).onInjected)==null||te.call(Q,{sender:n.payload.sender,content:n.payload.content,timestamp:n.payload.timestamp},a);break;case"chat:notice":(se=(pe=i.handlers).onNotice)==null||se.call(pe,n.payload.notice,a);break;case"chat:complete":(Ke=(et=i.handlers).onComplete)==null||Ke.call(et,{...a,success:n.payload.success,error:n.payload.error,model:n.payload.model,usage:n.payload.usage});break}}}const Ny=new Py,Fa="paddock:lastSeen:",mn=new Map,$a="paddock:lastSeen-changed";function Ry(e){return Fa+e}function Vs(e){try{window.dispatchEvent(new CustomEvent($a,{detail:{sessionId:e}}))}catch{}}function _y(e){return mn.get(e)??0}function Ch(e,t){!t||!Number.isFinite(t)||t<=(mn.get(e)??0)||(mn.set(e,t),Vs(e))}function E0(e,t=Date.now()){const n=mn.get(e)??0;return t<=n||(mn.set(e,t),Vs(e)),n}function C0(e,t,n){mn.get(e)===n&&(t?mn.set(e,t):mn.delete(e),Vs(e))}function Ty(){const e=new Map;try{for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);if(!n||!n.startsWith(Fa))continue;const r=Number(localStorage.getItem(n));Number.isFinite(r)&&r>0&&e.set(n.slice(Fa.length),r)}}catch{}return e}function Ly(e){for(const t of e)try{localStorage.removeItem(Ry(t))}catch{}}const My=4;let Ic=!1;async function Dy(e){if(Ic)return;const t=Ty();if(t.size===0)return;const n=new Map;for(const u of e)for(const f of u.chatTurns??[])t.has(f.sessionId)&&n.set(f.sessionId,{slug:u.slug,serverLastSeen:f.lastSeen??0});if(n.size===0)return;Ic=!0;const r=[...n].filter(([u,{serverLastSeen:f}])=>t.get(u)>f).map(([u,{slug:f}])=>({sid:u,slug:f,when:t.get(u)})),l=[];let o=0;const i=async()=>{for(;o<r.length;){const u=r[o++];try{await Bs.markChatSeen(u.slug,u.sid,u.when),Ch(u.sid,u.when),l.push(u.sid)}catch{}}};await Promise.all(Array.from({length:Math.min(My,r.length)},()=>i()));const a=new Set(r.map(u=>u.sid)),s=[...n.keys()].filter(u=>!a.has(u));Ly([...l,...s])}function Iy({tag:e,className:t=""}){const n=si();return h.jsx("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),n(`/tags/${encodeURIComponent(e)}`)},title:`Show projects tagged ${e}`,className:`tag relative z-10 transition-colors hover:bg-paddock-300/70 dark:hover:bg-paddock-700 ${t}`,children:e})}function G(e){return{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",...e}}const Oy=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M12 5v14M5 12h14"})}),j0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),zy=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M3 10.5 12 3l9 7.5"}),h.jsx("path",{d:"M5 9.5V20a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9.5"})]}),P0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),N0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"11",cy:"11",r:"7"}),h.jsx("path",{d:"m21 21-4.3-4.3"})]}),R0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M4 5h16"}),h.jsx("path",{d:"M8 5v6h12"}),h.jsx("path",{d:"M8 11v6h12"})]}),_0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),Uy=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z"})}),T0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"m22 2-7 20-4-9-9-4Z"}),h.jsx("path",{d:"M22 2 11 13"})]}),L0=e=>h.jsx("svg",{...G(e),children:h.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),M0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),h.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),h.jsx("path",{d:"M12 17v4M8 21h8"})]}),D0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"m9 18 6-6-6-6"})}),I0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2-2 2.6-2.6Z"})}),Fy=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"12",cy:"12",r:"3"}),h.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z"})]}),O0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z"}),h.jsx("path",{d:"M12 9v4M12 17h.01"})]}),z0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M5.6 18.4l2.8-2.8M15.6 8.4l2.8-2.8"})}),jh=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),U0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M13 2 4.5 13.5H11l-1 8.5 8.5-11.5H12z"})}),F0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M6 4.5v15l13-7.5z"})}),$y=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M3 6h18M3 12h18M3 18h18"})}),$0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("path",{d:"M12 7v5l3 2"})]}),A0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"12",cy:"5",r:"1"}),h.jsx("circle",{cx:"12",cy:"12",r:"1"}),h.jsx("circle",{cx:"12",cy:"19",r:"1"})]}),B0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M10 11v6M14 11v6"})}),W0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M12 20h9"}),h.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),V0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),h.jsx("path",{d:"M14 2v6h6"})]}),H0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M12 17v5"}),h.jsx("path",{d:"M9 10.76V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v6.76a2 2 0 0 0 .59 1.42l1.12 1.12A1 1 0 0 1 17 15H7a1 1 0 0 1-.71-1.7l1.12-1.12A2 2 0 0 0 9 10.76Z"})]}),Q0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M20 6 9 17l-5-5"})}),K0=({open:e,...t})=>e?h.jsxs("svg",{...G(t),children:[h.jsx("path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z"}),h.jsx("path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10"})]}):h.jsxs("svg",{...G(t),children:[h.jsx("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),h.jsx("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),b0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"6",cy:"6",r:"3"}),h.jsx("circle",{cx:"6",cy:"18",r:"3"}),h.jsx("circle",{cx:"18",cy:"6",r:"3"}),h.jsx("path",{d:"M6 9v6M18 9a9 9 0 0 1-9 9"})]}),J0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M9.5 14.5l-1.7 1.7a4 4 0 0 1-5.66-5.66l1.7-1.7"}),h.jsx("path",{d:"M14.5 9.5l1.7-1.7a4 4 0 0 1 5.66 5.66l-1.7 1.7"}),h.jsx("path",{d:"M8 3.5v2M3.5 8h2M16 20.5v-2M20.5 16h-2"})]}),Y0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),h.jsx("path",{d:"M17 8l-5-5-5 5M12 3v12"})]}),G0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M4 17l6-5-6-5M12 19h8"})}),X0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.9a3.4 3.4 0 0 0-1-2.6c3-.3 6.2-1.5 6.2-6.6a5.2 5.2 0 0 0-1.4-3.6 4.8 4.8 0 0 0-.1-3.6s-1.1-.3-3.7 1.4a12.6 12.6 0 0 0-6.6 0C6.5 1.3 5.4 1.6 5.4 1.6a4.8 4.8 0 0 0-.1 3.6 5.2 5.2 0 0 0-1.4 3.6c0 5.1 3.2 6.3 6.2 6.6a3.4 3.4 0 0 0-1 2.6V22"})}),Ay=e=>h.jsxs("svg",{...G(e),children:[h.jsx("circle",{cx:"12",cy:"12",r:"4"}),h.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),By=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})}),Wy=e=>h.jsxs("svg",{...G(e),children:[h.jsx("path",{d:"M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.5 1.5"}),h.jsx("path",{d:"M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.5-1.5"})]}),Z0=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"m6 9 6 6 6-6"})}),q0=e=>h.jsxs("svg",{...G(e),children:[h.jsx("rect",{x:"3",y:"4",width:"18",height:"4",rx:"1"}),h.jsx("path",{d:"M5 8v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V8"}),h.jsx("path",{d:"M10 12h4"})]}),e1=e=>h.jsx("svg",{...G(e),children:h.jsx("path",{d:"M12 2.5l2.9 5.88 6.49.94-4.7 4.58 1.11 6.46L12 17.8l-5.8 3.05 1.11-6.46-4.7-4.58 6.49-.94z"})}),Vy=["idea","active","paused","blocked","done"];function Hy({open:e,onClose:t,onCreated:n}){const[r,l]=C.useState(""),[o,i]=C.useState(""),[a,s]=C.useState(""),[u,f]=C.useState(""),[c,p]=C.useState("active"),[x,E]=C.useState(""),[k,T]=C.useState(!1),[m,d]=C.useState(null);if(C.useEffect(()=>{e&&(l(""),i(""),s(""),f(""),p("active"),E(""),d(null))},[e]),C.useEffect(()=>{const S=P=>{P.key==="Escape"&&e&&!k&&t()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e,k,t]),!e)return null;const g=async S=>{if(S.preventDefault(),!!r.trim()){T(!0),d(null);try{const P=await Bs.createProject({name:r.trim(),status:c,group:u||void 0,summary:o.trim()||void 0,repo:x.trim()||void 0,domain:a.split(",").map(_=>_.trim()).filter(Boolean)});n(P)}catch(P){d(P instanceof xl?P.message:"Failed to create project")}finally{T(!1)}}};return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4 backdrop-blur-sm",onClick:()=>!k&&t(),children:h.jsxs("form",{className:"w-full max-w-md animate-scale-in rounded-2xl border border-paddock-200 bg-white p-6 shadow-2xl dark:border-paddock-800 dark:bg-paddock-900",onClick:S=>S.stopPropagation(),onSubmit:g,children:[h.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[h.jsx("h2",{className:"text-lg font-semibold",children:"New project"}),h.jsx("button",{type:"button",onClick:t,className:"rounded-lg p-1 text-paddock-400 hover:bg-paddock-100 hover:text-paddock-600 dark:hover:bg-paddock-800","aria-label":"Close",children:h.jsx(jh,{width:18,height:18})})]}),h.jsxs("label",{className:"mb-4 block",children:[h.jsx("span",{className:"field-label",children:"Name"}),h.jsx("input",{autoFocus:!0,className:"input",value:r,onChange:S=>l(S.target.value),placeholder:"Garage Water Heater Replacement"})]}),h.jsxs("label",{className:"mb-4 block",children:[h.jsx("span",{className:"field-label",children:"Summary (optional)"}),h.jsx("input",{className:"input",value:o,onChange:S=>i(S.target.value),placeholder:"One line on what this project is about"})]}),h.jsxs("label",{className:"mb-4 block",children:[h.jsx("span",{className:"field-label",children:"Area"}),h.jsxs("select",{className:"input",value:u,onChange:S=>f(S.target.value),children:[h.jsx("option",{value:"",children:"Unsorted"}),Ws.map(S=>h.jsx("option",{value:S.slug,children:S.label},S.slug))]})]}),h.jsxs("label",{className:"mb-4 block",children:[h.jsx("span",{className:"field-label",children:"Git repository URL (optional)"}),h.jsx("input",{className:"input",value:x,onChange:S=>E(S.target.value),placeholder:"https://github.com/owner/repo.git"}),h.jsx("span",{className:"mt-1 block text-xs text-paddock-400 dark:text-paddock-500",children:"Link an external repo and Paddock clones it as the project's working directory — the repo's own CLAUDE.md, branches & PR flow apply. Leave blank for a notebook project."})]}),h.jsxs("div",{className:"mb-5 grid grid-cols-2 gap-3",children:[h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"field-label",children:"Domain tags"}),h.jsx("input",{className:"input",value:a,onChange:S=>s(S.target.value),placeholder:"home, plumbing"})]}),h.jsxs("label",{className:"block",children:[h.jsx("span",{className:"field-label",children:"Status"}),h.jsx("select",{className:"input capitalize",value:c,onChange:S=>p(S.target.value),children:Vy.map(S=>h.jsx("option",{value:S,className:"capitalize",children:S},S))})]})]}),m&&h.jsx("p",{className:"mb-4 rounded-lg bg-rose-50 px-3 py-2 text-sm text-rose-600 dark:bg-rose-950/40 dark:text-rose-300",children:m}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{type:"button",className:"btn-ghost",onClick:t,disabled:k,children:"Cancel"}),h.jsx("button",{type:"submit",className:"btn-primary",disabled:k||!r.trim(),children:k?"Creating…":"Create project"})]})]})})}function Oc(e){if(typeof window>"u"||typeof window.matchMedia!="function")return null;try{return window.matchMedia(e)??null}catch{return null}}function Qy(e){const[t,n]=C.useState(()=>{var r;return((r=Oc(e))==null?void 0:r.matches)??!1});return C.useEffect(()=>{var o;const r=Oc(e);if(!r)return;const l=()=>n(!!r.matches);return l(),typeof r.addEventListener=="function"?(r.addEventListener("change",l),()=>r.removeEventListener("change",l)):((o=r.addListener)==null||o.call(r,l),()=>{var i;return(i=r.removeListener)==null?void 0:i.call(r,l)})},[e]),t}const Hs="paddock:panewidth:",Ky={key:"sidenav",def:288,min:200,max:480},t1={key:"chatlist",def:256,min:220,max:520},by="(min-width: 1024px)";function pr(e,t){return Math.min(Math.max(t,e.min),e.max)}function zc(e,t,n){return pr(n,e+t)}function Jy(e){try{const t=localStorage.getItem(Hs+e.key);if(t==null)return null;const n=Number.parseFloat(t);return Number.isFinite(n)?pr(e,n):null}catch{return null}}function Yy(e,t){try{localStorage.setItem(Hs+e.key,String(pr(e,t)))}catch{}}function Gy(e){try{localStorage.removeItem(Hs+e.key)}catch{}}function Xy(e){const t=Qy(by),[n,r]=C.useState(()=>Jy(e)),l=pr(e,n??e.def);return{isDesktop:t,width:l,style:t?{width:l}:void 0,preview:o=>r(pr(e,o)),commit:o=>{const i=pr(e,o);r(i),Yy(e,i)},reset:()=>{r(null),Gy(e)},spec:e}}function Zy({spec:e,width:t,onPreview:n,onCommit:r,onReset:l,label:o}){const i=C.useRef(null),a=C.useRef(t);a.current=t;const s=16;return h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":o,"aria-valuenow":Math.round(t),"aria-valuemin":e.min,"aria-valuemax":e.max,tabIndex:0,onPointerDown:u=>{i.current={startX:u.clientX,startWidth:t},u.currentTarget.setPointerCapture(u.pointerId)},onPointerMove:u=>{i.current&&n(zc(i.current.startWidth,u.clientX-i.current.startX,e))},onPointerUp:u=>{if(i.current){i.current=null;try{u.currentTarget.releasePointerCapture(u.pointerId)}catch{}r(a.current)}},onDoubleClick:l,onKeyDown:u=>{if(u.key==="ArrowLeft"||u.key==="ArrowRight"){u.preventDefault();const f=zc(t,u.key==="ArrowRight"?s:-s,e);n(f),r(f)}},title:"Drag to resize · double-click to reset",className:"group/resizer absolute inset-y-0 right-0 z-10 hidden w-1.5 -mr-0.5 cursor-ew-resize touch-none lg:block",children:h.jsx("span",{className:"absolute inset-y-0 right-0 w-px bg-paddock-200 transition group-hover/resizer:w-0.5 group-hover/resizer:bg-accent group-focus/resizer:w-0.5 group-focus/resizer:bg-accent dark:bg-paddock-800"})})}function qy(e){const[t,n]=C.useState(new Map),r=C.useRef(new Map),[l,o]=C.useState(0);return C.useEffect(()=>{const i=r.current;for(const a of e)for(const s of a.chatTurns??[]){Ch(s.sessionId,s.lastSeen);const u=Date.parse(s.lastTurnCompletedAt);if(!Number.isFinite(u))continue;const f=i.get(s.sessionId);!f||u>f.at?i.set(s.sessionId,{slug:a.slug,at:u,unread:s.unread}):f.unread=s.unread}o(a=>a+1),Dy(e).catch(()=>{})},[e]),C.useEffect(()=>{const i=new Map;return Ny.onActiveInfos(a=>{for(const[s,u]of i)a.has(s)||r.current.set(s,{slug:u,at:Date.now()});i.clear();for(const[s,u]of a)i.set(s,u);n(new Map(a)),o(s=>s+1)})},[]),C.useEffect(()=>{const i=()=>o(a=>a+1);return window.addEventListener($a,i),()=>window.removeEventListener($a,i)},[]),C.useMemo(()=>{const i=new Map,a=s=>{let u=i.get(s);return u||(u={unread:0,inflight:0},i.set(s,u)),u};for(const[s,{slug:u,at:f,unread:c}]of r.current)!t.has(s)&&(c||f>_y(s))&&(a(u).unread+=1);for(const s of t.values())a(s).inflight+=1;return i},[t,l])}function e0(){const{projects:e,rootWorkspace:t,loading:n,upsert:r}=fy(),{dark:l,toggle:o}=my(),[i,a]=C.useState(!1),[s,u]=C.useState(!1),f=si(),c=Wn(),p=yy(),x=wy(),E=Xy(Ky),k=c.pathname==="/"||c.pathname==="/projects"||c.pathname.startsWith("/chat"),T=c.pathname.startsWith("/projects/")||k;C.useEffect(()=>{a(!1)},[c.pathname]),C.useEffect(()=>{document.title=p.name},[p.name]);const m=C.useMemo(()=>{const P=new Map;for(const _ of e){const L=_.group??"",y=P.get(L);y?y.push(_):P.set(L,[_])}return ky(P.keys()).map(_=>[_,P.get(_)??[]])},[e]),d=C.useMemo(()=>t?[...e,t]:e,[e,t]),g=qy(d),S=g.get(wh);return h.jsxs("div",{className:"flex h-[100dvh] flex-col overflow-hidden bg-canvas dark:bg-canvas-dark lg:flex-row",children:[!T&&h.jsxs("header",{className:"pt-safe flex items-center gap-2 border-b border-paddock-200 px-3 pb-2 dark:border-paddock-800 lg:hidden",children:[h.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":"Open menu",className:"btn-subtle -ml-1 px-2 py-2",children:h.jsx($y,{width:20,height:20})}),h.jsxs(bn,{to:"/",className:"flex items-center gap-2",children:[h.jsx(Uc,{brand:p,className:"h-7 w-7 text-sm"}),h.jsx("span",{className:"text-[15px] font-semibold tracking-tight",children:p.name})]})]}),i&&h.jsx("div",{className:"fixed inset-0 z-30 bg-black/40 backdrop-blur-sm lg:hidden","aria-hidden":"true",onClick:()=>a(!1)}),h.jsxs("aside",{style:E.style,className:`fixed inset-y-0 left-0 z-40 flex w-72 max-w-[85%] shrink-0 flex-col border-r border-paddock-200 bg-canvas shadow-2xl transition-transform duration-200 ease-out dark:border-paddock-800 dark:bg-paddock-900 lg:relative lg:z-auto lg:max-w-none lg:translate-x-0 lg:bg-white/50 lg:shadow-none dark:lg:bg-paddock-900/30 ${i?"translate-x-0":"-translate-x-full"}`,children:[E.isDesktop&&h.jsx(Zy,{spec:E.spec,width:E.width,onPreview:E.preview,onCommit:E.commit,onReset:E.reset,label:"Resize sidebar"}),h.jsxs("div",{className:"flex items-center gap-2 px-5 py-4",children:[h.jsxs(bn,{to:"/",className:"group flex items-center gap-2",children:[h.jsx(Uc,{brand:p,className:"h-8 w-8 text-base"}),h.jsx("span",{className:"text-[17px] font-semibold tracking-tight",children:p.name})]}),h.jsx("button",{type:"button",onClick:()=>a(!1),"aria-label":"Close menu",className:"btn-subtle ml-auto px-2 py-2 lg:hidden",children:h.jsx(jh,{width:18,height:18})})]}),h.jsx("div",{className:"px-3 pb-1",children:h.jsxs(bn,{to:"/",end:!0,className:({isActive:P})=>`btn-subtle w-full justify-start ${P?"bg-paddock-200/80 dark:bg-paddock-800":""}`,title:"The root workspace — every project, and the instance's own chats",children:[h.jsx(zy,{width:16,height:16}),"Home",h.jsx(Ph,{badge:S,className:"ml-auto"})]})}),h.jsxs("div",{className:"mt-5 mb-1 flex items-center justify-between pr-3",children:[h.jsx(bn,{to:uy(),className:"section-label hover:text-accent",children:"Projects"}),h.jsx("button",{type:"button",onClick:()=>u(!0),"aria-label":"New Project",title:"New Project",className:"btn-subtle -mr-1 px-1.5 py-1 text-paddock-400 hover:text-accent",children:h.jsx(Oy,{width:14,height:14})})]}),h.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 pb-4",children:[n&&h.jsx("div",{className:"space-y-2 px-2 py-2",children:[0,1,2].map(P=>h.jsx("div",{className:"h-10 animate-pulse rounded-lg bg-paddock-200/60 dark:bg-paddock-800/50"},P))}),!n&&e.length===0&&h.jsx("p",{className:"px-3 py-2 text-sm text-paddock-500",children:"No projects yet."}),!n&&e.length>0&&m.map(([P,_])=>h.jsxs("div",{className:"mb-2",children:[m.length>1&&h.jsx("div",{className:"px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wider text-paddock-400",children:Sy(P)}),_.map(L=>h.jsx(n0,{project:L,badge:g.get(L.slug)},L.slug))]},P||"unsorted"))]}),h.jsxs("div",{className:"border-t border-paddock-200 px-3 py-3 dark:border-paddock-800",children:[h.jsxs(bn,{to:"/config",className:({isActive:P})=>`btn-subtle w-full justify-start ${P?"bg-paddock-200/80 dark:bg-paddock-800":""}`,title:"Instance config — paddock.config.yaml (restart required)",children:[h.jsx(Fy,{width:15,height:15}),"Config"]}),x.enabled&&h.jsxs("a",{href:x.path,target:"_blank",rel:"noreferrer",className:"btn-subtle mt-1 w-full justify-start",title:"OpenAPI / Swagger reference (opens in a new tab)",children:[h.jsx(Wy,{width:15,height:15}),"Swagger API"]}),h.jsxs("button",{type:"button",onClick:o,className:"btn-subtle mt-1 w-full justify-start","aria-label":l?"Switch to light mode":"Switch to dark mode",title:"Toggle light / dark theme",children:[l?h.jsx(Ay,{width:15,height:15}):h.jsx(By,{width:15,height:15}),l?"Light mode":"Dark mode"]}),h.jsxs("p",{className:"mt-2 px-2 text-[11px] text-paddock-400",children:["v","0.59.1"]})]})]}),h.jsx("main",{className:"min-w-0 flex-1 overflow-hidden",children:h.jsx(C.Suspense,{fallback:h.jsx(t0,{}),children:h.jsx(Fg,{context:{openNav:()=>a(!0)}})})}),h.jsx(Hy,{open:s,onClose:()=>u(!1),onCreated:P=>{r(P),u(!1),f(`/projects/${P.slug}/chat`)}})]})}function Uc({brand:e,className:t=""}){return h.jsx("span",{className:`flex shrink-0 items-center justify-center overflow-hidden rounded-lg bg-accent text-white shadow-sm ${t}`,children:xy(e.logo)?h.jsx("img",{src:e.logo,alt:"",className:"h-full w-full object-cover"}):e.logo})}function t0(){return h.jsxs("div",{className:"flex h-full items-center justify-center","aria-busy":"true","aria-live":"polite",children:[h.jsx("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-paddock-300 border-t-accent dark:border-paddock-700 dark:border-t-accent"}),h.jsx("span",{className:"sr-only",children:"Loading…"})]})}function n0({project:e,badge:t}){return h.jsxs(bn,{to:`/projects/${e.slug}`,className:({isActive:n})=>`group mb-0.5 flex flex-col gap-1 rounded-lg px-2.5 py-2 text-sm transition-colors ${n?"bg-paddock-200/80 dark:bg-paddock-800":"hover:bg-paddock-200/50 dark:hover:bg-paddock-800/50"}`,children:[h.jsxs("span",{className:"flex items-center justify-between gap-2",children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx(Uy,{width:13,height:13,className:"shrink-0 text-paddock-400 group-hover:text-paddock-500"}),h.jsx("span",{className:"truncate font-medium",children:e.name})]}),h.jsx(Ph,{badge:t})]}),e.domain.length>0&&h.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden pl-[18px]",children:[e.domain.slice(0,2).map(n=>h.jsx(Iy,{tag:n,className:"max-w-[7rem] truncate"},n)),e.domain.length>2&&h.jsxs("span",{className:"shrink-0 text-[11px] text-paddock-400",children:["+",e.domain.length-2]})]})]})}function Ph({badge:e,className:t=""}){const n=(e==null?void 0:e.unread)??0,r=(e==null?void 0:e.inflight)??0;return n===0&&r===0?null:h.jsxs("span",{className:`flex shrink-0 items-center gap-1.5 ${t}`,children:[r>0&&h.jsxs("span",{className:"flex items-center gap-1 text-[11px] tabular-nums text-paddock-500 dark:text-paddock-400",title:`${r} chat${r===1?"":"s"} in flight`,"aria-label":`${r} chat${r===1?"":"s"} in flight`,children:[h.jsx("span",{"aria-hidden":"true",className:"h-2.5 w-2.5 spin-eco rounded-full border-[1.5px] border-paddock-400 border-t-transparent dark:border-paddock-500 dark:border-t-transparent"}),r]}),n>0&&h.jsx("span",{className:"inline-flex min-w-[1.1rem] items-center justify-center rounded-full bg-accent px-1.5 py-0.5 text-[11px] font-semibold leading-none tabular-nums text-white",title:`${n} unread ${n===1?"reply":"replies"}`,"aria-label":`${n} unread ${n===1?"reply":"replies"}`,children:n})]})}const Nh="paddock:chunkReloadAt",r0=1e4,Fc=/dynamically imported module|module script|importing a module|failed to fetch|unable to preload|load failed|error loading/i;function l0(e){return e?e instanceof Error?e.name==="ChunkLoadError"?!0:Fc.test(e.message):Fc.test(String(e)):!1}function Qs(){try{return typeof sessionStorage<"u"?sessionStorage:void 0}catch{return}}function o0(e=Date.now(),t=Qs()){if(!t)return!1;const n=t.getItem(Nh);if(!n)return!1;const r=Number(n);return Number.isFinite(r)&&e-r<r0}function i0(e=Date.now(),t=Qs()){try{t==null||t.setItem(Nh,String(e))}catch{}}function a0(e,t=Date.now(),n=Qs()){return l0(e)&&!o0(t,n)?"reload":"show"}function s0(){const e=vh(),t=a0(e);if(C.useEffect(()=>{t==="reload"&&(i0(),window.location.reload())},[t]),t==="reload")return h.jsxs("div",{className:"flex h-[100dvh] items-center justify-center bg-canvas dark:bg-canvas-dark","aria-busy":"true","aria-live":"polite",children:[h.jsx("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-paddock-300 border-t-accent dark:border-paddock-700 dark:border-t-accent"}),h.jsx("span",{className:"sr-only",children:"Updating…"})]});const n=e instanceof Error?e.message:typeof e=="string"?e:"";return h.jsxs("div",{className:"flex h-[100dvh] flex-col items-center justify-center gap-4 bg-canvas px-6 text-center dark:bg-canvas-dark",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"Something went wrong"}),h.jsx("p",{className:"mt-1 max-w-md text-sm text-paddock-500 dark:text-paddock-400",children:"The app hit an unexpected error. Reloading usually fixes it."}),n?h.jsx("p",{className:"mt-2 max-w-md break-words font-mono text-[11px] text-paddock-400",children:n}):null]}),h.jsx("button",{className:"btn-primary",onClick:()=>window.location.reload(),children:"Reload"})]})}function u0(){typeof navigator>"u"||!("serviceWorker"in navigator)||window.addEventListener("load",()=>{const e=navigator.serviceWorker,t=!!e.controller;let n=!1;e.addEventListener("controllerchange",()=>{n||!t||(n=!0,window.location.reload())}),e.register("/sw.js").catch(()=>{})})}const Rh=C.lazy(()=>Sl(()=>import("./ProjectsGrid-Dwngb-m1.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ProjectsGrid}))),ke=C.lazy(()=>Sl(()=>import("./ProjectView-BI1TtrOK.js").then(e=>e.P),__vite__mapDeps([2,1,3,4])).then(e=>({default:e.ProjectView}))),c0=C.lazy(()=>Sl(()=>import("./ProjectRedirect-D1ipv4jr.js"),__vite__mapDeps([5,4])).then(e=>({default:e.ProjectRedirect}))),d0=C.lazy(()=>Sl(()=>import("./InstanceConfigPage-CAwSnyga.js"),[]).then(e=>({default:e.InstanceConfigPage}))),_h=()=>document.documentElement.setAttribute("data-tab-hidden",document.hidden?"true":"false");document.addEventListener("visibilitychange",_h);_h();function f0(){const{tag:e}=Pg();return h.jsx(Rh,{filterTag:e?decodeURIComponent(e):void 0})}const h0=Kg([{path:"/",element:h.jsx(e0,{}),errorElement:h.jsx(s0,{}),children:[{index:!0,element:h.jsx(ke,{root:!0})},{path:"projects",element:h.jsx(Rh,{})},{path:"tags/:tag",element:h.jsx(f0,{})},{path:"projects/:slug",element:h.jsx(c0,{})},{path:"projects/:slug/home",element:h.jsx(ke,{})},{path:"projects/:slug/chat",element:h.jsx(ke,{})},{path:"projects/:slug/chat/:sessionId",element:h.jsx(ke,{})},{path:"projects/:slug/files",element:h.jsx(ke,{})},{path:"projects/:slug/files/*",element:h.jsx(ke,{})},{path:"projects/:slug/changes",element:h.jsx(ke,{})},{path:"projects/:slug/changes/:file",element:h.jsx(ke,{})},{path:"projects/:slug/history",element:h.jsx(ke,{})},{path:"projects/:slug/settings",element:h.jsx(ke,{})},{path:"projects/:slug/triggers",element:h.jsx(ke,{})},{path:"projects/:slug/hooks",element:h.jsx(ke,{})},{path:"chat",element:h.jsx(ke,{root:!0})},{path:"chat/:sessionId",element:h.jsx(ke,{root:!0})},{path:"files",element:h.jsx(ke,{root:!0})},{path:"files/*",element:h.jsx(ke,{root:!0})},{path:"changes",element:h.jsx(ke,{root:!0})},{path:"changes/:file",element:h.jsx(ke,{root:!0})},{path:"history",element:h.jsx(ke,{root:!0})},{path:"triggers",element:h.jsx(ke,{root:!0})},{path:"settings",element:h.jsx(ke,{root:!0})},{path:"config",element:h.jsx(d0,{})}]}]);Wi.createRoot(document.getElementById("root")).render(h.jsx(Xc.StrictMode,{children:h.jsx(dy,{children:h.jsx(ey,{router:h0})})}));u0();export{Zy as $,O0 as A,b0 as B,P0 as C,T0 as D,Uy as E,V0 as F,Is as G,N0 as H,Ny as I,j0 as J,X0 as K,oy as L,$y as M,Hy as N,G0 as O,Oy as P,H0 as Q,Ws as R,z0 as S,Iy as T,Y0 as U,F0 as V,I0 as W,jh as X,_0 as Y,R0 as Z,Sl as _,si as a,Z0 as a0,J0 as a1,q0 as a2,K0 as a3,e1 as a4,E0 as a5,C0 as a6,Ch as a7,_y as a8,wh as a9,Wn as aa,w0 as ab,x0 as ac,Xy as ad,y0 as ae,g0 as af,S0 as ag,t1 as ah,Bs as b,$0 as c,k0 as d,Sy as e,D0 as f,uy as g,Pg as h,v0 as i,h as j,Q0 as k,xl as l,m0 as m,Fy as n,ky as o,Ac as p,A0 as q,C as r,W0 as s,B0 as t,fy as u,p0 as v,M0 as w,L0 as x,U0 as y,Wy as z};
|
|
71
71
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as a,l as s,L as o,e as i}from"./mermaid.core-
|
|
1
|
+
import{_ as a,l as s,L as o,e as i}from"./mermaid.core-Dorg4Dl2.js";import{p as g}from"./wardley-L42UT6IY-DwgnVd48.js";import"./index-DKDgTDXa.js";var p={parse:a(async r=>{const e=await g("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,n)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=o(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),l={draw:c},b={parser:p,db:m,renderer:l};export{b as diagram};
|
|
3
3
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as o,c as ot,a4 as ut,L as dt,al as yt,z as ft,k as pt,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-
|
|
1
|
+
import{_ as o,c as ot,a4 as ut,L as dt,al as yt,z as ft,k as pt,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-Dorg4Dl2.js";import"./index-DKDgTDXa.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(F,"popStack");function j(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(j,"lex");for(var A,W,B,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as gt}from"./chunk-FMBD7UC4-
|
|
1
|
+
import{g as gt}from"./chunk-FMBD7UC4-BOEqxzyA.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-CkTZgv_W.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as G,e as $t,z as Mt}from"./mermaid.core-Dorg4Dl2.js";import{d as it}from"./arc-BZh6Z9_D.js";import"./index-DKDgTDXa.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as c,l as te,c as W,L as fe,ah as ye,ai as be,aj as me,af as _e,I as Y,i as G,t as ke,J as Ee,ac as Se,ad as le,ae as ce}from"./mermaid.core-
|
|
1
|
+
import{_ as c,l as te,c as W,L as fe,ah as ye,ai as be,aj as me,af as _e,I as Y,i as G,t as ke,J as Ee,ac as Se,ad as le,ae as ce}from"./mermaid.core-Dorg4Dl2.js";import{g as Ne}from"./chunk-FMBD7UC4-BOEqxzyA.js";import"./index-DKDgTDXa.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],j=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:j}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:M,11:U}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:j}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:M,11:U}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,F={},X,I,oe,K;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";K=[];for(X in B[R])this.terminals_[X]&&X>ue&&K.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+K.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:K})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./mermaid.core-
|
|
1
|
+
import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./mermaid.core-Dorg4Dl2.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
|
|
2
2
|
|