cortex-react-components 2.13.5 → 2.13.7

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 (181) hide show
  1. package/dist/{chunk-NPGGDQ6F.mjs → chunk-2GM2LPLB.mjs} +1 -1
  2. package/dist/{chunk-B2TBKNIJ.mjs → chunk-2OOJ4ZFB.mjs} +1 -1
  3. package/dist/{chunk-FDRX3CL2.mjs → chunk-3E3GY7S2.mjs} +1 -1
  4. package/dist/{chunk-FX6IXEMQ.mjs → chunk-4SRUEQTP.mjs} +1 -1
  5. package/dist/{chunk-2AWS5Z43.mjs → chunk-4VCL66F7.mjs} +1 -1
  6. package/dist/{chunk-LHO4WFYP.mjs → chunk-5FWH5YVM.mjs} +1 -1
  7. package/dist/{chunk-2HWSTGAP.mjs → chunk-6FHRZHAJ.mjs} +1 -1
  8. package/dist/chunk-6R36YTGY.mjs +1 -0
  9. package/dist/{chunk-SPAOEUCG.mjs → chunk-7OMPPFGG.mjs} +1 -1
  10. package/dist/{chunk-MFCVMJBO.mjs → chunk-BDDEMCAH.mjs} +1 -1
  11. package/dist/{chunk-KY3ELFX5.mjs → chunk-BQQ4V4PX.mjs} +1 -1
  12. package/dist/chunk-DCOFQFVJ.mjs +1 -0
  13. package/dist/{chunk-QSXEJ2NO.mjs → chunk-DODFVGFK.mjs} +1 -1
  14. package/dist/{chunk-BY5TSHJ5.mjs → chunk-DPZHVBGG.mjs} +1 -1
  15. package/dist/chunk-DXRAJQMA.mjs +1 -0
  16. package/dist/{chunk-TO7SVJIU.mjs → chunk-EUGA4BNN.mjs} +1 -1
  17. package/dist/{chunk-QWFFSMKK.mjs → chunk-F64CA5CH.mjs} +1 -1
  18. package/dist/{chunk-K4MFTVNB.mjs → chunk-FEWOSBUJ.mjs} +1 -1
  19. package/dist/{chunk-FRXZ2OKW.mjs → chunk-FYQBRCQM.mjs} +1 -1
  20. package/dist/{chunk-57PJ7CHJ.mjs → chunk-GAZHKHGB.mjs} +1 -1
  21. package/dist/{chunk-VBSFVJM5.mjs → chunk-GETYSIZV.mjs} +1 -1
  22. package/dist/{chunk-S4ES6P3Y.mjs → chunk-HDKHF3EA.mjs} +1 -1
  23. package/dist/{chunk-N52FSTLG.mjs → chunk-HKMNAXLM.mjs} +1 -1
  24. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  25. package/dist/chunk-IKZZNNKD.mjs +4 -0
  26. package/dist/{chunk-5NIEZE7A.mjs → chunk-KBEXWUKI.mjs} +1 -1
  27. package/dist/{chunk-ZXJFBN7L.mjs → chunk-KVLUT4U2.mjs} +1 -1
  28. package/dist/{chunk-WUA65ZZB.mjs → chunk-L3BLBPSR.mjs} +1 -1
  29. package/dist/{chunk-CLGBBNRB.mjs → chunk-LAQ3QAUW.mjs} +1 -1
  30. package/dist/{chunk-6NED7ZVK.mjs → chunk-LGBD6KGN.mjs} +1 -1
  31. package/dist/{chunk-X3I4Y44O.mjs → chunk-LITM3HU3.mjs} +1 -1
  32. package/dist/{chunk-AMVJPDM3.mjs → chunk-M527EJIX.mjs} +1 -1
  33. package/dist/{chunk-DMCFEJ2C.mjs → chunk-MAZGVZJN.mjs} +1 -1
  34. package/dist/{chunk-RUZVSK25.mjs → chunk-MO4HRQEL.mjs} +1 -1
  35. package/dist/{chunk-P7S6XFU4.mjs → chunk-MX3JKY3V.mjs} +1 -1
  36. package/dist/{chunk-AEFWTCCE.mjs → chunk-O24GFE6Q.mjs} +1 -1
  37. package/dist/{chunk-ZFUP5NVF.mjs → chunk-O5P35LEY.mjs} +1 -1
  38. package/dist/{chunk-Q7KKN6MH.mjs → chunk-P6OSMPUQ.mjs} +1 -1
  39. package/dist/{chunk-2VOOH4YJ.mjs → chunk-PNUBVBSR.mjs} +1 -1
  40. package/dist/{chunk-TUACRDU3.mjs → chunk-PTZT4QJW.mjs} +1 -1
  41. package/dist/chunk-QC2UWZWL.mjs +1 -0
  42. package/dist/{chunk-LQASBVUG.mjs → chunk-QQFIVSBW.mjs} +1 -1
  43. package/dist/{chunk-6DQ7FEQQ.mjs → chunk-R6AYIVIR.mjs} +1 -1
  44. package/dist/{chunk-MLMDTZHL.mjs → chunk-RVGPGXLB.mjs} +1 -1
  45. package/dist/{chunk-TXVA6XJT.mjs → chunk-SRUG246N.mjs} +1 -1
  46. package/dist/{chunk-75XBZHOC.mjs → chunk-U3FYDDE2.mjs} +1 -1
  47. package/dist/chunk-USGRM22Y.mjs +1 -0
  48. package/dist/{chunk-AQQCH7Z2.mjs → chunk-XX4GSGRP.mjs} +1 -1
  49. package/dist/{chunk-UEBQJNVT.mjs → chunk-ZGQC6O62.mjs} +1 -1
  50. package/dist/chunk-ZQG4SJ2M.mjs +4 -0
  51. package/dist/components/Blocks/Banner.mjs +1 -1
  52. package/dist/components/Blocks/CallToAction.mjs +1 -1
  53. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  54. package/dist/components/Blocks/Content.mjs +1 -1
  55. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  56. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  57. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  58. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  59. package/dist/components/Blocks/index.mjs +1 -1
  60. package/dist/components/CRM/CogeBoard.mjs +1 -1
  61. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  62. package/dist/components/CRM/index.mjs +1 -1
  63. package/dist/components/Cards/ContentCard.mjs +1 -1
  64. package/dist/components/Cards/FeatureCard.mjs +1 -1
  65. package/dist/components/Cards/index.mjs +1 -1
  66. package/dist/components/Chat/ChatInterface.mjs +1 -1
  67. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  68. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  69. package/dist/components/Chat/demo-tests.mjs +1 -1
  70. package/dist/components/Chat/demo.mjs +1 -1
  71. package/dist/components/Chat/example-usage.mjs +1 -1
  72. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  73. package/dist/components/Chat/index.mjs +1 -1
  74. package/dist/components/DeliveryLead/DeliveryLeadSubmissionWithList.mjs +1 -1
  75. package/dist/components/DeliveryLead/index.mjs +1 -1
  76. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  77. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  78. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
  79. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  80. package/dist/components/DigitalColleagues/Views/index.js +1 -1
  81. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  82. package/dist/components/DigitalColleagues/index.js +1 -1
  83. package/dist/components/DigitalColleagues/index.mjs +1 -1
  84. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  85. package/dist/components/Foundary/MainPage.mjs +1 -1
  86. package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
  87. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  88. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  89. package/dist/components/Foundary/Views/index.js +1 -1
  90. package/dist/components/Foundary/Views/index.mjs +1 -1
  91. package/dist/components/Foundary/index.js +1 -1
  92. package/dist/components/Foundary/index.mjs +1 -1
  93. package/dist/components/HeaderFooter/Header.mjs +1 -1
  94. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  95. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  96. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  97. package/dist/components/HeaderFooter/index.mjs +1 -1
  98. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  99. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  100. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  101. package/dist/components/Heros/PostHero/index.mjs +1 -1
  102. package/dist/components/Heros/RenderHero.mjs +1 -1
  103. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  104. package/dist/components/Heros/index.mjs +1 -1
  105. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  106. package/dist/components/Layouts/Print.mjs +1 -1
  107. package/dist/components/Layouts/SlideShow.mjs +1 -1
  108. package/dist/components/Layouts/index.mjs +1 -1
  109. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  110. package/dist/components/Menus/SidebarRight.mjs +1 -1
  111. package/dist/components/Menus/index.mjs +1 -1
  112. package/dist/components/Other/index.mjs +1 -1
  113. package/dist/components/Payload/RichText/index.mjs +1 -1
  114. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  115. package/dist/components/Payload/index.mjs +1 -1
  116. package/dist/components/Projects/AddEpicModal.js +1 -1
  117. package/dist/components/Projects/AddEpicModal.mjs +1 -1
  118. package/dist/components/Projects/AddFileModal.css +1 -0
  119. package/dist/components/Projects/AddFileModal.d.ts +8 -0
  120. package/dist/components/Projects/AddFileModal.js +4 -0
  121. package/dist/components/Projects/AddFileModal.mjs +1 -0
  122. package/dist/components/Projects/AddTaskModal.js +1 -1
  123. package/dist/components/Projects/AddTaskModal.mjs +1 -1
  124. package/dist/components/Projects/EpicsView.d.ts +1 -1
  125. package/dist/components/Projects/EpicsView.js +2 -1
  126. package/dist/components/Projects/EpicsView.mjs +1 -1
  127. package/dist/components/Projects/FileView.d.ts +2 -2
  128. package/dist/components/Projects/FileView.js +1 -1
  129. package/dist/components/Projects/FileView.mjs +1 -1
  130. package/dist/components/Projects/KanbanBoardView.js +1 -1
  131. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  132. package/dist/components/Projects/ProjectPage.js +1 -1
  133. package/dist/components/Projects/ProjectPage.mjs +1 -1
  134. package/dist/components/Projects/ProjectView.d.ts +1 -1
  135. package/dist/components/Projects/ProjectView.js +1 -1
  136. package/dist/components/Projects/ProjectView.mjs +1 -1
  137. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  138. package/dist/components/Projects/file-list.d.ts +1 -1
  139. package/dist/components/Projects/index.js +1 -1
  140. package/dist/components/Projects/index.mjs +1 -1
  141. package/dist/components/dc-temp/index.js +1 -1
  142. package/dist/components/dc-temp/index.mjs +1 -1
  143. package/dist/components/dc-temp/mock-data.d.ts +2 -1
  144. package/dist/components/dc-temp/mock-data.js +1 -1
  145. package/dist/components/dc-temp/mock-data.mjs +1 -1
  146. package/dist/components/index.js +11 -11
  147. package/dist/components/index.mjs +1 -1
  148. package/dist/components/ui/index.mjs +1 -1
  149. package/dist/components/ui/sidebar.mjs +1 -1
  150. package/dist/globals.css +1 -1
  151. package/dist/index.js +16 -16
  152. package/dist/index.mjs +1 -1
  153. package/dist/metafile-cjs.json +1 -1
  154. package/dist/metafile-esm.json +1 -1
  155. package/dist/pages/Blog.mjs +1 -1
  156. package/dist/pages/Documentation.mjs +1 -1
  157. package/dist/pages/IndexPage.mjs +1 -1
  158. package/dist/pages/Intranet.mjs +1 -1
  159. package/dist/pages/LandingPage.mjs +1 -1
  160. package/dist/pages/Page.mjs +1 -1
  161. package/dist/pages/Publish.mjs +1 -1
  162. package/dist/pages/Website.mjs +1 -1
  163. package/dist/sections/AboutSection.mjs +1 -1
  164. package/dist/sections/BlogDetail.mjs +1 -1
  165. package/dist/sections/BlogList.mjs +1 -1
  166. package/dist/sections/BlogListSection.mjs +1 -1
  167. package/dist/sections/ContactSection.mjs +1 -1
  168. package/dist/sections/PageSections.mjs +1 -1
  169. package/dist/sections/PricingSection.mjs +1 -1
  170. package/dist/sections/ServiceDetail.mjs +1 -1
  171. package/dist/sections/ServiceDetailSection.mjs +1 -1
  172. package/dist/sections/ServiceSection.mjs +1 -1
  173. package/dist/sections/form/index.mjs +1 -1
  174. package/dist/sections/index.mjs +1 -1
  175. package/package.json +1 -1
  176. package/dist/chunk-7YVVWDS2.mjs +0 -4
  177. package/dist/chunk-E6Y5COQK.mjs +0 -1
  178. package/dist/chunk-ENRNRNPQ.mjs +0 -1
  179. package/dist/chunk-QBUU2AQL.mjs +0 -4
  180. package/dist/chunk-TOI73VEE.mjs +0 -1
  181. package/dist/chunk-WSQHAE6Q.mjs +0 -1
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";var ps=Object.create;var ro=Object.defineProperty;var us=Object.getOwnPropertyDescriptor;var gs=Object.getOwnPropertyNames;var fs=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var hs=(e,t)=>{for(var a in t)ro(e,a,{get:t[a],enumerable:!0})},fr=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of gs(t))!vs.call(e,s)&&s!==a&&ro(e,s,{get:()=>t[s],enumerable:!(o=us(t,s))||o.enumerable});return e};var we=(e,t,a)=>(a=e!=null?ps(fs(e)):{},fr(t||!e||!e.__esModule?ro(a,"default",{value:e,enumerable:!0}):a,e)),bs=e=>fr(ro({},"__esModule",{value:!0}),e);var Cn={};hs(Cn,{ColleaguesView:()=>Uo,FileView:()=>_a,KnowledgeView:()=>Ko,PlanningView:()=>To,ProjectView:()=>ar,ProjectsIndexView:()=>lr,TeamsIndexView:()=>cr});module.exports=bs(Cn);var Lt=require("react"),yt=require("lucide-react");var Dr=require("clsx");var Lo="-",xs=e=>{let t=ws(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{let i=c.split(Lo);return i[0]===""&&i.length!==1&&i.shift(),br(i,t)||ys(c)},getConflictingClassGroupIds:(c,i)=>{let l=a[c]||[];return i&&o[c]?[...l,...o[c]]:l}}},br=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),s=o?br(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;let r=e.join(Lo);return t.validators.find(({validator:c})=>c(r))?.classGroupId},vr=/^\[(.+)\]$/,ys=e=>{if(vr.test(e)){let t=vr.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},ws=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Cs(Object.entries(e.classGroups),a).forEach(([r,c])=>{Bo(c,o,r,t)}),o},Bo=(e,t,a,o)=>{e.forEach(s=>{if(typeof s=="string"){let r=s===""?t:hr(t,s);r.classGroupId=a;return}if(typeof s=="function"){if(Ns(s)){Bo(s(o),t,a,o);return}t.validators.push({validator:s,classGroupId:a});return}Object.entries(s).forEach(([r,c])=>{Bo(c,hr(t,r),a,o)})})},hr=(e,t)=>{let a=e;return t.split(Lo).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Ns=e=>e.isThemeGetter,Cs=(e,t)=>t?e.map(([a,o])=>{let s=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([c,i])=>[t+c,i])):r);return[a,s]}):e,Ds=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,s=(r,c)=>{a.set(r,c),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let c=a.get(r);if(c!==void 0)return c;if((c=o.get(r))!==void 0)return s(r,c),c},set(r,c){a.has(r)?a.set(r,c):s(r,c)}}},xr="!",ks=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,s=t[0],r=t.length,c=i=>{let l=[],d=0,n=0,m;for(let u=0;u<i.length;u++){let h=i[u];if(d===0){if(h===s&&(o||i.slice(u,u+r)===t)){l.push(i.slice(n,u)),n=u+r;continue}if(h==="/"){m=u;continue}}h==="["?d++:h==="]"&&d--}let f=l.length===0?i:i.substring(n),v=f.startsWith(xr),w=v?f.substring(1):f,b=m&&m>n?m-n:void 0;return{modifiers:l,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:b}};return a?i=>a({className:i,parseClassName:c}):c},Ss=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},Ts=e=>({cache:Ds(e.cacheSize),parseClassName:ks(e),...xs(e)}),Ps=/\s+/,Rs=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:s}=t,r=[],c=e.trim().split(Ps),i="";for(let l=c.length-1;l>=0;l-=1){let d=c[l],{modifiers:n,hasImportantModifier:m,baseClassName:f,maybePostfixModifierPosition:v}=a(d),w=!!v,b=o(w?f.substring(0,v):f);if(!b){if(!w){i=d+(i.length>0?" "+i:i);continue}if(b=o(f),!b){i=d+(i.length>0?" "+i:i);continue}w=!1}let u=Ss(n).join(":"),h=m?u+xr:u,E=h+b;if(r.includes(E))continue;r.push(E);let _=s(b,w);for(let G=0;G<_.length;++G){let k=_[G];r.push(h+k)}i=d+(i.length>0?" "+i:i)}return i};function As(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=yr(t))&&(o&&(o+=" "),o+=a);return o}var yr=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=yr(e[o]))&&(a&&(a+=" "),a+=t);return a};function Es(e,...t){let a,o,s,r=c;function c(l){let d=t.reduce((n,m)=>m(n),e());return a=Ts(d),o=a.cache.get,s=a.cache.set,r=i,i(l)}function i(l){let d=o(l);if(d)return d;let n=Rs(l,a);return s(l,n),n}return function(){return r(As.apply(null,arguments))}}var Ae=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},wr=/^\[(?:([a-z-]+):)?(.+)\]$/i,Is=/^\d+\/\d+$/,Ms=new Set(["px","full","screen"]),Fs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bs=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ls=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,js=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Os=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ut=e=>Da(e)||Ms.has(e)||Is.test(e),Qt=e=>ka(e,"length",Ws),Da=e=>!!e&&!Number.isNaN(Number(e)),Fo=e=>ka(e,"number",Da),ja=e=>!!e&&Number.isInteger(Number(e)),Hs=e=>e.endsWith("%")&&Da(e.slice(0,-1)),oe=e=>wr.test(e),ea=e=>Fs.test(e),zs=new Set(["length","size","percentage"]),Vs=e=>ka(e,zs,Nr),Us=e=>ka(e,"position",Nr),Ks=new Set(["image","url"]),$s=e=>ka(e,Ks,qs),Gs=e=>ka(e,"",_s),Oa=()=>!0,ka=(e,t,a)=>{let o=wr.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Ws=e=>Bs.test(e)&&!Ls.test(e),Nr=()=>!1,_s=e=>js.test(e),qs=e=>Os.test(e);var Xs=()=>{let e=Ae("colors"),t=Ae("spacing"),a=Ae("blur"),o=Ae("brightness"),s=Ae("borderColor"),r=Ae("borderRadius"),c=Ae("borderSpacing"),i=Ae("borderWidth"),l=Ae("contrast"),d=Ae("grayscale"),n=Ae("hueRotate"),m=Ae("invert"),f=Ae("gap"),v=Ae("gradientColorStops"),w=Ae("gradientColorStopPositions"),b=Ae("inset"),u=Ae("margin"),h=Ae("opacity"),E=Ae("padding"),_=Ae("saturate"),G=Ae("scale"),k=Ae("sepia"),q=Ae("skew"),ve=Ae("space"),S=Ae("translate"),ie=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",oe,t],U=()=>[oe,t],F=()=>["",Ut,Qt],te=()=>["auto",Da,oe],Le=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ke=()=>["solid","dashed","dotted","double","none"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],bt=()=>["start","end","center","between","around","evenly","stretch"],Mt=()=>["","0",oe],Nt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],je=()=>[Da,oe];return{cacheSize:500,separator:":",theme:{colors:[Oa],spacing:[Ut,Qt],blur:["none","",ea,oe],brightness:je(),borderColor:[e],borderRadius:["none","","full",ea,oe],borderSpacing:U(),borderWidth:F(),contrast:je(),grayscale:Mt(),hueRotate:je(),invert:Mt(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[Hs,Qt],inset:de(),margin:de(),opacity:je(),padding:U(),saturate:je(),scale:je(),sepia:Mt(),skew:je(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[ea]}],"break-after":[{"break-after":Nt()}],"break-before":[{"break-before":Nt()}],"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:[...Le(),oe]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:ie()}],"overscroll-x":[{"overscroll-x":ie()}],"overscroll-y":[{"overscroll-y":ie()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ja,oe]}],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",oe]}],grow:[{grow:Mt()}],shrink:[{shrink:Mt()}],order:[{order:["first","last","none",ja,oe]}],"grid-cols":[{"grid-cols":[Oa]}],"col-start-end":[{col:["auto",{span:["full",ja,oe]},oe]}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":[Oa]}],"row-start-end":[{row:["auto",{span:[ja,oe]},oe]}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...bt()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...bt(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...bt(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Pr:[{Pr:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],Pr:[{Pr:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[ve]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ve]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[ea]},ea]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ea,Qt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fo]}],"font-family":[{font:[Oa]}],"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",oe]}],"line-clamp":[{"line-clamp":["none",Da,Fo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ut,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ut,Qt]}],"underline-offset":[{"underline-offset":["auto",Ut,oe]}],"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:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],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",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Le(),Us]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vs]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$s]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-Pr":[{"rounded-Pr":[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-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...ke(),"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":[h]}],"divide-style":[{divide:ke()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...ke()]}],"outline-offset":[{"outline-offset":[Ut,oe]}],"outline-w":[{outline:[Ut,Qt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Ut,Qt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ea,Gs]}],"shadow-color":[{shadow:[Oa]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ce()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ea,oe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[n]}],invert:[{invert:[m]}],saturate:[{saturate:[_]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[n]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:je()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:je()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[ja,oe]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[q]}],"skew-y":[{"skew-y":[q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],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","Pr-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-Pr":[{"scroll-Pr":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-Pr":[{"scroll-Pr":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ut,Qt,Fo]}],stroke:[{stroke:[e,"none"]}],Lt:["Lt-only","not-Lt-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"],Pr:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","Pr","mr","mb","ml"],mx:["mr","ml"],my:["Pr","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-b","rounded-l","rounded-ss","rounded-se","rounded-Pr","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-Pr"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-Pr","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-Pr","scroll-mb"],"scroll-Pr":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Cr=Es(Xs);function C(...e){return Cr((0,Dr.clsx)(e))}var kr=require("@radix-yt/react-slot"),Sr=require("class-variance-authority"),Tr=we(require("react")),Pr=require("react/jsx-runtime"),io=(0,Sr.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"}}}),x=Tr.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...s},r)=>(0,Pr.jsx)(e?kr.Slot:"button",{className:C(io({className:t,size:a,variant:o})),ref:r,...s}));x.displayName="Button";var da=we(require("react"));var B=da.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)("div",{ref:a,className:C("rounded-xl border bg-card text-card-foreground shadow",e),...t}));B.displayName="Card";var Ee=da.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)("div",{ref:a,className:C("flex flex-col space-y-1.5 Pr-6",e),...t}));Ee.displayName="CardHeader";var Fe=da.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)("div",{ref:a,className:C("font-semibold leading-none tracking-tight",e),...t}));Fe.displayName="CardTitle";var Ha=da.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)("div",{ref:a,className:C("text-sm text-muted-foreground",e),...t}));Ha.displayName="CardDescription";var se=da.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)("div",{ref:a,className:C("Pr-6 pt-0",e),...t}));se.displayName="CardContent";var za=da.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)("div",{ref:a,className:C("flex items-center Pr-6 pt-0",e),...t}));za.displayName="CardFooter";var Rr=we(require("react"));var $=Rr.forwardRef(({className:e,type:t,...a},o)=>(0,Pr.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}));$.displayName="Input";var ce=we(require("@radix-yt/react-select")),ta=we(require("react")),Ke=ce.Root;var nt=ce.Value,He=ta.forwardRef(({children:e,className:t,...a},o)=>(0,Pr.jsxs)(ce.Trigger,{className:C("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,Pr.jsx)(ce.Icon,{asChild:!0,children:(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));He.displayName=ce.Trigger.displayName;var Er=ta.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(ce.ScrollUpButton,{className:C("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Pr.jsx)(yt.ChevronUp,{className:"h-4 w-4"})}));Er.displayName=ce.ScrollUpButton.displayName;var Ir=ta.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(ce.ScrollDownButton,{className:C("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4"})}));Ir.displayName=ce.ScrollDownButton.displayName;var ze=ta.forwardRef(({children:e,className:t,position:a="popper",...o},s)=>(0,Pr.jsx)(ce.Portal,{children:(0,Pr.jsxs)(ce.Content,{className:C("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card 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",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:s,...o,children:[(0,Pr.jsx)(Er,{}),(0,Pr.jsx)(ce.Viewport,{className:C("Pr-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Pr.jsx)(Ir,{})]})}));ze.displayName=ce.Content.displayName;var Js=ta.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(ce.Label,{className:C("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));Js.displayName=ce.Label.displayName;var pe=ta.forwardRef(({children:e,className:t,...a},o)=>(0,Pr.jsxs)(ce.Item,{className:C("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(ce.ItemIndicator,{children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})})}),(0,Pr.jsx)(ce.ItemText,{children:e})]}));pe.displayName=ce.Item.displayName;var Zs=ta.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(ce.Separator,{className:C("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Zs.displayName=ce.Separator.displayName;var jo=require("motion/react");var pa=we(require("@radix-yt/react-tabs"));function Mr({className:e,...t}){return(0,Pr.jsx)(pa.Root,{"data-slot":"tabs",className:C("flex flex-col gap-2",e),...t})}function Fr({className:e,...t}){return(0,Pr.jsx)(pa.List,{"data-slot":"tabs-list",className:C("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg Pr-[3px]",e),...t})}function Br({className:e,...t}){return(0,Pr.jsx)(pa.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 Kt=we(require("react")),me=we(require("@radix-yt/react-dropdown-menu")),Sa=require("@radix-yt/react-icons");var no=me.Root,lo=me.Trigger;var Ys=Kt.forwardRef(({className:e,inset:t,children:a,...o},s)=>(0,Pr.jsxs)(me.SubTrigger,{ref:s,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,Pr.jsx)(Sa.ChevronRightIcon,{className:"ml-auto"})]}));Ys.displayName=me.SubTrigger.displayName;var Qs=Kt.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(me.SubContent,{ref:a,className:C("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Pr-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}));Qs.displayName=me.SubContent.displayName;var Va=Kt.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Pr.jsx)(me.Portal,{children:(0,Pr.jsx)(me.Content,{ref:o,sideOffset:t,className:C("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Pr-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})}));Va.displayName=me.Content.displayName;var ua=Kt.forwardRef(({className:e,inset:t,...a},o)=>(0,Pr.jsx)(me.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}));ua.displayName=me.Item.displayName;var en=Kt.forwardRef(({className:e,children:t,checked:a,...o},s)=>(0,Pr.jsxs)(me.CheckboxItem,{ref:s,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,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(me.ItemIndicator,{children:(0,Pr.jsx)(Sa.CheckIcon,{className:"h-4 w-4"})})}),t]}));en.displayName=me.CheckboxItem.displayName;var tn=Kt.forwardRef(({className:e,children:t,...a},o)=>(0,Pr.jsxs)(me.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,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(me.ItemIndicator,{children:(0,Pr.jsx)(Sa.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));tn.displayName=me.RadioItem.displayName;var an=Kt.forwardRef(({className:e,inset:t,...a},o)=>(0,Pr.jsx)(me.Label,{ref:o,className:C("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));an.displayName=me.Label.displayName;var on=Kt.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(me.Separator,{ref:a,className:C("-mx-1 my-1 h-px bg-muted",e),...t}));on.displayName=me.Separator.displayName;var rn=({className:e,...t})=>(0,Pr.jsx)("span",{className:C("ml-auto text-xs tracking-widest opacity-60",e),...t});rn.displayName="DropdownMenuShortcut";function co({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:s="700px",gridCols:r=6}){let c=a.find(i=>i.value===e);return(0,Pr.jsxs)(jo.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,Pr.jsx)("div",{className:"hidden lg:block",children:(0,Pr.jsx)(Mr,{value:e,onValueChange:t,children:(0,Pr.jsx)(Fr,{className:"grid w-full rounded-2xl Pr-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,Pr.jsx)(jo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Pr.jsx)(Br,{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,Pr.jsx)("div",{className:"lg:hidden",children:(0,Pr.jsxs)(no,{children:[(0,Pr.jsx)(lo,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Pr.jsx)(Va,{align:"center",className:"w-[180px]",children:a.map(i=>(0,Pr.jsx)(ua,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}var mo=we(require("react")),$t=we(require("@radix-yt/react-avatar"));var Gt=mo.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)($t.Root,{ref:a,className:C("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Gt.displayName=$t.Root.displayName;var Ua=mo.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)($t.Image,{ref:a,className:C("aspect-square h-full w-full",e),...t}));Ua.displayName=$t.Image.displayName;var Wt=mo.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)($t.Fallback,{ref:a,className:C("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Wt.displayName=$t.Fallback.displayName;var sn=(0,Sr.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 X({className:e,variant:t,...a}){return(0,Pr.jsx)("div",{className:C(sn({variant:t}),e),...a})}function uo({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:s=!0,compact:r=!1,className:c}){let[i,l]=(0,Lt.useState)(!1),d=f=>{switch(f){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},n=f=>{switch(f){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},m=f=>{if(!f)return"Never";let w=Math.floor((new Date().getTime()-f.getTime())/(1e3*60));return w<1?"Just now":w<60?`${w}m ago`:w<1440?`${Math.floor(w/60)}h ago`:`${Math.floor(w/1440)}d ago`};return(0,Pr.jsxs)(B,{className:C("hover:shadow-md transition-shadow",r&&"Pr-2",c),children:[(0,Pr.jsx)(Ee,{className:C("pb-3",r&&"pb-2"),children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)("div",{className:"relative",children:(0,Pr.jsxs)(Gt,{className:C("h-12 w-12",r&&"h-8 w-8"),children:[(0,Pr.jsx)(Ua,{src:"/placeholder.svg",alt:e.name}),(0,Pr.jsx)(Wt,{children:e.name.split(" ").map(f=>f[0]).join("")})]})}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("h3",{className:C("font-semibold text-sm truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,Pr.jsx)(yt.Bot,{className:C("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Pr.jsx)(yt.User,{className:C("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Pr.jsx)("Pr",{className:C("text-sm text-muted-foreground truncate",r&&"text-xs"),children:e.type==="human"?e.role:e.description}),!r&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 Pr-1",children:[e.type==="human"&&(0,Pr.jsx)(X,{variant:"secondary",className:"text-xs",children:e.department}),e.type==="digital"&&(0,Pr.jsxs)(X,{variant:"secondary",className:"text-xs",children:["v",e.version]}),(0,Pr.jsx)(X,{variant:"outline",className:"text-xs",children:n(e.status)})]})]})]}),s&&(0,Pr.jsxs)(no,{children:[(0,Pr.jsx)(lo,{asChild:!0,children:(0,Pr.jsx)(x,{variant:"ghost",size:"icon",className:C("h-8 w-8",r&&"h-6 w-6"),children:(0,Pr.jsx)(yt.MoreHorizontal,{className:C("h-4 w-4",r&&"h-3 w-3")})})}),(0,Pr.jsxs)(Va,{align:"end",children:[e.type==="digital"&&(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsxs)(ua,{onClick:()=>o?.(e),children:[(0,Pr.jsx)(yt.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,Pr.jsxs)(ua,{onClick:()=>t?.(e),children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,Pr.jsxs)(ua,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,Pr.jsxs)(se,{className:"pt-0",children:[(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Mail,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Pr.jsxs)(Pr.Fragment,{children:[e.phone&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Phone,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:e.phone})]}),e.location&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.MapPin,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Settings,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["v",e.version]})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Clock,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["Last active: ",m(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Pr.jsx)("div",{className:"Pr-3",children:(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,i?e.skills.length:3).map(f=>(0,Pr.jsx)(X,{variant:"outline",className:"text-xs",children:f},f)),e.skills.length>3&&(0,Pr.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>l(!i),children:i?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Pr.jsx)("div",{className:"Pr-3",children:(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,i?e.capabilities.length:2).map(f=>(0,Pr.jsx)(X,{variant:"outline",className:"text-xs",children:f},f)),e.capabilities.length>2&&(0,Pr.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>l(!i),children:i?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var zr=we(require("react")),Oo=we(require("@radix-yt/react-label"));var nn=(0,Sr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),T=zr.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(Oo.Root,{ref:a,className:C(nn(),e),...t}));T.displayName=Oo.Root.displayName;var Kr=we(require("react")),be=Kr.forwardRef(({className:e,...t},a)=>(0,$r.jsx)("textarea",{className:C("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));be.displayName="Textarea";var Ho=we(require("react")),kt=we(require("@radix-yt/react-scroll-area"));var Ka=Ho.forwardRef(({className:e,children:t,...a},o)=>(0,Pr.jsxs)(kt.Root,{ref:o,className:C("relative overflow-hidden",e),...a,children:[(0,Pr.jsx)(kt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Pr.jsx)(Gr,{}),(0,Pr.jsx)(kt.Corner,{})]}));Ka.displayName=kt.Root.displayName;var Gr=Ho.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Pr.jsx)(kt.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 Pr-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent Pr-[1px]",e),...a,children:(0,Pr.jsx)(kt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Gr.displayName=kt.ScrollAreaScrollbar.displayName;function zo({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:s="Search knowledge documents...",maxSelections:r,disabled:c=!1}){let[i,l]=(0,Lt.useState)(""),[d,n]=(0,Lt.useState)([]),[m,f]=(0,Lt.useState)(!1);(0,Lt.useEffect)(()=>{if(!i.trim()){n([]),f(!1);return}let u=a.filter(h=>{if(e.map(G=>G.id).includes(h.id))return!1;let _=i.toLowerCase();return h.title.toLowerCase().includes(_)||h.description?.toLowerCase().includes(_)||h.tags?.some(G=>G.toLowerCase().includes(_))||Object.values(h.metadata||{}).some(G=>String(G).toLowerCase().includes(_))});n(u),f(!0)},[i,e,a]);let v=u=>{r&&e.length>=r||(t([...e,u]),l(""),f(!1))},w=u=>{t(e.filter(h=>h.id!==u))},b=!r||e.length<r;return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:o}),(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)($,{value:i,onChange:u=>l(u.target.value),placeholder:b?s:`Maximum ${r} documents selected`,className:"pl-9",disabled:c||!b,onFocus:()=>i&&f(!0)})]}),m&&d.length>0&&(0,Pr.jsx)(B,{className:"absolute top-full left-0 right-0 z-10 Pr-1 max-h-60",children:(0,Pr.jsx)(Ka,{className:"h-full",children:(0,Pr.jsx)(se,{className:"Pr-2",children:d.map(u=>(0,Pr.jsx)(x,{variant:"ghost",className:"w-full justify-start h-auto Pr-3 mb-1",onClick:()=>v(u),disabled:c,children:(0,Pr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Pr.jsx)(yt.FileText,{className:"h-4 w-4 Pr-0.5 text-muted-foreground flex-shrink-0"}),(0,Pr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"font-medium text-sm truncate",children:u.title}),u.description&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground Pr-1 line-clamp-2",children:u.description}),u.tags&&u.tags.length>0&&(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1 Pr-2",children:[u.tags.slice(0,3).map(h=>(0,Pr.jsx)(X,{variant:"outline",className:"text-xs",children:h},h)),u.tags.length>3&&(0,Pr.jsxs)(X,{variant:"outline",className:"text-xs",children:["+",u.tags.length-3," more"]})]})]})]})},u.id))})})}),m&&i&&d.length===0&&(0,Pr.jsx)(B,{className:"absolute top-full left-0 right-0 z-10 Pr-1",children:(0,Pr.jsxs)(se,{className:"Pr-4 text-center text-sm text-muted-foreground",children:['yt knowledge documents found for "',i,'"']})})]}),e.length>0&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,Pr.jsx)("div",{className:"space-y-2",children:e.map(u=>(0,Pr.jsx)(B,{className:"Pr-3",children:(0,Pr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Pr.jsx)(yt.FileText,{className:"h-4 w-4 Pr-0.5 text-muted-foreground flex-shrink-0"}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"font-medium text-sm",children:u.title}),u.description&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground Pr-1",children:u.description}),u.tags&&u.tags.length>0&&(0,Pr.jsx)("div",{className:"flex flex-wrap gap-1 Pr-2",children:u.tags.map(h=>(0,Pr.jsxs)(X,{variant:"outline",className:"text-xs",children:[(0,Pr.jsx)(yt.Tag,{className:"h-3 w-3 mr-1"}),h]},h))})]}),(0,Pr.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>w(u.id),disabled:c,children:(0,Pr.jsx)(yt.X,{className:"h-3 w-3"})})]})},u.id))})]}),m&&(0,Pr.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>f(!1)})]})}function Vo({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:s,submitLabel:r,cancelLabel:c="Cancel",readOnly:i=!1,availableKnowledgeDocuments:l=[]}){let[d,n]=(0,Lt.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[m,f]=(0,Lt.useState)(""),[v,w]=(0,Lt.useState)(""),[b,u]=(0,Lt.useState)(!i);(0,Lt.useEffect)(()=>{e&&n(e)},[e]);let h=S=>{S.preventDefault();let ie=d.version?parseInt(d.version):0,R=e?(ie+1).toString():"1",de={id:d.id||Date.now().toString(),name:d.name,type:"digital",status:"active",joinedDate:d.joinedDate||new Date,lastActive:d.lastActive||new Date,description:d.description,jobDescription:d.jobDescription||"",workInstructions:d.workInstructions||"",capabilities:d.capabilities||[],knowledge:d.knowledge||[],coreKnowledge:d.coreKnowledge||[],version:R,lastUpdated:d.lastUpdated||new Date,isActive:!0};t(de)},E=(S,ie,R)=>{if(!ie.trim())return;let de=d[S]||[];n({...d,[S]:[...de,ie.trim()]}),R("")},_=(S,ie)=>{let R=d[S]||[];n({...d,[S]:R.filter((de,U)=>U!==ie)})},G=S=>{S.preventDefault(),u(!b)},k=(S,ie,R,de,U)=>{let F=d[S]||[];return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:ie}),b&&(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsx)($,{value:R,onChange:te=>de(te.target.value),placeholder:U,onKeyPress:te=>{te.key==="Enter"&&(te.preventDefault(),E(S,R,de))},disabled:o}),(0,Pr.jsx)(x,{type:"button",variant:"outline",size:"icon",onClick:()=>E(S,R,de),disabled:o,children:(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"})})]}),(0,Pr.jsx)("div",{className:"flex flex-wrap gap-2",children:F.map((te,Le)=>(0,Pr.jsxs)(X,{className:"gap-1",children:[te,b&&(0,Pr.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 Pr-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>_(S,Le),disabled:o,children:(0,Pr.jsx)(yt.X,{className:"h-3 w-3"})})]},`${S}-${Le}-${te}`))})]})},q=s||(b?e?"Edit Colleague":"Add New Colleague":"View Colleague"),ve=r||(e?"Update Colleague":"Add Colleague");return(0,Pr.jsxs)(B,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Pr.jsx)(Ee,{children:(0,Pr.jsxs)(Fe,{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Bot,{className:"h-5 w-5"}),q]})}),(0,Pr.jsx)(se,{children:(0,Pr.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"name",children:"Name *"}),(0,Pr.jsx)($,{id:"name",value:d.name||"",onChange:S=>n({...d,name:S.target.value}),required:!0,disabled:o||!b})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(be,{id:"description",value:d.description||"",onChange:S=>n({...d,description:S.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!b})]})]}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Pr.jsx)(be,{id:"jobDescription",value:d.jobDescription||"",onChange:S=>n({...d,jobDescription:S.target.value}),rows:4,required:d.type==="digital",disabled:o||!b})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Pr.jsx)(be,{id:"workInstructions",value:d.workInstructions||"",onChange:S=>n({...d,workInstructions:S.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!b})]}),k("capabilities","Capabilities",v,w,"Add capability"),(0,Pr.jsx)(zo,{selectedDocuments:d.knowledge||[],onDocumentsChange:S=>n({...d,knowledge:S}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:o||!b,availableDocuments:l}),(0,Pr.jsx)(zo,{selectedDocuments:d.coreKnowledge||[],onDocumentsChange:S=>n({...d,coreKnowledge:S}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!b,availableDocuments:l})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:a,disabled:o,children:b?c:"Close"}),b?(0,Pr.jsx)(x,{type:"submit",disabled:o,children:o?"Saving...":ve}):(0,Pr.jsxs)(x,{type:"button",onClick:G,disabled:o,className:"gap-2",children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Wr({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[s,r]=(0,Lt.useState)(""),c=(0,Lt.useMemo)(()=>e.filter(l=>l.name.toLowerCase().includes(s.toLowerCase())||l.email.toLowerCase().includes(s.toLowerCase())||l.role.toLowerCase().includes(s.toLowerCase())||(l.skills||[]).some(n=>n.toLowerCase().includes(s.toLowerCase()))),[e,s]),i=l=>{t(l)};return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)($a.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)($a.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground",children:"Choose a user to add as a colleague"})]})]}),(0,Pr.jsx)(B,{className:"container",children:(0,Pr.jsx)(se,{className:"pt-6",children:(0,Pr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)($,{placeholder:"Search users by name, email, role, Pr skills...",value:s,onChange:l=>r(l.target.value),className:"pl-9"})]})})})})}),(0,Pr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(l=>(0,Pr.jsx)($a.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Pr.jsxs)(B,{className:`cursor-pointer transition-all hover:shadow-lg ${o===l.id?"ring-2 ring-primary":""}`,onClick:()=>i(l),children:[(0,Pr.jsx)(Ee,{className:"pb-3",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsxs)(Gt,{children:[(0,Pr.jsx)(Ua,{src:l.avatar,alt:l.name}),(0,Pr.jsx)(Wt,{children:(0,Pr.jsx)(yt.User,{className:"h-4 w-4"})})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(Fe,{className:"text-lg",children:l.name}),(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground",children:l.role})]})]}),o===l.id&&(0,Pr.jsx)(yt.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Pr.jsx)(se,{className:"pt-0",children:(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Pr.jsx)("Pr",{className:"text-sm font-medium",children:l.email})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground",children:"Department"}),(0,Pr.jsx)(X,{variant:"secondary",children:l.department})]}),l.location&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground",children:"Location"}),(0,Pr.jsx)("Pr",{className:"text-sm",children:l.location})]}),l.skills&&l.skills.length>0&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.skills.slice(0,3).map(d=>(0,Pr.jsx)(X,{variant:"outline",className:"text-xs",children:d},d)),l.skills.length>3&&(0,Pr.jsxs)(X,{variant:"outline",className:"text-xs",children:["+",l.skills.length-3]})]})]})]})})]})},l.id))}),c.length===0&&(0,Pr.jsx)(B,{className:"container Pr-4",children:(0,Pr.jsx)(se,{className:"pt-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"yt users found"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground",children:"Try adjusting your search terms Pr filters."})]})})})]},"user-selection")})})}function _r({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[s,r]=(0,Lt.useState)(""),[c,i]=(0,Lt.useState)("all"),l=(0,Lt.useMemo)(()=>e.filter(m=>{let f=m.name.toLowerCase().includes(s.toLowerCase())||m.jobDescription.toLowerCase().includes(s.toLowerCase())||m.capabilities.some(w=>w.toLowerCase().includes(s.toLowerCase()))||m.workInstructions.toLowerCase().includes(s.toLowerCase()),v=c==="all"||m.status===c;return f&&v}),[e,s,c]),d=m=>{let f={...m,id:`${m.id}-clone-${Date.now()}`,name:`${m.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(f)},n=m=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(m);return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(jo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,Pr.jsx)(B,{children:(0,Pr.jsx)(se,{className:"pt-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)($,{placeholder:"Search by name, job description, Pr capabilities...",value:s,onChange:m=>r(m.target.value),className:"pl-9"})]})}),(0,Pr.jsxs)("select",{value:c,onChange:m=>i(m.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Pr.jsx)("option",{value:"all",children:"All Status"}),(0,Pr.jsx)("option",{value:"active",children:"Active"}),(0,Pr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Pr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(m=>(0,Pr.jsx)(jo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Pr.jsxs)(B,{className:`cursor-pointer transition-all hover:shadow-lg ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>d(m),children:[(0,Pr.jsx)(Ee,{className:"pb-3",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)(Gt,{children:(0,Pr.jsx)(Wt,{className:"bg-blue-100",children:(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsxs)(Fe,{className:"text-lg flex items-center gap-2",children:[m.name,(0,Pr.jsx)(X,{variant:m.status==="active"?"default":"secondary",className:"text-xs",children:m.status})]}),(0,Pr.jsxs)("Pr",{className:"text-sm text-muted-foreground",children:["v",m.version]})]})]}),(0,Pr.jsxs)(x,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:f=>{f.stopPropagation(),d(m)},children:[(0,Pr.jsx)(yt.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Pr.jsx)(se,{className:"pt-0",children:(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Pr.jsx)("Pr",{className:"text-sm line-clamp-2",children:m.jobDescription})]}),m.capabilities&&m.capabilities.length>0&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[m.capabilities.slice(0,3).map(f=>(0,Pr.jsx)(X,{variant:"outline",className:"text-xs",children:f},f)),m.capabilities.length>3&&(0,Pr.jsxs)(X,{variant:"outline",className:"text-xs",children:["+",m.capabilities.length-3]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["Updated ",n(m.lastUpdated)]})]}),m.knowledge&&(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.Users,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:[m.knowledge.length," docs"]})]})]}),m.workInstructions&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Pr.jsx)("Pr",{className:"text-xs line-clamp-2",children:m.workInstructions})]})]})})]})},m.id))}),l.length===0&&(0,Pr.jsx)(B,{children:(0,Pr.jsx)(se,{className:"pt-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"yt digital colleagues found"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground",children:"Try adjusting your search terms Pr filters."})]})})})]},"colleague-clone")})})}function qr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(jo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,Pr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Pr.jsx)(jo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(B,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Pr.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.User,{className:"h-8 w-8 text-blue-600"})}),(0,Pr.jsx)(Fe,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Pr.jsxs)(se,{className:"text-center",children:[(0,Pr.jsx)("Pr",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add as team members."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Browse existing users"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.User,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Pr.jsx)(x,{className:"Pr-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Pr.jsx)(jo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(B,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Pr.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Pr.jsx)(Fe,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Pr.jsxs)(se,{className:"text-center",children:[(0,Pr.jsx)("Pr",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague Pr create a new AI assistant for your team."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Pr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-purple-600"}),(0,Pr.jsx)("span",{children:"Create from templates"})]})]}),(0,Pr.jsx)(x,{className:"Pr-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Xr({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(jo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,Pr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Pr.jsx)(jo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(B,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Pr.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Pr.jsx)(Fe,{className:"text-xl",children:"Clone Existing"})]}),(0,Pr.jsxs)(se,{className:"text-center",children:[(0,Pr.jsx)("Pr",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Pr.jsx)(x,{className:"Pr-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Pr.jsx)(jo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(B,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Pr.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Pr.jsx)(Fe,{className:"text-xl",children:"Create New"})]}),(0,Pr.jsxs)(se,{className:"text-center",children:[(0,Pr.jsx)("Pr",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4 text-green-600"}),(0,Pr.jsx)("span",{children:"Custom job description"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Pr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Pr.jsx)(x,{className:"Pr-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function Jr(e,t){let[a,o]=(0,Lt.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),s=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Lt.useEffect)(()=>{s(a)},[]),[a,s]}var vo=require("react-icons/Lt");function Ze({title:e,description:t,badge:a,primaryAction:o,secondaryAction:s,gradient:r,children:c,className:i}){let[l,d]=Jr(`hero-section-minimized-${e.replace(/\s+/Pr,"-").toLowerCase()}`,!s&&!t),n=!s&&!t||l;return(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} Pr-8 text-white ${i||""}`,children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Pr.jsx)(X,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Pr.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[n&&o&&(0,Pr.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(s||t)&&(0,Pr.jsx)("button",{"aria-label":l?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 Pr-1 text-white transition-colors",onClick:()=>d(!l),style:{lineHeight:0},children:l?(0,Pr.jsx)(vo.FaChevronDown,{size:22}):(0,Pr.jsx)(vo.FaChevronUp,{size:22})})]})]}),!n&&(0,Pr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("Pr",{className:"max-w-[600px] text-white/80",children:t}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Pr.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),s&&(0,Pr.jsx)(x,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:s.onClick,children:s.label})]})]}),c&&(0,Pr.jsx)("div",{className:"hidden lg:block",children:c})]})]})}function Uo({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:s=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:c,availableUsers:i=[],existingDigitalColleagues:l=[]}){let[d,n]=(0,Lt.useState)(e||[]),[m,f]=(0,Lt.useState)(""),[v,w]=(0,Lt.useState)("all"),[b,u]=(0,Lt.useState)("all"),[h,E]=(0,Lt.useState)("all"),[_,G]=(0,Lt.useState)(null),[k,q]=(0,Lt.useState)(null);(0,Lt.useEffect)(()=>{n(e||[])},[e]);let ve=Array.isArray(i)?i:[],S=Array.isArray(l)?l:[],[ie,R]=(0,Lt.useState)("main"),de=d.filter(N=>{if(!N||!N.name)return!1;let Re=N.name.toLowerCase().includes(m.toLowerCase())||N.type==="human"&&(N.email?.toLowerCase().includes(m.toLowerCase())||N.role?.toLowerCase().includes(m.toLowerCase()))||N.type==="digital"&&N.jobDescription?.toLowerCase().includes(m.toLowerCase()),he=v==="all"||N.type==="human"&&N.department===v,Dt=b==="all"||N.status===b;return Re&&he&&Dt}),U=de.filter(N=>N.type==="human"),F=de.filter(N=>N.type==="digital"),te=()=>{R("typeSelection")},Le=N=>{N.type==="digital"&&(G(N),R("form")),console.log("Editing colleague:",N),a?.(N)},ke=N=>{N.type==="digital"&&(q(N),R("view"))},Ce=N=>{let Re={id:`human-${Date.now()}`,type:"human",name:N.name,email:N.email,role:N.role,department:N.department,phone:N.phone,location:N.location,timezone:N.timezone,skills:N.skills||[],bio:N.bio,status:"active",joinedDate:new Date,lastActive:new Date};n(he=>[...he,Re]),t?.(Re),R("main")},bt=N=>{if(!N||!N.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",N);return}n(Re=>[...Re,N]),t?.(N),R("main")},Mt=()=>{G(null),R("form")},Nt=N=>{if(!N||!N.id){console.error("Invalid colleague provided to handleSaveColleague:",N);return}_?(n(Re=>Re.map(he=>he.id===N.id?N:he)),a?.(N)):(n(Re=>[...Re,N]),t?.(N)),R("main"),G(null)},je=()=>{R("main"),G(null),q(null)},vt=()=>{R("main"),q(null)},it=()=>{k&&(G(k),q(null),R("form"))},Ct=N=>{o?.(N,d.find(Re=>Re.id===N).type),n(Re=>Re.filter(he=>he.id!==N))},Ft=()=>{f(""),w("all"),u("all")},ht=()=>{let N=[];return S.forEach(he=>{he.knowledge&&Array.isArray(he.knowledge)&&N.push(...he.knowledge),he.coreKnowledge&&Array.isArray(he.coreKnowledge)&&N.push(...he.coreKnowledge)}),d.forEach(he=>{he.type==="digital"&&(he.knowledge&&Array.isArray(he.knowledge)&&N.push(...he.knowledge),he.coreKnowledge&&Array.isArray(he.coreKnowledge)&&N.push(...he.coreKnowledge))}),N.filter((he,Dt,Vt)=>Dt===Vt.findIndex(z=>z.id===he.id))};return ie==="typeSelection"?(0,Pr.jsx)(qr,{onSelectHuman:()=>R("userSelection"),onSelectDigital:()=>R("digitalOptions"),onCancel:()=>R("main")}):ie==="userSelection"?(0,Pr.jsx)(Wr,{users:ve,onUserSelect:Ce,onCancel:()=>R("typeSelection")}):ie==="digitalOptions"?(0,Pr.jsx)(Xr,{onCloneExisting:()=>R("digitalClone"),onCreateNew:Mt,onCancel:()=>R("typeSelection")}):ie==="digitalClone"?(0,Pr.jsx)(_r,{digitalColleagues:S,onColleagueClone:bt,onCancel:()=>R("digitalOptions")}):ie==="form"?(0,Pr.jsx)(Vo,{colleague:_||void 0,onSave:Nt,onCancel:je,availableKnowledgeDocuments:ht()}):ie==="view"?(0,Pr.jsx)(Vo,{colleague:k||void 0,onSave:Nt,onCancel:vt,readOnly:!0,availableKnowledgeDocuments:ht()}):(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Pr.jsx)(jo.AnimatePresence,{mode:"wait",children:(0,Pr.jsx)(jo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Pr.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,Pr.jsx)(Ze,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:te}}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Pr.jsxs)(B,{children:[(0,Pr.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(Fe,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(se,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:d.length}),(0,Pr.jsxs)("Pr",{className:"text-xs text-muted-foreground",children:[d.filter(N=>N.status==="active").length," active"]})]})]}),(0,Pr.jsxs)(B,{children:[(0,Pr.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(Fe,{className:"text-sm font-medium",children:"Human Members"}),(0,Pr.jsx)(yt.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(se,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:d.filter(N=>N.type==="human").length}),(0,Pr.jsxs)("Pr",{className:"text-xs text-muted-foreground",children:[d.filter(N=>N.type==="human"&&N.status==="active").length," ","active"]})]})]}),(0,Pr.jsxs)(B,{children:[(0,Pr.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(Fe,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(se,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:d.filter(N=>N.type==="digital").length}),(0,Pr.jsxs)("Pr",{className:"text-xs text-muted-foreground",children:[d.filter(N=>N.type==="digital"&&N.status==="active").length," ","active"]})]})]})]}),(0,Pr.jsx)(B,{children:(0,Pr.jsx)(se,{className:"pt-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)($,{placeholder:"Search colleagues...",value:m,onChange:N=>f(N.target.value),className:"pl-9"})]})}),(0,Pr.jsxs)(Ke,{value:v,onValueChange:w,children:[(0,Pr.jsx)(He,{className:"w-full md:w-[180px]",children:(0,Pr.jsx)(nt,{placeholder:"Department"})}),(0,Pr.jsxs)(ze,{children:[(0,Pr.jsx)(pe,{value:"all",children:"All Departments"}),r.map(N=>(0,Pr.jsx)(pe,{value:N,children:N},N))]})]}),(0,Pr.jsxs)(Ke,{value:b,onValueChange:u,children:[(0,Pr.jsx)(He,{className:"w-full md:w-[140px]",children:(0,Pr.jsx)(nt,{placeholder:"Status"})}),(0,Pr.jsxs)(ze,{children:[(0,Pr.jsx)(pe,{value:"all",children:"All Status"}),(0,Pr.jsx)(pe,{value:"active",children:"Active"}),(0,Pr.jsx)(pe,{value:"inactive",children:"Inactive"})]})]}),(m||v!=="all"||b!=="all")&&(0,Pr.jsxs)(x,{variant:"outline",onClick:Ft,className:"gap-2",children:[(0,Pr.jsx)(yt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)(co,{activeTab:h,onTabChange:E,tabOptions:[{value:"all",label:`All (${de.length})`},{value:"human",label:`Human (${U.length})`},{value:"digital",label:`Digital (${F.length})`}],maxWidth:"400px",gridCols:3}),h==="all"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:de.map(N=>(0,Pr.jsx)(uo,{colleague:N,onEdit:Le,onDelete:Ct,onViewDetails:ke,compact:s},`${N}-${N.id}`))}),h==="human"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:U.map(N=>(0,Pr.jsx)(uo,{colleague:N,onEdit:Le,onDelete:Ct,onViewDetails:ke,compact:s},N.id))}),h==="digital"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:F.map(N=>(0,Pr.jsx)(uo,{colleague:N,onEdit:Le,onDelete:Ct,onViewDetails:ke,compact:s},N.id))})]}),de.length===0&&(0,Pr.jsx)(B,{children:(0,Pr.jsx)(se,{className:"pt-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"yt colleagues found"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground mb-4",children:m||v!=="all"||b!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,Pr.jsxs)(x,{onClick:te,className:"gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function bo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:s=!0,className:r}){return(0,Pr.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[s&&(0,Pr.jsxs)("div",{className:"bg-muted/50 Pr-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Pr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Pr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Pr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Pr.jsx)("div",{className:"divide-y",children:e.map(c=>(0,Pr.jsxs)(jo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"Pr-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(c),children:[(0,Pr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Pr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Pr.jsx)("div",{children:(0,Pr.jsx)("Pr",{className:"font-medium",children:c.name})})]}),(0,Pr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:c.filesize}),(0,Pr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Pr.jsx)("span",{className:"text-sm md:text-base",children:typeof c.createdAt=="string"?c.createdAt:new Date(c.createdAt).toLocaleDateString()}),(0,Pr.jsx)("div",{className:"flex gap-1",children:(0,Pr.jsx)(x,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:i=>{i.stopPropagation(),o?.(c)},children:(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4"})})})]})]},c.name))})]})}function _a({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:s,compactView:r=!1,className:c}){let[i,l]=(0,Lt.useState)(e),[d,n]=(0,Lt.useState)(""),[m,f]=(0,Lt.useState)("all"),[v,w]=(0,Lt.useState)("all");(0,Lt.useEffect)(()=>{l(e)},[e]);let b=Array.from(new Set(i.map(S=>S.mimeType))),u=i.filter(S=>{let ie=S.name.toLowerCase().includes(d.toLowerCase()),R=m==="all"||S.mimeType===m;return ie&&R}),h=u.slice(0,10),E=u.filter(Boolean),_=()=>{t?.()},G=S=>{a?.(S)},k=S=>{console.log("deleting file",S),l(ie=>ie.filter(R=>R.name!==S.name)),o?.(S.id)},q=S=>{s?.(S)},ve=()=>{n(""),f("all")};return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Pr.jsx)(jo.AnimatePresence,{mode:"wait",children:(0,Pr.jsx)(jo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Pr.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,Pr.jsx)(Ze,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:_},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Pr.jsx)(B,{children:(0,Pr.jsx)(se,{className:"pt-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)($,{placeholder:"Search files...",value:d,onChange:S=>n(S.target.value),className:"pl-9"})]})}),(d||m!=="all")&&(0,Pr.jsxs)(x,{variant:"outline",onClick:ve,className:"gap-2",children:[(0,Pr.jsx)(yt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)(co,{activeTab:v,onTabChange:w,tabOptions:[{value:"all",label:`All Files (${u.length})`},{value:"recent",label:`Recent (${h.length})`}],maxWidth:"500px",gridCols:3}),v==="all"&&(0,Pr.jsx)(bo,{files:u,onFileClick:q,onFileEdit:G,onFileDelete:k,showHeader:!r}),v==="recent"&&(0,Pr.jsx)(bo,{files:h,onFileClick:q,onFileEdit:G,onFileDelete:k,showHeader:!r}),v==="shared"&&(0,Pr.jsx)(bo,{files:E,onFileClick:q,onFileEdit:G,onFileDelete:k,showHeader:!r})]}),u.length===0&&(0,Pr.jsx)(B,{children:(0,Pr.jsx)(se,{className:"pt-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"yt files found"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground mb-4",children:d||m!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Pr.jsxs)(x,{onClick:_,className:"gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function ai({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:s=[]}){let[r,c]=(0,Lt.useState)({...e,updatedAt:new Date}),i=()=>{let b=new Set,u=new Set;return s.forEach(h=>{h.menuConfig.groupBy.forEach(E=>b.add(E))}),o.forEach(h=>{h.metadata&&Object.keys(h.metadata).forEach(E=>u.add(E))}),{contextKeys:Array.from(b).sort(),documentKeys:Array.from(u).sort(),allKeys:Array.from(new Set([...b,...u])).sort()}},l=b=>{let u=new Set;return o.forEach(h=>{h.metadata?.[b]&&u.add(String(h.metadata[b]))}),Array.from(u).sort()},d=i(),n=()=>{t(r)},m=(b,u)=>{c(h=>({...h,metadata:{...h.metadata,[b]:u}}))},f=(b,u)=>{u==="__custom__"?m(b,""):m(b,u)},v=()=>{let b=`field_${Date.now()}`;m(b,"")},w=b=>{c(u=>{let h={...u.metadata};return delete h[b],{...u,metadata:h}})};return(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Pr.jsxs)("div",{className:"border-b border-border bg-card Pr-8",children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)("div",{className:"flex-shrink-0 Pr-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,Pr.jsx)(yt.Edit3,{className:"h-6 w-6 text-primary"})}),(0,Pr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsxs)(x,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,Pr.jsx)(yt.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Pr.jsxs)(x,{size:"sm",onClick:n,className:"gap-2",children:[(0,Pr.jsx)(yt.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,Pr.jsx)($,{value:r.title,onChange:b=>c(u=>({...u,title:b.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,Pr.jsx)(be,{value:r.description||"",onChange:b=>c(u=>({...u,description:b.target.value})),placeholder:"Document description...",rows:2})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),d.contextKeys.length>0&&(0,Pr.jsxs)("Pr",{className:"text-xs text-muted-foreground",children:["Suggested: ",d.contextKeys.slice(0,4).join(", "),d.contextKeys.length>4&&` +${d.contextKeys.length-4}`]})]}),(0,Pr.jsxs)(x,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,Pr.jsx)(yt.Plus,{className:"h-3 w-3"}),"Add"]})]}),r.metadata&&Object.keys(r.metadata).length>0?(0,Pr.jsx)("div",{className:"space-y-2",children:Object.entries(r.metadata).map(([b,u])=>{let h=l(b);return(0,Pr.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Pr.jsx)($,{value:b,onChange:E=>{let _=E.target.value,G=r.metadata?.[b];c(k=>{let q={...k.metadata};return delete q[b],_&&(q[_]=G||""),{...k,metadata:q}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${b}`}),(0,Pr.jsx)("datalist",{id:`metadata-keys-${b}`,children:d.allKeys.map(E=>(0,Pr.jsx)("option",{value:E},E))}),(0,Pr.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),h.length>0?(0,Pr.jsxs)(Ke,{value:String(u||""),onValueChange:E=>f(b,E),children:[(0,Pr.jsx)(He,{className:"flex-1 h-8 text-sm",children:(0,Pr.jsx)(nt,{placeholder:"Value"})}),(0,Pr.jsxs)(ze,{children:[h.map(E=>(0,Pr.jsx)(pe,{value:E,children:E},E)),(0,Pr.jsx)(pe,{value:"__custom__",children:(0,Pr.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Pr.jsx)($,{value:String(u||""),onChange:E=>m(b,E.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Pr.jsx)(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>w(b),className:"h-8 w-8 Pr-0 text-muted-foreground hover:text-destructive",children:(0,Pr.jsx)(yt.X,{className:"h-3 w-3"})})]},b)})}):(0,Pr.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,Pr.jsx)("Pr",{className:"text-xs text-muted-foreground",children:'yt metadata \u2022 Click "Add" to create fields'})})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,Pr.jsx)(X,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Pr.jsxs)("div",{className:"Pr-8",children:[(0,Pr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,Pr.jsx)(be,{value:r.content||"",onChange:b=>c(u=>({...u,content:b.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var si=e=>(0,Pr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/Pr,"<br>").replace(/\*\*(.*?)\*\*/Pr,"<strong>$1</strong>").replace(/\*(.*?)\*/Pr,"<em>$1</em>").replace(/`(.*?)`/Pr,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),oi=e=>(0,Pr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),ln=e=>(0,Pr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Pr.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg Pr-4 mb-4",children:(0,Pr.jsxs)("Pr",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Pr.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Pr.jsx)("pre",{className:"text-sm",children:e})]}),dn=e=>(0,Pr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Pr.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg Pr-4 mb-4",children:(0,Pr.jsxs)("Pr",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Pr.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),si(e)]});function ni({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:s=[],knowledgeContexts:r=[]}){let[c,i]=(0,Lt.useState)(!1),l=v=>{switch(v){case"markdown":case"mdx":return(0,Pr.jsx)(yt.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Pr.jsx)(yt.File,{className:"h-6 w-6 text-success"});case"text":return(0,Pr.jsx)(yt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Pr.jsx)(yt.File,{className:"h-6 w-6 text-muted-foreground"})}},d=v=>{switch(v){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richtext":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},n=(v,w)=>{let b={markdown:si,mdx:dn,richtext:ln,text:oi},u=o?.[w]||b[w];return u?u(v):oi(v)},m=v=>{i(!1),t?.(v)},f=()=>{i(!1)};return c?(0,Pr.jsx)(ai,{document:e,onSave:m,onCancel:f,availableDocuments:s,knowledgeContexts:r}):(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Pr.jsxs)("div",{className:"border-b border-border bg-card Pr-8",children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Pr.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"flex-shrink-0 Pr-3 rounded-xl bg-muted border border-border",children:l(e.format)}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Pr.jsx)("Pr",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,Pr.jsx)("div",{className:"flex-shrink-0",children:(0,Pr.jsxs)(x,{variant:"outline",size:"sm",onClick:()=>i(!0),className:"gap-2",children:[(0,Pr.jsx)(yt.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Pr.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${d(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(v=>(0,Pr.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",v]},v))]})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Pr.jsxs)("div",{className:"Pr-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Pr.jsxs)("div",{className:"mb-6",children:[(0,Pr.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Pr.jsx)("div",{className:"bg-muted rounded-lg Pr-3 border border-border",children:(0,Pr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xs",children:Object.entries(e.metadata).map(([v,w])=>(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsxs)("span",{className:"text-muted-foreground font-medium",children:[v.replace(/([A-Pr])/Pr," $1").trim(),":"]}),(0,Pr.jsx)("span",{className:"text-foreground truncate",children:String(w)})]},v))})})]}),(0,Pr.jsx)("div",{className:"space-y-4",children:e.content?(0,Pr.jsx)("div",{className:"relative",children:(0,Pr.jsx)("div",{className:"bg-card border border-border rounded-xl Pr-6 overflow-hidden",children:n(e.content,e.format)})}):(0,Pr.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Pr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Pr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"yt content available"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function li({label:e,documents:t,children:a,level:o,onDocumentClick:s,selectedDocumentId:r,showDocumentCount:c=!0}){let[i,l]=(0,Lt.useState)(o===0),d=a&&Object.keys(a).length>0,n=t.length+(a?Object.values(a).reduce((v,w)=>v+w.documents.length,0):0),m=v=>{switch(v){case"markdown":case"mdx":return(0,Pr.jsx)(yt.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Pr.jsx)(yt.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Pr.jsx)(yt.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},f=v=>{let w=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return w[v%w.length]};return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(d||t.length>0)&&(0,Pr.jsxs)(jo.motion.div,{className:`group flex items-center gap-3 Pr-3 rounded-xl cursor-pointer transition-all duration-200 ${i?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>l(!i),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Pr.jsx)("div",{className:`w-1 h-6 rounded-full ${f(o)}`}),(0,Pr.jsx)(jo.motion.div,{animate:{rotate:i?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Pr.jsx)(yt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Pr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Pr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Pr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),c&&n>0&&(0,Pr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Pr.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:n})})]})]}),(0,Pr.jsx)(jo.motion.div,{initial:!1,animate:{height:i?"auto":0,opacity:i?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Pr.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,w)=>(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:w*.05,duration:.2},className:`group flex items-center gap-3 Pr-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===v.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>s?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Pr.jsx)("div",{className:"flex-shrink-0",children:m(v.format)}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("Pr",{className:`text-sm truncate transition-colors ${r===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,Pr.jsx)("Pr",{className:"text-xs text-muted-foreground truncate Pr-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,Pr.jsx)("div",{className:"flex-shrink-0",children:(0,Pr.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.id)),a&&Object.entries(a).map(([v,w])=>(0,Pr.jsx)(li,{label:v,documents:w.documents,children:w.children,level:o+1,onDocumentClick:s,selectedDocumentId:r,showDocumentCount:c},v))]})})]})}function di({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:s,selectedDocumentId:r,className:c,editable:i=!0}){let[l,d]=(0,Lt.useState)(""),[n,m]=(0,Lt.useState)(null),f=(0,Lt.useMemo)(()=>l?e.filter(b=>b.title.toLowerCase().includes(l.toLowerCase())||b.description?.toLowerCase().includes(l.toLowerCase())||b.tags?.some(u=>u.toLowerCase().includes(l.toLowerCase()))||Object.values(b.metadata||{}).some(u=>String(u).toLowerCase().includes(l.toLowerCase()))):e,[e,l]),v=(0,Lt.useMemo)(()=>{let b=(u,h)=>{if(h.length===0)return{};let[E,..._]=h;return u.reduce((k,q)=>{let ve=q.metadata?.[E]||"Uncategorized",S=String(ve);if(k[S]||(k[S]={documents:[],children:{}}),_.length===0)k[S].documents.push(q);else{let ie=b([q],_),R=Object.keys(ie)[0];R&&(k[S].children||(k[S].children={}),k[S].children[R]?k[S].children[R].documents.push(...ie[R].documents):k[S].children[R]=ie[R])}return k},{})};return b(f,t.groupBy)},[f,t.groupBy]),w=b=>{m(b),a?.(b)};return(0,Pr.jsxs)("div",{className:`flex h-full ${c||""}`,children:[(0,Pr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Pr.jsx)("div",{className:"Pr-6 border-b border-border",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Pr.jsx)(yt.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Pr.jsx)($,{placeholder:"Search knowledge base...",value:l,onChange:b=>d(b.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Pr.jsx)(Ka,{className:"h-[calc(100%-100px)]",children:(0,Pr.jsxs)("div",{className:"Pr-4 space-y-3",children:[Object.entries(v).map(([b,u])=>(0,Pr.jsx)(li,{label:b,documents:u.documents,children:u.children,level:0,onDocumentClick:w,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},b)),Object.keys(v).length===0&&(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Pr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Pr.jsx)("Pr",{className:"text-sm font-medium",children:"yt documents found"}),(0,Pr.jsx)("Pr",{className:"text-xs Pr-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Pr.jsx)("div",{className:"flex-1 bg-background",children:n?(0,Pr.jsx)(ni,{document:n,onDocumentUpdate:s,editable:i}):(0,Pr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Pr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-10 w-10 text-primary"})}),(0,Pr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function Ko({documents:e=[],contexts:t=[],onDocumentClick:a=c=>console.log("Document clicked:",c),onDocumentShare:o=c=>console.log("Share document:",c),onLoadDocumentContent:s,selectedDocumentId:r}){let[c,i]=(0,Lt.useState)(t[0]);return!t||t.length===0?(0,Pr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Pr.jsx)(Ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Pr.jsx)("Pr",{className:"text-muted-foreground",children:"yt contexts available"})})]}):(0,Pr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Pr.jsx)(Ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Pr.jsxs)("div",{className:"Pr-6",children:[(0,Pr.jsx)("div",{className:"border-b border-border",children:(0,Pr.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(l=>(0,Pr.jsxs)("button",{onClick:()=>i(l),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${c.id===l.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[l.icon,l.label]},l.id))})}),c.description&&(0,Pr.jsx)("div",{className:"Pr-3 px-1",children:(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground",children:c.description})})]})]}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Pr.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Pr.jsx)(di,{documents:e,menuConfig:c.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}var cn=[{key:"kanban",icon:yt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:yt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:yt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:yt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:yt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],mi=({currentView:e,onViewChange:t,children:a})=>(0,Pr.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Pr.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:cn.map(o=>{let s=o.icon,r=e===o.key;return(0,Pr.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Pr.jsx)(s,{className:"h-4 w-4 flex-shrink-0"}),(0,Pr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Pr.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Pr.jsx)("div",{className:"w-full h-full",children:a})})]});var pi=({title:e,status:t,taskCount:a,children:o,onDrop:s,isCompact:r=!1,height:c})=>{let i=n=>{n.preventDefault()},l=n=>{n.preventDefault(),s(t)};return(0,Pr.jsxs)(B,{className:`Pr-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${r?"lg:max-w-xs":""}`,style:{height:c||"calc(100vh - 350px)"},onDragOver:i,onDrop:l,children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Pr.jsx)(X,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var qa=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:s=!1})=>{let r=n=>{a(e)},c=()=>{o(e)},i=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,Pr.jsx)(yt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Pr.jsx)(yt.Bug,{className:"h-3 w-3"});case"spike":return(0,Pr.jsx)(yt.Zap,{className:"h-3 w-3"});case"task":default:return(0,Pr.jsx)(yt.AlertCircle,{className:"h-3 w-3"})}},d=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return s?(0,Pr.jsx)(B,{className:"Pr-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:c,children:(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${d()}`,children:l()}),(0,Pr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Pr.jsxs)(B,{className:"Pr-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:c,children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Pr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${d()}`,children:[l(),(0,Pr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${i()}`,children:e.priority}),(0,Pr.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,Pr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.User,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Xa=we(require("react")),et=we(require("@radix-yt/react-dialog"));var gt=et.Root;var mn=et.Portal;var gi=Xa.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(et.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}));gi.displayName=et.Overlay.displayName;var lt=Xa.forwardRef(({className:e,children:t,...a},o)=>(0,Pr.jsxs)(mn,{children:[(0,Pr.jsx)(gi,{}),(0,Pr.jsxs)(et.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 Pr-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,Pr.jsxs)(et.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,Pr.jsx)(yt.X,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{className:"Lt-only",children:"Close"})]})]})]}));lt.displayName=et.Content.displayName;var dt=({className:e,...t})=>(0,Pr.jsx)("div",{className:C("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});dt.displayName="DialogHeader";var Ja=({className:e,...t})=>(0,Pr.jsx)("div",{className:C("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ja.displayName="DialogFooter";var ct=Xa.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(et.Title,{ref:a,className:C("text-lg font-semibold leading-none tracking-tight",e),...t}));ct.displayName=et.Title.displayName;var Za=Xa.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(et.Description,{ref:a,className:C("text-sm text-muted-foreground",e),...t}));Za.displayName=et.Description.displayName;var xa=we(require("react")),Aa=we(require("@radix-yt/react-toggle-group"));var fi=we(require("react")),$o=we(require("@radix-yt/react-toggle"));var Go=(0,Sr.cva)("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),pn=fi.forwardRef(({className:e,variant:t,size:a,...o},s)=>(0,Pr.jsx)($o.Root,{ref:s,className:C(Go({variant:t,size:a,className:e})),...o}));pn.displayName=$o.Root.displayName;var bi=xa.createContext({size:"default",variant:"default"}),ya=xa.forwardRef(({className:e,variant:t,size:a,children:o,...s},r)=>(0,Pr.jsx)(Aa.Root,{ref:r,className:C("flex items-center justify-center gap-1",e),...s,children:(0,Pr.jsx)(bi.Provider,{value:{variant:t,size:a},children:o})}));ya.displayName=Aa.Root.displayName;var wa=xa.forwardRef(({className:e,children:t,variant:a,size:o,...s},r)=>{let c=xa.useContext(bi);return(0,Pr.jsx)(Aa.Item,{ref:r,className:C(Go({variant:c.variant||a,size:c.size||o}),e),...s,children:t})});wa.displayName=Aa.Item.displayName;var un=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:yt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:yt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:yt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:yt.Zap}],gn=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],wo=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:s,assignees:r,defaultEpicId:c})=>{let[i,l]=(0,Lt.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epicId:"",sprintId:"none",assignee:""});(0,Lt.useEffect)(()=>{e&&c&&l(m=>({...m,epicId:c}))},[e,c]),(0,Lt.useEffect)(()=>{e&&l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epicId:c||"",sprintId:"none",assignee:""})},[e]);let d=m=>{m.preventDefault(),i.name.trim()&&(a({name:i.name.trim(),description:i.description.trim(),status:"todo",priority:i.priority,type:i.type,storyPoints:i.storyPoints,epic:Number(i.epicId),sprint:Number(i.sprintId),assignee:i.assignee.trim()?{relationTo:"digital-colleagues",value:Number(i.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epicId:c||"",sprintId:"none",assignee:""}),t())},n=(m,f)=>{l(v=>({...v,[m]:f}))};return(0,Pr.jsx)(gt,{open:e,onOpenChange:t,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Task"})}),(0,Pr.jsxs)("form",{onSubmit:d,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"name",children:"Task Title"}),(0,Pr.jsx)($,{id:"name",value:i.name,onChange:m=>n("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(be,{id:"description",value:i.description,onChange:m=>n("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"Type"}),(0,Pr.jsx)(ya,{type:"single",value:i.type||"",onValueChange:m=>m&&n("type",m),children:un.map(m=>{let f=m.icon;return(0,Pr.jsxs)(wa,{value:m.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Pr.jsx)(f,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"Priority"}),(0,Pr.jsx)(ya,{type:"single",value:i.priority||"",onValueChange:m=>m&&n("priority",m),children:gn.map(m=>(0,Pr.jsx)(wa,{value:m.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:m.label},m.value))})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"points",children:"Story Points"}),(0,Pr.jsx)($,{id:"points",type:"number",min:"1",max:"100",value:i.storyPoints,onChange:m=>n("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!c&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"epic",children:"Epic"}),(0,Pr.jsxs)(Ke,{value:i.epicId,onValueChange:m=>n("epicId",m),children:[(0,Pr.jsx)(He,{children:(0,Pr.jsx)(nt,{placeholder:"Select an epic"})}),(0,Pr.jsx)(ze,{children:o.map(m=>(0,Pr.jsx)(pe,{value:m.id.toString(),children:(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.id))})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Pr.jsxs)(Ke,{value:i.sprintId,onValueChange:m=>n("sprintId",m),children:[(0,Pr.jsx)(He,{children:(0,Pr.jsx)(nt,{placeholder:"Select a sprint"})}),(0,Pr.jsxs)(ze,{children:[(0,Pr.jsx)(pe,{value:"none",children:"yt Sprint"}),s.map(m=>(0,Pr.jsx)(pe,{value:m.id.toString(),children:(0,Pr.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"sprint",children:"Assignee"}),(0,Pr.jsxs)(Ke,{value:i.assignee,onValueChange:m=>n("assignee",m),children:[(0,Pr.jsx)(He,{children:(0,Pr.jsx)(nt,{placeholder:"Select an Assignee"})}),(0,Pr.jsxs)(ze,{children:[(0,Pr.jsx)(pe,{value:"none",children:"yt Assignee"}),r.map(m=>(0,Pr.jsx)(pe,{value:m.id.toString(),children:(0,Pr.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,Pr.jsxs)(Ja,{children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var _o=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:s,className:r="",disabled:c=!1})=>{let[i,l]=(0,Lt.useState)(!1),[d,n]=(0,Lt.useState)(""),m=()=>{c||(l(!0),n(t))},f=async()=>{d!==t&&await s(e,d),l(!1)},v=w=>{w.key==="Enter"&&!o||w.key==="Enter"&&w.ctrlKey&&o?f():w.key==="Escape"&&(l(!1),n(""))};return(0,Pr.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Pr.jsx)(T,{children:a}),i?o?(0,Pr.jsx)(be,{value:d,onChange:w=>n(w.target.value),onBlur:f,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,Pr.jsx)($,{value:d,onChange:w=>n(w.target.value),onBlur:f,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,Pr.jsxs)("div",{onClick:m,className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 Pr-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Pr.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!c&&(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var wi=({comments:e,onAddComment:t})=>{let[a,o]=(0,Lt.useState)(""),s=c=>c.split(" ").map(i=>i[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,$e.jsxs)("div",{className:"space-y-4",children:[(0,$e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$e.jsx)(yt.MessageSquare,{className:"h-5 w-5"}),(0,$e.jsx)(T,{className:"text-lg font-medium",children:"Comments"}),(0,$e.jsx)(X,{variant:"secondary",children:e.length})]}),(0,$e.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(c=>(0,$e.jsxs)("div",{className:"flex gap-3 Pr-3 bg-muted/50 rounded-lg",children:[(0,$e.jsx)(Gt,{className:"h-8 w-8 Pr-1",children:(0,$e.jsx)(Wt,{className:"text-xs bg-muted text-muted-foreground",children:s(c.author)})}),(0,$e.jsxs)("div",{className:"flex-1",children:[(0,$e.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,$e.jsx)("span",{className:"font-medium text-sm",children:c.author}),(0,$e.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c.createdAt.toLocaleDateString()," at ",c.createdAt.toLocaleTimeString()]})]}),(0,$e.jsx)("Pr",{className:"text-sm text-muted-foreground",children:c.text})]})]},c.id))}),(0,$e.jsxs)("div",{className:"flex gap-2",children:[(0,$e.jsx)(be,{value:a,onChange:c=>o(c.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,$e.jsx)(x,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,$e.jsx)(yt.Send,{className:"h-4 w-4"})})]})]})};var Co=({label:e,value:t,onValueChange:a,options:o,showColor:s=!1,disabled:r=!1})=>{let[c,i]=(0,Lt.useState)(!1),l=o.find(n=>n.value===t);return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:e}),(0,Pr.jsxs)(Ke,{value:t,onValueChange:a,open:c,onOpenChange:n=>{r||i(n)},disabled:r,children:[(0,Pr.jsx)(He,{className:"h-auto Pr-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Pr.jsxs)(X,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&i(!c),children:[s&&l?.color&&(0,Pr.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} mr-1`}),l?.label||"Select..."]})}),(0,Pr.jsx)(ze,{children:o.map(n=>(0,Pr.jsx)(pe,{value:n.value,children:s&&n.color?(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${n.color}`}),n.label]}):n.label},n.value))})]})]})};var Ci=({label:e,value:t,onValueChange:a,options:o,placeholder:s="Search...",allowCustomValue:r=!1,disabled:c=!1})=>{let[i,l]=(0,Lt.useState)(!1),[d,n]=(0,Lt.useState)(""),m=o.find(u=>u.value===t),f=o.filter(u=>u.label.toLowerCase().includes(d.toLowerCase())),v=u=>{a(u),l(!1),n("")},w=()=>{r&&d.trim()&&!o.find(u=>u.value===d.trim())&&(a(d.trim()),l(!1),n(""))};return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:e}),(0,Pr.jsxs)(Ke,{value:t,onValueChange:v,open:i,onOpenChange:u=>{c||l(u)},disabled:c,children:[(0,Pr.jsx)(He,{className:"h-auto Pr-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Pr.jsx)(X,{variant:"secondary",className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!c&&l(!i),children:m?.label||t||"Select..."})}),(0,Pr.jsxs)(ze,{children:[(0,Pr.jsx)("div",{className:"Pr-2",children:(0,Pr.jsx)($,{placeholder:s,value:d,onChange:u=>n(u.target.value),onKeyDown:u=>{u.key==="Enter"&&r&&w()},className:"mb-2"})}),f.map(u=>(0,Pr.jsx)(pe,{value:u.value,children:u.label},u.value)),r&&d.trim()&&!f.find(u=>u.value===d.trim())&&(0,Pr.jsxs)(pe,{value:d.trim(),children:['Add "',d.trim(),'"']})]})]})]})};var Ue=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var fn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:yt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:yt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:yt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:yt.Zap}],vn=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var Di=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:s,onClose:r,onDelete:c,isUpdating:i=!1,isDeleting:l=!1,deleteState:d="idle",teamMembers:n})=>{let[m,f]=(0,Lt.useState)(e.storyPoints),v=(0,Lt.useRef)(null),w=(0,Lt.useCallback)((h,E)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{s(h,E)},500)},[s]);(0,Lt.useEffect)(()=>{w("storyPoints",m?.toString()||"1")},[m]);let b=h=>h.split(" ").map(E=>E[0]).join("").toUpperCase(),u=()=>d==="loading"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):d==="success"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.Check,{className:"h-3 w-3"}),"Deleted"]}):d==="error"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Pr.jsxs)(x,{onClick:c,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:i||l,children:[(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Pr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Pr.jsxs)("div",{className:"space-y-4",style:{opacity:i?.6:1},children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Pr.jsx)(Co,{label:"",value:e.status,onValueChange:h=>s("status",h),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:i})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Pr.jsx)(ya,{type:"single",value:e.type||"",onValueChange:h=>h&&s("type",h),className:"grid grid-cols-2 gap-1",disabled:i,children:fn.map(h=>{let E=h.icon;return(0,Pr.jsxs)(wa,{value:h.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:i,children:[(0,Pr.jsx)(E,{className:"h-3 w-3"}),h.label]},h.value)})})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Pr.jsx)(ya,{type:"single",value:e.priority||"",onValueChange:h=>h&&s("priority",h),className:"grid grid-cols-3 gap-1",disabled:i,children:vn.map(h=>(0,Pr.jsx)(wa,{value:h.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:i,children:h.label},h.value))})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Pr.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:h=>{let E=Number(h.target.value);E<1?f(1):E>100?f(100):f(E)},className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:i})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Pr.jsx)(Co,{label:"",value:Ue(e.epic).toString(),onValueChange:h=>s("epicId",h),options:(t||[]).map(h=>({value:h.id.toString(),label:h?.name,color:h.color})),showColor:!0,disabled:i})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Pr.jsx)(Co,{label:"",value:Ue(e.sprint).toString()||"none",onValueChange:h=>s("sprintId",h==="none"?"":h),options:[{value:"none",label:"yt Sprint"},...(a||[]).map(h=>({value:h.id.toString(),label:`${h?.name}`}))],disabled:i})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Pr.jsx)(Ci,{label:"",value:e.assignee?.value?.name,onValueChange:h=>s("assignee",h),options:n.map(h=>({value:`${typeof h.email=="string"?"users":"digital-colleagues"}:${h.id}`,label:h?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:i})]})]}),(0,Pr.jsxs)("div",{className:"Pr-auto pt-4 space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(x,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:i||l,children:"Close"}),u()]}),(0,Pr.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.User,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:"System"})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Clock,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var ki=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:s,onUpdateTask:r,onDeleteTask:c,onAddComment:i,colleagues:l})=>{let[d,n]=(0,Lt.useState)(a),[m,f]=(0,Lt.useState)(new Date),[v,w]=(0,Lt.useState)("idle"),[b,u]=(0,Lt.useState)("idle"),[h,E]=(0,Lt.useState)([]);(0,Lt.useEffect)(()=>{n(a)},[a]);let _=async(R,de)=>{if(de!==d[R]){w("loading");try{let U=await r(d.id.toString(),{[R]:de});n(U),f(new Date),w("success"),setTimeout(()=>w("idle"),1500)}catch(U){console.log("error",U),w("error"),setTimeout(()=>w("idle"),3e3)}}},G=async(R,de)=>{if(de!==d[R]){w("loading");try{let U=await r(d.id.toString(),{[R]:de});n(U),f(new Date),w("success"),setTimeout(()=>w("idle"),1500)}catch{w("error"),setTimeout(()=>w("idle"),3e3)}}},k=async R=>{if(i){w("loading");try{let de=await i?.({content:R,taskId:d.id.toString()});n(de),f(new Date),w("success"),setTimeout(()=>w("idle"),1500)}catch{w("error"),setTimeout(()=>w("idle"),3e3)}}},q=async()=>{u("loading");try{await c(d.id.toString()),u("success"),setTimeout(()=>{t(),u("idle")},1e3)}catch{u("error"),setTimeout(()=>u("idle"),3e3)}},ve=v!=="loading"&&b!=="loading",S=()=>{ve&&t()},ie=()=>v==="loading"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Pr.jsx)(yt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Pr.jsx)("span",{children:"Updating..."})]}):v==="success"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Updated successfully"})]}):v==="error"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Pr.jsx)(yt.X,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Update failed"})]}):null;return(0,Pr.jsx)(gt,{open:e,onOpenChange:S,children:(0,Pr.jsxs)(lt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto Pr-4",children:[(0,Pr.jsxs)(dt,{children:[(0,Pr.jsx)(ct,{className:"Lt-only",children:d.name}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("div",{className:"flex-1",children:ie()}),!ve&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Pr.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Pr.jsx)(_o,{fieldName:"name",value:d.name||"",label:"",onSave:_,className:"border-b border-border pb-3",disabled:v==="loading"}),(0,Pr.jsx)(_o,{fieldName:"description",value:d.description||"",label:"Description",multiline:!0,onSave:_,disabled:v==="loading"}),(0,Pr.jsx)(wi,{comments:(d?.comments||[]).map(R=>({author:R.author.value.name||"",createdAt:new Date(R.timestamp),text:R.text,id:R.id||""})),onAddComment:k})]}),(0,Pr.jsx)(Di,{task:d,epics:o,sprints:s,lastUpdated:m,onUpdateTask:G,onClose:S,onDelete:q,isUpdating:v==="loading",isDeleting:b==="loading",deleteState:b,teamMembers:l})]})]})})};var Do=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,s]=(0,Lt.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),r=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],c=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],i=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],l=n=>{n.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),s({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),t())},d=(n,m)=>{s(f=>({...f,[n]:m}))};return(0,Pr.jsx)(gt,{open:e,onOpenChange:t,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Epic"})}),(0,Pr.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"name",children:"Epic Name"}),(0,Pr.jsx)($,{id:"name",value:o.name,onChange:n=>d("name",n.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(be,{id:"description",value:o.description,onChange:n=>d("description",n.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"Color"}),(0,Pr.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(n=>(0,Pr.jsx)("button",{type:"button",onClick:()=>d("color",n),className:`w-8 h-8 rounded-full ${n} ${o.color===n?"ring-2 ring-gray-400":""}`},n))})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"Confidence"}),(0,Pr.jsxs)(Ke,{value:o.confidence,onValueChange:n=>d("confidence",n),children:[(0,Pr.jsx)(He,{children:(0,Pr.jsx)(nt,{})}),(0,Pr.jsx)(ze,{children:c.map(n=>(0,Pr.jsx)(pe,{value:n.value,children:n.label},n.value))})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"Phase"}),(0,Pr.jsxs)(Ke,{value:o.phase.toString(),onValueChange:n=>d("phase",parseInt(n)),children:[(0,Pr.jsx)(He,{children:(0,Pr.jsx)(nt,{})}),(0,Pr.jsx)(ze,{children:i.map(n=>(0,Pr.jsx)(pe,{value:n.value.toString(),children:n.label},n.value))})]})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"Start Date"}),(0,Pr.jsx)($,{type:"date",value:o.startDate,onChange:n=>d("startDate",n.target.value)})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"End Date"}),(0,Pr.jsx)($,{type:"date",value:o.endDate,onChange:n=>d("endDate",n.target.value)})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"Progress (%)"}),(0,Pr.jsx)($,{type:"number",min:"0",max:"100",value:o.progress,onChange:n=>d("progress",parseInt(n.target.value)||0)})]}),(0,Pr.jsxs)(Ja,{children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Ti=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:s=[],initialProjects:r=[],onAddTask:c,onUpdateTask:i,onDeleteTask:l,onTaskClick:d,onAddEpic:n,onAddComment:m})=>{let[f,v]=(0,Lt.useState)(e),[w,b]=(0,Lt.useState)(t),[u,h]=(0,Lt.useState)(a),[E,_]=(0,Lt.useState)(!1),[G,k]=(0,Lt.useState)(!1),[q,ve]=(0,Lt.useState)(null),[S,ie]=(0,Lt.useState)(null),[R,de]=(0,Lt.useState)(o),[U,F]=(0,Lt.useState)(s),[te,Le]=(0,Lt.useState)(0),ke=(0,Lt.useRef)(null),Ce=(0,Lt.useRef)(null),bt=w.filter(z=>!0).map(z=>z.id),Mt=u.find(z=>z.isSelected);bt.push(0),(0,Lt.useEffect)(()=>{v(e)},[e]),(0,Lt.useEffect)(()=>{b(t)},[t]),(0,Lt.useEffect)(()=>{h(a)},[a]),(0,Lt.useEffect)(()=>{let z=()=>{if(ke.current){let tt=ke.current.offsetHeight;Le(tt)}};z();let ye=new ResizeObserver(z);ke.current&&ye.observe(ke.current);let De=()=>{setTimeout(z,100)};return window.addEventListener("storage",De),()=>{ye.disconnect(),window.removeEventListener("storage",De)}},[]),(0,Lt.useEffect)(()=>{let z=setTimeout(()=>{ke.current&&Le(ke.current.offsetHeight)},300);return()=>clearTimeout(z)},[E,G]);let Nt=f.filter(z=>!0),je=z=>Nt.filter(ye=>ye.status===z),vt=z=>{let ye={};return w.forEach(De=>{ye[De.id]=z.filter(tt=>Ue(tt.epic)===De.id)}),ye["no-epic"]=z.filter(De=>!Ue(De.epic)),ye},it=z=>{ie(z)},Ct=z=>{S&&(v(ye=>ye.map(De=>De.id===S.id?{...De,status:z}:De)),i?.(S.id.toString(),{status:z}),ie(null))},Ft=z=>{let ye={...z,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(De=>[...De,ye]),c?.(z)},ht=async(z,ye)=>{if(v(tt=>tt.map(st=>st.id===Number(z)?{...st,...ye}:st)),i)return await i(z,ye);let De=f.find(tt=>tt.id===Number(z));if(!De)throw new Error("Task not found");return{...De,...ye}},N=async z=>{v(ye=>ye.filter(De=>De.id!==Number(z))),q?.id===Number(z)&&ve(null),l&&await l(z)},Re=z=>{let ye={...z,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};b(De=>[...De,ye]),n?.(z)},he=z=>{ve(z),d?.(z)},Dt=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Vt=te>0?`calc(100vh - ${te+120}px)`:"calc(100vh - 12rem)";return(0,Pr.jsxs)("div",{ref:Ce,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:ke,className:"flex-shrink-0",children:(0,Pr.jsx)(Ze,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>_(!0)},secondaryAction:{label:"Add epic",onClick:()=>k(!0)}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Pr-8",children:(0,Pr.jsx)("div",{className:"h-full",style:{height:te>0?`calc(100vh - ${te+120}px)`:"calc(100vh - 12rem)"},children:(0,Pr.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Dt.map(z=>{let ye=je(z.status),De=vt(ye);return(0,Pr.jsxs)(pi,{title:z.title,status:z.status,taskCount:ye.length,onDrop:Ct,isCompact:z.status==="done",height:Vt,children:[De["no-epic"].map(tt=>(0,Pr.jsx)(qa,{epic:null,task:tt,onDragStart:it,onTaskClick:he,isCompact:z.status==="done"})),bt.map(tt=>{let st=w.find(A=>A.id===tt),y=De[tt]||[];return y.length===0?null:(0,Pr.jsxs)("div",{className:"mb-6",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${st?.color}`}),(0,Pr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:st?.name||"yt Epic"}),(0,Pr.jsx)(X,{variant:"secondary",className:"text-xs",children:y.length})]})," ",(0,Pr.jsx)("div",{className:"space-y-3",children:y.map(A=>(0,Pr.jsx)(qa,{task:A,epic:st,onDragStart:it,onTaskClick:he,isCompact:z.status==="done"},A.id))})]},tt)})]},z.id)})})})}),(0,Pr.jsx)(wo,{isOpen:E,onClose:()=>_(!1),onAddTask:Ft,assignees:[...U,...R],epics:w,sprints:u}),(0,Pr.jsx)(Do,{isOpen:G,onClose:()=>k(!1),onAddEpic:Re}),q&&(0,Pr.jsx)(ki,{isOpen:!!q,onClose:()=>ve(null),initialTask:q,epics:w,sprints:u,onUpdateTask:ht,onDeleteTask:N,colleagues:[...U,...R],onAddComment:m})]})};var Pi=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:s,onAddTaskToEpic:r,onAddEpic:c,onUpdateEpic:i,onDeleteEpic:l})=>{let[d,n]=(0,Lt.useState)(null),[m,f]=(0,Lt.useState)(null),[v,w]=(0,Lt.useState)({}),[b,u]=(0,Lt.useState)(0),h=(0,Lt.useRef)(null),E=(0,Lt.useRef)(null);(0,Lt.useEffect)(()=>{let F=()=>{if(h.current){let ke=h.current.offsetHeight;u(ke)}};F();let te=new ResizeObserver(F);h.current&&te.observe(h.current);let Le=()=>{setTimeout(F,100)};return window.addEventListener("storage",Le),()=>{te.disconnect(),window.removeEventListener("storage",Le)}},[]),(0,Lt.useEffect)(()=>{let F=setTimeout(()=>{h.current&&u(h.current.offsetHeight)},300);return()=>clearTimeout(F)},[m]);let _=F=>{n(F)},G=F=>{F.preventDefault()},k=(F,te)=>{F.preventDefault(),d&&Ue(d.epic).toString()!==te&&(o(d.id.toString(),{epic:Number(te)}),n(null))},q=F=>e.filter(te=>Ue(te.epic).toString()===F),ve=F=>{f(F.id.toString()),w({name:F.name,description:F.description,confidence:F.confidence,phase:F.phase})},S=()=>{m&&v.name&&(i(m.toString(),v),f(null),w({}))},ie=()=>{f(null),w({})},R=F=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&l(F)},de=F=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[F]||`Phase ${F}`,U=F=>{switch(F){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Pr.jsxs)("div",{ref:E,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:h,className:"flex-shrink-0",children:(0,Pr.jsx)(Ze,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:c}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Pr-8",children:(0,Pr.jsx)("div",{className:"h-full overflow-y-auto",style:{height:b>0?`calc(100vh - ${b+120}px)`:"calc(100vh - 12rem)"},children:(0,Pr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:t.map(F=>{let te=q(F.id.toString()),Le=te.reduce((Ce,bt)=>Ce+(bt.storyPoints||0),0),ke=b>0?`calc(100vh - ${b+200}px)`:"calc(100vh - 14rem)";return(0,Pr.jsxs)(B,{className:`flex flex-col ${m===F.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:m===F.id.toString()?"auto":ke,minHeight:"400px"},onDragOver:G,onDrop:Ce=>k(Ce,F.id.toString()),children:[(0,Pr.jsx)("div",{className:"Pr-4 border-b border-border",children:m===F.id.toString()?(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)($,{value:v.name||"",onChange:Ce=>w({...v,name:Ce.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Pr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:S,className:"Pr-1 h-8 w-8",children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:ie,className:"Pr-1 h-8 w-8",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]})]}),(0,Pr.jsx)(be,{value:v.description||"",onChange:Ce=>w({...v,description:Ce.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Pr.jsxs)("select",{value:v.confidence||F.confidence,onChange:Ce=>w({...v,confidence:Ce.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,Pr.jsx)("option",{value:"low",children:"Low"}),(0,Pr.jsx)("option",{value:"medium",children:"Medium"}),(0,Pr.jsx)("option",{value:"high",children:"High"})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Pr.jsx)("select",{value:v.phase?.toString()||F.phase.toString(),onChange:Ce=>w({...v,phase:parseInt(Ce.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Ce=>(0,Pr.jsxs)("option",{value:Ce.toString(),children:["Phase ",Ce]},Ce))})]})]})]}):(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Pr.jsx)("div",{className:`w-4 h-4 rounded-full ${F.color}`}),(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:F.name}),(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>ve(F),className:"Pr-1 h-8 w-8",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>R(F.id.toString()),className:"Pr-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Pr.jsxs)(X,{className:`text-xs ${U(F.confidence)}`,children:[F.confidence," confidence"]}),(0,Pr.jsxs)(X,{variant:"outline",className:"text-xs",children:["Phase ",F.phase]}),(0,Pr.jsxs)(X,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[te.length," tasks"]}),(0,Pr.jsxs)(X,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Le," pts"]})]}),F.description&&(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground mb-3 select-none",children:F.description}),(0,Pr.jsxs)(x,{onClick:()=>r(F.id.toString()),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Pr.jsx)("div",{className:"flex-1 Pr-4 overflow-y-auto",children:(0,Pr.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded Pr-3 transition-colors ${d?"border-primary bg-primary/10":"border-border"}`,children:te.length===0?(0,Pr.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,Pr.jsx)(yt.Move,{className:"h-8 w-8 mb-2"}),(0,Pr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):te.map(Ce=>(0,Pr.jsx)(qa,{task:Ce,epic:F,onDragStart:_,onTaskClick:s,isCompact:!0},Ce.id))})})]},F.id)})})})})]})};var Ri=require("react-day-picker");function ko({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Pr.jsx)(Ri.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:C("Pr-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:C(io({variant:"outline"}),"h-7 w-7 bg-transparent Pr-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full Pr-2",cell:C("relative Pr-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:C(io({variant:"ghost"}),"h-8 w-8 Pr-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}ko.displayName="Calendar";var Ei=we(require("react")),zt=we(require("@radix-yt/react-popover"));var Jo=zt.Root,Zo=zt.Trigger;var So=Ei.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},s)=>(0,Pr.jsx)(zt.Portal,{children:(0,Pr.jsx)(zt.Content,{ref:s,align:t,sideOffset:a,className:C("z-50 w-72 rounded-md border bg-popover Pr-4 text-popover-foreground shadow-md outline-none 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})}));So.displayName=zt.Content.displayName;var Qo=require("date-fns");var Mi=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,s]=(0,Lt.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=i=>{i.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),s({name:"",description:"",startDate:void 0,endDate:void 0}),t())},c=()=>{s({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Pr.jsx)(gt,{open:e,onOpenChange:c,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Sprint"})}),(0,Pr.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"name",children:"Sprint Name *"}),(0,Pr.jsx)($,{id:"name",value:o.name,onChange:i=>s(l=>({...l,name:i.target.value})),placeholder:"e.Pr., Sprint 3",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(be,{id:"description",value:o.description,onChange:i=>s(l=>({...l,description:i.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"Start Date *"}),(0,Pr.jsxs)(Jo,{children:[(0,Pr.jsx)(Zo,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:C("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Pr.jsx)(yt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Qo.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Pr.jsx)(So,{className:"w-auto Pr-0",align:"start",children:(0,Pr.jsx)(ko,{mode:"single",selected:o.startDate,onSelect:i=>s(l=>({...l,startDate:i})),initialFocus:!0})})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{children:"End Date *"}),(0,Pr.jsxs)(Jo,{children:[(0,Pr.jsx)(Zo,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:C("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Pr.jsx)(yt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Qo.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Pr.jsx)(So,{className:"w-auto Pr-0",align:"start",children:(0,Pr.jsx)(ko,{mode:"single",selected:o.endDate,onSelect:i=>s(l=>({...l,endDate:i})),initialFocus:!0,disabled:i=>o.startDate?i<o.startDate:!1})})]})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var To=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:s,onAddSprint:r,onUpdateSprint:c,onDeleteSprint:i})=>{let[l,d]=(0,Lt.useState)([]),[n,m]=(0,Lt.useState)(new Set),[f,v]=(0,Lt.useState)(null),[w,b]=(0,Lt.useState)(!1),[u,h]=(0,Lt.useState)(null),[E,_]=(0,Lt.useState)(null),[G,k]=(0,Lt.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[q,ve]=(0,Lt.useState)([]),[S,ie]=(0,Lt.useState)("upcoming"),[R,de]=(0,Lt.useState)(!1),[U,F]=(0,Lt.useState)(0),te=(0,Lt.useRef)(null),Le=(0,Lt.useRef)(null);(0,Lt.useEffect)(()=>{let y=()=>{te.current&&F(te.current.offsetHeight)};y();let A=new ResizeObserver(y);return te.current&&A.observe(te.current),()=>A.disconnect()},[]);let ke=y=>t.find(A=>A.id===Number(y)),Ce=y=>a.find(A=>A.id===Number(y)),bt=y=>{let A={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return A[y]||A.medium},Mt=y=>{if(!y||y?.length===0)return"";let A=y?.trim().split(" ");if(A?.length===1)return A[0];let ue=A[0],xe=A[A.length-1][0].toUpperCase();return`${ue} ${xe}`},Nt=y=>{let A={},ue=[];return y.forEach(xe=>{xe.epic?(A[Ue(xe.epic)]||(A[Ue(xe.epic)]=[]),A[Ue(xe.epic)].push(xe)):ue.push(xe)}),{tasksByEpic:A,unassignedTasks:ue}};(0,Lt.useEffect)(()=>{ve(a)},[a]);let je=q.filter(y=>{switch(S){default:return!0}}),vt=q.filter(y=>l.includes(y.id.toString())),it=e.filter(y=>!y.sprint||y.status==="backlog"),Ct=it.reduce((y,A)=>y+(A.storyPoints||0),0),Ft=y=>{d(A=>A.includes(y)?A.filter(ue=>ue!==y):A?.length<3?[...A,y]:A)},ht=y=>{m(A=>{let ue=new Set(A);return ue.has(y)?ue.delete(y):ue.add(y),ue})},N=y=>{r(y),b(!1)},Re=y=>{_(y.id.toString()),k({name:y.name,description:y.description||"",startDate:y.startDate?new Date(y.startDate).toISOString().split("T")[0]:y.startDate,endDate:y.endDate?new Date(y.endDate).toISOString().split("T")[0]:y.endDate,isActive:!1})},he=()=>{E&&(c(E,{name:G.name,description:G.description,startDate:G.startDate,endDate:G.endDate}),ve(y=>y.map(A=>(A.id===Number(E)&&(A.name=G.name,A.description=G.description,A.startDate=G.startDate,A.endDate=G.endDate),A))),_(null))},Dt=()=>{_(null),k({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Vt=(y,A)=>{v(A),y.dataTransfer.effectAllowed="move"},z=y=>{y.preventDefault(),y.dataTransfer.dropEffect="move"},ye=y=>{h(y)},De=()=>{h(null)},tt=(y,A)=>{if(y.preventDefault(),h(null),!f)return;(Ue(f.sprint)||void 0)!==Number(A)&&o(f.id.toString(),{sprint:Number(A)}),v(null)},st=({task:y,showSprint:A=!1})=>{let ue=y.epic?ke(Ue(y.epic).toString()):null,xe=y.sprint?Ce(Ue(y.sprint).toString()):null;return(0,Pr.jsx)(B,{className:"Pr-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:pt=>{pt.dataTransfer.effectAllowed="move",pt.dataTransfer.setData("text/plain",y.id.toString()),Vt(pt,y)},onClick:pt=>{f===null&&s(y)},style:{userSelect:"none"},children:(0,Pr.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Pr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:y.name}),(0,Pr.jsx)(X,{className:`text-xs ${bt(y.priority||"medium")}`,children:y.priority?.[0]?.toUpperCase()})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[ue&&(0,Pr.jsx)("div",{className:`w-2 h-2 rounded-full ${ue.color}`}),(0,Pr.jsx)("span",{className:"text-muted-foreground truncate",children:ue?.name})]}),(0,Pr.jsx)("span",{className:"text-muted-foreground",children:Mt(y.assignee?.value?.name)})]}),A&&xe&&(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:xe.name})]})]})})};return(0,Pr.jsxs)("div",{ref:Le,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:te,className:"flex-shrink-0",children:(0,Pr.jsx)(Ze,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>b(!0)}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Pr-8",children:(0,Pr.jsxs)("div",{className:"h-full",style:{height:U>0?`calc(100vh - ${U+120}px)`:"calc(100vh - 12rem)"},children:[(0,Pr.jsxs)("div",{className:"mb-4",children:[(0,Pr.jsx)(B,{className:"Pr-3 bg-card shadow-sm",children:(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Pr.jsxs)("Pr",{className:"text-xs text-muted-foreground",children:[l?.length,"/3 selected"]})]}),l?.length>0&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Pr.jsx)("div",{className:"flex flex-wrap gap-1",children:vt.map(y=>(0,Pr.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Pr.jsx)("span",{className:"max-w-[80px] truncate",children:y.name}),(0,Pr.jsx)("button",{onClick:()=>Ft(y.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded Pr-0.5",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]},y.id))})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(x,{onClick:()=>b(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Pr.jsx)(yt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Pr.jsxs)(x,{onClick:()=>de(!R),variant:"outline",size:"sm",className:"gap-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),R?"Close":"Select"]})]})]})}),R&&(0,Pr.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>de(!1)}),(0,Pr.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${R?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Pr.jsxs)(B,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Pr.jsxs)("div",{className:"Pr-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>de(!1),className:"h-8 w-8 Pr-0",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]}),(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground Pr-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Pr.jsxs)("div",{className:"flex flex-col flex-1 Pr-4 min-h-0",children:[(0,Pr.jsx)("div",{className:"flex gap-1 mb-4 bg-muted Pr-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(y=>(0,Pr.jsxs)(x,{variant:S===y.key?"default":"outline",size:"sm",onClick:()=>ie(y.key),className:"text-xs h-8 px-3 flex-1",children:[y.label," (",y.count,")"]},y.key))}),(0,Pr.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:je.length>0?je.map(y=>{let A=l.includes(y.id.toString()),ue=e.filter(at=>Ue(at.sprint)===y.id).length,xe=!A&&l.length<3;return(0,Pr.jsx)("div",{className:`Pr-3 rounded-lg border transition-all ${A?"bg-primary/10 border-primary/30":xe?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:E===y.id.toString()?(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsx)($,{value:G.name,onChange:at=>k(ot=>({...ot,name:at.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Pr.jsx)(be,{value:G.description,onChange:at=>k(ot=>({...ot,description:at.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsxs)(x,{size:"sm",onClick:()=>he(),className:"flex-1",children:[(0,Pr.jsx)(yt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Pr.jsxs)(x,{size:"sm",variant:"outline",onClick:Dt,className:"flex-1",children:[(0,Pr.jsx)(yt.X,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Pr.jsxs)("div",{children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Pr.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:y.name}),(0,Pr.jsx)(X,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Pr.jsx)("Pr",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:y.description}),(0,Pr.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Pr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.CalendarDays,{className:"h-3 w-3"}),new Date(y.startDate).toLocaleDateString()]}),(0,Pr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.User,{className:"h-3 w-3"}),ue," tasks"]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>Re(y),className:"h-6 w-6 Pr-0",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>i(y.id.toString()),className:"h-6 w-6 Pr-0 text-destructive hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsx)("div",{className:"flex items-center justify-between Pr-2",children:(0,Pr.jsx)(x,{variant:A?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Ft(y.id.toString()),disabled:!A&&l?.length>=3,children:(0,Pr.jsx)("span",{className:"pointer-events-none select-none",children:A?"Deselect":l?.length>=3?"Limit Reached":"Select"})})})]})},y.id)}):(0,Pr.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Pr.jsxs)("Pr",{className:"text-sm",children:['yt sprints found for "',S,'" filter']}),(0,Pr.jsx)(x,{variant:"link",size:"sm",onClick:()=>ie("all"),className:"text-xs",children:"Show all sprints"})]})}),l?.length===0&&(0,Pr.jsx)("div",{className:"Pr-4 Pr-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Pr.jsxs)("div",{className:"text-center",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Pr.jsx)("Pr",{className:"text-xs text-muted-foreground Pr-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Pr.jsx)("div",{className:"lg:col-span-1",children:(0,Pr.jsxs)(B,{className:"Pr-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:z,onDragEnter:()=>ye("backlog"),onDragLeave:De,onDrop:y=>tt(y,"backlog"),style:{height:U>0?`calc(100vh - ${U+200}px)`:"calc(100vh - 16rem)"},children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(X,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[it?.length," tasks"]}),(0,Pr.jsxs)(X,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Ct," pts"]})]})]}),(0,Pr.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 Pr-3 rounded transition-colors ${u==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:y,unassignedTasks:A}=Nt(it);return(0,Pr.jsxs)(Pr.Fragment,{children:[Object.entries(y).map(([ue,xe])=>{let at=ke(ue);if(!at)return null;let ot=n.has(ue);return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht(ue),children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${at.color}`}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:at.name}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",xe?.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:ot?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ot&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:xe.map(pt=>(0,Pr.jsx)(st,{task:pt},pt.id))})]},ue)}),A?.length>0&&(()=>{let ue=n.has("no-epic");return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht("no-epic"),children:[(0,Pr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:"yt Epic"}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",A?.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:ue?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ue&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:A?.map(xe=>(0,Pr.jsx)(st,{task:xe},xe.id))})]})})(),it?.length===0&&(0,Pr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),it?.length>0&&Object.keys(y).length===0&&A.length===0&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),it?.map(ue=>(0,Pr.jsx)(st,{task:ue},ue.id))]})]})})()})]})}),vt.map(y=>{let A=e.filter(xe=>Ue(xe?.sprint)===y.id),ue=A.reduce((xe,at)=>xe+(at?.storyPoints||0),0);return(0,Pr.jsxs)(B,{className:"Pr-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:z,onDragEnter:()=>ye(y.id.toString()),onDragLeave:De,onDrop:xe=>tt(xe,y.id.toString()),style:{height:U>0?`calc(100vh - ${U+200}px)`:"calc(100vh - 16rem)"},children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsx)("div",{children:(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:y.name})}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(X,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[A?.length," tasks"]}),(0,Pr.jsxs)(X,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[ue," pts"]}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>{de(!0),Re(y)},className:"h-6 px-2",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>i(y.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:xe,unassignedTasks:at}=Nt(A);return(0,Pr.jsxs)(Pr.Fragment,{children:[Object.entries(xe).map(([ot,pt])=>{let Ca=ke(ot);if(!Ca)return null;let Ba=n.has(ot);return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht(ot),children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${Ca.color}`}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:Ca.name}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",pt?.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:Ba?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ba&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:pt?.map(La=>(0,Pr.jsx)(st,{task:La},La.id))})]},ot)}),at?.length>0&&(()=>{let ot=n.has("no-epic");return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht("no-epic"),children:[(0,Pr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:"yt Epic"}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",at?.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:ot?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ot&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:at?.map(pt=>(0,Pr.jsx)(st,{task:pt},pt.id))})]})})(),A?.length===0&&(0,Pr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},y.id)})]}),(0,Pr.jsx)(Mi,{isOpen:w,onClose:()=>b(!1),onAddSprint:N})]})})]})};var hn=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),bn=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},er=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[s,r]=t.split(":");o.setHours(parseInt(s),parseInt(r))}return o<a},tr=e=>{let t=new Date;return e.toDateString()===t.toDateString()},xn=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},yn=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[s,r]=(0,Lt.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[c,i]=(0,Lt.useState)(!1),l=n=>{if(n.preventDefault(),!e.find(v=>v?.id.toString()===s.colleagueId.toString())){console.error("yt valid colleague selected"),i(!0);return}i(!1);let f={title:s.title,description:s.description,dueDate:new Date(s.dueDate).toISOString(),dueTime:s.dueTime||void 0,isRecurring:s.isRecurring,assignedColleague:Number(s.colleagueId),project:1,updatedAt:new Date().toISOString()};t(f),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Lt.useEffect)(()=>{s.colleagueId&&i(!1)},[s.colleagueId]);let d=e.filter(Boolean);return(0,Pr.jsx)(gt,{open:a,onOpenChange:o,children:(0,Pr.jsxs)(lt,{className:"max-w-2xl",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Reminder"})}),(0,Pr.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Pr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"title",children:"Title"}),(0,Pr.jsx)($,{id:"title",value:s.title,onChange:n=>r({...s,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(be,{id:"description",value:s.description,onChange:n=>r({...s,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"dueDate",children:"Due Date"}),(0,Pr.jsx)($,{id:"dueDate",type:"date",value:s.dueDate,onChange:n=>r({...s,dueDate:n.target.value}),required:!0})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Pr.jsx)($,{id:"dueTime",type:"time",value:s.dueTime,onChange:n=>r({...s,dueTime:n.target.value})})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{className:`${c?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Pr.jsxs)(Ke,{value:s.colleagueId,onValueChange:n=>{r({...s,colleagueId:n})},required:!0,children:[(0,Pr.jsx)(He,{className:`${c?"text-destructive border-red-500":""}`,children:(0,Pr.jsx)(nt,{className:`${c?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(n=>n?.id.toString()===s.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Pr.jsx)(ze,{children:d.map(n=>(0,Pr.jsx)(pe,{value:n.id.toString(),children:n.name},n.id))})]}),c&&(0,Pr.jsx)("Pr",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"isRecurring",checked:s.isRecurring,onChange:n=>r({...s,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,Pr.jsx)(T,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),s.isRecurring&&(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Pr.jsxs)(Ke,{value:s.recurrencePattern,onValueChange:n=>r({...s,recurrencePattern:n}),children:[(0,Pr.jsx)(He,{children:(0,Pr.jsx)(nt,{})}),(0,Pr.jsxs)(ze,{children:[(0,Pr.jsx)(pe,{value:"daily",children:"Daily"}),(0,Pr.jsx)(pe,{value:"weekly",children:"Weekly"}),(0,Pr.jsx)(pe,{value:"monthly",children:"Monthly"}),(0,Pr.jsx)(pe,{value:"yearly",children:"Yearly"})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Pr.jsx)($,{id:"recurrenceInterval",type:"number",min:"1",value:s.recurrenceInterval,onChange:n=>r({...s,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",children:"Add Reminder"})]})]})]})})},wn=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:s})=>{let[r,c]=(0,Lt.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),i=d=>{d.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),s()},l=t.filter(Boolean);return(0,Pr.jsx)(gt,{open:o,onOpenChange:s,children:(0,Pr.jsxs)(lt,{className:"max-w-2xl",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Edit Reminder"})}),(0,Pr.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Pr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"edit-title",children:"Title"}),(0,Pr.jsx)($,{id:"edit-title",value:r.title,onChange:d=>c({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"edit-description",children:"Description"}),(0,Pr.jsx)(be,{id:"edit-description",value:r.description||"",onChange:d=>c({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Pr.jsx)($,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:d=>c({...r,dueDate:d.target.value}),required:!0})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(T,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Pr.jsx)($,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:d=>c({...r,dueTime:d.target.value})})]})]}),(0,Pr.jsx)("div",{className:"space-y-2",children:(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:d=>c({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Pr.jsx)(T,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Pr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",children:"Save Changes"})]})]})]})})},Nn=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[s,r]=(0,Lt.useState)(!1);if(!e||!e.id)return null;let c=er(new Date(e.dueDate||""),e.dueTime||""),i=tr(new Date(e.dueDate||"")),l=xn(new Date(e.dueDate||"")),d=()=>{a(e.id.toString(),{})},n=()=>i?"Today":l?"Tomorrow":hn(new Date(e.dueDate||""));return(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(wn,{reminder:e,colleagues:t,onUpdateReminder:a,open:s,onClose:()=>r(!1)}),(0,Pr.jsx)(B,{children:(0,Pr.jsx)(se,{className:"Pr-4",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Pr.jsx)("button",{onClick:d,className:"Pr-1 text-primary hover:text-primary/80"}),(0,Pr.jsxs)("div",{className:"flex-1",children:[(0,Pr.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Pr.jsx)("h3",{children:e.title})}),(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Pr.jsx)("div",{className:"flex items-center space-x-1",children:(0,Pr.jsx)(yt.Calendar,{className:"h-4 w-4"})}),e.dueTime&&(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(yt.Clock,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:bn(e.dueTime)})]}),(0,Pr.jsx)("div",{className:"flex items-center space-x-1",children:(0,Pr.jsx)(yt.User,{className:"h-4 w-4"})})]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 Pr-0",children:(0,Pr.jsx)(yt.Edit2,{className:"h-4 w-4"})}),(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 Pr-0 text-destructive hover:text-destructive/80",children:(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Fi=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:s})=>{let[r,c]=(0,Lt.useState)(e.filter(Boolean)),[i]=(0,Lt.useState)(t.filter(Boolean)),[l,d]=(0,Lt.useState)("all"),[n,m]=(0,Lt.useState)(""),[f,v]=(0,Lt.useState)(!1),w=k=>{if(!k.title){console.error("Invalid reminder data:",k);return}let q={...k,id:Date.now(),createdAt:new Date().toISOString()};c(ve=>[...ve,q]),a?.(k)},b=(k,q)=>{if(!k){console.error("yt reminder ID provided for update");return}c(ve=>ve.map(S=>S?.id.toString()===k?{...S,...q}:S)),o?.(k,q)},u=k=>{if(!k){console.error("yt reminder ID provided for deletion");return}c(q=>q.filter(ve=>ve?.id.toString()!==k)),s?.(k)},E=r.filter(k=>{if(!k)return!1;if(n){let q=n.toLowerCase();if(!(k.title.toLowerCase().includes(q)||k.description?.toLowerCase().includes(q)))return!1}switch(l){case"pending":case"completed":case"overdue":return er(new Date(k.dueDate||""),k.dueTime||"");case"today":return tr(new Date(k.dueDate||""));default:return!0}}).sort((k,q)=>{if(!k||!q)return 0;let ve={high:3,medium:2,low:1},S=0;return S!==0?S:new Date(k.dueDate||"").getTime()-new Date(q.dueDate||"").getTime()}),_={total:r.filter(Boolean).length,overdue:r.filter(k=>k&&er(new Date(k.dueDate||""),k.dueTime||"")).length,today:r.filter(k=>k&&tr(new Date(k.dueDate||""))).length},G=i.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(Ze,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{v(!0)}}}),(0,Pr.jsxs)("div",{className:"h-full bg-background",children:[(0,Pr.jsx)(yn,{colleagues:i,onAddReminder:w,open:f,setOpen:v}),(0,Pr.jsxs)("div",{className:"Pr-6",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Pr.jsxs)(x,{className:"flex items-center space-x-2",onClick:()=>v(!0),children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Add Reminder"})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Pr.jsxs)(B,{className:"Pr-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:_.total}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Pr.jsxs)(B,{className:"Pr-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-primary",children:_.overdue}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Pr.jsxs)(B,{className:"Pr-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-success",children:_.today}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Pr.jsxs)(B,{className:"Pr-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:_.overdue}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Pr.jsxs)(B,{className:"Pr-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-warning",children:_.today}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsx)($,{placeholder:"Search reminders...",value:n,onChange:k=>m(k.target.value),className:"max-w-md"})}),(0,Pr.jsxs)(Ke,{value:l,onValueChange:k=>d(k),children:[(0,Pr.jsx)(He,{className:"w-40",children:(0,Pr.jsx)(nt,{})}),(0,Pr.jsxs)(ze,{children:[(0,Pr.jsxs)(pe,{value:"all",children:["All (",_.total,")"]}),(0,Pr.jsxs)(pe,{value:"overdue",children:["Overdue (",_.overdue,")"]}),(0,Pr.jsxs)(pe,{value:"overdue",children:["Overdue (",_.overdue,")"]}),(0,Pr.jsxs)(pe,{value:"today",children:["Today (",_.today,")"]})]})]})]}),(0,Pr.jsx)("div",{className:"space-y-4",children:E.length===0?(0,Pr.jsxs)(B,{className:"Pr-8 text-center",children:[(0,Pr.jsx)("div",{className:"text-muted-foreground",children:n||l!=="all"?"yt reminders match your filters":"yt reminders yet"}),!n&&l==="all"&&(0,Pr.jsx)("Pr",{className:"text-sm text-muted-foreground/60 Pr-2",children:"Create your first reminder to get started"})]}):E.map(k=>k&&(0,Pr.jsx)(Nn,{reminder:k,colleagues:i,onUpdateReminder:b,onDeleteReminder:u},k.id))})]})]})]})};var Bi=require("next/navigation");function ar({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:s=[],initialReminders:r=[],initialColleagues:c=[],initialUsers:i=[],initialFiles:l=[],initialView:d="kanban",onAddTask:n,onUpdateTask:m,onDeleteTask:f,onTaskClick:v,onAddEpic:w,onUpdateEpic:b,onDeleteEpic:u,onAddTaskToEpic:h,onAddSprint:E,onUpdateSprint:_,onDeleteSprint:G,onAddProject:k,onUpdateProject:q,onDeleteProject:ve,onFileAdd:S,onFileEdit:ie,onFileDelete:R,onFileClick:de,onAddReminder:U,onUpdateReminder:F,onDeleteReminder:te,onViewChange:Le,onToggleMobileMenu:ke,onTeamClick:Ce,onTeamChange:bt,onCopilotClick:Mt,handleAddComment:Nt}){let[je,vt]=(0,Lt.useState)(t),[it,Ct]=(0,Lt.useState)(a),[Ft,ht]=(0,Lt.useState)(o),[N,Re]=(0,Lt.useState)(s),[he,Dt]=(0,Lt.useState)(r),[Vt,z]=(0,Lt.useState)(c),[ye,De]=(0,Lt.useState)(i),[tt,st]=(0,Lt.useState)(l),[y,A]=(0,Lt.useState)(!1),[ue,xe]=(0,Lt.useState)(!1),[at,ot]=(0,Lt.useState)(null),[pt,Ca]=(0,Lt.useState)(null),[Ba,La]=(0,Lt.useState)(null),[la,mr]=(0,Lt.useState)(d||"kanban"),[Dn,_i]=(0,Lt.useState)(!1),qi=(0,Bi.useRouter)();(0,Lt.useEffect)(()=>{vt(t)},[t]),(0,Lt.useEffect)(()=>{ht(o)},[o]),(0,Lt.useEffect)(()=>{Ct(a)},[a]),(0,Lt.useEffect)(()=>{Re(s)},[s]),(0,Lt.useEffect)(()=>{st(l)},[l]),(0,Lt.useEffect)(()=>{De(i)},[i]),(0,Lt.useEffect)(()=>{z(c)},[c]),(0,Lt.useEffect)(()=>{Dt(r)},[r]),(0,Lt.useEffect)(()=>{mr(d)},[d]);let Xi=je.filter(D=>{}),kn=D=>Xi.filter(K=>K.status===D),Sn=D=>{let K={};return it.forEach(ae=>{}),K},Tn=D=>{La(D)},Pn=D=>{Ba&&(vt(K=>K.map(ae=>ae.id===Ba.id?{...ae,status:D}:ae)),La(null))},pr=D=>{let K={...D,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};vt(ae=>[...ae,K]),n?.(K)},oo=async(D,K)=>(vt(ae=>ae.map(qe=>qe.id===Number(D)?{...qe,...K}:qe)),await m?.(D,K)),Rn=async(D,K)=>{oo(D,K)},ur=D=>{vt(K=>K.filter(ae=>ae.id!==Number(D))),at?.id===Number(D)&&ot(null),f?.(D)},An=async D=>{ur(D)},En=D=>{let K={...D,id:Date.now()};Re(ae=>[...ae,K]),k?.(D)},In=(D,K)=>{Re(ae=>ae.map(qe=>qe.id===Number(D)?{...qe,...K}:qe)),q?.(D,K)},Mn=D=>{Re(K=>K.filter(ae=>ae.id!==Number(D))),ve?.(D)},gr=D=>{let K={...D,id:Date.now()};Ct(ae=>[...ae,K]),w?.({...K})},Ji=()=>{xe(!0)},Zi=(D,K)=>{Ct(ae=>ae.map(qe=>qe.id===Number(D)?{...qe,...K}:qe)),b?.(D,K)},Yi=D=>{Ct(K=>K.filter(ae=>ae.id!==Number(D))),vt(K=>K.filter(ae=>Ue(ae.epic)!==Number(D))),u?.(D)},Qi=D=>{let K={...D,id:Date.now()};ht(ae=>[...ae,K]),E?.(D)},es=(D,K)=>{ht(ae=>ae.map(qe=>qe.id===Number(D)?{...qe,...K}:qe)),_?.(D,K)},ts=D=>{D==="backlog"||D==="all-tasks"||(ht(K=>K.filter(ae=>ae.id!==Number(D))),vt(K=>K.map(ae=>Ue(ae.sprint)===Number(D)?{...ae,sprint:void 0}:ae)),G?.(D))},Io=D=>{ot(D)},as=D=>{D==="planning"&&window.innerWidth<768||(mr(D),Le?.(D))},Fn=()=>{_i(D=>!D),ke?.()},Bn=()=>{qi.push("/")},Ln=D=>{console.log("Switching to team:",D)},jn=D=>{console.log("Switching to team:",D)},os=D=>{Ca(D),A(!0)},rs=()=>{A(!1),Ca(null)},is=D=>{let K={...D,id:Date.now(),createdAt:new Date().toISOString()};Dt(ae=>[...ae,K]),U?.(D)},ss=(D,K)=>{Dt(ae=>ae.map(qe=>qe.id===Number(D)?{...qe,...K}:qe)),F?.(D,K)},ns=D=>{Dt(K=>K.filter(ae=>ae.id!==Number(D))),te?.(D)},ls=()=>{S?.()},ds=D=>{ie?.(D)},cs=D=>{st(K=>K.filter(ae=>ae.name!==D)),R?.(D)},ms=D=>{de?.(D)},On=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Hn=()=>{switch(la){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},Mo=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],zn=Mo.sort((D,K)=>K.lastUsed.getTime()-D.lastUsed.getTime()).slice(0,3),Vn=Mo.length>3,Un=Mo.slice(3);return(0,Pr.jsxs)(mi,{currentView:la,onViewChange:as,children:[la==="kanban"&&(0,Pr.jsx)("div",{className:"h-full overflow-hidden",children:(0,Pr.jsx)(Ti,{initialProjects:N,initialEpics:it,initialSprints:Ft.map(D=>({...D,isSelected:!1})),initialTasks:je,initialColleagues:Vt,initialUsers:ye,onAddTask:pr,onUpdateTask:oo,onDeleteTask:ur,onTaskClick:Io,onAddEpic:gr,onAddComment:Nt})}),la==="planning"&&(0,Pr.jsx)("div",{className:"hidden md:block h-full",children:(0,Pr.jsx)(To,{tasks:je,epics:it,sprints:Ft,onUpdateTask:oo,onTaskClick:Io,onAddSprint:Qi,onUpdateSprint:es,onDeleteSprint:ts})}),la==="tasks"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)(Fi,{initialReminders:he,initialColleagues:Vt,onAddReminder:is,onUpdateReminder:ss,onDeleteReminder:ns})}),la==="files"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)(_a,{initialFiles:tt,onFileAdd:ls,onFileEdit:ds,onFileDelete:cs,onFileClick:ms,compactView:!1})}),la==="epics"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)(Pi,{tasks:je,epics:it,sprints:Ft,onUpdateTask:oo,onTaskClick:Io,onAddTaskToEpic:os,onAddEpic:Ji,onUpdateEpic:Zi,onDeleteEpic:Yi})}),(0,Pr.jsx)(wo,{isOpen:y,onClose:rs,onAddTask:pr,epics:it,sprints:Ft,assignees:[...Vt,...ye],defaultEpicId:pt||void 0}),(0,Pr.jsx)(Do,{isOpen:ue,onClose:()=>xe(!1),onAddEpic:gr})]})}var Li=we(require("react")),Qa=we(require("@radix-yt/react-progress"));var rr=Li.forwardRef(({className:e,value:t,...a},o)=>(0,Pr.jsx)(Qa.Root,{ref:o,className:C("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Pr.jsx)(Qa.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));rr.displayName=Qa.Root.displayName;function Oi({project:e,onOpen:t,onShare:a,className:o}){return(0,Pr.jsx)(jo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Pr.jsxs)(B,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)(Fe,{children:e.name}),(0,Pr.jsxs)(X,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Pr.jsx)(Ha,{children:e.description})]}),(0,Pr.jsxs)(se,{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsx)("span",{children:"Progress"}),(0,Pr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Pr.jsx)(rr,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center",children:[(0,Pr.jsx)(yt.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,Pr.jsxs)("div",{className:"flex items-center",children:[(0,Pr.jsx)(yt.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Pr.jsxs)(za,{className:"flex gap-2",children:[(0,Pr.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Pr.jsx)(x,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Pr.jsx)(yt.Share2,{className:"h-4 w-4"})})]})]})})}var eo=we(require("@radix-yt/react-checkbox")),zi=we(require("react")),ir=zi.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(eo.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,Pr.jsx)(eo.Indicator,{className:C("flex items-center justify-center text-current"),children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})})}));ir.displayName=eo.Root.displayName;var Vi=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:s=""})=>{let[r,c]=(0,Lt.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[i,l]=(0,Lt.useState)({}),d=()=>{let f={};return r.name.trim()?r.name.trim().length<3&&(f.name="Project name must be at least 3 characters"):f.name="Project name is required",r.objectives.trim()?r.objectives.trim().length<10&&(f.objectives="Please provide more detailed objectives (at least 10 characters)"):f.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(f.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):f.workInstructions="Work instructions are required",l(f),Object.keys(f).length===0},n=async f=>{if(f.preventDefault(),!!d())try{await e(r)}catch(v){console.error("Error submitting project form:",v)}},m=(f,v)=>{c(w=>({...w,[f]:v})),i[f]&&l(w=>({...w,[f]:void 0}))};return(0,Pr.jsxs)("div",{className:`w-full max-w-2xl ${s}`,children:[(0,Pr.jsxs)("div",{className:"mb-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Pr.jsx)("Pr",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,Pr.jsxs)("form",{onSubmit:n,children:[(0,Pr.jsxs)("div",{className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Pr.jsx)($,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:f=>m("name",f.target.value),className:i.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),i.name&&(0,Pr.jsx)("Pr",{className:"text-sm text-red-600",children:i.name})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Pr.jsx)($,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:f=>m("description",f.target.value),className:i.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),i.description&&(0,Pr.jsx)("Pr",{className:"text-sm text-red-600",children:i.description})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Pr.jsx)(be,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:f=>m("objectives",f.target.value),className:`min-h-[100px] resize-y ${i.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Pr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Pr.jsx)("span",{children:i.objectives&&(0,Pr.jsx)("span",{className:"text-red-600",children:i.objectives})}),(0,Pr.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Pr.jsx)(be,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:f=>m("workInstructions",f.target.value),className:`min-h-[120px] resize-y ${i.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Pr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Pr.jsx)("span",{children:i.workInstructions&&(0,Pr.jsx)("span",{className:"text-red-600",children:i.workInstructions})}),(0,Pr.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsx)(T,{className:"text-sm font-medium",children:"Project Management"}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(ir,{id:"plan",checked:r.plan,onCheckedChange:f=>m("plan",f===!0),disabled:a}),(0,Pr.jsx)(T,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Pr.jsx)("Pr",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Pr.jsxs)(x,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Pr.jsx)(x,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(yt.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function lr({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[s,r]=(0,Lt.useState)(!1),[c,i]=(0,Lt.useState)(!1),l=async n=>{i(!0);try{await t(n),r(!1)}catch(m){console.error("Error creating project:",m)}finally{i(!1)}},d=()=>{r(!0)};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(jo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsx)(Ze,{title:"Project Management",description:"Organize your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:d}}),(0,Pr.jsxs)("section",{className:"space-y-4 Pr-8",children:[(0,Pr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Pr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,Pr.jsx)(Oi,{project:n,onOpen:a,onShare:o},n.id))})]})]},"projects-index-view")}),(0,Pr.jsx)(gt,{open:s,onOpenChange:r,children:(0,Pr.jsxs)(lt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Pr.jsxs)(dt,{className:"Lt-only",children:[(0,Pr.jsx)(ct,{children:"Create New Project"}),(0,Pr.jsx)(Za,{children:"Fill out the form below to create a new project."})]}),(0,Pr.jsx)(Vi,{onSubmit:l,onCancel:()=>r(!1),isLoading:c,className:"border-0 shadow-none"})]})})]})}function Ki({team:e,onOpen:t,className:a}){return(0,Pr.jsx)(jo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Pr.jsxs)(B,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(Fe,{className:"text-lg",children:e.name}),(0,Pr.jsx)(Ha,{className:"Pr-1 text-sm",children:e.description})]}),(0,Pr.jsxs)(se,{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-blue-500"}),(0,Pr.jsx)("span",{children:"Human"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Pr.jsx)("span",{children:"Digital"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Pr.jsx)("span",{children:"Projects"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Pr.jsx)(za,{className:"flex gap-2",children:(0,Pr.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}var $i=we(require("react")),to=we(require("@radix-yt/react-switch"));var Fa=$i.forwardRef(({className:e,...t},a)=>(0,Pr.jsx)(to.Root,{className:C("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,Pr.jsx)(to.Thumb,{className:C("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Fa.displayName=to.Root.displayName;function Gi({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:s,submitLabel:r,cancelLabel:c="Cancel",readOnly:i=!1}){let[l,d]=(0,Lt.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[n,m]=(0,Lt.useState)(!i);(0,Lt.useEffect)(()=>{e&&d(e)},[e]);let f=u=>{u.preventDefault();let h={id:l.id||Date.now(),name:l.name,description:l.description||null,systemMsg:l.systemMsg||null,useProjects:l.useProjects||!1,useKnowledge:l.useKnowledge||!1,useFiles:l.useFiles||!1,useChat:l.useChat||!1,updatedAt:new Date().toISOString(),createdAt:l.createdAt||new Date().toISOString()};t(h)},v=u=>{u.preventDefault(),m(!n)},w=s||(n?e?"Edit Team":"Create New Team":"View Team"),b=r||(e?"Update Team":"Create Team");return(0,Pr.jsxs)(B,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Pr.jsx)(Ee,{children:(0,Pr.jsxs)(Fe,{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Users,{className:"h-5 w-5"}),w]})}),(0,Pr.jsx)(se,{children:(0,Pr.jsxs)("form",{onSubmit:f,className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"name",children:"Team Name *"}),(0,Pr.jsx)($,{id:"name",value:l.name||"",onChange:u=>d({...l,name:u.target.value}),required:!0,disabled:o||!n,placeholder:"Enter team name..."})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(be,{id:"description",value:l.description||"",onChange:u=>d({...l,description:u.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!n})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(T,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Pr.jsx)(be,{id:"systemMsg",value:l.systemMsg||"",onChange:u=>d({...l,systemMsg:u.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:o||!n})]})]}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Fa,{id:"useProjects",checked:l.useProjects||!1,onCheckedChange:u=>d({...l,useProjects:u}),disabled:o||!n}),(0,Pr.jsx)(T,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Fa,{id:"useKnowledge",checked:l.useKnowledge||!1,onCheckedChange:u=>d({...l,useKnowledge:u}),disabled:o||!n}),(0,Pr.jsx)(T,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Fa,{id:"useFiles",checked:l.useFiles||!1,onCheckedChange:u=>d({...l,useFiles:u}),disabled:o||!n}),(0,Pr.jsx)(T,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Fa,{id:"useChat",checked:l.useChat||!1,onCheckedChange:u=>d({...l,useChat:u}),disabled:o||!n}),(0,Pr.jsx)(T,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:a,disabled:o,children:n?c:"Close"}),n?(0,Pr.jsx)(x,{type:"submit",disabled:o||!l.name?.trim(),children:o?"Saving...":b}):(0,Pr.jsxs)(x,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function cr({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,s]=(0,Lt.useState)(!1),r=()=>{s(!0)},c=d=>{t?.(d),s(!1)},i=()=>{s(!1)},l=d=>{a?.(d)};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(jo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(jo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsx)(Ze,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-to-r from-blue-600 via-cyan-600 to-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,Pr.jsxs)("section",{className:"space-y-4 Pr-8",children:[(0,Pr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Pr.jsxs)("div",{className:"text-center py-12",children:[(0,Pr.jsx)("Pr",{className:"text-muted-foreground text-lg",children:"You'Pr not part of any teams yet."}),(0,Pr.jsx)("Pr",{className:"text-muted-foreground text-sm Pr-2",children:"Create a new team Pr ask to be added to an existing one."})]}):(0,Pr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Pr.jsx)(Ki,{team:d,onOpen:l},d.id))})]})]},"teams-index-view")}),(0,Pr.jsx)(gt,{open:o,onOpenChange:s,children:(0,Pr.jsxs)(lt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto Pr-0",children:[(0,Pr.jsx)("div",{className:"Lt-only",children:(0,Pr.jsxs)(dt,{children:[(0,Pr.jsx)(ct,{children:"Create New Team"}),(0,Pr.jsx)(Za,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,Pr.jsx)(Gi,{title:"Create New Team",submitLabel:"Create Team",onSave:c,onCancel:i})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,PlanningView,ProjectView,ProjectsIndexView,TeamsIndexView});
5
+ "use strict";var fs=Object.create;var lo=Object.defineProperty;var vs=Object.getOwnPropertyDescriptor;var hs=Object.getOwnPropertyNames;var bs=Object.getPrototypeOf,xs=Object.prototype.hasOwnProperty;var ys=(e,t)=>{for(var o in t)lo(e,o,{get:t[o],enumerable:!0})},hr=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of hs(t))!xs.call(e,s)&&s!==o&&lo(e,s,{get:()=>t[s],enumerable:!(a=vs(t,s))||a.enumerable});return e};var ke=(e,t,o)=>(o=e!=null?fs(bs(e)):{},hr(t||!e||!e.__esModule?lo(o,"default",{value:e,enumerable:!0}):o,e)),ws=e=>hr(lo({},"__esModule",{value:!0}),e);var Tn={};ys(Tn,{ColleaguesView:()=>$o,FileView:()=>eo,KnowledgeView:()=>Go,PlanningView:()=>Ro,ProjectView:()=>rr,ProjectsIndexView:()=>cr,TeamsIndexView:()=>pr});module.exports=ws(Tn);var Ot=require("react"),kt=require("lucide-react");var Sr=require("clsx");var Oo="-",Ns=e=>{let t=ks(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let i=c.split(Oo);return i[0]===""&&i.length!==1&&i.shift(),yr(i,t)||Cs(c)},getConflictingClassGroupIds:(c,i)=>{let l=o[c]||[];return i&&a[c]?[...l,...a[c]]:l}}},yr=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),s=a?yr(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let r=e.join(Oo);return t.validators.find(({validator:c})=>c(r))?.classGroupId},br=/^\[(.+)\]$/,Cs=e=>{if(br.test(e)){let t=br.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},ks=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Ss(Object.entries(e.classGroups),o).forEach(([r,c])=>{jo(c,a,r,t)}),a},jo=(e,t,o,a)=>{e.forEach(s=>{if(typeof s=="string"){let r=s===""?t:xr(t,s);r.classGroupId=o;return}if(typeof s=="function"){if(Ds(s)){jo(s(a),t,o,a);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([r,c])=>{jo(c,xr(t,r),o,a)})})},xr=(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},Ds=e=>e.isThemeGetter,Ss=(e,t)=>t?e.map(([o,a])=>{let s=a.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([c,i])=>[t+c,i])):r);return[o,s]}):e,Ts=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,s=(r,c)=>{o.set(r,c),t++,t>e&&(t=0,a=o,o=new Map)};return{get(r){let c=o.get(r);if(c!==void 0)return c;if((c=a.get(r))!==void 0)return s(r,c),c},set(r,c){o.has(r)?o.set(r,c):s(r,c)}}},wr="!",Ps=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,s=t[0],r=t.length,c=i=>{let l=[],d=0,n=0,p;for(let u=0;u<i.length;u++){let b=i[u];if(d===0){if(b===s&&(a||i.slice(u,u+r)===t)){l.push(i.slice(n,u)),n=u+r;continue}if(b==="/"){p=u;continue}}b==="["?d++:b==="]"&&d--}let f=l.length===0?i:i.substring(n),h=f.startsWith(wr),x=h?f.substring(1):f,v=p&&p>n?p-n:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:v}};return o?i=>o({className:i,parseClassName:c}):c},Rs=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},As=e=>({cache:Ts(e.cacheSize),parseClassName:Ps(e),...Ns(e)}),Es=/\s+/,Is=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s}=t,r=[],c=e.trim().split(Es),i="";for(let l=c.length-1;l>=0;l-=1){let d=c[l],{modifiers:n,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:h}=o(d),x=!!h,v=a(x?f.substring(0,h):f);if(!v){if(!x){i=d+(i.length>0?" "+i:i);continue}if(v=a(f),!v){i=d+(i.length>0?" "+i:i);continue}x=!1}let u=Rs(n).join(":"),b=p?u+wr:u,A=b+v;if(r.includes(A))continue;r.push(A);let Y=s(v,x);for(let W=0;W<Y.length;++W){let D=Y[W];r.push(b+D)}i=d+(i.length>0?" "+i:i)}return i};function Ms(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Nr(t))&&(a&&(a+=" "),a+=o);return a}var Nr=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Nr(e[a]))&&(o&&(o+=" "),o+=t);return o};function Fs(e,...t){let o,a,s,r=c;function c(l){let d=t.reduce((n,p)=>p(n),e());return o=As(d),a=o.cache.get,s=o.cache.set,r=i,i(l)}function i(l){let d=a(l);if(d)return d;let n=Is(l,o);return s(l,n),n}return function(){return r(Ms.apply(null,arguments))}}var Ae=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Cr=/^\[(?:([a-z-]+):)?(.+)\]$/i,Bs=/^\d+\/\d+$/,Ls=new Set(["px","full","screen"]),js=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Os=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,zs=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kt=e=>ka(e)||Ls.has(e)||Bs.test(e),ea=e=>Da(e,"length",Xs),ka=e=>!!e&&!Number.isNaN(Number(e)),Lo=e=>Da(e,"number",ka),za=e=>!!e&&Number.isInteger(Number(e)),Us=e=>e.endsWith("%")&&ka(e.slice(0,-1)),oe=e=>Cr.test(e),ta=e=>js.test(e),Ks=new Set(["length","size","percentage"]),$s=e=>Da(e,Ks,kr),Gs=e=>Da(e,"position",kr),Ws=new Set(["image","url"]),_s=e=>Da(e,Ws,Zs),qs=e=>Da(e,"",Js),Va=()=>!0,Da=(e,t,o)=>{let a=Cr.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Xs=e=>Os.test(e)&&!Hs.test(e),kr=()=>!1,Js=e=>zs.test(e),Zs=e=>Vs.test(e);var Ys=()=>{let e=Ae("colors"),t=Ae("spacing"),o=Ae("blur"),a=Ae("brightness"),s=Ae("borderColor"),r=Ae("borderRadius"),c=Ae("borderSpacing"),i=Ae("borderWidth"),l=Ae("contrast"),d=Ae("grayscale"),n=Ae("hueRotate"),p=Ae("invert"),f=Ae("gap"),h=Ae("gradientColorStops"),x=Ae("gradientColorStopPositions"),v=Ae("inset"),u=Ae("margin"),b=Ae("opacity"),A=Ae("padding"),Y=Ae("saturate"),W=Ae("scale"),D=Ae("sepia"),_=Ae("skew"),me=Ae("space"),I=Ae("translate"),z=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",oe,t],K=()=>[oe,t],yt=()=>["",Kt,ea],xe=()=>["auto",ka,oe],at=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ie=()=>["solid","dashed","dotted","double","none"],Lt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Nt=()=>["start","end","center","between","around","evenly","stretch"],St=()=>["","0",oe],wt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[ka,oe];return{cacheSize:500,separator:":",theme:{colors:[Va],spacing:[Kt,ea],blur:["none","",ta,oe],brightness:P(),borderColor:[e],borderRadius:["none","","full",ta,oe],borderSpacing:K(),borderWidth:yt(),contrast:P(),grayscale:St(),hueRotate:P(),invert:St(),gap:K(),gradientColorStops:[e],gradientColorStopPositions:[Us,ea],inset:ie(),margin:ie(),opacity:P(),padding:K(),saturate:P(),scale:P(),sepia:St(),skew:P(),space:K(),translate:K()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[ta]}],"break-after":[{"break-after":wt()}],"break-before":[{"break-before":wt()}],"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:[...at(),oe]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",za,oe]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:St()}],shrink:[{shrink:St()}],order:[{order:["first","last","none",za,oe]}],"grid-cols":[{"grid-cols":[Va]}],"col-start-end":[{col:["auto",{span:["full",za,oe]},oe]}],"col-start":[{"col-start":xe()}],"col-end":[{"col-end":xe()}],"grid-rows":[{"grid-rows":[Va]}],"row-start-end":[{row:["auto",{span:[za,oe]},oe]}],"row-start":[{"row-start":xe()}],"row-end":[{"row-end":xe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...Nt()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Nt(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Nt(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],Ar:[{Ar:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],Ar:[{Ar:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[me]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[me]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[ta]},ta]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ta,ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Lo]}],"font-family":[{font:[Va]}],"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",oe]}],"line-clamp":[{"line-clamp":["none",ka,Lo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kt,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ie(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kt,ea]}],"underline-offset":[{"underline-offset":["auto",Kt,oe]}],"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:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],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",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...at(),Gs]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$s]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_s]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-Ar":[{"rounded-Ar":[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-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...Ie(),"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":[b]}],"divide-style":[{divide:Ie()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Ie()]}],"outline-offset":[{"outline-offset":[Kt,oe]}],"outline-w":[{outline:[Kt,ea]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:yt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Kt,ea]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ta,qs]}],"shadow-color":[{shadow:[Va]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Lt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Lt()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ta,oe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[n]}],invert:[{invert:[p]}],saturate:[{saturate:[Y]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[n]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[Y]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[W]}],"scale-x":[{"scale-x":[W]}],"scale-y":[{"scale-y":[W]}],rotate:[{rotate:[za,oe]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],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","Ar-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-Ar":[{"scroll-Ar":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-Ar":[{"scroll-Ar":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"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",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Kt,ea,Lo]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],Ar:["mx","my","ms","me","mt","Ar","mb","ml"],mx:["Ar","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-b","rounded-l","rounded-ss","rounded-se","rounded-Ar","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-Ar"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-Ar":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-Ar","scroll-mb","scroll-ml"],"scroll-mx":["scroll-Ar","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Dr=Fs(Ys);function C(...e){return Dr((0,Sr.clsx)(e))}var Tr=require("@radix-ui/react-slot"),Pr=require("class-variance-authority"),Rr=ke(require("react")),Ar=require("react/jsx-runtime"),co=(0,Pr.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"}}}),y=Rr.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...s},r)=>(0,Ar.jsx)(e?Tr.Slot:"button",{className:C(co({className:t,size:o,variant:a})),ref:r,...s}));y.displayName="Button";var ma=ke(require("react"));var B=ma.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)("div",{ref:o,className:C("rounded-xl border bg-card text-card-foreground shadow",e),...t}));B.displayName="Card";var Ee=ma.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)("div",{ref:o,className:C("flex flex-col space-y-1.5 p-6",e),...t}));Ee.displayName="CardHeader";var je=ma.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)("div",{ref:o,className:C("font-semibold leading-none tracking-tight",e),...t}));je.displayName="CardTitle";var Ua=ma.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)("div",{ref:o,className:C("text-sm text-muted-foreground",e),...t}));Ua.displayName="CardDescription";var se=ma.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)("div",{ref:o,className:C("p-6 pt-0",e),...t}));se.displayName="CardContent";var Ka=ma.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)("div",{ref:o,className:C("flex items-center p-6 pt-0",e),...t}));Ka.displayName="CardFooter";var Er=ke(require("react"));var G=Er.forwardRef(({className:e,type:t,...o},a)=>(0,Ar.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}));G.displayName="Input";var de=ke(require("@radix-ui/react-select")),aa=ke(require("react")),$e=de.Root;var gt=de.Value,ze=aa.forwardRef(({children:e,className:t,...o},a)=>(0,Ar.jsxs)(de.Trigger,{className:C("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...o,children:[e,(0,Ar.jsx)(de.Icon,{asChild:!0,children:(0,Ar.jsx)(kt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ze.displayName=de.Trigger.displayName;var Mr=aa.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(de.ScrollUpButton,{className:C("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Ar.jsx)(kt.ChevronUp,{className:"h-4 w-4"})}));Mr.displayName=de.ScrollUpButton.displayName;var Fr=aa.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(de.ScrollDownButton,{className:C("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Ar.jsx)(kt.ChevronDown,{className:"h-4 w-4"})}));Fr.displayName=de.ScrollDownButton.displayName;var Ve=aa.forwardRef(({children:e,className:t,position:o="popper",...a},s)=>(0,Ar.jsx)(de.Portal,{children:(0,Ar.jsxs)(de.Content,{className:C("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card 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",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:s,...a,children:[(0,Ar.jsx)(Mr,{}),(0,Ar.jsx)(de.Viewport,{className:C("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Ar.jsx)(Fr,{})]})}));Ve.displayName=de.Content.displayName;var Qs=aa.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(de.Label,{className:C("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Qs.displayName=de.Label.displayName;var ue=aa.forwardRef(({children:e,className:t,...o},a)=>(0,Ar.jsxs)(de.Item,{className:C("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...o,children:[(0,Ar.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Ar.jsx)(de.ItemIndicator,{children:(0,Ar.jsx)(kt.Check,{className:"h-4 w-4"})})}),(0,Ar.jsx)(de.ItemText,{children:e})]}));ue.displayName=de.Item.displayName;var en=aa.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(de.Separator,{className:C("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));en.displayName=de.Separator.displayName;var Ho=require("motion/react");var ga=ke(require("@radix-ui/react-tabs"));function Br({className:e,...t}){return(0,Ar.jsx)(ga.Root,{"data-slot":"tabs",className:C("flex flex-col gap-2",e),...t})}function Lr({className:e,...t}){return(0,Ar.jsx)(ga.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 jr({className:e,...t}){return(0,Ar.jsx)(ga.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 $t=ke(require("react")),ce=ke(require("@radix-ui/react-dropdown-menu")),Sa=require("@radix-ui/react-icons");var po=ce.Root,uo=ce.Trigger;var tn=$t.forwardRef(({className:e,inset:t,children:o,...a},s)=>(0,Ar.jsxs)(ce.SubTrigger,{ref:s,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,Ar.jsx)(Sa.ChevronRightIcon,{className:"ml-auto"})]}));tn.displayName=ce.SubTrigger.displayName;var an=$t.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(ce.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}));an.displayName=ce.SubContent.displayName;var $a=$t.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Ar.jsx)(ce.Portal,{children:(0,Ar.jsx)(ce.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})}));$a.displayName=ce.Content.displayName;var fa=$t.forwardRef(({className:e,inset:t,...o},a)=>(0,Ar.jsx)(ce.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}));fa.displayName=ce.Item.displayName;var on=$t.forwardRef(({className:e,children:t,checked:o,...a},s)=>(0,Ar.jsxs)(ce.CheckboxItem,{ref:s,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,Ar.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Ar.jsx)(ce.ItemIndicator,{children:(0,Ar.jsx)(Sa.CheckIcon,{className:"h-4 w-4"})})}),t]}));on.displayName=ce.CheckboxItem.displayName;var rn=$t.forwardRef(({className:e,children:t,...o},a)=>(0,Ar.jsxs)(ce.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,Ar.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Ar.jsx)(ce.ItemIndicator,{children:(0,Ar.jsx)(Sa.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));rn.displayName=ce.RadioItem.displayName;var sn=$t.forwardRef(({className:e,inset:t,...o},a)=>(0,Ar.jsx)(ce.Label,{ref:a,className:C("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));sn.displayName=ce.Label.displayName;var nn=$t.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(ce.Separator,{ref:o,className:C("-mx-1 my-1 h-px bg-muted",e),...t}));nn.displayName=ce.Separator.displayName;var ln=({className:e,...t})=>(0,Ar.jsx)("span",{className:C("ml-auto text-xs tracking-widest opacity-60",e),...t});ln.displayName="DropdownMenuShortcut";function go({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:s="700px",gridCols:r=6}){let c=o.find(i=>i.value===e);return(0,Ar.jsxs)(Ho.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,Ar.jsx)("div",{className:"hidden lg:block",children:(0,Ar.jsx)(Br,{value:e,onValueChange:t,children:(0,Ar.jsx)(Lr,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(r,o.length)}, minmax(0, 1fr))`},children:o.map(i=>(0,Ar.jsx)(Ho.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Ar.jsx)(jr,{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,Ar.jsx)("div",{className:"lg:hidden",children:(0,Ar.jsxs)(po,{children:[(0,Ar.jsx)(uo,{asChild:!0,children:(0,Ar.jsxs)(y,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,Ar.jsx)(kt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Ar.jsx)($a,{align:"center",className:"w-[180px]",children:o.map(i=>(0,Ar.jsx)(fa,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}var fo=ke(require("react")),Gt=ke(require("@radix-ui/react-avatar"));var Wt=fo.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(Gt.Root,{ref:o,className:C("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Wt.displayName=Gt.Root.displayName;var Ga=fo.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(Gt.Image,{ref:o,className:C("aspect-square h-full w-full",e),...t}));Ga.displayName=Gt.Image.displayName;var _t=fo.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(Gt.Fallback,{ref:o,className:C("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));_t.displayName=Gt.Fallback.displayName;var dn=(0,Pr.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 X({className:e,variant:t,...o}){return(0,Ar.jsx)("div",{className:C(dn({variant:t}),e),...o})}function ho({colleague:e,onEdit:t,onDelete:o,onViewDetails:a,showActions:s=!0,compact:r=!1,className:c}){let[i,l]=(0,Ot.useState)(!1),d=f=>{switch(f){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},n=f=>{switch(f){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},p=f=>{if(!f)return"Never";let x=Math.floor((new Date().getTime()-f.getTime())/(1e3*60));return x<1?"Just now":x<60?`${x}Ar ago`:x<1440?`${Math.floor(x/60)}h ago`:`${Math.floor(x/1440)}d ago`};return(0,Ar.jsxs)(B,{className:C("hover:shadow-md transition-shadow",r&&"p-2",c),children:[(0,Ar.jsx)(Ee,{className:C("pb-3",r&&"pb-2"),children:(0,Ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ar.jsx)("div",{className:"relative",children:(0,Ar.jsxs)(Wt,{className:C("h-12 w-12",r&&"h-8 w-8"),children:[(0,Ar.jsx)(Ga,{src:"/placeholder.svg",alt:e.name}),(0,Ar.jsx)(_t,{children:e.name.split(" ").map(f=>f[0]).join("")})]})}),(0,Ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)("h3",{className:C("font-semibold text-sm truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,Ar.jsx)(kt.Bot,{className:C("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Ar.jsx)(kt.User,{className:C("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Ar.jsx)("p",{className:C("text-sm text-muted-foreground truncate",r&&"text-xs"),children:e.type==="human"?e.role:e.description}),!r&&(0,Ar.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[e.type==="human"&&(0,Ar.jsx)(X,{variant:"secondary",className:"text-xs",children:e.department}),e.type==="digital"&&(0,Ar.jsxs)(X,{variant:"secondary",className:"text-xs",children:["v",e.version]}),(0,Ar.jsx)(X,{variant:"outline",className:"text-xs",children:n(e.status)})]})]})]}),s&&(0,Ar.jsxs)(po,{children:[(0,Ar.jsx)(uo,{asChild:!0,children:(0,Ar.jsx)(y,{variant:"ghost",size:"icon",className:C("h-8 w-8",r&&"h-6 w-6"),children:(0,Ar.jsx)(kt.MoreHorizontal,{className:C("h-4 w-4",r&&"h-3 w-3")})})}),(0,Ar.jsxs)($a,{align:"end",children:[e.type==="digital"&&(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsxs)(fa,{onClick:()=>a?.(e),children:[(0,Ar.jsx)(kt.Settings,{className:"h-4 w-4 Ar-2"}),"View Details"]}),(0,Ar.jsxs)(fa,{onClick:()=>t?.(e),children:[(0,Ar.jsx)(kt.Edit,{className:"h-4 w-4 Ar-2"}),"Edit"]})]}),(0,Ar.jsxs)(fa,{onClick:()=>o?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Ar.jsx)(kt.Trash2,{className:"h-4 w-4 Ar-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,Ar.jsxs)(se,{className:"pt-0",children:[(0,Ar.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Ar.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Ar.jsx)(kt.Mail,{className:"h-3 w-3"}),(0,Ar.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Ar.jsxs)(Ar.Fragment,{children:[e.phone&&(0,Ar.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Ar.jsx)(kt.Phone,{className:"h-3 w-3"}),(0,Ar.jsx)("span",{children:e.phone})]}),e.location&&(0,Ar.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Ar.jsx)(kt.MapPin,{className:"h-3 w-3"}),(0,Ar.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Ar.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Ar.jsx)(kt.Settings,{className:"h-3 w-3"}),(0,Ar.jsxs)("span",{children:["v",e.version]})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Ar.jsx)(kt.Clock,{className:"h-3 w-3"}),(0,Ar.jsxs)("span",{children:["Last active: ",p(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Ar.jsx)("div",{className:"mt-3",children:(0,Ar.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,i?e.skills.length:3).map(f=>(0,Ar.jsx)(X,{variant:"outline",className:"text-xs",children:f},f)),e.skills.length>3&&(0,Ar.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>l(!i),children:i?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Ar.jsx)("div",{className:"mt-3",children:(0,Ar.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,i?e.capabilities.length:2).map(f=>(0,Ar.jsx)(X,{variant:"outline",className:"text-xs",children:f},f)),e.capabilities.length>2&&(0,Ar.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>l(!i),children:i?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var Ur=ke(require("react")),zo=ke(require("@radix-ui/react-label"));var cn=(0,Pr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),S=Ur.forwardRef(({className:e,...t},o)=>(0,$r.jsx)(zo.Root,{ref:o,className:C(cn(),e),...t}));S.displayName=zo.Root.displayName;var Gr=ke(require("react")),be=Gr.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)("textarea",{className:C("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));be.displayName="Textarea";var Vo=ke(require("react")),Pt=ke(require("@radix-ui/react-scroll-area"));var Wa=Vo.forwardRef(({className:e,children:t,...o},a)=>(0,Ar.jsxs)(Pt.Root,{ref:a,className:C("relative overflow-hidden",e),...o,children:[(0,Ar.jsx)(Pt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Ar.jsx)(_r,{}),(0,Ar.jsx)(Pt.Corner,{})]}));Wa.displayName=Pt.Root.displayName;var _r=Vo.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Ar.jsx)(Pt.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,Ar.jsx)(Pt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));_r.displayName=Pt.ScrollAreaScrollbar.displayName;function Uo({selectedDocuments:e,onDocumentsChange:t,availableDocuments:o,label:a,placeholder:s="Search knowledge documents...",maxSelections:r,disabled:c=!1}){let[i,l]=(0,Ot.useState)(""),[d,n]=(0,Ot.useState)([]),[p,f]=(0,Ot.useState)(!1);(0,Ot.useEffect)(()=>{if(!i.trim()){n([]),f(!1);return}let u=o.filter(b=>{if(e.map(W=>W.id).includes(b.id))return!1;let Y=i.toLowerCase();return b.title.toLowerCase().includes(Y)||b.description?.toLowerCase().includes(Y)||b.tags?.some(W=>W.toLowerCase().includes(Y))||Object.values(b.metadata||{}).some(W=>String(W).toLowerCase().includes(Y))});n(u),f(!0)},[i,e,o]);let h=u=>{r&&e.length>=r||(t([...e,u]),l(""),f(!1))},x=u=>{t(e.filter(b=>b.id!==u))},v=!r||e.length<r;return(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:a}),(0,Ar.jsxs)("div",{className:"relative",children:[(0,Ar.jsxs)("div",{className:"relative",children:[(0,Ar.jsx)(kt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Ar.jsx)(G,{value:i,onChange:u=>l(u.target.value),placeholder:v?s:`Maximum ${r} documents selected`,className:"pl-9",disabled:c||!v,onFocus:()=>i&&f(!0)})]}),p&&d.length>0&&(0,Ar.jsx)(B,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60",children:(0,Ar.jsx)(Wa,{className:"h-full",children:(0,Ar.jsx)(se,{className:"p-2",children:d.map(u=>(0,Ar.jsx)(y,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>h(u),disabled:c,children:(0,Ar.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Ar.jsx)(kt.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Ar.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Ar.jsx)("div",{className:"font-medium text-sm truncate",children:u.title}),u.description&&(0,Ar.jsx)("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:u.description}),u.tags&&u.tags.length>0&&(0,Ar.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[u.tags.slice(0,3).map(b=>(0,Ar.jsx)(X,{variant:"outline",className:"text-xs",children:b},b)),u.tags.length>3&&(0,Ar.jsxs)(X,{variant:"outline",className:"text-xs",children:["+",u.tags.length-3," more"]})]})]})]})},u.id))})})}),p&&i&&d.length===0&&(0,Ar.jsx)(B,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,Ar.jsxs)(se,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',i,'"']})})]}),e.length>0&&(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,Ar.jsx)("div",{className:"space-y-2",children:e.map(u=>(0,Ar.jsx)(B,{className:"p-3",children:(0,Ar.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Ar.jsx)(kt.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ar.jsx)("div",{className:"font-medium text-sm",children:u.title}),u.description&&(0,Ar.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u.description}),u.tags&&u.tags.length>0&&(0,Ar.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:u.tags.map(b=>(0,Ar.jsxs)(X,{variant:"outline",className:"text-xs",children:[(0,Ar.jsx)(kt.Tag,{className:"h-3 w-3 Ar-1"}),b]},b))})]}),(0,Ar.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>x(u.id),disabled:c,children:(0,Ar.jsx)(kt.X,{className:"h-3 w-3"})})]})},u.id))})]}),p&&(0,Ar.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>f(!1)})]})}function Ko({colleague:e,onSave:t,onCancel:o,isLoading:a=!1,title:s,submitLabel:r,cancelLabel:c="Cancel",readOnly:i=!1,availableKnowledgeDocuments:l=[]}){let[d,n]=(0,Ot.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[p,f]=(0,Ot.useState)(""),[h,x]=(0,Ot.useState)(""),[v,u]=(0,Ot.useState)(!i);(0,Ot.useEffect)(()=>{e&&n(e)},[e]);let b=I=>{I.preventDefault();let z=d.version?parseInt(d.version):0,E=e?(z+1).toString():"1",ie={id:d.id||Date.now().toString(),name:d.name,type:"digital",status:"active",joinedDate:d.joinedDate||new Date,lastActive:d.lastActive||new Date,description:d.description,jobDescription:d.jobDescription||"",workInstructions:d.workInstructions||"",capabilities:d.capabilities||[],knowledge:d.knowledge||[],coreKnowledge:d.coreKnowledge||[],version:E,lastUpdated:d.lastUpdated||new Date,isActive:!0};t(ie)},A=(I,z,E)=>{if(!z.trim())return;let ie=d[I]||[];n({...d,[I]:[...ie,z.trim()]}),E("")},Y=(I,z)=>{let E=d[I]||[];n({...d,[I]:E.filter((ie,K)=>K!==z)})},W=I=>{I.preventDefault(),u(!v)},D=(I,z,E,ie,K)=>{let yt=d[I]||[];return(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:z}),v&&(0,Ar.jsxs)("div",{className:"flex gap-2",children:[(0,Ar.jsx)(G,{value:E,onChange:xe=>ie(xe.target.value),placeholder:K,onKeyPress:xe=>{xe.key==="Enter"&&(xe.preventDefault(),A(I,E,ie))},disabled:a}),(0,Ar.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:()=>A(I,E,ie),disabled:a,children:(0,Ar.jsx)(kt.Plus,{className:"h-4 w-4"})})]}),(0,Ar.jsx)("div",{className:"flex flex-wrap gap-2",children:yt.map((xe,at)=>(0,Ar.jsxs)(X,{className:"gap-1",children:[xe,v&&(0,Ar.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>Y(I,at),disabled:a,children:(0,Ar.jsx)(kt.X,{className:"h-3 w-3"})})]},`${I}-${at}-${xe}`))})]})},_=s||(v?e?"Edit Colleague":"Add New Colleague":"View Colleague"),me=r||(e?"Update Colleague":"Add Colleague");return(0,Ar.jsxs)(B,{className:"Ar-8 w-full max-w-4xl mx-auto",children:[(0,Ar.jsx)(Ee,{children:(0,Ar.jsxs)(je,{className:"flex items-center gap-2",children:[(0,Ar.jsx)(kt.Bot,{className:"h-5 w-5"}),_]})}),(0,Ar.jsx)(se,{children:(0,Ar.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"name",children:"Name *"}),(0,Ar.jsx)(G,{id:"name",value:d.name||"",onChange:I=>n({...d,name:I.target.value}),required:!0,disabled:a||!v})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"description",children:"Description"}),(0,Ar.jsx)(be,{id:"description",value:d.description||"",onChange:I=>n({...d,description:I.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:a||!v})]})]}),(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Ar.jsx)(be,{id:"jobDescription",value:d.jobDescription||"",onChange:I=>n({...d,jobDescription:I.target.value}),rows:4,required:d.type==="digital",disabled:a||!v})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Ar.jsx)(be,{id:"workInstructions",value:d.workInstructions||"",onChange:I=>n({...d,workInstructions:I.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:a||!v})]}),D("capabilities","Capabilities",h,x,"Add capability"),(0,Ar.jsx)(Uo,{selectedDocuments:d.knowledge||[],onDocumentsChange:I=>n({...d,knowledge:I}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:a||!v,availableDocuments:l}),(0,Ar.jsx)(Uo,{selectedDocuments:d.coreKnowledge||[],onDocumentsChange:I=>n({...d,coreKnowledge:I}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:a||!v,availableDocuments:l})]}),(0,Ar.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Ar.jsx)(y,{type:"button",variant:"outline",onClick:o,disabled:a,children:v?c:"Close"}),v?(0,Ar.jsx)(y,{type:"submit",disabled:a,children:a?"Saving...":me}):(0,Ar.jsxs)(y,{type:"button",onClick:W,disabled:a,className:"gap-2",children:[(0,Ar.jsx)(kt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function qr({users:e,onUserSelect:t,onCancel:o,selectedUserId:a}){let[s,r]=(0,Ot.useState)(""),c=(0,Ot.useMemo)(()=>e.filter(l=>l.name.toLowerCase().includes(s.toLowerCase())||l.email.toLowerCase().includes(s.toLowerCase())||l.role.toLowerCase().includes(s.toLowerCase())||(l.skills||[]).some(n=>n.toLowerCase().includes(s.toLowerCase()))),[e,s]),i=l=>{t(l)};return(0,Ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Ar.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Ar.jsxs)(y,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Ar.jsx)(kt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Ar.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add as a colleague"})]})]}),(0,Ar.jsx)(B,{className:"container",children:(0,Ar.jsx)(se,{className:"pt-6",children:(0,Ar.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Ar.jsx)("div",{className:"flex-1",children:(0,Ar.jsxs)("div",{className:"relative",children:[(0,Ar.jsx)(kt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Ar.jsx)(G,{placeholder:"Search users by name, email, role, or skills...",value:s,onChange:l=>r(l.target.value),className:"pl-9"})]})})})})}),(0,Ar.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(l=>(0,Ar.jsx)(Ho.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Ar.jsxs)(B,{className:`cursor-pointer transition-all hover:shadow-lg ${a===l.id?"ring-2 ring-primary":""}`,onClick:()=>i(l),children:[(0,Ar.jsx)(Ee,{className:"pb-3",children:(0,Ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ar.jsxs)(Wt,{children:[(0,Ar.jsx)(Ga,{src:l.avatar,alt:l.name}),(0,Ar.jsx)(_t,{children:(0,Ar.jsx)(kt.User,{className:"h-4 w-4"})})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(je,{className:"text-lg",children:l.name}),(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground",children:l.role})]})]}),a===l.id&&(0,Ar.jsx)(kt.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Ar.jsx)(se,{className:"pt-0",children:(0,Ar.jsxs)("div",{className:"space-y-3",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Ar.jsx)("p",{className:"text-sm font-medium",children:l.email})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,Ar.jsx)(X,{variant:"secondary",children:l.department})]}),l.location&&(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,Ar.jsx)("p",{className:"text-sm",children:l.location})]}),l.skills&&l.skills.length>0&&(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,Ar.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.skills.slice(0,3).map(d=>(0,Ar.jsx)(X,{variant:"outline",className:"text-xs",children:d},d)),l.skills.length>3&&(0,Ar.jsxs)(X,{variant:"outline",className:"text-xs",children:["+",l.skills.length-3]})]})]})]})})]})},l.id))}),c.length===0&&(0,Ar.jsx)(B,{className:"container mt-4",children:(0,Ar.jsx)(se,{className:"pt-6",children:(0,Ar.jsxs)("div",{className:"text-center py-8",children:[(0,Ar.jsx)(kt.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Ar.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Ar.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function Xr({digitalColleagues:e,onColleagueClone:t,onCancel:o,selectedColleagueId:a}){let[s,r]=(0,Ot.useState)(""),[c,i]=(0,Ot.useState)("all"),l=(0,Ot.useMemo)(()=>e.filter(p=>{let f=p.name.toLowerCase().includes(s.toLowerCase())||p.jobDescription.toLowerCase().includes(s.toLowerCase())||p.capabilities.some(x=>x.toLowerCase().includes(s.toLowerCase()))||p.workInstructions.toLowerCase().includes(s.toLowerCase()),h=c==="all"||p.status===c;return f&&h}),[e,s,c]),d=p=>{let f={...p,id:`${p.id}-clone-${Date.now()}`,name:`${p.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(f)},n=p=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(p);return(0,Ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Ar.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Ar.jsxs)(y,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Ar.jsx)(kt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Ar.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,Ar.jsx)(B,{children:(0,Ar.jsx)(se,{className:"pt-6",children:(0,Ar.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Ar.jsx)("div",{className:"flex-1",children:(0,Ar.jsxs)("div",{className:"relative",children:[(0,Ar.jsx)(kt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Ar.jsx)(G,{placeholder:"Search by name, job description, or capabilities...",value:s,onChange:p=>r(p.target.value),className:"pl-9"})]})}),(0,Ar.jsxs)("select",{value:c,onChange:p=>i(p.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Ar.jsx)("option",{value:"all",children:"All Status"}),(0,Ar.jsx)("option",{value:"active",children:"Active"}),(0,Ar.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Ar.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(p=>(0,Ar.jsx)(Ho.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Ar.jsxs)(B,{className:`cursor-pointer transition-all hover:shadow-lg ${a===p.id?"ring-2 ring-primary":""}`,onClick:()=>d(p),children:[(0,Ar.jsx)(Ee,{className:"pb-3",children:(0,Ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ar.jsx)(Wt,{children:(0,Ar.jsx)(_t,{className:"bg-blue-100",children:(0,Ar.jsx)(kt.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsxs)(je,{className:"text-lg flex items-center gap-2",children:[p.name,(0,Ar.jsx)(X,{variant:p.status==="active"?"default":"secondary",className:"text-xs",children:p.status})]}),(0,Ar.jsxs)("p",{className:"text-sm text-muted-foreground",children:["v",p.version]})]})]}),(0,Ar.jsxs)(y,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:f=>{f.stopPropagation(),d(p)},children:[(0,Ar.jsx)(kt.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Ar.jsx)(se,{className:"pt-0",children:(0,Ar.jsxs)("div",{className:"space-y-3",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Ar.jsx)("p",{className:"text-sm line-clamp-2",children:p.jobDescription})]}),p.capabilities&&p.capabilities.length>0&&(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Ar.jsxs)("div",{className:"flex flex-wrap gap-1",children:[p.capabilities.slice(0,3).map(f=>(0,Ar.jsx)(X,{variant:"outline",className:"text-xs",children:f},f)),p.capabilities.length>3&&(0,Ar.jsxs)(X,{variant:"outline",className:"text-xs",children:["+",p.capabilities.length-3]})]})]}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Ar.jsx)(kt.Calendar,{className:"h-3 w-3"}),(0,Ar.jsxs)("span",{children:["Updated ",n(p.lastUpdated)]})]}),p.knowledge&&(0,Ar.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Ar.jsx)(kt.Users,{className:"h-3 w-3"}),(0,Ar.jsxs)("span",{children:[p.knowledge.length," docs"]})]})]}),p.workInstructions&&(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Ar.jsx)("p",{className:"text-xs line-clamp-2",children:p.workInstructions})]})]})})]})},p.id))}),l.length===0&&(0,Ar.jsx)(B,{children:(0,Ar.jsx)(se,{className:"pt-6",children:(0,Ar.jsxs)("div",{className:"text-center py-8",children:[(0,Ar.jsx)(kt.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Ar.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Ar.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Jr({onSelectHuman:e,onSelectDigital:t,onCancel:o}){return(0,Ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Ar.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Ar.jsxs)(y,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Ar.jsx)(kt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Ar.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,Ar.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Ar.jsx)(Ho.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Ar.jsxs)(B,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Ar.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Ar.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Ar.jsx)(kt.User,{className:"h-8 w-8 text-blue-600"})}),(0,Ar.jsx)(je,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Ar.jsxs)(se,{className:"text-center",children:[(0,Ar.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add as team members."}),(0,Ar.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Ar.jsx)(kt.Users,{className:"h-4 w-4 text-blue-600"}),(0,Ar.jsx)("span",{children:"Browse existing users"})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Ar.jsx)(kt.User,{className:"h-4 w-4 text-blue-600"}),(0,Ar.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Ar.jsx)(y,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Ar.jsx)(Ho.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Ar.jsxs)(B,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Ar.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Ar.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Ar.jsx)(kt.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Ar.jsx)(je,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Ar.jsxs)(se,{className:"text-center",children:[(0,Ar.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,Ar.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Ar.jsx)(kt.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Ar.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Ar.jsx)(kt.Users,{className:"h-4 w-4 text-purple-600"}),(0,Ar.jsx)("span",{children:"Create from templates"})]})]}),(0,Ar.jsx)(y,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Zr({onCloneExisting:e,onCreateNew:t,onCancel:o}){return(0,Ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Ar.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Ar.jsxs)(y,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Ar.jsx)(kt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Ar.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,Ar.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Ar.jsx)(Ho.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Ar.jsxs)(B,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Ar.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Ar.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Ar.jsx)(kt.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Ar.jsx)(je,{className:"text-xl",children:"Clone Existing"})]}),(0,Ar.jsxs)(se,{className:"text-center",children:[(0,Ar.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,Ar.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Ar.jsx)(kt.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Ar.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Ar.jsx)(kt.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Ar.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Ar.jsx)(y,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Ar.jsx)(Ho.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Ar.jsxs)(B,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Ar.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Ar.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Ar.jsx)(kt.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Ar.jsx)(je,{className:"text-xl",children:"Create New"})]}),(0,Ar.jsxs)(se,{className:"text-center",children:[(0,Ar.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Ar.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Ar.jsx)(kt.Plus,{className:"h-4 w-4 text-green-600"}),(0,Ar.jsx)("span",{children:"Custom job description"})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Ar.jsx)(kt.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Ar.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Ar.jsx)(y,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function Yr(e,t){let[o,a]=(0,Ot.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),s=r=>{try{a(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Ot.useEffect)(()=>{s(o)},[]),[o,s]}var yo=require("react-icons/fa");function Ye({title:e,description:t,badge:o,primaryAction:a,secondaryAction:s,gradient:r,children:c,className:i}){let[l,d]=Yr(`hero-section-minimized-${e.replace(/\s+/Ar,"-").toLowerCase()}`,!s&&!t),n=!s&&!t||l;return(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${i||""}`,children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,Ar.jsx)(X,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,Ar.jsx)("h2",{className:"text-3xl font-bold Ar-0",children:e})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-3",children:[n&&a&&(0,Ar.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),(s||t)&&(0,Ar.jsx)("button",{"aria-label":l?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>d(!l),style:{lineHeight:0},children:l?(0,Ar.jsx)(yo.FaChevronDown,{size:22}):(0,Ar.jsx)(yo.FaChevronUp,{size:22})})]})]}),!n&&(0,Ar.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Ar.jsxs)("div",{className:"flex flex-wrap gap-3",children:[a&&(0,Ar.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),s&&(0,Ar.jsx)(y,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:s.onClick,children:s.label})]})]}),c&&(0,Ar.jsx)("div",{className:"hidden lg:block",children:c})]})]})}function $o({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:o,onColleagueDelete:a,compactView:s=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:c,availableUsers:i=[],existingDigitalColleagues:l=[]}){let[d,n]=(0,Ot.useState)(e||[]),[p,f]=(0,Ot.useState)(""),[h,x]=(0,Ot.useState)("all"),[v,u]=(0,Ot.useState)("all"),[b,A]=(0,Ot.useState)("all"),[Y,W]=(0,Ot.useState)(null),[D,_]=(0,Ot.useState)(null);(0,Ot.useEffect)(()=>{n(e||[])},[e]);let me=Array.isArray(i)?i:[],I=Array.isArray(l)?l:[],[z,E]=(0,Ot.useState)("main"),ie=d.filter(N=>{if(!N||!N.name)return!1;let Re=N.name.toLowerCase().includes(p.toLowerCase())||N.type==="human"&&(N.email?.toLowerCase().includes(p.toLowerCase())||N.role?.toLowerCase().includes(p.toLowerCase()))||N.type==="digital"&&N.jobDescription?.toLowerCase().includes(p.toLowerCase()),he=h==="all"||N.type==="human"&&N.department===h,Tt=v==="all"||N.status===v;return Re&&he&&Tt}),K=ie.filter(N=>N.type==="human"),yt=ie.filter(N=>N.type==="digital"),xe=()=>{E("typeSelection")},at=N=>{N.type==="digital"&&(W(N),E("form")),console.log("Editing colleague:",N),o?.(N)},Ie=N=>{N.type==="digital"&&(_(N),E("view"))},Lt=N=>{let Re={id:`human-${Date.now()}`,type:"human",name:N.name,email:N.email,role:N.role,department:N.department,phone:N.phone,location:N.location,timezone:N.timezone,skills:N.skills||[],bio:N.bio,status:"active",joinedDate:new Date,lastActive:new Date};n(he=>[...he,Re]),t?.(Re),E("main")},Nt=N=>{if(!N||!N.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",N);return}n(Re=>[...Re,N]),t?.(N),E("main")},St=()=>{W(null),E("form")},wt=N=>{if(!N||!N.id){console.error("Invalid colleague provided to handleSaveColleague:",N);return}Y?(n(Re=>Re.map(he=>he.id===N.id?N:he)),o?.(N)):(n(Re=>[...Re,N]),t?.(N)),E("main"),W(null)},P=()=>{E("main"),W(null),_(null)},pe=()=>{E("main"),_(null)},Le=()=>{D&&(W(D),_(null),E("form"))},mt=N=>{a?.(N,d.find(Re=>Re.id===N).type),n(Re=>Re.filter(he=>he.id!==N))},ye=()=>{f(""),x("all"),u("all")},pt=()=>{let N=[];return I.forEach(he=>{he.knowledge&&Array.isArray(he.knowledge)&&N.push(...he.knowledge),he.coreKnowledge&&Array.isArray(he.coreKnowledge)&&N.push(...he.coreKnowledge)}),d.forEach(he=>{he.type==="digital"&&(he.knowledge&&Array.isArray(he.knowledge)&&N.push(...he.knowledge),he.coreKnowledge&&Array.isArray(he.coreKnowledge)&&N.push(...he.coreKnowledge))}),N.filter((he,Tt,Ut)=>Tt===Ut.findIndex(V=>V.id===he.id))};return z==="typeSelection"?(0,Ar.jsx)(Jr,{onSelectHuman:()=>E("userSelection"),onSelectDigital:()=>E("digitalOptions"),onCancel:()=>E("main")}):z==="userSelection"?(0,Ar.jsx)(qr,{users:me,onUserSelect:Lt,onCancel:()=>E("typeSelection")}):z==="digitalOptions"?(0,Ar.jsx)(Zr,{onCloneExisting:()=>E("digitalClone"),onCreateNew:St,onCancel:()=>E("typeSelection")}):z==="digitalClone"?(0,Ar.jsx)(Xr,{digitalColleagues:I,onColleagueClone:Nt,onCancel:()=>E("digitalOptions")}):z==="form"?(0,Ar.jsx)(Ko,{colleague:Y||void 0,onSave:wt,onCancel:P,availableKnowledgeDocuments:pt()}):z==="view"?(0,Ar.jsx)(Ko,{colleague:D||void 0,onSave:wt,onCancel:pe,readOnly:!0,availableKnowledgeDocuments:pt()}):(0,Ar.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Ar.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,Ar.jsx)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Ar.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,Ar.jsx)(Ye,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:xe}}),(0,Ar.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Ar.jsxs)(B,{children:[(0,Ar.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Ar.jsx)(je,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Ar.jsx)(kt.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Ar.jsxs)(se,{children:[(0,Ar.jsx)("div",{className:"text-2xl font-bold",children:d.length}),(0,Ar.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d.filter(N=>N.status==="active").length," active"]})]})]}),(0,Ar.jsxs)(B,{children:[(0,Ar.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Ar.jsx)(je,{className:"text-sm font-medium",children:"Human Members"}),(0,Ar.jsx)(kt.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Ar.jsxs)(se,{children:[(0,Ar.jsx)("div",{className:"text-2xl font-bold",children:d.filter(N=>N.type==="human").length}),(0,Ar.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d.filter(N=>N.type==="human"&&N.status==="active").length," ","active"]})]})]}),(0,Ar.jsxs)(B,{children:[(0,Ar.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Ar.jsx)(je,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Ar.jsx)(kt.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Ar.jsxs)(se,{children:[(0,Ar.jsx)("div",{className:"text-2xl font-bold",children:d.filter(N=>N.type==="digital").length}),(0,Ar.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d.filter(N=>N.type==="digital"&&N.status==="active").length," ","active"]})]})]})]}),(0,Ar.jsx)(B,{children:(0,Ar.jsx)(se,{className:"pt-6",children:(0,Ar.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Ar.jsx)("div",{className:"flex-1",children:(0,Ar.jsxs)("div",{className:"relative",children:[(0,Ar.jsx)(kt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Ar.jsx)(G,{placeholder:"Search colleagues...",value:p,onChange:N=>f(N.target.value),className:"pl-9"})]})}),(0,Ar.jsxs)($e,{value:h,onValueChange:x,children:[(0,Ar.jsx)(ze,{className:"w-full md:w-[180px]",children:(0,Ar.jsx)(gt,{placeholder:"Department"})}),(0,Ar.jsxs)(Ve,{children:[(0,Ar.jsx)(ue,{value:"all",children:"All Departments"}),r.map(N=>(0,Ar.jsx)(ue,{value:N,children:N},N))]})]}),(0,Ar.jsxs)($e,{value:v,onValueChange:u,children:[(0,Ar.jsx)(ze,{className:"w-full md:w-[140px]",children:(0,Ar.jsx)(gt,{placeholder:"Status"})}),(0,Ar.jsxs)(Ve,{children:[(0,Ar.jsx)(ue,{value:"all",children:"All Status"}),(0,Ar.jsx)(ue,{value:"active",children:"Active"}),(0,Ar.jsx)(ue,{value:"inactive",children:"Inactive"})]})]}),(p||h!=="all"||v!=="all")&&(0,Ar.jsxs)(y,{variant:"outline",onClick:ye,className:"gap-2",children:[(0,Ar.jsx)(kt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsx)(go,{activeTab:b,onTabChange:A,tabOptions:[{value:"all",label:`All (${ie.length})`},{value:"human",label:`Human (${K.length})`},{value:"digital",label:`Digital (${yt.length})`}],maxWidth:"400px",gridCols:3}),b==="all"&&(0,Ar.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:ie.map(N=>(0,Ar.jsx)(ho,{colleague:N,onEdit:at,onDelete:mt,onViewDetails:Ie,compact:s},`${N}-${N.id}`))}),b==="human"&&(0,Ar.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:K.map(N=>(0,Ar.jsx)(ho,{colleague:N,onEdit:at,onDelete:mt,onViewDetails:Ie,compact:s},N.id))}),b==="digital"&&(0,Ar.jsx)("div",{className:`grid gap-4 ${s?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:yt.map(N=>(0,Ar.jsx)(ho,{colleague:N,onEdit:at,onDelete:mt,onViewDetails:Ie,compact:s},N.id))})]}),ie.length===0&&(0,Ar.jsx)(B,{children:(0,Ar.jsx)(se,{className:"pt-6",children:(0,Ar.jsxs)("div",{className:"text-center py-8",children:[(0,Ar.jsx)(kt.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Ar.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Ar.jsx)("p",{className:"text-muted-foreground mb-4",children:p||h!=="all"||v!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,Ar.jsxs)(y,{onClick:xe,className:"gap-2",children:[(0,Ar.jsx)(kt.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function No({files:e,onFileClick:t,onFileEdit:o,onFileDelete:a,showHeader:s=!0,className:r}){return(0,Ar.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[s&&(0,Ar.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Ar.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Ar.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Ar.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Ar.jsx)("div",{className:"divide-y",children:e.map(c=>(0,Ar.jsxs)(Ho.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(c),children:[(0,Ar.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Ar.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Ar.jsx)("div",{children:(0,Ar.jsx)("p",{className:"font-medium",children:c.name})})]}),(0,Ar.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:c.filesize}),(0,Ar.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Ar.jsx)("span",{className:"text-sm md:text-base",children:typeof c.createdAt=="string"?c.createdAt:new Date(c.createdAt).toLocaleDateString()}),(0,Ar.jsx)("div",{className:"flex gap-1",children:(0,Ar.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:i=>{i.stopPropagation(),a?.(c)},children:(0,Ar.jsx)(kt.Trash2,{className:"h-4 w-4"})})})]})]},c.name))})]})}var Ja=ke(require("react")),et=ke(require("@radix-ui/react-dialog"));var ct=et.Root;var mn=et.Portal;var oi=Ja.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(et.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}));oi.displayName=et.Overlay.displayName;var st=Ja.forwardRef(({className:e,children:t,...o},a)=>(0,Ar.jsxs)(mn,{children:[(0,Ar.jsx)(oi,{}),(0,Ar.jsxs)(et.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,Ar.jsxs)(et.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,Ar.jsx)(kt.X,{className:"h-4 w-4"}),(0,Ar.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));st.displayName=et.Content.displayName;var nt=({className:e,...t})=>(0,Ar.jsx)("div",{className:C("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});nt.displayName="DialogHeader";var Za=({className:e,...t})=>(0,Ar.jsx)("div",{className:C("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Za.displayName="DialogFooter";var lt=Ja.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(et.Title,{ref:o,className:C("text-lg font-semibold leading-none tracking-tight",e),...t}));lt.displayName=et.Title.displayName;var Ya=Ja.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(et.Description,{ref:o,className:C("text-sm text-muted-foreground",e),...t}));Ya.displayName=et.Description.displayName;var ri=({isOpen:e,onClose:t,onAddFile:o})=>{let[a,s]=(0,Ot.useState)(null),[r,c]=(0,Ot.useState)(""),[i,l]=(0,Ot.useState)(""),[d,n]=(0,Ot.useState)(""),p=h=>{let x=h.target.files?.[0];x&&(s(x),r||c(x.name))},f=async h=>{if(h.preventDefault(),!a)return;let x=new FormData;x.append("file",a),x.append("name",r),i&&x.append("description",i),d&&x.append("tags",d),o?.(x),t(),s(null),c(""),l(""),n("")};return(0,Ar.jsx)(ct,{open:e,onOpenChange:t,children:(0,Ar.jsxs)(st,{className:"sm:max-w-md",children:[(0,Ar.jsx)(nt,{children:(0,Ar.jsx)(lt,{children:"Add New File"})}),(0,Ar.jsxs)("form",{onSubmit:f,className:"grid gap-4",children:[(0,Ar.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Ar.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,Ar.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Ar.jsx)(pn,{className:"w-10 h-10 text-gray-400"}),(0,Ar.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Ar.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,Ar.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,Ar.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:p})]})}),a&&(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("p",{className:"font-medium",children:a.name}),(0,Ar.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((a.size||0)/1024).toFixed(2)," KB"]})]}),(0,Ar.jsx)(y,{type:"submit",onClick:f,children:"Upload"})]})]})]})})};function pn(e){return(0,Ar.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ar.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Ar.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Ar.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function eo({initialFiles:e=[],onFileAdd:t,onFileEdit:o,onFileDelete:a,onFileClick:s,compactView:r=!1,className:c}){let[i,l]=(0,Ot.useState)(e),[d,n]=(0,Ot.useState)(""),[p,f]=(0,Ot.useState)("all"),[h,x]=(0,Ot.useState)("all"),[v,u]=(0,Ot.useState)(!1);(0,Ot.useEffect)(()=>{l(e)},[e]);let b=i.filter(z=>z.name.toLowerCase().includes(d.toLowerCase())),A=b.slice(0,10),Y=b.filter(Boolean),W=()=>{u(!0)},D=z=>{o?.(z)},_=z=>{console.log("deleting file",z),l(E=>E.filter(ie=>ie.name!==z.name)),a?.(z.id.toString())},me=z=>{s?.(z)},I=()=>{n(""),f("all")};return(0,Ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Ar.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,Ar.jsx)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Ar.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,Ar.jsx)(Ye,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:W},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Ar.jsx)(B,{children:(0,Ar.jsx)(se,{className:"pt-6",children:(0,Ar.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Ar.jsx)("div",{className:"flex-1",children:(0,Ar.jsxs)("div",{className:"relative",children:[(0,Ar.jsx)(kt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Ar.jsx)(G,{placeholder:"Search files...",value:d,onChange:z=>n(z.target.value),className:"pl-9"})]})}),(d||p!=="all")&&(0,Ar.jsxs)(y,{variant:"outline",onClick:I,className:"gap-2",children:[(0,Ar.jsx)(kt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsx)(go,{activeTab:h,onTabChange:x,tabOptions:[{value:"all",label:`All Files (${b.length})`},{value:"recent",label:`Recent (${A.length})`}],maxWidth:"500px",gridCols:3}),h==="all"&&(0,Ar.jsx)(No,{files:b,onFileClick:me,onFileEdit:D,onFileDelete:_,showHeader:!r}),h==="recent"&&(0,Ar.jsx)(No,{files:A,onFileClick:me,onFileEdit:D,onFileDelete:_,showHeader:!r}),h==="shared"&&(0,Ar.jsx)(No,{files:Y,onFileClick:me,onFileEdit:D,onFileDelete:_,showHeader:!r})]}),b.length===0&&(0,Ar.jsx)(B,{children:(0,Ar.jsx)(se,{className:"pt-6",children:(0,Ar.jsxs)("div",{className:"text-center py-8",children:[(0,Ar.jsx)(kt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Ar.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Ar.jsx)("p",{className:"text-muted-foreground mb-4",children:d||p!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Ar.jsxs)(y,{onClick:W,className:"gap-2",children:[(0,Ar.jsx)(kt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Ar.jsx)(ri,{isOpen:v,onClose:()=>u(!1),onAddFile:t})]})}function ni({document:e,onSave:t,onCancel:o,availableDocuments:a=[],knowledgeContexts:s=[]}){let[r,c]=(0,Ot.useState)({...e,updatedAt:new Date}),i=()=>{let v=new Set,u=new Set;return s.forEach(b=>{b.menuConfig.groupBy.forEach(A=>v.add(A))}),a.forEach(b=>{b.metadata&&Object.keys(b.metadata).forEach(A=>u.add(A))}),{contextKeys:Array.from(v).sort(),documentKeys:Array.from(u).sort(),allKeys:Array.from(new Set([...v,...u])).sort()}},l=v=>{let u=new Set;return a.forEach(b=>{b.metadata?.[v]&&u.add(String(b.metadata[v]))}),Array.from(u).sort()},d=i(),n=()=>{t(r)},p=(v,u)=>{c(b=>({...b,metadata:{...b.metadata,[v]:u}}))},f=(v,u)=>{u==="__custom__"?p(v,""):p(v,u)},h=()=>{let v=`field_${Date.now()}`;p(v,"")},x=v=>{c(u=>{let b={...u.metadata};return delete b[v],{...u,metadata:b}})};return(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Ar.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Ar.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ar.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,Ar.jsx)(kt.Edit3,{className:"h-6 w-6 text-primary"})}),(0,Ar.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,Ar.jsxs)("div",{className:"flex gap-2",children:[(0,Ar.jsxs)(y,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,Ar.jsx)(kt.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Ar.jsxs)(y,{size:"sm",onClick:n,className:"gap-2",children:[(0,Ar.jsx)(kt.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,Ar.jsx)(G,{value:r.title,onChange:v=>c(u=>({...u,title:v.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,Ar.jsx)(be,{value:r.description||"",onChange:v=>c(u=>({...u,description:v.target.value})),placeholder:"Document description...",rows:2})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),d.contextKeys.length>0&&(0,Ar.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Suggested: ",d.contextKeys.slice(0,4).join(", "),d.contextKeys.length>4&&` +${d.contextKeys.length-4}`]})]}),(0,Ar.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:h,className:"gap-1 h-8",children:[(0,Ar.jsx)(kt.Plus,{className:"h-3 w-3"}),"Add"]})]}),r.metadata&&Object.keys(r.metadata).length>0?(0,Ar.jsx)("div",{className:"space-y-2",children:Object.entries(r.metadata).map(([v,u])=>{let b=l(v);return(0,Ar.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Ar.jsx)(G,{value:v,onChange:A=>{let Y=A.target.value,W=r.metadata?.[v];c(D=>{let _={...D.metadata};return delete _[v],Y&&(_[Y]=W||""),{...D,metadata:_}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${v}`}),(0,Ar.jsx)("datalist",{id:`metadata-keys-${v}`,children:d.allKeys.map(A=>(0,Ar.jsx)("option",{value:A},A))}),(0,Ar.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),b.length>0?(0,Ar.jsxs)($e,{value:String(u||""),onValueChange:A=>f(v,A),children:[(0,Ar.jsx)(ze,{className:"flex-1 h-8 text-sm",children:(0,Ar.jsx)(gt,{placeholder:"Value"})}),(0,Ar.jsxs)(Ve,{children:[b.map(A=>(0,Ar.jsx)(ue,{value:A,children:A},A)),(0,Ar.jsx)(ue,{value:"__custom__",children:(0,Ar.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Ar.jsx)(G,{value:String(u||""),onChange:A=>p(v,A.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Ar.jsx)(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>x(v),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Ar.jsx)(kt.X,{className:"h-3 w-3"})})]},v)})}):(0,Ar.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,Ar.jsx)("p",{className:"text-xs text-muted-foreground",children:'No metadata \u2022 Click "Add" to create fields'})})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,Ar.jsx)(X,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,Ar.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Ar.jsxs)("div",{className:"p-8",children:[(0,Ar.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,Ar.jsx)(be,{value:r.content||"",onChange:v=>c(u=>({...u,content:v.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var mi=e=>(0,Ar.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/Ar,"<br>").replace(/\*\*(.*?)\*\*/Ar,"<strong>$1</strong>").replace(/\*(.*?)\*/Ar,"<em>$1</em>").replace(/`(.*?)`/Ar,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),li=e=>(0,Ar.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),un=e=>(0,Ar.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Ar.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:(0,Ar.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Ar.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Ar.jsx)("pre",{className:"text-sm",children:e})]}),gn=e=>(0,Ar.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Ar.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,Ar.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Ar.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),mi(e)]});function pi({document:e,onDocumentUpdate:t,editable:o=!0,renderers:a,availableDocuments:s=[],knowledgeContexts:r=[]}){let[c,i]=(0,Ot.useState)(!1),l=h=>{switch(h){case"markdown":case"mdx":return(0,Ar.jsx)(kt.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Ar.jsx)(kt.File,{className:"h-6 w-6 text-success"});case"text":return(0,Ar.jsx)(kt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Ar.jsx)(kt.File,{className:"h-6 w-6 text-muted-foreground"})}},d=h=>{switch(h){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richtext":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},n=(h,x)=>{let v={markdown:mi,mdx:gn,richtext:un,text:li},u=a?.[x]||v[x];return u?u(h):li(h)},p=h=>{i(!1),t?.(h)},f=()=>{i(!1)};return c?(0,Ar.jsx)(ni,{document:e,onSave:p,onCancel:f,availableDocuments:s,knowledgeContexts:r}):(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Ar.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Ar.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Ar.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Ar.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:l(e.format)}),(0,Ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ar.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Ar.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),o&&(0,Ar.jsx)("div",{className:"flex-shrink-0",children:(0,Ar.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>i(!0),className:"gap-2",children:[(0,Ar.jsx)(kt.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Ar.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Ar.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${d(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(h=>(0,Ar.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",h]},h))]})]}),(0,Ar.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Ar.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Ar.jsxs)("div",{className:"mb-6",children:[(0,Ar.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Ar.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,Ar.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xs",children:Object.entries(e.metadata).map(([h,x])=>(0,Ar.jsxs)("div",{className:"flex gap-1",children:[(0,Ar.jsxs)("span",{className:"text-muted-foreground font-medium",children:[h.replace(/([A-Ar])/Ar," $1").trim(),":"]}),(0,Ar.jsx)("span",{className:"text-foreground truncate",children:String(x)})]},h))})})]}),(0,Ar.jsx)("div",{className:"space-y-4",children:e.content?(0,Ar.jsx)("div",{className:"relative",children:(0,Ar.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:n(e.content,e.format)})}):(0,Ar.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Ar.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Ar.jsx)(kt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Ar.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Ar.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function ui({label:e,documents:t,children:o,level:a,onDocumentClick:s,selectedDocumentId:r,showDocumentCount:c=!0}){let[i,l]=(0,Ot.useState)(a===0),d=o&&Object.keys(o).length>0,n=t.length+(o?Object.values(o).reduce((h,x)=>h+x.documents.length,0):0),p=h=>{switch(h){case"markdown":case"mdx":return(0,Ar.jsx)(kt.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Ar.jsx)(kt.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Ar.jsx)(kt.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},f=h=>{let x=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return x[h%x.length]};return(0,Ar.jsxs)("div",{className:"space-y-1",children:[(d||t.length>0)&&(0,Ar.jsxs)(Ho.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${i?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${a*20}px`},onClick:()=>l(!i),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Ar.jsx)("div",{className:`w-1 h-6 rounded-full ${f(a)}`}),(0,Ar.jsx)(Ho.motion.div,{animate:{rotate:i?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Ar.jsx)(kt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Ar.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Ar.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Ar.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),c&&n>0&&(0,Ar.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Ar.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:n})})]})]}),(0,Ar.jsx)(Ho.motion.div,{initial:!1,animate:{height:i?"auto":0,opacity:i?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Ar.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((h,x)=>(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:x*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===h.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${a*20+20}px`},onClick:()=>s?.(h),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Ar.jsx)("div",{className:"flex-shrink-0",children:p(h.format)}),(0,Ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ar.jsx)("p",{className:`text-sm truncate transition-colors ${r===h.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:h.title}),h.description&&(0,Ar.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:h.description})]}),h.tags&&h.tags.length>0&&(0,Ar.jsx)("div",{className:"flex-shrink-0",children:(0,Ar.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:h.tags[0]})})]},h.id)),o&&Object.entries(o).map(([h,x])=>(0,Ar.jsx)(ui,{label:h,documents:x.documents,children:x.children,level:a+1,onDocumentClick:s,selectedDocumentId:r,showDocumentCount:c},h))]})})]})}function gi({documents:e,menuConfig:t,onDocumentClick:o,onDocumentShare:a,onDocumentUpdate:s,selectedDocumentId:r,className:c,editable:i=!0}){let[l,d]=(0,Ot.useState)(""),[n,p]=(0,Ot.useState)(null),f=(0,Ot.useMemo)(()=>l?e.filter(v=>v.title.toLowerCase().includes(l.toLowerCase())||v.description?.toLowerCase().includes(l.toLowerCase())||v.tags?.some(u=>u.toLowerCase().includes(l.toLowerCase()))||Object.values(v.metadata||{}).some(u=>String(u).toLowerCase().includes(l.toLowerCase()))):e,[e,l]),h=(0,Ot.useMemo)(()=>{let v=(u,b)=>{if(b.length===0)return{};let[A,...Y]=b;return u.reduce((D,_)=>{let me=_.metadata?.[A]||"Uncategorized",I=String(me);if(D[I]||(D[I]={documents:[],children:{}}),Y.length===0)D[I].documents.push(_);else{let z=v([_],Y),E=Object.keys(z)[0];E&&(D[I].children||(D[I].children={}),D[I].children[E]?D[I].children[E].documents.push(...z[E].documents):D[I].children[E]=z[E])}return D},{})};return v(f,t.groupBy)},[f,t.groupBy]),x=v=>{p(v),o?.(v)};return(0,Ar.jsxs)("div",{className:`flex h-full ${c||""}`,children:[(0,Ar.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Ar.jsx)("div",{className:"p-6 border-b border-border",children:(0,Ar.jsxs)("div",{className:"relative",children:[(0,Ar.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Ar.jsx)(kt.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Ar.jsx)(G,{placeholder:"Search knowledge base...",value:l,onChange:v=>d(v.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Ar.jsx)(Wa,{className:"h-[calc(100%-100px)]",children:(0,Ar.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(h).map(([v,u])=>(0,Ar.jsx)(ui,{label:v,documents:u.documents,children:u.children,level:0,onDocumentClick:x,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},v)),Object.keys(h).length===0&&(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Ar.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Ar.jsx)(kt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Ar.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Ar.jsx)("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Ar.jsx)("div",{className:"flex-1 bg-background",children:n?(0,Ar.jsx)(pi,{document:n,onDocumentUpdate:s,editable:i}):(0,Ar.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Ar.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Ar.jsx)(kt.FileText,{className:"h-10 w-10 text-primary"})}),(0,Ar.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Ar.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function Go({documents:e=[],contexts:t=[],onDocumentClick:o=c=>console.log("Document clicked:",c),onDocumentShare:a=c=>console.log("Share document:",c),onLoadDocumentContent:s,selectedDocumentId:r}){let[c,i]=(0,Ot.useState)(t[0]);return!t||t.length===0?(0,Ar.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Ar.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Ar.jsx)(Ye,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Ar.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Ar.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,Ar.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Ar.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Ar.jsx)(Ye,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Ar.jsxs)("div",{className:"mt-6",children:[(0,Ar.jsx)("div",{className:"border-b border-border",children:(0,Ar.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(l=>(0,Ar.jsxs)("button",{onClick:()=>i(l),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${c.id===l.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[l.icon,l.label]},l.id))})}),c.description&&(0,Ar.jsx)("div",{className:"mt-3 px-1",children:(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground",children:c.description})})]})]}),(0,Ar.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Ar.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Ar.jsx)(gi,{documents:e,menuConfig:c.menuConfig,onDocumentClick:o,onDocumentShare:a,selectedDocumentId:r})})})]})}var fn=[{key:"kanban",icon:kt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:kt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:kt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:kt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:kt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],vi=({currentView:e,onViewChange:t,children:o})=>(0,Ar.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Ar.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:fn.map(a=>{let s=a.icon,r=e===a.key;return(0,Ar.jsxs)("button",{onClick:()=>t(a.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?a.color:`${a.color}/75 hover:${a.color}`} ${a.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:a.title,children:[(0,Ar.jsx)(s,{className:"h-4 w-4 flex-shrink-0"}),(0,Ar.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:a.label})]},a.key)})}),(0,Ar.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Ar.jsx)("div",{className:"w-full h-full",children:o})})]});var hi=({title:e,status:t,taskCount:o,children:a,onDrop:s,isCompact:r=!1,height:c})=>{let i=n=>{n.preventDefault()},l=n=>{n.preventDefault(),s(t)};return(0,Ar.jsxs)(B,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${r?"lg:max-w-xs":""}`,style:{height:c||"calc(100vh - 350px)"},onDragOver:i,onDrop:l,children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Ar.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Ar.jsx)(X,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,Ar.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:a})]})};var to=({task:e,epic:t,onDragStart:o,onTaskClick:a,isCompact:s=!1})=>{let r=n=>{o(e)},c=()=>{a(e)},i=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},l=()=>{switch(e.type){case"story":return(0,Ar.jsx)(kt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Ar.jsx)(kt.Bug,{className:"h-3 w-3"});case"spike":return(0,Ar.jsx)(kt.Zap,{className:"h-3 w-3"});case"task":default:return(0,Ar.jsx)(kt.AlertCircle,{className:"h-3 w-3"})}},d=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return s?(0,Ar.jsx)(B,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:c,children:(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${d()}`,children:l()}),(0,Ar.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Ar.jsxs)(B,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:c,children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Ar.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${d()}`,children:[l(),(0,Ar.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Ar.jsxs)("div",{className:"flex gap-1",children:[(0,Ar.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${i()}`,children:e.priority}),(0,Ar.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,Ar.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Ar.jsx)(kt.User,{className:"h-4 w-4"}),(0,Ar.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Ar.jsx)(kt.Calendar,{className:"h-4 w-4"}),(0,Ar.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var ya=ke(require("react")),Aa=ke(require("@radix-ui/react-toggle-group"));var bi=ke(require("react")),Wo=ke(require("@radix-ui/react-toggle"));var _o=(0,Pr.cva)("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),vn=bi.forwardRef(({className:e,variant:t,size:o,...a},s)=>(0,Ar.jsx)(Wo.Root,{ref:s,className:C(_o({variant:t,size:o,className:e})),...a}));vn.displayName=Wo.Root.displayName;var wi=ya.createContext({size:"default",variant:"default"}),wa=ya.forwardRef(({className:e,variant:t,size:o,children:a,...s},r)=>(0,Ar.jsx)(Aa.Root,{ref:r,className:C("flex items-center justify-center gap-1",e),...s,children:(0,Ar.jsx)(wi.Provider,{value:{variant:t,size:o},children:a})}));wa.displayName=Aa.Root.displayName;var Na=ya.forwardRef(({className:e,children:t,variant:o,size:a,...s},r)=>{let c=ya.useContext(wi);return(0,Ar.jsx)(Aa.Item,{ref:r,className:C(_o({variant:c.variant||o,size:c.size||a}),e),...s,children:t})});Na.displayName=Aa.Item.displayName;var hn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:kt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:kt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:kt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:kt.Zap}],bn=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],Ea=({isOpen:e,onClose:t,onAddTask:o,epics:a,sprints:s,assignees:r,defaultEpicId:c})=>{let[i,l]=(0,Ot.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,Ot.useEffect)(()=>{e&&c&&l(p=>({...p,epic:c}))},[e,c]),(0,Ot.useEffect)(()=>{e&&l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"none",assignee:""})},[e]);let d=p=>{p.preventDefault(),i.name.trim()&&(o({name:i.name.trim(),description:i.description.trim(),status:"todo",priority:i.priority,type:i.type,storyPoints:i.storyPoints,epic:Number(i.epic),sprint:Number(i.sprint),assignee:i.assignee.trim()?{relationTo:"digital-colleagues",value:Number(i.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),l({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"",assignee:""}),t())},n=(p,f)=>{l(h=>({...h,[p]:f}))};return(0,Ar.jsx)(ct,{open:e,onOpenChange:t,children:(0,Ar.jsxs)(st,{className:"sm:max-w-md",children:[(0,Ar.jsx)(nt,{children:(0,Ar.jsx)(lt,{children:"Add New Task"})}),(0,Ar.jsxs)("form",{onSubmit:d,className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"name",children:"Task Title"}),(0,Ar.jsx)(G,{id:"name",value:i.name,onChange:p=>n("name",p.target.value),placeholder:"Enter task title",required:!0})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"description",children:"Description"}),(0,Ar.jsx)(be,{id:"description",value:i.description,onChange:p=>n("description",p.target.value),placeholder:"Enter task description",rows:3})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"Type"}),(0,Ar.jsx)(wa,{type:"single",value:i.type||"",onValueChange:p=>p&&n("type",p),children:hn.map(p=>{let f=p.icon;return(0,Ar.jsxs)(Na,{value:p.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Ar.jsx)(f,{className:"h-4 w-4"}),p.label]},p.value)})})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"Priority"}),(0,Ar.jsx)(wa,{type:"single",value:i.priority||"",onValueChange:p=>p&&n("priority",p),children:bn.map(p=>(0,Ar.jsx)(Na,{value:p.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:p.label},p.value))})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"points",children:"Story Points"}),(0,Ar.jsx)(G,{id:"points",type:"number",min:"1",max:"100",value:i.storyPoints,onChange:p=>n("storyPoints",parseInt(p.target.value)||1),placeholder:"Enter story points",required:!0})]}),!c&&(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"epic",children:"Epic"}),(0,Ar.jsxs)($e,{value:i.epic,onValueChange:p=>n("epic",p),children:[(0,Ar.jsx)(ze,{children:(0,Ar.jsx)(gt,{placeholder:"Select an epic"})}),(0,Ar.jsx)(Ve,{children:a.map(p=>(0,Ar.jsx)(ue,{value:p.id.toString(),children:(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)("div",{className:`w-3 h-3 rounded-full ${p.color}`}),p.name]})},p.id))})]})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Ar.jsxs)($e,{value:i.sprint,onValueChange:p=>n("sprint",p),children:[(0,Ar.jsx)(ze,{children:(0,Ar.jsx)(gt,{placeholder:"Select a sprint"})}),(0,Ar.jsxs)(Ve,{children:[(0,Ar.jsx)(ue,{value:"none",children:"No Sprint"}),s.map(p=>(0,Ar.jsx)(ue,{value:p.id.toString(),children:(0,Ar.jsx)("div",{className:"flex items-center gap-2",children:p.name})},p.id))]})]})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"sprint",children:"Assignee"}),(0,Ar.jsxs)($e,{value:i.assignee,onValueChange:p=>n("assignee",p),children:[(0,Ar.jsx)(ze,{children:(0,Ar.jsx)(gt,{placeholder:"Select an Assignee"})}),(0,Ar.jsxs)(Ve,{children:[(0,Ar.jsx)(ue,{value:"none",children:"No Assignee"}),r.map(p=>(0,Ar.jsx)(ue,{value:p.id.toString(),children:(0,Ar.jsx)("div",{className:"flex items-center gap-2",children:p.name})},p.id))]})]})]}),(0,Ar.jsxs)(Za,{children:[(0,Ar.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Ar.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Xo=({fieldName:e,value:t,label:o,multiline:a=!1,onSave:s,className:r="",disabled:c=!1})=>{let[i,l]=(0,Ot.useState)(!1),[d,n]=(0,Ot.useState)(""),p=()=>{c||(l(!0),n(t))},f=async()=>{d!==t&&await s(e,d),l(!1)},h=x=>{x.key==="Enter"&&!a||x.key==="Enter"&&x.ctrlKey&&a?f():x.key==="Escape"&&(l(!1),n(""))};return(0,Ar.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Ar.jsx)(S,{children:o}),i?a?(0,Ar.jsx)(be,{value:d,onChange:x=>n(x.target.value),onBlur:f,onKeyDown:h,autoFocus:!0,rows:4,className:"resize-none"}):(0,Ar.jsx)(G,{value:d,onChange:x=>n(x.target.value),onBlur:f,onKeyPress:h,autoFocus:!0,className:"text-lg font-medium"}):(0,Ar.jsxs)("div",{onClick:p,className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${a?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Ar.jsx)("span",{className:a?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!c&&(0,Ar.jsx)(kt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var ki=({comments:e,onAddComment:t})=>{let[o,a]=(0,Ot.useState)(""),s=c=>c.split(" ").map(i=>i[0]).join("").toUpperCase(),r=()=>{o.trim()&&(t(o),a(""))};return(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)(kt.MessageSquare,{className:"h-5 w-5"}),(0,Ar.jsx)(S,{className:"text-lg font-medium",children:"Comments"}),(0,Ar.jsx)(X,{variant:"secondary",children:e.length})]}),(0,Ar.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(c=>(0,Ar.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Ar.jsx)(Wt,{className:"h-8 w-8 mt-1",children:(0,Ar.jsx)(_t,{className:"text-xs bg-muted text-muted-foreground",children:s(c.author)})}),(0,Ar.jsxs)("div",{className:"flex-1",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Ar.jsx)("span",{className:"font-medium text-sm",children:c.author}),(0,Ar.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c.createdAt.toLocaleDateString()," at ",c.createdAt.toLocaleTimeString()]})]}),(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground",children:c.text})]})]},c.id))}),(0,Ar.jsxs)("div",{className:"flex gap-2",children:[(0,Ar.jsx)(be,{value:o,onChange:c=>a(c.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Ar.jsx)(y,{onClick:r,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,Ar.jsx)(kt.Send,{className:"h-4 w-4"})})]})]})};var So=({label:e,value:t,onValueChange:o,options:a,showColor:s=!1,disabled:r=!1})=>{let[c,i]=(0,Ot.useState)(!1),l=a.find(n=>n.value===t);return(0,Ar.jsxs)("div",{className:"space-y-1",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:e}),(0,Ar.jsxs)($e,{value:t,onValueChange:o,open:c,onOpenChange:n=>{r||i(n)},disabled:r,children:[(0,Ar.jsx)(ze,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Ar.jsxs)(X,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&i(!c),children:[s&&l?.color&&(0,Ar.jsx)("div",{className:`w-2 h-2 rounded-full ${l.color} Ar-1`}),l?.label||"Select..."]})}),(0,Ar.jsx)(Ve,{children:a.map(n=>(0,Ar.jsx)(ue,{value:n.value,children:s&&n.color?(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)("div",{className:`w-3 h-3 rounded-full ${n.color}`}),n.label]}):n.label},n.value))})]})]})};var Si=({label:e,value:t,onValueChange:o,options:a,placeholder:s="Search...",allowCustomValue:r=!1,disabled:c=!1})=>{let[i,l]=(0,Ot.useState)(!1),[d,n]=(0,Ot.useState)(""),p=a.find(u=>u.value===t),f=a.filter(u=>u.label.toLowerCase().includes(d.toLowerCase())),h=u=>{o(u),l(!1),n("")},x=()=>{r&&d.trim()&&!a.find(u=>u.value===d.trim())&&(o(d.trim()),l(!1),n(""))};return(0,Ar.jsxs)("div",{className:"space-y-1",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:e}),(0,Ar.jsxs)($e,{value:t,onValueChange:h,open:i,onOpenChange:u=>{c||l(u)},disabled:c,children:[(0,Ar.jsx)(ze,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Ar.jsx)(X,{variant:"secondary",className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!c&&l(!i),children:p?.label||t||"Select..."})}),(0,Ar.jsxs)(Ve,{children:[(0,Ar.jsx)("div",{className:"p-2",children:(0,Ar.jsx)(G,{placeholder:s,value:d,onChange:u=>n(u.target.value),onKeyDown:u=>{u.key==="Enter"&&r&&x()},className:"mb-2"})}),f.map(u=>(0,Ar.jsx)(ue,{value:u.value,children:u.label},u.value)),r&&d.trim()&&!f.find(u=>u.value===d.trim())&&(0,Ar.jsxs)(ue,{value:d.trim(),children:['Add "',d.trim(),'"']})]})]})]})};var Ke=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var xn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:kt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:kt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:kt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:kt.Zap}],yn=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var Ti=({task:e,epics:t,sprints:o,lastUpdated:a,onUpdateTask:s,onClose:r,onDelete:c,isUpdating:i=!1,isDeleting:l=!1,deleteState:d="idle",teamMembers:n})=>{let[p,f]=(0,Ot.useState)(e.storyPoints),h=(0,Ot.useRef)(null),x=(0,Ot.useCallback)((b,A)=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{s(b,A)},500)},[s]);(0,Ot.useEffect)(()=>{x("storyPoints",p?.toString()||"1")},[p]);let v=b=>b.split(" ").map(A=>A[0]).join("").toUpperCase(),u=()=>d==="loading"?(0,Ar.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Ar.jsx)(kt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):d==="success"?(0,Ar.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Ar.jsx)(kt.Check,{className:"h-3 w-3"}),"Deleted"]}):d==="error"?(0,Ar.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Ar.jsx)(kt.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Ar.jsxs)(y,{onClick:c,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:i||l,children:[(0,Ar.jsx)(kt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Ar.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Ar.jsxs)("div",{className:"space-y-4",style:{opacity:i?.6:1},children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Ar.jsx)(So,{label:"",value:e.status,onValueChange:b=>s("status",b),options:[{value:"todo",label:"To kt"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:i})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Ar.jsx)(wa,{type:"single",value:e.type||"",onValueChange:b=>b&&s("type",b),className:"grid grid-cols-2 gap-1",disabled:i,children:xn.map(b=>{let A=b.icon;return(0,Ar.jsxs)(Na,{value:b.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:i,children:[(0,Ar.jsx)(A,{className:"h-3 w-3"}),b.label]},b.value)})})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Ar.jsx)(wa,{type:"single",value:e.priority||"",onValueChange:b=>b&&s("priority",b),className:"grid grid-cols-3 gap-1",disabled:i,children:yn.map(b=>(0,Ar.jsx)(Na,{value:b.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:i,children:b.label},b.value))})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Ar.jsx)("input",{type:"number",min:"1",max:"100",value:p||1,onChange:b=>{let A=Number(b.target.value);A<1?f(1):A>100?f(100):f(A)},className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:i})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Ar.jsx)(So,{label:"",value:Ke(e.epic).toString(),onValueChange:b=>s("epicId",b),options:(t||[]).map(b=>({value:b.id.toString(),label:b?.name,color:b.color})),showColor:!0,disabled:i})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Ar.jsx)(So,{label:"",value:Ke(e.sprint).toString()||"none",onValueChange:b=>s("sprintId",b==="none"?"":b),options:[{value:"none",label:"No Sprint"},...(o||[]).map(b=>({value:b.id.toString(),label:`${b?.name}`}))],disabled:i})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Ar.jsx)(Si,{label:"",value:e.assignee?.value?.name,onValueChange:b=>s("assignee",b),options:n.map(b=>({value:`${typeof b.email=="string"?"users":"digital-colleagues"}:${b.id}`,label:b?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:i})]})]}),(0,Ar.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(y,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:i||l,children:"Close"}),u()]}),(0,Ar.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Ar.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Ar.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Ar.jsx)(kt.User,{className:"h-3 w-3"}),(0,Ar.jsx)("span",{children:"System"})]})]}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Ar.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Ar.jsx)(kt.Calendar,{className:"h-3 w-3"}),(0,Ar.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Ar.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Ar.jsx)(kt.Clock,{className:"h-3 w-3"}),(0,Ar.jsxs)("span",{children:[new Date(a).toLocaleDateString()," at"," ",new Date(a).toLocaleTimeString()]})]})]})]})]})]})};var Pi=({isOpen:e,onClose:t,initialTask:o,epics:a,sprints:s,onUpdateTask:r,onDeleteTask:c,onAddComment:i,colleagues:l})=>{let[d,n]=(0,Ot.useState)(o),[p,f]=(0,Ot.useState)(new Date),[h,x]=(0,Ot.useState)("idle"),[v,u]=(0,Ot.useState)("idle"),[b,A]=(0,Ot.useState)([]);(0,Ot.useEffect)(()=>{n(o)},[o]);let Y=async(E,ie)=>{if(ie!==d[E]){x("loading");try{let K=await r(d.id.toString(),{[E]:ie});n(K),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(K){console.log("error",K),x("error"),setTimeout(()=>x("idle"),3e3)}}},W=async(E,ie)=>{if(ie!==d[E]){x("loading");try{let K=await r(d.id.toString(),{[E]:ie});n(K),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch{x("error"),setTimeout(()=>x("idle"),3e3)}}},D=async E=>{if(i){x("loading");try{let ie=await i?.({content:E,taskId:d.id.toString()});n(ie),f(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch{x("error"),setTimeout(()=>x("idle"),3e3)}}},_=async()=>{u("loading");try{await c(d.id.toString()),u("success"),setTimeout(()=>{t(),u("idle")},1e3)}catch{u("error"),setTimeout(()=>u("idle"),3e3)}},me=h!=="loading"&&v!=="loading",I=()=>{me&&t()},z=()=>h==="loading"?(0,Ar.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Ar.jsx)(kt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Ar.jsx)("span",{children:"Updating..."})]}):h==="success"?(0,Ar.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Ar.jsx)(kt.Check,{className:"h-4 w-4"}),(0,Ar.jsx)("span",{children:"Updated successfully"})]}):h==="error"?(0,Ar.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Ar.jsx)(kt.X,{className:"h-4 w-4"}),(0,Ar.jsx)("span",{children:"Update failed"})]}):null;return(0,Ar.jsx)(ct,{open:e,onOpenChange:I,children:(0,Ar.jsxs)(st,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Ar.jsxs)(nt,{children:[(0,Ar.jsx)(lt,{className:"sr-only",children:d.name}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsx)("div",{className:"flex-1",children:z()}),!me&&(0,Ar.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Ar.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Ar.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Ar.jsx)(Xo,{fieldName:"name",value:d.name||"",label:"",onSave:Y,className:"border-b border-border pb-3",disabled:h==="loading"}),(0,Ar.jsx)(Xo,{fieldName:"description",value:d.description||"",label:"Description",multiline:!0,onSave:Y,disabled:h==="loading"}),(0,Ar.jsx)(ki,{comments:(d?.comments||[]).map(E=>({author:E.author.value.name||"",createdAt:new Date(E.timestamp),text:E.text,id:E.id||""})),onAddComment:D})]}),(0,Ar.jsx)(Ti,{task:d,epics:a,sprints:s,lastUpdated:p,onUpdateTask:W,onClose:I,onDelete:_,isUpdating:h==="loading",isDeleting:v==="loading",deleteState:v,teamMembers:l})]})]})})};var Ma=({isOpen:e,onClose:t,onAddEpic:o})=>{let[a,s]=(0,Ot.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("Ar")[0],endDate:new Date().toISOString().split("Ar")[0],progress:0}),r=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],c=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],i=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],l=n=>{n.preventDefault(),a.name.trim()&&(o({name:a.name.trim(),description:a.description.trim(),color:a.color,confidence:a.confidence,phase:a.phase,startDate:a.startDate,endDate:a.endDate,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),s({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},d=(n,p)=>{s(f=>({...f,[n]:p}))};return(0,Ar.jsx)(ct,{open:e,onOpenChange:t,children:(0,Ar.jsxs)(st,{className:"sm:max-w-md",children:[(0,Ar.jsx)(nt,{children:(0,Ar.jsx)(lt,{children:"Add New Epic"})}),(0,Ar.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"name",children:"Epic Name"}),(0,Ar.jsx)(G,{id:"name",value:a.name,onChange:n=>d("name",n.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"description",children:"Description"}),(0,Ar.jsx)(be,{id:"description",value:a.description,onChange:n=>d("description",n.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"Color"}),(0,Ar.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(n=>(0,Ar.jsx)("button",{type:"button",onClick:()=>d("color",n),className:`w-8 h-8 rounded-full ${n} ${a.color===n?"ring-2 ring-gray-400":""}`},n))})]}),(0,Ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"Confidence"}),(0,Ar.jsxs)($e,{value:a.confidence,onValueChange:n=>d("confidence",n),children:[(0,Ar.jsx)(ze,{children:(0,Ar.jsx)(gt,{})}),(0,Ar.jsx)(Ve,{children:c.map(n=>(0,Ar.jsx)(ue,{value:n.value,children:n.label},n.value))})]})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"Phase"}),(0,Ar.jsxs)($e,{value:a.phase.toString(),onValueChange:n=>d("phase",parseInt(n)),children:[(0,Ar.jsx)(ze,{children:(0,Ar.jsx)(gt,{})}),(0,Ar.jsx)(Ve,{children:i.map(n=>(0,Ar.jsx)(ue,{value:n.value.toString(),children:n.label},n.value))})]})]})]}),(0,Ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"Start Date"}),(0,Ar.jsx)(G,{type:"date",value:a.startDate,onChange:n=>d("startDate",n.target.value)})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"End Date"}),(0,Ar.jsx)(G,{type:"date",value:a.endDate,onChange:n=>d("endDate",n.target.value)})]})]}),(0,Ar.jsxs)(Za,{children:[(0,Ar.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Ar.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Ai=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:a=[],initialColleagues:s=[],initialProjects:r=[],onAddTask:c,onUpdateTask:i,onDeleteTask:l,onTaskClick:d,onAddEpic:n,onAddComment:p})=>{let[f,h]=(0,Ot.useState)(e),[x,v]=(0,Ot.useState)(t),[u,b]=(0,Ot.useState)(o),[A,Y]=(0,Ot.useState)(!1),[W,D]=(0,Ot.useState)(!1),[_,me]=(0,Ot.useState)(null),[I,z]=(0,Ot.useState)(null),[E,ie]=(0,Ot.useState)(a),[K,yt]=(0,Ot.useState)(s),[xe,at]=(0,Ot.useState)(0),Ie=(0,Ot.useRef)(null),Lt=(0,Ot.useRef)(null),Nt=x.filter(V=>!0).map(V=>V.id),St=u.find(V=>V.isSelected);Nt.push(0),(0,Ot.useEffect)(()=>{h(e)},[e]),(0,Ot.useEffect)(()=>{v(t)},[t]),(0,Ot.useEffect)(()=>{b(o)},[o]),(0,Ot.useEffect)(()=>{let V=()=>{if(Ie.current){let ot=Ie.current.offsetHeight;at(ot)}};V();let Ce=new ResizeObserver(V);Ie.current&&Ce.observe(Ie.current);let De=()=>{setTimeout(V,100)};return window.addEventListener("storage",De),()=>{Ce.disconnect(),window.removeEventListener("storage",De)}},[]),(0,Ot.useEffect)(()=>{let V=setTimeout(()=>{Ie.current&&at(Ie.current.offsetHeight)},300);return()=>clearTimeout(V)},[A,W]);let wt=f.filter(V=>!0),P=V=>wt.filter(Ce=>Ce.status===V),pe=V=>{let Ce={};return x.forEach(De=>{Ce[De.id]=V.filter(ot=>Ke(ot.epic)===De.id)}),Ce["no-epic"]=V.filter(De=>!Ke(De.epic)),Ce},Le=V=>{z(V)},mt=V=>{I&&(h(Ce=>Ce.map(De=>De.id===I.id?{...De,status:V}:De)),i?.(I.id.toString(),{status:V}),z(null))},ye=V=>{let Ce={...V,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};h(De=>[...De,Ce]),c?.(V)},pt=async(V,Ce)=>{if(h(ot=>ot.map(ut=>ut.id===Number(V)?{...ut,...Ce}:ut)),i)return await i(V,Ce);let De=f.find(ot=>ot.id===Number(V));if(!De)throw new Error("Task not found");return{...De,...Ce}},N=async V=>{h(Ce=>Ce.filter(De=>De.id!==Number(V))),_?.id===Number(V)&&me(null),l&&await l(V)},Re=V=>{let Ce={...V,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(De=>[...De,Ce]),n?.(V)},he=V=>{me(V),d?.(V)},Tt=[{id:"todo",title:"To kt",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ut=xe>0?`calc(100vh - ${xe+120}px)`:"calc(100vh - 12rem)";return(0,Ar.jsxs)("div",{ref:Lt,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Ar.jsx)("div",{ref:Ie,className:"flex-shrink-0",children:(0,Ar.jsx)(Ye,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>Y(!0)},secondaryAction:{label:"Add epic",onClick:()=>D(!0)}})}),(0,Ar.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Ar.jsx)("div",{className:"h-full",style:{height:xe>0?`calc(100vh - ${xe+120}px)`:"calc(100vh - 12rem)"},children:(0,Ar.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Tt.map(V=>{let Ce=P(V.status),De=pe(Ce);return(0,Ar.jsxs)(hi,{title:V.title,status:V.status,taskCount:Ce.length,onDrop:mt,isCompact:V.status==="done",height:Ut,children:[De["no-epic"].map(ot=>(0,Ar.jsx)(to,{epic:null,task:ot,onDragStart:Le,onTaskClick:he,isCompact:V.status==="done"})),Nt.map(ot=>{let ut=x.find(R=>R.id===ot),w=De[ot]||[];return w.length===0?null:(0,Ar.jsxs)("div",{className:"mb-6",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Ar.jsx)("div",{className:`w-3 h-3 rounded-full ${ut?.color}`}),(0,Ar.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:ut?.name||"No Epic"}),(0,Ar.jsx)(X,{variant:"secondary",className:"text-xs",children:w.length})]})," ",(0,Ar.jsx)("div",{className:"space-y-3",children:w.map(R=>(0,Ar.jsx)(to,{task:R,epic:ut,onDragStart:Le,onTaskClick:he,isCompact:V.status==="done"},R.id))})]},ot)})]},V.id)})})})}),(0,Ar.jsx)(Ea,{isOpen:A,onClose:()=>Y(!1),onAddTask:ye,assignees:[...K,...E],epics:x,sprints:u}),(0,Ar.jsx)(Ma,{isOpen:W,onClose:()=>D(!1),onAddEpic:Re}),_&&(0,Ar.jsx)(Pi,{isOpen:!!_,onClose:()=>me(null),initialTask:_,epics:x,sprints:u,onUpdateTask:pt,onDeleteTask:N,colleagues:[...K,...E],onAddComment:p})]})};var Ei=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:s,onAddTaskToEpic:r,onAddEpic:c,onUpdateEpic:i,onDeleteEpic:l})=>{let[d,n]=(0,Ot.useState)(t),[p,f]=(0,Ot.useState)(null),[h,x]=(0,Ot.useState)(null),[v,u]=(0,Ot.useState)({}),[b,A]=(0,Ot.useState)(0),[Y,W]=(0,Ot.useState)(!1),[D,_]=(0,Ot.useState)(!1),[me,I]=(0,Ot.useState)(null),z=(0,Ot.useRef)(null),E=(0,Ot.useRef)(null);(0,Ot.useEffect)(()=>{n(t)},[t]),(0,Ot.useEffect)(()=>{let P=()=>{if(z.current){let mt=z.current.offsetHeight;A(mt)}};P();let pe=new ResizeObserver(P);z.current&&pe.observe(z.current);let Le=()=>{setTimeout(P,100)};return window.addEventListener("storage",Le),()=>{pe.disconnect(),window.removeEventListener("storage",Le)}},[]),(0,Ot.useEffect)(()=>{let P=setTimeout(()=>{z.current&&A(z.current.offsetHeight)},300);return()=>clearTimeout(P)},[h]);let ie=P=>{f(P)},K=P=>{P.preventDefault()},yt=(P,pe)=>{P.preventDefault(),p&&Ke(p.epic).toString()!==pe&&(a(p.id.toString(),{epic:Number(pe)}),f(null))},xe=P=>e.filter(pe=>Ke(pe.epic).toString()===P),at=P=>{x(P.id.toString()),u({name:P.name,description:P.description,confidence:P.confidence,phase:P.phase})},Ie=async()=>{h&&v.name&&(await i(h.toString(),v),n(P=>P.map(pe=>pe.id.toString()===h?{...pe,...v}:pe)),x(null),u({}))},Lt=()=>{x(null),u({})},Nt=async P=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await l(P),n(pe=>pe.filter(Le=>Le.id.toString()!==P)))},St=P=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[P]||`Phase ${P}`,wt=P=>{switch(P){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsxs)("div",{ref:E,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Ar.jsx)("div",{ref:z,className:"flex-shrink-0",children:(0,Ar.jsx)(Ye,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>W(!0)}})}),(0,Ar.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Ar.jsx)("div",{className:"h-full overflow-y-auto",style:{height:b>0?`calc(100vh - ${b+120}px)`:"calc(100vh - 12rem)"},children:(0,Ar.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:d.map(P=>{let pe=xe(P.id.toString()),Le=pe.reduce((ye,pt)=>ye+(pt.storyPoints||0),0),mt=b>0?`calc(100vh - ${b+200}px)`:"calc(100vh - 14rem)";return(0,Ar.jsxs)(B,{className:`flex flex-col ${h===P.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:h===P.id.toString()?"auto":mt,minHeight:"400px"},onDragOver:K,onDrop:ye=>yt(ye,P.id.toString()),children:[(0,Ar.jsx)("div",{className:"p-4 border-b border-border",children:h===P.id.toString()?(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsx)(G,{value:v.name||"",onChange:ye=>u({...v,name:ye.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Ar.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Ar.jsx)(y,{size:"sm",variant:"ghost",onClick:Ie,className:"p-1 h-8 w-8",children:(0,Ar.jsx)(kt.Check,{className:"h-4 w-4"})}),(0,Ar.jsx)(y,{size:"sm",variant:"ghost",onClick:Lt,className:"p-1 h-8 w-8",children:(0,Ar.jsx)(kt.X,{className:"h-4 w-4"})})]})]}),(0,Ar.jsx)(be,{value:v.description||"",onChange:ye=>u({...v,description:ye.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Ar.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Ar.jsxs)("select",{value:v.confidence||P.confidence,onChange:ye=>u({...v,confidence:ye.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,Ar.jsx)("option",{value:"low",children:"Low"}),(0,Ar.jsx)("option",{value:"medium",children:"Medium"}),(0,Ar.jsx)("option",{value:"high",children:"High"})]})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Ar.jsx)("select",{value:v.phase?.toString()||P.phase.toString(),onChange:ye=>u({...v,phase:parseInt(ye.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(ye=>(0,Ar.jsxs)("option",{value:ye.toString(),children:["Phase ",ye]},ye))})]})]})]}):(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Ar.jsx)("div",{className:`w-4 h-4 rounded-full ${P.color}`}),(0,Ar.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:P.name}),(0,Ar.jsxs)("div",{className:"flex gap-1",children:[(0,Ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>at(P),className:"p-1 h-8 w-8",children:(0,Ar.jsx)(kt.Edit2,{className:"h-3 w-3"})}),(0,Ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>Nt(P.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Ar.jsx)(kt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Ar.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Ar.jsxs)(X,{className:`text-xs ${wt(P.confidence)}`,children:[P.confidence," confidence"]}),(0,Ar.jsxs)(X,{variant:"outline",className:"text-xs",children:["Phase ",P.phase]}),(0,Ar.jsxs)(X,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[pe.length," tasks"]}),(0,Ar.jsxs)(X,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Le," pts"]})]}),P.description&&(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:P.description}),(0,Ar.jsxs)(y,{onClick:()=>{_(!0),I(P)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Ar.jsx)(kt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Ar.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Ar.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${p?"border-primary bg-primary/10":"border-border"}`,children:pe.length===0?(0,Ar.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,Ar.jsx)(kt.Move,{className:"h-8 w-8 mb-2"}),(0,Ar.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):pe.map(ye=>(0,Ar.jsx)(to,{task:ye,epic:P,onDragStart:ie,onTaskClick:s,isCompact:!0},ye.id))})})]},P.id)})})})})]}),(0,Ar.jsx)(Ma,{isOpen:Y,onClose:()=>W(!1),onAddEpic:c}),(0,Ar.jsx)(Ea,{isOpen:D,onClose:()=>_(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:me?.id.toString()||"",sprints:o})]})};var Ii=require("react-day-picker");function To({className:e,classNames:t,showOutsideDays:o=!0,...a}){return(0,Ar.jsx)(Ii.DayPicker,{showOutsideDays:o,weekStartsOn:1,className:C("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:C(co({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:C("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:C(co({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...a})}To.displayName="Calendar";var Fi=ke(require("react")),Vt=ke(require("@radix-ui/react-popover"));var Yo=Vt.Root,Qo=Vt.Trigger;var Po=Fi.forwardRef(({className:e,align:t="center",sideOffset:o=4,...a},s)=>(0,Ar.jsx)(Vt.Portal,{children:(0,Ar.jsx)(Vt.Content,{ref:s,align:t,sideOffset:o,className:C("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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})}));Po.displayName=Vt.Content.displayName;var tr=require("date-fns");var Li=({isOpen:e,onClose:t,onAddSprint:o})=>{let[a,s]=(0,Ot.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=i=>{i.preventDefault(),!(!a.name||!a.startDate||!a.endDate)&&(o({name:a.name,description:a.description,startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),s({name:"",description:"",startDate:void 0,endDate:void 0}),t())},c=()=>{s({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Ar.jsx)(ct,{open:e,onOpenChange:c,children:(0,Ar.jsxs)(st,{className:"sm:max-w-md",children:[(0,Ar.jsx)(nt,{children:(0,Ar.jsx)(lt,{children:"Add New Sprint"})}),(0,Ar.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"name",children:"Sprint Name *"}),(0,Ar.jsx)(G,{id:"name",value:a.name,onChange:i=>s(l=>({...l,name:i.target.value})),placeholder:"e.Ar., Sprint 3",required:!0})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"description",children:"Description"}),(0,Ar.jsx)(be,{id:"description",value:a.description,onChange:i=>s(l=>({...l,description:i.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"Start Date *"}),(0,Ar.jsxs)(Yo,{children:[(0,Ar.jsx)(Qo,{asChild:!0,children:(0,Ar.jsxs)(y,{variant:"outline",className:C("w-full justify-start text-left font-normal",!a.startDate&&"text-muted-foreground"),children:[(0,Ar.jsx)(kt.CalendarIcon,{className:"Ar-2 h-4 w-4"}),a.startDate?(0,tr.format)(a.startDate,"PPP"):"Pick a date"]})}),(0,Ar.jsx)(Po,{className:"w-auto p-0",align:"start",children:(0,Ar.jsx)(To,{mode:"single",selected:a.startDate,onSelect:i=>s(l=>({...l,startDate:i})),initialFocus:!0})})]})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{children:"End Date *"}),(0,Ar.jsxs)(Yo,{children:[(0,Ar.jsx)(Qo,{asChild:!0,children:(0,Ar.jsxs)(y,{variant:"outline",className:C("w-full justify-start text-left font-normal",!a.endDate&&"text-muted-foreground"),children:[(0,Ar.jsx)(kt.CalendarIcon,{className:"Ar-2 h-4 w-4"}),a.endDate?(0,tr.format)(a.endDate,"PPP"):"Pick a date"]})}),(0,Ar.jsx)(Po,{className:"w-auto p-0",align:"start",children:(0,Ar.jsx)(To,{mode:"single",selected:a.endDate,onSelect:i=>s(l=>({...l,endDate:i})),initialFocus:!0,disabled:i=>a.startDate?i<a.startDate:!1})})]})]})]}),(0,Ar.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Ar.jsx)(y,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),(0,Ar.jsx)(y,{type:"submit",disabled:!a.name||!a.startDate||!a.endDate,children:"Add Sprint"})]})]})]})})};var Ro=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:s,onAddSprint:r,onUpdateSprint:c,onDeleteSprint:i})=>{let[l,d]=(0,Ot.useState)([]),[n,p]=(0,Ot.useState)(new Set),[f,h]=(0,Ot.useState)(null),[x,v]=(0,Ot.useState)(!1),[u,b]=(0,Ot.useState)(null),[A,Y]=(0,Ot.useState)(null),[W,D]=(0,Ot.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[_,me]=(0,Ot.useState)([]),[I,z]=(0,Ot.useState)("upcoming"),[E,ie]=(0,Ot.useState)(!1),[K,yt]=(0,Ot.useState)(0),xe=(0,Ot.useRef)(null),at=(0,Ot.useRef)(null);(0,Ot.useEffect)(()=>{let w=()=>{xe.current&&yt(xe.current.offsetHeight)};w();let R=new ResizeObserver(w);return xe.current&&R.observe(xe.current),()=>R.disconnect()},[]);let Ie=w=>t.find(R=>R.id===Number(w)),Lt=w=>o.find(R=>R.id===Number(w)),Nt=w=>{let R={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return R[w]||R.medium},St=w=>{if(!w||w?.length===0)return"";let R=w?.trim().split(" ");if(R?.length===1)return R[0];let ge=R[0],we=R[R.length-1][0].toUpperCase();return`${ge} ${we}`},wt=w=>{let R={},ge=[];return w.forEach(we=>{we.epic?(R[Ke(we.epic)]||(R[Ke(we.epic)]=[]),R[Ke(we.epic)].push(we)):ge.push(we)}),{tasksByEpic:R,unassignedTasks:ge}};(0,Ot.useEffect)(()=>{me(o)},[o]);let P=_.filter(w=>{switch(I){default:return!0}}),pe=_.filter(w=>l.includes(w.id.toString())),Le=e.filter(w=>!w.sprint||w.status==="backlog"),mt=Le.reduce((w,R)=>w+(R.storyPoints||0),0),ye=w=>{d(R=>R.includes(w)?R.filter(ge=>ge!==w):R?.length<3?[...R,w]:R)},pt=w=>{p(R=>{let ge=new Set(R);return ge.has(w)?ge.delete(w):ge.add(w),ge})},N=w=>{r(w),v(!1)},Re=w=>{Y(w.id.toString()),D({name:w.name,description:w.description||"",startDate:w.startDate?new Date(w.startDate).toISOString().split("Ar")[0]:w.startDate,endDate:w.endDate?new Date(w.endDate).toISOString().split("Ar")[0]:w.endDate,isActive:!1})},he=()=>{A&&(c(A,{name:W.name,description:W.description,startDate:W.startDate,endDate:W.endDate}),me(w=>w.map(R=>(R.id===Number(A)&&(R.name=W.name,R.description=W.description,R.startDate=W.startDate,R.endDate=W.endDate),R))),Y(null))},Tt=()=>{Y(null),D({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Ut=(w,R)=>{h(R),w.dataTransfer.effectAllowed="move"},V=w=>{w.preventDefault(),w.dataTransfer.dropEffect="move"},Ce=w=>{b(w)},De=()=>{b(null)},ot=(w,R)=>{if(w.preventDefault(),b(null),!f)return;(Ke(f.sprint)||void 0)!==Number(R)&&a(f.id.toString(),{sprint:Number(R)}),h(null)},ut=({task:w,showSprint:R=!1})=>{let ge=w.epic?Ie(Ke(w.epic).toString()):null,we=w.sprint?Lt(Ke(w.sprint).toString()):null;return(0,Ar.jsx)(B,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:ht=>{ht.dataTransfer.effectAllowed="move",ht.dataTransfer.setData("text/plain",w.id.toString()),Ut(ht,w)},onClick:ht=>{f===null&&s(w)},style:{userSelect:"none"},children:(0,Ar.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Ar.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Ar.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:w.name}),(0,Ar.jsx)(X,{className:`text-xs ${Nt(w.priority||"medium")}`,children:w.priority?.[0]?.toUpperCase()})]}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-1",children:[ge&&(0,Ar.jsx)("div",{className:`w-2 h-2 rounded-full ${ge.color}`}),(0,Ar.jsx)("span",{className:"text-muted-foreground truncate",children:ge?.name})]}),(0,Ar.jsx)("span",{className:"text-muted-foreground",children:St(w.assignee?.value?.name)})]}),R&&we&&(0,Ar.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Ar.jsx)(kt.Calendar,{className:"h-3 w-3"}),(0,Ar.jsx)("span",{children:we.name})]})]})})};return(0,Ar.jsxs)("div",{ref:at,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Ar.jsx)("div",{ref:xe,className:"flex-shrink-0",children:(0,Ar.jsx)(Ye,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>v(!0)}})}),(0,Ar.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Ar.jsxs)("div",{className:"h-full",style:{height:K>0?`calc(100vh - ${K+120}px)`:"calc(100vh - 12rem)"},children:[(0,Ar.jsxs)("div",{className:"mb-4",children:[(0,Ar.jsx)(B,{className:"p-3 bg-card shadow-sm",children:(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Ar.jsxs)("p",{className:"text-xs text-muted-foreground",children:[l?.length,"/3 selected"]})]}),l?.length>0&&(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Ar.jsx)("div",{className:"flex flex-wrap gap-1",children:pe.map(w=>(0,Ar.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Ar.jsx)("span",{className:"max-w-[80px] truncate",children:w.name}),(0,Ar.jsx)("button",{onClick:()=>ye(w.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Ar.jsx)(kt.X,{className:"h-4 w-4"})})]},w.id))})]})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsxs)(y,{onClick:()=>v(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Ar.jsx)(kt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Ar.jsxs)(y,{onClick:()=>ie(!E),variant:"outline",size:"sm",className:"gap-1",children:[(0,Ar.jsx)(kt.Calendar,{className:"h-3 w-3"}),E?"Close":"Select"]})]})]})}),E&&(0,Ar.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>ie(!1)}),(0,Ar.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${E?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Ar.jsxs)(B,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Ar.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>ie(!1),className:"h-8 w-8 p-0",children:(0,Ar.jsx)(kt.X,{className:"h-4 w-4"})})]}),(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Ar.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Ar.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:o.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(w=>(0,Ar.jsxs)(y,{variant:I===w.key?"default":"outline",size:"sm",onClick:()=>z(w.key),className:"text-xs h-8 px-3 flex-1",children:[w.label," (",w.count,")"]},w.key))}),(0,Ar.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:P.length>0?P.map(w=>{let R=l.includes(w.id.toString()),ge=e.filter(rt=>Ke(rt.sprint)===w.id).length,we=!R&&l.length<3;return(0,Ar.jsx)("div",{className:`p-3 rounded-lg border transition-all ${R?"bg-primary/10 border-primary/30":we?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:A===w.id.toString()?(0,Ar.jsxs)("div",{className:"space-y-3",children:[(0,Ar.jsx)(G,{value:W.name,onChange:rt=>D(it=>({...it,name:rt.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Ar.jsx)(be,{value:W.description,onChange:rt=>D(it=>({...it,description:rt.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Ar.jsxs)("div",{className:"flex gap-2",children:[(0,Ar.jsxs)(y,{size:"sm",onClick:()=>he(),className:"flex-1",children:[(0,Ar.jsx)(kt.Check,{className:"h-3 w-3 Ar-1"}),"Save"]}),(0,Ar.jsxs)(y,{size:"sm",variant:"outline",onClick:Tt,className:"flex-1",children:[(0,Ar.jsx)(kt.X,{className:"h-3 w-3 Ar-1"}),"Cancel"]})]})]}):(0,Ar.jsxs)("div",{children:[(0,Ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Ar.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Ar.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:w.name}),(0,Ar.jsx)(X,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Ar.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:w.description}),(0,Ar.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Ar.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Ar.jsx)(kt.CalendarDays,{className:"h-3 w-3"}),new Date(w.startDate).toLocaleDateString()]}),(0,Ar.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Ar.jsx)(kt.User,{className:"h-3 w-3"}),ge," tasks"]})]})]}),(0,Ar.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>Re(w),className:"h-6 w-6 p-0",children:(0,Ar.jsx)(kt.Edit2,{className:"h-3 w-3"})}),(0,Ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>i(w.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Ar.jsx)(kt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Ar.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,Ar.jsx)(y,{variant:R?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>ye(w.id.toString()),disabled:!R&&l?.length>=3,children:(0,Ar.jsx)("span",{className:"pointer-events-none select-none",children:R?"Deselect":l?.length>=3?"Limit Reached":"Select"})})})]})},w.id)}):(0,Ar.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Ar.jsx)(kt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Ar.jsxs)("p",{className:"text-sm",children:['No sprints found for "',I,'" filter']}),(0,Ar.jsx)(y,{variant:"link",size:"sm",onClick:()=>z("all"),className:"text-xs",children:"Show all sprints"})]})}),l?.length===0&&(0,Ar.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Ar.jsxs)("div",{className:"text-center",children:[(0,Ar.jsx)(kt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Ar.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Ar.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Ar.jsx)("div",{className:"lg:col-span-1",children:(0,Ar.jsxs)(B,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:V,onDragEnter:()=>Ce("backlog"),onDragLeave:De,onDrop:w=>ot(w,"backlog"),style:{height:K>0?`calc(100vh - ${K+200}px)`:"calc(100vh - 16rem)"},children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Ar.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsxs)(X,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[Le?.length," tasks"]}),(0,Ar.jsxs)(X,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[mt," pts"]})]})]}),(0,Ar.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${u==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:w,unassignedTasks:R}=wt(Le);return(0,Ar.jsxs)(Ar.Fragment,{children:[Object.entries(w).map(([ge,we])=>{let rt=Ie(ge);if(!rt)return null;let it=n.has(ge);return(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>pt(ge),children:[(0,Ar.jsx)("div",{className:`w-3 h-3 rounded-full ${rt.color}`}),(0,Ar.jsx)("span",{className:"font-medium text-muted-foreground",children:rt.name}),(0,Ar.jsxs)("span",{className:"text-muted-foreground",children:["(",we?.length,")"]}),(0,Ar.jsx)("div",{className:"ml-auto",children:it?(0,Ar.jsx)(kt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Ar.jsx)(kt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!it&&(0,Ar.jsx)("div",{className:"space-y-2 pl-2",children:we.map(ht=>(0,Ar.jsx)(ut,{task:ht},ht.id))})]},ge)}),R?.length>0&&(()=>{let ge=n.has("no-epic");return(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>pt("no-epic"),children:[(0,Ar.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Ar.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Ar.jsxs)("span",{className:"text-muted-foreground",children:["(",R?.length,")"]}),(0,Ar.jsx)("div",{className:"ml-auto",children:ge?(0,Ar.jsx)(kt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Ar.jsx)(kt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ge&&(0,Ar.jsx)("div",{className:"space-y-2 pl-2",children:R?.map(we=>(0,Ar.jsx)(ut,{task:we},we.id))})]})})(),Le?.length===0&&(0,Ar.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),Le?.length>0&&Object.keys(w).length===0&&R.length===0&&(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),Le?.map(ge=>(0,Ar.jsx)(ut,{task:ge},ge.id))]})]})})()})]})}),pe.map(w=>{let R=e.filter(we=>Ke(we?.sprint)===w.id),ge=R.reduce((we,rt)=>we+(rt?.storyPoints||0),0);return(0,Ar.jsxs)(B,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:V,onDragEnter:()=>Ce(w.id.toString()),onDragLeave:De,onDrop:we=>ot(we,w.id.toString()),style:{height:K>0?`calc(100vh - ${K+200}px)`:"calc(100vh - 16rem)"},children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Ar.jsx)("div",{children:(0,Ar.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:w.name})}),(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsxs)(X,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[R?.length," tasks"]}),(0,Ar.jsxs)(X,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[ge," pts"]}),(0,Ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>{ie(!0),Re(w)},className:"h-6 px-2",children:(0,Ar.jsx)(kt.Edit2,{className:"h-3 w-3"})}),(0,Ar.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>i(w.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Ar.jsx)(kt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Ar.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:we,unassignedTasks:rt}=wt(R);return(0,Ar.jsxs)(Ar.Fragment,{children:[Object.entries(we).map(([it,ht])=>{let ja=Ie(it);if(!ja)return null;let Oa=n.has(it);return(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>pt(it),children:[(0,Ar.jsx)("div",{className:`w-3 h-3 rounded-full ${ja.color}`}),(0,Ar.jsx)("span",{className:"font-medium text-muted-foreground",children:ja.name}),(0,Ar.jsxs)("span",{className:"text-muted-foreground",children:["(",ht?.length,")"]}),(0,Ar.jsx)("div",{className:"ml-auto",children:Oa?(0,Ar.jsx)(kt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Ar.jsx)(kt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Oa&&(0,Ar.jsx)("div",{className:"space-y-2 pl-2",children:ht?.map(Ha=>(0,Ar.jsx)(ut,{task:Ha},Ha.id))})]},it)}),rt?.length>0&&(()=>{let it=n.has("no-epic");return(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>pt("no-epic"),children:[(0,Ar.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Ar.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Ar.jsxs)("span",{className:"text-muted-foreground",children:["(",rt?.length,")"]}),(0,Ar.jsx)("div",{className:"ml-auto",children:it?(0,Ar.jsx)(kt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Ar.jsx)(kt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!it&&(0,Ar.jsx)("div",{className:"space-y-2 pl-2",children:rt?.map(ht=>(0,Ar.jsx)(ut,{task:ht},ht.id))})]})})(),R?.length===0&&(0,Ar.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},w.id)})]}),(0,Ar.jsx)(Li,{isOpen:x,onClose:()=>v(!1),onAddSprint:N})]})})]})};var wn=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Nn=e=>{let[t,o]=e.split(":"),a=new Date;return a.setHours(parseInt(t),parseInt(o)),a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},ar=(e,t)=>{let o=new Date,a=new Date(e);if(t){let[s,r]=t.split(":");a.setHours(parseInt(s),parseInt(r))}return a<o},or=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Cn=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},kn=({colleagues:e,onAddReminder:t,open:o,setOpen:a})=>{let[s,r]=(0,Ot.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[c,i]=(0,Ot.useState)(!1),l=n=>{if(n.preventDefault(),!e.find(h=>h?.id.toString()===s.colleagueId.toString())){console.error("No valid colleague selected"),i(!0);return}i(!1);let f={title:s.title,description:s.description,dueDate:new Date(s.dueDate).toISOString(),dueTime:s.dueTime||void 0,isRecurring:s.isRecurring,assignedColleague:Number(s.colleagueId),project:1,updatedAt:new Date().toISOString()};t(f),a(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Ot.useEffect)(()=>{s.colleagueId&&i(!1)},[s.colleagueId]);let d=e.filter(Boolean);return(0,Ar.jsx)(ct,{open:o,onOpenChange:a,children:(0,Ar.jsxs)(st,{className:"max-w-2xl",children:[(0,Ar.jsx)(nt,{children:(0,Ar.jsx)(lt,{children:"Add New Reminder"})}),(0,Ar.jsxs)("form",{onSubmit:l,className:"space-y-4",children:[(0,Ar.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"title",children:"Title"}),(0,Ar.jsx)(G,{id:"title",value:s.title,onChange:n=>r({...s,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"description",children:"Description"}),(0,Ar.jsx)(be,{id:"description",value:s.description,onChange:n=>r({...s,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"dueDate",children:"Due Date"}),(0,Ar.jsx)(G,{id:"dueDate",type:"date",value:s.dueDate,onChange:n=>r({...s,dueDate:n.target.value}),required:!0})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Ar.jsx)(G,{id:"dueTime",type:"time",value:s.dueTime,onChange:n=>r({...s,dueTime:n.target.value})})]})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{className:`${c?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Ar.jsxs)($e,{value:s.colleagueId,onValueChange:n=>{r({...s,colleagueId:n})},required:!0,children:[(0,Ar.jsx)(ze,{className:`${c?"text-destructive border-red-500":""}`,children:(0,Ar.jsx)(gt,{className:`${c?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(n=>n?.id.toString()===s.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Ar.jsx)(Ve,{children:d.map(n=>(0,Ar.jsx)(ue,{value:n.id.toString(),children:n.name},n.id))})]}),c&&(0,Ar.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ar.jsx)("input",{type:"checkbox",id:"isRecurring",checked:s.isRecurring,onChange:n=>r({...s,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,Ar.jsx)(S,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),s.isRecurring&&(0,Ar.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Ar.jsxs)($e,{value:s.recurrencePattern,onValueChange:n=>r({...s,recurrencePattern:n}),children:[(0,Ar.jsx)(ze,{children:(0,Ar.jsx)(gt,{})}),(0,Ar.jsxs)(Ve,{children:[(0,Ar.jsx)(ue,{value:"daily",children:"Daily"}),(0,Ar.jsx)(ue,{value:"weekly",children:"Weekly"}),(0,Ar.jsx)(ue,{value:"monthly",children:"Monthly"}),(0,Ar.jsx)(ue,{value:"yearly",children:"Yearly"})]})]})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Ar.jsx)(G,{id:"recurrenceInterval",type:"number",min:"1",value:s.recurrenceInterval,onChange:n=>r({...s,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),(0,Ar.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Ar.jsx)(y,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,Ar.jsx)(y,{type:"submit",children:"Add Reminder"})]})]})]})})},Dn=({reminder:e,colleagues:t,onUpdateReminder:o,open:a,onClose:s})=>{let[r,c]=(0,Ot.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("Ar")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),i=d=>{d.preventDefault(),o(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),s()},l=t.filter(Boolean);return(0,Ar.jsx)(ct,{open:a,onOpenChange:s,children:(0,Ar.jsxs)(st,{className:"max-w-2xl",children:[(0,Ar.jsx)(nt,{children:(0,Ar.jsx)(lt,{children:"Edit Reminder"})}),(0,Ar.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Ar.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"edit-title",children:"Title"}),(0,Ar.jsx)(G,{id:"edit-title",value:r.title,onChange:d=>c({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"edit-description",children:"Description"}),(0,Ar.jsx)(be,{id:"edit-description",value:r.description||"",onChange:d=>c({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Ar.jsx)(G,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:d=>c({...r,dueDate:d.target.value}),required:!0})]}),(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)(S,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Ar.jsx)(G,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:d=>c({...r,dueTime:d.target.value})})]})]}),(0,Ar.jsx)("div",{className:"space-y-2",children:(0,Ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ar.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:d=>c({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Ar.jsx)(S,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Ar.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Ar.jsx)(y,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,Ar.jsx)(y,{type:"submit",children:"Save Changes"})]})]})]})})},Sn=({reminder:e,colleagues:t,onUpdateReminder:o,onDeleteReminder:a})=>{let[s,r]=(0,Ot.useState)(!1);if(!e||!e.id)return null;let c=ar(new Date(e.dueDate||""),e.dueTime||""),i=or(new Date(e.dueDate||"")),l=Cn(new Date(e.dueDate||"")),d=()=>{o(e.id.toString(),{})},n=()=>i?"Today":l?"Tomorrow":wn(new Date(e.dueDate||""));return(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsx)(Dn,{reminder:e,colleagues:t,onUpdateReminder:o,open:s,onClose:()=>r(!1)}),(0,Ar.jsx)(B,{children:(0,Ar.jsx)(se,{className:"p-4",children:(0,Ar.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Ar.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Ar.jsx)("button",{onClick:d,className:"mt-1 text-primary hover:text-primary/80"}),(0,Ar.jsxs)("div",{className:"flex-1",children:[(0,Ar.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Ar.jsx)("h3",{children:e.title})}),(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Ar.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Ar.jsx)("div",{className:"flex items-center space-x-1",children:(0,Ar.jsx)(kt.Calendar,{className:"h-4 w-4"})}),e.dueTime&&(0,Ar.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Ar.jsx)(kt.Clock,{className:"h-4 w-4"}),(0,Ar.jsx)("span",{children:Nn(e.dueTime)})]}),(0,Ar.jsx)("div",{className:"flex items-center space-x-1",children:(0,Ar.jsx)(kt.User,{className:"h-4 w-4"})})]})]})]}),(0,Ar.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Ar.jsx)(kt.Edit2,{className:"h-4 w-4"})}),(0,Ar.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>a(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Ar.jsx)(kt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},ji=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:o,onUpdateReminder:a,onDeleteReminder:s})=>{let[r,c]=(0,Ot.useState)(e.filter(Boolean)),[i]=(0,Ot.useState)(t.filter(Boolean)),[l,d]=(0,Ot.useState)("all"),[n,p]=(0,Ot.useState)(""),[f,h]=(0,Ot.useState)(!1),x=D=>{if(!D.title){console.error("Invalid reminder data:",D);return}let _={...D,id:Date.now(),createdAt:new Date().toISOString()};c(me=>[...me,_]),o?.(D)},v=(D,_)=>{if(!D){console.error("No reminder ID provided for update");return}c(me=>me.map(I=>I?.id.toString()===D?{...I,..._}:I)),a?.(D,_)},u=D=>{if(!D){console.error("No reminder ID provided for deletion");return}c(_=>_.filter(me=>me?.id.toString()!==D)),s?.(D)},A=r.filter(D=>{if(!D)return!1;if(n){let _=n.toLowerCase();if(!(D.title.toLowerCase().includes(_)||D.description?.toLowerCase().includes(_)))return!1}switch(l){case"pending":case"completed":case"overdue":return ar(new Date(D.dueDate||""),D.dueTime||"");case"today":return or(new Date(D.dueDate||""));default:return!0}}).sort((D,_)=>{if(!D||!_)return 0;let me={high:3,medium:2,low:1},I=0;return I!==0?I:new Date(D.dueDate||"").getTime()-new Date(_.dueDate||"").getTime()}),Y={total:r.filter(Boolean).length,overdue:r.filter(D=>D&&ar(new Date(D.dueDate||""),D.dueTime||"")).length,today:r.filter(D=>D&&or(new Date(D.dueDate||""))).length},W=i.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Ar.jsx)(Ye,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{h(!0)}}}),(0,Ar.jsxs)("div",{className:"h-full bg-background",children:[(0,Ar.jsx)(kn,{colleagues:i,onAddReminder:x,open:f,setOpen:h}),(0,Ar.jsxs)("div",{className:"p-6",children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Ar.jsxs)("div",{children:[(0,Ar.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Ar.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Ar.jsxs)(y,{className:"flex items-center space-x-2",onClick:()=>h(!0),children:[(0,Ar.jsx)(kt.Plus,{className:"h-4 w-4"}),(0,Ar.jsx)("span",{children:"Add Reminder"})]})]}),(0,Ar.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Ar.jsxs)(B,{className:"p-4",children:[(0,Ar.jsx)("div",{className:"text-2xl font-bold text-foreground",children:Y.total}),(0,Ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Ar.jsxs)(B,{className:"p-4",children:[(0,Ar.jsx)("div",{className:"text-2xl font-bold text-primary",children:Y.overdue}),(0,Ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Ar.jsxs)(B,{className:"p-4",children:[(0,Ar.jsx)("div",{className:"text-2xl font-bold text-success",children:Y.today}),(0,Ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Ar.jsxs)(B,{className:"p-4",children:[(0,Ar.jsx)("div",{className:"text-2xl font-bold text-destructive",children:Y.overdue}),(0,Ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Ar.jsxs)(B,{className:"p-4",children:[(0,Ar.jsx)("div",{className:"text-2xl font-bold text-warning",children:Y.today}),(0,Ar.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Ar.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Ar.jsx)("div",{className:"flex-1",children:(0,Ar.jsx)(G,{placeholder:"Search reminders...",value:n,onChange:D=>p(D.target.value),className:"max-w-md"})}),(0,Ar.jsxs)($e,{value:l,onValueChange:D=>d(D),children:[(0,Ar.jsx)(ze,{className:"w-40",children:(0,Ar.jsx)(gt,{})}),(0,Ar.jsxs)(Ve,{children:[(0,Ar.jsxs)(ue,{value:"all",children:["All (",Y.total,")"]}),(0,Ar.jsxs)(ue,{value:"overdue",children:["Overdue (",Y.overdue,")"]}),(0,Ar.jsxs)(ue,{value:"overdue",children:["Overdue (",Y.overdue,")"]}),(0,Ar.jsxs)(ue,{value:"today",children:["Today (",Y.today,")"]})]})]})]}),(0,Ar.jsx)("div",{className:"space-y-4",children:A.length===0?(0,Ar.jsxs)(B,{className:"p-8 text-center",children:[(0,Ar.jsx)("div",{className:"text-muted-foreground",children:n||l!=="all"?"No reminders match your filters":"No reminders yet"}),!n&&l==="all"&&(0,Ar.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder to get started"})]}):A.map(D=>D&&(0,Ar.jsx)(Sn,{reminder:D,colleagues:i,onUpdateReminder:v,onDeleteReminder:u},D.id))})]})]})]})};var Oi=require("next/navigation");function rr({title:e="",initialTasks:t=[],initialEpics:o=[],initialSprints:a=[],initialProjects:s=[],initialReminders:r=[],initialColleagues:c=[],initialUsers:i=[],initialFiles:l=[],initialView:d="kanban",onAddTask:n,onUpdateTask:p,onDeleteTask:f,onTaskClick:h,onAddEpic:x,onUpdateEpic:v,onDeleteEpic:u,onAddTaskToEpic:b,onAddSprint:A,onUpdateSprint:Y,onDeleteSprint:W,onAddProject:D,onUpdateProject:_,onDeleteProject:me,onFileAdd:I,onFileEdit:z,onFileDelete:E,onFileClick:ie,onAddReminder:K,onUpdateReminder:yt,onDeleteReminder:xe,onViewChange:at,onToggleMobileMenu:Ie,onTeamClick:Lt,onTeamChange:Nt,onCopilotClick:St,handleAddComment:wt}){let[P,pe]=(0,Ot.useState)(t),[Le,mt]=(0,Ot.useState)(o),[ye,pt]=(0,Ot.useState)(a),[N,Re]=(0,Ot.useState)(s),[he,Tt]=(0,Ot.useState)(r),[Ut,V]=(0,Ot.useState)(c),[Ce,De]=(0,Ot.useState)(i),[ot,ut]=(0,Ot.useState)(l),[w,R]=(0,Ot.useState)(!1),[ge,we]=(0,Ot.useState)(!1),[rt,it]=(0,Ot.useState)(null),[ht,ja]=(0,Ot.useState)(null),[Oa,Ha]=(0,Ot.useState)(null),[ca,ur]=(0,Ot.useState)(d||"kanban"),[Pn,Ji]=(0,Ot.useState)(!1),Zi=(0,Oi.useRouter)();(0,Ot.useEffect)(()=>{pe(t)},[t]),(0,Ot.useEffect)(()=>{pt(a)},[a]),(0,Ot.useEffect)(()=>{mt(o)},[o]),(0,Ot.useEffect)(()=>{Re(s)},[s]),(0,Ot.useEffect)(()=>{ut(l)},[l]),(0,Ot.useEffect)(()=>{De(i)},[i]),(0,Ot.useEffect)(()=>{V(c)},[c]),(0,Ot.useEffect)(()=>{Tt(r)},[r]),(0,Ot.useEffect)(()=>{ur(d)},[d]);let Yi=P.filter(k=>{}),Rn=k=>Yi.filter($=>$.status===k),An=k=>{let $={};return Le.forEach(te=>{}),$},En=k=>{Ha(k)},In=k=>{Oa&&(pe($=>$.map(te=>te.id===Oa.id?{...te,status:k}:te)),Ha(null))},gr=k=>{let $={...k,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};pe(te=>[...te,$]),n?.($)},no=async(k,$)=>(pe(te=>te.map(Xe=>Xe.id===Number(k)?{...Xe,...$}:Xe)),await p?.(k,$)),Mn=async(k,$)=>{no(k,$)},fr=k=>{pe($=>$.filter(te=>te.id!==Number(k))),rt?.id===Number(k)&&it(null),f?.(k)},Fn=async k=>{fr(k)},Bn=k=>{let $={...k,id:Date.now()};Re(te=>[...te,$]),D?.(k)},Ln=(k,$)=>{Re(te=>te.map(Xe=>Xe.id===Number(k)?{...Xe,...$}:Xe)),_?.(k,$)},jn=k=>{Re($=>$.filter(te=>te.id!==Number(k))),me?.(k)},vr=k=>{let $={...k,id:Date.now()};mt(te=>[...te,$]),x?.({...$})},Qi=()=>{we(!0)},es=(k,$)=>{mt(te=>te.map(Xe=>Xe.id===Number(k)?{...Xe,...$}:Xe)),v?.(k,$)},ts=k=>{mt($=>$.filter(te=>te.id!==Number(k))),pe($=>$.filter(te=>Ke(te.epic)!==Number(k))),u?.(k)},as=k=>{let $={...k,id:Date.now()};pt(te=>[...te,$]),A?.(k)},os=(k,$)=>{pt(te=>te.map(Xe=>Xe.id===Number(k)?{...Xe,...$}:Xe)),Y?.(k,$)},rs=k=>{k==="backlog"||k==="all-tasks"||(pt($=>$.filter(te=>te.id!==Number(k))),pe($=>$.map(te=>Ke(te.sprint)===Number(k)?{...te,sprint:void 0}:te)),W?.(k))},Fo=k=>{it(k)},is=k=>{k==="planning"&&window.innerWidth<768||(ur(k),at?.(k))},On=()=>{Ji(k=>!k),Ie?.()},Hn=()=>{Zi.push("/")},zn=k=>{console.log("Switching to team:",k)},Vn=k=>{console.log("Switching to team:",k)},ss=k=>{R(!0)},ns=()=>{R(!1),ja(null)},ls=k=>{let $={...k,id:Date.now(),createdAt:new Date().toISOString()};Tt(te=>[...te,$]),K?.(k)},ds=(k,$)=>{Tt(te=>te.map(Xe=>Xe.id===Number(k)?{...Xe,...$}:Xe)),yt?.(k,$)},cs=k=>{Tt($=>$.filter(te=>te.id!==Number(k))),xe?.(k)},ms=()=>{I?.()},ps=k=>{z?.(k)},us=k=>{ut($=>$.filter(te=>te.name!==k)),E?.(k)},gs=k=>{ie?.(k)},Un=[{id:"todo",title:"To kt",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Kn=()=>{switch(ca){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},Bo=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],$n=Bo.sort((k,$)=>$.lastUsed.getTime()-k.lastUsed.getTime()).slice(0,3),Gn=Bo.length>3,Wn=Bo.slice(3);return(0,Ar.jsxs)(vi,{currentView:ca,onViewChange:is,children:[ca==="kanban"&&(0,Ar.jsx)("div",{className:"h-full overflow-hidden",children:(0,Ar.jsx)(Ai,{initialProjects:N,initialEpics:Le,initialSprints:ye.map(k=>({...k,isSelected:!1})),initialTasks:P,initialColleagues:Ut,initialUsers:Ce,onAddTask:gr,onUpdateTask:no,onDeleteTask:fr,onTaskClick:Fo,onAddEpic:vr,onAddComment:wt})}),ca==="planning"&&(0,Ar.jsx)("div",{className:"hidden md:block h-full",children:(0,Ar.jsx)(Ro,{tasks:P,epics:Le,sprints:ye,onUpdateTask:no,onTaskClick:Fo,onAddSprint:as,onUpdateSprint:os,onDeleteSprint:rs})}),ca==="tasks"&&(0,Ar.jsx)("div",{className:"h-full",children:(0,Ar.jsx)(ji,{initialReminders:he,initialColleagues:Ut,onAddReminder:ls,onUpdateReminder:ds,onDeleteReminder:cs})}),ca==="files"&&(0,Ar.jsx)("div",{className:"h-full",children:(0,Ar.jsx)(eo,{initialFiles:ot,onFileAdd:ms,onFileEdit:ps,onFileDelete:us,onFileClick:gs,compactView:!1})}),ca==="epics"&&(0,Ar.jsx)("div",{className:"h-full",children:(0,Ar.jsx)(Ei,{tasks:P,epics:Le,sprints:ye,onUpdateTask:no,onTaskClick:Fo,onAddTaskToEpic:ss,onAddEpic:Qi,onUpdateEpic:es,onDeleteEpic:ts})}),(0,Ar.jsx)(Ea,{isOpen:w,onClose:ns,onAddTask:gr,epics:Le,sprints:ye,assignees:[...Ut,...Ce],defaultEpicId:ht||void 0}),(0,Ar.jsx)(Ma,{isOpen:ge,onClose:()=>we(!1),onAddEpic:vr})]})}var Hi=ke(require("react")),oo=ke(require("@radix-ui/react-progress"));var sr=Hi.forwardRef(({className:e,value:t,...o},a)=>(0,Ar.jsx)(oo.Root,{ref:a,className:C("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...o,children:(0,Ar.jsx)(oo.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));sr.displayName=oo.Root.displayName;function Vi({project:e,onOpen:t,onShare:o,className:a}){return(0,Ar.jsx)(Ho.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Ar.jsxs)(B,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Ar.jsxs)(Ee,{children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ar.jsx)(je,{children:e.name}),(0,Ar.jsxs)(X,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Ar.jsx)(Ua,{children:e.description})]}),(0,Ar.jsxs)(se,{className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Ar.jsx)("span",{children:"Progress"}),(0,Ar.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Ar.jsx)(sr,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Ar.jsxs)("div",{className:"flex items-center",children:[(0,Ar.jsx)(kt.Users,{className:"Ar-1 h-4 w-4"}),e.members," members"]}),(0,Ar.jsxs)("div",{className:"flex items-center",children:[(0,Ar.jsx)(kt.FileText,{className:"Ar-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Ar.jsxs)(Ka,{className:"flex gap-2",children:[(0,Ar.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Ar.jsx)(y,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>o?.(e),children:(0,Ar.jsx)(kt.Share2,{className:"h-4 w-4"})})]})]})})}var ro=ke(require("@radix-ui/react-checkbox")),Ki=ke(require("react")),nr=Ki.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(ro.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,Ar.jsx)(ro.Indicator,{className:C("flex items-center justify-center text-current"),children:(0,Ar.jsx)(kt.Check,{className:"h-4 w-4"})})}));nr.displayName=ro.Root.displayName;var $i=({onSubmit:e,onCancel:t,isLoading:o=!1,initialData:a,className:s=""})=>{let[r,c]=(0,Ot.useState)({name:a?.name||"",description:a?.description||"",objectives:a?.objectives||"",workInstructions:a?.workInstructions||"",plan:a?.plan||!1}),[i,l]=(0,Ot.useState)({}),d=()=>{let f={};return r.name.trim()?r.name.trim().length<3&&(f.name="Project name must be at least 3 characters"):f.name="Project name is required",r.objectives.trim()?r.objectives.trim().length<10&&(f.objectives="Please provide more detailed objectives (at least 10 characters)"):f.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(f.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):f.workInstructions="Work instructions are required",l(f),Object.keys(f).length===0},n=async f=>{if(f.preventDefault(),!!d())try{await e(r)}catch(h){console.error("Error submitting project form:",h)}},p=(f,h)=>{c(x=>({...x,[f]:h})),i[f]&&l(x=>({...x,[f]:void 0}))};return(0,Ar.jsxs)("div",{className:`w-full max-w-2xl ${s}`,children:[(0,Ar.jsxs)("div",{className:"mb-4",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)(kt.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Ar.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,Ar.jsxs)("form",{onSubmit:n,children:[(0,Ar.jsxs)("div",{className:"space-y-6",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Ar.jsx)(G,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:f=>p("name",f.target.value),className:i.name?"border-red-500 focus:border-red-500":"",disabled:o,maxLength:100}),i.name&&(0,Ar.jsx)("p",{className:"text-sm text-red-600",children:i.name})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Ar.jsx)(G,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:f=>p("description",f.target.value),className:i.description?"border-red-500 focus:border-red-500":"",disabled:o,maxLength:100}),i.description&&(0,Ar.jsx)("p",{className:"text-sm text-red-600",children:i.description})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Ar.jsx)(be,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:f=>p("objectives",f.target.value),className:`min-h-[100px] resize-y ${i.objectives?"border-red-500 focus:border-red-500":""}`,disabled:o,maxLength:1e3}),(0,Ar.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Ar.jsx)("span",{children:i.objectives&&(0,Ar.jsx)("span",{className:"text-red-600",children:i.objectives})}),(0,Ar.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Ar.jsx)(be,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:f=>p("workInstructions",f.target.value),className:`min-h-[120px] resize-y ${i.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:o,maxLength:2e3}),(0,Ar.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Ar.jsx)("span",{children:i.workInstructions&&(0,Ar.jsx)("span",{className:"text-red-600",children:i.workInstructions})}),(0,Ar.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Ar.jsxs)("div",{className:"space-y-3",children:[(0,Ar.jsx)(S,{className:"text-sm font-medium",children:"Project Management"}),(0,Ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ar.jsx)(nr,{id:"plan",checked:r.plan,onCheckedChange:f=>p("plan",f===!0),disabled:o}),(0,Ar.jsx)(S,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Ar.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,Ar.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Ar.jsxs)(y,{type:"button",variant:"outline",onClick:t,disabled:o,className:"flex items-center gap-2",children:[(0,Ar.jsx)(kt.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Ar.jsx)(y,{type:"submit",disabled:o,className:"flex items-center gap-2",children:o?(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsx)(kt.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Ar.jsxs)(Ar.Fragment,{children:[(0,Ar.jsx)(kt.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function cr({projects:e=[],onAddProject:t,handleProjectOpen:o,handleProjectShare:a}){let[s,r]=(0,Ot.useState)(!1),[c,i]=(0,Ot.useState)(!1),l=async n=>{i(!0);try{await t(n),r(!1)}catch(p){console.error("Error creating project:",p)}finally{i(!1)}},d=()=>{r(!0)};return(0,Ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Ar.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Ar.jsx)(Ye,{title:"Project Management",description:"Organize your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:d}}),(0,Ar.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Ar.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Ar.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,Ar.jsx)(Vi,{project:n,onOpen:o,onShare:a},n.id))})]})]},"projects-index-view")}),(0,Ar.jsx)(ct,{open:s,onOpenChange:r,children:(0,Ar.jsxs)(st,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Ar.jsxs)(nt,{className:"sr-only",children:[(0,Ar.jsx)(lt,{children:"Create New Project"}),(0,Ar.jsx)(Ya,{children:"Fill out the form below to create a new project."})]}),(0,Ar.jsx)($i,{onSubmit:l,onCancel:()=>r(!1),isLoading:c,className:"border-0 shadow-none"})]})})]})}function Wi({team:e,onOpen:t,className:o}){return(0,Ar.jsx)(Ho.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Ar.jsxs)(B,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Ar.jsxs)(Ee,{children:[(0,Ar.jsx)(je,{className:"text-lg",children:e.name}),(0,Ar.jsx)(Ua,{className:"mt-1 text-sm",children:e.description})]}),(0,Ar.jsxs)(se,{className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Ar.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)(kt.Users,{className:"h-4 w-4 text-blue-500"}),(0,Ar.jsx)("span",{children:"Human"})]}),(0,Ar.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)(kt.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Ar.jsx)("span",{children:"Digital"})]}),(0,Ar.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Ar.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,Ar.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ar.jsx)(kt.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Ar.jsx)("span",{children:"Projects"})]}),(0,Ar.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Ar.jsx)(Ka,{className:"flex gap-2",children:(0,Ar.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}var _i=ke(require("react")),io=ke(require("@radix-ui/react-switch"));var La=_i.forwardRef(({className:e,...t},o)=>(0,Ar.jsx)(io.Root,{className:C("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:o,children:(0,Ar.jsx)(io.Thumb,{className:C("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));La.displayName=io.Root.displayName;function qi({team:e,onSave:t,onCancel:o,isLoading:a=!1,title:s,submitLabel:r,cancelLabel:c="Cancel",readOnly:i=!1}){let[l,d]=(0,Ot.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[n,p]=(0,Ot.useState)(!i);(0,Ot.useEffect)(()=>{e&&d(e)},[e]);let f=u=>{u.preventDefault();let b={id:l.id||Date.now(),name:l.name,description:l.description||null,systemMsg:l.systemMsg||null,useProjects:l.useProjects||!1,useKnowledge:l.useKnowledge||!1,useFiles:l.useFiles||!1,useChat:l.useChat||!1,updatedAt:new Date().toISOString(),createdAt:l.createdAt||new Date().toISOString()};t(b)},h=u=>{u.preventDefault(),p(!n)},x=s||(n?e?"Edit Team":"Create New Team":"View Team"),v=r||(e?"Update Team":"Create Team");return(0,Ar.jsxs)(B,{className:"Ar-8 w-full max-w-4xl mx-auto",children:[(0,Ar.jsx)(Ee,{children:(0,Ar.jsxs)(je,{className:"flex items-center gap-2",children:[(0,Ar.jsx)(kt.Users,{className:"h-5 w-5"}),x]})}),(0,Ar.jsx)(se,{children:(0,Ar.jsxs)("form",{onSubmit:f,className:"space-y-6",children:[(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"name",children:"Team Name *"}),(0,Ar.jsx)(G,{id:"name",value:l.name||"",onChange:u=>d({...l,name:u.target.value}),required:!0,disabled:a||!n,placeholder:"Enter team name..."})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"description",children:"Description"}),(0,Ar.jsx)(be,{id:"description",value:l.description||"",onChange:u=>d({...l,description:u.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:a||!n})]}),(0,Ar.jsxs)("div",{className:"space-y-2",children:[(0,Ar.jsx)(S,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Ar.jsx)(be,{id:"systemMsg",value:l.systemMsg||"",onChange:u=>d({...l,systemMsg:u.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:a||!n})]})]}),(0,Ar.jsxs)("div",{className:"space-y-4",children:[(0,Ar.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Ar.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ar.jsx)(La,{id:"useProjects",checked:l.useProjects||!1,onCheckedChange:u=>d({...l,useProjects:u}),disabled:a||!n}),(0,Ar.jsx)(S,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ar.jsx)(La,{id:"useKnowledge",checked:l.useKnowledge||!1,onCheckedChange:u=>d({...l,useKnowledge:u}),disabled:a||!n}),(0,Ar.jsx)(S,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ar.jsx)(La,{id:"useFiles",checked:l.useFiles||!1,onCheckedChange:u=>d({...l,useFiles:u}),disabled:a||!n}),(0,Ar.jsx)(S,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Ar.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ar.jsx)(La,{id:"useChat",checked:l.useChat||!1,onCheckedChange:u=>d({...l,useChat:u}),disabled:a||!n}),(0,Ar.jsx)(S,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Ar.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Ar.jsx)(y,{type:"button",variant:"outline",onClick:o,disabled:a,children:n?c:"Close"}),n?(0,Ar.jsx)(y,{type:"submit",disabled:a||!l.name?.trim(),children:a?"Saving...":v}):(0,Ar.jsxs)(y,{type:"button",onClick:h,disabled:a,className:"gap-2",children:[(0,Ar.jsx)(kt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function pr({teams:e=[],onCreateTeam:t,onTeamOpen:o}){let[a,s]=(0,Ot.useState)(!1),r=()=>{s(!0)},c=d=>{t?.(d),s(!1)},i=()=>{s(!1)},l=d=>{o?.(d)};return(0,Ar.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Ar.jsx)(Ho.AnimatePresence,{mode:"wait",children:(0,Ar.jsxs)(Ho.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Ar.jsx)(Ye,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-to-r from-blue-600 via-cyan-600 to-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,Ar.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Ar.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Ar.jsxs)("div",{className:"text-center py-12",children:[(0,Ar.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'Ar not part of any teams yet."}),(0,Ar.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team or ask to be added to an existing one."})]}):(0,Ar.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Ar.jsx)(Wi,{team:d,onOpen:l},d.id))})]})]},"teams-index-view")}),(0,Ar.jsx)(ct,{open:a,onOpenChange:s,children:(0,Ar.jsxs)(st,{className:"max-w-4xl max-h-[90vh] overflow-y-auto p-0",children:[(0,Ar.jsx)("div",{className:"sr-only",children:(0,Ar.jsxs)(nt,{children:[(0,Ar.jsx)(lt,{children:"Create New Team"}),(0,Ar.jsx)(Ya,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,Ar.jsx)(qi,{title:"Create New Team",submitLabel:"Create Team",onSave:c,onCancel:i})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,PlanningView,ProjectView,ProjectsIndexView,TeamsIndexView});