teodor-new-chat-ui 4.3.513 → 4.3.514
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/index.esm.js +10 -9
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -14717,10 +14717,10 @@ const NE = {
|
|
|
14717
14717
|
getInterruptOptions: x,
|
|
14718
14718
|
toolConfig: w
|
|
14719
14719
|
}) {
|
|
14720
|
-
const b = Ch(t, n), S = t.role === "default_message",
|
|
14721
|
-
() => fx(t.id,
|
|
14722
|
-
[t.id,
|
|
14723
|
-
),
|
|
14720
|
+
const b = Ch(t, n), S = t.role === "default_message", T = !!t.__syntheticStreaming || r && o === t.id && t.role === "assistant", C = f ?? NE, I = !S && "checkpointId" in t ? t.checkpointId ?? null : null, { attemptCount: A, attemptIndex: L, attempts: D } = Fe(
|
|
14721
|
+
() => fx(t.id, I, C),
|
|
14722
|
+
[t.id, I, C]
|
|
14723
|
+
), B = g == null ? void 0 : g(t);
|
|
14724
14724
|
return /* @__PURE__ */ u.jsx(
|
|
14725
14725
|
"div",
|
|
14726
14726
|
{
|
|
@@ -14735,7 +14735,8 @@ const NE = {
|
|
|
14735
14735
|
{
|
|
14736
14736
|
message: t,
|
|
14737
14737
|
messageIndex: n,
|
|
14738
|
-
isStreamingMessage:
|
|
14738
|
+
isStreamingMessage: T,
|
|
14739
|
+
renderStreamingMarkdown: T,
|
|
14739
14740
|
streamingDebounceMs: s,
|
|
14740
14741
|
isEditing: c === t.id,
|
|
14741
14742
|
showActions: i,
|
|
@@ -14747,11 +14748,11 @@ const NE = {
|
|
|
14747
14748
|
onCancelEdit: p,
|
|
14748
14749
|
getInterruptOptions: x,
|
|
14749
14750
|
showToolMessages: m,
|
|
14750
|
-
attemptCount:
|
|
14751
|
-
attemptIndex:
|
|
14752
|
-
attemptMetas:
|
|
14751
|
+
attemptCount: A,
|
|
14752
|
+
attemptIndex: L,
|
|
14753
|
+
attemptMetas: D,
|
|
14753
14754
|
onSelectCheckpoint: v,
|
|
14754
|
-
customStyles:
|
|
14755
|
+
customStyles: B,
|
|
14755
14756
|
toolConfig: w
|
|
14756
14757
|
}
|
|
14757
14758
|
)
|
package/dist/index.umd.js
CHANGED
|
@@ -126,6 +126,6 @@ ${t}</tr>
|
|
|
126
126
|
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=Ph(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let o='<a href="'+t+'"';return n&&(o+=' title="'+n+'"'),o+=">"+r+"</a>",o}image(t,n,r){if(t=Ph(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let o=`<img src="${t}" alt="${r}"`;return n&&(o+=` title="${n}"`),o+=this.options.xhtml?"/>":">",o}text(t){return t}}class Oh{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class Dh{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let r=t,o=0;if(this.seen.hasOwnProperty(r)){o=this.seen[t];do o++,r=t+"-"+o;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=o,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Vn{constructor(t){this.options=t||dr,this.options.renderer=this.options.renderer||new hl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Oh,this.slugger=new Dh}static parse(t,n){return new Vn(n).parse(t)}static parseInline(t,n){return new Vn(n).parseInline(t)}parse(t,n=!0){let r="",o,s,i,a,c,l,d,p,m,f,v,g,x,b,y,C,E,S,T;const k=t.length;for(o=0;o<k;o++){if(f=t[o],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[f.type]&&(T=this.options.extensions.renderers[f.type].call({parser:this},f),T!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(f.type))){r+=T||"";continue}switch(f.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(f.tokens),f.depth,Ah(this.parseInline(f.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(f.text,f.lang,f.escaped);continue}case"table":{for(p="",d="",a=f.header.length,s=0;s<a;s++)d+=this.renderer.tablecell(this.parseInline(f.header[s].tokens),{header:!0,align:f.align[s]});for(p+=this.renderer.tablerow(d),m="",a=f.rows.length,s=0;s<a;s++){for(l=f.rows[s],d="",c=l.length,i=0;i<c;i++)d+=this.renderer.tablecell(this.parseInline(l[i].tokens),{header:!1,align:f.align[i]});m+=this.renderer.tablerow(d)}r+=this.renderer.table(p,m);continue}case"blockquote":{m=this.parse(f.tokens),r+=this.renderer.blockquote(m);continue}case"list":{for(v=f.ordered,g=f.start,x=f.loose,a=f.items.length,m="",s=0;s<a;s++)y=f.items[s],C=y.checked,E=y.task,b="",y.task&&(S=this.renderer.checkbox(C),x?y.tokens.length>0&&y.tokens[0].type==="paragraph"?(y.tokens[0].text=S+" "+y.tokens[0].text,y.tokens[0].tokens&&y.tokens[0].tokens.length>0&&y.tokens[0].tokens[0].type==="text"&&(y.tokens[0].tokens[0].text=S+" "+y.tokens[0].tokens[0].text)):y.tokens.unshift({type:"text",text:S}):b+=S),b+=this.parse(y.tokens,x),m+=this.renderer.listitem(b,E,C);r+=this.renderer.list(m,v,g);continue}case"html":{r+=this.renderer.html(f.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(f.tokens));continue}case"text":{for(m=f.tokens?this.parseInline(f.tokens):f.text;o+1<k&&t[o+1].type==="text";)f=t[++o],m+=`
|
|
127
127
|
`+(f.tokens?this.parseInline(f.tokens):f.text);r+=n?this.renderer.paragraph(m):m;continue}default:{const A='Token with "'+f.type+'" type was not found.';if(this.options.silent){console.error(A);return}else throw new Error(A)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",o,s,i;const a=t.length;for(o=0;o<a;o++){if(s=t[o],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]&&(i=this.options.extensions.renderers[s.type].call({parser:this},s),i!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type))){r+=i||"";continue}switch(s.type){case"escape":{r+=n.text(s.text);break}case"html":{r+=n.html(s.text);break}case"link":{r+=n.link(s.href,s.title,this.parseInline(s.tokens,n));break}case"image":{r+=n.image(s.href,s.title,s.text);break}case"strong":{r+=n.strong(this.parseInline(s.tokens,n));break}case"em":{r+=n.em(this.parseInline(s.tokens,n));break}case"codespan":{r+=n.codespan(s.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(s.tokens,n));break}case"text":{r+=n.text(s.text);break}default:{const c='Token with "'+s.type+'" type was not found.';if(this.options.silent){console.error(c);return}else throw new Error(c)}}}return r}}class Qs{constructor(t){this.options=t||dr}preprocess(t){return t}postprocess(t){return t}}xx(Qs,"passThroughHooks",new Set(["preprocess","postprocess"]));function UT(e,t,n){return r=>{if(r.message+=`
|
|
128
128
|
Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+Dt(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(o);if(n){n(null,o);return}return o}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function Lh(e,t){return(n,r,o)=>{typeof r=="function"&&(o=r,r=null);const s={...r};r={...xe.defaults,...s};const i=UT(r.silent,r.async,o);if(typeof n>"u"||n===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(BT(r),r.hooks&&(r.hooks.options=r),o){const a=r.highlight;let c;try{r.hooks&&(n=r.hooks.preprocess(n)),c=e(n,r)}catch(p){return i(p)}const l=function(p){let m;if(!p)try{r.walkTokens&&xe.walkTokens(c,r.walkTokens),m=t(c,r),r.hooks&&(m=r.hooks.postprocess(m))}catch(f){p=f}return r.highlight=a,p?i(p):o(null,m)};if(!a||a.length<3||(delete r.highlight,!c.length))return l();let d=0;xe.walkTokens(c,function(p){p.type==="code"&&(d++,setTimeout(()=>{a(p.text,p.lang,function(m,f){if(m)return l(m);f!=null&&f!==p.text&&(p.text=f,p.escaped=!0),d--,d===0&&l()})},0))}),d===0&&l();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(a=>e(a,r)).then(a=>r.walkTokens?Promise.all(xe.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(i);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&xe.walkTokens(a,r.walkTokens);let c=t(a,r);return r.hooks&&(c=r.hooks.postprocess(c)),c}catch(a){return i(a)}}}function xe(e,t,n){return Lh(Wn.lex,Vn.parse)(e,t,n)}xe.options=xe.setOptions=function(e){return xe.defaults={...xe.defaults,...e},IT(xe.defaults),xe},xe.getDefaults=kh,xe.defaults=dr,xe.use=function(...e){const t=xe.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=xe.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const s=t.renderers[o.name];s?t.renderers[o.name]=function(...i){let a=o.renderer.apply(this,i);return a===!1&&(a=s.apply(this,i)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){const o=xe.defaults.renderer||new hl;for(const s in n.renderer){const i=o[s];o[s]=(...a)=>{let c=n.renderer[s].apply(o,a);return c===!1&&(c=i.apply(o,a)),c}}r.renderer=o}if(n.tokenizer){const o=xe.defaults.tokenizer||new pl;for(const s in n.tokenizer){const i=o[s];o[s]=(...a)=>{let c=n.tokenizer[s].apply(o,a);return c===!1&&(c=i.apply(o,a)),c}}r.tokenizer=o}if(n.hooks){const o=xe.defaults.hooks||new Qs;for(const s in n.hooks){const i=o[s];Qs.passThroughHooks.has(s)?o[s]=a=>{if(xe.defaults.async)return Promise.resolve(n.hooks[s].call(o,a)).then(l=>i.call(o,l));const c=n.hooks[s].call(o,a);return i.call(o,c)}:o[s]=(...a)=>{let c=n.hooks[s].apply(o,a);return c===!1&&(c=i.apply(o,a)),c}}r.hooks=o}if(n.walkTokens){const o=xe.defaults.walkTokens;r.walkTokens=function(s){let i=[];return i.push(n.walkTokens.call(this,s)),o&&(i=i.concat(o.call(this,s))),i}}xe.setOptions(r)})},xe.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(xe,r)),r.type){case"table":{for(const o of r.header)n=n.concat(xe.walkTokens(o.tokens,t));for(const o of r.rows)for(const s of o)n=n.concat(xe.walkTokens(s.tokens,t));break}case"list":{n=n.concat(xe.walkTokens(r.items,t));break}default:xe.defaults.extensions&&xe.defaults.extensions.childTokens&&xe.defaults.extensions.childTokens[r.type]?xe.defaults.extensions.childTokens[r.type].forEach(function(o){n=n.concat(xe.walkTokens(r[o],t))}):r.tokens&&(n=n.concat(xe.walkTokens(r.tokens,t)))}return n},xe.parseInline=Lh(Wn.lexInline,Vn.parseInline),xe.Parser=Vn,xe.parser=Vn.parse,xe.Renderer=hl,xe.TextRenderer=Oh,xe.Lexer=Wn,xe.lexer=Wn.lex,xe.Tokenizer=pl,xe.Slugger=Dh,xe.Hooks=Qs,xe.parse=xe,xe.options,xe.setOptions,xe.use,xe.walkTokens,xe.parseInline,Vn.parse,Wn.lex;function fr({content:e,className:t="",allowHtml:n=!1,style:r}){const o=w.useMemo(()=>{if(!e||typeof e!="string"||e.trim().length===0)return"";try{if(!n){const i=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"");return typeof xe.parse=="function"?xe.parse(i):xe(i)}return typeof xe.parse=="function"?xe.parse(e):xe(e)}catch(i){return console.error("[MarkdownContent] parse error",i),`<pre class="font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words">Error rendering markdown: ${String(i)}</pre>`}},[e,n]),s=w.useMemo(()=>{const i={color:"currentColor",...r};if(r&&r.color){const a=r.color;return{...i,"--tw-prose-body":a,"--tw-prose-headings":a,"--tw-prose-links":a,"--tw-prose-bold":a,"--tw-prose-counters":a,"--tw-prose-bullets":a,"--tw-prose-hr":a,"--tw-prose-quotes":a,"--tw-prose-quote-borders":a,"--tw-prose-captions":a,"--tw-prose-code":a,"--tw-prose-pre-code":a,"--tw-prose-pre-bg":"inherit","--tw-prose-th-borders":a,"--tw-prose-td-borders":a}}return i},[r]);return u.jsx("div",{className:ne("markdown prose prose-sm max-w-none break-words","dark:prose-invert","text-current","prose-headings:text-current prose-p:text-current prose-li:text-current prose-a:text-current prose-strong:text-current","prose-em:text-current prose-blockquote:text-current prose-table:text-current prose-td:text-current prose-th:text-current","prose-pre:font-mono prose-pre:text-xs prose-pre:bg-background/50 prose-pre:border prose-pre:rounded prose-pre:p-3 prose-pre:whitespace-pre prose-pre:overflow-x-auto","prose-code:font-mono prose-code:text-sm prose-code:bg-background/50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-current",t),style:s,dangerouslySetInnerHTML:{__html:o}})}function $h({preview:e,idx:t}){return u.jsxs("div",{className:"space-y-2",children:[e.label&&u.jsxs("p",{className:"text-[0.65rem] uppercase tracking-wide text-muted-foreground",children:["Artifact: ",e.label]}),u.jsx("div",{className:"overflow-hidden rounded border border-border/60 bg-background/60 p-1 shadow-sm",children:u.jsx("img",{src:e.src,alt:e.alt,title:e.label,loading:"lazy",className:"h-auto max-h-[420px] w-full rounded object-contain",onLoad:()=>{},onError:n=>{console.error(`[MessageComponent] ❌ Image failed to load for artifact ${t}:`,{alt:e.alt,label:e.label,message:n.target.alt})}})})]})}function Fh({artifact:e,idx:t=0}){const n=w.useMemo(()=>e?(Array.isArray(e.plots)?e.plots:[]).map(o=>ju(o)).filter(o=>o!==null):[],[e]);return n.length>0?u.jsx("div",{className:"space-y-2",children:n.map((r,o)=>u.jsx($h,{preview:r,idx:o},`${t}-plot-${o}`))}):e&&typeof e=="object"?u.jsx("div",{className:"rounded-lg border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/20 p-4",children:u.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Unknown artifact type: ",u.jsx("code",{className:"font-mono",children:e.type||"unknown"})]})}):null}const WT="prose prose-sm max-w-none break-words dark:prose-invert prose-headings:break-words prose-p:break-words prose-li:break-words prose-td:break-words prose-th:break-words prose-a:break-all prose-code:break-words prose-blockquote:break-words";function ei({data:e}){return Array.isArray(e)?e.every(n=>n===null||["string","number","boolean"].includes(typeof n))?u.jsx("div",{className:WT,children:u.jsx("ul",{className:"list-disc pl-5",children:e.map((n,r)=>u.jsx("li",{children:String(n)},r))})}):u.jsx("pre",{className:"font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words",children:er(e)}):u.jsx("pre",{className:"font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words",children:er(e)})}function Bh({message:e,isStreaming:t=!1}){const n=e.name??"tool",r=w.useMemo(()=>{const a=e.additionalKwargs??{};return Array.isArray(a.toolProgress)?[...a.toolProgress]:[]},[e]),s=r.some(a=>a.type==="tool.start"||a.type==="tool.call"||a.type==="message.start")?`Running ${n}…`:void 0;return t||r.length>0?u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs uppercase tracking-wide text-muted-foreground",children:[t&&u.jsx(le.Loader,{className:"h-3 w-3 animate-spin"}),u.jsx("span",{children:s??`Running ${n}…`})]}),r.length>0&&u.jsx("div",{className:"space-y-2 text-xs text-muted-foreground",children:r.map((a,c)=>{var l;return u.jsxs("div",{className:"rounded border border-current/10 bg-muted/60 p-2 text-[11px] leading-snug",children:[u.jsxs("div",{className:"mb-1 flex items-center justify-between text-[8px] uppercase tracking-wide text-muted-foreground",children:[u.jsx("span",{children:((l=a.type)==null?void 0:l.replace(/\./g," "))??"progress"}),u.jsx("span",{children:a.idx??c+1})]}),a.content&&u.jsx("p",{className:"mt-1 text-[12px] text-foreground/90",children:a.content}),u.jsxs("div",{className:"mt-1 flex flex-wrap gap-2 text-[10px] opacity-70",children:[typeof a.factsFound=="number"&&u.jsxs("span",{children:["Facts found: ",a.factsFound]}),typeof a.isSufficient=="boolean"&&u.jsxs("span",{children:["Research ",a.isSufficient?"sufficient":"needs more data"]})]})]},`tool-progress-${n}-${c}`)})})]}):null}const ml=h.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ne("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ml.displayName="Card";const gl=h.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ne("flex flex-col space-y-1.5 p-6",e),...t}));gl.displayName="CardHeader";const xl=h.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:ne("text-2xl font-semibold leading-none tracking-tight",e),...t}));xl.displayName="CardTitle";const vl=h.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:ne("text-sm text-muted-foreground",e),...t}));vl.displayName="CardDescription";const ti=h.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ne("p-6 pt-0",e),...t}));ti.displayName="CardContent";const zh=h.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ne("flex items-center p-6 pt-0",e),...t}));zh.displayName="CardFooter";const VT=e=>!!e&&typeof e=="object"&&e.type==="user_choice"&&typeof e.question=="string"&&Array.isArray(e.alternatives);function wl({interruptPart:e,onApprove:t,onReject:n,onSelectAlternative:r,disabled:o,isActive:s,payload:i}){const a=VT(i)?i:null,c=(a==null?void 0:a.question)??e.title??"Approve the result?",l=a?s?"Select one of the alternatives to continue.":"Waiting for approval from another participant.":s?"Please approve or reject this action to resume the workflow.":"Waiting for approval from another participant.";let d=null;if(!a&&i!==void 0&&i!==null)if(typeof i=="string")d=u.jsx("p",{className:"text-sm leading-relaxed text-blue-800/90 dark:text-blue-200/90 whitespace-pre-wrap",children:i});else{const p=er(i);d=u.jsx("pre",{className:"max-h-48 overflow-auto rounded bg-blue-100/60 p-2 text-xs text-blue-900/90 dark:bg-blue-900/40 dark:text-blue-100/80",children:p})}return u.jsxs(ml,{className:ne("border-blue-200 dark:border-blue-800 bg-blue-50/50 dark:bg-blue-950/10 transition-shadow",s?"shadow-md ring-1 ring-blue-300 dark:ring-blue-500/70":"opacity-80"),children:[u.jsxs(gl,{className:"pb-3",children:[u.jsx(xl,{className:"text-blue-900 dark:text-blue-100 text-base",children:c}),u.jsx(vl,{className:"text-blue-700 dark:text-blue-300 text-sm",children:l})]}),a?u.jsx(ti,{className:"pt-0 pb-3",children:u.jsx("div",{className:"space-y-2",children:a.alternatives.map(p=>u.jsx(Xe,{size:"sm",variant:"outline",onClick:()=>r==null?void 0:r(e,p),className:"w-full justify-start text-left",disabled:o||!s,children:u.jsxs("div",{className:"flex flex-col items-start gap-1",children:[u.jsx("span",{className:"font-semibold",children:p.label}),p.description?u.jsx("span",{className:"text-xs text-muted-foreground leading-snug",children:p.description}):null]})},p.id))})}):d&&u.jsx(ti,{className:"pt-0 pb-3",children:d}),!a&&u.jsx(zh,{className:"pt-0",children:u.jsxs("div",{className:"flex gap-2 ml-auto",children:[u.jsx(Xe,{size:"sm",variant:"outline",onClick:()=>n(e),className:"border-red-300 text-red-700 hover:bg-red-50 dark:border-red-700 dark:text-red-300 dark:hover:bg-red-950/50",disabled:o||!s,children:"Reject"}),u.jsx(Xe,{size:"sm",onClick:()=>t(e),className:"bg-blue-600 hover:bg-blue-700 text-white",disabled:o||!s,children:"Approve"})]})})]})}function Hh({className:e}){const t=w.useRef(null);return w.useEffect(()=>{let n=0;const r=()=>{if(n=(n+1)%4,t.current){const s=".".repeat(n);t.current.textContent=`Is thinking${s}`}};r();const o=setInterval(r,500);return()=>clearInterval(o)},[]),u.jsx("span",{ref:t,"aria-live":"polite",className:ne("inline-block text-xs opacity-70 ml-1",e),children:"Is thinking"})}function Uh({text:e,expanded:t,onExpandedChange:n,previewLength:r,isCompact:o}){const s=Math.max(e.length-r,0),i=e.substring(0,r);return u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("div",{className:ne("text-sm text-[hsl(var(--chat-bubble-user-text))]",o&&"text-xs"),children:t?u.jsx(fr,{content:e,allowHtml:!1}):u.jsxs("pre",{className:ne("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]",o&&"text-xs"),children:[i,"..."]})}),u.jsx(Xe,{type:"button",variant:"ghost",size:"sm",className:"h-6 text-xs !text-[hsl(var(--chat-bubble-user-text))]",onClick:()=>n(!t),children:t?u.jsxs(u.Fragment,{children:[u.jsx(le.ChevronUp,{className:"h-3 w-3 mr-1"})," Show less"]}):u.jsxs(u.Fragment,{children:[u.jsx(le.ChevronDown,{className:"h-3 w-3 mr-1"})," Show more (",s," chars)"]})})]})}function Wh(e){const{allowFileOpen:t,currentThreadId:n}=e,{toast:r}=fl(),[o,s]=w.useState({}),[i,a]=w.useState(null),[c,l]=w.useState(!1),d=w.useCallback(()=>{l(!1),a(null)},[]),p=w.useCallback(f=>{a(f),l(!0)},[]),m=w.useCallback(async(f,v,g)=>{var x,b;if(!t){f.preventDefault();return}if(o[g]){f.preventDefault();return}try{const y=String(v.url??""),C=y.match(/\/chat\/files\/([^/]+)(?:\/(view|download))?/);if(C){f.preventDefault();const E=C[1],S=v.name||`file_${E}`,T=v.mimeType||"application/octet-stream";p({id:E,name:S,mimeType:T});return}if(y.startsWith("data:")){f.preventDefault(),s(S=>({...S,[g]:!0}));const E=r({title:"Fetching file...",description:"",open:!0});try{const S=await cu(n??void 0);if(!S||!Array.isArray(S))throw new Error("Invalid file list response");const T=S.find(k=>!k||typeof k!="object"||!((k.filename??"")===(v.name??""))?!1:typeof v.size=="number"&&typeof k.size=="number"?k.size===v.size:!0);if(!(T!=null&&T.id))throw new Error(`File "${v.name}" is not yet available on the server`);if(!T.id||!T.filename)throw new Error("Invalid file data received from server");p({id:T.id,name:v.name||T.filename||`file_${T.id}`,mimeType:v.mimeType||T.mime_type||"application/octet-stream"}),(x=E.update)==null||x.call(E,{id:E.id,title:"Success",description:`Opened ${v.name}`,open:!0})}catch(S){console.error("Failed to fetch server file:",S);const T=S instanceof Error?S.message:"Unknown error occurred";(b=E.update)==null||b.call(E,{id:E.id,title:"Failed",description:T}),r({title:"Failed to fetch file",description:T,open:!0})}finally{s(S=>({...S,[g]:!1}))}}}catch(y){console.error("File click error:",y),s(C=>({...C,[g]:!1}))}},[t,o,r,n,p]);return{uploadingFiles:o,handleFileClick:m,fileViewerOpen:c,currentFileInfo:i,closeFileViewer:d}}function Vh(e,t){return w.useMemo(()=>{if(t)return{contentParts:[],textContent:"",toolMeta:{},imageParts:[],fileParts:[],interruptParts:[],toolRaw:"",isToolStreaming:!1};const n=e,r=Array.isArray(n.content)?n.content:[],o=n.additionalKwargs??{};return{contentParts:r,textContent:ku(r),toolMeta:Qo(n),imageParts:r.filter(s=>s.type==="image_url"),fileParts:r.filter(s=>s.type==="file"),interruptParts:r.filter(s=>s.type==="interrupt"),toolRaw:Eu(r),isToolStreaming:!!o.toolStreaming}},[e,t])}const Kh="data:";function KT(e){if(!e)return[];const t=[],n=e.split(/\r?\n/);for(const r of n){const o=r.trim();if(!o||!o.startsWith(Kh))continue;const s=o.slice(Kh.length).trim();if(!s||s.toLowerCase()==="[done]")continue;const i=Qn(s);i&&typeof i=="object"&&t.push(i)}return t}function qT(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n&&typeof n=="object"&&n.type==="tool.end")return n}return null}function GT(e){return w.useMemo(()=>{const t=e.content.filter(l=>l.type==="text");if(!t.length)return null;let r=t.flatMap(l=>KT(l.text??""));if(!r.length){const l=t.map(p=>p.text??"").join(`
|
|
129
|
-
`),d=Qn(l);d&&typeof d=="object"&&(r=[d])}if(!r.length)return null;const s=qT(r)??r[r.length-1];if(!s)return null;const i=s.output??s.payload??s,a=Cr(i),c=tr(a);return c&&typeof c=="object"&&!Array.isArray(c)?{kind:"dict",value:c,data:c,event:s}:{kind:"generic",value:c,event:s}},[e])}function qh({message:e,viewMode:t,isStreaming:n=!1,toolConfig:r,expandable:o=!1}){var $;const s=Qo(e),i=e.artifact??null,a=GT(e),l=(a?_u(a):null)??a,d=e.content.find(L=>L.type!=="tool_call"),p=L=>{if(L==null)return null;const z=typeof L=="string"?Qn(L)??L:L;if(z&&typeof z=="object")return u.jsx(ei,{data:z});const G=typeof z=="string"?z:(()=>{try{return er(z)}catch{return String(z??"")}})();return u.jsx("pre",{className:"whitespace-pre-wrap break-words font-sans text-sm text-foreground/90",children:G})},m=L=>{if(L==null)return null;const{content:z,isMarkdown:G}=Tu(L);return G?u.jsx(fr,{content:z,className:"text-current"}):p(L)},f=L=>u.jsxs("div",{className:"space-y-2 rounded-2xl border border-muted-foreground/30 bg-white/80 p-4 shadow-sm shadow-slate-900/10",children:[u.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.4em] text-muted-foreground",children:"Structured dictionary"}),u.jsx(ei,{data:L})]}),v=()=>{if((l==null?void 0:l.kind)==="generic")return m(l.value);if(!d)return null;if(d.type==="text"){const M=(d.text??"").trim();if(!M)return null;const X=tr(M);return m(X)}const L=Sr(d),z=tr(L);return m(z)},g=()=>(l==null?void 0:l.kind)==="dict"?f(l.data):v(),x=()=>{if(!b)return;if(s.name){const z=b[s.name];if(z)return z}const L=(l==null?void 0:l.kind)??(a==null?void 0:a.kind);if(L){const z=b[L];if(z)return z}return b.default},{toolRenderers:b,toolArtifactRenderers:y}=r??{},C=x(),E=g(),S=!o||t==="expanded",T=(S?C==null?void 0:C({message:e,toolMeta:s,toolPayload:l,viewMode:t,isStreaming:n}):null)??null,A=(($=(()=>{if(!y)return;const L=i==null?void 0:i.type;if(typeof L=="string"){const z=y[L];if(z)return z}return y.default})())==null?void 0:$({artifact:i,message:e,toolPayload:l,isStreaming:n}))??null,j=T??E;return u.jsxs("div",{className:"space-y-2",children:[i&&(A??u.jsx(Fh,{artifact:i,idx:0})),u.jsx(Bh,{message:e,isStreaming:n}),S?j:null]})}const YT={checkpoints:[],checkpointMetaByCheckpointId:new Map,timeline:[],messagePreviews:new Map,getLatest:()=>{},getCheckpoint:()=>{},getMessageAttempts:()=>[]},bl=(e,t)=>(e==null?void 0:e.id)??`message-${t}`,yl=w.memo(function({message:t,index:n,isStreaming:r,streamingAssistantId:o,streamingDebounceMs:s,layoutSize:i,enableMessageEditing:a,editingMessageId:c,onEdit:l,onRegenerate:d,onCancelEdit:p,showToolMessages:m,checkpointIndex:f,onSelectCheckpoint:v,getMessageCustomStyles:g,getInterruptOptions:x,toolConfig:b}){const y=bl(t,n),C=t.role==="default_message",
|
|
129
|
+
`),d=Qn(l);d&&typeof d=="object"&&(r=[d])}if(!r.length)return null;const s=qT(r)??r[r.length-1];if(!s)return null;const i=s.output??s.payload??s,a=Cr(i),c=tr(a);return c&&typeof c=="object"&&!Array.isArray(c)?{kind:"dict",value:c,data:c,event:s}:{kind:"generic",value:c,event:s}},[e])}function qh({message:e,viewMode:t,isStreaming:n=!1,toolConfig:r,expandable:o=!1}){var $;const s=Qo(e),i=e.artifact??null,a=GT(e),l=(a?_u(a):null)??a,d=e.content.find(L=>L.type!=="tool_call"),p=L=>{if(L==null)return null;const z=typeof L=="string"?Qn(L)??L:L;if(z&&typeof z=="object")return u.jsx(ei,{data:z});const G=typeof z=="string"?z:(()=>{try{return er(z)}catch{return String(z??"")}})();return u.jsx("pre",{className:"whitespace-pre-wrap break-words font-sans text-sm text-foreground/90",children:G})},m=L=>{if(L==null)return null;const{content:z,isMarkdown:G}=Tu(L);return G?u.jsx(fr,{content:z,className:"text-current"}):p(L)},f=L=>u.jsxs("div",{className:"space-y-2 rounded-2xl border border-muted-foreground/30 bg-white/80 p-4 shadow-sm shadow-slate-900/10",children:[u.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.4em] text-muted-foreground",children:"Structured dictionary"}),u.jsx(ei,{data:L})]}),v=()=>{if((l==null?void 0:l.kind)==="generic")return m(l.value);if(!d)return null;if(d.type==="text"){const M=(d.text??"").trim();if(!M)return null;const X=tr(M);return m(X)}const L=Sr(d),z=tr(L);return m(z)},g=()=>(l==null?void 0:l.kind)==="dict"?f(l.data):v(),x=()=>{if(!b)return;if(s.name){const z=b[s.name];if(z)return z}const L=(l==null?void 0:l.kind)??(a==null?void 0:a.kind);if(L){const z=b[L];if(z)return z}return b.default},{toolRenderers:b,toolArtifactRenderers:y}=r??{},C=x(),E=g(),S=!o||t==="expanded",T=(S?C==null?void 0:C({message:e,toolMeta:s,toolPayload:l,viewMode:t,isStreaming:n}):null)??null,A=(($=(()=>{if(!y)return;const L=i==null?void 0:i.type;if(typeof L=="string"){const z=y[L];if(z)return z}return y.default})())==null?void 0:$({artifact:i,message:e,toolPayload:l,isStreaming:n}))??null,j=T??E;return u.jsxs("div",{className:"space-y-2",children:[i&&(A??u.jsx(Fh,{artifact:i,idx:0})),u.jsx(Bh,{message:e,isStreaming:n}),S?j:null]})}const YT={checkpoints:[],checkpointMetaByCheckpointId:new Map,timeline:[],messagePreviews:new Map,getLatest:()=>{},getCheckpoint:()=>{},getMessageAttempts:()=>[]},bl=(e,t)=>(e==null?void 0:e.id)??`message-${t}`,yl=w.memo(function({message:t,index:n,isStreaming:r,streamingAssistantId:o,streamingDebounceMs:s,layoutSize:i,enableMessageEditing:a,editingMessageId:c,onEdit:l,onRegenerate:d,onCancelEdit:p,showToolMessages:m,checkpointIndex:f,onSelectCheckpoint:v,getMessageCustomStyles:g,getInterruptOptions:x,toolConfig:b}){const y=bl(t,n),C=t.role==="default_message",T=!!t.__syntheticStreaming||r&&o===t.id&&t.role==="assistant",k=f??YT,A=!C&&"checkpointId"in t?t.checkpointId??null:null,{attemptCount:j,attemptIndex:$,attempts:L}=w.useMemo(()=>cc(t.id,A,k),[t.id,A,k]),z=g==null?void 0:g(t);return u.jsx("div",{className:"relative mb-4 last:mb-0","data-message-id":y,style:{minHeight:"60px",containIntrinsicSize:"auto 120px"},children:u.jsx(ni,{message:t,messageIndex:n,isStreamingMessage:T,renderStreamingMarkdown:T,streamingDebounceMs:s,isEditing:c===t.id,showActions:a,showTimestamp:!1,showAgentName:!0,layoutSize:i,onEdit:l,onRegenerate:()=>d(n),onCancelEdit:p,getInterruptOptions:x,showToolMessages:m,attemptCount:j,attemptIndex:$,attemptMetas:L,onSelectCheckpoint:v,customStyles:z,toolConfig:b})})});yl.displayName="MessageRow";function XT(e,t,n){const[r,o]=w.useState(e),s=w.useRef([]);return w.useEffect(()=>{if(!t){o(e),s.current=e.map(a=>a.type==="text"?a.text??"":void 0);return}const i=e.map((a,c)=>{if(a.type!=="text")return s.current[c]=void 0,a;const l=a.text??"",d=s.current[c];return n(l)?(s.current[c]=l,a):{...a,text:d??""}});o(i)},[e,t,n]),r}function JT({message:e,isToolMessage:t,showToolMessages:n,toolViewMode:r,toolExpandable:o,isToolStreaming:s,contentParts:i,textContent:a,imageParts:c,fileParts:l,interruptPart:d,isStreamingMessage:p,enableStreamingMarkdownBuffer:m,renderStreamingMarkdown:f,defaultMessage:v,handleFileClick:g,uploadingFiles:x,messageRole:b,truncateUserMessages:y,userMessagePreviewLength:C,isUserExpanded:E,setIsUserExpanded:S,isCompactLayout:T,iconForeground:k,toolConfig:A,handleInterruptApprove:j,handleInterruptReject:$,handleInterruptAlternative:L,disableInterruptActions:z,isInterruptMessage:G}){const M=w.useCallback(()=>u.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted/30 rounded",children:[u.jsx(le.Loader,{className:"h-4 w-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:"File upload"})]}),[]),U=XT(i,(m??!0)&&p,Gh),W=w.useMemo(()=>U.filter(H=>H.type==="text"),[U]),R=w.useMemo(()=>W.map(H=>H.text??"").join(""),[W]),I=w.useMemo(()=>{if(!f)return null;const H=ZT(R);return{stablePart:R.slice(0,H),tailPart:R.slice(H)}},[R,f]),Y=w.useMemo(()=>{if(!I)return null;const{stablePart:H,tailPart:P}=I;return!H&&!P?null:u.jsxs("div",{className:"space-y-2",children:[H?u.jsx(fr,{content:H,allowHtml:!1}):null,P?u.jsx(fr,{content:P,allowHtml:!1}):null]})},[I]),J=w.useMemo(()=>{if(!f)return U;const H=[];let P=!1;for(const _ of U){if(_.type==="text"){P||(H.push({type:"text",text:"",__streamingMarkdownAggregate:!0}),P=!0);continue}H.push(_)}return H},[U,f]),q=(f?J:U).filter(H=>H.type!=="interrupt"),D=w.useCallback(({part:H,i:P})=>{if(H.type==="text"){if(f)return null;const _=H.text??"",K=_.trim(),Z=Qn(K);return Z&&b!=="tool"?u.jsx(ei,{data:Z},P):b==="user"&&y&&K.length>C?u.jsx(Uh,{text:K,expanded:E,onExpandedChange:S,previewLength:C,isCompact:T},P):u.jsx(fr,{content:_,allowHtml:!1},P)}if(H.type==="image_url"){const _=H;return u.jsx("div",{className:"my-2",children:u.jsx("img",{src:_.url,alt:_.alt??"",loading:"lazy",className:"border rounded max-h-[420px] w-auto object-contain"})},P)}if(H.type==="file"){const _=H,K=_.name||"file";return u.jsxs("a",{href:_.url,onClick:Z=>g(Z,_,P),className:`inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
|
|
130
130
|
dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,children:[x[P]?u.jsx(le.Loader,{className:"h-4 w-4 animate-spin"}):null,u.jsxs("span",{className:"truncate max-w-[180px]",children:[K,x[P]?" (processing)":""]})]},P)}return null},[g,T,E,b,y,x,C,f,S]),F=a.trim().length>0||c.length>0||l.length>0||q.length>0;if(!t&&l.length>0&&!p)return M();if(!t&&!F&&!p)return null;if(t){if(!n)return null;if(G&&d){const H=d.value,P=!z,_=j??(()=>{}),K=$??(()=>{});return u.jsx(wl,{interruptPart:d,payload:H,onApprove:_,onReject:K,onSelectAlternative:L,disabled:z,isActive:P})}return u.jsx(qh,{message:e,viewMode:r,expandable:o,isStreaming:s,toolConfig:A},e.id)}if(!v){const H=u.jsx("div",{className:"space-y-2",children:q.map((P,_)=>f&&QT(P)?Y?u.jsx("div",{className:"space-y-2",children:Y},`streaming-md-${_}`):null:u.jsx(D,{part:P,i:_},_))});return p?u.jsxs("div",{"aria-busy":"true",role:"status",children:[H,u.jsx(Hh,{className:k})]}):H}return null}function Gh(e){return e?!(jo(e,/```/g)||jo(e,/`/g)||jo(e,/\*\*/g)||jo(e,/__/g)||jo(e,/~~/g)||/[^\\]\[[^\]]*$/.test(e)||/\[[^\]]*\]\([^)]*$/.test(e)):!0}function jo(e,t){const n=e.match(t);return((n==null?void 0:n.length)??0)%2!==0}function ZT(e){if(!e)return 0;for(let t=e.length;t>=0;t-=1)if(Gh(e.slice(0,t)))return t;return 0}function QT(e){return e.type==="text"&&!!e.__streamingMarkdownAggregate}const ek=Kr.cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Yh({className:e,variant:t,...n}){return u.jsx("div",{className:ne(ek({variant:t}),e),...n})}function tk({showTimestamp:e,showAgentName:t,isToolMessage:n,isInterruptMessage:r=!1,iconForeground:o,agentName:s,messageIcon:i,customHeaderClass:a,customActionsClass:c,isCompactLayout:l,showActions:d,isEditing:p,messageRole:m,toolViewMode:f,toolExpandable:v=!1,toolMeta:g,onToggleToolView:x,onCopy:b,onEdit:y,onRegenerate:C,showCheckpointControls:E,attemptCount:S,attemptIndex:T,handleOlderAttemptSelect:k,handleNewerAttemptSelect:A,messageCreatedAt:j,copied:$}){return!e&&!t&&!n&&!r?null:u.jsxs("div",{className:ne("flex items-center justify-between mb-2 pb-2 border-b border-current/10",l&&"mb-1 pb-1",o,a),children:[u.jsxs("div",{className:"flex items-center gap-2",children:[i,t&&s&&u.jsx("span",{className:ne("font-medium",l?"text-xs":"text-sm"),children:s}),n&&!r&&u.jsxs(Yh,{variant:"outline",className:ne("text-xs flex items-center gap-1",o,"border border-current/40",l&&"text-xs h-4",v&&"cursor-pointer select-none"),role:v?"button":void 0,tabIndex:v?0:void 0,"aria-expanded":v?f==="expanded":void 0,onClick:v?x:void 0,onKeyDown:L=>{v&&(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),x())},children:[u.jsx("span",{children:g.name??"Tool Output"}),g.toolCallId&&u.jsx("span",{className:"opacity-70",children:g.toolCallId.slice(0,8)}),v&&(f==="expanded"?u.jsx(le.ChevronUp,{className:"h-3 w-3"}):u.jsx(le.ChevronDown,{className:"h-3 w-3"}))]}),r&&u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:g.name??"Interrupt"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[E&&S>1&&u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsx("button",{type:"button",className:ne("flex items-center justify-center rounded border px-1.5 py-1 transition-colors",T<S-1?"border-border text-foreground hover:bg-muted/60":"border-border text-muted-foreground cursor-not-allowed"),onClick:()=>{T>=S-1||k()},"aria-label":"Older attempt (back in time)",disabled:T>=S-1,children:u.jsx(le.ChevronLeft,{className:"h-3 w-3"})}),u.jsx("div",{className:"flex items-center gap-2",children:u.jsxs("span",{className:"whitespace-nowrap",children:[S-T," / ",S]})}),u.jsx("button",{type:"button",className:ne("flex items-center justify-center rounded border px-1.5 py-1 transition-colors",T>0?"border-border text-foreground hover:bg-muted/60":"border-border text-muted-foreground cursor-not-allowed"),onClick:()=>{T<=0||A()},"aria-label":"Newer attempt (forward in time)",disabled:T<=0,children:u.jsx(le.ChevronRight,{className:"h-3 w-3"})})]}),e&&j&&u.jsx("time",{className:ne("text-xs opacity-60",o,l&&"text-xs"),dateTime:new Date(j).toISOString(),title:new Date(j).toLocaleString(),children:new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(j))}),d&&!p&&u.jsxs("div",{className:ne("opacity-0 group-hover:opacity-100 transition-opacity","flex items-center gap-1",c),children:[u.jsx("div",{className:"relative",children:u.jsx(Xe,{variant:"ghost",size:"sm",onClick:b,className:ne("h-6 w-6 p-0 hover:bg-foreground/10",o,l&&"h-5 w-5"),"aria-label":"Copy message",title:"Copy message",children:u.jsx(le.Copy,{className:ne($?"text-success":o,l?"h-3 w-3":"h-4 w-4")})})}),m==="user"&&y&&u.jsx(Xe,{variant:"ghost",size:"sm",onClick:y,className:ne("h-6 w-6 p-0 hover:bg-foreground/10",o,l&&"h-5 w-5"),"aria-label":"Edit message",children:u.jsx(le.Edit,{className:ne(o,l?"h-3 w-3":"h-4 w-4")})}),m==="assistant"&&C&&u.jsx(Xe,{variant:"ghost",size:"sm",onClick:C,className:ne("h-6 w-6 p-0 hover:bg-foreground/10",o,l&&"h-5 w-5"),"aria-label":"Regenerate response",children:u.jsx(le.RotateCcw,{className:ne(o,l?"h-3 w-3":"h-4 w-4")})})]})]})]})}const ni=w.memo(function({message:t,messageIndex:n,isStreamingMessage:r=!1,isEditing:o=!1,showActions:s=!0,showTimestamp:i=!0,showAgentName:a=!0,layoutSize:c="desktop",truncateUserMessages:l=!0,userMessagePreviewLength:d=500,showToolMessages:p=!0,toolConfig:m,customStyles:f={},streamingDebounceMs:v=300,renderStreamingMarkdown:g=!1,enableStreamingMarkdownBuffer:x,onEdit:b,onRegenerate:y,onCopy:C,getInterruptOptions:E,attemptCount:S=1,attemptIndex:T=0,onSelectCheckpoint:k,attemptMetas:A=[]}){const[j,$]=w.useState(!1),[L,z]=w.useState(!1),{currentThreadId:G}=yr(),{respondToInterrupt:M}=oo(),[X,U]=w.useState(!1),W=c==="phone"||c==="half-screen",R=t.role,I=R==="interrupt",Y=R==="tool"||I,O=!(t.role==="default_message")&&t.expandable!==void 0?t.expandable!==!1:!0,{toolRenderers:q,toolArtifactRenderers:D,getToolExpandable:F}=m??{},H=w.useMemo(()=>!F||t.role!=="tool"?!1:F(t),[F,t.id,t.role]),[P,_]=w.useState(H?"preview":"expanded");w.useEffect(()=>{_(H?"preview":"expanded")},[H,t.id]);const K=w.useMemo(()=>t.role==="default_message"?t:null,[t]),Z=!!K,oe=!(r&&R!=="user"),{uploadingFiles:se,handleFileClick:Ne,fileViewerOpen:ye,currentFileInfo:je,closeFileViewer:ze}=Wh({allowFileOpen:oe,currentThreadId:G}),$e=w.useMemo(()=>{switch(R){case"user":return"text-[hsl(var(--chat-bubble-user-text))]";case"assistant":return"text-[hsl(var(--chat-bubble-ai-text))]";case"interrupt":return"text-[hsl(var(--chat-bubble-ai-text))]";case"tool":return"text-secondary-foreground";case"system":return"text-muted-foreground";default:return"text-[hsl(var(--chat-bubble-ai-text))]"}},[R]),Ye=Vh(t,K),{contentParts:Ze,imageParts:at,fileParts:St,textContent:ft,toolMeta:Ve,toolRaw:He,isToolStreaming:Oe,interruptParts:_e}=Ye,Fe=x??v!==0,rt=w.useMemo(()=>_e.length?_e[0]:null,[_e]),xt=w.useCallback(async()=>{const Ee=Y?He:ft;async function Ce(qe){if(navigator.clipboard&&typeof navigator.clipboard.writeText=="function"){await navigator.clipboard.writeText(qe);return}if(navigator.clipboard&&typeof navigator.clipboard.write=="function"&&typeof ClipboardItem<"u"){const jt=new Blob([qe],{type:"text/plain"});await navigator.clipboard.write([new ClipboardItem({"text/plain":jt})]);return}throw new Error("Clipboard API not supported in this context.")}try{await Ce(Ee),$(!0),setTimeout(()=>$(!1),2e3),C==null||C(Ee)}catch(qe){console.error("Failed to copy:",qe)}},[Y,He,ft,C]),Qe=w.useCallback(async(Ee,Ce)=>{if(!rt)return;if(!Hi(rt.id)){console.warn("Interrupt part missing id",rt);return}U(!0);try{const jt=E==null?void 0:E(t);await M(Ee,Ce,jt)}catch(jt){console.error("Failed to respond to interrupt:",jt)}finally{U(!1)}},[rt,M]),It=w.useCallback(()=>Qe(!0),[Qe]),pt=w.useCallback(()=>Qe(!1),[Qe]),vt=w.useCallback((Ee,Ce)=>{if(!Ce)return;const qe={alternativeId:Ce.id??Ce.label??void 0,alternativeLabel:Ce.label};Qe(!0,qe)},[Qe]),Nt=w.useCallback(()=>{if(!b||!t.id)return;const Ee=(Y?He:ft)??"",Ce="type"in t&&t.type==="default_message"?void 0:{checkpointId:t.checkpointId??null,checkpointNs:t.checkpointNs??null};b(t.id,Ee,Ce)},[b,Y,He,ft,t]),en=w.useCallback(()=>{y==null||y(n)},[y,n]),Ct=w.useCallback(()=>{const Ce=ne(W?"h-3 w-3":"h-4 w-4","opacity-60 flex-shrink-0",$e);switch(R){case"user":return u.jsx(le.User,{className:Ce});case"assistant":return u.jsx(le.Bot,{className:Ce});case"tool":return u.jsx(le.Wrench,{className:Ce});case"interrupt":return u.jsx(le.Bot,{className:Ce});default:return u.jsx(le.Bot,{className:Ce})}},[W,$e,R]),sn=w.useCallback(()=>{const Ee="group relative mb-4 flex w-full";switch(R){case"user":return ne(Ee,"justify-end");case"assistant":case"tool":case"system":case"interrupt":return ne(Ee,"justify-start");default:return Ee}},[R]),wt=w.useCallback(()=>{const Ee=ne("rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",W&&"px-3 py-2 text-sm");if(Z)return ne(Ee,"w-full","bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]","border border-border/60 dark:border-border/40 shadow-sm");switch(R){case"user":return ne(Ee,"w-full md:max-w-[95%]","bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]","border border-transparent");case"assistant":return ne(Ee,"w-full md:max-w-[95%]","bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]","border border-border/60 dark:border-border/40");case"tool":case"interrupt":return ne(Ee,"w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");case"system":return ne(Ee,"w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");default:return ne(Ee,"w-full md:max-w-[95%]","bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]","border border-border/60 dark:border-border/40")}},[W,Z,R]),Ue=H&&!I&&O,We=w.useCallback(()=>{Ue&&_(Ee=>Ee==="expanded"?"preview":"expanded")},[Ue]),Q=I?"expanded":P,ge=(p||I)&&O,et=u.jsx(JT,{message:t,isToolMessage:Y,showToolMessages:ge,toolViewMode:Q,toolExpandable:H,toolConfig:{toolRenderers:q,toolArtifactRenderers:D,getToolExpandable:F},isToolStreaming:Oe,contentParts:Ze,textContent:ft,imageParts:at,fileParts:St,isStreamingMessage:r,defaultMessage:K,enableStreamingMarkdownBuffer:Fe,renderStreamingMarkdown:g,handleFileClick:Ne,uploadingFiles:se,messageRole:R,truncateUserMessages:l,userMessagePreviewLength:d,isUserExpanded:L,setIsUserExpanded:z,isCompactLayout:W,iconForeground:$e,interruptPart:rt,handleInterruptApprove:It,handleInterruptReject:pt,handleInterruptAlternative:vt,disableInterruptActions:X,isInterruptMessage:I}),fe=w.useMemo(()=>K?"Assistant":Iu(t),[K,t]),Me=Ct(),Ke=R==="user"&&(S??1)>1&&typeof k=="function",ut=(A==null?void 0:A.length)??0,ct=ut>0&&T<ut-1?A[T+1]:void 0,dt=ut>0&&T>0?A[T-1]:void 0,Pt=w.useCallback(()=>{!ct||!k||k(ct.id,void 0,!!ct.isLatestAttempt)},[ct,k]),ke=w.useCallback(()=>{!dt||!k||k(dt.id,void 0,!!dt.isLatestAttempt)},[dt,k]);return Y&&!p?null:Z&&K?u.jsx("div",{className:ne(sn(),f.container),children:u.jsxs("div",{className:ne(wt(),f.content),children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2 pb-2 border-b border-current/10",children:[u.jsx(le.Bot,{className:ne("h-4 w-4",$e)}),a&&u.jsx("span",{className:"font-medium text-sm",children:"Assistant"})]}),u.jsx(fr,{content:K.content,className:"text-current"})]})}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:ne(sn(),f.container),children:u.jsxs("div",{className:ne(wt(),f.content),children:[u.jsx(tk,{showTimestamp:i,showAgentName:a,isToolMessage:Y,iconForeground:$e,agentName:fe,messageIcon:Me,customHeaderClass:f.header,customActionsClass:f.actions,isCompactLayout:W,showActions:s,isEditing:o,messageRole:R,toolViewMode:Q,toolExpandable:H,isInterruptMessage:I,toolMeta:Ve,onToggleToolView:We,onCopy:xt,onEdit:Nt,onRegenerate:en,showCheckpointControls:Ke,attemptCount:S,attemptIndex:T,handleOlderAttemptSelect:Pt,handleNewerAttemptSelect:ke,messageCreatedAt:t.createdAt,copied:j}),u.jsx("div",{className:"relative",children:et}),!(i||a||Y)&&s&&!o&&u.jsxs("div",{className:ne("absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity","flex items-center gap-1",f.actions),children:[u.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>xt(),className:ne("h-6 w-6 p-0 hover:bg-background/50 text-current",W&&"h-5 w-5"),children:u.jsx(le.Copy,{className:ne(j?"text-success":"text-current",W?"h-3 w-3":"h-4 w-4")})}),R==="user"&&b&&u.jsx(Xe,{variant:"ghost",size:"sm",onClick:Nt,className:ne("h-6 w-6 p-0 hover:bg-background/50 text-current",W&&"h-5 w-5"),children:u.jsx(le.Edit,{className:ne("text-current",W?"h-3 w-3":"h-4 w-4")})}),R==="assistant"&&y&&u.jsx(Xe,{variant:"ghost",size:"sm",onClick:en,className:ne("h-6 w-6 p-0 hover:bg-background/50 text-current",W&&"h-5 w-5"),children:u.jsx(le.RotateCcw,{className:ne("text-current",W?"h-3 w-3":"h-4 w-4")})})]})]})}),je&&u.jsx(Th,{isOpen:ye,onClose:ze,fileId:je.id,fileName:je.name,mimeType:je.mimeType})]})},(e,t)=>{var c,l,d,p,m,f,v,g;if(t.isStreamingMessage||e.isStreamingMessage||!(e.message.id===t.message.id&&Ui(e.message)===Ui(t.message)))return!1;const o=["isEditing","showActions","layoutSize","showTimestamp","showAgentName","truncateUserMessages","userMessagePreviewLength","showToolMessages","toolConfig"].every(x=>e[x]===t[x]),s=((c=e.customStyles)==null?void 0:c.container)===((l=t.customStyles)==null?void 0:l.container)&&((d=e.customStyles)==null?void 0:d.content)===((p=t.customStyles)==null?void 0:p.content)&&((m=e.customStyles)==null?void 0:m.actions)===((f=t.customStyles)==null?void 0:f.actions)&&((v=e.customStyles)==null?void 0:v.header)===((g=t.customStyles)==null?void 0:g.header);if(!o||!s)return!1;const i=Wi(e.message),a=Wi(t.message);return i.length===a.length});ni.displayName="MessageComponent";const Sl=w.forwardRef(({messages:e,isStreaming:t,streamingAssistantId:n,streamingDebounceMs:r,layoutSize:o,enableMessageEditing:s,editingMessageId:i,onStartReached:a,onEdit:c,onRegenerate:l,onCancelEdit:d,className:p,style:m,emptyMessage:f,followNewMessages:v=!0,isNavigatingCheckpoint:g=!1,onScrollAway:x,onAtBottom:b,showToolMessages:y=!0,toolConfig:C,checkpointIndex:E,activeCheckpointId:S,onSelectCheckpoint:T,createSyntheticThinkingMessage:k=!0,forceSyntheticThinking:A=!1,getMessageCustomStyles:j,getInterruptOptions:$},L)=>{const z=w.useRef(null),G=w.useRef(null),M=w.useRef(!1),X=w.useRef(!1),U=e,W=w.useMemo(()=>{const P=n&&U.some(K=>K.id===n);return k&&(t||A)&&!P&&U.length>0?[...U,{id:"thinking-assistant",role:"assistant",content:[{type:"text",text:""}],createdAt:new Date().toISOString(),__syntheticStreaming:!0}]:U},[U,t,n,k,A]),R=w.useMemo(()=>y?W:W.filter(P=>(P==null?void 0:P.role)!=="tool"),[W,y]),I=w.useCallback(P=>{x&&x(!P),b&&b(P)},[x,b]),Y=w.useMemo(()=>{if(a)return async()=>{if(!M.current){M.current=!0;try{await a()}finally{M.current=!1}}}},[a]),J=w.useMemo(()=>!v||g?!1:"auto",[v,g]),O=w.useMemo(()=>{if(typeof f!="string")return null;const P=f.trim();return!P||R&&R.length>0?null:{id:"default-message",role:"default_message",content:P,createdAt:new Date().toISOString()}},[f,R]),q=["flex h-full flex-col md:flex-row",p].filter(Boolean).join(" "),D=()=>{if(O){const P=j==null?void 0:j(O);return u.jsx("div",{className:"p-6 h-full overflow-y-auto",children:u.jsx("div",{className:"w-full max-w-full",children:u.jsx(ni,{message:O,messageIndex:0,isStreamingMessage:!1,showActions:!1,showTimestamp:!1,showAgentName:!0,layoutSize:o,onEdit:()=>{},onRegenerate:()=>{},onCancelEdit:()=>{},customStyles:P,getInterruptOptions:$})})})}return u.jsx("div",{className:"flex h-full items-center justify-center py-8 text-center text-muted-foreground",children:f??"No messages yet. Start a conversation!"})},F=R.length,H=F>0;return w.useEffect(()=>{var P,_;if(F===0){X.current=!1;return}if(!X.current)if(X.current=!0,z.current&&R.length>0){const K=R.length-1;(_=(P=z.current).scrollToIndex)==null||_.call(P,{index:K,align:"end",behavior:"auto"})}else G.current&&(G.current.scrollTop=G.current.scrollHeight)},[F,R.length]),w.useImperativeHandle(L,()=>({scrollToLatest:()=>{var P,_;if(z.current&&R.length>0){const K=R.length-1;(_=(P=z.current).scrollToIndex)==null||_.call(P,{index:K,align:"end",behavior:"auto"})}else G.current&&(G.current.scrollTop=G.current.scrollHeight)},scrollToTop:()=>{var P,_;z.current&&R.length>0?(_=(P=z.current).scrollToIndex)==null||_.call(P,{index:0,align:"start",behavior:"auto"}):G.current&&(G.current.scrollTop=0)}}),[R]),u.jsx("div",{className:q,style:m,children:u.jsx("div",{className:"relative flex-1 min-h-0",children:H?u.jsx(YC,{ref:P=>{z.current=P},scrollerRef:P=>{G.current=P instanceof HTMLDivElement?P:null},data:R,followOutput:J,overscan:200,increaseViewportBy:{top:100,bottom:200},defaultItemHeight:80,atBottomThreshold:50,startReached:()=>{Y&&Y()},atBottomStateChange:I,style:{height:"100%",overscrollBehavior:"contain"},computeItemKey:(P,_)=>bl(_,P),itemContent:(P,_)=>u.jsx(yl,{message:_,index:P,isStreaming:t,streamingAssistantId:n,streamingDebounceMs:r,layoutSize:o,enableMessageEditing:s,editingMessageId:i,onEdit:c,onRegenerate:l,onCancelEdit:d,showToolMessages:y,toolConfig:C,checkpointIndex:E,activeCheckpointId:S,onSelectCheckpoint:T,getMessageCustomStyles:j,getInterruptOptions:$})}):D()})})});Sl.displayName="MessageList";const Xh={value:""};function Fr({className:e="",placeholder:t="Type your message...",autoFocus:n=!0,maxHeight:r=void 0,streamingDebounceMs:o=500,streamingThrottleMs:s,followNewMessages:i=!0,enableFileUpload:a=!0,enableExcelUpload:c=!1,enableMessageEditing:l=!0,showToolMessages:d=!0,toolConfig:p,toolRenderers:m,toolArtifactRenderers:f,payloadExtras:v={},customStyles:g={},messageCustomStyles:x,onMessageSent:b,onExcelUploadSuccess:y,onError:C,defaultMessage:E}){const{api:S}=no(),T=S.baseUrl,{currentThreadId:k}=yr(),{threadId:A,messages:j,isLoading:$,navigateToCheckpoint:L,returnToLatest:z,checkpoint:G,checkpoints:M,interrupt:X,metadata:U,checkpointIndex:W,respondToInterrupt:R}=oo(),{isStreaming:I,error:Y,connectionState:J,submit:O,stop:q}=qi(),D=A??k??null,F=(G==null?void 0:G.id)??null,H=(G==null?void 0:G.namespace)??null,P=(U==null?void 0:U.assemblingMessageId)??null,_=X,K=_?Hi(_.id):null,Z=K!==null?{type:"interrupt",id:K}:null,[oe,se]=w.useState(!1),[Ne,ye]=w.useState(!1);w.useEffect(()=>{_||se(!1)},[_]);const je=w.useCallback(()=>{se(!0)},[]),ze=w.useCallback(()=>{se(!1)},[]),$e=w.useCallback(ae=>{},[]),Ye=w.useCallback(ae=>ae.name!=="ask_user_choice",[]),Ze=p??{toolRenderers:m,toolArtifactRenderers:f,getToolExpandable:Ye},at=w.useCallback(async(ae,pe,we)=>{try{je(),await R(ae,pe,we)}catch(be){console.error("Failed to respond to interrupt:",be)}finally{ze()}},[ze,je,R]),St=w.useCallback(()=>at(!0),[at]),ft=w.useCallback(()=>at(!1),[at]),Ve=w.useCallback((ae,pe)=>at(!0,pe),[at]),He=!!_||oe,[Oe,_e]=w.useState(null),[Fe,rt]=w.useState(""),[xt,Qe]=w.useState(null),[It,pt]=w.useState(null),[vt,Nt]=w.useState(!1),[en,Ct]=w.useState(null),sn=w.useRef(!1),[wt,Ue]=w.useState(()=>Xh.value),We=w.useRef(wt),Tt=w.useRef(null),Q=w.useCallback(ae=>{Xh.value=ae,Ue(ae)},[]),[ge,et]=w.useState(!1),fe=w.useRef(null),Me=w.useCallback(ae=>{Q(ae)},[Q]);w.useEffect(()=>{I||ye(!1)},[I]),w.useEffect(()=>{U!=null&&U.assemblingMessageId&&ye(!1)},[U==null?void 0:U.assemblingMessageId]);const[Ke,ut]=w.useState("desktop");w.useEffect(()=>{const ae=()=>{const pe=window.innerWidth;ut(pe<640?"phone":pe<1024?"tablet":"desktop")};return ae(),window.addEventListener("resize",ae),()=>window.removeEventListener("resize",ae)},[]),w.useEffect(()=>{sn.current=!1},[D]),w.useEffect(()=>{We.current=wt},[wt]),w.useEffect(()=>{if(!Oe){Tt.current=null;return}Tt.current===null&&(Tt.current=We.current),Q(Fe??"")},[Fe,Oe,Q]),w.useEffect(()=>{if(E!==void 0){Ct(E);return}(async()=>{if(!T){Ct(null);return}try{const we=(await S.getAgent("default")).uiDefaultMessage||"";Ct(we||null)}catch(pe){console.warn("Failed to fetch default message:",pe),Ct(null)}})()},[S,T,E]),w.useEffect(()=>{Y&&!vt&&(C==null||C(Y))},[Y,vt,C]);const ct=async(ae,pe)=>{const we=ae.trim();if(!(!we&&pe.length===0))try{const be=Oe?(xt==null?void 0:xt.checkpointId)??F??void 0:F??void 0,Ae=Oe?(xt==null?void 0:xt.checkpointNs)??H??void 0:H??void 0;await O({text:we||"",attachments:pe,payload:v},{checkpointId:be,checkpointNs:Ae,edit:!!Oe,originalMessageId:Oe??void 0}),b==null||b(we),ye(!0),Q(""),pt(null),_e(null),rt(""),Qe(null)}catch(be){const Ae=(be==null?void 0:be.message)||"Failed to send message";pt(Ae),C==null||C(Ae),ye(!1)}},dt=w.useCallback(async ae=>{await O({attachments:[ae],payload:v},{checkpointId:F??void 0,checkpointNs:H??void 0}),y==null||y({file:ae})},[F,H,v,y,O]),Pt=w.useCallback((ae,pe,we)=>{l&&(Tt.current=wt,_e(ae),rt(pe),Q(pe),pt(null),Qe({checkpointId:(we==null?void 0:we.checkpointId)??null,checkpointNs:(we==null?void 0:we.checkpointNs)??null}))},[wt,l,Q]),ke=w.useCallback(()=>{_e(null),rt(""),Qe(null),pt(null),Q(Tt.current??wt),Tt.current=null},[wt,Q]),Ee=w.useCallback((ae,pe,we)=>{Pt(ae,pe,we)},[Pt]),Ce=w.useCallback(ae=>{let pe=null;for(let ot=ae-1;ot>=0;ot--)if(j[ot].role==="user"){pe=j[ot];break}if(!pe)return;const we=Array.isArray(pe.content)?pe.content:[],Ae=we.filter(ot=>(ot==null?void 0:ot.type)==="text").map(ot=>ot.text).join("")||(()=>{try{return JSON.stringify(we,null,2)}catch{return String(we)}})();Ae&&O({text:Ae,payload:v},{checkpointId:F??void 0,checkpointNs:H??void 0,edit:!0,originalMessageId:pe.id})},[j,O,F,H,v]),qe=w.useCallback(async ae=>{if(k){et(!0);try{if(!ae){await z(),requestAnimationFrame(()=>{var be;(be=fe.current)==null||be.scrollToLatest()});return}const pe=M.find(be=>be.checkpointId===ae),we=(pe==null?void 0:pe.checkpointNs)??null;await L(ae,we),requestAnimationFrame(()=>{var be;(be=fe.current)==null||be.scrollToTop()})}finally{et(!1)}}},[M,k,fe,L,z]),jt=w.useCallback(async(ae,pe,we)=>{await qe(we?null:ae)},[qe]),N=`flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${g.container||""}`,ee=`flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 ${_?"pb-32":""} bg-transparent ${g.messagesArea||""}`,ce=`relative flex-shrink-0 w-full border-t p-4 bg-transparent ${g.inputArea||""}`;return u.jsxs("div",{className:N,children:[!!Y&&!vt&&u.jsxs("div",{className:"flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between",children:[u.jsx("span",{children:Y}),u.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>Nt(!0),className:"text-red-800 hover:bg-red-100","aria-label":"Dismiss error",children:u.jsx(le.X,{size:16})})]}),u.jsxs("div",{className:`relative ${ee}`,style:r?{maxHeight:r}:void 0,children:[u.jsx(Sl,{ref:fe,className:"h-full",style:{height:"100%"},messages:j,isStreaming:I,streamingAssistantId:P,streamingDebounceMs:typeof s=="number"?s:o,followNewMessages:i,layoutSize:Ke,enableMessageEditing:l,editingMessageId:Oe,onEdit:Ee,onRegenerate:Ce,onCancelEdit:ke,emptyMessage:en??void 0,isNavigatingCheckpoint:ge,showToolMessages:d,toolConfig:Ze,checkpointIndex:W,activeCheckpointId:F,onSelectCheckpoint:jt,createSyntheticThinkingMessage:!0,forceSyntheticThinking:Ne,getMessageCustomStyles:x,getInterruptOptions:$e}),(J==="reconnecting"||J==="connecting")&&u.jsx("div",{className:"pointer-events-none absolute top-3 right-3 z-20 rounded-full bg-muted/80 px-3 py-1 text-xs font-medium text-foreground shadow-sm backdrop-blur-sm dark:bg-muted/60",children:u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx(le.Loader2,{className:"h-3 w-3 animate-spin"}),J==="reconnecting"?"Reconnecting…":"Connecting…"]})}),J==="error"&&u.jsx("div",{className:"pointer-events-none absolute top-3 right-3 z-20 rounded-full bg-destructive/10 px-3 py-1 text-xs font-semibold text-destructive shadow-sm",children:"Connection lost"}),$&&u.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground",children:[u.jsx(le.Loader2,{className:"h-6 w-6 animate-spin"}),u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Loading messages…"})]}),ge&&u.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80 backdrop-blur-sm text-muted-foreground",children:[u.jsx(le.Loader2,{className:"h-6 w-6 animate-spin"}),u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:"Loading checkpoint…"})]}),_&&Z&&u.jsx("div",{className:"pointer-events-auto absolute inset-x-0 bottom-6 z-30 flex justify-center px-4",children:u.jsx("div",{className:"w-full max-w-3xl",children:u.jsx(wl,{interruptPart:Z,onApprove:St,onReject:ft,onSelectAlternative:Ve,disabled:oe,isActive:!0,payload:_.value})})})]}),u.jsxs("div",{className:ce,children:[Oe&&u.jsx("div",{className:"mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(le.Edit3,{size:16,className:"text-blue-600"}),u.jsx("span",{className:"text-sm font-medium text-blue-800",children:"Editing message"})]}),u.jsx(Xe,{variant:"ghost",size:"sm",onClick:ke,className:"text-blue-600 hover:bg-blue-100",children:u.jsx(le.X,{size:16})})]})}),It&&u.jsx("div",{className:"mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2",children:It}),u.jsx(FS,{composerValue:wt,onComposerChange:Me,onSend:ct,onCancelEdit:ke,onStop:q,editingMessageId:Oe,editingInitialValue:Fe,placeholder:Oe?"Edit your message...":t,isStreaming:I,disabled:He,enableFileUpload:a,enableExcelUpload:c,onExcelUpload:dt,onError:C,customStyles:g,textareaClassName:g.textarea||"",allowEmptySend:!1,inputError:It})]})]})}var Jh=1,nk=.9,rk=.8,ok=.17,Cl=.1,Tl=.999,sk=.9999,ik=.99,ak=/[\\\/_+.#"@\[\(\{&]/,lk=/[\\\/_+.#"@\[\(\{&]/g,ck=/[\s-]/,Zh=/[\s-]/g;function kl(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?Jh:ik;var a=`${o},${s}`;if(i[a]!==void 0)return i[a];for(var c=r.charAt(s),l=n.indexOf(c,o),d=0,p,m,f,v;l>=0;)p=kl(e,t,n,r,l+1,s+1,i),p>d&&(l===o?p*=Jh:ak.test(e.charAt(l-1))?(p*=rk,f=e.slice(o,l-1).match(lk),f&&o>0&&(p*=Math.pow(Tl,f.length))):ck.test(e.charAt(l-1))?(p*=nk,v=e.slice(o,l-1).match(Zh),v&&o>0&&(p*=Math.pow(Tl,v.length))):(p*=ok,o>0&&(p*=Math.pow(Tl,l-o))),e.charAt(l)!==t.charAt(s)&&(p*=sk)),(p<Cl&&n.charAt(l-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(l-1)!==r.charAt(s))&&(m=kl(e,t,n,r,l+1,s+2,i),m*Cl>p&&(p=m*Cl)),p>d&&(d=p),l=n.indexOf(c,l+1);return i[a]=d,d}function Qh(e){return e.toLowerCase().replace(Zh," ")}function uk(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,kl(e,t,Qh(e),Qh(t),0,0,{})}var _o='[cmdk-group=""]',El='[cmdk-group-items=""]',dk='[cmdk-group-heading=""]',em='[cmdk-item=""]',tm=`${em}:not([aria-disabled="true"])`,Il="cmdk-item-select",Br="data-value",fk=(e,t,n)=>uk(e,t,n),nm=h.createContext(void 0),Ro=()=>h.useContext(nm),rm=h.createContext(void 0),Nl=()=>h.useContext(rm),om=h.createContext(void 0),sm=h.forwardRef((e,t)=>{let n=zr(()=>{var O,q;return{search:"",value:(q=(O=e.value)!=null?O:e.defaultValue)!=null?q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=zr(()=>new Set),o=zr(()=>new Map),s=zr(()=>new Map),i=zr(()=>new Set),a=im(e),{label:c,children:l,value:d,onValueChange:p,filter:m,shouldFilter:f,loop:v,disablePointerSelection:g=!1,vimBindings:x=!0,...b}=e,y=Rt(),C=Rt(),E=Rt(),S=h.useRef(null),T=Ck();pr(()=>{if(d!==void 0){let O=d.trim();n.current.value=O,k.emit()}},[d]),pr(()=>{T(6,G)},[]);let k=h.useMemo(()=>({subscribe:O=>(i.current.add(O),()=>i.current.delete(O)),snapshot:()=>n.current,setState:(O,q,D)=>{var F,H,P,_;if(!Object.is(n.current[O],q)){if(n.current[O]=q,O==="search")z(),$(),T(1,L);else if(O==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let K=document.getElementById(E);K?K.focus():(F=document.getElementById(y))==null||F.focus()}if(T(7,()=>{var K;n.current.selectedItemId=(K=M())==null?void 0:K.id,k.emit()}),D||T(5,G),((H=a.current)==null?void 0:H.value)!==void 0){let K=q??"";(_=(P=a.current).onValueChange)==null||_.call(P,K);return}}k.emit()}},emit:()=>{i.current.forEach(O=>O())}}),[]),A=h.useMemo(()=>({value:(O,q,D)=>{var F;q!==((F=s.current.get(O))==null?void 0:F.value)&&(s.current.set(O,{value:q,keywords:D}),n.current.filtered.items.set(O,j(q,D)),T(2,()=>{$(),k.emit()}))},item:(O,q)=>(r.current.add(O),q&&(o.current.has(q)?o.current.get(q).add(O):o.current.set(q,new Set([O]))),T(3,()=>{z(),$(),n.current.value||L(),k.emit()}),()=>{s.current.delete(O),r.current.delete(O),n.current.filtered.items.delete(O);let D=M();T(4,()=>{z(),(D==null?void 0:D.getAttribute("id"))===O&&L(),k.emit()})}),group:O=>(o.current.has(O)||o.current.set(O,new Set),()=>{s.current.delete(O),o.current.delete(O)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:y,inputId:E,labelId:C,listInnerRef:S}),[]);function j(O,q){var D,F;let H=(F=(D=a.current)==null?void 0:D.filter)!=null?F:fk;return O?H(O,n.current.search,q):0}function $(){if(!n.current.search||a.current.shouldFilter===!1)return;let O=n.current.filtered.items,q=[];n.current.filtered.groups.forEach(F=>{let H=o.current.get(F),P=0;H.forEach(_=>{let K=O.get(_);P=Math.max(K,P)}),q.push([F,P])});let D=S.current;X().sort((F,H)=>{var P,_;let K=F.getAttribute("id"),Z=H.getAttribute("id");return((P=O.get(Z))!=null?P:0)-((_=O.get(K))!=null?_:0)}).forEach(F=>{let H=F.closest(El);H?H.appendChild(F.parentElement===H?F:F.closest(`${El} > *`)):D.appendChild(F.parentElement===D?F:F.closest(`${El} > *`))}),q.sort((F,H)=>H[1]-F[1]).forEach(F=>{var H;let P=(H=S.current)==null?void 0:H.querySelector(`${_o}[${Br}="${encodeURIComponent(F[0])}"]`);P==null||P.parentElement.appendChild(P)})}function L(){let O=X().find(D=>D.getAttribute("aria-disabled")!=="true"),q=O==null?void 0:O.getAttribute(Br);k.setState("value",q||void 0)}function z(){var O,q,D,F;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let H=0;for(let P of r.current){let _=(q=(O=s.current.get(P))==null?void 0:O.value)!=null?q:"",K=(F=(D=s.current.get(P))==null?void 0:D.keywords)!=null?F:[],Z=j(_,K);n.current.filtered.items.set(P,Z),Z>0&&H++}for(let[P,_]of o.current)for(let K of _)if(n.current.filtered.items.get(K)>0){n.current.filtered.groups.add(P);break}n.current.filtered.count=H}function G(){var O,q,D;let F=M();F&&(((O=F.parentElement)==null?void 0:O.firstChild)===F&&((D=(q=F.closest(_o))==null?void 0:q.querySelector(dk))==null||D.scrollIntoView({block:"nearest"})),F.scrollIntoView({block:"nearest"}))}function M(){var O;return(O=S.current)==null?void 0:O.querySelector(`${em}[aria-selected="true"]`)}function X(){var O;return Array.from(((O=S.current)==null?void 0:O.querySelectorAll(tm))||[])}function U(O){let q=X()[O];q&&k.setState("value",q.getAttribute(Br))}function W(O){var q;let D=M(),F=X(),H=F.findIndex(_=>_===D),P=F[H+O];(q=a.current)!=null&&q.loop&&(P=H+O<0?F[F.length-1]:H+O===F.length?F[0]:F[H+O]),P&&k.setState("value",P.getAttribute(Br))}function R(O){let q=M(),D=q==null?void 0:q.closest(_o),F;for(;D&&!F;)D=O>0?yk(D,_o):Sk(D,_o),F=D==null?void 0:D.querySelector(tm);F?k.setState("value",F.getAttribute(Br)):W(O)}let I=()=>U(X().length-1),Y=O=>{O.preventDefault(),O.metaKey?I():O.altKey?R(1):W(1)},J=O=>{O.preventDefault(),O.metaKey?U(0):O.altKey?R(-1):W(-1)};return h.createElement(he.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:O=>{var q;(q=b.onKeyDown)==null||q.call(b,O);let D=O.nativeEvent.isComposing||O.keyCode===229;if(!(O.defaultPrevented||D))switch(O.key){case"n":case"j":{x&&O.ctrlKey&&Y(O);break}case"ArrowDown":{Y(O);break}case"p":case"k":{x&&O.ctrlKey&&J(O);break}case"ArrowUp":{J(O);break}case"Home":{O.preventDefault(),U(0);break}case"End":{O.preventDefault(),I();break}case"Enter":{O.preventDefault();let F=M();if(F){let H=new Event(Il);F.dispatchEvent(H)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:kk},c),ri(e,O=>h.createElement(rm.Provider,{value:k},h.createElement(nm.Provider,{value:A},O))))}),pk=h.forwardRef((e,t)=>{var n,r;let o=Rt(),s=h.useRef(null),i=h.useContext(om),a=Ro(),c=im(e),l=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;pr(()=>{if(!l)return a.item(o,i==null?void 0:i.id)},[l]);let d=am(o,s,[e.value,e.children,s],e.keywords),p=Nl(),m=Kn(T=>T.value&&T.value===d.current),f=Kn(T=>l||a.filter()===!1?!0:T.search?T.filtered.items.get(o)>0:!0);h.useEffect(()=>{let T=s.current;if(!(!T||e.disabled))return T.addEventListener(Il,v),()=>T.removeEventListener(Il,v)},[f,e.onSelect,e.disabled]);function v(){var T,k;g(),(k=(T=c.current).onSelect)==null||k.call(T,d.current)}function g(){p.setState("value",d.current,!0)}if(!f)return null;let{disabled:x,value:b,onSelect:y,forceMount:C,keywords:E,...S}=e;return h.createElement(he.div,{ref:Mn(s,t),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||a.getDisablePointerSelection()?void 0:g,onClick:x?void 0:v},e.children)}),hk=h.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=Rt(),a=h.useRef(null),c=h.useRef(null),l=Rt(),d=Ro(),p=Kn(f=>o||d.filter()===!1?!0:f.search?f.filtered.groups.has(i):!0);pr(()=>d.group(i),[]),am(i,a,[e.value,e.heading,c]);let m=h.useMemo(()=>({id:i,forceMount:o}),[o]);return h.createElement(he.div,{ref:Mn(a,t),...s,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&h.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),ri(e,f=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},h.createElement(om.Provider,{value:m},f))))}),mk=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=h.useRef(null),s=Kn(i=>!i.search);return!n&&!s?null:h.createElement(he.div,{ref:Mn(o,t),...r,"cmdk-separator":"",role:"separator"})}),gk=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=Nl(),i=Kn(l=>l.search),a=Kn(l=>l.selectedItemId),c=Ro();return h.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),h.createElement(he.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":a,id:c.inputId,type:"text",value:o?e.value:i,onChange:l=>{o||s.setState("search",l.target.value),n==null||n(l.target.value)}})}),xk=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=h.useRef(null),i=h.useRef(null),a=Kn(l=>l.selectedItemId),c=Ro();return h.useEffect(()=>{if(i.current&&s.current){let l=i.current,d=s.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let f=l.offsetHeight;d.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return m.observe(l),()=>{cancelAnimationFrame(p),m.unobserve(l)}}},[]),h.createElement(he.div,{ref:Mn(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},ri(e,l=>h.createElement("div",{ref:Mn(i,c.listInnerRef),"cmdk-list-sizer":""},l)))}),vk=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...a}=e;return h.createElement(al,{open:n,onOpenChange:r},h.createElement(ll,{container:i},h.createElement(No,{"cmdk-overlay":"",className:o}),h.createElement(Ao,{"aria-label":e.label,"cmdk-dialog":"",className:s},h.createElement(sm,{ref:t,...a}))))}),wk=h.forwardRef((e,t)=>Kn(n=>n.filtered.count===0)?h.createElement(he.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),bk=h.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return h.createElement(he.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},ri(e,i=>h.createElement("div",{"aria-hidden":!0},i)))}),Wt=Object.assign(sm,{List:xk,Item:pk,Input:gk,Group:hk,Separator:mk,Dialog:vk,Empty:wk,Loading:bk});function yk(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Sk(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function im(e){let t=h.useRef(e);return pr(()=>{t.current=e}),t}var pr=typeof window>"u"?h.useEffect:h.useLayoutEffect;function zr(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function Kn(e){let t=Nl(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function am(e,t,n,r=[]){let o=h.useRef(),s=Ro();return pr(()=>{var i;let a=(()=>{var l;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(l=d.current.textContent)==null?void 0:l.trim():o.current}})(),c=r.map(l=>l.trim());s.value(e,a,c),(i=t.current)==null||i.setAttribute(Br,a),o.current=a}),o}var Ck=()=>{let[e,t]=h.useState(),n=zr(()=>new Map);return pr(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function Tk(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ri({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(Tk(t),{ref:t.ref},n(t.props.children)):n(t)}var kk={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Al=h.forwardRef(({className:e,...t},n)=>u.jsx(Wt,{ref:n,className:ne("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Al.displayName=Wt.displayName;const Pl=h.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(le.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Wt.Input,{ref:n,className:ne("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Pl.displayName=Wt.Input.displayName;const jl=h.forwardRef(({className:e,...t},n)=>u.jsx(Wt.List,{ref:n,className:ne("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));jl.displayName=Wt.List.displayName;const _l=h.forwardRef((e,t)=>u.jsx(Wt.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));_l.displayName=Wt.Empty.displayName;const Rl=h.forwardRef(({className:e,...t},n)=>u.jsx(Wt.Group,{ref:n,className:ne("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Rl.displayName=Wt.Group.displayName;const Ek=h.forwardRef(({className:e,...t},n)=>u.jsx(Wt.Separator,{ref:n,className:ne("-mx-1 h-px bg-border",e),...t}));Ek.displayName=Wt.Separator.displayName;const Ml=h.forwardRef(({className:e,...t},n)=>u.jsx(Wt.Item,{ref:n,className:ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));Ml.displayName=Wt.Item.displayName;function Ol(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ik(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Dl="ScrollArea",[lm,WN]=cn(Dl),[Nk,on]=lm(Dl),cm=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,c]=h.useState(null),[l,d]=h.useState(null),[p,m]=h.useState(null),[f,v]=h.useState(null),[g,x]=h.useState(null),[b,y]=h.useState(0),[C,E]=h.useState(0),[S,T]=h.useState(!1),[k,A]=h.useState(!1),j=De(t,L=>c(L)),$=ts(o);return u.jsx(Nk,{scope:n,type:r,dir:$,scrollHideDelay:s,scrollArea:a,viewport:l,onViewportChange:d,content:p,onContentChange:m,scrollbarX:f,onScrollbarXChange:v,scrollbarXEnabled:S,onScrollbarXEnabledChange:T,scrollbarY:g,onScrollbarYChange:x,scrollbarYEnabled:k,onScrollbarYEnabledChange:A,onCornerWidthChange:y,onCornerHeightChange:E,children:u.jsx(he.div,{dir:$,...i,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});cm.displayName=Dl;var um="ScrollAreaViewport",dm=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=on(um,n),a=h.useRef(null),c=De(t,a,i.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),u.jsx(he.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});dm.displayName=um;var In="ScrollAreaScrollbar",Ll=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=on(In,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return h.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?u.jsx(Ak,{...r,ref:t,forceMount:n}):o.type==="scroll"?u.jsx(Pk,{...r,ref:t,forceMount:n}):o.type==="auto"?u.jsx(fm,{...r,ref:t,forceMount:n}):o.type==="always"?u.jsx($l,{...r,ref:t}):null});Ll.displayName=In;var Ak=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=on(In,e.__scopeScrollArea),[s,i]=h.useState(!1);return h.useEffect(()=>{const a=o.scrollArea;let c=0;if(a){const l=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",l),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",l),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),u.jsx(Ht,{present:n||s,children:u.jsx(fm,{"data-state":s?"visible":"hidden",...r,ref:t})})}),Pk=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=on(In,e.__scopeScrollArea),s=e.orientation==="horizontal",i=ai(()=>c("SCROLL_END"),100),[a,c]=Ik("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,o.scrollHideDelay,c]),h.useEffect(()=>{const l=o.viewport,d=s?"scrollLeft":"scrollTop";if(l){let p=l[d];const m=()=>{const f=l[d];p!==f&&(c("SCROLL"),i()),p=f};return l.addEventListener("scroll",m),()=>l.removeEventListener("scroll",m)}},[o.viewport,s,c,i]),u.jsx(Ht,{present:n||a!=="hidden",children:u.jsx($l,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ie(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ie(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),fm=h.forwardRef((e,t)=>{const n=on(In,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=h.useState(!1),a=e.orientation==="horizontal",c=ai(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?l:d)}},10);return Hr(n.viewport,c),Hr(n.content,c),u.jsx(Ht,{present:r||s,children:u.jsx($l,{"data-state":s?"visible":"hidden",...o,ref:t})})}),$l=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=on(In,e.__scopeScrollArea),s=h.useRef(null),i=h.useRef(0),[a,c]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=xm(a.viewport,a.content),d={...r,sizes:a,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:m=>s.current=m,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:m=>i.current=m};function p(m,f){return Dk(m,i.current,a,f)}return n==="horizontal"?u.jsx(jk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollLeft,f=vm(m,a,o.dir);s.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollLeft=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollLeft=p(m,o.dir))}}):n==="vertical"?u.jsx(_k,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const m=o.viewport.scrollTop,f=vm(m,a);s.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:m=>{o.viewport&&(o.viewport.scrollTop=m)},onDragScroll:m=>{o.viewport&&(o.viewport.scrollTop=p(m))}}):null}),jk=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=on(In,e.__scopeScrollArea),[i,a]=h.useState(),c=h.useRef(null),l=De(t,c,s.onScrollbarXChange);return h.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),u.jsx(hm,{"data-orientation":"horizontal",...o,ref:l,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ii(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(s.viewport){const m=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),bm(m,p)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:si(i.paddingLeft),paddingEnd:si(i.paddingRight)}})}})}),_k=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=on(In,e.__scopeScrollArea),[i,a]=h.useState(),c=h.useRef(null),l=De(t,c,s.onScrollbarYChange);return h.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),u.jsx(hm,{"data-orientation":"vertical",...o,ref:l,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ii(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(s.viewport){const m=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),bm(m,p)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:si(i.paddingTop),paddingEnd:si(i.paddingBottom)}})}})}),[Rk,pm]=lm(In),hm=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:d,onResize:p,...m}=e,f=on(In,n),[v,g]=h.useState(null),x=De(t,j=>g(j)),b=h.useRef(null),y=h.useRef(""),C=f.viewport,E=r.content-r.viewport,S=mt(d),T=mt(c),k=ai(p,10);function A(j){if(b.current){const $=j.clientX-b.current.left,L=j.clientY-b.current.top;l({x:$,y:L})}}return h.useEffect(()=>{const j=$=>{const L=$.target;(v==null?void 0:v.contains(L))&&S($,E)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[C,v,E,S]),h.useEffect(T,[r,T]),Hr(v,k),Hr(f.content,k),u.jsx(Rk,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:mt(s),onThumbPointerUp:mt(i),onThumbPositionChange:T,onThumbPointerDown:mt(a),children:u.jsx(he.div,{...m,ref:x,style:{position:"absolute",...m.style},onPointerDown:ie(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),b.current=v.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),A(j))}),onPointerMove:ie(e.onPointerMove,A),onPointerUp:ie(e.onPointerUp,j=>{const $=j.target;$.hasPointerCapture(j.pointerId)&&$.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=y.current,f.viewport&&(f.viewport.style.scrollBehavior=""),b.current=null})})})}),oi="ScrollAreaThumb",mm=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pm(oi,e.__scopeScrollArea);return u.jsx(Ht,{present:n||o.hasThumb,children:u.jsx(Mk,{ref:t,...r})})}),Mk=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=on(oi,n),i=pm(oi,n),{onThumbPositionChange:a}=i,c=De(t,p=>i.onThumbChange(p)),l=h.useRef(void 0),d=ai(()=>{l.current&&(l.current(),l.current=void 0)},100);return h.useEffect(()=>{const p=s.viewport;if(p){const m=()=>{if(d(),!l.current){const f=Lk(p,a);l.current=f,a()}};return a(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[s.viewport,d,a]),u.jsx(he.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ie(e.onPointerDownCapture,p=>{const f=p.target.getBoundingClientRect(),v=p.clientX-f.left,g=p.clientY-f.top;i.onThumbPointerDown({x:v,y:g})}),onPointerUp:ie(e.onPointerUp,i.onThumbPointerUp)})});mm.displayName=oi;var Fl="ScrollAreaCorner",gm=h.forwardRef((e,t)=>{const n=on(Fl,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(Ok,{...e,ref:t}):null});gm.displayName=Fl;var Ok=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=on(Fl,n),[s,i]=h.useState(0),[a,c]=h.useState(0),l=!!(s&&a);return Hr(o.scrollbarX,()=>{var p;const d=((p=o.scrollbarX)==null?void 0:p.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),Hr(o.scrollbarY,()=>{var p;const d=((p=o.scrollbarY)==null?void 0:p.offsetWidth)||0;o.onCornerWidthChange(d),i(d)}),l?u.jsx(he.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function si(e){return e?parseInt(e,10):0}function xm(e,t){const n=e/t;return isNaN(n)?0:n}function ii(e){const t=xm(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Dk(e,t,n,r="ltr"){const o=ii(n),s=o/2,i=t||s,a=o-i,c=n.scrollbar.paddingStart+i,l=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,p=r==="ltr"?[0,d]:[d*-1,0];return wm([c,l],p)(e)}function vm(e,t,n="ltr"){const r=ii(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-r,c=n==="ltr"?[0,i]:[i*-1,0],l=Ol(e,c);return wm([0,i],[0,a])(l)}function wm(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function bm(e,t){return e>0&&e<t}var Lk=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function ai(e,t){const n=mt(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Hr(e,t){const n=mt(t);At(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var ym=cm,$k=dm,Fk=gm;const Bl=h.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(ym,{ref:r,className:ne("relative overflow-hidden",e),...n,children:[u.jsx($k,{className:"h-full w-full rounded-[inherit] overflow-auto",children:t}),u.jsx(Sm,{}),u.jsx(Fk,{})]}));Bl.displayName=ym.displayName;const Sm=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>u.jsx(Ll,{ref:r,orientation:t,className:ne("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:u.jsx(mm,{className:"relative flex-1 rounded-full bg-border"})}));Sm.displayName=Ll.displayName;const zl=h.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:ne("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base 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-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));zl.displayName="Input";const Bk="group relative p-3 rounded-lg cursor-pointer transition-colors border text-gray-900 dark:text-slate-100",zk="bg-slate-700 border-slate-600 hover:bg-slate-600",Hk="bg-slate-600 border-slate-500";function Cm({thread:e,isActive:t,editingThreadId:n,editingTitle:r,onSelect:o,onStartEditing:s,onEditingTitleChange:i,onSaveEditing:a,onCancelEditing:c,onShare:l,onDelete:d,showEditTitle:p,showDeleteButton:m,formatDate:f,getDisplayThreadTitle:v,secondaryLine:g,itemClassName:x,activeItemClassName:b}){const y=n===e.threadId,C=t?`${b??Hk}`:`${x??zk}`,E=S=>{S.stopPropagation(),o(e.threadId)};return u.jsxs("div",{onClick:E,className:`${Bk} ${C}`,children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"flex-1 min-w-0",children:y?u.jsxs("div",{className:"flex items-center gap-2",onClick:S=>S.stopPropagation(),children:[u.jsx(zl,{value:r,onChange:S=>i(S.target.value),onKeyDown:S=>{S.key==="Enter"?a(e.threadId):S.key==="Escape"&&c()},className:"h-6 text-sm",autoFocus:!0}),u.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>a(e.threadId),className:"h-6 w-6 p-0",children:u.jsx(le.Check,{size:12})}),u.jsx(Xe,{variant:"ghost",size:"sm",onClick:c,className:"h-6 w-6 p-0",children:u.jsx(le.X,{size:12})})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"font-medium text-sm truncate text-gray-900 dark:text-slate-100",children:v(e)}),u.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1",children:[u.jsx(le.Calendar,{size:10}),u.jsx("span",{children:f(e.updatedAt||e.createdAt)})]}),g&&u.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:g})]})}),u.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2",children:u.jsxs(Is,{children:[u.jsx(Ns,{asChild:!0,children:u.jsx(Xe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",children:u.jsx(le.MoreHorizontal,{size:12})})}),u.jsxs(xo,{align:"end",sideOffset:6,className:"w-44",children:[u.jsxs(Fn,{onClick:S=>{S.preventDefault(),l(e.threadId)},children:[u.jsx(le.Share2,{className:"mr-2 h-4 w-4"}),"Share thread"]}),p&&n!==e.threadId&&u.jsxs(Fn,{onClick:S=>{S.preventDefault(),s(e,S)},children:[u.jsx(le.Edit3,{className:"mr-2 h-4 w-4"}),"Rename"]}),m&&d&&u.jsxs(Fn,{className:"text-red-400 hover:text-red-300",onClick:S=>{S.preventDefault(),d(e.threadId,S)},children:[u.jsx(le.Trash2,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]}),t&&u.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-blue-400 rounded-r"})]})}const Tm=25,km="thread-manager-view",Uk=e=>e==="default"||e==="shared",Wk=()=>{if(typeof window>"u")return null;try{const e=window.localStorage.getItem(km);if(Uk(e))return e}catch{}return null};function Em({defaultView:e}={}){const[t,n]=w.useState(()=>Wk()??e??"default");w.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(km,t)}catch{}},[t]);const r=w.useCallback(o=>{n(o)},[]);return{view:t,setView:r}}const Vk=[{key:"default",label:"My chats"},{key:"shared",label:"Shared with you"}];function li({className:e="",showCreateButton:t=!0,showDeleteButton:n=!0,showEditTitle:r=!0,maxHeight:o="400px",customStyles:s={},currentThreadId:i=null,navigateToThread:a,onThreadSelect:c,onThreadCreate:l,onThreadDelete:d,view:p,defaultView:m,onViewChange:f,viewOptions:v,viewState:g,showHeader:x=!0,shareTargets:b,isLoadingShareTargets:y,shareTargetFilter:C}){const{threads:E,sharedThreads:S,currentThreadId:T,setCurrentThreadId:k,isLoading:A,isLoadingSharedThreads:j,actions:$,shareInFlight:L,shareStatus:z,clearShareStatus:G}=yr(),{createThread:M,deleteThread:X,renameThread:U,shareThread:W}=$,{loadThread:R}=oo(),I=i??T,[Y,J]=w.useState(Array.isArray(E)?E:[]),O=w.useRef(Y.length>0),q=w.useRef(null),D=w.useRef(0),[F,H]=w.useState(null),[P,_]=w.useState(""),[K,Z]=w.useState(!1),[oe,se]=w.useState(!1),[Ne,ye]=w.useState(null),[je,ze]=w.useState(""),$e=v&&v.length>0?v:Vk,Ye=Em({defaultView:m}),Ze=g??Ye,at=p??Ze.view,St=w.useCallback(Q=>{p||Ze.setView(Q),f==null||f(Q)},[p,f,Ze]),ft=$e.find(Q=>Q.key===at)??$e[0],Ve=Q=>{ye(Q),ze(""),se(!0)},He=()=>{se(!1),ye(null),ze(""),G()},Oe=w.useCallback(async Q=>{if(!(!Ne||L)&&Q.id)try{await W(Ne,Q.id),setTimeout(()=>He(),600)}catch(ge){console.error("Failed to share thread:",ge)}},[He,L,Ne,W]),_e=w.useMemo(()=>{const Q=b??[],ge=je.trim().toLowerCase();return ge?C?Q.filter(et=>C(et,ge)):Q.filter(et=>`${et.label} ${et.secondaryLabel??""}`.toLowerCase().includes(ge)):Q},[b,je,C]),Fe=at==="shared",rt=Fe?S:Y,xt=Fe?j:A,Qe=Fe?"No shared conversations yet":"No conversations yet",It=Q=>{const ge=Q.sharedAt?` • ${Ue(Q.sharedAt)}`:"";return`Shared by ${Q.sharedByUserId}${ge}`},pt=Q=>"sharedByUserId"in Q;w.useEffect(()=>{const Q=Array.isArray(E)?E:[];if(Q.length>0){O.current=!0,J(Q);return}A||(O.current=!1,J(Q))},[E,A]),w.useEffect(()=>{if(!q.current)return;const Q=q.current.querySelector("[data-radix-scroll-area-viewport]");if(!Q)return;let ge=null,et=null;return ge=requestAnimationFrame(()=>{et=requestAnimationFrame(()=>{Q.scrollTop=D.current})}),()=>{ge!==null&&cancelAnimationFrame(ge),et!==null&&cancelAnimationFrame(et)}},[Y]);const vt=async Q=>{try{k(Q),await R(Q),a==null||a(Q),c==null||c(Q)}catch(ge){console.error("Failed to select thread:",ge)}},Nt=async()=>{try{Z(!0);const Q=await M();Q&&(l==null||l(Q),a==null||a(Q))}catch(Q){console.error("Failed to create thread:",Q)}finally{Z(!1)}},en=async(Q,ge)=>{if(ge.stopPropagation(),!!confirm("Delete this thread?")){if(q.current){const et=q.current.querySelector("[data-radix-scroll-area-viewport]");et&&(D.current=et.scrollTop)}try{await X(Q),d==null||d(Q)}catch(et){console.error("Failed to delete thread:",et)}}},Ct=(Q,ge)=>{ge.stopPropagation(),H(Q.threadId),_(Q.title||`Thread ${Q.threadId.slice(0,8)}`)},sn=async Q=>{if(P.trim())try{await U(Q,P.trim()),H(null),_("")}catch(ge){console.error("Failed to update title:",ge)}},wt=()=>{H(null),_("")},Ue=Q=>{if(!Q)return"";try{const ge=new Date(Q),fe=new Date().getTime()-ge.getTime(),Me=Math.floor(fe/(1e3*60*60*24));return Me===0?ge.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):Me===1?"Yesterday":Me<7?`${Me} days ago`:ge.toLocaleDateString()}catch{return""}},We=Q=>Q.title||`Thread ${Q.threadId.slice(0,8)}`,Tt=Q=>{const ge=We(Q);return ge.length<=Tm?ge:`${ge.slice(0,Tm)}...`};return u.jsxs("div",{className:`flex flex-col h-full ${e} ${s.container||""}`,children:[x&&u.jsxs("div",{className:s.header||"flex flex-col gap-2 px-1 py-0 border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900 shadow-sm",children:[t&&u.jsx("div",{className:"flex justify-end",children:u.jsxs(Xe,{onClick:Nt,disabled:K||A,className:s.createButton||"px-3 py-2 gap-1",size:"sm",variant:"ghost",title:K?"Creating...":"New Chat",children:[u.jsx(le.Edit3,{size:16}),u.jsx("span",{children:"New chat"})]})}),u.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 dark:text-slate-200 uppercase tracking-wide leading-tight",children:[u.jsx("span",{children:"Current View"}),u.jsxs(Is,{children:[u.jsx(Ns,{asChild:!0,children:u.jsx(Xe,{variant:"outline",size:"sm",className:"text-[11px] text-slate-700 dark:text-slate-200 border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-900 hover:bg-slate-50 dark:hover:bg-slate-800 px-2 py-0",children:ft.label})}),u.jsx(xo,{align:"start",sideOffset:6,className:"w-40",children:$e.map(Q=>u.jsxs(Fn,{className:"justify-between text-[12px]",onClick:ge=>{ge.preventDefault(),St(Q.key)},children:[u.jsx("span",{children:Q.label}),at===Q.key&&u.jsx(le.Check,{className:"h-3 w-3"})]},Q.key))})]})]})]}),u.jsx(Bl,{ref:q,className:`flex-1 min-h-0 ${s.threadList||""}`,style:o?{maxHeight:o}:void 0,children:u.jsx("div",{className:"p-2 space-y-1 pb-4",children:xt?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-8 text-slate-400",children:[u.jsx(le.Loader2,{className:"h-5 w-5 animate-spin"}),u.jsx("span",{className:"text-sm",children:"Loading threads…"})]}):rt.length===0?u.jsxs("div",{className:"text-center py-8 text-slate-400",children:[u.jsx(le.MessageSquare,{className:"w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500"}),u.jsx("p",{className:"text-sm text-slate-500",children:Qe})]}):rt.slice().sort((Q,ge)=>new Date(ge.updatedAt||ge.createdAt||"").getTime()-new Date(Q.updatedAt||Q.createdAt||"").getTime()).map(Q=>u.jsx(Cm,{thread:Q,isActive:I===Q.threadId,editingThreadId:F,editingTitle:P,onSelect:vt,onStartEditing:Ct,onEditingTitleChange:ge=>_(ge),onSaveEditing:sn,onCancelEditing:wt,onShare:()=>Ve(Q.threadId),onDelete:en,showEditTitle:r,showDeleteButton:n,formatDate:Ue,getDisplayThreadTitle:Tt,secondaryLine:Fe&&pt(Q)?It(Q):void 0,itemClassName:s.threadItem,activeItemClassName:s.activeThread},Q.threadId))})}),u.jsx(cl,{open:oe,onOpenChange:Q=>!Q&&He(),children:u.jsxs(Vs,{className:"max-w-md p-0",children:[u.jsx(Ks,{children:u.jsx(qs,{children:"Share thread"})}),u.jsxs(Al,{children:[u.jsx(Pl,{autoFocus:!0,value:je,onValueChange:Q=>ze(Q),placeholder:"Search for recipients..."}),u.jsxs(jl,{children:[z&&u.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground",children:[L&&u.jsx(le.Loader2,{className:"h-3 w-3 animate-spin"}),u.jsx("span",{className:z.startsWith("Failed")?"text-red-500":z.startsWith("Shared")?"text-emerald-500":"text-slate-600 dark:text-slate-400",children:z})]}),u.jsx(_l,{children:y?u.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[u.jsx(le.Loader2,{className:"h-4 w-4 animate-spin"}),"Loading recipients…"]}):"No matching recipients found"}),_e.length>0&&u.jsx(Rl,{heading:"Recipients",children:_e.map(Q=>u.jsx(Ml,{onSelect:()=>Oe(Q),children:u.jsxs("div",{className:"flex flex-col items-start text-sm",children:[u.jsx("span",{className:"font-medium",children:Q.label}),Q.secondaryLabel&&u.jsx("span",{className:"text-xs text-muted-foreground",children:Q.secondaryLabel})]})},Q.id))})]})]})]})})]})}function Kk({layout:e="sidebar",layoutSize:t="desktop",showThreads:n=!0,className:r="",customStyles:o={},...s}){const i=l=>{const d="h-full";switch(l){case"phone":return`${d} max-w-none`;case"tablet":return`${d} max-w-4xl mx-auto`;case"half-screen":return`${d} max-w-2xl`;case"desktop":default:return`${d} max-w-7xl mx-auto`}},a=l=>({"--chat-sidebar-width":l==="phone"?"100%":l==="tablet"?"280px":l==="half-screen"?"240px":"320px","--chat-message-max-width":l==="phone"?"95%":l==="tablet"?"90%":l==="half-screen"?"85%":"80%","--chat-input-height":l==="phone"?"120px":"100px"}),c=w.useCallback(l=>{var d;(d=s.onThreadChange)==null||d.call(s,l)},[s]);return e==="fullscreen"?u.jsx(Tr,{...s,onThreadChange:c,children:u.jsx("div",{className:`${i(t)} flex flex-col overflow-hidden ${r} ${o.container||""}`,style:a(t),children:u.jsx(Fr,{className:"flex-1",onError:s.onError,enableFileUpload:!0})})}):e==="tabs"?u.jsx(Tr,{...s,onThreadChange:c,children:u.jsx("div",{className:`${i(t)} flex flex-col overflow-hidden ${r} ${o.container||""}`,style:a(t),children:u.jsxs("div",{className:"flex-1 flex min-h-0 overflow-hidden",children:[n&&u.jsx("div",{className:`w-80 border-r flex-shrink-0 overflow-hidden ${o.sidebar||""}`,children:u.jsx(li,{showCreateButton:!0,showDeleteButton:!0,showEditTitle:!0,className:"h-full"})}),u.jsx("div",{className:`flex-1 min-w-0 overflow-hidden ${o.chatArea||""}`,children:u.jsx(Fr,{onError:s.onError,enableFileUpload:!0})})]})})}):u.jsx(Tr,{...s,onThreadChange:c,children:u.jsxs("div",{className:`${i(t)} flex overflow-hidden ${r} ${o.container||""}`,style:a(t),children:[n&&u.jsx("div",{className:`w-80 border-r bg-gray-50 flex-shrink-0 overflow-hidden ${o.sidebar||""}`,children:u.jsx(li,{showCreateButton:!0,showDeleteButton:!0,showEditTitle:!0,className:"h-full"})}),u.jsx("div",{className:`flex-1 min-w-0 overflow-hidden ${o.chatArea||""}`,children:u.jsx(Fr,{onError:s.onError,enableFileUpload:!0})})]})})}function qk({apiConfig:e,className:t="",onError:n}){return u.jsx(Tr,{apiConfig:e,onError:n,children:u.jsx("div",{className:`h-full ${t}`,children:u.jsx(Fr,{})})})}function Gk({placeholder:e,onMessageSent:t}){const[n,r]=w.useState("chat");return u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"flex border-b border-gray-200 bg-gray-50",children:[u.jsx("button",{onClick:()=>r("chat"),className:`flex-1 px-3 py-2 text-sm font-medium transition-colors ${n==="chat"?"border-b-2 border-slate-800 text-slate-800 bg-white":"text-gray-600 hover:text-gray-800"}`,children:u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(le.MessageSquare,{size:14}),"Chat"]})}),u.jsx("button",{onClick:()=>r("threads"),className:`flex-1 px-3 py-2 text-sm font-medium transition-colors ${n==="threads"?"border-b-2 border-slate-800 text-slate-800 bg-white":"text-gray-600 hover:text-gray-800"}`,children:u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(le.History,{size:14}),"History"]})})]}),u.jsx("div",{className:"flex-1 min-h-0",children:n==="chat"?u.jsx(Fr,{placeholder:e??"Ask Serti AI anything...",autoFocus:!0,className:"h-full",onMessageSent:t}):u.jsx(li,{showCreateButton:!0,className:"h-full",onThreadSelect:()=>r("chat")})})]})}function Yk({className:e="",placeholder:t,isAuthenticated:n=!0,onMessageSent:r,widgetTitle:o="Serti AI Navigator",widgetSubtitle:s="AI-Powered Assistant",...i}){const[a,c]=w.useState(!1);return n?u.jsx(Tr,{...i,children:u.jsx("div",{className:`fixed bottom-6 right-6 z-[9999] transition-all duration-300 ${e}`,children:u.jsxs("div",{className:`w-96 bg-white rounded-xl shadow-2xl border border-gray-200 overflow-hidden relative ${a?"scale-75":"scale-100"}`,children:[u.jsx("div",{className:"bg-slate-800 text-white p-4 flex-shrink-0",children:u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{className:"relative h-10 w-10 rounded-full bg-gradient-to-br from-slate-500 to-slate-700 border border-white/30 flex items-center justify-center text-white text-sm font-bold",children:["S",u.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 h-3 w-3 rounded-full border-2 border-slate-800 bg-emerald-400"})]}),u.jsxs("div",{className:"flex flex-col",children:[u.jsx("h3",{className:"text-lg font-semibold leading-tight",children:o}),u.jsx("p",{className:"text-xs text-white/70",children:s})]}),u.jsx("span",{className:"ml-2 inline-flex items-center justify-center rounded-full bg-red-500 px-2 py-0.5 text-[11px] font-semibold leading-none text-white",children:"1"})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-white hover:bg-white/10 h-8 w-8 p-0",title:"Options",children:u.jsx(le.MoreHorizontal,{size:16})}),u.jsx(Xe,{variant:"ghost",size:"sm",className:"text-white hover:bg-white/10 h-8 w-8 p-0",title:"Compose",children:u.jsx(le.Edit3,{size:16})}),u.jsx(Xe,{variant:"ghost",size:"sm",onClick:l=>{l.stopPropagation(),c(d=>!d)},className:"text-white hover:bg-white/10 h-8 w-8 p-0",title:a?"Maximize":"Minimize",children:a?u.jsx(le.Maximize2,{size:14}):u.jsx(le.Minimize2,{size:14})})]})]})}),!a&&u.jsx("div",{className:"h-96 flex flex-col",children:u.jsx(Gk,{placeholder:t,onMessageSent:r})})]})})}):null}function Xk({label:e="New chat",children:t,className:n,variant:r="ghost",size:o="sm",...s}){return u.jsxs(Xe,{variant:r,size:o,className:ne("gap-2 rounded-full px-3 font-semibold transition-all hover:scale-[1.01]",n),...s,children:[u.jsx(le.Edit3,{size:16}),t??e]})}var Jk="Label",Im=h.forwardRef((e,t)=>u.jsx(he.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Im.displayName=Jk;var Nm=Im;const Zk=Kr.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Am=h.forwardRef(({className:e,...t},n)=>u.jsx(Nm,{ref:n,className:ne(Zk(),e),...t}));Am.displayName=Nm.displayName;function Pm(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jm=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Qk="VisuallyHidden",ci=h.forwardRef((e,t)=>u.jsx(he.span,{...e,ref:t,style:{...jm,...e.style}}));ci.displayName=Qk;var eE=ci,tE=[" ","Enter","ArrowUp","ArrowDown"],nE=[" ","Enter"],hr="Select",[ui,di,rE]=es(hr),[Ur,VN]=cn(hr,[rE,jr]),fi=jr(),[oE,qn]=Ur(hr),[sE,iE]=Ur(hr),_m=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:d,autoComplete:p,disabled:m,required:f,form:v}=e,g=fi(t),[x,b]=h.useState(null),[y,C]=h.useState(null),[E,S]=h.useState(!1),T=ts(l),[k,A]=On({prop:r,defaultProp:o??!1,onChange:s,caller:hr}),[j,$]=On({prop:i,defaultProp:a,onChange:c,caller:hr}),L=h.useRef(null),z=x?v||!!x.closest("form"):!0,[G,M]=h.useState(new Set),X=Array.from(G).map(U=>U.props.value).join(";");return u.jsx(ha,{...g,children:u.jsxs(oE,{required:f,scope:t,trigger:x,onTriggerChange:b,valueNode:y,onValueNodeChange:C,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:Rt(),value:j,onValueChange:$,open:k,onOpenChange:A,dir:T,triggerPointerDownPosRef:L,disabled:m,children:[u.jsx(ui.Provider,{scope:t,children:u.jsx(sE,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(U=>{M(W=>new Set(W).add(U))},[]),onNativeOptionRemove:h.useCallback(U=>{M(W=>{const R=new Set(W);return R.delete(U),R})},[]),children:n})}),z?u.jsxs(ng,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:p,value:j,onChange:U=>$(U.target.value),disabled:m,form:v,children:[j===void 0?u.jsx("option",{value:""}):null,Array.from(G)]},X):null]})})};_m.displayName=hr;var Rm="SelectTrigger",Mm=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=fi(n),i=qn(Rm,n),a=i.disabled||r,c=De(t,i.onTriggerChange),l=di(n),d=h.useRef("touch"),[p,m,f]=og(g=>{const x=l().filter(C=>!C.disabled),b=x.find(C=>C.value===i.value),y=sg(x,g,b);y!==void 0&&i.onValueChange(y.value)}),v=g=>{a||(i.onOpenChange(!0),f()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return u.jsx(ma,{asChild:!0,...s,children:u.jsx(he.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":rg(i.value)?"":void 0,...o,ref:c,onClick:ie(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&v(g)}),onPointerDown:ie(o.onPointerDown,g=>{d.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(v(g),g.preventDefault())}),onKeyDown:ie(o.onKeyDown,g=>{const x=p.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&m(g.key),!(x&&g.key===" ")&&tE.includes(g.key)&&(v(),g.preventDefault())})})})});Mm.displayName=Rm;var Om="SelectValue",Dm=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=qn(Om,n),{onValueNodeHasChildrenChange:l}=c,d=s!==void 0,p=De(t,c.onValueNodeChange);return At(()=>{l(d)},[l,d]),u.jsx(he.span,{...a,ref:p,style:{pointerEvents:"none"},children:rg(c.value)?u.jsx(u.Fragment,{children:i}):s})});Dm.displayName=Om;var aE="SelectIcon",Lm=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return u.jsx(he.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Lm.displayName=aE;var lE="SelectPortal",$m=e=>u.jsx(co,{asChild:!0,...e});$m.displayName=lE;var mr="SelectContent",Fm=h.forwardRef((e,t)=>{const n=qn(mr,e.__scopeSelect),[r,o]=h.useState();if(At(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?qr.createPortal(u.jsx(Bm,{scope:e.__scopeSelect,children:u.jsx(ui.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),s):null}return u.jsx(zm,{...e,ref:t})});Fm.displayName=mr;var mn=10,[Bm,Gn]=Ur(mr),cE="SelectContentImpl",uE=qt.createSlot("SelectContent.RemoveScroll"),zm=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:f,sticky:v,hideWhenDetached:g,avoidCollisions:x,...b}=e,y=qn(mr,n),[C,E]=h.useState(null),[S,T]=h.useState(null),k=De(t,P=>E(P)),[A,j]=h.useState(null),[$,L]=h.useState(null),z=di(n),[G,M]=h.useState(!1),X=h.useRef(!1);h.useEffect(()=>{if(C)return ya(C)},[C]),Zi();const U=h.useCallback(P=>{const[_,...K]=z().map(se=>se.ref.current),[Z]=K.slice(-1),oe=document.activeElement;for(const se of P)if(se===oe||(se==null||se.scrollIntoView({block:"nearest"}),se===_&&S&&(S.scrollTop=0),se===Z&&S&&(S.scrollTop=S.scrollHeight),se==null||se.focus(),document.activeElement!==oe))return},[z,S]),W=h.useCallback(()=>U([A,C]),[U,A,C]);h.useEffect(()=>{G&&W()},[G,W]);const{onOpenChange:R,triggerPointerDownPosRef:I}=y;h.useEffect(()=>{if(C){let P={x:0,y:0};const _=Z=>{var oe,se;P={x:Math.abs(Math.round(Z.pageX)-(((oe=I.current)==null?void 0:oe.x)??0)),y:Math.abs(Math.round(Z.pageY)-(((se=I.current)==null?void 0:se.y)??0))}},K=Z=>{P.x<=10&&P.y<=10?Z.preventDefault():C.contains(Z.target)||R(!1),document.removeEventListener("pointermove",_),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",_),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",K,{capture:!0})}}},[C,R,I]),h.useEffect(()=>{const P=()=>R(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[R]);const[Y,J]=og(P=>{const _=z().filter(oe=>!oe.disabled),K=_.find(oe=>oe.ref.current===document.activeElement),Z=sg(_,P,K);Z&&setTimeout(()=>Z.ref.current.focus())}),O=h.useCallback((P,_,K)=>{const Z=!X.current&&!K;(y.value!==void 0&&y.value===_||Z)&&(j(P),Z&&(X.current=!0))},[y.value]),q=h.useCallback(()=>C==null?void 0:C.focus(),[C]),D=h.useCallback((P,_,K)=>{const Z=!X.current&&!K;(y.value!==void 0&&y.value===_||Z)&&L(P)},[y.value]),F=r==="popper"?Hl:Hm,H=F===Hl?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:f,sticky:v,hideWhenDetached:g,avoidCollisions:x}:{};return u.jsx(Bm,{scope:n,content:C,viewport:S,onViewportChange:T,itemRefCallback:O,selectedItem:A,onItemLeave:q,itemTextRefCallback:D,focusSelectedItem:W,selectedItemText:$,position:r,isPositioned:G,searchRef:Y,children:u.jsx(ys,{as:uE,allowPinchZoom:!0,children:u.jsx(ns,{asChild:!0,trapped:y.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:ie(o,P=>{var _;(_=y.trigger)==null||_.focus({preventScroll:!0}),P.preventDefault()}),children:u.jsx(Er,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(F,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:P=>P.preventDefault(),...b,...H,onPlaced:()=>M(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ie(b.onKeyDown,P=>{const _=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!_&&P.key.length===1&&J(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let Z=z().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(P.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const oe=P.target,se=Z.indexOf(oe);Z=Z.slice(se+1)}setTimeout(()=>U(Z)),P.preventDefault()}})})})})})})});zm.displayName=cE;var dE="SelectItemAlignedPosition",Hm=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=qn(mr,n),i=Gn(mr,n),[a,c]=h.useState(null),[l,d]=h.useState(null),p=De(t,k=>d(k)),m=di(n),f=h.useRef(!1),v=h.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:b,focusSelectedItem:y}=i,C=h.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&g&&x&&b){const k=s.trigger.getBoundingClientRect(),A=l.getBoundingClientRect(),j=s.valueNode.getBoundingClientRect(),$=b.getBoundingClientRect();if(s.dir!=="rtl"){const oe=$.left-A.left,se=j.left-oe,Ne=k.left-se,ye=k.width+Ne,je=Math.max(ye,A.width),ze=window.innerWidth-mn,$e=Ol(se,[mn,Math.max(mn,ze-je)]);a.style.minWidth=ye+"px",a.style.left=$e+"px"}else{const oe=A.right-$.right,se=window.innerWidth-j.right-oe,Ne=window.innerWidth-k.right-se,ye=k.width+Ne,je=Math.max(ye,A.width),ze=window.innerWidth-mn,$e=Ol(se,[mn,Math.max(mn,ze-je)]);a.style.minWidth=ye+"px",a.style.right=$e+"px"}const L=m(),z=window.innerHeight-mn*2,G=g.scrollHeight,M=window.getComputedStyle(l),X=parseInt(M.borderTopWidth,10),U=parseInt(M.paddingTop,10),W=parseInt(M.borderBottomWidth,10),R=parseInt(M.paddingBottom,10),I=X+U+G+R+W,Y=Math.min(x.offsetHeight*5,I),J=window.getComputedStyle(g),O=parseInt(J.paddingTop,10),q=parseInt(J.paddingBottom,10),D=k.top+k.height/2-mn,F=z-D,H=x.offsetHeight/2,P=x.offsetTop+H,_=X+U+P,K=I-_;if(_<=D){const oe=L.length>0&&x===L[L.length-1].ref.current;a.style.bottom="0px";const se=l.clientHeight-g.offsetTop-g.offsetHeight,Ne=Math.max(F,H+(oe?q:0)+se+W),ye=_+Ne;a.style.height=ye+"px"}else{const oe=L.length>0&&x===L[0].ref.current;a.style.top="0px";const Ne=Math.max(D,X+g.offsetTop+(oe?O:0)+H)+K;a.style.height=Ne+"px",g.scrollTop=_-D+g.offsetTop}a.style.margin=`${mn}px 0`,a.style.minHeight=Y+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[m,s.trigger,s.valueNode,a,l,g,x,b,s.dir,r]);At(()=>C(),[C]);const[E,S]=h.useState();At(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);const T=h.useCallback(k=>{k&&v.current===!0&&(C(),y==null||y(),v.current=!1)},[C,y]);return u.jsx(pE,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:T,children:u.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:u.jsx(he.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Hm.displayName=dE;var fE="SelectPopperPosition",Hl=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=mn,...s}=e,i=fi(n);return u.jsx(ga,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Hl.displayName=fE;var[pE,Ul]=Ur(mr,{}),Wl="SelectViewport",Um=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Gn(Wl,n),i=Ul(Wl,n),a=De(t,s.onViewportChange),c=h.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(ui.Slot,{scope:n,children:u.jsx(he.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ie(o.onScroll,l=>{const d=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&p){const f=Math.abs(c.current-d.scrollTop);if(f>0){const v=window.innerHeight-mn*2,g=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),b=Math.max(g,x);if(b<v){const y=b+f,C=Math.min(v,y),E=y-C;p.style.height=C+"px",p.style.bottom==="0px"&&(d.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Um.displayName=Wl;var Wm="SelectGroup",[hE,mE]=Ur(Wm),gE=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Rt();return u.jsx(hE,{scope:n,id:o,children:u.jsx(he.div,{role:"group","aria-labelledby":o,...r,ref:t})})});gE.displayName=Wm;var Vm="SelectLabel",Km=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=mE(Vm,n);return u.jsx(he.div,{id:o.id,...r,ref:t})});Km.displayName=Vm;var pi="SelectItem",[xE,qm]=Ur(pi),Gm=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=qn(pi,n),c=Gn(pi,n),l=a.value===r,[d,p]=h.useState(s??""),[m,f]=h.useState(!1),v=De(t,y=>{var C;return(C=c.itemRefCallback)==null?void 0:C.call(c,y,r,o)}),g=Rt(),x=h.useRef("touch"),b=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return u.jsx(xE,{scope:n,value:r,disabled:o,textId:g,isSelected:l,onItemTextChange:h.useCallback(y=>{p(C=>C||((y==null?void 0:y.textContent)??"").trim())},[]),children:u.jsx(ui.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:u.jsx(he.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":l&&m,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:v,onFocus:ie(i.onFocus,()=>f(!0)),onBlur:ie(i.onBlur,()=>f(!1)),onClick:ie(i.onClick,()=>{x.current!=="mouse"&&b()}),onPointerUp:ie(i.onPointerUp,()=>{x.current==="mouse"&&b()}),onPointerDown:ie(i.onPointerDown,y=>{x.current=y.pointerType}),onPointerMove:ie(i.onPointerMove,y=>{var C;x.current=y.pointerType,o?(C=c.onItemLeave)==null||C.call(c):x.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ie(i.onPointerLeave,y=>{var C;y.currentTarget===document.activeElement&&((C=c.onItemLeave)==null||C.call(c))}),onKeyDown:ie(i.onKeyDown,y=>{var E;((E=c.searchRef)==null?void 0:E.current)!==""&&y.key===" "||(nE.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});Gm.displayName=pi;var Mo="SelectItemText",Ym=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=qn(Mo,n),a=Gn(Mo,n),c=qm(Mo,n),l=iE(Mo,n),[d,p]=h.useState(null),m=De(t,b=>p(b),c.onItemTextChange,b=>{var y;return(y=a.itemTextRefCallback)==null?void 0:y.call(a,b,c.value,c.disabled)}),f=d==null?void 0:d.textContent,v=h.useMemo(()=>u.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=l;return At(()=>(g(v),()=>x(v)),[g,x,v]),u.jsxs(u.Fragment,{children:[u.jsx(he.span,{id:c.textId,...s,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?qr.createPortal(s.children,i.valueNode):null]})});Ym.displayName=Mo;var Xm="SelectItemIndicator",Jm=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qm(Xm,n).isSelected?u.jsx(he.span,{"aria-hidden":!0,...r,ref:t}):null});Jm.displayName=Xm;var Vl="SelectScrollUpButton",Zm=h.forwardRef((e,t)=>{const n=Gn(Vl,e.__scopeSelect),r=Ul(Vl,e.__scopeSelect),[o,s]=h.useState(!1),i=De(t,r.onScrollButtonChange);return At(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?u.jsx(eg,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Zm.displayName=Vl;var Kl="SelectScrollDownButton",Qm=h.forwardRef((e,t)=>{const n=Gn(Kl,e.__scopeSelect),r=Ul(Kl,e.__scopeSelect),[o,s]=h.useState(!1),i=De(t,r.onScrollButtonChange);return At(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?u.jsx(eg,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Qm.displayName=Kl;var eg=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Gn("SelectScrollButton",n),i=h.useRef(null),a=di(n),c=h.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),At(()=>{var d;const l=a().find(p=>p.ref.current===document.activeElement);(d=l==null?void 0:l.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),u.jsx(he.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ie(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ie(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ie(o.onPointerLeave,()=>{c()})})}),vE="SelectSeparator",tg=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(he.div,{"aria-hidden":!0,...r,ref:t})});tg.displayName=vE;var ql="SelectArrow",wE=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=fi(n),s=qn(ql,n),i=Gn(ql,n);return s.open&&i.position==="popper"?u.jsx(xa,{...o,...r,ref:t}):null});wE.displayName=ql;var bE="SelectBubbleInput",ng=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),s=De(r,o),i=Pm(t);return h.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const p=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(p)}},[i,t]),u.jsx(he.select,{...n,style:{...jm,...n.style},ref:s,defaultValue:t})});ng.displayName=bE;function rg(e){return e===""||e===void 0}function og(e){const t=mt(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function sg(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=yE(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function yE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var SE=_m,ig=Mm,CE=Dm,TE=Lm,kE=$m,ag=Fm,EE=Um,lg=Km,cg=Gm,IE=Ym,NE=Jm,ug=Zm,dg=Qm,fg=tg;const AE=SE,PE=CE,pg=h.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(ig,{ref:r,className:ne("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",e),...n,children:[t,u.jsx(TE,{asChild:!0,children:u.jsx(le.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));pg.displayName=ig.displayName;const hg=h.forwardRef(({className:e,...t},n)=>u.jsx(ug,{ref:n,className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(le.ChevronUp,{className:"h-4 w-4"})}));hg.displayName=ug.displayName;const mg=h.forwardRef(({className:e,...t},n)=>u.jsx(dg,{ref:n,className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(le.ChevronDown,{className:"h-4 w-4"})}));mg.displayName=dg.displayName;const gg=h.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>u.jsx(kE,{children:u.jsxs(ag,{ref:o,className:ne("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",n==="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",e),position:n,...r,children:[u.jsx(hg,{}),u.jsx(EE,{className:ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(mg,{})]})}));gg.displayName=ag.displayName;const jE=h.forwardRef(({className:e,...t},n)=>u.jsx(lg,{ref:n,className:ne("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));jE.displayName=lg.displayName;const xg=h.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(cg,{ref:r,className:ne("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",e),...n,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(NE,{children:u.jsx(le.Check,{className:"h-4 w-4"})})}),u.jsx(IE,{children:t})]}));xg.displayName=cg.displayName;const _E=h.forwardRef(({className:e,...t},n)=>u.jsx(fg,{ref:n,className:ne("-mx-1 my-1 h-px bg-muted",e),...t}));_E.displayName=fg.displayName;var RE="Separator",vg="horizontal",ME=["horizontal","vertical"],wg=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=vg,...o}=e,s=OE(r)?r:vg,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return u.jsx(he.div,{"data-orientation":s,...a,...o,ref:t})});wg.displayName=RE;function OE(e){return ME.includes(e)}var bg=wg;const yg=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>u.jsx(bg,{ref:o,decorative:n,orientation:t,className:ne("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));yg.displayName=bg.displayName;var hi="Switch",[DE,KN]=cn(hi),[LE,$E]=DE(hi),Sg=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c="on",onCheckedChange:l,form:d,...p}=e,[m,f]=h.useState(null),v=De(t,C=>f(C)),g=h.useRef(!1),x=m?d||!!m.closest("form"):!0,[b,y]=On({prop:o,defaultProp:s??!1,onChange:l,caller:hi});return u.jsxs(LE,{scope:n,checked:b,disabled:a,children:[u.jsx(he.button,{type:"button",role:"switch","aria-checked":b,"aria-required":i,"data-state":Eg(b),"data-disabled":a?"":void 0,disabled:a,value:c,...p,ref:v,onClick:ie(e.onClick,C=>{y(E=>!E),x&&(g.current=C.isPropagationStopped(),g.current||C.stopPropagation())})}),x&&u.jsx(kg,{control:m,bubbles:!g.current,name:r,value:c,checked:b,required:i,disabled:a,form:d,style:{transform:"translateX(-100%)"}})]})});Sg.displayName=hi;var Cg="SwitchThumb",Tg=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=$E(Cg,n);return u.jsx(he.span,{"data-state":Eg(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Tg.displayName=Cg;var FE="SwitchBubbleInput",kg=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const i=h.useRef(null),a=De(i,s),c=Pm(n),l=Od(t);return h.useEffect(()=>{const d=i.current;if(!d)return;const p=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&f){const v=new Event("click",{bubbles:r});f.call(d,n),d.dispatchEvent(v)}},[c,n,r]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:a,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});kg.displayName=FE;function Eg(e){return e?"checked":"unchecked"}var Ig=Sg,BE=Tg;const Ng=h.forwardRef(({className:e,...t},n)=>u.jsx(Ig,{className:ne("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:u.jsx(BE,{className:ne("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Ng.displayName=Ig.displayName;const zE=al,HE=wT,UE=ll,Ag=h.forwardRef(({className:e,...t},n)=>u.jsx(No,{className:ne("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",e),...t,ref:n}));Ag.displayName=No.displayName;const WE=Kr.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Pg=h.forwardRef(({side:e="right",className:t,children:n,...r},o)=>u.jsxs(UE,{children:[u.jsx(Ag,{}),u.jsxs(Ao,{ref:o,className:ne(WE({side:e}),t),...r,children:[n,u.jsxs(yh,{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-secondary",children:[u.jsx(le.X,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Pg.displayName=Ao.displayName;const jg=({className:e,...t})=>u.jsx("div",{className:ne("flex flex-col space-y-2 text-center sm:text-left",e),...t});jg.displayName="SheetHeader";const _g=h.forwardRef(({className:e,...t},n)=>u.jsx(ur,{ref:n,className:ne("text-lg font-semibold text-foreground",e),...t}));_g.displayName=ur.displayName;const Rg=h.forwardRef(({className:e,...t},n)=>u.jsx(Ws,{ref:n,className:ne("text-sm text-muted-foreground",e),...t}));Rg.displayName=Ws.displayName;var[mi,qN]=cn("Tooltip",[jr]),gi=jr(),Mg="TooltipProvider",VE=700,Gl="tooltip.open",[KE,Yl]=mi(Mg),Og=e=>{const{__scopeTooltip:t,delayDuration:n=VE,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=h.useRef(!0),a=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),u.jsx(KE,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(l=>{a.current=l},[]),disableHoverableContent:o,children:s})};Og.displayName=Mg;var Oo="Tooltip",[qE,xi]=mi(Oo),Dg=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=Yl(Oo,e.__scopeTooltip),l=gi(t),[d,p]=h.useState(null),m=Rt(),f=h.useRef(0),v=i??c.disableHoverableContent,g=a??c.delayDuration,x=h.useRef(!1),[b,y]=On({prop:r,defaultProp:o??!1,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(Gl))):c.onClose(),s==null||s(k)},caller:Oo}),C=h.useMemo(()=>b?x.current?"delayed-open":"instant-open":"closed",[b]),E=h.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x.current=!1,y(!0)},[y]),S=h.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y(!1)},[y]),T=h.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{x.current=!0,y(!0),f.current=0},g)},[g,y]);return h.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),u.jsx(ha,{...l,children:u.jsx(qE,{scope:t,contentId:m,open:b,stateAttribute:C,trigger:d,onTriggerChange:p,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?T():E()},[c.isOpenDelayedRef,T,E]),onTriggerLeave:h.useCallback(()=>{v?S():(window.clearTimeout(f.current),f.current=0)},[S,v]),onOpen:E,onClose:S,disableHoverableContent:v,children:n})})};Dg.displayName=Oo;var Xl="TooltipTrigger",Lg=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xi(Xl,n),s=Yl(Xl,n),i=gi(n),a=h.useRef(null),c=De(t,a,o.onTriggerChange),l=h.useRef(!1),d=h.useRef(!1),p=h.useCallback(()=>l.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),u.jsx(ma,{asChild:!0,...i,children:u.jsx(he.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:ie(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ie(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:ie(e.onBlur,o.onClose),onClick:ie(e.onClick,o.onClose)})})});Lg.displayName=Xl;var GE="TooltipPortal",[GN,YE]=mi(GE,{forceMount:void 0}),Wr="TooltipContent",$g=h.forwardRef((e,t)=>{const n=YE(Wr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=xi(Wr,e.__scopeTooltip);return u.jsx(Ht,{present:r||i.open,children:i.disableHoverableContent?u.jsx(Fg,{side:o,...s,ref:t}):u.jsx(XE,{side:o,...s,ref:t})})}),XE=h.forwardRef((e,t)=>{const n=xi(Wr,e.__scopeTooltip),r=Yl(Wr,e.__scopeTooltip),o=h.useRef(null),s=De(t,o),[i,a]=h.useState(null),{trigger:c,onClose:l}=n,d=o.current,{onPointerInTransitChange:p}=r,m=h.useCallback(()=>{a(null),p(!1)},[p]),f=h.useCallback((v,g)=>{const x=v.currentTarget,b={x:v.clientX,y:v.clientY},y=tI(b,x.getBoundingClientRect()),C=nI(b,y),E=rI(g.getBoundingClientRect()),S=sI([...C,...E]);a(S),p(!0)},[p]);return h.useEffect(()=>()=>m(),[m]),h.useEffect(()=>{if(c&&d){const v=x=>f(x,d),g=x=>f(x,c);return c.addEventListener("pointerleave",v),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",g)}}},[c,d,f,m]),h.useEffect(()=>{if(i){const v=g=>{const x=g.target,b={x:g.clientX,y:g.clientY},y=(c==null?void 0:c.contains(x))||(d==null?void 0:d.contains(x)),C=!oI(b,i);y?m():C&&(m(),l())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,d,i,l,m]),u.jsx(Fg,{...e,ref:s})}),[JE,ZE]=mi(Oo,{isInside:!1}),QE=qt.createSlottable("TooltipContent"),Fg=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=xi(Wr,n),l=gi(n),{onClose:d}=c;return h.useEffect(()=>(document.addEventListener(Gl,d),()=>document.removeEventListener(Gl,d)),[d]),h.useEffect(()=>{if(c.trigger){const p=m=>{const f=m.target;f!=null&&f.contains(c.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,d]),u.jsx(Er,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:u.jsxs(ga,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(QE,{children:r}),u.jsx(JE,{scope:n,isInside:!0,children:u.jsx(eE,{id:c.contentId,role:"tooltip",children:o||r})})]})})});$g.displayName=Wr;var Bg="TooltipArrow",eI=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gi(n);return ZE(Bg,n).isInside?null:u.jsx(xa,{...o,...r,ref:t})});eI.displayName=Bg;function tI(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function nI(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function rI(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function oI(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],l=a.x,d=a.y,p=c.x,m=c.y;d>r!=m>r&&n<(p-l)*(r-d)/(m-d)+l&&(o=!o)}return o}function sI(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),iI(t)}function iI(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var aI=Og,lI=Dg,cI=Lg,zg=$g;const uI=aI,dI=lI,fI=cI,Hg=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(zg,{ref:r,sideOffset:t,className:ne("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));Hg.displayName=zg.displayName;var Jl="ToastProvider",[Zl,pI,hI]=es("Toast"),[Ug,YN]=cn("Toast",[hI]),[mI,vi]=Ug(Jl),Wg=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,c]=h.useState(null),[l,d]=h.useState(0),p=h.useRef(!1),m=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Jl}\`. Expected non-empty \`string\`.`),u.jsx(Zl.Provider,{scope:t,children:u.jsx(mI,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:l,viewport:a,onViewportChange:c,onToastAdd:h.useCallback(()=>d(f=>f+1),[]),onToastRemove:h.useCallback(()=>d(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,children:i})})};Wg.displayName=Jl;var Vg="ToastViewport",gI=["F8"],Ql="toast.viewportPause",ec="toast.viewportResume",Kg=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=gI,label:o="Notifications ({hotkey})",...s}=e,i=vi(Vg,n),a=pI(n),c=h.useRef(null),l=h.useRef(null),d=h.useRef(null),p=h.useRef(null),m=De(t,p,i.onViewportChange),f=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=i.toastCount>0;h.useEffect(()=>{const x=b=>{var C;r.length!==0&&r.every(E=>b[E]||b.code===E)&&((C=p.current)==null||C.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),h.useEffect(()=>{const x=c.current,b=p.current;if(v&&x&&b){const y=()=>{if(!i.isClosePausedRef.current){const T=new CustomEvent(Ql);b.dispatchEvent(T),i.isClosePausedRef.current=!0}},C=()=>{if(i.isClosePausedRef.current){const T=new CustomEvent(ec);b.dispatchEvent(T),i.isClosePausedRef.current=!1}},E=T=>{!x.contains(T.relatedTarget)&&C()},S=()=>{x.contains(document.activeElement)||C()};return x.addEventListener("focusin",y),x.addEventListener("focusout",E),x.addEventListener("pointermove",y),x.addEventListener("pointerleave",S),window.addEventListener("blur",y),window.addEventListener("focus",C),()=>{x.removeEventListener("focusin",y),x.removeEventListener("focusout",E),x.removeEventListener("pointermove",y),x.removeEventListener("pointerleave",S),window.removeEventListener("blur",y),window.removeEventListener("focus",C)}}},[v,i.isClosePausedRef]);const g=h.useCallback(({tabbingDirection:x})=>{const y=a().map(C=>{const E=C.ref.current,S=[E,...AI(E)];return x==="forwards"?S:S.reverse()});return(x==="forwards"?y.reverse():y).flat()},[a]);return h.useEffect(()=>{const x=p.current;if(x){const b=y=>{var S,T,k;const C=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!C){const A=document.activeElement,j=y.shiftKey;if(y.target===x&&j){(S=l.current)==null||S.focus();return}const z=g({tabbingDirection:j?"backwards":"forwards"}),G=z.findIndex(M=>M===A);rc(z.slice(G+1))?y.preventDefault():j?(T=l.current)==null||T.focus():(k=d.current)==null||k.focus()}};return x.addEventListener("keydown",b),()=>x.removeEventListener("keydown",b)}},[a,g]),u.jsxs(qw,{ref:c,role:"region","aria-label":o.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&u.jsx(tc,{ref:l,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});rc(x)}}),u.jsx(Zl.Slot,{scope:n,children:u.jsx(he.ol,{tabIndex:-1,...s,ref:m})}),v&&u.jsx(tc,{ref:d,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});rc(x)}})]})});Kg.displayName=Vg;var qg="ToastFocusProxy",tc=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=vi(qg,n);return u.jsx(ci,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var l;const a=i.relatedTarget;!((l=s.viewport)!=null&&l.contains(a))&&r()}})});tc.displayName=qg;var Do="Toast",xI="toast.swipeStart",vI="toast.swipeMove",wI="toast.swipeCancel",bI="toast.swipeEnd",Gg=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a,c]=On({prop:r,defaultProp:o??!0,onChange:s,caller:Do});return u.jsx(Ht,{present:n||a,children:u.jsx(CI,{open:a,...i,ref:t,onClose:()=>c(!1),onPause:mt(e.onPause),onResume:mt(e.onResume),onSwipeStart:ie(e.onSwipeStart,l=>{l.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(e.onSwipeMove,l=>{const{x:d,y:p}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","move"),l.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:ie(e.onSwipeCancel,l=>{l.currentTarget.setAttribute("data-swipe","cancel"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(e.onSwipeEnd,l=>{const{x:d,y:p}=l.detail.delta;l.currentTarget.setAttribute("data-swipe","end"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),l.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),l.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),l.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),c(!1)})})})});Gg.displayName=Do;var[yI,SI]=Ug(Do,{onClose(){}}),CI=h.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:d,onSwipeMove:p,onSwipeCancel:m,onSwipeEnd:f,...v}=e,g=vi(Do,n),[x,b]=h.useState(null),y=De(t,M=>b(M)),C=h.useRef(null),E=h.useRef(null),S=o||g.duration,T=h.useRef(0),k=h.useRef(S),A=h.useRef(0),{onToastAdd:j,onToastRemove:$}=g,L=mt(()=>{var X;(x==null?void 0:x.contains(document.activeElement))&&((X=g.viewport)==null||X.focus()),i()}),z=h.useCallback(M=>{!M||M===1/0||(window.clearTimeout(A.current),T.current=new Date().getTime(),A.current=window.setTimeout(L,M))},[L]);h.useEffect(()=>{const M=g.viewport;if(M){const X=()=>{z(k.current),l==null||l()},U=()=>{const W=new Date().getTime()-T.current;k.current=k.current-W,window.clearTimeout(A.current),c==null||c()};return M.addEventListener(Ql,U),M.addEventListener(ec,X),()=>{M.removeEventListener(Ql,U),M.removeEventListener(ec,X)}}},[g.viewport,S,c,l,z]),h.useEffect(()=>{s&&!g.isClosePausedRef.current&&z(S)},[s,S,g.isClosePausedRef,z]),h.useEffect(()=>(j(),()=>$()),[j,$]);const G=h.useMemo(()=>x?tx(x):null,[x]);return g.viewport?u.jsxs(u.Fragment,{children:[G&&u.jsx(TI,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),u.jsx(yI,{scope:n,onClose:L,children:qr.createPortal(u.jsx(Zl.ItemSlot,{scope:n,children:u.jsx(Kw,{asChild:!0,onEscapeKeyDown:ie(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||L(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(he.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ie(e.onKeyDown,M=>{M.key==="Escape"&&(a==null||a(M.nativeEvent),M.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,L()))}),onPointerDown:ie(e.onPointerDown,M=>{M.button===0&&(C.current={x:M.clientX,y:M.clientY})}),onPointerMove:ie(e.onPointerMove,M=>{if(!C.current)return;const X=M.clientX-C.current.x,U=M.clientY-C.current.y,W=!!E.current,R=["left","right"].includes(g.swipeDirection),I=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,Y=R?I(0,X):0,J=R?0:I(0,U),O=M.pointerType==="touch"?10:2,q={x:Y,y:J},D={originalEvent:M,delta:q};W?(E.current=q,wi(vI,p,D,{discrete:!1})):nx(q,g.swipeDirection,O)?(E.current=q,wi(xI,d,D,{discrete:!1}),M.target.setPointerCapture(M.pointerId)):(Math.abs(X)>O||Math.abs(U)>O)&&(C.current=null)}),onPointerUp:ie(e.onPointerUp,M=>{const X=E.current,U=M.target;if(U.hasPointerCapture(M.pointerId)&&U.releasePointerCapture(M.pointerId),E.current=null,C.current=null,X){const W=M.currentTarget,R={originalEvent:M,delta:X};nx(X,g.swipeDirection,g.swipeThreshold)?wi(bI,f,R,{discrete:!0}):wi(wI,m,R,{discrete:!0}),W.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),TI=e=>{const{__scopeToast:t,children:n,...r}=e,o=vi(Do,t),[s,i]=h.useState(!1),[a,c]=h.useState(!1);return II(()=>i(!0)),h.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:u.jsx(co,{asChild:!0,children:u.jsx(ci,{...r,children:s&&u.jsxs(u.Fragment,{children:[o.label," ",n]})})})},kI="ToastTitle",Yg=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(he.div,{...r,ref:t})});Yg.displayName=kI;var EI="ToastDescription",Xg=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(he.div,{...r,ref:t})});Xg.displayName=EI;var Jg="ToastAction",Zg=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?u.jsx(ex,{altText:n,asChild:!0,children:u.jsx(nc,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Jg}\`. Expected non-empty \`string\`.`),null)});Zg.displayName=Jg;var Qg="ToastClose",nc=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=SI(Qg,n);return u.jsx(ex,{asChild:!0,children:u.jsx(he.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,o.onClose)})})});nc.displayName=Qg;var ex=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return u.jsx(he.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function tx(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),NI(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...tx(r))}}),t}function wi(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Yi(o,s):o.dispatchEvent(s)}var nx=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function II(e=()=>{}){const t=mt(e);At(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function NI(e){return e.nodeType===e.ELEMENT_NODE}function AI(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function rc(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var PI=Wg,rx=Kg,ox=Gg,sx=Yg,ix=Xg,ax=Zg,lx=nc;const jI=PI,cx=h.forwardRef(({className:e,...t},n)=>u.jsx(rx,{ref:n,className:ne("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col p-4 md:max-w-[420px]",e),...t}));cx.displayName=rx.displayName;const _I=Kr.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ux=h.forwardRef(({className:e,variant:t,...n},r)=>u.jsx(ox,{ref:r,className:ne(_I({variant:t}),e),...n}));ux.displayName=ox.displayName;const RI=h.forwardRef(({className:e,...t},n)=>u.jsx(ax,{ref:n,className:ne("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));RI.displayName=ax.displayName;const dx=h.forwardRef(({className:e,...t},n)=>u.jsx(lx,{ref:n,className:ne("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:u.jsx(le.X,{className:"h-4 w-4"})}));dx.displayName=lx.displayName;const fx=h.forwardRef(({className:e,...t},n)=>u.jsx(sx,{ref:n,className:ne("text-sm font-semibold",e),...t}));fx.displayName=sx.displayName;const px=h.forwardRef(({className:e,...t},n)=>u.jsx(ix,{ref:n,className:ne("text-sm opacity-90",e),...t}));px.displayName=ix.displayName;function MI(){const{toasts:e}=fl();return u.jsxs(jI,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return u.jsxs(ux,{...s,children:[u.jsxs("div",{className:"grid gap-1",children:[n&&u.jsx(fx,{children:n}),r&&u.jsx(px,{children:r})]}),o,u.jsx(dx,{})]},t)}),u.jsx(cx,{})]})}var OI=(e,t,n,r,o,s,i,a)=>{let c=document.documentElement,l=["light","dark"];function d(f){(Array.isArray(e)?e:[e]).forEach(v=>{let g=v==="class",x=g&&s?o.map(b=>s[b]||b):o;g?(c.classList.remove(...x),c.classList.add(s&&s[f]?s[f]:f)):c.setAttribute(v,f)}),p(f)}function p(f){a&&l.includes(f)&&(c.style.colorScheme=f)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)d(r);else try{let f=localStorage.getItem(t)||n,v=i&&f==="system"?m():f;d(v)}catch{}},DI=h.createContext(void 0),LI={setTheme:e=>{},themes:[]},$I=()=>{var e;return(e=h.useContext(DI))!=null?e:LI};h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:a,nonce:c,scriptProps:l})=>{let d=JSON.stringify([n,t,s,e,a,i,r,o]).slice(1,-1);return h.createElement("script",{...l,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${OI.toString()})(${d})`}})});var FI=e=>{switch(e){case"success":return HI;case"info":return WI;case"warning":return UI;case"error":return VI;default:return null}},BI=Array(12).fill(0),zI=({visible:e,className:t})=>w.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},w.createElement("div",{className:"sonner-spinner"},BI.map((n,r)=>w.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),HI=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UI=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),WI=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),VI=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),KI=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},w.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qI=()=>{let[e,t]=w.useState(document.hidden);return w.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},oc=1,GI=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:oc++,s=this.toasts.find(a=>a.id===o),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:i,title:n}):a):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,s,i=r.then(async c=>{if(s=["resolve",c],w.isValidElement(c))o=!1,this.create({id:n,type:"default",message:c});else if(XI(c)&&!c.ok){o=!1;let l=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:l,description:d})}else if(t.success!==void 0){o=!1;let l=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:l,description:d})}}).catch(async c=>{if(s=["reject",c],t.error!==void 0){o=!1;let l=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:l,description:d})}}).finally(()=>{var c;o&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),a=()=>new Promise((c,l)=>i.then(()=>s[0]==="reject"?l(s[1]):c(s[1])).catch(l));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||oc++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Vt=new GI,YI=(e,t)=>{let n=(t==null?void 0:t.id)||oc++;return Vt.addToast({title:e,...t,id:n}),n},XI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",JI=YI,ZI=()=>Vt.toasts,QI=()=>Vt.getActiveToasts();Object.assign(JI,{success:Vt.success,info:Vt.info,warning:Vt.warning,error:Vt.error,custom:Vt.custom,message:Vt.message,promise:Vt.promise,dismiss:Vt.dismiss,loading:Vt.loading},{getHistory:ZI,getToasts:QI});function eN(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}eN(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
131
131
|
`);function bi(e){return e.label!==void 0}var tN=3,nN="32px",rN="16px",hx=4e3,oN=356,sN=14,iN=20,aN=200;function gn(...e){return e.filter(Boolean).join(" ")}function lN(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var cN=e=>{var t,n,r,o,s,i,a,c,l,d,p;let{invert:m,toast:f,unstyled:v,interacting:g,setHeights:x,visibleToasts:b,heights:y,index:C,toasts:E,expanded:S,removeToast:T,defaultRichColors:k,closeButton:A,style:j,cancelButtonStyle:$,actionButtonStyle:L,className:z="",descriptionClassName:G="",duration:M,position:X,gap:U,loadingIcon:W,expandByDefault:R,classNames:I,icons:Y,closeButtonAriaLabel:J="Close toast",pauseWhenPageIsHidden:O}=e,[q,D]=w.useState(null),[F,H]=w.useState(null),[P,_]=w.useState(!1),[K,Z]=w.useState(!1),[oe,se]=w.useState(!1),[Ne,ye]=w.useState(!1),[je,ze]=w.useState(!1),[$e,Ye]=w.useState(0),[Ze,at]=w.useState(0),St=w.useRef(f.duration||M||hx),ft=w.useRef(null),Ve=w.useRef(null),He=C===0,Oe=C+1<=b,_e=f.type,Fe=f.dismissible!==!1,rt=f.className||"",xt=f.descriptionClassName||"",Qe=w.useMemo(()=>y.findIndex(fe=>fe.toastId===f.id)||0,[y,f.id]),It=w.useMemo(()=>{var fe;return(fe=f.closeButton)!=null?fe:A},[f.closeButton,A]),pt=w.useMemo(()=>f.duration||M||hx,[f.duration,M]),vt=w.useRef(0),Nt=w.useRef(0),en=w.useRef(0),Ct=w.useRef(null),[sn,wt]=X.split("-"),Ue=w.useMemo(()=>y.reduce((fe,Me,Ke)=>Ke>=Qe?fe:fe+Me.height,0),[y,Qe]),We=qI(),Tt=f.invert||m,Q=_e==="loading";Nt.current=w.useMemo(()=>Qe*U+Ue,[Qe,Ue]),w.useEffect(()=>{St.current=pt},[pt]),w.useEffect(()=>{_(!0)},[]),w.useEffect(()=>{let fe=Ve.current;if(fe){let Me=fe.getBoundingClientRect().height;return at(Me),x(Ke=>[{toastId:f.id,height:Me,position:f.position},...Ke]),()=>x(Ke=>Ke.filter(ut=>ut.toastId!==f.id))}},[x,f.id]),w.useLayoutEffect(()=>{if(!P)return;let fe=Ve.current,Me=fe.style.height;fe.style.height="auto";let Ke=fe.getBoundingClientRect().height;fe.style.height=Me,at(Ke),x(ut=>ut.find(ct=>ct.toastId===f.id)?ut.map(ct=>ct.toastId===f.id?{...ct,height:Ke}:ct):[{toastId:f.id,height:Ke,position:f.position},...ut])},[P,f.title,f.description,x,f.id]);let ge=w.useCallback(()=>{Z(!0),Ye(Nt.current),x(fe=>fe.filter(Me=>Me.toastId!==f.id)),setTimeout(()=>{T(f)},aN)},[f,T,x,Nt]);w.useEffect(()=>{if(f.promise&&_e==="loading"||f.duration===1/0||f.type==="loading")return;let fe;return S||g||O&&We?(()=>{if(en.current<vt.current){let Me=new Date().getTime()-vt.current;St.current=St.current-Me}en.current=new Date().getTime()})():St.current!==1/0&&(vt.current=new Date().getTime(),fe=setTimeout(()=>{var Me;(Me=f.onAutoClose)==null||Me.call(f,f),ge()},St.current)),()=>clearTimeout(fe)},[S,g,f,_e,O,We,ge]),w.useEffect(()=>{f.delete&&ge()},[ge,f.delete]);function et(){var fe,Me,Ke;return Y!=null&&Y.loading?w.createElement("div",{className:gn(I==null?void 0:I.loader,(fe=f==null?void 0:f.classNames)==null?void 0:fe.loader,"sonner-loader"),"data-visible":_e==="loading"},Y.loading):W?w.createElement("div",{className:gn(I==null?void 0:I.loader,(Me=f==null?void 0:f.classNames)==null?void 0:Me.loader,"sonner-loader"),"data-visible":_e==="loading"},W):w.createElement(zI,{className:gn(I==null?void 0:I.loader,(Ke=f==null?void 0:f.classNames)==null?void 0:Ke.loader),visible:_e==="loading"})}return w.createElement("li",{tabIndex:0,ref:Ve,className:gn(z,rt,I==null?void 0:I.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,I==null?void 0:I.default,I==null?void 0:I[_e],(n=f==null?void 0:f.classNames)==null?void 0:n[_e]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:k,"data-styled":!(f.jsx||f.unstyled||v),"data-mounted":P,"data-promise":!!f.promise,"data-swiped":je,"data-removed":K,"data-visible":Oe,"data-y-position":sn,"data-x-position":wt,"data-index":C,"data-front":He,"data-swiping":oe,"data-dismissible":Fe,"data-type":_e,"data-invert":Tt,"data-swipe-out":Ne,"data-swipe-direction":F,"data-expanded":!!(S||R&&P),style:{"--index":C,"--toasts-before":C,"--z-index":E.length-C,"--offset":`${K?$e:Nt.current}px`,"--initial-height":R?"auto":`${Ze}px`,...j,...f.style},onDragEnd:()=>{se(!1),D(null),Ct.current=null},onPointerDown:fe=>{Q||!Fe||(ft.current=new Date,Ye(Nt.current),fe.target.setPointerCapture(fe.pointerId),fe.target.tagName!=="BUTTON"&&(se(!0),Ct.current={x:fe.clientX,y:fe.clientY}))},onPointerUp:()=>{var fe,Me,Ke,ut;if(Ne||!Fe)return;Ct.current=null;let ct=Number(((fe=Ve.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dt=Number(((Me=Ve.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Pt=new Date().getTime()-((Ke=ft.current)==null?void 0:Ke.getTime()),ke=q==="x"?ct:dt,Ee=Math.abs(ke)/Pt;if(Math.abs(ke)>=iN||Ee>.11){Ye(Nt.current),(ut=f.onDismiss)==null||ut.call(f,f),H(q==="x"?ct>0?"right":"left":dt>0?"down":"up"),ge(),ye(!0),ze(!1);return}se(!1),D(null)},onPointerMove:fe=>{var Me,Ke,ut,ct;if(!Ct.current||!Fe||((Me=window.getSelection())==null?void 0:Me.toString().length)>0)return;let dt=fe.clientY-Ct.current.y,Pt=fe.clientX-Ct.current.x,ke=(Ke=e.swipeDirections)!=null?Ke:lN(X);!q&&(Math.abs(Pt)>1||Math.abs(dt)>1)&&D(Math.abs(Pt)>Math.abs(dt)?"x":"y");let Ee={x:0,y:0};q==="y"?(ke.includes("top")||ke.includes("bottom"))&&(ke.includes("top")&&dt<0||ke.includes("bottom")&&dt>0)&&(Ee.y=dt):q==="x"&&(ke.includes("left")||ke.includes("right"))&&(ke.includes("left")&&Pt<0||ke.includes("right")&&Pt>0)&&(Ee.x=Pt),(Math.abs(Ee.x)>0||Math.abs(Ee.y)>0)&&ze(!0),(ut=Ve.current)==null||ut.style.setProperty("--swipe-amount-x",`${Ee.x}px`),(ct=Ve.current)==null||ct.style.setProperty("--swipe-amount-y",`${Ee.y}px`)}},It&&!f.jsx?w.createElement("button",{"aria-label":J,"data-disabled":Q,"data-close-button":!0,onClick:Q||!Fe?()=>{}:()=>{var fe;ge(),(fe=f.onDismiss)==null||fe.call(f,f)},className:gn(I==null?void 0:I.closeButton,(o=f==null?void 0:f.classNames)==null?void 0:o.closeButton)},(s=Y==null?void 0:Y.close)!=null?s:KI):null,f.jsx||w.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:w.createElement(w.Fragment,null,_e||f.icon||f.promise?w.createElement("div",{"data-icon":"",className:gn(I==null?void 0:I.icon,(i=f==null?void 0:f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||et():null,f.type!=="loading"?f.icon||(Y==null?void 0:Y[_e])||FI(_e):null):null,w.createElement("div",{"data-content":"",className:gn(I==null?void 0:I.content,(a=f==null?void 0:f.classNames)==null?void 0:a.content)},w.createElement("div",{"data-title":"",className:gn(I==null?void 0:I.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?w.createElement("div",{"data-description":"",className:gn(G,xt,I==null?void 0:I.description,(l=f==null?void 0:f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),w.isValidElement(f.cancel)?f.cancel:f.cancel&&bi(f.cancel)?w.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||$,onClick:fe=>{var Me,Ke;bi(f.cancel)&&Fe&&((Ke=(Me=f.cancel).onClick)==null||Ke.call(Me,fe),ge())},className:gn(I==null?void 0:I.cancelButton,(d=f==null?void 0:f.classNames)==null?void 0:d.cancelButton)},f.cancel.label):null,w.isValidElement(f.action)?f.action:f.action&&bi(f.action)?w.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||L,onClick:fe=>{var Me,Ke;bi(f.action)&&((Ke=(Me=f.action).onClick)==null||Ke.call(Me,fe),!fe.defaultPrevented&&ge())},className:gn(I==null?void 0:I.actionButton,(p=f==null?void 0:f.classNames)==null?void 0:p.actionButton)},f.action.label):null))};function mx(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function uN(e,t){let n={};return[e,t].forEach((r,o)=>{let s=o===1,i=s?"--mobile-offset":"--offset",a=s?rN:nN;function c(l){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof l=="number"?`${l}px`:l})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(l=>{r[l]===void 0?n[`${i}-${l}`]=a:n[`${i}-${l}`]=typeof r[l]=="number"?`${r[l]}px`:r[l]}):c(a)}),n}var dN=w.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:c,mobileOffset:l,theme:d="light",richColors:p,duration:m,style:f,visibleToasts:v=tN,toastOptions:g,dir:x=mx(),gap:b=sN,loadingIcon:y,icons:C,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:S}=e,[T,k]=w.useState([]),A=w.useMemo(()=>Array.from(new Set([r].concat(T.filter(O=>O.position).map(O=>O.position)))),[T,r]),[j,$]=w.useState([]),[L,z]=w.useState(!1),[G,M]=w.useState(!1),[X,U]=w.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=w.useRef(null),R=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=w.useRef(null),Y=w.useRef(!1),J=w.useCallback(O=>{k(q=>{var D;return(D=q.find(F=>F.id===O.id))!=null&&D.delete||Vt.dismiss(O.id),q.filter(({id:F})=>F!==O.id)})},[]);return w.useEffect(()=>Vt.subscribe(O=>{if(O.dismiss){k(q=>q.map(D=>D.id===O.id?{...D,delete:!0}:D));return}setTimeout(()=>{Lo.flushSync(()=>{k(q=>{let D=q.findIndex(F=>F.id===O.id);return D!==-1?[...q.slice(0,D),{...q[D],...O},...q.slice(D+1)]:[O,...q]})})})}),[]),w.useEffect(()=>{if(d!=="system"){U(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:q})=>{U(q?"dark":"light")})}catch{O.addListener(({matches:D})=>{try{U(D?"dark":"light")}catch(F){console.error(F)}})}},[d]),w.useEffect(()=>{T.length<=1&&z(!1)},[T]),w.useEffect(()=>{let O=q=>{var D,F;o.every(H=>q[H]||q.code===H)&&(z(!0),(D=W.current)==null||D.focus()),q.code==="Escape"&&(document.activeElement===W.current||(F=W.current)!=null&&F.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[o]),w.useEffect(()=>{if(W.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,Y.current=!1)}},[W.current]),w.createElement("section",{ref:t,"aria-label":`${E} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((O,q)=>{var D;let[F,H]=O.split("-");return T.length?w.createElement("ol",{key:O,dir:x==="auto"?mx():x,tabIndex:-1,ref:W,className:a,"data-sonner-toaster":!0,"data-theme":X,"data-y-position":F,"data-lifted":L&&T.length>1&&!s,"data-x-position":H,style:{"--front-toast-height":`${((D=j[0])==null?void 0:D.height)||0}px`,"--width":`${oN}px`,"--gap":`${b}px`,...f,...uN(c,l)},onBlur:P=>{Y.current&&!P.currentTarget.contains(P.relatedTarget)&&(Y.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,I.current=P.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{G||z(!1)},onDragEnd:()=>z(!1),onPointerDown:P=>{P.target instanceof HTMLElement&&P.target.dataset.dismissible==="false"||M(!0)},onPointerUp:()=>M(!1)},T.filter(P=>!P.position&&q===0||P.position===O).map((P,_)=>{var K,Z;return w.createElement(cN,{key:P.id,icons:C,index:_,toast:P,defaultRichColors:p,duration:(K=g==null?void 0:g.duration)!=null?K:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:v,closeButton:(Z=g==null?void 0:g.closeButton)!=null?Z:i,interacting:G,position:O,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:J,toasts:T.filter(oe=>oe.position==P.position),heights:j.filter(oe=>oe.position==P.position),setHeights:$,expandByDefault:s,gap:b,loadingIcon:y,expanded:L,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});const fN=({...e})=>{const{theme:t="system"}=$I();return u.jsx(dN,{theme:t,className:"toaster group",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"}},...e})};B.Api=ow,B.ApiClient=rw,B.ApiProvider=du,B.ArtifactRenderer=Fh,B.Badge=Yh,B.Button=Xe,B.Card=ml,B.CardContent=ti,B.CardDescription=vl,B.CardHeader=gl,B.CardTitle=xl,B.ChatApi=Jo,B.ChatApp=Kk,B.ChatInput=sp,B.ChatInputRow=ip,B.ChatInterface=Fr,B.ChatProviders=Tr,B.ChatWidget=Yk,B.Command=Al,B.CommandEmpty=_l,B.CommandGroup=Rl,B.CommandInput=Pl,B.CommandItem=Ml,B.CommandList=jl,B.DEFAULT_TIMEOUT_MS=su,B.Dialog=cl,B.DialogContent=Vs,B.DialogHeader=Ks,B.DialogTitle=qs,B.DropdownMenu=Is,B.DropdownMenuContent=xo,B.DropdownMenuItem=Fn,B.DropdownMenuTrigger=Ns,B.FileViewerModal=Th,B.HISTORY_TIMEOUT_MS=iu,B.Input=zl,B.InterruptPartRenderer=wl,B.Label=Am,B.MarkdownContent=fr,B.MessageComponent=ni,B.MessageList=Sl,B.MessageRow=yl,B.NewChatButton=Xk,B.PlotArtifact=$h,B.SETTINGS_STORAGE_KEY=Gi,B.ScrollArea=Bl,B.Select=AE,B.SelectContent=gg,B.SelectItem=xg,B.SelectTrigger=pg,B.SelectValue=PE,B.Separator=yg,B.Sheet=zE,B.SheetContent=Pg,B.SheetDescription=Rg,B.SheetHeader=jg,B.SheetTitle=_g,B.SheetTrigger=HE,B.SimpleChat=qk,B.SimpleJsonView=ei,B.Sonner=fN,B.StreamProgress=Bh,B.Switch=Ng,B.Textarea=Ma,B.ThinkingIndicator=Hh,B.ThreadListItem=Cm,B.ThreadManager=li,B.ThreadStateProvider=zu,B.ThreadsProvider=Su,B.TimelineColumn=Mx,B.Toaster=MI,B.ToolContent=qh,B.Tooltip=dI,B.TooltipContent=Hg,B.TooltipProvider=uI,B.TooltipTrigger=fI,B.UserTextContent=Uh,B.applySettings=Pw,B.buildCheckpointIndex=lc,B.buildCheckpointPreviewMap=Sx,B.buildLabelParts=Au,B.chatApiClient=Nn,B.collectText=ku,B.createArtifactPreviewFromPlot=ju,B.createArtifactPreviewFromSource=Pu,B.del=Li,B.downloadFileById=lu,B.extractConfigFields=Ci,B.extractToolContent=tr,B.extractToolMeta=Qo,B.fileToBase64=fu,B.formatToolOutput=Tu,B.get=Yt,B.getAgentNameFromMessage=Iu,B.getChatToken=ru,B.getCheckpointForMessage=Cx,B.getCurrentSettings=Aw,B.getDefaultApiConfig=Xu,B.getDefaultChatSettings=Ju,B.getFileContent=Fi,B.getFileInfo=iw,B.getMessageAttemptInfo=cc,B.getMessageDomKey=bl,B.getPreviewForMessage=Si,B.getToolProgress=Wi,B.httpClient=Gt,B.hydrateHistorySnapshots=Yn,B.isEnvelope=hu,B.isFileLike=zi,B.listFiles=cu,B.loadStoredSettings=Zu,B.looksLikeMarkdown=Cu,B.messageSignature=Ui,B.normalizeInterruptId=Hi,B.normalizeMimeType=Nu,B.normalizeToolPayload=_u,B.normalizeToolPayloadValue=Cr,B.onChatTokenChanged=ou,B.parseJsonSafe=Qn,B.post=Xo,B.pretty=er,B.processAttachments=pu,B.put=au,B.readNumber=dc,B.readString=Rn,B.resolveChatBaseUrl=vn,B.sanitizeForDisplay=Sr,B.saveSettings=Qu,B.setChatToken=Yo,B.stringifyTool=Eu,B.toPlainObject=_n,B.unwrap=Lt,B.useApi=no,B.useCheckpointIndex=uc,B.useFilePreview=Wh,B.useHasChatSession=Ew,B.useParsedMessageContent=Vh,B.useShallowStableValue=Ku,B.useStream=qi,B.useStreamingHook=qi,B.useThreadHistoryState=Lu,B.useThreadManagerViewState=Em,B.useThreadState=oo,B.useThreadStateUpdater=Bu,B.useThreads=yr,B.useThreadsState=bu,B.viewFileById=sw,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED