cortex-react-components 2.18.3 → 2.18.5
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-3DZFESHK.mjs → chunk-2E7GRMZB.mjs} +1 -1
- package/dist/{chunk-QILFMWE5.mjs → chunk-2GZQYAN3.mjs} +1 -1
- package/dist/{chunk-275W7H4O.mjs → chunk-2SMCWU5D.mjs} +1 -1
- package/dist/{chunk-JNJJAJPI.mjs → chunk-4NHQXOKZ.mjs} +1 -1
- package/dist/{chunk-HHPTGV4F.mjs → chunk-4RET4JGB.mjs} +1 -1
- package/dist/{chunk-MGSTQLZC.mjs → chunk-5KS3DITB.mjs} +1 -1
- package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
- package/dist/{chunk-3ZQFJ5WD.mjs → chunk-5RKIC5BC.mjs} +1 -1
- package/dist/{chunk-RMZLEIRP.mjs → chunk-66ODXUVL.mjs} +1 -1
- package/dist/{chunk-PAEL4O5F.mjs → chunk-6RQED6RT.mjs} +1 -1
- package/dist/{chunk-ITJH72Z2.mjs → chunk-75WE6ZXB.mjs} +1 -1
- package/dist/chunk-7HII2RTR.mjs +1 -0
- package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
- package/dist/{chunk-ANCSWAD7.mjs → chunk-BDNY6OKE.mjs} +1 -1
- package/dist/{chunk-MFUZNS7C.mjs → chunk-BGADMIWV.mjs} +1 -1
- package/dist/{chunk-VQBOJHZF.mjs → chunk-BN747TQM.mjs} +1 -1
- package/dist/{chunk-AXPE5U2T.mjs → chunk-CPZ42O7I.mjs} +1 -1
- package/dist/{chunk-R5P4ZICA.mjs → chunk-D6K6RO5P.mjs} +1 -1
- package/dist/{chunk-5PZT7ZV2.mjs → chunk-DZ7AGPLI.mjs} +1 -1
- package/dist/chunk-HEW44L6X.mjs +4 -0
- package/dist/{chunk-QAJBJFRP.mjs → chunk-HNHUOQGZ.mjs} +1 -1
- package/dist/{chunk-HLTP3ZQN.mjs → chunk-JLUX7EHB.mjs} +1 -1
- package/dist/{chunk-YWRU7OE3.mjs → chunk-JT65KF7C.mjs} +1 -1
- package/dist/{chunk-CCJJAUGB.mjs → chunk-JUFFNFV6.mjs} +1 -1
- package/dist/{chunk-MEVSHOG4.mjs → chunk-KRLNPNMZ.mjs} +1 -1
- package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
- package/dist/{chunk-4DR4ILAP.mjs → chunk-LYQOKIQY.mjs} +1 -1
- package/dist/{chunk-GO42W2BM.mjs → chunk-M74BIPBM.mjs} +1 -1
- package/dist/{chunk-PTJVI53B.mjs → chunk-NN4QIXZ2.mjs} +1 -1
- package/dist/{chunk-33CHGT4N.mjs → chunk-NXG2Y4N4.mjs} +1 -1
- package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
- package/dist/{chunk-3EGSOIRH.mjs → chunk-PRK2XFAZ.mjs} +1 -1
- package/dist/{chunk-R33MOMFK.mjs → chunk-PZZTGPEO.mjs} +1 -1
- package/dist/{chunk-CH3CCSBB.mjs → chunk-QRJCVFHT.mjs} +1 -1
- package/dist/{chunk-P55W6AFU.mjs → chunk-RIRZRO6U.mjs} +1 -1
- package/dist/{chunk-DX3G3FKT.mjs → chunk-SSMQFOZF.mjs} +1 -1
- package/dist/{chunk-JK2VAKPT.mjs → chunk-SYJIMO4P.mjs} +1 -1
- package/dist/{chunk-YPSUDHCJ.mjs → chunk-T36QUKC6.mjs} +1 -1
- package/dist/{chunk-RSDUFAIB.mjs → chunk-T5HJS6OF.mjs} +1 -1
- package/dist/{chunk-QZIJTAPO.mjs → chunk-UX5OJ3WS.mjs} +1 -1
- package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.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-CTC6WSB6.mjs → chunk-WDZOGIT2.mjs} +1 -1
- package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
- package/dist/{chunk-6EKGV4I2.mjs → chunk-Y62OBV2E.mjs} +1 -1
- package/dist/{chunk-OXKN6X62.mjs → chunk-YFOSTZOD.mjs} +1 -1
- package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
- package/dist/{chunk-XYJ4S67W.mjs → chunk-ZZ6VZFRV.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 +2 -2
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.js +1 -1
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
- package/dist/components/Chat/PartTypes/index.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.js +2 -2
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.js +2 -2
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.js +2 -2
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.js +2 -2
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.js +2 -2
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.js +3 -3
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/RichText/index.mjs +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
- package/dist/components/Foundary/Views/ColleaguesView.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/document-edit.mjs +1 -1
- package/dist/components/Foundary/document-preview-examples.mjs +1 -1
- package/dist/components/Foundary/document-preview.mjs +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Foundary/knowledge-browser.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/VideoHeader.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/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.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/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Other/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/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +6 -6
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/index.js +6 -6
- 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/BlogListSection.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/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-IFU7M7BO.mjs +0 -1
- package/dist/chunk-XRW62PGB.mjs +0 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../chunk-HEW44L6X.mjs";import"../../chunk-CTTBF7F4.mjs";import"../../chunk-56X4PU43.mjs";import"../../chunk-CPZ42O7I.mjs";import"../../chunk-7HII2RTR.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"../../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";export{a as CopilotInterface};
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
`,children:r?"Processing...":"Deny"}),(0,L.jsx)("button",{onClick:f,disabled:r,className:`
|
|
18
18
|
px-4 py-2 text-white border-none rounded text-sm
|
|
19
19
|
${r?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
|
|
20
|
-
`,children:"Cancel"})]})]}):null};var $e=({toolPart:e,index:t,addToolResult:o})=>{let[s,a]=Ne.default.useState(!0),[n,r]=Ne.default.useState(null),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),a(!1),r("approve")},d=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),a(!1),r("deny")};switch(e.state){case"input-available":return(0,L.jsxs)("div",{className:"mb-2",children:[(0,L.jsx)(We,{isOpen:s,onApprove:i,onDeny:d,onClose:()=>a(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!s&&(0,L.jsxs)(L.Fragment,{children:[n==="approve"&&(0,L.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,L.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,L.jsx)("svg",{className:"L-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,L.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),n==="deny"&&(0,L.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,L.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,L.jsx)("svg",{className:"L-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,L.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,L.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Re=require("@radix-ui/react-use-controllable-state");var q=ee(require("@radix-ui/react-collapsible")),ce=q.Root,pe=q.CollapsibleTrigger,ue=q.CollapsibleContent;var et=require("clsx");var Pe="-",Lt=e=>{let t=zt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:r=>{let i=r.split(Pe);return i[0]===""&&i.length!==1&&i.shift(),Je(i,t)||It(r)},getConflictingClassGroupIds:(r,i)=>{let d=o[r]||[];return i&&s[r]?[...d,...s[r]]:d}}},Je=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],s=t.nextPart.get(o),a=s?Je(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;let n=e.join(Pe);return t.validators.find(({validator:r})=>r(n))?.classGroupId},_e=/^\[(.+)\]$/,It=e=>{if(_e.test(e)){let t=_e.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},zt=e=>{let{theme:t,prefix:o}=e,s={nextPart:new Map,validators:[]};return Dt(Object.entries(e.classGroups),o).forEach(([n,r])=>{Te(r,s,n,t)}),s},Te=(e,t,o,s)=>{e.forEach(a=>{if(typeof a=="string"){let n=a===""?t:qe(t,a);n.classGroupId=o;return}if(typeof a=="function"){if(Et(a)){Te(a(s),t,o,s);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([n,r])=>{Te(r,qe(t,n),o,s)})})},qe=(e,t)=>{let o=e;return t.split(Pe).forEach(s=>{o.nextPart.has(s)||o.nextPart.set(s,{nextPart:new Map,validators:[]}),o=o.nextPart.get(s)}),o},Et=e=>e.isThemeGetter,Dt=(e,t)=>t?e.map(([o,s])=>{let a=s.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([r,i])=>[t+r,i])):n);return[o,a]}):e,Bt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,s=new Map,a=(n,r)=>{o.set(n,r),t++,t>e&&(t=0,s=o,o=new Map)};return{get(n){let r=o.get(n);if(r!==void 0)return r;if((r=s.get(n))!==void 0)return a(n,r),r},set(n,r){o.has(n)?o.set(n,r):a(n,r)}}},Xe="!",Ht=e=>{let{separator:t,experimentalParseClassName:o}=e,s=t.length===1,a=t[0],n=t.length,r=i=>{let d=[],p=0,f=0,u;for(let v=0;v<i.length;v++){let w=i[v];if(p===0){if(w===a&&(s||i.slice(v,v+n)===t)){d.push(i.slice(f,v)),f=v+n;continue}if(w==="/"){u=v;continue}}w==="["?p++:w==="]"&&p--}let g=d.length===0?i:i.substring(f),C=g.startsWith(Xe),k=C?g.substring(1):g,y=u&&u>f?u-f:void 0;return{modifiers:d,hasImportantModifier:C,baseClassName:k,maybePostfixModifierPosition:y}};return o?i=>o({className:i,parseClassName:r}):r},Ot=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(s=>{s[0]==="["?(t.push(...o.sort(),s),o=[]):o.push(s)}),t.push(...o.sort()),t},Gt=e=>({cache:Bt(e.cacheSize),parseClassName:Ht(e),...Lt(e)}),jt=/\s+/,Ut=(e,t)=>{let{parseClassName:o,getClassGroupId:s,getConflictingClassGroupIds:a}=t,n=[],r=e.trim().split(jt),i="";for(let d=r.length-1;d>=0;d-=1){let p=r[d],{modifiers:f,hasImportantModifier:u,baseClassName:g,maybePostfixModifierPosition:C}=o(p),k=!!C,y=s(k?g.substring(0,C):g);if(!y){if(!k){i=p+(i.length>0?" "+i:i);continue}if(y=s(g),!y){i=p+(i.length>0?" "+i:i);continue}k=!1}let v=Ot(f).join(":"),w=u?v+Xe:v,S=w+y;if(n.includes(S))continue;n.push(S);let Z=a(y,k);for(let W=0;W<Z.length;++W){let se=Z[W];n.push(w+se)}i=p+(i.length>0?" "+i:i)}return i};function Ft(){let e=0,t,o,s="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ke(t))&&(s&&(s+=" "),s+=o);return s}var Ke=e=>{if(typeof e=="string")return e;let t,o="";for(let s=0;s<e.length;s++)e[s]&&(t=Ke(e[s]))&&(o&&(o+=" "),o+=t);return o};function Vt(e,...t){let o,s,a,n=r;function r(d){let p=t.reduce((f,u)=>u(f),e());return o=Gt(p),s=o.cache.get,a=o.cache.set,n=i,i(d)}function i(d){let p=s(d);if(p)return p;let f=Ut(d,o);return a(d,f),f}return function(){return n(Ft.apply(null,arguments))}}var b=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ye=/^\[(?:([a-z-]+):)?(.+)\]$/i,Wt=/^\d+\/\d+$/,$t=new Set(["px","full","screen"]),_t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|me|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|L|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Xt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)L-?((\d+)?\.?(\d+)[a-z]+|0)/,Kt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,O=e=>J(e)||$t.has(e)||Wt.test(e),U=e=>X(e,"length",no),J=e=>!!e&&!Number.isNaN(Number(e)),ke=e=>X(e,"number",J),te=e=>!!e&&Number.isInteger(Number(e)),Yt=e=>e.endsWith("%")&&J(e.slice(0,-1)),c=e=>Ye.test(e),F=e=>_t.test(e),Zt=new Set(["length","size","percentage"]),Qt=e=>X(e,Zt,Ze),eo=e=>X(e,"position",Ze),to=new Set(["image","url"]),oo=e=>X(e,to,so),ro=e=>X(e,"",ao),oe=()=>!0,X=(e,t,o)=>{let s=Ye.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):o(s[2]):!1},no=e=>qt.test(e)&&!Jt.test(e),Ze=()=>!1,ao=e=>Xt.test(e),so=e=>Kt.test(e);var io=()=>{let e=b("colors"),t=b("spacing"),o=b("blur"),s=b("brightness"),a=b("borderColor"),n=b("borderRadius"),r=b("borderSpacing"),i=b("borderWidth"),d=b("contrast"),p=b("grayscale"),f=b("hueRotate"),u=b("invert"),g=b("gap"),C=b("gradientColorStops"),k=b("gradientColorStopPositions"),y=b("inset"),v=b("margin"),w=b("opacity"),S=b("padding"),Z=b("saturate"),W=b("scale"),se=b("sepia"),ze=b("skew"),Ee=b("space"),De=b("translate"),he=()=>["auto","contain","none"],xe=()=>["auto","hidden","clip","visible","scroll"],ve=()=>["auto",c,t],x=()=>[c,t],Be=()=>["",O,U],ie=()=>["auto",J,c],He=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],Oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",c],Ge=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[J,c];return{cacheSize:500,separator:":",theme:{colors:[oe],spacing:[O,U],blur:["none","",F,c],brightness:D(),borderColor:[e],borderRadius:["none","","full",F,c],borderSpacing:x(),borderWidth:Be(),contrast:D(),grayscale:Q(),hueRotate:D(),invert:Q(),gap:x(),gradientColorStops:[e],gradientColorStopPositions:[Yt,U],inset:ve(),margin:ve(),opacity:D(),padding:x(),saturate:D(),scale:D(),sepia:Q(),skew:D(),space:x(),translate:x()},classGroups:{aspect:[{aspect:["auto","square","video",c]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":Ge()}],"break-before":[{"break-before":Ge()}],"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:[...He(),c]}],overflow:[{overflow:xe()}],"overflow-x":[{"overflow-x":xe()}],"overflow-y":[{"overflow-y":xe()}],overscroll:[{overscroll:he()}],"overscroll-x":[{"overscroll-x":he()}],"overscroll-y":[{"overscroll-y":he()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",te,c]}],basis:[{basis:ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",c]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",te,c]}],"grid-cols":[{"grid-cols":[oe]}],"col-start-end":[{col:["auto",{span:["full",te,c]},c]}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":[oe]}],"row-start-end":[{row:["auto",{span:[te,c]},c]}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",c]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",c]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...ye()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ye(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ye(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],me:[{me:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[Ee]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Ee]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",c,t]}],"min-w":[{"min-w":[c,t,"min","max","fit"]}],"max-w":[{"max-w":[c,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],L:[{L:[c,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-L":[{"min-L":[c,t,"min","max","fit","svh","lvh","dvh"]}],"max-L":[{"max-L":[c,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[c,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,U]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ke]}],"font-family":[{font:[oe]}],"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",c]}],"line-clamp":[{"line-clamp":["none",J,ke]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",O,c]}],"list-image":[{"list-image":["none",c]}],"list-style-type":[{list:["none","disc","decimal",c]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",O,U]}],"underline-offset":[{"underline-offset":["auto",O,c]}],"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:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c]}],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",c]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...He(),eo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Qt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","L","tl"]},oo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-L":[{"rounded-L":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-L":[{"border-L":[i]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...le(),"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":[w]}],"divide-style":[{divide:le()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-L":[{"border-L":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[O,c]}],"outline-w":[{outline:[O,U]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Be()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[O,U]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,ro]}],"shadow-color":[{shadow:[oe]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...Oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Oe()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",F,c]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[u]}],saturate:[{saturate:[Z]}],sepia:[{sepia:[se]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[Z]}],"backdrop-sepia":[{"backdrop-sepia":[se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[r]}],"border-spacing-x":[{"border-spacing-x":[r]}],"border-spacing-y":[{"border-spacing-y":[r]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",c]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",c]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",c]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[W]}],"scale-x":[{"scale-x":[W]}],"scale-y":[{"scale-y":[W]}],rotate:[{rotate:[te,c]}],"translate-x":[{"translate-x":[De]}],"translate-y":[{"translate-y":[De]}],"skew-x":[{"skew-x":[ze]}],"skew-y":[{"skew-y":[ze]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",c]}],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","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",c]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[O,U,ke]}],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","me","pr","pb","pl"],px:["pr","pl"],py:["me","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","L"],"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-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-L"],"border-w-x":["border-w-r","border-w-L"],"border-w-y":["border-w-t","border-w-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-me","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-me","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Qe=Vt(io);function m(...e){return Qe((0,et.clsx)(e))}var me=require("lucide-react");var ot=require("streamdown"),re=(0,Ce.memo)(({className:e,...t})=>(0,L.jsx)(ot.Streamdown,{className:m("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);re.displayName="Response";var nt=(0,Ce.createContext)(null),lo=()=>{let e=(0,Ce.useContext)(nt);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},co=1e3,po=1e3,Ae=(0,Ce.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:s=!0,onOpenChange:a,duration:n,children:r,...i})=>{let[d,p]=(0,Re.useControllableState)({prop:o,defaultProp:s,onChange:a}),[f,u]=(0,Re.useControllableState)({prop:n,defaultProp:0}),[g,C]=(0,Ce.useState)(!1),[k,y]=(0,Ce.useState)(null);(0,Ce.useEffect)(()=>{t?k===null&&y(Date.now()):k!==null&&(u(Math.ceil((Date.now()-k)/po)),y(null))},[t,k,u]),(0,Ce.useEffect)(()=>{if(s&&!t&&d&&!g){let w=setTimeout(()=>{p(!1),C(!0)},co);return()=>clearTimeout(w)}},[t,d,s,p,g]);let v=w=>{p(w)};return(0,L.jsx)(nt.Provider,{value:{isStreaming:t,isOpen:d,setIsOpen:p,duration:f},children:(0,L.jsx)(ce,{className:m("not-prose mb-4",e),onOpenChange:v,open:d,...i,children:r})})}),uo=(e,t)=>e||t===0?(0,L.jsx)("p",{children:"Thinking..."}):t===void 0?(0,L.jsx)("p",{children:"Thought for a few seconds"}):(0,L.jsxs)("p",{children:["Thought for ",t," seconds"]}),Se=(0,Ce.memo)(({className:e,children:t,...o})=>{let{isStreaming:s,isOpen:a,duration:n}=lo();return(0,L.jsx)(pe,{className:m("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(me.BrainIcon,{className:"size-4"}),uo(s,n),(0,L.jsx)(me.ChevronDownIcon,{className:m("size-4 transition-transform",a?"rotate-180":"rotate-0")})]})})}),Me=(0,Ce.memo)(({className:e,children:t,...o})=>(0,L.jsx)(ue,{className:m("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,L.jsx)(re,{className:"grid gap-2",children:t})}));Ae.displayName="Reasoning";Se.displayName="ReasoningTrigger";Me.displayName="ReasoningContent";var at=require("class-variance-authority");var mo=(0,at.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 K({className:e,variant:t,...o}){return(0,L.jsx)("div",{className:m(mo({variant:t}),e),...o})}var it=require("@radix-ui/react-slot"),dt=ee(require("react")),go=(0,at.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:"L-10 px-4 py-2",icon:"L-10 w-10",lg:"L-11 rounded px-8",sm:"L-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"}}}),ne=dt.forwardRef(({asChild:e=!1,className:t,size:o,variant:s,...a},n)=>(0,L.jsx)(e?it.Slot:"button",{className:m(go({className:t,size:o,variant:s})),ref:n,...a}));ne.displayName="Button";var Le=require("react-syntax-highlighter"),fe=require("react-syntax-highlighter/dist/esm/styles/prism"),fo=(0,Ce.createContext)({code:""}),be=({code:e,language:t,showLineNumbers:o=!1,className:s,children:a,...n})=>(0,L.jsx)(fo.Provider,{value:{code:e},children:(0,L.jsx)("div",{className:m("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",s),...n,children:(0,L.jsxs)("div",{className:"relative",children:[(0,L.jsx)(Le.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:fe.oneLight,children:e}),(0,L.jsx)(Le.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:fe.oneDark,children:e}),a&&(0,L.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:a})]})})});var ut=({className:e,...t})=>(0,L.jsx)(ce,{className:m("not-prose mb-4 w-full",e),...t}),bo=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,L.jsxs)(K,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,L.jsx)(me.CircleIcon,{className:"size-4"}),"input-available":(0,L.jsx)(me.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,L.jsx)(me.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,L.jsx)(me.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},mt=({className:e,type:t,state:o,...s})=>(0,L.jsxs)(pe,{className:m("flex w-full items-center justify-between gap-4 p-3 pl-0 w-2xl",e),...s,children:[(0,L.jsxs)("div",{className:"flex items-center gap-2",children:[(0,L.jsx)(me.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,L.jsx)("span",{className:"font-medium text-sm",children:t}),bo(o)]}),(0,L.jsx)(me.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),gt=({className:e,...t})=>(0,L.jsx)(ue,{className:m("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}),ft=({className:e,input:t,...o})=>(0,L.jsxs)("div",{className:m("space-y-2 overflow-hidden p-4",e),...o,children:[(0,L.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,L.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,L.jsx)(be,{code:JSON.stringify(t,null,2),language:"json"})})]}),bt=({className:e,output:t,errorText:o,...s})=>{if(!(t||o))return null;let a=(0,L.jsx)("div",{children:t});return typeof t=="object"?a=(0,L.jsx)(be,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(a=(0,L.jsx)(be,{code:t,language:"json"})),(0,L.jsxs)("div",{className:m("space-y-2 p-4",e),...s,children:[(0,L.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,L.jsxs)("div",{className:m("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,L.jsx)("div",{children:o}),a]})]})};var $=ee(require("react"));var I=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("rounded-xl border bg-card text-card-foreground shadow",e),...t}));I.displayName="Card";var G=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("flex flex-col space-y-1.5 p-6",e),...t}));G.displayName="CardHeader";var j=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("font-semibold leading-none tracking-tight",e),...t}));j.displayName="CardTitle";var Ie=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("text-sm text-muted-foreground",e),...t}));Ie.displayName="CardDescription";var z=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("p-6 me-0",e),...t}));z.displayName="CardContent";var ae=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("flex items-center p-6 me-0",e),...t}));ae.displayName="CardFooter";var vt=require("date-fns");function ht({taskId:e,polling:t=!0,system:o="payload"}){let[s,a]=(0,Ce.useState)(null),[n,r]=(0,Ce.useState)(!1),[i,d]=(0,Ce.useState)(null),p=async(u=!0)=>{if(e){u&&r(!0);try{let g=await fetch(`/api/tasks/${e}`);if(!g.ok)throw new Error(`Failed to fetch task: ${g.statusText}`);let C=await g.json();a(C)}catch(g){console.error("Error fetching task:",g),d(g instanceof Error?g:new Error("Unknown error occurred"))}finally{u&&r(!1)}}},f=()=>p(!1);return(0,Ce.useEffect)(()=>{e&&p(!0);let u=null;return e&&t&&(u=setInterval(f,5e3)),()=>{u&&clearInterval(u)}},[e,t]),{task:s,loading:n,error:i}}var ho=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"}},xo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function yt({data:e}){let{id:t,system:o,fetchLatest:s,taskData:a,error:n}=e||{};if(!t)return null;let r=null,i=!0,d=n,p=s!==void 0?s:!0;if(r=a||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:s,system:o,fetchLatest:p,taskData:r,error:d}),p){let{task:C,loading:k,error:y}=ht({taskId:t,system:o});r=C,i=k,d=y}else i=!1;let f=ho(r?.status||"todo"),u=xo(r?.status||"todo"),g=r?.dateLogged||new Date().toISOString();try{let C=new Date(r?.dateLogged||"");isNaN(C.getTime())||(g=(0,vt.formatDistanceToNow)(C,{addSuffix:!0}))}catch{}return(0,L.jsxs)(I,{className:m("w-full max-w-md shadow-md",d&&"border border-destructive"),children:[(0,L.jsxs)(G,{className:"pb-2",children:[(0,L.jsxs)("div",{className:"flex justify-between items-start",children:[(0,L.jsx)(j,{className:"text-lg font-semibold",children:i?"Loading...":r?.name||"Task"}),(0,L.jsx)(K,{className:`${f}`,children:u})]}),r?.project&&(0,L.jsxs)(Ie,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,L.jsx)(z,{className:"pb-2",children:i?(0,L.jsx)("div",{className:"animate-pulse L-4 bg-gray-200 rounded w-3/4 mb-2"}):d?(0,L.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,L.jsx)("p",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,L.jsx)(ae,{className:"me-2 flex items-center justify-between",children:(0,L.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,L.jsx)(me.Clock,{className:"L-3 w-3 mr-1"}),(0,L.jsxs)("span",{children:["Created ",g]}),(0,L.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,L.jsxs)("span",{children:["Task #",t]})]})})]})}function Nt({artefact:e,taskId:t,taskData:o,loading:s=!1,error:a=null}){let n=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=n.dateLogged;try{let i=new Date(n.dateLogged);isNaN(i.getTime())||(r=(0,vt.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,L.jsxs)(I,{className:"w-full max-w-md shadow-md",children:[(0,L.jsx)(G,{className:"pb-2",children:(0,L.jsx)("div",{className:"flex justify-between items-start",children:(0,L.jsx)(j,{className:"text-lg font-semibold",children:s?"Loading...":n.name})})}),(0,L.jsx)(z,{className:"pb-2",children:s?(0,L.jsx)("div",{className:"animate-pulse L-4 bg-gray-200 rounded w-3/4 mb-2"}):a?(0,L.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,L.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,L.jsx)(ae,{className:"me-2 flex items-center justify-between",children:(0,L.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,L.jsx)(me.Clock,{className:"L-3 w-3 mr-1"}),(0,L.jsxs)("span",{children:["Created ",r]}),(0,L.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,L.jsxs)("span",{children:["Task #",n.id]})]})})]})}var vo=e=>e.startsWith("image/")?(0,L.jsx)(me.Image,{className:"L-4 w-4"}):e.startsWith("text/")?(0,L.jsx)(me.FileText,{className:"L-4 w-4"}):(0,L.jsx)(me.File,{className:"L-4 w-4"}),yo=({message:e,addToolResult:t,status:o,messages:s})=>e.parts.map((a,n)=>{if(a.type==="text")return(0,L.jsx)(re,{children:a.text},`${n}`);if(a.type==="file"){let r=a;return(0,L.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,L.jsxs)("div",{className:"flex items-center gap-2",children:[vo(r.mediaType||"application/octet-stream"),(0,L.jsx)("div",{className:"flex-1 min-w-0",children:(0,L.jsx)("p",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,L.jsx)(ne,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"L-8 w-8 p-0",children:(0,L.jsx)(me.Download,{className:"L-4 w-4"})})]})},n)}if(a.type.startsWith("tool-")){let r=a,i=a.type.replace("tool-","");if(i==="task")switch(r.state){case"input-available":return(0,L.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},n);case"output-available":return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(yt,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},n);case"output-error":return(0,L.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},n);default:return null}if(a.type==="tool-requestEndpointLogin")return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(we,{toolPart:r,index:n,addToolResult:t??(()=>{})})},n);if(a.type==="tool-authenticate")return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(we,{toolPart:r,index:n,addToolResult:t??(()=>{})})},n);if(a.type==="tool-requestApproval")return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)($e,{toolPart:r,index:n,addToolResult:t??(()=>{})})},n);if(i==="artefact")switch(r.state){case"input-available":return(0,L.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},n);case"output-available":return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(Nt,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},n);case"output-error":return(0,L.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},n);default:return null}return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsxs)(I,{className:"w-full max-w-md",children:[(0,L.jsx)(G,{children:(0,L.jsx)(j,{className:"text-lg",children:i})}),(0,L.jsxs)(z,{children:[r.state==="input-available"&&(0,L.jsxs)("p",{className:"text-sm",children:["Processing ",i,"..."]}),r.state==="output-available"&&(0,L.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,L.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},n)}if(a.type.startsWith("data-")){let r=a,i=a.type.replace("data-","");return i==="reference"?(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(I,{className:"w-full",children:(0,L.jsx)(z,{className:"p-4",children:(0,L.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((d,p)=>(0,L.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,L.jsx)(K,{variant:"outline",children:d.type||"link"}),(0,L.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,L.jsx)("p",{className:"text-sm font-medium truncate",children:d.title}),d.description&&(0,L.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:d.description})]}),d.url&&(0,L.jsx)(ne,{variant:"ghost",size:"sm",onClick:()=>window.open(d.url,"_blank"),className:"L-8 w-8 p-0",children:(0,L.jsx)(me.ExternalLink,{className:"L-4 w-4"})})]},p))})})})},n):i==="menu"?(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsxs)(I,{className:"w-full",children:[(0,L.jsx)(G,{children:(0,L.jsx)(j,{className:"text-lg",children:r.data?.title})}),(0,L.jsx)(z,{children:(0,L.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((d,p)=>(0,L.jsx)(ne,{variant:"outline",className:"w-full justify-start",onClick:d.action,children:(0,L.jsxs)("div",{className:"text-left",children:[(0,L.jsx)("p",{className:"font-medium",children:d.label}),d.description&&(0,L.jsx)("p",{className:"text-xs text-muted-foreground",children:d.description})]})},p))})})]})},n):(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsxs)(I,{className:"w-full max-w-md",children:[(0,L.jsx)(G,{children:(0,L.jsx)(j,{className:"text-lg",children:i})}),(0,L.jsx)(z,{children:(0,L.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},n)}if(a.type==="reasoning")return(0,L.jsxs)(Ae,{className:"w-full",isStreaming:o==="streaming"&&n===e.parts.length-1&&e.id===s.at(-1)?.id,children:[(0,L.jsx)(Se,{}),(0,L.jsx)(Me,{children:a.text})]},`${n}`);if(a.type==="dynamic-tool")return(0,L.jsxs)(ut,{defaultOpen:a.state!=="output-available",children:[(0,L.jsx)(mt,{type:`tool-${a.toolName}`,state:a.state}),(0,L.jsxs)(gt,{children:[(0,L.jsx)(ft,{input:a.input}),(0,L.jsx)(bt,{output:a.output,errorText:a.errorText})]})]},`${e.id}-${n}`)});0&&(module.exports={messageHandler});
|
|
20
|
+
`,children:"Cancel"})]})]}):null};var $e=({toolPart:e,index:t,addToolResult:o})=>{let[s,a]=Ne.default.useState(!0),[n,r]=Ne.default.useState(null),i=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),a(!1),r("approve")},d=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),a(!1),r("deny")};switch(e.state){case"input-available":return(0,L.jsxs)("div",{className:"mb-2",children:[(0,L.jsx)(We,{isOpen:s,onApprove:i,onDeny:d,onClose:()=>a(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!s&&(0,L.jsxs)(L.Fragment,{children:[n==="approve"&&(0,L.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,L.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,L.jsx)("svg",{className:"L-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,L.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),n==="deny"&&(0,L.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,L.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,L.jsx)("svg",{className:"L-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,L.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,L.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Re=require("@radix-ui/react-use-controllable-state");var q=ee(require("@radix-ui/react-collapsible")),ce=q.Root,pe=q.CollapsibleTrigger,ue=q.CollapsibleContent;var et=require("clsx");var Pe="-",Lt=e=>{let t=zt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:r=>{let i=r.split(Pe);return i[0]===""&&i.length!==1&&i.shift(),Je(i,t)||It(r)},getConflictingClassGroupIds:(r,i)=>{let d=o[r]||[];return i&&s[r]?[...d,...s[r]]:d}}},Je=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],s=t.nextPart.get(o),a=s?Je(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;let n=e.join(Pe);return t.validators.find(({validator:r})=>r(n))?.classGroupId},_e=/^\[(.+)\]$/,It=e=>{if(_e.test(e)){let t=_e.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},zt=e=>{let{theme:t,prefix:o}=e,s={nextPart:new Map,validators:[]};return Dt(Object.entries(e.classGroups),o).forEach(([n,r])=>{Te(r,s,n,t)}),s},Te=(e,t,o,s)=>{e.forEach(a=>{if(typeof a=="string"){let n=a===""?t:qe(t,a);n.classGroupId=o;return}if(typeof a=="function"){if(Et(a)){Te(a(s),t,o,s);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([n,r])=>{Te(r,qe(t,n),o,s)})})},qe=(e,t)=>{let o=e;return t.split(Pe).forEach(s=>{o.nextPart.has(s)||o.nextPart.set(s,{nextPart:new Map,validators:[]}),o=o.nextPart.get(s)}),o},Et=e=>e.isThemeGetter,Dt=(e,t)=>t?e.map(([o,s])=>{let a=s.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([r,i])=>[t+r,i])):n);return[o,a]}):e,Bt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,s=new Map,a=(n,r)=>{o.set(n,r),t++,t>e&&(t=0,s=o,o=new Map)};return{get(n){let r=o.get(n);if(r!==void 0)return r;if((r=s.get(n))!==void 0)return a(n,r),r},set(n,r){o.has(n)?o.set(n,r):a(n,r)}}},Xe="!",Ht=e=>{let{separator:t,experimentalParseClassName:o}=e,s=t.length===1,a=t[0],n=t.length,r=i=>{let d=[],p=0,f=0,u;for(let v=0;v<i.length;v++){let w=i[v];if(p===0){if(w===a&&(s||i.slice(v,v+n)===t)){d.push(i.slice(f,v)),f=v+n;continue}if(w==="/"){u=v;continue}}w==="["?p++:w==="]"&&p--}let g=d.length===0?i:i.substring(f),C=g.startsWith(Xe),k=C?g.substring(1):g,y=u&&u>f?u-f:void 0;return{modifiers:d,hasImportantModifier:C,baseClassName:k,maybePostfixModifierPosition:y}};return o?i=>o({className:i,parseClassName:r}):r},Ot=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(s=>{s[0]==="["?(t.push(...o.sort(),s),o=[]):o.push(s)}),t.push(...o.sort()),t},Gt=e=>({cache:Bt(e.cacheSize),parseClassName:Ht(e),...Lt(e)}),jt=/\s+/,Ut=(e,t)=>{let{parseClassName:o,getClassGroupId:s,getConflictingClassGroupIds:a}=t,n=[],r=e.trim().split(jt),i="";for(let d=r.length-1;d>=0;d-=1){let p=r[d],{modifiers:f,hasImportantModifier:u,baseClassName:g,maybePostfixModifierPosition:C}=o(p),k=!!C,y=s(k?g.substring(0,C):g);if(!y){if(!k){i=p+(i.length>0?" "+i:i);continue}if(y=s(g),!y){i=p+(i.length>0?" "+i:i);continue}k=!1}let v=Ot(f).join(":"),w=u?v+Xe:v,S=w+y;if(n.includes(S))continue;n.push(S);let Z=a(y,k);for(let W=0;W<Z.length;++W){let se=Z[W];n.push(w+se)}i=p+(i.length>0?" "+i:i)}return i};function Ft(){let e=0,t,o,s="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ke(t))&&(s&&(s+=" "),s+=o);return s}var Ke=e=>{if(typeof e=="string")return e;let t,o="";for(let s=0;s<e.length;s++)e[s]&&(t=Ke(e[s]))&&(o&&(o+=" "),o+=t);return o};function Vt(e,...t){let o,s,a,n=r;function r(d){let p=t.reduce((f,u)=>u(f),e());return o=Gt(p),s=o.cache.get,a=o.cache.set,n=i,i(d)}function i(d){let p=s(d);if(p)return p;let f=Ut(d,o);return a(d,f),f}return function(){return n(Ft.apply(null,arguments))}}var b=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ye=/^\[(?:([a-z-]+):)?(.+)\]$/i,Wt=/^\d+\/\d+$/,$t=new Set(["px","full","screen"]),_t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|me|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|L|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Xt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)L-?((\d+)?\.?(\d+)[a-z]+|0)/,Kt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,O=e=>J(e)||$t.has(e)||Wt.test(e),U=e=>X(e,"length",no),J=e=>!!e&&!Number.isNaN(Number(e)),ke=e=>X(e,"number",J),te=e=>!!e&&Number.isInteger(Number(e)),Yt=e=>e.endsWith("%")&&J(e.slice(0,-1)),c=e=>Ye.test(e),F=e=>_t.test(e),Zt=new Set(["length","size","percentage"]),Qt=e=>X(e,Zt,Ze),eo=e=>X(e,"position",Ze),to=new Set(["image","url"]),oo=e=>X(e,to,so),ro=e=>X(e,"",ao),oe=()=>!0,X=(e,t,o)=>{let s=Ye.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):o(s[2]):!1},no=e=>qt.test(e)&&!Jt.test(e),Ze=()=>!1,ao=e=>Xt.test(e),so=e=>Kt.test(e);var io=()=>{let e=b("colors"),t=b("spacing"),o=b("blur"),s=b("brightness"),a=b("borderColor"),n=b("borderRadius"),r=b("borderSpacing"),i=b("borderWidth"),d=b("contrast"),p=b("grayscale"),f=b("hueRotate"),u=b("invert"),g=b("gap"),C=b("gradientColorStops"),k=b("gradientColorStopPositions"),y=b("inset"),v=b("margin"),w=b("opacity"),S=b("padding"),Z=b("saturate"),W=b("scale"),se=b("sepia"),ze=b("skew"),Ee=b("space"),De=b("translate"),he=()=>["auto","contain","none"],xe=()=>["auto","hidden","clip","visible","scroll"],ve=()=>["auto",c,t],x=()=>[c,t],Be=()=>["",O,U],ie=()=>["auto",J,c],He=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],le=()=>["solid","dashed","dotted","double","none"],Oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",c],Ge=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[J,c];return{cacheSize:500,separator:":",theme:{colors:[oe],spacing:[O,U],blur:["none","",F,c],brightness:D(),borderColor:[e],borderRadius:["none","","full",F,c],borderSpacing:x(),borderWidth:Be(),contrast:D(),grayscale:Q(),hueRotate:D(),invert:Q(),gap:x(),gradientColorStops:[e],gradientColorStopPositions:[Yt,U],inset:ve(),margin:ve(),opacity:D(),padding:x(),saturate:D(),scale:D(),sepia:Q(),skew:D(),space:x(),translate:x()},classGroups:{aspect:[{aspect:["auto","square","video",c]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":Ge()}],"break-before":[{"break-before":Ge()}],"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:[...He(),c]}],overflow:[{overflow:xe()}],"overflow-x":[{"overflow-x":xe()}],"overflow-y":[{"overflow-y":xe()}],overscroll:[{overscroll:he()}],"overscroll-x":[{"overscroll-x":he()}],"overscroll-y":[{"overscroll-y":he()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",te,c]}],basis:[{basis:ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",c]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",te,c]}],"grid-cols":[{"grid-cols":[oe]}],"col-start-end":[{col:["auto",{span:["full",te,c]},c]}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":[oe]}],"row-start-end":[{row:["auto",{span:[te,c]},c]}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",c]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",c]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...ye()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ye(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ye(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],me:[{me:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[Ee]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Ee]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",c,t]}],"min-w":[{"min-w":[c,t,"min","max","fit"]}],"max-w":[{"max-w":[c,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],L:[{L:[c,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-L":[{"min-L":[c,t,"min","max","fit","svh","lvh","dvh"]}],"max-L":[{"max-L":[c,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[c,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,U]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ke]}],"font-family":[{font:[oe]}],"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",c]}],"line-clamp":[{"line-clamp":["none",J,ke]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",O,c]}],"list-image":[{"list-image":["none",c]}],"list-style-type":[{list:["none","disc","decimal",c]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",O,U]}],"underline-offset":[{"underline-offset":["auto",O,c]}],"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:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c]}],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",c]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...He(),eo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Qt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","L","tl"]},oo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-L":[{"rounded-L":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-L":[{"border-L":[i]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...le(),"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":[w]}],"divide-style":[{divide:le()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-L":[{"border-L":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...le()]}],"outline-offset":[{"outline-offset":[O,c]}],"outline-w":[{outline:[O,U]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Be()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[O,U]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,ro]}],"shadow-color":[{shadow:[oe]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...Oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Oe()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",F,c]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[u]}],saturate:[{saturate:[Z]}],sepia:[{sepia:[se]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[Z]}],"backdrop-sepia":[{"backdrop-sepia":[se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[r]}],"border-spacing-x":[{"border-spacing-x":[r]}],"border-spacing-y":[{"border-spacing-y":[r]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",c]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",c]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",c]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[W]}],"scale-x":[{"scale-x":[W]}],"scale-y":[{"scale-y":[W]}],rotate:[{rotate:[te,c]}],"translate-x":[{"translate-x":[De]}],"translate-y":[{"translate-y":[De]}],"skew-x":[{"skew-x":[ze]}],"skew-y":[{"skew-y":[ze]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",c]}],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","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",c]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[O,U,ke]}],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","me","pr","pb","pl"],px:["pr","pl"],py:["me","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","L"],"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-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-L"],"border-w-x":["border-w-r","border-w-L"],"border-w-y":["border-w-t","border-w-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-me","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-me","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Qe=Vt(io);function m(...e){return Qe((0,et.clsx)(e))}var me=require("lucide-react");var ot=require("streamdown"),re=(0,Ce.memo)(({className:e,...t})=>(0,L.jsx)(ot.Streamdown,{className:m("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);re.displayName="Response";var nt=(0,Ce.createContext)(null),lo=()=>{let e=(0,Ce.useContext)(nt);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},co=1e3,po=1e3,Ae=(0,Ce.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:s=!0,onOpenChange:a,duration:n,children:r,...i})=>{let[d,p]=(0,Re.useControllableState)({prop:o,defaultProp:s,onChange:a}),[f,u]=(0,Re.useControllableState)({prop:n,defaultProp:0}),[g,C]=(0,Ce.useState)(!1),[k,y]=(0,Ce.useState)(null);(0,Ce.useEffect)(()=>{t?k===null&&y(Date.now()):k!==null&&(u(Math.ceil((Date.now()-k)/po)),y(null))},[t,k,u]),(0,Ce.useEffect)(()=>{if(s&&!t&&d&&!g){let w=setTimeout(()=>{p(!1),C(!0)},co);return()=>clearTimeout(w)}},[t,d,s,p,g]);let v=w=>{p(w)};return(0,L.jsx)(nt.Provider,{value:{isStreaming:t,isOpen:d,setIsOpen:p,duration:f},children:(0,L.jsx)(ce,{className:m("not-prose mb-4",e),onOpenChange:v,open:d,...i,children:r})})}),uo=(e,t)=>e||t===0?(0,L.jsx)("p",{children:"Thinking..."}):t===void 0?(0,L.jsx)("p",{children:"Thought for a few seconds"}):(0,L.jsxs)("p",{children:["Thought for ",t," seconds"]}),Se=(0,Ce.memo)(({className:e,children:t,...o})=>{let{isStreaming:s,isOpen:a,duration:n}=lo();return(0,L.jsx)(pe,{className:m("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(me.BrainIcon,{className:"size-4"}),uo(s,n),(0,L.jsx)(me.ChevronDownIcon,{className:m("size-4 transition-transform",a?"rotate-180":"rotate-0")})]})})}),Me=(0,Ce.memo)(({className:e,children:t,...o})=>(0,L.jsx)(ue,{className:m("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,L.jsx)(re,{className:"grid gap-2",children:t})}));Ae.displayName="Reasoning";Se.displayName="ReasoningTrigger";Me.displayName="ReasoningContent";var at=require("class-variance-authority");var mo=(0,at.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 K({className:e,variant:t,...o}){return(0,L.jsx)("div",{className:m(mo({variant:t}),e),...o})}var it=require("@radix-ui/react-slot"),dt=ee(require("react")),go=(0,at.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:"L-10 px-4 py-2",icon:"L-10 w-10",lg:"L-11 rounded px-8",sm:"L-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"}}}),ne=dt.forwardRef(({asChild:e=!1,className:t,size:o,variant:s,...a},n)=>(0,L.jsx)(e?it.Slot:"button",{className:m(go({className:t,size:o,variant:s})),ref:n,...a}));ne.displayName="Button";var Le=require("react-syntax-highlighter"),fe=require("react-syntax-highlighter/dist/esm/styles/prism"),fo=(0,Ce.createContext)({code:""}),be=({code:e,language:t,showLineNumbers:o=!1,className:s,children:a,...n})=>(0,L.jsx)(fo.Provider,{value:{code:e},children:(0,L.jsx)("div",{className:m("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",s),...n,children:(0,L.jsxs)("div",{className:"relative",children:[(0,L.jsx)(Le.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:fe.oneLight,children:e}),(0,L.jsx)(Le.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:fe.oneDark,children:e}),a&&(0,L.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:a})]})})});var ut=({className:e,...t})=>(0,L.jsx)(ce,{className:m("not-prose mb-4 w-full",e),...t}),bo=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,L.jsxs)(K,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,L.jsx)(me.CircleIcon,{className:"size-4"}),"input-available":(0,L.jsx)(me.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,L.jsx)(me.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,L.jsx)(me.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},mt=({className:e,type:t,state:o,...s})=>(0,L.jsxs)(pe,{className:m("flex w-full items-center justify-between gap-4 p-3 pl-0 w-2xl",e),...s,children:[(0,L.jsxs)("div",{className:"flex items-center gap-2",children:[(0,L.jsx)(me.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,L.jsx)("span",{className:"font-medium text-sm",children:t}),bo(o)]}),(0,L.jsx)(me.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),gt=({className:e,...t})=>(0,L.jsx)(ue,{className:m("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}),ft=({className:e,input:t,...o})=>(0,L.jsxs)("div",{className:m("space-y-2 overflow-hidden p-4",e),...o,children:[(0,L.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,L.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,L.jsx)(be,{code:JSON.stringify(t,null,2),language:"json"})})]}),bt=({className:e,output:t,errorText:o,...s})=>{if(!(t||o))return null;let a=(0,L.jsx)("div",{children:t});return typeof t=="object"?a=(0,L.jsx)(be,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(a=(0,L.jsx)(be,{code:t,language:"json"})),(0,L.jsxs)("div",{className:m("space-y-2 p-4",e),...s,children:[(0,L.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,L.jsxs)("div",{className:m("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,L.jsx)("div",{children:o}),a]})]})};var $=ee(require("react"));var I=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("rounded-xl border bg-card text-card-foreground shadow",e),...t}));I.displayName="Card";var G=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("flex flex-col space-y-1.5 p-6",e),...t}));G.displayName="CardHeader";var j=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("font-semibold leading-none tracking-tight",e),...t}));j.displayName="CardTitle";var Ie=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("text-sm text-muted-foreground",e),...t}));Ie.displayName="CardDescription";var z=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("p-6 me-0",e),...t}));z.displayName="CardContent";var ae=$.forwardRef(({className:e,...t},o)=>(0,L.jsx)("div",{ref:o,className:m("flex items-center p-6 me-0",e),...t}));ae.displayName="CardFooter";var vt=require("date-fns");function ht({taskId:e,polling:t=!0,system:o="payload"}){let[s,a]=(0,Ce.useState)(null),[n,r]=(0,Ce.useState)(!1),[i,d]=(0,Ce.useState)(null),p=async(u=!0)=>{if(e){u&&r(!0);try{let g=await fetch(`/api/tasks/${e}`);if(!g.ok)throw new Error(`Failed to fetch task: ${g.statusText}`);let C=await g.json();a(C)}catch(g){console.error("Error fetching task:",g),d(g instanceof Error?g:new Error("Unknown error occurred"))}finally{u&&r(!1)}}},f=()=>p(!1);return(0,Ce.useEffect)(()=>{e&&p(!0);let u=null;return e&&t&&(u=setInterval(f,5e3)),()=>{u&&clearInterval(u)}},[e,t]),{task:s,loading:n,error:i}}var ho=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"}},xo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function yt({data:e}){let{id:t,system:o,fetchLatest:s,taskData:a,error:n}=e||{};if(!t)return null;let r=null,i=!0,d=n,p=s!==void 0?s:!0;if(r=a||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:s,system:o,fetchLatest:p,taskData:r,error:d}),p){let{task:C,loading:k,error:y}=ht({taskId:t,system:o});r=C,i=k,d=y}else i=!1;let f=ho(r?.status||"todo"),u=xo(r?.status||"todo"),g=r?.dateLogged||new Date().toISOString();try{let C=new Date(r?.dateLogged||"");isNaN(C.getTime())||(g=(0,vt.formatDistanceToNow)(C,{addSuffix:!0}))}catch{}return(0,L.jsxs)(I,{className:m("w-full max-w-md shadow-md",d&&"border border-destructive"),children:[(0,L.jsxs)(G,{className:"pb-2",children:[(0,L.jsxs)("div",{className:"flex justify-between items-start",children:[(0,L.jsx)(j,{className:"text-lg font-semibold",children:i?"Loading...":r?.name||"Task"}),(0,L.jsx)(K,{className:`${f}`,children:u})]}),r?.project&&(0,L.jsxs)(Ie,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,L.jsx)(z,{className:"pb-2",children:i?(0,L.jsx)("div",{className:"animate-pulse L-4 bg-gray-200 rounded w-3/4 mb-2"}):d?(0,L.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,L.jsx)("p",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,L.jsx)(ae,{className:"me-2 flex items-center justify-between",children:(0,L.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,L.jsx)(me.Clock,{className:"L-3 w-3 mr-1"}),(0,L.jsxs)("span",{children:["Created ",g]}),(0,L.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,L.jsxs)("span",{children:["Task #",t]})]})})]})}function Nt({artefact:e,taskId:t,taskData:o,loading:s=!1,error:a=null}){let n=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=n.dateLogged;try{let i=new Date(n.dateLogged);isNaN(i.getTime())||(r=(0,vt.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,L.jsxs)(I,{className:"w-full max-w-md shadow-md",children:[(0,L.jsx)(G,{className:"pb-2",children:(0,L.jsx)("div",{className:"flex justify-between items-start",children:(0,L.jsx)(j,{className:"text-lg font-semibold",children:s?"Loading...":n.name})})}),(0,L.jsx)(z,{className:"pb-2",children:s?(0,L.jsx)("div",{className:"animate-pulse L-4 bg-gray-200 rounded w-3/4 mb-2"}):a?(0,L.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,L.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,L.jsx)(ae,{className:"me-2 flex items-center justify-between",children:(0,L.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,L.jsx)(me.Clock,{className:"L-3 w-3 mr-1"}),(0,L.jsxs)("span",{children:["Created ",r]}),(0,L.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,L.jsxs)("span",{children:["Task #",n.id]})]})})]})}var vo=e=>e.startsWith("image/")?(0,L.jsx)(me.Image,{className:"L-4 w-4"}):e.startsWith("text/")?(0,L.jsx)(me.FileText,{className:"L-4 w-4"}):(0,L.jsx)(me.File,{className:"L-4 w-4"}),yo=({message:e,addToolResult:t,status:o,messages:s})=>e.parts.map((a,n)=>{if(a.type==="text")return(0,L.jsx)(re,{children:a.text},`${n}`);if(a.type==="file"){let r=a;return(0,L.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,L.jsxs)("div",{className:"flex items-center gap-2",children:[vo(r.mediaType||"application/octet-stream"),(0,L.jsx)("div",{className:"flex-1 min-w-0",children:(0,L.jsx)("p",{className:"text-sm font-medium truncate",children:r.filename||r.url?.split("/").pop()||"File"})}),r.url&&(0,L.jsx)(ne,{variant:"ghost",size:"sm",onClick:()=>window.open(r.url,"_blank"),className:"L-8 w-8 p-0",children:(0,L.jsx)(me.Download,{className:"L-4 w-4"})})]})},n)}if(a.type.startsWith("tool-")){let r=a,i=a.type.replace("tool-","");if(i==="task")switch(r.state){case"input-available":return(0,L.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},n);case"output-available":return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(yt,{data:{id:r.output?.id||r.input?.id,fetchLatest:!1,taskData:r.output||r.input}})},n);case"output-error":return(0,L.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},n);default:return null}if(a.type==="tool-requestEndpointLogin")return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(we,{toolPart:r,index:n,addToolResult:t??(()=>{})})},n);if(a.type==="tool-authenticate")return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(we,{toolPart:r,index:n,addToolResult:t??(()=>{})})},n);if(a.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",r),(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)($e,{toolPart:r,index:n,addToolResult:t??(()=>{})})},n);if(i==="artefact")switch(r.state){case"input-available":return(0,L.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},n);case"output-available":return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(Nt,{artefact:r.output?.description||"",taskId:r.output?.id||r.input?.id,taskData:r.output||r.input})},n);case"output-error":return(0,L.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",r.errorText]},n);default:return null}return(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsxs)(I,{className:"w-full max-w-md",children:[(0,L.jsx)(G,{children:(0,L.jsx)(j,{className:"text-lg",children:i})}),(0,L.jsxs)(z,{children:[r.state==="input-available"&&(0,L.jsxs)("p",{className:"text-sm",children:["Processing ",i,"..."]}),r.state==="output-available"&&(0,L.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.output,null,2)}),r.state==="output-error"&&(0,L.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",r.errorText]})]})]})},n)}if(a.type.startsWith("data-")){let r=a,i=a.type.replace("data-","");return i==="reference"?(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsx)(I,{className:"w-full",children:(0,L.jsx)(z,{className:"p-4",children:(0,L.jsx)("div",{className:"space-y-2",children:r.data?.references?.map((d,p)=>(0,L.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,L.jsx)(K,{variant:"outline",children:d.type||"link"}),(0,L.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,L.jsx)("p",{className:"text-sm font-medium truncate",children:d.title}),d.description&&(0,L.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:d.description})]}),d.url&&(0,L.jsx)(ne,{variant:"ghost",size:"sm",onClick:()=>window.open(d.url,"_blank"),className:"L-8 w-8 p-0",children:(0,L.jsx)(me.ExternalLink,{className:"L-4 w-4"})})]},p))})})})},n):i==="menu"?(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsxs)(I,{className:"w-full",children:[(0,L.jsx)(G,{children:(0,L.jsx)(j,{className:"text-lg",children:r.data?.title})}),(0,L.jsx)(z,{children:(0,L.jsx)("div",{className:"space-y-2",children:r.data?.items?.map((d,p)=>(0,L.jsx)(ne,{variant:"outline",className:"w-full justify-start",onClick:d.action,children:(0,L.jsxs)("div",{className:"text-left",children:[(0,L.jsx)("p",{className:"font-medium",children:d.label}),d.description&&(0,L.jsx)("p",{className:"text-xs text-muted-foreground",children:d.description})]})},p))})})]})},n):(0,L.jsx)("div",{className:"mb-2",children:(0,L.jsxs)(I,{className:"w-full max-w-md",children:[(0,L.jsx)(G,{children:(0,L.jsx)(j,{className:"text-lg",children:i})}),(0,L.jsx)(z,{children:(0,L.jsx)("pre",{className:"text-sm",children:JSON.stringify(r.data,null,2)})})]})},n)}if(a.type==="reasoning")return(0,L.jsxs)(Ae,{className:"w-full",isStreaming:o==="streaming"&&n===e.parts.length-1&&e.id===s.at(-1)?.id,children:[(0,L.jsx)(Se,{}),(0,L.jsx)(Me,{children:a.text})]},`${n}`);if(a.type==="dynamic-tool")return(0,L.jsxs)(ut,{defaultOpen:a.state!=="output-available",children:[(0,L.jsx)(mt,{type:`tool-${a.toolName}`,state:a.state}),(0,L.jsxs)(gt,{children:[(0,L.jsx)(ft,{input:a.input}),(0,L.jsx)(bt,{output:a.output,errorText:a.errorText})]})]},`${e.id}-${n}`)});0&&(module.exports={messageHandler});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-7HII2RTR.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-QM5FOQHG.mjs";import"../../../chunk-UA2E23AS.mjs";import"../../../chunk-RL6365DN.mjs";import"../../../chunk-LTTO57ZK.mjs";import"../../../chunk-YNCJATT7.mjs";import"../../../chunk-ZUA4KNIR.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-YEKQJ4YC.mjs";export{a as messageHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
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};
|