cortex-react-components 2.18.0 → 2.18.1
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/{chunk-WIRQ5IRT.mjs → chunk-2GM2LPLB.mjs} +1 -1
- package/dist/{chunk-3HNU2NYP.mjs → chunk-2OOJ4ZFB.mjs} +1 -1
- package/dist/{chunk-ZEALRBXW.mjs → chunk-3ANJOET7.mjs} +1 -1
- package/dist/{chunk-7R47MHQE.mjs → chunk-4SRUEQTP.mjs} +1 -1
- package/dist/{chunk-3ZQFJ5WD.mjs → chunk-5KO67YNF.mjs} +1 -1
- package/dist/{chunk-UECG3SCG.mjs → chunk-5PJLI46T.mjs} +1 -1
- package/dist/{chunk-ITJH72Z2.mjs → chunk-75WE6ZXB.mjs} +1 -1
- package/dist/chunk-7JDMW5R3.mjs +4 -0
- package/dist/{chunk-7IARWH7M.mjs → chunk-7JX3L2MA.mjs} +1 -1
- package/dist/{chunk-CXOVEABI.mjs → chunk-7OMPPFGG.mjs} +1 -1
- package/dist/{chunk-75F3LJMX.mjs → chunk-BQQ4V4PX.mjs} +1 -1
- package/dist/{chunk-V6GK2FJG.mjs → chunk-CQAMS7RZ.mjs} +1 -1
- package/dist/{chunk-LX3D4J7I.mjs → chunk-DEVPAZSJ.mjs} +1 -1
- package/dist/{chunk-GHOL5L32.mjs → chunk-F64CA5CH.mjs} +1 -1
- package/dist/{chunk-3Y7QG6VP.mjs → chunk-FEWOSBUJ.mjs} +1 -1
- package/dist/{chunk-TTWEHUP5.mjs → chunk-FMV74RKL.mjs} +1 -1
- package/dist/{chunk-2BRDNDUB.mjs → chunk-FYQBRCQM.mjs} +1 -1
- package/dist/{chunk-RJGYVDOU.mjs → chunk-GAZHKHGB.mjs} +1 -1
- package/dist/{chunk-RGOKBIQ5.mjs → chunk-GETYSIZV.mjs} +1 -1
- package/dist/{chunk-3NRXQBBS.mjs → chunk-HDKHF3EA.mjs} +1 -1
- package/dist/{chunk-6R6NYDWN.mjs → chunk-HGL6JHJQ.mjs} +1 -1
- package/dist/{chunk-C4RWEPVF.mjs → chunk-HKMNAXLM.mjs} +1 -1
- package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
- package/dist/{chunk-WHDV4REI.mjs → chunk-IG36QUEI.mjs} +1 -1
- package/dist/{chunk-5EQXJS23.mjs → chunk-JYPPWTB3.mjs} +1 -1
- package/dist/{chunk-PWFVXG44.mjs → chunk-KVLUT4U2.mjs} +1 -1
- package/dist/{chunk-L5NPH5RX.mjs → chunk-LLP4EFT4.mjs} +1 -1
- package/dist/{chunk-5MWZTJYP.mjs → chunk-MO4HRQEL.mjs} +1 -1
- package/dist/{chunk-KWYJ3XZI.mjs → chunk-O24GFE6Q.mjs} +1 -1
- package/dist/{chunk-GTZJWMZR.mjs → chunk-P6OSMPUQ.mjs} +1 -1
- package/dist/{chunk-FE7ZGUPU.mjs → chunk-PNUBVBSR.mjs} +1 -1
- package/dist/{chunk-AJQHGVZ5.mjs → chunk-PTZT4QJW.mjs} +1 -1
- package/dist/chunk-QADUAIFH.mjs +1 -0
- package/dist/{chunk-D6K6RO5P.mjs → chunk-R5P4ZICA.mjs} +1 -1
- package/dist/{chunk-EM3T2XYC.mjs → chunk-R6AYIVIR.mjs} +1 -1
- package/dist/{chunk-P55W6AFU.mjs → chunk-RIRZRO6U.mjs} +1 -1
- package/dist/{chunk-TXVA6XJT.mjs → chunk-SRUG246N.mjs} +1 -1
- package/dist/{chunk-RSDUFAIB.mjs → chunk-T5HJS6OF.mjs} +1 -1
- package/dist/{chunk-NINFDOV5.mjs → chunk-U3FYDDE2.mjs} +1 -1
- package/dist/chunk-UA2E23AS.mjs +4 -0
- package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.mjs} +1 -1
- package/dist/{chunk-6PS55VJZ.mjs → chunk-VDFRWGXR.mjs} +1 -1
- package/dist/{chunk-XGIYNUGC.mjs → chunk-VNYUNZ3M.mjs} +1 -1
- package/dist/{chunk-2BR55L74.mjs → chunk-VRE6VCHX.mjs} +1 -1
- package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
- package/dist/{chunk-HUYTXZLC.mjs → chunk-WYLCN44C.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/ImageBlock.mjs +1 -1
- package/dist/components/Blocks/MediaBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.js +1 -1
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.js +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/CodeBlock.js +1 -1
- package/dist/components/Chat/PartTypes/CodeBlock.mjs +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.js +3 -3
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/Tool.js +1 -1
- package/dist/components/Chat/PartTypes/Tool.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.js +1 -1
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.js +1 -1
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.js +1 -1
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.js +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.js +1 -1
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.js +1 -1
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/index.mjs +1 -1
- package/dist/components/Payload/PayloadCard/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/EpicsView.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-GXRWKWKJ.mjs +0 -1
- package/dist/chunk-UGBDJDPW.mjs +0 -4
- package/dist/chunk-ZN7NNMB7.mjs +0 -4
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
`,children:a?"Processing...":"Deny"}),(0,A.jsx)("button",{onClick:g,disabled:a,className:`
|
|
18
18
|
px-4 py-2 text-white border-none rounded text-sm
|
|
19
19
|
${a?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
20
|
-
`,children:"Cancel"})]})]}):null};var mt=({toolPart:e,index:t,addToolResult:o})=>{let[r,n]=pe.default.useState(!0),[s,a]=pe.default.useState(null),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),a("approve")},c=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),a("deny")};switch(e.state){case"input-available":return(0,A.jsxs)("div",{className:"mb-2",children:[(0,A.jsx)(Be,{isOpen:r,onApprove:i,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!r&&(0,A.jsxs)(A.Fragment,{children:[s==="approve"&&(0,A.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,A.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,A.jsx)("svg",{className:"h-4 A-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,A.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),s==="deny"&&(0,A.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,A.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,A.jsx)("svg",{className:"h-4 A-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,A.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,A.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var fe=require("@radix-ui/react-use-controllable-state");var G=U(require("@radix-ui/react-collapsible")),Z=G.Root,Q=G.CollapsibleTrigger,ee=G.CollapsibleContent;var He=require("clsx");var ge="-",gt=e=>{let t=bt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{let i=a.split(ge);return i[0]===""&&i.length!==1&&i.shift(),Oe(i,t)||ft(a)},getConflictingClassGroupIds:(a,i)=>{let c=o[a]||[];return i&&r[a]?[...c,...r[a]]:c}}},Oe=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),n=r?Oe(e.slice(1),r):void 0;if(n)return n;if(t.validators.length===0)return;let s=e.join(ge);return t.validators.find(({validator:a})=>a(s))?.classGroupId},Le=/^\[(.+)\]$/,ft=e=>{if(Le.test(e)){let t=Le.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},bt=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return xt(Object.entries(e.classGroups),o).forEach(([s,a])=>{me(a,r,s,t)}),r},me=(e,t,o,r)=>{e.forEach(n=>{if(typeof n=="string"){let s=n===""?t:Ee(t,n);s.classGroupId=o;return}if(typeof n=="function"){if(ht(n)){me(n(r),t,o,r);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([s,a])=>{me(a,Ee(t,s),o,r)})})},Ee=(e,t)=>{let o=e;return t.split(ge).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},ht=e=>e.isThemeGetter,xt=(e,t)=>t?e.map(([o,r])=>{let n=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,i])=>[t+a,i])):s);return[o,n]}):e,yt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,n=(s,a)=>{o.set(s,a),t++,t>e&&(t=0,r=o,o=new Map)};return{get(s){let a=o.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return n(s,a),a},set(s,a){o.has(s)?o.set(s,a):n(s,a)}}},Ge="!",vt=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,n=t[0],s=t.length,a=i=>{let c=[],d=0,g=0,f;for(let b=0;b<i.length;b++){let y=i[b];if(d===0){if(y===n&&(r||i.slice(b,b+s)===t)){c.push(i.slice(g,b)),g=b+s;continue}if(y==="/"){f=b;continue}}y==="["?d++:y==="]"&&d--}let v=c.length===0?i:i.substring(g),N=v.startsWith(Ge),C=N?v.substring(1):v,x=f&&f>g?f-g:void 0;return{modifiers:c,hasImportantModifier:N,baseClassName:C,maybePostfixModifierPosition:x}};return o?i=>o({className:i,parseClassName:a}):a},wt=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},Ct=e=>({cache:yt(e.cacheSize),parseClassName:vt(e),...gt(e)}),kt=/\s+/,Pt=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:n}=t,s=[],a=e.trim().split(kt),i="";for(let c=a.length-1;c>=0;c-=1){let d=a[c],{modifiers:g,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:N}=o(d),C=!!N,x=r(C?v.substring(0,N):v);if(!x){if(!C){i=d+(i.length>0?" "+i:i);continue}if(x=r(v),!x){i=d+(i.length>0?" "+i:i);continue}C=!1}let b=wt(g).join(":"),y=f?b+Ge:b,T=y+x;if(s.includes(T))continue;s.push(T);let j=n(x,C);for(let O=0;O<j.length;++O){let J=j[O];s.push(y+J)}i=d+(i.length>0?" "+i:i)}return i};function Nt(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ve(t))&&(r&&(r+=" "),r+=o);return r}var Ve=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Ve(e[r]))&&(o&&(o+=" "),o+=t);return o};function Tt(e,...t){let o,r,n,s=a;function a(c){let d=t.reduce((g,f)=>f(g),e());return o=Ct(d),r=o.cache.get,n=o.cache.set,s=i,i(c)}function i(c){let d=r(c);if(d)return d;let g=Pt(c,o);return n(c,g),g}return function(){return s(Nt.apply(null,arguments))}}var p=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},_e=/^\[(?:([a-z-]+):)?(.+)\]$/i,Rt=/^\d+\/\d+$/,At=new Set(["px","full","screen"]),Mt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(A|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,St=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,It=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>V(e)||At.has(e)||Rt.test(e),L=e=>_(e,"length",jt),V=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>_(e,"number",V),q=e=>!!e&&Number.isInteger(Number(e)),Lt=e=>e.endsWith("%")&&V(e.slice(0,-1)),l=e=>_e.test(e),E=e=>Mt.test(e),Et=new Set(["length","size","percentage"]),Ot=e=>_(e,Et,We),Gt=e=>_(e,"position",We),Vt=new Set(["image","url"]),_t=e=>_(e,Vt,Ut),Wt=e=>_(e,"",Ht),F=()=>!0,_=(e,t,o)=>{let r=_e.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},jt=e=>zt.test(e)&&!St.test(e),We=()=>!1,Ht=e=>It.test(e),Ut=e=>Bt.test(e);var $t=()=>{let e=p("colors"),t=p("spacing"),o=p("blur"),r=p("brightness"),n=p("borderColor"),s=p("borderRadius"),a=p("borderSpacing"),i=p("borderWidth"),c=p("contrast"),d=p("grayscale"),g=p("hueRotate"),f=p("invert"),v=p("gap"),N=p("gradientColorStops"),C=p("gradientColorStopPositions"),x=p("inset"),b=p("margin"),y=p("opacity"),T=p("padding"),j=p("saturate"),O=p("scale"),J=p("sepia"),xe=p("skew"),ye=p("space"),ve=p("translate"),se=()=>["auto","contain","none"],ae=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",l,t],m=()=>[l,t],we=()=>["",B,L],X=()=>["auto",V,l],Ce=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",l],Pe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[V,l];return{cacheSize:500,separator:":",theme:{colors:[F],spacing:[B,L],blur:["none","",E,l],brightness:z(),borderColor:[e],borderRadius:["none","","full",E,l],borderSpacing:m(),borderWidth:we(),contrast:z(),grayscale:H(),hueRotate:z(),invert:H(),gap:m(),gradientColorStops:[e],gradientColorStopPositions:[Lt,L],inset:ie(),margin:ie(),opacity:z(),padding:m(),saturate:z(),scale:z(),sepia:H(),skew:z(),space:m(),translate:m()},classGroups:{aspect:[{aspect:["auto","square","video",l]}],container:["container"],columns:[{columns:[E]}],"break-after":[{"break-after":Pe()}],"break-before":[{"break-before":Pe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ce(),l]}],overflow:[{overflow:ae()}],"overflow-x":[{"overflow-x":ae()}],"overflow-y":[{"overflow-y":ae()}],overscroll:[{overscroll:se()}],"overscroll-x":[{"overscroll-x":se()}],"overscroll-y":[{"overscroll-y":se()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",q,l]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",l]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",q,l]}],"grid-cols":[{"grid-cols":[F]}],"col-start-end":[{col:["auto",{span:["full",q,l]},l]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[F]}],"row-start-end":[{row:["auto",{span:[q,l]},l]}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",l]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",l]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[ye]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ye]}],"space-y-reverse":["space-y-reverse"],A:[{A:["auto","min","max","fit","svw","lvw","dvw",l,t]}],"min-A":[{"min-A":[l,t,"min","max","fit"]}],"max-A":[{"max-A":[l,t,"none","full","min","max","fit","prose",{screen:[E]},E]}],h:[{h:[l,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[l,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[l,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[l,t,"auto","min","max","fit"]}],"font-size":[{text:["base",E,L]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[F]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",l]}],"line-clamp":[{"line-clamp":["none",V,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,l]}],"list-image":[{"list-image":["none",l]}],"list-style-type":[{list:["none","disc","decimal",l]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,L]}],"underline-offset":[{"underline-offset":["auto",B,l]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:m()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",l]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",l]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ce(),Gt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ot]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_t]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[N]}],"gradient-via":[{via:[N]}],"gradient-to":[{to:[N]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-A":[{border:[i]}],"border-A-x":[{"border-x":[i]}],"border-A-y":[{"border-y":[i]}],"border-A-s":[{"border-s":[i]}],"border-A-e":[{"border-e":[i]}],"border-A-t":[{"border-t":[i]}],"border-A-r":[{"border-r":[i]}],"border-A-b":[{"border-b":[i]}],"border-A-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:K()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[B,l]}],"outline-A":[{outline:[B,L]}],"outline-color":[{outline:[e]}],"ring-A":[{ring:we()}],"ring-A-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-A":[{"ring-offset":[B,L]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",E,Wt]}],"shadow-color":[{shadow:[F]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",E,l]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[f]}],saturate:[{saturate:[j]}],sepia:[{sepia:[J]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[J]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",l]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",l]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",l]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[q,l]}],"translate-x":[{"translate-x":[ve]}],"translate-y":[{"translate-y":[ve]}],"skew-x":[{"skew-x":[xe]}],"skew-y":[{"skew-y":[xe]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",l]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","A-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",l]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":m()}],"scroll-mx":[{"scroll-mx":m()}],"scroll-my":[{"scroll-my":m()}],"scroll-ms":[{"scroll-ms":m()}],"scroll-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":m()}],"scroll-mr":[{"scroll-mr":m()}],"scroll-mb":[{"scroll-mb":m()}],"scroll-ml":[{"scroll-ml":m()}],"scroll-p":[{"scroll-p":m()}],"scroll-px":[{"scroll-px":m()}],"scroll-py":[{"scroll-py":m()}],"scroll-ps":[{"scroll-ps":m()}],"scroll-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":m()}],"scroll-pb":[{"scroll-pb":m()}],"scroll-pl":[{"scroll-pl":m()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",l]}],fill:[{fill:[e,"none"]}],"stroke-A":[{stroke:[B,L,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["A","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-A":["border-A-s","border-A-e","border-A-t","border-A-r","border-A-b","border-A-l"],"border-A-x":["border-A-r","border-A-l"],"border-A-y":["border-A-t","border-A-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var je=Tt($t);function h(...e){return je((0,He.clsx)(e))}var oe=require("lucide-react");var $e=require("streamdown"),te=(0,ce.memo)(({className:e,...t})=>(0,A.jsx)($e.Streamdown,{className:h("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);te.displayName="Response";var Fe=(0,ce.createContext)(null),qt=()=>{let e=(0,ce.useContext)(Fe);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},Ft=1e3,Dt=1e3,De=(0,ce.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:r=!0,onOpenChange:n,duration:s,children:a,...i})=>{let[c,d]=(0,fe.useControllableState)({prop:o,defaultProp:r,onChange:n}),[g,f]=(0,fe.useControllableState)({prop:s,defaultProp:0}),[v,N]=(0,ce.useState)(!1),[C,x]=(0,ce.useState)(null);(0,ce.useEffect)(()=>{t?C===null&&x(Date.now()):C!==null&&(f(Math.ceil((Date.now()-C)/Dt)),x(null))},[t,C,f]),(0,ce.useEffect)(()=>{if(r&&!t&&c&&!v){let y=setTimeout(()=>{d(!1),N(!0)},Ft);return()=>clearTimeout(y)}},[t,c,r,d,v]);let b=y=>{d(y)};return(0,A.jsx)(Fe.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:d,duration:g},children:(0,A.jsx)(Z,{className:h("not-prose mb-4",e),onOpenChange:b,open:c,...i,children:a})})}),Jt=(e,t)=>e||t===0?(0,A.jsx)("p",{children:"Thinking..."}):t===void 0?(0,A.jsx)("p",{children:"Thought for a few seconds"}):(0,A.jsxs)("p",{children:["Thought for ",t," seconds"]}),Je=(0,ce.memo)(({className:e,children:t,...o})=>{let{isStreaming:r,isOpen:n,duration:s}=qt();return(0,A.jsx)(Q,{className:h("flex A-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(oe.BrainIcon,{className:"size-4"}),Jt(r,s),(0,A.jsx)(oe.ChevronDownIcon,{className:h("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),Xe=(0,ce.memo)(({className:e,children:t,...o})=>(0,A.jsx)(ee,{className:h("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,A.jsx)(te,{className:"grid gap-2",children:t})}));De.displayName="Reasoning";Je.displayName="ReasoningTrigger";Xe.displayName="ReasoningContent";var Ke=require("class-variance-authority");var Xt=(0,Ke.cva)("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ye({className:e,variant:t,...o}){return(0,A.jsx)("div",{className:h(Xt({variant:t}),e),...o})}var Qe=require("@radix-ui/react-slot"),tt=U(require("react")),Kt=(0,Ke.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 A-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),be=tt.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...n},s)=>(0,A.jsx)(e?Qe.Slot:"button",{className:h(Kt({className:t,size:o,variant:r})),ref:s,...n}));be.displayName="Button";var he=require("react-syntax-highlighter"),ne=require("react-syntax-highlighter/dist/esm/styles/prism"),rt=(0,ce.createContext)({code:""}),D=({code:e,language:t,showLineNumbers:o=!1,className:r,children:n,...s})=>(0,A.jsx)(rt.Provider,{value:{code:e},children:(0,A.jsx)("div",{className:h("relative A-full overflow-hidden rounded-md border bg-background text-foreground",r),...s,children:(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)(he.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:ne.oneLight,children:e}),(0,A.jsx)(he.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:ne.oneDark,children:e}),n&&(0,A.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})}),Yt=({onCopy:e,onError:t,timeout:o=2e3,children:r,className:n,...s})=>{let[a,i]=(0,ce.useState)(!1),{code:c}=(0,ce.useContext)(rt),d=async()=>{if(typeof window>"A"||!navigator.clipboard.writeText){t?.(new Error("Clipboard API not available"));return}try{await navigator.clipboard.writeText(c),i(!0),e?.(),setTimeout(()=>i(!1),o)}catch(f){t?.(f)}},g=a?oe.CheckIcon:oe.CopyIcon;return(0,A.jsx)(be,{className:h("shrink-0",n),onClick:d,size:"icon",variant:"ghost",...s,children:r??(0,A.jsx)(g,{size:14})})};var Zt=({className:e,...t})=>(0,A.jsx)(Z,{className:h("not-prose mb-4 A-full rounded-md border",e),...t}),Qt=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,A.jsxs)(Ye,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,A.jsx)(oe.CircleIcon,{className:"size-4"}),"input-available":(0,A.jsx)(oe.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,A.jsx)(oe.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,A.jsx)(oe.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},eo=({className:e,type:t,state:o,...r})=>(0,A.jsxs)(Q,{className:h("flex A-full items-center justify-between gap-4 p-3",e),...r,children:[(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(oe.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,A.jsx)("span",{className:"font-medium text-sm",children:t}),Qt(o)]}),(0,A.jsx)(oe.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),to=({className:e,...t})=>(0,A.jsx)(ee,{className:h("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),oo=({className:e,input:t,...o})=>(0,A.jsxs)("div",{className:h("space-y-2 overflow-hidden p-4",e),...o,children:[(0,A.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,A.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,A.jsx)(D,{code:JSON.stringify(t,null,2),language:"json"})})]}),ro=({className:e,output:t,errorText:o,...r})=>{if(!(t||o))return null;let n=(0,A.jsx)("div",{children:t});return typeof t=="object"?n=(0,A.jsx)(D,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,A.jsx)(D,{code:t,language:"json"})),(0,A.jsxs)("div",{className:h("space-y-2 p-4",e),...r,children:[(0,A.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,A.jsxs)("div",{className:h("overflow-x-auto rounded-md text-xs [&_table]:A-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,A.jsx)("div",{children:o}),n]})]})};0&&(module.exports={CodeBlock,CodeBlockCopyButton,PartApprovalTool,PartAuthenticateTool,PartText,Reasoning,ReasoningContent,ReasoningTrigger,Response,Tool,ToolContent,ToolHeader,ToolInput,ToolOutput});
|
|
20
|
+
`,children:"Cancel"})]})]}):null};var mt=({toolPart:e,index:t,addToolResult:o})=>{let[r,n]=pe.default.useState(!0),[s,a]=pe.default.useState(null),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),a("approve")},c=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),a("deny")};switch(e.state){case"input-available":return(0,A.jsxs)("div",{className:"mb-2",children:[(0,A.jsx)(Be,{isOpen:r,onApprove:i,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!r&&(0,A.jsxs)(A.Fragment,{children:[s==="approve"&&(0,A.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,A.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,A.jsx)("svg",{className:"h-4 A-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,A.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),s==="deny"&&(0,A.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,A.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,A.jsx)("svg",{className:"h-4 A-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,A.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,A.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var fe=require("@radix-ui/react-use-controllable-state");var G=U(require("@radix-ui/react-collapsible")),Z=G.Root,Q=G.CollapsibleTrigger,ee=G.CollapsibleContent;var He=require("clsx");var ge="-",gt=e=>{let t=bt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{let i=a.split(ge);return i[0]===""&&i.length!==1&&i.shift(),Oe(i,t)||ft(a)},getConflictingClassGroupIds:(a,i)=>{let c=o[a]||[];return i&&r[a]?[...c,...r[a]]:c}}},Oe=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),n=r?Oe(e.slice(1),r):void 0;if(n)return n;if(t.validators.length===0)return;let s=e.join(ge);return t.validators.find(({validator:a})=>a(s))?.classGroupId},Le=/^\[(.+)\]$/,ft=e=>{if(Le.test(e)){let t=Le.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},bt=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return xt(Object.entries(e.classGroups),o).forEach(([s,a])=>{me(a,r,s,t)}),r},me=(e,t,o,r)=>{e.forEach(n=>{if(typeof n=="string"){let s=n===""?t:Ee(t,n);s.classGroupId=o;return}if(typeof n=="function"){if(ht(n)){me(n(r),t,o,r);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([s,a])=>{me(a,Ee(t,s),o,r)})})},Ee=(e,t)=>{let o=e;return t.split(ge).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},ht=e=>e.isThemeGetter,xt=(e,t)=>t?e.map(([o,r])=>{let n=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,i])=>[t+a,i])):s);return[o,n]}):e,yt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,n=(s,a)=>{o.set(s,a),t++,t>e&&(t=0,r=o,o=new Map)};return{get(s){let a=o.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return n(s,a),a},set(s,a){o.has(s)?o.set(s,a):n(s,a)}}},Ge="!",vt=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,n=t[0],s=t.length,a=i=>{let c=[],d=0,g=0,f;for(let b=0;b<i.length;b++){let y=i[b];if(d===0){if(y===n&&(r||i.slice(b,b+s)===t)){c.push(i.slice(g,b)),g=b+s;continue}if(y==="/"){f=b;continue}}y==="["?d++:y==="]"&&d--}let v=c.length===0?i:i.substring(g),N=v.startsWith(Ge),C=N?v.substring(1):v,x=f&&f>g?f-g:void 0;return{modifiers:c,hasImportantModifier:N,baseClassName:C,maybePostfixModifierPosition:x}};return o?i=>o({className:i,parseClassName:a}):a},wt=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},Ct=e=>({cache:yt(e.cacheSize),parseClassName:vt(e),...gt(e)}),kt=/\s+/,Pt=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:n}=t,s=[],a=e.trim().split(kt),i="";for(let c=a.length-1;c>=0;c-=1){let d=a[c],{modifiers:g,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:N}=o(d),C=!!N,x=r(C?v.substring(0,N):v);if(!x){if(!C){i=d+(i.length>0?" "+i:i);continue}if(x=r(v),!x){i=d+(i.length>0?" "+i:i);continue}C=!1}let b=wt(g).join(":"),y=f?b+Ge:b,T=y+x;if(s.includes(T))continue;s.push(T);let j=n(x,C);for(let O=0;O<j.length;++O){let J=j[O];s.push(y+J)}i=d+(i.length>0?" "+i:i)}return i};function Nt(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ve(t))&&(r&&(r+=" "),r+=o);return r}var Ve=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Ve(e[r]))&&(o&&(o+=" "),o+=t);return o};function Tt(e,...t){let o,r,n,s=a;function a(c){let d=t.reduce((g,f)=>f(g),e());return o=Ct(d),r=o.cache.get,n=o.cache.set,s=i,i(c)}function i(c){let d=r(c);if(d)return d;let g=Pt(c,o);return n(c,g),g}return function(){return s(Nt.apply(null,arguments))}}var p=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},_e=/^\[(?:([a-z-]+):)?(.+)\]$/i,Rt=/^\d+\/\d+$/,At=new Set(["px","full","screen"]),Mt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(A|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,St=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,It=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>V(e)||At.has(e)||Rt.test(e),L=e=>_(e,"length",jt),V=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>_(e,"number",V),q=e=>!!e&&Number.isInteger(Number(e)),Lt=e=>e.endsWith("%")&&V(e.slice(0,-1)),l=e=>_e.test(e),E=e=>Mt.test(e),Et=new Set(["length","size","percentage"]),Ot=e=>_(e,Et,We),Gt=e=>_(e,"position",We),Vt=new Set(["image","url"]),_t=e=>_(e,Vt,Ut),Wt=e=>_(e,"",Ht),F=()=>!0,_=(e,t,o)=>{let r=_e.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},jt=e=>zt.test(e)&&!St.test(e),We=()=>!1,Ht=e=>It.test(e),Ut=e=>Bt.test(e);var $t=()=>{let e=p("colors"),t=p("spacing"),o=p("blur"),r=p("brightness"),n=p("borderColor"),s=p("borderRadius"),a=p("borderSpacing"),i=p("borderWidth"),c=p("contrast"),d=p("grayscale"),g=p("hueRotate"),f=p("invert"),v=p("gap"),N=p("gradientColorStops"),C=p("gradientColorStopPositions"),x=p("inset"),b=p("margin"),y=p("opacity"),T=p("padding"),j=p("saturate"),O=p("scale"),J=p("sepia"),xe=p("skew"),ye=p("space"),ve=p("translate"),se=()=>["auto","contain","none"],ae=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",l,t],m=()=>[l,t],we=()=>["",B,L],X=()=>["auto",V,l],Ce=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",l],Pe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[V,l];return{cacheSize:500,separator:":",theme:{colors:[F],spacing:[B,L],blur:["none","",E,l],brightness:z(),borderColor:[e],borderRadius:["none","","full",E,l],borderSpacing:m(),borderWidth:we(),contrast:z(),grayscale:H(),hueRotate:z(),invert:H(),gap:m(),gradientColorStops:[e],gradientColorStopPositions:[Lt,L],inset:ie(),margin:ie(),opacity:z(),padding:m(),saturate:z(),scale:z(),sepia:H(),skew:z(),space:m(),translate:m()},classGroups:{aspect:[{aspect:["auto","square","video",l]}],container:["container"],columns:[{columns:[E]}],"break-after":[{"break-after":Pe()}],"break-before":[{"break-before":Pe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ce(),l]}],overflow:[{overflow:ae()}],"overflow-x":[{"overflow-x":ae()}],"overflow-y":[{"overflow-y":ae()}],overscroll:[{overscroll:se()}],"overscroll-x":[{"overscroll-x":se()}],"overscroll-y":[{"overscroll-y":se()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",q,l]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",l]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",q,l]}],"grid-cols":[{"grid-cols":[F]}],"col-start-end":[{col:["auto",{span:["full",q,l]},l]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[F]}],"row-start-end":[{row:["auto",{span:[q,l]},l]}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",l]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",l]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[ye]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ye]}],"space-y-reverse":["space-y-reverse"],A:[{A:["auto","min","max","fit","svw","lvw","dvw",l,t]}],"min-A":[{"min-A":[l,t,"min","max","fit"]}],"max-A":[{"max-A":[l,t,"none","full","min","max","fit","prose",{screen:[E]},E]}],h:[{h:[l,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[l,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[l,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[l,t,"auto","min","max","fit"]}],"font-size":[{text:["base",E,L]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[F]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",l]}],"line-clamp":[{"line-clamp":["none",V,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,l]}],"list-image":[{"list-image":["none",l]}],"list-style-type":[{list:["none","disc","decimal",l]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,L]}],"underline-offset":[{"underline-offset":["auto",B,l]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:m()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",l]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",l]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ce(),Gt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ot]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_t]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[N]}],"gradient-via":[{via:[N]}],"gradient-to":[{to:[N]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-A":[{border:[i]}],"border-A-x":[{"border-x":[i]}],"border-A-y":[{"border-y":[i]}],"border-A-s":[{"border-s":[i]}],"border-A-e":[{"border-e":[i]}],"border-A-t":[{"border-t":[i]}],"border-A-r":[{"border-r":[i]}],"border-A-b":[{"border-b":[i]}],"border-A-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:K()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[B,l]}],"outline-A":[{outline:[B,L]}],"outline-color":[{outline:[e]}],"ring-A":[{ring:we()}],"ring-A-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-A":[{"ring-offset":[B,L]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",E,Wt]}],"shadow-color":[{shadow:[F]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",E,l]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[g]}],invert:[{invert:[f]}],saturate:[{saturate:[j]}],sepia:[{sepia:[J]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[g]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[J]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",l]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",l]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",l]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[q,l]}],"translate-x":[{"translate-x":[ve]}],"translate-y":[{"translate-y":[ve]}],"skew-x":[{"skew-x":[xe]}],"skew-y":[{"skew-y":[xe]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",l]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","A-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",l]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":m()}],"scroll-mx":[{"scroll-mx":m()}],"scroll-my":[{"scroll-my":m()}],"scroll-ms":[{"scroll-ms":m()}],"scroll-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":m()}],"scroll-mr":[{"scroll-mr":m()}],"scroll-mb":[{"scroll-mb":m()}],"scroll-ml":[{"scroll-ml":m()}],"scroll-p":[{"scroll-p":m()}],"scroll-px":[{"scroll-px":m()}],"scroll-py":[{"scroll-py":m()}],"scroll-ps":[{"scroll-ps":m()}],"scroll-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":m()}],"scroll-pb":[{"scroll-pb":m()}],"scroll-pl":[{"scroll-pl":m()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",l]}],fill:[{fill:[e,"none"]}],"stroke-A":[{stroke:[B,L,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["A","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-A":["border-A-s","border-A-e","border-A-t","border-A-r","border-A-b","border-A-l"],"border-A-x":["border-A-r","border-A-l"],"border-A-y":["border-A-t","border-A-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var je=Tt($t);function h(...e){return je((0,He.clsx)(e))}var oe=require("lucide-react");var $e=require("streamdown"),te=(0,ce.memo)(({className:e,...t})=>(0,A.jsx)($e.Streamdown,{className:h("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);te.displayName="Response";var Fe=(0,ce.createContext)(null),qt=()=>{let e=(0,ce.useContext)(Fe);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},Ft=1e3,Dt=1e3,De=(0,ce.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:r=!0,onOpenChange:n,duration:s,children:a,...i})=>{let[c,d]=(0,fe.useControllableState)({prop:o,defaultProp:r,onChange:n}),[g,f]=(0,fe.useControllableState)({prop:s,defaultProp:0}),[v,N]=(0,ce.useState)(!1),[C,x]=(0,ce.useState)(null);(0,ce.useEffect)(()=>{t?C===null&&x(Date.now()):C!==null&&(f(Math.ceil((Date.now()-C)/Dt)),x(null))},[t,C,f]),(0,ce.useEffect)(()=>{if(r&&!t&&c&&!v){let y=setTimeout(()=>{d(!1),N(!0)},Ft);return()=>clearTimeout(y)}},[t,c,r,d,v]);let b=y=>{d(y)};return(0,A.jsx)(Fe.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:d,duration:g},children:(0,A.jsx)(Z,{className:h("not-prose mb-4",e),onOpenChange:b,open:c,...i,children:a})})}),Jt=(e,t)=>e||t===0?(0,A.jsx)("p",{children:"Thinking..."}):t===void 0?(0,A.jsx)("p",{children:"Thought for a few seconds"}):(0,A.jsxs)("p",{children:["Thought for ",t," seconds"]}),Je=(0,ce.memo)(({className:e,children:t,...o})=>{let{isStreaming:r,isOpen:n,duration:s}=qt();return(0,A.jsx)(Q,{className:h("flex A-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(oe.BrainIcon,{className:"size-4"}),Jt(r,s),(0,A.jsx)(oe.ChevronDownIcon,{className:h("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),Xe=(0,ce.memo)(({className:e,children:t,...o})=>(0,A.jsx)(ee,{className:h("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,A.jsx)(te,{className:"grid gap-2",children:t})}));De.displayName="Reasoning";Je.displayName="ReasoningTrigger";Xe.displayName="ReasoningContent";var Ke=require("class-variance-authority");var Xt=(0,Ke.cva)("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ye({className:e,variant:t,...o}){return(0,A.jsx)("div",{className:h(Xt({variant:t}),e),...o})}var Qe=require("@radix-ui/react-slot"),tt=U(require("react")),Kt=(0,Ke.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 A-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),be=tt.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...n},s)=>(0,A.jsx)(e?Qe.Slot:"button",{className:h(Kt({className:t,size:o,variant:r})),ref:s,...n}));be.displayName="Button";var he=require("react-syntax-highlighter"),ne=require("react-syntax-highlighter/dist/esm/styles/prism"),rt=(0,ce.createContext)({code:""}),D=({code:e,language:t,showLineNumbers:o=!1,className:r,children:n,...s})=>(0,A.jsx)(rt.Provider,{value:{code:e},children:(0,A.jsx)("div",{className:h("relative max-A-2xl overflow-hidden rounded-md border bg-background text-foreground",r),...s,children:(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)(he.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:ne.oneLight,children:e}),(0,A.jsx)(he.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:ne.oneDark,children:e}),n&&(0,A.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})}),Yt=({onCopy:e,onError:t,timeout:o=2e3,children:r,className:n,...s})=>{let[a,i]=(0,ce.useState)(!1),{code:c}=(0,ce.useContext)(rt),d=async()=>{if(typeof window>"A"||!navigator.clipboard.writeText){t?.(new Error("Clipboard API not available"));return}try{await navigator.clipboard.writeText(c),i(!0),e?.(),setTimeout(()=>i(!1),o)}catch(f){t?.(f)}},g=a?oe.CheckIcon:oe.CopyIcon;return(0,A.jsx)(be,{className:h("shrink-0",n),onClick:d,size:"icon",variant:"ghost",...s,children:r??(0,A.jsx)(g,{size:14})})};var Zt=({className:e,...t})=>(0,A.jsx)(Z,{className:h("not-prose mb-4 A-full",e),...t}),Qt=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,A.jsxs)(Ye,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,A.jsx)(oe.CircleIcon,{className:"size-4"}),"input-available":(0,A.jsx)(oe.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,A.jsx)(oe.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,A.jsx)(oe.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},eo=({className:e,type:t,state:o,...r})=>(0,A.jsxs)(Q,{className:h("flex A-full items-center justify-between gap-4 p-3 pl-0 A-2xl",e),...r,children:[(0,A.jsxs)("div",{className:"flex items-center gap-2",children:[(0,A.jsx)(oe.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,A.jsx)("span",{className:"font-medium text-sm",children:t}),Qt(o)]}),(0,A.jsx)(oe.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),to=({className:e,...t})=>(0,A.jsx)(ee,{className:h("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),oo=({className:e,input:t,...o})=>(0,A.jsxs)("div",{className:h("space-y-2 overflow-hidden p-4",e),...o,children:[(0,A.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,A.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,A.jsx)(D,{code:JSON.stringify(t,null,2),language:"json"})})]}),ro=({className:e,output:t,errorText:o,...r})=>{if(!(t||o))return null;let n=(0,A.jsx)("div",{children:t});return typeof t=="object"?n=(0,A.jsx)(D,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,A.jsx)(D,{code:t,language:"json"})),(0,A.jsxs)("div",{className:h("space-y-2 p-4",e),...r,children:[(0,A.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,A.jsxs)("div",{className:h("overflow-x-auto rounded-md text-xs [&_table]:A-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,A.jsx)("div",{children:o}),n]})]})};0&&(module.exports={CodeBlock,CodeBlockCopyButton,PartApprovalTool,PartAuthenticateTool,PartText,Reasoning,ReasoningContent,ReasoningTrigger,Response,Tool,ToolContent,ToolHeader,ToolInput,ToolOutput});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"../../../chunk-EH3PJU6C.mjs";import{a}from"../../../chunk-V5VE3EIY.mjs";import{a as b}from"../../../chunk-6OCLRAHU.mjs";import{a as e,b as f,c as g}from"../../../chunk-5Y6FKL5W.mjs";import{a as d}from"../../../chunk-EW6KWAHS.mjs";import{a as j,b as k,c as l,d as m,e as n}from"../../../chunk-
|
|
1
|
+
import{a as c}from"../../../chunk-EH3PJU6C.mjs";import{a}from"../../../chunk-V5VE3EIY.mjs";import{a as b}from"../../../chunk-6OCLRAHU.mjs";import{a as e,b as f,c as g}from"../../../chunk-5Y6FKL5W.mjs";import{a as d}from"../../../chunk-EW6KWAHS.mjs";import{a as j,b as k,c as l,d as m,e as n}from"../../../chunk-7JDMW5R3.mjs";import"../../../chunk-6OT5PQXV.mjs";import"../../../chunk-QM5FOQHG.mjs";import{a as h,b as i}from"../../../chunk-UA2E23AS.mjs";import"../../../chunk-YNCJATT7.mjs";import"../../../chunk-ZUA4KNIR.mjs";import"../../../chunk-CSBGSBEU.mjs";import"../../../chunk-EGEO3FNE.mjs";import"../../../chunk-MDJREBVI.mjs";import"../../../chunk-ZWHGOTSF.mjs";import"../../../chunk-Q3G5UAAD.mjs";import"../../../chunk-XGRRLABA.mjs";import"../../../chunk-YEKQJ4YC.mjs";export{h as CodeBlock,i as CodeBlockCopyButton,c as PartApprovalTool,a as PartAuthenticateTool,b as PartText,e as Reasoning,g as ReasoningContent,f as ReasoningTrigger,d as Response,j as Tool,l as ToolContent,k as ToolHeader,m as ToolInput,n as ToolOutput};
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
`,children:r?"Processing...":"Deny"}),(0,Lo.jsx)("button",{onClick:w,disabled:r,className:`
|
|
19
19
|
px-4 py-2 text-white border-none rounded text-sm
|
|
20
20
|
${r?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
21
|
-
`,children:"Cancel"})]})]}):null};var ya=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=go.default.useState(!0),[i,r]=go.default.useState(null),s=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),r("approve")},c=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,Lo.jsxs)("div",{className:"mb-2",children:[(0,Lo.jsx)(ha,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Lo.jsxs)(Lo.Fragment,{children:[i==="approve"&&(0,Lo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Lo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Lo.jsx)("svg",{className:"Lo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Lo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Lo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Lo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Lo.jsx)("svg",{className:"Lo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Lo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Lo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var fo=require("@radix-ui/react-use-controllable-state");var nt=V(require("@radix-ui/react-collapsible")),zt=nt.Root,Ut=nt.CollapsibleTrigger,Ft=nt.CollapsibleContent;var wa=require("streamdown"),yt=(0,qa.memo)(({className:e,...t})=>(0,Lo.jsx)(wa.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);yt.displayName="Response";var Na=(0,qa.createContext)(null),lr=()=>{let e=(0,qa.useContext)(Na);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},cr=1e3,dr=1e3,bo=(0,qa.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[c,m]=(0,fo.useControllableState)({prop:o,defaultProp:a,onChange:n}),[w,f]=(0,fo.useControllableState)({prop:i,defaultProp:0}),[y,R]=(0,qa.useState)(!1),[A,T]=(0,qa.useState)(null);(0,qa.useEffect)(()=>{t?A===null&&T(Date.now()):A!==null&&(f(Math.ceil((Date.now()-A)/dr)),T(null))},[t,A,f]),(0,qa.useEffect)(()=>{if(a&&!t&&c&&!y){let N=setTimeout(()=>{m(!1),R(!0)},cr);return()=>clearTimeout(N)}},[t,c,a,m,y]);let C=N=>{m(N)};return(0,Lo.jsx)(Na.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:w},children:(0,Lo.jsx)(zt,{className:l("not-prose mb-4",e),onOpenChange:C,open:c,...s,children:r})})}),pr=(e,t)=>e||t===0?(0,Lo.jsx)("Lo",{children:"Thinking..."}):t===void 0?(0,Lo.jsx)("Lo",{children:"Thought for a few seconds"}):(0,Lo.jsxs)("Lo",{children:["Thought for ",t," seconds"]}),vo=(0,qa.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,duration:i}=lr();return(0,Lo.jsx)(Ut,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Lo.jsxs)(Lo.Fragment,{children:[(0,Lo.jsx)(Wa.BrainIcon,{className:"size-4"}),pr(a,i),(0,Lo.jsx)(Wa.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),ho=(0,qa.memo)(({className:e,children:t,...o})=>(0,Lo.jsx)(Ft,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Lo.jsx)(yt,{className:"grid gap-2",children:t})}));bo.displayName="Reasoning";vo.displayName="ReasoningTrigger";ho.displayName="ReasoningContent";var yo=require("react-syntax-highlighter"),Ot=require("react-syntax-highlighter/dist/esm/styles/prism"),mr=(0,qa.createContext)({code:""}),Vt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:n,...i})=>(0,Lo.jsx)(mr.Provider,{value:{code:e},children:(0,Lo.jsx)("div",{className:l("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,Lo.jsxs)("div",{className:"relative",children:[(0,Lo.jsx)(yo.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Ot.oneLight,children:e}),(0,Lo.jsx)(yo.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Ot.oneDark,children:e}),n&&(0,Lo.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Pa=({className:e,...t})=>(0,Lo.jsx)(zt,{className:l("not-prose mb-4 w-full rounded-md border",e),...t}),ur=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Lo.jsxs)(ae,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Lo.jsx)(Wa.CircleIcon,{className:"size-4"}),"input-available":(0,Lo.jsx)(Wa.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Lo.jsx)(Wa.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Lo.jsx)(Wa.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Ta=({className:e,type:t,state:o,...a})=>(0,Lo.jsxs)(Ut,{className:l("flex w-full items-center justify-between gap-4 Lo-3",e),...a,children:[(0,Lo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Lo.jsx)(Wa.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Lo.jsx)("span",{className:"font-medium text-sm",children:t}),ur(o)]}),(0,Lo.jsx)(Wa.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Da=({className:e,...t})=>(0,Lo.jsx)(Ft,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ra=({className:e,input:t,...o})=>(0,Lo.jsxs)("div",{className:l("space-y-2 overflow-hidden Lo-4",e),...o,children:[(0,Lo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Lo.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Lo.jsx)(Vt,{code:JSON.stringify(t,null,2),language:"json"})})]}),Sa=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let n=(0,Lo.jsx)("div",{children:t});return typeof t=="object"?n=(0,Lo.jsx)(Vt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,Lo.jsx)(Vt,{code:t,language:"json"})),(0,Lo.jsxs)("div",{className:l("space-y-2 Lo-4",e),...a,children:[(0,Lo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Lo.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Lo.jsx)("div",{children:o}),n]})]})};var Ma=require("date-fns");function Aa({taskId:e,polling:t=!0,system:o="payload"}){let[a,n]=(0,qa.useState)(null),[i,r]=(0,qa.useState)(!1),[s,c]=(0,qa.useState)(null),m=async(f=!0)=>{if(e){f&&r(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let R=await y.json();n(R)}catch(y){console.error("Error fetching task:",y),c(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&r(!1)}}},w=()=>m(!1);return(0,qa.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:i,error:s}}var gr=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},fr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Ba({data:e}){let{id:t,system:o,fetchLatest:a,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,c=i,m=a!==void 0?a:!0;if(r=n||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:m,taskData:r,error:c}),m){let{task:R,loading:A,error:T}=Aa({taskId:t,system:o});r=R,s=A,c=T}else s=!1;let w=gr(r?.status||"todo"),f=fr(r?.status||"todo"),y=r?.dateLogged||new Date().toISOString();try{let R=new Date(r?.dateLogged||"");isNaN(R.getTime())||(y=(0,Ma.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Lo.jsxs)(ge,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Lo.jsxs)(Le,{className:"pb-2",children:[(0,Lo.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Lo.jsx)(Ee,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,Lo.jsx)(ae,{className:`${w}`,children:f})]}),r?.project&&(0,Lo.jsxs)(co,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,Lo.jsx)(Pe,{className:"pb-2",children:s?(0,Lo.jsx)("div",{className:"animate-pulse Lo-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Lo.jsx)("Lo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Lo.jsx)("Lo",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,Lo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,Lo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Lo.jsx)(Wa.Clock,{className:"Lo-3 w-3 mr-1"}),(0,Lo.jsxs)("span",{children:["Created ",y]}),(0,Lo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Lo.jsxs)("span",{children:["Task #",t]})]})})]})}function za({artefact:e,taskId:t,taskData:o,loading:a=!1,error:n=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Ma.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Lo.jsxs)(ge,{className:"w-full max-w-md shadow-md",children:[(0,Lo.jsx)(Le,{className:"pb-2",children:(0,Lo.jsx)("div",{className:"flex justify-between items-start",children:(0,Lo.jsx)(Ee,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,Lo.jsx)(Pe,{className:"pb-2",children:a?(0,Lo.jsx)("div",{className:"animate-pulse Lo-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,Lo.jsx)("Lo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Lo.jsx)("Lo",{className:"text-sm text-foreground",children:e})}),(0,Lo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,Lo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Lo.jsx)(Wa.Clock,{className:"Lo-3 w-3 mr-1"}),(0,Lo.jsxs)("span",{children:["Created ",r]}),(0,Lo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Lo.jsxs)("span",{children:["Task #",i.id]})]})})]})}var br=e=>e.startsWith("image/")?(0,Lo.jsx)(Wa.Image,{className:"Lo-4 w-4"}):e.startsWith("text/")?(0,Lo.jsx)(Wa.FileText,{className:"Lo-4 w-4"}):(0,Lo.jsx)(Wa.File,{className:"Lo-4 w-4"}),Ua=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,Lo.jsx)(yt,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,Lo.jsx)("div",{className:"mb-2 Lo-2 bg-background/50 rounded-lg",children:(0,Lo.jsxs)("div",{className:"flex items-center gap-2",children:[br(r.mediaType||"application/octet-stream"),(0,Lo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Lo.jsx)("Lo",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,Lo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"Lo-8 w-8 Lo-0",children:(0,Lo.jsx)(Wa.Download,{className:"Lo-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(s==="task")switch(r.state){case"input-available":return(0,Lo.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(Ba,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,Lo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(uo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(uo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(ya,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,Lo.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(za,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,Lo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsxs)(ge,{className:"w-full max-w-md",children:[(0,Lo.jsx)(Le,{children:(0,Lo.jsx)(Ee,{className:"text-lg",children:s})}),(0,Lo.jsxs)(Pe,{children:[r.state==="input-available"&&(0,Lo.jsxs)("Lo",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,Lo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,Lo.jsxs)("Lo",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(ge,{className:"w-full",children:(0,Lo.jsx)(Pe,{className:"Lo-4",children:(0,Lo.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((c,m)=>(0,Lo.jsxs)("div",{className:"flex items-center gap-2 Lo-2 rounded-md bg-muted/50",children:[(0,Lo.jsx)(ae,{variant:"outline",children:c.type||"link"}),(0,Lo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Lo.jsx)("Lo",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Lo.jsx)("Lo",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Lo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Lo-8 w-8 Lo-0",children:(0,Lo.jsx)(Wa.ExternalLink,{className:"Lo-4 w-4"})})]},m))})})})},i):s==="menu"?(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsxs)(ge,{className:"w-full",children:[(0,Lo.jsx)(Le,{children:(0,Lo.jsx)(Ee,{className:"text-lg",children:r.data?.title})}),(0,Lo.jsx)(Pe,{children:(0,Lo.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((c,m)=>(0,Lo.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Lo.jsxs)("div",{className:"text-left",children:[(0,Lo.jsx)("Lo",{className:"font-medium",children:c.label}),c.description&&(0,Lo.jsx)("Lo",{className:"text-xs text-muted-foreground",children:c.description})]})},m))})})]})},i):(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsxs)(ge,{className:"w-full max-w-md",children:[(0,Lo.jsx)(Le,{children:(0,Lo.jsx)(Ee,{className:"text-lg",children:s})}),(0,Lo.jsx)(Pe,{children:(0,Lo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}return n.type==="reasoning"?(0,Lo.jsxs)(bo,{className:"w-full",isStreaming:o==="streaming"&&i===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Lo.jsx)(vo,{}),(0,Lo.jsx)(ho,{children:n.text})]},`${i}`):n.type==="dynamic-tool"?(0,Lo.jsxs)(Pa,{defaultOpen:!0,children:[(0,Lo.jsx)(Ta,{type:`tool-${n.toolName}`,state:n.state}),(0,Lo.jsxs)(Da,{children:[(0,Lo.jsx)(Ra,{input:n.input}),(0,Lo.jsx)(Sa,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`):(0,Lo.jsxs)(Lo.Fragment,{children:["Unknown part type: ",n.type]})});var Ha=({className:e,from:t,...o})=>(0,Lo.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),vr=(0,Bo.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),ja=({children:e,className:t,variant:o,...a})=>(0,Lo.jsx)("div",{className:l(vr({variant:o,className:t})),...a,children:e});function Oa({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:c,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:y,onRemoveFile:R,onDragOver:A,className:T,status:C="ready"}){let N=(0,qa.useRef)(null),F=(0,qa.useRef)(null),S=(0,qa.useRef)(null),[I,_]=(0,qa.useState)(!1),[$,se]=(0,qa.useState)({path:[],selectedItems:[],filters:{}});(0,qa.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,qa.useEffect)(()=>{I&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[I]);let J=()=>po($),W=()=>{let u=[];return n.forEach(U=>{U.actions&&U.actions.forEach(ve=>{u.push({label:ve.label,action:()=>X(ve.id,{path:[U],selectedItems:[],filters:{}})})}),U.children&&U.children.forEach(ve=>{ve.type==="list"&&ve.data&&u.push({label:`View ${ve.name}`,action:()=>_(!0)})})}),u.slice(0,5)},X=(u,U)=>{console.log("Capability action:",u,U);let ve=`Executing ${u} with context: ${JSON.stringify(U.path.map(Ae=>Ae.name))}`;_(!1)},le=po({path:[],selectedItems:[],filters:{}}),M=u=>{y(u.target.files),u.target.files&&(u.target.value="")},Se=u=>{u.preventDefault(),A(!0)},d=u=>{u.preventDefault(),A(!1)},L=u=>{u.preventDefault(),A(!1),y(u.dataTransfer.files)},E=u=>{if(u===0)return"0 Bytes";let U=1024,ve=["Bytes","KB","MB","GB"],Ae=Math.floor(Math.log(u)/Math.log(U));return parseFloat((u/Math.pow(U,Ae)).toFixed(2))+" "+ve[Ae]},G=u=>u.startsWith("image/")?(0,Lo.jsx)(Wa.Image,{className:"Lo-4 w-4"}):u.startsWith("text/")?(0,Lo.jsx)(Wa.FileText,{className:"Lo-4 w-4"}):(0,Lo.jsx)(Wa.File,{className:"Lo-4 w-4"}),Z={messages:e,currentSessionTitle:a,capabilities:n,currentCapabilityContext:$,contextualActions:le,getQuickSuggestions:W().map(u=>u.label)},be=()=>{navigator.clipboard.writeText(JSON.stringify(Z,null,2)),alert("Debug info copied to clipboard")};return(0,Lo.jsxs)("div",{className:`Lo-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Lo.jsxs)(Ce,{ref:F,className:"flex-1 Lo-4 bg-background border-0",onDragOver:Se,onDragLeave:d,onDrop:L,children:[(0,Lo.jsxs)("div",{className:l("space-y-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Lo.jsx)(lt.animate,{children:e.map(u=>(0,Lo.jsx)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Lo.jsx)(Ha,{from:u.role,children:(0,Lo.jsx)(ja,{variant:"flat",children:Ua({message:u,addToolResult:m??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),I&&(0,Lo.jsxs)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Lo.jsx)(et,{className:"Lo-8 w-8",children:(0,Lo.jsx)(tt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Lo.jsx)(Wa.Bot,{className:"Lo-4 w-4"})})}),(0,Lo.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Lo.jsx)(ga,{capabilities:n,isOpen:I,onToggle:()=>_(!I),onActionSelect:X,className:"w-full"})})]}),o&&(0,Lo.jsxs)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Lo.jsx)(et,{className:"Lo-8 w-8",children:(0,Lo.jsx)(tt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Lo.jsx)(Wa.Bot,{className:"Lo-4 w-4"})})}),(0,Lo.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Lo.jsxs)("div",{className:"flex space-x-1",children:[(0,Lo.jsx)("div",{className:"w-2 Lo-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Lo.jsx)("div",{className:"w-2 Lo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Lo.jsx)("div",{className:"w-2 Lo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Lo.jsx)("div",{ref:N})]}),i.length>0&&(0,Lo.jsx)("div",{className:"Lo-4 border-t bg-muted/10",children:(0,Lo.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(u=>(0,Lo.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg Lo-2 border",children:[G(u.file.type),(0,Lo.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Lo.jsx)("span",{className:"text-xs text-muted-foreground",children:E(u.file.size)}),(0,Lo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>R(u.id),className:"Lo-6 w-6 Lo-0",children:(0,Lo.jsx)(Wa.X,{className:"Lo-4 w-4"})})]},u.id))})}),(0,Lo.jsxs)("div",{className:"border rounded-2xl Lo-4 bg-muted/20",children:[(0,Lo.jsxs)("div",{className:"flex gap-3",children:[(0,Lo.jsx)(gt,{value:t,onChange:u=>c(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Lo.jsx)(D,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl Lo-10 w-10 shadow-sm",children:(0,Lo.jsx)(Wa.Paperclip,{className:"Lo-4 w-4"})}),(0,Lo.jsx)(D,{onClick:w,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl Lo-10 w-10 shadow-sm",children:(0,Lo.jsx)(Wa.Send,{className:"Lo-4 w-4"})})]}),(0,Lo.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Lo.jsxs)(D,{onClick:()=>_(!I),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Lo.jsx)(Wa.Menu,{className:"Lo-3 w-3 mr-1"}),I?"Hide":"Show"," Capabilities"]}),(0,Lo.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[J().map((u,U)=>(0,Lo.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>X(u.id,$),children:u.label},`context-${u.id}`)),J().length===0&&W().map((u,U)=>(0,Lo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${U}`)),(0,Lo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:be,children:"Debug"})]})]}),s&&(0,Lo.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:M,className:"hidden"})]})]})}function Ga({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:c=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:R=()=>{},onNotificationRemove:A=()=>{},onRemoveAll:T=()=>{},onActionClick:C=()=>{},onSearch:N=L=>console.log("Search query:",L),initialTeam:F="design",currentSession:S=null,showCapabilities:I=!0,title:_="Digital Colleagues",enableFileUpload:$=!0,maxFileSize:se=10,allowedFileTypes:J=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:X="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:M=(0,Lo.jsx)(Wa.Users,{className:"mr-2 Lo-4 w-4"}),actionText:Se="Collaborate",sidebarInitiallyClosed:d=!1}){let L={...e,onError:H=>{G?.setMessages(de=>[...de,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:H.message}]}]),console.error("Error in CopilotInterface:",H)}},E=(0,Va.useChat)(L||{}),G=o?t||E:null,[Z,be]=(0,qa.useState)(""),[u,U]=(0,qa.useState)(!1),ve=G?.messages||a,Ae=Z,Ka=G?.status==="submitted"||u,_a=G?.addToolResult?(H,de,oe)=>{G.addToolResult({tool:de,toolCallId:H,output:oe}),G.sendMessage()}:()=>{},dt=n||[],Ja={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Xa,Qa]=(0,qa.useState)(()=>dt.length===0?Ja:dt.find(H=>H.id===F)||dt[0]),[pt,xt]=(0,qa.useState)([]),[Ya,Za]=(0,qa.useState)(!1),ei=H=>{if(!H||!$)return;let de=[];Array.from(H).forEach(oe=>{if(oe.size>se*1024*1024){alert(`File ${oe.name} is too large. Maximum size is ${se}MB.`);return}if(J.length>0&&!J.some(wt=>oe.type.match(wt))){alert(`File type ${oe.type} is not allowed.`);return}let Co={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:oe,status:"pending",progress:0};if(oe.type.startsWith("image/")){let wt=new FileReader;wt.onload=ri=>{xt(ni=>ni.map($t=>$t.id===Co.id?{...$t,preview:ri.target?.result}:$t))},wt.readAsDataURL(oe)}de.push(Co)}),xt(oe=>[...oe,...de])},ti=H=>{xt(de=>de.filter(oe=>oe.id!==H))},wo=()=>{if(!(!Ae.trim()&&pt.length===0)){if(G){let H=pt.length>0?oi(pt.map(de=>de.file)):void 0;G.sendMessage({text:Ae,files:H},{body:{timestamp:Date.now()}}),be("")}else console.log("Message to send:",Ae),console.log("Files to upload:",pt),be(""),U(!0),setTimeout(()=>{U(!1)},1500);xt([])}},oi=H=>{let de=new DataTransfer;return H.forEach(oe=>de.items.add(oe)),de.files},ai=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),wo())},ii=H=>{be(H)};return(0,Lo.jsx)(da,{sidebarItems:r||[],title:_,notifications:s||[],businessUnits:dt,currentBusinessUnit:Xa,onBusinessUnitChange:H=>{H&&(Qa(H),R?.(H))},onSearch:N,showTabs:!1,onActionClick:C,actionIcon:M,actionText:Se,onNotificationRemove:A,onRemoveAll:T,logo:W,appName:X,tagline:le,sidebarInitiallyClosed:d,children:(0,Lo.jsx)(Gt.AnimatePresence,{mode:"wait",children:(0,Lo.jsx)(Gt.motion.div,{className:"flex-1 Lo-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Lo.jsxs)("div",{className:"Lo-full flex",children:[(0,Lo.jsx)("div",{className:"w-80 flex-shrink-0 Lo-full Lo-2",children:(0,Lo.jsx)(pa,{sessions:c||[],currentSession:S,teams:dt,onNewChat:m,onSessionSelect:w,onSessionEdit:y,onSessionDelete:f})}),(0,Lo.jsx)("div",{className:"flex-1 Lo-full Lo-2",children:(0,Lo.jsx)(Oa,{messages:ve||[],input:Ae,isTyping:Ka,currentSessionTitle:S?.title,capabilities:i||[],onInputChange:ii,addToolResult:_a,onSendMessage:wo,onKeyPress:ai,fileUploads:pt,isDragOver:Ya,enableFileUpload:$,onFileUpload:ei,onRemoveFile:ti,onDragOver:Za})})]})},"chat-interface")})})}var $a=[{id:"1",role:"user",parts:[{type:"text",text:"Can you write me a comprehensive analysis of the current state of artificial intelligence and machine learning technologies, including their applications, limitations, and future prospects?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:`Here's a comprehensive analysis of the current state of AI and ML technologies:
|
|
21
|
+
`,children:"Cancel"})]})]}):null};var ya=({toolPart:e,index:t,addToolResult:o})=>{let[a,n]=go.default.useState(!0),[i,r]=go.default.useState(null),s=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),r("approve")},c=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,Lo.jsxs)("div",{className:"mb-2",children:[(0,Lo.jsx)(ha,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Lo.jsxs)(Lo.Fragment,{children:[i==="approve"&&(0,Lo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Lo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Lo.jsx)("svg",{className:"Lo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Lo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,Lo.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Lo.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Lo.jsx)("svg",{className:"Lo-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Lo.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Lo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var fo=require("@radix-ui/react-use-controllable-state");var nt=V(require("@radix-ui/react-collapsible")),zt=nt.Root,Ut=nt.CollapsibleTrigger,Ft=nt.CollapsibleContent;var wa=require("streamdown"),yt=(0,qa.memo)(({className:e,...t})=>(0,Lo.jsx)(wa.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);yt.displayName="Response";var Na=(0,qa.createContext)(null),lr=()=>{let e=(0,qa.useContext)(Na);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},cr=1e3,dr=1e3,bo=(0,qa.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[c,m]=(0,fo.useControllableState)({prop:o,defaultProp:a,onChange:n}),[w,f]=(0,fo.useControllableState)({prop:i,defaultProp:0}),[y,R]=(0,qa.useState)(!1),[A,T]=(0,qa.useState)(null);(0,qa.useEffect)(()=>{t?A===null&&T(Date.now()):A!==null&&(f(Math.ceil((Date.now()-A)/dr)),T(null))},[t,A,f]),(0,qa.useEffect)(()=>{if(a&&!t&&c&&!y){let N=setTimeout(()=>{m(!1),R(!0)},cr);return()=>clearTimeout(N)}},[t,c,a,m,y]);let C=N=>{m(N)};return(0,Lo.jsx)(Na.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:w},children:(0,Lo.jsx)(zt,{className:l("not-prose mb-4",e),onOpenChange:C,open:c,...s,children:r})})}),pr=(e,t)=>e||t===0?(0,Lo.jsx)("Lo",{children:"Thinking..."}):t===void 0?(0,Lo.jsx)("Lo",{children:"Thought for a few seconds"}):(0,Lo.jsxs)("Lo",{children:["Thought for ",t," seconds"]}),vo=(0,qa.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:n,duration:i}=lr();return(0,Lo.jsx)(Ut,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Lo.jsxs)(Lo.Fragment,{children:[(0,Lo.jsx)(Wa.BrainIcon,{className:"size-4"}),pr(a,i),(0,Lo.jsx)(Wa.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),ho=(0,qa.memo)(({className:e,children:t,...o})=>(0,Lo.jsx)(Ft,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Lo.jsx)(yt,{className:"grid gap-2",children:t})}));bo.displayName="Reasoning";vo.displayName="ReasoningTrigger";ho.displayName="ReasoningContent";var yo=require("react-syntax-highlighter"),Ot=require("react-syntax-highlighter/dist/esm/styles/prism"),mr=(0,qa.createContext)({code:""}),Vt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:n,...i})=>(0,Lo.jsx)(mr.Provider,{value:{code:e},children:(0,Lo.jsx)("div",{className:l("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",a),...i,children:(0,Lo.jsxs)("div",{className:"relative",children:[(0,Lo.jsx)(yo.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Ot.oneLight,children:e}),(0,Lo.jsx)(yo.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Ot.oneDark,children:e}),n&&(0,Lo.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Pa=({className:e,...t})=>(0,Lo.jsx)(zt,{className:l("not-prose mb-4 w-full",e),...t}),ur=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Lo.jsxs)(ae,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Lo.jsx)(Wa.CircleIcon,{className:"size-4"}),"input-available":(0,Lo.jsx)(Wa.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Lo.jsx)(Wa.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Lo.jsx)(Wa.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Ta=({className:e,type:t,state:o,...a})=>(0,Lo.jsxs)(Ut,{className:l("flex w-full items-center justify-between gap-4 Lo-3 pl-0 w-2xl",e),...a,children:[(0,Lo.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Lo.jsx)(Wa.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Lo.jsx)("span",{className:"font-medium text-sm",children:t}),ur(o)]}),(0,Lo.jsx)(Wa.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Da=({className:e,...t})=>(0,Lo.jsx)(Ft,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ra=({className:e,input:t,...o})=>(0,Lo.jsxs)("div",{className:l("space-y-2 overflow-hidden Lo-4",e),...o,children:[(0,Lo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Lo.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Lo.jsx)(Vt,{code:JSON.stringify(t,null,2),language:"json"})})]}),Sa=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let n=(0,Lo.jsx)("div",{children:t});return typeof t=="object"?n=(0,Lo.jsx)(Vt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,Lo.jsx)(Vt,{code:t,language:"json"})),(0,Lo.jsxs)("div",{className:l("space-y-2 Lo-4",e),...a,children:[(0,Lo.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Lo.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Lo.jsx)("div",{children:o}),n]})]})};var Ma=require("date-fns");function Aa({taskId:e,polling:t=!0,system:o="payload"}){let[a,n]=(0,qa.useState)(null),[i,r]=(0,qa.useState)(!1),[s,c]=(0,qa.useState)(null),m=async(f=!0)=>{if(e){f&&r(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let R=await y.json();n(R)}catch(y){console.error("Error fetching task:",y),c(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&r(!1)}}},w=()=>m(!1);return(0,qa.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:i,error:s}}var gr=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},fr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Ba({data:e}){let{id:t,system:o,fetchLatest:a,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,c=i,m=a!==void 0?a:!0;if(r=n||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:m,taskData:r,error:c}),m){let{task:R,loading:A,error:T}=Aa({taskId:t,system:o});r=R,s=A,c=T}else s=!1;let w=gr(r?.status||"todo"),f=fr(r?.status||"todo"),y=r?.dateLogged||new Date().toISOString();try{let R=new Date(r?.dateLogged||"");isNaN(R.getTime())||(y=(0,Ma.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Lo.jsxs)(ge,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Lo.jsxs)(Le,{className:"pb-2",children:[(0,Lo.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Lo.jsx)(Ee,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,Lo.jsx)(ae,{className:`${w}`,children:f})]}),r?.project&&(0,Lo.jsxs)(co,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,Lo.jsx)(Pe,{className:"pb-2",children:s?(0,Lo.jsx)("div",{className:"animate-pulse Lo-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Lo.jsx)("Lo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Lo.jsx)("Lo",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,Lo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,Lo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Lo.jsx)(Wa.Clock,{className:"Lo-3 w-3 mr-1"}),(0,Lo.jsxs)("span",{children:["Created ",y]}),(0,Lo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Lo.jsxs)("span",{children:["Task #",t]})]})})]})}function za({artefact:e,taskId:t,taskData:o,loading:a=!1,error:n=null}){let i=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Ma.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Lo.jsxs)(ge,{className:"w-full max-w-md shadow-md",children:[(0,Lo.jsx)(Le,{className:"pb-2",children:(0,Lo.jsx)("div",{className:"flex justify-between items-start",children:(0,Lo.jsx)(Ee,{className:"text-lg font-semibold",children:a?"Loading...":i.name})})}),(0,Lo.jsx)(Pe,{className:"pb-2",children:a?(0,Lo.jsx)("div",{className:"animate-pulse Lo-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,Lo.jsx)("Lo",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Lo.jsx)("Lo",{className:"text-sm text-foreground",children:e})}),(0,Lo.jsx)(ht,{className:"pt-2 flex items-center justify-between",children:(0,Lo.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Lo.jsx)(Wa.Clock,{className:"Lo-3 w-3 mr-1"}),(0,Lo.jsxs)("span",{children:["Created ",r]}),(0,Lo.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Lo.jsxs)("span",{children:["Task #",i.id]})]})})]})}var br=e=>e.startsWith("image/")?(0,Lo.jsx)(Wa.Image,{className:"Lo-4 w-4"}):e.startsWith("text/")?(0,Lo.jsx)(Wa.FileText,{className:"Lo-4 w-4"}):(0,Lo.jsx)(Wa.File,{className:"Lo-4 w-4"}),Ua=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,Lo.jsx)(yt,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,Lo.jsx)("div",{className:"mb-2 Lo-2 bg-background/50 rounded-lg",children:(0,Lo.jsxs)("div",{className:"flex items-center gap-2",children:[br(r.mediaType||"application/octet-stream"),(0,Lo.jsx)("div",{className:"flex-1 min-w-0",children:(0,Lo.jsx)("Lo",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,Lo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"Lo-8 w-8 Lo-0",children:(0,Lo.jsx)(Wa.Download,{className:"Lo-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(s==="task")switch(r.state){case"input-available":return(0,Lo.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(Ba,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,Lo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(uo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(uo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(ya,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,Lo.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(za,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,Lo.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsxs)(ge,{className:"w-full max-w-md",children:[(0,Lo.jsx)(Le,{children:(0,Lo.jsx)(Ee,{className:"text-lg",children:s})}),(0,Lo.jsxs)(Pe,{children:[r.state==="input-available"&&(0,Lo.jsxs)("Lo",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,Lo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,Lo.jsxs)("Lo",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsx)(ge,{className:"w-full",children:(0,Lo.jsx)(Pe,{className:"Lo-4",children:(0,Lo.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((c,m)=>(0,Lo.jsxs)("div",{className:"flex items-center gap-2 Lo-2 rounded-md bg-muted/50",children:[(0,Lo.jsx)(ae,{variant:"outline",children:c.type||"link"}),(0,Lo.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Lo.jsx)("Lo",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Lo.jsx)("Lo",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Lo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Lo-8 w-8 Lo-0",children:(0,Lo.jsx)(Wa.ExternalLink,{className:"Lo-4 w-4"})})]},m))})})})},i):s==="menu"?(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsxs)(ge,{className:"w-full",children:[(0,Lo.jsx)(Le,{children:(0,Lo.jsx)(Ee,{className:"text-lg",children:r.data?.title})}),(0,Lo.jsx)(Pe,{children:(0,Lo.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((c,m)=>(0,Lo.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Lo.jsxs)("div",{className:"text-left",children:[(0,Lo.jsx)("Lo",{className:"font-medium",children:c.label}),c.description&&(0,Lo.jsx)("Lo",{className:"text-xs text-muted-foreground",children:c.description})]})},m))})})]})},i):(0,Lo.jsx)("div",{className:"mb-2",children:(0,Lo.jsxs)(ge,{className:"w-full max-w-md",children:[(0,Lo.jsx)(Le,{children:(0,Lo.jsx)(Ee,{className:"text-lg",children:s})}),(0,Lo.jsx)(Pe,{children:(0,Lo.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}return n.type==="reasoning"?(0,Lo.jsxs)(bo,{className:"w-full",isStreaming:o==="streaming"&&i===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Lo.jsx)(vo,{}),(0,Lo.jsx)(ho,{children:n.text})]},`${i}`):n.type==="dynamic-tool"?(0,Lo.jsxs)(Pa,{defaultOpen:n.state!=="output-available",children:[(0,Lo.jsx)(Ta,{type:`tool-${n.toolName}`,state:n.state}),(0,Lo.jsxs)(Da,{children:[(0,Lo.jsx)(Ra,{input:n.input}),(0,Lo.jsx)(Sa,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`):(0,Lo.jsxs)(Lo.Fragment,{children:["Unknown part type: ",n.type]})});var Ha=({className:e,from:t,...o})=>(0,Lo.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),vr=(0,Bo.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),ja=({children:e,className:t,variant:o,...a})=>(0,Lo.jsx)("div",{className:l(vr({variant:o,className:t})),...a,children:e});function Oa({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:c,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:y,onRemoveFile:R,onDragOver:A,className:T,status:C="ready"}){let N=(0,qa.useRef)(null),F=(0,qa.useRef)(null),S=(0,qa.useRef)(null),[I,_]=(0,qa.useState)(!1),[$,se]=(0,qa.useState)({path:[],selectedItems:[],filters:{}});(0,qa.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,qa.useEffect)(()=>{I&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[I]);let J=()=>po($),W=()=>{let u=[];return n.forEach(U=>{U.actions&&U.actions.forEach(ve=>{u.push({label:ve.label,action:()=>X(ve.id,{path:[U],selectedItems:[],filters:{}})})}),U.children&&U.children.forEach(ve=>{ve.type==="list"&&ve.data&&u.push({label:`View ${ve.name}`,action:()=>_(!0)})})}),u.slice(0,5)},X=(u,U)=>{console.log("Capability action:",u,U);let ve=`Executing ${u} with context: ${JSON.stringify(U.path.map(Ae=>Ae.name))}`;_(!1)},le=po({path:[],selectedItems:[],filters:{}}),M=u=>{y(u.target.files),u.target.files&&(u.target.value="")},Se=u=>{u.preventDefault(),A(!0)},d=u=>{u.preventDefault(),A(!1)},L=u=>{u.preventDefault(),A(!1),y(u.dataTransfer.files)},E=u=>{if(u===0)return"0 Bytes";let U=1024,ve=["Bytes","KB","MB","GB"],Ae=Math.floor(Math.log(u)/Math.log(U));return parseFloat((u/Math.pow(U,Ae)).toFixed(2))+" "+ve[Ae]},G=u=>u.startsWith("image/")?(0,Lo.jsx)(Wa.Image,{className:"Lo-4 w-4"}):u.startsWith("text/")?(0,Lo.jsx)(Wa.FileText,{className:"Lo-4 w-4"}):(0,Lo.jsx)(Wa.File,{className:"Lo-4 w-4"}),Z={messages:e,currentSessionTitle:a,capabilities:n,currentCapabilityContext:$,contextualActions:le,getQuickSuggestions:W().map(u=>u.label)},be=()=>{navigator.clipboard.writeText(JSON.stringify(Z,null,2)),alert("Debug info copied to clipboard")};return(0,Lo.jsxs)("div",{className:`Lo-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Lo.jsxs)(Ce,{ref:F,className:"flex-1 Lo-4 bg-background border-0",onDragOver:Se,onDragLeave:d,onDrop:L,children:[(0,Lo.jsxs)("div",{className:l("space-y-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Lo.jsx)(lt.animate,{children:e.map(u=>(0,Lo.jsx)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Lo.jsx)(Ha,{from:u.role,children:(0,Lo.jsx)(ja,{variant:"flat",children:Ua({message:u,addToolResult:m??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),I&&(0,Lo.jsxs)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Lo.jsx)(et,{className:"Lo-8 w-8",children:(0,Lo.jsx)(tt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Lo.jsx)(Wa.Bot,{className:"Lo-4 w-4"})})}),(0,Lo.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Lo.jsx)(ga,{capabilities:n,isOpen:I,onToggle:()=>_(!I),onActionSelect:X,className:"w-full"})})]}),o&&(0,Lo.jsxs)(lt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Lo.jsx)(et,{className:"Lo-8 w-8",children:(0,Lo.jsx)(tt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Lo.jsx)(Wa.Bot,{className:"Lo-4 w-4"})})}),(0,Lo.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Lo.jsxs)("div",{className:"flex space-x-1",children:[(0,Lo.jsx)("div",{className:"w-2 Lo-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Lo.jsx)("div",{className:"w-2 Lo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Lo.jsx)("div",{className:"w-2 Lo-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Lo.jsx)("div",{ref:N})]}),i.length>0&&(0,Lo.jsx)("div",{className:"Lo-4 border-t bg-muted/10",children:(0,Lo.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(u=>(0,Lo.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg Lo-2 border",children:[G(u.file.type),(0,Lo.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Lo.jsx)("span",{className:"text-xs text-muted-foreground",children:E(u.file.size)}),(0,Lo.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>R(u.id),className:"Lo-6 w-6 Lo-0",children:(0,Lo.jsx)(Wa.X,{className:"Lo-4 w-4"})})]},u.id))})}),(0,Lo.jsxs)("div",{className:"border rounded-2xl Lo-4 bg-muted/20",children:[(0,Lo.jsxs)("div",{className:"flex gap-3",children:[(0,Lo.jsx)(gt,{value:t,onChange:u=>c(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Lo.jsx)(D,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl Lo-10 w-10 shadow-sm",children:(0,Lo.jsx)(Wa.Paperclip,{className:"Lo-4 w-4"})}),(0,Lo.jsx)(D,{onClick:w,disabled:!t.trim()&&i.length===0||o,size:"icon",className:"rounded-2xl Lo-10 w-10 shadow-sm",children:(0,Lo.jsx)(Wa.Send,{className:"Lo-4 w-4"})})]}),(0,Lo.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Lo.jsxs)(D,{onClick:()=>_(!I),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Lo.jsx)(Wa.Menu,{className:"Lo-3 w-3 mr-1"}),I?"Hide":"Show"," Capabilities"]}),(0,Lo.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[J().map((u,U)=>(0,Lo.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>X(u.id,$),children:u.label},`context-${u.id}`)),J().length===0&&W().map((u,U)=>(0,Lo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${U}`)),(0,Lo.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:be,children:"Debug"})]})]}),s&&(0,Lo.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:M,className:"hidden"})]})]})}function Ga({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:c=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:R=()=>{},onNotificationRemove:A=()=>{},onRemoveAll:T=()=>{},onActionClick:C=()=>{},onSearch:N=L=>console.log("Search query:",L),initialTeam:F="design",currentSession:S=null,showCapabilities:I=!0,title:_="Digital Colleagues",enableFileUpload:$=!0,maxFileSize:se=10,allowedFileTypes:J=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:X="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:M=(0,Lo.jsx)(Wa.Users,{className:"mr-2 Lo-4 w-4"}),actionText:Se="Collaborate",sidebarInitiallyClosed:d=!1}){let L={...e,onError:H=>{G?.setMessages(de=>[...de,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:H.message}]}]),console.error("Error in CopilotInterface:",H)}},E=(0,Va.useChat)(L||{}),G=o?t||E:null,[Z,be]=(0,qa.useState)(""),[u,U]=(0,qa.useState)(!1),ve=G?.messages||a,Ae=Z,Ka=G?.status==="submitted"||u,_a=G?.addToolResult?(H,de,oe)=>{G.addToolResult({tool:de,toolCallId:H,output:oe}),G.sendMessage()}:()=>{},dt=n||[],Ja={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Xa,Qa]=(0,qa.useState)(()=>dt.length===0?Ja:dt.find(H=>H.id===F)||dt[0]),[pt,xt]=(0,qa.useState)([]),[Ya,Za]=(0,qa.useState)(!1),ei=H=>{if(!H||!$)return;let de=[];Array.from(H).forEach(oe=>{if(oe.size>se*1024*1024){alert(`File ${oe.name} is too large. Maximum size is ${se}MB.`);return}if(J.length>0&&!J.some(wt=>oe.type.match(wt))){alert(`File type ${oe.type} is not allowed.`);return}let Co={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:oe,status:"pending",progress:0};if(oe.type.startsWith("image/")){let wt=new FileReader;wt.onload=ri=>{xt(ni=>ni.map($t=>$t.id===Co.id?{...$t,preview:ri.target?.result}:$t))},wt.readAsDataURL(oe)}de.push(Co)}),xt(oe=>[...oe,...de])},ti=H=>{xt(de=>de.filter(oe=>oe.id!==H))},wo=()=>{if(!(!Ae.trim()&&pt.length===0)){if(G){let H=pt.length>0?oi(pt.map(de=>de.file)):void 0;G.sendMessage({text:Ae,files:H},{body:{timestamp:Date.now()}}),be("")}else console.log("Message to send:",Ae),console.log("Files to upload:",pt),be(""),U(!0),setTimeout(()=>{U(!1)},1500);xt([])}},oi=H=>{let de=new DataTransfer;return H.forEach(oe=>de.items.add(oe)),de.files},ai=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),wo())},ii=H=>{be(H)};return(0,Lo.jsx)(da,{sidebarItems:r||[],title:_,notifications:s||[],businessUnits:dt,currentBusinessUnit:Xa,onBusinessUnitChange:H=>{H&&(Qa(H),R?.(H))},onSearch:N,showTabs:!1,onActionClick:C,actionIcon:M,actionText:Se,onNotificationRemove:A,onRemoveAll:T,logo:W,appName:X,tagline:le,sidebarInitiallyClosed:d,children:(0,Lo.jsx)(Gt.AnimatePresence,{mode:"wait",children:(0,Lo.jsx)(Gt.motion.div,{className:"flex-1 Lo-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Lo.jsxs)("div",{className:"Lo-full flex",children:[(0,Lo.jsx)("div",{className:"w-80 flex-shrink-0 Lo-full Lo-2",children:(0,Lo.jsx)(pa,{sessions:c||[],currentSession:S,teams:dt,onNewChat:m,onSessionSelect:w,onSessionEdit:y,onSessionDelete:f})}),(0,Lo.jsx)("div",{className:"flex-1 Lo-full Lo-2",children:(0,Lo.jsx)(Oa,{messages:ve||[],input:Ae,isTyping:Ka,currentSessionTitle:S?.title,capabilities:i||[],onInputChange:ii,addToolResult:_a,onSendMessage:wo,onKeyPress:ai,fileUploads:pt,isDragOver:Ya,enableFileUpload:$,onFileUpload:ei,onRemoveFile:ti,onDragOver:Za})})]})},"chat-interface")})})}var $a=[{id:"1",role:"user",parts:[{type:"text",text:"Can you write me a comprehensive analysis of the current state of artificial intelligence and machine learning technologies, including their applications, limitations, and future prospects?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:`Here's a comprehensive analysis of the current state of AI and ML technologies:
|
|
22
22
|
|
|
23
23
|
**Current State of Artificial Intelligence and Machine Learning**
|
|
24
24
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-7JX3L2MA.mjs";import"../../chunk-CTTBF7F4.mjs";import"../../chunk-56X4PU43.mjs";import"../../chunk-DEVPAZSJ.mjs";import"../../chunk-QADUAIFH.mjs";import"../../chunk-EH3PJU6C.mjs";import"../../chunk-V5VE3EIY.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-5Y6FKL5W.mjs";import"../../chunk-EW6KWAHS.mjs";import"../../chunk-7JDMW5R3.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-YPZAYXNQ.mjs";import"../../chunk-7TSR2LQB.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-UA2E23AS.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-RL6365DN.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-4WA47ZQA.mjs";import"../../chunk-NPVUICIF.mjs";import"../../chunk-VDN4LQSS.mjs";import"../../chunk-FGEFYI5E.mjs";import"../../chunk-MU5WPW4N.mjs";import"../../chunk-AZKOVKSK.mjs";import{b as e}from"../../chunk-Q2DPE66H.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-YEKQJ4YC.mjs";import{useState as r}from"react";import{jsx as i}from"react/jsx-runtime";var n=[{id:"1",role:"user",parts:[{type:"text",text:"Can you write me a comprehensive analysis of the current state of artificial intelligence and machine learning technologies, including their applications, limitations, and future prospects?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:`Here's a comprehensive analysis of the current state of AI and ML technologies:
|
|
2
2
|
|
|
3
3
|
**Current State of Artificial Intelligence and Machine Learning**
|
|
4
4
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
`,children:r?"Processing...":"Deny"}),(0,La.jsx)("button",{onClick:w,disabled:r,className:`
|
|
19
19
|
px-4 py-2 text-white border-none rounded text-sm
|
|
20
20
|
${r?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
21
|
-
`,children:"Cancel"})]})]}):null};var wo=({toolPart:e,index:t,addToolResult:a})=>{let[o,n]=ba.default.useState(!0),[i,r]=ba.default.useState(null),s=()=>{a(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),r("approve")},d=()=>{a(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,La.jsxs)("div",{className:"mb-2",children:[(0,La.jsx)(xo,{isOpen:o,onApprove:s,onDeny:d,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,La.jsxs)(La.Fragment,{children:[i==="approve"&&(0,La.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,La.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,La.jsx)("svg",{className:"La-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,La.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,La.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,La.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,La.jsx)("svg",{className:"La-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,La.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,La.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var ha=require("@radix-ui/react-use-controllable-state");var ct=j(require("@radix-ui/react-collapsible")),Ht=ct.Root,Ot=ct.CollapsibleTrigger,jt=ct.CollapsibleContent;var No=require("streamdown"),Nt=(0,tt.memo)(({className:e,...t})=>(0,La.jsx)(No.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Nt.displayName="Response";var Po=(0,tt.createContext)(null),sr=()=>{let e=(0,tt.useContext)(Po);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},lr=1e3,dr=1e3,ya=(0,tt.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[d,m]=(0,ha.useControllableState)({prop:a,defaultProp:o,onChange:n}),[w,f]=(0,ha.useControllableState)({prop:i,defaultProp:0}),[y,D]=(0,tt.useState)(!1),[A,T]=(0,tt.useState)(null);(0,tt.useEffect)(()=>{t?A===null&&T(Date.now()):A!==null&&(f(Math.ceil((Date.now()-A)/dr)),T(null))},[t,A,f]),(0,tt.useEffect)(()=>{if(o&&!t&&d&&!y){let N=setTimeout(()=>{m(!1),D(!0)},lr);return()=>clearTimeout(N)}},[t,d,o,m,y]);let C=N=>{m(N)};return(0,La.jsx)(Po.Provider,{value:{isStreaming:t,isOpen:d,setIsOpen:m,duration:w},children:(0,La.jsx)(Ht,{className:l("not-prose mb-4",e),onOpenChange:C,open:d,...s,children:r})})}),cr=(e,t)=>e||t===0?(0,La.jsx)("La",{children:"Thinking..."}):t===void 0?(0,La.jsx)("La",{children:"Thought for a few seconds"}):(0,La.jsxs)("La",{children:["Thought for ",t," seconds"]}),xa=(0,tt.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:n,duration:i}=sr();return(0,La.jsx)(Ot,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,La.jsxs)(La.Fragment,{children:[(0,La.jsx)(Go.BrainIcon,{className:"size-4"}),cr(o,i),(0,La.jsx)(Go.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),wa=(0,tt.memo)(({className:e,children:t,...a})=>(0,La.jsx)(jt,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...a,children:(0,La.jsx)(Nt,{className:"grid gap-2",children:t})}));ya.displayName="Reasoning";xa.displayName="ReasoningTrigger";wa.displayName="ReasoningContent";var Ca=require("react-syntax-highlighter"),Gt=require("react-syntax-highlighter/dist/esm/styles/prism"),pr=(0,tt.createContext)({code:""}),$t=({code:e,language:t,showLineNumbers:a=!1,className:o,children:n,...i})=>(0,La.jsx)(pr.Provider,{value:{code:e},children:(0,La.jsx)("div",{className:l("relative w-full overflow-hidden rounded-md border bg-background text-foreground",o),...i,children:(0,La.jsxs)("div",{className:"relative",children:[(0,La.jsx)(Ca.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:a,style:Gt.oneLight,children:e}),(0,La.jsx)(Ca.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:a,style:Gt.oneDark,children:e}),n&&(0,La.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Ro=({className:e,...t})=>(0,La.jsx)(Ht,{className:l("not-prose mb-4 w-full rounded-md border",e),...t}),mr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,La.jsxs)(oe,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,La.jsx)(Go.CircleIcon,{className:"size-4"}),"input-available":(0,La.jsx)(Go.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,La.jsx)(Go.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,La.jsx)(Go.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Do=({className:e,type:t,state:a,...o})=>(0,La.jsxs)(Ot,{className:l("flex w-full items-center justify-between gap-4 La-3",e),...o,children:[(0,La.jsxs)("div",{className:"flex items-center gap-2",children:[(0,La.jsx)(Go.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,La.jsx)("span",{className:"font-medium text-sm",children:t}),mr(a)]}),(0,La.jsx)(Go.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),So=({className:e,...t})=>(0,La.jsx)(jt,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ao=({className:e,input:t,...a})=>(0,La.jsxs)("div",{className:l("space-y-2 overflow-hidden La-4",e),...a,children:[(0,La.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,La.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,La.jsx)($t,{code:JSON.stringify(t,null,2),language:"json"})})]}),Io=({className:e,output:t,errorText:a,...o})=>{if(!(t||a))return null;let n=(0,La.jsx)("div",{children:t});return typeof t=="object"?n=(0,La.jsx)($t,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,La.jsx)($t,{code:t,language:"json"})),(0,La.jsxs)("div",{className:l("space-y-2 La-4",e),...o,children:[(0,La.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:a?"Error":"Result"}),(0,La.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&(0,La.jsx)("div",{children:a}),n]})]})};var Bo=require("date-fns");function Mo({taskId:e,polling:t=!0,system:a="payload"}){let[o,n]=(0,tt.useState)(null),[i,r]=(0,tt.useState)(!1),[s,d]=(0,tt.useState)(null),m=async(f=!0)=>{if(e){f&&r(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let D=await y.json();n(D)}catch(y){console.error("Error fetching task:",y),d(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&r(!1)}}},w=()=>m(!1);return(0,tt.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:o,loading:i,error:s}}var ur=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},gr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Uo({data:e}){let{id:t,system:a,fetchLatest:o,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,d=i,m=o!==void 0?o:!0;if(r=n||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:r,error:d}),m){let{task:D,loading:A,error:T}=Mo({taskId:t,system:a});r=D,s=A,d=T}else s=!1;let w=ur(r?.status||"todo"),f=gr(r?.status||"todo"),y=r?.dateLogged||new Date().toISOString();try{let D=new Date(r?.dateLogged||"");isNaN(D.getTime())||(y=(0,Bo.formatDistanceToNow)(D,{addSuffix:!0}))}catch{}return(0,La.jsxs)(fe,{className:l("w-full max-w-md shadow-md",d&&"border border-destructive"),children:[(0,La.jsxs)(Ue,{className:"pb-2",children:[(0,La.jsxs)("div",{className:"flex justify-between items-start",children:[(0,La.jsx)(Le,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,La.jsx)(oe,{className:`${w}`,children:f})]}),r?.project&&(0,La.jsxs)(ua,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,La.jsx)(Te,{className:"pb-2",children:s?(0,La.jsx)("div",{className:"animate-pulse La-4 bg-gray-200 rounded w-3/4 mb-2"}):d?(0,La.jsx)("La",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,La.jsx)("La",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,La.jsx)(Ct,{className:"tt-2 flex items-center justify-between",children:(0,La.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,La.jsx)(Go.Clock,{className:"La-3 w-3 mr-1"}),(0,La.jsxs)("span",{children:["Created ",y]}),(0,La.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,La.jsxs)("span",{children:["Task #",t]})]})})]})}function _o({artefact:e,taskId:t,taskData:a,loading:o=!1,error:n=null}){let i=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Bo.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,La.jsxs)(fe,{className:"w-full max-w-md shadow-md",children:[(0,La.jsx)(Ue,{className:"pb-2",children:(0,La.jsx)("div",{className:"flex justify-between items-start",children:(0,La.jsx)(Le,{className:"text-lg font-semibold",children:o?"Loading...":i.name})})}),(0,La.jsx)(Te,{className:"pb-2",children:o?(0,La.jsx)("div",{className:"animate-pulse La-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,La.jsx)("La",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,La.jsx)("La",{className:"text-sm text-foreground",children:e})}),(0,La.jsx)(Ct,{className:"tt-2 flex items-center justify-between",children:(0,La.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,La.jsx)(Go.Clock,{className:"La-3 w-3 mr-1"}),(0,La.jsxs)("span",{children:["Created ",r]}),(0,La.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,La.jsxs)("span",{children:["Task #",i.id]})]})})]})}var fr=e=>e.startsWith("image/")?(0,La.jsx)(Go.Image,{className:"La-4 w-4"}):e.startsWith("text/")?(0,La.jsx)(Go.FileText,{className:"La-4 w-4"}):(0,La.jsx)(Go.File,{className:"La-4 w-4"}),Fo=({message:e,addToolResult:t,status:a,messages:o})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,La.jsx)(Nt,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,La.jsx)("div",{className:"mb-2 La-2 bg-background/50 rounded-lg",children:(0,La.jsxs)("div",{className:"flex items-center gap-2",children:[fr(r.mediaType||"application/octet-stream"),(0,La.jsx)("div",{className:"flex-1 min-w-0",children:(0,La.jsx)("La",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,La.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"La-8 w-8 La-0",children:(0,La.jsx)(Go.Download,{className:"La-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(s==="task")switch(r.state){case"input-available":return(0,La.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(Uo,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,La.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(va,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(va,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(wo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,La.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(_o,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,La.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsxs)(fe,{className:"w-full max-w-md",children:[(0,La.jsx)(Ue,{children:(0,La.jsx)(Le,{className:"text-lg",children:s})}),(0,La.jsxs)(Te,{children:[r.state==="input-available"&&(0,La.jsxs)("La",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,La.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,La.jsxs)("La",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(fe,{className:"w-full",children:(0,La.jsx)(Te,{className:"La-4",children:(0,La.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((d,m)=>(0,La.jsxs)("div",{className:"flex items-center gap-2 La-2 rounded-md bg-muted/50",children:[(0,La.jsx)(oe,{variant:"outline",children:d.type||"link"}),(0,La.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,La.jsx)("La",{className:"text-sm font-medium truncate",children:d.title}),d.description&&(0,La.jsx)("La",{className:"text-xs text-muted-foreground truncate",children:d.description})]}),d.url&&(0,La.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>window.open(d.url,"_blank"),className:"La-8 w-8 La-0",children:(0,La.jsx)(Go.ExternalLink,{className:"La-4 w-4"})})]},m))})})})},i):s==="menu"?(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsxs)(fe,{className:"w-full",children:[(0,La.jsx)(Ue,{children:(0,La.jsx)(Le,{className:"text-lg",children:r.data?.title})}),(0,La.jsx)(Te,{children:(0,La.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((d,m)=>(0,La.jsx)(R,{variant:"outline",className:"w-full justify-start",onClick:d.action,children:(0,La.jsxs)("div",{className:"text-left",children:[(0,La.jsx)("La",{className:"font-medium",children:d.label}),d.description&&(0,La.jsx)("La",{className:"text-xs text-muted-foreground",children:d.description})]})},m))})})]})},i):(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsxs)(fe,{className:"w-full max-w-md",children:[(0,La.jsx)(Ue,{children:(0,La.jsx)(Le,{className:"text-lg",children:s})}),(0,La.jsx)(Te,{children:(0,La.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}return n.type==="reasoning"?(0,La.jsxs)(ya,{className:"w-full",isStreaming:a==="streaming"&&i===e.parts.length-1&&e.id===o.at(-1)?.id,children:[(0,La.jsx)(xa,{}),(0,La.jsx)(wa,{children:n.text})]},`${i}`):n.type==="dynamic-tool"?(0,La.jsxs)(Ro,{defaultOpen:!0,children:[(0,La.jsx)(Do,{type:`tool-${n.toolName}`,state:n.state}),(0,La.jsxs)(So,{children:[(0,La.jsx)(Ao,{input:n.input}),(0,La.jsx)(Io,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`):(0,La.jsxs)(La.Fragment,{children:["Unknown part type: ",n.type]})});var Oo=({className:e,from:t,...a})=>(0,La.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...a}),vr=(0,Ua.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),jo=({children:e,className:t,variant:a,...o})=>(0,La.jsx)("div",{className:l(vr({variant:a,className:t})),...o,children:e});function Wo({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:d,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:y,onRemoveFile:D,onDragOver:A,className:T,status:C="ready"}){let N=(0,tt.useRef)(null),_=(0,tt.useRef)(null),S=(0,tt.useRef)(null),[I,K]=(0,tt.useState)(!1),[G,se]=(0,tt.useState)({path:[],selectedItems:[],filters:{}});(0,tt.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,tt.useEffect)(()=>{I&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[I]);let J=()=>ga(G),W=()=>{let u=[];return n.forEach(z=>{z.actions&&z.actions.forEach(he=>{u.push({label:he.label,action:()=>Q(he.id,{path:[z],selectedItems:[],filters:{}})})}),z.children&&z.children.forEach(he=>{he.type==="list"&&he.data&&u.push({label:`View ${he.name}`,action:()=>K(!0)})})}),u.slice(0,5)},Q=(u,z)=>{console.log("Capability action:",u,z);let he=`Executing ${u} with context: ${JSON.stringify(z.path.map(Ie=>Ie.name))}`;K(!1)},le=ga({path:[],selectedItems:[],filters:{}}),M=u=>{y(u.target.files),u.target.files&&(u.target.value="")},Ae=u=>{u.preventDefault(),A(!0)},c=u=>{u.preventDefault(),A(!1)},B=u=>{u.preventDefault(),A(!1),y(u.dataTransfer.files)},U=u=>{if(u===0)return"0 Bytes";let z=1024,he=["Bytes","KB","MB","GB"],Ie=Math.floor(Math.log(u)/Math.log(z));return parseFloat((u/Math.pow(z,Ie)).toFixed(2))+" "+he[Ie]},V=u=>u.startsWith("image/")?(0,La.jsx)(Go.Image,{className:"La-4 w-4"}):u.startsWith("text/")?(0,La.jsx)(Go.FileText,{className:"La-4 w-4"}):(0,La.jsx)(Go.File,{className:"La-4 w-4"}),Z={messages:e,currentSessionTitle:o,capabilities:n,currentCapabilityContext:G,contextualActions:le,getQuickSuggestions:W().map(u=>u.label)},be=()=>{navigator.clipboard.writeText(JSON.stringify(Z,null,2)),alert("Debug info copied to clipboard")};return(0,La.jsxs)("div",{className:`La-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,La.jsxs)(Ne,{ref:_,className:"flex-1 La-4 bg-background border-0",onDragOver:Ae,onDragLeave:c,onDrop:B,children:[(0,La.jsxs)("div",{className:l("space-y-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,La.jsx)(mt.animate,{children:e.map(u=>(0,La.jsx)(mt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,La.jsx)(Oo,{from:u.role,children:(0,La.jsx)(jo,{variant:"flat",children:Fo({message:u,addToolResult:m??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),I&&(0,La.jsxs)(mt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,La.jsx)(it,{className:"La-8 w-8",children:(0,La.jsx)(rt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,La.jsx)(Go.Bot,{className:"La-4 w-4"})})}),(0,La.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,La.jsx)(vo,{capabilities:n,isOpen:I,onToggle:()=>K(!I),onActionSelect:Q,className:"w-full"})})]}),a&&(0,La.jsxs)(mt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,La.jsx)(it,{className:"La-8 w-8",children:(0,La.jsx)(rt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,La.jsx)(Go.Bot,{className:"La-4 w-4"})})}),(0,La.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,La.jsxs)("div",{className:"flex space-x-1",children:[(0,La.jsx)("div",{className:"w-2 La-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,La.jsx)("div",{className:"w-2 La-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,La.jsx)("div",{className:"w-2 La-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,La.jsx)("div",{ref:N})]}),i.length>0&&(0,La.jsx)("div",{className:"La-4 border-t bg-muted/10",children:(0,La.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(u=>(0,La.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg La-2 border",children:[V(u.file.type),(0,La.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,La.jsx)("span",{className:"text-xs text-muted-foreground",children:U(u.file.size)}),(0,La.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>D(u.id),className:"La-6 w-6 La-0",children:(0,La.jsx)(Go.La,{className:"La-4 w-4"})})]},u.id))})}),(0,La.jsxs)("div",{className:"border rounded-2xl La-4 bg-muted/20",children:[(0,La.jsxs)("div",{className:"flex gap-3",children:[(0,La.jsx)(ht,{value:t,onChange:u=>d(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),s&&(0,La.jsx)(R,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl La-10 w-10 shadow-sm",children:(0,La.jsx)(Go.Paperclip,{className:"La-4 w-4"})}),(0,La.jsx)(R,{onClick:w,disabled:!t.trim()&&i.length===0||a,size:"icon",className:"rounded-2xl La-10 w-10 shadow-sm",children:(0,La.jsx)(Go.Send,{className:"La-4 w-4"})})]}),(0,La.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,La.jsxs)(R,{onClick:()=>K(!I),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,La.jsx)(Go.Menu,{className:"La-3 w-3 mr-1"}),I?"Hide":"Show"," Capabilities"]}),(0,La.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[J().map((u,z)=>(0,La.jsx)(R,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>Q(u.id,G),children:u.label},`context-${u.id}`)),J().length===0&&W().map((u,z)=>(0,La.jsx)(R,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${z}`)),(0,La.jsx)(R,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:be,children:"Debug"})]})]}),s&&(0,La.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:M,className:"hidden"})]})]})}function et({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:d=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:D=()=>{},onNotificationRemove:A=()=>{},onRemoveAll:T=()=>{},onActionClick:C=()=>{},onSearch:N=B=>console.log("Search query:",B),initialTeam:_="design",currentSession:S=null,showCapabilities:I=!0,title:K="Digital Colleagues",enableFileUpload:G=!0,maxFileSize:se=10,allowedFileTypes:J=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:Q="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:M=(0,La.jsx)(Go.Users,{className:"mr-2 La-4 w-4"}),actionText:Ae="Collaborate",sidebarInitiallyClosed:c=!1}){let B={...e,onError:F=>{V?.setMessages(ce=>[...ce,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:F.message}]}]),console.error("Error in CopilotInterface:",F)}},U=(0,Vo.useChat)(B||{}),V=a?t||U:null,[Z,be]=(0,tt.useState)(""),[u,z]=(0,tt.useState)(!1),he=V?.messages||o,Ie=Z,$o=V?.status==="submitted"||u,qo=V?.addToolResult?(F,ce,ae)=>{V.addToolResult({tool:ce,toolCallId:F,output:ae}),V.sendMessage()}:()=>{},gt=n||[],Ko={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Jo,Qo]=(0,tt.useState)(()=>gt.length===0?Ko:gt.find(F=>F.id===_)||gt[0]),[ft,kt]=(0,tt.useState)([]),[Xo,Yo]=(0,tt.useState)(!1),Zo=F=>{if(!F||!G)return;let ce=[];Array.from(F).forEach(ae=>{if(ae.size>se*1024*1024){alert(`File ${ae.name} is too large. Maximum size is ${se}MB.`);return}if(J.length>0&&!J.some(Pt=>ae.type.match(Pt))){alert(`File type ${ae.type} is not allowed.`);return}let ka={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ae,status:"pending",progress:0};if(ae.type.startsWith("image/")){let Pt=new FileReader;Pt.onload=ii=>{kt(ri=>ri.map(Jt=>Jt.id===ka.id?{...Jt,preview:ii.target?.result}:Jt))},Pt.readAsDataURL(ae)}ce.push(ka)}),kt(ae=>[...ae,...ce])},ei=F=>{kt(ce=>ce.filter(ae=>ae.id!==F))},Na=()=>{if(!(!Ie.trim()&&ft.length===0)){if(V){let F=ft.length>0?ti(ft.map(ce=>ce.file)):void 0;V.sendMessage({text:Ie,files:F},{body:{timestamp:Date.now()}}),be("")}else console.log("Message to send:",Ie),console.log("Files to upload:",ft),be(""),z(!0),setTimeout(()=>{z(!1)},1500);kt([])}},ti=F=>{let ce=new DataTransfer;return F.forEach(ae=>ce.items.add(ae)),ce.files},ai=F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),Na())},oi=F=>{be(F)};return(0,La.jsx)(uo,{sidebarItems:r||[],title:K,notifications:s||[],businessUnits:gt,currentBusinessUnit:Jo,onBusinessUnitChange:F=>{F&&(Qo(F),D?.(F))},onSearch:N,showTabs:!1,onActionClick:C,actionIcon:M,actionText:Ae,onNotificationRemove:A,onRemoveAll:T,logo:W,appName:Q,tagline:le,sidebarInitiallyClosed:c,children:(0,La.jsx)(Kt.AnimatePresence,{mode:"wait",children:(0,La.jsx)(Kt.motion.div,{className:"flex-1 La-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,La.jsxs)("div",{className:"La-full flex",children:[(0,La.jsx)("div",{className:"w-80 flex-shrink-0 La-full La-2",children:(0,La.jsx)(go,{sessions:d||[],currentSession:S,teams:gt,onNewChat:m,onSessionSelect:w,onSessionEdit:y,onSessionDelete:f})}),(0,La.jsx)("div",{className:"flex-1 La-full La-2",children:(0,La.jsx)(Wo,{messages:he||[],input:Ie,isTyping:$o,currentSessionTitle:S?.title,capabilities:i||[],onInputChange:oi,addToolResult:qo,onSendMessage:Na,onKeyPress:ai,fileUploads:ft,isDragOver:Xo,enableFileUpload:G,onFileUpload:Zo,onRemoveFile:ei,onDragOver:Yo})})]})},"chat-interface")})})}function br(){let[e,t]=(0,tt.useState)([{id:"1",role:"user",parts:[{type:"text",text:"Can you help La analyze my sales data?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:`I'll help you analyze your sales data. Let La fetch the latest information.
|
|
21
|
+
`,children:"Cancel"})]})]}):null};var wo=({toolPart:e,index:t,addToolResult:a})=>{let[o,n]=ba.default.useState(!0),[i,r]=ba.default.useState(null),s=()=>{a(e.input?.toolCallId,e.input?.tool,"Approved"),n(!1),r("approve")},d=()=>{a(e.input?.toolCallId,e.input?.tool,"Denied"),n(!1),r("deny")};switch(e.state){case"input-available":return(0,La.jsxs)("div",{className:"mb-2",children:[(0,La.jsx)(xo,{isOpen:o,onApprove:s,onDeny:d,onClose:()=>n(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,La.jsxs)(La.Fragment,{children:[i==="approve"&&(0,La.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,La.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,La.jsx)("svg",{className:"La-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,La.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),i==="deny"&&(0,La.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,La.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,La.jsx)("svg",{className:"La-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,La.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,La.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var ha=require("@radix-ui/react-use-controllable-state");var ct=j(require("@radix-ui/react-collapsible")),Ht=ct.Root,Ot=ct.CollapsibleTrigger,jt=ct.CollapsibleContent;var No=require("streamdown"),Nt=(0,tt.memo)(({className:e,...t})=>(0,La.jsx)(No.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Nt.displayName="Response";var Po=(0,tt.createContext)(null),sr=()=>{let e=(0,tt.useContext)(Po);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},lr=1e3,dr=1e3,ya=(0,tt.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:n,duration:i,children:r,...s})=>{let[d,m]=(0,ha.useControllableState)({prop:a,defaultProp:o,onChange:n}),[w,f]=(0,ha.useControllableState)({prop:i,defaultProp:0}),[y,D]=(0,tt.useState)(!1),[A,T]=(0,tt.useState)(null);(0,tt.useEffect)(()=>{t?A===null&&T(Date.now()):A!==null&&(f(Math.ceil((Date.now()-A)/dr)),T(null))},[t,A,f]),(0,tt.useEffect)(()=>{if(o&&!t&&d&&!y){let N=setTimeout(()=>{m(!1),D(!0)},lr);return()=>clearTimeout(N)}},[t,d,o,m,y]);let C=N=>{m(N)};return(0,La.jsx)(Po.Provider,{value:{isStreaming:t,isOpen:d,setIsOpen:m,duration:w},children:(0,La.jsx)(Ht,{className:l("not-prose mb-4",e),onOpenChange:C,open:d,...s,children:r})})}),cr=(e,t)=>e||t===0?(0,La.jsx)("La",{children:"Thinking..."}):t===void 0?(0,La.jsx)("La",{children:"Thought for a few seconds"}):(0,La.jsxs)("La",{children:["Thought for ",t," seconds"]}),xa=(0,tt.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:n,duration:i}=sr();return(0,La.jsx)(Ot,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,La.jsxs)(La.Fragment,{children:[(0,La.jsx)(Go.BrainIcon,{className:"size-4"}),cr(o,i),(0,La.jsx)(Go.ChevronDownIcon,{className:l("size-4 transition-transform",n?"rotate-180":"rotate-0")})]})})}),wa=(0,tt.memo)(({className:e,children:t,...a})=>(0,La.jsx)(jt,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...a,children:(0,La.jsx)(Nt,{className:"grid gap-2",children:t})}));ya.displayName="Reasoning";xa.displayName="ReasoningTrigger";wa.displayName="ReasoningContent";var Ca=require("react-syntax-highlighter"),Gt=require("react-syntax-highlighter/dist/esm/styles/prism"),pr=(0,tt.createContext)({code:""}),$t=({code:e,language:t,showLineNumbers:a=!1,className:o,children:n,...i})=>(0,La.jsx)(pr.Provider,{value:{code:e},children:(0,La.jsx)("div",{className:l("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",o),...i,children:(0,La.jsxs)("div",{className:"relative",children:[(0,La.jsx)(Ca.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:a,style:Gt.oneLight,children:e}),(0,La.jsx)(Ca.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:a,style:Gt.oneDark,children:e}),n&&(0,La.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:n})]})})});var Ro=({className:e,...t})=>(0,La.jsx)(Ht,{className:l("not-prose mb-4 w-full",e),...t}),mr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,La.jsxs)(oe,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,La.jsx)(Go.CircleIcon,{className:"size-4"}),"input-available":(0,La.jsx)(Go.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,La.jsx)(Go.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,La.jsx)(Go.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Do=({className:e,type:t,state:a,...o})=>(0,La.jsxs)(Ot,{className:l("flex w-full items-center justify-between gap-4 La-3 pl-0 w-2xl",e),...o,children:[(0,La.jsxs)("div",{className:"flex items-center gap-2",children:[(0,La.jsx)(Go.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,La.jsx)("span",{className:"font-medium text-sm",children:t}),mr(a)]}),(0,La.jsx)(Go.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),So=({className:e,...t})=>(0,La.jsx)(jt,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ao=({className:e,input:t,...a})=>(0,La.jsxs)("div",{className:l("space-y-2 overflow-hidden La-4",e),...a,children:[(0,La.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,La.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,La.jsx)($t,{code:JSON.stringify(t,null,2),language:"json"})})]}),Io=({className:e,output:t,errorText:a,...o})=>{if(!(t||a))return null;let n=(0,La.jsx)("div",{children:t});return typeof t=="object"?n=(0,La.jsx)($t,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(n=(0,La.jsx)($t,{code:t,language:"json"})),(0,La.jsxs)("div",{className:l("space-y-2 La-4",e),...o,children:[(0,La.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:a?"Error":"Result"}),(0,La.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",a?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[a&&(0,La.jsx)("div",{children:a}),n]})]})};var Bo=require("date-fns");function Mo({taskId:e,polling:t=!0,system:a="payload"}){let[o,n]=(0,tt.useState)(null),[i,r]=(0,tt.useState)(!1),[s,d]=(0,tt.useState)(null),m=async(f=!0)=>{if(e){f&&r(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let D=await y.json();n(D)}catch(y){console.error("Error fetching task:",y),d(y instanceof Error?y:new Error("Unknown error occurred"))}finally{f&&r(!1)}}},w=()=>m(!1);return(0,tt.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:o,loading:i,error:s}}var ur=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},gr=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Uo({data:e}){let{id:t,system:a,fetchLatest:o,taskData:n,error:i}=e||{};if(!t)return null;let r=null,s=!0,d=i,m=o!==void 0?o:!0;if(r=n||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:r,error:d}),m){let{task:D,loading:A,error:T}=Mo({taskId:t,system:a});r=D,s=A,d=T}else s=!1;let w=ur(r?.status||"todo"),f=gr(r?.status||"todo"),y=r?.dateLogged||new Date().toISOString();try{let D=new Date(r?.dateLogged||"");isNaN(D.getTime())||(y=(0,Bo.formatDistanceToNow)(D,{addSuffix:!0}))}catch{}return(0,La.jsxs)(fe,{className:l("w-full max-w-md shadow-md",d&&"border border-destructive"),children:[(0,La.jsxs)(Ue,{className:"pb-2",children:[(0,La.jsxs)("div",{className:"flex justify-between items-start",children:[(0,La.jsx)(Le,{className:"text-lg font-semibold",children:s?"Loading...":r?.name||"Task"}),(0,La.jsx)(oe,{className:`${w}`,children:f})]}),r?.project&&(0,La.jsxs)(ua,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,La.jsx)(Te,{className:"pb-2",children:s?(0,La.jsx)("div",{className:"animate-pulse La-4 bg-gray-200 rounded w-3/4 mb-2"}):d?(0,La.jsx)("La",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,La.jsx)("La",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,La.jsx)(Ct,{className:"tt-2 flex items-center justify-between",children:(0,La.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,La.jsx)(Go.Clock,{className:"La-3 w-3 mr-1"}),(0,La.jsxs)("span",{children:["Created ",y]}),(0,La.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,La.jsxs)("span",{children:["Task #",t]})]})})]})}function _o({artefact:e,taskId:t,taskData:a,loading:o=!1,error:n=null}){let i=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=i.dateLogged;try{let s=new Date(i.dateLogged);isNaN(s.getTime())||(r=(0,Bo.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,La.jsxs)(fe,{className:"w-full max-w-md shadow-md",children:[(0,La.jsx)(Ue,{className:"pb-2",children:(0,La.jsx)("div",{className:"flex justify-between items-start",children:(0,La.jsx)(Le,{className:"text-lg font-semibold",children:o?"Loading...":i.name})})}),(0,La.jsx)(Te,{className:"pb-2",children:o?(0,La.jsx)("div",{className:"animate-pulse La-4 bg-gray-200 rounded w-3/4 mb-2"}):n?(0,La.jsx)("La",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,La.jsx)("La",{className:"text-sm text-foreground",children:e})}),(0,La.jsx)(Ct,{className:"tt-2 flex items-center justify-between",children:(0,La.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,La.jsx)(Go.Clock,{className:"La-3 w-3 mr-1"}),(0,La.jsxs)("span",{children:["Created ",r]}),(0,La.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,La.jsxs)("span",{children:["Task #",i.id]})]})})]})}var fr=e=>e.startsWith("image/")?(0,La.jsx)(Go.Image,{className:"La-4 w-4"}):e.startsWith("text/")?(0,La.jsx)(Go.FileText,{className:"La-4 w-4"}):(0,La.jsx)(Go.File,{className:"La-4 w-4"}),Fo=({message:e,addToolResult:t,status:a,messages:o})=>e.parts.map((n,i)=>{if(n.type==="text")return(0,La.jsx)(Nt,{children:n.text},`${i}`);if(n.type==="file"){let r=n;return(0,La.jsx)("div",{className:"mb-2 La-2 bg-background/50 rounded-lg",children:(0,La.jsxs)("div",{className:"flex items-center gap-2",children:[fr(r.mediaType||"application/octet-stream"),(0,La.jsx)("div",{className:"flex-1 min-w-0",children:(0,La.jsx)("La",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,La.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"La-8 w-8 La-0",children:(0,La.jsx)(Go.Download,{className:"La-4 w-4"})})]})},i)}if(n.type.startsWith("tool-")){let r=n,s=n.type.replace("tool-","");if(s==="task")switch(r.state){case"input-available":return(0,La.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},i);case"output-available":return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(Uo,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},i);case"output-error":return(0,La.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}if(n.type==="tool-requestEndpointLogin")return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(va,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-authenticate")return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(va,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(n.type==="tool-requestApproval")return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(wo,{toolPart:r,index:i,addToolResult:t??(()=>{})})},i);if(s==="artefact")switch(r.state){case"input-available":return(0,La.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},i);case"output-available":return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(_o,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},i);case"output-error":return(0,La.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},i);default:return null}return(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsxs)(fe,{className:"w-full max-w-md",children:[(0,La.jsx)(Ue,{children:(0,La.jsx)(Le,{className:"text-lg",children:s})}),(0,La.jsxs)(Te,{children:[r.state==="input-available"&&(0,La.jsxs)("La",{className:"text-sm",children:["Processing ",s,"..."]}),r.state==="output-available"&&(0,La.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,La.jsxs)("La",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},i)}if(n.type.startsWith("data-")){let r=n,s=n.type.replace("data-","");return s==="reference"?(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsx)(fe,{className:"w-full",children:(0,La.jsx)(Te,{className:"La-4",children:(0,La.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((d,m)=>(0,La.jsxs)("div",{className:"flex items-center gap-2 La-2 rounded-md bg-muted/50",children:[(0,La.jsx)(oe,{variant:"outline",children:d.type||"link"}),(0,La.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,La.jsx)("La",{className:"text-sm font-medium truncate",children:d.title}),d.description&&(0,La.jsx)("La",{className:"text-xs text-muted-foreground truncate",children:d.description})]}),d.url&&(0,La.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>window.open(d.url,"_blank"),className:"La-8 w-8 La-0",children:(0,La.jsx)(Go.ExternalLink,{className:"La-4 w-4"})})]},m))})})})},i):s==="menu"?(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsxs)(fe,{className:"w-full",children:[(0,La.jsx)(Ue,{children:(0,La.jsx)(Le,{className:"text-lg",children:r.data?.title})}),(0,La.jsx)(Te,{children:(0,La.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((d,m)=>(0,La.jsx)(R,{variant:"outline",className:"w-full justify-start",onClick:d.action,children:(0,La.jsxs)("div",{className:"text-left",children:[(0,La.jsx)("La",{className:"font-medium",children:d.label}),d.description&&(0,La.jsx)("La",{className:"text-xs text-muted-foreground",children:d.description})]})},m))})})]})},i):(0,La.jsx)("div",{className:"mb-2",children:(0,La.jsxs)(fe,{className:"w-full max-w-md",children:[(0,La.jsx)(Ue,{children:(0,La.jsx)(Le,{className:"text-lg",children:s})}),(0,La.jsx)(Te,{children:(0,La.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},i)}return n.type==="reasoning"?(0,La.jsxs)(ya,{className:"w-full",isStreaming:a==="streaming"&&i===e.parts.length-1&&e.id===o.at(-1)?.id,children:[(0,La.jsx)(xa,{}),(0,La.jsx)(wa,{children:n.text})]},`${i}`):n.type==="dynamic-tool"?(0,La.jsxs)(Ro,{defaultOpen:n.state!=="output-available",children:[(0,La.jsx)(Do,{type:`tool-${n.toolName}`,state:n.state}),(0,La.jsxs)(So,{children:[(0,La.jsx)(Ao,{input:n.input}),(0,La.jsx)(Io,{output:n.output,errorText:n.errorText})]})]},`${e.id}-${i}`):(0,La.jsxs)(La.Fragment,{children:["Unknown part type: ",n.type]})});var Oo=({className:e,from:t,...a})=>(0,La.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...a}),vr=(0,Ua.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),jo=({children:e,className:t,variant:a,...o})=>(0,La.jsx)("div",{className:l(vr({variant:a,className:t})),...o,children:e});function Wo({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:n,fileUploads:i,isDragOver:r,enableFileUpload:s,onInputChange:d,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:y,onRemoveFile:D,onDragOver:A,className:T,status:C="ready"}){let N=(0,tt.useRef)(null),_=(0,tt.useRef)(null),S=(0,tt.useRef)(null),[I,K]=(0,tt.useState)(!1),[G,se]=(0,tt.useState)({path:[],selectedItems:[],filters:{}});(0,tt.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,tt.useEffect)(()=>{I&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[I]);let J=()=>ga(G),W=()=>{let u=[];return n.forEach(z=>{z.actions&&z.actions.forEach(he=>{u.push({label:he.label,action:()=>Q(he.id,{path:[z],selectedItems:[],filters:{}})})}),z.children&&z.children.forEach(he=>{he.type==="list"&&he.data&&u.push({label:`View ${he.name}`,action:()=>K(!0)})})}),u.slice(0,5)},Q=(u,z)=>{console.log("Capability action:",u,z);let he=`Executing ${u} with context: ${JSON.stringify(z.path.map(Ie=>Ie.name))}`;K(!1)},le=ga({path:[],selectedItems:[],filters:{}}),M=u=>{y(u.target.files),u.target.files&&(u.target.value="")},Ae=u=>{u.preventDefault(),A(!0)},c=u=>{u.preventDefault(),A(!1)},B=u=>{u.preventDefault(),A(!1),y(u.dataTransfer.files)},U=u=>{if(u===0)return"0 Bytes";let z=1024,he=["Bytes","KB","MB","GB"],Ie=Math.floor(Math.log(u)/Math.log(z));return parseFloat((u/Math.pow(z,Ie)).toFixed(2))+" "+he[Ie]},V=u=>u.startsWith("image/")?(0,La.jsx)(Go.Image,{className:"La-4 w-4"}):u.startsWith("text/")?(0,La.jsx)(Go.FileText,{className:"La-4 w-4"}):(0,La.jsx)(Go.File,{className:"La-4 w-4"}),Z={messages:e,currentSessionTitle:o,capabilities:n,currentCapabilityContext:G,contextualActions:le,getQuickSuggestions:W().map(u=>u.label)},be=()=>{navigator.clipboard.writeText(JSON.stringify(Z,null,2)),alert("Debug info copied to clipboard")};return(0,La.jsxs)("div",{className:`La-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,La.jsxs)(Ne,{ref:_,className:"flex-1 La-4 bg-background border-0",onDragOver:Ae,onDragLeave:c,onDrop:B,children:[(0,La.jsxs)("div",{className:l("space-y-4",r&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,La.jsx)(mt.animate,{children:e.map(u=>(0,La.jsx)(mt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,La.jsx)(Oo,{from:u.role,children:(0,La.jsx)(jo,{variant:"flat",children:Fo({message:u,addToolResult:m??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),I&&(0,La.jsxs)(mt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,La.jsx)(it,{className:"La-8 w-8",children:(0,La.jsx)(rt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,La.jsx)(Go.Bot,{className:"La-4 w-4"})})}),(0,La.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,La.jsx)(vo,{capabilities:n,isOpen:I,onToggle:()=>K(!I),onActionSelect:Q,className:"w-full"})})]}),a&&(0,La.jsxs)(mt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,La.jsx)(it,{className:"La-8 w-8",children:(0,La.jsx)(rt,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,La.jsx)(Go.Bot,{className:"La-4 w-4"})})}),(0,La.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,La.jsxs)("div",{className:"flex space-x-1",children:[(0,La.jsx)("div",{className:"w-2 La-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,La.jsx)("div",{className:"w-2 La-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,La.jsx)("div",{className:"w-2 La-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,La.jsx)("div",{ref:N})]}),i.length>0&&(0,La.jsx)("div",{className:"La-4 border-t bg-muted/10",children:(0,La.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(u=>(0,La.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg La-2 border",children:[V(u.file.type),(0,La.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,La.jsx)("span",{className:"text-xs text-muted-foreground",children:U(u.file.size)}),(0,La.jsx)(R,{variant:"ghost",size:"sm",onClick:()=>D(u.id),className:"La-6 w-6 La-0",children:(0,La.jsx)(Go.La,{className:"La-4 w-4"})})]},u.id))})}),(0,La.jsxs)("div",{className:"border rounded-2xl La-4 bg-muted/20",children:[(0,La.jsxs)("div",{className:"flex gap-3",children:[(0,La.jsx)(ht,{value:t,onChange:u=>d(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),s&&(0,La.jsx)(R,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl La-10 w-10 shadow-sm",children:(0,La.jsx)(Go.Paperclip,{className:"La-4 w-4"})}),(0,La.jsx)(R,{onClick:w,disabled:!t.trim()&&i.length===0||a,size:"icon",className:"rounded-2xl La-10 w-10 shadow-sm",children:(0,La.jsx)(Go.Send,{className:"La-4 w-4"})})]}),(0,La.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,La.jsxs)(R,{onClick:()=>K(!I),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,La.jsx)(Go.Menu,{className:"La-3 w-3 mr-1"}),I?"Hide":"Show"," Capabilities"]}),(0,La.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[J().map((u,z)=>(0,La.jsx)(R,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>Q(u.id,G),children:u.label},`context-${u.id}`)),J().length===0&&W().map((u,z)=>(0,La.jsx)(R,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${z}`)),(0,La.jsx)(R,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:be,children:"Debug"})]})]}),s&&(0,La.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:M,className:"hidden"})]})]})}function et({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:n=[],capabilities:i=[],sidebarItems:r=[],notifications:s=[],sessions:d=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:y=()=>{},onBusinessUnitChange:D=()=>{},onNotificationRemove:A=()=>{},onRemoveAll:T=()=>{},onActionClick:C=()=>{},onSearch:N=B=>console.log("Search query:",B),initialTeam:_="design",currentSession:S=null,showCapabilities:I=!0,title:K="Digital Colleagues",enableFileUpload:G=!0,maxFileSize:se=10,allowedFileTypes:J=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:Q="Nuvia",tagline:le="AI-Powered Workspace",actionIcon:M=(0,La.jsx)(Go.Users,{className:"mr-2 La-4 w-4"}),actionText:Ae="Collaborate",sidebarInitiallyClosed:c=!1}){let B={...e,onError:F=>{V?.setMessages(ce=>[...ce,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:F.message}]}]),console.error("Error in CopilotInterface:",F)}},U=(0,Vo.useChat)(B||{}),V=a?t||U:null,[Z,be]=(0,tt.useState)(""),[u,z]=(0,tt.useState)(!1),he=V?.messages||o,Ie=Z,$o=V?.status==="submitted"||u,qo=V?.addToolResult?(F,ce,ae)=>{V.addToolResult({tool:ce,toolCallId:F,output:ae}),V.sendMessage()}:()=>{},gt=n||[],Ko={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Jo,Qo]=(0,tt.useState)(()=>gt.length===0?Ko:gt.find(F=>F.id===_)||gt[0]),[ft,kt]=(0,tt.useState)([]),[Xo,Yo]=(0,tt.useState)(!1),Zo=F=>{if(!F||!G)return;let ce=[];Array.from(F).forEach(ae=>{if(ae.size>se*1024*1024){alert(`File ${ae.name} is too large. Maximum size is ${se}MB.`);return}if(J.length>0&&!J.some(Pt=>ae.type.match(Pt))){alert(`File type ${ae.type} is not allowed.`);return}let ka={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ae,status:"pending",progress:0};if(ae.type.startsWith("image/")){let Pt=new FileReader;Pt.onload=ii=>{kt(ri=>ri.map(Jt=>Jt.id===ka.id?{...Jt,preview:ii.target?.result}:Jt))},Pt.readAsDataURL(ae)}ce.push(ka)}),kt(ae=>[...ae,...ce])},ei=F=>{kt(ce=>ce.filter(ae=>ae.id!==F))},Na=()=>{if(!(!Ie.trim()&&ft.length===0)){if(V){let F=ft.length>0?ti(ft.map(ce=>ce.file)):void 0;V.sendMessage({text:Ie,files:F},{body:{timestamp:Date.now()}}),be("")}else console.log("Message to send:",Ie),console.log("Files to upload:",ft),be(""),z(!0),setTimeout(()=>{z(!1)},1500);kt([])}},ti=F=>{let ce=new DataTransfer;return F.forEach(ae=>ce.items.add(ae)),ce.files},ai=F=>{F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),Na())},oi=F=>{be(F)};return(0,La.jsx)(uo,{sidebarItems:r||[],title:K,notifications:s||[],businessUnits:gt,currentBusinessUnit:Jo,onBusinessUnitChange:F=>{F&&(Qo(F),D?.(F))},onSearch:N,showTabs:!1,onActionClick:C,actionIcon:M,actionText:Ae,onNotificationRemove:A,onRemoveAll:T,logo:W,appName:Q,tagline:le,sidebarInitiallyClosed:c,children:(0,La.jsx)(Kt.AnimatePresence,{mode:"wait",children:(0,La.jsx)(Kt.motion.div,{className:"flex-1 La-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,La.jsxs)("div",{className:"La-full flex",children:[(0,La.jsx)("div",{className:"w-80 flex-shrink-0 La-full La-2",children:(0,La.jsx)(go,{sessions:d||[],currentSession:S,teams:gt,onNewChat:m,onSessionSelect:w,onSessionEdit:y,onSessionDelete:f})}),(0,La.jsx)("div",{className:"flex-1 La-full La-2",children:(0,La.jsx)(Wo,{messages:he||[],input:Ie,isTyping:$o,currentSessionTitle:S?.title,capabilities:i||[],onInputChange:oi,addToolResult:qo,onSendMessage:Na,onKeyPress:ai,fileUploads:ft,isDragOver:Xo,enableFileUpload:G,onFileUpload:Zo,onRemoveFile:ei,onDragOver:Yo})})]})},"chat-interface")})})}function br(){let[e,t]=(0,tt.useState)([{id:"1",role:"user",parts:[{type:"text",text:"Can you help La analyze my sales data?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:`I'll help you analyze your sales data. Let La fetch the latest information.
|
|
22
22
|
|
|
23
23
|
*\u{1F527} Calling function: fetch_sales_data(period="30d", region="all")*`}]},{id:"3",role:"assistant",parts:[{type:"text",text:`Great! I'Go retrieved your sales data for the last 30 days. Here's what I found:
|
|
24
24
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as n}from"../../chunk-
|
|
1
|
+
import{a as n}from"../../chunk-7JX3L2MA.mjs";import"../../chunk-CTTBF7F4.mjs";import"../../chunk-56X4PU43.mjs";import"../../chunk-DEVPAZSJ.mjs";import"../../chunk-QADUAIFH.mjs";import"../../chunk-EH3PJU6C.mjs";import"../../chunk-V5VE3EIY.mjs";import"../../chunk-6OCLRAHU.mjs";import"../../chunk-5Y6FKL5W.mjs";import"../../chunk-EW6KWAHS.mjs";import"../../chunk-7JDMW5R3.mjs";import"../../chunk-6OT5PQXV.mjs";import"../../chunk-YPZAYXNQ.mjs";import"../../chunk-7TSR2LQB.mjs";import"../../chunk-QM5FOQHG.mjs";import"../../chunk-UA2E23AS.mjs";import"../../chunk-2LINLX4S.mjs";import"../../chunk-RL6365DN.mjs";import"../../chunk-LTTO57ZK.mjs";import"../../chunk-4WA47ZQA.mjs";import"../../chunk-NPVUICIF.mjs";import"../../chunk-VDN4LQSS.mjs";import"../../chunk-FGEFYI5E.mjs";import"../../chunk-MU5WPW4N.mjs";import"../../chunk-AZKOVKSK.mjs";import{b as s}from"../../chunk-Q2DPE66H.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-EGEO3FNE.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-YEKQJ4YC.mjs";import{useState as r}from"react";import{jsx as e}from"react/jsx-runtime";function u(){let[t,a]=r([{id:"1",role:"user",parts:[{type:"text",text:"Can you help me analyze my sales data?"}]},{id:"2",role:"assistant",parts:[{type:"text",text:`I'll help you analyze your sales data. Let me fetch the latest information.
|
|
2
2
|
|
|
3
3
|
*\u{1F527} Calling function: fetch_sales_data(period="30d", region="all")*`}]},{id:"3",role:"assistant",parts:[{type:"text",text:`Great! I've retrieved your sales data for the last 30 days. Here's what I found:
|
|
4
4
|
|