@townco/gui-template 0.1.12 → 0.1.13
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/dist/assets/{acp-sdk-C7r2g8Gx.js → acp-sdk-CrAUv_2m.js} +1 -1
- package/dist/assets/icons-Dn0pjvgj.js +1 -0
- package/dist/assets/index-9OV0HYRI.js +8 -0
- package/dist/assets/index-dSWdaIUO.css +1 -0
- package/dist/assets/{markdown-BYclSlXM.js → markdown-CwEbCfit.js} +1 -1
- package/dist/assets/{radix-5M08E2bk.js → radix-BPjk4-Jl.js} +1 -1
- package/dist/assets/react-CIcriR6k.js +61 -0
- package/dist/assets/vendor--IKG6KWl.js +48 -0
- package/dist/index.html +8 -8
- package/package.json +3 -3
- package/src/ChatView.tsx +2 -0
- package/dist/assets/icons-DyKSdrA7.js +0 -1
- package/dist/assets/index-B4gi_GLt.js +0 -8
- package/dist/assets/index-DDhFOEN_.css +0 -1
- package/dist/assets/react-oZw8z-KQ.js +0 -49
- package/dist/assets/vendor-CEpcc87q.js +0 -48
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as h,a as p,s as e,o,r as a,u as t,b as l,l as n,c as s,d as m}from"./vendor-CEpcc87q.js";const Qe=1,x=h(),C=p(),w=e(),q=o({_meta:a(t()).optional(),content:e(),path:e(),sessionId:e()}),f=o({_meta:a(t()).optional(),limit:p().optional().nullable(),line:p().optional().nullable(),path:e(),sessionId:e()}),M=o({_meta:a(t()).optional(),sessionId:e(),terminalId:e()}),k=o({_meta:a(t()).optional(),sessionId:e(),terminalId:e()}),v=o({_meta:a(t()).optional(),sessionId:e(),terminalId:e()}),O=o({_meta:a(t()).optional(),sessionId:e(),terminalId:e()}),F=a(t()),U=l([n("assistant"),n("user")]),z=o({_meta:a(t()).optional(),mimeType:e().optional().nullable(),text:e(),uri:e()}),N=o({_meta:a(t()).optional(),blob:e(),mimeType:e().optional().nullable(),uri:e()}),b=l([n("read"),n("edit"),n("delete"),n("move"),n("search"),n("execute"),n("think"),n("fetch"),n("switch_mode"),n("other")]),_=l([n("pending"),n("in_progress"),n("completed"),n("failed")]),S=o({code:p(),data:a(t()).optional(),message:e()}),E=o({_meta:a(t()).optional()}),P=o({_meta:t().optional()}),V=o({_meta:a(t()).optional(),stopReason:l([n("end_turn"),n("max_tokens"),n("max_turn_requests"),n("refusal"),n("cancelled")])}),j=o({_meta:a(t()).optional()}),L=a(t()),B=e(),H=a(t()),K=o({hint:e()}),A=h(),D=p(),G=e(),J=o({_meta:a(t()).optional(),methodId:e()}),Q=o({_meta:a(t()).optional(),modeId:e(),sessionId:e()}),W=o({_meta:a(t()).optional(),modelId:e(),sessionId:e()}),X=a(t()),d=o({_meta:a(t()).optional(),name:e(),value:e()}),i=o({_meta:a(t()).optional(),audience:s(U).optional().nullable(),lastModified:e().optional().nullable(),priority:p().optional().nullable()}),c=l([z,N]),Y=o({_meta:a(t()).optional()}),Z=o({_meta:a(t()).optional(),content:e()}),$=o({_meta:a(t()).optional(),outcome:l([o({outcome:n("cancelled")}),o({optionId:e(),outcome:n("selected")})])}),ee=o({_meta:a(t()).optional(),terminalId:e()}),oe=o({_meta:a(t()).optional()}),te=o({_meta:a(t()).optional(),exitCode:p().optional().nullable(),signal:e().optional().nullable()}),ae=o({_meta:a(t()).optional()}),ne=a(t()),le=o({_meta:a(t()).optional(),sessionId:e()}),ie=a(t()),se=o({_meta:a(t()).optional(),kind:l([n("allow_once"),n("allow_always"),n("reject_once"),n("reject_always")]),name:e(),optionId:e()}),u=l([o({content:l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),type:n("content")}),o({_meta:a(t()).optional(),newText:e(),oldText:e().optional().nullable(),path:e(),type:n("diff")}),o({terminalId:e(),type:n("terminal")})]),r=o({_meta:a(t()).optional(),line:p().optional().nullable(),path:e()}),y=o({_meta:a(t()).optional(),name:e(),value:e()}),R=o({name:e(),title:e().optional().nullable(),version:e()}),pe=o({_meta:a(t()).optional(),description:e().optional().nullable(),id:e(),name:e()}),me=o({_meta:a(t()).optional(),http:m().optional(),sse:m().optional()}),ce=o({_meta:a(t()).optional(),audio:m().optional(),embeddedContext:m().optional(),image:m().optional()}),ue=o({_meta:a(t()).optional(),description:e().optional().nullable(),modelId:e(),name:e()}),re=o({_meta:a(t()).optional(),description:e().optional().nullable(),id:B,name:e()}),T=o({_meta:a(t()).optional(),availableModels:s(ue),currentModelId:e()}),I=o({_meta:a(t()).optional(),availableModes:s(re),currentModeId:e()}),de=o({_meta:a(t()).optional(),content:e(),priority:l([n("high"),n("medium"),n("low")]),status:l([n("pending"),n("in_progress"),n("completed")])}),he=K,be=o({_meta:a(t()).optional(),readTextFile:m().optional(),writeTextFile:m().optional()}),_e=o({args:s(e()),command:e(),env:s(y),name:e()}),g=l([o({headers:s(d),name:e(),type:n("http"),url:e()}),o({headers:s(d),name:e(),type:n("sse"),url:e()}),_e]),Se=l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),ye=o({_meta:a(t()).optional(),exitCode:p().optional().nullable(),signal:e().optional().nullable()}),Re=l([le,ie]),Te=o({_meta:a(t()).optional(),options:s(se),sessionId:e(),toolCall:o({_meta:a(t()).optional(),content:s(u).optional().nullable(),kind:b.optional().nullable(),locations:s(r).optional().nullable(),rawInput:a(t()).optional(),rawOutput:a(t()).optional(),status:_.optional().nullable(),title:e().optional().nullable(),toolCallId:e()})}),Ie=o({_meta:a(t()).optional(),args:s(e()).optional(),command:e(),cwd:e().optional().nullable(),env:s(y).optional(),outputByteLimit:p().optional().nullable(),sessionId:e()}),ge=o({_meta:a(t()).optional(),models:T.optional().nullable(),modes:I.optional().nullable(),sessionId:e()}),xe=o({_meta:a(t()).optional(),models:T.optional().nullable(),modes:I.optional().nullable()}),Ce=o({method:e(),params:Re.optional().nullable()}),we=o({_meta:a(t()).optional(),cwd:e(),mcpServers:s(g)}),qe=o({_meta:a(t()).optional(),cwd:e(),mcpServers:s(g),sessionId:e()}),fe=o({_meta:a(t()).optional(),prompt:s(Se),sessionId:e()}),Me=o({_meta:a(t()).optional(),exitStatus:ye.optional().nullable(),output:e(),truncated:m()}),ke=l([q,f,Te,Ie,M,k,v,O,F]),ve=o({_meta:a(t()).optional(),loadSession:m().optional(),mcpCapabilities:me.optional(),promptCapabilities:ce.optional()}),Oe=o({_meta:a(t()).optional(),description:e(),input:he.optional().nullable(),name:e()}),Fe=o({_meta:a(t()).optional(),fs:be.optional(),terminal:m().optional()}),Ue=o({id:l([x,C,w]),method:e(),params:ke.optional().nullable()}),ze=o({_meta:a(t()).optional(),agentCapabilities:ve.optional(),agentInfo:R.optional().nullable(),authMethods:s(pe).optional(),protocolVersion:p()}),Ne=o({_meta:a(t()).optional(),sessionId:e(),update:l([o({_meta:a(t()).optional(),content:l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),sessionUpdate:n("user_message_chunk")}),o({_meta:a(t()).optional(),content:l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),sessionUpdate:n("agent_message_chunk")}),o({_meta:a(t()).optional(),content:l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),sessionUpdate:n("agent_thought_chunk")}),o({_meta:a(t()).optional(),content:s(u).optional(),kind:l([n("read"),n("edit"),n("delete"),n("move"),n("search"),n("execute"),n("think"),n("fetch"),n("switch_mode"),n("other")]).optional(),locations:s(r).optional(),rawInput:a(t()).optional(),rawOutput:a(t()).optional(),sessionUpdate:n("tool_call"),status:l([n("pending"),n("in_progress"),n("completed"),n("failed")]).optional(),title:e(),toolCallId:e()}),o({_meta:a(t()).optional(),content:s(u).optional().nullable(),kind:b.optional().nullable(),locations:s(r).optional().nullable(),rawInput:a(t()).optional(),rawOutput:a(t()).optional(),sessionUpdate:n("tool_call_update"),status:_.optional().nullable(),title:e().optional().nullable(),toolCallId:e()}),o({_meta:a(t()).optional(),entries:s(de),sessionUpdate:n("plan")}),o({_meta:a(t()).optional(),availableCommands:s(Oe),sessionUpdate:n("available_commands_update")}),o({_meta:a(t()).optional(),currentModeId:e(),sessionUpdate:n("current_mode_update")})])}),Ee=o({_meta:a(t()).optional(),clientCapabilities:Fe.optional(),clientInfo:R.optional().nullable(),protocolVersion:p()}),Pe=l([Y,Z,$,ee,Me,oe,te,ae,ne]),Ve=l([Ne,H]),je=l([Ee,J,we,qe,Q,fe,W,X]),Le=o({method:e(),params:Ve.optional().nullable()}),Be=l([ze,E,ge,xe,P,V,j,L]),He=o({id:l([A,D,G]),method:e(),params:je.optional().nullable()}),Ke=l([o({result:Pe}),o({error:S})]),Ae=l([He,Ke,Ce]),De=l([o({result:Be}),o({error:S})]),Ge=l([Ue,De,Le]);l([Ge,Ae]);export{Qe as P,Ge as a};
|
|
1
|
+
import{n as h,a as p,s as e,o,r as a,u as t,b as l,l as n,c as s,d as m}from"./vendor--IKG6KWl.js";const Qe=1,x=h(),C=p(),w=e(),q=o({_meta:a(t()).optional(),content:e(),path:e(),sessionId:e()}),f=o({_meta:a(t()).optional(),limit:p().optional().nullable(),line:p().optional().nullable(),path:e(),sessionId:e()}),M=o({_meta:a(t()).optional(),sessionId:e(),terminalId:e()}),k=o({_meta:a(t()).optional(),sessionId:e(),terminalId:e()}),v=o({_meta:a(t()).optional(),sessionId:e(),terminalId:e()}),O=o({_meta:a(t()).optional(),sessionId:e(),terminalId:e()}),F=a(t()),U=l([n("assistant"),n("user")]),z=o({_meta:a(t()).optional(),mimeType:e().optional().nullable(),text:e(),uri:e()}),N=o({_meta:a(t()).optional(),blob:e(),mimeType:e().optional().nullable(),uri:e()}),b=l([n("read"),n("edit"),n("delete"),n("move"),n("search"),n("execute"),n("think"),n("fetch"),n("switch_mode"),n("other")]),_=l([n("pending"),n("in_progress"),n("completed"),n("failed")]),S=o({code:p(),data:a(t()).optional(),message:e()}),E=o({_meta:a(t()).optional()}),P=o({_meta:t().optional()}),V=o({_meta:a(t()).optional(),stopReason:l([n("end_turn"),n("max_tokens"),n("max_turn_requests"),n("refusal"),n("cancelled")])}),j=o({_meta:a(t()).optional()}),L=a(t()),B=e(),H=a(t()),K=o({hint:e()}),A=h(),D=p(),G=e(),J=o({_meta:a(t()).optional(),methodId:e()}),Q=o({_meta:a(t()).optional(),modeId:e(),sessionId:e()}),W=o({_meta:a(t()).optional(),modelId:e(),sessionId:e()}),X=a(t()),d=o({_meta:a(t()).optional(),name:e(),value:e()}),i=o({_meta:a(t()).optional(),audience:s(U).optional().nullable(),lastModified:e().optional().nullable(),priority:p().optional().nullable()}),c=l([z,N]),Y=o({_meta:a(t()).optional()}),Z=o({_meta:a(t()).optional(),content:e()}),$=o({_meta:a(t()).optional(),outcome:l([o({outcome:n("cancelled")}),o({optionId:e(),outcome:n("selected")})])}),ee=o({_meta:a(t()).optional(),terminalId:e()}),oe=o({_meta:a(t()).optional()}),te=o({_meta:a(t()).optional(),exitCode:p().optional().nullable(),signal:e().optional().nullable()}),ae=o({_meta:a(t()).optional()}),ne=a(t()),le=o({_meta:a(t()).optional(),sessionId:e()}),ie=a(t()),se=o({_meta:a(t()).optional(),kind:l([n("allow_once"),n("allow_always"),n("reject_once"),n("reject_always")]),name:e(),optionId:e()}),u=l([o({content:l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),type:n("content")}),o({_meta:a(t()).optional(),newText:e(),oldText:e().optional().nullable(),path:e(),type:n("diff")}),o({terminalId:e(),type:n("terminal")})]),r=o({_meta:a(t()).optional(),line:p().optional().nullable(),path:e()}),y=o({_meta:a(t()).optional(),name:e(),value:e()}),R=o({name:e(),title:e().optional().nullable(),version:e()}),pe=o({_meta:a(t()).optional(),description:e().optional().nullable(),id:e(),name:e()}),me=o({_meta:a(t()).optional(),http:m().optional(),sse:m().optional()}),ce=o({_meta:a(t()).optional(),audio:m().optional(),embeddedContext:m().optional(),image:m().optional()}),ue=o({_meta:a(t()).optional(),description:e().optional().nullable(),modelId:e(),name:e()}),re=o({_meta:a(t()).optional(),description:e().optional().nullable(),id:B,name:e()}),T=o({_meta:a(t()).optional(),availableModels:s(ue),currentModelId:e()}),I=o({_meta:a(t()).optional(),availableModes:s(re),currentModeId:e()}),de=o({_meta:a(t()).optional(),content:e(),priority:l([n("high"),n("medium"),n("low")]),status:l([n("pending"),n("in_progress"),n("completed")])}),he=K,be=o({_meta:a(t()).optional(),readTextFile:m().optional(),writeTextFile:m().optional()}),_e=o({args:s(e()),command:e(),env:s(y),name:e()}),g=l([o({headers:s(d),name:e(),type:n("http"),url:e()}),o({headers:s(d),name:e(),type:n("sse"),url:e()}),_e]),Se=l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),ye=o({_meta:a(t()).optional(),exitCode:p().optional().nullable(),signal:e().optional().nullable()}),Re=l([le,ie]),Te=o({_meta:a(t()).optional(),options:s(se),sessionId:e(),toolCall:o({_meta:a(t()).optional(),content:s(u).optional().nullable(),kind:b.optional().nullable(),locations:s(r).optional().nullable(),rawInput:a(t()).optional(),rawOutput:a(t()).optional(),status:_.optional().nullable(),title:e().optional().nullable(),toolCallId:e()})}),Ie=o({_meta:a(t()).optional(),args:s(e()).optional(),command:e(),cwd:e().optional().nullable(),env:s(y).optional(),outputByteLimit:p().optional().nullable(),sessionId:e()}),ge=o({_meta:a(t()).optional(),models:T.optional().nullable(),modes:I.optional().nullable(),sessionId:e()}),xe=o({_meta:a(t()).optional(),models:T.optional().nullable(),modes:I.optional().nullable()}),Ce=o({method:e(),params:Re.optional().nullable()}),we=o({_meta:a(t()).optional(),cwd:e(),mcpServers:s(g)}),qe=o({_meta:a(t()).optional(),cwd:e(),mcpServers:s(g),sessionId:e()}),fe=o({_meta:a(t()).optional(),prompt:s(Se),sessionId:e()}),Me=o({_meta:a(t()).optional(),exitStatus:ye.optional().nullable(),output:e(),truncated:m()}),ke=l([q,f,Te,Ie,M,k,v,O,F]),ve=o({_meta:a(t()).optional(),loadSession:m().optional(),mcpCapabilities:me.optional(),promptCapabilities:ce.optional()}),Oe=o({_meta:a(t()).optional(),description:e(),input:he.optional().nullable(),name:e()}),Fe=o({_meta:a(t()).optional(),fs:be.optional(),terminal:m().optional()}),Ue=o({id:l([x,C,w]),method:e(),params:ke.optional().nullable()}),ze=o({_meta:a(t()).optional(),agentCapabilities:ve.optional(),agentInfo:R.optional().nullable(),authMethods:s(pe).optional(),protocolVersion:p()}),Ne=o({_meta:a(t()).optional(),sessionId:e(),update:l([o({_meta:a(t()).optional(),content:l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),sessionUpdate:n("user_message_chunk")}),o({_meta:a(t()).optional(),content:l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),sessionUpdate:n("agent_message_chunk")}),o({_meta:a(t()).optional(),content:l([o({_meta:a(t()).optional(),annotations:i.optional().nullable(),text:e(),type:n("text")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("image"),uri:e().optional().nullable()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),data:e(),mimeType:e(),type:n("audio")}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),description:e().optional().nullable(),mimeType:e().optional().nullable(),name:e(),size:p().optional().nullable(),title:e().optional().nullable(),type:n("resource_link"),uri:e()}),o({_meta:a(t()).optional(),annotations:i.optional().nullable(),resource:c,type:n("resource")})]),sessionUpdate:n("agent_thought_chunk")}),o({_meta:a(t()).optional(),content:s(u).optional(),kind:l([n("read"),n("edit"),n("delete"),n("move"),n("search"),n("execute"),n("think"),n("fetch"),n("switch_mode"),n("other")]).optional(),locations:s(r).optional(),rawInput:a(t()).optional(),rawOutput:a(t()).optional(),sessionUpdate:n("tool_call"),status:l([n("pending"),n("in_progress"),n("completed"),n("failed")]).optional(),title:e(),toolCallId:e()}),o({_meta:a(t()).optional(),content:s(u).optional().nullable(),kind:b.optional().nullable(),locations:s(r).optional().nullable(),rawInput:a(t()).optional(),rawOutput:a(t()).optional(),sessionUpdate:n("tool_call_update"),status:_.optional().nullable(),title:e().optional().nullable(),toolCallId:e()}),o({_meta:a(t()).optional(),entries:s(de),sessionUpdate:n("plan")}),o({_meta:a(t()).optional(),availableCommands:s(Oe),sessionUpdate:n("available_commands_update")}),o({_meta:a(t()).optional(),currentModeId:e(),sessionUpdate:n("current_mode_update")})])}),Ee=o({_meta:a(t()).optional(),clientCapabilities:Fe.optional(),clientInfo:R.optional().nullable(),protocolVersion:p()}),Pe=l([Y,Z,$,ee,Me,oe,te,ae,ne]),Ve=l([Ne,H]),je=l([Ee,J,we,qe,Q,fe,W,X]),Le=o({method:e(),params:Ve.optional().nullable()}),Be=l([ze,E,ge,xe,P,V,j,L]),He=o({id:l([A,D,G]),method:e(),params:je.optional().nullable()}),Ke=l([o({result:Pe}),o({error:S})]),Ae=l([He,Ke,Ce]),De=l([o({result:Be}),o({error:S})]),Ge=l([Ue,De,Le]);l([Ge,Ae]);export{Qe as P,Ge as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r}from"./react-CIcriR6k.js";const _=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m=o=>o.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,c,a)=>a?a.toUpperCase():c.toLowerCase()),h=o=>{const t=m(o);return t.charAt(0).toUpperCase()+t.slice(1)},i=(...o)=>o.filter((t,c,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===c).join(" ").trim(),w=o=>{for(const t in o)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var g={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const u=r.forwardRef(({color:o="currentColor",size:t=24,strokeWidth:c=2,absoluteStrokeWidth:a,className:n="",children:s,iconNode:l,...d},p)=>r.createElement("svg",{ref:p,...g,width:t,height:t,stroke:o,strokeWidth:a?Number(c)*24/Number(t):c,className:i("lucide",n),...!s&&!w(d)&&{"aria-hidden":"true"},...d},[...l.map(([y,k])=>r.createElement(y,k)),...Array.isArray(s)?s:[s]]));const e=(o,t)=>{const c=r.forwardRef(({className:a,...n},s)=>r.createElement(u,{ref:s,iconNode:t,className:i(`lucide-${_(h(o))}`,`lucide-${o}`,a),...n}));return c.displayName=h(o),c};const f=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],D=e("arrow-down",f);const C=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],V=e("arrow-right",C);const v=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],F=e("check",v);const $=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],I=e("chevron-down",$);const x=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Z=e("chevron-right",x);const N=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],K=e("chevron-up",N);const M=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],O=e("chevrons-up-down",M);const b=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],T=e("circle-check",b);const A=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],X=e("circle",A);const j=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],G=e("code",j);const z=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],J=e("file-text",z);const q=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Q=e("loader-circle",q);const L=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Y=e("mic",L);const S=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],e1=e("paperclip",S);const E=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],t1=e("settings",E);const H=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],o1=e("sparkles",H);const P=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],c1=e("square-check-big",P);const R=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],a1=e("square-slash",R);const U=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],s1=e("wrench",U);const W=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],r1=e("x",W);export{D as A,Z as C,J as F,Q as L,Y as M,e1 as P,a1 as S,s1 as W,r1 as X,F as a,X as b,I as c,O as d,K as e,T as f,V as g,c1 as h,o1 as i,t1 as j,G as k};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{r as i,j as t,P as Mt,e as At,f as Ut,M as Dt,h as se,i as Pt,a as Lt}from"./react-CIcriR6k.js";import{L,M as T,N as R,O as x,P as ce,Q as E,R as I,S as A,T as U,U as Ht,W as B,X as G,Y as zt,Z as _t,$ as Ot,a0 as Ft,a1 as H,a2 as $t}from"./vendor--IKG6KWl.js";import{P as Bt,a as Vt}from"./acp-sdk-CrAUv_2m.js";import{S as q,L as de,T as ue,C as fe,R as qt,O as pe,P as Wt,a as me,b as Qt,c as he,D as xe,d as ge,e as be,f as Kt,g as ye,I as we,h as ve,i as Ne,j as je,k as Ce,l as Se,m as Te,n as Ie,o as Gt,p as Ee,q as Re,r as Yt,s as ke,V as Jt,t as Me,u as Ae,v as Xt,w as Zt,x as Ue}from"./radix-BPjk4-Jl.js";import{S as es,P as ts,M as ss,A as ns,X as rs,C as os,a as De,b as Pe,c as te,W as as,L as Le,d as is,e as ls,f as cs,g as ds,h as us,F as fs,i as ne,j as ps,k as ms}from"./icons-Dn0pjvgj.js";import{r as hs}from"./markdown-CwEbCfit.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&n(d)}).observe(document,{childList:!0,subtree:!0});function r(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function n(o){if(o.ep)return;o.ep=!0;const c=r(o);fetch(o.href,c)}})();const He=L(["pending","in_progress","completed","failed"]),xs=L(["read","edit","delete","move","search","execute","think","fetch","switch_mode","other"]),ze=T({path:x(),line:R().nullable().optional()}),_e=T({inputTokens:R().optional(),outputTokens:R().optional(),totalTokens:R().optional()}),Oe=ce("type",[T({type:E("content"),content:T({type:E("text"),text:x()})}),T({type:E("text"),text:x()}),T({type:E("diff"),path:x(),oldText:x(),newText:x(),line:R().nullable().optional()}),T({type:E("terminal"),terminalId:x()})]),Fe=T({id:x(),title:x(),kind:xs,status:He,locations:I(ze).optional(),rawInput:A(x(),U()).optional(),rawOutput:A(x(),U()).optional(),content:I(Oe).optional(),error:x().optional(),startedAt:R().optional(),completedAt:R().optional(),tokenUsage:_e.optional()}),gs=T({id:x(),status:He.optional(),locations:I(ze).optional(),rawOutput:A(x(),U()).optional(),content:I(Oe).optional(),error:x().optional(),completedAt:R().optional(),tokenUsage:_e.optional()});function re(s,e){return{...s,status:e.status??s.status,locations:e.locations??s.locations,rawOutput:e.rawOutput??s.rawOutput,content:e.content?[...s.content??[],...e.content]:s.content,error:e.error??s.error,completedAt:e.completedAt??s.completedAt,tokenUsage:e.tokenUsage??s.tokenUsage}}const S=Ht(s=>({connectionStatus:"disconnected",sessionId:null,error:null,messages:[],isStreaming:!1,streamingStartTime:null,toolCalls:{},input:{value:"",isSubmitting:!1,attachedFiles:[]},setConnectionStatus:e=>s({connectionStatus:e}),setSessionId:e=>s({sessionId:e}),setError:e=>s({error:e}),addMessage:e=>s(r=>({messages:[...r.messages,e]})),updateMessage:(e,r)=>s(n=>({messages:n.messages.map(o=>o.id===e?{...o,...r}:o)})),clearMessages:()=>s({messages:[]}),setIsStreaming:e=>s({isStreaming:e}),setStreamingStartTime:e=>s({streamingStartTime:e}),addToolCall:(e,r)=>s(n=>({toolCalls:{...n.toolCalls,[e]:[...n.toolCalls[e]||[],r]}})),addToolCallToCurrentMessage:e=>s(r=>{const n=r.messages.findLastIndex(d=>d.role==="assistant");if(n===-1)return console.warn("No assistant message found to add tool call to"),r;const o=[...r.messages],c=o[n];return c?(o[n]={...c,toolCalls:[...c.toolCalls||[],e]},{messages:o}):r}),updateToolCallInCurrentMessage:e=>s(r=>{const n=r.messages.findLastIndex(l=>l.role==="assistant");if(n===-1)return console.warn("No assistant message found to update tool call in"),r;const o=[...r.messages],c=o[n];if(!c)return r;const d=c.toolCalls||[],f=d.findIndex(l=>l.id===e.id);if(f===-1)return console.warn(`Tool call ${e.id} not found in message`),r;const p=d[f];if(!p)return r;const a=[...d];return a[f]=re(p,e),o[n]={...c,toolCalls:a},{messages:o}}),updateToolCall:(e,r)=>s(n=>{const o=n.toolCalls[e]||[],c=o.findIndex(p=>p.id===r.id);if(c===-1)return n;const d=o[c];if(!d)return n;const f=[...o];return f[c]=re(d,r),{toolCalls:{...n.toolCalls,[e]:f}}}),setInputValue:e=>s(r=>({input:{...r.input,value:e}})),setInputSubmitting:e=>s(r=>({input:{...r.input,isSubmitting:e}})),addFileAttachment:e=>s(r=>({input:{...r.input,attachedFiles:[...r.input.attachedFiles,e]}})),removeFileAttachment:e=>s(r=>({input:{...r.input,attachedFiles:r.input.attachedFiles.filter((n,o)=>o!==e)}})),clearInput:()=>s(e=>({input:{value:"",isSubmitting:!1,attachedFiles:[]}}))}));function $e(s){const e=S(l=>l.messages),r=S(l=>l.isStreaming),n=S(l=>l.sessionId),o=S(l=>l.setIsStreaming),c=S(l=>l.setStreamingStartTime),d=S(l=>l.addMessage),f=S(l=>l.updateMessage),p=S(l=>l.setError),a=i.useCallback(async l=>{if(!s){console.error("❌ No client available"),p("No client available");return}if(!n){console.error("❌ No active session"),p("No active session");return}try{const u=Date.now();o(!0),c(u);const h={id:`msg_${Date.now()}_user`,role:"user",content:l,timestamp:new Date().toISOString(),isStreaming:!1};d(h);const g=`msg_${Date.now()}_assistant`,b={id:g,role:"assistant",content:"",timestamp:new Date().toISOString(),isStreaming:!0,streamingStartTime:u};d(b);const j=e.filter(v=>v.role!=="system").map(v=>`${v.role==="user"?"Human":"Assistant"}: ${v.content}`).join(`
|
|
2
|
+
|
|
3
|
+
`),N=j?`${j}
|
|
4
|
+
|
|
5
|
+
Human: ${l}`:l,y=s.receiveMessages();s.sendMessage(N,n).catch(v=>{const k=v instanceof Error?v.message:String(v);p(k),o(!1),c(null)});let w="";for await(const v of y)if(v.isComplete){f(g,{content:w,isStreaming:!1,streamingStartTime:void 0}),o(!1),c(null);break}else v.contentDelta.type==="text"&&(w+=v.contentDelta.text,f(g,{content:w}),await new Promise(k=>setTimeout(k,16)))}catch(u){const h=u instanceof Error?u.message:String(u);p(h),o(!1),c(null)}},[s,n,e,d,f,o,c,p]);return{messages:e,isStreaming:r,sendMessage:a}}function bs(s){const e=S(u=>u.input),r=S(u=>u.setInputValue),n=S(u=>u.setInputSubmitting),o=S(u=>u.addFileAttachment),c=S(u=>u.removeFileAttachment),{sendMessage:d}=$e(s),f=i.useCallback(u=>{r(u)},[r]),p=i.useCallback(async()=>{if(!e.value.trim()||e.isSubmitting)return;const u=e.value;r(""),n(!0);try{await d(u)}catch(h){console.error("Failed to send message:",h)}finally{n(!1)}},[e,r,n,d]),a=i.useCallback(u=>{o(u)},[o]),l=i.useCallback(u=>{c(u)},[c]);return{value:e.value,isSubmitting:e.isSubmitting,attachedFiles:e.attachedFiles,onChange:f,onSubmit:p,onAttachFile:a,onRemoveFile:l}}function ys(s){const e=S(l=>l.connectionStatus),r=S(l=>l.sessionId),n=S(l=>l.setConnectionStatus),o=S(l=>l.setSessionId),c=S(l=>l.setError),d=S(l=>l.clearMessages),f=i.useCallback(async()=>{if(!s){c("No client available");return}try{n("connecting"),c(null),await s.connect(),n("connected")}catch(l){console.log(l);const u=l instanceof Error?l.message:String(l);c(u),n("error")}},[s,n,c]),p=i.useCallback(async()=>{if(!s){c("No client available");return}try{const l=await s.startSession();o(l),d()}catch(l){const u=l instanceof Error?l.message:String(l);c(u)}},[s,o,c,d]),a=i.useCallback(async()=>{if(s)try{await s.disconnect(),n("disconnected"),o(null)}catch(l){const u=l instanceof Error?l.message:String(l);c(u)}},[s,n,o,c]);return i.useEffect(()=>{s&&e==="disconnected"&&f()},[s,e,f]),i.useEffect(()=>{e==="connected"&&!r&&p()},[e,r,p]),{connectionStatus:e,sessionId:r,connect:f,startSession:p,disconnect:a}}function ws(s){const e=S(d=>d.toolCalls),r=S(d=>d.addToolCall),n=S(d=>d.updateToolCall),o=S(d=>d.addToolCallToCurrentMessage),c=S(d=>d.updateToolCallInCurrentMessage);return i.useEffect(()=>{if(!s)return;const d=s.onSessionUpdate(f=>{f.type==="tool_call"?(r(f.sessionId,f.toolCall),o(f.toolCall)):f.type==="tool_call_update"&&(n(f.sessionId,f.toolCallUpdate),c(f.toolCallUpdate))});return()=>{d()}},[s,r,n,o,c]),{toolCalls:e,getToolCallsForSession:d=>{const f=e[d];return f&&f.length>0?f:Object.values(e).flat()}}}const oe={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},vs={trace:"color: #6B7280",debug:"color: #3B82F6; font-weight: bold",info:"color: #10B981; font-weight: bold",warn:"color: #F59E0B; font-weight: bold",error:"color: #EF4444; font-weight: bold",fatal:"color: #DC2626; font-weight: bold; background: #FEE2E2"};class Ns{service;minLevel;constructor(e,r="debug"){this.service=e,this.minLevel=r,typeof process<"u"&&(this.minLevel="info")}shouldLog(e){return oe[e]>=oe[this.minLevel]}log(e,r,n){if(!this.shouldLog(e))return;const o={timestamp:new Date().toISOString(),level:e,service:this.service,message:r,...n&&{metadata:n}},c=vs[e],d=e.toUpperCase().padEnd(5);if(typeof console<"u"){const f=`%c[${o.timestamp}] [${this.service}] [${d}]`,p=n?`${r} %o`:r;switch(e){case"trace":case"debug":case"info":console.log(f,c,p,...n?[n]:[]);break;case"warn":console.warn(f,c,p,...n?[n]:[]);break;case"error":case"fatal":console.error(f,c,p,...n?[n]:[]);break}}(e==="fatal"||e==="error")&&console.debug("Structured log:",JSON.stringify(o))}trace(e,r){this.log("trace",e,r)}debug(e,r){this.log("debug",e,r)}info(e,r){this.log("info",e,r)}warn(e,r){this.log("warn",e,r)}error(e,r){this.log("error",e,r)}fatal(e,r){this.log("fatal",e,r)}}function Be(s,e="debug"){return new Ns(s,e)}const js=T({id:x(),role:L(["user","assistant","system"]),content:x(),timestamp:G(),isStreaming:B().default(!1),streamingStartTime:R().optional(),metadata:A(x(),U()).optional(),toolCalls:I(Fe).optional()}),Cs=T({value:x(),isSubmitting:B(),attachedFiles:I(T({name:x(),path:x(),size:R(),mimeType:x()}))});T({sessionId:x().nullable(),isConnected:B(),isStreaming:B(),messages:I(js),input:Cs,error:x().nullable()});L(["disconnected","connecting","connected","error"]);class Ss{connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;messageQueue=[];currentSessionId=null;chunkResolvers=[];streamComplete=!1;sseAbortController=null;reconnectAttempts=0;maxReconnectAttempts=5;reconnectDelay=1e3;reconnecting=!1;abortController=null;options;constructor(e){this.options={...e,baseUrl:e.baseUrl.replace(/\/$/,"")}}async connect(){if(!this.connected)try{this.abortController=new AbortController;const e={protocolVersion:Bt,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},r=await this.sendRpcRequest("initialize",e);console.log("ACP connection initialized:",r);const n={cwd:"/",mcpServers:[]},o=await this.sendRpcRequest("session/new",n);this.currentSessionId=o.sessionId,console.log("Session created:",this.currentSessionId),await this.connectSSE(),this.connected=!0,this.reconnectAttempts=0}catch(e){this.connected=!1;const r=e instanceof Error?e:new Error(String(e));throw this.notifyError(r),r}}async disconnect(){if(this.connected)try{this.abortController&&(this.abortController.abort(),this.abortController=null),this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.connected=!1,this.currentSessionId=null,this.messageQueue=[],this.chunkResolvers=[],this.streamComplete=!1,this.reconnecting=!1,this.reconnectAttempts=0}catch(e){const r=e instanceof Error?e:new Error(String(e));throw this.notifyError(r),r}}async send(e){if(!this.connected||!this.currentSessionId)throw new Error("Transport not connected");try{this.streamComplete=!1,this.messageQueue=[];const r=e.content.filter(d=>d.type==="text").map(d=>d.text).join(`
|
|
6
|
+
`),n={sessionId:this.currentSessionId,prompt:[{type:"text",text:r}]},o=await this.sendRpcRequest("session/prompt",n);console.log("Prompt sent:",o),this.streamComplete=!0;const c=this.chunkResolvers.shift();c?c({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}):this.messageQueue.push({id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0})}catch(r){this.streamComplete=!0;const n=r instanceof Error?r:new Error(String(r));throw this.notifyError(n),n}}async*receive(){for(;!this.streamComplete;)if(this.messageQueue.length>0){const e=this.messageQueue.shift();if(e&&(yield e,e.isComplete))return}else{const e=await new Promise(r=>{this.chunkResolvers.push(r)});if(e.isComplete){yield e;return}else yield e}for(;this.messageQueue.length>0;){const e=this.messageQueue.shift();e&&(yield e)}yield{id:this.currentSessionId||"unknown",role:"assistant",contentDelta:{type:"text",text:""},isComplete:!0}}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}async sendRpcRequest(e,r){const o={jsonrpc:"2.0",id:this.generateRequestId(),method:e,params:r},c={"Content-Type":"application/json",...this.options.headers},d=this.options.timeout||3e4,f=new AbortController,p=setTimeout(()=>f.abort(),d);try{const a=await fetch(`${this.options.baseUrl}/rpc`,{method:"POST",headers:c,body:JSON.stringify(o),signal:f.signal});if(clearTimeout(p),!a.ok){const u=await a.text();throw new Error(`HTTP ${a.status}: ${u}`)}const l=await a.json();if(l.error)throw new Error(`ACP error: ${l.error.message||JSON.stringify(l.error)}`);return l.result||l}catch(a){throw clearTimeout(p),a instanceof Error&&a.name==="AbortError"?new Error(`Request timeout after ${d}ms`):a}}async connectSSE(){if(!this.currentSessionId)throw new Error("Cannot connect SSE without a session ID");const e=`${this.options.baseUrl}/events`,r={"X-Session-ID":this.currentSessionId,...this.options.headers};this.sseAbortController=new AbortController;try{const n=await fetch(e,{method:"GET",headers:r,signal:this.sseAbortController.signal});if(!n.ok)throw new Error(`SSE connection failed: HTTP ${n.status}`);if(!n.body)throw new Error("Response body is null");console.log("SSE connection opened"),this.reconnectAttempts=0,this.reconnectDelay=1e3;const o=n.body.getReader(),c=new TextDecoder;let d="";(async()=>{try{for(;;){const{done:f,value:p}=await o.read();if(f){console.log("SSE stream closed by server"),this.connected&&await this.handleSSEDisconnect();break}d+=c.decode(p,{stream:!0});const a=d.split(`
|
|
7
|
+
`);d=a.pop()||"";let l={event:"message",data:""};for(const u of a)u.startsWith("event:")?l.event=u.substring(6).trim():u.startsWith("data:")?l.data=u.substring(5).trim():u===""&&(l.event==="message"&&l.data&&this.handleSSEMessage(l.data),l={event:"message",data:""})}}catch(f){if(f instanceof Error&&f.name==="AbortError"){console.log("SSE stream aborted");return}console.error("Error reading SSE stream:",f),this.connected&&!this.reconnecting&&await this.handleSSEDisconnect()}})()}catch(n){throw console.error("SSE connection error:",n),n}}async handleSSEDisconnect(){if(this.reconnecting||!this.connected)return;if(this.reconnecting=!0,this.sseAbortController&&(this.sseAbortController.abort(),this.sseAbortController=null),this.reconnectAttempts>=this.maxReconnectAttempts){const r=new Error(`SSE reconnection failed after ${this.maxReconnectAttempts} attempts`);this.notifyError(r),this.connected=!1,this.reconnecting=!1;return}this.reconnectAttempts++;const e=Math.min(this.reconnectDelay*2**(this.reconnectAttempts-1),32e3);console.log(`SSE reconnecting in ${e}ms (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})`),await new Promise(r=>setTimeout(r,e));try{await this.connectSSE(),console.log("SSE reconnected successfully"),this.reconnecting=!1}catch(r){console.error("SSE reconnection failed:",r),this.reconnecting=!1}}handleSSEMessage(e){try{const r=JSON.parse(e);console.log("[HTTP Transport] Received SSE message:",r);const n=Vt.safeParse(r);if(!n.success){console.error("Invalid ACP message from SSE:",n.error.issues);return}const o=n.data;console.log("[HTTP Transport] Parsed ACP message, method:","method"in o?o.method:"(no method)"),"method"in o&&o.method==="session/update"&&(console.log("[HTTP Transport] This is a session/update notification"),"params"in o&&o.params&&(console.log("[HTTP Transport] Calling handleSessionNotification with params:",o.params),this.handleSessionNotification(o.params)))}catch(r){console.error("Error parsing SSE message:",r),this.notifyError(r instanceof Error?r:new Error(String(r)))}}handleSessionNotification(e){console.log("[HTTP Transport] handleSessionNotification called with:",e);const n=e.update,o=this.currentSessionId||e.sessionId;if(console.log("[HTTP Transport] update.sessionUpdate type:",n?.sessionUpdate),n?.sessionUpdate==="tool_call"){console.log("[HTTP Transport] tool_call - tokenUsage:",n.tokenUsage);const c=n._meta&&typeof n._meta=="object"&&"messageId"in n._meta?String(n._meta.messageId):void 0,d={id:n.toolCallId??"",title:n.title??"",kind:n.kind||"other",status:n.status||"pending",locations:n.locations,rawInput:n.rawInput,tokenUsage:n.tokenUsage,content:n.content?.map(p=>{if(typeof p!="object"||p===null)return{type:"text",text:""};const a=p;if(a.type==="content"&&typeof a.content=="object"&&a.content!==null){const l=a.content;if(l.type==="text")return{type:"content",content:{type:"text",text:typeof l.text=="string"?l.text:""}}}return a.type==="text"?{type:"text",text:typeof a.text=="string"?a.text:""}:a.type==="diff"?{type:"diff",path:typeof a.path=="string"?a.path:"",oldText:typeof a.oldText=="string"?a.oldText:"",newText:typeof a.newText=="string"?a.newText:"",line:typeof a.line=="number"?a.line:null}:a.type==="terminal"?{type:"terminal",terminalId:typeof a.terminalId=="string"?a.terminalId:""}:{type:"text",text:""}}),startedAt:Date.now()},f={type:"tool_call",sessionId:o,status:"active",toolCall:d,messageId:c};this.notifySessionUpdate(f)}else if(n?.sessionUpdate==="tool_call_update"){const c=n._meta&&typeof n._meta=="object"&&"messageId"in n._meta?String(n._meta.messageId):void 0,d={id:n.toolCallId??"",status:n.status,locations:n.locations,rawOutput:n.rawOutput,tokenUsage:n.tokenUsage,content:n.content?.map(p=>{if(typeof p!="object"||p===null)return{type:"text",text:""};const a=p;if(a.type==="content"&&typeof a.content=="object"&&a.content!==null){const l=a.content;if(l.type==="text")return{type:"content",content:{type:"text",text:typeof l.text=="string"?l.text:""}}}return a.type==="text"?{type:"text",text:typeof a.text=="string"?a.text:""}:a.type==="diff"?{type:"diff",path:typeof a.path=="string"?a.path:"",oldText:typeof a.oldText=="string"?a.oldText:"",newText:typeof a.newText=="string"?a.newText:"",line:typeof a.line=="number"?a.line:null}:a.type==="terminal"?{type:"terminal",terminalId:typeof a.terminalId=="string"?a.terminalId:""}:{type:"text",text:""}}),error:n.error,completedAt:n.status==="completed"||n.status==="failed"?Date.now():void 0},f={type:"tool_call_update",sessionId:o,status:"active",toolCallUpdate:d,messageId:c};console.log("[HTTP Transport] Notifying tool_call_update session update:",f),this.notifySessionUpdate(f)}else if(n&&"sessionUpdate"in n&&n.sessionUpdate==="tool_output"){const c=n,d=c._meta&&typeof c._meta=="object"&&"messageId"in c._meta?String(c._meta.messageId):void 0,f={id:c.toolCallId??"",rawOutput:c.rawOutput,content:c.content?.map(a=>{if(typeof a!="object"||a===null)return{type:"text",text:""};const l=a;if(l.type==="content"&&typeof l.content=="object"&&l.content!==null){const u=l.content;if(u.type==="text")return{type:"content",content:{type:"text",text:typeof u.text=="string"?u.text:""}}}return l.type==="text"?{type:"text",text:typeof l.text=="string"?l.text:""}:l.type==="diff"?{type:"diff",path:typeof l.path=="string"?l.path:"",oldText:typeof l.oldText=="string"?l.oldText:"",newText:typeof l.newText=="string"?l.newText:"",line:typeof l.line=="number"?l.line:null}:l.type==="terminal"?{type:"terminal",terminalId:typeof l.terminalId=="string"?l.terminalId:""}:{type:"text",text:""}})},p={type:"tool_call_update",sessionId:o,status:"active",toolCallUpdate:f,messageId:d};console.log("[HTTP Transport] Notifying tool_output as tool_call_update:",p),this.notifySessionUpdate(p)}else if(n?.sessionUpdate==="agent_message_chunk"){const c={type:"generic",sessionId:o,status:"active"},d=n.content;if(d&&typeof d=="object"){const f=d;let p=null;if(f.type==="text"&&typeof f.text=="string"&&(p={id:e.sessionId,role:"assistant",contentDelta:{type:"text",text:f.text},isComplete:!1}),p){const a=this.chunkResolvers.shift();a?a(p):this.messageQueue.push(p)}}this.notifySessionUpdate(c)}else{const c={type:"generic",sessionId:o,status:"active"};this.notifySessionUpdate(c)}}generateRequestId(){return`req-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}notifySessionUpdate(e){for(const r of this.sessionUpdateCallbacks)try{r(e)}catch(n){console.error("Error in session update callback:",n)}}notifyError(e){for(const r of this.errorCallbacks)try{r(e)}catch(n){console.error("Error in error callback:",n)}}}class Ts{constructor(){throw new Error("StdioTransport is not available in the browser. Use HttpTransport or WebSocketTransport instead.")}async connect(){throw new Error("StdioTransport not available in browser")}async disconnect(){}async send(){throw new Error("StdioTransport not available in browser")}async*receive(){throw new Error("StdioTransport not available in browser")}isConnected(){return!1}onSessionUpdate(){return()=>{}}onError(){return()=>{}}}class Is{ws=null;connected=!1;sessionUpdateCallbacks=new Set;errorCallbacks=new Set;constructor(e){}async connect(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async disconnect(){this.ws&&(this.ws.close(),this.ws=null),this.connected=!1}async send(e){throw!this.connected||!this.ws?new Error("Transport not connected"):new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}async*receive(){throw new Error("WebSocketTransport not yet implemented. Waiting for HTTP ACP server.")}isConnected(){return this.connected}onSessionUpdate(e){return this.sessionUpdateCallbacks.add(e),()=>{this.sessionUpdateCallbacks.delete(e)}}onError(e){return this.errorCallbacks.add(e),()=>{this.errorCallbacks.delete(e)}}}class Es{config;transport;sessions=new Map;currentSessionId=null;sessionUpdateHandlers=new Set;errorHandlers=new Set;constructor(e){this.config=e,this.transport=this.createTransport(),this.setupTransportListeners(),e.autoConnect&&this.connect().catch(r=>{console.error("Failed to auto-connect:",r)})}async connect(){await this.transport.connect()}async disconnect(){await this.transport.disconnect(),this.currentSessionId=null}isConnected(){return this.transport.isConnected()}async startSession(e){const r=this.generateSessionId(),n=new Date().toISOString(),o={id:r,status:"connecting",config:e?{...e,agentPath:e.agentPath||""}:{agentPath:""},messages:[],metadata:{startedAt:n}};return this.sessions.set(r,o),this.currentSessionId=r,this.updateSessionStatus(r,"connected"),r}async sendMessage(e,r){const n=r||this.currentSessionId;if(!n)throw new Error("No active session. Start a session first.");if(!this.transport.isConnected())throw new Error("Transport not connected");const o=this.sessions.get(n);if(!o)throw new Error(`Session ${n} not found`);const c={id:this.generateMessageId(),role:"user",content:[{type:"text",text:e}],timestamp:new Date().toISOString()};o.messages.push(c),this.updateSessionStatus(n,"active"),await this.transport.send(c)}async*receiveMessages(){if(!this.transport.isConnected())throw new Error("Transport not connected");yield*this.transport.receive()}getSession(e){return this.sessions.get(e)}getCurrentSession(){return this.currentSessionId?this.sessions.get(this.currentSessionId):void 0}getAllSessions(){return Array.from(this.sessions.values())}onSessionUpdate(e){return this.sessionUpdateHandlers.add(e),()=>{this.sessionUpdateHandlers.delete(e)}}onError(e){return this.errorHandlers.add(e),()=>{this.errorHandlers.delete(e)}}createTransport(){switch(this.config.type){case"stdio":return new Ts(this.config.options);case"http":return new Ss(this.config.options);case"websocket":return new Is(this.config.options);default:throw new Error(`Unknown transport type: ${this.config.type}`)}}setupTransportListeners(){this.transport.onSessionUpdate(e=>{this.handleSessionUpdate(e)}),this.transport.onError(e=>{this.handleError(e)})}handleSessionUpdate(e){if(e.sessionId){const r=this.sessions.get(e.sessionId);r&&(e.status&&(r.status=e.status),e.message&&r.messages.push(e.message),e.error&&(r.error=e.error))}for(const r of this.sessionUpdateHandlers)try{r(e)}catch(n){console.error("Error in session update handler:",n)}}handleError(e){for(const r of this.errorHandlers)try{r(e)}catch(n){console.error("Error in error handler:",n)}}updateSessionStatus(e,r){const n=this.sessions.get(e);n&&(n.status=r,this.handleSessionUpdate({sessionId:e,status:r}))}generateSessionId(){return`session_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}generateMessageId(){return`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}}const Rs=T({name:x(),description:x().optional(),parameters:A(x(),U()).optional()}),ks=T({name:x(),description:x(),parameters:A(x(),U()),required:I(x()).optional()}),Ms=T({name:x(),version:x().optional(),description:x().optional(),author:x().optional(),capabilities:I(Rs).optional(),tools:I(ks).optional(),supportedFormats:I(x()).optional()}),As=L(["initializing","ready","busy","error","terminated"]);T({status:As,info:Ms.optional(),pid:R().optional(),error:x().optional(),uptime:R().optional()});const Ve=L(["user","assistant","system","tool"]),Us=L(["text","image","file","tool_call","tool_result"]),W=T({type:Us}),Ds=W.extend({type:E("text"),text:x()}),Ps=W.extend({type:E("image"),url:x().url().optional(),data:x().optional(),mimeType:x().optional()}),Ls=W.extend({type:E("file"),name:x(),path:x().optional(),url:x().url().optional(),mimeType:x(),size:R().optional()}),Hs=W.extend({type:E("tool_call"),id:x(),name:x(),arguments:A(x(),U())}),zs=W.extend({type:E("tool_result"),callId:x(),result:U(),error:x().optional()}),qe=ce("type",[Ds,Ps,Ls,Hs,zs]),We=T({id:x(),role:Ve,content:I(qe),timestamp:G(),metadata:A(x(),U()).optional()});T({id:x(),role:Ve,contentDelta:qe,isComplete:B()});const Qe=L(["idle","connecting","connected","active","streaming","error","disconnected"]),_s=T({agentPath:x(),agentArgs:I(x()).optional(),environment:A(x(),x()).optional(),workingDirectory:x().optional(),timeout:R().optional()}),Os=T({agentName:x().optional(),agentVersion:x().optional(),capabilities:I(x()).optional(),startedAt:G(),lastActivityAt:G().optional()});T({id:x(),status:Qe,config:_s,metadata:Os.optional(),messages:I(We),error:x().optional()});const J=T({sessionId:x(),status:Qe.optional(),message:We.optional(),error:x().optional()}),Fs=J.extend({type:E("tool_call"),toolCall:Fe,messageId:x().optional()}),$s=J.extend({type:E("tool_call_update"),toolCallUpdate:gs,messageId:x().optional()}),Bs=J.extend({type:E("tool_output"),toolOutput:T({id:x(),content:I(zt()).optional(),rawOutput:A(x(),U()).optional()}),messageId:x().optional()}),Vs=J.extend({type:E("generic").optional()});_t([Fs,$s,Bs,Vs]);function m(...s){return Ot(Ft(s))}const qs=H("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Q=i.forwardRef(({className:s,variant:e,size:r,asChild:n=!1,...o},c)=>{const d=n?q:"button";return t.jsx(d,{className:m(qs({variant:e,size:r,className:s})),ref:c,...o})});Q.displayName="Button";const Ws=i.forwardRef(({className:s,...e},r)=>t.jsx("div",{ref:r,className:m("rounded-lg border bg-card text-card-foreground shadow-sm",s),...e}));Ws.displayName="Card";const Qs=i.forwardRef(({className:s,...e},r)=>t.jsx("div",{ref:r,className:m("flex flex-col space-y-1.5 p-6",s),...e}));Qs.displayName="CardHeader";const Ks=i.forwardRef(({className:s,...e},r)=>t.jsx("div",{ref:r,className:m("text-2xl font-semibold leading-none tracking-tight",s),...e}));Ks.displayName="CardTitle";const Gs=i.forwardRef(({className:s,...e},r)=>t.jsx("div",{ref:r,className:m("text-sm text-muted-foreground",s),...e}));Gs.displayName="CardDescription";const Ys=i.forwardRef(({className:s,...e},r)=>t.jsx("div",{ref:r,className:m("p-6 pt-0",s),...e}));Ys.displayName="CardContent";const Js=i.forwardRef(({className:s,...e},r)=>t.jsx("div",{ref:r,className:m("flex items-center p-6 pt-0",s),...e}));Js.displayName="CardFooter";const Ke=i.createContext(void 0),Ge=()=>{const s=i.useContext(Ke);if(!s)throw new Error("ChatHeader components must be used within ChatHeader.Root");return s},Xs=i.forwardRef(({defaultExpanded:s=!1,expanded:e,onExpandedChange:r,className:n,children:o,...c},d)=>{const[f,p]=i.useState(s),a=e??f,l=i.useCallback(b=>{p(b),r?.(b)},[r]),u=i.Children.toArray(o),h=u.find(b=>i.isValidElement(b)&&typeof b.type=="function"&&b.type.displayName==="ChatHeader.ExpandablePanel"),g=u.filter(b=>b!==h);return t.jsxs(Ke.Provider,{value:{isExpanded:a,setIsExpanded:l},children:[t.jsx("div",{ref:d,className:m("flex items-center justify-between px-6 py-4",n),...c,children:g}),h]})});Xs.displayName="ChatHeader.Root";const Zs=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("h1",{ref:n,className:m("m-0 text-xl font-semibold",s),...r,children:e}));Zs.displayName="ChatHeader.Title";const en=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("div",{ref:n,className:m("flex items-center gap-3",s),...r,children:e}));en.displayName="ChatHeader.Actions";const tn=s=>{switch(s){case"connected":return"bg-green-500";case"connecting":return"bg-yellow-500";case"error":return"bg-red-500";default:return"bg-gray-500"}},sn=s=>{switch(s){case"connected":return"Connected";case"connecting":return"Connecting...";case"error":return"Connection Error";default:return"No Server"}},nn=i.forwardRef(({status:s,statusText:e,className:r,...n},o)=>{const c=e??sn(s),d=tn(s);return t.jsxs("div",{ref:o,className:m("flex items-center gap-2",r),...n,children:[t.jsx("div",{className:m("h-2 w-2 rounded-full",d)}),t.jsx("span",{className:"text-sm text-muted-foreground",children:c})]})});nn.displayName="ChatHeader.StatusIndicator";const rn=i.forwardRef(({icon:s,className:e,children:r,onClick:n,...o},c)=>{const{isExpanded:d,setIsExpanded:f}=Ge(),p=a=>{f(!d),n?.(a)};return t.jsxs("button",{ref:c,type:"button",onClick:p,className:m("rounded p-1 transition-colors hover:bg-background lg:hidden",e),"aria-label":d?"Collapse header":"Expand header",...o,children:[s&&t.jsx("div",{className:m("transition-transform duration-200",d&&"rotate-180"),children:s}),r]})});rn.displayName="ChatHeader.Toggle";const on=i.forwardRef(({className:s,children:e,...r},n)=>{const{isExpanded:o}=Ge();return o?t.jsx("div",{ref:n,className:m("absolute top-full left-0 right-0 z-50 border-b border-border bg-card px-6 py-4 shadow-lg lg:hidden",s),...r,children:e}):null});on.displayName="ChatHeader.ExpandablePanel";const Ye=i.forwardRef(({commands:s=[],showCommandMenu:e,commandMenuQuery:r,selectedMenuIndex:n,setSelectedMenuIndex:o,setMenuItemCount:c,triggerCounter:d,onChange:f,className:p,...a},l)=>{const u=i.useCallback((g,b)=>{const j=g.toLowerCase(),N=b.toLowerCase();if(!b)return 1;if(j.includes(N))return 1-N.length/j.length;let y=0;for(let w=0;w<j.length&&y<N.length;w++)j[w]===N[y]&&y++;return y===N.length?.5-y/j.length:0},[]),h=i.useMemo(()=>s.map(g=>({...g,score:Math.max(u(g.label,r),g.description?u(g.description,r):0)})).filter(g=>g.score>0).sort((g,b)=>b.score-g.score),[s,r,u]);return i.useEffect(()=>{c(h.length)},[h.length,c]),i.useEffect(()=>{o(0)},[o]),i.useEffect(()=>{d>0&&h[n]&&(h[n].onSelect(),f(""))},[d,h,n,f]),!e||h.length===0?null:t.jsxs("div",{ref:l,className:m("absolute bottom-full left-0 z-50 mb-2 w-full max-w-md","rounded-md border border-border bg-card p-2 shadow-lg",p),...a,children:[t.jsx("div",{className:"text-xs font-semibold text-muted-foreground px-2 py-1",children:"Commands"}),t.jsx("div",{className:"max-h-64 overflow-y-auto",children:h.map((g,b)=>t.jsxs("button",{type:"button",onClick:()=>g.onSelect(),className:m("w-full rounded-sm px-2 py-2 text-left text-sm transition-colors","flex items-start gap-2","hover:bg-muted",b===n&&"bg-muted"),children:[g.icon&&t.jsx("span",{className:"shrink-0 mt-0.5",children:g.icon}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"font-medium",children:g.label}),g.description&&t.jsx("div",{className:"text-xs text-muted-foreground truncate",children:g.description})]})]},g.id))})]})});Ye.displayName="ChatInputCommandMenu";const Je=i.createContext(void 0),X=()=>{const s=i.useContext(Je);if(!s)throw new Error("ChatInput components must be used within ChatInput.Root");return s},Xe=i.forwardRef(({client:s,value:e,onChange:r,onSubmit:n,disabled:o=!1,isSubmitting:c,submitOnEnter:d=!0,className:f,children:p,...a},l)=>{const u=i.useRef(null),h=bs(s??null),g=S(P=>P.isStreaming),b=h?h.value:e||"",j=h?h.onChange:r||(()=>{}),N=h?h.onSubmit:n||(async()=>{}),y=h?h.isSubmitting||g:c||!1,[w,v]=i.useState(!1),[k,z]=i.useState(""),[_,C]=i.useState(0),[M,D]=i.useState(0),[Z,ee]=i.useState(0),Rt=i.useCallback(()=>{ee(P=>P+1)},[]),kt=async P=>{P.preventDefault(),b.trim()&&!y&&!o&&(await N(),setTimeout(()=>{u.current?.focus()},0))};return i.useEffect(()=>{const P=document.querySelector('textarea[name="chat-input"]');P&&u.current!==P&&(u.current=P)},[]),i.useEffect(()=>{!b&&u.current&&(u.current.style.height="auto",u.current.style.overflowY="hidden")},[b]),t.jsx(Je.Provider,{value:{value:b,onChange:j,onSubmit:N,disabled:o,isSubmitting:y,submitOnEnter:d,showCommandMenu:w,setShowCommandMenu:v,commandMenuQuery:k,setCommandMenuQuery:z,selectedMenuIndex:_,setSelectedMenuIndex:C,menuItemCount:M,setMenuItemCount:D,triggerMenuSelect:Rt,triggerCounter:Z},children:t.jsx("form",{ref:l,onSubmit:kt,className:m("relative w-full divide-y rounded-xl border bg-background shadow-md",f),...a,children:p})})});Xe.displayName="ChatInput.Root";const Ze=i.forwardRef(({asChild:s=!1,className:e,onKeyDown:r,children:n,...o},c)=>{const{value:d,onChange:f,onSubmit:p,disabled:a,isSubmitting:l,submitOnEnter:u,showCommandMenu:h,setShowCommandMenu:g,setCommandMenuQuery:b,setSelectedMenuIndex:j,menuItemCount:N,triggerMenuSelect:y}=X(),w=i.useRef(null),_={ref:i.useCallback(C=>{w.current=C,typeof c=="function"?c(C):c&&(c.current=C)},[c]),name:"chat-input",value:d,onChange:C=>{const M=C.target.value;if(f(M),M.startsWith("/")&&!M.includes(`
|
|
8
|
+
`)){g(!0);const ee=M.slice(1);b(ee)}else g(!1),b("");const D=w.current;if(!D)return;D.style.height="auto";const Z=Math.min(D.scrollHeight,164);D.style.height=`${Z}px`,D.scrollHeight>164?D.style.overflowY="auto":D.style.overflowY="hidden"},onKeyDown:C=>{if(h&&N>0){if(C.key==="ArrowDown"){C.preventDefault(),j(M=>(M+1)%N);return}else if(C.key==="ArrowUp"){C.preventDefault(),j(M=>(M-1+N)%N);return}else if(C.key==="Enter"&&!C.shiftKey){C.preventDefault(),y();return}else if(C.key==="Escape"){C.preventDefault(),g(!1),b("");return}}u&&C.key==="Enter"&&!C.shiftKey&&(d.trim()&&!l&&!a?(C.preventDefault(),p()):(l||a)&&C.preventDefault()),r?.(C)},disabled:a,...o};return s&&i.isValidElement(n)?i.cloneElement(n,_):t.jsx("textarea",{..._,className:m("w-full resize-none rounded-none border-none p-4 shadow-none","outline-none ring-0 field-sizing-content max-h-[6lh]","bg-transparent dark:bg-transparent focus-visible:ring-0","text-sm placeholder:text-muted-foreground","disabled:cursor-not-allowed disabled:opacity-50",e)})});Ze.displayName="ChatInput.Field";const et=i.forwardRef(({asChild:s=!1,className:e,disabled:r,children:n,...o},c)=>{const{value:d,disabled:f,isSubmitting:p}=X(),a=r||f||p||!d.trim(),l=s?q:Q;return t.jsx(l,{ref:c,type:"submit",disabled:a,variant:s?void 0:"default",size:"icon",className:m(!s&&"gap-1.5 rounded-full",e),...o,children:n})});et.displayName="ChatInput.Submit";const tt=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("div",{ref:n,className:m("flex items-center justify-between p-2",s),...r,children:e}));tt.displayName="ChatInput.Toolbar";const st=i.forwardRef(({asChild:s=!1,className:e,children:r,onClick:n,...o},c)=>{const{value:d,onChange:f,setShowCommandMenu:p,setCommandMenuQuery:a}=X(),l=h=>{d.startsWith("/")||(f("/"),p(!0),a("")),n?.(h)},u=s?q:Q;return t.jsx(u,{ref:c,type:"button",variant:"ghost",size:"icon",className:m("rounded-full",e),onClick:l,...o,children:r||t.jsx(es,{className:"size-4"})})});st.displayName="ChatInput.Actions";const nt=i.forwardRef(({asChild:s=!1,className:e,children:r,...n},o)=>{const c=s?q:Q;return t.jsx(c,{ref:o,type:"button",variant:"ghost",size:"icon",className:m("rounded-full",e),...n,children:r||t.jsx(ts,{className:"size-4"})})});nt.displayName="ChatInput.Attachment";const rt=i.forwardRef(({asChild:s=!1,className:e,children:r,...n},o)=>{const c=s?q:Q;return t.jsx(c,{ref:o,type:"button",variant:"ghost",size:"icon",className:m("rounded-full",e),...n,children:r||t.jsx(ss,{className:"size-4"})})});rt.displayName="ChatInput.VoiceInput";const ot=i.forwardRef(({commands:s=[],className:e,onChange:r,...n},o)=>{const{showCommandMenu:c,commandMenuQuery:d,selectedMenuIndex:f,setSelectedMenuIndex:p,setMenuItemCount:a,triggerCounter:l,onChange:u}=X();return t.jsx(Ye,{ref:o,commands:s,showCommandMenu:c,commandMenuQuery:d,selectedMenuIndex:f,setSelectedMenuIndex:p,setMenuItemCount:a,triggerCounter:l,onChange:u,className:e,...n})});ot.displayName="ChatInput.CommandMenu";const an=({className:s,...e})=>t.jsx(Mt,{className:m("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",s),...e}),at=({className:s,...e})=>t.jsx(At,{className:m(s),...e}),ln=({withHandle:s,className:e,...r})=>t.jsx(Ut,{className:m("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...r,children:s&&t.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-2.5 w-2.5",children:[t.jsx("title",{children:"Resize Handle"}),t.jsx("circle",{cx:"9",cy:"12",r:"1"}),t.jsx("circle",{cx:"9",cy:"5",r:"1"}),t.jsx("circle",{cx:"9",cy:"19",r:"1"}),t.jsx("circle",{cx:"15",cy:"12",r:"1"}),t.jsx("circle",{cx:"15",cy:"5",r:"1"}),t.jsx("circle",{cx:"15",cy:"19",r:"1"})]})})}),cn=({...s})=>t.jsx($t,{position:"top-center",className:"toaster group",style:{"--top-offset":"16px","--width:":"calc(100% - 2 * var(--top-offset))",position:"absolute",zIndex:5,top:"var(--top-offset)",left:"50%",transform:"translateX(-50%)",width:"calc(100% - 2 * var(--top-offset))",maxWidth:"480px"},offset:0,toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...s}),it=i.createContext(void 0),lt=()=>{const s=i.useContext(it);if(!s)throw new Error("ChatLayout components must be used within ChatLayout.Root");return s},ct=i.forwardRef(({defaultSidebarOpen:s=!1,defaultPanelSize:e="hidden",defaultActiveTab:r="todo",className:n,children:o,...c},d)=>{const[f,p]=i.useState(s),[a,l]=i.useState(e),[u,h]=i.useState(r);return t.jsx(it.Provider,{value:{sidebarOpen:f,setSidebarOpen:p,panelSize:a,setPanelSize:l,activeTab:u,setActiveTab:h},children:t.jsx("div",{ref:d,className:m("flex h-screen flex-row bg-background text-foreground",n),...c,children:t.jsx(an,{direction:"horizontal",className:"flex-1",children:o})})})});ct.displayName="ChatLayout.Root";const dn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("div",{ref:n,className:m("relative z-10 border-b border-border bg-card shrink-0",s),...r,children:e}));dn.displayName="ChatLayout.Header";const dt=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx(at,{defaultSize:75,minSize:50,children:t.jsx("div",{ref:n,className:m("flex flex-1 flex-col overflow-hidden h-full",s),...r,children:e})}));dt.displayName="ChatLayout.Main";const ut=i.forwardRef(({showToaster:s=!0,className:e,children:r,...n},o)=>t.jsxs("div",{ref:o,className:m("relative flex flex-1 flex-col overflow-hidden",e),...n,children:[r,s&&t.jsx(cn,{})]}));ut.displayName="ChatLayout.Body";const ft=i.forwardRef(({className:s,children:e,onScrollChange:r,showScrollToBottom:n=!0,...o},c)=>{const[d,f]=i.useState(!1),p=i.useRef(null);i.useImperativeHandle(c,()=>p.current);const a=i.useCallback(()=>{const h=p.current;if(!h)return;const{scrollTop:g,scrollHeight:b,clientHeight:j}=h,y=b-g-j<100;f(!y&&n),r?.(y)},[r,n]),l=i.useCallback(()=>{a()},[a]),u=i.useCallback(()=>{const h=p.current;h&&h.scrollTo({top:h.scrollHeight,behavior:"smooth"})},[]);return i.useEffect(()=>{a()},[a]),t.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[t.jsx("div",{ref:p,className:m("h-full overflow-y-auto",s),onScroll:l,...o,children:e}),d&&t.jsx("button",{type:"button",onClick:u,className:m("absolute bottom-4 left-1/2 -translate-x-1/2 z-10","flex items-center justify-center p-2 rounded-full","bg-card border border-border shadow-lg","text-foreground","hover:bg-accent hover:text-accent-foreground","transition-all duration-200 ease-in-out","animate-in fade-in slide-in-from-bottom-2"),"aria-label":"Scroll to bottom",children:t.jsx(ns,{className:"h-4 w-4"})})]})});ft.displayName="ChatLayout.Messages";const pt=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("div",{ref:n,className:m("bg-linear-to-t from-background to-transparent px-4 pb-4",s),...r,children:e}));pt.displayName="ChatLayout.Footer";const un=i.forwardRef(({className:s,children:e,...r},n)=>{const{sidebarOpen:o}=lt();return o?t.jsx("div",{ref:n,className:m("border-r border-border bg-card w-64 overflow-y-auto",s),...r,children:e}):null});un.displayName="ChatLayout.Sidebar";const mt=i.forwardRef(({breakpoint:s="lg",className:e,children:r,...n},o)=>{const{panelSize:c}=lt();return c==="hidden"?null:t.jsxs(t.Fragment,{children:[t.jsx(ln,{withHandle:!0}),t.jsx(at,{defaultSize:25,minSize:15,maxSize:50,children:t.jsx("div",{ref:o,className:m("hidden h-full border-l border-border bg-card overflow-y-auto transition-all duration-300",s==="md"&&"md:block",s==="lg"&&"lg:block",s==="xl"&&"xl:block",s==="2xl"&&"2xl:block",e),...n,children:r})})]})});mt.displayName="ChatLayout.Aside";const ht=i.forwardRef(({todos:s,className:e,...r},n)=>t.jsx("div",{ref:n,className:m("space-y-2",e),...r,children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No todos yet"})}):s.map(o=>t.jsx("div",{className:"text-sm",children:o.text},o.id))}));ht.displayName="TodoTabContent";const xt=i.forwardRef(({files:s=[],className:e,...r},n)=>t.jsx("div",{ref:n,className:m("space-y-2",e),...r,children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full min-h-[200px]",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No files attached"})}):s.map(o=>t.jsx("div",{className:"text-sm",children:o},o))}));xt.displayName="FilesTabContent";const fn=i.forwardRef(({data:s,className:e,...r},n)=>t.jsxs("div",{ref:n,className:m("space-y-4",e),...r,children:[t.jsx("h3",{className:"font-semibold text-lg",children:"Database"}),t.jsxs("div",{className:"text-sm text-muted-foreground",children:[t.jsx("p",{children:"Database viewer - panel automatically expanded to large size"}),t.jsxs("div",{className:"mt-4 p-4 border border-border rounded",children:[t.jsx("p",{children:"Your large data table would go here"}),s&&typeof s=="object"?t.jsx("pre",{className:"mt-2 text-xs overflow-auto",children:JSON.stringify(s,null,2)}):null]})]})]}));fn.displayName="DatabaseTabContent";const gt=qt,Y=i.forwardRef(({className:s,...e},r)=>t.jsx(de,{ref:r,className:m("inline-flex h-10 items-center rounded-md bg-muted p-1 text-muted-foreground gap-1",s),...e}));Y.displayName=de.displayName;const V=i.forwardRef(({className:s,...e},r)=>t.jsx(ue,{ref:r,className:m("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...e}));V.displayName=ue.displayName;const F=i.forwardRef(({className:s,...e},r)=>t.jsx(fe,{ref:r,className:m("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...e}));F.displayName=fe.displayName;const bt=i.forwardRef(({todo:s,className:e,...r},n)=>t.jsx("div",{ref:n,className:m("flex items-center gap-3 px-3 py-2 rounded-lg",e),...r,children:t.jsx("span",{className:m("flex-1 text-[var(--font-size)] font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"shimmer-animation"),children:s.text})}));bt.displayName="TodoListItem";const yt=i.forwardRef(({client:s,todos:e,className:r,...n},o)=>{const c=e||[];return t.jsx("div",{ref:o,className:m("space-y-2 max-h-64 overflow-y-auto",r),...n,children:c.length===0?t.jsx("p",{className:"text-sm text-foreground opacity-60 italic",children:"No tasks yet."}):c.map(d=>t.jsx(bt,{todo:d},d.id))})});yt.displayName="TodoList";const pn=i.forwardRef(({client:s,todos:e,className:r,...n},o)=>{const c=e||[],[d,f]=i.useState("todo"),p=i.useRef(null),a=i.useRef(null);i.useEffect(()=>{const h=setTimeout(()=>{const g=p.current;if(d&&g){const b=a.current;if(b){const j=g.getBoundingClientRect(),N=b.getBoundingClientRect(),y=N.left-j.left,w=N.width,v=y/j.width*100,k=100-(y+w)/j.width*100;g.style.clipPath=`inset(0 ${k.toFixed(2)}% 0 ${v.toFixed(2)}% round 999px)`}}},0);return()=>clearTimeout(h)},[d]);const l=[{id:"todo",label:"To-Do List"},{id:"files",label:"Files"},{id:"database",label:"Database"}];return t.jsx("div",{ref:o,className:m("select-none",r),...n,children:t.jsxs(gt,{value:d,onValueChange:f,className:"w-full",children:[t.jsxs("div",{className:"relative mb-4 border-border",children:[t.jsx(Y,{className:"bg-transparent p-0 h-auto rounded-none w-full border-none",children:l.map(u=>t.jsx(V,{value:u.id,className:"px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:u.label},u.id))}),t.jsx("div",{ref:p,className:"absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none",style:{clipPath:"inset(0 100% 0 0% round 999px)",transition:"clip-path 0.25s ease-out"},children:t.jsx(Y,{className:"bg-secondary p-0 h-auto rounded-none w-full border-none",children:l.map(u=>t.jsx(V,{value:u.id,ref:d===u.id?a:null,className:"px-3 py-1 text-sm font-[var(--font-family)] font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none",tabIndex:-1,children:u.label},u.id))})})]}),t.jsx(F,{value:"todo",children:t.jsx(yt,{todos:c})}),t.jsx(F,{value:"files",children:t.jsx("div",{className:"text-sm text-foreground opacity-60 italic",children:"Files tab coming soon..."})}),t.jsx(F,{value:"database",children:t.jsx("div",{className:"text-sm text-foreground opacity-60 italic",children:"Database tab coming soon..."})})]})})});pn.displayName="ChatSecondaryPanel";const mn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("div",{ref:n,className:m("flex h-full flex-col",s),...r,children:e}));mn.displayName="ChatSidebar.Root";const hn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("div",{ref:n,className:m("border-b border-border px-4 py-3",s),...r,children:e}));hn.displayName="ChatSidebar.Header";const xn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("div",{ref:n,className:m("flex-1 overflow-y-auto p-4",s),...r,children:e}));xn.displayName="ChatSidebar.Content";const gn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsx("div",{ref:n,className:m("border-t border-border px-4 py-3",s),...r,children:e}));gn.displayName="ChatSidebar.Footer";const bn=i.forwardRef(({children:s,className:e,...r},n)=>{const[o,c]=i.useState(s),[d,f]=i.useState(!1),p=i.useRef(s),a=i.useRef(!0);return i.useEffect(()=>{if(a.current){a.current=!1,p.current=s;return}if(p.current===s)return;f(!0);const l=setTimeout(()=>{c(s),p.current=s,requestAnimationFrame(()=>{f(!1)})},150);return()=>{clearTimeout(l)}},[s]),t.jsx("span",{ref:n,className:m("text-sm text-foreground opacity-60 transition-opacity duration-300",d?"opacity-0":"opacity-60",e),...r,children:o})});bn.displayName="ChatStatus";const yn=i.forwardRef(({autoScroll:s=!0,isStreaming:e=!1,scrollBehavior:r="smooth",scrollThreshold:n=100,showScrollButton:o=!0,scrollButton:c,className:d,children:f,...p},a)=>{const l=i.useRef(null),[u,h]=i.useState(!0),[g,b]=i.useState(!1),j=i.useRef(0);i.useImperativeHandle(a,()=>{if(!l.current)throw new Error("Container ref not initialized");return l.current});const N=i.useCallback(()=>{const w=l.current;if(!w)return;const{scrollTop:v,scrollHeight:k,clientHeight:z}=w,C=k-v-z<n;h(C),b(!C&&o),j.current=v},[n,o]),y=i.useCallback((w=r)=>{const v=l.current;v&&v.scrollTo({top:v.scrollHeight,behavior:w})},[r]);return i.useEffect(()=>{!s||!l.current||(e&&u?y("auto"):!e&&u&&y())},[s,e,u,y]),i.useEffect(()=>{const w=l.current;if(!w)return;const v=()=>{N()};return w.addEventListener("scroll",v,{passive:!0}),N(),()=>{w.removeEventListener("scroll",v)}},[N]),i.useEffect(()=>{const w=l.current;if(!w)return;const v=new ResizeObserver(()=>{u&&s&&y("auto")});return v.observe(w),()=>{v.disconnect()}},[u,s,y]),t.jsxs("div",{className:"relative flex-1",children:[t.jsx("div",{ref:l,className:m("h-full overflow-y-auto overflow-x-hidden","scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent",d),...p,children:t.jsx("div",{className:"flex flex-col gap-4 px-4 py-4",children:f})}),g&&t.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10",children:c||t.jsxs("button",{type:"button",onClick:()=>y(),className:"px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2","aria-label":"Scroll to bottom",children:[t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Down arrow",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})}),"Scroll to bottom"]})})]})});yn.displayName="Conversation";const wn=Wt,wt=i.forwardRef(({className:s,...e},r)=>t.jsx(pe,{ref:r,className:m("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",s),...e}));wt.displayName=pe.displayName;const vn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsxs(wn,{children:[t.jsx(wt,{}),t.jsxs(me,{ref:n,className:m("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",s),...r,children:[e,t.jsxs(Qt,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(rs,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vn.displayName=me.displayName;const Nn=i.forwardRef(({className:s,...e},r)=>t.jsx(he,{ref:r,className:m("text-lg font-semibold leading-none tracking-tight",s),...e}));Nn.displayName=he.displayName;const jn=i.forwardRef(({className:s,...e},r)=>t.jsx(xe,{ref:r,className:m("text-sm text-muted-foreground",s),...e}));jn.displayName=xe.displayName;const Cn=i.forwardRef(({className:s,inset:e,children:r,...n},o)=>t.jsxs(ge,{ref:o,className:m("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-muted data-[state=open]:bg-muted",e&&"pl-8",s),...n,children:[r,t.jsx(os,{className:"ml-auto h-4 w-4"})]}));Cn.displayName=ge.displayName;const Sn=i.forwardRef(({className:s,...e},r)=>t.jsx(be,{ref:r,className:m("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 shadow-lg","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",s),...e}));Sn.displayName=be.displayName;const Tn=i.forwardRef(({className:s,sideOffset:e=4,...r},n)=>t.jsx(Kt,{children:t.jsx(ye,{ref:n,sideOffset:e,className:m("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card p-1 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",s),...r})}));Tn.displayName=ye.displayName;const In=i.forwardRef(({className:s,inset:e,...r},n)=>t.jsx(we,{ref:n,className:m("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",s),...r}));In.displayName=we.displayName;const En=i.forwardRef(({className:s,children:e,...r},n)=>t.jsxs(ve,{ref:n,className:m("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ne,{children:t.jsx(De,{className:"h-4 w-4"})})}),e]}));En.displayName=ve.displayName;const Rn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsxs(je,{ref:n,className:m("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors","focus:bg-muted focus:text-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ne,{children:t.jsx(Pe,{className:"h-2 w-2 fill-current"})})}),e]}));Rn.displayName=je.displayName;const kn=i.forwardRef(({className:s,inset:e,...r},n)=>t.jsx(Ce,{ref:n,className:m("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",s),...r}));kn.displayName=Ce.displayName;const Mn=i.forwardRef(({className:s,...e},r)=>t.jsx(Se,{ref:r,className:m("-mx-1 my-1 h-px bg-border",s),...e}));Mn.displayName=Se.displayName;const An=H("flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),Un=i.forwardRef(({className:s,type:e,variant:r,...n},o)=>t.jsx("input",{type:e,className:m(An({variant:r,className:s})),ref:o,...n}));Un.displayName="Input";const Dn=i.forwardRef(({className:s,...e},r)=>t.jsx(Te,{ref:r,className:m("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...e}));Dn.displayName=Te.displayName;const Pn=H("flex animate-fadeIn",{variants:{role:{user:"max-w-[80%] self-end ml-auto mr-2",assistant:"self-start mr-auto",system:"self-start mr-auto max-w-full"},layout:{default:"",full:"max-w-full",compact:"max-w-[90%]"}},defaultVariants:{role:"assistant",layout:"default"}}),vt=i.forwardRef(({message:s,role:e,layout:r,className:n,children:o,messageId:c,autoScroll:d,isLastMessage:f=!1,...p},a)=>{const l=s?s.role:e||"assistant",u=s?s.id:c,h=i.useRef(null),[g,b]=i.useState(void 0);return i.useImperativeHandle(a,()=>h.current),i.useEffect(()=>{if(!f||l!=="assistant"){b(void 0);return}const j=()=>{const y=h.current;if(!y)return;let w=y.parentElement;for(;w&&!w.classList.contains("overflow-y-auto");)w=w.parentElement;if(!w)return;const v=y.previousElementSibling;if(!v||v.getAttribute("aria-label")!=="user message"){b(void 0);return}const k=w.clientHeight,z=v.offsetHeight,C=Math.max(0,k-z-32);b(C)};j();const N=new ResizeObserver(j);if(h.current){N.observe(h.current);let y=h.current.parentElement;for(;y&&!y.classList.contains("overflow-y-auto");)y=y.parentElement;y&&N.observe(y)}return()=>N.disconnect()},[f,l]),i.useEffect(()=>{if((d!==void 0?d:l==="user")&&h.current){const N=setTimeout(()=>{h.current?.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},50);return()=>clearTimeout(N)}},[l,d]),t.jsx("article",{ref:h,"aria-label":`${l} message`,"data-message-id":u,className:m(Pn({role:l,layout:r}),n),style:{minHeight:g!==void 0?`${g}px`:void 0},...p,children:o})});vt.displayName="Message";const ae=H("mb-3 rounded-lg bg-card border border-border transition-all",{variants:{variant:{default:"opacity-70",subtle:"opacity-50",prominent:"opacity-90 shadow-sm"}},defaultVariants:{variant:"default"}}),Ln=H("w-4 h-4 text-foreground opacity-60 transition-transform duration-200",{variants:{expanded:{true:"rotate-180",false:""}},defaultVariants:{expanded:!1}}),Nt=i.forwardRef(({content:s,isStreaming:e=!1,mode:r="collapsible",defaultExpanded:n=!1,autoExpand:o=!1,autoCollapse:c=!0,autoCollapseDelay:d=2e3,label:f="Thinking",variant:p,className:a},l)=>{const[u,h]=i.useState(r==="inline"?!0:n),[g,b]=i.useState(!1);return i.useEffect(()=>{if(c&&!e&&s&&r==="collapsible"){const j=setTimeout(()=>{b(!0),h(!1)},d);return()=>clearTimeout(j)}},[e,s,c,d,r]),i.useEffect(()=>{o&&e&&r==="collapsible"&&!g&&h(!0)},[o,e,r,g]),!s&&!e?null:r==="inline"?t.jsxs("div",{ref:l,className:m(ae({variant:p}),"p-3",a),children:[t.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",children:f}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse"})]}),t.jsxs("div",{className:"text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})]}):t.jsxs("div",{ref:l,className:m("mb-3",a),children:[t.jsxs("button",{type:"button",onClick:()=>{h(!u),b(!1)},className:"w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left","aria-expanded":u,"aria-label":`${u?"Collapse":"Expand"} reasoning`,children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide shrink-0",children:f}),e&&t.jsx("span",{className:"inline-block w-2 h-2 bg-primary rounded-full animate-pulse shrink-0"}),!u&&s&&t.jsxs("span",{className:"text-xs text-foreground opacity-50 truncate",children:[s.substring(0,60),s.length>60&&"..."]})]}),t.jsx(te,{className:Ln({expanded:u}),"aria-hidden":"true"})]}),u&&t.jsx("div",{className:m(ae({variant:p}),"mt-2 p-3 animate-fadeIn"),children:t.jsxs("div",{className:"text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap",children:[s,e&&s&&t.jsx("span",{className:"inline-block animate-typing text-primary",children:"..."})]})})]})});Nt.displayName="Reasoning";const jt=i.forwardRef(({content:s,isStreaming:e=!1,showEmpty:r=!0,emptyMessage:n="",className:o,...c},d)=>{if(!s&&e&&r)return t.jsx("div",{ref:d,className:m("opacity-70 italic text-sm",o),...c,children:n});if(!s)return null;const f={table:({node:p,...a})=>t.jsx("div",{className:"overflow-x-auto my-4",children:t.jsx("table",{className:"min-w-full border-collapse border border-border rounded-md",...a})}),thead:({node:p,...a})=>t.jsx("thead",{className:"bg-card border-b border-border",...a}),tbody:({node:p,...a})=>t.jsx("tbody",{...a}),tr:({node:p,...a})=>t.jsx("tr",{className:"border-b border-border hover:bg-card transition-colors",...a}),th:({node:p,...a})=>t.jsx("th",{className:"px-4 py-2 text-left font-semibold text-foreground border-r border-border last:border-r-0",...a}),td:({node:p,...a})=>t.jsx("td",{className:"px-4 py-2 text-foreground border-r border-border last:border-r-0",...a}),input:({node:p,checked:a,...l})=>l.type==="checkbox"?t.jsx("input",{type:"checkbox",checked:a||!1,disabled:!0,readOnly:!0,className:"mr-2 w-4 h-4 accent-[primary] cursor-not-allowed",...l}):t.jsx("input",{...l}),code:({node:p,...a})=>a.className?.includes("language-")?t.jsx("code",{className:"block p-4 bg-card border border-border rounded-md overflow-x-auto text-sm font-mono text-foreground shadow-sm",...a}):t.jsx("code",{className:"px-1.5 py-0.5 bg-card border border-border rounded text-sm font-mono text-foreground",...a}),pre:({node:p,...a})=>t.jsx("pre",{className:"my-4 rounded-lg",...a}),h1:({node:p,...a})=>t.jsx("h1",{className:"text-2xl font-bold mt-6 mb-4 text-foreground border-b border-border pb-2",...a}),h2:({node:p,...a})=>t.jsx("h2",{className:"text-xl font-semibold mt-5 mb-3 text-foreground border-b border-border/50 pb-1.5",...a}),h3:({node:p,...a})=>t.jsx("h3",{className:"text-lg font-semibold mt-4 mb-2 text-foreground",...a}),h4:({node:p,...a})=>t.jsx("h4",{className:"text-base font-semibold mt-3 mb-2 text-foreground",...a}),ul:({node:p,...a})=>{const l=p?.children?.some(u=>typeof u=="object"&&u!==null&&"type"in u&&u.type==="element"&&"tagName"in u&&u.tagName==="li"&&"children"in u&&Array.isArray(u.children)&&u.children.some(h=>typeof h=="object"&&h!==null&&"type"in h&&h.type==="element"&&"tagName"in h&&h.tagName==="input"&&"properties"in h&&typeof h.properties=="object"&&h.properties!==null&&"type"in h.properties&&h.properties.type==="checkbox"));return t.jsx("ul",{className:m("my-2 space-y-1 text-foreground",l?"list-none space-y-2":"list-disc list-inside"),...a})},ol:({node:p,...a})=>t.jsx("ol",{className:"list-decimal list-inside my-2 space-y-1 text-foreground",...a}),li:({node:p,...a})=>{const l=p?.children?.some(u=>typeof u=="object"&&u!==null&&"type"in u&&u.type==="element"&&"tagName"in u&&u.tagName==="input"&&"properties"in u&&typeof u.properties=="object"&&u.properties!==null&&"type"in u.properties&&u.properties.type==="checkbox");return t.jsx("li",{className:m("flex items-start",l?"gap-2":"ml-2"),...a})},a:({node:p,...a})=>t.jsx("a",{className:"text-primary hover:underline decoration-2 underline-offset-2 transition-all",target:"_blank",rel:"noopener noreferrer",...a}),p:({node:p,...a})=>t.jsx("p",{className:"my-2 text-foreground leading-relaxed",...a}),blockquote:({node:p,...a})=>t.jsx("blockquote",{className:"border-l-4 border-[primary] pl-4 italic my-4 text-foreground bg-card py-2 rounded-r-md shadow-sm",...a}),hr:({node:p,...a})=>t.jsx("hr",{className:"my-6 border-t border-border opacity-50",...a})};return t.jsxs("div",{ref:d,className:m("markdown-content prose prose-sm max-w-none dark:prose-invert",o),...c,children:[t.jsx(Dt,{remarkPlugins:[hs],components:f,children:s}),e&&s&&t.jsx("span",{className:"inline-block ml-1 animate-typing text-primary",children:"..."})]})});jt.displayName="Response";const Hn={pending:"bg-transparent text-muted-foreground",in_progress:"bg-transparent text-muted-foreground",completed:"bg-transparent text-muted-foreground",failed:"bg-transparent text-muted-foreground"};function zn({toolCall:s}){const[e,r]=i.useState(!1);return t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("button",{type:"button",className:"flex items-center gap-1.5 cursor-pointer bg-transparent border-none p-0 text-left group w-fit",onClick:()=>r(!e),"aria-expanded":e,children:[t.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-1 text-xs font-medium rounded ${Hn[s.status]}`,children:[t.jsx(as,{className:"h-3 w-3"}),t.jsx("span",{children:s.title}),s.status==="completed"&&t.jsx("span",{children:"✓"})]}),t.jsx("span",{className:"text-gray-400 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:e?"▲":"▼"})]}),e&&t.jsxs("div",{className:"mt-2 space-y-3 text-sm border border-gray-200 rounded-md p-3 bg-white shadow-sm max-w-full",children:[s.locations&&s.locations.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1.5",children:"Files"}),t.jsx("ul",{className:"space-y-1",children:s.locations.map(n=>t.jsxs("li",{className:"font-mono text-xs text-gray-700 bg-gray-50 px-2 py-1 rounded",children:[n.path,n.line!==null&&n.line!==void 0&&`:${n.line}`]},`${n.path}:${n.line??""}`))})]}),s.rawInput&&Object.keys(s.rawInput).length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1.5",children:"Input"}),t.jsx("div",{className:"bg-gray-50 p-2 rounded border border-gray-200",children:t.jsx(se,{src:s.rawInput,name:!1,collapsed:1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:{fontSize:"11px",backgroundColor:"transparent"},theme:"rjv-default"})})]}),s.content&&s.content.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1.5",children:"Output"}),t.jsx("div",{className:"space-y-2",children:s.content.map((n,o)=>{const c=()=>n.type==="diff"&&"path"in n?`diff-${n.path}-${o}`:n.type==="terminal"&&"terminalId"in n?`terminal-${n.terminalId}`:n.type==="text"&&"text"in n?`text-${n.text.substring(0,20)}-${o}`:n.type==="content"&&"content"in n?`content-${n.content.text?.substring(0,20)}-${o}`:`block-${o}`,d=(f,p)=>{try{const a=JSON.parse(f);if(typeof a=="object"&&a!==null)return t.jsx("div",{className:"bg-gray-50 p-2 rounded border border-gray-200",children:t.jsx(se,{src:a,name:!1,collapsed:1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,style:{fontSize:"11px",backgroundColor:"transparent"},theme:"rjv-default"})},p)}catch{}return t.jsx("pre",{className:"bg-gray-50 p-2.5 rounded border border-gray-200 text-xs overflow-x-auto font-mono text-gray-800",children:f},p)};if(n.type==="content"&&"content"in n){const f=n.content;if(f.type==="text"&&f.text)return d(f.text,c())}return n.type==="text"&&"text"in n?d(n.text,c()):n.type==="diff"&&"path"in n&&"oldText"in n&&"newText"in n?t.jsxs("div",{className:"border rounded",children:[t.jsxs("div",{className:"bg-gray-100 px-2 py-1 text-xs font-mono",children:[n.path,"line"in n&&n.line!==null&&n.line!==void 0&&`:${n.line}`]}),t.jsxs("div",{className:"p-2 font-mono text-xs",children:[t.jsxs("div",{className:"text-red-600",children:["- ",n.oldText]}),t.jsxs("div",{className:"text-green-600",children:["+ ",n.newText]})]})]},c()):n.type==="terminal"&&"terminalId"in n?t.jsxs("div",{className:"bg-black text-green-400 p-2 rounded text-xs font-mono",children:["Terminal: ",n.terminalId]},c()):null})})]}),s.error&&t.jsxs("div",{className:"bg-red-50 border border-red-200 rounded p-2.5 text-red-700",children:[t.jsx("div",{className:"text-xs font-semibold text-red-600 uppercase tracking-wide mb-1.5",children:"Error"}),t.jsx("div",{className:"text-xs",children:s.error})]}),s.tokenUsage&&t.jsxs("div",{className:"bg-gray-50 border border-gray-200 rounded p-2.5",children:[t.jsx("div",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"Token Usage"}),t.jsxs("div",{className:"grid grid-cols-3 gap-3 text-xs text-gray-700",children:[s.tokenUsage.inputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wide mb-0.5",children:"Input"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.inputTokens.toLocaleString()})]}),s.tokenUsage.outputTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wide mb-0.5",children:"Output"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.outputTokens.toLocaleString()})]}),s.tokenUsage.totalTokens!==void 0&&t.jsxs("div",{children:[t.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wide mb-0.5",children:"Total"}),t.jsx("div",{className:"font-medium",children:s.tokenUsage.totalTokens.toLocaleString()})]})]})]}),s.startedAt&&t.jsxs("div",{className:"text-xs text-gray-500",children:["Started: ",new Date(s.startedAt).toLocaleTimeString(),s.completedAt&&t.jsxs(t.Fragment,{children:[" ","| Completed:"," ",new Date(s.completedAt).toLocaleTimeString()," (",Math.round((s.completedAt-s.startedAt)/1e3),"s)"]})]})]})]})}const K=["Thinking","Pensando","Pensant","Denkend","Pensando","考えている","생각 중","思考中","Размышляя","Düşünüyor","Myślący","Tänkande","Pensando","Ajatellen","Σκεπτόμενος","חושב","सोच रहा है","Berpikir"],ie=["...","·..",".·.","..·",".·.","·.."];function _n({startTime:s}){const[e,r]=i.useState(0),[n,o]=i.useState(()=>K[Math.floor(Math.random()*K.length)]),[c,d]=i.useState(0);i.useEffect(()=>{const a=setInterval(()=>{const u=Date.now()-s;r(u)},100);return()=>clearInterval(a)},[s]),i.useEffect(()=>{const a=setInterval(()=>{const l=Math.floor(Math.random()*K.length);o(K[l])},1500);return()=>clearInterval(a)},[]),i.useEffect(()=>{const a=setInterval(()=>{d(l=>(l+1)%ie.length)},100);return()=>clearInterval(a)},[]);const f=(e/1e3).toFixed(1),p=ie[c];return t.jsxs("span",{className:"text-muted-foreground text-sm",children:[n,p," ",f,"s"]})}const On=H("w-full px-4 py-3 rounded-xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors",{variants:{role:{user:"bg-primary text-primary-foreground shadow-sm",assistant:"text-foreground",system:"bg-card border border-border text-foreground opacity-80 text-sm"},variant:{default:"",outline:"border border-border",ghost:"bg-transparent"}},defaultVariants:{role:"assistant",variant:"default"}}),Ct=i.forwardRef(({role:s,variant:e,isStreaming:r,message:n,thinkingDisplayStyle:o="collapsible",className:c,children:d,...f},p)=>{const a=S(b=>b.streamingStartTime),l=n&&!d,u=l?n.role:s||"assistant",h=l?n.isStreaming:r;let g=d;if(l){const b=n.metadata?.thinking,j=!!b,N=n.isStreaming&&!n.content&&n.role==="assistant";g=t.jsxs(t.Fragment,{children:[n.role==="assistant"&&j&&t.jsx(Nt,{content:b,isStreaming:n.isStreaming,mode:o,autoCollapse:!0}),N&&a&&t.jsxs("div",{className:"flex items-center gap-2 opacity-50",children:[t.jsx(Le,{className:"size-4 animate-spin text-muted-foreground"}),t.jsx(_n,{startTime:a})]}),n.role==="assistant"&&n.toolCalls&&n.toolCalls.length>0&&t.jsx("div",{className:"flex flex-col gap-2 mb-3",children:n.toolCalls.map(y=>t.jsx(zn,{toolCall:y},y.id))}),n.role==="user"?t.jsx("div",{className:"whitespace-pre-wrap",children:n.content}):t.jsx(jt,{content:n.content,isStreaming:n.isStreaming,showEmpty:!1})]})}return t.jsx("div",{ref:p,className:m(On({role:u,variant:e}),h&&"animate-pulse-subtle",c),...f,children:g})});Ct.displayName="MessageContent";const Fn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsxs(Ie,{ref:n,className:m("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm 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",s),...r,children:[e,t.jsx(Gt,{asChild:!0,children:t.jsx(is,{className:"h-4 w-4 opacity-50"})})]}));Fn.displayName=Ie.displayName;const St=i.forwardRef(({className:s,...e},r)=>t.jsx(Ee,{ref:r,className:m("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(ls,{className:"h-4 w-4"})}));St.displayName=Ee.displayName;const Tt=i.forwardRef(({className:s,...e},r)=>t.jsx(Re,{ref:r,className:m("flex cursor-default items-center justify-center py-1",s),...e,children:t.jsx(te,{className:"h-4 w-4"})}));Tt.displayName=Re.displayName;const $n=i.forwardRef(({className:s,children:e,position:r="popper",...n},o)=>t.jsx(Yt,{children:t.jsxs(ke,{ref:o,className:m("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",r==="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",s),position:r,...n,children:[t.jsx(St,{}),t.jsx(Jt,{className:m("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),t.jsx(Tt,{})]})}));$n.displayName=ke.displayName;const Bn=i.forwardRef(({className:s,...e},r)=>t.jsx(Me,{ref:r,className:m("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...e}));Bn.displayName=Me.displayName;const Vn=i.forwardRef(({className:s,children:e,...r},n)=>t.jsxs(Ae,{ref:n,className:m("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Xt,{children:t.jsx(De,{className:"h-4 w-4"})})}),t.jsx(Zt,{children:e})]}));Vn.displayName=Ae.displayName;const qn=i.forwardRef(({className:s,...e},r)=>t.jsx(Ue,{ref:r,className:m("-mx-1 my-1 h-px bg-muted",s),...e}));qn.displayName=Ue.displayName;const It=i.forwardRef(({task:s,collapsible:e=!0,defaultExpanded:r=!1,onTaskClick:n,className:o,...c},d)=>{const[f,p]=i.useState(r),a=!!(s.details||s.files&&s.files.length>0),l={pending:Pe,in_progress:Le,completed:cs}[s.status],u=()=>{switch(s.status){case"completed":return"text-green-500";case"in_progress":return"text-primary";default:return"text-foreground opacity-40"}},h=()=>{a&&e&&p(!f),n?.(s)};return t.jsxs("div",{ref:d,className:m("rounded-lg border border-border bg-card transition-all","hover:shadow-sm hover:border-border/80",o),...c,children:[t.jsxs("button",{type:"button",onClick:h,className:m("w-full flex items-center gap-3 px-3 py-2.5 text-left",a&&e&&"cursor-pointer"),disabled:!a&&!e,children:[t.jsx(l,{className:m("w-4 h-4 shrink-0",u(),s.status==="in_progress"&&"animate-spin")}),t.jsx("span",{className:m("flex-1 text-sm font-[var(--font-family)]",s.status==="completed"&&"line-through opacity-60",s.status==="in_progress"&&"font-medium"),children:s.text}),a&&e&&t.jsx(te,{className:m("w-4 h-4 text-foreground opacity-50 transition-transform duration-200 shrink-0",f&&"rotate-180"),"aria-hidden":"true"})]}),a&&f&&t.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-border/50 animate-fadeIn",children:[s.details&&t.jsx("p",{className:"text-sm text-foreground opacity-80 leading-relaxed mb-2",children:s.details}),s.files&&s.files.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("span",{className:"text-xs font-medium text-foreground opacity-60 uppercase tracking-wide",children:"Files:"}),t.jsx("div",{className:"space-y-1",children:s.files.map(g=>t.jsx("div",{className:"text-xs font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50",children:g},g))})]})]})]})});It.displayName="Task";const Wn=i.forwardRef(({tasks:s,collapsible:e=!0,onTaskClick:r,emptyMessage:n="No tasks yet.",className:o,...c},d)=>t.jsx("div",{ref:d,className:m("space-y-2 max-h-96 overflow-y-auto",o),...c,children:s.length===0?t.jsx("p",{className:"text-sm text-foreground opacity-60 italic py-4 text-center",children:n}):s.map(f=>t.jsx(It,{task:f,collapsible:e,...r?{onTaskClick:r}:{}},f.id))}));Wn.displayName="TaskList";const Qn=H("flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none",{variants:{variant:{default:"border-input focus-visible:ring-ring",error:"border-destructive focus-visible:ring-destructive",success:"border-green-500 focus-visible:ring-green-500"}},defaultVariants:{variant:"default"}}),Kn=i.forwardRef(({className:s,autoResize:e=!1,maxHeight:r=200,variant:n,...o},c)=>{const d=i.useRef(null),f=i.useCallback(a=>{d.current=a,typeof c=="function"?c(a):c&&(c.current=a)},[c]),p=i.useCallback(()=>{const a=d.current;if(!a||!e)return;a.style.height="auto";const l=Math.min(a.scrollHeight,r);a.style.height=`${l}px`,a.scrollHeight>r?a.style.overflowY="auto":a.style.overflowY="hidden"},[e,r]);return i.useEffect(()=>{p()},[p]),t.jsx("textarea",{className:m(Qn({variant:n}),e&&"overflow-y-hidden",s),ref:f,...o})});Kn.displayName="Textarea";const O=Be("gui");function Gn({client:s}){const{connectionStatus:e,connect:r}=ys(s),{messages:n}=$e(s);ws(s);const o=S(f=>f.error);i.useEffect(()=>{O.debug("Connection status changed",{status:e}),e==="error"&&o&&O.error("Connection error occurred",{error:o})},[e,o]);const c=[],d=[{id:"model-sonnet",label:"Use Sonnet 4.5",description:"Switch to Claude Sonnet 4.5 model",icon:t.jsx(ne,{className:"h-4 w-4"}),category:"model",onSelect:()=>{O.info("User selected Sonnet 4.5 model")}},{id:"model-opus",label:"Use Opus",description:"Switch to Claude Opus model",icon:t.jsx(ne,{className:"h-4 w-4"}),category:"model",onSelect:()=>{O.info("User selected Opus model")}},{id:"settings",label:"Open Settings",description:"Configure chat preferences",icon:t.jsx(ps,{className:"h-4 w-4"}),category:"action",onSelect:()=>{O.info("User opened settings")}},{id:"code-mode",label:"Code Mode",description:"Enable code-focused responses",icon:t.jsx(ms,{className:"h-4 w-4"}),category:"mode",onSelect:()=>{O.info("User enabled code mode")}}];return t.jsxs(ct,{defaultPanelSize:"small",defaultActiveTab:"todo",children:[t.jsxs(dt,{children:[e==="error"&&o&&t.jsx("div",{className:"border-b border-red-500/20 bg-red-500/10 px-6 py-4",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{className:"mb-1 text-sm font-semibold text-red-500",children:"Connection Error"}),t.jsx("p",{className:"whitespace-pre-line text-sm text-foreground",children:o})]}),t.jsx("button",{type:"button",onClick:r,className:"rounded-lg bg-red-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-600",children:"Retry"})]})}),t.jsxs(ut,{children:[t.jsx(ft,{className:"pt-4",children:n.length===0?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx("div",{className:"text-center text-muted-foreground",children:t.jsx("p",{className:"mb-2 text-lg",children:"No messages yet"})})}):t.jsx("div",{className:"flex flex-col gap-4 px-4",children:n.map((f,p)=>t.jsx(vt,{message:f,isLastMessage:p===n.length-1,children:t.jsx(Ct,{message:f,thinkingDisplayStyle:"collapsible"})},f.id))})}),t.jsx(pt,{children:t.jsxs(Xe,{client:s,children:[t.jsx(ot,{commands:d}),t.jsx(Ze,{placeholder:"Type a message or / for commands...",autoFocus:!0}),t.jsxs(tt,{children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(st,{}),t.jsx(nt,{})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(rt,{}),t.jsx(et,{children:t.jsx(ds,{className:"size-4"})})]})]})]})})]})]}),t.jsx(mt,{breakpoint:"lg",children:t.jsxs(gt,{defaultValue:"todo",className:"flex flex-col h-full",children:[t.jsxs(Y,{className:"w-full justify-start rounded-none border-b border-border bg-card px-4",children:[t.jsxs(V,{value:"todo",children:[t.jsx(us,{className:"h-4 w-4 mr-2"}),"To-Do"]}),t.jsxs(V,{value:"files",children:[t.jsx(fs,{className:"h-4 w-4 mr-2"}),"Files"]})]}),t.jsx(F,{value:"todo",className:"flex-1 p-4 mt-0",children:t.jsx(ht,{todos:c})}),t.jsx(F,{value:"files",className:"flex-1 p-4 mt-0",children:t.jsx(xt,{})})]})})]})}function Yn(){return"http://localhost:3100"}const le={agentServerUrl:Yn()},$=Be("gui");function Jn(){const[s,e]=i.useState(null),[r,n]=i.useState(null);return i.useEffect(()=>{try{$.info("Initializing ACP client",{serverUrl:le.agentServerUrl});const o=new Es({type:"http",options:{baseUrl:le.agentServerUrl}});return e(o),$.info("ACP client initialized successfully"),()=>{$.debug("Disconnecting ACP client"),o.disconnect().catch(c=>{$.error("Failed to disconnect ACP client",{error:c instanceof Error?c.message:String(c)})})}}catch(o){const c=o instanceof Error?o.message:"Failed to initialize ACP client";n(c),$.error("Failed to initialize ACP client",{error:o instanceof Error?o.message:String(o),stack:o instanceof Error?o.stack:void 0});return}},[]),r?t.jsx("div",{className:"flex items-center justify-center h-screen bg-[var(--color-bg)]",children:t.jsxs("div",{className:"text-center p-8 max-w-md",children:[t.jsx("h1",{className:"text-2xl font-bold text-red-500 mb-4",children:"Initialization Error"}),t.jsx("p",{className:"text-[var(--color-text)] mb-4",children:r}),t.jsx("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Failed to initialize the ACP client. Check the console for details."})]})}):t.jsx(Gn,{client:s})}const Et=document.getElementById("root");if(!Et)throw new Error("Root element not found");Pt.createRoot(Et).render(t.jsx(Lt.StrictMode,{children:t.jsx(Jn,{})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-800:oklch(47.6% .114 61.907);--color-green-100:oklch(96.2% .044 156.743);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-800:oklch(44.8% .119 151.328);--color-cyan-50:oklch(98.4% .019 200.873);--color-cyan-600:oklch(60.9% .126 221.723);--color-cyan-700:oklch(52% .105 223.128);--color-cyan-900:oklch(39.8% .07 227.392);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:hsl(var(--background));--color-foreground:hsl(var(--foreground));--color-card:hsl(var(--card));--color-card-foreground:hsl(var(--card-foreground));--color-popover:hsl(var(--popover));--color-popover-foreground:hsl(var(--popover-foreground));--color-primary:hsl(var(--primary));--color-primary-foreground:hsl(var(--primary-foreground));--color-secondary:hsl(var(--secondary));--color-secondary-foreground:hsl(var(--secondary-foreground));--color-muted:hsl(var(--muted));--color-muted-foreground:hsl(var(--muted-foreground));--color-accent:hsl(var(--accent));--color-accent-foreground:hsl(var(--accent-foreground));--color-destructive:hsl(var(--destructive));--color-destructive-foreground:hsl(var(--destructive-foreground));--color-border:hsl(var(--border));--color-input:hsl(var(--input));--color-ring:hsl(var(--ring))}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.top-full{top:100%}.-right-4{right:calc(var(--spacing)*-4)}.right-0{right:calc(var(--spacing)*0)}.right-4{right:calc(var(--spacing)*4)}.-bottom-4{bottom:calc(var(--spacing)*-4)}.bottom-4{bottom:calc(var(--spacing)*4)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.my-1{margin-block:calc(var(--spacing)*1)}.my-2{margin-block:calc(var(--spacing)*2)}.my-4{margin-block:calc(var(--spacing)*4)}.my-6{margin-block:calc(var(--spacing)*6)}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-11{height:calc(var(--spacing)*11)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-64{max-height:calc(var(--spacing)*64)}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[6lh\]{max-height:6lh}.min-h-\[80px\]{min-height:80px}.min-h-\[200px\]{min-height:200px}.min-h-\[300px\]{min-height:300px}.w-1\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-10{width:calc(var(--spacing)*10)}.w-64{width:calc(var(--spacing)*64)}.w-\[60px\]{width:60px}.w-\[400px\]{width:400px}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[80\%\]{max-width:80%}.max-w-\[90\%\]{max-width:90%}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-none{max-width:none}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[400px\]{min-width:400px}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-ew-resize{cursor:ew-resize}.cursor-not-allowed{cursor:not-allowed}.cursor-ns-resize{cursor:ns-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-hidden{overflow-y:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-none{--tw-border-style:none;border-style:none}.border-\[primary\]{border-color:primary}.border-\[var\(--color-border\)\],.border-border{border-color:var(--color-border)}.border-border\/50{border-color:color-mix(in srgb,hsl(var(--border))50%,transparent)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--color-border)50%,transparent)}}.border-destructive{border-color:var(--color-destructive)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--color-input)}.border-red-200{border-color:var(--color-red-200)}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-\[var\(--color-accent\)\]{background-color:var(--color-accent)}.bg-\[var\(--color-bg\)\]{background-color:var(--color-bg)}.bg-\[var\(--color-surface\)\]{background-color:var(--color-surface)}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.bg-black\/80{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--color-border)}.bg-card{background-color:var(--color-card)}.bg-cyan-50{background-color:var(--color-cyan-50)}.bg-destructive{background-color:var(--color-destructive)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-muted{background-color:var(--color-muted)}.bg-popover{background-color:var(--color-popover)}.bg-primary{background-color:var(--color-primary)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-secondary{background-color:var(--color-secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-linear-to-t{--tw-gradient-position:to top}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-t{--tw-gradient-position:to top in oklab}}.bg-linear-to-t{background-image:linear-gradient(var(--tw-gradient-stops))}.\[background-image\:radial-gradient\(var\(--color-border\)_1px\,var\(--color-bg\)_1px\)\]{background-image:radial-gradient(var(--color-border)1px,var(--color-bg)1px)}.from-background{--tw-gradient-from:var(--color-background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.\[background-size\:20px_20px\]{background-size:20px 20px}.fill-current{fill:currentColor}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-1\.5{padding-bottom:calc(var(--spacing)*1.5)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-\[var\(--font-family\)\]{--tw-font-weight:var(--font-family);font-weight:var(--font-family)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--color-text\)\]{color:var(--color-text)}.text-\[var\(--color-text-secondary\)\]{color:var(--color-text-secondary)}.text-\[var\(--font-size\)\]{color:var(--font-size)}.text-card-foreground{color:var(--color-card-foreground)}.text-cyan-600{color:var(--color-cyan-600)}.text-cyan-700{color:var(--color-cyan-700)}.text-destructive-foreground{color:var(--color-destructive-foreground)}.text-foreground{color:var(--color-foreground)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-800{color:var(--color-green-800)}.text-muted-foreground{color:var(--color-muted-foreground)}.text-popover-foreground{color:var(--color-popover-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-secondary-foreground{color:var(--color-secondary-foreground)}.text-white{color:var(--color-white)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-800{color:var(--color-yellow-800)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.line-through{text-decoration-line:line-through}.decoration-2{text-decoration-thickness:2px}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.accent-\[primary\]{accent-color:primary}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--color-background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-\[\.toast\]\:bg-muted:is(:where(.group).toast *){background-color:var(--color-muted)}.group-\[\.toast\]\:bg-primary:is(:where(.group).toast *){background-color:var(--color-primary)}.group-\[\.toast\]\:text-muted-foreground:is(:where(.group).toast *){color:var(--color-muted-foreground)}.group-\[\.toast\]\:text-primary-foreground:is(:where(.group).toast *){color:var(--color-primary-foreground)}.group-\[\.toaster\]\:border-border:is(:where(.group).toaster *){border-color:var(--color-border)}.group-\[\.toaster\]\:bg-background:is(:where(.group).toaster *){background-color:var(--color-background)}.group-\[\.toaster\]\:text-foreground:is(:where(.group).toaster *){color:var(--color-foreground)}.group-\[\.toaster\]\:shadow-lg:is(:where(.group).toaster *){--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--color-foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--color-muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing)*0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing)*1)}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.last\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}@media(hover:hover){.hover\:border-border\/80:hover{border-color:color-mix(in srgb,hsl(var(--border))80%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/80:hover{border-color:color-mix(in oklab,var(--color-border)80%,transparent)}}.hover\:bg-\[var\(--color-bg\)\]:hover{background-color:var(--color-bg)}.hover\:bg-accent:hover{background-color:var(--color-accent)}.hover\:bg-background:hover{background-color:var(--color-background)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-card:hover{background-color:var(--color-card)}.hover\:bg-card\/80:hover{background-color:color-mix(in srgb,hsl(var(--card))80%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/80:hover{background-color:color-mix(in oklab,var(--color-card)80%,transparent)}}.hover\:bg-card\/90:hover{background-color:color-mix(in srgb,hsl(var(--card))90%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/90:hover{background-color:color-mix(in oklab,var(--color-card)90%,transparent)}}.hover\:bg-destructive\/90:hover{background-color:color-mix(in srgb,hsl(var(--destructive))90%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--color-destructive)90%,transparent)}}.hover\:bg-muted:hover{background-color:var(--color-muted)}.hover\:bg-primary\/90:hover{background-color:color-mix(in srgb,hsl(var(--primary))90%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\:bg-secondary\/80:hover{background-color:color-mix(in srgb,hsl(var(--secondary))80%,transparent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--color-secondary)80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--color-accent-foreground)}.hover\:text-cyan-900:hover{color:var(--color-cyan-900)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-sm:hover{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:border-\[var\(--color-accent\)\]:focus{border-color:var(--color-accent)}.focus\:border-transparent:focus{border-color:#0000}.focus\:bg-accent:focus{background-color:var(--color-accent)}.focus\:bg-muted:focus{background-color:var(--color-muted)}.focus\:text-accent-foreground:focus{color:var(--color-accent-foreground)}.focus\:text-foreground:focus{color:var(--color-foreground)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-ring:focus{--tw-ring-color:var(--color-ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive:focus-visible{--tw-ring-color:var(--color-destructive)}.focus-visible\:ring-green-500:focus-visible{--tw-ring-color:var(--color-green-500)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-100:disabled{background-color:var(--color-gray-100)}.disabled\:bg-gray-300:disabled{background-color:var(--color-gray-300)}.disabled\:opacity-50:disabled{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing)*0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing)*1)}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--color-background)}.data-\[state\=active\]\:bg-transparent[data-state=active]{background-color:#0000}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--color-foreground)}.data-\[state\=active\]\:opacity-100[data-state=active]{opacity:1}.data-\[state\=active\]\:shadow-none[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 8px 24px -16px var(--tw-shadow-color,#0000000a),0 4px 16px 0 var(--tw-shadow-color,#0000000a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--color-accent)}.data-\[state\=open\]\:bg-muted[data-state=open]{background-color:var(--color-muted)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--color-muted-foreground)}@media(min-width:40rem){.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}:where(.sm\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:block{display:block}}@media(min-width:64rem){.lg\:block{display:block}.lg\:hidden{display:none}}@media(min-width:80rem){.xl\:block{display:block}}@media(min-width:96rem){.\32xl\:block{display:block}}@media(prefers-color-scheme:dark){.dark\:bg-transparent{background-color:#0000}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}}:root{--background:0 0% 100%;--foreground:222.2 84% 4.9%;--card:0 0% 100%;--card-foreground:222.2 84% 4.9%;--popover:0 0% 100%;--popover-foreground:222.2 84% 4.9%;--primary:222.2 47.4% 11.2%;--primary-foreground:210 40% 98%;--secondary:210 40% 96.1%;--secondary-foreground:222.2 47.4% 11.2%;--muted:210 40% 96.1%;--muted-foreground:215.4 16.3% 46.9%;--accent:210 40% 96.1%;--accent-foreground:222.2 47.4% 11.2%;--destructive:0 84.2% 60.2%;--destructive-foreground:210 40% 98%;--border:214.3 31.8% 91.4%;--input:214.3 31.8% 91.4%;--ring:222.2 84% 4.9%;--radius:.5rem}.dark{--background:222.2 84% 4.9%;--foreground:210 40% 98%;--card:222.2 84% 4.9%;--card-foreground:210 40% 98%;--popover:222.2 84% 4.9%;--popover-foreground:210 40% 98%;--primary:210 40% 98%;--primary-foreground:222.2 47.4% 11.2%;--secondary:217.2 32.6% 17.5%;--secondary-foreground:210 40% 98%;--muted:217.2 32.6% 17.5%;--muted-foreground:215 20.2% 65.1%;--accent:217.2 32.6% 17.5%;--accent-foreground:210 40% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:210 40% 98%;--border:217.2 32.6% 17.5%;--input:217.2 32.6% 17.5%;--ring:212.7 26.8% 83.9%}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes exit{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes slideDownAndFade{0%{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideLeftAndFade{0%{opacity:0;transform:translate(2px)}to{opacity:1;transform:translate(0)}}@keyframes slideUpAndFade{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@keyframes slideRightAndFade{0%{opacity:0;transform:translate(-2px)}to{opacity:1;transform:translate(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as i,e,f as k}from"./vendor
|
|
1
|
+
import{g as i,e,f as k}from"./vendor--IKG6KWl.js";const c={};function d(s){const t=this,n=s||c,o=t.data(),r=o.micromarkExtensions||(o.micromarkExtensions=[]),a=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),m=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);r.push(i(n)),a.push(e()),m.push(k(n))}export{d as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as s,R as st,j as l,a as pe,b as at,c as zo,d as it}from"./react-oZw8z-KQ.js";import{h as ct,i as Yo,j as Xo,k as qo,m as Zo,p as Jo,q as Qo,t as er,v as tr,w as nr}from"./vendor-CEpcc87q.js";function Pt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function be(...e){return t=>{let n=!1;const o=e.map(r=>{const a=Pt(r,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():Pt(e[r],null)}}}}function M(...e){return s.useCallback(be(...e),e)}var or=Symbol.for("react.lazy"),_e=st[" use ".trim().toString()];function rr(e){return typeof e=="object"&&e!==null&&"then"in e}function Lt(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===or&&"_payload"in e&&rr(e._payload)}function kt(e){const t=sr(e),n=s.forwardRef((o,r)=>{let{children:a,...c}=o;Lt(a)&&typeof _e=="function"&&(a=_e(a._payload));const i=s.Children.toArray(a),u=i.find(ir);if(u){const d=u.props.children,f=i.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...c,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}var qa=kt("Slot");function sr(e){const t=s.forwardRef((n,o)=>{let{children:r,...a}=n;if(Lt(r)&&typeof _e=="function"&&(r=_e(r._payload)),s.isValidElement(r)){const c=lr(r),i=cr(a,r.props);return r.type!==s.Fragment&&(i.ref=o?be(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ar=Symbol("radix.slottable");function ir(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ar}function cr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const u=a(...i);return r(...i),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function lr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function E(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function ur(e,t){const n=s.createContext(t),o=a=>{const{children:c,...i}=a,u=s.useMemo(()=>i,Object.values(i));return l.jsx(n.Provider,{value:u,children:c})};o.displayName=e+"Provider";function r(a){const c=s.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function le(e,t=[]){let n=[];function o(a,c){const i=s.createContext(c),u=n.length;n=[...n,c];const d=p=>{const{scope:v,children:y,...C}=p,m=v?.[e]?.[u]||i,h=s.useMemo(()=>C,Object.values(C));return l.jsx(m.Provider,{value:h,children:y})};d.displayName=a+"Provider";function f(p,v){const y=v?.[e]?.[u]||i,C=s.useContext(y);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=n.map(c=>s.createContext(c));return function(i){const u=i?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return r.scopeName=e,[o,dr(r,...t)]}function dr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const c=o.reduce((i,{useScope:u,scopeName:d})=>{const p=u(a)[`__scope${d}`];return{...i,...p}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function xe(e){const t=fr(e),n=s.forwardRef((o,r)=>{const{children:a,...c}=o,i=s.Children.toArray(a),u=i.find(mr);if(u){const d=u.props.children,f=i.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...c,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function fr(e){const t=s.forwardRef((n,o)=>{const{children:r,...a}=n;if(s.isValidElement(r)){const c=hr(r),i=vr(a,r.props);return r.type!==s.Fragment&&(i.ref=o?be(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pr=Symbol("radix.slottable");function mr(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pr}function vr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const u=a(...i);return r(...i),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function hr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function lt(e){const t=e+"CollectionProvider",[n,o]=le(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:h,children:x}=m,g=pe.useRef(null),w=pe.useRef(new Map).current;return l.jsx(r,{scope:h,itemMap:w,collectionRef:g,children:x})};c.displayName=t;const i=e+"CollectionSlot",u=xe(i),d=pe.forwardRef((m,h)=>{const{scope:x,children:g}=m,w=a(i,x),R=M(h,w.collectionRef);return l.jsx(u,{ref:R,children:g})});d.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",v=xe(f),y=pe.forwardRef((m,h)=>{const{scope:x,children:g,...w}=m,R=pe.useRef(null),T=M(h,R),F=a(f,x);return pe.useEffect(()=>(F.itemMap.set(R,{ref:R,...w}),()=>void F.itemMap.delete(R))),l.jsx(v,{[p]:"",ref:T,children:g})});y.displayName=f;function C(m){const h=a(e+"CollectionConsumer",m);return pe.useCallback(()=>{const g=h.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((F,I)=>w.indexOf(F.ref.current)-w.indexOf(I.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:c,Slot:d,ItemSlot:y},C,o]}var U=globalThis?.document?s.useLayoutEffect:()=>{},gr=st[" useId ".trim().toString()]||(()=>{}),xr=0;function De(e){const[t,n]=s.useState(gr());return U(()=>{n(o=>o??String(xr++))},[e]),t?`radix-${t}`:""}var wr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],P=wr.reduce((e,t)=>{const n=xe(`Primitive.${t}`),o=s.forwardRef((r,a)=>{const{asChild:c,...i}=r,u=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...i,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function $t(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function ae(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>t.current?.(...n),[])}var yr=st[" useInsertionEffect ".trim().toString()]||U;function Bt({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,c]=Cr({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:r;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,o])}const d=s.useCallback(f=>{if(i){const p=Sr(f)?f(e):f;p!==e&&c.current?.(p)}else a(f)},[i,e,a,c]);return[u,d]}function Cr({defaultProp:e,onChange:t}){const[n,o]=s.useState(e),r=s.useRef(n),a=s.useRef(t);return yr(()=>{a.current=t},[t]),s.useEffect(()=>{r.current!==n&&(a.current?.(n),r.current=n)},[n,r]),[n,o,a]}function Sr(e){return typeof e=="function"}var Er=s.createContext(void 0);function Ut(e){const t=s.useContext(Er);return e||t||"ltr"}var ze="rovingFocusGroup.onEntryFocus",br={bubbles:!1,cancelable:!0},Re="RovingFocusGroup",[Ze,Kt,Rr]=lt(Re),[Ir,Oe]=le(Re,[Rr]),[Pr,_r]=Ir(Re),Wt=s.forwardRef((e,t)=>l.jsx(Ze.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ze.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Mr,{...e,ref:t})})}));Wt.displayName=Re;var Mr=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,v=s.useRef(null),y=M(t,v),C=Ut(a),[m,h]=Bt({prop:c,defaultProp:i??null,onChange:u,caller:Re}),[x,g]=s.useState(!1),w=ae(d),R=Kt(n),T=s.useRef(!1),[F,I]=s.useState(0);return s.useEffect(()=>{const _=v.current;if(_)return _.addEventListener(ze,w),()=>_.removeEventListener(ze,w)},[w]),l.jsx(Pr,{scope:n,orientation:o,dir:C,loop:r,currentTabStopId:m,onItemFocus:s.useCallback(_=>h(_),[h]),onItemShiftTab:s.useCallback(()=>g(!0),[]),onFocusableItemAdd:s.useCallback(()=>I(_=>_+1),[]),onFocusableItemRemove:s.useCallback(()=>I(_=>_-1),[]),children:l.jsx(P.div,{tabIndex:x||F===0?-1:0,"data-orientation":o,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:E(e.onMouseDown,()=>{T.current=!0}),onFocus:E(e.onFocus,_=>{const $=!T.current;if(_.target===_.currentTarget&&$&&!x){const L=new CustomEvent(ze,br);if(_.currentTarget.dispatchEvent(L),!L.defaultPrevented){const B=R().filter(k=>k.focusable),K=B.find(k=>k.active),W=B.find(k=>k.id===m),H=[K,W,...B].filter(Boolean).map(k=>k.ref.current);Ht(H,f)}}T.current=!1}),onBlur:E(e.onBlur,()=>g(!1))})})}),Gt="RovingFocusGroupItem",Vt=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:a,children:c,...i}=e,u=De(),d=a||u,f=_r(Gt,n),p=f.currentTabStopId===d,v=Kt(n),{onFocusableItemAdd:y,onFocusableItemRemove:C,currentTabStopId:m}=f;return s.useEffect(()=>{if(o)return y(),()=>C()},[o,y,C]),l.jsx(Ze.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:l.jsx(P.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:E(e.onMouseDown,h=>{o?f.onItemFocus(d):h.preventDefault()}),onFocus:E(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:E(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const x=Ar(h,f.orientation,f.dir);if(x!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=v().filter(R=>R.focusable).map(R=>R.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const R=w.indexOf(h.currentTarget);w=f.loop?Dr(w,R+1):w.slice(R+1)}setTimeout(()=>Ht(w))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:m!=null}):c})})});Vt.displayName=Gt;var Tr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ar(e,t,n){const o=Nr(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Tr[o]}function Ht(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Dr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var zt=Wt,Yt=Vt;function Or(e,t){return s.useReducer((n,o)=>t[n][o]??n,e)}var ie=e=>{const{present:t,children:n}=e,o=jr(t),r=typeof n=="function"?n({present:o.isPresent}):s.Children.only(n),a=M(o.ref,Fr(r));return typeof n=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};ie.displayName="Presence";function jr(e){const[t,n]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),c=e?"mounted":"unmounted",[i,u]=Or(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const d=Pe(o.current);a.current=i==="mounted"?d:"none"},[i]),U(()=>{const d=o.current,f=r.current;if(f!==e){const v=a.current,y=Pe(d);e?u("MOUNT"):y==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&v!==y?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),U(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=y=>{const m=Pe(o.current).includes(CSS.escape(y.animationName));if(y.target===t&&m&&(u("ANIMATION_END"),!r.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},v=y=>{y.target===t&&(a.current=Pe(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:s.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function Pe(e){return e?.animationName||"none"}function Fr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var je="Tabs",[Lr]=le(je,[Oe]),Xt=Oe(),[kr,ut]=Lr(je),qt=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:c="horizontal",dir:i,activationMode:u="automatic",...d}=e,f=Ut(i),[p,v]=Bt({prop:o,onChange:r,defaultProp:a??"",caller:je});return l.jsx(kr,{scope:n,baseId:De(),value:p,onValueChange:v,orientation:c,dir:f,activationMode:u,children:l.jsx(P.div,{dir:f,"data-orientation":c,...d,ref:t})})});qt.displayName=je;var Zt="TabsList",Jt=s.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=ut(Zt,n),c=Xt(n);return l.jsx(zt,{asChild:!0,...c,orientation:a.orientation,dir:a.dir,loop:o,children:l.jsx(P.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});Jt.displayName=Zt;var Qt="TabsTrigger",en=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,c=ut(Qt,n),i=Xt(n),u=on(c.baseId,o),d=rn(c.baseId,o),f=o===c.value;return l.jsx(Yt,{asChild:!0,...i,focusable:!r,active:f,children:l.jsx(P.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...a,ref:t,onMouseDown:E(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?c.onValueChange(o):p.preventDefault()}),onKeyDown:E(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(o)}),onFocus:E(e.onFocus,()=>{const p=c.activationMode!=="manual";!f&&!r&&p&&c.onValueChange(o)})})})});en.displayName=Qt;var tn="TabsContent",nn=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:a,...c}=e,i=ut(tn,n),u=on(i.baseId,o),d=rn(i.baseId,o),f=o===i.value,p=s.useRef(f);return s.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),l.jsx(ie,{present:r||f,children:({present:v})=>l.jsx(P.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":u,hidden:!v,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&a})})});nn.displayName=tn;function on(e,t){return`${e}-trigger-${t}`}function rn(e,t){return`${e}-content-${t}`}var Za=qt,Ja=Jt,Qa=en,ei=nn;function $r(e,t=globalThis?.document){const n=ae(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Br="DismissableLayer",Je="dismissableLayer.update",Ur="dismissableLayer.pointerDownOutside",Kr="dismissableLayer.focusOutside",_t,sn=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:c,onDismiss:i,...u}=e,d=s.useContext(sn),[f,p]=s.useState(null),v=f?.ownerDocument??globalThis?.document,[,y]=s.useState({}),C=M(t,I=>p(I)),m=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(h),g=f?m.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,R=g>=x,T=Vr(I=>{const _=I.target,$=[...d.branches].some(L=>L.contains(_));!R||$||(r?.(I),c?.(I),I.defaultPrevented||i?.())},v),F=Hr(I=>{const _=I.target;[...d.branches].some(L=>L.contains(_))||(a?.(I),c?.(I),I.defaultPrevented||i?.())},v);return $r(I=>{g===d.layers.size-1&&(o?.(I),!I.defaultPrevented&&i&&(I.preventDefault(),i()))},v),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_t=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Mt(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=_t)}},[f,v,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Mt())},[f,d]),s.useEffect(()=>{const I=()=>y({});return document.addEventListener(Je,I),()=>document.removeEventListener(Je,I)},[]),l.jsx(P.div,{...u,ref:C,style:{pointerEvents:w?R?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,F.onFocusCapture),onBlurCapture:E(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,T.onPointerDownCapture)})});Fe.displayName=Br;var Wr="DismissableLayerBranch",Gr=s.forwardRef((e,t)=>{const n=s.useContext(sn),o=s.useRef(null),r=M(t,o);return s.useEffect(()=>{const a=o.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(P.div,{...e,ref:r})});Gr.displayName=Wr;function Vr(e,t=globalThis?.document){const n=ae(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=i=>{if(i.target&&!o.current){let u=function(){an(Ur,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Hr(e,t=globalThis?.document){const n=ae(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&an(Kr,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Mt(){const e=new CustomEvent(Je);document.dispatchEvent(e)}function an(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?$t(r,a):r.dispatchEvent(a)}var Ye="focusScope.autoFocusOnMount",Xe="focusScope.autoFocusOnUnmount",Tt={bubbles:!1,cancelable:!0},zr="FocusScope",Le=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...c}=e,[i,u]=s.useState(null),d=ae(r),f=ae(a),p=s.useRef(null),v=M(t,m=>u(m)),y=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let m=function(w){if(y.paused||!i)return;const R=w.target;i.contains(R)?p.current=R:ce(p.current,{select:!0})},h=function(w){if(y.paused||!i)return;const R=w.relatedTarget;R!==null&&(i.contains(R)||ce(p.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&ce(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",h);const g=new MutationObserver(x);return i&&g.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",h),g.disconnect()}}},[o,i,y.paused]),s.useEffect(()=>{if(i){At.add(y);const m=document.activeElement;if(!i.contains(m)){const x=new CustomEvent(Ye,Tt);i.addEventListener(Ye,d),i.dispatchEvent(x),x.defaultPrevented||(Yr(Qr(cn(i)),{select:!0}),document.activeElement===m&&ce(i))}return()=>{i.removeEventListener(Ye,d),setTimeout(()=>{const x=new CustomEvent(Xe,Tt);i.addEventListener(Xe,f),i.dispatchEvent(x),x.defaultPrevented||ce(m??document.body,{select:!0}),i.removeEventListener(Xe,f),At.remove(y)},0)}}},[i,d,f,y]);const C=s.useCallback(m=>{if(!n&&!o||y.paused)return;const h=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(h&&x){const g=m.currentTarget,[w,R]=Xr(g);w&&R?!m.shiftKey&&x===R?(m.preventDefault(),n&&ce(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&ce(R,{select:!0})):x===g&&m.preventDefault()}},[n,o,y.paused]);return l.jsx(P.div,{tabIndex:-1,...c,ref:v,onKeyDown:C})});Le.displayName=zr;function Yr(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ce(o,{select:t}),document.activeElement!==n)return}function Xr(e){const t=cn(e),n=Nt(t,e),o=Nt(t.reverse(),e);return[n,o]}function cn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nt(e,t){for(const n of e)if(!qr(n,{upTo:t}))return n}function qr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Zr(e){return e instanceof HTMLInputElement&&"select"in e}function ce(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zr(e)&&t&&e.select()}}var At=Jr();function Jr(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Dt(e,t),e.unshift(t)},remove(t){e=Dt(e,t),e[0]?.resume()}}}function Dt(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Qr(e){return e.filter(t=>t.tagName!=="A")}var es="Portal",ke=s.forwardRef((e,t)=>{const{container:n,...o}=e,[r,a]=s.useState(!1);U(()=>a(!0),[]);const c=n||r&&globalThis?.document?.body;return c?zo.createPortal(l.jsx(P.div,{...o,ref:t}),c):null});ke.displayName=es;var qe=0;function dt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ot()),document.body.insertAdjacentElement("beforeend",e[1]??Ot()),qe++,()=>{qe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qe--}},[])}function Ot(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ln="Dialog",[un]=le(ln),[ti,oe]=un(ln),dn="DialogTrigger",ts=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(dn,n),a=M(t,r.triggerRef);return l.jsx(P.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":mt(r.open),...o,ref:a,onClick:E(e.onClick,r.onOpenToggle)})});ts.displayName=dn;var ft="DialogPortal",[ns,fn]=un(ft,{forceMount:void 0}),pn=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,a=oe(ft,t);return l.jsx(ns,{scope:t,forceMount:n,children:s.Children.map(o,c=>l.jsx(ie,{present:n||a.open,children:l.jsx(ke,{asChild:!0,container:r,children:c})}))})};pn.displayName=ft;var Me="DialogOverlay",mn=s.forwardRef((e,t)=>{const n=fn(Me,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=oe(Me,e.__scopeDialog);return a.modal?l.jsx(ie,{present:o||a.open,children:l.jsx(rs,{...r,ref:t})}):null});mn.displayName=Me;var os=xe("DialogOverlay.RemoveScroll"),rs=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(Me,n);return l.jsx(it,{as:os,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(P.div,{"data-state":mt(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),me="DialogContent",vn=s.forwardRef((e,t)=>{const n=fn(me,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=oe(me,e.__scopeDialog);return l.jsx(ie,{present:o||a.open,children:a.modal?l.jsx(ss,{...r,ref:t}):l.jsx(as,{...r,ref:t})})});vn.displayName=me;var ss=s.forwardRef((e,t)=>{const n=oe(me,e.__scopeDialog),o=s.useRef(null),r=M(t,n.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return ct(a)},[]),l.jsx(hn,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,i=c.button===0&&c.ctrlKey===!0;(c.button===2||i)&&a.preventDefault()}),onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault())})}),as=s.forwardRef((e,t)=>{const n=oe(me,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return l.jsx(hn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const c=a.target;n.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),hn=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...c}=e,i=oe(me,n),u=s.useRef(null),d=M(t,u);return dt(),l.jsxs(l.Fragment,{children:[l.jsx(Le,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:l.jsx(Fe,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":mt(i.open),...c,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(is,{titleId:i.titleId}),l.jsx(ls,{contentRef:u,descriptionId:i.descriptionId})]})]})}),pt="DialogTitle",gn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(pt,n);return l.jsx(P.h2,{id:r.titleId,...o,ref:t})});gn.displayName=pt;var xn="DialogDescription",wn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(xn,n);return l.jsx(P.p,{id:r.descriptionId,...o,ref:t})});wn.displayName=xn;var yn="DialogClose",Cn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(yn,n);return l.jsx(P.button,{type:"button",...o,ref:t,onClick:E(e.onClick,()=>r.onOpenChange(!1))})});Cn.displayName=yn;function mt(e){return e?"open":"closed"}var Sn="DialogTitleWarning",[ni,En]=ur(Sn,{contentName:me,titleName:pt,docsSlug:"dialog"}),is=({titleId:e})=>{const t=En(Sn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1
|
+
import{r as s,R as st,j as l,a as pe,b as at,c as zo,d as it}from"./react-CIcriR6k.js";import{h as ct,i as Yo,j as Xo,k as qo,m as Zo,p as Jo,q as Qo,t as er,v as tr,w as nr}from"./vendor--IKG6KWl.js";function Pt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function be(...e){return t=>{let n=!1;const o=e.map(r=>{const a=Pt(r,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():Pt(e[r],null)}}}}function M(...e){return s.useCallback(be(...e),e)}var or=Symbol.for("react.lazy"),_e=st[" use ".trim().toString()];function rr(e){return typeof e=="object"&&e!==null&&"then"in e}function Lt(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===or&&"_payload"in e&&rr(e._payload)}function kt(e){const t=sr(e),n=s.forwardRef((o,r)=>{let{children:a,...c}=o;Lt(a)&&typeof _e=="function"&&(a=_e(a._payload));const i=s.Children.toArray(a),u=i.find(ir);if(u){const d=u.props.children,f=i.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...c,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}var qa=kt("Slot");function sr(e){const t=s.forwardRef((n,o)=>{let{children:r,...a}=n;if(Lt(r)&&typeof _e=="function"&&(r=_e(r._payload)),s.isValidElement(r)){const c=lr(r),i=cr(a,r.props);return r.type!==s.Fragment&&(i.ref=o?be(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ar=Symbol("radix.slottable");function ir(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ar}function cr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const u=a(...i);return r(...i),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function lr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function E(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function ur(e,t){const n=s.createContext(t),o=a=>{const{children:c,...i}=a,u=s.useMemo(()=>i,Object.values(i));return l.jsx(n.Provider,{value:u,children:c})};o.displayName=e+"Provider";function r(a){const c=s.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function le(e,t=[]){let n=[];function o(a,c){const i=s.createContext(c),u=n.length;n=[...n,c];const d=p=>{const{scope:v,children:y,...C}=p,m=v?.[e]?.[u]||i,h=s.useMemo(()=>C,Object.values(C));return l.jsx(m.Provider,{value:h,children:y})};d.displayName=a+"Provider";function f(p,v){const y=v?.[e]?.[u]||i,C=s.useContext(y);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[d,f]}const r=()=>{const a=n.map(c=>s.createContext(c));return function(i){const u=i?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])}};return r.scopeName=e,[o,dr(r,...t)]}function dr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const c=o.reduce((i,{useScope:u,scopeName:d})=>{const p=u(a)[`__scope${d}`];return{...i,...p}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function xe(e){const t=fr(e),n=s.forwardRef((o,r)=>{const{children:a,...c}=o,i=s.Children.toArray(a),u=i.find(mr);if(u){const d=u.props.children,f=i.map(p=>p===u?s.Children.count(d)>1?s.Children.only(null):s.isValidElement(d)?d.props.children:null:p);return l.jsx(t,{...c,ref:r,children:s.isValidElement(d)?s.cloneElement(d,void 0,f):null})}return l.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function fr(e){const t=s.forwardRef((n,o)=>{const{children:r,...a}=n;if(s.isValidElement(r)){const c=hr(r),i=vr(a,r.props);return r.type!==s.Fragment&&(i.ref=o?be(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pr=Symbol("radix.slottable");function mr(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pr}function vr(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const u=a(...i);return r(...i),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function hr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function lt(e){const t=e+"CollectionProvider",[n,o]=le(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=m=>{const{scope:h,children:x}=m,g=pe.useRef(null),w=pe.useRef(new Map).current;return l.jsx(r,{scope:h,itemMap:w,collectionRef:g,children:x})};c.displayName=t;const i=e+"CollectionSlot",u=xe(i),d=pe.forwardRef((m,h)=>{const{scope:x,children:g}=m,w=a(i,x),R=M(h,w.collectionRef);return l.jsx(u,{ref:R,children:g})});d.displayName=i;const f=e+"CollectionItemSlot",p="data-radix-collection-item",v=xe(f),y=pe.forwardRef((m,h)=>{const{scope:x,children:g,...w}=m,R=pe.useRef(null),T=M(h,R),F=a(f,x);return pe.useEffect(()=>(F.itemMap.set(R,{ref:R,...w}),()=>void F.itemMap.delete(R))),l.jsx(v,{[p]:"",ref:T,children:g})});y.displayName=f;function C(m){const h=a(e+"CollectionConsumer",m);return pe.useCallback(()=>{const g=h.collectionRef.current;if(!g)return[];const w=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(h.itemMap.values()).sort((F,I)=>w.indexOf(F.ref.current)-w.indexOf(I.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:c,Slot:d,ItemSlot:y},C,o]}var U=globalThis?.document?s.useLayoutEffect:()=>{},gr=st[" useId ".trim().toString()]||(()=>{}),xr=0;function De(e){const[t,n]=s.useState(gr());return U(()=>{n(o=>o??String(xr++))},[e]),t?`radix-${t}`:""}var wr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],P=wr.reduce((e,t)=>{const n=xe(`Primitive.${t}`),o=s.forwardRef((r,a)=>{const{asChild:c,...i}=r,u=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(u,{...i,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function $t(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}function ae(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>t.current?.(...n),[])}var yr=st[" useInsertionEffect ".trim().toString()]||U;function Bt({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,c]=Cr({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:r;{const f=s.useRef(e!==void 0);s.useEffect(()=>{const p=f.current;p!==i&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=i},[i,o])}const d=s.useCallback(f=>{if(i){const p=Sr(f)?f(e):f;p!==e&&c.current?.(p)}else a(f)},[i,e,a,c]);return[u,d]}function Cr({defaultProp:e,onChange:t}){const[n,o]=s.useState(e),r=s.useRef(n),a=s.useRef(t);return yr(()=>{a.current=t},[t]),s.useEffect(()=>{r.current!==n&&(a.current?.(n),r.current=n)},[n,r]),[n,o,a]}function Sr(e){return typeof e=="function"}var Er=s.createContext(void 0);function Ut(e){const t=s.useContext(Er);return e||t||"ltr"}var ze="rovingFocusGroup.onEntryFocus",br={bubbles:!1,cancelable:!0},Re="RovingFocusGroup",[Ze,Kt,Rr]=lt(Re),[Ir,Oe]=le(Re,[Rr]),[Pr,_r]=Ir(Re),Wt=s.forwardRef((e,t)=>l.jsx(Ze.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ze.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Mr,{...e,ref:t})})}));Wt.displayName=Re;var Mr=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,v=s.useRef(null),y=M(t,v),C=Ut(a),[m,h]=Bt({prop:c,defaultProp:i??null,onChange:u,caller:Re}),[x,g]=s.useState(!1),w=ae(d),R=Kt(n),T=s.useRef(!1),[F,I]=s.useState(0);return s.useEffect(()=>{const _=v.current;if(_)return _.addEventListener(ze,w),()=>_.removeEventListener(ze,w)},[w]),l.jsx(Pr,{scope:n,orientation:o,dir:C,loop:r,currentTabStopId:m,onItemFocus:s.useCallback(_=>h(_),[h]),onItemShiftTab:s.useCallback(()=>g(!0),[]),onFocusableItemAdd:s.useCallback(()=>I(_=>_+1),[]),onFocusableItemRemove:s.useCallback(()=>I(_=>_-1),[]),children:l.jsx(P.div,{tabIndex:x||F===0?-1:0,"data-orientation":o,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:E(e.onMouseDown,()=>{T.current=!0}),onFocus:E(e.onFocus,_=>{const $=!T.current;if(_.target===_.currentTarget&&$&&!x){const L=new CustomEvent(ze,br);if(_.currentTarget.dispatchEvent(L),!L.defaultPrevented){const B=R().filter(k=>k.focusable),K=B.find(k=>k.active),W=B.find(k=>k.id===m),H=[K,W,...B].filter(Boolean).map(k=>k.ref.current);Ht(H,f)}}T.current=!1}),onBlur:E(e.onBlur,()=>g(!1))})})}),Gt="RovingFocusGroupItem",Vt=s.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:a,children:c,...i}=e,u=De(),d=a||u,f=_r(Gt,n),p=f.currentTabStopId===d,v=Kt(n),{onFocusableItemAdd:y,onFocusableItemRemove:C,currentTabStopId:m}=f;return s.useEffect(()=>{if(o)return y(),()=>C()},[o,y,C]),l.jsx(Ze.ItemSlot,{scope:n,id:d,focusable:o,active:r,children:l.jsx(P.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:E(e.onMouseDown,h=>{o?f.onItemFocus(d):h.preventDefault()}),onFocus:E(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:E(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){f.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const x=Ar(h,f.orientation,f.dir);if(x!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let w=v().filter(R=>R.focusable).map(R=>R.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const R=w.indexOf(h.currentTarget);w=f.loop?Dr(w,R+1):w.slice(R+1)}setTimeout(()=>Ht(w))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:m!=null}):c})})});Vt.displayName=Gt;var Tr={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nr(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ar(e,t,n){const o=Nr(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Tr[o]}function Ht(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Dr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var zt=Wt,Yt=Vt;function Or(e,t){return s.useReducer((n,o)=>t[n][o]??n,e)}var ie=e=>{const{present:t,children:n}=e,o=jr(t),r=typeof n=="function"?n({present:o.isPresent}):s.Children.only(n),a=M(o.ref,Fr(r));return typeof n=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};ie.displayName="Presence";function jr(e){const[t,n]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),c=e?"mounted":"unmounted",[i,u]=Or(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const d=Pe(o.current);a.current=i==="mounted"?d:"none"},[i]),U(()=>{const d=o.current,f=r.current;if(f!==e){const v=a.current,y=Pe(d);e?u("MOUNT"):y==="none"||d?.display==="none"?u("UNMOUNT"):u(f&&v!==y?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),U(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=y=>{const m=Pe(o.current).includes(CSS.escape(y.animationName));if(y.target===t&&m&&(u("ANIMATION_END"),!r.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},v=y=>{y.target===t&&(a.current=Pe(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:s.useCallback(d=>{o.current=d?getComputedStyle(d):null,n(d)},[])}}function Pe(e){return e?.animationName||"none"}function Fr(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var je="Tabs",[Lr]=le(je,[Oe]),Xt=Oe(),[kr,ut]=Lr(je),qt=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:c="horizontal",dir:i,activationMode:u="automatic",...d}=e,f=Ut(i),[p,v]=Bt({prop:o,onChange:r,defaultProp:a??"",caller:je});return l.jsx(kr,{scope:n,baseId:De(),value:p,onValueChange:v,orientation:c,dir:f,activationMode:u,children:l.jsx(P.div,{dir:f,"data-orientation":c,...d,ref:t})})});qt.displayName=je;var Zt="TabsList",Jt=s.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=ut(Zt,n),c=Xt(n);return l.jsx(zt,{asChild:!0,...c,orientation:a.orientation,dir:a.dir,loop:o,children:l.jsx(P.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});Jt.displayName=Zt;var Qt="TabsTrigger",en=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,c=ut(Qt,n),i=Xt(n),u=on(c.baseId,o),d=rn(c.baseId,o),f=o===c.value;return l.jsx(Yt,{asChild:!0,...i,focusable:!r,active:f,children:l.jsx(P.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...a,ref:t,onMouseDown:E(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?c.onValueChange(o):p.preventDefault()}),onKeyDown:E(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(o)}),onFocus:E(e.onFocus,()=>{const p=c.activationMode!=="manual";!f&&!r&&p&&c.onValueChange(o)})})})});en.displayName=Qt;var tn="TabsContent",nn=s.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:a,...c}=e,i=ut(tn,n),u=on(i.baseId,o),d=rn(i.baseId,o),f=o===i.value,p=s.useRef(f);return s.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),l.jsx(ie,{present:r||f,children:({present:v})=>l.jsx(P.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":u,hidden:!v,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&a})})});nn.displayName=tn;function on(e,t){return`${e}-trigger-${t}`}function rn(e,t){return`${e}-content-${t}`}var Za=qt,Ja=Jt,Qa=en,ei=nn;function $r(e,t=globalThis?.document){const n=ae(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Br="DismissableLayer",Je="dismissableLayer.update",Ur="dismissableLayer.pointerDownOutside",Kr="dismissableLayer.focusOutside",_t,sn=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fe=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:c,onDismiss:i,...u}=e,d=s.useContext(sn),[f,p]=s.useState(null),v=f?.ownerDocument??globalThis?.document,[,y]=s.useState({}),C=M(t,I=>p(I)),m=Array.from(d.layers),[h]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(h),g=f?m.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,R=g>=x,T=Vr(I=>{const _=I.target,$=[...d.branches].some(L=>L.contains(_));!R||$||(r?.(I),c?.(I),I.defaultPrevented||i?.())},v),F=Hr(I=>{const _=I.target;[...d.branches].some(L=>L.contains(_))||(a?.(I),c?.(I),I.defaultPrevented||i?.())},v);return $r(I=>{g===d.layers.size-1&&(o?.(I),!I.defaultPrevented&&i&&(I.preventDefault(),i()))},v),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_t=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Mt(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=_t)}},[f,v,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Mt())},[f,d]),s.useEffect(()=>{const I=()=>y({});return document.addEventListener(Je,I),()=>document.removeEventListener(Je,I)},[]),l.jsx(P.div,{...u,ref:C,style:{pointerEvents:w?R?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,F.onFocusCapture),onBlurCapture:E(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,T.onPointerDownCapture)})});Fe.displayName=Br;var Wr="DismissableLayerBranch",Gr=s.forwardRef((e,t)=>{const n=s.useContext(sn),o=s.useRef(null),r=M(t,o);return s.useEffect(()=>{const a=o.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(P.div,{...e,ref:r})});Gr.displayName=Wr;function Vr(e,t=globalThis?.document){const n=ae(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=i=>{if(i.target&&!o.current){let u=function(){an(Ur,n,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Hr(e,t=globalThis?.document){const n=ae(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&an(Kr,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Mt(){const e=new CustomEvent(Je);document.dispatchEvent(e)}function an(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?$t(r,a):r.dispatchEvent(a)}var Ye="focusScope.autoFocusOnMount",Xe="focusScope.autoFocusOnUnmount",Tt={bubbles:!1,cancelable:!0},zr="FocusScope",Le=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...c}=e,[i,u]=s.useState(null),d=ae(r),f=ae(a),p=s.useRef(null),v=M(t,m=>u(m)),y=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let m=function(w){if(y.paused||!i)return;const R=w.target;i.contains(R)?p.current=R:ce(p.current,{select:!0})},h=function(w){if(y.paused||!i)return;const R=w.relatedTarget;R!==null&&(i.contains(R)||ce(p.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const T of w)T.removedNodes.length>0&&ce(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",h);const g=new MutationObserver(x);return i&&g.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",h),g.disconnect()}}},[o,i,y.paused]),s.useEffect(()=>{if(i){At.add(y);const m=document.activeElement;if(!i.contains(m)){const x=new CustomEvent(Ye,Tt);i.addEventListener(Ye,d),i.dispatchEvent(x),x.defaultPrevented||(Yr(Qr(cn(i)),{select:!0}),document.activeElement===m&&ce(i))}return()=>{i.removeEventListener(Ye,d),setTimeout(()=>{const x=new CustomEvent(Xe,Tt);i.addEventListener(Xe,f),i.dispatchEvent(x),x.defaultPrevented||ce(m??document.body,{select:!0}),i.removeEventListener(Xe,f),At.remove(y)},0)}}},[i,d,f,y]);const C=s.useCallback(m=>{if(!n&&!o||y.paused)return;const h=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(h&&x){const g=m.currentTarget,[w,R]=Xr(g);w&&R?!m.shiftKey&&x===R?(m.preventDefault(),n&&ce(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&ce(R,{select:!0})):x===g&&m.preventDefault()}},[n,o,y.paused]);return l.jsx(P.div,{tabIndex:-1,...c,ref:v,onKeyDown:C})});Le.displayName=zr;function Yr(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ce(o,{select:t}),document.activeElement!==n)return}function Xr(e){const t=cn(e),n=Nt(t,e),o=Nt(t.reverse(),e);return[n,o]}function cn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nt(e,t){for(const n of e)if(!qr(n,{upTo:t}))return n}function qr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Zr(e){return e instanceof HTMLInputElement&&"select"in e}function ce(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zr(e)&&t&&e.select()}}var At=Jr();function Jr(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Dt(e,t),e.unshift(t)},remove(t){e=Dt(e,t),e[0]?.resume()}}}function Dt(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Qr(e){return e.filter(t=>t.tagName!=="A")}var es="Portal",ke=s.forwardRef((e,t)=>{const{container:n,...o}=e,[r,a]=s.useState(!1);U(()=>a(!0),[]);const c=n||r&&globalThis?.document?.body;return c?zo.createPortal(l.jsx(P.div,{...o,ref:t}),c):null});ke.displayName=es;var qe=0;function dt(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ot()),document.body.insertAdjacentElement("beforeend",e[1]??Ot()),qe++,()=>{qe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qe--}},[])}function Ot(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ln="Dialog",[un]=le(ln),[ti,oe]=un(ln),dn="DialogTrigger",ts=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(dn,n),a=M(t,r.triggerRef);return l.jsx(P.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":mt(r.open),...o,ref:a,onClick:E(e.onClick,r.onOpenToggle)})});ts.displayName=dn;var ft="DialogPortal",[ns,fn]=un(ft,{forceMount:void 0}),pn=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,a=oe(ft,t);return l.jsx(ns,{scope:t,forceMount:n,children:s.Children.map(o,c=>l.jsx(ie,{present:n||a.open,children:l.jsx(ke,{asChild:!0,container:r,children:c})}))})};pn.displayName=ft;var Me="DialogOverlay",mn=s.forwardRef((e,t)=>{const n=fn(Me,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=oe(Me,e.__scopeDialog);return a.modal?l.jsx(ie,{present:o||a.open,children:l.jsx(rs,{...r,ref:t})}):null});mn.displayName=Me;var os=xe("DialogOverlay.RemoveScroll"),rs=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(Me,n);return l.jsx(it,{as:os,allowPinchZoom:!0,shards:[r.contentRef],children:l.jsx(P.div,{"data-state":mt(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),me="DialogContent",vn=s.forwardRef((e,t)=>{const n=fn(me,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=oe(me,e.__scopeDialog);return l.jsx(ie,{present:o||a.open,children:a.modal?l.jsx(ss,{...r,ref:t}):l.jsx(as,{...r,ref:t})})});vn.displayName=me;var ss=s.forwardRef((e,t)=>{const n=oe(me,e.__scopeDialog),o=s.useRef(null),r=M(t,n.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return ct(a)},[]),l.jsx(hn,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,i=c.button===0&&c.ctrlKey===!0;(c.button===2||i)&&a.preventDefault()}),onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault())})}),as=s.forwardRef((e,t)=>{const n=oe(me,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return l.jsx(hn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const c=a.target;n.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),hn=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...c}=e,i=oe(me,n),u=s.useRef(null),d=M(t,u);return dt(),l.jsxs(l.Fragment,{children:[l.jsx(Le,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:l.jsx(Fe,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":mt(i.open),...c,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(is,{titleId:i.titleId}),l.jsx(ls,{contentRef:u,descriptionId:i.descriptionId})]})]})}),pt="DialogTitle",gn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(pt,n);return l.jsx(P.h2,{id:r.titleId,...o,ref:t})});gn.displayName=pt;var xn="DialogDescription",wn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(xn,n);return l.jsx(P.p,{id:r.descriptionId,...o,ref:t})});wn.displayName=xn;var yn="DialogClose",Cn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=oe(yn,n);return l.jsx(P.button,{type:"button",...o,ref:t,onClick:E(e.onClick,()=>r.onOpenChange(!1))})});Cn.displayName=yn;function mt(e){return e?"open":"closed"}var Sn="DialogTitleWarning",[ni,En]=ur(Sn,{contentName:me,titleName:pt,docsSlug:"dialog"}),is=({titleId:e})=>{const t=En(Sn),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
4
|
|