@edspencer/paddock 0.59.0 → 0.60.0
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 +2 -2
- package/packages/server/dist/adoptable.d.ts +72 -3
- package/packages/server/dist/adoptable.js +231 -25
- 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/dist/herdctl.d.ts +80 -0
- package/packages/server/dist/herdctl.js +159 -0
- package/packages/server/dist/routes/chats.js +59 -3
- package/packages/server/dist/run-provenance.d.ts +11 -0
- package/packages/server/dist/run-provenance.js +18 -0
- package/packages/server/dist/ws-turn.d.ts +0 -13
- package/packages/server/dist/ws-turn.js +50 -0
- package/packages/server/package.json +1 -1
- package/packages/web/dist/assets/{InstanceConfigPage-Cli_WHsM.js → InstanceConfigPage-xn9Rvoah.js} +1 -1
- package/packages/web/dist/assets/{MarkdownRenderer-BYK9nmr4.js → MarkdownRenderer-DMONssKA.js} +1 -1
- package/packages/web/dist/assets/{ProjectRedirect-DWcMpdZJ.js → ProjectRedirect-DHoWtvtY.js} +1 -1
- package/packages/web/dist/assets/ProjectView-BmSdUwY2.js +13 -0
- package/packages/web/dist/assets/{ProjectsGrid-Bf2cx9-Z.js → ProjectsGrid-CjfwpeFj.js} +1 -1
- package/packages/web/dist/assets/{arc-CZ9CFd-g.js → arc-DdFdbD-c.js} +1 -1
- package/packages/web/dist/assets/{architectureDiagram-3BPJPVTR-BzOXUlLu.js → architectureDiagram-3BPJPVTR-DC8UKtwV.js} +1 -1
- package/packages/web/dist/assets/{blockDiagram-GPEHLZMM-Bnkcx-Fn.js → blockDiagram-GPEHLZMM-DqFFe_5c.js} +1 -1
- package/packages/web/dist/assets/{c4Diagram-AAUBKEIU-C-nqckPS.js → c4Diagram-AAUBKEIU-DbffFSM-.js} +1 -1
- package/packages/web/dist/assets/channel-QxsJGL6F.js +2 -0
- package/packages/web/dist/assets/{chunk-2J33WTMH-jVn7J_5N.js → chunk-2J33WTMH-8PP2RHft.js} +1 -1
- package/packages/web/dist/assets/{chunk-4BX2VUAB-D5eys7Hi.js → chunk-4BX2VUAB-Hag68B5N.js} +1 -1
- package/packages/web/dist/assets/{chunk-55IACEB6-CqpdXIoL.js → chunk-55IACEB6-BXp_gQIa.js} +1 -1
- package/packages/web/dist/assets/{chunk-727SXJPM-SQikk09l.js → chunk-727SXJPM-DlntjQux.js} +1 -1
- package/packages/web/dist/assets/{chunk-AQP2D5EJ-rfBNpUwD.js → chunk-AQP2D5EJ-BhI9KPrE.js} +1 -1
- package/packages/web/dist/assets/{chunk-FMBD7UC4-CnL0tA20.js → chunk-FMBD7UC4-WhfORs2z.js} +1 -1
- package/packages/web/dist/assets/{chunk-ND2GUHAM-CZGi4swC.js → chunk-ND2GUHAM-CIskmv20.js} +1 -1
- package/packages/web/dist/assets/{chunk-QZHKN3VN-Du4WKuCj.js → chunk-QZHKN3VN-CNOTpCW4.js} +1 -1
- package/packages/web/dist/assets/classDiagram-4FO5ZUOK-CI7p84hR.js +2 -0
- package/packages/web/dist/assets/classDiagram-v2-Q7XG4LA2-CI7p84hR.js +2 -0
- package/packages/web/dist/assets/{core-LJ--cHnT.js → core-usOVRkLM.js} +1 -1
- package/packages/web/dist/assets/{cose-bilkent-S5V4N54A-CEovKrYZ.js → cose-bilkent-S5V4N54A-CniuMIIW.js} +1 -1
- package/packages/web/dist/assets/{dagre-BM42HDAG-jQhK8147.js → dagre-BM42HDAG-5CteYfQY.js} +1 -1
- package/packages/web/dist/assets/{diagram-2AECGRRQ-BmiauiWQ.js → diagram-2AECGRRQ-BIQjD2LA.js} +1 -1
- package/packages/web/dist/assets/{diagram-5GNKFQAL-VYdTkqGm.js → diagram-5GNKFQAL-1vy3ErTt.js} +1 -1
- package/packages/web/dist/assets/{diagram-KO2AKTUF-DcOTKmwo.js → diagram-KO2AKTUF-D45iqFk6.js} +1 -1
- package/packages/web/dist/assets/{diagram-LMA3HP47-DaehIKcD.js → diagram-LMA3HP47-DNktDktn.js} +1 -1
- package/packages/web/dist/assets/{diagram-OG6HWLK6-DTqk6D4N.js → diagram-OG6HWLK6-BQ9JgV70.js} +1 -1
- package/packages/web/dist/assets/{erDiagram-TEJ5UH35-Dj4rI8M1.js → erDiagram-TEJ5UH35-oBasZ1uv.js} +1 -1
- package/packages/web/dist/assets/{flowDiagram-I6XJVG4X-D0FWSohH.js → flowDiagram-I6XJVG4X-DxnJHMBS.js} +1 -1
- package/packages/web/dist/assets/{format-CgkZTf5F.js → format-CIAat6sU.js} +1 -1
- package/packages/web/dist/assets/{ganttDiagram-6RSMTGT7-DgaRh12R.js → ganttDiagram-6RSMTGT7-CtJQ2m7z.js} +1 -1
- package/packages/web/dist/assets/{gitGraphDiagram-PVQCEYII-5qiry4ao.js → gitGraphDiagram-PVQCEYII-5RPscwD_.js} +1 -1
- package/packages/web/dist/assets/index-B6etJCHf.css +1 -0
- package/packages/web/dist/assets/{index-CcYeBUNk.js → index-DtRblEY_.js} +4 -4
- package/packages/web/dist/assets/{infoDiagram-5YYISTIA-CZmDwouw.js → infoDiagram-5YYISTIA-zQu3xkW4.js} +1 -1
- package/packages/web/dist/assets/{ishikawaDiagram-YF4QCWOH-knkHstDa.js → ishikawaDiagram-YF4QCWOH-ChoEjcdw.js} +1 -1
- package/packages/web/dist/assets/{journeyDiagram-JHISSGLW-ByfdmIVy.js → journeyDiagram-JHISSGLW-DM2KWmDr.js} +1 -1
- package/packages/web/dist/assets/{kanban-definition-UN3LZRKU-DSzly2xb.js → kanban-definition-UN3LZRKU-DWzTpYgh.js} +1 -1
- package/packages/web/dist/assets/{linear-BX6qYIpB.js → linear-Bpy9Aj-K.js} +1 -1
- package/packages/web/dist/assets/{mermaid.core-BXPz6_-1.js → mermaid.core-D43x5bFb.js} +4 -4
- package/packages/web/dist/assets/{mindmap-definition-RKZ34NQL-fzfZWy91.js → mindmap-definition-RKZ34NQL-BhceB-cv.js} +1 -1
- package/packages/web/dist/assets/{pieDiagram-4H26LBE5-M99j1K9t.js → pieDiagram-4H26LBE5-BgcGlFFA.js} +1 -1
- package/packages/web/dist/assets/{quadrantDiagram-W4KKPZXB-B7fKq1ce.js → quadrantDiagram-W4KKPZXB-ZRVaOoSp.js} +1 -1
- package/packages/web/dist/assets/{requirementDiagram-4Y6WPE33-xCBFrXav.js → requirementDiagram-4Y6WPE33-2hHcJHBt.js} +1 -1
- package/packages/web/dist/assets/{sankeyDiagram-5OEKKPKP-Dp9KLMhd.js → sankeyDiagram-5OEKKPKP-KPUQ9Mu5.js} +1 -1
- package/packages/web/dist/assets/{sequenceDiagram-3UESZ5HK-CNNVWpta.js → sequenceDiagram-3UESZ5HK-D4BXQSSM.js} +1 -1
- package/packages/web/dist/assets/{stateDiagram-AJRCARHV-CzKRXREb.js → stateDiagram-AJRCARHV-DftS7dIo.js} +1 -1
- package/packages/web/dist/assets/stateDiagram-v2-BHNVJYJU-CgBC1jpO.js +2 -0
- package/packages/web/dist/assets/{timeline-definition-PNZ67QCA-DfvQTe5J.js → timeline-definition-PNZ67QCA-C0OAxyWY.js} +1 -1
- package/packages/web/dist/assets/{vennDiagram-CIIHVFJN-2PBM01eq.js → vennDiagram-CIIHVFJN-C94fINN3.js} +1 -1
- package/packages/web/dist/assets/{wardley-L42UT6IY-DC1EIjci.js → wardley-L42UT6IY-CbFrlwHE.js} +1 -1
- package/packages/web/dist/assets/{wardleyDiagram-YWT4CUSO-4kYoKkfS.js → wardleyDiagram-YWT4CUSO-CHG2nndd.js} +1 -1
- package/packages/web/dist/assets/{xychartDiagram-2RQKCTM6-Bin8O1V8.js → xychartDiagram-2RQKCTM6-U9ESc19z.js} +1 -1
- package/packages/web/dist/index.html +2 -2
- package/packages/web/dist/sw.js +1 -1
- package/packages/web/dist/assets/ProjectView-CvD9WQsW.js +0 -13
- 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/index-CvGiQddO.css +0 -1
- 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-CjfwpeFj.js","assets/format-CIAat6sU.js","assets/ProjectView-BmSdUwY2.js","assets/queued-LamEU0GH.js","assets/lastTab-CU1zsF0j.js","assets/ProjectRedirect-DHoWtvtY.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
|
|
@@ -23,7 +23,7 @@ function $c(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/(function(e){function t(D,I){var
|
|
26
|
+
*/(function(e){function t(D,I){var V=D.length;D.push(I);e:for(;0<V;){var ie=V-1>>>1,ue=D[ie];if(0<l(ue,I))D[ie]=I,D[V]=ue,V=ie;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var I=D[0],V=D.pop();if(V!==I){D[0]=V;e:for(var ie=0,ue=D.length,be=ue>>>1;ie<be;){var Je=2*(ie+1)-1,Tt=D[Je],Me=Je+1,ut=D[Me];if(0>l(Tt,V))Me<ue&&0>l(ut,Tt)?(D[ie]=ut,D[Me]=V,ie=Me):(D[ie]=Tt,D[Je]=V,ie=Je);else if(Me<ue&&0>l(ut,V))D[ie]=ut,D[Me]=V,ie=Me;else break e}}return I}function l(D,I){var V=D.sortIndex-I.sortIndex;return V!==0?V:D.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var s=[],u=[],f=1,c=null,p=3,x=!1,E=!1,k=!1,T=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(D){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=D)r(u),I.sortIndex=I.expirationTime,t(s,I);else break;I=n(u)}}function S(D){if(k=!1,g(D),!E)if(n(s)!==null)E=!0,Ke(P);else{var I=n(u);I!==null&&le(S,I.startTime-D)}}function P(D,I){E=!1,k&&(k=!1,m(y),y=-1),x=!0;var V=p;try{for(g(I),c=n(s);c!==null&&(!(c.expirationTime>I)||D&&!Q());){var ie=c.callback;if(typeof ie=="function"){c.callback=null,p=c.priorityLevel;var ue=ie(c.expirationTime<=I);I=e.unstable_now(),typeof ue=="function"?c.callback=ue:c===n(s)&&r(s),g(I)}else r(s);c=n(s)}if(c!==null)var be=!0;else{var Je=n(u);Je!==null&&le(S,Je.startTime-I),be=!1}return be}finally{c=null,p=V,x=!1}}var _=!1,L=null,y=-1,F=5,O=-1;function Q(){return!(e.unstable_now()-O<F)}function te(){if(L!==null){var D=e.unstable_now();O=D;var I=!0;try{I=L(!0,D)}finally{I?pe():(_=!1,L=null)}}else _=!1}var pe;if(typeof d=="function")pe=function(){d(te)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,et=se.port2;se.port1.onmessage=te,pe=function(){et.postMessage(null)}}else pe=function(){T(te,0)};function Ke(D){L=D,_||(_=!0,pe())}function le(D,I){y=T(function(){D(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_continueExecution=function(){E||x||(E=!0,Ke(P))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(s)},e.unstable_next=function(D){switch(p){case 1:case 2:case 3:var I=3;break;default:I=p}var V=p;p=I;try{return D()}finally{p=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,I){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var V=p;p=D;try{return I()}finally{p=V}},e.unstable_scheduleCallback=function(D,I,V){var ie=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?ie+V:ie):V=ie,D){case 1:var ue=-1;break;case 2:ue=250;break;case 5:ue=1073741823;break;case 4:ue=1e4;break;default:ue=5e3}return ue=V+ue,D={id:f++,callback:I,priorityLevel:D,startTime:V,expirationTime:ue,sortIndex:-1},V>ie?(D.sortIndex=V,t(u,D),n(s)===null&&D===n(u)&&(k?(m(y),y=-1):k=!0,le(S,V-ie))):(D.sortIndex=ue,t(s,D),E||x||(E=!0,Ke(P))),D},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(D){var I=p;return function(){var V=p;p=I;try{return D.apply(this,arguments)}finally{p=V}}}})(td);ed.exports=td;var yp=ed.exports;/**
|
|
27
27
|
* @license React
|
|
28
28
|
* react-dom.production.min.js
|
|
29
29
|
*
|
|
@@ -47,7 +47,7 @@ Error generating stack: `+o.message+`
|
|
|
47
47
|
* LICENSE.md file in the root directory of this source tree.
|
|
48
48
|
*
|
|
49
49
|
* @license MIT
|
|
50
|
-
*/function me(){return me=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},me.apply(this,arguments)}var je;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(je||(je={}));const mc="popstate";function Cv(e){e===void 0&&(e={});function t(r,l){let{pathname:o,search:i,hash:a}=r.location;return yl("",{pathname:o,search:i,hash:a},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:$n(l)}return Pv(t,n,null,e)}function Y(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jv(){return Math.random().toString(36).substr(2,8)}function vc(e,t){return{usr:e.state,key:e.key,idx:t}}function yl(e,t,n,r){return n===void 0&&(n=null),me({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Sn(t):t,{state:n,key:t&&t.key||r||jv()})}function $n(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Sn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Pv(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,a=je.Pop,s=null,u=f();u==null&&(u=0,i.replaceState(me({},i.state,{idx:u}),""));function f(){return(i.state||{idx:null}).idx}function c(){a=je.Pop;let T=f(),m=T==null?null:T-u;u=T,s&&s({action:a,location:k.location,delta:m})}function p(T,m){a=je.Push;let d=yl(k.location,T,m);u=f()+1;let g=vc(d,u),S=k.createHref(d);try{i.pushState(g,"",S)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(S)}o&&s&&s({action:a,location:k.location,delta:1})}function x(T,m){a=je.Replace;let d=yl(k.location,T,m);u=f();let g=vc(d,u),S=k.createHref(d);i.replaceState(g,"",S),o&&s&&s({action:a,location:k.location,delta:0})}function E(T){let m=l.location.origin!=="null"?l.location.origin:l.location.href,d=typeof T=="string"?T:$n(T);return d=d.replace(/ $/,"%20"),Y(m,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,m)}let k={get action(){return a},get location(){return e(l,i)},listen(T){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(mc,c),s=T,()=>{l.removeEventListener(mc,c),s=null}},createHref(T){return t(l,T)},createURL:E,encodeLocation(T){let m=E(T);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:x,go(T){return i.go(T)}};return k}var oe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(oe||(oe={}));const Nv=new Set(["lazy","caseSensitive","path","id","index","children"]);function Rv(e){return e.index===!0}function wl(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((l,o)=>{let i=[...n,String(o)],a=typeof l.id=="string"?l.id:i.join("-");if(Y(l.index!==!0||!l.children,"Cannot specify children on an index route"),Y(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),Rv(l)){let s=me({},l,t(l),{id:a});return r[a]=s,s}else{let s=me({},l,t(l),{id:a,children:void 0});return r[a]=s,l.children&&(s.children=wl(l.children,t,i,r)),s}})}function Nn(e,t,n){return n===void 0&&(n="/"),mo(e,t,n,!1)}function mo(e,t,n,r){let l=typeof t=="string"?Sn(t):t,o=Qt(l.pathname||"/",n);if(o==null)return null;let i=th(e);Tv(i);let a=null;for(let s=0;a==null&&s<i.length;++s){let u=Bv(o);a=$v(i[s],u,r)}return a}function _v(e,t){let{route:n,pathname:r,params:l}=e;return{id:n.id,pathname:r,params:l,data:t[n.id],handle:n.handle}}function th(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(o,i,a)=>{let s={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};s.relativePath.startsWith("/")&&(Y(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=At([r,s.relativePath]),f=n.concat(s);o.children&&o.children.length>0&&(Y(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),th(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Uv(u,o.index),routesMeta:f})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))l(o,i);else for(let s of nh(o.path))l(o,i,s)}),t}function nh(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=nh(r.join("/")),a=[];return a.push(...i.map(s=>s===""?o:[o,s].join("/"))),l&&a.push(...i),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function Tv(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Fv(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Lv=/^:[\w-]+$/,Mv=3,Dv=2,Iv=1,Ov=10,zv=-2,gc=e=>e==="*";function Uv(e,t){let n=e.split("/"),r=n.length;return n.some(gc)&&(r+=zv),t&&(r+=Dv),n.filter(l=>!gc(l)).reduce((l,o)=>l+(Lv.test(o)?Mv:o===""?Iv:Ov),r)}function Fv(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function $v(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a<r.length;++a){let s=r[a],u=a===r.length-1,f=o==="/"?t:t.slice(o.length)||"/",c=Ao({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},f),p=s.route;if(!c&&u&&n&&!r[r.length-1].route.index&&(c=Ao({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},f)),!c)return null;Object.assign(l,c.params),i.push({params:l,pathname:At([o,c.pathname]),pathnameBase:Hv(At([o,c.pathnameBase])),route:p}),c.pathnameBase!=="/"&&(o=At([o,c.pathnameBase]))}return i}function Ao(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Av(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],i=o.replace(/(.)\/+$/,"$1"),a=l.slice(1);return{params:r.reduce((u,f,c)=>{let{paramName:p,isOptional:x}=f;if(p==="*"){let k=a[c]||"";i=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const E=a[c];return x&&!E?u[p]=void 0:u[p]=(E||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Av(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),kr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Bv(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return kr(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Qt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Wv(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Sn(e):e;return{pathname:n?n.startsWith("/")?n:Vv(n,t):t,search:Qv(r),hash:Kv(l)}}function Vv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function $i(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function rh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function oi(e,t){let n=rh(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ii(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=Sn(e):(l=me({},e),Y(!l.pathname||!l.pathname.includes("?"),$i("?","pathname","search",l)),Y(!l.pathname||!l.pathname.includes("#"),$i("#","pathname","hash",l)),Y(!l.search||!l.search.includes("#"),$i("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,a;if(i==null)a=n;else{let c=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),c-=1;l.pathname=p.join("/")}a=c>=0?t[c]:"/"}let s=Wv(l,a),u=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||f)&&(s.pathname+="/"),s}const At=e=>e.join("/").replace(/\/\/+/g,"/"),Hv=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Qv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Kv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Bo{constructor(t,n,r,l){l===void 0&&(l=!1),this.status=t,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ai(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lh=["post","put","patch","delete"],bv=new Set(lh),Jv=["get",...lh],Yv=new Set(Jv),Gv=new Set([301,302,303,307,308]),Xv=new Set([307,308]),Ai={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Zv={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Fr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Os=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qv=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),oh="remix-router-transitions";function eg(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Y(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l;if(e.mapRouteProperties)l=e.mapRouteProperties;else if(e.detectErrorBoundary){let v=e.detectErrorBoundary;l=w=>({hasErrorBoundary:v(w)})}else l=qv;let o={},i=wl(e.routes,l,void 0,o),a,s=e.basename||"/",u=e.unstable_dataStrategy||ig,f=e.unstable_patchRoutesOnNavigation,c=me({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,x=new Set,E=1e3,k=new Set,T=null,m=null,d=null,g=e.hydrationData!=null,S=Nn(i,e.history.location,s),P=null;if(S==null&&!f){let v=Be(404,{pathname:e.history.location.pathname}),{matches:w,route:j}=Pc(i);S=w,P={[j.id]:v}}S&&!e.hydrationData&&Ml(S,i,e.history.location.pathname).active&&(S=null);let _;if(S)if(S.some(v=>v.route.lazy))_=!1;else if(!S.some(v=>v.route.loader))_=!0;else if(c.v7_partialHydration){let v=e.hydrationData?e.hydrationData.loaderData:null,w=e.hydrationData?e.hydrationData.errors:null,j=N=>N.route.loader?typeof N.route.loader=="function"&&N.route.loader.hydrate===!0?!1:v&&v[N.route.id]!==void 0||w&&w[N.route.id]!==void 0:!0;if(w){let N=S.findIndex(z=>w[z.route.id]!==void 0);_=S.slice(0,N+1).every(j)}else _=S.every(j)}else _=e.hydrationData!=null;else if(_=!1,S=[],c.v7_partialHydration){let v=Ml(null,i,e.history.location.pathname);v.active&&v.matches&&(S=v.matches)}let L,y={historyAction:e.history.action,location:e.history.location,matches:S,initialized:_,navigation:Ai,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||P,fetchers:new Map,blockers:new Map},F=je.Pop,O=!1,Q,te=!1,pe=new Map,se=null,et=!1,Ke=!1,le=[],D=new Set,I=new Map,W=0,ie=-1,ue=new Map,be=new Set,Je=new Map,Tt=new Map,Me=new Set,ut=new Map,kn=new Map,Th=new Map,Rl;function Lh(){if(p=e.history.listen(v=>{let{action:w,location:j,delta:N}=v;if(Rl){Rl(),Rl=void 0;return}kr(kn.size===0||N!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let z=eu({currentLocation:y.location,nextLocation:j,historyAction:w});if(z&&N!=null){let B=new Promise(K=>{Rl=K});e.history.go(N*-1),Tl(z,{state:"blocked",location:j,proceed(){Tl(z,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),B.then(()=>e.history.go(N))},reset(){let K=new Map(y.blockers);K.set(z,Fr),Ae({blockers:K})}});return}return En(w,j)}),n){Sg(t,pe);let v=()=>kg(t,pe);t.addEventListener("pagehide",v),se=()=>t.removeEventListener("pagehide",v)}return y.initialized||En(je.Pop,y.location,{initialHydration:!0}),L}function Mh(){p&&p(),se&&se(),x.clear(),Q&&Q.abort(),y.fetchers.forEach((v,w)=>_l(w)),y.blockers.forEach((v,w)=>qs(w))}function Dh(v){return x.add(v),()=>x.delete(v)}function Ae(v,w){w===void 0&&(w={}),y=me({},y,v);let j=[],N=[];c.v7_fetcherPersist&&y.fetchers.forEach((z,B)=>{z.state==="idle"&&(Me.has(B)?N.push(B):j.push(B))}),[...x].forEach(z=>z(y,{deletedFetchers:N,unstable_viewTransitionOpts:w.viewTransitionOpts,unstable_flushSync:w.flushSync===!0})),c.v7_fetcherPersist&&(j.forEach(z=>y.fetchers.delete(z)),N.forEach(z=>_l(z)))}function Vn(v,w,j){var N,z;let{flushSync:B}=j===void 0?{}:j,K=y.actionData!=null&&y.navigation.formMethod!=null&&wt(y.navigation.formMethod)&&y.navigation.state==="loading"&&((N=v.state)==null?void 0:N._isRedirect)!==!0,M;w.actionData?Object.keys(w.actionData).length>0?M=w.actionData:M=null:K?M=y.actionData:M=null;let V=w.loaderData?Cc(y.loaderData,w.loaderData,w.matches||[],w.errors):y.loaderData,$=y.blockers;$.size>0&&($=new Map($),$.forEach((ne,ce)=>$.set(ce,Fr)));let A=O===!0||y.navigation.formMethod!=null&&wt(y.navigation.formMethod)&&((z=v.state)==null?void 0:z._isRedirect)!==!0;a&&(i=a,a=void 0),et||F===je.Pop||(F===je.Push?e.history.push(v,v.state):F===je.Replace&&e.history.replace(v,v.state));let ee;if(F===je.Pop){let ne=pe.get(y.location.pathname);ne&&ne.has(v.pathname)?ee={currentLocation:y.location,nextLocation:v}:pe.has(v.pathname)&&(ee={currentLocation:v,nextLocation:y.location})}else if(te){let ne=pe.get(y.location.pathname);ne?ne.add(v.pathname):(ne=new Set([v.pathname]),pe.set(y.location.pathname,ne)),ee={currentLocation:y.location,nextLocation:v}}Ae(me({},w,{actionData:M,loaderData:V,historyAction:F,location:v,initialized:!0,navigation:Ai,revalidation:"idle",restoreScrollPosition:nu(v,w.matches||y.matches),preventScrollReset:A,blockers:$}),{viewTransitionOpts:ee,flushSync:B===!0}),F=je.Pop,O=!1,te=!1,et=!1,Ke=!1,le=[]}async function Ks(v,w){if(typeof v=="number"){e.history.go(v);return}let j=Oa(y.location,y.matches,s,c.v7_prependBasename,v,c.v7_relativeSplatPath,w==null?void 0:w.fromRouteId,w==null?void 0:w.relative),{path:N,submission:z,error:B}=yc(c.v7_normalizeFormMethod,!1,j,w),K=y.location,M=yl(y.location,N,w&&w.state);M=me({},M,e.history.encodeLocation(M));let V=w&&w.replace!=null?w.replace:void 0,$=je.Push;V===!0?$=je.Replace:V===!1||z!=null&&wt(z.formMethod)&&z.formAction===y.location.pathname+y.location.search&&($=je.Replace);let A=w&&"preventScrollReset"in w?w.preventScrollReset===!0:void 0,ee=(w&&w.unstable_flushSync)===!0,ne=eu({currentLocation:K,nextLocation:M,historyAction:$});if(ne){Tl(ne,{state:"blocked",location:M,proceed(){Tl(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:M}),Ks(v,w)},reset(){let ce=new Map(y.blockers);ce.set(ne,Fr),Ae({blockers:ce})}});return}return await En($,M,{submission:z,pendingError:B,preventScrollReset:A,replace:w&&w.replace,enableViewTransition:w&&w.unstable_viewTransition,flushSync:ee})}function Ih(){if(ci(),Ae({revalidation:"loading"}),y.navigation.state!=="submitting"){if(y.navigation.state==="idle"){En(y.historyAction,y.location,{startUninterruptedRevalidation:!0});return}En(F||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:te===!0})}}async function En(v,w,j){Q&&Q.abort(),Q=null,F=v,et=(j&&j.startUninterruptedRevalidation)===!0,Hh(y.location,y.matches),O=(j&&j.preventScrollReset)===!0,te=(j&&j.enableViewTransition)===!0;let N=a||i,z=j&&j.overrideNavigation,B=Nn(N,w,s),K=(j&&j.flushSync)===!0,M=Ml(B,N,w.pathname);if(M.active&&M.matches&&(B=M.matches),!B){let{error:Z,notFoundMatches:_e,route:Ce}=di(w.pathname);Vn(w,{matches:_e,loaderData:{},errors:{[Ce.id]:Z}},{flushSync:K});return}if(y.initialized&&!Ke&&fg(y.location,w)&&!(j&&j.submission&&wt(j.submission.formMethod))){Vn(w,{matches:B},{flushSync:K});return}Q=new AbortController;let V=Kn(e.history,w,Q.signal,j&&j.submission),$;if(j&&j.pendingError)$=[ir(B).route.id,{type:oe.error,error:j.pendingError}];else if(j&&j.submission&&wt(j.submission.formMethod)){let Z=await Oh(V,w,j.submission,B,M.active,{replace:j.replace,flushSync:K});if(Z.shortCircuited)return;if(Z.pendingActionResult){let[_e,Ce]=Z.pendingActionResult;if(rt(Ce)&&ai(Ce.error)&&Ce.error.status===404){Q=null,Vn(w,{matches:Z.matches,loaderData:{},errors:{[_e]:Ce.error}});return}}B=Z.matches||B,$=Z.pendingActionResult,z=Bi(w,j.submission),K=!1,M.active=!1,V=Kn(e.history,V.url,V.signal)}let{shortCircuited:A,matches:ee,loaderData:ne,errors:ce}=await zh(V,w,B,M.active,z,j&&j.submission,j&&j.fetcherSubmission,j&&j.replace,j&&j.initialHydration===!0,K,$);A||(Q=null,Vn(w,me({matches:ee||B},jc($),{loaderData:ne,errors:ce})))}async function Oh(v,w,j,N,z,B){B===void 0&&(B={}),ci();let K=wg(w,j);if(Ae({navigation:K},{flushSync:B.flushSync===!0}),z){let $=await Dl(N,w.pathname,v.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){let{boundaryId:A,error:ee}=Ll(w.pathname,$);return{matches:$.partialMatches,pendingActionResult:[A,{type:oe.error,error:ee}]}}else if($.matches)N=$.matches;else{let{notFoundMatches:A,error:ee,route:ne}=di(w.pathname);return{matches:A,pendingActionResult:[ne.id,{type:oe.error,error:ee}]}}}let M,V=Qr(N,w);if(!V.route.action&&!V.route.lazy)M={type:oe.error,error:Be(405,{method:v.method,pathname:w.pathname,routeId:V.route.id})};else if(M=(await Rr("action",y,v,[V],N,null))[V.route.id],v.signal.aborted)return{shortCircuited:!0};if(Ln(M)){let $;return B&&B.replace!=null?$=B.replace:$=Sc(M.response.headers.get("Location"),new URL(v.url),s)===y.location.pathname+y.location.search,await Cn(v,M,!0,{submission:j,replace:$}),{shortCircuited:!0}}if(on(M))throw Be(400,{type:"defer-action"});if(rt(M)){let $=ir(N,V.route.id);return(B&&B.replace)!==!0&&(F=je.Push),{matches:N,pendingActionResult:[$.route.id,M]}}return{matches:N,pendingActionResult:[V.route.id,M]}}async function zh(v,w,j,N,z,B,K,M,V,$,A){let ee=z||Bi(w,B),ne=B||K||Rc(ee),ce=!et&&(!c.v7_partialHydration||!V);if(N){if(ce){let we=bs(A);Ae(me({navigation:ee},we!==void 0?{actionData:we}:{}),{flushSync:$})}let J=await Dl(j,w.pathname,v.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let{boundaryId:we,error:tt}=Ll(w.pathname,J);return{matches:J.partialMatches,loaderData:{},errors:{[we]:tt}}}else if(J.matches)j=J.matches;else{let{error:we,notFoundMatches:tt,route:xe}=di(w.pathname);return{matches:tt,loaderData:{},errors:{[xe.id]:we}}}}let Z=a||i,[_e,Ce]=wc(e.history,y,j,ne,w,c.v7_partialHydration&&V===!0,c.v7_skipActionErrorRevalidation,Ke,le,D,Me,Je,be,Z,s,A);if(fi(J=>!(j&&j.some(we=>we.route.id===J))||_e&&_e.some(we=>we.route.id===J)),ie=++W,_e.length===0&&Ce.length===0){let J=Xs();return Vn(w,me({matches:j,loaderData:{},errors:A&&rt(A[1])?{[A[0]]:A[1].error}:null},jc(A),J?{fetchers:new Map(y.fetchers)}:{}),{flushSync:$}),{shortCircuited:!0}}if(ce){let J={};if(!N){J.navigation=ee;let we=bs(A);we!==void 0&&(J.actionData=we)}Ce.length>0&&(J.fetchers=Uh(Ce)),Ae(J,{flushSync:$})}Ce.forEach(J=>{I.has(J.key)&&Yt(J.key),J.controller&&I.set(J.key,J.controller)});let _r=()=>Ce.forEach(J=>Yt(J.key));Q&&Q.signal.addEventListener("abort",_r);let{loaderResults:Mt,fetcherResults:Hn}=await Js(y,j,_e,Ce,v);if(v.signal.aborted)return{shortCircuited:!0};Q&&Q.signal.removeEventListener("abort",_r),Ce.forEach(J=>I.delete(J.key));let Gt=to(Mt);if(Gt)return await Cn(v,Gt.result,!0,{replace:M}),{shortCircuited:!0};if(Gt=to(Hn),Gt)return be.add(Gt.key),await Cn(v,Gt.result,!0,{replace:M}),{shortCircuited:!0};let{loaderData:Il,errors:Dt}=Ec(y,j,_e,Mt,A,Ce,Hn,ut);ut.forEach((J,we)=>{J.subscribe(tt=>{(tt||J.done)&&ut.delete(we)})}),c.v7_partialHydration&&V&&y.errors&&Object.entries(y.errors).filter(J=>{let[we]=J;return!_e.some(tt=>tt.route.id===we)}).forEach(J=>{let[we,tt]=J;Dt=Object.assign(Dt||{},{[we]:tt})});let Ol=Xs(),zl=Zs(ie),Ul=Ol||zl||Ce.length>0;return me({matches:j,loaderData:Il,errors:Dt},Ul?{fetchers:new Map(y.fetchers)}:{})}function bs(v){if(v&&!rt(v[1]))return{[v[0]]:v[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function Uh(v){return v.forEach(w=>{let j=y.fetchers.get(w.key),N=$r(void 0,j?j.data:void 0);y.fetchers.set(w.key,N)}),new Map(y.fetchers)}function Fh(v,w,j,N){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");I.has(v)&&Yt(v);let z=(N&&N.unstable_flushSync)===!0,B=a||i,K=Oa(y.location,y.matches,s,c.v7_prependBasename,j,c.v7_relativeSplatPath,w,N==null?void 0:N.relative),M=Nn(B,K,s),V=Ml(M,B,K);if(V.active&&V.matches&&(M=V.matches),!M){Lt(v,w,Be(404,{pathname:K}),{flushSync:z});return}let{path:$,submission:A,error:ee}=yc(c.v7_normalizeFormMethod,!0,K,N);if(ee){Lt(v,w,ee,{flushSync:z});return}let ne=Qr(M,$);if(O=(N&&N.preventScrollReset)===!0,A&&wt(A.formMethod)){$h(v,w,$,ne,M,V.active,z,A);return}Je.set(v,{routeId:w,path:$}),Ah(v,w,$,ne,M,V.active,z,A)}async function $h(v,w,j,N,z,B,K,M){ci(),Je.delete(v);function V(xe){if(!xe.route.action&&!xe.route.lazy){let It=Be(405,{method:M.formMethod,pathname:j,routeId:w});return Lt(v,w,It,{flushSync:K}),!0}return!1}if(!B&&V(N))return;let $=y.fetchers.get(v);Jt(v,xg(M,$),{flushSync:K});let A=new AbortController,ee=Kn(e.history,j,A.signal,M);if(B){let xe=await Dl(z,j,ee.signal);if(xe.type==="aborted")return;if(xe.type==="error"){let{error:It}=Ll(j,xe);Lt(v,w,It,{flushSync:K});return}else if(xe.matches){if(z=xe.matches,N=Qr(z,j),V(N))return}else{Lt(v,w,Be(404,{pathname:j}),{flushSync:K});return}}I.set(v,A);let ne=W,Z=(await Rr("action",y,ee,[N],z,v))[N.route.id];if(ee.signal.aborted){I.get(v)===A&&I.delete(v);return}if(c.v7_fetcherPersist&&Me.has(v)){if(Ln(Z)||rt(Z)){Jt(v,Zt(void 0));return}}else{if(Ln(Z))if(I.delete(v),ie>ne){Jt(v,Zt(void 0));return}else return be.add(v),Jt(v,$r(M)),Cn(ee,Z,!1,{fetcherSubmission:M});if(rt(Z)){Lt(v,w,Z.error);return}}if(on(Z))throw Be(400,{type:"defer-action"});let _e=y.navigation.location||y.location,Ce=Kn(e.history,_e,A.signal),_r=a||i,Mt=y.navigation.state!=="idle"?Nn(_r,y.navigation.location,s):y.matches;Y(Mt,"Didn't find any matches after fetcher action");let Hn=++W;ue.set(v,Hn);let Gt=$r(M,Z.data);y.fetchers.set(v,Gt);let[Il,Dt]=wc(e.history,y,Mt,M,_e,!1,c.v7_skipActionErrorRevalidation,Ke,le,D,Me,Je,be,_r,s,[N.route.id,Z]);Dt.filter(xe=>xe.key!==v).forEach(xe=>{let It=xe.key,lu=y.fetchers.get(It),bh=$r(void 0,lu?lu.data:void 0);y.fetchers.set(It,bh),I.has(It)&&Yt(It),xe.controller&&I.set(It,xe.controller)}),Ae({fetchers:new Map(y.fetchers)});let Ol=()=>Dt.forEach(xe=>Yt(xe.key));A.signal.addEventListener("abort",Ol);let{loaderResults:zl,fetcherResults:Ul}=await Js(y,Mt,Il,Dt,Ce);if(A.signal.aborted)return;A.signal.removeEventListener("abort",Ol),ue.delete(v),I.delete(v),Dt.forEach(xe=>I.delete(xe.key));let J=to(zl);if(J)return Cn(Ce,J.result,!1);if(J=to(Ul),J)return be.add(J.key),Cn(Ce,J.result,!1);let{loaderData:we,errors:tt}=Ec(y,Mt,Il,zl,void 0,Dt,Ul,ut);if(y.fetchers.has(v)){let xe=Zt(Z.data);y.fetchers.set(v,xe)}Zs(Hn),y.navigation.state==="loading"&&Hn>ie?(Y(F,"Expected pending action"),Q&&Q.abort(),Vn(y.navigation.location,{matches:Mt,loaderData:we,errors:tt,fetchers:new Map(y.fetchers)})):(Ae({errors:tt,loaderData:Cc(y.loaderData,we,Mt,tt),fetchers:new Map(y.fetchers)}),Ke=!1)}async function Ah(v,w,j,N,z,B,K,M){let V=y.fetchers.get(v);Jt(v,$r(M,V?V.data:void 0),{flushSync:K});let $=new AbortController,A=Kn(e.history,j,$.signal);if(B){let Z=await Dl(z,j,A.signal);if(Z.type==="aborted")return;if(Z.type==="error"){let{error:_e}=Ll(j,Z);Lt(v,w,_e,{flushSync:K});return}else if(Z.matches)z=Z.matches,N=Qr(z,j);else{Lt(v,w,Be(404,{pathname:j}),{flushSync:K});return}}I.set(v,$);let ee=W,ce=(await Rr("loader",y,A,[N],z,v))[N.route.id];if(on(ce)&&(ce=await zs(ce,A.signal,!0)||ce),I.get(v)===$&&I.delete(v),!A.signal.aborted){if(Me.has(v)){Jt(v,Zt(void 0));return}if(Ln(ce))if(ie>ee){Jt(v,Zt(void 0));return}else{be.add(v),await Cn(A,ce,!1);return}if(rt(ce)){Lt(v,w,ce.error);return}Y(!on(ce),"Unhandled fetcher deferred data"),Jt(v,Zt(ce.data))}}async function Cn(v,w,j,N){let{submission:z,fetcherSubmission:B,replace:K}=N===void 0?{}:N;w.response.headers.has("X-Remix-Revalidate")&&(Ke=!0);let M=w.response.headers.get("Location");Y(M,"Expected a Location header on the redirect Response"),M=Sc(M,new URL(v.url),s);let V=yl(y.location,M,{_isRedirect:!0});if(n){let Z=!1;if(w.response.headers.has("X-Remix-Reload-Document"))Z=!0;else if(Os.test(M)){const _e=e.history.createURL(M);Z=_e.origin!==t.location.origin||Qt(_e.pathname,s)==null}if(Z){K?t.location.replace(M):t.location.assign(M);return}}Q=null;let $=K===!0||w.response.headers.has("X-Remix-Replace")?je.Replace:je.Push,{formMethod:A,formAction:ee,formEncType:ne}=y.navigation;!z&&!B&&A&&ee&&ne&&(z=Rc(y.navigation));let ce=z||B;if(Xv.has(w.response.status)&&ce&&wt(ce.formMethod))await En($,V,{submission:me({},ce,{formAction:M}),preventScrollReset:O,enableViewTransition:j?te:void 0});else{let Z=Bi(V,z);await En($,V,{overrideNavigation:Z,fetcherSubmission:B,preventScrollReset:O,enableViewTransition:j?te:void 0})}}async function Rr(v,w,j,N,z,B){let K,M={};try{K=await ag(u,v,w,j,N,z,B,o,l)}catch(V){return N.forEach($=>{M[$.route.id]={type:oe.error,error:V}}),M}for(let[V,$]of Object.entries(K))if(pg($)){let A=$.result;M[V]={type:oe.redirect,response:cg(A,j,V,z,s,c.v7_relativeSplatPath)}}else M[V]=await ug($);return M}async function Js(v,w,j,N,z){let B=v.matches,K=Rr("loader",v,z,j,w,null),M=Promise.all(N.map(async A=>{if(A.matches&&A.match&&A.controller){let ne=(await Rr("loader",v,Kn(e.history,A.path,A.controller.signal),[A.match],A.matches,A.key))[A.match.route.id];return{[A.key]:ne}}else return Promise.resolve({[A.key]:{type:oe.error,error:Be(404,{pathname:A.path})}})})),V=await K,$=(await M).reduce((A,ee)=>Object.assign(A,ee),{});return await Promise.all([gg(w,V,z.signal,B,v.loaderData),yg(w,$,N)]),{loaderResults:V,fetcherResults:$}}function ci(){Ke=!0,le.push(...fi()),Je.forEach((v,w)=>{I.has(w)&&(D.add(w),Yt(w))})}function Jt(v,w,j){j===void 0&&(j={}),y.fetchers.set(v,w),Ae({fetchers:new Map(y.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function Lt(v,w,j,N){N===void 0&&(N={});let z=ir(y.matches,w);_l(v),Ae({errors:{[z.route.id]:j},fetchers:new Map(y.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function Ys(v){return c.v7_fetcherPersist&&(Tt.set(v,(Tt.get(v)||0)+1),Me.has(v)&&Me.delete(v)),y.fetchers.get(v)||Zv}function _l(v){let w=y.fetchers.get(v);I.has(v)&&!(w&&w.state==="loading"&&ue.has(v))&&Yt(v),Je.delete(v),ue.delete(v),be.delete(v),Me.delete(v),D.delete(v),y.fetchers.delete(v)}function Bh(v){if(c.v7_fetcherPersist){let w=(Tt.get(v)||0)-1;w<=0?(Tt.delete(v),Me.add(v)):Tt.set(v,w)}else _l(v);Ae({fetchers:new Map(y.fetchers)})}function Yt(v){let w=I.get(v);Y(w,"Expected fetch controller: "+v),w.abort(),I.delete(v)}function Gs(v){for(let w of v){let j=Ys(w),N=Zt(j.data);y.fetchers.set(w,N)}}function Xs(){let v=[],w=!1;for(let j of be){let N=y.fetchers.get(j);Y(N,"Expected fetcher: "+j),N.state==="loading"&&(be.delete(j),v.push(j),w=!0)}return Gs(v),w}function Zs(v){let w=[];for(let[j,N]of ue)if(N<v){let z=y.fetchers.get(j);Y(z,"Expected fetcher: "+j),z.state==="loading"&&(Yt(j),ue.delete(j),w.push(j))}return Gs(w),w.length>0}function Wh(v,w){let j=y.blockers.get(v)||Fr;return kn.get(v)!==w&&kn.set(v,w),j}function qs(v){y.blockers.delete(v),kn.delete(v)}function Tl(v,w){let j=y.blockers.get(v)||Fr;Y(j.state==="unblocked"&&w.state==="blocked"||j.state==="blocked"&&w.state==="blocked"||j.state==="blocked"&&w.state==="proceeding"||j.state==="blocked"&&w.state==="unblocked"||j.state==="proceeding"&&w.state==="unblocked","Invalid blocker state transition: "+j.state+" -> "+w.state);let N=new Map(y.blockers);N.set(v,w),Ae({blockers:N})}function eu(v){let{currentLocation:w,nextLocation:j,historyAction:N}=v;if(kn.size===0)return;kn.size>1&&kr(!1,"A router only supports one blocker at a time");let z=Array.from(kn.entries()),[B,K]=z[z.length-1],M=y.blockers.get(B);if(!(M&&M.state==="proceeding")&&K({currentLocation:w,nextLocation:j,historyAction:N}))return B}function di(v){let w=Be(404,{pathname:v}),j=a||i,{matches:N,route:z}=Pc(j);return fi(),{notFoundMatches:N,route:z,error:w}}function Ll(v,w){return{boundaryId:ir(w.partialMatches).route.id,error:Be(400,{type:"route-discovery",pathname:v,message:w.error!=null&&"message"in w.error?w.error:String(w.error)})}}function fi(v){let w=[];return ut.forEach((j,N)=>{(!v||v(N))&&(j.cancel(),w.push(N),ut.delete(N))}),w}function Vh(v,w,j){if(T=v,d=w,m=j||null,!g&&y.navigation===Ai){g=!0;let N=nu(y.location,y.matches);N!=null&&Ae({restoreScrollPosition:N})}return()=>{T=null,d=null,m=null}}function tu(v,w){return m&&m(v,w.map(N=>_v(N,y.loaderData)))||v.key}function Hh(v,w){if(T&&d){let j=tu(v,w);T[j]=d()}}function nu(v,w){if(T){let j=tu(v,w),N=T[j];if(typeof N=="number")return N}return null}function Ml(v,w,j){if(f){if(k.has(j))return{active:!1,matches:v};if(v){if(Object.keys(v[0].params).length>0)return{active:!0,matches:mo(w,j,s,!0)}}else return{active:!0,matches:mo(w,j,s,!0)||[]}}return{active:!1,matches:null}}async function Dl(v,w,j){let N=v;for(;;){let z=a==null,B=a||i;try{await lg(f,w,N,B,o,l,Th,j)}catch(V){return{type:"error",error:V,partialMatches:N}}finally{z&&(i=[...i])}if(j.aborted)return{type:"aborted"};let K=Nn(B,w,s);if(K)return ru(w,k),{type:"success",matches:K};let M=mo(B,w,s,!0);if(!M||N.length===M.length&&N.every((V,$)=>V.route.id===M[$].route.id))return ru(w,k),{type:"success",matches:null};N=M}}function ru(v,w){if(w.size>=E){let j=w.values().next().value;w.delete(j)}w.add(v)}function Qh(v){o={},a=wl(v,l,void 0,o)}function Kh(v,w){let j=a==null;ah(v,w,a||i,o,l),j&&(i=[...i],Ae({}))}return L={get basename(){return s},get future(){return c},get state(){return y},get routes(){return i},get window(){return t},initialize:Lh,subscribe:Dh,enableScrollRestoration:Vh,navigate:Ks,fetch:Fh,revalidate:Ih,createHref:v=>e.history.createHref(v),encodeLocation:v=>e.history.encodeLocation(v),getFetcher:Ys,deleteFetcher:Bh,dispose:Mh,getBlocker:Wh,deleteBlocker:qs,patchRoutes:Kh,_internalFetchControllers:I,_internalActiveDeferreds:ut,_internalSetRoutes:Qh},L}function tg(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Oa(e,t,n,r,l,o,i,a){let s,u;if(i){s=[];for(let c of t)if(s.push(c),c.route.id===i){u=c;break}}else s=t,u=t[t.length-1];let f=ii(l||".",oi(s,o),Qt(e.pathname,n)||e.pathname,a==="path");return l==null&&(f.search=e.search,f.hash=e.hash),(l==null||l===""||l===".")&&u&&u.route.index&&!Us(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:At([n,f.pathname])),$n(f)}function yc(e,t,n,r){if(!r||!tg(r))return{path:n};if(r.formMethod&&!vg(r.formMethod))return{path:n,error:Be(405,{method:r.formMethod})};let l=()=>({path:n,error:Be(400,{type:"invalid-body"})}),o=r.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),a=sh(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!wt(i))return l();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((x,E)=>{let[k,T]=E;return""+x+k+"="+T+`
|
|
50
|
+
*/function me(){return me=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},me.apply(this,arguments)}var je;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(je||(je={}));const mc="popstate";function Cv(e){e===void 0&&(e={});function t(r,l){let{pathname:o,search:i,hash:a}=r.location;return yl("",{pathname:o,search:i,hash:a},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:$n(l)}return Pv(t,n,null,e)}function Y(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jv(){return Math.random().toString(36).substr(2,8)}function vc(e,t){return{usr:e.state,key:e.key,idx:t}}function yl(e,t,n,r){return n===void 0&&(n=null),me({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Sn(t):t,{state:n,key:t&&t.key||r||jv()})}function $n(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Sn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Pv(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,a=je.Pop,s=null,u=f();u==null&&(u=0,i.replaceState(me({},i.state,{idx:u}),""));function f(){return(i.state||{idx:null}).idx}function c(){a=je.Pop;let T=f(),m=T==null?null:T-u;u=T,s&&s({action:a,location:k.location,delta:m})}function p(T,m){a=je.Push;let d=yl(k.location,T,m);u=f()+1;let g=vc(d,u),S=k.createHref(d);try{i.pushState(g,"",S)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;l.location.assign(S)}o&&s&&s({action:a,location:k.location,delta:1})}function x(T,m){a=je.Replace;let d=yl(k.location,T,m);u=f();let g=vc(d,u),S=k.createHref(d);i.replaceState(g,"",S),o&&s&&s({action:a,location:k.location,delta:0})}function E(T){let m=l.location.origin!=="null"?l.location.origin:l.location.href,d=typeof T=="string"?T:$n(T);return d=d.replace(/ $/,"%20"),Y(m,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,m)}let k={get action(){return a},get location(){return e(l,i)},listen(T){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(mc,c),s=T,()=>{l.removeEventListener(mc,c),s=null}},createHref(T){return t(l,T)},createURL:E,encodeLocation(T){let m=E(T);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:x,go(T){return i.go(T)}};return k}var oe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(oe||(oe={}));const Nv=new Set(["lazy","caseSensitive","path","id","index","children"]);function Rv(e){return e.index===!0}function wl(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((l,o)=>{let i=[...n,String(o)],a=typeof l.id=="string"?l.id:i.join("-");if(Y(l.index!==!0||!l.children,"Cannot specify children on an index route"),Y(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),Rv(l)){let s=me({},l,t(l),{id:a});return r[a]=s,s}else{let s=me({},l,t(l),{id:a,children:void 0});return r[a]=s,l.children&&(s.children=wl(l.children,t,i,r)),s}})}function Nn(e,t,n){return n===void 0&&(n="/"),mo(e,t,n,!1)}function mo(e,t,n,r){let l=typeof t=="string"?Sn(t):t,o=Qt(l.pathname||"/",n);if(o==null)return null;let i=th(e);Tv(i);let a=null;for(let s=0;a==null&&s<i.length;++s){let u=Bv(o);a=$v(i[s],u,r)}return a}function _v(e,t){let{route:n,pathname:r,params:l}=e;return{id:n.id,pathname:r,params:l,data:t[n.id],handle:n.handle}}function th(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let l=(o,i,a)=>{let s={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};s.relativePath.startsWith("/")&&(Y(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let u=At([r,s.relativePath]),f=n.concat(s);o.children&&o.children.length>0&&(Y(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),th(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Uv(u,o.index),routesMeta:f})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))l(o,i);else for(let s of nh(o.path))l(o,i,s)}),t}function nh(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=nh(r.join("/")),a=[];return a.push(...i.map(s=>s===""?o:[o,s].join("/"))),l&&a.push(...i),a.map(s=>e.startsWith("/")&&s===""?"/":s)}function Tv(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Fv(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Lv=/^:[\w-]+$/,Mv=3,Dv=2,Iv=1,Ov=10,zv=-2,gc=e=>e==="*";function Uv(e,t){let n=e.split("/"),r=n.length;return n.some(gc)&&(r+=zv),t&&(r+=Dv),n.filter(l=>!gc(l)).reduce((l,o)=>l+(Lv.test(o)?Mv:o===""?Iv:Ov),r)}function Fv(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function $v(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a<r.length;++a){let s=r[a],u=a===r.length-1,f=o==="/"?t:t.slice(o.length)||"/",c=Ao({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},f),p=s.route;if(!c&&u&&n&&!r[r.length-1].route.index&&(c=Ao({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},f)),!c)return null;Object.assign(l,c.params),i.push({params:l,pathname:At([o,c.pathname]),pathnameBase:Hv(At([o,c.pathnameBase])),route:p}),c.pathnameBase!=="/"&&(o=At([o,c.pathnameBase]))}return i}function Ao(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Av(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],i=o.replace(/(.)\/+$/,"$1"),a=l.slice(1);return{params:r.reduce((u,f,c)=>{let{paramName:p,isOptional:x}=f;if(p==="*"){let k=a[c]||"";i=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const E=a[c];return x&&!E?u[p]=void 0:u[p]=(E||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Av(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),kr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,s)=>(r.push({paramName:a,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Bv(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return kr(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Qt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Wv(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Sn(e):e;return{pathname:n?n.startsWith("/")?n:Vv(n,t):t,search:Qv(r),hash:Kv(l)}}function Vv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function $i(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function rh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function oi(e,t){let n=rh(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ii(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=Sn(e):(l=me({},e),Y(!l.pathname||!l.pathname.includes("?"),$i("?","pathname","search",l)),Y(!l.pathname||!l.pathname.includes("#"),$i("#","pathname","hash",l)),Y(!l.search||!l.search.includes("#"),$i("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,a;if(i==null)a=n;else{let c=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),c-=1;l.pathname=p.join("/")}a=c>=0?t[c]:"/"}let s=Wv(l,a),u=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||f)&&(s.pathname+="/"),s}const At=e=>e.join("/").replace(/\/\/+/g,"/"),Hv=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Qv=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Kv=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Bo{constructor(t,n,r,l){l===void 0&&(l=!1),this.status=t,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ai(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lh=["post","put","patch","delete"],bv=new Set(lh),Jv=["get",...lh],Yv=new Set(Jv),Gv=new Set([301,302,303,307,308]),Xv=new Set([307,308]),Ai={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Zv={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Fr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Os=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qv=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),oh="remix-router-transitions";function eg(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Y(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l;if(e.mapRouteProperties)l=e.mapRouteProperties;else if(e.detectErrorBoundary){let v=e.detectErrorBoundary;l=w=>({hasErrorBoundary:v(w)})}else l=qv;let o={},i=wl(e.routes,l,void 0,o),a,s=e.basename||"/",u=e.unstable_dataStrategy||ig,f=e.unstable_patchRoutesOnNavigation,c=me({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,x=new Set,E=1e3,k=new Set,T=null,m=null,d=null,g=e.hydrationData!=null,S=Nn(i,e.history.location,s),P=null;if(S==null&&!f){let v=Be(404,{pathname:e.history.location.pathname}),{matches:w,route:j}=Pc(i);S=w,P={[j.id]:v}}S&&!e.hydrationData&&Ml(S,i,e.history.location.pathname).active&&(S=null);let _;if(S)if(S.some(v=>v.route.lazy))_=!1;else if(!S.some(v=>v.route.loader))_=!0;else if(c.v7_partialHydration){let v=e.hydrationData?e.hydrationData.loaderData:null,w=e.hydrationData?e.hydrationData.errors:null,j=N=>N.route.loader?typeof N.route.loader=="function"&&N.route.loader.hydrate===!0?!1:v&&v[N.route.id]!==void 0||w&&w[N.route.id]!==void 0:!0;if(w){let N=S.findIndex(z=>w[z.route.id]!==void 0);_=S.slice(0,N+1).every(j)}else _=S.every(j)}else _=e.hydrationData!=null;else if(_=!1,S=[],c.v7_partialHydration){let v=Ml(null,i,e.history.location.pathname);v.active&&v.matches&&(S=v.matches)}let L,y={historyAction:e.history.action,location:e.history.location,matches:S,initialized:_,navigation:Ai,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||P,fetchers:new Map,blockers:new Map},F=je.Pop,O=!1,Q,te=!1,pe=new Map,se=null,et=!1,Ke=!1,le=[],D=new Set,I=new Map,V=0,ie=-1,ue=new Map,be=new Set,Je=new Map,Tt=new Map,Me=new Set,ut=new Map,kn=new Map,Th=new Map,Rl;function Lh(){if(p=e.history.listen(v=>{let{action:w,location:j,delta:N}=v;if(Rl){Rl(),Rl=void 0;return}kr(kn.size===0||N!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let z=eu({currentLocation:y.location,nextLocation:j,historyAction:w});if(z&&N!=null){let B=new Promise(K=>{Rl=K});e.history.go(N*-1),Tl(z,{state:"blocked",location:j,proceed(){Tl(z,{state:"proceeding",proceed:void 0,reset:void 0,location:j}),B.then(()=>e.history.go(N))},reset(){let K=new Map(y.blockers);K.set(z,Fr),Ae({blockers:K})}});return}return En(w,j)}),n){Sg(t,pe);let v=()=>kg(t,pe);t.addEventListener("pagehide",v),se=()=>t.removeEventListener("pagehide",v)}return y.initialized||En(je.Pop,y.location,{initialHydration:!0}),L}function Mh(){p&&p(),se&&se(),x.clear(),Q&&Q.abort(),y.fetchers.forEach((v,w)=>_l(w)),y.blockers.forEach((v,w)=>qs(w))}function Dh(v){return x.add(v),()=>x.delete(v)}function Ae(v,w){w===void 0&&(w={}),y=me({},y,v);let j=[],N=[];c.v7_fetcherPersist&&y.fetchers.forEach((z,B)=>{z.state==="idle"&&(Me.has(B)?N.push(B):j.push(B))}),[...x].forEach(z=>z(y,{deletedFetchers:N,unstable_viewTransitionOpts:w.viewTransitionOpts,unstable_flushSync:w.flushSync===!0})),c.v7_fetcherPersist&&(j.forEach(z=>y.fetchers.delete(z)),N.forEach(z=>_l(z)))}function Vn(v,w,j){var N,z;let{flushSync:B}=j===void 0?{}:j,K=y.actionData!=null&&y.navigation.formMethod!=null&&wt(y.navigation.formMethod)&&y.navigation.state==="loading"&&((N=v.state)==null?void 0:N._isRedirect)!==!0,M;w.actionData?Object.keys(w.actionData).length>0?M=w.actionData:M=null:K?M=y.actionData:M=null;let H=w.loaderData?Cc(y.loaderData,w.loaderData,w.matches||[],w.errors):y.loaderData,$=y.blockers;$.size>0&&($=new Map($),$.forEach((ne,ce)=>$.set(ce,Fr)));let A=O===!0||y.navigation.formMethod!=null&&wt(y.navigation.formMethod)&&((z=v.state)==null?void 0:z._isRedirect)!==!0;a&&(i=a,a=void 0),et||F===je.Pop||(F===je.Push?e.history.push(v,v.state):F===je.Replace&&e.history.replace(v,v.state));let ee;if(F===je.Pop){let ne=pe.get(y.location.pathname);ne&&ne.has(v.pathname)?ee={currentLocation:y.location,nextLocation:v}:pe.has(v.pathname)&&(ee={currentLocation:v,nextLocation:y.location})}else if(te){let ne=pe.get(y.location.pathname);ne?ne.add(v.pathname):(ne=new Set([v.pathname]),pe.set(y.location.pathname,ne)),ee={currentLocation:y.location,nextLocation:v}}Ae(me({},w,{actionData:M,loaderData:H,historyAction:F,location:v,initialized:!0,navigation:Ai,revalidation:"idle",restoreScrollPosition:nu(v,w.matches||y.matches),preventScrollReset:A,blockers:$}),{viewTransitionOpts:ee,flushSync:B===!0}),F=je.Pop,O=!1,te=!1,et=!1,Ke=!1,le=[]}async function Ks(v,w){if(typeof v=="number"){e.history.go(v);return}let j=Oa(y.location,y.matches,s,c.v7_prependBasename,v,c.v7_relativeSplatPath,w==null?void 0:w.fromRouteId,w==null?void 0:w.relative),{path:N,submission:z,error:B}=yc(c.v7_normalizeFormMethod,!1,j,w),K=y.location,M=yl(y.location,N,w&&w.state);M=me({},M,e.history.encodeLocation(M));let H=w&&w.replace!=null?w.replace:void 0,$=je.Push;H===!0?$=je.Replace:H===!1||z!=null&&wt(z.formMethod)&&z.formAction===y.location.pathname+y.location.search&&($=je.Replace);let A=w&&"preventScrollReset"in w?w.preventScrollReset===!0:void 0,ee=(w&&w.unstable_flushSync)===!0,ne=eu({currentLocation:K,nextLocation:M,historyAction:$});if(ne){Tl(ne,{state:"blocked",location:M,proceed(){Tl(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:M}),Ks(v,w)},reset(){let ce=new Map(y.blockers);ce.set(ne,Fr),Ae({blockers:ce})}});return}return await En($,M,{submission:z,pendingError:B,preventScrollReset:A,replace:w&&w.replace,enableViewTransition:w&&w.unstable_viewTransition,flushSync:ee})}function Ih(){if(ci(),Ae({revalidation:"loading"}),y.navigation.state!=="submitting"){if(y.navigation.state==="idle"){En(y.historyAction,y.location,{startUninterruptedRevalidation:!0});return}En(F||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:te===!0})}}async function En(v,w,j){Q&&Q.abort(),Q=null,F=v,et=(j&&j.startUninterruptedRevalidation)===!0,Hh(y.location,y.matches),O=(j&&j.preventScrollReset)===!0,te=(j&&j.enableViewTransition)===!0;let N=a||i,z=j&&j.overrideNavigation,B=Nn(N,w,s),K=(j&&j.flushSync)===!0,M=Ml(B,N,w.pathname);if(M.active&&M.matches&&(B=M.matches),!B){let{error:Z,notFoundMatches:_e,route:Ce}=di(w.pathname);Vn(w,{matches:_e,loaderData:{},errors:{[Ce.id]:Z}},{flushSync:K});return}if(y.initialized&&!Ke&&fg(y.location,w)&&!(j&&j.submission&&wt(j.submission.formMethod))){Vn(w,{matches:B},{flushSync:K});return}Q=new AbortController;let H=Kn(e.history,w,Q.signal,j&&j.submission),$;if(j&&j.pendingError)$=[ir(B).route.id,{type:oe.error,error:j.pendingError}];else if(j&&j.submission&&wt(j.submission.formMethod)){let Z=await Oh(H,w,j.submission,B,M.active,{replace:j.replace,flushSync:K});if(Z.shortCircuited)return;if(Z.pendingActionResult){let[_e,Ce]=Z.pendingActionResult;if(rt(Ce)&&ai(Ce.error)&&Ce.error.status===404){Q=null,Vn(w,{matches:Z.matches,loaderData:{},errors:{[_e]:Ce.error}});return}}B=Z.matches||B,$=Z.pendingActionResult,z=Bi(w,j.submission),K=!1,M.active=!1,H=Kn(e.history,H.url,H.signal)}let{shortCircuited:A,matches:ee,loaderData:ne,errors:ce}=await zh(H,w,B,M.active,z,j&&j.submission,j&&j.fetcherSubmission,j&&j.replace,j&&j.initialHydration===!0,K,$);A||(Q=null,Vn(w,me({matches:ee||B},jc($),{loaderData:ne,errors:ce})))}async function Oh(v,w,j,N,z,B){B===void 0&&(B={}),ci();let K=wg(w,j);if(Ae({navigation:K},{flushSync:B.flushSync===!0}),z){let $=await Dl(N,w.pathname,v.signal);if($.type==="aborted")return{shortCircuited:!0};if($.type==="error"){let{boundaryId:A,error:ee}=Ll(w.pathname,$);return{matches:$.partialMatches,pendingActionResult:[A,{type:oe.error,error:ee}]}}else if($.matches)N=$.matches;else{let{notFoundMatches:A,error:ee,route:ne}=di(w.pathname);return{matches:A,pendingActionResult:[ne.id,{type:oe.error,error:ee}]}}}let M,H=Qr(N,w);if(!H.route.action&&!H.route.lazy)M={type:oe.error,error:Be(405,{method:v.method,pathname:w.pathname,routeId:H.route.id})};else if(M=(await Rr("action",y,v,[H],N,null))[H.route.id],v.signal.aborted)return{shortCircuited:!0};if(Ln(M)){let $;return B&&B.replace!=null?$=B.replace:$=Sc(M.response.headers.get("Location"),new URL(v.url),s)===y.location.pathname+y.location.search,await Cn(v,M,!0,{submission:j,replace:$}),{shortCircuited:!0}}if(on(M))throw Be(400,{type:"defer-action"});if(rt(M)){let $=ir(N,H.route.id);return(B&&B.replace)!==!0&&(F=je.Push),{matches:N,pendingActionResult:[$.route.id,M]}}return{matches:N,pendingActionResult:[H.route.id,M]}}async function zh(v,w,j,N,z,B,K,M,H,$,A){let ee=z||Bi(w,B),ne=B||K||Rc(ee),ce=!et&&(!c.v7_partialHydration||!H);if(N){if(ce){let we=bs(A);Ae(me({navigation:ee},we!==void 0?{actionData:we}:{}),{flushSync:$})}let J=await Dl(j,w.pathname,v.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let{boundaryId:we,error:tt}=Ll(w.pathname,J);return{matches:J.partialMatches,loaderData:{},errors:{[we]:tt}}}else if(J.matches)j=J.matches;else{let{error:we,notFoundMatches:tt,route:xe}=di(w.pathname);return{matches:tt,loaderData:{},errors:{[xe.id]:we}}}}let Z=a||i,[_e,Ce]=wc(e.history,y,j,ne,w,c.v7_partialHydration&&H===!0,c.v7_skipActionErrorRevalidation,Ke,le,D,Me,Je,be,Z,s,A);if(fi(J=>!(j&&j.some(we=>we.route.id===J))||_e&&_e.some(we=>we.route.id===J)),ie=++V,_e.length===0&&Ce.length===0){let J=Xs();return Vn(w,me({matches:j,loaderData:{},errors:A&&rt(A[1])?{[A[0]]:A[1].error}:null},jc(A),J?{fetchers:new Map(y.fetchers)}:{}),{flushSync:$}),{shortCircuited:!0}}if(ce){let J={};if(!N){J.navigation=ee;let we=bs(A);we!==void 0&&(J.actionData=we)}Ce.length>0&&(J.fetchers=Uh(Ce)),Ae(J,{flushSync:$})}Ce.forEach(J=>{I.has(J.key)&&Yt(J.key),J.controller&&I.set(J.key,J.controller)});let _r=()=>Ce.forEach(J=>Yt(J.key));Q&&Q.signal.addEventListener("abort",_r);let{loaderResults:Mt,fetcherResults:Hn}=await Js(y,j,_e,Ce,v);if(v.signal.aborted)return{shortCircuited:!0};Q&&Q.signal.removeEventListener("abort",_r),Ce.forEach(J=>I.delete(J.key));let Gt=to(Mt);if(Gt)return await Cn(v,Gt.result,!0,{replace:M}),{shortCircuited:!0};if(Gt=to(Hn),Gt)return be.add(Gt.key),await Cn(v,Gt.result,!0,{replace:M}),{shortCircuited:!0};let{loaderData:Il,errors:Dt}=Ec(y,j,_e,Mt,A,Ce,Hn,ut);ut.forEach((J,we)=>{J.subscribe(tt=>{(tt||J.done)&&ut.delete(we)})}),c.v7_partialHydration&&H&&y.errors&&Object.entries(y.errors).filter(J=>{let[we]=J;return!_e.some(tt=>tt.route.id===we)}).forEach(J=>{let[we,tt]=J;Dt=Object.assign(Dt||{},{[we]:tt})});let Ol=Xs(),zl=Zs(ie),Ul=Ol||zl||Ce.length>0;return me({matches:j,loaderData:Il,errors:Dt},Ul?{fetchers:new Map(y.fetchers)}:{})}function bs(v){if(v&&!rt(v[1]))return{[v[0]]:v[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function Uh(v){return v.forEach(w=>{let j=y.fetchers.get(w.key),N=$r(void 0,j?j.data:void 0);y.fetchers.set(w.key,N)}),new Map(y.fetchers)}function Fh(v,w,j,N){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");I.has(v)&&Yt(v);let z=(N&&N.unstable_flushSync)===!0,B=a||i,K=Oa(y.location,y.matches,s,c.v7_prependBasename,j,c.v7_relativeSplatPath,w,N==null?void 0:N.relative),M=Nn(B,K,s),H=Ml(M,B,K);if(H.active&&H.matches&&(M=H.matches),!M){Lt(v,w,Be(404,{pathname:K}),{flushSync:z});return}let{path:$,submission:A,error:ee}=yc(c.v7_normalizeFormMethod,!0,K,N);if(ee){Lt(v,w,ee,{flushSync:z});return}let ne=Qr(M,$);if(O=(N&&N.preventScrollReset)===!0,A&&wt(A.formMethod)){$h(v,w,$,ne,M,H.active,z,A);return}Je.set(v,{routeId:w,path:$}),Ah(v,w,$,ne,M,H.active,z,A)}async function $h(v,w,j,N,z,B,K,M){ci(),Je.delete(v);function H(xe){if(!xe.route.action&&!xe.route.lazy){let It=Be(405,{method:M.formMethod,pathname:j,routeId:w});return Lt(v,w,It,{flushSync:K}),!0}return!1}if(!B&&H(N))return;let $=y.fetchers.get(v);Jt(v,xg(M,$),{flushSync:K});let A=new AbortController,ee=Kn(e.history,j,A.signal,M);if(B){let xe=await Dl(z,j,ee.signal);if(xe.type==="aborted")return;if(xe.type==="error"){let{error:It}=Ll(j,xe);Lt(v,w,It,{flushSync:K});return}else if(xe.matches){if(z=xe.matches,N=Qr(z,j),H(N))return}else{Lt(v,w,Be(404,{pathname:j}),{flushSync:K});return}}I.set(v,A);let ne=V,Z=(await Rr("action",y,ee,[N],z,v))[N.route.id];if(ee.signal.aborted){I.get(v)===A&&I.delete(v);return}if(c.v7_fetcherPersist&&Me.has(v)){if(Ln(Z)||rt(Z)){Jt(v,Zt(void 0));return}}else{if(Ln(Z))if(I.delete(v),ie>ne){Jt(v,Zt(void 0));return}else return be.add(v),Jt(v,$r(M)),Cn(ee,Z,!1,{fetcherSubmission:M});if(rt(Z)){Lt(v,w,Z.error);return}}if(on(Z))throw Be(400,{type:"defer-action"});let _e=y.navigation.location||y.location,Ce=Kn(e.history,_e,A.signal),_r=a||i,Mt=y.navigation.state!=="idle"?Nn(_r,y.navigation.location,s):y.matches;Y(Mt,"Didn't find any matches after fetcher action");let Hn=++V;ue.set(v,Hn);let Gt=$r(M,Z.data);y.fetchers.set(v,Gt);let[Il,Dt]=wc(e.history,y,Mt,M,_e,!1,c.v7_skipActionErrorRevalidation,Ke,le,D,Me,Je,be,_r,s,[N.route.id,Z]);Dt.filter(xe=>xe.key!==v).forEach(xe=>{let It=xe.key,lu=y.fetchers.get(It),bh=$r(void 0,lu?lu.data:void 0);y.fetchers.set(It,bh),I.has(It)&&Yt(It),xe.controller&&I.set(It,xe.controller)}),Ae({fetchers:new Map(y.fetchers)});let Ol=()=>Dt.forEach(xe=>Yt(xe.key));A.signal.addEventListener("abort",Ol);let{loaderResults:zl,fetcherResults:Ul}=await Js(y,Mt,Il,Dt,Ce);if(A.signal.aborted)return;A.signal.removeEventListener("abort",Ol),ue.delete(v),I.delete(v),Dt.forEach(xe=>I.delete(xe.key));let J=to(zl);if(J)return Cn(Ce,J.result,!1);if(J=to(Ul),J)return be.add(J.key),Cn(Ce,J.result,!1);let{loaderData:we,errors:tt}=Ec(y,Mt,Il,zl,void 0,Dt,Ul,ut);if(y.fetchers.has(v)){let xe=Zt(Z.data);y.fetchers.set(v,xe)}Zs(Hn),y.navigation.state==="loading"&&Hn>ie?(Y(F,"Expected pending action"),Q&&Q.abort(),Vn(y.navigation.location,{matches:Mt,loaderData:we,errors:tt,fetchers:new Map(y.fetchers)})):(Ae({errors:tt,loaderData:Cc(y.loaderData,we,Mt,tt),fetchers:new Map(y.fetchers)}),Ke=!1)}async function Ah(v,w,j,N,z,B,K,M){let H=y.fetchers.get(v);Jt(v,$r(M,H?H.data:void 0),{flushSync:K});let $=new AbortController,A=Kn(e.history,j,$.signal);if(B){let Z=await Dl(z,j,A.signal);if(Z.type==="aborted")return;if(Z.type==="error"){let{error:_e}=Ll(j,Z);Lt(v,w,_e,{flushSync:K});return}else if(Z.matches)z=Z.matches,N=Qr(z,j);else{Lt(v,w,Be(404,{pathname:j}),{flushSync:K});return}}I.set(v,$);let ee=V,ce=(await Rr("loader",y,A,[N],z,v))[N.route.id];if(on(ce)&&(ce=await zs(ce,A.signal,!0)||ce),I.get(v)===$&&I.delete(v),!A.signal.aborted){if(Me.has(v)){Jt(v,Zt(void 0));return}if(Ln(ce))if(ie>ee){Jt(v,Zt(void 0));return}else{be.add(v),await Cn(A,ce,!1);return}if(rt(ce)){Lt(v,w,ce.error);return}Y(!on(ce),"Unhandled fetcher deferred data"),Jt(v,Zt(ce.data))}}async function Cn(v,w,j,N){let{submission:z,fetcherSubmission:B,replace:K}=N===void 0?{}:N;w.response.headers.has("X-Remix-Revalidate")&&(Ke=!0);let M=w.response.headers.get("Location");Y(M,"Expected a Location header on the redirect Response"),M=Sc(M,new URL(v.url),s);let H=yl(y.location,M,{_isRedirect:!0});if(n){let Z=!1;if(w.response.headers.has("X-Remix-Reload-Document"))Z=!0;else if(Os.test(M)){const _e=e.history.createURL(M);Z=_e.origin!==t.location.origin||Qt(_e.pathname,s)==null}if(Z){K?t.location.replace(M):t.location.assign(M);return}}Q=null;let $=K===!0||w.response.headers.has("X-Remix-Replace")?je.Replace:je.Push,{formMethod:A,formAction:ee,formEncType:ne}=y.navigation;!z&&!B&&A&&ee&&ne&&(z=Rc(y.navigation));let ce=z||B;if(Xv.has(w.response.status)&&ce&&wt(ce.formMethod))await En($,H,{submission:me({},ce,{formAction:M}),preventScrollReset:O,enableViewTransition:j?te:void 0});else{let Z=Bi(H,z);await En($,H,{overrideNavigation:Z,fetcherSubmission:B,preventScrollReset:O,enableViewTransition:j?te:void 0})}}async function Rr(v,w,j,N,z,B){let K,M={};try{K=await ag(u,v,w,j,N,z,B,o,l)}catch(H){return N.forEach($=>{M[$.route.id]={type:oe.error,error:H}}),M}for(let[H,$]of Object.entries(K))if(pg($)){let A=$.result;M[H]={type:oe.redirect,response:cg(A,j,H,z,s,c.v7_relativeSplatPath)}}else M[H]=await ug($);return M}async function Js(v,w,j,N,z){let B=v.matches,K=Rr("loader",v,z,j,w,null),M=Promise.all(N.map(async A=>{if(A.matches&&A.match&&A.controller){let ne=(await Rr("loader",v,Kn(e.history,A.path,A.controller.signal),[A.match],A.matches,A.key))[A.match.route.id];return{[A.key]:ne}}else return Promise.resolve({[A.key]:{type:oe.error,error:Be(404,{pathname:A.path})}})})),H=await K,$=(await M).reduce((A,ee)=>Object.assign(A,ee),{});return await Promise.all([gg(w,H,z.signal,B,v.loaderData),yg(w,$,N)]),{loaderResults:H,fetcherResults:$}}function ci(){Ke=!0,le.push(...fi()),Je.forEach((v,w)=>{I.has(w)&&(D.add(w),Yt(w))})}function Jt(v,w,j){j===void 0&&(j={}),y.fetchers.set(v,w),Ae({fetchers:new Map(y.fetchers)},{flushSync:(j&&j.flushSync)===!0})}function Lt(v,w,j,N){N===void 0&&(N={});let z=ir(y.matches,w);_l(v),Ae({errors:{[z.route.id]:j},fetchers:new Map(y.fetchers)},{flushSync:(N&&N.flushSync)===!0})}function Ys(v){return c.v7_fetcherPersist&&(Tt.set(v,(Tt.get(v)||0)+1),Me.has(v)&&Me.delete(v)),y.fetchers.get(v)||Zv}function _l(v){let w=y.fetchers.get(v);I.has(v)&&!(w&&w.state==="loading"&&ue.has(v))&&Yt(v),Je.delete(v),ue.delete(v),be.delete(v),Me.delete(v),D.delete(v),y.fetchers.delete(v)}function Bh(v){if(c.v7_fetcherPersist){let w=(Tt.get(v)||0)-1;w<=0?(Tt.delete(v),Me.add(v)):Tt.set(v,w)}else _l(v);Ae({fetchers:new Map(y.fetchers)})}function Yt(v){let w=I.get(v);Y(w,"Expected fetch controller: "+v),w.abort(),I.delete(v)}function Gs(v){for(let w of v){let j=Ys(w),N=Zt(j.data);y.fetchers.set(w,N)}}function Xs(){let v=[],w=!1;for(let j of be){let N=y.fetchers.get(j);Y(N,"Expected fetcher: "+j),N.state==="loading"&&(be.delete(j),v.push(j),w=!0)}return Gs(v),w}function Zs(v){let w=[];for(let[j,N]of ue)if(N<v){let z=y.fetchers.get(j);Y(z,"Expected fetcher: "+j),z.state==="loading"&&(Yt(j),ue.delete(j),w.push(j))}return Gs(w),w.length>0}function Wh(v,w){let j=y.blockers.get(v)||Fr;return kn.get(v)!==w&&kn.set(v,w),j}function qs(v){y.blockers.delete(v),kn.delete(v)}function Tl(v,w){let j=y.blockers.get(v)||Fr;Y(j.state==="unblocked"&&w.state==="blocked"||j.state==="blocked"&&w.state==="blocked"||j.state==="blocked"&&w.state==="proceeding"||j.state==="blocked"&&w.state==="unblocked"||j.state==="proceeding"&&w.state==="unblocked","Invalid blocker state transition: "+j.state+" -> "+w.state);let N=new Map(y.blockers);N.set(v,w),Ae({blockers:N})}function eu(v){let{currentLocation:w,nextLocation:j,historyAction:N}=v;if(kn.size===0)return;kn.size>1&&kr(!1,"A router only supports one blocker at a time");let z=Array.from(kn.entries()),[B,K]=z[z.length-1],M=y.blockers.get(B);if(!(M&&M.state==="proceeding")&&K({currentLocation:w,nextLocation:j,historyAction:N}))return B}function di(v){let w=Be(404,{pathname:v}),j=a||i,{matches:N,route:z}=Pc(j);return fi(),{notFoundMatches:N,route:z,error:w}}function Ll(v,w){return{boundaryId:ir(w.partialMatches).route.id,error:Be(400,{type:"route-discovery",pathname:v,message:w.error!=null&&"message"in w.error?w.error:String(w.error)})}}function fi(v){let w=[];return ut.forEach((j,N)=>{(!v||v(N))&&(j.cancel(),w.push(N),ut.delete(N))}),w}function Vh(v,w,j){if(T=v,d=w,m=j||null,!g&&y.navigation===Ai){g=!0;let N=nu(y.location,y.matches);N!=null&&Ae({restoreScrollPosition:N})}return()=>{T=null,d=null,m=null}}function tu(v,w){return m&&m(v,w.map(N=>_v(N,y.loaderData)))||v.key}function Hh(v,w){if(T&&d){let j=tu(v,w);T[j]=d()}}function nu(v,w){if(T){let j=tu(v,w),N=T[j];if(typeof N=="number")return N}return null}function Ml(v,w,j){if(f){if(k.has(j))return{active:!1,matches:v};if(v){if(Object.keys(v[0].params).length>0)return{active:!0,matches:mo(w,j,s,!0)}}else return{active:!0,matches:mo(w,j,s,!0)||[]}}return{active:!1,matches:null}}async function Dl(v,w,j){let N=v;for(;;){let z=a==null,B=a||i;try{await lg(f,w,N,B,o,l,Th,j)}catch(H){return{type:"error",error:H,partialMatches:N}}finally{z&&(i=[...i])}if(j.aborted)return{type:"aborted"};let K=Nn(B,w,s);if(K)return ru(w,k),{type:"success",matches:K};let M=mo(B,w,s,!0);if(!M||N.length===M.length&&N.every((H,$)=>H.route.id===M[$].route.id))return ru(w,k),{type:"success",matches:null};N=M}}function ru(v,w){if(w.size>=E){let j=w.values().next().value;w.delete(j)}w.add(v)}function Qh(v){o={},a=wl(v,l,void 0,o)}function Kh(v,w){let j=a==null;ah(v,w,a||i,o,l),j&&(i=[...i],Ae({}))}return L={get basename(){return s},get future(){return c},get state(){return y},get routes(){return i},get window(){return t},initialize:Lh,subscribe:Dh,enableScrollRestoration:Vh,navigate:Ks,fetch:Fh,revalidate:Ih,createHref:v=>e.history.createHref(v),encodeLocation:v=>e.history.encodeLocation(v),getFetcher:Ys,deleteFetcher:Bh,dispose:Mh,getBlocker:Wh,deleteBlocker:qs,patchRoutes:Kh,_internalFetchControllers:I,_internalActiveDeferreds:ut,_internalSetRoutes:Qh},L}function tg(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Oa(e,t,n,r,l,o,i,a){let s,u;if(i){s=[];for(let c of t)if(s.push(c),c.route.id===i){u=c;break}}else s=t,u=t[t.length-1];let f=ii(l||".",oi(s,o),Qt(e.pathname,n)||e.pathname,a==="path");return l==null&&(f.search=e.search,f.hash=e.hash),(l==null||l===""||l===".")&&u&&u.route.index&&!Us(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:At([n,f.pathname])),$n(f)}function yc(e,t,n,r){if(!r||!tg(r))return{path:n};if(r.formMethod&&!vg(r.formMethod))return{path:n,error:Be(405,{method:r.formMethod})};let l=()=>({path:n,error:Be(400,{type:"invalid-body"})}),o=r.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),a=sh(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!wt(i))return l();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((x,E)=>{let[k,T]=E;return""+x+k+"="+T+`
|
|
51
51
|
`},""):String(r.body);return{path:n,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!wt(i))return l();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return l()}}}Y(typeof FormData=="function","FormData is not available in this environment");let s,u;if(r.formData)s=za(r.formData),u=r.formData;else if(r.body instanceof FormData)s=za(r.body),u=r.body;else if(r.body instanceof URLSearchParams)s=r.body,u=kc(s);else if(r.body==null)s=new URLSearchParams,u=new FormData;else try{s=new URLSearchParams(r.body),u=kc(s)}catch{return l()}let f={formMethod:i,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(wt(f.formMethod))return{path:n,submission:f};let c=Sn(n);return t&&c.search&&Us(c.search)&&s.append("index",""),c.search="?"+s,{path:$n(c),submission:f}}function ng(e,t){let n=e;if(t){let r=e.findIndex(l=>l.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function wc(e,t,n,r,l,o,i,a,s,u,f,c,p,x,E,k){let T=k?rt(k[1])?k[1].error:k[1].data:void 0,m=e.createURL(t.location),d=e.createURL(l),g=k&&rt(k[1])?k[0]:void 0,S=g?ng(n,g):n,P=k?k[1].statusCode:void 0,_=i&&P&&P>=400,L=S.filter((F,O)=>{let{route:Q}=F;if(Q.lazy)return!0;if(Q.loader==null)return!1;if(o)return typeof Q.loader!="function"||Q.loader.hydrate?!0:t.loaderData[Q.id]===void 0&&(!t.errors||t.errors[Q.id]===void 0);if(rg(t.loaderData,t.matches[O],F)||s.some(se=>se===F.route.id))return!0;let te=t.matches[O],pe=F;return xc(F,me({currentUrl:m,currentParams:te.params,nextUrl:d,nextParams:pe.params},r,{actionResult:T,actionStatus:P,defaultShouldRevalidate:_?!1:a||m.pathname+m.search===d.pathname+d.search||m.search!==d.search||ih(te,pe)}))}),y=[];return c.forEach((F,O)=>{if(o||!n.some(et=>et.route.id===F.routeId)||f.has(O))return;let Q=Nn(x,F.path,E);if(!Q){y.push({key:O,routeId:F.routeId,path:F.path,matches:null,match:null,controller:null});return}let te=t.fetchers.get(O),pe=Qr(Q,F.path),se=!1;p.has(O)?se=!1:u.has(O)?(u.delete(O),se=!0):te&&te.state!=="idle"&&te.data===void 0?se=a:se=xc(pe,me({currentUrl:m,currentParams:t.matches[t.matches.length-1].params,nextUrl:d,nextParams:n[n.length-1].params},r,{actionResult:T,actionStatus:P,defaultShouldRevalidate:_?!1:a})),se&&y.push({key:O,routeId:F.routeId,path:F.path,matches:Q,match:pe,controller:new AbortController})}),[L,y]}function rg(e,t,n){let r=!t||n.route.id!==t.route.id,l=e[n.route.id]===void 0;return r||l}function ih(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function xc(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function lg(e,t,n,r,l,o,i,a){let s=[t,...n.map(u=>u.route.id)].join("-");try{let u=i.get(s);u||(u=e({path:t,matches:n,patch:(f,c)=>{a.aborted||ah(f,c,r,l,o)}}),i.set(s,u)),u&&hg(u)&&await u}finally{i.delete(s)}}function ah(e,t,n,r,l){if(e){var o;let i=r[e];Y(i,"No route found to patch children into: routeId = "+e);let a=wl(t,l,[e,"patch",String(((o=i.children)==null?void 0:o.length)||"0")],r);i.children?i.children.push(...a):i.children=a}else{let i=wl(t,l,["patch",String(n.length||"0")],r);n.push(...i)}}async function og(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let l=n[e.id];Y(l,"No route found in manifest");let o={};for(let i in r){let s=l[i]!==void 0&&i!=="hasErrorBoundary";kr(!s,'Route "'+l.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!s&&!Nv.has(i)&&(o[i]=r[i])}Object.assign(l,o),Object.assign(l,me({},t(l),{lazy:void 0}))}async function ig(e){let{matches:t}=e,n=t.filter(l=>l.shouldLoad);return(await Promise.all(n.map(l=>l.resolve()))).reduce((l,o,i)=>Object.assign(l,{[n[i].route.id]:o}),{})}async function ag(e,t,n,r,l,o,i,a,s,u){let f=o.map(x=>x.route.lazy?og(x.route,s,a):void 0),c=o.map((x,E)=>{let k=f[E],T=l.some(d=>d.route.id===x.route.id);return me({},x,{shouldLoad:T,resolve:async d=>(d&&r.method==="GET"&&(x.route.lazy||x.route.loader)&&(T=!0),T?sg(t,r,x,k,d,u):Promise.resolve({type:oe.data,result:void 0}))})}),p=await e({matches:c,request:r,params:o[0].params,fetcherKey:i,context:u});try{await Promise.all(f)}catch{}return p}async function sg(e,t,n,r,l,o){let i,a,s=u=>{let f,c=new Promise((E,k)=>f=k);a=()=>f(),t.signal.addEventListener("abort",a);let p=E=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:o},...E!==void 0?[E]:[]),x=(async()=>{try{return{type:"data",result:await(l?l(k=>p(k)):p())}}catch(E){return{type:"error",result:E}}})();return Promise.race([x,c])};try{let u=n.route[e];if(r)if(u){let f,[c]=await Promise.all([s(u).catch(p=>{f=p}),r]);if(f!==void 0)throw f;i=c}else if(await r,u=n.route[e],u)i=await s(u);else if(e==="action"){let f=new URL(t.url),c=f.pathname+f.search;throw Be(405,{method:t.method,pathname:c,routeId:n.route.id})}else return{type:oe.data,result:void 0};else if(u)i=await s(u);else{let f=new URL(t.url),c=f.pathname+f.search;throw Be(404,{pathname:c})}Y(i.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:oe.error,result:u}}finally{a&&t.signal.removeEventListener("abort",a)}return i}async function ug(e){let{result:t,type:n}=e;if(uh(t)){let u;try{let f=t.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(f){return{type:oe.error,error:f}}return n===oe.error?{type:oe.error,error:new Bo(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:oe.data,data:u,statusCode:t.status,headers:t.headers}}if(n===oe.error){if(Nc(t)){var r;if(t.data instanceof Error){var l;return{type:oe.error,error:t.data,statusCode:(l=t.init)==null?void 0:l.status}}t=new Bo(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:oe.error,error:t,statusCode:ai(t)?t.status:void 0}}if(mg(t)){var o,i;return{type:oe.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((i=t.init)==null?void 0:i.headers)&&new Headers(t.init.headers)}}if(Nc(t)){var a,s;return{type:oe.data,data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:oe.data,data:t}}function cg(e,t,n,r,l,o){let i=e.headers.get("Location");if(Y(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Os.test(i)){let a=r.slice(0,r.findIndex(s=>s.route.id===n)+1);i=Oa(new URL(t.url),a,l,!0,i,o),e.headers.set("Location",i)}return e}function Sc(e,t,n){if(Os.test(e)){let r=e,l=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Qt(l.pathname,n)!=null;if(l.origin===t.origin&&o)return l.pathname+l.search+l.hash}return e}function Kn(e,t,n,r){let l=e.createURL(sh(t)).toString(),o={signal:n};if(r&&wt(r.formMethod)){let{formMethod:i,formEncType:a}=r;o.method=i.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(r.json)):a==="text/plain"?o.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?o.body=za(r.formData):o.body=r.formData}return new Request(l,o)}function za(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function kc(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function dg(e,t,n,r,l){let o={},i=null,a,s=!1,u={},f=n&&rt(n[1])?n[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let p=c.route.id,x=t[p];if(Y(!Ln(x),"Cannot handle redirect results in processLoaderData"),rt(x)){let E=x.error;f!==void 0&&(E=f,f=void 0),i=i||{};{let k=ir(e,p);i[k.route.id]==null&&(i[k.route.id]=E)}o[p]=void 0,s||(s=!0,a=ai(x.error)?x.error.status:500),x.headers&&(u[p]=x.headers)}else on(x)?(r.set(p,x.deferredData),o[p]=x.deferredData.data,x.statusCode!=null&&x.statusCode!==200&&!s&&(a=x.statusCode),x.headers&&(u[p]=x.headers)):(o[p]=x.data,x.statusCode&&x.statusCode!==200&&!s&&(a=x.statusCode),x.headers&&(u[p]=x.headers))}),f!==void 0&&n&&(i={[n[0]]:f},o[n[0]]=void 0),{loaderData:o,errors:i,statusCode:a||200,loaderHeaders:u}}function Ec(e,t,n,r,l,o,i,a){let{loaderData:s,errors:u}=dg(t,r,l,a);return o.forEach(f=>{let{key:c,match:p,controller:x}=f,E=i[c];if(Y(E,"Did not find corresponding fetcher result"),!(x&&x.signal.aborted))if(rt(E)){let k=ir(e.matches,p==null?void 0:p.route.id);u&&u[k.route.id]||(u=me({},u,{[k.route.id]:E.error})),e.fetchers.delete(c)}else if(Ln(E))Y(!1,"Unhandled fetcher revalidation redirect");else if(on(E))Y(!1,"Unhandled fetcher deferred data");else{let k=Zt(E.data);e.fetchers.set(c,k)}}),{loaderData:s,errors:u}}function Cc(e,t,n,r){let l=me({},t);for(let o of n){let i=o.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(l[i]=t[i]):e[i]!==void 0&&o.route.loader&&(l[i]=e[i]),r&&r.hasOwnProperty(i))break}return l}function jc(e){return e?rt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ir(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Pc(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Be(e,t){let{pathname:n,routeId:r,method:l,type:o,message:i}=t===void 0?{}:t,a="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(a="Bad Request",o==="route-discovery"?s='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
|
|
52
52
|
`+i):l&&n&&r?s="You made a "+l+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?s="defer() is not supported in actions":o==="invalid-body"&&(s="Unable to encode submission body")):e===403?(a="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",s='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",l&&n&&r?s="You made a "+l.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":l&&(s='Invalid request method "'+l.toUpperCase()+'"')),new Bo(e||500,a,new Error(s),!0)}function to(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,l]=t[n];if(Ln(l))return{key:r,result:l}}}function sh(e){let t=typeof e=="string"?Sn(e):e;return $n(me({},t,{hash:""}))}function fg(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function hg(e){return typeof e=="object"&&e!=null&&"then"in e}function pg(e){return uh(e.result)&&Gv.has(e.result.status)}function on(e){return e.type===oe.deferred}function rt(e){return e.type===oe.error}function Ln(e){return(e&&e.type)===oe.redirect}function Nc(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function mg(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function uh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function vg(e){return Yv.has(e.toLowerCase())}function wt(e){return bv.has(e.toLowerCase())}async function gg(e,t,n,r,l){let o=Object.entries(t);for(let i=0;i<o.length;i++){let[a,s]=o[i],u=e.find(p=>(p==null?void 0:p.route.id)===a);if(!u)continue;let f=r.find(p=>p.route.id===u.route.id),c=f!=null&&!ih(f,u)&&(l&&l[u.route.id])!==void 0;on(s)&&c&&await zs(s,n,!1).then(p=>{p&&(t[a]=p)})}}async function yg(e,t,n){for(let r=0;r<n.length;r++){let{key:l,routeId:o,controller:i}=n[r],a=t[l];e.find(u=>(u==null?void 0:u.route.id)===o)&&on(a)&&(Y(i,"Expected an AbortController for revalidating fetcher deferred result"),await zs(a,i.signal,!0).then(u=>{u&&(t[l]=u)}))}}async function zs(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:oe.data,data:e.deferredData.unwrappedData}}catch(l){return{type:oe.error,error:l}}return{type:oe.data,data:e.deferredData.data}}}function Us(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qr(e,t){let n=typeof t=="string"?Sn(t).search:t.search;if(e[e.length-1].route.index&&Us(n||""))return e[e.length-1];let r=rh(e);return r[r.length-1]}function Rc(e){let{formMethod:t,formAction:n,formEncType:r,text:l,formData:o,json:i}=e;if(!(!t||!n||!r)){if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:l};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function Bi(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function wg(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function $r(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function xg(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Zt(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Sg(e,t){try{let n=e.sessionStorage.getItem(oh);if(n){let r=JSON.parse(n);for(let[l,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(l,new Set(o||[]))}}catch{}}function kg(e,t){if(t.size>0){let n={};for(let[r,l]of t)n[r]=[...l];try{e.sessionStorage.setItem(oh,JSON.stringify(n))}catch(r){kr(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
53
53
|
* React Router v6.26.2
|
|
@@ -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 W(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 W("/api/me")},async markChatSeen(e,t,n){const r=`${b(e)}/chats/${encodeURIComponent(t)}/seen`;await W(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 W(r,{method:"POST",body:JSON.stringify({unread:n})})},async projectRuns(e,t){const n=t!==void 0?`?limit=${encodeURIComponent(t)}`:"";return W(`${b(e)}/runs${n}`)},async markRunsSeen(e,t){await W(`${b(e)}/runs/seen`,{method:"POST",body:JSON.stringify(t!==void 0?{when:t}:{})})},async getModels(){return W("/api/models")},async getInstanceConfig(){return W("/api/instance-config")},async updateInstanceConfig(e){return W("/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 W(`${b(e)}/commands`);return t},async listProjects(){const{projects:e,root:t}=await W("/api/projects");return{projects:e,root:t??null}},async getProjectDetail(e){return W(`${b(e)}`)},async attentionChats(e){const t=await W(`${b(e)}/chats/attention`);return{running:t.running??[],unread:t.unread??[]}},async createProject(e){const{project:t}=await W("/api/projects",{method:"POST",body:JSON.stringify(e)});return t},async updateProject(e,t){const{project:n}=await W(`${b(e)}`,{method:"PATCH",body:JSON.stringify(t)});return n},async promoteProject(e,t){const{project:n}=await W(`${b(e)}/promote`,{method:"POST",body:JSON.stringify({repo:t})});return n},async deleteProject(e){await W(`${b(e)}`,{method:"DELETE"})},async deleteProjectChat(e,t){await W(`${b(e)}/chats/${encodeURIComponent(t)}`,{method:"DELETE"})},async renameProjectChat(e,t,n){await W(`${b(e)}/chats/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({name:n})})},async archiveProjectChat(e,t,n){await W(`${b(e)}/chats/${encodeURIComponent(t)}/archive`,{method:"POST",body:JSON.stringify({archived:n})})},async starProjectChat(e,t,n){await W(`${b(e)}/chats/${encodeURIComponent(t)}/star`,{method:"POST",body:JSON.stringify({starred:n})})},async archiveProjectChats(e,t,n){await W(`${b(e)}/chats/batch/archive`,{method:"POST",body:JSON.stringify({sessionIds:t,archived:n})})},async markChatsUnread(e,t,n){await W(`${b(e)}/chats/batch/unread`,{method:"POST",body:JSON.stringify({sessionIds:t,unread:n})})},async deleteProjectChats(e,t){const n=await W(`${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 W(`${b(e)}/chats/${encodeURIComponent(t)}/detach`,{method:"POST",body:JSON.stringify({detached:n})})},async promoteChat(e,t,n){return W(`${b(e)}/chats/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify(n)})},async forkChat(e,t,n,r){const{sessionId:l}=await W(`${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 W(`${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 W(`${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 W(`${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 W(`${b(e)}/pins`,{method:"PUT",body:JSON.stringify({file:t})});return n},async unpinFile(e,t){const{project:n}=await W(`${b(e)}/pins/${encodeURIComponent(t)}`,{method:"DELETE"});return n},async listProjectChats(e){const{chats:t}=await W(`${b(e)}/chats`);return t},async getAdoptableChats(e){return W(`${b(e)}/adoptable-chats`)},async adoptChats(e,t){return W(`${b(e)}/adopt-chats`,{method:"POST",body:JSON.stringify(t??{})})},async unadoptChats(e,t){return W(`${b(e)}/unadopt-chats`,{method:"POST",body:JSON.stringify(t??{})})},async chatUsage(e,t){const n=t?`?scope=${t}`:"",{usage:r}=await W(`${b(e)}/chats/usage${n}`);return r},async projectChatMessages(e,t){const{messages:n}=await W(`${b(e)}/chats/${encodeURIComponent(t)}/messages`);return n},async subagentMessages(e,t,n){const r=`${b(e)}/chats/${encodeURIComponent(t)}`,{messages:l}=await W(`${r}/subagents/${encodeURIComponent(n)}/messages`);return l},async chatContext(e,t){const n=`${b(e)}/chats/${encodeURIComponent(t)}/context`,{usage:r}=await W(n);return r},async listTriggers(e){return W(`${b(e)}/triggers`)},async putTrigger(e,t,n){const{trigger:r}=await W(`${b(e)}/triggers/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(n)});return r},async deleteTrigger(e,t){await W(`${b(e)}/triggers/${encodeURIComponent(t)}`,{method:"DELETE"})},async triggerRuntime(e){return W(`${b(e)}/triggers/runtime`)},async runTrigger(e,t){const{sessionId:n}=await W(`${b(e)}/triggers/${encodeURIComponent(t)}/run`,{method:"POST",body:"{}"});return n},async gitInfo(){return W("/api/git")},async gitStatus(e){return W(`${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 W(`${b(e)}/git/commit`,{method:"POST",body:JSON.stringify(n?{message:t,files:n}:{message:t})})},async gitPush(){return W("/api/git/push",{method:"POST"})},async githubConnect(){return W("/api/git/github/connect",{method:"POST"})},async githubPoll(e){return W("/api/git/github/poll",{method:"POST",body:JSON.stringify({deviceCode:e})})},async githubDisconnect(){await W("/api/git/github/disconnect",{method:"POST"})},async transcriptionStatus(){return W("/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:V}=await import("./queued-LamEU0GH.js");return{writeQueued:I,writeQueuedTs:V}},[]).then(({writeQueued:I,writeQueuedTs:V})=>{I(le,r,null),V(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 V of this.subs.values())V.projectSlug===r&&V.sessionId===le&&((d=(m=V.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.60.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-CjfwpeFj.js"),__vite__mapDeps([0,1])).then(e=>({default:e.ProjectsGrid}))),ke=C.lazy(()=>Sl(()=>import("./ProjectView-BmSdUwY2.js").then(e=>e.P),__vite__mapDeps([2,1,3,4])).then(e=>({default:e.ProjectView}))),c0=C.lazy(()=>Sl(()=>import("./ProjectRedirect-DHoWtvtY.js"),__vite__mapDeps([5,4])).then(e=>({default:e.ProjectRedirect}))),d0=C.lazy(()=>Sl(()=>import("./InstanceConfigPage-xn9Rvoah.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-D43x5bFb.js";import{p as g}from"./wardley-L42UT6IY-CbFrlwHE.js";import"./index-DtRblEY_.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
|
|