tarsk 0.5.50 → 0.5.52
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/README.md +85 -3
- package/dist/bundled-skills/skill-creator/SKILL.md +1 -0
- package/dist/index.js +4931 -2506
- package/dist/public/assets/{account-view-orctnHTc.js → account-view-C5bYplbC.js} +1 -1
- package/dist/public/assets/api-DDjBQKVp.js +1 -0
- package/dist/public/assets/browser-tab-BLzy-OnY.js +8 -0
- package/dist/public/assets/commit-dialog-VaKgg0v7.js +1 -0
- package/dist/public/assets/context-menu-CyWNCdS8.js +1 -0
- package/dist/public/assets/create-repo-dialog-CxeBrzuI.js +1 -0
- package/dist/public/assets/dialogs-config-sFb6rmoV.js +51 -0
- package/dist/public/assets/diff-view-CUydKAcj.js +3 -0
- package/dist/public/assets/explorer-tab-view-DImsoaa7.js +2 -0
- package/dist/public/assets/explorer-tree-C3N9yUX2.js +1 -0
- package/dist/public/assets/explorer-view-t0Ubx-_E.js +75 -0
- package/dist/public/assets/git-history-dialog-BdFqU3-t.js +1 -0
- package/dist/public/assets/git-ops-button-DREYFquW.js +2 -0
- package/dist/public/assets/history-view-BaNsCvOG.js +9 -0
- package/dist/public/assets/index-BabXMhGR.js +81 -0
- package/dist/public/assets/index-CouJM3yT.css +1 -0
- package/dist/public/assets/mcp-server-card-euln08CV.js +1 -0
- package/dist/public/assets/merged-pr-dialog-CU3eepWu.js +1 -0
- package/dist/public/assets/model-star-rating-BeaqZyyn.js +1 -0
- package/dist/public/assets/onboarding-BtDZI4KL.js +1 -0
- package/dist/public/assets/project-settings-view-nULqYl1Q.js +1 -0
- package/dist/public/assets/providers-list-view-C_I7apJ0.js +1 -0
- package/dist/public/assets/pull-request-dialog-DPoyoAzR.js +1 -0
- package/dist/public/assets/pull-with-changes-dialog-BWeBUSvR.js +1 -0
- package/dist/public/assets/push-before-pr-dialog-CelqoZ3J.js +1 -0
- package/dist/public/assets/{radio-group-DAndqwXy.js → radio-group-DZUWbeu6.js} +1 -1
- package/dist/public/assets/react-vendor-G5EdW8A3.js +16 -0
- package/dist/public/assets/settings-general-view-BIpRxHjN.js +1 -0
- package/dist/public/assets/settings-instructions-view-DdZptx3T.js +1 -0
- package/dist/public/assets/settings-list-CKN-l-Ee.js +1 -0
- package/dist/public/assets/settings-mcp-servers-view-DThIXFIU.js +5 -0
- package/dist/public/assets/{settings-models-skeleton-ZtGznNlV.js → settings-models-skeleton-bDHbKptW.js} +1 -1
- package/dist/public/assets/settings-models-view-Dm63snYH.js +1 -0
- package/dist/public/assets/settings-rules-view-C8EhiuF6.js +8 -0
- package/dist/public/assets/settings-skills-view-DUq0nOrv.js +3 -0
- package/dist/public/assets/settings-slash-commands-view-3UGw-rg7.js +1 -0
- package/dist/public/assets/settings-subagents-view-DjY_-Vkl.js +2 -0
- package/dist/public/assets/{settings-system-prompt-view-BLkM6rN5.js → settings-system-prompt-view-C5zpTiRs.js} +1 -1
- package/dist/public/assets/settings-view-BqDpwOQy.js +2 -0
- package/dist/public/assets/{skeleton-CxK1dTki.js → skeleton-jLDiBDMB.js} +1 -1
- package/dist/public/assets/{slug-utils-D3-onmIf.js → slug-utils-CKHx-ORv.js} +1 -1
- package/dist/public/assets/{tabs-Tmfp1NOE.js → tabs-BDis0z_E.js} +1 -1
- package/dist/public/assets/tasks-view-Chkg_CWm.js +3 -0
- package/dist/public/assets/{terminal-panel-DKkr68gm.js → terminal-panel-qSiost2C.js} +2 -2
- package/dist/public/assets/{ui-components-BhYSDqpD.js → ui-components-CxpS-7ye.js} +1 -1
- package/dist/public/assets/{use-deferred-search-DXiiWEeH.js → use-deferred-search-BqzgL9XK.js} +1 -1
- package/dist/public/assets/{utils-DDUhUTLy.js → utils-DKzTCvnZ.js} +1 -1
- package/dist/public/assets/{vosk-speech-BHa2mKnm.js → vosk-speech-Im3i-XDL.js} +1 -1
- package/dist/public/assets/{web-BYoghlKk.js → web-CY9AvMQI.js} +1 -1
- package/dist/public/assets/web-CtID-CpM.js +1 -0
- package/dist/public/assets/{web-Dgmyivst.js → web-D7a-Gt-K.js} +1 -1
- package/dist/public/assets/{web-6JeYEnKU.js → web-DE8zJOsF.js} +1 -1
- package/dist/public/browser-preview-rpc.js +346 -6
- package/dist/public/index.html +8 -8
- package/package.json +14 -1
- package/dist/public/assets/api-_tZksLaY.js +0 -1
- package/dist/public/assets/browser-tab-bfjSH9LH.js +0 -1
- package/dist/public/assets/commit-dialog-BAFsxiuw.js +0 -1
- package/dist/public/assets/context-menu-CeBh_Q21.js +0 -1
- package/dist/public/assets/create-repo-dialog-D6cKAxMh.js +0 -1
- package/dist/public/assets/dialogs-config-COzptu1b.js +0 -51
- package/dist/public/assets/diff-view-CFu5DBIy.js +0 -3
- package/dist/public/assets/explorer-tab-view-yR_3TyF7.js +0 -2
- package/dist/public/assets/explorer-tree-DKrWFiee.js +0 -1
- package/dist/public/assets/explorer-view-DYbdTXTm.js +0 -1
- package/dist/public/assets/git-history-dialog-CTJwMGDA.js +0 -1
- package/dist/public/assets/git-ops-button-DM9h9L8O.js +0 -2
- package/dist/public/assets/history-view-BJ65FVAN.js +0 -9
- package/dist/public/assets/index-BMgOr4si.js +0 -73
- package/dist/public/assets/index-DzUALYN4.css +0 -1
- package/dist/public/assets/mcp-server-card-7DWtYR7B.js +0 -1
- package/dist/public/assets/merged-pr-dialog-D6ReZlV4.js +0 -1
- package/dist/public/assets/model-star-rating-DmWIerry.js +0 -1
- package/dist/public/assets/onboarding-pVfMmu_a.js +0 -1
- package/dist/public/assets/project-settings-view-CvPC_OvN.js +0 -1
- package/dist/public/assets/providers-list-view-BEBGDXvF.js +0 -1
- package/dist/public/assets/pull-request-dialog-DD9Yxl2t.js +0 -1
- package/dist/public/assets/pull-with-changes-dialog-yEIyN-rw.js +0 -1
- package/dist/public/assets/push-before-pr-dialog-09SWB4nh.js +0 -1
- package/dist/public/assets/react-vendor-CEpXTE2b.js +0 -16
- package/dist/public/assets/settings-general-view-Crc9BTRv.js +0 -1
- package/dist/public/assets/settings-instructions-view-CB-cGPIr.js +0 -1
- package/dist/public/assets/settings-list-C5XuK_4u.js +0 -1
- package/dist/public/assets/settings-mcp-servers-view-CZR7I1h2.js +0 -5
- package/dist/public/assets/settings-models-view-CB0rRPNa.js +0 -1
- package/dist/public/assets/settings-rules-view-BnoxoZfX.js +0 -8
- package/dist/public/assets/settings-skills-view-DKXDiK3e.js +0 -3
- package/dist/public/assets/settings-slash-commands-view-DtTuDEFe.js +0 -1
- package/dist/public/assets/settings-subagents-view-DNcPuqd5.js +0 -2
- package/dist/public/assets/settings-view-BX2dUb7a.js +0 -2
- package/dist/public/assets/todos-view-_rD_cv7x.js +0 -17
- package/dist/public/assets/web-3Ems3Koj.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$ as t,Aa as n,Br as r,Fa as i,Ii as a,K as o,Ki as s,Kn as c,Ko as l,La as u,Lr as d,Lt as f,Ms as p,No as m,Pi as h,Po as g,Ps as _,Qr as v,Qt as y,Rr as b,c as x,ei as S,eo as C,fs as w,ga as T,ii as E,js as D,ka as O,lt as k,ni as ee,ri as te,ro as A,st as j,to as M,za as N}from"./dialogs-config-sFb6rmoV.js";import{N as P}from"./react-vendor-G5EdW8A3.js";import{t as F}from"./monaco-CZnIWXyV.js";import{I,a as ne,l as re,n as L,o as ie}from"./history-view-BaNsCvOG.js";import{d as ae}from"./onboarding-BtDZI4KL.js";import{n as oe}from"./utils-DKzTCvnZ.js";import{C as se,H as ce,K as le,L as ue,U as de,V as fe,W as pe,d as me,f as R,h as he,m as ge,p as _e}from"./index-BabXMhGR.js";import{a as z,n as ve,r as ye,t as be}from"./context-menu-CyWNCdS8.js";var B=e(_(),1),V=p(),H=D();function U(e){let t=(0,V.c)(20),{children:n,title:r,subtitle:i,headerAction:a,footer:o}=e,s;t[0]===r?s=t[1]:(s=r&&(0,H.jsx)(`span`,{className:w.sectionTitle,children:r}),t[0]=r,t[1]=s);let c;t[2]===s?c=t[3]:(c=(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:s}),t[2]=s,t[3]=c);let l;t[4]===a?l=t[5]:(l=a&&(0,H.jsx)(`div`,{className:`flex items-center gap-2 ml-auto`,children:a}),t[4]=a,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]!==i||t[10]!==u?(d=(0,H.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sidebar-border px-4 py-6`,children:[u,i]}),t[9]=i,t[10]=u,t[11]=d):d=t[11];let f;t[12]===n?f=t[13]:(f=(0,H.jsx)(x,{className:`min-h-0 flex-1`,children:n}),t[12]=n,t[13]=f);let p;t[14]===o?p=t[15]:(p=o&&(0,H.jsx)(`div`,{className:`border-t border-sidebar-border`,children:o}),t[14]=o,t[15]=p);let m;return t[16]!==d||t[17]!==f||t[18]!==p?(m=(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-col`,children:[d,f,p]}),t[16]=d,t[17]=f,t[18]=p,t[19]=m):m=t[19],m}function xe(e){let t=[],n={};return e.forEach((e,r)=>{let i=e.path.split(`/`),a=t,o=``;for(let e=0;e<i.length-1;e++){if(o=o?`${o}/${i[e]}`:i[e],!n[o]){let t={id:`dir:${o}`,name:i[e],children:[]};n[o]=t,a.push(t)}a=n[o].children}a.push({id:`file:${e.path}`,name:i[i.length-1],fileIndex:r,status:e.status})}),t}var W={added:`text-green-500`,deleted:`text-red-500`,untracked:`text-green-500`,renamed:`text-blue-500`,modified:`text-orange-500`},Se={added:`A`,deleted:`D`,untracked:`U`,renamed:`R`,modified:`M`};function G(e){return a(a(w.compact,`status-badge font-mono font-semibold`),W[e]??`text-orange-500`)}function Ce(e){return Se[e]??`M`}var K=I(e=>(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsxs)(`span`,{className:e.v0,children:[e.v1,` file`,e.v2]}),(0,H.jsxs)(`span`,{className:e.v3,children:[`+`,e.v4]}),(0,H.jsxs)(`span`,{className:e.v5,children:[`-`,e.v6]})]}),{name:`JSX_stats_1`,portals:[`v1`,`v2`,`v4`,`v6`]}),q=I(e=>e.v0,{name:`DiffTree_1`,portals:[`v0`]}),J=I(e=>e.v0,{name:`DiffTree_2`,portals:[`v0`]}),we=I(e=>e.v0,{name:`DiffTree_3`,portals:[`v0`]}),Te=function(e){let t=(0,V.c)(32),{treeData:n,files:r,error:i,selectedFileIndex:o,onFileSelect:s,onRevertFile:c}=e,l;t[0]===r?l=t[1]:(l=r.reduce(Y,0),t[0]=r,t[1]=l);let u=l,d;t[2]===r?d=t[3]:(d=r.reduce(Ae,0),t[2]=r,t[3]=d);let f=d,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=a(w.compact,`text-muted-foreground`),t[4]=p):p=t[4];let h=r.length,g=r.length===1?``:`s`,_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=a(w.compact,`text-green-500`),t[5]=_):_=t[5];let v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=a(w.compact,`text-red-500`),t[6]=v):v=t[6];let y;t[7]!==r.length||t[8]!==g||t[9]!==u||t[10]!==f?(y=(0,H.jsx)(K,{v0:p,v1:h,v2:g,v3:_,v4:u,v5:v,v6:f}),t[7]=r.length,t[8]=g,t[9]=u,t[10]=f,t[11]=y):y=t[11];let b=y;if(i){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=a(w.compact,`text-destructive text-center`),t[12]=e):e=t[12];let n;t[13]===i?n=t[14]:(n=(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 pt-7 pb-2`,children:(0,H.jsx)(`p`,{className:e,children:i})}),t[13]=i,t[14]=n);let r;return t[15]!==b||t[16]!==n?(r=(0,H.jsx)(q,{v0:(0,H.jsx)(U,{title:`Review Changes`,subtitle:b,children:n})}),t[15]=b,t[16]=n,t[17]=r):r=t[17],r}if(r.length===0){let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 pt-7 pb-2`,children:(0,H.jsx)(`p`,{className:a(w.compact,w.bodyMuted,`text-center`),children:`No changes to review`})}),t[18]=e):e=t[18];let n;return t[19]===b?n=t[20]:(n=(0,H.jsx)(J,{v0:(0,H.jsx)(U,{title:`Review Changes`,subtitle:b,children:e})}),t[19]=b,t[20]=n),n}let x;t[21]!==r||t[22]!==s||t[23]!==c||t[24]!==o?(x=(e,t)=>{let{isOpen:n,toggle:i}=t,l=!!e.children,u=(0,H.jsxs)(ae,{onClick:()=>{l?i():e.fileIndex!==void 0&&s(e.fileIndex)},selected:!l&&e.fileIndex===o,className:`gap-1.5`,children:[l?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(m,{className:a(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform`,n&&`rotate-90`)}),n?(0,H.jsx)(M,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,H.jsx)(C,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}):(0,H.jsx)(A,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`truncate flex-1 min-w-0`,children:e.name}),!l&&e.status&&(0,H.jsx)(`span`,{className:G(e.status),children:Ce(e.status)})]});return l?u:(0,H.jsxs)(be,{children:[(0,H.jsx)(z,{asChild:!0,children:(0,H.jsx)(`div`,{children:u})}),(0,H.jsx)(ve,{children:(0,H.jsxs)(ye,{onClick:()=>{e.fileIndex!==void 0&&c?.(r[e.fileIndex])},children:[(0,H.jsx)(T,{className:`mr-2 h-3.5 w-3.5`}),`Revert Change`]})})]})},t[21]=r,t[22]=s,t[23]=c,t[24]=o,t[25]=x):x=t[25];let S;t[26]!==x||t[27]!==n?(S=(0,H.jsx)(`div`,{className:`px-1 pt-3 pb-2`,children:(0,H.jsx)(fe,{nodes:n,defaultOpen:!0,resetKey:n,indent:16,childContainerClassName:`ml-4 border-l border-sidebar-border pl-2`,renderNode:x})}),t[26]=x,t[27]=n,t[28]=S):S=t[28];let E;return t[29]!==b||t[30]!==S?(E=(0,H.jsx)(we,{v0:(0,H.jsx)(U,{title:`Review Changes`,subtitle:b,children:S})}),t[29]=b,t[30]=S,t[31]=E):E=t[31],E};function Ee(e){return e.type===`add`}function De(e,t){return e+t.changes.filter(Ee).length}function Y(e,t){return e+t.hunks.reduce(De,0)}function Oe(e){return e.type===`delete`}function ke(e,t){return e+t.changes.filter(Oe).length}function Ae(e,t){return e+t.hunks.reduce(ke,0)}var je=I(e=>(0,H.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,H.jsx)(`div`,{className:e.v0,children:e.v1}),(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-4 overflow-auto bg-background`,children:(0,H.jsx)(`img`,{src:e.v2,alt:e.v3,className:`max-w-full max-h-full object-contain`})})]}),{name:`DiffImageSingle_1`,portals:[`v1`]}),X=function(e){let t=(0,V.c)(5),{threadId:n,filePath:r,version:i,label:o}=e,s=Z(n,r,i),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=a(w.caption,`px-3 py-1.5 border-b text-muted-foreground bg-muted/30`),t[0]=c):c=t[0];let l=`${o} - ${r}`,u;return t[1]!==o||t[2]!==s||t[3]!==l?(u=(0,H.jsx)(je,{v0:c,v1:o,v2:s,v3:l}),t[1]=o,t[2]=s,t[3]=l,t[4]=u):u=t[4],u};function Me(e,t,n){return`git-media:${e}:${t}:${n}`}function Z(e,t,n){let r=(0,V.c)(13),i;r[0]!==t||r[1]!==e||r[2]!==n?(i=Me(e,t,n),r[0]=t,r[1]=e,r[2]=n,r[3]=i):i=r[3];let a;r[4]!==t||r[5]!==e||r[6]!==n?(a=()=>k(e,t,n),r[4]=t,r[5]=e,r[6]=n,r[7]=a):a=r[7];let o=ne(i,a),s;r[8]===o?s=r[9]:(s=URL.createObjectURL(o),r[8]=o,r[9]=s);let c=s,l,u;return r[10]===c?(l=r[11],u=r[12]):(l=()=>()=>{URL.revokeObjectURL(c)},u=[c],r[10]=c,r[11]=l,r[12]=u),(0,B.useEffect)(l,u),c}function Ne(e){let t=(0,V.c)(23),{threadId:n,file:r}=e,i=r.status===`modified`||r.status===`deleted`||r.status===`renamed`,a=r.status===`modified`||r.status===`added`||r.status===`untracked`||r.status===`renamed`;if(i&&a){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(re,{label:`Loading before...`}),t[0]=e):e=t[0];let i=r.status===`renamed`&&r.oldPath?r.oldPath:r.path,a;t[1]!==i||t[2]!==n?(a=(0,H.jsx)(`div`,{className:`flex-1 border-r border-border`,children:(0,H.jsx)(B.Suspense,{fallback:e,children:(0,H.jsx)(X,{threadId:n,filePath:i,version:`old`,label:`Before`})})}),t[1]=i,t[2]=n,t[3]=a):a=t[3];let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,H.jsx)(re,{label:`Loading after...`}),t[4]=o):o=t[4];let s;t[5]!==r.path||t[6]!==n?(s=(0,H.jsx)(`div`,{className:`flex-1`,children:(0,H.jsx)(B.Suspense,{fallback:o,children:(0,H.jsx)(X,{threadId:n,filePath:r.path,version:`new`,label:`After`})})}),t[5]=r.path,t[6]=n,t[7]=s):s=t[7];let c;return t[8]!==a||t[9]!==s?(c=(0,H.jsxs)(`div`,{className:`flex h-full`,children:[a,s]}),t[8]=a,t[9]=s,t[10]=c):c=t[10],c}let o=a?`new`:`old`,s=a?`Added`:`Deleted`,c;t[11]===s?c=t[12]:(c=s.toLowerCase(),t[11]=s,t[12]=c);let l=`Loading ${c} image...`,u;t[13]===l?u=t[14]:(u=(0,H.jsx)(re,{label:l}),t[13]=l,t[14]=u);let d;t[15]!==r.path||t[16]!==s||t[17]!==n||t[18]!==o?(d=(0,H.jsx)(X,{threadId:n,filePath:r.path,version:o,label:s}),t[15]=r.path,t[16]=s,t[17]=n,t[18]=o,t[19]=d):d=t[19];let f;return t[20]!==u||t[21]!==d?(f=(0,H.jsx)(`div`,{className:`flex h-full flex-col`,children:(0,H.jsx)(B.Suspense,{fallback:u,children:d})}),t[20]=u,t[21]=d,t[22]=f):f=t[22],f}function Pe(e){let t=(0,V.c)(4),{isOpen:n}=e,r=(n===void 0?!0:n)&&`ml-[-40px]`,i;t[0]===r?i=t[1]:(i=a(`z-10 shrink-0`,r),t[0]=r,t[1]=i);let o;return t[2]===i?o=t[3]:(o=(0,H.jsx)(R,{withHandle:!0,className:i}),t[2]=i,t[3]=o),o}function Fe(e){let t=(0,V.c)(36),{open:n,lineNumber:r,lineContent:i,initialComment:o,isEditing:s,onSave:c,onDelete:l,onClose:u}=e,[d,f]=(0,B.useState)((o===void 0?``:o)??``),p;t[0]!==c||t[1]!==d?(p=()=>{d.trim()&&c(d.trim())},t[0]=c,t[1]=d,t[2]=p):p=t[2];let m=p,g;t[3]===m?g=t[4]:(g=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),m())},t[3]=m,t[4]=g);let _=g,y;t[5]===u?y=t[6]:(y=e=>{e||u()},t[5]=u,t[6]=y);let b;t[7]===r?b=t[8]:(b=(0,H.jsx)(te,{children:(0,H.jsxs)(E,{children:[`Comment on line `,r]})}),t[7]=r,t[8]=b);let x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=a(w.compact,`font-mono rounded bg-muted px-3 py-2 text-muted-foreground overflow-x-auto whitespace-pre`),t[9]=x):x=t[9];let C=i||` `,T;t[10]===C?T=t[11]:(T=(0,H.jsx)(`div`,{className:x,children:C}),t[10]=C,t[11]=T);let D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>f(e.target.value),t[12]=D):D=t[12];let O;t[13]!==_||t[14]!==d?(O=(0,H.jsx)(ce,{autoFocus:!0,placeholder:`Add a comment... (Cmd+Enter to save)`,value:d,onChange:D,onKeyDown:_,rows:12,className:`resize-none text-base`}),t[13]=_,t[14]=d,t[15]=O):O=t[15];let k;t[16]!==s||t[17]!==l?(k=s&&l&&(0,H.jsx)(h,{variant:`destructive`,size:`sm`,onClick:l,className:`mr-auto`,children:`Delete`}),t[16]=s,t[17]=l,t[18]=k):k=t[18];let A;t[19]===d?A=t[20]:(A=d.trim(),t[19]=d,t[20]=A);let j=!A,M;t[21]!==m||t[22]!==j?(M=(0,H.jsx)(h,{size:`sm`,onClick:m,disabled:j,children:`Save`}),t[21]=m,t[22]=j,t[23]=M):M=t[23];let N;t[24]!==k||t[25]!==M?(N=(0,H.jsxs)(ee,{className:`gap-2 sm:gap-0`,children:[k,M]}),t[24]=k,t[25]=M,t[26]=N):N=t[26];let P;t[27]!==O||t[28]!==N||t[29]!==b||t[30]!==T?(P=(0,H.jsxs)(S,{className:`max-w-2xl`,children:[b,T,O,N]}),t[27]=O,t[28]=N,t[29]=b,t[30]=T,t[31]=P):P=t[31];let F;return t[32]!==n||t[33]!==P||t[34]!==y?(F=(0,H.jsx)(v,{open:n,onOpenChange:y,children:P}),t[32]=n,t[33]=P,t[34]=y,t[35]=F):F=t[35],F}var Ie=I(e=>e.v0,{name:`ReviewLoadingFallback_1`,portals:[`v0`]}),Le=I(e=>(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,H.jsxs)(`div`,{className:`space-y-4 text-center`,children:[(0,H.jsx)(`p`,{className:e.v0,children:`Loading review changes is taking longer than expected.`}),e.v1]})}),{name:`ReviewLoadingFallback_2`,portals:[`v1`]}),Re=function(e){let t=(0,V.c)(5),{onRetry:n}=e,[r,i]=(0,B.useState)(!1),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.setTimeout(()=>{i(!0)},15e3);return()=>{window.clearTimeout(e)}},o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,B.useEffect)(a,o),!r){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsx)(Ie,{v0:(0,H.jsx)(re,{label:`Loading review changes...`})}),t[2]=e):e=t[2],e}let s;return t[3]===n?s=t[4]:(s=(0,H.jsx)(Le,{v0:w.bodyMuted,v1:(0,H.jsx)(h,{variant:`outline`,onClick:n,children:`Retry`})}),t[3]=n,t[4]=s),s},ze=l(`app.diff-view.ui`);function Be(e,t){return`git-diff:${e}:${t}`}function Q(){return Error(`Loading review changes timed out. Please try again.`)}async function Ve(e,t=15e3){return Promise.race([j(e),new Promise((e,n)=>{window.setTimeout(()=>n(Q()),t)})])}function He({threadId:e,onExit:l,loadVersion:p}){let _=ne(Be(e,p),()=>Ve(e)),v=de(),x=pe(e=>e.diffComments),S=pe(e=>e.projectModelSelections),{resolvedTheme:C}=oe(),T=se(),{fetchUnifiedStatus:E}=ue(),[D,k]=(0,B.useState)(_.files||[]),[ee,te]=(0,B.useState)(null),[A,M]=(0,B.useState)(0),[I,re]=(0,B.useState)(!1),[L,ie]=(0,B.useState)(!1),[ae,ce]=(0,B.useState)(!1),[fe,R]=(0,B.useState)(!0),z=(0,B.useRef)(null);(0,B.useEffect)(()=>{R(!0)},[e]);let ve=(0,B.useCallback)(e=>{M(e),T&&R(!1)},[T]),ye=(0,B.useCallback)(()=>{R(!0)},[]),be=T&&!fe,V=(0,B.useMemo)(()=>x[e]??[],[x,e]),U=(0,B.useCallback)(t=>{let n=x[e]??[],r=typeof t==`function`?t(n):t;v({type:le.SetDiffComments,threadId:e,comments:r})},[v,e,x]),[W,Se]=(0,B.useState)(null),[G,Ce]=(0,B.useState)(null),[K,q]=(0,B.useState)(null),J=(0,B.useRef)(null),we=(0,B.useRef)(V),Ee=(0,B.useRef)(W),De=(0,B.useRef)({isFullView:I,selectedFileIndex:A,files:D}),Y=(0,B.useRef)({original:[],modified:[]}),Oe=(0,B.useRef)(!0);(0,B.useEffect)(()=>{we.current=V},[V]),(0,B.useEffect)(()=>{Ee.current=W},[W]),(0,B.useEffect)(()=>{De.current={isFullView:I,selectedFileIndex:A,files:D}},[I,A,D]);let ke=(0,B.useCallback)(()=>{z.current&&(L?z.current.expand():z.current.collapse())},[L]),Ae=(0,B.useCallback)(async()=>{if(e){te(null);try{k((await j(e)).files||[]),M(0)}catch(e){te(e instanceof Error?e.message:`Failed to load diff`)}}},[e]),je=(0,B.useCallback)(async t=>{try{await y(e,t.path),await Promise.all([Ae(),E(!0)])}catch(e){te(e instanceof Error?e.message:`Failed to revert file`)}},[e,Ae,E]),X=(0,B.useRef)(!1);(0,B.useEffect)(()=>{if((x[e]??[]).length>0){X.current=!0;return}f(e).then(t=>{t.diffComments&&t.diffComments.length>0&&v({type:le.SetDiffComments,threadId:e,comments:t.diffComments}),X.current=!0}).catch(()=>{X.current=!0})},[e]),(0,B.useEffect)(()=>{X.current&&c(e,{diffComments:V}).catch(()=>{})},[e,V]);let Me=(0,B.useMemo)(()=>xe(D),[D]),Z=e=>{if(e.hunks.length===0)return null;let t=1/0,n=0;return e.hunks.forEach(e=>{let r=Math.min(e.oldStart,e.newStart),i=e.oldStart+e.oldLines,a=e.newStart+e.newLines,o=Math.max(i,a);t=Math.min(t,r),n=Math.max(n,o)}),t===1/0?null:{startLine:Math.max(1,t-2),endLine:n+2}},Ie=(e,t,n)=>e.split(`
|
|
2
|
+
`).slice(t-1,n).join(`
|
|
3
|
+
`),Le=e=>{let t=Z(e);return t?t.startLine<=1:!0},Re=e=>({ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,cpp:`cpp`,h:`c`,hpp:`cpp`,sh:`shell`,yaml:`yaml`,yml:`yaml`,xml:`xml`,sql:`sql`})[e.split(`.`).pop()??``]||`plaintext`,Q=D[A],He=Q?.isBinary??!1,Ue=Q?I?Q.oldContent:(()=>{let e=Z(Q);return e?Ie(Q.oldContent,e.startLine,e.endLine):Q.oldContent})():``,We=Q?I?Q.newContent:(()=>{let e=Z(Q);return e?Ie(Q.newContent,e.startLine,e.endLine):Q.newContent})():``,$=(0,B.useCallback)(()=>{if(!Oe.current)return;let e=J.current;if(!e)return;let{isFullView:t,selectedFileIndex:n,files:r}=De.current,i=we.current,a=Ee.current,o=r[n];if(!o)return;let s=(e,r)=>{let s=t?null:Z(o),c=i.filter(e=>e.fileIndex===n&&e.side===r),l=new Set(c.map(e=>s?e.lineNumber-s.startLine+1:e.lineNumber)),u=e.getModel()?.getLineCount()??0,d=[];for(let e=1;e<=u;e++)l.has(e)||d.push({range:{startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1},options:{isWholeLine:!0,glyphMarginClassName:`diff-gutter-add-comment`,glyphMarginHoverMessage:{value:`$(add) Click to add a comment`},stickiness:F.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}});let f=c.map(e=>{let t=s?e.lineNumber-s.startLine+1:e.lineNumber;if(t<1)return null;let n=i.indexOf(e)===a;return{range:{startLineNumber:t,startColumn:1,endLineNumber:t,endColumn:1},options:{isWholeLine:!0,className:n?`diff-comment-active-line`:`diff-comment-marked-line`,glyphMarginClassName:n?`diff-comment-glyph-active`:`diff-comment-glyph`,glyphMarginHoverMessage:{value:e.comment},stickiness:F.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}).filter(e=>e!==null);d.push(...f);let p=r===`original`?Y.current.original:Y.current.modified,m=e.deltaDecorations(p,d);r===`original`?Y.current.original=m:Y.current.modified=m};s(e.getOriginalEditor(),`original`),s(e.getModifiedEditor(),`modified`)},[]);(0,B.useEffect)(()=>{$()},[$,V,W,A,I,Q]),(0,B.useEffect)(()=>()=>{J.current=null,Y.current={original:[],modified:[]}},[A]),(0,B.useEffect)(()=>()=>{Oe.current=!1,J.current&&=(J.current.getOriginalEditor().getModel()?.dispose(),J.current.getModifiedEditor().getModel()?.dispose(),J.current.dispose(),null),Y.current={original:[],modified:[]}},[]);let Ge=(0,B.useCallback)(e=>{J.current=e;let t=e=>e===F.MouseTargetType.GUTTER_GLYPH_MARGIN||e===F.MouseTargetType.GUTTER_LINE_NUMBERS||e===F.MouseTargetType.GUTTER_LINE_DECORATIONS||e===F.MouseTargetType.GUTTER_VIEW_ZONE,n=(e,n)=>{e.onMouseDown(r=>{if(!r.target?.position||!t(r.target.type))return;let i=r.target.position.lineNumber,{isFullView:a,selectedFileIndex:o,files:s}=De.current,c=s[o];if(!c)return;let l=a?null:Z(c),u=l?l.startLine+i-1:i,d=e.getModel()?.getLineContent(i)??``,f=we.current.find(e=>e.fileIndex===o&&e.lineNumber===u&&e.side===n);f?q(f):Ce({lineNumber:u,lineContent:d,side:n})})};n(e.getOriginalEditor(),`original`),n(e.getModifiedEditor(),`modified`),setTimeout(()=>{J.current===e&&$()},150)},[$]),Ke=(0,B.useCallback)(e=>{if(G&&Q){let t={id:`comment-${Date.now()}`,filePath:Q.path,fileIndex:A,lineNumber:G.lineNumber,lineContent:G.lineContent,comment:e,side:G.side};U(e=>[...e,t]),Ce(null)}else K&&(U(t=>t.map(t=>t.id===K.id?{...t,comment:e}:t)),q(null))},[G,K,Q,A,U]),qe=(0,B.useCallback)(()=>{K&&(U(e=>e.filter(e=>e.id!==K.id)),q(null))},[K,U]),Je=(0,B.useCallback)(e=>{if(V.length===0)return;let t=(e%V.length+V.length)%V.length,n=V[t];Se(t),M(n.fileIndex),T&&R(!1),setTimeout(()=>{let e=J.current;if(!e)return;let t=D[n.fileIndex];if(!t)return;let r=I?null:Z(t),i=r?n.lineNumber-r.startLine+1:n.lineNumber;(n.side===`original`?e.getOriginalEditor():e.getModifiedEditor()).revealLineInCenter(Math.max(1,i)),$()},100)},[V,D,I,$,T]),Ye=(0,B.useCallback)(()=>{Je((W??0)-1)},[Je,W]),Xe=(0,B.useCallback)(()=>{Je((W??-1)+1)},[Je,W]),Ze=(0,B.useCallback)(async()=>{let n=S[e];if(!n)try{let e=await t(),r=Object.values(e).flat();if(r.length>0)n=r[0];else{ze.error(`No models available to process comments`);return}}catch(e){ze.error(`Failed to load models:`,e);return}let r=n.id,i=n.provider;try{let{prompt:t}=await o(e,V);U([]),v({type:le.SetPendingChatMessage,message:{threadId:e,message:t,model:r,provider:i}}),l()}catch(e){ze.error(`Failed to fix comments:`,e),typeof window<`u`&&window.alert(`Failed to process comments. Please try again.`)}},[V,S,v,e,l,U]),Qe={readOnly:!0,renderSideBySide:!T,ignoreTrimWhitespace:!1,renderOverviewRuler:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},folding:!1,glyphMargin:!0,lineNumbers:Q&&(I||Le(Q))?`on`:`off`,diffWordWrap:`on`,originalEditable:!1,automaticLayout:!0},$e=(0,H.jsx)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden`,children:(0,H.jsx)(Te,{treeData:Me,files:D,error:ee,selectedFileIndex:A,onFileSelect:ve,onRevertFile:je})}),et=(0,H.jsxs)(`div`,{className:`diff-editor-panel flex h-full min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden bg-transparent`,children:[(0,H.jsxs)(me,{className:a(`bg-transparent`,L&&`h-auto py-3 flex-col items-start gap-3 md:flex-row md:items-center md:h-[71px] md:py-0 md:gap-2 justify-between`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[be?(0,H.jsxs)(h,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground shrink-0`,onClick:ye,children:[(0,H.jsx)(O,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):(0,H.jsxs)(h,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground shrink-0`,onClick:ke,children:[L?(0,H.jsx)(O,{className:`h-4 w-4`}):(0,H.jsx)(n,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Toggle file tree`})]}),(0,H.jsx)(`span`,{className:a(w.label,`text-foreground`),children:Q?Q.path:`Review Changes`})]}),(0,H.jsxs)(`div`,{className:a(`flex items-center gap-2`,L&&`ml-0`,!L&&`ml-auto`,`md:ml-auto`),children:[!He&&(0,H.jsx)(h,{variant:`ghost`,size:`sm`,onClick:()=>re(e=>!e),disabled:!Q,className:a(w.compact,`h-8 gap-1 px-2`),children:I?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(i,{className:`h-3 w-3`}),` Show changes only`]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(N,{className:`h-3 w-3`}),` Show full file`]})}),V.length>0&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(d,{children:[(0,H.jsx)(r,{asChild:!0,children:(0,H.jsx)(h,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-full`,onClick:Ye,disabled:(W??0)===0,children:(0,H.jsx)(g,{className:`h-3 w-3`})})}),(0,H.jsx)(b,{children:`Previous comment`})]}),(0,H.jsx)(`span`,{className:a(w.caption,`whitespace-nowrap`),children:V.length===1?`1 Comment`:`Comment ${(W??0)+1} of ${V.length}`}),(0,H.jsxs)(d,{children:[(0,H.jsx)(r,{asChild:!0,children:(0,H.jsx)(h,{variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-full`,onClick:Xe,disabled:(W??0)===V.length-1,children:(0,H.jsx)(m,{className:`h-3 w-3`})})}),(0,H.jsx)(b,{children:`Next comment`})]})]}),V.length>0&&(0,H.jsxs)(d,{children:[(0,H.jsx)(r,{asChild:!0,children:(0,H.jsxs)(h,{size:`sm`,onClick:Ze,className:a(w.compact,`h-8 gap-1 px-3 bg-foreground text-background hover:bg-foreground/90`),children:[(0,H.jsx)(u,{className:`h-3 w-3`}),`Fix all comments`]})}),(0,H.jsx)(b,{children:`Send all comments to Tarsk for resolution`})]})]})]}),(0,H.jsxs)(`div`,{className:`flex-1 bg-transparent relative`,children:[He&&Q?(0,H.jsx)(Ne,{threadId:e,file:Q}):(0,H.jsx)(P,{height:`100%`,language:Re(Q?.path||``),original:Ue,modified:We,theme:C===`dark`?`vs-dark`:`vs-light`,onMount:Ge,options:Qe},`diff-${A}`),(0,H.jsxs)(`div`,{className:`pointer-events-none absolute bottom-4 right-4 z-20 flex flex-col items-end gap-3`,children:[ae&&(0,H.jsxs)(`div`,{className:`pointer-events-auto w-[min(100%,48rem)] rounded-2xl bg-background/50 p-4 backdrop-blur-md`,children:[(0,H.jsx)(`div`,{className:`mb-3 flex items-center justify-end`,children:(0,H.jsxs)(h,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>ce(!1),children:[(0,H.jsx)(s,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Close chat`})]})}),(0,H.jsx)(he,{})]}),!ae&&(0,H.jsxs)(d,{children:[(0,H.jsx)(r,{asChild:!0,children:(0,H.jsxs)(h,{size:`icon`,className:`pointer-events-auto h-12 w-12 rounded-full shadow-lg`,onClick:()=>ce(!0),children:[(0,H.jsx)(u,{className:`h-5 w-5`}),(0,H.jsx)(`span`,{className:`sr-only`,children:`Open review chat`})]})}),(0,H.jsx)(b,{children:`Chat about this diff`})]})]})]})]});return(0,H.jsxs)(`div`,{className:`diff-view-root flex h-full min-h-0 w-full flex-col`,children:[(0,H.jsx)(`div`,{className:`diff-body flex min-h-0 w-full flex-1 overflow-hidden`,children:T?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:a(`flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden`,!fe&&`hidden`),children:$e}),(0,H.jsx)(`div`,{className:a(`flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden`,fe&&`hidden`),children:et})]}):(0,H.jsxs)(ge,{direction:`horizontal`,children:[(0,H.jsx)(_e,{ref:z,defaultSize:25,minSize:12,maxSize:40,collapsible:!0,collapsedSize:0,onCollapse:()=>ie(!0),onExpand:()=>ie(!1),className:`border-r border-transparent`,children:$e}),(0,H.jsx)(Pe,{isOpen:!L}),(0,H.jsx)(_e,{className:`overflow-hidden border-l border-border bg-transparent`,children:et})]})}),(0,H.jsx)(Fe,{open:G!==null||K!==null,lineNumber:K?.lineNumber??G?.lineNumber??0,lineContent:K?.lineContent??G?.lineContent??``,initialComment:K?.comment,isEditing:K!==null,onSave:Ke,onDelete:qe,onClose:()=>{Ce(null),q(null)}},`${K?.id??``}-${G?.lineNumber??``}-${G?.side??``}`)]})}function Ue(e){let t=(0,V.c)(22),[n,r]=(0,B.useState)(0),[i,a]=(0,B.useState)(0),o=(0,B.useRef)(0),s;t[0]===e.threadId?s=t[1]:(s=()=>{r(t=>(ie(Be(e.threadId,t)),t+1)),a($)},t[0]=e.threadId,t[1]=s);let c=s,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{a(0),r(0),o.current=0},t[2]=l):l=t[2];let u;t[3]===e.threadId?u=t[4]:(u=[e.threadId],t[3]=e.threadId,t[4]=u),(0,B.useEffect)(l,u);let d,f;t[5]!==e.refreshTrigger||t[6]!==e.threadId?(d=()=>{!e.refreshTrigger||e.refreshTrigger<=o.current||(o.current=e.refreshTrigger,r(t=>(ie(Be(e.threadId,t)),t+1)),a(We))},f=[e.refreshTrigger,e.threadId],t[5]=e.refreshTrigger,t[6]=e.threadId,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,B.useEffect)(d,f);let p=`${e.threadId}:${i}`,m;t[9]===c?m=t[10]:(m=(0,H.jsx)(Re,{onRetry:c}),t[9]=c,t[10]=m);let h=`${e.threadId}:${n}`,g;t[11]!==n||t[12]!==e||t[13]!==h?(g=(0,H.jsx)(He,{...e,loadVersion:n},h),t[11]=n,t[12]=e,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==m||t[16]!==g?(_=(0,H.jsx)(B.Suspense,{fallback:m,children:g}),t[15]=m,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==c||t[19]!==p||t[20]!==_?(v=(0,H.jsx)(L,{fallbackTitle:`Failed to load review changes`,onRetry:c,children:_},p),t[18]=c,t[19]=p,t[20]=_,t[21]=v):v=t[21],v}function We(e){return e+1}function $(e){return e+1}export{Ue as DiffView,Ue as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/explorer-tree-C3N9yUX2.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index-BabXMhGR.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-BaNsCvOG.js","assets/dialogs-config-sFb6rmoV.js","assets/onboarding-BtDZI4KL.js","assets/vosk-speech-Im3i-XDL.js","assets/react-vendor-G5EdW8A3.js","assets/utils-DKzTCvnZ.js","assets/index-CouJM3yT.css","assets/api-DDjBQKVp.js","assets/context-menu-CyWNCdS8.js","assets/ui-components-CxpS-7ye.js","assets/explorer-view-t0Ubx-_E.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ii as t,Ms as n,Ps as r,c as i,fs as a,js as o}from"./dialogs-config-sFb6rmoV.js";import{r as s}from"./monaco-CZnIWXyV.js";import{l as c,n as l,u}from"./history-view-BaNsCvOG.js";import{C as d,I as f,P as p,W as m,f as h,m as g,p as _}from"./index-BabXMhGR.js";var v=n(),y=e(r(),1),b=o(),x=(0,y.lazy)(()=>s(()=>import(`./explorer-tree-C3N9yUX2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),S=(0,y.lazy)(()=>s(()=>import(`./explorer-view-t0Ubx-_E.js`),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10,11,12])));function C(){let e=(0,v.c)(49),n=m(w),r=d(),[o,s]=(0,y.useState)(null),[C,T]=(0,y.useState)(!0),{pendingExplorerPath:E,setPendingExplorerPath:D,explorerClearPath:O,setExplorerClearPath:k}=p(),A;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{T(!0)},e[0]=A):A=e[0];let j;e[1]===n?j=e[2]:(j=[n],e[1]=n,e[2]=j),(0,y.useEffect)(A,j);let M;e[3]===r?M=e[4]:(M=e=>{s(e),r&&T(!1)},e[3]=r,e[4]=M);let N=M,P;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{T(!0)},e[5]=P):P=e[5];let F=P,I;e[6]===r?I=e[7]:(I=e=>{s(e),r&&T(!1)},e[6]=r,e[7]=I);let L=I,R,z;e[8]!==r||e[9]!==E||e[10]!==D?(R=()=>{E&&(s({name:E.split(`/`).pop()??E,path:E,type:`file`}),r&&T(!1),D(null))},z=[r,E,D],e[8]=r,e[9]=E,e[10]=D,e[11]=R,e[12]=z):(R=e[11],z=e[12]),(0,y.useEffect)(R,z);let B,V;e[13]!==O||e[14]!==r||e[15]!==o||e[16]!==k?(B=()=>{O&&(o&&(o.path===O||o.path.startsWith(O+`/`))&&(s(null),r&&T(!0)),k(null))},V=[O,r,o,k],e[13]=O,e[14]=r,e[15]=o,e[16]=k,e[17]=B,e[18]=V):(B=e[17],V=e[18]),(0,y.useEffect)(B,V);let H;e[19]!==N||e[20]!==o?.path||e[21]!==n?(H=(0,b.jsx)(i,{className:`h-full`,children:n?(0,b.jsx)(f,{threadId:n,children:(0,b.jsx)(l,{fallbackTitle:`Failed to load files`,children:(0,b.jsx)(y.Suspense,{fallback:(0,b.jsx)(u,{}),children:(0,b.jsx)(x,{threadId:n,selectedPath:o?.path??null,onNodeSelect:N})})})}):(0,b.jsx)(`p`,{className:t(a.caption,`px-3 py-4 text-center`),children:`No thread selected.`})}),e[19]=N,e[20]=o?.path,e[21]=n,e[22]=H):H=e[22];let U=H,W;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,b.jsx)(c,{}),e[23]=W):W=e[23];let G=r&&!C,K;e[24]!==L||e[25]!==o||e[26]!==G?(K=(0,b.jsx)(y.Suspense,{fallback:W,children:(0,b.jsx)(S,{selectedFile:o,showTreeBackButton:G,onShowTree:F,onFileCreated:L})}),e[24]=L,e[25]=o,e[26]=G,e[27]=K):K=e[27];let q=K;if(r){let n=!C&&`hidden`,r;e[28]===n?r=e[29]:(r=t(`flex-1 min-h-0 overflow-hidden`,n),e[28]=n,e[29]=r);let i;e[30]!==U||e[31]!==r?(i=(0,b.jsx)(`div`,{className:r,children:U}),e[30]=U,e[31]=r,e[32]=i):i=e[32];let a=C&&`hidden`,o;e[33]===a?o=e[34]:(o=t(`flex-1 min-h-0 overflow-hidden`,a),e[33]=a,e[34]=o);let s;e[35]!==q||e[36]!==o?(s=(0,b.jsx)(`div`,{className:o,children:q}),e[35]=q,e[36]=o,e[37]=s):s=e[37];let c;return e[38]!==i||e[39]!==s?(c=(0,b.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[i,s]}),e[38]=i,e[39]=s,e[40]=c):c=e[40],c}let J;e[41]===U?J=e[42]:(J=(0,b.jsx)(_,{defaultSize:25,minSize:15,maxSize:50,className:`overflow-hidden border-r border-border`,children:U}),e[41]=U,e[42]=J);let Y;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,b.jsx)(h,{withHandle:!0}),e[43]=Y):Y=e[43];let X;e[44]===q?X=e[45]:(X=(0,b.jsx)(_,{className:`overflow-hidden`,children:q}),e[44]=q,e[45]=X);let Z;return e[46]!==J||e[47]!==X?(Z=(0,b.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:(0,b.jsxs)(g,{direction:`horizontal`,className:`flex-1 overflow-hidden`,children:[J,Y,X]})}),e[46]=J,e[47]=X,e[48]=Z):Z=e[48],Z}function w(e){return e.selectedThreadId}export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Br as t,Fo as n,Ii as r,Lr as i,Ms as a,No as o,Pi as s,Ps as c,Rr as l,Zr as u,eo as d,fa as f,fs as p,js as m,ro as h,to as g,va as _}from"./dialogs-config-sFb6rmoV.js";import{A as v,F as y,M as b,O as x,a as S,c as C,j as w,k as T,n as E,o as D,u as O}from"./history-view-BaNsCvOG.js";import{d as k}from"./onboarding-BtDZI4KL.js";import{B as A,L as j,M as ee,N as te,P as M,S as N,j as ne}from"./index-BabXMhGR.js";import{a as P,i as F,n as I,r as L,t as R}from"./context-menu-CyWNCdS8.js";import{l as z,n as re,o as ie,r as ae,s as oe,t as se}from"./api-DDjBQKVp.js";import{t as B}from"./ui-components-CxpS-7ye.js";var V=a(),H=e(c(),1),U=m(),W=H.forwardRef((e,t)=>{let n=(0,V.c)(9),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=r(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(B,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});W.displayName=B.displayName;var G=H.forwardRef((e,t)=>{let n=(0,V.c)(10),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,U.jsx)(f,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),n[3]=o):o=n[3];let s;n[4]===i?s=n[5]:(s=r(`flex h-11 w-full rounded-md bg-transparent py-3 text-base outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),n[4]=i,n[5]=s);let c;return n[6]!==a||n[7]!==t||n[8]!==s?(c=(0,U.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[o,(0,U.jsx)(B.Input,{ref:t,className:s,...a})]}),n[6]=a,n[7]=t,n[8]=s,n[9]=c):c=n[9],c});G.displayName=B.Input.displayName;var K=H.forwardRef((e,t)=>{let n=(0,V.c)(9),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=r(`max-h-[300px] overflow-y-auto overflow-x-hidden`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(B.List,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});K.displayName=B.List.displayName;var q=H.forwardRef((e,t)=>{let n=(0,V.c)(4),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=r(p.bodyMuted,`py-6 text-center`),n[0]=i):i=n[0];let a;return n[1]!==e||n[2]!==t?(a=(0,U.jsx)(B.Empty,{ref:t,className:i,...e}),n[1]=e,n[2]=t,n[3]=a):a=n[3],a});q.displayName=B.Empty.displayName;var J=H.forwardRef((e,t)=>{let n=(0,V.c)(9),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=r(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(B.Group,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});J.displayName=B.Group.displayName;var ce=H.forwardRef((e,t)=>{let n=(0,V.c)(9),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=r(`-mx-1 h-px bg-border`,i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(B.Separator,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});ce.displayName=B.Separator.displayName;var le=H.forwardRef((e,t)=>{let n=(0,V.c)(9),i,a;n[0]===e?(i=n[1],a=n[2]):({className:i,...a}=e,n[0]=e,n[1]=i,n[2]=a);let o;n[3]===i?o=n[4]:(o=r(r(p.body,`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`),i),n[3]=i,n[4]=o);let s;return n[5]!==a||n[6]!==t||n[7]!==o?(s=(0,U.jsx)(B.Item,{ref:t,className:o,...a}),n[5]=a,n[6]=t,n[7]=o,n[8]=s):s=n[8],s});le.displayName=B.Item.displayName;var Y=e=>{let t=(0,V.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(p.compact,`ml-auto tracking-widest text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,U.jsx)(`span`,{className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o};Y.displayName=`CommandShortcut`;var X=100,ue=500;function Z(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean)}function de(e,t){return t.length===0?!0:t.every(t=>e.haystack.includes(t))}function fe(e,t,n){if(t.length===0)return[];let r=[];for(let n of e)if(de(n,t)&&(r.push(n.node),r.length>=ue))break;return r.sort((e,t)=>pe(e,t,n)).slice(0,X)}function pe(e,t,n){let r=n.trim().toLowerCase(),i=e.name.toLowerCase(),a=t.name.toLowerCase(),o=r?i.startsWith(r):!1;return o===(r?a.startsWith(r):!1)?e.type===t.type?e.path.localeCompare(t.path):e.type===`folder`?-1:1:o?-1:1}function me(e){let t=(0,V.c)(38),{items:n,isReady:i,onRequestIndex:a,onOpenChange:o,onSelect:s}=e,c=i===void 0?!1:i,l=(0,H.useRef)(null),f=(0,H.useRef)(!1),m=(0,H.useRef)(!1),[h,g]=(0,H.useState)(!1),[_,v]=(0,H.useState)(``),y=(0,H.useDeferredValue)(_),b;t[0]===a?b=t[1]:(b=function(){m.current||(m.current=!0,a())},t[0]=a,t[1]=b);let x=b,S;t[2]!==y||t[3]!==n?(S=fe(n,Z(y),y),t[2]=y,t[3]=n,t[4]=S):S=t[4];let C=S,w,T;t[5]!==o||t[6]!==_?(w=()=>{let e=_.trim().length>0;g(e),f.current!==e&&(f.current=e,o(e))},T=[o,_],t[5]=o,t[6]=_,t[7]=w,t[8]=T):(w=t[7],T=t[8]),(0,H.useEffect)(w,T);let E;t[9]===o?E=t[10]:(E=function(e){e||v(``),g(e),o(e),e&&requestAnimationFrame(()=>l.current?.focus())},t[9]=o,t[10]=E);let D=E,O;t[11]!==o||t[12]!==s?(O=function(e){s(e),g(!1),o(!1),v(``)},t[11]=o,t[12]=s,t[13]=O):O=t[13];let k=O,A;t[14]===x?A=t[15]:(A=e=>{x(),v(e.target.value)},t[14]=x,t[15]=A);let j;t[16]!==_||t[17]!==x||t[18]!==A?(j=(0,U.jsx)(te,{asChild:!0,children:(0,U.jsx)(`div`,{children:(0,U.jsx)(u,{ref:l,value:_,onPointerDown:x,onChange:A,placeholder:`Search files and folders`,className:`pr-[4px]`})})}),t[16]=_,t[17]=x,t[18]=A,t[19]=j):j=t[19];let M;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(M=r(p.compact,`py-4`),t[20]=M):M=t[20];let P=c?`No matches found.`:`Indexing files and folders...`,F;t[21]===P?F=t[22]:(F=(0,U.jsx)(q,{className:M,children:P}),t[21]=P,t[22]=F);let I;if(t[23]!==k||t[24]!==C){let e;t[26]===k?e=t[27]:(e=e=>(0,U.jsxs)(le,{value:e.path,onSelect:()=>k(e),className:e.ignored?`opacity-50`:void 0,children:[e.type===`folder`?(0,U.jsx)(d,{className:`h-4 w-4 text-muted-foreground`}):(0,U.jsx)(N,{filename:e.name}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate`,children:e.name}),(0,U.jsx)(`div`,{className:r(p.compact,`truncate text-muted-foreground`),children:e.path})]})]},e.path),t[26]=k,t[27]=e),I=C.map(e),t[23]=k,t[24]=C,t[25]=I}else I=t[25];let L;t[28]===I?L=t[29]:(L=(0,U.jsx)(J,{children:I}),t[28]=I,t[29]=L);let R;t[30]!==F||t[31]!==L?(R=(0,U.jsx)(ee,{align:`start`,side:`bottom`,sideOffset:4,onOpenAutoFocus:Q,className:`w-[var(--radix-popover-trigger-width)] p-0`,children:(0,U.jsx)(W,{shouldFilter:!1,children:(0,U.jsxs)(K,{children:[F,L]})})}),t[30]=F,t[31]=L,t[32]=R):R=t[32];let z;return t[33]!==D||t[34]!==h||t[35]!==R||t[36]!==j?(z=(0,U.jsxs)(ne,{open:h,onOpenChange:D,children:[j,R]}),t[33]=D,t[34]=h,t[35]=R,t[36]=j,t[37]=z):z=t[37],z}function Q(e){return e.preventDefault()}function he(e,t,n){return`explorer-dir:${e}:${t}:${n}`}function ge(e){let t=(0,V.c)(12),{threadId:n,dirPath:r,version:i,children:a}=e,o;t[0]!==r||t[1]!==n||t[2]!==i?(o=he(n,r,i),t[0]=r,t[1]=n,t[2]=i,t[3]=o):o=t[3];let s;t[4]!==r||t[5]!==n?(s=()=>ie(n,r).then(_e),t[4]=r,t[5]=n,t[6]=s):s=t[6];let c=S(o,s),l;t[7]!==a||t[8]!==c?(l=a(c),t[7]=a,t[8]=c,t[9]=l):l=t[9];let u;return t[10]===l?u=t[11]:(u=(0,U.jsx)(U.Fragment,{children:l}),t[10]=l,t[11]=u),u}function _e(e){return e.entries}function ve(e){let t=(0,V.c)(17),{defaultValue:n,onCommit:r,onCancel:i,level:a,basePadding:o,icon:s}=e,c=(0,H.useRef)(null),l,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{c.current?.focus(),c.current?.select()},u=[],t[0]=l,t[1]=u):(l=t[0],u=t[1]),(0,H.useEffect)(l,u);let d;t[2]!==i||t[3]!==r?(d=function(e){if(e.key===`Enter`){let e=c.current?.value.trim()??``;e?r(e):i()}else e.key===`Escape`&&i()},t[2]=i,t[3]=r,t[4]=d):d=t[4];let f=d,p;t[5]!==i||t[6]!==r?(p=function(){let e=c.current?.value.trim()??``;e?r(e):i()},t[5]=i,t[6]=r,t[7]=p):p=t[7];let m=p,h;t[8]!==n||t[9]!==m||t[10]!==f?(h=(0,U.jsx)(`input`,{ref:c,defaultValue:n,onKeyDown:f,onBlur:m,className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`,onClick:$}),t[8]=n,t[9]=m,t[10]=f,t[11]=h):h=t[11];let g;return t[12]!==o||t[13]!==s||t[14]!==a||t[15]!==h?(g=(0,U.jsxs)(k,{level:a,basePadding:o,children:[s,h]}),t[12]=o,t[13]=s,t[14]=a,t[15]=h,t[16]=g):g=t[16],g}function $(e){return e.stopPropagation()}function ye(e){return e.map(e=>({node:e,haystack:`${e.name} ${e.path}`.toLowerCase()}))}function be(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(0,t):``}var xe=(0,H.memo)(function e({node:t,level:r,threadId:i,selectedPath:a,expandedPaths:s,getDirVersion:c,renamingPath:l,newItemIn:u,onToggleFolder:f,onSelectNode:p,onStartRename:m,onCommitRename:_,onCancelRename:v,onDelete:y,onOpen:b,onCopyReference:x,onNewFile:S,onNewFolder:w,onCommitNewItem:T,onCancelNewItem:E}){let D=s.has(t.path),O=l===t.path,A=u?.dirPath===t.path&&D;return t.type===`folder`?(0,U.jsxs)(R,{children:[(0,U.jsx)(P,{asChild:!0,children:(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(k,{level:r,basePadding:10,selected:a===t.path,className:t.ignored?`opacity-50`:void 0,onClick:e=>{e.stopPropagation(),f(t)},children:[(0,U.jsx)(`span`,{className:`text-muted-foreground w-3 flex-shrink-0`,children:D?(0,U.jsx)(n,{className:`h-3 w-3`}):(0,U.jsx)(o,{className:`h-3 w-3`})}),O?(0,U.jsxs)(U.Fragment,{children:[D?(0,U.jsx)(g,{className:`h-4 w-4 flex-shrink-0`}):(0,U.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}),(0,U.jsx)(`input`,{autoFocus:!0,defaultValue:t.name,onKeyDown:e=>{if(e.key===`Enter`){let n=e.target.value.trim();n?_(t,n):v()}else e.key===`Escape`&&v()},onBlur:e=>{let n=e.target.value.trim();n?_(t,n):v()},onClick:e=>e.stopPropagation(),className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`})]}):(0,U.jsxs)(U.Fragment,{children:[D?(0,U.jsx)(g,{className:`h-4 w-4 flex-shrink-0`}):(0,U.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:t.name})]})]}),D&&(0,U.jsx)(`div`,{children:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(C,{}),children:(0,U.jsx)(ge,{threadId:i,dirPath:t.path,version:c(t.path),children:t=>(0,U.jsxs)(U.Fragment,{children:[A&&(0,U.jsx)(ve,{defaultValue:``,level:r+1,basePadding:u.type===`folder`?10:22,icon:u.type===`folder`?(0,U.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}):(0,U.jsx)(h,{className:`h-4 w-4 flex-shrink-0 text-muted-foreground`}),onCommit:T,onCancel:E}),t.map(t=>(0,U.jsx)(e,{node:t,level:r+1,threadId:i,selectedPath:a,expandedPaths:s,getDirVersion:c,renamingPath:l,newItemIn:u,onToggleFolder:f,onSelectNode:p,onStartRename:m,onCommitRename:_,onCancelRename:v,onDelete:y,onOpen:b,onCopyReference:x,onNewFile:S,onNewFolder:w,onCommitNewItem:T,onCancelNewItem:E},t.path))]})})})})]})}),(0,U.jsxs)(I,{children:[(0,U.jsx)(L,{onSelect:()=>b(t),children:`Open`}),(0,U.jsx)(F,{}),(0,U.jsx)(L,{onSelect:()=>S(t.path),children:`New File...`}),(0,U.jsx)(L,{onSelect:()=>w(t.path),children:`New Folder...`}),(0,U.jsx)(F,{}),(0,U.jsx)(L,{onSelect:()=>x(t),children:`Copy Reference`}),(0,U.jsx)(L,{onSelect:()=>m(t),children:`Rename...`}),(0,U.jsx)(L,{onSelect:()=>y(t),className:`text-destructive focus:text-destructive`,children:`Delete`})]})]}):(0,U.jsxs)(R,{children:[(0,U.jsx)(P,{asChild:!0,children:(0,U.jsxs)(k,{level:r,basePadding:22,selected:a===t.path,className:t.ignored?`opacity-50`:void 0,onClick:()=>p(t),children:[(0,U.jsx)(N,{filename:t.name}),O?(0,U.jsx)(`input`,{autoFocus:!0,defaultValue:t.name,onKeyDown:e=>{if(e.key===`Enter`){let n=e.target.value.trim();n?_(t,n):v()}else e.key===`Escape`&&v()},onBlur:e=>{let n=e.target.value.trim();n?_(t,n):v()},onClick:e=>e.stopPropagation(),className:`flex-1 min-w-0 bg-transparent outline-none border border-border rounded px-1 text-base`}):(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:t.name})]})}),(0,U.jsxs)(I,{children:[(0,U.jsx)(L,{onSelect:()=>b(t),children:`Open`}),(0,U.jsx)(F,{}),(0,U.jsx)(L,{onSelect:()=>S(be(t.path)),children:`New File...`}),(0,U.jsx)(L,{onSelect:()=>w(be(t.path)),children:`New Folder...`}),(0,U.jsx)(F,{}),(0,U.jsx)(L,{onSelect:()=>x(t),children:`Copy Reference`}),(0,U.jsx)(L,{onSelect:()=>m(t),children:`Rename...`}),(0,U.jsx)(L,{onSelect:()=>y(t),className:`text-destructive focus:text-destructive`,children:`Delete`})]})]})}),Se=new Map;function Ce({threadId:e,selectedPath:n,onNodeSelect:r}){let[a,o]=(0,H.useState)(()=>new Map([[``,0]])),[c,u]=(0,H.useState)(new Set),[f,p]=(0,H.useState)(null),[m,g]=(0,H.useState)(null),[S,C]=(0,H.useState)(null),[k,ee]=(0,H.useState)(!1),[te,N]=(0,H.useState)([]),[ne,F]=(0,H.useState)(!1),[B,V]=(0,H.useState)(!1),W=(0,H.useRef)(null),G=(0,H.useRef)(0),K=(0,H.useRef)(null),{explorerRefreshTick:q,pendingExplorerPath:J,setExplorerClearPath:ce,triggerExplorerRefresh:le}=M(),{fetchUnifiedStatus:Y}=j(),X=(0,H.useMemo)(()=>`${e}:${q}`,[q,e]),ue=(0,H.useCallback)(e=>{(0,H.startTransition)(()=>{ee(t=>t===e?t:e)})},[]),Z=(0,H.useCallback)(async()=>{if(!e)return;let t=Se.get(X);if(t){N(t),F(!0);return}if(W.current!==X){W.current=X,N([]),F(!1);try{let t=ye((await ie(e,``,!0)).entries);Se.set(X,t),N(t),F(!0)}catch{N([]),F(!1)}finally{W.current===X&&(W.current=null)}}},[X,e]),de=(0,H.useCallback)(()=>{V(!0)},[]),fe=(0,H.useCallback)(()=>{Se.delete(X),N([]),F(!1)},[X]),pe=(0,H.useCallback)(()=>{fe(),B&&Z()},[fe,Z,B]),Q=(0,H.useCallback)(e=>a.get(e)??0,[a]),_e=(0,H.useCallback)(e=>{o(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},[]),$=(0,H.useCallback)(t=>{e&&(D(he(e,t,Q(t))),_e(t))},[_e,Q,e]),Ce=(0,H.useCallback)(t=>{if(!e)return;let n=t.path.split(`/`);t.type===`file`&&n.pop();let r=[],i=``;for(let e of n)i=i?`${i}/${e}`:e,r.push(i);u(e=>{let t=new Set(e);for(let e of r)t.add(e);return t})},[e]);(0,H.useEffect)(()=>{if(!e)return;let t=K.current!==null&&K.current!==e;K.current=e,t&&(o(new Map([[``,0]])),u(new Set),p(null),g(null),G.current=q)},[q,e]),(0,H.useEffect)(()=>{!e||q<=G.current||(G.current=q,o(t=>{let n=new Set([``]);for(let e of c)n.add(e);let r=new Map(t);for(let i of n){let n=t.get(i)??0;D(he(e,i,n)),r.set(i,n+1)}return r}))},[q,c,e]),(0,H.useEffect)(()=>{N([]),F(!1),V(!1),W.current=null},[X]),(0,H.useEffect)(()=>{!B||!e||Z()},[Z,B,e]),(0,H.useEffect)(()=>{if(!J||!e)return;let t=J.split(`/`);t.pop();let n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);if(n.length!==0){u(e=>{let t=new Set(e);for(let e of n)t.add(e);return t});for(let e of n)o(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})}},[J,e]);function we(e){c.has(e.path)?u(t=>{let n=new Set(t);return n.delete(e.path),n}):(u(t=>new Set(t).add(e.path)),o(t=>{if(t.has(e.path))return t;let n=new Map(t);return n.set(e.path,0),n}))}function Te(e){C(e)}async function Ee(t){try{await oe(e,t.path)}catch{A({title:`Error`,description:`Failed to open "${t.name}"`,variant:`destructive`})}}async function De(e){try{await navigator.clipboard.writeText(e.path);let t=A({title:`Copied`,description:`Reference copied to clipboard.`});window.setTimeout(()=>{t.dismiss()},2e3)}catch{A({title:`Error`,description:`Failed to copy reference for "${e.name}"`,variant:`destructive`})}}async function Oe(){if(!S)return;let t=S;C(null);try{await ae(e,t.path),ce(t.path),$(be(t.path)),pe(),Y(!0),u(e=>{let n=new Set(e);for(let e of n)(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}),o(e=>{let n=new Map(e);for(let e of n.keys())(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n})}catch{A({title:`Error`,description:`Failed to move "${t.name}" to trash`,variant:`destructive`})}}function ke(e){g(null),p(e.path)}async function Ae(t,n){if(n===t.name){p(null);return}p(null);try{await z(e,t.path,n),$(be(t.path)),pe(),Y(!0),t.type===`folder`&&(u(e=>{let n=new Set(e);for(let e of n)(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}),o(e=>{let n=new Map(e);for(let e of n.keys())(e===t.path||e.startsWith(t.path+`/`))&&n.delete(e);return n}))}catch{A({title:`Error`,description:`Failed to rename "${t.name}"`,variant:`destructive`})}}function je(e){p(null),c.has(e)||(u(t=>new Set(t).add(e)),o(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})),g({dirPath:e,type:`file`})}function Me(e){p(null),c.has(e)||(u(t=>new Set(t).add(e)),o(t=>{if(t.has(e))return t;let n=new Map(t);return n.set(e,0),n})),g({dirPath:e,type:`folder`})}async function Ne(t){if(!m)return;let{dirPath:n,type:r}=m;g(null);try{r===`file`?await se(e,n,t):await re(e,n,t),$(n),pe(),Y(!0)}catch{A({title:`Error`,description:`Failed to create ${r} "${t}"`,variant:`destructive`})}}function Pe(){g(null)}function Fe(e){Ce(e),e.type===`file`&&r(e)}let Ie=m?.dirPath===``?(0,U.jsx)(ve,{defaultValue:``,level:0,basePadding:m.type===`folder`?10:22,icon:m.type===`folder`?(0,U.jsx)(d,{className:`h-4 w-4 flex-shrink-0`}):(0,U.jsx)(h,{className:`h-4 w-4 flex-shrink-0 text-muted-foreground`}),onCommit:Ne,onCancel:Pe}):null;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(x,{open:S!==null,onOpenChange:e=>!e&&C(null),children:(0,U.jsxs)(w,{children:[(0,U.jsx)(y,{children:`Move to Trash`}),(0,U.jsxs)(b,{children:[`Move “`,S?.name,`” to trash?`]}),(0,U.jsxs)(`div`,{className:`flex gap-3 justify-end`,children:[(0,U.jsx)(v,{children:`Cancel`}),(0,U.jsx)(T,{onClick:()=>void Oe(),children:`Move to Trash`})]})]})}),(0,U.jsx)(`div`,{className:`border-b border-border bg-background px-2 py-2`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(me,{items:te,isReady:ne,onRequestIndex:de,onOpenChange:ue,onSelect:e=>Fe(e)},X)}),(0,U.jsxs)(i,{children:[(0,U.jsx)(t,{asChild:!0,children:(0,U.jsx)(s,{variant:`ghost`,size:`icon-sm`,onClick:le,"aria-label":`Refresh file listing`,children:(0,U.jsx)(_,{className:`h-4 w-4`})})}),(0,U.jsx)(l,{children:`Refresh`})]})]})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(P,{asChild:!0,disabled:k,children:(0,U.jsx)(`div`,{className:`py-2 min-h-full`,children:(0,U.jsx)(E,{fallbackTitle:`Failed to load files`,onRetry:()=>$(``),children:(0,U.jsx)(H.Suspense,{fallback:(0,U.jsx)(O,{}),children:(0,U.jsx)(ge,{threadId:e,dirPath:``,version:Q(``),children:t=>(0,U.jsxs)(U.Fragment,{children:[Ie,t.map(t=>(0,U.jsx)(xe,{node:t,level:0,threadId:e,selectedPath:n,expandedPaths:c,getDirVersion:Q,renamingPath:f,newItemIn:m,onToggleFolder:we,onSelectNode:r,onStartRename:ke,onCommitRename:Ae,onCancelRename:()=>p(null),onDelete:Te,onOpen:Ee,onCopyReference:De,onNewFile:je,onNewFolder:Me,onCommitNewItem:Ne,onCancelNewItem:Pe},t.path))]})})})})})}),(0,U.jsxs)(I,{children:[(0,U.jsx)(L,{onSelect:()=>je(``),children:`New File...`}),(0,U.jsx)(L,{onSelect:()=>Me(``),children:`New Folder...`})]})]})]})}export{Ce as default};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{Ba as t,Ii as n,Io as r,Ko as i,Ms as a,Pi as o,Ps as s,Sa as c,To as l,ao as u,at as d,ba as ee,fs as f,js as p,ka as te,mo as m,ns as ne,oo as h,rr as re,rs as g}from"./dialogs-config-sFb6rmoV.js";import{M as ie}from"./react-vendor-G5EdW8A3.js";import{I as _,a as v,l as y,n as b,o as x}from"./history-view-BaNsCvOG.js";import{n as ae}from"./utils-DKzTCvnZ.js";import{A as oe,B as S,D as C,E as w,P as T,R as se,T as ce,W as le,d as ue}from"./index-BabXMhGR.js";import{a as E,c as de,i as D,o as O,s as fe,t as pe,u as me}from"./api-DDjBQKVp.js";var k=a(),A=p(),j=e(s(),1),M=_(e=>(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center`,children:[e.v0,(0,A.jsx)(`p`,{className:e.v1,children:`Select a thread to browse its files`})]}),{name:`ExplorerView_1`,portals:[`v0`]}),N=_(e=>(0,A.jsxs)(`div`,{className:`explorer-view-root flex flex-col h-full print:block print:h-auto`,children:[e.v0,(0,A.jsx)(`div`,{className:`flex-1 overflow-hidden print:overflow-visible print:flex-none`,children:(0,A.jsx)(`div`,{className:`h-full relative overflow-hidden print:h-auto print:overflow-visible`,children:e.v1})}),e.v2]}),{name:`ExplorerView_2`,portals:[`v0`,`v1`,`v2`]}),P=function({selectedFile:e,showTreeBackButton:i=!1,onShowTree:a,onFileCreated:s}){let{resolvedTheme:u}=ae(),p=le(e=>e.selectedThreadId),{triggerExplorerRefresh:m}=T(),g=(0,j.useRef)(null),_=(0,j.useRef)(null),v=(0,j.useRef)(!1),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)(!1),[P,F]=(0,j.useState)(!1),[U,W]=(0,j.useState)(`edit`),[ve,ye]=(0,j.useState)(0),[G,be]=(0,j.useState)(null),[K,q]=(0,j.useState)(!1),xe=e?.path??null;(0,j.useEffect)(()=>{p&&d(p).then(be).catch(()=>{})},[p]);let Se=async()=>{if(!(!G||K)){q(!0);try{await navigator.clipboard.writeText(G),S({title:`Copied`,description:`Repository folder path copied to clipboard.`})}catch(e){V(`Failed to copy explorer folder path`,{threadId:p,folderPath:G},e),S({title:`Error`,description:`Failed to copy path to clipboard.`,variant:`destructive`})}finally{q(!1)}}},Ce=async()=>{if(p)try{await fe(p,`.`)}catch(e){V(`Failed to open explorer repository folder`,{threadId:p,folderPath:G},e),S({title:`Error`,description:`Failed to open repository folder.`,variant:`destructive`})}},we=(0,j.useCallback)(async e=>{if(p)try{let t=await L(p,e);await pe(p,``,t);let n={name:t,path:t,type:`file`};_.current=t,v.current=!0,s?.(n),m(),S({title:`Created`,description:`${t} created successfully.`})}catch(t){V(`Failed to create explorer file`,{threadId:p,extension:e},t),S({title:`Error`,description:`Failed to create file.`,variant:`destructive`})}},[p,s,m]),J=e?ne(e.path,e.name):null,Y=e?.type===`file`&&p&&!J?e:null,X=Y?`${p}:${Y.path}:${ve}`:null,Z=E&&E.key===X?E:null,Q=Z?.content??``,Te=Z?.original??``;(0,j.useEffect)(()=>()=>{g.current&&=(g.current.getModel()?.dispose(),g.current.dispose(),null)},[]),(0,j.useEffect)(()=>{e?.type===`file`?_.current===e.path?(_.current=null,W(`edit`)):W(R(e.path)?`view`:`edit`):W(`edit`)},[xe,p]);async function $(){if(!(!p||!e||!X)){k(!0);try{await me(p,e.path,Q),D({key:X,content:Q,original:Q}),S({title:`Saved`,description:`${e.name} saved successfully.`})}catch(t){V(`Failed to save explorer file`,{threadId:p,path:e.path},t),S({title:`Error`,description:t instanceof Error?t.message:`Failed to save file`,variant:`destructive`})}finally{k(!1)}}}async function Ee(){if(!(!p||!e||P)){F(!0);try{if(!re()){if(typeof window>`u`)return;let t=document.querySelector(`[data-markdown-print-content]`);if(!(t instanceof HTMLElement)){S({title:`Print unavailable`,description:`Couldn't find the markdown preview to print.`,variant:`destructive`});return}let n=`<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>${e.name??`Markdown document`}</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
color-scheme: light;
|
|
10
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
}
|
|
13
|
+
* {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
body {
|
|
17
|
+
margin: 0;
|
|
18
|
+
background: white;
|
|
19
|
+
color: black;
|
|
20
|
+
}
|
|
21
|
+
.markdown-print-shell {
|
|
22
|
+
max-width: 900px;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
padding: 32px;
|
|
25
|
+
}
|
|
26
|
+
img, video, svg {
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
height: auto;
|
|
29
|
+
}
|
|
30
|
+
pre {
|
|
31
|
+
white-space: pre-wrap;
|
|
32
|
+
overflow-wrap: anywhere;
|
|
33
|
+
border: 1px solid #d4d4d8;
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
padding: 12px;
|
|
36
|
+
background: #f4f4f5;
|
|
37
|
+
}
|
|
38
|
+
code {
|
|
39
|
+
white-space: pre-wrap;
|
|
40
|
+
overflow-wrap: anywhere;
|
|
41
|
+
}
|
|
42
|
+
table {
|
|
43
|
+
width: 100%;
|
|
44
|
+
border-collapse: collapse;
|
|
45
|
+
}
|
|
46
|
+
th, td {
|
|
47
|
+
border: 1px solid #d4d4d8;
|
|
48
|
+
padding: 8px;
|
|
49
|
+
text-align: left;
|
|
50
|
+
}
|
|
51
|
+
@page {
|
|
52
|
+
margin: 0.75in;
|
|
53
|
+
}
|
|
54
|
+
@media print {
|
|
55
|
+
body {
|
|
56
|
+
-webkit-print-color-adjust: exact;
|
|
57
|
+
print-color-adjust: exact;
|
|
58
|
+
}
|
|
59
|
+
.markdown-print-shell {
|
|
60
|
+
max-width: none;
|
|
61
|
+
padding: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<main class="markdown-print-shell">${t.innerHTML}</main>
|
|
68
|
+
<script>
|
|
69
|
+
window.addEventListener("load", () => {
|
|
70
|
+
window.focus();
|
|
71
|
+
window.print();
|
|
72
|
+
}, { once: true });
|
|
73
|
+
<\/script>
|
|
74
|
+
</body>
|
|
75
|
+
</html>`,r=window.open(``,`_blank`,`noopener,noreferrer`);if(!r){S({title:`Print blocked`,description:`Allow pop-ups to print this file.`,variant:`destructive`});return}r.document.open(),r.document.write(n),r.document.close();return}S({title:`PDF created`,description:`Opened ${(await de(p,e.path)).outputPath.split(/[\\/]/).pop()??`the PDF`} in your default app.`})}catch(t){V(`Failed to print markdown file as PDF`,{threadId:p,path:e.path},t),S({title:`PDF export failed`,description:t instanceof Error?t.message:`Failed to convert this markdown file to PDF.`,variant:`destructive`})}finally{F(!1)}}}function De(){!p||!Y||(x(B(p,Y.path)),ye(e=>e+1))}return p?(0,A.jsx)(N,{v0:(0,A.jsxs)(ue,{className:`justify-between print:hidden`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[i&&a?(0,A.jsxs)(o,{variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-muted-foreground electrobun-webkit-app-region-no-drag`,onClick:a,children:[(0,A.jsx)(te,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Show file tree`})]}):null,(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,A.jsx)(`span`,{className:n(f.label,`truncate text-foreground`),children:e?e.name:`Select a file to edit`}),(0,A.jsx)(`span`,{className:n(f.compact,`truncate text-muted-foreground`),children:e?e.path:`Browse and edit repository files`})]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[Y&&Z?(0,A.jsxs)(A.Fragment,{children:[R(Y.path)?(0,A.jsxs)(`div`,{className:`flex rounded-full border border-input bg-background p-0.5`,children:[(0,A.jsx)(o,{size:`sm`,variant:U===`view`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>W(`view`),children:`View`}),(0,A.jsx)(o,{size:`sm`,variant:U===`edit`?`secondary`:`ghost`,className:`h-7 px-3`,onClick:()=>W(`edit`),children:`Edit`})]}):null,R(Y.path)&&U===`view`?(0,A.jsxs)(o,{size:`sm`,variant:`outline`,onClick:()=>void Ee(),disabled:P,children:[P?(0,A.jsx)(t,{className:`h-4 w-4 animate-spin`}):(0,A.jsx)(ee,{className:`h-4 w-4`}),P?`Printing…`:`Print`]}):null,(0,A.jsxs)(o,{size:`sm`,onClick:()=>void $(),disabled:O||!Q||Q===Te,children:[O?(0,A.jsx)(t,{className:`h-4 w-4 animate-spin`}):null,`Save`]})]}):null,e?null:(0,A.jsxs)(ce,{children:[(0,A.jsx)(oe,{asChild:!0,children:(0,A.jsxs)(o,{size:`sm`,className:`gap-1.5`,children:[(0,A.jsx)(c,{className:`h-3.5 w-3.5`}),`New file`]})}),(0,A.jsx)(w,{align:`end`,children:I.map(({label:e,ext:t,icon:n})=>(0,A.jsxs)(C,{onSelect:()=>void we(t),children:[(0,A.jsx)(n,{className:`h-4 w-4`}),e]},t))})]})]})]}),v1:Y?(0,A.jsxs)(b,{fallbackTitle:`Failed to load file`,onRetry:De,children:[(0,A.jsx)(j.Suspense,{fallback:(0,A.jsx)(y,{}),children:(0,A.jsx)(he,{threadId:p,path:Y.path,contentKey:X??``,onContentReady:D},X??void 0)}),Z?R(Y.path)&&U===`view`?(0,A.jsx)(`div`,{className:`h-full overflow-auto p-6 print:h-auto print:overflow-visible print:p-0`,children:(0,A.jsx)(`div`,{className:`mx-auto max-w-4xl print:max-w-none`,"data-markdown-print-content":!0,children:(0,A.jsx)(se,{content:Q,enableMermaid:!0})})}):(0,A.jsx)(ie,{height:`100%`,language:z(Y.path),value:Q,onChange:e=>D(t=>t&&{...t,content:e??``}),onMount:e=>{g.current=e,v.current&&(v.current=!1,e.focus())},theme:u===`dark`?`vs-dark`:`vs-light`,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`,automaticLayout:!0,fontSize:13,lineNumbers:`on`,renderLineHighlight:`line`,scrollbar:{vertical:`auto`,horizontal:`auto`}}}):(0,A.jsx)(y,{})]},X??void 0):e?.type===`file`&&J===`image`?(0,A.jsx)(b,{fallbackTitle:`Failed to load image`,onRetry:()=>{!p||!e||x(H(p,e.path))},children:(0,A.jsx)(j.Suspense,{fallback:(0,A.jsx)(y,{}),children:(0,A.jsx)(ge,{threadId:p,path:e.path,alt:e.name})})},e.path):e?.type===`file`&&J===`video`?(0,A.jsx)(b,{fallbackTitle:`Failed to load video`,onRetry:()=>{!p||!e||x(H(p,e.path))},children:(0,A.jsx)(j.Suspense,{fallback:(0,A.jsx)(y,{}),children:(0,A.jsx)(_e,{threadId:p,path:e.path})})},e.path):(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-center p-8`,children:[(0,A.jsx)(`h2`,{className:n(f.pageTitle,`text-foreground`),children:`File Explorer`}),(0,A.jsx)(`p`,{className:n(f.pageSubtitle),children:`Browse and edit files`})]}),v2:e?null:(0,A.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 px-4 py-2`,children:G?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>void Ce(),className:n(f.compact,`min-w-0 flex-1 truncate text-left font-mono text-muted-foreground hover:text-foreground hover:underline`),title:G,children:G}),(0,A.jsxs)(o,{variant:`ghost`,size:`icon`,className:`h-7 w-7 shrink-0`,onClick:()=>void Se(),disabled:K,children:[K?(0,A.jsx)(r,{className:`h-3.5 w-3.5`}):(0,A.jsx)(l,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Copy path`})]})]}):(0,A.jsx)(`p`,{className:n(f.compact,`text-muted-foreground/50 italic`),children:`Loading path...`})})}):(0,A.jsx)(M,{v0:(0,A.jsx)(h,{className:`h-8 w-8 text-muted-foreground`}),v1:f.bodyMuted})},F=i(`explorer.preview`),I=[{label:`Markdown`,ext:`md`,icon:h},{label:`TypeScript`,ext:`ts`,icon:m},{label:`Text`,ext:`txt`,icon:u}];async function L(e,t){try{let n=await O(e,``),r=new Set(n.entries.map(e=>e.name)),i=`untitled`,a=`${i}.${t}`,o=2;for(;r.has(a);)a=`${i}${o}.${t}`,o++;return a}catch{return`untitled.${t}`}}function R(e){return g(e)===`md`}function z(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,md:`markdown`,mdc:`markdown`,css:`css`,scss:`scss`,html:`html`,py:`python`,sh:`shell`,yaml:`yaml`,yml:`yaml`,xml:`xml`,sql:`sql`}[g(e)]??`plaintext`}function B(e,t){return`explorer-file:${e}:${t}`}function he(e){let t=(0,k.c)(11),{threadId:n,path:r,contentKey:i,onContentReady:a}=e,o;t[0]!==r||t[1]!==n?(o=B(n,r),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s;t[3]!==r||t[4]!==n?(s=async()=>{try{return await E(n,r)}catch(e){let t=e;throw V(`Failed to load explorer file preview`,{threadId:n,path:r},t),t}},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c=v(o,s),l,u;return t[6]!==i||t[7]!==a||t[8]!==c.content?(l=()=>{a({key:i,content:c.content,original:c.content})},u=[a,c.content,i],t[6]=i,t[7]=a,t[8]=c.content,t[9]=l,t[10]=u):(l=t[9],u=t[10]),(0,j.useLayoutEffect)(l,u),null}function V(e,t,n){F.error(e,{...t,error:n})}function H(e,t){return`explorer-media:${e}:${t}`}function U(e,t){let n=(0,k.c)(11),r;n[0]!==t||n[1]!==e?(r=H(e,t),n[0]=t,n[1]=e,n[2]=r):r=n[2];let i;n[3]!==t||n[4]!==e?(i=async()=>{try{return await D(e,t)}catch(n){let r=n;throw V(`Failed to load explorer media preview`,{threadId:e,path:t},r),r}},n[3]=t,n[4]=e,n[5]=i):i=n[5];let a=v(r,i),o;n[6]===a?o=n[7]:(o=URL.createObjectURL(a),n[6]=a,n[7]=o);let s=o,c,l;return n[8]===s?(c=n[9],l=n[10]):(c=()=>()=>{URL.revokeObjectURL(s)},l=[s],n[8]=s,n[9]=c,n[10]=l),(0,j.useEffect)(c,l),s}function ge(e){let t=(0,k.c)(3),{threadId:n,path:r,alt:i}=e,a=U(n,r),o;return t[0]!==i||t[1]!==a?(o=(0,A.jsx)(`div`,{className:`flex items-center justify-center h-full p-4 overflow-auto`,children:(0,A.jsx)(`img`,{src:a,alt:i,className:`max-w-full max-h-full object-contain`})}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o}function _e(e){let t=(0,k.c)(2),{threadId:n,path:r}=e,i=U(n,r),a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`div`,{className:`flex items-center justify-center h-full p-4`,children:(0,A.jsx)(`video`,{src:i,controls:!0,className:`max-w-full max-h-full`})}),t[0]=i,t[1]=a),a}export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ba as e,Ii as t,Ms as n,Pi as r,Qr as i,ei as a,fs as o,ii as s,js as c,ni as l,ri as u,ti as d}from"./dialogs-config-sFb6rmoV.js";var f=n(),p=c();function m(n){let c=(0,f.c)(28),{open:m,onOpenChange:g,commits:_,displayedCommits:v,isLoadingMore:y,onScroll:b,currentBranch:x}=n,S;c[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,p.jsx)(s,{children:`Commit History`}),c[0]=S):S=c[0];let C;c[1]===x?C=c[2]:(C=(0,p.jsxs)(u,{children:[S,(0,p.jsxs)(d,{children:[`Recent commits on branch `,x]})]}),c[1]=x,c[2]=C);let w;c[3]===v?w=c[4]:(w=v.length>0?v.map(h):(0,p.jsx)(`p`,{className:t(o.bodyMuted,`text-center py-8`),children:`No commits found`}),c[3]=v,c[4]=w);let T;c[5]===y?T=c[6]:(T=y&&(0,p.jsx)(`div`,{className:`p-3 text-center`,children:(0,p.jsx)(e,{className:`h-4 w-4 animate-spin inline`})}),c[5]=y,c[6]=T);let E;c[7]!==_.length||c[8]!==v.length||c[9]!==y?(E=v.length<_.length&&!y&&(0,p.jsx)(`div`,{className:t(o.caption,`p-3 text-center`),children:`Scroll to load more`}),c[7]=_.length,c[8]=v.length,c[9]=y,c[10]=E):E=c[10];let D;c[11]!==w||c[12]!==T||c[13]!==E?(D=(0,p.jsxs)(`div`,{className:`divide-y`,children:[w,T,E]}),c[11]=w,c[12]=T,c[13]=E,c[14]=D):D=c[14];let O;c[15]!==b||c[16]!==D?(O=(0,p.jsx)(`div`,{className:`flex-1 overflow-y-auto border rounded-lg`,onScroll:b,children:D}),c[15]=b,c[16]=D,c[17]=O):O=c[17];let k;c[18]===g?k=c[19]:(k=(0,p.jsx)(l,{children:(0,p.jsx)(r,{onClick:()=>g(!1),children:`Close`})}),c[18]=g,c[19]=k);let A;c[20]!==C||c[21]!==O||c[22]!==k?(A=(0,p.jsxs)(a,{className:`max-w-2xl max-h-[80vh] flex flex-col`,children:[C,O,k]}),c[20]=C,c[21]=O,c[22]=k,c[23]=A):A=c[23];let j;return c[24]!==g||c[25]!==m||c[26]!==A?(j=(0,p.jsx)(i,{open:m,onOpenChange:g,children:A}),c[24]=g,c[25]=m,c[26]=A,c[27]=j):j=c[27],j}function h(e){return(0,p.jsxs)(`div`,{className:`p-3 hover:bg-muted/50 transition-colors`,children:[(0,p.jsx)(`p`,{className:t(o.label,`break-words`),children:e.message}),(0,p.jsxs)(`p`,{className:t(o.bodyMuted,`mt-1`),children:[(0,p.jsx)(`span`,{className:o.mono,children:e.hash.substring(0,7)}),` •`,` `,e.author,` • `,new Date(e.date).toLocaleDateString()]})]},e.hash)}export{m as GitHistoryDialog};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/commit-dialog-VaKgg0v7.js","assets/index-BabXMhGR.js","assets/rolldown-runtime-aKtaBQYM.js","assets/monaco-CZnIWXyV.js","assets/monaco-Br_kD0ds.css","assets/history-view-BaNsCvOG.js","assets/dialogs-config-sFb6rmoV.js","assets/onboarding-BtDZI4KL.js","assets/vosk-speech-Im3i-XDL.js","assets/react-vendor-G5EdW8A3.js","assets/utils-DKzTCvnZ.js","assets/index-CouJM3yT.css","assets/pull-request-dialog-DPoyoAzR.js","assets/create-repo-dialog-CxeBrzuI.js","assets/git-history-dialog-BdFqU3-t.js","assets/push-before-pr-dialog-CelqoZ3J.js","assets/pull-with-changes-dialog-BWeBUSvR.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{$t as t,Ba as n,Br as r,C as i,Cs as a,Dt as o,Fo as ee,Gi as te,Ii as ne,Ka as re,Kn as s,Ko as c,Kt as ie,Lr as ae,Ms as l,Pi as oe,Ps as u,Rr as d,Uo as f,Vo as se,Wt as ce,Xa as le,Xi as ue,Xt as p,Y as m,Yt as de,Za as fe,bo as pe,ct as me,dt as he,fs as h,js as g,mt as ge,on as _,q as _e,qt as ve,rn as ye,va as be,xo as xe,zr as Se}from"./dialogs-config-sFb6rmoV.js";import{r as v}from"./monaco-CZnIWXyV.js";import{A as Ce,B as y,D as b,E as we,K as Te,L as Ee,O as De,T as Oe,U as ke,W as Ae,k as je,v as Me,y as Ne}from"./index-BabXMhGR.js";var x=e(u(),1),S=g();function C(e){return!e.hasChanges&&e.defaultBranchBehind>0}function w(e){return e.prExists&&e.prState===`OPEN`&&!e.hasChanges&&!e.hasUnpushedCommits}function T(e){return e.hasUnpushedCommits&&e.prExists}function Pe(e,t){return t?`Creating PR...`:e.hasChanges?`Commit`:T(e)?`Update PR`:w(e)?`Open PR`:e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges?`Create PR`:C(e)?`Sync`:`Commit`}function Fe(e,t,n=!1){return t||n||e.hasChanges||T(e)||w(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||!e.hasChanges&&!e.hasUnpushedCommits&&!C(e)?null:C(e)?(0,S.jsx)(f,{className:`h-3.5 w-3.5`}):(0,S.jsx)(fe,{className:`h-3.5 w-3.5`})}function Ie(e){if(e.hasChanges)return e.changedFilesCount>0?`Commit ${e.changedFilesCount} changed file${e.changedFilesCount===1?``:`s`}`:`No changes to commit`;if(T(e))return`Update pull request with unpushed commits`;if(w(e))return`View pull request in GitHub`;if(e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges)return`Create pull request for committed changes`;if(C(e)){let t=e.defaultBranch??`main`,n=`${e.defaultBranchBehind} commit${e.defaultBranchBehind===1?``:`s`} behind origin/${t}`,r=e.defaultBranchAhead>0?`, ${e.defaultBranchAhead} commit${e.defaultBranchAhead===1?``:`s`} ahead`:``;return e.currentBranch===e.defaultBranch?`Your branch is ${n}${r}. Click to pull the latest changes.`:`Your branch "${e.currentBranch}" is ${n}${r}. Click to rebase onto the latest ${t}.`}return`No actions available`}function Le(e,t,n=!1){return t||n?!0:w(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges||C(e)?!1:!e.hasChanges&&!e.hasUnpushedCommits}function Re(e){return e.hasChanges||w(e)||T(e)||C(e)||e.commitsAheadOfDefault&&!e.prExists&&!e.hasChanges}var ze=l();function Be(e){let t=(0,ze.c)(105),{branchStatus:i,remoteUrl:a,hasRemoteBranch:o,hasUnpushedCommits:s,canCreateRepo:c,repoUrl:ie,isRefreshing:l,isCreatingPR:u,isBrandState:ce,hasChanges:p,defaultBranch:m,defaultBranchAhead:de,defaultBranchBehind:me,gitUser:he,isDirectCommitMode:g,autoGenerateCommitMessage:ge,isLoading:_,isLoadingHistory:_e,isQuickCommitting:ve,onFetch:ye,onPull:v,onPush:y,onOpenHistory:Te,onCreatePR:Ee,onCreateRepo:ke,onViewInGitHub:Ae,onQuickCommit:Me,onSyncWithDefault:Ne,onOpenChange:x,open:C,layout:w}=e,T=u===void 0?!1:u,Pe=w===void 0?`bar`:w,Fe=!!m&&!!a&&me>0,Ie=!p&&!_,Le=Pe===`bar`&&`w-8 rounded-l-none`,Re=Pe===`menu`&&`w-full justify-start gap-2 rounded-md`,Be=ce&&Pe===`bar`&&` border-transparent bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground`,E;t[0]!==Le||t[1]!==Re||t[2]!==Be?(E=ne(`h-8 px-1`,Le,Re,Be),t[0]=Le,t[1]=Re,t[2]=Be,t[3]=E):E=t[3];let Ve=_||T,D;t[4]===Pe?D=t[5]:(D=Pe===`menu`&&(0,S.jsx)(`span`,{children:`More git actions`}),t[4]=Pe,t[5]=D);let O;t[6]!==T||t[7]!==l?(O=T||l?(0,S.jsx)(n,{className:`h-3.5 w-3.5 animate-spin`}):(0,S.jsx)(ee,{className:`h-3.5 w-3.5`}),t[6]=T,t[7]=l,t[8]=O):O=t[8];let k;t[9]!==E||t[10]!==Ve||t[11]!==D||t[12]!==O?(k=(0,S.jsx)(Ce,{asChild:!0,children:(0,S.jsxs)(oe,{variant:`outline`,size:`sm`,className:E,disabled:Ve,children:[D,O]})}),t[9]=E,t[10]=Ve,t[11]=D,t[12]=O,t[13]=k):k=t[13];let A;t[14]!==i||t[15]!==a?(A=i===`Behind`&&(0,S.jsxs)(`div`,{className:ne(h.compact,`px-2 py-1 text-amber-600`),children:[`Branch is behind `,a?`origin`:`remote`]}),t[14]=i,t[15]=a,t[16]=A):A=t[16];let j;t[17]===he?j=t[18]:(j=he&&(0,S.jsxs)(`div`,{className:ne(h.compact,`px-2 py-1 text-muted-foreground`),children:[(0,S.jsx)(`span`,{className:`font-medium`,children:`User:`}),` `,he]}),t[17]=he,t[18]=j);let He;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,S.jsx)(De,{}),t[19]=He):He=t[19];let M;t[20]!==Ie||t[21]!==m||t[22]!==de||t[23]!==me||t[24]!==p||t[25]!==Ne||t[26]!==Fe?(M=Fe&&(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:()=>{Ie&&Ne()},className:Ie?``:`opacity-50 cursor-not-allowed`,children:[(0,S.jsx)(be,{className:`h-3.5 w-3.5 mr-2`}),`Sync with `,m,(0,S.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 pl-3 text-xs tabular-nums text-muted-foreground`,children:[de>0&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,S.jsx)(se,{className:`h-3 w-3`}),de]}),me>0&&(0,S.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,S.jsx)(f,{className:`h-3 w-3`}),me]})]})]})}),(0,S.jsx)(d,{side:`right`,children:p?`Commit or stash changes before syncing with the default branch`:`Pull latest changes from origin/${m} onto your current branch`})]})}),t[20]=Ie,t[21]=m,t[22]=de,t[23]=me,t[24]=p,t[25]=Ne,t[26]=Fe,t[27]=M):M=t[27];let N;t[28]!==ge||t[29]!==p||t[30]!==_||t[31]!==ve||t[32]!==Me?(N=p&&ge&&(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:Me,disabled:_||ve,children:[ve?(0,S.jsx)(n,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,S.jsx)(te,{className:`h-3.5 w-3.5 mr-2`}),`Quick Commit`,(0,S.jsx)(je,{children:`⌘⇧C`})]})}),(0,S.jsx)(d,{side:`right`,children:`Generate the commit message and commit`})]})}),t[28]=ge,t[29]=p,t[30]=_,t[31]=ve,t[32]=Me,t[33]=N):N=t[33];let P;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,S.jsx)(xe,{className:`h-3.5 w-3.5 mr-2`}),t[34]=P):P=t[34];let F;t[35]!==_||t[36]!==ye?(F=(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:ye,disabled:_,children:[P,`Fetch`]})}),t[35]=_,t[36]=ye,t[37]=F):F=t[37];let Ue;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,S.jsx)(d,{side:`right`,children:`Download latest information from remote without merging changes`}),t[38]=Ue):Ue=t[38];let I;t[39]===F?I=t[40]:(I=(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[F,Ue]})}),t[39]=F,t[40]=I);let L;t[41]!==o||t[42]!==_||t[43]!==v?(L=()=>{o&&!_&&v()},t[41]=o,t[42]=_,t[43]=v,t[44]=L):L=t[44];let We=!o||_?`opacity-50 cursor-not-allowed`:``,Ge;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,S.jsx)(f,{className:`h-3.5 w-3.5 mr-2`}),t[45]=Ge):Ge=t[45];let R;t[46]!==L||t[47]!==We?(R=(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:L,className:We,children:[Ge,`Pull`]})}),t[46]=L,t[47]=We,t[48]=R):R=t[48];let Ke=o?`Pull latest changes from remote`:`No remote branch to pull from`,z;t[49]===Ke?z=t[50]:(z=(0,S.jsx)(d,{side:`right`,children:Ke}),t[49]=Ke,t[50]=z);let B;t[51]!==R||t[52]!==z?(B=(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[R,z]})}),t[51]=R,t[52]=z,t[53]=B):B=t[53];let V;t[54]!==o||t[55]!==_||t[56]!==y?(V=!o&&(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:y,disabled:_,children:[(0,S.jsx)(ue,{className:`h-3.5 w-3.5 mr-2`}),`Push Branch to Remote`]})}),(0,S.jsx)(d,{side:`right`,children:`Create remote branch and push local commits`})]})}),t[54]=o,t[55]=_,t[56]=y,t[57]=V):V=t[57];let H;t[58]!==s||t[59]!==_||t[60]!==y?(H=()=>{s&&!_&&y()},t[58]=s,t[59]=_,t[60]=y,t[61]=H):H=t[61];let qe=!s||_?`opacity-50 cursor-not-allowed`:``,Je;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Je=(0,S.jsx)(ue,{className:`h-3.5 w-3.5 mr-2`}),t[62]=Je):Je=t[62];let U;t[63]!==H||t[64]!==qe?(U=(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(b,{onClick:H,className:qe,children:[Je,`Push Commits`]})}),t[63]=H,t[64]=qe,t[65]=U):U=t[65];let Ye=s?_?`Push in progress...`:`Push your uncommitted commits to the remote branch`:`No commits to push - your branch is up to date with remote`,W;t[66]===Ye?W=t[67]:(W=(0,S.jsx)(d,{side:`right`,children:Ye}),t[66]=Ye,t[67]=W);let G;t[68]!==U||t[69]!==W?(G=(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[U,W]})}),t[68]=U,t[69]=W,t[70]=G):G=t[70];let Xe=_||_e,Ze;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,S.jsx)(re,{className:`h-3.5 w-3.5 mr-2`}),t[71]=Ze):Ze=t[71];let K;t[72]!==Te||t[73]!==Xe?(K=(0,S.jsxs)(b,{onClick:Te,disabled:Xe,children:[Ze,`History`]}),t[72]=Te,t[73]=Xe,t[74]=K):K=t[74];let Qe;t[75]!==g||t[76]!==_||t[77]!==Ee?(Qe=!g&&(0,S.jsxs)(b,{onClick:Ee,disabled:_,children:[(0,S.jsx)(fe,{className:`h-3.5 w-3.5 mr-2`}),`Create Pull Request`,(0,S.jsx)(je,{children:`⌘⇧P`})]}),t[75]=g,t[76]=_,t[77]=Ee,t[78]=Qe):Qe=t[78];let q;t[79]!==c||t[80]!==_||t[81]!==ke?(q=c&&(0,S.jsxs)(b,{onClick:ke,disabled:_,children:[(0,S.jsx)(le,{className:`h-3.5 w-3.5 mr-2`}),`Create Repo`]}),t[79]=c,t[80]=_,t[81]=ke,t[82]=q):q=t[82];let J;t[83]!==_||t[84]!==Ae||t[85]!==ie?(J=ie&&(0,S.jsxs)(b,{onClick:Ae,disabled:_,children:[(0,S.jsx)(pe,{className:`h-3.5 w-3.5 mr-2`}),`View in GitHub`,(0,S.jsx)(je,{children:`⌘⇧G`})]}),t[83]=_,t[84]=Ae,t[85]=ie,t[86]=J):J=t[86];let Y;t[87]!==A||t[88]!==j||t[89]!==M||t[90]!==N||t[91]!==I||t[92]!==B||t[93]!==V||t[94]!==G||t[95]!==K||t[96]!==Qe||t[97]!==q||t[98]!==J?(Y=(0,S.jsxs)(we,{align:`end`,children:[A,j,He,M,N,I,B,V,G,K,Qe,q,J]}),t[87]=A,t[88]=j,t[89]=M,t[90]=N,t[91]=I,t[92]=B,t[93]=V,t[94]=G,t[95]=K,t[96]=Qe,t[97]=q,t[98]=J,t[99]=Y):Y=t[99];let X;return t[100]!==x||t[101]!==C||t[102]!==k||t[103]!==Y?(X=(0,S.jsxs)(Oe,{open:C,onOpenChange:x,children:[k,Y]}),t[100]=x,t[101]=C,t[102]=k,t[103]=Y,t[104]=X):X=t[104],X}function E(e){return e?!0:(y({title:`Error`,description:`No thread selected`,variant:`destructive`}),!1)}function Ve(e){let t=e.split(`/`);return t.length>=2?{provider:t[0],model:t.slice(1).join(`/`)}:{provider:void 0,model:e}}var D=c(`app.use-ai-generation.hook`);function O(e,t,n){let[r,i]=(0,x.useState)(!1),[a,o]=(0,x.useState)(!1),ee=()=>n?.id?n.provider?{provider:n.provider,model:n.id}:Ve(n.id):{provider:void 0,model:void 0};return{isGeneratingMessage:r,isGeneratingPRInfo:a,generateCommitMessageWithAI:(0,x.useCallback)(async()=>{if(!e)return null;try{i(!0);let{provider:t,model:n}=ee();return await _e(e,n,t)}catch(e){return D.error(`Failed to generate commit message:`,e),y({title:`Error`,description:e instanceof Error?e.message:`Failed to generate commit message`,variant:`destructive`}),null}finally{i(!1)}},[e,n]),generatePRInfoWithAI:(0,x.useCallback)(async()=>{if(!e)return null;try{o(!0);let{provider:t,model:n}=ee();return await m(e,n,t)}catch(e){return D.error(`Failed to generate PR info:`,e),y({title:`Error`,description:e instanceof Error?e.message:`Failed to generate PR info`,variant:`destructive`}),null}finally{o(!1)}},[e,n])}}var k=(0,x.lazy)(()=>v(()=>import(`./commit-dialog-VaKgg0v7.js`).then(e=>({default:e.CommitDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),A=(0,x.lazy)(()=>v(()=>import(`./pull-request-dialog-DPoyoAzR.js`).then(e=>({default:e.PullRequestDialog})),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),j=(0,x.lazy)(()=>v(()=>import(`./create-repo-dialog-CxeBrzuI.js`).then(e=>({default:e.CreateRepoDialog})),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11]))),He=(0,x.lazy)(()=>v(()=>import(`./git-history-dialog-BdFqU3-t.js`).then(e=>({default:e.GitHistoryDialog})),__vite__mapDeps([14,6,2]))),M=(0,x.lazy)(()=>v(()=>import(`./push-before-pr-dialog-CelqoZ3J.js`).then(e=>({default:e.PushBeforePRDialog})),__vite__mapDeps([15,6,2]))),N=(0,x.lazy)(()=>v(()=>import(`./pull-with-changes-dialog-BWeBUSvR.js`).then(e=>({default:e.PullWithChangesDialog})),__vite__mapDeps([16,5,2,6]))),P=c(`app.git-ops-button.ui`);function F(){return null}async function Ue(e,t,n,r){r&&(await s(e,{title:r}),n({type:Te.UpdateThreadTitle,projectId:t,threadId:e,title:r}))}function I({projectId:e,threadId:n,layout:ee=`bar`}){let te=ke(),re=Ae(e=>e.projectModelSelections[n]),s=Ae(t=>t.projects.find(t=>t.projectId===e)),[c,l]=(0,x.useState)(!1),[u,f]=(0,x.useState)(!1),[se,le]=(0,x.useState)(!1),[ue,m]=(0,x.useState)(!1),[fe,pe]=(0,x.useState)(``),[h,g]=(0,x.useState)(``),[_e,be]=(0,x.useState)(``),[xe,v]=(0,x.useState)(!1),[Ce,b]=(0,x.useState)(null),we=(0,x.useRef)(!1),De=(0,x.useRef)(!1),Oe=(0,x.useRef)(h),je=(0,x.useRef)(_e);Oe.current=h,je.current=_e;let[C,w]=(0,x.useState)(!1),[T,ze]=(0,x.useState)([]),[Ve,D]=(0,x.useState)(!1),[I,L]=(0,x.useState)([]),[We,Ge]=(0,x.useState)(!1),[R,Ke]=(0,x.useState)(!1),[z,B]=(0,x.useState)(``),[V,H]=(0,x.useState)(``),[qe,Je]=(0,x.useState)(``),[U,Ye]=(0,x.useState)(!1),[W,G]=(0,x.useState)(!1),[Xe,Ze]=(0,x.useState)(!1),[K,Qe]=(0,x.useState)(!1),q=(0,x.useRef)(!1),J=Ee(),{fetchUnifiedStatus:Y}=J,X=O(n,e,re),Z=(0,x.useRef)(null),$e=(0,x.useRef)(()=>{}),et=(0,x.useRef)(()=>{}),tt=(0,x.useRef)(()=>{}),nt=(0,x.useRef)(()=>{});(0,x.useEffect)(()=>()=>{Z.current!==null&&(clearInterval(Z.current),Z.current=null)},[]);async function Q(){ye();let e=await o();te({type:Te.SetProjects,projects:e.projects})}let[$,rt]=(0,x.useState)(()=>Me()),it=s?.commitMethod===a.Direct;(0,x.useEffect)(()=>{R&&s?.name&&!z&&B(s.name)},[R,s?.name,z]),(0,x.useEffect)(()=>{Ne($)},[$]);function at(){U||(Ye(!0),he().then(e=>Je(e)).catch(()=>{}))}function ot(e){Qe(e),e&&(at(),Y(!0))}(0,x.useEffect)(()=>{if(!se){De.current=!1;return}if(se&&$.autoGenerateCommitMessage&&!fe.trim()&&n&&!De.current){De.current=!0;async function e(){let e=await X.generateCommitMessageWithAI();e&&pe(e)}e()}},[se,$.autoGenerateCommitMessage,n,X.generateCommitMessageWithAI,fe]),(0,x.useEffect)(()=>{if(!ue){we.current=!1;return}if(ue&&$.autoGeneratePRInfo&&!Oe.current.trim()&&!je.current.trim()&&n&&!we.current){we.current=!0;async function e(){let e=await X.generatePRInfoWithAI();e&&(g(e.title),be(e.description),y({title:`Success`,description:`PR title and description generated`}))}e()}},[ue,$.autoGeneratePRInfo,n,X.generatePRInfoWithAI]),$e.current=dt,et.current=()=>m(!0),tt.current=Dt,nt.current=()=>{c||u||ot(!0)},(0,x.useEffect)(()=>{function e(e){let t=e.key.toLowerCase();if((e.metaKey||e.ctrlKey)&&e.shiftKey&&!e.altKey){if(t===`c`){J.hasChanges&&$.autoGenerateCommitMessage&&!c&&(e.preventDefault(),$e.current());return}if(t===`p`){J.commitsAheadOfDefault&&!J.prExists&&!J.hasChanges&&!c&&!it&&(e.preventDefault(),et.current());return}if(t===`g`){J.repoUrl&&!c&&(e.preventDefault(),tt.current());return}t===`b`&&!c&&!u&&(e.preventDefault(),nt.current())}}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[J.commitsAheadOfDefault,J.hasChanges,J.prExists,J.repoUrl,$.autoGenerateCommitMessage,c,u,it]),(0,x.useEffect)(()=>{u&&J.prExists&&J.prState===`OPEN`&&f(!1)},[J.prExists,J.prState,u]),(0,x.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>{f(!1)},15e3);return()=>clearTimeout(e)},[u]),(0,x.useEffect)(()=>{let e=J.prExists&&J.prState===`OPEN`&&!J.hasChanges&&!J.hasUnpushedCommits;e&&!q.current&&Q(),q.current=e},[J.hasChanges,J.hasUnpushedCommits,J.prExists,J.prState]);async function st(){if(fe.trim()&&E(n))try{l(!0),await ce(n,fe),pe(``),le(!1),await J.fetchUnifiedStatus(!0),Q(),y({title:`Changes committed successfully`,description:`Your changes have been committed to '${J.currentBranch}'.`}),Xe&&(Ze(!1),await ht())}catch(e){P.error(`Failed to commit:`,e),y({title:`Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{l(!1)}}async function ct(){if(!E(n))return;let e=J.prUrl;if(!e)try{e=(await ge(n)).url}catch(e){P.error(`Failed to fetch pull request URL:`,e),y({title:`Could not open pull request`,description:e instanceof Error?e.message:`Failed to fetch pull request URL`,variant:`destructive`});return}if(!e){y({title:`Could not open pull request`,description:`Pull request URL is unavailable. Try refreshing git status.`,variant:`destructive`});return}try{await _(e)}catch(e){P.error(`Failed to open pull request:`,e),y({title:`Could not open pull request`,description:e instanceof Error?e.message:`Failed to open URL in browser`,variant:`destructive`})}}async function lt(){if(J.hasChanges){le(!0);return}if(J.hasUnpushedCommits&&J.prExists){await pt();return}if(J.prExists&&J.prState===`OPEN`&&!J.hasChanges&&!J.hasUnpushedCommits){await ct();return}if(J.commitsAheadOfDefault&&!J.prExists&&!J.hasChanges){m(!0);return}if(J.defaultBranchBehind>0){await vt();return}}async function ut(){let e=await X.generateCommitMessageWithAI();e&&pe(e)}async function dt(){if(E(n))try{l(!0);let e=await X.generateCommitMessageWithAI();if(!e){y({title:`Quick Commit failed`,description:`Could not generate commit message`,variant:`destructive`});return}await ce(n,e),await J.fetchUnifiedStatus(!0),Q(),y({title:`Changes committed successfully`,description:`Committed: ${e}`})}catch(e){P.error(`Quick commit failed:`,e),y({title:`Quick Commit failed`,description:e instanceof Error?e.message:`Failed to commit changes`,variant:`destructive`})}finally{l(!1)}}async function ft(){if(E(n))try{l(!0),await ve(n),await J.fetchUnifiedStatus()}catch(e){P.error(`Failed to fetch:`,e)}finally{l(!1)}}async function pt(){if(E(n))try{l(!0),await p(n),await J.fetchUnifiedStatus(!0),Q(),J.hasRemoteBranch?y({title:`Branch pushed successfully`,description:`Your branch '${J.currentBranch}' has been pushed to the remote.`}):y({title:`Push completed`,description:`Changes have been pushed successfully.`})}catch(e){P.error(`Failed to push:`,e),y({title:`Push failed`,description:e instanceof Error?e.message:`Failed to push to remote`,variant:`destructive`})}finally{l(!1)}}async function mt(){if(E(n)){if(J.hasChanges){G(!0);return}await ht()}}async function ht(){try{l(!0),await de(n),await J.fetchUnifiedStatus(!0),Q(),y({title:`Pull successful`,description:`Latest changes have been pulled from remote.`})}catch(e){P.error(`Failed to pull:`,e),y({title:`Pull failed`,description:e instanceof Error?e.message:`Failed to pull from remote`,variant:`destructive`})}finally{l(!1)}}function gt(){G(!1),Ze(!0),le(!0)}async function _t(){G(!1),await ht()}async function vt(){if(E(n))try{l(!0),await t(n),await J.fetchUnifiedStatus(!0),Q(),y({title:`Branch synced successfully`,description:`Your branch '${J.currentBranch}' has been synced with the latest changes`})}catch(e){P.error(`[sync] ✗ Failed to sync branch:`,e),y({title:`Sync failed`,description:e instanceof Error?e.message:`Failed to sync with default branch`,variant:`destructive`})}finally{l(!1)}}async function yt(){if(E(n))try{l(!0),f(!0);let t=await ie(n,h,_e);await Ue(n,e,te,t.title??h),t.prUrl&&await _(t.prUrl),g(``),be(``),m(!1),await J.fetchUnifiedStatus(!0),Q();let r=0;Z.current!==null&&clearInterval(Z.current),Z.current=setInterval(async()=>{if(r++,r>=6){Z.current!==null&&(clearInterval(Z.current),Z.current=null);return}await J.fetchUnifiedStatus(!0)},2e3)}catch(e){P.error(`Failed to create PR:`,e);let t=e instanceof Error?e.message:`Failed to create PR`;t.includes(`push the current branch`)||t.includes(`--head flag`)?(m(!1),St({title:h,description:_e})):(f(!1),y({title:`Create PR Failed`,description:t,variant:`destructive`}))}finally{l(!1)}}async function bt(){if(E(n))try{l(!0);let e=await i(n,z,V,$.privateRepositoryDefault);e.repoUrl&&setTimeout(()=>{_(e.repoUrl)},3e3),B(``),H(``),Ke(!1),await J.fetchUnifiedStatus(),Q()}catch(e){P.error(`Failed to create repo:`,e)}finally{l(!1)}}async function xt(){let e=await X.generatePRInfoWithAI();e&&(g(e.title),be(e.description),y({title:`Success`,description:`PR title and description generated`}))}async function St(r){let i=r??Ce;if(!(!n||!i))try{l(!0),f(!0);try{await p(n)}catch(e){let r=e?.message??``;if(r.includes(`non-fast-forward`)||r.includes(`Updates were rejected because the tip of your current branch is behind`)){y({title:`Syncing branch before push`,description:`Your branch is behind remote. Pulling latest changes first...`});try{await t(n),await p(n)}catch{throw e}}else throw e}let r=await ie(n,i.title,i.description);await Ue(n,e,te,r.title??i.title),r.prUrl&&await _(r.prUrl),g(``),be(``),b(null),v(!1),await J.fetchUnifiedStatus(!0),Q();let a=0;Z.current!==null&&clearInterval(Z.current),Z.current=setInterval(async()=>{if(a++,a>=6){Z.current!==null&&(clearInterval(Z.current),Z.current=null);return}await J.fetchUnifiedStatus(!0)},2e3)}catch(e){P.error(`Failed to push and create PR:`,e);let t=e instanceof Error?e.message:`Failed to push and create PR`;f(!1),y({title:`Push & Create PR Failed`,description:t,variant:`destructive`})}finally{l(!1)}}async function Ct(){if(E(n))try{D(!0);let e=await me(n,100);ze(e),L(e.slice(0,10)),w(!0)}catch(e){P.error(`Failed to fetch git history:`,e)}finally{D(!1)}}function wt(){We||(Ge(!0),setTimeout(()=>{let e=I.length+10;L(T.slice(0,e)),Ge(!1)},300))}function Tt(e){let t=e.currentTarget;t.scrollHeight-t.scrollTop-t.clientHeight<100&&I.length<T.length&&!We&&wt()}let Et=Re(J);function Dt(){J.repoUrl&&_(J.repoUrl)}function Ot(){v(!1),b(null)}return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:ne(`flex items-center gap-0`,ee===`menu`&&`w-full flex-col gap-1 [&_button]:w-full [&_button]:justify-start`),children:[(0,S.jsx)(Se,{children:(0,S.jsxs)(ae,{children:[(0,S.jsx)(r,{asChild:!0,children:(0,S.jsxs)(oe,{variant:`outline`,size:`sm`,className:ne(`h-8 gap-1.5`,ee===`bar`&&`rounded-r-none border-r-0`,ee===`menu`&&`rounded-md border`,Et&&` border-transparent bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground`),disabled:Le(J,c,u),onClick:lt,children:[Fe(J,u,c),Pe(J,u)]})}),(0,S.jsx)(d,{children:Ie(J)})]})}),(0,S.jsx)(Be,{branchStatus:J.status,remoteUrl:J.remoteUrl,hasRemoteBranch:J.hasRemoteBranch,hasUnpushedCommits:J.hasUnpushedCommits,canCreateRepo:J.canCreateRepo,repoUrl:J.repoUrl,isRefreshing:J.isRefreshing,isCreatingPR:u,isBrandState:Et,hasChanges:J.hasChanges,defaultBranch:J.defaultBranch??null,defaultBranchAhead:J.defaultBranchAhead,defaultBranchBehind:J.defaultBranchBehind,gitUser:qe,isDirectCommitMode:it,autoGenerateCommitMessage:$.autoGenerateCommitMessage,isLoading:c,isLoadingHistory:Ve,isQuickCommitting:X.isGeneratingMessage&&c,onFetch:()=>void ft(),onPull:()=>void mt(),onPush:()=>void pt(),onOpenHistory:()=>void Ct(),onCreatePR:()=>m(!0),onCreateRepo:()=>Ke(!0),onViewInGitHub:Dt,onQuickCommit:()=>void dt(),onSyncWithDefault:()=>void vt(),open:K,onOpenChange:ot,layout:ee})]}),se&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(k,{open:se,onOpenChange:le,commitMessage:fe,onCommitMessageChange:pe,autoGenerateCommitMessage:$.autoGenerateCommitMessage,onAutoGenerateChange:e=>rt(t=>({...t,autoGenerateCommitMessage:e})),isGeneratingMessage:X.isGeneratingMessage,isLoading:c,onGenerateMessage:ut,onCommit:st,currentBranch:J.currentBranch})}),ue&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(A,{open:ue,onOpenChange:m,prTitle:h,onPrTitleChange:g,prDescription:_e,onPrDescriptionChange:be,isGeneratingPRInfo:X.isGeneratingPRInfo,isLoading:c,onGeneratePRInfo:xt,onCreatePR:yt,currentBranch:J.currentBranch,autoGeneratePRInfo:$.autoGeneratePRInfo,onAutoGeneratePRInfoChange:e=>rt(t=>({...t,autoGeneratePRInfo:e}))})}),xe&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(M,{open:xe,onOpenChange:v,isLoading:c,onPushAndCreatePR:St,onCancel:Ot})}),R&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(j,{open:R,onOpenChange:Ke,repoName:z,onRepoNameChange:B,repoDescription:V,onRepoDescriptionChange:H,isPrivateRepo:$.privateRepositoryDefault,onPrivateRepoChange:e=>rt(t=>({...t,privateRepositoryDefault:e})),isLoading:c,onCreateRepo:bt})}),C&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(He,{open:C,onOpenChange:w,commits:T,displayedCommits:I,isLoadingMore:We,onScroll:Tt,currentBranch:J.currentBranch})}),W&&(0,S.jsx)(x.Suspense,{fallback:(0,S.jsx)(F,{}),children:(0,S.jsx)(N,{open:W,onOpenChange:G,onCommitFirst:gt,onStashAndPull:_t,onCancel:()=>G(!1),isLoading:c})})]})}export{I as GitOpsButton};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{$i as n,Ai as r,Ba as i,Br as a,Di as o,Fi as s,Fo as c,Gr as l,Ii as u,Io as d,Ki as f,Ko as p,Kr as m,Lr as h,Mi as g,Mo as _,Ms as v,Ni as y,No as b,Ns as x,Oi as S,Pi as C,Po as w,Ps as T,Rr as E,Si as D,Ti as O,Ui as k,Ur as A,Vr as j,Wr as M,_ as ee,_i as te,ai as N,bi as ne,c as re,ci as P,di as F,ds as I,fi as ie,fs as L,gi as ae,hi as oe,ji as R,js as se,ki as ce,l as le,li as ue,mi as de,oi as fe,ot as pe,pi as me,qr as he,s as ge,si as _e,u as ve,ui as ye,wi as be,wo as xe,yi as Se,zr as Ce}from"./dialogs-config-sFb6rmoV.js";var z=v(),we=Object,Te=Map,Ee=Set,De=Ee.prototype.has,Oe=Ee.prototype.add,ke=Te.prototype.has,Ae=Te.prototype.get,je=Te.prototype.set,Me=1,Ne=2,Pe=4,Fe=8,Ie=16,Le=32,B=`__t`,Re=`__p`,ze=`__e`,Be=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ve=`http://www.w3.org/1999/xlink`,He=`http://www.w3.org/2000/xmlns/`,Ue=120,We=new Ee([`href`,`list`,`form`,`tabIndex`,`download`]),Ge=new Ee([`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`isindex`,`keygen`,`link`,`menuitem`,`meta`,`nextid`,`param`,`source`,`track`,`wbr`]);if(typeof window>`u`)throw Error(`See http://million.dev/docs/install to install the compiler.`);var V=document;V.createElement(`template`);var Ke=V.createElement(`template`),qe=Ke.content,Je=V.createElementNS(`http://www.w3.org/2000/svg`,`svg`),H=Node.prototype,Ye=Element.prototype,Xe=CharacterData.prototype,Ze=we.getOwnPropertyDescriptor,Qe=H.insertBefore,$e=H.cloneNode,et=H.replaceChild,tt=Ye.remove,nt=H.addEventListener,rt=Ye.removeAttribute,it=Ye.setAttribute,at=Ye.setAttributeNS,ot=Ze(H,`textContent`).set,st=Ze(H,`firstChild`).get,ct=Ze(H,`nextSibling`).get,lt=Ze(Xe,`data`).set,ut=(e,t)=>{let n=t?Je:Ke;return n.innerHTML=e,(t?Je:qe).firstChild};V[ze]=new Ee;var dt=(e,t,n)=>{let r=t.toLowerCase(),i=!1;r.endsWith(`capture`)&&(r=r.slice(0,-7),i=!0);let a=`$$${r}`;De.call(V[ze],r)||(nt.call(V,r,e=>{let t=e.target;for(;t;){let n=t[a];n&&(we.defineProperty(e,`currentTarget`,{configurable:!0,get(){return t}}),n(e)),t=t.parentNode}},{capture:i}),Oe.call(V[ze],r));let o=t=>{t?`key`in t&&t.key===e[a]?.key||(e[a]=t):e[a]=null};return o(n),o},U=(e,t)=>{let n=st.call(e);if(t)for(let e=0;e<t&&n;++e)n=ct.call(n);return n},ft=new WeakSet,pt=e=>{if(ft.has(e))return;e.nodeType===8&&e.parentNode?.removeChild(e);let t=st.call(e);for(;t;)pt(t),t=t.nextSibling;ft.add(e)},mt=(e,t,n)=>{let r=V.createTextNode(t),i=U(e,n);return Qe.call(e,r,i),r},ht=(e,t)=>{lt.call(e,t)},gt=(e,t,n)=>{typeof n!=`number`||Be.test(t)?e.style[t]=n:typeof n==`string`?e.style.cssText=n:t.startsWith(`-`)?e.style.setProperty(t,String(n)):n==null?e.style[t]=``:e.style[t]=`${String(n)}px`},_t=(e,t,n)=>{t=t.replace(/xlink(?:H|:h)/,`h`).replace(/sName$/,`s`),t.startsWith(`xmlns`)?at.call(e,He,t,String(n)):t.startsWith(`xlink`)&&at.call(e,Ve,`href`,String(n))},vt=(e,t,n)=>{let r=n==null;if(n=r?``:n,t in e&&e[t]!==void 0&&e[t]!==null&&!(e instanceof SVGElement)&&De.call(We,t))try{e[t]=n}catch{}else !r&&n!==``&&(n!==!1||t.includes(`-`))?it.call(e,t,String(n)):rt.call(e,t);let i=e instanceof HTMLInputElement,a=e instanceof HTMLSelectElement,o=e instanceof HTMLTextAreaElement;t===`value`&&(i||a||o)&&(it.call(e,t,String(n)),e.value=n)},yt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]);function bt(e){return yt.get(e)||e}var xt=Object.defineProperty,St=(e,t,n)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>(St(e,typeof t==`symbol`?t:t+``,n),n),Ct=class{constructor(){W(this,`r`),W(this,`e`),W(this,`l`),W(this,`g`),W(this,`_u`),W(this,`_t`),W(this,`d`),W(this,`k`),W(this,`c`)}},wt=(e,t=[],n=[])=>{if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`bigint`||e===!0)return String(e);if(e==null||e===!1)return``;if(typeof e==`object`&&`$`in e)return t.push({p:n,e:[{t:Me,n:null,v:null,h:e.$,i:0,l:null,p:null,b:null}],i:[]}),`<slot/>`;let r=``,i=``,a={p:n,e:[],i:[]};for(let t in e.props){let n=e.props[t];if(t===`key`||t===`ref`||t===`children`)continue;let i=bt(t);if(i&&(t=i),t===`className`&&(t=`class`),t.startsWith(`on`)){`$`in n?a.e.push({t:Pe,n:t.slice(2),v:null,h:n.$,i:null,l:null,p:null,b:null}):a.i.push({t:Pe,n:t.slice(2),v:null,h:null,i:null,l:n,p:null,b:null});continue}if(n){if(typeof n==`object`&&`$`in n){t===`style`?a.e.push({t:Fe,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null}):t.charCodeAt(0)===Ue?a.e.push({t:Ie,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null}):a.e.push({t:Ne,n:t,v:null,h:n.$,i:null,l:null,p:null,b:null});continue}if(t===`style`&&typeof n==`object`){let e=``;for(let t in n){if(typeof n[t]==`object`){a.e.push({t:Fe,n:t,v:null,h:n[t].$,i:null,l:null,p:null,b:null});continue}let r=``;for(let e=0,n=t.length;e<n;++e){let n=t.charCodeAt(e);n<97?r+=`-${String.fromCharCode(n+32)}`:r+=t[e]}e+=`${r}:${String(n[t])};`}r+=` style="${e}"`;continue}r+=` ${t}="${String(n)}"`}}if(De.call(Ge,e.type))return a.e.length&&t.push(a),`<${e.type}${r} />`;let o=!1;for(let r=0,s=e.props.children?.length||0,c=0;r<s;++r){let s=e.props.children?.[r];if(s==null||s===!1)continue;if(typeof s==`object`&&`$`in s){a.e.push({t:Me,n:null,v:null,h:s.$,i:r,l:null,p:null,b:null});continue}if(s instanceof Ct){a.i.push({t:Le,n:null,v:null,h:null,i:r,l:null,p:null,b:s});continue}if(typeof s==`string`||typeof s==`number`||typeof s==`bigint`){let e=typeof s==`number`||typeof s==`bigint`?String(s):s;if(o){a.i.push({t:Me,n:null,v:e,h:null,i:r,l:null,p:null,b:null});continue}o=!0,i+=e,c++;continue}o=!1;let l=n.slice();l.push(c++),i+=wt(s,t,l)}return(a.i.length||a.e.length)&&t.push(a),`<${e.type}${r}>${i}</${e.type}>`},Tt=Object.defineProperty,Et=(e,t,n)=>t in e?Tt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dt=(e,t,n)=>(Et(e,typeof t==`symbol`?t:t+``,n),n),Ot=e=>new kt(e),kt=class extends Ct{constructor(e){super(),Dt(this,`b`),this.b=e}v(){}p(e){let t=this.b,n=e.b,r=t.length,i=n.length,a=this.t();if(this===e||i===0&&r===0)return a;if(this.b=n,i===0)return Nt.call(this),a;if(r===0)return jt.call(e,a),a;let o=0,s=0,c=r-1,l=i-1,u=t[0],d=n[0],f=t[c],p=n[l],m;for(;o<=c&&s<=l;){if(!u){u=t[++o];continue}if(!f){f=t[--c];continue}let e=u.k,r=d.k;if(e===r){Vt.call(u,d),n[s]=u,u=t[++o],d=n[++s];continue}let i=f.k,h=p.k;if(i===h){Vt.call(f,p),n[l]=f,f=t[--c],p=n[--l];continue}if(e===h){Vt.call(u,p),n[l]=u;let e=n[l+1];Ht.call(u,e,e?.l||null),u=t[++o],p=n[--l];continue}if(i===r){Vt.call(f,d),n[s]=f;let e=t[o];Ht.call(f,e,e?.l||null),f=t[--c],d=n[++s];continue}if(!m){m=new Te;for(let e=o;e<=c;e++)je.call(m,t[e].k,e)}let g=m.get(r);if(g===void 0)Bt.call(d,a,u.l||null);else{let e=t[g];Ht.call(e,u,null),Vt.call(e,d),n[s]=e,t[g]=null}d=n[++s]}if(o<=c||s<=l)if(o>c){let e=n[l+1];for(let t=s;t<=l;++t)Bt.call(n[t],a,e?e.l:null)}else for(let e=o;e<=c;++e)Ut.call(t[e]);return a}m(e,t=null){if(this._t)return this._t;for(let n=0,r=this.b.length;n<r;++n){let r=this.b[n];Bt.call(r,e,t)}return this._t=e,e}x(){let e=this.t();if(e)ot.call(e,``);else for(let e=0,t=this.b.length;e<t;++e)Ut.call(this.b[e]);this.b=[]}u(){return!0}s(){return this.b.map(e=>e.s()).join(``)}t(){return this._t||=this.b[0].t(),this._t}},At=kt.prototype,jt=At.m,Mt=At.p,Nt=At.x,Pt=new Proxy({},{get(e,t){return{$:t}}}),Ft=(e,t,n,r)=>{let i=e(Pt),a=[],o=ut(wt(t?t(i):i,a),r);return pt(o),(e,t,r)=>new Lt(o,a,e,t??e?.key??null,r??n??null,null)},It=(e,t)=>{if((`b`in e||`b`in t)&&Mt.call(e,t),e.l||Bt.call(e,void 0,null,null),e.k&&e.k===t.k||e.r===t.r)return Vt.call(e,t);let n=Bt.call(t,e.t(),e.l,null);return Ut.call(e),e.k=t.k,n},Lt=class extends Ct{constructor(e,t,n,r,i,a){super(),this.r=e,this.d=n,this.e=t,this.k=r,this.c=Array(t.length),i?this._u=i:this._u=null,a?this.g=a:this.g=null}m(e,t=null,n){if(this.l)return this.l;let r=n??$e.call(this.r,!0),i=this.g?.(r);i&&(this.c=i);for(let e=0,t=this.e.length;e<t;++e){let t=this.e[e],a=i?.[e]??Rt(t.p,r,this.c,e);for(let e=0,r=t.e.length;e<r;++e){let i=t.e[e],o=this.d[i.h];if(i.t&Me){if(o instanceof Ct){let e=U(a,i.i);n?o.m(a,e,e):o.m(a,e);continue}if(a[B]||(a[B]=Array(r)),o&&typeof o==`object`&&`foreign`in o){if(n){let e=U(a,i.i);o.reset(e)}let t=o.current;a[B][e]=t,n||Qe.call(a,t,U(a,i.i));continue}if(n){a[B][e]=U(a,i.i);continue}a[B][e]=mt(a,o==null||o===!1?``:String(o),i.i)}else if(i.t&Pe){let e=dt(a,i.n,o);a[Re+i.n]=e}else if(i.t&Ne)vt(a,i.n,o);else if(i.t&Fe)if(typeof o==`string`||typeof o==`number`)gt(a,i.n,o);else for(let e in o)gt(a,e,o[e]);else _t(a,i.n,o)}let o=t.i?.length;if(o)for(let e=0;e<o;++e){let r=t.i[e];if(r.t&Me)r.v&&!n&&mt(a,r.v,r.i);else if(r.t&Pe)dt(a,r.n,r.l);else{let e=U(a,r.i);n?r.b.m(a,e,e):r.b.m(a,e)}}}return e&&!n&&Qe.call(e,r,t),this.l=r,r}p(e){let t=this.l;if(!e.d)return t;let n=this.d;if(!Wt.call(this,n,e.d))return t;this.d=e.d;for(let r=0,i=this.e.length;r<i;++r){let i=this.e[r],a=this.c[r]??Rt(i.p,t,this.c,r);for(let t=0,o=i.e.length;t<o;++t){let o=i.e[t],s=n[o.h],c=e.d[o.h];if(c!==s){if(o.t&Pe){a[Re+o.n](c);continue}if(o.t&Me){if(s instanceof Ct){let n=e.e?.[r]?.e[t],i=e.d[n.h];s.p(i);continue}if(c&&typeof c==`object`&&`foreign`in c){let e=a[B][t];if(c.unstable&&s!==c){let n=c.current;a[B][t]=n,et.call(a,n,e)}else c.current=e;continue}ht(a[B][t],c==null||c===!1?``:String(c))}else if(o.t&Ne)vt(a,o.n,c);else if(o.t&Fe)if(typeof c==`string`||typeof c==`number`)gt(a,o.n,c);else for(let e in c)c[e]!==s[e]&>(a,e,c[e]);else _t(a,o.n,c)}}}return t}v(e=null,t=null){Qe.call(this.t(),this.l,e?e.l:t)}x(){tt.call(this.l),this.l=null}u(e,t){return this._u?this._u(e,t):!0}s(){return String(this.l?.outerHTML)}t(){return this._t||=this.l?.parentElement,this._t}},Rt=(e,t,n,r)=>{let i=e.length;if(!i)return t;let a=n&&r!==void 0;if(a&&n[r])return n[r];for(let n=0;n<i;++n){let r=e[n];t=U(t,r)}return a&&(n[r]=t),t},zt=Lt.prototype,Bt=zt.m,Vt=zt.p,Ht=zt.v,Ut=zt.x,Wt=zt.u,G=e(T(),1),Gt={noSlot:!1},Kt=e(x(),1),qt=`slot`,Jt=({effect:e,deps:t})=>((0,G.useEffect)(e,t||[]),null),K=new Map,Yt=(0,G.createContext)(!1),Xt=(e,t,n)=>{let r={ref:t},i=0;for(let t in e){let a=e[t];if((0,G.isValidElement)(a)||Array.isArray(a)&&a.length&&(0,G.isValidElement)(a[0])){r[t]=Qt(a,!1,n,i++);continue}r[t]=e[t]}return r},Zt=(e,t)=>(0,G.createElement)(qt,{suppressHydrationWarning:!0,id:t},e),Qt=(e,t,n,r,i)=>{let a=n?.[r]?.current,o=(0,G.isValidElement)(e)&&typeof e.type==`function`&&`_c`in e.type,s=o&&e.type._c;if(typeof window>`u`)return o?s?e:Zt(Zt(e),i):Zt(e,i);if(s){let t=e.type(e.props);if(K.has(t.type)){let e=K.get(t.type);if(typeof e==`function`)return e(t.props)}}let c=a??(i?document.getElementById(i):null)??document.createElement(`slot`),l={foreign:!0,current:c,portal:(0,Kt.createPortal)((0,G.createElement)(G.Fragment,{children:e}),c,i),reset:e=>{e.childNodes.forEach(t=>e.removeChild(t))},unstable:t};return n&&(n[r]=l),l},$t=e=>{if(typeof e!=`object`||!e||!(`type`in e))return typeof e==`number`?String(e):e;let t=e.type;if(typeof t==`function`)return $t(t(e.props??{}));if(typeof t==`object`&&`$`in t)return t;let n={...e.props};return`css`in n&&`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`in n&&(n.style=n.css.styles,t=n.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete n.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete n.css),e.props?.children!=null&&(n.children=en(e.props.children).map(e=>$t(e))),{type:t,props:n}},en=e=>{if(e==null)return[];if(typeof e==`object`&&`type`in e&&e.type===G.Fragment)return en(e.props.children);if(!Array.isArray(e)||typeof e==`object`&&`$`in e)return[e];let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;++e)n.push(...en(t[e]));return n},tn=typeof window>`u`?G.useEffect:G.useLayoutEffect;function nn(e,t,n){if(!e||t(e))return e;let r=n?e.return:e.child;for(;r;){let e=nn(r,t,n);if(e)return e;r=n?null:r.sibling}}function rn(){let e=(0,G.useRef)();return(0,G.useState)(()=>{let t=Function.prototype.bind;Function.prototype.bind=function(n,r){return n===null&&typeof r?.type==`function`&&(e.current=r,Function.prototype.bind=t),t.apply(this,arguments)}}),e.current}function an(e){let t=rn(),n=(0,G.useRef)({el:null,depth:0});return tn(()=>{n.current.el=nn(t,t=>(n.current.depth++,typeof t.type==`string`&&(e===void 0||t.type===e)),!0)?.stateNode},[t]),n}function on(){let e=rn(),t=(0,G.useRef)({el:null,depth:0});return tn(()=>{t.current.el=nn(e,e=>(t.current.depth++,e.stateNode?.containerInfo!=null),!0)?.stateNode.containerInfo},[e]),t}var sn=(e,t={})=>{let n=t?.experimental_noSlot??Gt.noSlot,r=t?.block,i=t?.svg?`g`:qt;e&&(r=Ft(e,$t,t?.shouldUpdate,t?.svg));let a=(e,a)=>{let o=on(),s=an(),c=e._hmr,l=(0,G.useRef)(null),u=(0,G.useRef)(null),d=(0,G.useRef)([]);e=Xt(e,a,d.current),u.current?.(e);let f=(0,G.useCallback)(()=>{if(!l.current&&!n)return;let i=r(e,e.key);return c&&l.current?.textContent&&(l.current.textContent=``),n&&(l.current=s.current?.el??o.current?.el,(e.scoped||s.current&&o.current&&s.current.depth>o.current.depth)&&(l.current=o.current.el),l.current.childNodes.length&&console.error(Error(`\`experimental_options.noSlot\` does not support having siblings at the moment.
|
|
2
|
+
The block element should be the only child of the \`${$e.call(l.current).outerHTML}\` element.
|
|
3
|
+
To avoid this error, \`experimental_options.noSlot\` should be false`))),(u.current===null||c)&&(Bt.call(i,l.current,null),u.current=e=>{It(i,r(e,e.key,t?.shouldUpdate))}),()=>{Ut.call(i)}},[]),p=(0,G.useMemo)(()=>n?null:(0,G.createElement)(t?.as??i,{ref:l}),[]),m=d.current.length,h=Array(m);for(let e=0;e<m;++e)h[e]=d.current[e]?.portal;return(0,G.createElement)(G.Fragment,{},p,(0,G.createElement)(Jt,{effect:f,deps:c?[c]:[]}),h)};return ke.call(K,a)||je.call(K,a,sn),t?.name&&(e&&(e.displayName=`Million(Render(${t.name}))`),a.displayName=`Million(Block(${t.name}))`),a};(0,G.memo)(({each:e,children:t,memo:n,svg:r,as:i,...a})=>{let o=(0,G.useRef)(null),[s]=(0,G.useState)(()=>({current:Array(e.length)})),c=(0,G.useRef)(null),l=(0,G.useRef)({each:null,children:null,mounted:!1}),[,u]=(0,G.useState)(!1);if(c.current&&(e!==l.current.each||!n)){let r=cn(e,t,l,s,n);Mt.call(c.current,Ot(r))}let d=(0,G.createElement)(G.Fragment,null,(0,G.createElement)(i??(r?`g`:`slot`),{...a,ref:o}),...s.current.map(e=>e.portal));return(0,G.useEffect)(()=>{!o.current||c.current||l.current.mounted||(c.current=Ot(cn(e,t,l,s,n)),ke.call(K,d)||je.call(K,d,c.current),jt.call(c.current,o.current),l.current.mounted=!0,u(!0))},[o.current]),d});var cn=(e,t,n,r,i)=>{let a=Array(e.length),o=n.current;for(let n=0,s=e.length;n<s;++n){if(i&&o.each&&o.each[n]===e[n]){a[n]=o.children?.[n];continue}let s=t(e[n],n);if(ke.call(K,s.type)){o.block||=Ae.call(K,s.type),a[n]=o.block(s.props,r,n);continue}if(typeof s.type==`function`&&`_c`in s.type){let e=s.type(s.props);if(ke.call(K,e.type)){let t=Ae.call(K,e.type);if(typeof t==`function`){a[n]=t(e.props);continue}}}let c=Ft(e=>e?.scope),l=(e,t,n)=>c({scope:Qt((0,G.createElement)(s.type,e),!1,t.current,n)},s.key?String(s.key):void 0);je.call(K,s.type,l),o.block=l,a[n]=l(s.props,r,n)}return o.each=e,o.children=a,a};function ln(e,t){return e===t||e!==e&&t!==t}function un(e,t){for(let n in e)if(!ln(e[n],t[n]))return!0;return!1}function dn(e,{portals:t,...n}){let r=`CompiledBlock(Inner(${n.name}))`,i=sn(t=>e(t),{...n,scoped:void 0,name:r,shouldUpdate:un}),a=t?.length||0,o=t&&a>0?e=>{let n=(0,G.useContext)(Yt),[r]=(0,G.useState)(()=>[]),o={...e,scoped:n};for(let e=0;e<a;e++){let n=t[e];o[n]=Qt(o[n],!1,r,e)}let s=[];for(let e=0,t=r.length;e<t;e++)s[e]=r[e].portal;return(0,G.createElement)(G.Fragment,null,(0,G.createElement)(i,o),s)}:e=>(0,G.createElement)(i,e);return n.name&&(o.displayName=`Million(CompiledBlock(Outer(${n.name})))`),o}typeof window<`u`&&(window.__MILLION_DATA__={version:`3.1.11`});var q=se(),fn=`AlertDialog`,[pn,mn]=g(fn,[de]),J=de(),hn=e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,q.jsx)(ye,{...r,...n,modal:!0})};hn.displayName=fn;var gn=`AlertDialogTrigger`,_n=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(ie,{...i,...r,ref:t})});_n.displayName=gn;var vn=`AlertDialogPortal`,yn=e=>{let{__scopeAlertDialog:t,...n}=e,r=J(t);return(0,q.jsx)(ue,{...r,...n})};yn.displayName=vn;var bn=`AlertDialogOverlay`,xn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(P,{...i,...r,ref:t})});xn.displayName=bn;var Sn=`AlertDialogContent`,[Cn,wn]=pn(Sn),Tn=S(`AlertDialogContent`),En=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=J(n),o=G.useRef(null),s=k(t,o),c=G.useRef(null);return(0,q.jsx)(me,{contentName:Sn,titleName:Dn,docsSlug:`alert-dialog`,children:(0,q.jsx)(Cn,{scope:n,cancelRef:c,children:(0,q.jsxs)(fe,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:y(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,q.jsx)(Tn,{children:r}),(0,q.jsx)(Fn,{contentRef:o})]})})})});En.displayName=Sn;var Dn=`AlertDialogTitle`,On=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(F,{...i,...r,ref:t})});On.displayName=Dn;var kn=`AlertDialogDescription`,An=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(_e,{...i,...r,ref:t})});An.displayName=kn;var jn=`AlertDialogAction`,Mn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=J(n);return(0,q.jsx)(N,{...i,...r,ref:t})});Mn.displayName=jn;var Nn=`AlertDialogCancel`,Pn=G.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=wn(Nn,n),a=J(n),o=k(t,i);return(0,q.jsx)(N,{...a,...r,ref:o})});Pn.displayName=Nn;var Fn=({contentRef:e})=>{let t=`\`${Sn}\` requires a description for the component to be accessible for screen reader users.
|
|
4
|
+
|
|
5
|
+
You can add a description to the \`${Sn}\` by passing a \`${kn}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
6
|
+
|
|
7
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Sn}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
8
|
+
|
|
9
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return G.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},In=hn,Ln=yn,Rn=xn,zn=En,Bn=Mn,Vn=Pn,Hn=On,Un=An,Wn=In,Gn=Ln,Kn=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Rn,{className:a,...i,ref:t}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Kn.displayName=Rn.displayName;var qn=G.forwardRef((e,t)=>{let n=(0,z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(Kn,{}),n[3]=a):a=n[3];let o;n[4]===r?o=n[5]:(o=u(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==t||n[8]!==o?(s=(0,q.jsxs)(Gn,{children:[a,(0,q.jsx)(zn,{ref:t,className:o,...i})]}),n[6]=i,n[7]=t,n[8]=o,n[9]=s):s=n[9],s});qn.displayName=zn.displayName;var Jn=e=>{let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col space-y-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Jn.displayName=`AlertDialogHeader`;var Yn=e=>{let t=(0,z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,q.jsx)(`div`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};Yn.displayName=`AlertDialogFooter`;var Xn=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.dialogTitle,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Hn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Xn.displayName=Hn.displayName;var Zn=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.dialogDescription,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Un,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Zn.displayName=Un.displayName;var Qn=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(s(),r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Bn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Qn.displayName=Bn.displayName;var $n=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(s({variant:`outline`}),`mt-2 sm:mt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Vn,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});$n.displayName=Vn.displayName;var er=dn(e=>(0,q.jsxs)(`div`,{className:e.v0,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{className:e.v1,children:e.v2}),e.v3]}),e.v4]}),{name:`PageHeader_1`,portals:[`v2`,`v3`,`v4`]}),tr=function(e){let t=(0,z.c)(12),{title:n,description:r,action:i,className:a,titleClassName:o}=e,s;t[0]===a?s=t[1]:(s=u(`flex items-center justify-between mb-6`,a),t[0]=a,t[1]=s);let c;t[2]===o?c=t[3]:(c=u(L.pageTitle,o),t[2]=o,t[3]=c);let l;t[4]===r?l=t[5]:(l=r?(0,q.jsx)(`p`,{className:L.pageSubtitle,children:r}):null,t[4]=r,t[5]=l);let d;return t[6]!==i||t[7]!==s||t[8]!==c||t[9]!==l||t[10]!==n?(d=(0,q.jsx)(er,{v0:s,v1:c,v2:n,v3:l,v4:i}),t[6]=i,t[7]=s,t[8]=c,t[9]=l,t[10]=n,t[11]=d):d=t[11],d};function nr(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(I.settingsPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function rr(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(I.accountPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ir(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(I.formPage,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ar(e){let t=(0,z.c)(5),{title:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(L.sectionTitle,`mb-3`,r),t[0]=r,t[1]=i);let a;return t[2]!==i||t[3]!==n?(a=(0,q.jsx)(`h2`,{className:i,children:n}),t[2]=i,t[3]=n,t[4]=a):a=t[4],a}function or(e){let t=(0,z.c)(6),{children:n,variant:r,className:i}=e,a=r===void 0?`info`:r,o;t[0]!==i||t[1]!==a?(o=u(a===`hint`?L.hintBanner:a===`success`?u(L.body,`text-green-700 bg-green-50 dark:text-green-400 dark:bg-green-950/30 rounded-md px-3 py-2 mb-4`):a===`error`?u(L.error,`bg-destructive/10 rounded-md px-3 py-2 mb-4`):L.infoBanner,i),t[0]=i,t[1]=a,t[2]=o):o=t[2];let s;return t[3]!==n||t[4]!==o?(s=(0,q.jsx)(`div`,{className:o,children:n}),t[3]=n,t[4]=o,t[5]=s):s=t[5],s}function sr(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(`flex-1 overflow-auto`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function cr(e){let t=(0,z.c)(10),{children:n,title:r,action:i}=e,a;t[0]===r?a=t[1]:(a=r?(0,q.jsx)(`h2`,{className:u(L.emptyStateTitle,`mb-2`),children:r}):null,t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,q.jsx)(`p`,{className:L.bodyMuted,children:n}),t[2]=n,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,q.jsx)(`div`,{className:`mt-4`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,q.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,q.jsxs)(`div`,{className:`text-center`,children:[a,o,s]})}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function lr(e){let t=(0,z.c)(5),{children:n,className:r}=e,i;t[0]===r?i=t[1]:(i=u(`h-full flex flex-col overflow-hidden`,r),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,q.jsx)(`div`,{className:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ur(e){let t=(0,z.c)(14),{title:n,description:r,action:i,children:a,className:o}=e,s;t[0]===n?s=t[1]:(s=(0,q.jsx)(ar,{title:n,className:`mb-1`}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=r?(0,q.jsx)(`p`,{className:L.bodyMuted,children:r}):null,t[2]=r,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]!==i||t[8]!==l?(u=(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-3`,children:[l,i]}),t[7]=i,t[8]=l,t[9]=u):u=t[9];let d;return t[10]!==a||t[11]!==o||t[12]!==u?(d=(0,q.jsxs)(`div`,{className:o,children:[u,a]}),t[10]=a,t[11]=o,t[12]=u,t[13]=d):d=t[13],d}function dr(e){let t=G.useRef({value:e,previous:e});return G.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fr=[` `,`Enter`,`ArrowUp`,`ArrowDown`],pr=[` `,`Enter`],mr=`Select`,[hr,gr,_r]=ge(mr),[vr,yr]=g(mr,[_r,he]),br=he(),[xr,Y]=vr(mr),[Sr,Cr]=vr(mr),wr=e=>{let{__scopeSelect:t,children:n,open:i,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:g}=e,_=br(t),[v,y]=G.useState(null),[b,x]=G.useState(null),[S,C]=G.useState(!1),w=ve(u),[T,E]=ce({prop:i,defaultProp:a??!1,onChange:o,caller:mr}),[D,O]=ce({prop:s,defaultProp:c,onChange:l,caller:mr}),k=G.useRef(null),A=v?g||!!v.closest(`form`):!0,[j,M]=G.useState(new Set),ee=Array.from(j).map(e=>e.props.value).join(`;`);return(0,q.jsx)(m,{..._,children:(0,q.jsxs)(xr,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:r(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:p,children:[(0,q.jsx)(hr.Provider,{scope:t,children:(0,q.jsx)(Sr,{scope:e.__scopeSelect,onNativeOptionAdd:G.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:G.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,q.jsxs)(_i,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:e=>O(e.target.value),disabled:p,form:g,children:[D===void 0?(0,q.jsx)(`option`,{value:``}):null,Array.from(j)]},ee):null]})})};wr.displayName=mr;var Tr=`SelectTrigger`,Er=G.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=br(n),o=Y(Tr,n),s=o.disabled||r,c=k(t,o.onTriggerChange),l=gr(n),u=G.useRef(`touch`),[d,f,p]=yi(e=>{let t=l().filter(e=>!e.disabled),n=bi(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,q.jsx)(A,{asChild:!0,...a,children:(0,q.jsx)(O.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":vi(o.value)?``:void 0,...i,ref:c,onClick:y(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:y(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:y(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&fr.includes(e.key)&&(m(),e.preventDefault())})})})});Er.displayName=Tr;var Dr=`SelectValue`,Or=G.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Y(Dr,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=k(t,c.onValueNodeChange);return R(()=>{l(u)},[l,u]),(0,q.jsx)(O.span,{...s,ref:d,style:{pointerEvents:`none`},children:vi(c.value)?(0,q.jsx)(q.Fragment,{children:o}):a})});Or.displayName=Dr;var kr=`SelectIcon`,Ar=G.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,q.jsx)(O.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Ar.displayName=kr;var jr=`SelectPortal`,Mr=e=>(0,q.jsx)(Se,{asChild:!0,...e});Mr.displayName=jr;var Nr=`SelectContent`,Pr=G.forwardRef((e,t)=>{let n=Y(Nr,e.__scopeSelect),[r,i]=G.useState();if(R(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Kt.createPortal((0,q.jsx)(Fr,{scope:e.__scopeSelect,children:(0,q.jsx)(hr.Slot,{scope:e.__scopeSelect,children:(0,q.jsx)(`div`,{children:e.children})})}),t):null}return(0,q.jsx)(Rr,{...e,ref:t})});Pr.displayName=Nr;var X=10,[Fr,Z]=vr(Nr),Ir=`SelectContentImpl`,Lr=o(`SelectContent.RemoveScroll`),Rr=G.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=Y(Nr,n),[b,x]=G.useState(null),[S,C]=G.useState(null),w=k(t,e=>x(e)),[T,E]=G.useState(null),[O,A]=G.useState(null),j=gr(n),[M,ee]=G.useState(!1),N=G.useRef(!1);G.useEffect(()=>{if(b)return oe(b)},[b]),te();let re=G.useCallback(e=>{let[t,...n]=j().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&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,S]),P=G.useCallback(()=>re([T,b]),[re,T,b]);G.useEffect(()=>{M&&P()},[M,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=v;G.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():b.contains(n.target)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null};return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,F,I]),G.useEffect(()=>{let e=()=>F(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[ie,L]=yi(e=>{let t=j().filter(e=>!e.disabled),n=bi(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),R=G.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&(E(e),r&&(N.current=!0))},[v.value]),se=G.useCallback(()=>b?.focus(),[b]),ce=G.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&A(e)},[v.value]),le=r===`popper`?Hr:Br,ue=le===Hr?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,q.jsx)(Fr,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:R,selectedItem:T,onItemLeave:se,itemTextRefCallback:ce,focusSelectedItem:P,selectedItemText:O,position:r,isPositioned:M,searchRef:ie,children:(0,q.jsx)(ae,{as:Lr,allowPinchZoom:!0,children:(0,q.jsx)(ne,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:y(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,q.jsx)(D,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,q.jsx)(le,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ue,onPlaced:()=>ee(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:y(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&L(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().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(()=>re(t)),e.preventDefault()}})})})})})})});Rr.displayName=Ir;var zr=`SelectItemAlignedPosition`,Br=G.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Y(Nr,n),o=Z(Nr,n),[s,c]=G.useState(null),[l,u]=G.useState(null),d=k(t,e=>u(e)),f=gr(n),p=G.useRef(!1),m=G.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=G.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=le(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-X,d=le(a,[X,Math.max(X,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-X*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-X,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${X}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);R(()=>y(),[y]);let[b,x]=G.useState();return R(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,q.jsx)(Ur,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:G.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,q.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,q.jsx)(O.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Br.displayName=zr;var Vr=`SelectPopperPosition`,Hr=G.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=X,...a}=e,o=br(n);return(0,q.jsx)(l,{...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)`}})});Hr.displayName=Vr;var[Ur,Wr]=vr(Nr,{}),Gr=`SelectViewport`,Kr=G.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=Z(Gr,n),o=Wr(Gr,n),s=k(t,a.onViewportChange),c=G.useRef(0);return(0,q.jsxs)(q.Fragment,{children:[(0,q.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,q.jsx)(hr.Slot,{scope:n,children:(0,q.jsx)(O.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:y(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-X*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`)}}}c.current=t.scrollTop})})})]})});Kr.displayName=Gr;var qr=`SelectGroup`,[Jr,Yr]=vr(qr),Xr=G.forwardRef((e,t)=>{let{__scopeSelect:n,...i}=e,a=r();return(0,q.jsx)(Jr,{scope:n,id:a,children:(0,q.jsx)(O.div,{role:`group`,"aria-labelledby":a,...i,ref:t})})});Xr.displayName=qr;var Zr=`SelectLabel`,Qr=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Yr(Zr,n);return(0,q.jsx)(O.div,{id:i.id,...r,ref:t})});Qr.displayName=Zr;var $r=`SelectItem`,[ei,ti]=vr($r),ni=G.forwardRef((e,t)=>{let{__scopeSelect:n,value:i,disabled:a=!1,textValue:o,...s}=e,c=Y($r,n),l=Z($r,n),u=c.value===i,[d,f]=G.useState(o??``),[p,m]=G.useState(!1),h=k(t,e=>l.itemRefCallback?.(e,i,a)),g=r(),_=G.useRef(`touch`),v=()=>{a||(c.onValueChange(i),c.onOpenChange(!1))};if(i===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,q.jsx)(ei,{scope:n,value:i,disabled:a,textId:g,isSelected:u,onItemTextChange:G.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,q.jsx)(hr.ItemSlot,{scope:n,value:i,disabled:a,textValue:d,children:(0,q.jsx)(O.div,{role:`option`,"aria-labelledby":g,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...s,ref:h,onFocus:y(s.onFocus,()=>m(!0)),onBlur:y(s.onBlur,()=>m(!1)),onClick:y(s.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:y(s.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:y(s.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:y(s.onPointerMove,e=>{_.current=e.pointerType,a?l.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:y(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:y(s.onKeyDown,e=>{l.searchRef?.current!==``&&e.key===` `||(pr.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});ni.displayName=$r;var ri=`SelectItemText`,ii=G.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Y(ri,n),s=Z(ri,n),c=ti(ri,n),l=Cr(ri,n),[u,d]=G.useState(null),f=k(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=G.useMemo(()=>(0,q.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return R(()=>(h(m),()=>g(m)),[h,g,m]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(O.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Kt.createPortal(a.children,o.valueNode):null]})});ii.displayName=ri;var ai=`SelectItemIndicator`,oi=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return ti(ai,n).isSelected?(0,q.jsx)(O.span,{"aria-hidden":!0,...r,ref:t}):null});oi.displayName=ai;var si=`SelectScrollUpButton`,ci=G.forwardRef((e,t)=>{let n=Z(si,e.__scopeSelect),r=Wr(si,e.__scopeSelect),[i,a]=G.useState(!1),o=k(t,r.onScrollButtonChange);return R(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(di,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});ci.displayName=si;var li=`SelectScrollDownButton`,ui=G.forwardRef((e,t)=>{let n=Z(li,e.__scopeSelect),r=Wr(li,e.__scopeSelect),[i,a]=G.useState(!1),o=k(t,r.onScrollButtonChange);return R(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,q.jsx)(di,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ui.displayName=li;var di=G.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Z(`SelectScrollButton`,n),o=G.useRef(null),s=gr(n),c=G.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return G.useEffect(()=>()=>c(),[c]),R(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,q.jsx)(O.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:y(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:y(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:y(i.onPointerLeave,()=>{c()})})}),fi=`SelectSeparator`,pi=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,q.jsx)(O.div,{"aria-hidden":!0,...r,ref:t})});pi.displayName=fi;var mi=`SelectArrow`,hi=G.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=br(n),a=Y(mi,n),o=Z(mi,n);return a.open&&o.position===`popper`?(0,q.jsx)(M,{...i,...r,ref:t}):null});hi.displayName=mi;var gi=`SelectBubbleInput`,_i=G.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=G.useRef(null),a=k(r,i),o=dr(t);return G.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,q.jsx)(O.select,{...n,style:{...j,...n.style},ref:a,defaultValue:t})});_i.displayName=gi;function vi(e){return e===``||e===void 0}function yi(e){let t=be(e),n=G.useRef(``),r=G.useRef(0),i=G.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=G.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return G.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function bi(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=xi(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 xi(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Si=wr,Ci=Er,wi=Or,Ti=Ar,Ei=Mr,Di=Pr,Oi=Kr,ki=Qr,Ai=ni,ji=ii,Mi=oi,Ni=ci,Pi=ui,Fi=pi,Ii=Si,Li=wi,Ri=G.forwardRef((e,t)=>{let n=(0,z.c)(12),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=u(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(Ti,{asChild:!0,children:(0,q.jsx)(c,{className:`h-4 w-4 opacity-50`})}),n[6]=s):s=n[6];let l;return n[7]!==r||n[8]!==a||n[9]!==t||n[10]!==o?(l=(0,q.jsxs)(Ci,{ref:t,className:o,...a,children:[r,s]}),n[7]=r,n[8]=a,n[9]=t,n[10]=o,n[11]=l):l=n[11],l});Ri.displayName=Ci.displayName;var zi=G.forwardRef((e,t)=>{let n=(0,z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(_,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,q.jsx)(Ni,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});zi.displayName=Ni.displayName;var Bi=G.forwardRef((e,t)=>{let n=(0,z.c)(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`flex cursor-default items-center justify-center py-1`,r),n[3]=r,n[4]=a);let o;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(c,{className:`h-4 w-4`}),n[5]=o):o=n[5];let s;return n[6]!==i||n[7]!==t||n[8]!==a?(s=(0,q.jsx)(Pi,{ref:t,className:a,...i,children:o}),n[6]=i,n[7]=t,n[8]=a,n[9]=s):s=n[9],s});Bi.displayName=Pi.displayName;var Vi=G.forwardRef((e,t)=>{let n=(0,z.c)(21),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,children:r,position:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=o===void 0?`popper`:o,c=s===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,l;n[5]!==i||n[6]!==c?(l=u(`relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,c,i),n[5]=i,n[6]=c,n[7]=l):l=n[7];let d;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,q.jsx)(zi,{}),n[8]=d):d=n[8];let f=s===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`,p;n[9]===f?p=n[10]:(p=u(`p-1`,f),n[9]=f,n[10]=p);let m;n[11]!==r||n[12]!==p?(m=(0,q.jsx)(Oi,{className:p,children:r}),n[11]=r,n[12]=p,n[13]=m):m=n[13];let h;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,q.jsx)(Bi,{}),n[14]=h):h=n[14];let g;return n[15]!==s||n[16]!==a||n[17]!==t||n[18]!==l||n[19]!==m?(g=(0,q.jsx)(Ei,{children:(0,q.jsxs)(Di,{ref:t,className:l,position:s,...a,children:[d,m,h]})}),n[15]=s,n[16]=a,n[17]=t,n[18]=l,n[19]=m,n[20]=g):g=n[20],g});Vi.displayName=Di.displayName;var Hi=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`py-1.5 pl-8 pr-2 text-base font-semibold`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(ki,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Hi.displayName=ki.displayName;var Ui=G.forwardRef((e,t)=>{let n=(0,z.c)(14),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=u(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-base outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,q.jsx)(Mi,{children:(0,q.jsx)(d,{className:`h-4 w-4`})})}),n[6]=s):s=n[6];let c;n[7]===r?c=n[8]:(c=(0,q.jsx)(ji,{children:r}),n[7]=r,n[8]=c);let l;return n[9]!==a||n[10]!==t||n[11]!==o||n[12]!==c?(l=(0,q.jsxs)(Ai,{ref:t,className:o,...a,children:[s,c]}),n[9]=a,n[10]=t,n[11]=o,n[12]=c,n[13]=l):l=n[13],l});Ui.displayName=Ai.displayName;var Wi=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`-mx-1 my-1 h-px bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(Fi,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Wi.displayName=Fi.displayName;function Gi(e){let t=(0,z.c)(14),{className:n,label:r,size:a}=e,o=a===void 0?`md`:a,s=o===`sm`?`h-4 w-4`:o===`lg`?`h-8 w-8`:`h-6 w-6`,c;t[0]===n?c=t[1]:(c=u(`flex h-full items-center justify-center`,n),t[0]=n,t[1]=c);let l;t[2]===s?l=t[3]:(l=u(s,`animate-spin mx-auto text-muted-foreground`),t[2]=s,t[3]=l);let d;t[4]===l?d=t[5]:(d=(0,q.jsx)(i,{className:l}),t[4]=l,t[5]=d);let f;t[6]===r?f=t[7]:(f=r?(0,q.jsx)(`p`,{className:u(L.bodyMuted,`mt-2`),children:r}):null,t[6]=r,t[7]=f);let p;t[8]!==d||t[9]!==f?(p=(0,q.jsxs)(`div`,{className:`text-center`,children:[d,f]}),t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;return t[11]!==c||t[12]!==p?(m=(0,q.jsx)(`div`,{className:c,children:p}),t[11]=c,t[12]=p,t[13]=m):m=t[13],m}function Ki(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(`div`,{className:`space-y-1 px-2 py-2`,children:[1,2,3].map(qi)}),e[0]=t):t=e[0],t}function qi(e){return(0,q.jsx)(`div`,{className:`animate-pulse h-7 bg-muted rounded-full`},e)}function Ji(){let e=(0,z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsx)(`div`,{className:`animate-pulse h-4 bg-muted rounded mx-4 my-1`}),e[0]=t):t=e[0],t}var Yi=new Map;function Xi(e,t){let n=Yi.get(e);return n||(n={promise:t().catch(t=>{throw Yi.delete(e),t})},Yi.set(e,n)),n.promise}function Zi(e){Yi.delete(e)}function Qi(e){for(let t of Yi.keys())t.startsWith(e)&&Yi.delete(t)}function $i(e,t){return(0,G.use)(Xi(e,t))}var ea=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`w-full caption-bottom`,L.body,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,q.jsx)(`table`,{ref:t,className:a,...i})}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ea.displayName=`Table`;var ta=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`[&_tr]:border-b`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`thead`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ta.displayName=`TableHeader`;var na=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`[&_tr:last-child]:border-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`tbody`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});na.displayName=`TableBody`;var ra=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`tfoot`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ra.displayName=`TableFooter`;var ia=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`tr`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ia.displayName=`TableRow`;var Q=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`th`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});Q.displayName=`TableHead`;var $=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`td`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});$.displayName=`TableCell`;var aa=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.caption,`mt-4`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`caption`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});aa.displayName=`TableCaption`;var oa=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`rounded-lg border bg-card text-card-foreground shadow-sm`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});oa.displayName=`Card`;var sa=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`flex flex-col space-y-1.5 p-6`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});sa.displayName=`CardHeader`;var ca=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.sectionTitle,`leading-none tracking-tight`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ca.displayName=`CardTitle`;var la=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(L.bodyMuted,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});la.displayName=`CardDescription`;var ua=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`p-6 pt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});ua.displayName=`CardContent`;var da=G.forwardRef((e,t)=>{let n=(0,z.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=u(`flex items-center p-6 pt-0`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,q.jsx)(`div`,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});da.displayName=`CardFooter`;var fa=p(`app.async-error-boundary.ui`),pa=class extends G.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){fa.error(`AsyncErrorBoundary caught an error`,{error:e,info:t})}handleRetry=()=>{this.setState({error:null}),this.props.onRetry?.()};render(){let{error:e}=this.state;return e?this.props.renderFallback?this.props.renderFallback(e,this.handleRetry):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(oa,{className:`max-w-md`,children:[(0,q.jsx)(sa,{children:(0,q.jsx)(ca,{className:`text-destructive`,children:this.props.fallbackTitle??`Something went wrong`})}),(0,q.jsxs)(ua,{className:`space-y-4`,children:[(0,q.jsx)(`p`,{className:L.body,children:e.message}),(0,q.jsx)(C,{variant:`outline`,onClick:this.handleRetry,children:`Retry`})]})]})}):this.props.children}},ma=t({ConversationHistoryView:()=>Ta,default:()=>Ta}),ha=dn(e=>(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(`div`,{className:`max-w-md text-center space-y-2`,children:[(0,q.jsx)(`h3`,{className:e.v0,children:`No history`}),(0,q.jsx)(`p`,{className:e.v1,children:`No conversation history found for this thread.`})]})}),{name:`ConversationHistoryContent_1`}),ga=dn(e=>(0,q.jsxs)(`slot`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between border-b py-3 px-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.v0,e.v1]}),(0,q.jsxs)(`div`,{className:e.v2,children:[e.v3,` of `,e.v4,` messages`]})]}),e.v5]}),{name:`ConversationHistoryContent_2`,portals:[`v0`,`v1`,`v3`,`v4`,`v5`]}),_a=function(e){let t=(0,z.c)(39),{scope:n,projects:r,loadVersion:i,currentPromptIndex:o,onPromptIndexChange:s}=e,c;t[0]!==i||t[1]!==n?(c=Ca(n,i),t[0]=i,t[1]=n,t[2]=c):c=t[2];let l;t[3]!==r||t[4]!==n?(l=()=>wa(n,r),t[3]=r,t[4]=n,t[5]=l):l=t[5];let d=$i(c,l),f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=function(e){return new Date(e).toLocaleString()},t[6]=f):f=t[6];let p=f,m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=function(e,t){let n=new Date(e),r=new Date(t).getTime()-n.getTime();if(r<0)return{display:`0:00`,tooltip:`0 seconds`};let i=Math.floor(r/1e3),a=Math.floor(i/60),o=i%60,s=`${a}:${o.toString().padStart(2,`0`)}`,c;return c=a===0?`${o} second${o===1?``:`s`}`:o===0?`${a} minute${a===1?``:`s`}`:`${a} minute${a===1?``:`s`} ${o} second${o===1?``:`s`}`,{display:s,tooltip:c}},t[7]=m):m=t[7];let g=m,_;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(e){return{inputTokens:e.inputTokens??0,outputTokens:e.outputTokens??0}},t[8]=_):_=t[8];let v=_,y;t[9]!==o||t[10]!==d.messages||t[11]!==s?(y=function(){d.messages&&o<d.messages.length-1&&s(o+1)},t[9]=o,t[10]=d.messages,t[11]=s,t[12]=y):y=t[12];let x=y,S;t[13]!==o||t[14]!==s?(S=function(){o>0&&s(o-1)},t[13]=o,t[14]=s,t[15]=S):S=t[15];let T=S;if(!d.messages?.length){let e;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,q.jsx)(ha,{v0:L.emptyStateTitle,v1:L.bodyMuted}),t[16]=e):e=t[16],e}let D=o===0,O;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,q.jsx)(w,{className:`h-4 w-4 mr-1`}),t[17]=O):O=t[17];let k;t[18]!==T||t[19]!==D?(k=(0,q.jsx)(C,{variant:`outline`,size:`sm`,onClick:T,disabled:D,children:O}),t[18]=T,t[19]=D,t[20]=k):k=t[20];let A=o>=d.messages.length-1,j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,q.jsx)(b,{className:`h-4 w-4 ml-1`}),t[21]=j):j=t[21];let M;t[22]!==x||t[23]!==A?(M=(0,q.jsx)(C,{variant:`outline`,size:`sm`,onClick:x,disabled:A,children:j}),t[22]=x,t[23]=A,t[24]=M):M=t[24];let ee=o+1,te=d.messages.length,N;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,q.jsx)(ta,{children:(0,q.jsxs)(ia,{children:[(0,q.jsx)(Q,{children:`Prompt`}),(0,q.jsx)(Q,{children:`Answer`}),(0,q.jsx)(Q,{className:`w-24`,children:`Model`}),(0,q.jsx)(Q,{className:`w-24 text-right`,children:`Duration`}),(0,q.jsx)(Q,{className:`w-20 text-right`,children:`Input Tokens`}),(0,q.jsx)(Q,{className:`w-20 text-right`,children:`Output Tokens`}),(0,q.jsx)(Q,{className:`w-32 text-right`,children:`Timestamp`})]})}),t[25]=N):N=t[25];let ne;if(t[26]!==o||t[27]!==d.messages){let e;t[29]===o?e=t[30]:(e=(e,t)=>{let{inputTokens:n,outputTokens:r}=v(e);return(0,q.jsxs)(ia,{className:t===o?`bg-muted/50`:``,children:[(0,q.jsx)($,{className:`max-w-md`,children:(0,q.jsx)(`div`,{className:L.body,children:(0,q.jsx)(ba,{text:e.request.message})})}),(0,q.jsx)($,{className:`max-w-md`,children:e.response?(0,q.jsx)(`div`,{className:L.body,children:(0,q.jsx)(ba,{text:e.response.content})}):(0,q.jsx)(`span`,{className:u(L.bodyMuted,`italic`),children:`No response`})}),(0,q.jsx)($,{children:(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,q.jsx)(xe,{className:`h-3 w-3 text-muted-foreground`}),(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:e.request.model})]})}),(0,q.jsx)($,{className:u(L.caption,`text-right`),children:e.response?(0,q.jsx)(Ce,{children:(0,q.jsxs)(h,{children:[(0,q.jsx)(a,{asChild:!0,children:(0,q.jsx)(`div`,{className:`cursor-help`,children:g(e.timestamp,e.response.completedAt).display})}),(0,q.jsx)(E,{children:(0,q.jsx)(`p`,{children:g(e.timestamp,e.response.completedAt).tooltip})})]})}):(0,q.jsx)(`span`,{className:`text-muted-foreground italic`,children:`-`})}),(0,q.jsx)($,{className:u(L.bodyMuted,`text-right`),children:n>0?n.toLocaleString():`-`}),(0,q.jsx)($,{className:u(L.bodyMuted,`text-right`),children:r>0?r.toLocaleString():`-`}),(0,q.jsx)($,{className:u(L.bodyMuted,`text-right`),children:p(e.timestamp)})]},e.id)},t[29]=o,t[30]=e),ne=d.messages.map(e),t[26]=o,t[27]=d.messages,t[28]=ne}else ne=t[28];let P;t[31]===ne?P=t[32]:(P=(0,q.jsx)(re,{className:`h-full`,children:(0,q.jsx)(`div`,{className:`py-4`,children:(0,q.jsxs)(ea,{children:[N,(0,q.jsx)(na,{children:ne})]})})}),t[31]=ne,t[32]=P);let F;return t[33]!==d.messages.length||t[34]!==k||t[35]!==M||t[36]!==ee||t[37]!==P?(F=(0,q.jsx)(ga,{v0:k,v1:M,v2:L.bodyMuted,v3:ee,v4:te,v5:P}),t[33]=d.messages.length,t[34]=k,t[35]=M,t[36]=ee,t[37]=P,t[38]=F):F=t[38],F},va=p(`app.conversation-history-view.ui`),ya=`__ALL_PROJECTS__`;function ba(e){let t=(0,z.c)(8),{text:n,maxLength:r}=e,i=r===void 0?100:r;if(n.length<=i){let e;return t[0]===n?e=t[1]:(e=(0,q.jsx)(q.Fragment,{children:n}),t[0]=n,t[1]=e),e}let a;t[2]!==i||t[3]!==n?(a=n.substring(0,i),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,q.jsx)(`span`,{className:`text-muted-foreground ml-2`,children:`...`}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,q.jsxs)(q.Fragment,{children:[a,o]}),t[6]=a,t[7]=s),s}function xa(e,t){let n=`${t} - `,r=e.title??e.threadId;return r.startsWith(n)?r.slice(n.length):r}async function Sa(e){let t=[],n=new Set,r=``;for(let i of e)try{let e=await pe(i.threadId);e?.messages&&(t.push(...e.messages),e.conversationIds&&e.conversationIds.forEach(e=>n.add(e)),e.lastUpdated>r&&(r=e.lastUpdated))}catch(e){va.warn(`Failed to load history for thread ${i.threadId}:`,e)}return t.sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()),{messages:t,conversationIds:Array.from(n),lastUpdated:r??new Date().toISOString()}}function Ca(e,t){return e.type===`thread`?`conversation-history:thread:${e.threadId}:${t}`:e.type===`project`?`conversation-history:project:${e.projectId}:${t}`:`conversation-history:all:${t}`}async function wa(e,t){if(e.type===`thread`)return await pe(e.threadId);if(e.type===`project`){let n=t.find(t=>t.projectId===e.projectId);if(!n||n.threads.length===0)return{threadId:e.projectId,messages:[],lastUpdated:new Date().toISOString(),conversationIds:[]};let r=await Sa(n.threads);return{threadId:e.projectId,...r}}return{threadId:ya,...await Sa(t.flatMap(e=>e.threads))}}var Ta=(0,G.memo)(function({isOpen:e,onClose:t,initialFilter:r,projects:i,inline:a}){let[o,s]=(0,G.useState)(0),[c,l]=(0,G.useState)(``),[u,d]=(0,G.useState)(``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(0),[y,b]=(0,G.useState)(null),[x,S]=(0,G.useState)(null),w=(0,G.useMemo)(()=>u?{type:`thread`,threadId:u}:c===ya?{type:`all`}:c?{type:`project`,projectId:c}:null,[c,u]),T=w?Ca(w,_):null;(0,G.useEffect)(()=>{e&&r?r.type===`thread`?(d(r.id),l(``),s(0)):r.type===`project`&&(l(r.id),d(``),s(0)):e&&!r?(l(ya),d(``),s(0)):e||(d(``),l(``),s(0),S(null),b(null))},[e,r]);let E=e=>{d(e),l(``),s(0),b(null),S(null)},D=e=>{l(e),d(``),s(0),b(null),S(null)},O=(0,G.useCallback)(()=>{if(u){let e=i.flatMap(e=>e.threads).find(e=>e.threadId===u),t=i.find(e=>e.threads.some(e=>e.threadId===u)),n=e?xa(e,t?.name??t?.projectId??``):u;return{options:{threadId:u},title:`Clear Thread History`,description:`Permanently delete all conversation history for "${n}"? This cannot be undone.`}}if(c&&c!==ya){let e=i.find(e=>e.projectId===c)?.name??c;return{options:{projectId:c},title:`Clear Project History`,description:`Permanently delete all conversation history for "${e}"? This cannot be undone.`}}return{options:void 0,title:`Clear All History`,description:`Permanently delete all conversation history across every project and thread? This cannot be undone.`}},[i,c,u]),k=(0,G.useCallback)(async()=>{let e=O();g(!0),S(null);try{await ee(e.options),T&&Zi(T),b(T),s(0),m(!1)}catch(e){S(e instanceof Error?e.message:`Failed to clear conversation history`)}finally{g(!1)}},[O,T]);function A(){w&&Zi(Ca(w,_)),v(e=>e+1),b(null),S(null)}let j=O();if(!e)return null;let M=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Ii,{value:c,onValueChange:D,children:[(0,q.jsx)(Ri,{className:`w-48`,children:(0,q.jsx)(Li,{placeholder:`Select project`})}),(0,q.jsxs)(Vi,{children:[(0,q.jsx)(Ui,{value:ya,children:`All Projects`}),i.map(e=>(0,q.jsx)(Ui,{value:e.projectId,children:e.name??e.projectId},e.projectId))]})]}),(0,q.jsxs)(Ii,{value:u,onValueChange:E,children:[(0,q.jsx)(Ri,{className:`w-48`,children:(0,q.jsx)(Li,{placeholder:`Select thread`})}),(0,q.jsx)(Vi,{children:i.flatMap(e=>e.threads.map(t=>(0,q.jsx)(Ui,{value:t.threadId,children:xa(t,e.name??e.projectId)},t.threadId)))})]}),(0,q.jsxs)(C,{variant:`outline`,size:`sm`,onClick:()=>m(!0),disabled:h,children:[(0,q.jsx)(n,{className:`h-4 w-4 mr-2`}),`Clear`]})]}),te=(0,q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,q.jsx)(`div`,{className:a?void 0:`border-b px-6 py-4`,children:(0,q.jsx)(tr,{title:`History`,description:a?`View and browse conversation history across projects and threads.`:void 0,action:(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[M,a?null:(0,q.jsx)(C,{variant:`action`,size:`icon-sm`,onClick:t,children:(0,q.jsx)(f,{})})]})})}),(0,q.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:x?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,q.jsxs)(oa,{className:`max-w-md`,children:[(0,q.jsx)(sa,{children:(0,q.jsx)(ca,{className:`text-destructive`,children:`Error`})}),(0,q.jsxs)(ua,{className:`space-y-4`,children:[(0,q.jsx)(`p`,{children:x}),(0,q.jsx)(C,{onClick:()=>S(null),children:`Dismiss`})]})]})}):y&&y===T?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,q.jsxs)(`div`,{className:`max-w-md text-center space-y-2`,children:[(0,q.jsx)(`h3`,{className:L.emptyStateTitle,children:`No history`}),(0,q.jsx)(`p`,{className:L.bodyMuted,children:`No conversation history found for this thread.`})]})}):w?(0,q.jsx)(pa,{fallbackTitle:`Failed to load conversation history`,onRetry:A,children:(0,q.jsx)(G.Suspense,{fallback:(0,q.jsx)(Gi,{label:`Loading conversation history...`,size:`lg`}),children:(0,q.jsx)(_a,{scope:w,projects:i,loadVersion:_,currentPromptIndex:o,onPromptIndexChange:s},T??void 0)})}):(0,q.jsx)(Gi,{label:`Loading conversation history...`,size:`lg`})})]});return(0,q.jsxs)(q.Fragment,{children:[a?(0,q.jsx)(sr,{children:(0,q.jsx)(nr,{className:`max-w-none w-full h-full flex flex-col min-h-0`,children:te})}):(0,q.jsx)(`div`,{className:`fixed inset-0 z-50 bg-background`,children:te}),(0,q.jsx)(Wn,{open:p,onOpenChange:m,children:(0,q.jsxs)(qn,{children:[(0,q.jsxs)(Jn,{children:[(0,q.jsx)(Xn,{children:j.title}),(0,q.jsx)(Zn,{children:j.description})]}),(0,q.jsxs)(Yn,{children:[(0,q.jsx)($n,{disabled:h,children:`Cancel`}),(0,q.jsx)(Qn,{onClick:e=>{e.preventDefault(),k()},disabled:h,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:h?`Clearing...`:`Clear`})]})]})})]})});export{$n as A,ar as C,sr as D,nr as E,Xn as F,dn as I,Zn as M,Yn as N,Wn as O,Jn as P,tr as S,cr as T,dr as _,$i as a,ur as b,Ji as c,Ii as d,Vi as f,Li as g,Ri as h,ua as i,qn as j,Qn as k,Gi as l,Wi as m,pa as n,Zi as o,Ui as p,oa as r,Qi as s,ma as t,Ki as u,rr as v,lr as w,or as x,ir as y};
|