cortex-react-components 2.15.0 → 2.16.0

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.
Files changed (104) hide show
  1. package/dist/{chunk-TILPSVAP.mjs → chunk-A5MYHSX7.mjs} +1 -1
  2. package/dist/{chunk-RX63ABAF.mjs → chunk-B7AXSCTN.mjs} +1 -1
  3. package/dist/{chunk-MFCVMJBO.mjs → chunk-BDDEMCAH.mjs} +1 -1
  4. package/dist/{chunk-XKGBG5FX.mjs → chunk-CBIULUZQ.mjs} +1 -1
  5. package/dist/{chunk-CJDUN6R4.mjs → chunk-DKRRVTCV.mjs} +1 -1
  6. package/dist/{chunk-D2H36ZLW.mjs → chunk-DXE6AGJX.mjs} +1 -1
  7. package/dist/{chunk-MDBYZZXI.mjs → chunk-ESPA7NWT.mjs} +1 -1
  8. package/dist/{chunk-A2KX5N75.mjs → chunk-EZKKO2SR.mjs} +1 -1
  9. package/dist/{chunk-PO3XUUWY.mjs → chunk-L5NPH5RX.mjs} +1 -1
  10. package/dist/{chunk-I2GNNRFH.mjs → chunk-LJOWXPWW.mjs} +1 -1
  11. package/dist/{chunk-AMVJPDM3.mjs → chunk-M527EJIX.mjs} +1 -1
  12. package/dist/{chunk-JTVWQ42C.mjs → chunk-N7BHIWS5.mjs} +1 -1
  13. package/dist/{chunk-R5SXUWYU.mjs → chunk-NWRU6YZM.mjs} +1 -1
  14. package/dist/chunk-R72ZFTOO.mjs +1 -0
  15. package/dist/{chunk-HSQAHQNP.mjs → chunk-TKCFCYEQ.mjs} +1 -1
  16. package/dist/chunk-UGBDJDPW.mjs +4 -0
  17. package/dist/{chunk-OLIYPWO3.mjs → chunk-UPDEVKI7.mjs} +1 -1
  18. package/dist/{chunk-2UNIT7NC.mjs → chunk-UPRS7OYQ.mjs} +1 -1
  19. package/dist/chunk-ZN7NNMB7.mjs +4 -0
  20. package/dist/components/Blocks/index.mjs +1 -1
  21. package/dist/components/CRM/CogeBoard.mjs +1 -1
  22. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  23. package/dist/components/CRM/index.mjs +1 -1
  24. package/dist/components/Chat/ChatInterface.js +6 -6
  25. package/dist/components/Chat/ChatInterface.mjs +1 -1
  26. package/dist/components/Chat/CopilotInterface.js +7 -7
  27. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  28. package/dist/components/Chat/PartTypes/CodeBlock.css +1 -0
  29. package/dist/components/Chat/PartTypes/CodeBlock.d.ts +15 -0
  30. package/dist/components/Chat/PartTypes/CodeBlock.js +4 -0
  31. package/dist/components/Chat/PartTypes/CodeBlock.mjs +2 -0
  32. package/dist/components/Chat/PartTypes/Tool.css +1 -0
  33. package/dist/components/Chat/PartTypes/Tool.d.ts +22 -0
  34. package/dist/components/Chat/PartTypes/Tool.js +5 -0
  35. package/dist/components/Chat/PartTypes/Tool.mjs +2 -0
  36. package/dist/components/Chat/PartTypes/index.d.ts +2 -0
  37. package/dist/components/Chat/PartTypes/index.js +6 -6
  38. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  39. package/dist/components/Chat/demo-long-messages.js +12 -12
  40. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  41. package/dist/components/Chat/demo-tests.js +27 -27
  42. package/dist/components/Chat/demo-tests.mjs +1 -1
  43. package/dist/components/Chat/demo.js +7 -7
  44. package/dist/components/Chat/demo.mjs +1 -1
  45. package/dist/components/Chat/example-usage.js +7 -7
  46. package/dist/components/Chat/example-usage.mjs +1 -1
  47. package/dist/components/Chat/example-with-vercel-ai.js +7 -7
  48. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  49. package/dist/components/Chat/index.js +11 -11
  50. package/dist/components/Chat/index.mjs +1 -1
  51. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  52. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  53. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  54. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  55. package/dist/components/DigitalColleagues/index.mjs +1 -1
  56. package/dist/components/Foundary/MainPage.mjs +1 -1
  57. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  58. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  59. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  60. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  61. package/dist/components/Foundary/Views/index.mjs +1 -1
  62. package/dist/components/Foundary/index.mjs +1 -1
  63. package/dist/components/HeaderFooter/Header.mjs +1 -1
  64. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  65. package/dist/components/HeaderFooter/index.mjs +1 -1
  66. package/dist/components/Heros/RenderHero.mjs +1 -1
  67. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  68. package/dist/components/Heros/index.mjs +1 -1
  69. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  70. package/dist/components/Layouts/Print.mjs +1 -1
  71. package/dist/components/Layouts/SlideShow.mjs +1 -1
  72. package/dist/components/Layouts/index.mjs +1 -1
  73. package/dist/components/Other/index.mjs +1 -1
  74. package/dist/components/Payload/index.mjs +1 -1
  75. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  76. package/dist/components/Projects/ProjectPage.mjs +1 -1
  77. package/dist/components/Projects/ProjectView.mjs +1 -1
  78. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  79. package/dist/components/Projects/index.mjs +1 -1
  80. package/dist/components/dc-temp/index.mjs +1 -1
  81. package/dist/components/index.js +14 -14
  82. package/dist/components/index.mjs +1 -1
  83. package/dist/globals.css +1 -1
  84. package/dist/index.js +25 -25
  85. package/dist/index.mjs +1 -1
  86. package/dist/metafile-cjs.json +1 -1
  87. package/dist/metafile-esm.json +1 -1
  88. package/dist/pages/Blog.mjs +1 -1
  89. package/dist/pages/Documentation.mjs +1 -1
  90. package/dist/pages/IndexPage.mjs +1 -1
  91. package/dist/pages/Intranet.mjs +1 -1
  92. package/dist/pages/LandingPage.mjs +1 -1
  93. package/dist/pages/Page.mjs +1 -1
  94. package/dist/pages/Publish.mjs +1 -1
  95. package/dist/pages/Website.mjs +1 -1
  96. package/dist/sections/AboutSection.mjs +1 -1
  97. package/dist/sections/BlogDetail.mjs +1 -1
  98. package/dist/sections/BlogList.mjs +1 -1
  99. package/dist/sections/PageSections.mjs +1 -1
  100. package/dist/sections/PricingSection.mjs +1 -1
  101. package/dist/sections/ServiceSection.mjs +1 -1
  102. package/dist/sections/index.mjs +1 -1
  103. package/package.json +5 -2
  104. package/dist/chunk-UTHKFW4R.mjs +0 -1
@@ -3,22 +3,22 @@
3
3
  "use client"
4
4
  'use client';
5
5
 
