@puddle-code/cli 0.4.4 → 0.4.7
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/CHANGELOG.md +2 -15
- package/dist/index.js +5 -2
- package/dist/install.sh +13 -2
- package/dist/public/assets/App-CiC_hRBz.js +7 -0
- package/dist/public/assets/App-Ckp6kzac.css +1 -0
- package/dist/public/assets/{CompilationCommandForm-C71yC-_B.js → CompilationCommandForm-ByQ3n2Av.js} +1 -1
- package/dist/public/assets/{Dashboard-DwYEuGdA.js → Dashboard-DXufaZFW.js} +1 -1
- package/dist/public/assets/{EditorTabClose-DWcVp29x.js → EditorTabClose-dEi1apPb.js} +1 -1
- package/dist/public/assets/FindWidget-DG1YP6Zx.js +1 -0
- package/dist/public/assets/{LazyTerminal-BRdmWa8z.js → LazyTerminal-CQNsHnn5.js} +2 -2
- package/dist/public/assets/{ModelRefcount-C0bySKlY.js → ModelRefcount-CrRz4dBj.js} +1 -1
- package/dist/public/assets/{NewProjectDialog-D87YE4pz.js → NewProjectDialog-CRoDFgh9.js} +1 -1
- package/dist/public/assets/{NotebookWidget-BxU1ILhZ.js → NotebookWidget-D_cBVZys.js} +1 -1
- package/dist/public/assets/{PaneEditorBody-DosywVrH.js → PaneEditorBody-_H5u21rG.js} +19 -19
- package/dist/public/assets/{PdfViewer-C-dXDOjG.js → PdfViewer-CvbL21Y7.js} +1 -1
- package/dist/public/assets/ReleaseNotesDialog-WjdHjwjo.js +1 -0
- package/dist/public/assets/SettingsDialog-CJX0gDhJ.css +1 -0
- package/dist/public/assets/SettingsDialog-CiDPg9PP.js +8 -0
- package/dist/public/assets/Terminal-kGAX-Lcx.js +66 -0
- package/dist/public/assets/Workspace-D8fTPYJv.js +20 -0
- package/dist/public/assets/Workspace-fmUH5XvW.css +1 -0
- package/dist/public/assets/{buffer-store-KcgRSSvB.js → buffer-store-BvfE0iGv.js} +1 -1
- package/dist/public/assets/{chevron-right-BP2NLwlG.js → chevron-right-nSpC9bNN.js} +1 -1
- package/dist/public/assets/client-settings-DhfHheKR.js +1 -0
- package/dist/public/assets/command-CrnEVrrI.js +1 -0
- package/dist/public/assets/{context-C3-WejyN.js → context-CSOKgBuW.js} +1 -1
- package/dist/public/assets/{context-menu-C0cOAj0E.js → context-menu-BaamZoTk.js} +1 -1
- package/dist/public/assets/control-tray-CHewYBoS.css +1 -0
- package/dist/public/assets/control-tray-D6zVSZF4.js +1 -0
- package/dist/public/assets/dialog-BIriom7c.js +41 -0
- package/dist/public/assets/dialog-BYIi-VQq.css +1 -0
- package/dist/public/assets/{dist-BHBQY7ao.js → dist-DsLo0ckR.js} +1 -1
- package/dist/public/assets/{dist-CGlwr6Pc.js → dist-gLwIpKj2.js} +1 -1
- package/dist/public/assets/dist-t7ZlsY9S.js +1 -0
- package/dist/public/assets/index-DAZZvnBz.css +2 -0
- package/dist/public/assets/{index-ByBNBhsx.js → index-Nd31gVbt.js} +3 -3
- package/dist/public/assets/{markdown-mermaid-Bn0a2pwd.js → markdown-mermaid-ByeNUiyP.js} +1 -1
- package/dist/public/assets/{media-refresh-store-CHPkX-XV.js → media-refresh-store-1wdl12UC.js} +1 -1
- package/dist/public/assets/motion-OSLfKoC0.js +1 -0
- package/dist/public/assets/{notification-delivery-C9wsvfQY.js → notification-delivery-BrgeSks8.js} +1 -1
- package/dist/public/assets/{popover-B5Bw2ljC.js → popover-ChiZqTsE.js} +1 -1
- package/dist/public/assets/{protocol-support-CsLR9u7d.js → protocol-support-BApsXw77.js} +1 -1
- package/dist/public/assets/select-4yfFmU4K.js +1 -0
- package/dist/public/assets/selection-actions-2STnRxD9.js +1 -0
- package/dist/public/assets/{switch-DihTSmnc.js → switch-B1LYyDZA.js} +1 -1
- package/dist/public/assets/{use-ui-state-e6mUjW-H.js → use-ui-state-Bi73JKcr.js} +1 -1
- package/dist/public/index.html +3 -3
- package/package.json +1 -1
- package/dist/public/assets/App-DiuYTEQv.js +0 -19
- package/dist/public/assets/FindWidget-CaVwYvST.js +0 -1
- package/dist/public/assets/ReleaseNotesDialog-BXqx8SP6.js +0 -1
- package/dist/public/assets/SettingsDialog-gGoY2tNN.js +0 -8
- package/dist/public/assets/Terminal-ixgwoszm.js +0 -66
- package/dist/public/assets/Workspace-BaIPEaup.js +0 -20
- package/dist/public/assets/Workspace-D5qlJNnU.css +0 -1
- package/dist/public/assets/client-settings-CwqpIric.js +0 -1
- package/dist/public/assets/command-BkdEYC1b.js +0 -1
- package/dist/public/assets/control-tray-D7OXXkAy.css +0 -1
- package/dist/public/assets/control-tray-OJfh0_ml.js +0 -1
- package/dist/public/assets/dialog-IU2fjIs9.js +0 -41
- package/dist/public/assets/dist-eLNGMhYC.js +0 -1
- package/dist/public/assets/index-C3TPFFMc.css +0 -2
- package/dist/public/assets/select-C0UTbo8D.js +0 -1
- package/dist/public/assets/selection-actions-C4diprgb.js +0 -1
- package/dist/public/assets/whole-word-BJjKpISQ.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-D2QzpYEE.js","assets/preload-helper-Czpn1I53.js","assets/purify.es-D8QhFVkO.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-_wZywoZs.js","assets/chunk-DU6HZSFF-1ZoT19aa.js","assets/chunk-75Z2AOVW-CYC6lmPG.js","assets/dist-D9sYb5Oa.js","assets/chunk-CLGD4ZFX-85mvsF4F.js","assets/chunk-PWAF6VOD-CTSTb7zN.js","assets/chunk-GMAD6QVW-BzDEhlK8.js","assets/chunk-P2QGCYS3-C5-f0Lvg.js","assets/chunk-4HAMMTFA-eolw8o4c.js","assets/rough.esm-CSKSodPl.js","assets/chunk-GVQU2GXP-CZrUjjq3.js","assets/chunk-OSK3NFVY-Cs_K17E_.js","assets/line-D4r_bmlv.js","assets/path-BWPyau1x.js","assets/array-BifhSqXX.js","assets/chunk-L3NEJ4N5-BW3s5_r9.js","assets/chunk-TLUHSLCS-CcE5HWjm.js","assets/chunk-2E4U76K2-3abpRZU5.js","assets/graphlib-DS17s2tU.js","assets/chunk-LNGE3PJU-DNNNwF8Y.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./preload-helper-Czpn1I53.js";import{n}from"./index-
|
|
2
|
+
import{n as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./preload-helper-Czpn1I53.js";import{n}from"./index-Nd31gVbt.js";var r=e({MERMAID_SELECTOR:()=>i,renderMermaidDiagrams:()=>s}),i=`[data-puddle-mermaid]`,a=0,o=Promise.resolve();function s(e,t,n,r=!1){let i=o.then(()=>c(e,t,n,r));return o=i.catch(()=>void 0),i}async function c(e,r,o,s=!1){if(o?.aborted)return;let c=[...e.querySelectorAll(i)];if(c.length===0)return;let d;try{({default:d}=await t(()=>import(`./mermaid.core-D2QzpYEE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24])))}catch{if(!o?.aborted)for(let e of c)l(e,`Mermaid could not be loaded`);return}if(!o?.aborted){try{let t=n(),i=getComputedStyle(e).fontSize,a=Number.parseFloat(i);d.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,theme:`base`,htmlLabels:!1,fontFamily:t(`--font-sans`),...s&&Number.isFinite(a)?{flowchart:{nodeSpacing:a,rankSpacing:a*2,padding:a/2,subGraphTitleMargin:{top:a/2,bottom:a}},sequence:{diagramMarginY:a/2,messageMargin:a,actorMargin:a}}:{},secure:[`secure`,`securityLevel`,`startOnLoad`,`maxTextSize`,`maxEdges`,`suppressErrorRendering`,`theme`,`themeCSS`,`themeVariables`,`fontFamily`],themeVariables:{darkMode:r===`dark`,background:t(`--bg-base`),primaryColor:t(`--bg-elevated`),primaryTextColor:t(`--text-primary`),primaryBorderColor:t(`--border`),secondaryColor:t(`--bg-surface`),secondaryTextColor:t(`--text-primary`),secondaryBorderColor:t(`--border`),tertiaryColor:t(`--bg-base`),tertiaryTextColor:t(`--text-secondary`),tertiaryBorderColor:t(`--border`),lineColor:t(`--text-muted`),textColor:t(`--text-primary`),fontFamily:t(`--font-sans`),fontSize:i}})}catch(e){if(!o?.aborted)for(let t of c)l(t,u(e));return}for(let e of c){if(o?.aborted||!e.isConnected)return;let t=e.textContent??``,n=`puddle-mermaid-${a++}`;try{let{svg:r}=await d.render(n,t);if(o?.aborted||!e.isConnected)continue;e.innerHTML=r,e.removeAttribute(`data-puddle-mermaid`)}catch(t){document.getElementById(n)?.remove(),!o?.aborted&&e.isConnected&&l(e,u(t))}}}}function l(e,t){if(e.querySelector(`.mermaid-error`))return;let n=document.createElement(`p`);n.className=`mermaid-error`,n.textContent=`Unable to render Mermaid diagram.`,n.title=t,e.prepend(n)}function u(e){return e instanceof Error?e.message:String(e)}export{s as n,r as t};
|
package/dist/public/assets/{media-refresh-store-CHPkX-XV.js → media-refresh-store-1wdl12UC.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{At as n,Ct as r,Dt as i,St as a,Tt as o,bt as s,kt as c,xt as l}from"./protocol-support-CsLR9u7d.js";import{t as u}from"./jsx-runtime-By8HlURe.js";import{n as d,r as f}from"./api-BOuyloUi.js";import{n as p}from"./dist-BOS6OKSE.js";import{S as m,T as h,h as ee,v as g,w as te}from"./dialog-IU2fjIs9.js";import{o as ne}from"./x-Dq6POV20.js";import{o as _,s as v,t as re}from"./chevron-right-BP2NLwlG.js";import{n as y,t as b}from"./createLucideIcon-C9A1vLE-.js";import{_ as ie,a as ae,c as oe,d as se,f as ce,g as le,h as ue,i as de,l as fe,m as pe,n as me,o as he,p as ge,r as _e,s as ve,t as ye,u as be}from"./dist-eLNGMhYC.js";var xe=class extends i{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:r}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:s,isRefetchError:l}=i,u=r.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=a&&u===`forward`,p=s&&u===`backward`,m=a&&u===`backward`;return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:c(t,r.data),hasPreviousPage:n(t,r.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:o&&!f&&!m}}};function Se(e,t){return r(e,xe,t)}var Ce=b(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),we=b(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Te=b(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ee=b(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),De=b(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Oe=b(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),x=50;function S(e){return e===void 0?``:`&root=${encodeURIComponent(e)}`}function C(e){return e?{placeholderData:e=>e}:{}}function ke(e,t,n){let r=e!==void 0;return a({queryKey:n===void 0?[`wt-tree`,e,t]:[`wt-tree`,e,t,n],queryFn:()=>d(`GET`,`/api/worktrees/${e}/tree?path=${encodeURIComponent(t)}${S(n)}`),enabled:r,...C(r)})}function Ae(e,t,n){let r=n?.root;return a({queryKey:r===void 0?[`wt-file`,e,t]:[`wt-file`,e,t,r],queryFn:()=>d(`GET`,`/api/worktrees/${e}/file?path=${encodeURIComponent(t)}${S(r)}`),enabled:e!==void 0&&(n?.enabled??!0),...n?.live===!0?{refetchInterval:s(3e3),refetchOnWindowFocus:!0}:{}})}function je(e,t){let n=o();return l({mutationFn:({path:n,...r})=>d(`PUT`,`/api/worktrees/${e}/file?path=${encodeURIComponent(n)}${S(t)}`,r),onSuccess:(r,{path:i})=>{n.invalidateQueries({queryKey:t===void 0?[`wt-file`,e,i]:[`wt-file`,e,i,t]}),n.invalidateQueries({queryKey:[`wt-diff`,e]})}})}function Me(e,t){let n=t?.against??`base`,r=t?.area,i=t?.root,o=e!==void 0&&(t?.enabled??!0);return a({queryKey:i===void 0?[`wt-diff`,e,n,r]:[`wt-diff`,e,n,r,i],queryFn:()=>{let t=r===void 0?``:`&area=${r}`;return d(`GET`,`/api/worktrees/${e}/diff?against=${n}${t}${S(i)}`)},enabled:o,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...C(o)})}function Ne(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return a({queryKey:n===void 0?[`git-repositories`,e]:[`git-repositories`,e,n],queryFn:()=>d(`GET`,`/api/worktrees/${e}/git-repositories${w(n)}`),enabled:r,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...C(r)})}function Pe(e,t,n){let r=n?.root,i=e!==void 0&&(n?.enabled??!0);return a({queryKey:[`git-original`,e,t,r],queryFn:()=>d(`GET`,`/api/worktrees/${e}/git-original?path=${encodeURIComponent(t)}${S(r)}`),enabled:i,refetchInterval:s(1e4),refetchOnWindowFocus:!0})}function Fe(e,t,n){let r=n?.root;return a({queryKey:[`git-index-file`,e,t,r],queryFn:()=>d(`GET`,`/api/worktrees/${e}/index-file?path=${encodeURIComponent(t)}${S(r)}`),enabled:e!==void 0&&(n?.enabled??!0)})}function Ie(e,t){let n=o();return l({mutationFn:({action:n,...r})=>d(`POST`,`/api/worktrees/${e}/git-${n}${w(t)}`,r),onSuccess:()=>{n.invalidateQueries({queryKey:[`git-repositories`,e]}),n.invalidateQueries({queryKey:[`wt-git-status`,e]}),n.invalidateQueries({queryKey:[`wt-diff`,e]}),n.invalidateQueries({queryKey:[`wt-log`,e]}),n.invalidateQueries({queryKey:[`wt-show`,e]}),n.invalidateQueries({queryKey:[`git-original`,e]}),n.invalidateQueries({queryKey:[`git-index-file`,e]})}})}function Le(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return a({queryKey:n===void 0?[`wt-git-status`,e]:[`wt-git-status`,e,n],queryFn:()=>d(`GET`,`/api/worktrees/${e}/git-status${w(n)}`),enabled:r,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...C(r)})}function w(e){return e===void 0?``:`?root=${encodeURIComponent(e)}`}function Re(e,t,n,r){return d(`POST`,`/api/worktrees/${e}/create${w(r)}`,{path:t,kind:n})}function ze(e,t,n,r){return d(`POST`,`/api/worktrees/${e}/rename${w(r)}`,{from:t,to:n})}function Be(e,t,n,r){return d(`POST`,`/api/worktrees/${e}/copy${w(r)}`,{from:t,to:n})}function Ve(e,t,n){return d(`POST`,`/api/worktrees/${e}/transfer${w(n)}`,t)}function He(e,t,n){return d(`POST`,`/api/worktrees/${e}/delete${w(n)}`,{path:t})}function Ue(e,t,n){let{query:r,regex:i,caseSensitive:o,wholeWord:s}=t;return a({queryKey:[`wt-search`,e,r,i,o,s,n],queryFn:()=>{let t=new URLSearchParams({q:r});return i&&t.set(`regex`,`1`),o&&t.set(`case`,`1`),s&&t.set(`word`,`1`),n!==void 0&&t.set(`root`,n),d(`GET`,`/api/worktrees/${e}/search?${t.toString()}`)},enabled:e!==void 0&&r.length>0,staleTime:2e3})}function We(e,t,n,r){let i=r?.root;return a({queryKey:[`wt-file-at`,e,t,n,i],queryFn:()=>d(`GET`,`/api/worktrees/${e}/file-at?ref=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}${S(i)}`),enabled:e!==void 0&&(r?.enabled??!0),staleTime:1/0})}function Ge(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return Se({queryKey:n===void 0?[`wt-log`,e]:[`wt-log`,e,n],queryFn:({pageParam:t})=>d(`GET`,`/api/worktrees/${e}/log?limit=${x}&skip=${t}${S(n)}`),initialPageParam:0,getNextPageParam:(e,t)=>e.has_more?t.length*x:void 0,enabled:r,...C(r)})}function Ke(e,t,n){return a({queryKey:n===void 0?[`wt-show`,e,t]:[`wt-show`,e,t,n],queryFn:()=>d(`GET`,`/api/worktrees/${e}/show/${t}${w(n)}`),enabled:e!==void 0&&t!==void 0,staleTime:1/0})}var qe=64*1024*1024;function Je(e,t){let n=[],r=[],i=0;for(let a of e)r.length>0&&i+a.size>t&&(n.push(r),r=[],i=0),r.push(a),i+=a.size;return r.length>0&&n.push(r),n}async function Ye(e,t,n,r){let i=[];for(let a of Je(n,qe)){let n=new FormData;for(let e of a)n.append(`files`,e,e.name);let o=await f(`POST`,`/api/worktrees/${e}/upload?dir=${encodeURIComponent(t)}${S(r)}`,{body:n});i.push(...(await o.json()).files)}return{files:i}}function Xe(e,t){if(!e)return t;let n=/filename\*=UTF-8''([^;]+)/i.exec(e);if(n?.[1])try{return decodeURIComponent(n[1])}catch{return t}return/filename="?([^"; ]+)"?/i.exec(e)?.[1]??t}async function Ze(e,t,n){let r=await f(`GET`,`/api/worktrees/${e}/download?path=${encodeURIComponent(t)}${S(n)}`),i=await r.blob(),a=t.split(`/`).filter(Boolean).pop()??`worktree`,o=Xe(r.headers.get(`content-disposition`),a),s=URL.createObjectURL(i);try{let e=document.createElement(`a`);e.href=s,e.download=o,document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(s)}}var T=e(t(),1),E=[],D=new Map,O=new Map,k=new Map;function A(e,t){let n=D.get(e)??E;t.length===0?D.delete(e):D.set(e,t);let r=new Set([...n.map(e=>j(e.source)),...t.map(e=>j(e.source))]);for(let e of r)tt(e)}function Qe(e){A(e,E)}function $e(e,t,n){let r=j({session:e,path:t,...n===void 0?{}:{root:n}});return(0,T.useSyncExternalStore)((0,T.useCallback)(e=>nt(r,e),[r]),()=>et({session:e,path:t,...n===void 0?{}:{root:n}}))}function et(e){return O.get(j(e))??E}function tt(e){let t=[...D.values()].flatMap(t=>t.filter(t=>j(t.source)===e));t.length===0?O.delete(e):O.set(e,t);for(let t of k.get(e)??[])t()}function nt(e,t){let n=k.get(e)??new Set;return n.add(t),k.set(e,n),()=>{n.delete(t),n.size===0&&k.delete(e)}}function j(e){return JSON.stringify([e.session,e.root??null,e.path])}var M=u();function N(e,t,n){let r=`${encodeURIComponent(e)}:${encodeURIComponent(t)}`;return n===void 0?r:`${r}:${encodeURIComponent(n)}`}var P=new Map;function rt(e,t,n){let r={save:t,...n?{target:n}:{}};return P.set(e,r),()=>{P.get(e)===r&&P.delete(e)}}function it(e){if(e===null)return!1;let t=P.get(e);return t?(t.save(),!0):!1}async function at(e,t){let n=N(e.session,e.path,e.root),r=[...P.entries()].flatMap(([r,i])=>{let a=i.target;if(!a||a.session!==e.session||a.root!==e.root)return[];let o=ot(a.path);return r!==n&&!t.has(o)?[]:[Promise.resolve(i.save())]});return(await Promise.all(r)).every(e=>e!==!1)}function ot(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<0?``:t.slice(n+1).toLowerCase()}var st=`UTC`;function ct(e){return new Date(e).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,timeZone:st})}var F=60,I=60*F,L=24*I,lt=7*L;function ut(e,t=new Date){let n=new Date(e).getTime(),r=Math.max(0,Math.floor((t.getTime()-n)/1e3));return r<F?`just now`:r<I?`${Math.floor(r/F)} m ago`:r<L?`${Math.floor(r/I)} h ago`:r<lt?`${Math.floor(r/L)} d ago`:ct(n)}function dt(e,t){return t?`added`:e}function ft(e){return d(`POST`,`/api/profiles/${e}/untitled`)}function pt(e,t){return[`untitled`,e,t]}function mt(e,t){return a({queryKey:pt(e,t),queryFn:()=>d(`GET`,`/api/profiles/${e}/untitled/${t}`),enabled:e!==null,staleTime:1/0})}function ht(e,t,n,r){e.setQueryData(pt(t,n),e=>e===void 0?e:{...e,content:r})}function gt(e,t,n){return d(`PUT`,`/api/profiles/${e}/untitled/${t}`,{content:n})}function _t(e,t){return d(`DELETE`,`/api/profiles/${e}/untitled/${t}`)}var vt=null,R=new Map;function yt(e){vt=e}function bt(e){vt?.(e)}function xt(e,t){R.set(e,t)}function St(e){return R.get(e)}function Ct(e){R.delete(e)}var z=(0,T.createContext)({openFile:()=>void 0,handler:null,setHandler:()=>void 0});function wt({children:e}){let[t,n]=(0,T.useState)(null),r=(0,T.useCallback)(e=>n(()=>e),[]),i=(0,T.useCallback)((e,n,r,i)=>{if(!t){p(`The editor is not ready yet.`);return}t(e,n,r,i)},[t]),a=(0,T.useMemo)(()=>({openFile:i,handler:t,setHandler:r}),[i,t,r]);return(0,M.jsx)(z.Provider,{value:a,children:e})}function Tt(){let{openFile:e}=(0,T.useContext)(z);return{openFile:e}}function Et(e){let{setHandler:t}=(0,T.useContext)(z),n=(0,T.useRef)(e);n.current=e,(0,T.useEffect)(()=>(t((e,t,r,i)=>n.current(e,t,r,i)),()=>t(null)),[t])}var B=new Map;function Dt(e,t){let n=N(e.session,e.path,e.root),r=B.get(n)??new Set;return r.add(t),B.set(n,r),()=>{r.delete(t),r.size||B.delete(n)}}function Ot(e){let t=B.get(N(e.session,e.path,e.root))?.values().next().value;return t?(t(),!0):!1}var V=`DropdownMenu`,[kt,At]=te(V,[ie]),H=ie(),[jt,U]=kt(V),W=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=H(t),l=T.useRef(null),[u,d]=ee({prop:i,defaultProp:a??!1,onChange:o,caller:V});return(0,M.jsx)(jt,{scope:t,triggerId:g(),triggerRef:l,contentId:g(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,M.jsx)(ce,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};W.displayName=V;var G=`DropdownMenuTrigger`,K=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=U(G,n),o=H(n),s=ne(t,a.triggerRef);return(0,M.jsx)(ye,{asChild:!0,...o,children:(0,M.jsx)(m.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:h(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:h(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});K.displayName=G;var Mt=`DropdownMenuPortal`,q=e=>{let{__scopeDropdownMenu:t,...n}=e,r=H(t);return(0,M.jsx)(fe,{...r,...n})};q.displayName=Mt;var J=`DropdownMenuContent`,Y=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=U(J,n),a=H(n),o=T.useRef(!1);return(0,M.jsx)(de,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:h(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Y.displayName=J;var Nt=`DropdownMenuGroup`,Pt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(ae,{...i,...r,ref:t})});Pt.displayName=Nt;var Ft=`DropdownMenuLabel`,It=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(oe,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`DropdownMenuItem`,X=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(he,{...i,...r,ref:t})});X.displayName=Lt;var Rt=`DropdownMenuCheckboxItem`,zt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(_e,{...i,...r,ref:t})});zt.displayName=Rt;var Bt=`DropdownMenuRadioGroup`,Vt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(be,{...i,...r,ref:t})});Vt.displayName=Bt;var Ht=`DropdownMenuRadioItem`,Ut=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(se,{...i,...r,ref:t})});Ut.displayName=Ht;var Wt=`DropdownMenuItemIndicator`,Gt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(ve,{...i,...r,ref:t})});Gt.displayName=Wt;var Kt=`DropdownMenuSeparator`,qt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(ge,{...i,...r,ref:t})});qt.displayName=Kt;var Jt=`DropdownMenuArrow`,Yt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(me,{...i,...r,ref:t})});Yt.displayName=Jt;var Xt=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=H(t),[s,c]=ee({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,M.jsx)(pe,{...o,open:s,onOpenChange:c,children:n})},Zt=`DropdownMenuSubTrigger`,Qt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(le,{...i,...r,ref:t})});Qt.displayName=Zt;var $t=`DropdownMenuSubContent`,Z=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(ue,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Z.displayName=$t;var en=W,tn=K,nn=q,rn=Y,an=X,on=qt,sn=Xt,cn=Qt,ln=Z,un=en,dn=tn,fn=sn;function pn({className:e,sideOffset:t=4,...n}){return(0,M.jsx)(nn,{children:(0,M.jsx)(rn,{sideOffset:t,className:y(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...n})})}function mn({className:e,...t}){return(0,M.jsx)(an,{className:y(v,_,`[&_svg]:size-3.5`,e),...t})}function hn({className:e,children:t,...n}){return(0,M.jsxs)(cn,{className:y(v,_,`data-[state=open]:bg-action data-[state=open]:text-action-ink [&_svg]:size-3.5`,e),...n,children:[t,(0,M.jsx)(re,{className:`ml-auto`})]})}function gn({className:e,...t}){return(0,M.jsx)(nn,{children:(0,M.jsx)(ln,{className:y(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...t})})}function _n({className:e,...t}){return(0,M.jsx)(on,{className:y(`-mx-1 my-1 h-px bg-border`,e),...t})}var Q=new Map,$=new Map;function vn(e,t,n){let r=xn(e,t,n);Q.set(r,(Q.get(r)??0)+1);for(let e of $.get(r)??[])e()}function yn(e,t,n){let r=xn(e,t,n),i=(0,T.useCallback)(e=>bn(r,e),[r]),a=(0,T.useCallback)(()=>Q.get(r)??0,[r]);return(0,T.useSyncExternalStore)(i,a,a)}function bn(e,t){let n=$.get(e);return n||(n=new Set,$.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&$.delete(e)}}function xn(e,t,n){return JSON.stringify([e,n??null,t])}export{Ge as $,at as A,S as B,gt as C,ut as D,dt as E,Be as F,Ie as G,Ye as H,Re as I,Fe as J,Pe as K,He as L,Qe as M,A as N,rt as O,$e as P,Le as Q,Ze as R,_t as S,mt as T,Ke as U,Ve as V,We as W,Me as X,je as Y,Ae as Z,xt as _,mn as a,Te as at,St as b,gn as c,Dt as d,Ue as et,Ot as f,Ct as g,Et as h,pn as i,Ee as it,N as j,it as k,hn as l,Tt as m,yn as n,Oe as nt,_n as o,we as ot,wt as p,Ne as q,un as r,De as rt,fn as s,Ce as st,vn as t,ke as tt,dn as u,bt as v,ht as w,ft as x,yt as y,ze as z};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{At as n,Ct as r,Dt as i,St as a,Tt as o,bt as s,kt as c,xt as l}from"./protocol-support-BApsXw77.js";import{t as u}from"./jsx-runtime-By8HlURe.js";import{n as d,r as f}from"./api-BOuyloUi.js";import{n as p}from"./dist-BOS6OKSE.js";import{C as m,E as h,T as ee,g as te,y as g}from"./dialog-BIriom7c.js";import{o as ne}from"./x-Dq6POV20.js";import{o as _,s as v,t as re}from"./chevron-right-nSpC9bNN.js";import{n as y,t as b}from"./createLucideIcon-C9A1vLE-.js";import{_ as ie,a as ae,c as oe,d as se,f as ce,g as le,h as ue,i as de,l as fe,m as pe,n as me,o as he,p as ge,r as _e,s as ve,t as ye,u as be}from"./dist-t7ZlsY9S.js";var xe=class extends i{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:r}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:s,isRefetchError:l}=i,u=r.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=a&&u===`forward`,p=s&&u===`backward`,m=a&&u===`backward`;return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:c(t,r.data),hasPreviousPage:n(t,r.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:o&&!f&&!m}}};function Se(e,t){return r(e,xe,t)}var Ce=b(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),we=b(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Te=b(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ee=b(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),De=b(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Oe=b(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),x=50;function S(e){return e===void 0?``:`&root=${encodeURIComponent(e)}`}function C(e){return e?{placeholderData:e=>e}:{}}function ke(e,t,n){let r=e!==void 0;return a({queryKey:n===void 0?[`wt-tree`,e,t]:[`wt-tree`,e,t,n],queryFn:()=>d(`GET`,`/api/worktrees/${e}/tree?path=${encodeURIComponent(t)}${S(n)}`),enabled:r,...C(r)})}function Ae(e,t,n){let r=n?.root;return a({queryKey:r===void 0?[`wt-file`,e,t]:[`wt-file`,e,t,r],queryFn:()=>d(`GET`,`/api/worktrees/${e}/file?path=${encodeURIComponent(t)}${S(r)}`),enabled:e!==void 0&&(n?.enabled??!0),...n?.live===!0?{refetchInterval:s(3e3),refetchOnWindowFocus:!0}:{}})}function je(e,t){let n=o();return l({mutationFn:({path:n,...r})=>d(`PUT`,`/api/worktrees/${e}/file?path=${encodeURIComponent(n)}${S(t)}`,r),onSuccess:(r,{path:i})=>{n.invalidateQueries({queryKey:t===void 0?[`wt-file`,e,i]:[`wt-file`,e,i,t]}),n.invalidateQueries({queryKey:[`wt-diff`,e]})}})}function Me(e,t){let n=t?.against??`base`,r=t?.area,i=t?.root,o=e!==void 0&&(t?.enabled??!0);return a({queryKey:i===void 0?[`wt-diff`,e,n,r]:[`wt-diff`,e,n,r,i],queryFn:()=>{let t=r===void 0?``:`&area=${r}`;return d(`GET`,`/api/worktrees/${e}/diff?against=${n}${t}${S(i)}`)},enabled:o,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...C(o)})}function Ne(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return a({queryKey:n===void 0?[`git-repositories`,e]:[`git-repositories`,e,n],queryFn:()=>d(`GET`,`/api/worktrees/${e}/git-repositories${w(n)}`),enabled:r,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...C(r)})}function Pe(e,t,n){let r=n?.root,i=e!==void 0&&(n?.enabled??!0);return a({queryKey:[`git-original`,e,t,r],queryFn:()=>d(`GET`,`/api/worktrees/${e}/git-original?path=${encodeURIComponent(t)}${S(r)}`),enabled:i,refetchInterval:s(1e4),refetchOnWindowFocus:!0})}function Fe(e,t,n){let r=n?.root;return a({queryKey:[`git-index-file`,e,t,r],queryFn:()=>d(`GET`,`/api/worktrees/${e}/index-file?path=${encodeURIComponent(t)}${S(r)}`),enabled:e!==void 0&&(n?.enabled??!0)})}function Ie(e,t){let n=o();return l({mutationFn:({action:n,...r})=>d(`POST`,`/api/worktrees/${e}/git-${n}${w(t)}`,r),onSuccess:()=>{n.invalidateQueries({queryKey:[`git-repositories`,e]}),n.invalidateQueries({queryKey:[`wt-git-status`,e]}),n.invalidateQueries({queryKey:[`wt-diff`,e]}),n.invalidateQueries({queryKey:[`wt-log`,e]}),n.invalidateQueries({queryKey:[`wt-show`,e]}),n.invalidateQueries({queryKey:[`git-original`,e]}),n.invalidateQueries({queryKey:[`git-index-file`,e]})}})}function Le(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return a({queryKey:n===void 0?[`wt-git-status`,e]:[`wt-git-status`,e,n],queryFn:()=>d(`GET`,`/api/worktrees/${e}/git-status${w(n)}`),enabled:r,refetchInterval:s(1e4),refetchOnWindowFocus:!0,...C(r)})}function w(e){return e===void 0?``:`?root=${encodeURIComponent(e)}`}function Re(e,t,n,r){return d(`POST`,`/api/worktrees/${e}/create${w(r)}`,{path:t,kind:n})}function ze(e,t,n,r){return d(`POST`,`/api/worktrees/${e}/rename${w(r)}`,{from:t,to:n})}function Be(e,t,n,r){return d(`POST`,`/api/worktrees/${e}/copy${w(r)}`,{from:t,to:n})}function Ve(e,t,n){return d(`POST`,`/api/worktrees/${e}/transfer${w(n)}`,t)}function He(e,t,n){return d(`POST`,`/api/worktrees/${e}/delete${w(n)}`,{path:t})}function Ue(e,t,n){let{query:r,regex:i,caseSensitive:o,wholeWord:s}=t;return a({queryKey:[`wt-search`,e,r,i,o,s,n],queryFn:()=>{let t=new URLSearchParams({q:r});return i&&t.set(`regex`,`1`),o&&t.set(`case`,`1`),s&&t.set(`word`,`1`),n!==void 0&&t.set(`root`,n),d(`GET`,`/api/worktrees/${e}/search?${t.toString()}`)},enabled:e!==void 0&&r.length>0,staleTime:2e3})}function We(e,t,n,r){let i=r?.root;return a({queryKey:[`wt-file-at`,e,t,n,i],queryFn:()=>d(`GET`,`/api/worktrees/${e}/file-at?ref=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}${S(i)}`),enabled:e!==void 0&&(r?.enabled??!0),staleTime:1/0})}function Ge(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return Se({queryKey:n===void 0?[`wt-log`,e]:[`wt-log`,e,n],queryFn:({pageParam:t})=>d(`GET`,`/api/worktrees/${e}/log?limit=${x}&skip=${t}${S(n)}`),initialPageParam:0,getNextPageParam:(e,t)=>e.has_more?t.length*x:void 0,enabled:r,...C(r)})}function Ke(e,t,n){return a({queryKey:n===void 0?[`wt-show`,e,t]:[`wt-show`,e,t,n],queryFn:()=>d(`GET`,`/api/worktrees/${e}/show/${t}${w(n)}`),enabled:e!==void 0&&t!==void 0,staleTime:1/0})}var qe=64*1024*1024;function Je(e,t){let n=[],r=[],i=0;for(let a of e)r.length>0&&i+a.size>t&&(n.push(r),r=[],i=0),r.push(a),i+=a.size;return r.length>0&&n.push(r),n}async function Ye(e,t,n,r){let i=[];for(let a of Je(n,qe)){let n=new FormData;for(let e of a)n.append(`files`,e,e.name);let o=await f(`POST`,`/api/worktrees/${e}/upload?dir=${encodeURIComponent(t)}${S(r)}`,{body:n});i.push(...(await o.json()).files)}return{files:i}}function Xe(e,t){if(!e)return t;let n=/filename\*=UTF-8''([^;]+)/i.exec(e);if(n?.[1])try{return decodeURIComponent(n[1])}catch{return t}return/filename="?([^"; ]+)"?/i.exec(e)?.[1]??t}async function Ze(e,t,n){let r=await f(`GET`,`/api/worktrees/${e}/download?path=${encodeURIComponent(t)}${S(n)}`),i=await r.blob(),a=t.split(`/`).filter(Boolean).pop()??`worktree`,o=Xe(r.headers.get(`content-disposition`),a),s=URL.createObjectURL(i);try{let e=document.createElement(`a`);e.href=s,e.download=o,document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(s)}}var T=e(t(),1),E=[],D=new Map,O=new Map,k=new Map;function A(e,t){let n=D.get(e)??E;t.length===0?D.delete(e):D.set(e,t);let r=new Set([...n.map(e=>j(e.source)),...t.map(e=>j(e.source))]);for(let e of r)tt(e)}function Qe(e){A(e,E)}function $e(e,t,n){let r=j({session:e,path:t,...n===void 0?{}:{root:n}});return(0,T.useSyncExternalStore)((0,T.useCallback)(e=>nt(r,e),[r]),()=>et({session:e,path:t,...n===void 0?{}:{root:n}}))}function et(e){return O.get(j(e))??E}function tt(e){let t=[...D.values()].flatMap(t=>t.filter(t=>j(t.source)===e));t.length===0?O.delete(e):O.set(e,t);for(let t of k.get(e)??[])t()}function nt(e,t){let n=k.get(e)??new Set;return n.add(t),k.set(e,n),()=>{n.delete(t),n.size===0&&k.delete(e)}}function j(e){return JSON.stringify([e.session,e.root??null,e.path])}var M=u();function N(e,t,n){let r=`${encodeURIComponent(e)}:${encodeURIComponent(t)}`;return n===void 0?r:`${r}:${encodeURIComponent(n)}`}var P=new Map;function rt(e,t,n){let r={save:t,...n?{target:n}:{}};return P.set(e,r),()=>{P.get(e)===r&&P.delete(e)}}function it(e){if(e===null)return!1;let t=P.get(e);return t?(t.save(),!0):!1}async function at(e,t){let n=N(e.session,e.path,e.root),r=[...P.entries()].flatMap(([r,i])=>{let a=i.target;if(!a||a.session!==e.session||a.root!==e.root)return[];let o=ot(a.path);return r!==n&&!t.has(o)?[]:[Promise.resolve(i.save())]});return(await Promise.all(r)).every(e=>e!==!1)}function ot(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<0?``:t.slice(n+1).toLowerCase()}var st=`UTC`;function ct(e){return new Date(e).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,timeZone:st})}var F=60,I=60*F,L=24*I,lt=7*L;function ut(e,t=new Date){let n=new Date(e).getTime(),r=Math.max(0,Math.floor((t.getTime()-n)/1e3));return r<F?`just now`:r<I?`${Math.floor(r/F)} m ago`:r<L?`${Math.floor(r/I)} h ago`:r<lt?`${Math.floor(r/L)} d ago`:ct(n)}function dt(e,t){return t?`added`:e}function ft(e){return d(`POST`,`/api/profiles/${e}/untitled`)}function pt(e,t){return[`untitled`,e,t]}function mt(e,t){return a({queryKey:pt(e,t),queryFn:()=>d(`GET`,`/api/profiles/${e}/untitled/${t}`),enabled:e!==null,staleTime:1/0})}function ht(e,t,n,r){e.setQueryData(pt(t,n),e=>e===void 0?e:{...e,content:r})}function gt(e,t,n){return d(`PUT`,`/api/profiles/${e}/untitled/${t}`,{content:n})}function _t(e,t){return d(`DELETE`,`/api/profiles/${e}/untitled/${t}`)}var vt=null,R=new Map;function yt(e){vt=e}function bt(e){vt?.(e)}function xt(e,t){R.set(e,t)}function St(e){return R.get(e)}function Ct(e){R.delete(e)}var z=(0,T.createContext)({openFile:()=>void 0,handler:null,setHandler:()=>void 0});function wt({children:e}){let[t,n]=(0,T.useState)(null),r=(0,T.useCallback)(e=>n(()=>e),[]),i=(0,T.useCallback)((e,n,r,i)=>{if(!t){p(`The editor is not ready yet.`);return}t(e,n,r,i)},[t]),a=(0,T.useMemo)(()=>({openFile:i,handler:t,setHandler:r}),[i,t,r]);return(0,M.jsx)(z.Provider,{value:a,children:e})}function Tt(){let{openFile:e}=(0,T.useContext)(z);return{openFile:e}}function Et(e){let{setHandler:t}=(0,T.useContext)(z),n=(0,T.useRef)(e);n.current=e,(0,T.useEffect)(()=>(t((e,t,r,i)=>n.current(e,t,r,i)),()=>t(null)),[t])}var B=new Map;function Dt(e,t){let n=N(e.session,e.path,e.root),r=B.get(n)??new Set;return r.add(t),B.set(n,r),()=>{r.delete(t),r.size||B.delete(n)}}function Ot(e){let t=B.get(N(e.session,e.path,e.root))?.values().next().value;return t?(t(),!0):!1}var V=`DropdownMenu`,[kt,At]=ee(V,[ie]),H=ie(),[jt,U]=kt(V),W=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=H(t),l=T.useRef(null),[u,d]=te({prop:i,defaultProp:a??!1,onChange:o,caller:V});return(0,M.jsx)(jt,{scope:t,triggerId:g(),triggerRef:l,contentId:g(),open:u,onOpenChange:d,onOpenToggle:T.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,M.jsx)(ce,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};W.displayName=V;var G=`DropdownMenuTrigger`,K=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=U(G,n),o=H(n),s=ne(t,a.triggerRef);return(0,M.jsx)(ye,{asChild:!0,...o,children:(0,M.jsx)(m.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:h(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:h(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});K.displayName=G;var Mt=`DropdownMenuPortal`,q=e=>{let{__scopeDropdownMenu:t,...n}=e,r=H(t);return(0,M.jsx)(fe,{...r,...n})};q.displayName=Mt;var J=`DropdownMenuContent`,Y=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=U(J,n),a=H(n),o=T.useRef(!1);return(0,M.jsx)(de,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:h(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Y.displayName=J;var Nt=`DropdownMenuGroup`,Pt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(ae,{...i,...r,ref:t})});Pt.displayName=Nt;var Ft=`DropdownMenuLabel`,It=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(oe,{...i,...r,ref:t})});It.displayName=Ft;var Lt=`DropdownMenuItem`,X=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(he,{...i,...r,ref:t})});X.displayName=Lt;var Rt=`DropdownMenuCheckboxItem`,zt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(_e,{...i,...r,ref:t})});zt.displayName=Rt;var Bt=`DropdownMenuRadioGroup`,Vt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(be,{...i,...r,ref:t})});Vt.displayName=Bt;var Ht=`DropdownMenuRadioItem`,Ut=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(se,{...i,...r,ref:t})});Ut.displayName=Ht;var Wt=`DropdownMenuItemIndicator`,Gt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(ve,{...i,...r,ref:t})});Gt.displayName=Wt;var Kt=`DropdownMenuSeparator`,qt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(ge,{...i,...r,ref:t})});qt.displayName=Kt;var Jt=`DropdownMenuArrow`,Yt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(me,{...i,...r,ref:t})});Yt.displayName=Jt;var Xt=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=H(t),[s,c]=te({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,M.jsx)(pe,{...o,open:s,onOpenChange:c,children:n})},Zt=`DropdownMenuSubTrigger`,Qt=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(le,{...i,...r,ref:t})});Qt.displayName=Zt;var $t=`DropdownMenuSubContent`,Z=T.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=H(n);return(0,M.jsx)(ue,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Z.displayName=$t;var en=W,tn=K,nn=q,rn=Y,an=X,on=qt,sn=Xt,cn=Qt,ln=Z,un=en,dn=tn,fn=sn;function pn({className:e,sideOffset:t=4,...n}){return(0,M.jsx)(nn,{children:(0,M.jsx)(rn,{sideOffset:t,className:y(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...n})})}function mn({className:e,...t}){return(0,M.jsx)(an,{className:y(v,_,`[&_svg]:size-3.5`,e),...t})}function hn({className:e,children:t,...n}){return(0,M.jsxs)(cn,{className:y(v,_,`data-[state=open]:bg-action data-[state=open]:text-action-ink [&_svg]:size-3.5`,e),...n,children:[t,(0,M.jsx)(re,{className:`ml-auto`})]})}function gn({className:e,...t}){return(0,M.jsx)(nn,{children:(0,M.jsx)(ln,{className:y(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...t})})}function _n({className:e,...t}){return(0,M.jsx)(on,{className:y(`-mx-1 my-1 h-px bg-border`,e),...t})}var Q=new Map,$=new Map;function vn(e,t,n){let r=xn(e,t,n);Q.set(r,(Q.get(r)??0)+1);for(let e of $.get(r)??[])e()}function yn(e,t,n){let r=xn(e,t,n),i=(0,T.useCallback)(e=>bn(r,e),[r]),a=(0,T.useCallback)(()=>Q.get(r)??0,[r]);return(0,T.useSyncExternalStore)(i,a,a)}function bn(e,t){let n=$.get(e);return n||(n=new Set,$.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&$.delete(e)}}function xn(e,t,n){return JSON.stringify([e,n??null,t])}export{Ge as $,at as A,S as B,gt as C,ut as D,dt as E,Be as F,Ie as G,Ye as H,Re as I,Fe as J,Pe as K,He as L,Qe as M,A as N,rt as O,$e as P,Le as Q,Ze as R,_t as S,mt as T,Ke as U,Ve as V,We as W,Me as X,je as Y,Ae as Z,xt as _,mn as a,Te as at,St as b,gn as c,Dt as d,Ue as et,Ot as f,Ct as g,Et as h,pn as i,Ee as it,N as j,it as k,hn as l,Tt as m,yn as n,Oe as nt,_n as o,we as ot,wt as p,Ne as q,un as r,De as rt,fn as s,Ce as st,vn as t,ke as tt,dn as u,bt as v,ht as w,ft as x,yt as y,ze as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{i as n,t as r}from"./client-settings-DhfHheKR.js";import{t as i}from"./createLucideIcon-C9A1vLE-.js";var a=i(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),o=i(`regex`,[[`path`,{d:`M17 3v10`,key:`15fgeh`}],[`path`,{d:`m12.67 5.5 8.66 5`,key:`1gpheq`}],[`path`,{d:`m12.67 10.5 8.66-5`,key:`1dkfa6`}],[`path`,{d:`M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z`,key:`swwfx4`}]]),s=i(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]),c=e(t(),1),l=`(prefers-reduced-motion: reduce)`,u=()=>matchMedia(l).matches,d=e=>{let t=matchMedia(l);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)};function f(){return r().reduceMotion||u()}function p(){let e=n(),t=(0,c.useSyncExternalStore)(d,u);return e.reduceMotion||t}export{a,o as i,p as n,s as r,f as t};
|
package/dist/public/assets/{notification-delivery-C9wsvfQY.js → notification-delivery-BrgeSks8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{Bt as n,Mt as r,St as i,Tt as a,xt as o}from"./protocol-support-CsLR9u7d.js";import{C as s,J as c,S as l,X as u,Z as d,o as f,q as p,x as ee}from"./auth-olLlgxc3.js";import{a as te,d as ne,o as re,t as ie}from"./LazyTerminal-BRdmWa8z.js";import{t as ae}from"./jsx-runtime-By8HlURe.js";import{i as m,n as h,t as oe}from"./api-BOuyloUi.js";import{_ as g}from"./hotkeys-Cu0t6sbz.js";import{a as se,n as ce,o as le,r as ue,t as de}from"./dialog-IU2fjIs9.js";import{n as fe,t as _}from"./createLucideIcon-C9A1vLE-.js";import{c as pe,d as me,s as he,u as ge}from"./switch-DihTSmnc.js";import{t as v}from"./ws-Dgc69_w8.js";function _e(e,t){return`[${ne(t)}] ${e}`.slice(0,160)}function ve(e){return e}var y=e(t(),1);function ye(e,t){let n=a(t);return be({filters:{...e,status:`pending`}},n).length}function b(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function be(e={},t){let i=a(t).getMutationCache(),o=y.useRef(e),s=y.useRef(null);return s.current===null&&(s.current=b(i,e)),y.useEffect(()=>{o.current=e}),y.useSyncExternalStore(y.useCallback(e=>i.subscribe(()=>{let t=n(s.current,b(i,o.current));s.current!==t&&(s.current=t,r.schedule(e))}),[i]),()=>s.current,()=>s.current)}var xe=_(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),Se=_(`bike`,[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]),x=_(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),S=_(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),C=_(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),w=_(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),T=_(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),E=_(`cake`,[[`path`,{d:`M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8`,key:`1w3rig`}],[`path`,{d:`M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1`,key:`n2jgmb`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}],[`path`,{d:`M7 8v3`,key:`1qtyvj`}],[`path`,{d:`M12 8v3`,key:`hwp4zt`}],[`path`,{d:`M17 8v3`,key:`1i6e5u`}],[`path`,{d:`M7 4h.01`,key:`1bh4kh`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M17 4h.01`,key:`1upcoc`}]]),D=_(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),O=_(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),k=_(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),A=_(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),j=_(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),Ce=_(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),we=_(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Te=_(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),Ee=_(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),De=_(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),Oe=_(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),ke=_(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),Ae=_(`flower-2`,[[`path`,{d:`M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1`,key:`3pnvol`}],[`circle`,{cx:`12`,cy:`8`,r:`2`,key:`1822b1`}],[`path`,{d:`M12 10v12`,key:`6ubwww`}],[`path`,{d:`M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z`,key:`9hd38g`}],[`path`,{d:`M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z`,key:`ufn41s`}]]),je=_(`flower`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5`,key:`14wa3c`}],[`path`,{d:`M12 7.5V9`,key:`1oy5b0`}],[`path`,{d:`M7.5 12H9`,key:`eltsq1`}],[`path`,{d:`M16.5 12H15`,key:`vk5kw4`}],[`path`,{d:`M12 16.5V15`,key:`k7eayi`}],[`path`,{d:`m8 8 1.88 1.88`,key:`nxy4qf`}],[`path`,{d:`M14.12 9.88 16 8`,key:`1lst6k`}],[`path`,{d:`m8 16 1.88-1.88`,key:`h2eex1`}],[`path`,{d:`M14.12 14.12 16 16`,key:`uqkrx3`}]]),Me=_(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),Ne=_(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),Pe=_(`ghost`,[[`path`,{d:`M9 10h.01`,key:`qbtxuw`}],[`path`,{d:`M15 10h.01`,key:`1qmjsl`}],[`path`,{d:`M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z`,key:`uwwb07`}]]),Fe=_(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),Ie=_(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Le=_(`guitar`,[[`path`,{d:`m11.9 12.1 4.514-4.514`,key:`109xqo`}],[`path`,{d:`M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z`,key:`txyc8t`}],[`path`,{d:`m6 16 2 2`,key:`16qmzd`}],[`path`,{d:`M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z`,key:`1de1vg`}]]),Re=_(`headphones`,[[`path`,{d:`M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3`,key:`1xhozi`}]]),ze=_(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Be=_(`ice-cream-cone`,[[`path`,{d:`m7 11 4.08 10.35a1 1 0 0 0 1.84 0L17 11`,key:`1v6356`}],[`path`,{d:`M17 7A5 5 0 0 0 7 7`,key:`151p3v`}],[`path`,{d:`M17 7a2 2 0 0 1 0 4H7a2 2 0 0 1 0-4`,key:`1sdaij`}]]),Ve=_(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),He=_(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),Ue=_(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),M=_(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),We=_(`mountain-snow`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}],[`path`,{d:`M4.14 15.08c2.62-1.57 5.24-1.43 7.86.42 2.74 1.94 5.49 2 8.23.19`,key:`1pvmmp`}]]),Ge=_(`mountain`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]),Ke=_(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),qe=_(`paw-print`,[[`circle`,{cx:`11`,cy:`4`,r:`2`,key:`vol9p0`}],[`circle`,{cx:`18`,cy:`8`,r:`2`,key:`17gozi`}],[`circle`,{cx:`20`,cy:`16`,r:`2`,key:`1v9bxh`}],[`path`,{d:`M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z`,key:`1ydw1z`}]]),Je=_(`pizza`,[[`path`,{d:`m12 14-1 1`,key:`11onhr`}],[`path`,{d:`m13.75 18.25-1.25 1.42`,key:`1yisr3`}],[`path`,{d:`M17.775 5.654a15.68 15.68 0 0 0-12.121 12.12`,key:`1qtqk6`}],[`path`,{d:`M18.8 9.3a1 1 0 0 0 2.1 7.7`,key:`fbbbr2`}],[`path`,{d:`M21.964 20.732a1 1 0 0 1-1.232 1.232l-18-5a1 1 0 0 1-.695-1.232A19.68 19.68 0 0 1 15.732 2.037a1 1 0 0 1 1.232.695z`,key:`1hyfdd`}]]),Ye=_(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),Xe=_(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Ze=_(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),Qe=_(`rainbow`,[[`path`,{d:`M22 17a10 10 0 0 0-20 0`,key:`ozegv`}],[`path`,{d:`M6 17a6 6 0 0 1 12 0`,key:`5giftw`}],[`path`,{d:`M10 17a2 2 0 0 1 4 0`,key:`gnsikk`}]]),$e=_(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),et=_(`sailboat`,[[`path`,{d:`M10 2v15`,key:`1qf71f`}],[`path`,{d:`M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z`,key:`1pxcvx`}],[`path`,{d:`M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z`,key:`5oog16`}]]),tt=_(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]),nt=_(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),rt=_(`snowflake`,[[`path`,{d:`m10 20-1.25-2.5L6 18`,key:`18frcb`}],[`path`,{d:`M10 4 8.75 6.5 6 6`,key:`7mghy3`}],[`path`,{d:`m14 20 1.25-2.5L18 18`,key:`1chtki`}],[`path`,{d:`m14 4 1.25 2.5L18 6`,key:`1b4wsy`}],[`path`,{d:`m17 21-3-6h-4`,key:`15hhxa`}],[`path`,{d:`m17 3-3 6 1.5 3`,key:`11697g`}],[`path`,{d:`M2 12h6.5L10 9`,key:`kv9z4n`}],[`path`,{d:`m20 10-1.5 2 1.5 2`,key:`1swlpi`}],[`path`,{d:`M22 12h-6.5L14 15`,key:`1mxi28`}],[`path`,{d:`m4 10 1.5 2L4 14`,key:`k9enpj`}],[`path`,{d:`m7 21 3-6-1.5-3`,key:`j8hb9u`}],[`path`,{d:`m7 3 3 6h4`,key:`1otusx`}]]),it=_(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),at=_(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),ot=_(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),N=_(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),st=_(`tent`,[[`path`,{d:`M3.5 21 14 3`,key:`1szst5`}],[`path`,{d:`M20.5 21 10 3`,key:`1310c3`}],[`path`,{d:`M15.5 21 12 15l-3.5 6`,key:`1ddtfw`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}]]),ct=_(`train-front`,[[`path`,{d:`M8 3.1V7a4 4 0 0 0 8 0V3.1`,key:`1v71zp`}],[`path`,{d:`m9 15-1-1`,key:`1yrq24`}],[`path`,{d:`m15 15 1-1`,key:`1t0d6s`}],[`path`,{d:`M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z`,key:`1p0hjs`}],[`path`,{d:`m8 19-2 3`,key:`13i0xs`}],[`path`,{d:`m16 19 2 3`,key:`xo31yx`}]]),lt=_(`tree-pine`,[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]),ut=_(`trees`,[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]),dt=_(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),ft=_(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),pt=_(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]),P=[{name:`mountain`,Icon:Ge},{name:`mountain-snow`,Icon:We},{name:`tree-pine`,Icon:lt},{name:`trees`,Icon:ut},{name:`leaf`,Icon:He},{name:`flower`,Icon:je},{name:`flower-2`,Icon:Ae},{name:`sprout`,Icon:at},{name:`sun`,Icon:N},{name:`moon`,Icon:M},{name:`star`,Icon:ot},{name:`cloud`,Icon:A},{name:`snowflake`,Icon:rt},{name:`zap`,Icon:he},{name:`flame`,Icon:ke},{name:`droplet`,Icon:Ee},{name:`rainbow`,Icon:Qe},{name:`wind`,Icon:pt},{name:`bird`,Icon:x},{name:`fish`,Icon:Oe},{name:`cat`,Icon:k},{name:`dog`,Icon:Te},{name:`rabbit`,Icon:Ze},{name:`turtle`,Icon:ft},{name:`bug`,Icon:T},{name:`snail`,Icon:nt},{name:`paw-print`,Icon:qe},{name:`feather`,Icon:De},{name:`rocket`,Icon:$e},{name:`anchor`,Icon:xe},{name:`compass`,Icon:Ce},{name:`map`,Icon:Ue},{name:`tent`,Icon:st},{name:`camera`,Icon:D},{name:`music`,Icon:Ke},{name:`headphones`,Icon:Re},{name:`palette`,Icon:ge},{name:`brush`,Icon:w},{name:`pencil`,Icon:re},{name:`book`,Icon:C},{name:`book-open`,Icon:S},{name:`coffee`,Icon:j},{name:`pizza`,Icon:Je},{name:`ice-cream-cone`,Icon:Be},{name:`cake`,Icon:E},{name:`gift`,Icon:Fe},{name:`gamepad-2`,Icon:Me},{name:`puzzle`,Icon:Xe},{name:`bike`,Icon:Se},{name:`car`,Icon:O},{name:`plane`,Icon:Ye},{name:`ship`,Icon:tt},{name:`sailboat`,Icon:et},{name:`train-front`,Icon:ct},{name:`heart`,Icon:ze},{name:`sparkles`,Icon:it},{name:`crown`,Icon:we},{name:`gem`,Icon:Ne},{name:`trophy`,Icon:dt},{name:`ghost`,Icon:Pe},{name:`bot`,Icon:me},{name:`globe`,Icon:Ie},{name:`guitar`,Icon:Le}],mt=Object.fromEntries(P.map(e=>[e.name,e.Icon])),F=ae();function ht({icon:e,colour:t,className:n}){let r=fe(`size-4 shrink-0`,t?te(t):`text-fg-muted`,n);return(0,F.jsx)(e&&mt[e]||pe,{className:r})}function gt({stream:e,label:t,hint:n,onClose:r}){let[i,a]=(0,y.useState)(null);return(0,F.jsx)(de,{open:!0,onOpenChange:e=>!e&&r(),children:(0,F.jsxs)(ce,{className:`h-[85vh] max-w-[calc(100vw-4rem)]`,children:[(0,F.jsxs)(se,{children:[(0,F.jsxs)(le,{children:[t,` — login`]}),(0,F.jsx)(ue,{children:i===null?`Complete the agent’s login flow below.${n===void 0?` The account shows as logged in once it finishes cleanly.`:` ${n}`}`:`The login exited with code ${i} without completing. The output above may say why; close this and try again.`})]}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-md bg-ground p-1`,children:(0,F.jsx)(ie,{stream:e,onExit:e=>e===0?r():a(e)})})]})})}function _t(e){let t=e?.catalogue,n=t?.releases.latest;if(e?.availability!==`ready`||!t||!n?.host_asset)return[];let r=[];return c(n.version,t.daemon_version)&&r.push({component:`daemon`,version:n.version}),t.runtime_default&&c(n.version,t.runtime_default.version)&&r.push({component:`runtime`,version:n.version}),r}function I(e){return e.staged&&!e.dispatched&&[`staged`,`preflight`,`approved`].includes(e.phase)}function vt(e,t){let n=e?.result?.operation;if(e?.availability!==`ready`||!e.result?.ok||!n||!I(n)||!t?.ok||t.operation?.id!==n.id||t.operation.revision!==n.revision)return null;let r=t.review;if(!r)return null;let i=r.interruption_fingerprint,a=r.fingerprint??i;return!a||!r.can_apply&&!i||i&&!e.capabilities.interruption_approval?null:{action:`apply`,reference:{id:n.id,revision:n.revision},fingerprint:a,...i?{interruption_approval:i}:{}}}function yt(e){let t=e?.result?.operation;return!!t&&!p(t.phase)}function bt(e){let t=e.result?.operation;return e.availability===`unavailable`&&e.observation===`recorded`&&e.capabilities.offline_continuation&&e.result?.ok&&t?.dispatched&&!p(t.phase)?{action:`continue-offline`,reference:{id:t.id,revision:t.revision}}:null}var xt={checking:`Checking update`,downloading:`Downloading`,staged:`Downloaded and verified`,preflight:`Ready for review`,approved:`Approved`,dispatching:`Starting update`,applying:`Applying update`,verifying:`Verifying update`,complete:`Update complete`,blocked:`Update blocked`,cancelled:`Update cancelled`,superseded:`Update replaced`,failed:`Update failed`,recovery_required:`Recovery required`,rolled_back:`Update rolled back`},St=class{offered=new Set;take(e,t){return t.filter(({component:t,version:n})=>{let r=JSON.stringify([e,t,n]);return this.offered.has(r)?!1:(this.offered.add(r),!0)})}};function L(){return f()?.scope??`local`}function R(e){let t=f(),n=t?.generation,r=t?`/api/host/updates`:`/cockpit/updates`,i=()=>{if(!e)throw Error(`Host updates require host-approved device access.`);if(f()!==t||t?.generation!==n)throw Error(`Host update connection changed. Refresh status before continuing.`)};return async(e,n)=>{i(),t&&e&&s.parse(e);let a=e?await h(`POST`,r,e,n):n?await h(`GET`,r,void 0,n):await h(`GET`,r);return i(),a}}function Ct(e,t){let n=[`cockpit-host-updates`,t],r,i=()=>{let t=e.getQueryData(n);if(t?.availability!==`ready`||t.observation===`recorded`||!t.catalogue)return;let i=JSON.stringify([t.catalogue.daemon_version,t.catalogue.runtime_default?.version??null]);i!==r&&(r=i,e.invalidateQueries({queryKey:[`release-notes`]}))},a=e.getQueryCache().subscribe(e=>{e.type===`updated`&&e.query.queryKey[0]===n[0]&&e.query.queryKey[1]===t&&i()});return i(),a}function z(){return[`cockpit-host-updates`,L()]}function B(){let e=f(),t=i({queryKey:[`host-update-access`,L(),e?.generation],queryFn:async({signal:e})=>{let t=u.parse(await h(`GET`,`/api/version`,void 0,e));return t.protocol.major>=26&&t.remote_host_updates===!0},enabled:!!e,staleTime:1/0,retry:!1});return!e||t.data===!0}function wt(e=!f()){let t=R(e);return ve({queryKey:z(),queryFn:async({signal:e})=>l.parse(await t(void 0,e)),enabled:e,retry:!1,staleTime:5e3,refetchInterval:e=>e.state.error instanceof oe&&e.state.error.status===404?!1:[`checking`,`downloading`,`dispatching`,`applying`,`verifying`].includes(e.state.data?.result?.operation?.phase??``)||e.state.data?.catalogue?.releases.state===`checking`?2e3:6e4})}function Tt(e,t=!f()){let n=z(),r=R(t);return{mutationKey:[`cockpit-host-update-action`,L()],retry:!1,networkMode:`always`,mutationFn:async e=>ee.parse(await r(e)),onMutate:async()=>{await e.cancelQueries({queryKey:n})},onSuccess:t=>{e.setQueryData(n,e=>e&&{...e,result:t})},onSettled:async()=>{await e.invalidateQueries({queryKey:n})}}}function Et(){return i(wt(B()))}function Dt(){let e=a(),t=B(),n=[`cockpit-host-update-action`,L()],r=ye({mutationKey:n}),i=o(Tt(e,t));return{...i,busy:r>0,act:t=>{e.isMutating({mutationKey:n})||i.mutate(t)}}}function Ot(){let e=a(),t=L();(0,y.useEffect)(()=>{let n=[`cockpit-host-updates`,t],r=()=>{e.invalidateQueries({queryKey:n}),e.invalidateQueries({queryKey:[`release-notes`]})},i=v.onHostUpdatesChanged(r),a=Ct(e,t),o=v.onConnectionChange(e=>{e&&r()});return()=>{i(),a(),o()}},[e,t])}var V=e=>e&&typeof e==`object`?e:{},H=[{id:`appearance`,label:`Appearance`,fields:[{key:`theme`,store:`theme`},{key:`cursorPackage`,store:`client`},{key:`uiFontSize`,store:`client`},{key:`terminalFontSize`,store:`client`},{key:`editorFontSize`,store:`client`},{key:`density`,store:`client`},{key:`terminalScrollback`,store:`client`},{key:`projectBasedLayout`,store:`client`},{key:`showAllProjectSessions`,store:`client`}]},{id:`profile`,label:`Profile`,fields:[{key:`branch_prefix`,store:`profileColumn`},{key:`icon`,store:`profileColumn`},{key:`icon_colour`,store:`profileColumn`}]},{id:`sessions`,label:`Sessions`,fields:[{key:`onboardingTemplate`,store:`profileSettings`},{key:`concurrentTemplate`,store:`profileSettings`},{key:`restartTemplate`,store:`profileSettings`},{key:`tabTitleTemplate`,store:`profileSettings`},{key:`sessionDefaults`,store:`profileSettings`},{key:`allowSkipPermissions`,store:`profileSettings`},{key:`captureSessionEnv`,store:`profileSettings`}]},{id:`editor`,label:`Editor`,fields:[{key:`editorTabSize`,store:`client`},{key:`editorWordWrap`,store:`client`},{key:`editorLinkSshHost`,store:`client`}]},{id:`hotkeys`,label:`Hotkeys`,fields:[{key:`hotkeys`,store:`profileSettings`}]},{id:`notifications`,label:`Notifications`,fields:[{key:`notifications`,store:`profileSettings`,pick:e=>{let{desktop:t,sound:n,when_focused:r}=V(e);return{desktop:t,sound:n,...r===void 0?{}:{when_focused:r}}},mergeInto:(e,t)=>({...V(t),...V(e)})}]},{id:`scratchpad`,label:`Scratchpad (profile-wide entries)`,fields:[{key:`entries`,store:`scratchpad`}]}];function U(e){return e.filter(e=>e.scope===`profile`).map(e=>({title:e.title,body:e.body,tags:e.tags,agent_type:e.agent_type}))}function W(e){return JSON.stringify([e.title??``,e.body,e.tags,e.agent_type??``])}function kt(e,t){if(!Array.isArray(e))return[];let n=new Set(U(t).map(W)),r=new Set,i=[];for(let t of e){let e=V(t);if(typeof e.body!=`string`||e.body.length===0)continue;let a={title:typeof e.title==`string`&&e.title!==``?e.title:null,body:e.body,tags:Array.isArray(e.tags)?e.tags.filter(e=>typeof e==`string`):[],agent_type:typeof e.agent_type==`string`?e.agent_type:null},o=W(a);n.has(o)||r.has(o)||(r.add(o),i.push(a))}return i}function At(e,t){switch(e.store){case`client`:return t.client[e.key];case`theme`:return t.theme;case`profileSettings`:return t.profileSettings[e.key];case`profileColumn`:return t.profile[e.key];case`scratchpad`:return U(t.scratchpad)}}function jt(e,t){let n={};for(let r of H){if(!e.includes(r.id))continue;let i={};for(let e of r.fields){let n=At(e,t);n!==void 0&&(i[e.key]=e.pick?e.pick(n):n)}Object.keys(i).length>0&&(n[r.id]=i)}return n}function Mt(e,t,n,r){if(!e||typeof e!=`object`)return[];let i=e,a={},o={},s={},c=[];for(let e of H){if(r&&!r.includes(e.id))continue;let l=i[e.id];if(!l||typeof l!=`object`)continue;let u=l,d=!1;for(let r of e.fields){if(!(r.key in u))continue;let e=u[r.key];if(r.store===`scratchpad`){let r=kt(e,n.scratchpad);r.length>0&&(t.createScratchpad(r),d=!0);continue}d=!0;let i=r.mergeInto?r.mergeInto(e,r.store===`profileSettings`?n.profileSettings[r.key]:void 0):e;r.store===`client`?a[r.key]=i:r.store===`theme`?t.setTheme(i):r.store===`profileSettings`?o[r.key]=i:s[r.key]=i}d&&c.push(e.label)}return Object.keys(a).length>0&&t.setClient(a),Object.keys(o).length>0&&t.patchProfileSettings(o),Object.keys(s).length>0&&t.patchProfileColumns(s),c}var G={version:1,profiles:{}};function Nt(e,t){return e.profiles[t]??{enabled:!0,groups:H.map(e=>e.id),doc:{},updatedAt:new Date(0).toISOString()}}async function Pt(){try{let e=await fetch(`/cockpit/local-sync`,{headers:m(),cache:`no-store`});return e.ok?{available:!0,file:await e.json()}:{available:!1,file:G}}catch{return{available:!1,file:G}}}function Ft(){return i({queryKey:[`local-sync`],queryFn:Pt,staleTime:5e3,refetchOnWindowFocus:!0,retry:!1})}function It(){let e=a();return o({mutationFn:async e=>{let t=await fetch(`/cockpit/local-sync`,{method:`PUT`,headers:{...m(),"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`The local sync store did not accept the write.`);return await t.json()},onSuccess:t=>e.setQueryData([`local-sync`],{available:!0,file:t})})}function Lt(){return g()?.showNotification?`unverified`:typeof Notification>`u`?`unsupported`:Notification.permission}async function Rt(e,t){let n;try{return await Promise.race([e,new Promise((e,r)=>{n=setTimeout(()=>r(Error(t)),1e4)})])}finally{clearTimeout(n)}}var K;async function zt(){return!(`serviceWorker`in navigator)||!window.isSecureContext?null:(K||=q().catch(e=>{throw K=void 0,e}),K)}async function q(){let e=await Rt(navigator.serviceWorker.register(`/notification-worker.js`),`Notification support did not respond. Reload Puddle and try again.`);if(e.active)return e;let t=e.installing??e.waiting;if(!t)throw Error(`Notification support could not start. Reload and try again.`);return await new Promise((e,n)=>{let r=r=>{clearTimeout(a),t.removeEventListener(`statechange`,i),r?n(r):e()},i=()=>{t.state===`activated`?r():t.state===`redundant`&&r(Error(`Notification support could not start.`))},a=setTimeout(()=>r(Error(`Notification support timed out.`)),1e4);t.addEventListener(`statechange`,i),i()}),e}async function Bt(e,t){if(!e.active)throw Error(`Notification support is not active.`);await new Promise((n,r)=>{let i=new MessageChannel,a=e=>{clearTimeout(o),i.port1.close(),e?r(e):n()},o=setTimeout(()=>a(Error(`Notification delivery timed out.`)),1e4);i.port1.onmessage=e=>a(e.data?.ok?void 0:Error(`The browser could not deliver the notification. Check system permissions.`)),e.active.postMessage({t:`show-notification`,request:t},[i.port2])})}var J={state:`unverified`,message:null},Y=new Set,X=new Map,Z=!1,Vt=!1;function Q(e,t){X.set(e,t),X.size>64&&X.delete(X.keys().next().value)}function $(e){J=e;for(let e of Y)e();return e}function Ht(){return(0,y.useSyncExternalStore)(e=>(Y.add(e),()=>{Y.delete(e)}),()=>J)}async function Ut(){let e=g();if(e?.notificationStatus)try{$(d.parse(await e.notificationStatus()))}catch{$({state:`failed`,message:`Could not read desktop notification delivery status.`})}}async function Wt(e,t,n){try{let r=g();if(r?.showNotification){!Z&&r.onNotificationClick&&(r.onNotificationClick((e,t)=>{t||X.get(e)?.(),X.delete(e)}),Z=!0),Q(e.id,t);let{target:i,...a}=e;return $(d.parse(await r.showNotification({...a,...r.notificationTargets?{target:i}:{},...r.notificationSubtitles&&n?{title:`${n.host} · ${n.project.name}`.slice(0,160),subtitle:e.title}:{}})))}if(typeof Notification>`u`)return $({state:`unsupported`,message:`This browser cannot show notifications.`});if(Notification.permission!==`granted`)return $({state:`failed`,message:`Allow notifications for Puddle in browser settings.`});let i=n?{...e,title:_e(e.title,n.project)}:e,a=await zt();return a?(Vt||=(navigator.serviceWorker.addEventListener(`message`,e=>{e.data?.t!==`notification-click`||typeof e.data.id!=`string`||(e.data.target||X.get(e.data.id)?.(),X.delete(e.data.id))}),!0),Q(e.id,t),await Bt(a,i),$({state:`shown`,message:null})):await new Promise(n=>{let r=new Notification(i.title,{body:e.body,tag:e.id,silent:!0}),a=setTimeout(()=>n($({state:`unverified`,message:`Delivery has not been confirmed. Check system notification settings.`})),5e3);r.onshow=()=>{clearTimeout(a),n($({state:`shown`,message:null}))},r.onerror=()=>{clearTimeout(a),n($({state:`failed`,message:`The browser could not deliver the notification. Check system permissions.`}))},r.onclick=()=>{window.focus(),t(),r.close()}})}catch(e){return $({state:`failed`,message:e instanceof Error?e.message:`Notification delivery failed.`})}}export{gt as C,M as D,N as E,Ve as O,yt as S,P as T,_t as _,Nt as a,xt as b,H as c,B as d,Dt as f,St as g,L as h,Lt as i,Mt as l,Et as m,Ut as n,Ft as o,Ot as p,Ht as r,It as s,Wt as t,jt as u,I as v,ht as w,vt as x,bt as y};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{Bt as n,Mt as r,St as i,Tt as a,xt as o}from"./protocol-support-BApsXw77.js";import{C as s,J as c,S as l,X as u,Z as d,o as f,q as p,x as ee}from"./auth-olLlgxc3.js";import{a as te,d as ne,o as re,t as ie}from"./LazyTerminal-CQNsHnn5.js";import{t as ae}from"./jsx-runtime-By8HlURe.js";import{i as m,n as h,t as oe}from"./api-BOuyloUi.js";import{_ as g}from"./hotkeys-Cu0t6sbz.js";import{i as se,o as ce,r as le,s as ue,t as de}from"./dialog-BIriom7c.js";import{n as fe,t as _}from"./createLucideIcon-C9A1vLE-.js";import{c as pe,d as me,s as he,u as ge}from"./switch-B1LYyDZA.js";import{t as v}from"./ws-Dgc69_w8.js";function _e(e,t){return`[${ne(t)}] ${e}`.slice(0,160)}function ve(e){return e}var y=e(t(),1);function ye(e,t){let n=a(t);return be({filters:{...e,status:`pending`}},n).length}function b(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function be(e={},t){let i=a(t).getMutationCache(),o=y.useRef(e),s=y.useRef(null);return s.current===null&&(s.current=b(i,e)),y.useEffect(()=>{o.current=e}),y.useSyncExternalStore(y.useCallback(e=>i.subscribe(()=>{let t=n(s.current,b(i,o.current));s.current!==t&&(s.current=t,r.schedule(e))}),[i]),()=>s.current,()=>s.current)}var xe=_(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),Se=_(`bike`,[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]),x=_(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),S=_(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),C=_(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),w=_(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),T=_(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),E=_(`cake`,[[`path`,{d:`M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8`,key:`1w3rig`}],[`path`,{d:`M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1`,key:`n2jgmb`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}],[`path`,{d:`M7 8v3`,key:`1qtyvj`}],[`path`,{d:`M12 8v3`,key:`hwp4zt`}],[`path`,{d:`M17 8v3`,key:`1i6e5u`}],[`path`,{d:`M7 4h.01`,key:`1bh4kh`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M17 4h.01`,key:`1upcoc`}]]),D=_(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),O=_(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),k=_(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),A=_(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),j=_(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),Ce=_(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),we=_(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Te=_(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),Ee=_(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),De=_(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),Oe=_(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),ke=_(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),Ae=_(`flower-2`,[[`path`,{d:`M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1`,key:`3pnvol`}],[`circle`,{cx:`12`,cy:`8`,r:`2`,key:`1822b1`}],[`path`,{d:`M12 10v12`,key:`6ubwww`}],[`path`,{d:`M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z`,key:`9hd38g`}],[`path`,{d:`M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z`,key:`ufn41s`}]]),je=_(`flower`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5`,key:`14wa3c`}],[`path`,{d:`M12 7.5V9`,key:`1oy5b0`}],[`path`,{d:`M7.5 12H9`,key:`eltsq1`}],[`path`,{d:`M16.5 12H15`,key:`vk5kw4`}],[`path`,{d:`M12 16.5V15`,key:`k7eayi`}],[`path`,{d:`m8 8 1.88 1.88`,key:`nxy4qf`}],[`path`,{d:`M14.12 9.88 16 8`,key:`1lst6k`}],[`path`,{d:`m8 16 1.88-1.88`,key:`h2eex1`}],[`path`,{d:`M14.12 14.12 16 16`,key:`uqkrx3`}]]),Me=_(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),Ne=_(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),Pe=_(`ghost`,[[`path`,{d:`M9 10h.01`,key:`qbtxuw`}],[`path`,{d:`M15 10h.01`,key:`1qmjsl`}],[`path`,{d:`M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z`,key:`uwwb07`}]]),Fe=_(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),Ie=_(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Le=_(`guitar`,[[`path`,{d:`m11.9 12.1 4.514-4.514`,key:`109xqo`}],[`path`,{d:`M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z`,key:`txyc8t`}],[`path`,{d:`m6 16 2 2`,key:`16qmzd`}],[`path`,{d:`M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z`,key:`1de1vg`}]]),Re=_(`headphones`,[[`path`,{d:`M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3`,key:`1xhozi`}]]),ze=_(`heart`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]),Be=_(`ice-cream-cone`,[[`path`,{d:`m7 11 4.08 10.35a1 1 0 0 0 1.84 0L17 11`,key:`1v6356`}],[`path`,{d:`M17 7A5 5 0 0 0 7 7`,key:`151p3v`}],[`path`,{d:`M17 7a2 2 0 0 1 0 4H7a2 2 0 0 1 0-4`,key:`1sdaij`}]]),Ve=_(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),He=_(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),Ue=_(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),M=_(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),We=_(`mountain-snow`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}],[`path`,{d:`M4.14 15.08c2.62-1.57 5.24-1.43 7.86.42 2.74 1.94 5.49 2 8.23.19`,key:`1pvmmp`}]]),Ge=_(`mountain`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]),Ke=_(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),qe=_(`paw-print`,[[`circle`,{cx:`11`,cy:`4`,r:`2`,key:`vol9p0`}],[`circle`,{cx:`18`,cy:`8`,r:`2`,key:`17gozi`}],[`circle`,{cx:`20`,cy:`16`,r:`2`,key:`1v9bxh`}],[`path`,{d:`M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z`,key:`1ydw1z`}]]),Je=_(`pizza`,[[`path`,{d:`m12 14-1 1`,key:`11onhr`}],[`path`,{d:`m13.75 18.25-1.25 1.42`,key:`1yisr3`}],[`path`,{d:`M17.775 5.654a15.68 15.68 0 0 0-12.121 12.12`,key:`1qtqk6`}],[`path`,{d:`M18.8 9.3a1 1 0 0 0 2.1 7.7`,key:`fbbbr2`}],[`path`,{d:`M21.964 20.732a1 1 0 0 1-1.232 1.232l-18-5a1 1 0 0 1-.695-1.232A19.68 19.68 0 0 1 15.732 2.037a1 1 0 0 1 1.232.695z`,key:`1hyfdd`}]]),Ye=_(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),Xe=_(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Ze=_(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),Qe=_(`rainbow`,[[`path`,{d:`M22 17a10 10 0 0 0-20 0`,key:`ozegv`}],[`path`,{d:`M6 17a6 6 0 0 1 12 0`,key:`5giftw`}],[`path`,{d:`M10 17a2 2 0 0 1 4 0`,key:`gnsikk`}]]),$e=_(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),et=_(`sailboat`,[[`path`,{d:`M10 2v15`,key:`1qf71f`}],[`path`,{d:`M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z`,key:`1pxcvx`}],[`path`,{d:`M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z`,key:`5oog16`}]]),tt=_(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]),nt=_(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),rt=_(`snowflake`,[[`path`,{d:`m10 20-1.25-2.5L6 18`,key:`18frcb`}],[`path`,{d:`M10 4 8.75 6.5 6 6`,key:`7mghy3`}],[`path`,{d:`m14 20 1.25-2.5L18 18`,key:`1chtki`}],[`path`,{d:`m14 4 1.25 2.5L18 6`,key:`1b4wsy`}],[`path`,{d:`m17 21-3-6h-4`,key:`15hhxa`}],[`path`,{d:`m17 3-3 6 1.5 3`,key:`11697g`}],[`path`,{d:`M2 12h6.5L10 9`,key:`kv9z4n`}],[`path`,{d:`m20 10-1.5 2 1.5 2`,key:`1swlpi`}],[`path`,{d:`M22 12h-6.5L14 15`,key:`1mxi28`}],[`path`,{d:`m4 10 1.5 2L4 14`,key:`k9enpj`}],[`path`,{d:`m7 21 3-6-1.5-3`,key:`j8hb9u`}],[`path`,{d:`m7 3 3 6h4`,key:`1otusx`}]]),it=_(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),at=_(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),ot=_(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),N=_(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),st=_(`tent`,[[`path`,{d:`M3.5 21 14 3`,key:`1szst5`}],[`path`,{d:`M20.5 21 10 3`,key:`1310c3`}],[`path`,{d:`M15.5 21 12 15l-3.5 6`,key:`1ddtfw`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}]]),ct=_(`train-front`,[[`path`,{d:`M8 3.1V7a4 4 0 0 0 8 0V3.1`,key:`1v71zp`}],[`path`,{d:`m9 15-1-1`,key:`1yrq24`}],[`path`,{d:`m15 15 1-1`,key:`1t0d6s`}],[`path`,{d:`M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z`,key:`1p0hjs`}],[`path`,{d:`m8 19-2 3`,key:`13i0xs`}],[`path`,{d:`m16 19 2 3`,key:`xo31yx`}]]),lt=_(`tree-pine`,[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]),ut=_(`trees`,[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]),dt=_(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),ft=_(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),pt=_(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]),P=[{name:`mountain`,Icon:Ge},{name:`mountain-snow`,Icon:We},{name:`tree-pine`,Icon:lt},{name:`trees`,Icon:ut},{name:`leaf`,Icon:He},{name:`flower`,Icon:je},{name:`flower-2`,Icon:Ae},{name:`sprout`,Icon:at},{name:`sun`,Icon:N},{name:`moon`,Icon:M},{name:`star`,Icon:ot},{name:`cloud`,Icon:A},{name:`snowflake`,Icon:rt},{name:`zap`,Icon:he},{name:`flame`,Icon:ke},{name:`droplet`,Icon:Ee},{name:`rainbow`,Icon:Qe},{name:`wind`,Icon:pt},{name:`bird`,Icon:x},{name:`fish`,Icon:Oe},{name:`cat`,Icon:k},{name:`dog`,Icon:Te},{name:`rabbit`,Icon:Ze},{name:`turtle`,Icon:ft},{name:`bug`,Icon:T},{name:`snail`,Icon:nt},{name:`paw-print`,Icon:qe},{name:`feather`,Icon:De},{name:`rocket`,Icon:$e},{name:`anchor`,Icon:xe},{name:`compass`,Icon:Ce},{name:`map`,Icon:Ue},{name:`tent`,Icon:st},{name:`camera`,Icon:D},{name:`music`,Icon:Ke},{name:`headphones`,Icon:Re},{name:`palette`,Icon:ge},{name:`brush`,Icon:w},{name:`pencil`,Icon:re},{name:`book`,Icon:C},{name:`book-open`,Icon:S},{name:`coffee`,Icon:j},{name:`pizza`,Icon:Je},{name:`ice-cream-cone`,Icon:Be},{name:`cake`,Icon:E},{name:`gift`,Icon:Fe},{name:`gamepad-2`,Icon:Me},{name:`puzzle`,Icon:Xe},{name:`bike`,Icon:Se},{name:`car`,Icon:O},{name:`plane`,Icon:Ye},{name:`ship`,Icon:tt},{name:`sailboat`,Icon:et},{name:`train-front`,Icon:ct},{name:`heart`,Icon:ze},{name:`sparkles`,Icon:it},{name:`crown`,Icon:we},{name:`gem`,Icon:Ne},{name:`trophy`,Icon:dt},{name:`ghost`,Icon:Pe},{name:`bot`,Icon:me},{name:`globe`,Icon:Ie},{name:`guitar`,Icon:Le}],mt=Object.fromEntries(P.map(e=>[e.name,e.Icon])),F=ae();function ht({icon:e,colour:t,className:n}){let r=fe(`size-4 shrink-0`,t?te(t):`text-fg-muted`,n);return(0,F.jsx)(e&&mt[e]||pe,{className:r})}function gt({stream:e,label:t,hint:n,onClose:r}){let[i,a]=(0,y.useState)(null);return(0,F.jsx)(de,{open:!0,onOpenChange:e=>!e&&r(),children:(0,F.jsxs)(le,{className:`h-[85vh] max-w-[calc(100vw-4rem)]`,children:[(0,F.jsxs)(ce,{children:[(0,F.jsxs)(ue,{children:[t,` — login`]}),(0,F.jsx)(se,{children:i===null?`Complete the agent’s login flow below.${n===void 0?` The account shows as logged in once it finishes cleanly.`:` ${n}`}`:`The login exited with code ${i} without completing. The output above may say why; close this and try again.`})]}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-md bg-ground p-1`,children:(0,F.jsx)(ie,{stream:e,onExit:e=>e===0?r():a(e)})})]})})}function _t(e){let t=e?.catalogue,n=t?.releases.latest;if(e?.availability!==`ready`||!t||!n?.host_asset)return[];let r=[];return c(n.version,t.daemon_version)&&r.push({component:`daemon`,version:n.version}),t.runtime_default&&c(n.version,t.runtime_default.version)&&r.push({component:`runtime`,version:n.version}),r}function I(e){return e.staged&&!e.dispatched&&[`staged`,`preflight`,`approved`].includes(e.phase)}function vt(e,t){let n=e?.result?.operation;if(e?.availability!==`ready`||!e.result?.ok||!n||!I(n)||!t?.ok||t.operation?.id!==n.id||t.operation.revision!==n.revision)return null;let r=t.review;if(!r)return null;let i=r.interruption_fingerprint,a=r.fingerprint??i;return!a||!r.can_apply&&!i||i&&!e.capabilities.interruption_approval?null:{action:`apply`,reference:{id:n.id,revision:n.revision},fingerprint:a,...i?{interruption_approval:i}:{}}}function yt(e){let t=e?.result?.operation;return!!t&&!p(t.phase)}function bt(e){let t=e.result?.operation;return e.availability===`unavailable`&&e.observation===`recorded`&&e.capabilities.offline_continuation&&e.result?.ok&&t?.dispatched&&!p(t.phase)?{action:`continue-offline`,reference:{id:t.id,revision:t.revision}}:null}var xt={checking:`Checking update`,downloading:`Downloading`,staged:`Downloaded and verified`,preflight:`Ready for review`,approved:`Approved`,dispatching:`Starting update`,applying:`Applying update`,verifying:`Verifying update`,complete:`Update complete`,blocked:`Update blocked`,cancelled:`Update cancelled`,superseded:`Update replaced`,failed:`Update failed`,recovery_required:`Recovery required`,rolled_back:`Update rolled back`},St=class{offered=new Set;take(e,t){return t.filter(({component:t,version:n})=>{let r=JSON.stringify([e,t,n]);return this.offered.has(r)?!1:(this.offered.add(r),!0)})}};function L(){return f()?.scope??`local`}function R(e){let t=f(),n=t?.generation,r=t?`/api/host/updates`:`/cockpit/updates`,i=()=>{if(!e)throw Error(`Host updates require host-approved device access.`);if(f()!==t||t?.generation!==n)throw Error(`Host update connection changed. Refresh status before continuing.`)};return async(e,n)=>{i(),t&&e&&s.parse(e);let a=e?await h(`POST`,r,e,n):n?await h(`GET`,r,void 0,n):await h(`GET`,r);return i(),a}}function Ct(e,t){let n=[`cockpit-host-updates`,t],r,i=()=>{let t=e.getQueryData(n);if(t?.availability!==`ready`||t.observation===`recorded`||!t.catalogue)return;let i=JSON.stringify([t.catalogue.daemon_version,t.catalogue.runtime_default?.version??null]);i!==r&&(r=i,e.invalidateQueries({queryKey:[`release-notes`]}))},a=e.getQueryCache().subscribe(e=>{e.type===`updated`&&e.query.queryKey[0]===n[0]&&e.query.queryKey[1]===t&&i()});return i(),a}function z(){return[`cockpit-host-updates`,L()]}function B(){let e=f(),t=i({queryKey:[`host-update-access`,L(),e?.generation],queryFn:async({signal:e})=>{let t=u.parse(await h(`GET`,`/api/version`,void 0,e));return t.protocol.major>=26&&t.remote_host_updates===!0},enabled:!!e,staleTime:1/0,retry:!1});return!e||t.data===!0}function wt(e=!f()){let t=R(e);return ve({queryKey:z(),queryFn:async({signal:e})=>l.parse(await t(void 0,e)),enabled:e,retry:!1,staleTime:5e3,refetchInterval:e=>e.state.error instanceof oe&&e.state.error.status===404?!1:[`checking`,`downloading`,`dispatching`,`applying`,`verifying`].includes(e.state.data?.result?.operation?.phase??``)||e.state.data?.catalogue?.releases.state===`checking`?2e3:6e4})}function Tt(e,t=!f()){let n=z(),r=R(t);return{mutationKey:[`cockpit-host-update-action`,L()],retry:!1,networkMode:`always`,mutationFn:async e=>ee.parse(await r(e)),onMutate:async()=>{await e.cancelQueries({queryKey:n})},onSuccess:t=>{e.setQueryData(n,e=>e&&{...e,result:t})},onSettled:async()=>{await e.invalidateQueries({queryKey:n})}}}function Et(){return i(wt(B()))}function Dt(){let e=a(),t=B(),n=[`cockpit-host-update-action`,L()],r=ye({mutationKey:n}),i=o(Tt(e,t));return{...i,busy:r>0,act:t=>{e.isMutating({mutationKey:n})||i.mutate(t)}}}function Ot(){let e=a(),t=L();(0,y.useEffect)(()=>{let n=[`cockpit-host-updates`,t],r=()=>{e.invalidateQueries({queryKey:n}),e.invalidateQueries({queryKey:[`release-notes`]})},i=v.onHostUpdatesChanged(r),a=Ct(e,t),o=v.onConnectionChange(e=>{e&&r()});return()=>{i(),a(),o()}},[e,t])}var V=e=>e&&typeof e==`object`?e:{},H=[{id:`appearance`,label:`Appearance`,fields:[{key:`theme`,store:`theme`},{key:`cursorPackage`,store:`client`},{key:`uiFontSize`,store:`client`},{key:`terminalFontSize`,store:`client`},{key:`editorFontSize`,store:`client`},{key:`density`,store:`client`},{key:`reduceMotion`,store:`client`},{key:`terminalScrollback`,store:`client`},{key:`projectBasedLayout`,store:`client`},{key:`showAllProjectSessions`,store:`client`}]},{id:`profile`,label:`Profile`,fields:[{key:`branch_prefix`,store:`profileColumn`},{key:`icon`,store:`profileColumn`},{key:`icon_colour`,store:`profileColumn`}]},{id:`sessions`,label:`Sessions`,fields:[{key:`onboardingTemplate`,store:`profileSettings`},{key:`concurrentTemplate`,store:`profileSettings`},{key:`restartTemplate`,store:`profileSettings`},{key:`tabTitleTemplate`,store:`profileSettings`},{key:`sessionDefaults`,store:`profileSettings`},{key:`allowSkipPermissions`,store:`profileSettings`},{key:`captureSessionEnv`,store:`profileSettings`}]},{id:`editor`,label:`Editor`,fields:[{key:`editorTabSize`,store:`client`},{key:`editorWordWrap`,store:`client`},{key:`editorLinkSshHost`,store:`client`}]},{id:`hotkeys`,label:`Hotkeys`,fields:[{key:`hotkeys`,store:`profileSettings`}]},{id:`notifications`,label:`Notifications`,fields:[{key:`notifications`,store:`profileSettings`,pick:e=>{let{desktop:t,sound:n,when_focused:r}=V(e);return{desktop:t,sound:n,...r===void 0?{}:{when_focused:r}}},mergeInto:(e,t)=>({...V(t),...V(e)})}]},{id:`scratchpad`,label:`Scratchpad (profile-wide entries)`,fields:[{key:`entries`,store:`scratchpad`}]}];function U(e){return e.filter(e=>e.scope===`profile`).map(e=>({title:e.title,body:e.body,tags:e.tags,agent_type:e.agent_type}))}function W(e){return JSON.stringify([e.title??``,e.body,e.tags,e.agent_type??``])}function kt(e,t){if(!Array.isArray(e))return[];let n=new Set(U(t).map(W)),r=new Set,i=[];for(let t of e){let e=V(t);if(typeof e.body!=`string`||e.body.length===0)continue;let a={title:typeof e.title==`string`&&e.title!==``?e.title:null,body:e.body,tags:Array.isArray(e.tags)?e.tags.filter(e=>typeof e==`string`):[],agent_type:typeof e.agent_type==`string`?e.agent_type:null},o=W(a);n.has(o)||r.has(o)||(r.add(o),i.push(a))}return i}function At(e,t){switch(e.store){case`client`:return t.client[e.key];case`theme`:return t.theme;case`profileSettings`:return t.profileSettings[e.key];case`profileColumn`:return t.profile[e.key];case`scratchpad`:return U(t.scratchpad)}}function jt(e,t){let n={};for(let r of H){if(!e.includes(r.id))continue;let i={};for(let e of r.fields){let n=At(e,t);n!==void 0&&(i[e.key]=e.pick?e.pick(n):n)}Object.keys(i).length>0&&(n[r.id]=i)}return n}function Mt(e,t,n,r){if(!e||typeof e!=`object`)return[];let i=e,a={},o={},s={},c=[];for(let e of H){if(r&&!r.includes(e.id))continue;let l=i[e.id];if(!l||typeof l!=`object`)continue;let u=l,d=!1;for(let r of e.fields){if(!(r.key in u))continue;let e=u[r.key];if(r.store===`scratchpad`){let r=kt(e,n.scratchpad);r.length>0&&(t.createScratchpad(r),d=!0);continue}d=!0;let i=r.mergeInto?r.mergeInto(e,r.store===`profileSettings`?n.profileSettings[r.key]:void 0):e;r.store===`client`?a[r.key]=i:r.store===`theme`?t.setTheme(i):r.store===`profileSettings`?o[r.key]=i:s[r.key]=i}d&&c.push(e.label)}return Object.keys(a).length>0&&t.setClient(a),Object.keys(o).length>0&&t.patchProfileSettings(o),Object.keys(s).length>0&&t.patchProfileColumns(s),c}var G={version:1,profiles:{}};function Nt(e,t){return e.profiles[t]??{enabled:!0,groups:H.map(e=>e.id),doc:{},updatedAt:new Date(0).toISOString()}}async function Pt(){try{let e=await fetch(`/cockpit/local-sync`,{headers:m(),cache:`no-store`});return e.ok?{available:!0,file:await e.json()}:{available:!1,file:G}}catch{return{available:!1,file:G}}}function Ft(){return i({queryKey:[`local-sync`],queryFn:Pt,staleTime:5e3,refetchOnWindowFocus:!0,retry:!1})}function It(){let e=a();return o({mutationFn:async e=>{let t=await fetch(`/cockpit/local-sync`,{method:`PUT`,headers:{...m(),"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`The local sync store did not accept the write.`);return await t.json()},onSuccess:t=>e.setQueryData([`local-sync`],{available:!0,file:t})})}function Lt(){return g()?.showNotification?`unverified`:typeof Notification>`u`?`unsupported`:Notification.permission}async function Rt(e,t){let n;try{return await Promise.race([e,new Promise((e,r)=>{n=setTimeout(()=>r(Error(t)),1e4)})])}finally{clearTimeout(n)}}var K;async function zt(){return!(`serviceWorker`in navigator)||!window.isSecureContext?null:(K||=q().catch(e=>{throw K=void 0,e}),K)}async function q(){let e=await Rt(navigator.serviceWorker.register(`/notification-worker.js`),`Notification support did not respond. Reload Puddle and try again.`);if(e.active)return e;let t=e.installing??e.waiting;if(!t)throw Error(`Notification support could not start. Reload and try again.`);return await new Promise((e,n)=>{let r=r=>{clearTimeout(a),t.removeEventListener(`statechange`,i),r?n(r):e()},i=()=>{t.state===`activated`?r():t.state===`redundant`&&r(Error(`Notification support could not start.`))},a=setTimeout(()=>r(Error(`Notification support timed out.`)),1e4);t.addEventListener(`statechange`,i),i()}),e}async function Bt(e,t){if(!e.active)throw Error(`Notification support is not active.`);await new Promise((n,r)=>{let i=new MessageChannel,a=e=>{clearTimeout(o),i.port1.close(),e?r(e):n()},o=setTimeout(()=>a(Error(`Notification delivery timed out.`)),1e4);i.port1.onmessage=e=>a(e.data?.ok?void 0:Error(`The browser could not deliver the notification. Check system permissions.`)),e.active.postMessage({t:`show-notification`,request:t},[i.port2])})}var J={state:`unverified`,message:null},Y=new Set,X=new Map,Z=!1,Vt=!1;function Q(e,t){X.set(e,t),X.size>64&&X.delete(X.keys().next().value)}function $(e){J=e;for(let e of Y)e();return e}function Ht(){return(0,y.useSyncExternalStore)(e=>(Y.add(e),()=>{Y.delete(e)}),()=>J)}async function Ut(){let e=g();if(e?.notificationStatus)try{$(d.parse(await e.notificationStatus()))}catch{$({state:`failed`,message:`Could not read desktop notification delivery status.`})}}async function Wt(e,t,n){try{let r=g();if(r?.showNotification){!Z&&r.onNotificationClick&&(r.onNotificationClick((e,t)=>{t||X.get(e)?.(),X.delete(e)}),Z=!0),Q(e.id,t);let{target:i,...a}=e;return $(d.parse(await r.showNotification({...a,...r.notificationTargets?{target:i}:{},...r.notificationSubtitles&&n?{title:`${n.host} · ${n.project.name}`.slice(0,160),subtitle:e.title}:{}})))}if(typeof Notification>`u`)return $({state:`unsupported`,message:`This browser cannot show notifications.`});if(Notification.permission!==`granted`)return $({state:`failed`,message:`Allow notifications for Puddle in browser settings.`});let i=n?{...e,title:_e(e.title,n.project)}:e,a=await zt();return a?(Vt||=(navigator.serviceWorker.addEventListener(`message`,e=>{e.data?.t!==`notification-click`||typeof e.data.id!=`string`||(e.data.target||X.get(e.data.id)?.(),X.delete(e.data.id))}),!0),Q(e.id,t),await Bt(a,i),$({state:`shown`,message:null})):await new Promise(n=>{let r=new Notification(i.title,{body:e.body,tag:e.id,silent:!0}),a=setTimeout(()=>n($({state:`unverified`,message:`Delivery has not been confirmed. Check system notification settings.`})),5e3);r.onshow=()=>{clearTimeout(a),n($({state:`shown`,message:null}))},r.onerror=()=>{clearTimeout(a),n($({state:`failed`,message:`The browser could not deliver the notification. Check system permissions.`}))},r.onclick=()=>{window.focus(),t(),r.close()}})}catch(e){return $({state:`failed`,message:e instanceof Error?e.message:`Notification delivery failed.`})}}export{gt as C,M as D,N as E,Ve as O,yt as S,P as T,_t as _,Nt as a,xt as b,H as c,B as d,Dt as f,St as g,L as h,Lt as i,Mt as l,Et as m,Ut as n,Ft as o,Ot as p,Ht as r,It as s,Wt as t,jt as u,I as v,ht as w,vt as x,bt as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-By8HlURe.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-By8HlURe.js";import{C as r,E as i,T as a,_ as o,f as s,g as c,h as l,m as u,p as d,v as f,x as p,y as m}from"./dialog-BIriom7c.js";import{o as h,r as g}from"./x-Dq6POV20.js";import{c as _,d as v,f as y,l as b,u as x}from"./chevron-right-nSpC9bNN.js";import{n as S}from"./createLucideIcon-C9A1vLE-.js";var C=e(t(),1),w=n(),T=`Popover`,[E,ee]=a(T,[y]),D=y(),[O,k]=E(T),A=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=D(t),l=C.useRef(null),[u,d]=C.useState(!1),[f,p]=c({prop:r,defaultProp:i??!1,onChange:a,caller:T});return(0,w.jsx)(v,{...s,children:(0,w.jsx)(O,{scope:t,contentId:m(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:C.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>d(!0),[]),onCustomAnchorRemove:C.useCallback(()=>d(!1),[]),modal:o,children:n})})};A.displayName=T;var j=`PopoverAnchor`,M=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=k(j,n),a=D(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return C.useEffect(()=>(o(),()=>s()),[o,s]),(0,w.jsx)(_,{...a,...r,ref:t})});M.displayName=j;var N=`PopoverTrigger`,P=C.forwardRef((e,t)=>{let{__scopePopover:n,...a}=e,o=k(N,n),s=D(n),c=h(t,o.triggerRef),l=(0,w.jsx)(r.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Y(o.open),...a,ref:c,onClick:i(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:(0,w.jsx)(_,{asChild:!0,...s,children:l})});P.displayName=N;var F=`PopoverPortal`,[I,L]=E(F,{forceMount:void 0}),R=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=k(F,t);return(0,w.jsx)(I,{scope:t,forceMount:n,children:(0,w.jsx)(o,{present:n||a.open,children:(0,w.jsx)(f,{asChild:!0,container:i,children:r})})})};R.displayName=F;var z=`PopoverContent`,B=C.forwardRef((e,t)=>{let n=L(z,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=k(z,e.__scopePopover);return(0,w.jsx)(o,{present:r||a.open,children:a.modal?(0,w.jsx)(H,{...i,ref:t}):(0,w.jsx)(U,{...i,ref:t})})});B.displayName=z;var V=g(`PopoverContent.RemoveScroll`),H=C.forwardRef((e,t)=>{let n=k(z,e.__scopePopover),r=C.useRef(null),a=h(t,r),o=C.useRef(!1);return C.useEffect(()=>{let e=r.current;if(e)return s(e)},[]),(0,w.jsx)(d,{as:V,allowPinchZoom:!0,children:(0,w.jsx)(W,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:i(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:i(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:i(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),U=C.forwardRef((e,t)=>{let n=k(z,e.__scopePopover),r=C.useRef(!1),i=C.useRef(!1);return(0,w.jsx)(W,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),W=C.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,...m}=e,h=k(z,n),g=D(n);return u(),(0,w.jsx)(l,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,w.jsx)(p,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,w.jsx)(x,{"data-state":Y(h.open),role:`dialog`,id:h.contentId,...g,...m,ref:t,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),G=`PopoverClose`,K=C.forwardRef((e,t)=>{let{__scopePopover:n,...a}=e,o=k(G,n);return(0,w.jsx)(r.button,{type:`button`,...a,ref:t,onClick:i(e.onClick,()=>o.onOpenChange(!1))})});K.displayName=G;var q=`PopoverArrow`,J=C.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=D(n);return(0,w.jsx)(b,{...i,...r,ref:t})});J.displayName=q;function Y(e){return e?`open`:`closed`}var X=A,Z=P,Q=R,$=B,te=X,ne=Z;function re({className:e,align:t=`end`,sideOffset:n=8,...r}){return(0,w.jsx)(Q,{children:(0,w.jsx)($,{align:t,sideOffset:n,className:S(`overlay-content-motion overlay-popover-motion island-outline z-50 rounded-[var(--ui-surface-radius)] bg-elevated p-5 shadow-2xl`,e),...r})})}export{re as n,ne as r,te as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import"./auth-olLlgxc3.js";import{t as n}from"./jsx-runtime-By8HlURe.js";import{n as r}from"./api-BOuyloUi.js";var i={major:26,minor:1};function a(e,t,n=i){return e?.major===n.major&&(e.major>t.major||e.major===t.major&&e.minor>=t.minor)}var o=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},s=new class extends o{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){return typeof e==`function`?e(t):e}function v(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==b(o,t.options))return!1}else if(!S(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function y(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(a))return!1}else if(!S(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function b(e,t){return(t?.queryKeyHashFn||x)(e)}function x(e){return JSON.stringify(e,(e,t)=>T(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function S(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>S(e[n],t[n])):!1}var ee=Object.prototype.hasOwnProperty;function C(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=te(e)&&te(t);if(!r&&!(T(e)&&T(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=C(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function w(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e){if(!E(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!E(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function E(e){return Object.prototype.toString.call(e)===`[object Object]`}function ne(e){return new Promise(t=>{l.setTimeout(t,e)})}function D(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:C(e,t)}function re(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function ae(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===O?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function k(e,t){return typeof e==`function`?e(...t):!!e}function oe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var A=(()=>{let e=()=>d;return{isServer(){return e()},setIsServer(t){e=t}}})();function j(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var se=u;function ce(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=se,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var M=ce(),N=new class extends o{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function le(e){return Math.min(1e3*2**e,3e4)}function P(e){return(e??`online`)!==`online`||N.isOnline()}var F=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,i=j(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new F(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>s.isFocused()&&(e.networkMode===`always`||N.isOnline())&&e.canRun(),d=()=>P(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(A.isServer()?0:3),o=e.retryDelay??le,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ne(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var L=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(A.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{oe(e,()=>t.signal,()=>n=!0)},u=ae(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ie:re;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?z:R,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:R(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function R(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function z(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function de(e,t){return t?R(e,t)!=null:!1}function fe(e,t){return!t||!e.getPreviousPageParam?!1:z(e,t)!=null}var pe=class extends L{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ge(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ge(this.options);e.data!==void 0&&(this.setState(he(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=D(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>_(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>g(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ae(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof F&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof F){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...me(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...he(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),M.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function me(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function he(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ge(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var _e=class extends o{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=j(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ye(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return B(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return B(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!w(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&V(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return be(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(f)),t}#g(){this.#b();let e=g(this.options.staleTime,this.#t);if(A.isServer()||this.#r.isStale||!m(e))return;let t=h(this.#r.dataUpdatedAt,e)+1;this.#d=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(A.isServer()||_(this.options.enabled,this.#t)===!1||!m(this.#p)||this.#p===0)&&(this.#f=l.setInterval(()=>{(this.options.refetchIntervalInBackground||s.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(l.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(l.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ye(e,t),o=i&&V(e,n,t,r);(a||o)&&(l={...l,...me(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=D(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=D(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:H(e,t),refetch:this.refetch,promise:this.#o,isEnabled:_(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=j();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!w(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){M.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ve(e,t){return _(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&_(t.retryOnMount,e)===!1)}function ye(e,t){return ve(e,t)||e.state.data!==void 0&&B(e,t,t.refetchOnMount)}function B(e,t,n){if(_(t.enabled,e)!==!1&&g(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&H(e,t)}return!1}function V(e,t,n,r){return(e!==t||_(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&H(e,n)}function H(e,t){return _(t.enabled,e)!==!1&&e.isStaleByTime(g(t.staleTime,e))}function be(e,t){return!w(e.getCurrentResult(),t)}var xe=class extends L{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||U(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=I({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),M.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function U(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Se=class extends o{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),w(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&x(t.mutationKey)!==x(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??U();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){M.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},W=e(t(),1),Ce=n(),G=W.createContext(void 0),K=e=>{let t=W.useContext(G);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},we=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Ce.jsx)(G.Provider,{value:e,children:t})),q=W.createContext(!1),Te=()=>W.useContext(q);q.Provider;function Ee(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var De=W.createContext(Ee()),Oe=()=>W.useContext(De),ke=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?k(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ae=e=>{W.useEffect(()=>{e.clearReset()},[e])},je=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||k(n,[e.error,r])),Me=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ne=(e,t)=>e.isLoading&&e.isFetching&&!t,Pe=(e,t)=>e?.suspense&&t.isPending,Fe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ie(e,t,n){let r=Te(),i=Oe(),a=K(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Me(o),ke(o,i,s),Ae(i);let l=!a.getQueryCache().get(o.queryHash),[u]=W.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),p=!r&&c;if(W.useSyncExternalStore(W.useCallback(e=>{let t=p?u.subscribe(M.batchCalls(e)):f;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),W.useEffect(()=>{u.setOptions(o)},[o,u]),Pe(o,d))throw Fe(o,u,i);if(je({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!A.isServer()&&Ne(d,r)&&(l?Fe(o,u,i):s?.promise)?.catch(f).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function J(e,t){return Ie(e,_e,t)}function Y(e,t){let n=K(t),[r]=W.useState(()=>new Se(n,e));W.useEffect(()=>{r.setOptions(e)},[r,e]);let i=W.useSyncExternalStore(W.useCallback(e=>r.subscribe(M.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=W.useCallback((e,t)=>{r.mutate(e,t).catch(f)},[r]);if(i.error&&k(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Le=12,X=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{X=!0}),window.addEventListener(`blur`,()=>{X=!1}),s.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function Z(e){return()=>X?e:e*Le}function Re(){return J({queryKey:[`profiles`],queryFn:()=>r(`GET`,`/api/profiles`)})}function ze(e){return J({queryKey:[`profile-settings`,e],queryFn:()=>r(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function Be(e){return J({queryKey:[`accounts`,e],queryFn:()=>r(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function Ve(e){return J({queryKey:[`account-usage`,e],queryFn:()=>r(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function He(){return J({queryKey:[`repos`],queryFn:()=>r(`GET`,`/api/repos`)})}function Ue(e,t=!0){return J({queryKey:[`projects`,e??`all`],queryFn:()=>r(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function We(e){return J({queryKey:[`project`,e],queryFn:()=>r(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function Ge(e){return r(`POST`,`/api/projects/${e}/conversations/refresh`)}function Ke(e){return J({queryKey:[`sessions`,e],queryFn:()=>r(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var qe={queryKey:[`sessions`,`all`],queryFn:()=>r(`GET`,`/api/sessions`)};function Je(e=!0){return J({...qe,enabled:e})}function Ye(e){return e.fetchQuery(qe)}function Xe(){return J({queryKey:[`config`],queryFn:()=>r(`GET`,`/api/config`)})}function Ze(e){return J({queryKey:[`repo-branches`,e],queryFn:()=>r(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function Qe(e,t=1e4){return J({queryKey:[`repo-worktrees`,e],queryFn:()=>r(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:t})}function $e(e,t){let n=K();return Y({mutationFn:t=>r(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function et(e,t){let n=K();return Y({mutationFn:({name:t,confirm:n})=>{let i=new URLSearchParams({name:t});return n&&i.set(`confirm`,`1`),r(`DELETE`,`/api/repos/${e}/branches?${i.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function tt(e){return J({queryKey:[`fs-dirs`,e],queryFn:()=>r(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function nt(){return J({queryKey:[`version`],queryFn:()=>r(`GET`,`/api/version`),staleTime:1/0})}function rt(){return J({queryKey:[`host`],queryFn:()=>r(`GET`,`/api/host`),staleTime:1/0})}function it(e){return e?e.displayName||e.hostname:void 0}function at(){return J({queryKey:[`agents`],queryFn:()=>r(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function ot(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function st(e){let t=K();return Y({mutationFn:t=>r(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function ct(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function lt(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function ut(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function dt(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function ft(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function pt(){return Y({mutationFn:e=>r(`POST`,`/api/accounts/${e}/login`)})}function mt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function ht(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function gt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function _t(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function vt(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/projects/${e}`,t),onSuccess:t=>{e.setQueryData([`project`,t.id],e=>e&&{...e,project:t}),e.invalidateQueries({queryKey:[`projects`]})}})}function yt(e,t){return J({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>r(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function bt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function xt(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function St(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Ct(e,t){return J({queryKey:[`layouts`,e,t??`none`],queryFn:()=>r(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function wt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Tt(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Et(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Q(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function Dt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/sessions`,e),onSuccess:t=>Q(e,t)})}function Ot(e){let t=K();return Y({mutationFn:t=>r(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>Q(t,e)})}function kt(){let e=K();return Y({mutationFn:({sessionId:e,accountId:t})=>r(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>Q(e,t)})}function At(){let e=K();return Y({mutationFn:({sessionId:e,accountId:t})=>r(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{Q(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function jt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>Q(e,t)})}function Mt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>Q(e,t)})}function Nt(){let e=K();return Y({mutationFn:({sessionId:e,title:t})=>r(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>Q(e,t)})}function Pt(){let e=K();return Y({mutationFn:e=>r(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function Ft(e){try{return await r(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function It(e,t){return r(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function Lt(e,t){return J({queryKey:[`ports`,e],queryFn:()=>r(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:Z(5e3),refetchIntervalInBackground:!1})}function Rt(e,t){return J({queryKey:[`session-env`,e],queryFn:()=>r(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:Z(5e3),refetchIntervalInBackground:!1})}function zt(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var Bt=e=>a(e,{major:25,minor:15});function $(e,t,n){return!e||e.major>t||e.major===t&&e.minor>=n}var Vt=e=>e!==void 0&&$(e,21,3),Ht=e=>e!==void 0&&$(e,24,5);function Ut(e){return $(e,17,1)}function Wt(e){return $(e,17,3)}var Gt=e=>e!==void 0&&$(e,24,4),Kt=e=>$(e,10,3),qt=e=>$(e,12,3),Jt=e=>$(e,12,4),Yt=e=>$(e,15,3),Xt=e=>e!==void 0&&$(e,16,3),Zt=e=>$(e,16,4),Qt=e=>$(e,14,1),$t=e=>e!==void 0&&$(e,24,6),en=e=>e!==void 0&&$(e,25,1),tn=e=>e!==void 0&&$(e,25,2),nn=e=>e!==void 0&&$(e,25,3),rn=e=>e!==void 0&&$(e,25,4);export{Tt as $,Xe as A,fe as At,et as B,C as Bt,Ge as C,Ie as Ct,Je as D,_e as Dt,at as E,xe as Et,mt as F,b as Ft,gt as G,ut as H,O as Ht,bt as I,y as It,Ct as J,At as K,Dt as L,v as Lt,wt as M,M as Mt,ot as N,p as Nt,jt as O,pe as Ot,_t as P,x as Pt,Pt as Q,nt as R,f as Rt,It as S,J as St,Be as T,K as Tt,St as U,s as Ut,Et as V,g as Vt,tt as W,o as Wt,kt as X,pt as Y,lt as Z,Yt as _,Lt as _t,Xt as a,ze as at,Ft as b,Z as bt,Vt as c,Ue as ct,tn as d,Ze as dt,ct as et,nn as f,Qe as ft,Bt as g,Rt as gt,Ht as h,Ot as ht,Ut as i,xt as it,ft as j,N as jt,zt as k,de as kt,Zt as l,$e as lt,rn as m,yt as mt,Gt as n,vt as nt,Qt as o,Re as ot,$t as p,He as pt,rt as q,Wt as r,ht as rt,Jt as s,We as st,qt as t,st as tt,en as u,Nt as ut,Kt as v,Ke as vt,Ve as w,we as wt,it as x,Y as xt,Ye as y,Mt as yt,dt as z,S as zt};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import"./auth-olLlgxc3.js";import{t as n}from"./jsx-runtime-By8HlURe.js";import{n as r}from"./api-BOuyloUi.js";var i={major:26,minor:1};function a(e,t,n=i){return e?.major===n.major&&(e.major>t.major||e.major===t.major&&e.minor>=t.minor)}var o=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},s=new class extends o{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){return typeof e==`function`?e(t):e}function v(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==b(o,t.options))return!1}else if(!S(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function y(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(a))return!1}else if(!S(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function b(e,t){return(t?.queryKeyHashFn||x)(e)}function x(e){return JSON.stringify(e,(e,t)=>T(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function S(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>S(e[n],t[n])):!1}var ee=Object.prototype.hasOwnProperty;function C(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=te(e)&&te(t);if(!r&&!(T(e)&&T(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=C(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function w(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e){if(!E(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!E(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function E(e){return Object.prototype.toString.call(e)===`[object Object]`}function ne(e){return new Promise(t=>{l.setTimeout(t,e)})}function D(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:C(e,t)}function re(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function ae(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===O?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function k(e,t){return typeof e==`function`?e(...t):!!e}function oe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var A=(()=>{let e=()=>d;return{isServer(){return e()},setIsServer(t){e=t}}})();function j(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var se=u;function ce(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=se,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var M=ce(),N=new class extends o{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function le(e){return Math.min(1e3*2**e,3e4)}function P(e){return(e??`online`)!==`online`||N.isOnline()}var F=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,i=j(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new F(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>s.isFocused()&&(e.networkMode===`always`||N.isOnline())&&e.canRun(),d=()=>P(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(A.isServer()?0:3),o=e.retryDelay??le,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ne(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var L=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(A.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{oe(e,()=>t.signal,()=>n=!0)},u=ae(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ie:re;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?z:R,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:R(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function R(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function z(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function de(e,t){return t?R(e,t)!=null:!1}function fe(e,t){return!t||!e.getPreviousPageParam?!1:z(e,t)!=null}var pe=class extends L{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ge(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ge(this.options);e.data!==void 0&&(this.setState(he(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=D(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>_(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>g(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ae(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof F&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof F){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...me(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...he(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),M.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function me(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function he(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ge(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var _e=class extends o{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=j(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ye(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return B(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return B(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!w(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&V(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return be(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(f)),t}#g(){this.#b();let e=g(this.options.staleTime,this.#t);if(A.isServer()||this.#r.isStale||!m(e))return;let t=h(this.#r.dataUpdatedAt,e)+1;this.#d=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(A.isServer()||_(this.options.enabled,this.#t)===!1||!m(this.#p)||this.#p===0)&&(this.#f=l.setInterval(()=>{(this.options.refetchIntervalInBackground||s.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(l.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(l.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ye(e,t),o=i&&V(e,n,t,r);(a||o)&&(l={...l,...me(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=D(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=D(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:H(e,t),refetch:this.refetch,promise:this.#o,isEnabled:_(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{let e=this.#o=S.promise=j();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!w(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){M.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ve(e,t){return _(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&_(t.retryOnMount,e)===!1)}function ye(e,t){return ve(e,t)||e.state.data!==void 0&&B(e,t,t.refetchOnMount)}function B(e,t,n){if(_(t.enabled,e)!==!1&&g(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&H(e,t)}return!1}function V(e,t,n,r){return(e!==t||_(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&H(e,n)}function H(e,t){return _(t.enabled,e)!==!1&&e.isStaleByTime(g(t.staleTime,e))}function be(e,t){return!w(e.getCurrentResult(),t)}var xe=class extends L{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||U(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=I({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),M.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function U(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Se=class extends o{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),w(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&x(t.mutationKey)!==x(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??U();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){M.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},W=e(t(),1),Ce=n(),G=W.createContext(void 0),K=e=>{let t=W.useContext(G);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},we=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Ce.jsx)(G.Provider,{value:e,children:t})),q=W.createContext(!1),Te=()=>W.useContext(q);q.Provider;function Ee(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var De=W.createContext(Ee()),Oe=()=>W.useContext(De),ke=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?k(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ae=e=>{W.useEffect(()=>{e.clearReset()},[e])},je=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||k(n,[e.error,r])),Me=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ne=(e,t)=>e.isLoading&&e.isFetching&&!t,Pe=(e,t)=>e?.suspense&&t.isPending,Fe=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ie(e,t,n){let r=Te(),i=Oe(),a=K(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Me(o),ke(o,i,s),Ae(i);let l=!a.getQueryCache().get(o.queryHash),[u]=W.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),p=!r&&c;if(W.useSyncExternalStore(W.useCallback(e=>{let t=p?u.subscribe(M.batchCalls(e)):f;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),W.useEffect(()=>{u.setOptions(o)},[o,u]),Pe(o,d))throw Fe(o,u,i);if(je({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!A.isServer()&&Ne(d,r)&&(l?Fe(o,u,i):s?.promise)?.catch(f).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function J(e,t){return Ie(e,_e,t)}function Y(e,t){let n=K(t),[r]=W.useState(()=>new Se(n,e));W.useEffect(()=>{r.setOptions(e)},[r,e]);let i=W.useSyncExternalStore(W.useCallback(e=>r.subscribe(M.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=W.useCallback((e,t)=>{r.mutate(e,t).catch(f)},[r]);if(i.error&&k(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Le=12,X=typeof document<`u`?document.hasFocus():!0;typeof window<`u`&&(window.addEventListener(`focus`,()=>{X=!0}),window.addEventListener(`blur`,()=>{X=!1}),s.setEventListener(e=>{let t=()=>e(void 0);return window.addEventListener(`visibilitychange`,t,!1),window.addEventListener(`focus`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}}));function Z(e){return()=>X?e:e*Le}function Re(){return J({queryKey:[`profiles`],queryFn:()=>r(`GET`,`/api/profiles`)})}function ze(e){return J({queryKey:[`profile-settings`,e],queryFn:()=>r(`GET`,`/api/profiles/${e}/settings`),enabled:e!==void 0})}function Be(e){return J({queryKey:[`accounts`,e],queryFn:()=>r(`GET`,`/api/accounts?profile=${e}`),enabled:e!==void 0})}function Ve(e){return J({queryKey:[`account-usage`,e],queryFn:()=>r(`GET`,`/api/accounts/${e}/usage`),enabled:e!==void 0,staleTime:15e3})}function He(){return J({queryKey:[`repos`],queryFn:()=>r(`GET`,`/api/repos`)})}function Ue(e,t=!0){return J({queryKey:[`projects`,e??`all`],queryFn:()=>r(`GET`,e===void 0?`/api/projects`:`/api/projects?profile=${e}`),enabled:t})}function We(e){return J({queryKey:[`project`,e],queryFn:()=>r(`GET`,`/api/projects/${e}`),enabled:e!==void 0,placeholderData:e=>e})}function Ge(e){return r(`POST`,`/api/projects/${e}/conversations/refresh`)}function Ke(e){return J({queryKey:[`sessions`,e],queryFn:()=>r(`GET`,`/api/sessions?project=${e}`),enabled:e!==void 0})}var qe={queryKey:[`sessions`,`all`],queryFn:()=>r(`GET`,`/api/sessions`)};function Je(e=!0){return J({...qe,enabled:e})}function Ye(e){return e.fetchQuery({...qe,staleTime:0})}function Xe(){return J({queryKey:[`config`],queryFn:()=>r(`GET`,`/api/config`)})}function Ze(e){return J({queryKey:[`repo-branches`,e],queryFn:()=>r(`GET`,`/api/repos/${e}/branches`),enabled:e!==void 0,staleTime:3e4})}function Qe(e,t=1e4){return J({queryKey:[`repo-worktrees`,e],queryFn:()=>r(`GET`,`/api/repos/${e}/worktrees`),enabled:e!==void 0,staleTime:t})}function $e(e,t){let n=K();return Y({mutationFn:t=>r(`DELETE`,`/api/repos/${e}/worktrees?path=${encodeURIComponent(t)}`),onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function et(e,t){let n=K();return Y({mutationFn:({name:t,confirm:n})=>{let i=new URLSearchParams({name:t});return n&&i.set(`confirm`,`1`),r(`DELETE`,`/api/repos/${e}/branches?${i.toString()}`)},onSuccess:r=>{n.setQueryData([`repo-worktrees`,e],r),n.invalidateQueries({queryKey:[`project`,t]})}})}function tt(e){return J({queryKey:[`fs-dirs`,e],queryFn:()=>r(`GET`,`/api/fs/dirs?prefix=${encodeURIComponent(e)}`),enabled:e.startsWith(`/`)||e.startsWith(`~`),placeholderData:e=>e,staleTime:1e4})}function nt(){return J({queryKey:[`version`],queryFn:()=>r(`GET`,`/api/version`),staleTime:1/0})}function rt(){return J({queryKey:[`host`],queryFn:()=>r(`GET`,`/api/host`),staleTime:1/0})}function it(e){return e?e.displayName||e.hostname:void 0}function at(){return J({queryKey:[`agents`],queryFn:()=>r(`GET`,`/api/agents`),staleTime:3e4,refetchOnWindowFocus:!0})}function ot(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/profiles`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function st(e){let t=K();return Y({mutationFn:t=>r(`PATCH`,`/api/profiles/${e}/settings`,t),onSuccess:n=>t.setQueryData([`profile-settings`,e],n)})}function ct(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/profiles/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`profiles`]})})}function lt(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/accounts/${e}`,t),onSuccess:t=>{e.invalidateQueries({queryKey:[`accounts`,t.profile_id]}),e.invalidateQueries({queryKey:[`account-usage`,t.id]})}})}function ut(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/profiles/${e}`),onSuccess:()=>e.clear()})}function dt(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/accounts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`accounts`]})})}function ft(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/accounts`,e),onSuccess:t=>void e.invalidateQueries({queryKey:[`accounts`,t.profile_id]})})}function pt(){return Y({mutationFn:e=>r(`POST`,`/api/accounts/${e}/login`)})}function mt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/repos`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function ht(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/repos/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function gt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/repos/${e}/fetch`),onSuccess:()=>void e.invalidateQueries({queryKey:[`repos`]})})}function _t(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/projects`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`projects`]})})}function vt(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/projects/${e}`,t),onSuccess:t=>{e.setQueryData([`project`,t.id],e=>e&&{...e,project:t}),e.invalidateQueries({queryKey:[`projects`]})}})}function yt(e,t){return J({queryKey:[`scratchpad`,e,t??`none`],queryFn:()=>r(`GET`,`/api/scratchpad?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function bt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/scratchpad`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function xt(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/scratchpad/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function St(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/scratchpad/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`scratchpad`]})})}function Ct(e,t){return J({queryKey:[`layouts`,e,t??`none`],queryFn:()=>r(`GET`,`/api/layouts?profile=${e}${t?`&project=${t}`:``}`),enabled:e!==void 0})}function wt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/layouts`,e),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Tt(){let e=K();return Y({mutationFn:({id:e,...t})=>r(`PATCH`,`/api/layouts/${e}`,t),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Et(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/layouts/${e}`),onSuccess:()=>void e.invalidateQueries({queryKey:[`layouts`]})})}function Q(e,t){e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`project`,t.project_id]})}function Dt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/sessions`,e),onSuccess:t=>Q(e,t)})}function Ot(e){let t=K();return Y({mutationFn:t=>r(`POST`,`/api/sessions/${t}/${e}`),onSuccess:e=>Q(t,e)})}function kt(){let e=K();return Y({mutationFn:({sessionId:e,accountId:t})=>r(`POST`,`/api/sessions/${e}/migrate`,{account_id:t}),onSuccess:t=>Q(e,t)})}function At(){let e=K();return Y({mutationFn:({sessionId:e,accountId:t})=>r(`POST`,`/api/sessions/${e}/handoff`,{account_id:t}),onSuccess:(t,{sessionId:n})=>{Q(e,t),e.invalidateQueries({queryKey:[`session`,n]})}})}function jt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/sessions/${e}/archive`),onSuccess:t=>Q(e,t)})}function Mt(){let e=K();return Y({mutationFn:e=>r(`POST`,`/api/sessions/${e}/unarchive`),onSuccess:t=>Q(e,t)})}function Nt(){let e=K();return Y({mutationFn:({sessionId:e,title:t})=>r(`PATCH`,`/api/sessions/${e}`,{title:t}),onSuccess:t=>Q(e,t)})}function Pt(){let e=K();return Y({mutationFn:e=>r(`PATCH`,`/api/config`,e),onSuccess:(t,n)=>{e.setQueryData([`config`],t),`displayName`in n&&e.invalidateQueries({queryKey:[`host`]})}})}async function Ft(e){try{return await r(`GET`,`/api/profiles/${e}/state`)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`no_state`)return null;throw e}}function It(e,t){return r(`PUT`,`/api/profiles/${e}/state`,{ui_state:t})}function Lt(e,t){return J({queryKey:[`ports`,e],queryFn:()=>r(`GET`,`/api/sessions/${e}/ports`),enabled:e!==void 0&&t,refetchInterval:Z(5e3),refetchIntervalInBackground:!1})}function Rt(e,t){return J({queryKey:[`session-env`,e],queryFn:()=>r(`GET`,`/api/sessions/${e}/env`),enabled:e!==void 0&&t,refetchInterval:Z(5e3),refetchIntervalInBackground:!1})}function zt(){let e=K();return Y({mutationFn:e=>r(`DELETE`,`/api/sessions/${e}/env`),onSuccess:(t,n)=>{e.setQueryData([`session-env`,n],{vars:[]})}})}var Bt=e=>a(e,{major:25,minor:15});function $(e,t,n){return!e||e.major>t||e.major===t&&e.minor>=n}var Vt=e=>e!==void 0&&$(e,21,3),Ht=e=>e!==void 0&&$(e,24,5);function Ut(e){return $(e,17,1)}function Wt(e){return $(e,17,3)}var Gt=e=>e!==void 0&&$(e,24,4),Kt=e=>$(e,10,3),qt=e=>$(e,12,3),Jt=e=>$(e,12,4),Yt=e=>$(e,15,3),Xt=e=>e!==void 0&&$(e,16,3),Zt=e=>$(e,16,4),Qt=e=>$(e,14,1),$t=e=>e!==void 0&&$(e,24,6),en=e=>e!==void 0&&$(e,25,1),tn=e=>e!==void 0&&$(e,25,2),nn=e=>e!==void 0&&$(e,25,3),rn=e=>e!==void 0&&$(e,25,4);export{Tt as $,Xe as A,fe as At,et as B,C as Bt,Ge as C,Ie as Ct,Je as D,_e as Dt,at as E,xe as Et,mt as F,b as Ft,gt as G,ut as H,O as Ht,bt as I,y as It,Ct as J,At as K,Dt as L,v as Lt,wt as M,M as Mt,ot as N,p as Nt,jt as O,pe as Ot,_t as P,x as Pt,Pt as Q,nt as R,f as Rt,It as S,J as St,Be as T,K as Tt,St as U,s as Ut,Et as V,g as Vt,tt as W,o as Wt,kt as X,pt as Y,lt as Z,Yt as _,Lt as _t,Xt as a,ze as at,Ft as b,Z as bt,Vt as c,Ue as ct,tn as d,Ze as dt,ct as et,nn as f,Qe as ft,Bt as g,Rt as gt,Ht as h,Ot as ht,Ut as i,xt as it,ft as j,N as jt,zt as k,de as kt,Zt as l,$e as lt,rn as m,yt as mt,Gt as n,vt as nt,Qt as o,Re as ot,$t as p,He as pt,rt as q,Wt as r,ht as rt,Jt as s,We as st,qt as t,st as tt,en as u,Nt as ut,Kt as v,Ke as vt,Ve as w,we as wt,it as x,Y as xt,Ye as y,Mt as yt,dt as z,S as zt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./react-dom-cJyBB_A4.js";import{t as r}from"./jsx-runtime-By8HlURe.js";import{C as i,E as a,S as o,T as s,_ as c,b as l,f as u,g as d,h as f,m as p,p as m,v as h,x as g,y as _}from"./dialog-BIriom7c.js";import{o as v,r as y}from"./x-Dq6POV20.js";import{c as b,d as x,f as S,i as C,l as w,o as T,s as E,u as D}from"./chevron-right-nSpC9bNN.js";import{a as O,t as k}from"./dist-DsLo0ckR.js";import{n as A,t as j}from"./createLucideIcon-C9A1vLE-.js";import{t as ee}from"./chevron-down-HQLVE6o5.js";import{n as te,t as ne}from"./dist-gLwIpKj2.js";var M=j(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),N=e(t(),1),P=e(n(),1);function F(e,[t,n]){return Math.min(n,Math.max(t,e))}var I=r(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=te(z),[U,re]=s(z,[H,S]),W=S(),[ie,G]=U(z),[ae,K]=U(z),oe=`SelectProvider`;function se(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:p,required:m,form:h,internal_do_not_use_render:g}=e,v=W(t),[y,b]=N.useState(null),[S,C]=N.useState(null),[w,T]=N.useState(!1),E=ne(l),[D,O]=d({prop:r,defaultProp:i??!1,onChange:a,caller:z}),[k,A]=d({prop:o,defaultProp:s,onChange:c,caller:z}),j=N.useRef(null),ee=N.useRef(k);N.useEffect(()=>{let e=h?y?.ownerDocument.getElementById(h):y?.form;if(e instanceof HTMLFormElement){let t=()=>A(ee.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,y,A]);let te=!y||!!h||!!y.closest(`form`),[M,P]=N.useState(new Set),F=_(),L=Array.from(M).map(e=>e.props.value).join(`;`),R=N.useCallback(e=>{P(t=>new Set(t).add(e))},[]),V=N.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),H={required:m,trigger:y,onTriggerChange:b,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:F,value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:p,name:u,autoComplete:f,form:h,nativeOptions:M,nativeSelectKey:L,isFormControl:te};return(0,I.jsx)(x,{...v,children:(0,I.jsx)(ie,{scope:t,...H,children:(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(ae,{scope:t,onNativeOptionAdd:R,onNativeOptionRemove:V,children:tt(g)?g(H):n})})})})}se.displayName=oe;var ce=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,I.jsx)(se,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[n,e?(0,I.jsx)(et,{__scopeSelect:t}):null]})})};ce.displayName=z;var le=`SelectTrigger`,ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...o}=e,s=W(n),c=G(le,n),l=c.disabled||r,u=v(t,c.onTriggerChange),d=V(n),f=N.useRef(`touch`),[p,m,h]=nt(e=>{let t=d().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.value===c.value));n!==void 0&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),h()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(b,{asChild:!0,...s,children:(0,I.jsx)(i.button,{type:`button`,role:`combobox`,"aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":`none`,dir:c.dir,"data-state":c.open?`open`:`closed`,disabled:l,"data-disabled":l?``:void 0,"data-placeholder":$(c.value)?``:void 0,...o,ref:u,onClick:a(o.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:a(o.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:a(o.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(g(),e.preventDefault())})})})});ue.displayName=le;var de=`SelectValue`,fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,children:o,placeholder:s=``,...c}=e,u=G(de,n),{onValueNodeHasChildrenChange:d}=u,f=o!==void 0,p=v(t,u.onValueNodeChange);l(()=>{d(f)},[d,f]);let m=$(u.value);return(0,I.jsx)(i.span,{...c,asChild:!m&&c.asChild,ref:p,style:{pointerEvents:`none`},children:(0,I.jsx)(N.Fragment,{children:m?s:o},m?`placeholder`:`value`)})});fe.displayName=de;var pe=`SelectIcon`,me=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...a}=e;return(0,I.jsx)(i.span,{"aria-hidden":!0,...a,ref:t,children:r||`▼`})});me.displayName=pe;var he=`SelectPortal`,[ge,_e]=U(he,{forceMount:void 0}),ve=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,I.jsx)(ge,{scope:e.__scopeSelect,forceMount:n,children:(0,I.jsx)(h,{asChild:!0,...r})})};ve.displayName=he;var q=`SelectContent`,ye=N.forwardRef((e,t)=>{let n=_e(q,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=G(q,e.__scopeSelect),[o,s]=N.useState();return l(()=>{s(new DocumentFragment)},[]),(0,I.jsx)(c,{present:r||a.open,children:({present:e})=>e?(0,I.jsx)(we,{...i,ref:t}):(0,I.jsx)(be,{...i,fragment:o})})});ye.displayName=q;var be=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?P.createPortal((0,I.jsx)(xe,{scope:n,children:(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(`div`,{ref:t,children:r})})}),i):null});be.displayName=`SelectContentFragment`;var J=10,[xe,Y]=U(q),Se=`SelectContentImpl`,Ce=y(`SelectContent.RemoveScroll`),we=N.forwardRef((e,t)=>{let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:l,align:d,alignOffset:h,arrowPadding:_,collisionBoundary:y,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=G(q,n),[E,D]=N.useState(null),[O,k]=N.useState(null),A=v(t,D),[j,ee]=N.useState(null),[te,ne]=N.useState(null),M=V(n),[P,F]=N.useState(!1),L=N.useRef(!1);N.useEffect(()=>{if(E)return u(E)},[E]),p();let R=N.useCallback(e=>{let[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[M,O]),z=N.useCallback(()=>R([j,E]),[R,j,E]);N.useEffect(()=>{P&&z()},[P,z]);let{onOpenChange:B,triggerPointerDownPosRef:H}=T;N.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(H.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||B(!1),document.removeEventListener(`pointermove`,t),H.current=null};return H.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,B,H]),N.useEffect(()=>{let e=()=>B(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[B]);let[U,re]=nt(e=>{let t=M().filter(e=>!e.disabled),n=rt(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),W=N.useCallback((e,t,n)=>{let r=!L.current&&!n;(T.value!==void 0&&T.value===t||r)&&(ee(e),r&&(L.current=!0))},[T.value]),ie=N.useCallback(()=>E?.focus(),[E]),ae=N.useCallback((e,t,n)=>{let r=!L.current&&!n;(T.value!==void 0&&T.value===t||r)&&ne(e)},[T.value]),K=r===`popper`?X:Ee,oe=K===X?{side:c,sideOffset:l,align:d,alignOffset:h,arrowPadding:_,collisionBoundary:y,collisionPadding:b,sticky:x,hideWhenDetached:S,avoidCollisions:C}:{};return(0,I.jsx)(xe,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:W,selectedItem:j,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:z,selectedItemText:te,position:r,isPositioned:P,searchRef:U,children:(0,I.jsx)(m,{as:Ce,allowPinchZoom:!0,children:(0,I.jsx)(f,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:a(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(g,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(K,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...oe,onPlaced:()=>F(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:a(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>R(t)),e.preventDefault()}})})})})})})});we.displayName=Se;var Te=`SelectItemAlignedPosition`,Ee=N.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...a}=e,o=G(q,n),s=Y(q,n),[c,u]=N.useState(null),[d,f]=N.useState(null),p=v(t,f),m=V(n),h=N.useRef(!1),g=N.useRef(!0),{viewport:_,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=N.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&d&&_&&y&&b){let e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-J,d=F(a,[J,Math.max(J,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-J,d=F(a,[J,Math.max(J,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=m(),s=window.innerHeight-J*2,l=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),v=parseInt(u.paddingBottom,10),x=f+p+l+v+g,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-J,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}c.style.margin=`${J}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,o.trigger,o.valueNode,c,d,_,y,b,o.dir,r]);l(()=>S(),[S]);let[C,w]=N.useState();return l(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]),(0,I.jsx)(Oe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N.useCallback(e=>{e&&g.current===!0&&(S(),x?.(),g.current=!1)},[S,x]),children:(0,I.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,I.jsx)(i.div,{...a,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});Ee.displayName=Te;var De=`SelectPopperPosition`,X=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=J,...a}=e,o=W(n);return(0,I.jsx)(D,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});X.displayName=De;var[Oe,ke]=U(q,{}),Ae=`SelectViewport`,je=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...o}=e,s=Y(Ae,n),c=ke(Ae,n),l=v(t,s.onViewportChange),u=N.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(i.div,{"data-radix-select-viewport":``,role:`presentation`,...o,ref:l,style:{position:`relative`,flex:1,overflow:`hidden auto`,...o.style},onScroll:a(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-J*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});je.displayName=Ae;var Me=`SelectGroup`,[Ne,Pe]=U(Me),Fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,a=_();return(0,I.jsx)(Ne,{scope:n,id:a,children:(0,I.jsx)(i.div,{role:`group`,"aria-labelledby":a,...r,ref:t})})});Fe.displayName=Me;var Ie=`SelectLabel`,Le=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,a=Pe(Ie,n);return(0,I.jsx)(i.div,{id:a.id,...r,ref:t})});Le.displayName=Ie;var Z=`SelectItem`,[Re,ze]=U(Z),Be=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:s=!1,textValue:c,...l}=e,u=G(Z,n),d=Y(Z,n),f=u.value===r,[p,m]=N.useState(c??``),[h,g]=N.useState(!1),y=v(t,o(e=>d.itemRefCallback?.(e,r,s))),b=_(),x=N.useRef(`touch`),S=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};return(0,I.jsx)(Re,{scope:n,value:r,disabled:s,textId:b,isSelected:f,onItemTextChange:N.useCallback(e=>{m(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:s,textValue:p,children:(0,I.jsx)(i.div,{role:`option`,"aria-labelledby":b,"data-highlighted":h?``:void 0,"aria-selected":f&&h,"data-state":f?`checked`:`unchecked`,"aria-disabled":s||void 0,"data-disabled":s?``:void 0,tabIndex:s?void 0:-1,...l,ref:y,onFocus:a(l.onFocus,()=>g(!0)),onBlur:a(l.onBlur,()=>g(!1)),onClick:a(l.onClick,()=>{x.current!==`mouse`&&S()}),onPointerUp:a(l.onPointerUp,()=>{x.current===`mouse`&&S()}),onPointerDown:a(l.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:a(l.onPointerMove,e=>{x.current=e.pointerType,s?d.onItemLeave?.():x.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:a(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:a(l.onKeyDown,e=>{s||e.target!==e.currentTarget||d.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&S(),e.key===` `&&e.preventDefault())})})})})});Be.displayName=Z;var Q=`SelectItemText`,Ve=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:a,...s}=e,c=G(Q,n),u=Y(Q,n),d=ze(Q,n),f=K(Q,n),[p,m]=N.useState(null),h=o(e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=v(t,m,d.onItemTextChange,h),_=p?.textContent,y=N.useMemo(()=>(0,I.jsx)(`option`,{value:d.value,disabled:d.disabled,children:_},d.value),[d.disabled,d.value,_]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=f;return l(()=>(b(y),()=>x(y)),[b,x,y]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(i.span,{id:d.textId,...s,ref:g}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!$(c.value)?P.createPortal(s.children,c.valueNode):null]})});Ve.displayName=Q;var He=`SelectItemIndicator`,Ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ze(He,n).isSelected?(0,I.jsx)(i.span,{"aria-hidden":!0,...r,ref:t}):null});Ue.displayName=He;var We=`SelectScrollUpButton`,Ge=N.forwardRef((e,t)=>{let n=Y(We,e.__scopeSelect),r=ke(We,e.__scopeSelect),[i,a]=N.useState(!1),o=v(t,r.onScrollButtonChange);return l(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Je,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ge.displayName=We;var Ke=`SelectScrollDownButton`,qe=N.forwardRef((e,t)=>{let n=Y(Ke,e.__scopeSelect),r=ke(Ke,e.__scopeSelect),[i,a]=N.useState(!1),o=v(t,r.onScrollButtonChange);return l(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Je,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});qe.displayName=Ke;var Je=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Y(`SelectScrollButton`,n),c=N.useRef(null),u=V(n),d=N.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return N.useEffect(()=>()=>d(),[d]),l(()=>{u().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[u]),(0,I.jsx)(i.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:a(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:a(o.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:a(o.onPointerLeave,()=>{d()})})}),Ye=`SelectSeparator`,Xe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(i.div,{"aria-hidden":!0,...r,ref:t})});Xe.displayName=Ye;var Ze=`SelectArrow`,Qe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=W(n);return Y(Ze,n).position===`popper`?(0,I.jsx)(w,{...i,...r,ref:t}):null});Qe.displayName=Ze;var $e=`SelectBubbleInput`,et=N.forwardRef(({__scopeSelect:e,...t},n)=>{let r=G($e,e),{value:a,onValueChange:o,required:s,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=N.useRef(null),h=v(n,m),g=a??``,_=k(g),y=Array.from(f).some(e=>(e.props.value??``)===``);return N.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,I.jsxs)(i.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...t,style:{...O,...t.style},ref:h,defaultValue:g,children:[$(a)&&!y?(0,I.jsx)(`option`,{value:``}):null,Array.from(f)]},p)});et.displayName=$e;function tt(e){return typeof e==`function`}function $(e){return e===``||e===void 0}function nt(e){let t=o(e),n=N.useRef(``),r=N.useRef(0),i=N.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function rt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=it(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function it(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var at=ce,ot=fe;function st({className:e,children:t,...n}){return(0,I.jsxs)(ue,{className:A(`flex h-8 w-full cursor-pointer items-center justify-between gap-2 px-2.5 [&>span]:truncate`,C,e),...n,children:[t,(0,I.jsx)(me,{asChild:!0,children:(0,I.jsx)(ee,{className:`size-3.5 shrink-0 text-fg-muted`})})]})}function ct({className:e,children:t,position:n=`popper`,...r}){return(0,I.jsx)(ve,{children:(0,I.jsx)(ye,{position:n,sideOffset:4,className:A(`z-50 max-h-72 min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)] overflow-y-auto rounded-md bg-elevated p-1 shadow-xl`,e),...r,children:(0,I.jsx)(je,{children:t})})})}function lt({className:e,children:t,detail:n,...r}){return(0,I.jsxs)(Be,{className:A(E,T,`py-1.5 pl-7 pr-2`,e),...r,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(Ue,{children:(0,I.jsx)(M,{className:`size-3.5`})})}),(0,I.jsx)(Ve,{children:t}),n]})}export{ot as a,st as i,ct as n,M as o,lt as r,at as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{A as n,X as r,a as i,d as a,et as o,f as s,j as c,o as l,v as u}from"./auth-olLlgxc3.js";import{t as d}from"./jsx-runtime-By8HlURe.js";import{d as f}from"./index-Nd31gVbt.js";import{n as p}from"./api-BOuyloUi.js";import{n as m}from"./dist-BOS6OKSE.js";import{t as h}from"./x-Dq6POV20.js";import{t as g}from"./createLucideIcon-C9A1vLE-.js";import{t as _}from"./button-q0ardkfx.js";import{t as v}from"./copy-D0Theg4Q.js";import{t as y}from"./ws-Dgc69_w8.js";var b=g(`clipboard-paste`,[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]),x=g(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);function ee(){return f.get()}var S=32,C=2048;function w(e,t,n){let r=e.getLine(t);if(!r)return null;let i=e.getNullCell(),a=``,o=[];for(let s=0;s<Math.min(n,r.length);s++){if(!r.getCell(s,i)||i.getWidth()===0)continue;if(s===n-1&&i.getChars()===``){let n=e.getLine(t+1);if(n?.isWrapped&&n.getCell(0)?.getWidth()===2)continue}let c=i.getChars()||` `;a+=c;for(let e=0;e<c.length;e++)o.push({row:t,col:s})}return{text:a,cells:o,isWrapped:r.isWrapped}}function te(e,t,n){return{...e,text:e.text.slice(t,n),cells:e.cells.slice(t,n)}}function T(e,t,n,r,i){if(t<0||n<1)return[];let a=Math.max(0,t-S+1),o=new Map;for(let r=a;r<t+S;r++){let t=w(e,r,n);if(!t)break;o.set(r,t)}let s=new Set,c=[];for(let l of[!0,!1])for(let u=a;u<=t;u++){if(o.get(u)?.isWrapped&&u>a)continue;let d=``,f=[];for(let a=u;a<u+S;a++){let p=o.get(a);if(!p)break;let m=o.get(a-1);if(a>u&&!p.isWrapped&&!(l&&m&&i(m,p,n,d)))break;let h=o.get(a+1),g=te(p,a>u&&!p.isWrapped?p.text.length-p.text.trimStart().length:0,h?.isWrapped?p.text.length:p.text.trimEnd().length);if(d.length+g.text.length>C)break;if(d+=g.text,f.push(...g.cells),!(a<t))for(let n of r(d)){let r=f[n.start],i=f[n.end-1];if(!r||!i||r.row>t||i.row<t)continue;let a=`${d.slice(n.start,n.end)}\0${r.row}:${r.col}-${i.row}:${i.col}`;if(s.has(a))continue;s.add(a);let o=e.getLine(i.row)?.getCell(i.col)?.getWidth()??1;c.push({candidate:n,start:r,end:{row:i.row,col:i.col+Math.max(1,o)-1},text:d.slice(n.start,n.end)})}}}return c.sort((e,t)=>t.text.length-e.text.length)}var E=n.options.join(`,`),D=a.imageBytes,O=20*1024*1024;async function ne(e,t,r){r?.throwIfAborted();let i=n.safeParse(e.type);if(!i.success)throw Error(`Choose a PNG, JPEG, GIF or WebP image.`);if(e.size===0)throw Error(`This image is empty.`);if(e.size>O)throw Error(`Choose an image smaller than 20 MiB.`);if(!t||e.size<=D)return{blob:e,mime:i.data,resized:!1};if(i.data===`image/gif`)throw Error(`Choose a GIF no larger than 4 MiB for remote access.`);let a=await createImageBitmap(e);try{r?.throwIfAborted();let e=document.createElement(`canvas`),t=e.getContext(`2d`);if(!t)throw Error(`Could not prepare this image.`);let o=i.data===`image/jpeg`?`image/jpeg`:`image/webp`,s=Math.min(1,2048/Math.max(a.width,a.height));for(let i=0;i<8;i++){e.width=Math.max(1,Math.round(a.width*s)),e.height=Math.max(1,Math.round(a.height*s)),t.drawImage(a,0,0,e.width,e.height);for(let t of[.85,.7,.55]){let i=await new Promise(n=>e.toBlob(n,o,t));if(r?.throwIfAborted(),i&&i.size<=D)return{blob:i,mime:n.parse(i.type),resized:!0}}s*=.75}throw Error(`This image is too large to attach remotely. Choose a smaller image.`)}finally{a.close()}}var k=new WeakSet,re=Math.floor((u.requestBytes-1024)*3/4);async function ie(e,t,n,i,l,u,d){let f=e.generation,p=()=>{if(u?.throwIfAborted(),l(),e.generation!==f)throw Error(`The connection changed; the image upload was interrupted.`)};if(p(),!n.size||n.size>a.imageBytes)throw Error(`The prepared image must be no larger than 4 MiB.`);if(k.has(e))throw Error(`An image upload is already in progress.`);k.add(e);let m=crypto.randomUUID(),h=`/api/worktrees/${t}/paste-upload`,g=!1,_=!1,v=async(t,n,r)=>{p();let i=await e.request(t,n,r,u),a=await i.json();if(p(),!i.ok){let e=o.safeParse(a);throw Error(e.success?e.data.error.message:`The image upload failed.`)}return a},y=e=>v(`POST`,h,e),b=async e=>{let t=new Uint8Array(await e.arrayBuffer());return p(),btoa(Array.from(t,e=>String.fromCharCode(e)).join(``))};try{let e=r.parse(await v(`GET`,`/api/version`));if(d?.(0,n.size),!e.remote_image_uploads){if(n.size>re)throw Error(`Update the host connector to upload images larger than 191 KiB.`);let e=await b(n),r=c.parse(await v(`POST`,`/api/worktrees/${t}/paste`,{mime:i,data:e}));return d?.(n.size,n.size),r}if(g=!0,s.parse(await y({action:`start`,upload:m,mime:i,size:n.size})).received!==0)throw Error(`Invalid image upload acknowledgement.`);for(let e=0;e<n.size;e+=a.chunkBytes){let t=n.slice(e,e+a.chunkBytes),r=await b(t),i=s.parse(await y({action:`chunk`,upload:m,offset:e,data:r}));if(i.received!==e+t.size)throw Error(`Invalid image upload acknowledgement.`);d?.(i.received,n.size)}let o=c.parse(await y({action:`finish`,upload:m}));return _=!0,o}finally{if(g&&!_&&e.generation===f)try{l(),e.request(`POST`,h,{action:`cancel`,upload:m}).catch(()=>{})}catch{}k.delete(e)}}function ae(e,t,n){if(t.startsWith(`login-`)||t===`home`)return!1;let r=Array.from(e.clipboardData?.items??[]);if(r.some(e=>e.type===`text/plain`))return!1;let i=r.find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!i)return!1;let a=i.getAsFile();return a?(A(a,t,n).then(({resized:e})=>{e&&m(`Image resized for remote access`)}).catch(e=>{m.error(e instanceof Error?`Image paste failed: ${e.message}`:`Image paste failed`)}),!0):!1}async function A(e,t,n,r={}){if(t.startsWith(`login-`)||t===`home`)throw Error(`Open a project terminal to attach an image.`);let i=l(),a=i?.generation,o=()=>{if(l()!==i||i?.generation!==a||!y.isConnected())throw Error(`The terminal connection changed; the image was not inserted.`)};r.signal?.throwIfAborted(),o(),r.onProgress?.({stage:`preparing`});let{blob:s,mime:u,resized:d}=await ne(e,i!==null,r.signal);o();let f=i?await ie(i,t,s,u,o,r.signal,(e,t)=>r.onProgress?.(e===t?{stage:`saving`}:{stage:`uploading`,received:e,total:t})):await(async()=>{let e=await oe(s);return o(),r.signal?.throwIfAborted(),c.parse(await p(`POST`,`/api/worktrees/${t}/paste`,{mime:u,data:e}))})();return r.signal?.throwIfAborted(),o(),r.onProgress?.({stage:`inserting`}),r.insert?r.insert(`${f.path} `):i?await i.input(t,n,`${f.path} `):y.write(t,n,`${f.path} `),{resized:d}}function oe(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).replace(/^data:[^,]*,/,``)),r.onerror=()=>n(r.error??Error(`could not read the clipboard image`)),r.readAsDataURL(e)})}var se=/(?:^|[\s"'`([<])((?:(?:\/|\.{1,2}\/|~\/)(?:[\w.+@~-]+\/)*[\w.+@~-]+|(?:[\w.+@~-]+\/)+[\w.+@~-]*|[\w.+@~-]+\.[A-Za-z]\w{0,11}))(?::(\d{1,6})(?::(\d{1,6}))?)?/dg,ce=/(?:^|[\s"'`([<])((?:~?\/|\.{1,2}\/|[\w.+@~-]+\/)(?:[\w.+@~-]+(?: [\w.+@~-]+)*\/)*[\w.+@~-]+)(?::(\d{1,6})(?::(\d{1,6}))?)?/dg,le=/"([^"\r\n]+)"|'([^'\r\n]+)'|`([^`\r\n]+)`|\(([^()\r\n]+)\)|\[([^\]\r\n[]+)\]/dg,ue=new Set([`.`,`,`,`;`,`:`,`)`,`]`,`'`,`"`]);function de(e){let t=[];for(let n of e.matchAll(le)){let e=n.slice(1).findIndex(e=>e!==void 0)+1,r=n[e];if(!r.includes(` `))continue;let i=/^(@?)(.+?)(?::(\d{1,6})(?::(\d{1,6}))?)?$/.exec(r);if(!i)continue;let a=i[2];if(!a.includes(`/`)&&!/\.[A-Za-z]\w{0,11}$/.test(a))continue;let o=n.indices[e][0]+i[1].length;t.push({path:a,line:i[3]===void 0?void 0:Number(i[3]),column:i[4]===void 0?void 0:Number(i[4]),start:o,end:n.indices[e][1]})}for(let n of[ce,se]){let r=new RegExp(n.source,n.flags),i;for(;i=r.exec(e);){let e=i.indices,n=i[1];if(!e?.[1]||n===void 0)continue;let r=e[1][0],a=e[1][1],o=n;for(o.startsWith(`@`)&&(o=o.slice(1),r++);o.length>0&&ue.has(o[o.length-1]);)o=o.slice(0,-1),a--;if(o.length===0)continue;let s=i[2]===void 0?void 0:Number.parseInt(i[2],10),c=i[3]===void 0?void 0:Number.parseInt(i[3],10),l=c!==void 0&&e[3]?e[3][1]:s!==void 0&&e[2]?e[2][1]:a;t.push({path:o,line:s,column:c,start:r,end:l})}}let n=new Set;return t.filter(e=>{let t=`${e.start}:${e.end}:${e.path}`;return n.has(t)?!1:(n.add(t),!0)}).sort((e,t)=>e.start-t.start||t.end-e.end)}function fe(e,t,n){let r=e.text.trimEnd(),i=t.text.trimStart();if(!/[\w.+@~/:-]$/.test(r)||!/^[\w.+@~/:-]/.test(i)||/^(?:~\/|\.{1,2}\/)/.test(i))return!1;let a=e.cells[r.length-1];return r.endsWith(`/`)||i.startsWith(`/`)||a!==void 0&&a.col>=n-9}function pe(e,t,n){return T(e,t,n,de,fe)}function me(e,t){return e.kind===`file`&&e.root!==void 0&&e.root!==t?e.root:null}var j=class{fetcher;now;positiveTtlMs;negativeTtlMs;maxEntries;maxConcurrent;entries=new Map;inflight=new Map;inUse=0;waiters=[];constructor(e){this.fetcher=e.fetcher,this.now=e.now??Date.now,this.positiveTtlMs=e.positiveTtlMs??15e3,this.negativeTtlMs=e.negativeTtlMs??5e3,this.maxEntries=e.maxEntries??500,this.maxConcurrent=e.maxConcurrent??4}resolve(e,t,n){let r=`${e}\0${t}`,i=this.entries.get(r);if(i){if(this.now()<i.expiresAt)return Promise.resolve(i.value);this.entries.delete(r)}let a=this.inflight.get(r);if(a)return a;let o=this.withSlot(()=>this.fetcher(e,t,n)).then(e=>(this.store(r,e),e)).finally(()=>{this.inflight.delete(r)});return this.inflight.set(r,o),o}store(e,t){let n=t?this.positiveTtlMs:this.negativeTtlMs;for(this.entries.set(e,{value:t,expiresAt:this.now()+n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}async withSlot(e){this.inUse>=this.maxConcurrent&&await new Promise(e=>this.waiters.push(e)),this.inUse++;try{return await e()}finally{this.inUse--,this.waiters.shift()?.()}}};async function M(e,t,n,r){let i=new URLSearchParams({path:t});return n!==void 0&&i.set(`line`,String(n)),r!==void 0&&i.set(`root`,r),p(`GET`,`/api/worktrees/${e}/resolve?${i}`)}function N(e,t,n){let r=e.kind??`file`;return{kind:r,path:e.path,...e.root===void 0?{}:{root:e.root},...e.relative_path===void 0?{}:{relativePath:e.relative_path},...r===`file`&&t!==void 0?{line:Math.max(1,t)}:{},...r===`file`&&n!==void 0?{column:n}:{}}}async function P(e,t,n){return N(await M(e,t,n?.line,n?.root),n?.line,n?.column)}async function F(e,t,n){try{return await M(e,t,n)}catch{return null}}function I(e,t,n){let r=new j({fetcher:F});return e.registerLinkProvider({provideLinks(i,a){let o=e.buffer.active,s=pe(o,i-1,e.cols);if(s.length===0){a(void 0);return}Promise.all(s.map(async({candidate:e,start:i,end:a,text:o})=>{let s=await r.resolve(t,e.path,e.line);return s?{range:{start:{x:i.col+1,y:i.row+1},end:{x:a.col+1,y:a.row+1}},text:o,decorations:{underline:!0,pointerCursor:!0},activate:t=>{!t.metaKey&&!t.ctrlKey||n(N(s,e.line,e.column))}}:null})).then(e=>{let t=e.filter(e=>e!==null);a(t.length>0?t:void 0)})}})}var L=e(t(),1),R={ctrl:1,alt:2,shift:4},he=/^(?:\[[ABCD]|O[ABCD]|\[1;([2-8])[ABCD])$/,z=e=>e.startsWith(`\x1B`)?he.exec(e.slice(1)):null;function B(e){return!e.startsWith(`\x1B`)||e===`\x1B`||z(e)!==null||e===`\x1B[Z`}function ge(e,t){if(!t)return e;let n=(t&R.ctrl)!==0,r=(t&R.alt)!==0,i=(t&R.shift)!==0,a=!!i|(r?2:0)|(n?4:0),o=z(e);if(o)return`\x1b[1;${1+(a|(o[1]?Number(o[1])-1:0))}${e.slice(-1)}`;if(!B(e))return e;if(e===` `||e===`\x1B[Z`)return i||e===`\x1B[Z`?`\x1B[Z`:` `;if(e===`\r`&&i)return`\x1b[13;${1+a}u`;if(i&&e.length===1){let t="`1234567890-=[]\\;',./".indexOf(e);t===-1?/[a-z]/.test(e)&&(e=e.toUpperCase()):e=`~!@#$%^&*()_+{}|:"<>?`[t]}if(n&&e.length===1){let t=e.toUpperCase().charCodeAt(0);t>=64&&t<=95?e=String.fromCharCode(t-64):e===` `?e=`\0`:e===`?`&&(e=``)}return r?`\x1b${e}`:e}function _e(e){return e.length===3&&(e.startsWith(`\x1B[`)||e.startsWith(`\x1BO`))&&`ABCD`.includes(e[2])}var V=new Map,H=new Map,U=new Map,W=new Map,G=new Set,K=e=>(G.add(e),()=>{G.delete(e)}),q=()=>{for(let e of G)e()},J=(e,t)=>i(JSON.stringify([e,t]));function ve(e,t){return(0,L.useSyncExternalStore)(K,()=>V.has(J(e,t)))}function ye(e,t,n,r,i){let a=J(e,t);return V.set(a,n),r&&H.set(a,r),i?U.set(a,i):U.delete(a),q(),()=>{V.get(a)===n&&(V.delete(a),H.delete(a),U.delete(a),W.delete(a),q())}}function Y(e,t){H.get(J(e,t))?.()}function X(e,t){return(0,L.useSyncExternalStore)(K,()=>W.get(J(e,t))??0)}function be(e,t,n){let r=J(e,t);W.set(r,(W.get(r)??0)^n),q()}function Z(e,t,n){let r=J(e,t),i=W.get(r)??0;return!i||!B(n)?n:(W.delete(r),q(),ge(n,i))}async function xe(e,t,n,r=!1){let i=J(e,t),a=V.get(i);if(!a)throw Error(`Wait for the terminal to attach; nothing was sent`);let o=r?`${a(n)}\r`:Z(e,t,n);!r&&_e(o)&&U.get(i)?.()&&(o=`\x1bO${o.slice(-1)}`),await Q(e,t,o)}async function Se(e,t,n){let r=J(e,t),i=V.get(r),a=l(),o=a?.generation;if(!i||!n()||!y.isConnected())throw Error(`Wait for the terminal to attach; nothing was pasted.`);let s;try{let n=navigator.clipboard.readText();Y(e,t),s=await n}catch{throw Error(`Could not read the clipboard. Allow clipboard access or use your keyboard’s Paste action.`)}if(!n()||V.get(r)!==i||l()!==a||a?.generation!==o||!y.isConnected())throw Error(`The terminal changed; nothing was pasted. Try again in the active terminal.`);s&&await Q(e,t,i(s))}async function Q(e,t,n){let r=l();if(r)await r.input(e,t,n);else{if(!y.isConnected())throw Error(`Terminal is disconnected; nothing was sent`);y.write(e,t,n)}}var $=d();function Ce({text:e,label:t,clear:n,paste:r}){let[i,a]=(0,L.useState)(!1);return(0,$.jsxs)(`div`,{role:`toolbar`,"aria-label":t,onPointerDown:e=>e.preventDefault(),className:`absolute right-2 top-2 z-20 flex gap-1 rounded-md bg-elevated p-1 shadow-lg`,children:[(0,$.jsxs)(_,{variant:`ghost`,size:`sm`,disabled:!e||i,onClick:async()=>{try{await navigator.clipboard.writeText(e),n()}catch{m.error(`Could not copy the selection. Try again.`)}},children:[(0,$.jsx)(v,{}),` Copy`]}),r&&(0,$.jsxs)(_,{variant:`ghost`,size:`sm`,disabled:i,onClick:async()=>{if(!i){a(!0);try{await r(),n()}catch(e){m.error(e instanceof Error?e.message:`Could not paste. Try again.`)}finally{a(!1)}}},children:[(0,$.jsx)(b,{}),` Paste`]}),(0,$.jsx)(_,{variant:`ghost`,size:`icon`,"aria-label":`Clear selection`,disabled:i,onClick:n,children:(0,$.jsx)(h,{})})]})}export{T as _,ye as a,x as b,ve as c,me as d,I as f,E as g,A as h,Se as i,X as l,ae as m,Z as n,xe as o,P as p,Y as r,be as s,Ce as t,R as u,w as v,ee as y};
|