6
- "use strict";var _o=Object.create;var Nt=Object.defineProperty;var Jo=Object.getOwnPropertyDescriptor;var Xo=Object.getOwnPropertyNames;var Qo=Object.getPrototypeOf,Yo=Object.prototype.hasOwnProperty;var Zo=(e,t)=>{for(var a in t)Nt(e,a,{get:t[a],enumerable:!0})},Pa=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Xo(t))!Yo.call(e,l)&&l!==a&&Nt(e,l,{get:()=>t[l],enumerable:!(o=Jo(t,l))||o.enumerable});return e};var V=(e,t,a)=>(a=e!=null?_o(Qo(e)):{},Pa(t||!e||!e.__esModule?Nt(a,"default",{value:e,enumerable:!0}):a,e)),ei=e=>Pa(Nt({},"__esModule",{value:!0}),e);var vr={};Zo(vr,{ApprovalRequestModal:()=>ba,CapabilityMenu:()=>da,ChatCardArtefact:()=>Qt,ChatCardTask:()=>ft,ChatInterface:()=>Ht,ChatInterfaceMessages:()=>Fi,ChatMessage:()=>_t,CopilotInterface:()=>cr,OAuthModal:()=>ma,defaultColorScheme:()=>Xt,findCapabilityByPath:()=>ji,getAllCapabilities:()=>Hi,getCapabilityByTeam:()=>Oi,getContextualActions:()=>Rt,getDataPart:()=>br,getFileParts:()=>gr,getTextContent:()=>dr,getToolPart:()=>mr,hasDataPart:()=>fr,hasFilePart:()=>ur,hasToolPart:()=>pr,testCapabilities:()=>Tt});module.exports=ei(vr);var Oa=V(require("react"));var kt=V(require("react")),Ee=V(require("@radix-ui/react-avatar"));var Ba=require("clsx");var qt="-",ti=e=>{let t=oi(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let i=s.split(qt);return i[0]===""&&i.length!==1&&i.shift(),Ra(i,t)||ai(s)},getConflictingClassGroupIds:(s,i)=>{let d=a[s]||[];return i&&o[s]?[...d,...o[s]]:d}}},Ra=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),l=o?Ra(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;let r=e.join(qt);return t.validators.find(({validator:s})=>s(r))?.classGroupId},Da=/^\[(.+)\]$/,ai=e=>{if(Da.test(e)){let t=Da.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},oi=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return ri(Object.entries(e.classGroups),a).forEach(([r,s])=>{Gt(s,o,r,t)}),o},Gt=(e,t,a,o)=>{e.forEach(l=>{if(typeof l=="string"){let r=l===""?t:Ta(t,l);r.classGroupId=a;return}if(typeof l=="function"){if(ii(l)){Gt(l(o),t,a,o);return}t.validators.push({validator:l,classGroupId:a});return}Object.entries(l).forEach(([r,s])=>{Gt(s,Ta(t,r),a,o)})})},Ta=(e,t)=>{let a=e;return t.split(qt).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},ii=e=>e.isThemeGetter,ri=(e,t)=>t?e.map(([a,o])=>{let l=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([s,i])=>[t+s,i])):r);return[a,l]}):e,ni=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,l=(r,s)=>{a.set(r,s),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let s=a.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return l(r,s),s},set(r,s){a.has(r)?a.set(r,s):l(r,s)}}},Aa="!",si=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,l=t[0],r=t.length,s=i=>{let d=[],m=0,w=0,f;for(let x=0;x<i.length;x++){let P=i[x];if(m===0){if(P===l&&(o||i.slice(x,x+r)===t)){d.push(i.slice(w,x)),w=x+r;continue}if(P==="/"){f=x;continue}}P==="["?m++:P==="]"&&m--}let h=d.length===0?i:i.substring(w),R=h.startsWith(Aa),M=R?h.substring(1):h,T=f&&f>w?f-w:void 0;return{modifiers:d,hasImportantModifier:R,baseClassName:M,maybePostfixModifierPosition:T}};return a?i=>a({className:i,parseClassName:s}):s},li=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},ci=e=>({cache:ni(e.cacheSize),parseClassName:si(e),...ti(e)}),di=/\s+/,pi=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l}=t,r=[],s=e.trim().split(di),i="";for(let d=s.length-1;d>=0;d-=1){let m=s[d],{modifiers:w,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:R}=a(m),M=!!R,T=o(M?h.substring(0,R):h);if(!T){if(!M){i=m+(i.length>0?" "+i:i);continue}if(T=o(h),!T){i=m+(i.length>0?" "+i:i);continue}M=!1}let x=li(w).join(":"),P=f?x+Aa:x,F=P+T;if(r.includes(F))continue;r.push(F);let C=l(T,M);for(let z=0;z<C.length;++z){let ee=C[z];r.push(P+ee)}i=m+(i.length>0?" "+i:i)}return i};function mi(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Sa(t))&&(o&&(o+=" "),o+=a);return o}var Sa=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Sa(e[o]))&&(a&&(a+=" "),a+=t);return a};function ui(e,...t){let a,o,l,r=s;function s(d){let m=t.reduce((w,f)=>f(w),e());return a=ci(m),o=a.cache.get,l=a.cache.set,r=i,i(d)}function i(d){let m=o(d);if(m)return m;let w=pi(d,a);return l(d,w),w}return function(){return r(mi.apply(null,arguments))}}var H=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ma=/^\[(?:([a-z-]+):)?(.+)\]$/i,gi=/^\d+\/\d+$/,fi=new Set(["px","full","screen"]),bi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vi=/\d+(%|px|r?em|[sdl]?Pt([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|Pt|min|max))|\Pt(calc|min|max|clamp)\(.+\)|^0$/,hi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Be=e=>at(e)||fi.has(e)||gi.test(e),Ve=e=>ot(e,"length",Ri),at=e=>!!e&&!Number.isNaN(Number(e)),Wt=e=>ot(e,"number",at),mt=e=>!!e&&Number.isInteger(Number(e)),wi=e=>e.endsWith("%")&&at(e.slice(0,-1)),y=e=>Ma.test(e),$e=e=>bi.test(e),Ci=new Set(["length","size","percentage"]),Ni=e=>ot(e,Ci,Ia),ki=e=>ot(e,"position",Ia),Pi=new Set(["image","url"]),Di=e=>ot(e,Pi,Si),Ti=e=>ot(e,"",Ai),ut=()=>!0,ot=(e,t,a)=>{let o=Ma.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Ri=e=>vi.test(e)&&!hi.test(e),Ia=()=>!1,Ai=e=>yi.test(e),Si=e=>xi.test(e);var Mi=()=>{let e=H("colors"),t=H("spacing"),a=H("blur"),o=H("brightness"),l=H("borderColor"),r=H("borderRadius"),s=H("borderSpacing"),i=H("borderWidth"),d=H("contrast"),m=H("grayscale"),w=H("hueRotate"),f=H("invert"),h=H("gap"),R=H("gradientColorStops"),M=H("gradientColorStopPositions"),T=H("inset"),x=H("margin"),P=H("opacity"),F=H("padding"),C=H("saturate"),z=H("scale"),ee=H("sepia"),te=H("skew"),ae=H("space"),Z=H("translate"),q=()=>["auto","contain","none"],re=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",y,t],I=()=>[y,t],Ie=()=>["",Be,Ve],p=()=>["auto",at,y],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],u=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",y],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[at,y];return{cacheSize:500,separator:":",theme:{colors:[ut],spacing:[Be,Ve],blur:["none","",$e,y],brightness:A(),borderColor:[e],borderRadius:["none","","full",$e,y],borderSpacing:I(),borderWidth:Ie(),contrast:A(),grayscale:j(),hueRotate:A(),invert:j(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[wi,Ve],inset:de(),margin:de(),opacity:A(),padding:I(),saturate:A(),scale:A(),sepia:j(),skew:A(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",y]}],container:["container"],columns:[{columns:[$e]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"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:[...E(),y]}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[T]}],"inset-x":[{"inset-x":[T]}],"inset-y":[{"inset-y":[T]}],start:[{start:[T]}],end:[{end:[T]}],top:[{top:[T]}],right:[{right:[T]}],bottom:[{bottom:[T]}],left:[{left:[T]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mt,y]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",y]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",mt,y]}],"grid-cols":[{"grid-cols":[ut]}],"col-start-end":[{col:["auto",{span:["full",mt,y]},y]}],"col-start":[{"col-start":p()}],"col-end":[{"col-end":p()}],"grid-rows":[{"grid-rows":[ut]}],"row-start-end":[{row:["auto",{span:[mt,y]},y]}],"row-start":[{"row-start":p()}],"row-end":[{"row-end":p()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",y]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...u()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...u(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...u(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],it:[{it:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[ae]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ae]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",y,t]}],"min-w":[{"min-w":[y,t,"min","max","fit"]}],"max-w":[{"max-w":[y,t,"none","full","min","max","fit","prose",{screen:[$e]},$e]}],h:[{h:[y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$e,Ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Wt]}],"font-family":[{font:[ut]}],"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",y]}],"line-clamp":[{"line-clamp":["none",at,Wt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Be,y]}],"list-image":[{"list-image":["none",y]}],"list-style-type":[{list:["none","disc","decimal",y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Be,Ve]}],"underline-offset":[{"underline-offset":["auto",Be,y]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",y]}],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",y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),ki]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ni]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","Pt","bl","l","tl"]},Di]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[M]}],"gradient-via-pos":[{via:[M]}],"gradient-to-pos":[{to:[M]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-Pt":[{"rounded-Pt":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-Fa":[{"rounded-Fa":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"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-Pt":[{"border-Pt":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...L(),"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":[P]}],"divide-style":[{divide:L()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-Pt":[{"border-Pt":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[Be,y]}],"outline-w":[{outline:[Be,Ve]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[Be,Ve]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$e,Ti]}],"shadow-color":[{shadow:[ut]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",$e,y]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[ee]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",y]}],duration:[{duration:A()}],ease:[{ease:["linear","in","out","in-out",y]}],delay:[{delay:A()}],animate:[{animate:["none","spin","ping","pulse","bounce",y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[mt,y]}],"translate-x":[{"translate-x":[Z]}],"translate-y":[{"translate-y":[Z]}],"skew-x":[{"skew-x":[te]}],"skew-y":[{"skew-y":[te]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",y]}],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","Pt-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","Fa-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-it":[{"scroll-it":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Be,Ve,Wt]}],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","it","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-Pt","rounded-l","rounded-ss","rounded-Fa","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Fa","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-Pt":["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-Pt","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-Pt"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-Pt","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-Pt"],"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-it","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var La=ui(Mi);function c(...e){return La((0,Ba.clsx)(e))}var Pt=require("react/jsx-runtime"),be=kt.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(Ee.Root,{ref:a,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));be.displayName=Ee.Root.displayName;var We=kt.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(Ee.Image,{ref:a,className:c("aspect-square h-full w-full",e),...t}));We.displayName=Ee.Image.displayName;var ve=kt.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(Ee.Fallback,{ref:a,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ve.displayName=Ee.Fallback.displayName;var Xe=V(require("react"));var he=Xe.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)("div",{ref:a,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));he.displayName="Card";var ze=Xe.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)("div",{ref:a,className:c("flex flex-col space-y-1.5 p-6",e),...t}));ze.displayName="CardHeader";var Ue=Xe.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)("div",{ref:a,className:c("font-semibold leading-none tracking-tight",e),...t}));Ue.displayName="CardTitle";var Kt=Xe.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)("div",{ref:a,className:c("text-sm text-muted-foreground",e),...t}));Kt.displayName="CardDescription";var Te=Xe.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)("div",{ref:a,className:c("p-6 pt-0",e),...t}));Te.displayName="CardContent";var gt=Xe.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)("div",{ref:a,className:c("flex items-center p-6 pt-0",e),...t}));gt.displayName="CardFooter";var Ea=require("class-variance-authority");var Ii=(0,Ea.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 ge({className:e,variant:t,...a}){return(0,Pt.jsx)("div",{className:c(Ii({variant:t}),e),...a})}var Fa=require("lucide-react"),ja=require("date-fns");var it=require("react");function Ua({taskId:e,polling:t=!0,system:a="payload"}){let[o,l]=(0,it.useState)(null),[r,s]=(0,it.useState)(!1),[i,d]=(0,it.useState)(null),m=async(f=!0)=>{if(e){f&&s(!0);try{let h=await fetch(`/api/tasks/${e}`);if(!h.ok)throw new Error(`Failed to fetch task: ${h.statusText}`);let R=await h.json();l(R)}catch(h){console.error("Error fetching task:",h),d(h instanceof Error?h:new Error("Unknown error occurred"))}finally{f&&s(!1)}}},w=()=>m(!1);return(0,it.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(w,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:o,loading:r,error:i}}var Li=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"}},Bi=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function ft({data:e}){let{id:t,system:a,fetchLatest:o,taskData:l,error:r}=e||{};if(!t)return null;let s=null,i=!0,d=r,m=o!==void 0?o:!0;if(s=l||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:m,taskData:s,error:d}),m){let{task:R,loading:M,error:T}=Ua({taskId:t,system:a});s=R,i=M,d=T}else i=!1;let w=Li(s?.status||"todo"),f=Bi(s?.status||"todo"),h=s?.dateLogged||new Date().toISOString();try{let R=new Date(s?.dateLogged||"");isNaN(R.getTime())||(h=(0,ja.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,Pt.jsxs)(he,{className:c("w-full max-w-md shadow-md",d&&"border border-destructive"),children:[(0,Pt.jsxs)(ze,{className:"pb-2",children:[(0,Pt.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Pt.jsx)(Ue,{className:"text-lg font-semibold",children:i?"Loading...":s?.name||"Task"}),(0,Pt.jsx)(ge,{className:`${w}`,children:f})]}),s?.project&&(0,Pt.jsxs)(Kt,{className:"text-sm text-gray-500",children:["Project: ",s.project.name]})]}),(0,Pt.jsx)(Te,{className:"pb-2",children:i?(0,Pt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):d?(0,Pt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Pt.jsx)("p",{className:"text-sm text-foreground",children:s?.description||"......."})}),(0,Pt.jsx)(gt,{className:"pt-2 flex items-center justify-between",children:(0,Pt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Pt.jsx)(Fa.Clock,{className:"h-3 w-3 mr-1"}),(0,Pt.jsxs)("span",{children:["Created ",h]}),(0,Pt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Pt.jsxs)("span",{children:["Task #",t]})]})})]})}var Ei={task:ft},zi=`
6
+ "use strict";var si=Object.create;var Dt=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var di=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty;var mi=(e,t)=>{for(var o in t)Dt(e,o,{get:t[o],enumerable:!0})},zo=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ci(t))!pi.call(e,r)&&r!==o&&Dt(e,r,{get:()=>t[r],enumerable:!(a=li(t,r))||a.enumerable});return e};var V=(e,t,o)=>(o=e!=null?si(di(e)):{},zo(t||!e||!e.__esModule?Dt(o,"default",{value:e,enumerable:!0}):o,e)),ui=e=>zo(Dt({},"__esModule",{value:!0}),e);var Mr={};mi(Mr,{ApprovalRequestModal:()=>Do,CapabilityMenu:()=>wo,ChatCardArtefact:()=>so,ChatCardTask:()=>ht,ChatInterface:()=>Qt,ChatInterfaceMessages:()=>Qi,ChatMessage:()=>io,CopilotInterface:()=>kr,OAuthModal:()=>No,defaultColorScheme:()=>no,findCapabilityByPath:()=>Yi,getAllCapabilities:()=>er,getCapabilityByTeam:()=>Zi,getContextualActions:()=>Mt,getDataPart:()=>Ir,getFileParts:()=>Sr,getTextContent:()=>Pr,getToolPart:()=>Dr,hasDataPart:()=>Ar,hasFilePart:()=>Rr,hasToolPart:()=>Tr,testCapabilities:()=>It});module.exports=ui(Mr);var Qo=V(require("react"));var Rt=V(require("react")),Ue=V(require("@radix-ui/react-avatar"));var Go=require("clsx");var oo="-",gi=e=>{let t=bi(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:l=>{let s=l.split(oo);return s[0]===""&&s.length!==1&&s.shift(),jo(s,t)||fi(l)},getConflictingClassGroupIds:(l,s)=>{let d=o[l]||[];return s&&a[l]?[...d,...a[l]]:d}}},jo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),r=a?jo(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;let n=e.join(oo);return t.validators.find(({validator:l})=>l(n))?.classGroupId},Uo=/^\[(.+)\]$/,fi=e=>{if(Uo.test(e)){let t=Uo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},bi=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return hi(Object.entries(e.classGroups),o).forEach(([n,l])=>{to(l,a,n,t)}),a},to=(e,t,o,a)=>{e.forEach(r=>{if(typeof r=="string"){let n=r===""?t:Fo(t,r);n.classGroupId=o;return}if(typeof r=="function"){if(vi(r)){to(r(a),t,o,a);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([n,l])=>{to(l,Fo(t,n),o,a)})})},Fo=(e,t)=>{let o=e;return t.split(oo).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},vi=e=>e.isThemeGetter,hi=(e,t)=>t?e.map(([o,a])=>{let r=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,s])=>[t+l,s])):n);return[o,r]}):e,yi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,r=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,a=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=a.get(n))!==void 0)return r(n,l),l},set(n,l){o.has(n)?o.set(n,l):r(n,l)}}},Oo="!",xi=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,r=t[0],n=t.length,l=s=>{let d=[],m=0,C=0,f;for(let x=0;x<s.length;x++){let T=s[x];if(m===0){if(T===r&&(a||s.slice(x,x+n)===t)){d.push(s.slice(C,x)),C=x+n;continue}if(T==="/"){f=x;continue}}T==="["?m++:T==="]"&&m--}let h=d.length===0?s:s.substring(C),S=h.startsWith(Oo),I=S?h.substring(1):h,R=f&&f>C?f-C:void 0;return{modifiers:d,hasImportantModifier:S,baseClassName:I,maybePostfixModifierPosition:R}};return o?s=>o({className:s,parseClassName:l}):l},wi=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},Ci=e=>({cache:yi(e.cacheSize),parseClassName:xi(e),...gi(e)}),Ni=/\s+/,ki=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r}=t,n=[],l=e.trim().split(Ni),s="";for(let d=l.length-1;d>=0;d-=1){let m=l[d],{modifiers:C,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:S}=o(m),I=!!S,R=a(I?h.substring(0,S):h);if(!R){if(!I){s=m+(s.length>0?" "+s:s);continue}if(R=a(h),!R){s=m+(s.length>0?" "+s:s);continue}I=!1}let x=wi(C).join(":"),T=f?x+Oo:x,F=T+R;if(n.includes(F))continue;n.push(F);let N=r(R,I);for(let z=0;z<N.length;++z){let te=N[z];n.push(T+te)}s=m+(s.length>0?" "+s:s)}return s};function Pi(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ho(t))&&(a&&(a+=" "),a+=o);return a}var Ho=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Ho(e[a]))&&(o&&(o+=" "),o+=t);return o};function Ti(e,...t){let o,a,r,n=l;function l(d){let m=t.reduce((C,f)=>f(C),e());return o=Ci(m),a=o.cache.get,r=o.cache.set,n=s,s(d)}function s(d){let m=a(d);if(m)return m;let C=ki(d,o);return r(d,C),C}return function(){return n(Pi.apply(null,arguments))}}var H=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},$o=/^\[(?:([a-z-]+):)?(.+)\]$/St,Di=/^\d+\/\d+$/,Ri=new Set(["px","full","screen"]),Si=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ai=/\d+(%|px|r?em|[sdl]?St([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|St|St|min|max))|\St(calc|min|max|clamp)\(.+\)|^0$/,Ii=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Mi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ze=e=>rt(e)||Ri.has(e)||Di.test(e),We=e=>nt(e,"length",Hi),rt=e=>!!e&&!Number.isNaN(Number(e)),eo=e=>nt(e,"number",rt),ft=e=>!!e&&Number.isInteger(Number(e)),Li=e=>e.endsWith("%")&&rt(e.slice(0,-1)),y=e=>$o.test(e),Ge=e=>Si.test(e),Ei=new Set(["length","size","percentage"]),zi=e=>nt(e,Ei,Vo),Ui=e=>nt(e,"position",Vo),Fi=new Set(["image","url"]),ji=e=>nt(e,Fi,Vi),Oi=e=>nt(e,"",$St),bt=()=>!0,nt=(e,t,o)=>{let a=$o.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Hi=e=>Ai.test(e)&&!Ii.test(e),Vo=()=>!1,$St=e=>Mi.test(e),Vi=e=>Bi.test(e);var Wi=()=>{let e=H("colors"),t=H("spacing"),o=H("blur"),a=H("brightness"),r=H("borderColor"),n=H("borderRadius"),l=H("borderSpacing"),s=H("borderWidth"),d=H("contrast"),m=H("grayscale"),C=H("hueRotate"),f=H("invert"),h=H("gap"),S=H("gradientColorStops"),I=H("gradientColorStopPositions"),R=H("inset"),x=H("margin"),T=H("opacity"),F=H("padding"),N=H("saturate"),z=H("scale"),te=H("sepia"),oe=H("skew"),ae=H("space"),ee=H("translate"),K=()=>["auto","contain","none"],ne=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",y,t],M=()=>[y,t],Le=()=>["",ze,We],p=()=>["auto",rt,y],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],u=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",y],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>[rt,y];return{cacheSize:500,separator:":",theme:{colors:[bt],spacing:[ze,We],blur:["none","",Ge,y],brightness:w(),borderColor:[e],borderRadius:["none","","full",Ge,y],borderSpacing:M(),borderWidth:Le(),contrast:w(),grayscale:j(),hueRotate:w(),invert:j(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Li,We],inset:me(),margin:me(),opacity:w(),padding:M(),saturate:w(),scale:w(),sepia:j(),skew:w(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",y]}],container:["container"],columns:[{columns:[Ge]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:[...E(),y]}],overflow:[{overflow:ne()}],"overflow-x":[{"overflow-x":ne()}],"overflow-y":[{"overflow-y":ne()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-y":[{"inset-y":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ft,y]}],basis:[{basis:me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",y]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",ft,y]}],"grid-cols":[{"grid-cols":[bt]}],"col-start-end":[{col:["auto",{span:["full",ft,y]},y]}],"col-start":[{"col-start":p()}],"col-end":[{"col-end":p()}],"grid-rows":[{"grid-rows":[bt]}],"row-start-end":[{row:["auto",{span:[ft,y]},y]}],"row-start":[{"row-start":p()}],"row-end":[{"row-end":p()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",y]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...u()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...u(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...u(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],St:[{St:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[ae]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ae]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",y,t]}],"min-w":[{"min-w":[y,t,"min","max","fit"]}],"max-w":[{"max-w":[y,t,"none","full","min","max","fit","prose",{screen:[Ge]},Ge]}],h:[{h:[y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ge,We]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",eo]}],"font-family":[{font:[bt]}],"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",y]}],"line-clamp":[{"line-clamp":["none",rt,eo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ze,y]}],"list-image":[{"list-image":["none",y]}],"list-style-type":[{list:["none","disc","decimal",y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ze,We]}],"underline-offset":[{"underline-offset":["auto",ze,y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",y]}],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",y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),Ui]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","St","bl","l","tl"]},ji]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-St":[{"rounded-St":[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:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-St":[{"border-St":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:B()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-St":[{"border-St":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[ze,y]}],"outline-w":[{outline:[ze,We]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-w":[{"ring-offset":[ze,We]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ge,Oi]}],"shadow-color":[{shadow:[bt]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ge,y]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[f]}],saturate:[{saturate:[N]}],sepia:[{sepia:[te]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",y]}],duration:[{duration:w()}],ease:[{ease:["linear","in","out","in-out",y]}],delay:[{delay:w()}],animate:[{animate:["none","spin","ping","pulse","bounce",y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[ft,y]}],"translate-x":[{"translate-x":[ee]}],"translate-y":[{"translate-y":[ee]}],"skew-x":[{"skew-x":[oe]}],"skew-y":[{"skew-y":[oe]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",y]}],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",y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-St":[{"scroll-St":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ze,We,eo]}],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","St","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-St","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-St":["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-St","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-St"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-St","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-St"],"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-St","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Wo=Ti(Wi);function c(...e){return Wo((0,Go.clsx)(e))}var St=require("react/jsx-runtime"),ve=Rt.forwardRef(({className:e,...t},o)=>(0,St.jsx)(Ue.Root,{ref:o,className:c("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ve.displayName=Ue.Root.displayName;var qe=Rt.forwardRef(({className:e,...t},o)=>(0,St.jsx)(Ue.Image,{ref:o,className:c("aspect-square h-full w-full",e),...t}));qe.displayName=Ue.Image.displayName;var he=Rt.forwardRef(({className:e,...t},o)=>(0,St.jsx)(Ue.Fallback,{ref:o,className:c("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));he.displayName=Ue.Fallback.displayName;var Ze=V(require("react"));var ye=Ze.forwardRef(({className:e,...t},o)=>(0,St.jsx)("div",{ref:o,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ye.displayName="Card";var Fe=Ze.forwardRef(({className:e,...t},o)=>(0,St.jsx)("div",{ref:o,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Fe.displayName="CardHeader";var je=Ze.forwardRef(({className:e,...t},o)=>(0,St.jsx)("div",{ref:o,className:c("font-semibold leading-none tracking-tight",e),...t}));je.displayName="CardTitle";var ao=Ze.forwardRef(({className:e,...t},o)=>(0,St.jsx)("div",{ref:o,className:c("text-sm text-muted-foreground",e),...t}));ao.displayName="CardDescription";var Se=Ze.forwardRef(({className:e,...t},o)=>(0,St.jsx)("div",{ref:o,className:c("p-6 pt-0",e),...t}));Se.displayName="CardContent";var vt=Ze.forwardRef(({className:e,...t},o)=>(0,St.jsx)("div",{ref:o,className:c("flex items-center p-6 pt-0",e),...t}));vt.displayName="CardFooter";var qo=require("class-variance-authority");var Gi=(0,qo.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 le({className:e,variant:t,...o}){return(0,St.jsx)("div",{className:c(Gi({variant:t}),e),...o})}var Jo=require("lucide-react"),Xo=require("date-fns");var st=require("react");function _o({taskId:e,polling:t=!0,system:o="payload"}){let[a,r]=(0,st.useState)(null),[n,l]=(0,st.useState)(!1),[s,d]=(0,st.useState)(null),m=async(f=!0)=>{if(e){f&&l(!0);try{let h=await fetch(`/api/tasks/${e}`);if(!h.ok)throw new Error(`Failed to fetch task: ${h.statusText}`);let S=await h.json();r(S)}catch(h){console.error("Error fetching task:",h),d(h instanceof Error?h:new Error("Unknown error occurred"))}finally{f&&l(!1)}}},C=()=>m(!1);return(0,st.useEffect)(()=>{e&&m(!0);let f=null;return e&&t&&(f=setInterval(C,5e3)),()=>{f&&clearInterval(f)}},[e,t]),{task:a,loading:n,error:s}}var qi=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"}},Ki=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function ht({data:e}){let{id:t,system:o,fetchLatest:a,taskData:r,error:n}=e||{};if(!t)return null;let l=null,s=!0,d=n,m=a!==void 0?a:!0;if(l=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:m,taskData:l,error:d}),m){let{task:S,loading:I,error:R}=_o({taskId:t,system:o});l=S,s=I,d=R}else s=!1;let C=qi(l?.status||"todo"),f=Ki(l?.status||"todo"),h=l?.dateLogged||new Date().toISOString();try{let S=new Date(l?.dateLogged||"");isNaN(S.getTime())||(h=(0,Xo.formatDistanceToNow)(S,{addSuffix:!0}))}catch{}return(0,St.jsxs)(ye,{className:c("w-full max-w-md shadow-md",d&&"border border-destructive"),children:[(0,St.jsxs)(Fe,{className:"pb-2",children:[(0,St.jsxs)("div",{className:"flex justify-between items-start",children:[(0,St.jsx)(je,{className:"text-lg font-semibold",children:s?"Loading...":l?.name||"Task"}),(0,St.jsx)(le,{className:`${C}`,children:f})]}),l?.project&&(0,St.jsxs)(ao,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,St.jsx)(Se,{className:"pb-2",children:s?(0,St.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):d?(0,St.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,St.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,St.jsx)(vt,{className:"pt-2 flex items-center justify-between",children:(0,St.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,St.jsx)(Jo.Clock,{className:"h-3 w-3 mr-1"}),(0,St.jsxs)("span",{children:["Created ",h]}),(0,St.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,St.jsxs)("span",{children:["Task #",t]})]})})]})}var _i={task:ht},Ji=`
7
7
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white" width="20" height="20">
8
8
  <path d="M327.5 85.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 128l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 128l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 64 426.8 7.5C425.1 3 420.8 0 416 0s-9.1 3-10.8 7.5L384 64 327.5 85.2zM205.1 73.3c-2.6-5.7-8.3-9.3-14.5-9.3s-11.9 3.6-14.5 9.3L123.3 187.3 9.3 240C3.6 242.6 0 248.3 0 254.6s3.6 11.9 9.3 14.5l114.1 52.7L176 435.8c2.6 5.7 8.3 9.3 14.5 9.3s11.9-3.6 14.5-9.3l52.7-114.1 114.1-52.7c5.7-2.6 9.3-8.3 9.3-14.5s-3.6-11.9-9.3-14.5L257.8 187.4 205.1 73.3zM384 384l-56.5 21.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 448l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 448l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 384l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L384 384z"/>
9
- </svg>`,Ui=`data:image/svg+xml;utf8,${encodeURIComponent(zi)}`,_t=Oa.default.memo(function(t){let{id:a,message:o,currentUser:l,role:r}=t,s=r==="user",i=s?l?.name||"You":l?.name||"AI Assistant",d=s?l?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,Pt.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${s?"flex-row-reverse":""}`,children:["Forwarding to ",o?.data?.content]},a);case"text":return(0,Pt.jsxs)("div",{className:`flex items-start gap-3 ${s?"flex-row-reverse":""}`,children:[s?(0,Pt.jsxs)(be,{children:[(0,Pt.jsx)(We,{src:d,alt:i}),(0,Pt.jsx)(ve,{children:i.substring(0,2).toUpperCase()})]}):(0,Pt.jsx)("img",{src:Ui,alt:"AI Assistant",className:"w-10 h-10"}),(0,Pt.jsxs)("div",{className:`grid gap-1.5 ${s?"text-right":""}`,children:[(0,Pt.jsx)("div",{className:"flex items-center gap-2",children:(0,Pt.jsx)("span",{className:"font-medium",children:i})}),(0,Pt.jsx)("div",{className:`rounded-lg p-3 text-sm ${s?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,Pt.jsxs)("div",{className:`flex items-start gap-3 ${s?"flex-row-reverse":""}`,children:[(0,Pt.jsxs)(be,{className:s?"":"ai-border",children:[(0,Pt.jsx)(We,{src:d,alt:i}),(0,Pt.jsx)(ve,{children:i.substring(0,2).toUpperCase()})]}),(0,Pt.jsxs)("div",{className:`grid gap-1.5 ${s?"text-right":""}`,children:[(0,Pt.jsx)("div",{className:"flex items-center gap-2",children:(0,Pt.jsx)("span",{className:"font-medium",children:i})}),(0,Pt.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${s?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let m=Ei[o.data.tool];return m?(0,Pt.jsx)("div",{className:"mt-2",children:(0,Pt.jsx)(m,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,Pt.jsx)("div",{className:"mt-2",children:"......"}))}}});var Jt=V(require("react")),ye=V(require("@radix-ui/react-scroll-area"));var xe=Jt.forwardRef(({className:e,children:t,...a},o)=>(0,Pt.jsxs)(ye.Root,{ref:o,className:c("relative overflow-hidden",e),...a,children:[(0,Pt.jsx)(ye.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Pt.jsx)(Ha,{}),(0,Pt.jsx)(ye.Corner,{})]}));xe.displayName=ye.Root.displayName;var Ha=Jt.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Pt.jsx)(ye.ScrollAreaScrollbar,{ref:o,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,Pt.jsx)(ye.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Ha.displayName=ye.ScrollAreaScrollbar.displayName;function Fi({messages:e,isLoading:t}){let a=(0,it.useRef)(null);return(0,it.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Pt.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,Pt.jsxs)(xe,{className:"container flex-1 p-4",children:[(0,Pt.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,Pt.jsx)("div",{className:"flex items-center justify-center h-full pt-60",children:(0,Pt.jsxs)("div",{className:"text-center max-w-md",children:[(0,Pt.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,Pt.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question to a business function directly using the toolbar below."})]})}),t&&(0,Pt.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Pt.jsxs)(be,{className:"ai-border",children:[(0,Pt.jsx)(We,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Pt.jsx)(ve,{children:"AI"})]}),(0,Pt.jsxs)("div",{className:"grid gap-1.5",children:[(0,Pt.jsx)("div",{className:"flex items-center gap-2",children:(0,Pt.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,Pt.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,Pt.jsxs)("div",{className:"flex space-x-2",children:[(0,Pt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,Pt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Pt.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,l)=>(0,Pt.jsx)(_t,{...o},l))]}),(0,Pt.jsx)("div",{ref:a})]})})}var Xt={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},Tt=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function ji(e){let t=Tt,a=null;for(let o of e){if(a=t.find(l=>l.id===o||l.name===o)||null,!a)return null;t=a.children||[]}return a}function Rt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Oi(e){return Tt.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function Hi(){return Tt}function Qt({artefact:e,taskId:t,taskData:a,loading:o=!1,error:l=null}){let r=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},s=r.dateLogged;try{let i=new Date(r.dateLogged);isNaN(i.getTime())||(s=(0,$a.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,Pt.jsxs)(he,{className:"w-full max-w-md shadow-md",children:[(0,Pt.jsx)(ze,{className:"pb-2",children:(0,Pt.jsx)("div",{className:"flex justify-between items-start",children:(0,Pt.jsx)(Ue,{className:"text-lg font-semibold",children:o?"Loading...":r.name})})}),(0,Pt.jsx)(Te,{className:"pb-2",children:o?(0,Pt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):l?(0,Pt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Pt.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Pt.jsx)(gt,{className:"pt-2 flex items-center justify-between",children:(0,Pt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Pt.jsx)(Fa.Clock,{className:"h-3 w-3 mr-1"}),(0,Pt.jsxs)("span",{children:["Created ",s]}),(0,Pt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Pt.jsxs)("span",{children:["Task #",r.id]})]})})]})}var Bo=require("@ai-sdk/react"),Vt=require("motion/react");var zt=V(require("react")),oa=V(require("next/link"));var Wa=require("@radix-ui/react-slot"),qa=V(require("react")),Vi=(0,Ea.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),S=qa.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...l},r)=>(0,Pt.jsx)(e?Wa.Slot:"button",{className:c(Vi({className:t,size:a,variant:o})),ref:r,...l}));S.displayName="Button";var _a=V(require("react"));var bt=_a.forwardRef(({className:e,type:t,...a},o)=>(0,Pt.jsx)("input",{type:t,className:c("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));bt.displayName="Input";var vt=V(require("react")),X=V(require("@radix-ui/react-dialog"));var Qa=X.Root;var $i=X.Portal;var Ya=vt.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(X.Overlay,{ref:a,className:c("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ya.displayName=X.Overlay.displayName;var Yt=vt.forwardRef(({className:e,children:t,...a},o)=>(0,Pt.jsxs)($i,{children:[(0,Pt.jsx)(Ya,{}),(0,Pt.jsxs)(X.Content,{ref:o,className:c("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,Pt.jsxs)(X.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,Pt.jsx)(Fa.X,{className:"h-4 w-4"}),(0,Pt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Yt.displayName=X.Content.displayName;var Zt=({className:e,...t})=>(0,Pt.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Zt.displayName="DialogHeader";var Wi=({className:e,...t})=>(0,Pt.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wi.displayName="DialogFooter";var ea=vt.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(X.Title,{ref:a,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));ea.displayName=X.Title.displayName;var Gi=vt.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(X.Description,{ref:a,className:c("text-sm text-muted-foreground",e),...t}));Gi.displayName=X.Description.displayName;var ht=V(require("@radix-ui/react-checkbox")),eo=V(require("react")),ta=eo.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(ht.Root,{className:c("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,Pt.jsx)(ht.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,Pt.jsx)(Fa.Check,{className:"h-4 w-4"})})}));ta.displayName=ht.Root.displayName;var Re=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ao=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Pt.jsx)(Fa.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Pt.jsx)(Fa.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Pt.jsx)(Fa.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Pt.jsx)(Fa.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Pt.jsx)(Fa.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Pt.jsx)(Fa.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Pt.jsx)(Fa.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Pt.jsx)(Fa.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Pt.jsx)(Fa.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Pt.jsx)(Fa.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],It=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var aa=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],St=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Bt=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],qi=[...Bt,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Ki=[...It,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],Mt={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},to={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Bt.filter(e=>e.epicId==="1")};var gn={empty:{initialProjects:Mt.projects,initialEpics:Mt.epics,initialSprints:Mt.sprints,initialTasks:Mt.tasks},default:{initialProjects:It,initialEpics:aa,initialSprints:St,initialTasks:Bt},highDensity:{initialProjects:It,initialEpics:aa,initialSprints:St,initialTasks:qi},singleEpic:{initialProjects:It,initialEpics:to.epics,initialSprints:St,initialTasks:to.tasks},multipleProjects:{initialProjects:Ki,initialEpics:aa,initialSprints:St,initialTasks:Bt}},Lt=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Re),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Re),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Re),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Re),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Re),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Re),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Re),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Re),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Re),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Re),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],fn=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Lt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Lt.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:Lt.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var bn=Lt.filter(e=>e.type==="digital");function oo(e,t){let[a,o]=(0,it.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),l=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,it.useEffect)(()=>{l(a)},[]),[a,l]}function ia({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:l=ao[0],onBusinessUnitChange:r,onSearch:s,className:i,logo:d="/headerlogo.png",appName:m="Nuvia",tagline:w="Collaboration Platform"}){let[f,h]=zt.useState({}),[R,M]=oo("sidebar-favorites",{}),[T,x]=zt.useState(null),[P,F]=zt.useState(""),C=p=>{h(E=>({...E,[p]:!E[p]}))},z=p=>{r?.(p)},ee=()=>{P.trim()&&s?.(P.trim())},te=p=>{p.key==="Enter"&&(p.preventDefault(),ee())},ae=(p,E)=>{let L=R[p]||[],_=L.includes(E)?L.filter(u=>u!==E):L.concat(E);M({...R,[p]:_})},Z=p=>{if(!p.items||!p.maxItems||p.items.length<=p.maxItems)return p.items||[];let E=R[p.id]||[],L=p.items.filter(u=>E.includes(u.id)),_=p.items.filter(u=>!E.includes(u.id));return[...L,..._].slice(0,p.maxItems)},q=p=>p.maxItems&&p.items&&p.items.length>p.maxItems,re=e,de=p=>{let E=q(p),L=Z(p),_=(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsxs)("div",{className:"flex items-center gap-3",children:[p.icon,(0,Pt.jsx)("span",{children:p.title})]}),p.badge&&(0,Pt.jsx)(ge,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:p.badge}),p.items&&(0,Pt.jsx)(Fa.ChevronDown,{className:c("ml-2 h-4 w-4 transition-transform",f[p.title]?"rotate-180":"")})]}),u=c("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",p.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return p.url?(0,Pt.jsx)(oa.default,{href:p.url,className:u,onClick:a?o:void 0,children:_}):(0,Pt.jsx)("button",{className:u,onClick:()=>p.items&&C(p.title),children:_})},I=()=>{let p=e.find(L=>L.id===T);if(!p||!p.items||!p.maxItems)return null;let E=R[p.id]||[];return(0,Pt.jsx)(Qa,{open:!!T,onOpenChange:L=>!L&&x(null),children:(0,Pt.jsxs)(Yt,{className:"sm:max-w-md",children:[(0,Pt.jsxs)(Zt,{children:[(0,Pt.jsxs)(ea,{children:["Manage ",p.title," Favorites"]}),(0,Pt.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",p.maxItems," items to show in ",p.title.toLowerCase(),"."]})]}),(0,Pt.jsx)(xe,{className:"max-h-96 pr-4",children:(0,Pt.jsx)("div",{className:"space-y-4",children:p.items.map(L=>(0,Pt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pt.jsx)(ta,{id:L.id,checked:E.includes(L.id),onCheckedChange:()=>ae(p.id,L.id),disabled:!E.includes(L.id)&&E.length>=(p.maxItems||0)}),(0,Pt.jsxs)("label",{htmlFor:L.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[L.title,L.badge&&(0,Pt.jsx)(ge,{variant:"outline",className:"text-xs",children:L.badge})]})]},L.id))})})]})})},Ie=(0,Pt.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Pt.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Pt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pt.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Pt.jsx)("img",{src:d,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Pt.jsxs)("div",{children:[(0,Pt.jsx)("h2",{className:"font-semibold",children:m}),(0,Pt.jsx)("p",{className:"text-xs text-muted-foreground",children:w})]})]}),a&&(0,Pt.jsx)(S,{variant:"ghost",size:"icon",onClick:o,children:(0,Pt.jsx)(Fa.X,{className:"h-5 w-5"})})]}),(0,Pt.jsx)("div",{className:"px-3 py-2",children:(0,Pt.jsxs)("div",{className:"relative",children:[(0,Pt.jsx)(Fa.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pt.jsx)(bt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:P,onChange:p=>F(p.target.value),onKeyPress:te})]})}),(0,Pt.jsx)(xe,{className:"flex-1 px-3 py-2",children:(0,Pt.jsx)("div",{className:"space-y-1",children:re.map(p=>(0,Pt.jsxs)("div",{className:"mb-1",children:[de(p),p.items&&f[p.title]&&(0,Pt.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[Z(p).map(E=>(0,Pt.jsxs)(oa.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[E.title,E.badge&&(0,Pt.jsx)(ge,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:E.badge})]},E.id)),q(p)&&p.items&&p.items.length>Z(p).length&&(0,Pt.jsxs)("button",{onClick:()=>x(p.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",p.items.length-Z(p).length," more available"]})]})]},p.id))})}),(0,Pt.jsx)("div",{className:"p-3",children:(0,Pt.jsx)("div",{className:"space-y-1",children:(0,Pt.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Pt.jsx)(Fa.Settings,{className:"h-5 w-5"}),(0,Pt.jsx)("span",{children:"Settings"})]})})}),(0,Pt.jsx)(I,{})]});return a?(0,Pt.jsx)("div",{className:c("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:Ie}):(0,Pt.jsx)("div",{className:c("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",i),children:Ie})}var io=V(require("react")),Ne=V(require("@radix-ui/react-tooltip"));var rt=Ne.Provider,nt=Ne.Root,st=Ne.Trigger,Ye=io.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Pt.jsx)(Ne.Portal,{children:(0,Pt.jsx)(Ne.Content,{ref:o,sideOffset:t,className:c("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ye.displayName=Ne.Content.displayName;var ro=require("next-themes");function no(){let{setTheme:e,theme:t}=(0,ro.useTheme)();return(0,Pt.jsx)(rt,{children:(0,Pt.jsxs)(nt,{children:[(0,Pt.jsx)(st,{asChild:!0,children:(0,Pt.jsxs)(S,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Pt.jsx)(Fa.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Pt.jsx)(Fa.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Pt.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Pt.jsx)(Ye,{children:"Toggle theme"})]})})}function so({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:l,className:r}){let s=e.filter(m=>!m.read),i=s.length,d=m=>{switch(m){case"info":return(0,Pt.jsx)(Fa.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Pt.jsx)(Fa.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Pt.jsx)(Fa.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Pt.jsx)(Fa.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Pt.jsx)(Vt.AnimatePresence,{children:t&&(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsx)(Vt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Pt.jsx)(Vt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:c("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,Pt.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Pt.jsxs)("div",{className:"flex items-center justify-between border-Pt p-4",children:[(0,Pt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pt.jsx)(Fa.Bell,{className:"h-5 w-5"}),(0,Pt.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,Pt.jsxs)(ge,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,Pt.jsxs)(S,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Pt.jsx)(Fa.X,{className:"h-5 w-5"}),(0,Pt.jsx)("span",{className:"sr-only",children:"Close"})]})]}),i>0&&(0,Pt.jsxs)("div",{className:"flex items-center justify-between border-Pt p-2",children:[(0,Pt.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,Pt.jsx)(S,{variant:"ghost",size:"sm",onClick:l,className:"text-sm",children:"Dismiss all"})]}),s.length>0?(0,Pt.jsx)(xe,{className:"flex-1",children:(0,Pt.jsx)("div",{className:"divide-y",children:s.map(m=>(0,Pt.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Pt.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:d(m.type)}),(0,Pt.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Pt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pt.jsx)("p",{className:"font-medium",children:m.title}),(0,Pt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pt.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,Pt.jsx)(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(m.id),title:"Dismiss",children:(0,Pt.jsx)(Fa.Check,{className:"h-3 w-3"})})]})]}),(0,Pt.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,Pt.jsxs)(S,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,Pt.jsx)(Fa.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.id))})}):(0,Pt.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Pt.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Pt.jsx)(Fa.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Pt.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Pt.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Ze=V(require("@radix-ui/react-tabs"));function lo({className:e,...t}){return(0,Pt.jsx)(Ze.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function co({className:e,...t}){return(0,Pt.jsx)(Ze.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function po({className:e,...t}){return(0,Pt.jsx)(Ze.Trigger,{"data-slot":"tabs-trigger",className:c("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Fe=V(require("react")),D=V(require("@radix-ui/react-dropdown-menu")),lt=require("@radix-ui/react-icons");var mo=D.Root,uo=D.Trigger;var _i=Fe.forwardRef(({className:e,inset:t,children:a,...o},l)=>(0,Pt.jsxs)(D.SubTrigger,{ref:l,className:c("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,Pt.jsx)(lt.ChevronRightIcon,{className:"ml-auto"})]}));_i.displayName=D.SubTrigger.displayName;var Ji=Fe.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(D.SubContent,{ref:a,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ji.displayName=D.SubContent.displayName;var na=Fe.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Pt.jsx)(D.Portal,{children:(0,Pt.jsx)(D.Content,{ref:o,sideOffset:t,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));na.displayName=D.Content.displayName;var sa=Fe.forwardRef(({className:e,inset:t,...a},o)=>(0,Pt.jsx)(D.Item,{ref:o,className:c("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));sa.displayName=D.Item.displayName;var Xi=Fe.forwardRef(({className:e,children:t,checked:a,...o},l)=>(0,Pt.jsxs)(D.CheckboxItem,{ref:l,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,Pt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pt.jsx)(D.ItemIndicator,{children:(0,Pt.jsx)(lt.CheckIcon,{className:"h-4 w-4"})})}),t]}));Xi.displayName=D.CheckboxItem.displayName;var Qi=Fe.forwardRef(({className:e,children:t,...a},o)=>(0,Pt.jsxs)(D.RadioItem,{ref:o,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,Pt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pt.jsx)(D.ItemIndicator,{children:(0,Pt.jsx)(lt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Qi.displayName=D.RadioItem.displayName;var Yi=Fe.forwardRef(({className:e,inset:t,...a},o)=>(0,Pt.jsx)(D.Label,{ref:o,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Yi.displayName=D.Label.displayName;var Zi=Fe.forwardRef(({className:e,...t},a)=>(0,Pt.jsx)(D.Separator,{ref:a,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));Zi.displayName=D.Separator.displayName;var er=({className:e,...t})=>(0,Pt.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});er.displayName="DropdownMenuShortcut";function fo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:l="700px",gridCols:r=6}){let s=a.find(i=>i.value===e);return(0,Pt.jsxs)(Vt.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Pt.jsx)("div",{className:"hidden lg:block",children:(0,Pt.jsx)(lo,{value:e,onValueChange:t,children:(0,Pt.jsx)(co,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:l,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,Pt.jsx)(Vt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Pt.jsx)(po,{value:i.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:i.label})},i.value))})})}),(0,Pt.jsx)("div",{className:"lg:hidden",children:(0,Pt.jsxs)(mo,{children:[(0,Pt.jsx)(uo,{asChild:!0,children:(0,Pt.jsxs)(S,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[s?.label||"Select",(0,Pt.jsx)(Fa.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Pt.jsx)(na,{align:"center",className:"w-[180px]",children:a.map(i=>(0,Pt.jsx)(sa,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function bo({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:l=!0,className:r,activeTab:s="assistant",onTabChange:i,showTabs:d=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:w,actionIcon:f=(0,Pt.jsx)(Fa.Bot,{className:"mr-2 h-4 w-4"}),actionText:h="Action",onNotificationRemove:R,onRemoveAll:M,logo:T="/headerlogo.png",appName:x="Nuvia",tagline:P="Collaboration Platform"}){let[F,C]=(0,it.useState)(!1),[z,ee]=(0,it.useState)(t),te=z.filter(q=>!q.read).length,ae=q=>{ee(re=>re.filter(de=>de.id!==q)),R?.(q)},Z=()=>{ee(q=>q.filter(re=>re.read)),M?.()};return(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,Pt.jsx)(S,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Pt.jsx)(Fa.Menu,{className:"h-5 w-5"})}),(0,Pt.jsx)(S,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Pt.jsx)(Fa.PanelLeft,{className:"h-5 w-5"})}),!l&&(0,Pt.jsxs)(Vt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Pt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Pt.jsx)("img",{src:T,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Pt.jsxs)("div",{children:[(0,Pt.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,Pt.jsx)("p",{className:"text-xs text-muted-foreground",children:P})]})]}),(0,Pt.jsxs)("div",{className:"flex flex-1 items-center",children:[d&&(0,Pt.jsx)(fo,{activeTab:s,onTabChange:i,tabOptions:m}),(0,Pt.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Pt.jsx)(Vt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Pt.jsx)(Vt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Pt.jsxs)(S,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:w,children:[f,h]})})}),(0,Pt.jsx)(no,{}),(0,Pt.jsx)(rt,{children:(0,Pt.jsxs)(nt,{children:[(0,Pt.jsx)(st,{asChild:!0,children:(0,Pt.jsx)(Vt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Pt.jsxs)(S,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>C(!0),children:[(0,Pt.jsx)(Vt.motion.div,{animate:te>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:te>0?1/0:0,repeatDelay:3},children:(0,Pt.jsx)(Fa.Bell,{className:"h-5 w-5"})}),te>0&&(0,Pt.jsx)(Vt.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:te})]})})}),(0,Pt.jsx)(Ye,{children:"Notifications"})]})}),(0,Pt.jsx)(Vt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Pt.jsxs)(be,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Pt.jsx)(We,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Pt.jsx)(ve,{})]})})]})]})]}),(0,Pt.jsx)(so,{notifications:z,open:F,onClose:()=>C(!1),onNotificationRemove:ae,onRemoveAll:Z})]})}var vo=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Pt.jsx)(Fa.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function yo({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:l=vo[0],onBusinessUnitChange:r,onSearch:s,businessUnits:i=vo,activeTab:d,onTabChange:m,showTabs:w=!1,onActionClick:f,actionIcon:h,actionText:R="Action",onNotificationRemove:M,onRemoveAll:T,logo:x="/headerlogo.png",appName:P="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:C=!1}){let[z,ee]=(0,it.useState)(!C),[te,ae]=(0,it.useState)(!1),[Z,q]=(0,it.useState)(l),re=de=>{q(de),r?.(de)};return(0,Pt.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[te&&(0,Pt.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>ae(!1)}),(0,Pt.jsx)("div",{className:"md:hidden",children:(0,Pt.jsx)(ia,{items:e,isOpen:te,isMobile:!0,onClose:()=>ae(!1),currentBusinessUnit:Z,onBusinessUnitChange:re,onSearch:s,logo:x,appName:P,tagline:F})}),(0,Pt.jsx)("div",{className:"hidden md:block",children:(0,Pt.jsx)(ia,{items:e,isOpen:z,isMobile:!1,currentBusinessUnit:Z,onBusinessUnitChange:re,onSearch:s,logo:x,appName:P,tagline:F})}),(0,Pt.jsxs)("div",{className:c("min-h-screen fixed w-full transition-all duration-300 ease-in-out",z?"md:pl-64":"md:pl-0"),children:[(0,Pt.jsx)(bo,{title:a,notifications:o,onToggleSidebar:()=>ee(!z),onToggleMobileMenu:()=>ae(!0),sidebarOpen:z,activeTab:d,onTabChange:m,showTabs:w,onActionClick:f,actionIcon:h,actionText:R,onNotificationRemove:M,onRemoveAll:T,logo:x,appName:P,tagline:F}),(0,Pt.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function xo({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:l,onSessionEdit:r,onSessionDelete:s,className:i}){return(0,Pt.jsx)(rt,{children:(0,Pt.jsx)("div",{className:`space-y-4 h-full ${i||""}`,children:(0,Pt.jsxs)(he,{className:"shadow-sm h-full",children:[(0,Pt.jsx)("div",{className:"p-4 border-Pt",children:(0,Pt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pt.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Pt.jsx)(Fa.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,Pt.jsxs)(S,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,Pt.jsx)(Fa.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,Pt.jsx)(xe,{className:"h-[600px]",children:(0,Pt.jsx)("div",{className:"p-2",children:e.length===0?(0,Pt.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(d=>(0,Pt.jsxs)(nt,{children:[(0,Pt.jsx)(st,{asChild:!0,children:(0,Pt.jsx)("div",{className:c("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===d.id&&"bg-muted border"),onClick:()=>l(d),children:(0,Pt.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Pt.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Pt.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:d.title}),(0,Pt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.lastMessage})]}),(0,Pt.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[r&&(0,Pt.jsx)(S,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),r(d.id)},children:(0,Pt.jsx)(Fa.Edit3,{className:"h-3 w-3"})}),s&&(0,Pt.jsx)(S,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),s(d.id)},children:(0,Pt.jsx)(Fa.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,Pt.jsx)(Ye,{side:"right",className:"max-w-xs",children:(0,Pt.jsxs)("div",{className:"space-y-1",children:[(0,Pt.jsx)("p",{className:"font-medium text-sm",children:d.title}),(0,Pt.jsx)("p",{className:"text-xs",children:d.lastMessage})]})})]},d.id))})})]})})})}var tt=V(require("motion/react-client"));function da({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:l,colorScheme:r=Xt,className:s}){let[i,d]=(0,it.useState)([]),[m,w]=(0,it.useState)([]),f=i[i.length-1],h=f?.children||e,R=(C,z)=>{switch(C.type){case"category":return r.categories[z%r.categories.length];case"list":return r.lists[z%r.lists.length];case"item":return r.items[z%r.items.length];default:return r.primary}},M=(0,it.useMemo)(()=>({path:i,selectedItems:m,filters:{}}),[i,m]);(0,it.useEffect)(()=>{l&&l(M)},[M,l]);let T=C=>{C.type==="category"||C.type==="list"?d([...i,C]):C.type==="item"&&w([...m,C])},x=()=>{d(i.slice(0,-1))},P=C=>{d(i.slice(0,C+1))},F=()=>f?.actions?f.actions:[];return t?(0,Pt.jsxs)("div",{className:c("w-full",s),children:[(0,Pt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Pt.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,Pt.jsx)(Vt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Pt.jsx)(Fa.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Pt.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,Pt.jsx)(Vt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Pt.jsx)(Fa.X,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,Pt.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Pt.jsx)(Vt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>d([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Pt.jsxs)("span",{className:"relative",children:["Capabilities",(0,Pt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),i.map((C,z)=>(0,Pt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pt.jsx)(Fa.ChevronRight,{className:"h-2 w-2"}),(0,Pt.jsx)(Vt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>P(z),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Pt.jsxs)("span",{className:"relative",children:[C.name,(0,Pt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},C.id))]}),(0,Pt.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,Pt.jsx)(Vt.AnimatePresence,{mode:"wait",children:(0,Pt.jsx)(Vt.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:f?.type==="list"&&f.data?(0,Pt.jsx)(or,{data:f.data,onItemSelect:C=>w([...m,C]),colorScheme:r}):(0,Pt.jsx)(tr,{capabilities:h,onSelect:T,colorScheme:r})},f?.id||"root")})})]}):(0,Pt.jsxs)(S,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Pt.jsx)(Fa.Menu,{className:"h-4 w-4"}),(0,Pt.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function tr({capabilities:e,onSelect:t,colorScheme:a}){return(0,Pt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,Pt.jsx)(ar,{capability:o,onClick:()=>t(o),color:a.categories[l%a.categories.length]},o.id))})}function ar({capability:e,onClick:t,selected:a,color:o}){return(0,Pt.jsxs)(Vt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Pt.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,Pt.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Pt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Pt.jsx)(Fa.ChevronRight,{className:c("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,Pt.jsx)(ge,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function or({data:e,onItemSelect:t,colorScheme:a}){return(0,Pt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,l)=>(0,Pt.jsxs)(Vt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,Pt.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[l%a.items.length])}),(0,Pt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pt.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,Pt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),o.subtitle&&(0,Pt.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,Pt.jsx)(ge,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}var wo=V(require("react"));var ma=({isOpen:e=!0,authUrl:t,onClose:a,onSuccess:o,description:l="This endpoint requires authentication to sync functions."})=>{let[r,s]=(0,it.useState)(!1),[i,d]=(0,it.useState)(""),m=()=>{if(!t){d("No authentication URL provided");return}s(!0),d("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){d("Popup blocked. Please allow popups for this site and try again."),s(!1);return}let h=setInterval(()=>{try{f.closed&&(clearInterval(h),s(!1),o(),a())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(h),s(!1),d("Authentication timed out. Please try again."))},6e5)}catch{d("Failed to open authentication window"),s(!1)}},w=async()=>{try{await navigator.clipboard.writeText(t),d("")}catch{d("Failed to copy URL to clipboard")}};return e?(0,Pt.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Pt.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Pt.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Pt.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l}),i&&(0,Pt.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:i}),(0,Pt.jsxs)("div",{className:"flex gap-2",children:[(0,Pt.jsx)("button",{onClick:m,disabled:r||!t,className:`
9
+ </svg>`,Xi=`data:image/svg+xml;utf8,${encodeURIComponent(Ji)}`,io=Qo.default.memo(function(t){let{id:o,message:a,currentUser:r,role:n}=t,l=n==="user",s=l?r?.name||"You":r?.name||"AI Assistant",d=l?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(a.type){case"forwarding":return(0,St.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${l?"flex-row-reverse":""}`,children:["Forwarding to ",a?.data?.content]},o);case"text":return(0,St.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[l?(0,St.jsxs)(ve,{children:[(0,St.jsx)(qe,{src:d,alt:s}),(0,St.jsx)(he,{children:s.substring(0,2).toUpperCase()})]}):(0,St.jsx)("img",{src:Xi,alt:"AI Assistant",className:"w-10 h-10"}),(0,St.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,St.jsx)("div",{className:"flex items-center gap-2",children:(0,St.jsx)("span",{className:"font-medium",children:s})}),(0,St.jsx)("div",{className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:a?.data?.content})]})]},o);case"image":return(0,St.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[(0,St.jsxs)(ve,{className:l?"":"ai-border",children:[(0,St.jsx)(qe,{src:d,alt:s}),(0,St.jsx)(he,{children:s.substring(0,2).toUpperCase()})]}),(0,St.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,St.jsx)("div",{className:"flex items-center gap-2",children:(0,St.jsx)("span",{className:"font-medium",children:s})}),(0,St.jsx)("img",{src:a?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},o);case"tool-invocation":if(a.data&&a.data.tool){let m=_i[a.data.tool];return m?(0,St.jsx)("div",{className:"mt-2",children:(0,St.jsx)(m,{data:a.data})}):(console.warn(`Tool ${a.data.tool} is not defined.`),(0,St.jsx)("div",{className:"mt-2",children:"......"}))}}});var ro=V(require("react")),xe=V(require("@radix-ui/react-scroll-area"));var we=ro.forwardRef(({className:e,children:t,...o},a)=>(0,St.jsxs)(xe.Root,{ref:a,className:c("relative overflow-hidden",e),...o,children:[(0,St.jsx)(xe.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,St.jsx)(Yo,{}),(0,St.jsx)(xe.Corner,{})]}));we.displayName=xe.Root.displayName;var Yo=ro.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,St.jsx)(xe.ScrollAreaScrollbar,{ref:a,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,St.jsx)(xe.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Yo.displayName=xe.ScrollAreaScrollbar.displayName;function Qi({messages:e,isLoading:t}){let o=(0,st.useRef)(null);return(0,st.useEffect)(()=>{o.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,St.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,St.jsxs)(we,{className:"container flex-1 p-4",children:[(0,St.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,St.jsx)("div",{className:"flex items-center justify-center h-full pt-60",children:(0,St.jsxs)("div",{className:"text-center max-w-md",children:[(0,St.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,St.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question to a business function directly using the toolbar below."})]})}),t&&(0,St.jsxs)("div",{className:"flex items-start gap-3",children:[(0,St.jsxs)(ve,{className:"ai-border",children:[(0,St.jsx)(qe,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,St.jsx)(he,{children:"AI"})]}),(0,St.jsxs)("div",{className:"grid gap-1.5",children:[(0,St.jsx)("div",{className:"flex items-center gap-2",children:(0,St.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,St.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,St.jsxs)("div",{className:"flex space-x-2",children:[(0,St.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce"}),(0,St.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,St.jsx)("div",{className:"w-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((a,r)=>(0,St.jsx)(io,{...a},r))]}),(0,St.jsx)("div",{ref:o})]})})}var no={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},It=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function Yi(e){let t=It,o=null;for(let a of e){if(o=t.find(r=>r.id===a||r.name===a)||null,!o)return null;t=o.children||[]}return o}function Mt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Zi(e){return It.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function er(){return It}function so({artefact:e,taskId:t,taskData:o,loading:a=!1,error:r=null}){let n=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=n.dateLogged;try{let s=new Date(n.dateLogged);isNaN(s.getTime())||(l=(0,Xo.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,St.jsxs)(ye,{className:"w-full max-w-md shadow-md",children:[(0,St.jsx)(Fe,{className:"pb-2",children:(0,St.jsx)("div",{className:"flex justify-between items-start",children:(0,St.jsx)(je,{className:"text-lg font-semibold",children:a?"Loading...":n.name})})}),(0,St.jsx)(Se,{className:"pb-2",children:a?(0,St.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded w-3/4 mb-2"}):r?(0,St.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,St.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,St.jsx)(vt,{className:"pt-2 flex items-center justify-between",children:(0,St.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,St.jsx)(Jo.Clock,{className:"h-3 w-3 mr-1"}),(0,St.jsxs)("span",{children:["Created ",l]}),(0,St.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,St.jsxs)("span",{children:["Task #",n.id]})]})})]})}var Ka=require("@ai-sdk/react"),Yt=require("motion/react");var Ot=V(require("react")),go=V(require("next/link"));var ta=require("@radix-ui/react-slot"),aa=V(require("react")),tr=(0,qo.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),A=aa.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...r},n)=>(0,St.jsx)(e?ta.Slot:"button",{className:c(tr({className:t,size:o,variant:a})),ref:n,...r}));A.displayName="Button";var ra=V(require("react"));var yt=ra.forwardRef(({className:e,type:t,...o},a)=>(0,St.jsx)("input",{type:t,className:c("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));yt.displayName="Input";var xt=V(require("react")),Q=V(require("@radix-ui/react-dialog"));var la=Q.Root;var or=Q.Portal;var ca=xt.forwardRef(({className:e,...t},o)=>(0,St.jsx)(Q.Overlay,{ref:o,className:c("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ca.displayName=Q.Overlay.displayName;var lo=xt.forwardRef(({className:e,children:t,...o},a)=>(0,St.jsxs)(or,{children:[(0,St.jsx)(ca,{}),(0,St.jsxs)(Q.Content,{ref:a,className:c("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,St.jsxs)(Q.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,St.jsx)(Jo.X,{className:"h-4 w-4"}),(0,St.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));lo.displayName=Q.Content.displayName;var co=({className:e,...t})=>(0,St.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});co.displayName="DialogHeader";var ar=({className:e,...t})=>(0,St.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ar.displayName="DialogFooter";var po=xt.forwardRef(({className:e,...t},o)=>(0,St.jsx)(Q.Title,{ref:o,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));po.displayName=Q.Title.displayName;var ir=xt.forwardRef(({className:e,...t},o)=>(0,St.jsx)(Q.Description,{ref:o,className:c("text-sm text-muted-foreground",e),...t}));ir.displayName=Q.Description.displayName;var wt=V(require("@radix-ui/react-checkbox")),pa=V(require("react")),mo=pa.forwardRef(({className:e,...t},o)=>(0,St.jsx)(wt.Root,{className:c("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,St.jsx)(wt.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,St.jsx)(Jo.Check,{className:"h-4 w-4"})})}));mo.displayName=wt.Root.displayName;var Ae=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ua=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,St.jsx)(Jo.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,St.jsx)(Jo.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,St.jsx)(Jo.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,St.jsx)(Jo.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,St.jsx)(Jo.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,St.jsx)(Jo.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,St.jsx)(Jo.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,St.jsx)(Jo.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,St.jsx)(Jo.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,St.jsx)(Jo.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],zt=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var uo=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Lt=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Ft=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],rr=[...Ft,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],nr=[...zt,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],Et={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},ma={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Ft.filter(e=>e.epicId==="1")};var Sn={empty:{initialProjects:Et.projects,initialEpics:Et.epics,initialSprints:Et.sprints,initialTasks:Et.tasks},default:{initialProjects:zt,initialEpics:uo,initialSprints:Lt,initialTasks:Ft},highDensity:{initialProjects:zt,initialEpics:uo,initialSprints:Lt,initialTasks:rr},singleEpic:{initialProjects:zt,initialEpics:ma.epics,initialSprints:Lt,initialTasks:ma.tasks},multipleProjects:{initialProjects:nr,initialEpics:uo,initialSprints:Lt,initialTasks:Ft}},Ut=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Ae),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ae),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Ae),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ae),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Ae),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ae),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Ae),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ae),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Ae),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ae),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],An=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Ut.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Ut.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:Ut.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var In=Ut.filter(e=>e.type==="digital");function ga(e,t){let[o,a]=(0,st.useState)(()=>{if(typeof window>"u")return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}),r=n=>{try{a(n),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(n))}catch{}};return(0,st.useEffect)(()=>{r(o)},[]),[o,r]}function fo({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:r=ua[0],onBusinessUnitChange:n,onSearch:l,className:s,logo:d="/headerlogo.png",appName:m="Nuvia",tagline:C="Collaboration Platform"}){let[f,h]=Ot.useState({}),[S,I]=ga("sidebar-favorites",{}),[R,x]=Ot.useState(null),[T,F]=Ot.useState(""),N=p=>{h(E=>({...E,[p]:!E[p]}))},z=p=>{n?.(p)},te=()=>{T.trim()&&l?.(T.trim())},oe=p=>{p.key==="Enter"&&(p.preventDefault(),te())},ae=(p,E)=>{let B=S[p]||[],J=B.includes(E)?B.filter(u=>u!==E):B.concat(E);I({...S,[p]:J})},ee=p=>{if(!p.items||!p.maxItems||p.items.length<=p.maxItems)return p.items||[];let E=S[p.id]||[],B=p.items.filter(u=>E.includes(u.id)),J=p.items.filter(u=>!E.includes(u.id));return[...B,...J].slice(0,p.maxItems)},K=p=>p.maxItems&&p.items&&p.items.length>p.maxItems,ne=e,me=p=>{let E=K(p),B=ee(p),J=(0,St.jsxs)(St.Fragment,{children:[(0,St.jsxs)("div",{className:"flex items-center gap-3",children:[p.icon,(0,St.jsx)("span",{children:p.title})]}),p.badge&&(0,St.jsx)(le,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:p.badge}),p.items&&(0,St.jsx)(Jo.ChevronDown,{className:c("ml-2 h-4 w-4 transition-transform",f[p.title]?"rotate-180":"")})]}),u=c("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",p.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return p.url?(0,St.jsx)(go.default,{href:p.url,className:u,onClick:o?a:void 0,children:J}):(0,St.jsx)("button",{className:u,onClick:()=>p.items&&N(p.title),children:J})},M=()=>{let p=e.find(B=>B.id===R);if(!p||!p.items||!p.maxItems)return null;let E=S[p.id]||[];return(0,St.jsx)(la,{open:!!R,onOpenChange:B=>!B&&x(null),children:(0,St.jsxs)(lo,{className:"sm:max-w-md",children:[(0,St.jsxs)(co,{children:[(0,St.jsxs)(po,{children:["Manage ",p.title," Favorites"]}),(0,St.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",p.maxItems," items to show in ",p.title.toLowerCase(),"."]})]}),(0,St.jsx)(we,{className:"max-h-96 pr-4",children:(0,St.jsx)("div",{className:"space-y-4",children:p.items.map(B=>(0,St.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,St.jsx)(mo,{id:B.id,checked:E.includes(B.id),onCheckedChange:()=>ae(p.id,B.id),disabled:!E.includes(B.id)&&E.length>=(p.maxItems||0)}),(0,St.jsxs)("label",{htmlFor:B.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[B.title,B.badge&&(0,St.jsx)(le,{variant:"outline",className:"text-xs",children:B.badge})]})]},B.id))})})]})})},Le=(0,St.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,St.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,St.jsxs)("div",{className:"flex items-center gap-3",children:[(0,St.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,St.jsx)("img",{src:d,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,St.jsxs)("div",{children:[(0,St.jsx)("h2",{className:"font-semibold",children:m}),(0,St.jsx)("p",{className:"text-xs text-muted-foreground",children:C})]})]}),o&&(0,St.jsx)(A,{variant:"ghost",size:"icon",onClick:a,children:(0,St.jsx)(Jo.X,{className:"h-5 w-5"})})]}),(0,St.jsx)("div",{className:"px-3 py-2",children:(0,St.jsxs)("div",{className:"relative",children:[(0,St.jsx)(Jo.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,St.jsx)(yt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:T,onChange:p=>F(p.target.value),onKeyPress:oe})]})}),(0,St.jsx)(we,{className:"flex-1 px-3 py-2",children:(0,St.jsx)("div",{className:"space-y-1",children:ne.map(p=>(0,St.jsxs)("div",{className:"mb-1",children:[me(p),p.items&&f[p.title]&&(0,St.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[ee(p).map(E=>(0,St.jsxs)(go.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[E.title,E.badge&&(0,St.jsx)(le,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:E.badge})]},E.id)),K(p)&&p.items&&p.items.length>ee(p).length&&(0,St.jsxs)("button",{onClick:()=>x(p.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",p.items.length-ee(p).length," more available"]})]})]},p.id))})}),(0,St.jsx)("div",{className:"p-3",children:(0,St.jsx)("div",{className:"space-y-1",children:(0,St.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,St.jsx)(Jo.Settings,{className:"h-5 w-5"}),(0,St.jsx)("span",{children:"Settings"})]})})}),(0,St.jsx)(M,{})]});return o?(0,St.jsx)("div",{className:c("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Le}):(0,St.jsx)("div",{className:c("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Le})}var fa=V(require("react")),Pe=V(require("@radix-ui/react-tooltip"));var lt=Pe.Provider,ct=Pe.Root,dt=Pe.Trigger,tt=fa.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,St.jsx)(Pe.Portal,{children:(0,St.jsx)(Pe.Content,{ref:a,sideOffset:t,className:c("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));tt.displayName=Pe.Content.displayName;var ba=require("next-themes");function va(){let{setTheme:e,theme:t}=(0,ba.useTheme)();return(0,St.jsx)(lt,{children:(0,St.jsxs)(ct,{children:[(0,St.jsx)(dt,{asChild:!0,children:(0,St.jsxs)(A,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,St.jsx)(Jo.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,St.jsx)(Jo.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,St.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,St.jsx)(tt,{children:"Toggle theme"})]})})}function ha({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:r,className:n}){let l=e.filter(m=>!m.read),s=l.length,d=m=>{switch(m){case"info":return(0,St.jsx)(Jo.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,St.jsx)(Jo.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,St.jsx)(Jo.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,St.jsx)(Jo.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,St.jsx)(Yt.AnimatePresence,{children:t&&(0,St.jsxs)(St.Fragment,{children:[(0,St.jsx)(Yt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:o}),(0,St.jsx)(Yt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:c("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",n),children:(0,St.jsxs)("div",{className:"flex h-full flex-col",children:[(0,St.jsxs)("div",{className:"flex items-center justify-between border-St p-4",children:[(0,St.jsxs)("div",{className:"flex items-center gap-2",children:[(0,St.jsx)(Jo.Bell,{className:"h-5 w-5"}),(0,St.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,St.jsxs)(le,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,St.jsxs)(A,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,St.jsx)(Jo.X,{className:"h-5 w-5"}),(0,St.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,St.jsxs)("div",{className:"flex items-center justify-between border-St p-2",children:[(0,St.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,St.jsx)(A,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,St.jsx)(we,{className:"flex-1",children:(0,St.jsx)("div",{className:"divide-y",children:l.map(m=>(0,St.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,St.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:d(m.type)}),(0,St.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,St.jsxs)("div",{className:"flex items-center justify-between",children:[(0,St.jsx)("p",{className:"font-medium",children:m.title}),(0,St.jsxs)("div",{className:"flex items-center gap-2",children:[(0,St.jsx)("p",{className:"text-xs text-muted-foreground",children:m.time}),(0,St.jsx)(A,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>a?.(m.id),title:"Dismiss",children:(0,St.jsx)(Jo.Check,{className:"h-3 w-3"})})]})]}),(0,St.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description}),m.actionLabel&&(0,St.jsxs)(A,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:m.onAction,children:[m.actionLabel,(0,St.jsx)(Jo.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},m.id))})}):(0,St.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,St.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,St.jsx)(Jo.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,St.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,St.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var ot=V(require("@radix-ui/react-tabs"));function ya({className:e,...t}){return(0,$t.jsx)(ot.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function xa({className:e,...t}){return(0,$t.jsx)(ot.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function wa({className:e,...t}){return(0,$t.jsx)(ot.Trigger,{"data-slot":"tabs-trigger",className:c("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Oe=V(require("react")),D=V(require("@radix-ui/react-dropdown-menu")),pt=require("@radix-ui/react-icons");var Ca=D.Root,Na=D.Trigger;var sr=Oe.forwardRef(({className:e,inset:t,children:o,...a},r)=>(0,St.jsxs)(D.SubTrigger,{ref:r,className:c("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[o,(0,St.jsx)(pt.ChevronRightIcon,{className:"ml-auto"})]}));sr.displayName=D.SubTrigger.displayName;var lr=Oe.forwardRef(({className:e,...t},o)=>(0,St.jsx)(D.SubContent,{ref:o,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));lr.displayName=D.SubContent.displayName;var vo=Oe.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,St.jsx)(D.Portal,{children:(0,St.jsx)(D.Content,{ref:a,sideOffset:t,className:c("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));vo.displayName=D.Content.displayName;var ho=Oe.forwardRef(({className:e,inset:t,...o},a)=>(0,St.jsx)(D.Item,{ref:a,className:c("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));ho.displayName=D.Item.displayName;var cr=Oe.forwardRef(({className:e,children:t,checked:o,...a},r)=>(0,St.jsxs)(D.CheckboxItem,{ref:r,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...a,children:[(0,St.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,St.jsx)(D.ItemIndicator,{children:(0,St.jsx)(pt.CheckIcon,{className:"h-4 w-4"})})}),t]}));cr.displayName=D.CheckboxItem.displayName;var dr=Oe.forwardRef(({className:e,children:t,...o},a)=>(0,St.jsxs)(D.RadioItem,{ref:a,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,St.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,St.jsx)(D.ItemIndicator,{children:(0,St.jsx)(pt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));dr.displayName=D.RadioItem.displayName;var pr=Oe.forwardRef(({className:e,inset:t,...o},a)=>(0,St.jsx)(D.Label,{ref:a,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));pr.displayName=D.Label.displayName;var mr=Oe.forwardRef(({className:e,...t},o)=>(0,St.jsx)(D.Separator,{ref:o,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));mr.displayName=D.Separator.displayName;var ur=({className:e,...t})=>(0,St.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});ur.displayName="DropdownMenuShortcut";function Pa({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:r="700px",gridCols:n=6}){let l=o.find(s=>s.value===e);return(0,St.jsxs)(Yt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,St.jsx)("div",{className:"hidden lg:block",children:(0,St.jsx)(ya,{value:e,onValueChange:t,children:(0,St.jsx)(xa,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(n,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,St.jsx)(Yt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,St.jsx)(wa,{value:s.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,St.jsx)("div",{className:"lg:hidden",children:(0,St.jsxs)(Ca,{children:[(0,St.jsx)(Na,{asChild:!0,children:(0,St.jsxs)(A,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,St.jsx)(Jo.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,St.jsx)(vo,{align:"center",className:"w-[180px]",children:o.map(s=>(0,St.jsx)(ho,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function Ta({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:r=!0,className:n,activeTab:l="assistant",onTabChange:s,showTabs:d=!0,tabOptions:m=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:C,actionIcon:f=(0,St.jsx)(Jo.Bot,{className:"mr-2 h-4 w-4"}),actionText:h="Action",onNotificationRemove:S,onRemoveAll:I,logo:R="/headerlogo.png",appName:x="Nuvia",tagline:T="Collaboration Platform"}){let[F,N]=(0,st.useState)(!1),[z,te]=(0,st.useState)(t),oe=z.filter(K=>!K.read).length,ae=K=>{te(ne=>ne.filter(me=>me.id!==K)),S?.(K)},ee=()=>{te(K=>K.filter(ne=>ne.read)),I?.()};return(0,St.jsxs)(St.Fragment,{children:[(0,St.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${n||""}`,children:[(0,St.jsx)(A,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,St.jsx)(Jo.Menu,{className:"h-5 w-5"})}),(0,St.jsx)(A,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,St.jsx)(Jo.PanelLeft,{className:"h-5 w-5"})}),!r&&(0,St.jsxs)(Yt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,St.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,St.jsx)("img",{src:R,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,St.jsxs)("div",{children:[(0,St.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,St.jsx)("p",{className:"text-xs text-muted-foreground",children:T})]})]}),(0,St.jsxs)("div",{className:"flex flex-1 items-center",children:[d&&(0,St.jsx)(Pa,{activeTab:l,onTabChange:s,tabOptions:m}),(0,St.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,St.jsx)(Yt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,St.jsx)(Yt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,St.jsxs)(A,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:C,children:[f,h]})})}),(0,St.jsx)(va,{}),(0,St.jsx)(lt,{children:(0,St.jsxs)(ct,{children:[(0,St.jsx)(dt,{asChild:!0,children:(0,St.jsx)(Yt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,St.jsxs)(A,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>N(!0),children:[(0,St.jsx)(Yt.motion.div,{animate:oe>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:oe>0?1/0:0,repeatDelay:3},children:(0,St.jsx)(Jo.Bell,{className:"h-5 w-5"})}),oe>0&&(0,St.jsx)(Yt.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:oe})]})})}),(0,St.jsx)(tt,{children:"Notifications"})]})}),(0,St.jsx)(Yt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,St.jsxs)(ve,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,St.jsx)(qe,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,St.jsx)(he,{})]})})]})]})]}),(0,St.jsx)(ha,{notifications:z,open:F,onClose:()=>N(!1),onNotificationRemove:ae,onRemoveAll:ee})]})}var Da=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,St.jsx)(Jo.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Sa({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:r=Da[0],onBusinessUnitChange:n,onSearch:l,businessUnits:s=Da,activeTab:d,onTabChange:m,showTabs:C=!1,onActionClick:f,actionIcon:h,actionText:S="Action",onNotificationRemove:I,onRemoveAll:R,logo:x="/headerlogo.png",appName:T="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:N=!1}){let[z,te]=(0,st.useState)(!N),[oe,ae]=(0,st.useState)(!1),[ee,K]=(0,st.useState)(r),ne=me=>{K(me),n?.(me)};return(0,St.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[oe&&(0,St.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>ae(!1)}),(0,St.jsx)("div",{className:"md:hidden",children:(0,St.jsx)(fo,{items:e,isOpen:oe,isMobile:!0,onClose:()=>ae(!1),currentBusinessUnit:ee,onBusinessUnitChange:ne,onSearch:l,logo:x,appName:T,tagline:F})}),(0,St.jsx)("div",{className:"hidden md:block",children:(0,St.jsx)(fo,{items:e,isOpen:z,isMobile:!1,currentBusinessUnit:ee,onBusinessUnitChange:ne,onSearch:l,logo:x,appName:T,tagline:F})}),(0,St.jsxs)("div",{className:c("min-h-screen fixed w-full transition-all duration-300 ease-in-out",z?"md:pl-64":"md:pl-0"),children:[(0,St.jsx)(Ta,{title:o,notifications:a,onToggleSidebar:()=>te(!z),onToggleMobileMenu:()=>ae(!0),sidebarOpen:z,activeTab:d,onTabChange:m,showTabs:C,onActionClick:f,actionIcon:h,actionText:S,onNotificationRemove:I,onRemoveAll:R,logo:x,appName:T,tagline:F}),(0,St.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Aa({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:r,onSessionEdit:n,onSessionDelete:l,className:s}){return(0,St.jsx)(lt,{children:(0,St.jsx)("div",{className:`space-y-4 h-full ${s||""}`,children:(0,St.jsxs)(ye,{className:"shadow-sm h-full",children:[(0,St.jsx)("div",{className:"p-4 border-St",children:(0,St.jsxs)("div",{className:"flex items-center justify-between",children:[(0,St.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,St.jsx)(Jo.Clock,{className:"h-4 w-4"}),"Recent Chats"]}),(0,St.jsxs)(A,{onClick:a,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,St.jsx)(Jo.Plus,{className:"h-3 w-3"}),"New"]})]})}),(0,St.jsx)(we,{className:"h-[600px]",children:(0,St.jsx)("div",{className:"p-2",children:e.length===0?(0,St.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(d=>(0,St.jsxs)(ct,{children:[(0,St.jsx)(dt,{asChild:!0,children:(0,St.jsx)("div",{className:c("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===d.id&&"bg-muted border"),onClick:()=>r(d),children:(0,St.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,St.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,St.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:d.title}),(0,St.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.lastMessage})]}),(0,St.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[n&&(0,St.jsx)(A,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),n(d.id)},children:(0,St.jsx)(Jo.Edit3,{className:"h-3 w-3"})}),l&&(0,St.jsx)(A,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:m=>{m.stopPropagation(),l(d.id)},children:(0,St.jsx)(Jo.Trash2,{className:"h-3 w-3"})})]})]})})}),(0,St.jsx)(tt,{side:"right",className:"max-w-xs",children:(0,St.jsxs)("div",{className:"space-y-1",children:[(0,St.jsx)("p",{className:"font-medium text-sm",children:d.title}),(0,St.jsx)("p",{className:"text-xs",children:d.lastMessage})]})})]},d.id))})})]})})})}var it=V(require("motion/react-client"));function wo({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:r,colorScheme:n=no,className:l}){let[s,d]=(0,st.useState)([]),[m,C]=(0,st.useState)([]),f=s[s.length-1],h=f?.children||e,S=(N,z)=>{switch(N.type){case"category":return n.categories[z%n.categories.length];case"list":return n.lists[z%n.lists.length];case"item":return n.items[z%n.items.length];default:return n.primary}},I=(0,st.useMemo)(()=>({path:s,selectedItems:m,filters:{}}),[s,m]);(0,st.useEffect)(()=>{r&&r(I)},[I,r]);let R=N=>{N.type==="category"||N.type==="list"?d([...s,N]):N.type==="item"&&C([...m,N])},x=()=>{d(s.slice(0,-1))},T=N=>{d(s.slice(0,N+1))},F=()=>f?.actions?f.actions:[];return t?(0,St.jsxs)("div",{className:c("w-full",l),children:[(0,St.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,St.jsxs)("div",{className:"flex items-center gap-2",children:[s.length>0&&(0,St.jsx)(Yt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:x,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,St.jsx)(Jo.ChevronLeft,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,St.jsx)("h4",{className:"font-medium text-sm",children:f?.name||"Capabilities"})]}),(0,St.jsx)(Yt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:o,className:c("group p-1 h-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,St.jsx)(Jo.X,{className:c("h-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,St.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,St.jsx)(Yt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>d([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,St.jsxs)("span",{className:"relative",children:["Capabilities",(0,St.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),s.map((N,z)=>(0,St.jsxs)("div",{className:"flex items-center gap-1",children:[(0,St.jsx)(Jo.ChevronRight,{className:"h-2 w-2"}),(0,St.jsx)(Yt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>T(z),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,St.jsxs)("span",{className:"relative",children:[N.name,(0,St.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},N.id))]}),(0,St.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,St.jsx)(Yt.AnimatePresence,{mode:"wait",children:(0,St.jsx)(Yt.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:f?.type==="list"&&f.data?(0,St.jsx)(br,{data:f.data,onItemSelect:N=>C([...m,N]),colorScheme:n}):(0,St.jsx)(gr,{capabilities:h,onSelect:R,colorScheme:n})},f?.id||"root")})})]}):(0,St.jsxs)(A,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,St.jsx)(Jo.Menu,{className:"h-4 w-4"}),(0,St.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function gr({capabilities:e,onSelect:t,colorScheme:o}){return(0,St.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,r)=>(0,St.jsx)(fr,{capability:a,onClick:()=>t(a),color:o.categories[r%o.categories.length]},a.id))})}function fr({capability:e,onClick:t,selected:o,color:a}){return(0,St.jsxs)(Yt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,St.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,St.jsxs)("span",{className:"truncate relative",children:[e.name,(0,St.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,St.jsx)(Jo.ChevronRight,{className:c("h-3 w-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,St.jsx)(le,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function br({data:e,onItemSelect:t,colorScheme:o}){return(0,St.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,r)=>(0,St.jsxs)(Yt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(a),children:[(0,St.jsx)("div",{className:c("w-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[r%o.items.length])}),(0,St.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,St.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,St.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,St.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,St.jsx)(le,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var Ia=V(require("react"));var No=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:r="This endpoint requires authentication to sync functions."})=>{let[n,l]=(0,st.useState)(!1),[s,d]=(0,st.useState)(""),m=()=>{if(!t){d("No authentication URL provided");return}l(!0),d("");try{let f=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!f){d("Popup blocked. Please allow popups for this site and try again."),l(!1);return}let h=setInterval(()=>{try{f.closed&&(clearInterval(h),l(!1),a(),o())}catch{}},1e3);setTimeout(()=>{f.closed||(f.close(),clearInterval(h),l(!1),d("Authentication timed out. Please try again."))},6e5)}catch{d("Failed to open authentication window"),l(!1)}},C=async()=>{try{await navigator.clipboard.writeText(t),d("")}catch{d("Failed to copy URL to clipboard")}};return e?(0,St.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,St.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,St.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,St.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:r}),s&&(0,St.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,St.jsxs)("div",{className:"flex gap-2",children:[(0,St.jsx)("button",{onClick:m,disabled:n||!t,className:`
10
10
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
11
- ${r||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
12
- `,children:r?"Authenticating...":"Authenticate"}),(0,Pt.jsx)("button",{onClick:w,disabled:!t,className:`
11
+ ${n||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
12
+ `,children:n?"Authenticating...":"Authenticate"}),(0,St.jsx)("button",{onClick:C,disabled:!t,className:`
13
13
  px-4 py-2 text-white border-none rounded text-sm
14
14
  ${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
15
- `,children:"Copy URL"}),(0,Pt.jsx)("button",{onClick:a,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var ua=({toolPart:e,index:t,addToolResult:a})=>{let[o,l]=wo.default.useState(!0),r=()=>{a(e.input?.toolCallId,e.input?.tool,"Authentication completed"),l(!1)};switch(e.state){case"input-available":return(0,Pt.jsxs)("div",{className:"mb-2",children:[(0,Pt.jsx)(ma,{isOpen:o,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>l(!1),onSuccess:r,description:e.output?.reason||e.input?.reason}),!o&&(0,Pt.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Pt.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,Pt.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Pt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,Pt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Co=require("marked"),No=V(require("react-markdown"));function ir(e){return Co.marked.lexer(e).map(a=>a.raw)}var ko=(0,it.memo)(({content:e})=>(0,Pt.jsx)(No.default,{children:e}),(e,t)=>e.content===t.content);ko.displayName="MemoizedMarkdownBlock";var ga=(0,it.memo)(({content:e,id:t})=>(0,it.useMemo)(()=>ir(e),[e]).map((o,l)=>(0,Pt.jsx)(ko,{content:o},`${t}-block_${l}`)));ga.displayName="PartText";var va=V(require("react"));var ba=({isOpen:e=!0,reason:t,onClose:a,onApprove:o,onDeny:l,title:r="Approval Required"})=>{let[s,i]=(0,it.useState)(!1),d=()=>{i(!0),o(),a()},m=()=>{i(!0),l(),a()},w=()=>{i(!0),l(),a()};return e?(0,Pt.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,Pt.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:r}),(0,Pt.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,Pt.jsxs)("div",{className:"flex gap-2",children:[(0,Pt.jsx)("button",{onClick:d,disabled:s,className:`
15
+ `,children:"Copy URL"}),(0,St.jsx)("button",{onClick:o,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var ko=({toolPart:e,index:t,addToolResult:o})=>{let[a,r]=Ia.default.useState(!0),n=()=>{o(e.input?.toolCallId,e.input?.tool,"Authentication completed"),r(!1)};switch(e.state){case"input-available":return(0,$e.jsxs)("div",{className:"mb-2",children:[(0,$e.jsx)(No,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>r(!1),onSuccess:n,description:e.output?.reason||e.input?.reason}),!a&&(0,$e.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,$e.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,$e.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,$e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,$e.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var Ma=require("marked"),Ba=V(require("react-markdown"));function vr(e){return Ma.marked.lexer(e).map(o=>o.raw)}var La=(0,st.memo)(({content:e})=>(0,St.jsx)(Ba.default,{children:e}),(e,t)=>e.content===t.content);La.displayName="MemoizedMarkdownBlock";var Po=(0,st.memo)(({content:e,id:t})=>(0,st.useMemo)(()=>vr(e),[e]).map((a,r)=>(0,St.jsx)(La,{content:a},`${t}-block_${r}`)));Po.displayName="PartText";var Ro=V(require("react"));var Do=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:r,title:n="Approval Required"})=>{let[l,s]=(0,st.useState)(!1),d=()=>{s(!0),a(),o()},m=()=>{s(!0),r(),o()},C=()=>{s(!0),r(),o()};return e?(0,St.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,St.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:n}),(0,St.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,St.jsxs)("div",{className:"flex gap-2",children:[(0,St.jsx)("button",{onClick:d,disabled:l,className:`
16
16
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
17
- ${s?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
18
- `,children:s?"Processing...":"Approve"}),(0,Pt.jsx)("button",{onClick:m,disabled:s,className:`
17
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
18
+ `,children:l?"Processing...":"Approve"}),(0,St.jsx)("button",{onClick:m,disabled:l,className:`
19
19
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
20
- ${s?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
21
- `,children:s?"Processing...":"Deny"}),(0,Pt.jsx)("button",{onClick:w,disabled:s,className:`
20
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
21
+ `,children:l?"Processing...":"Deny"}),(0,St.jsx)("button",{onClick:C,disabled:l,className:`
22
22
  px-4 py-2 text-white border-none rounded text-sm
23
- ${s?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
24
- `,children:"Cancel"})]})]}):null};var Do=({toolPart:e,index:t,addToolResult:a})=>{let[o,l]=va.default.useState(!0),[r,s]=va.default.useState(null),i=()=>{a(e.input?.toolCallId,e.input?.tool,"Approved"),l(!1),s("approve")},d=()=>{a(e.input?.toolCallId,e.input?.tool,"Denied"),l(!1),s("deny")};switch(e.state){case"input-available":return(0,Pt.jsxs)("div",{className:"mb-2",children:[(0,Pt.jsx)(ba,{isOpen:o,onApprove:i,onDeny:d,onClose:()=>l(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!o&&(0,Pt.jsxs)(Pt.Fragment,{children:[r==="approve"&&(0,Pt.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Pt.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,Pt.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Pt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),r==="deny"&&(0,Pt.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Pt.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,Pt.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Pt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Pt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var ya=require("@radix-ui/react-use-controllable-state");var ct=V(require("@radix-ui/react-collapsible")),To=ct.Root,Ro=ct.CollapsibleTrigger,Ao=ct.CollapsibleContent;var Mo=require("streamdown"),ha=(0,it.memo)(({className:e,...t})=>(0,Pt.jsx)(Mo.Streamdown,{className:c("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);ha.displayName="Response";var Lo=(0,it.createContext)(null),rr=()=>{let e=(0,it.useContext)(Lo);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},nr=1e3,sr=1e3,xa=(0,it.memo)(({className:e,isStreaming:t=!1,open:a,defaultOpen:o=!0,onOpenChange:l,duration:r,children:s,...i})=>{let[d,m]=(0,ya.useControllableState)({prop:a,defaultProp:o,onChange:l}),[w,f]=(0,ya.useControllableState)({prop:r,defaultProp:0}),[h,R]=(0,it.useState)(!1),[M,T]=(0,it.useState)(null);(0,it.useEffect)(()=>{t?M===null&&T(Date.now()):M!==null&&(f(Math.ceil((Date.now()-M)/sr)),T(null))},[t,M,f]),(0,it.useEffect)(()=>{if(o&&!t&&d&&!h){let P=setTimeout(()=>{m(!1),R(!0)},nr);return()=>clearTimeout(P)}},[t,d,o,m,h]);let x=P=>{m(P)};return(0,Pt.jsx)(Lo.Provider,{value:{isStreaming:t,isOpen:d,setIsOpen:m,duration:w},children:(0,Pt.jsx)(To,{className:c("not-prose mb-4",e),onOpenChange:x,open:d,...i,children:s})})}),lr=(e,t)=>e||t===0?(0,Pt.jsx)("p",{children:"Thinking..."}):t===void 0?(0,Pt.jsx)("p",{children:"Thought for a few seconds"}):(0,Pt.jsxs)("p",{children:["Thought for ",t," seconds"]}),wa=(0,it.memo)(({className:e,children:t,...a})=>{let{isStreaming:o,isOpen:l,duration:r}=rr();return(0,Pt.jsx)(Ro,{className:c("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...a,children:t??(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsx)(Fa.BrainIcon,{className:"size-4"}),lr(o,r),(0,Pt.jsx)(Fa.ChevronDownIcon,{className:c("size-4 transition-transform",l?"rotate-180":"rotate-0")})]})})}),Ca=(0,it.memo)(({className:e,children:t,...a})=>(0,Pt.jsx)(Ao,{className:c("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...a,children:(0,Pt.jsx)(ha,{className:"grid gap-2",children:t})}));xa.displayName="Reasoning";wa.displayName="ReasoningTrigger";Ca.displayName="ReasoningContent";function Ht({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:l,fileUploads:r,isDragOver:s,enableFileUpload:i,onInputChange:d,addToolResult:m,onSendMessage:w,onKeyPress:f,onFileUpload:h,onRemoveFile:R,onDragOver:M,className:T}){let x=(0,it.useRef)(null),P=(0,it.useRef)(null),F=(0,it.useRef)(null),[C,z]=(0,it.useState)(!1),[ee,te]=(0,it.useState)({path:[],selectedItems:[],filters:{}});(0,it.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,it.useEffect)(()=>{C&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[C]);let ae=()=>Rt(ee),Z=()=>{let u=[];return l.forEach(j=>{j.actions&&j.actions.forEach(J=>{u.push({label:J.label,action:()=>q(J.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach(J=>{J.type==="list"&&J.data&&u.push({label:`View ${J.name}`,action:()=>z(!0)})})}),u.slice(0,5)},q=(u,j)=>{console.log("Capability action:",u,j);let J=`Executing ${u} with context: ${JSON.stringify(j.path.map(A=>A.name))}`;z(!1)},re=Rt({path:[],selectedItems:[],filters:{}}),de=u=>{h(u.target.files),u.target.files&&(u.target.value="")},I=u=>{u.preventDefault(),M(!0)},Ie=u=>{u.preventDefault(),M(!1)},p=u=>{u.preventDefault(),M(!1),h(u.dataTransfer.files)},E=u=>{if(u===0)return"0 Bytes";let j=1024,J=["Bytes","KB","MB","GB"],A=Math.floor(Math.log(u)/Math.log(j));return parseFloat((u/Math.pow(j,A)).toFixed(2))+" "+J[A]},L=u=>u.startsWith("image/")?(0,Pt.jsx)($.Image,{className:"h-4 w-4"}):u.startsWith("text/")?(0,Pt.jsx)($.FileText,{className:"h-4 w-4"}):(0,Pt.jsx)($.File,{className:"h-4 w-4"}),_=u=>{let j=u.role==="assistant",J=u.role==="user";return(0,Pt.jsxs)("div",{className:c("flex my-2 items-start gap-3",J?"flex-row-reverse":""),children:[(0,Pt.jsx)(be,{className:"h-8 w-8 shrink-0",children:(0,Pt.jsx)(ve,{className:c(J?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:J?(0,Pt.jsx)($.User,{className:"h-4 w-4"}):(0,Pt.jsx)($.Bot,{className:"h-4 w-4"})})}),(0,Pt.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",J?"bg-primary text-primary-foreground":"bg-muted"),children:u.parts.map((A,K)=>{if(A.type==="text")return(0,Pt.jsx)(ga,{id:u.id,content:A.text},`${u.id}-text`);if(A.type==="file"){let k=A;return(0,Pt.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Pt.jsxs)("div",{className:"flex items-center gap-2",children:[L(k.mediaType||"application/octet-stream"),(0,Pt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Pt.jsx)("p",{className:"text-sm font-medium truncate",children:k.filename||k.url?.split("/").pop()||"File"})}),k.url&&(0,Pt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>window.open(k.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Pt.jsx)($.Download,{className:"h-4 w-4"})})]})},K)}if(A.type.startsWith("tool-")){let k=A,De=A.type.replace("tool-","");if(De==="task")switch(k.state){case"input-available":return(0,Pt.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},K);case"output-available":return(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsx)(ft,{data:{id:k.output?.id||k.input?.id,fetchLatest:!1,taskData:k.output||k.input}})},K);case"output-error":return(0,Pt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},K);default:return null}if(A.type==="tool-requestEndpointLogin")return(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsx)(ua,{toolPart:k,index:K,addToolResult:m??(()=>{})})},K);if(A.type==="tool-authenticate")return(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsx)(ua,{toolPart:k,index:K,addToolResult:m??(()=>{})})},K);if(A.type==="tool-requestApproval")return(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsx)(Do,{toolPart:k,index:K,addToolResult:m??(()=>{})})},K);if(De==="artefact")switch(k.state){case"input-available":return(0,Pt.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},K);case"output-available":return(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsx)(Qt,{artefact:k.output?.description||"",taskId:k.output?.id||k.input?.id,taskData:k.output||k.input})},K);case"output-error":return(0,Pt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",k.errorText]},K);default:return null}return(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsxs)(he,{className:"w-full max-w-md",children:[(0,Pt.jsx)(ze,{children:(0,Pt.jsx)(Ue,{className:"text-lg",children:De})}),(0,Pt.jsxs)(Te,{children:[k.state==="input-available"&&(0,Pt.jsxs)("p",{className:"text-sm",children:["Processing ",De,"..."]}),k.state==="output-available"&&(0,Pt.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.output,null,2)}),k.state==="output-error"&&(0,Pt.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",k.errorText]})]})]})},K)}if(A.type.startsWith("data-")){let k=A,De=A.type.replace("data-","");return De==="reference"?(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsx)(he,{className:"w-full",children:(0,Pt.jsx)(Te,{className:"p-4",children:(0,Pt.jsx)("div",{className:"space-y-2",children:k.data?.references?.map((me,Le)=>(0,Pt.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Pt.jsx)(ge,{variant:"outline",children:me.type||"link"}),(0,Pt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pt.jsx)("p",{className:"text-sm font-medium truncate",children:me.title}),me.description&&(0,Pt.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:me.description})]}),me.url&&(0,Pt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>window.open(me.url,"_blank"),className:"h-8 w-8 p-0",children:(0,Pt.jsx)($.ExternalLink,{className:"h-4 w-4"})})]},Le))})})})},K):De==="menu"?(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsxs)(he,{className:"w-full",children:[(0,Pt.jsx)(ze,{children:(0,Pt.jsx)(Ue,{className:"text-lg",children:k.data?.title})}),(0,Pt.jsx)(Te,{children:(0,Pt.jsx)("div",{className:"space-y-2",children:k.data?.items?.map((me,Le)=>(0,Pt.jsx)(S,{variant:"outline",className:"w-full justify-start",onClick:me.action,children:(0,Pt.jsxs)("div",{className:"text-left",children:[(0,Pt.jsx)("p",{className:"font-medium",children:me.label}),me.description&&(0,Pt.jsx)("p",{className:"text-xs text-muted-foreground",children:me.description})]})},Le))})})]})},K):(0,Pt.jsx)("div",{className:"mb-2",children:(0,Pt.jsxs)(he,{className:"w-full max-w-md",children:[(0,Pt.jsx)(ze,{children:(0,Pt.jsx)(Ue,{className:"text-lg",children:De})}),(0,Pt.jsx)(Te,{children:(0,Pt.jsx)("pre",{className:"text-sm",children:JSON.stringify(k.data,null,2)})})]})},K)}if(A.type==="reasoning")return(0,Pt.jsxs)(xa,{className:"w-full",isStreaming:status==="streaming"&&K===u.parts.length-1&&u.id===e.at(-1)?.id,children:[(0,Pt.jsx)(wa,{}),(0,Pt.jsx)(Ca,{children:A.text})]},`${u.id}-${K}`)})})]})};return(0,Pt.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${T||""}`,children:[(0,Pt.jsxs)(xe,{ref:P,className:"flex-1 p-4 bg-background border-0",onDragOver:I,onDragLeave:Ie,onDrop:p,children:[(0,Pt.jsxs)("div",{className:c("space-y-4",s&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Pt.jsx)(tt.animate,{children:e.map(u=>(0,Pt.jsx)(tt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:c("flex gap-3",u.role==="user"?"flex-row-reverse":"flex-row"),children:_(u)},u.id))}),C&&(0,Pt.jsxs)(tt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Pt.jsx)(be,{className:"h-8 w-8",children:(0,Pt.jsx)(ve,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Pt.jsx)($.Bot,{className:"h-4 w-4"})})}),(0,Pt.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Pt.jsx)(da,{capabilities:l,isOpen:C,onToggle:()=>z(!C),onActionSelect:q,className:"w-full"})})]}),a&&(0,Pt.jsxs)(tt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Pt.jsx)(be,{className:"h-8 w-8",children:(0,Pt.jsx)(ve,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Pt.jsx)($.Bot,{className:"h-4 w-4"})})}),(0,Pt.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Pt.jsxs)("div",{className:"flex space-x-1",children:[(0,Pt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Pt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Pt.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Pt.jsx)("div",{ref:x})]}),r.length>0&&(0,Pt.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Pt.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(u=>(0,Pt.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[L(u.file.type),(0,Pt.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Pt.jsx)("span",{className:"text-xs text-muted-foreground",children:E(u.file.size)}),(0,Pt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>R(u.id),className:"h-6 w-6 p-0",children:(0,Pt.jsx)($.X,{className:"h-4 w-4"})})]},u.id))})}),(0,Pt.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Pt.jsxs)("div",{className:"flex gap-3",children:[(0,Pt.jsx)(bt,{value:t,onChange:u=>d(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),i&&(0,Pt.jsx)(S,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Pt.jsx)($.Paperclip,{className:"h-4 w-4"})}),(0,Pt.jsx)(S,{onClick:w,disabled:!t.trim()&&r.length===0||a,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,Pt.jsx)($.Send,{className:"h-4 w-4"})})]}),(0,Pt.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Pt.jsxs)(S,{onClick:()=>z(!C),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Pt.jsx)($.Menu,{className:"h-3 w-3 mr-1"}),C?"Hide":"Show"," Capabilities"]}),(0,Pt.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ae().map((u,j)=>(0,Pt.jsx)(S,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>q(u.id,ee),children:u.label},`context-${u.id}`)),ae().length===0&&Z().map((u,j)=>(0,Pt.jsx)(S,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${j}`))]})]}),i&&(0,Pt.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:de,className:"hidden"})]})]})}function cr({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:l=[],capabilities:r=[],sidebarItems:s=[],notifications:i=[],sessions:d=[],onNewChat:m,onSessionSelect:w,onSessionDelete:f,onSessionEdit:h=()=>{},onBusinessUnitChange:R=()=>{},onNotificationRemove:M=()=>{},onRemoveAll:T=()=>{},onActionClick:x=()=>{},onSearch:P=E=>console.log("Search query:",E),initialTeam:F="design",currentSession:C=null,showCapabilities:z=!0,title:ee="Digital Colleagues",enableFileUpload:te=!0,maxFileSize:ae=10,allowedFileTypes:Z=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:q="/headerlogo.png",appName:re="Nuvia",tagline:de="AI-Powered Workspace",actionIcon:I=(0,Pt.jsx)(Fa.Users,{className:"mr-2 h-4 w-4"}),actionText:Ie="Collaborate",sidebarInitiallyClosed:p=!1}){let E={...e,onError:O=>{_?.setMessages(ue=>[...ue,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:O.message}]}]),console.error("Error in CopilotInterface:",O)}},L=(0,Bo.useChat)(E||{}),_=a?t||L:null,[u,j]=(0,it.useState)(""),[J,A]=(0,it.useState)(!1),K=_?.messages||o,k=u,De=_?.status==="submitted"||J,me=_?.addToolResult?(O,ue,ne)=>{_.addToolResult({tool:ue,toolCallId:O,output:ne}),_.sendMessage()}:()=>{},Le=l||[],zo={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Uo,Fo]=(0,it.useState)(()=>Le.length===0?zo:Le.find(O=>O.id===F)||Le[0]),[pt,wt]=(0,it.useState)([]),[jo,Oo]=(0,it.useState)(!1),Ho=O=>{if(!O||!te)return;let ue=[];Array.from(O).forEach(ne=>{if(ne.size>ae*1024*1024){alert(`File ${ne.name} is too large. Maximum size is ${ae}MB.`);return}if(Z.length>0&&!Z.some(Ct=>ne.type.match(Ct))){alert(`File type ${ne.type} is not allowed.`);return}let ka={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ne,status:"pending",progress:0};if(ne.type.startsWith("image/")){let Ct=new FileReader;Ct.onload=qo=>{wt(Ko=>Ko.map($t=>$t.id===ka.id?{...$t,preview:qo.target?.result}:$t))},Ct.readAsDataURL(ne)}ue.push(ka)}),wt(ne=>[...ne,...ue])},Vo=O=>{wt(ue=>ue.filter(ne=>ne.id!==O))},Na=()=>{if(!(!k.trim()&&pt.length===0)){if(_){let O=pt.length>0?$o(pt.map(ue=>ue.file)):void 0;_.sendMessage({text:k,files:O},{body:{timestamp:Date.now()}}),j("")}else console.log("Message to send:",k),console.log("Files to upload:",pt),j(""),A(!0),setTimeout(()=>{A(!1)},1500);wt([])}},$o=O=>{let ue=new DataTransfer;return O.forEach(ne=>ue.items.add(ne)),ue.files},Wo=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),Na())},Go=O=>{j(O)};return(0,Pt.jsx)(yo,{sidebarItems:s||[],title:ee,notifications:i||[],businessUnits:Le,currentBusinessUnit:Uo,onBusinessUnitChange:O=>{O&&(Fo(O),R?.(O))},onSearch:P,showTabs:!1,onActionClick:x,actionIcon:I,actionText:Ie,onNotificationRemove:M,onRemoveAll:T,logo:q,appName:re,tagline:de,sidebarInitiallyClosed:p,children:(0,Pt.jsx)(Vt.AnimatePresence,{mode:"wait",children:(0,Pt.jsx)(Vt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Pt.jsxs)("div",{className:"h-full flex",children:[(0,Pt.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,Pt.jsx)(xo,{sessions:d||[],currentSession:C,teams:Le,onNewChat:m,onSessionSelect:w,onSessionEdit:h,onSessionDelete:f})}),(0,Pt.jsx)("div",{className:"flex-1 h-full p-2",children:(0,Pt.jsx)(Ht,{messages:K||[],input:k,isTyping:De,currentSessionTitle:C?.title,capabilities:r||[],onInputChange:Go,addToolResult:me,onSendMessage:Na,onKeyPress:Wo,fileUploads:pt,isDragOver:jo,enableFileUpload:te,onFileUpload:Ho,onRemoveFile:Vo,onDragOver:Oo})})]})},"chat-interface")})})}function dr(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function pr(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function mr(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function ur(e){return e.parts.some(t=>t.type==="file")}function gr(e){return e.parts.filter(t=>t.type==="file")}function fr(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function br(e,t){return e.parts.find(a=>a.type===`data-${t}`)}0&&(module.exports={ApprovalRequestModal,CapabilityMenu,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,CopilotInterface,OAuthModal,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,testCapabilities});
23
+ ${l?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
24
+ `,children:"Cancel"})]})]}):null};var za=({toolPart:e,index:t,addToolResult:o})=>{let[a,r]=Ro.default.useState(!0),[n,l]=Ro.default.useState(null),s=()=>{o(e.input?.toolCallId,e.input?.tool,"Approved"),r(!1),l("approve")},d=()=>{o(e.input?.toolCallId,e.input?.tool,"Denied"),r(!1),l("deny")};switch(e.state){case"input-available":return(0,St.jsxs)("div",{className:"mb-2",children:[(0,St.jsx)(Do,{isOpen:a,onApprove:s,onDeny:d,onClose:()=>r(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,St.jsxs)(St.Fragment,{children:[n==="approve"&&(0,St.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,St.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,St.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,St.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),n==="deny"&&(0,St.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,St.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,St.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,St.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,St.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);default:return null}};var So=require("@radix-ui/react-use-controllable-state");var mt=V(require("@radix-ui/react-collapsible")),Wt=mt.Root,Gt=mt.CollapsibleTrigger,qt=mt.CollapsibleContent;var Fa=require("streamdown"),kt=(0,st.memo)(({className:e,...t})=>(0,St.jsx)(Fa.Streamdown,{className:c("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);kt.displayName="Response";var Oa=(0,st.createContext)(null),hr=()=>{let e=(0,st.useContext)(Oa);if(!e)throw new Error("Reasoning components must St used within Reasoning");return e},yr=1e3,xr=1e3,Ao=(0,st.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:r,duration:n,children:l,...s})=>{let[d,m]=(0,So.useControllableState)({prop:o,defaultProp:a,onChange:r}),[C,f]=(0,So.useControllableState)({prop:n,defaultProp:0}),[h,S]=(0,st.useState)(!1),[I,R]=(0,st.useState)(null);(0,st.useEffect)(()=>{t?I===null&&R(Date.now()):I!==null&&(f(Math.ceil((Date.now()-I)/xr)),R(null))},[t,I,f]),(0,st.useEffect)(()=>{if(a&&!t&&d&&!h){let T=setTimeout(()=>{m(!1),S(!0)},yr);return()=>clearTimeout(T)}},[t,d,a,m,h]);let x=T=>{m(T)};return(0,St.jsx)(Oa.Provider,{value:{isStreaming:t,isOpen:d,setIsOpen:m,duration:C},children:(0,St.jsx)(Wt,{className:c("not-prose mb-4",e),onOpenChange:x,open:d,...s,children:l})})}),wr=(e,t)=>e||t===0?(0,St.jsx)("p",{children:"Thinking..."}):t===void 0?(0,St.jsx)("p",{children:"Thought for a few seconds"}):(0,St.jsxs)("p",{children:["Thought for ",t," seconds"]}),Io=(0,st.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:r,duration:n}=hr();return(0,St.jsx)(Gt,{className:c("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,St.jsxs)(St.Fragment,{children:[(0,St.jsx)(Jo.BrainIcon,{className:"size-4"}),wr(a,n),(0,St.jsx)(Jo.ChevronDownIcon,{className:c("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),Mo=(0,st.memo)(({className:e,children:t,...o})=>(0,St.jsx)(qt,{className:c("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,St.jsx)(kt,{className:"grid gap-2",children:t})}));Ao.displayName="Reasoning";Io.displayName="ReasoningTrigger";Mo.displayName="ReasoningContent";var Bo=require("react-syntax-highlighter"),Jt=require("react-syntax-highlighter/dist/esm/styles/prism"),Cr=(0,st.createContext)({code:""}),Xt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:r,...n})=>(0,St.jsx)(Cr.Provider,{value:{code:e},children:(0,St.jsx)("div",{className:c("relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...n,children:(0,St.jsxs)("div",{className:"relative",children:[(0,St.jsx)(Bo.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:Jt.oneLight,children:e}),(0,St.jsx)(Bo.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:Jt.oneDark,children:e}),r&&(0,St.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})});var $a=({className:e,...t})=>(0,$.jsx)(Wt,{className:c("not-prose mb-4 w-full rounded-md border",e),...t}),Nr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,$.jsxs)(le,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,$.jsx)(Jo.CircleIcon,{className:"size-4"}),"input-available":(0,$.jsx)(Jo.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,$.jsx)(Jo.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,$.jsx)(Jo.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Va=({className:e,type:t,state:o,...a})=>(0,$.jsxs)(Gt,{className:c("flex w-full items-center justify-between gap-4 p-3",e),...a,children:[(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$.jsx)(Jo.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,$.jsx)("span",{className:"font-medium text-sm",children:t}),Nr(o)]}),(0,$.jsx)(Jo.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Wa=({className:e,...t})=>(0,$.jsx)(qt,{className:c("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}),Ga=({className:e,input:t,...o})=>(0,$.jsxs)("div",{className:c("space-y-2 overflow-hidden p-4",e),...o,children:[(0,$.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,$.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,$.jsx)(Xt,{code:JSON.stringify(t,null,2),language:"json"})})]}),qa=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let r=(0,$.jsx)("div",{children:t});return typeof t=="object"?r=(0,$.jsx)(Xt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(r=(0,$.jsx)(Xt,{code:t,language:"json"})),(0,$.jsxs)("div",{className:c("space-y-2 p-4",e),...a,children:[(0,$.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,$.jsxs)("div",{className:c("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,$.jsx)("div",{children:o}),r]})]})};function Qt({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:r,fileUploads:n,isDragOver:l,enableFileUpload:s,onInputChange:d,addToolResult:m,onSendMessage:C,onKeyPress:f,onFileUpload:h,onRemoveFile:S,onDragOver:I,className:R}){let x=(0,st.useRef)(null),T=(0,st.useRef)(null),F=(0,st.useRef)(null),[N,z]=(0,st.useState)(!1),[te,oe]=(0,st.useState)({path:[],selectedItems:[],filters:{}});(0,st.useEffect)(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,st.useEffect)(()=>{N&&setTimeout(()=>{x.current?.scrollIntoView({behavior:"smooth"})},100)},[N]);let ae=()=>Mt(te),ee=()=>{let u=[];return r.forEach(j=>{j.actions&&j.actions.forEach(X=>{u.push({label:X.label,action:()=>K(X.id,{path:[j],selectedItems:[],filters:{}})})}),j.children&&j.children.forEach(X=>{X.type==="list"&&X.data&&u.push({label:`View ${X.name}`,action:()=>z(!0)})})}),u.slice(0,5)},K=(u,j)=>{console.log("Capability action:",u,j);let X=`Executing ${u} with context: ${JSON.stringify(j.path.map(w=>w.name))}`;z(!1)},ne=Mt({path:[],selectedItems:[],filters:{}}),me=u=>{h(u.target.files),u.target.files&&(u.target.value="")},M=u=>{u.preventDefault(),I(!0)},Le=u=>{u.preventDefault(),I(!1)},p=u=>{u.preventDefault(),I(!1),h(u.dataTransfer.files)},E=u=>{if(u===0)return"0 Bytes";let j=1024,X=["Bytes","KB","MB","GB"],w=Math.floor(Math.log(u)/Math.log(j));return parseFloat((u/Math.pow(j,w)).toFixed(2))+" "+X[w]},B=u=>u.startsWith("image/")?(0,St.jsx)(Jo.Image,{className:"h-4 w-4"}):u.startsWith("text/")?(0,St.jsx)(Jo.FileText,{className:"h-4 w-4"}):(0,St.jsx)(Jo.File,{className:"h-4 w-4"}),J=u=>{let j=u.role==="assistant",X=u.role==="user";return(0,St.jsxs)("div",{className:c("flex my-2 items-start gap-3",X?"flex-row-reverse":""),children:[(0,St.jsx)(ve,{className:"h-8 w-8 shrink-0",children:(0,St.jsx)(he,{className:c(X?"bg-primary text-primary-foreground":"bg-gradient-to-br from-purple-600 to-blue-600 text-white"),children:X?(0,St.jsx)(Jo.User,{className:"h-4 w-4"}):(0,St.jsx)(Jo.Bot,{className:"h-4 w-4"})})}),(0,St.jsx)("div",{className:c("max-w-[80%] rounded-2xl px-4 py-3 shadow-sm",X?"bg-primary text-primary-foreground":"bg-muted"),children:u.parts.map((w,_)=>{if(w.type==="text")return(0,St.jsx)(Po,{id:u.id,content:w.text},`${u.id}-text`);if(w.type==="file"){let P=w;return(0,St.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,St.jsxs)("div",{className:"flex items-center gap-2",children:[B(P.mediaType||"application/octet-stream"),(0,St.jsx)("div",{className:"flex-1 min-w-0",children:(0,St.jsx)("p",{className:"text-sm font-medium truncate",children:P.filename||P.url?.split("/").pop()||"File"})}),P.url&&(0,St.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>window.open(P.url,"_blank"),className:"h-8 w-8 p-0",children:(0,St.jsx)(Jo.Download,{className:"h-4 w-4"})})]})},_)}if(w.type.startsWith("tool-")){let P=w,Re=w.type.replace("tool-","");if(Re==="task")switch(P.state){case"input-available":return(0,St.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},_);case"output-available":return(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsx)(ht,{data:{id:P.output?.id||P.input?.id,fetchLatest:!1,taskData:P.output||P.input}})},_);case"output-error":return(0,St.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",P.errorText]},_);default:return null}if(w.type==="tool-requestEndpointLogin")return(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsx)(ko,{toolPart:P,index:_,addToolResult:m??(()=>{})})},_);if(w.type==="tool-authenticate")return(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsx)(ko,{toolPart:P,index:_,addToolResult:m??(()=>{})})},_);if(w.type==="tool-requestApproval")return(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsx)(za,{toolPart:P,index:_,addToolResult:m??(()=>{})})},_);if(Re==="artefact")switch(P.state){case"input-available":return(0,St.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},_);case"output-available":return(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsx)(so,{artefact:P.output?.description||"",taskId:P.output?.id||P.input?.id,taskData:P.output||P.input})},_);case"output-error":return(0,St.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",P.errorText]},_);default:return null}return(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsxs)(ye,{className:"w-full max-w-md",children:[(0,St.jsx)(Fe,{children:(0,St.jsx)(je,{className:"text-lg",children:Re})}),(0,St.jsxs)(Se,{children:[P.state==="input-available"&&(0,St.jsxs)("p",{className:"text-sm",children:["Processing ",Re,"..."]}),P.state==="output-available"&&(0,St.jsx)("pre",{className:"text-sm",children:JSON.stringify(P.output,null,2)}),P.state==="output-error"&&(0,St.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",P.errorText]})]})]})},_)}if(w.type.startsWith("data-")){let P=w,Re=w.type.replace("data-","");return Re==="reference"?(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsx)(ye,{className:"w-full",children:(0,St.jsx)(Se,{className:"p-4",children:(0,St.jsx)("div",{className:"space-y-2",children:P.data?.references?.map((ge,Ee)=>(0,St.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,St.jsx)(le,{variant:"outline",children:ge.type||"link"}),(0,St.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,St.jsx)("p",{className:"text-sm font-medium truncate",children:ge.title}),ge.description&&(0,St.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:ge.description})]}),ge.url&&(0,St.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>window.open(ge.url,"_blank"),className:"h-8 w-8 p-0",children:(0,St.jsx)(Jo.ExternalLink,{className:"h-4 w-4"})})]},Ee))})})})},_):Re==="menu"?(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsxs)(ye,{className:"w-full",children:[(0,St.jsx)(Fe,{children:(0,St.jsx)(je,{className:"text-lg",children:P.data?.title})}),(0,St.jsx)(Se,{children:(0,St.jsx)("div",{className:"space-y-2",children:P.data?.items?.map((ge,Ee)=>(0,St.jsx)(A,{variant:"outline",className:"w-full justify-start",onClick:ge.action,children:(0,St.jsxs)("div",{className:"text-left",children:[(0,St.jsx)("p",{className:"font-medium",children:ge.label}),ge.description&&(0,St.jsx)("p",{className:"text-xs text-muted-foreground",children:ge.description})]})},Ee))})})]})},_):(0,St.jsx)("div",{className:"mb-2",children:(0,St.jsxs)(ye,{className:"w-full max-w-md",children:[(0,St.jsx)(Fe,{children:(0,St.jsx)(je,{className:"text-lg",children:Re})}),(0,St.jsx)(Se,{children:(0,St.jsx)("pre",{className:"text-sm",children:JSON.stringify(P.data,null,2)})})]})},_)}if(w.type==="reasoning")return(0,St.jsxs)(Ao,{className:"w-full",isStreaming:status==="streaming"&&_===u.parts.length-1&&u.id===e.st(-1)?.id,children:[(0,St.jsx)(Io,{}),(0,St.jsx)(Mo,{children:w.text})]},`${u.id}-${_}`);if(w.type==="dynamic-tool")return(0,St.jsxs)($a,{defaultOpen:!0,children:[(0,St.jsx)(Va,{type:`tool-${w.toolName}`,state:w.state}),(0,St.jsxs)(Wa,{children:[(0,St.jsx)(Ga,{input:w.input}),(0,St.jsx)(qa,{output:(0,St.jsx)(kt,{children:String(w.output)}),errorText:w.errorText})]})]})})})]})};return(0,St.jsxs)("div",{className:`h-full flex flex-col shadow-sm max-w-4xl mx-auto ${R||""}`,children:[(0,St.jsxs)(we,{ref:T,className:"flex-1 p-4 bg-background border-0",onDragOver:M,onDragLeave:Le,onDrop:p,children:[(0,St.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,St.jsx)(it.animate,{children:e.map(u=>(0,St.jsx)(it.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:c("flex gap-3",u.role==="user"?"flex-row-reverse":"flex-row"),children:J(u)},u.id))}),N&&(0,St.jsxs)(it.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,St.jsx)(ve,{className:"h-8 w-8",children:(0,St.jsx)(he,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,St.jsx)(Jo.Bot,{className:"h-4 w-4"})})}),(0,St.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,St.jsx)(wo,{capabilities:r,isOpen:N,onToggle:()=>z(!N),onActionSelect:K,className:"w-full"})})]}),o&&(0,St.jsxs)(it.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,St.jsx)(ve,{className:"h-8 w-8",children:(0,St.jsx)(he,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,St.jsx)(Jo.Bot,{className:"h-4 w-4"})})}),(0,St.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,St.jsxs)("div",{className:"flex space-x-1",children:[(0,St.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,St.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,St.jsx)("div",{className:"w-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,St.jsx)("div",{ref:x})]}),n.length>0&&(0,St.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,St.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(u=>(0,St.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[B(u.file.type),(0,St.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,St.jsx)("span",{className:"text-xs text-muted-foreground",children:E(u.file.size)}),(0,St.jsx)(A,{variant:"ghost",size:"sm",onClick:()=>S(u.id),className:"h-6 w-6 p-0",children:(0,St.jsx)(Jo.X,{className:"h-4 w-4"})})]},u.id))})}),(0,St.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,St.jsxs)("div",{className:"flex gap-3",children:[(0,St.jsx)(yt,{value:t,onChange:u=>d(u.target.value),onKeyPress:f,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,St.jsx)(A,{variant:"outline",size:"icon",onClick:()=>F.current?.click(),className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,St.jsx)(Jo.Paperclip,{className:"h-4 w-4"})}),(0,St.jsx)(A,{onClick:C,disabled:!t.trim()&&n.length===0||o,size:"icon",className:"rounded-2xl h-10 w-10 shadow-sm",children:(0,St.jsx)(Jo.Send,{className:"h-4 w-4"})})]}),(0,St.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,St.jsxs)(A,{onClick:()=>z(!N),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,St.jsx)(Jo.Menu,{className:"h-3 w-3 mr-1"}),N?"Hide":"Show"," Capabilities"]}),(0,St.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ae().map((u,j)=>(0,St.jsx)(A,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>K(u.id,te),children:u.label},`context-${u.id}`)),ae().length===0&&ee().map((u,j)=>(0,St.jsx)(A,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${j}`))]})]}),s&&(0,St.jsx)("input",{ref:F,type:"file",multiple:!0,onChange:me,className:"hidden"})]})]})}function kr({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:r=[],capabilities:n=[],sidebarItems:l=[],notifications:s=[],sessions:d=[],onNewChat:m,onSessionSelect:C,onSessionDelete:f,onSessionEdit:h=()=>{},onBusinessUnitChange:S=()=>{},onNotificationRemove:I=()=>{},onRemoveAll:R=()=>{},onActionClick:x=()=>{},onSearch:T=E=>console.log("Search query:",E),initialTeam:F="design",currentSession:N=null,showCapabilities:z=!0,title:te="Digital Colleagues",enableFileUpload:oe=!0,maxFileSize:ae=10,allowedFileTypes:ee=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:K="/headerlogo.png",appName:ne="Nuvia",tagline:me="AI-Powered Workspace",actionIcon:M=(0,St.jsx)(Jo.Users,{className:"mr-2 h-4 w-4"}),actionText:Le="Collaborate",sidebarInitiallyClosed:p=!1}){let E={...e,onError:O=>{J?.setMessages(fe=>[...fe,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:O.message}]}]),console.error("Error in CopilotInterface:",O)}},B=(0,Ka.useChat)(E||{}),J=o?t||B:null,[u,j]=(0,st.useState)(""),[X,w]=(0,st.useState)(!1),_=J?.messages||a,P=u,Re=J?.status==="submitted"||X,ge=J?.addToolResult?(O,fe,se)=>{J.addToolResult({tool:fe,toolCallId:O,output:se}),J.sendMessage()}:()=>{},Ee=r||[],Ja={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[Xa,Qa]=(0,st.useState)(()=>Ee.length===0?Ja:Ee.find(O=>O.id===F)||Ee[0]),[gt,Pt]=(0,st.useState)([]),[Ya,Za]=(0,st.useState)(!1),ei=O=>{if(!O||!oe)return;let fe=[];Array.from(O).forEach(se=>{if(se.size>ae*1024*1024){alert(`File ${se.name} is too large. Maximum size is ${ae}MB.`);return}if(ee.length>0&&!ee.some(Tt=>se.type.match(Tt))){alert(`File type ${se.type} is not allowed.`);return}let Eo={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:se,status:"pending",progress:0};if(se.type.startsWith("image/")){let Tt=new FileReader;Tt.onload=ri=>{Pt(ni=>ni.map(Zt=>Zt.id===Eo.id?{...Zt,preview:ri.target?.result}:Zt))},Tt.readAsDataURL(se)}fe.push(Eo)}),Pt(se=>[...se,...fe])},ti=O=>{Pt(fe=>fe.filter(se=>se.id!==O))},Lo=()=>{if(!(!P.trim()&&gt.length===0)){if(J){let O=gt.length>0?oi(gt.map(fe=>fe.file)):void 0;J.sendMessage({text:P,files:O},{body:{timestamp:Date.now()}}),j("")}else console.log("Message to send:",P),console.log("Files to upload:",gt),j(""),w(!0),setTimeout(()=>{w(!1)},1500);Pt([])}},oi=O=>{let fe=new DataTransfer;return O.forEach(se=>fe.items.add(se)),fe.files},ai=O=>{O.key==="Enter"&&!O.shiftKey&&(O.preventDefault(),Lo())},ii=O=>{j(O)};return(0,St.jsx)(Sa,{sidebarItems:l||[],title:te,notifications:s||[],businessUnits:Ee,currentBusinessUnit:Xa,onBusinessUnitChange:O=>{O&&(Qa(O),S?.(O))},onSearch:T,showTabs:!1,onActionClick:x,actionIcon:M,actionText:Le,onNotificationRemove:I,onRemoveAll:R,logo:K,appName:ne,tagline:me,sidebarInitiallyClosed:p,children:(0,St.jsx)(Yt.AnimatePresence,{mode:"wait",children:(0,St.jsx)(Yt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,St.jsxs)("div",{className:"h-full flex",children:[(0,St.jsx)("div",{className:"w-80 flex-shrink-0 h-full p-2",children:(0,St.jsx)(Aa,{sessions:d||[],currentSession:N,teams:Ee,onNewChat:m,onSessionSelect:C,onSessionEdit:h,onSessionDelete:f})}),(0,St.jsx)("div",{className:"flex-1 h-full p-2",children:(0,St.jsx)(Qt,{messages:_||[],input:P,isTyping:Re,currentSessionTitle:N?.title,capabilities:n||[],onInputChange:ii,addToolResult:ge,onSendMessage:Lo,onKeyPress:ai,fileUploads:gt,isDragOver:Ya,enableFileUpload:oe,onFileUpload:ei,onRemoveFile:ti,onDragOver:Za})})]})},"chat-interface")})})}function Pr(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function Tr(e,t){return e.parts.some(o=>o.type===`tool-${t}`)}function Dr(e,t){return e.parts.find(o=>o.type===`tool-${t}`)}function Rr(e){return e.parts.some(t=>t.type==="file")}function Sr(e){return e.parts.filter(t=>t.type==="file")}function Ar(e,t){return e.parts.some(o=>o.type===`data-${t}`)}function Ir(e,t){return e.parts.find(o=>o.type===`data-${t}`)}0&&(module.exports={ApprovalRequestModal,CapabilityMenu,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,CopilotInterface,OAuthModal,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,testCapabilities});