cortex-react-components 2.26.2 → 2.26.3

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 (152) hide show
  1. package/dist/{chunk-P7S6XFU4.mjs → chunk-23XORW7A.mjs} +1 -1
  2. package/dist/{chunk-3HNU2NYP.mjs → chunk-2GZQYAN3.mjs} +1 -1
  3. package/dist/{chunk-FE7ZGUPU.mjs → chunk-4NHQXOKZ.mjs} +1 -1
  4. package/dist/{chunk-RGOKBIQ5.mjs → chunk-5KS3DITB.mjs} +1 -1
  5. package/dist/{chunk-AJQHGVZ5.mjs → chunk-66ODXUVL.mjs} +1 -1
  6. package/dist/{chunk-RS4VD3ML.mjs → chunk-67PJ7D4O.mjs} +1 -1
  7. package/dist/{chunk-JCWFPKF3.mjs → chunk-6LY5CH7J.mjs} +1 -1
  8. package/dist/{chunk-5NIEZE7A.mjs → chunk-AGWQ5S2Z.mjs} +1 -1
  9. package/dist/chunk-AN744MXS.mjs +9 -0
  10. package/dist/{chunk-WIRQ5IRT.mjs → chunk-BDNY6OKE.mjs} +1 -1
  11. package/dist/{chunk-2BRDNDUB.mjs → chunk-BGADMIWV.mjs} +1 -1
  12. package/dist/{chunk-C4RWEPVF.mjs → chunk-BN747TQM.mjs} +1 -1
  13. package/dist/{chunk-2SQVMYDK.mjs → chunk-CJ2ZX7QN.mjs} +1 -1
  14. package/dist/{chunk-LAQ3QAUW.mjs → chunk-CLGBBNRB.mjs} +1 -1
  15. package/dist/{chunk-AQQCH7Z2.mjs → chunk-CNCT3JZV.mjs} +1 -1
  16. package/dist/{chunk-KQB6MFFS.mjs → chunk-DJ2KA3MS.mjs} +1 -1
  17. package/dist/{chunk-K4DQ5KUH.mjs → chunk-DVE2KPLR.mjs} +1 -1
  18. package/dist/{chunk-LHO4WFYP.mjs → chunk-ERHNVIOZ.mjs} +1 -1
  19. package/dist/{chunk-LJXTXROJ.mjs → chunk-GIL2SMPM.mjs} +1 -1
  20. package/dist/{chunk-2HKAJ4TZ.mjs → chunk-HTS3KCJL.mjs} +1 -1
  21. package/dist/{chunk-GVDM4RRN.mjs → chunk-I6OBIS4J.mjs} +1 -1
  22. package/dist/{chunk-6UDBIRMT.mjs → chunk-IO5ZSALG.mjs} +1 -1
  23. package/dist/{chunk-RJGYVDOU.mjs → chunk-JLUX7EHB.mjs} +1 -1
  24. package/dist/{chunk-5MWZTJYP.mjs → chunk-JT65KF7C.mjs} +1 -1
  25. package/dist/{chunk-EM3T2XYC.mjs → chunk-JUFFNFV6.mjs} +1 -1
  26. package/dist/{chunk-3Y7QG6VP.mjs → chunk-KRLNPNMZ.mjs} +1 -1
  27. package/dist/{chunk-3NRXQBBS.mjs → chunk-M74BIPBM.mjs} +1 -1
  28. package/dist/{chunk-7R47MHQE.mjs → chunk-NXG2Y4N4.mjs} +1 -1
  29. package/dist/{chunk-XDELWNND.mjs → chunk-OP6ZWZIM.mjs} +1 -1
  30. package/dist/{chunk-CXOVEABI.mjs → chunk-PRK2XFAZ.mjs} +1 -1
  31. package/dist/{chunk-ZFUP5NVF.mjs → chunk-PXLSH6S2.mjs} +1 -1
  32. package/dist/{chunk-GTZJWMZR.mjs → chunk-PZZTGPEO.mjs} +1 -1
  33. package/dist/{chunk-36UEU4CT.mjs → chunk-R3SDBXF2.mjs} +1 -1
  34. package/dist/{chunk-3MEOSYPN.mjs → chunk-RIFUOB7A.mjs} +1 -1
  35. package/dist/{chunk-P55W6AFU.mjs → chunk-RIRZRO6U.mjs} +1 -1
  36. package/dist/{chunk-TVTTUSWM.mjs → chunk-S3P6OGB7.mjs} +1 -1
  37. package/dist/{chunk-TXVA6XJT.mjs → chunk-SRUG246N.mjs} +1 -1
  38. package/dist/{chunk-GHOL5L32.mjs → chunk-T36QUKC6.mjs} +1 -1
  39. package/dist/{chunk-RSDUFAIB.mjs → chunk-T5HJS6OF.mjs} +1 -1
  40. package/dist/{chunk-HSQAHQNP.mjs → chunk-TKCFCYEQ.mjs} +1 -1
  41. package/dist/{chunk-ZEALRBXW.mjs → chunk-UX5OJ3WS.mjs} +1 -1
  42. package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.mjs} +1 -1
  43. package/dist/{chunk-XGIYNUGC.mjs → chunk-VNYUNZ3M.mjs} +1 -1
  44. package/dist/{chunk-2BR55L74.mjs → chunk-VRE6VCHX.mjs} +1 -1
  45. package/dist/{chunk-75F3LJMX.mjs → chunk-WDZOGIT2.mjs} +1 -1
  46. package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
  47. package/dist/{chunk-NINFDOV5.mjs → chunk-Y62OBV2E.mjs} +1 -1
  48. package/dist/components/Blocks/Banner.mjs +1 -1
  49. package/dist/components/Blocks/CallToAction.mjs +1 -1
  50. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  51. package/dist/components/Blocks/Content.mjs +1 -1
  52. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  53. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  54. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  55. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  56. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  57. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  58. package/dist/components/Blocks/index.mjs +1 -1
  59. package/dist/components/Cards/ContentCard.mjs +1 -1
  60. package/dist/components/Cards/FeatureCard.mjs +1 -1
  61. package/dist/components/Cards/index.mjs +1 -1
  62. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  63. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  64. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +6 -6
  65. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  66. package/dist/components/DigitalColleagues/Views/index.js +6 -6
  67. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  68. package/dist/components/DigitalColleagues/index.js +6 -6
  69. package/dist/components/DigitalColleagues/index.mjs +1 -1
  70. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  71. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  72. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  73. package/dist/components/Foundary/MainPage.mjs +1 -1
  74. package/dist/components/Foundary/Pages/dashboardpage.js +6 -6
  75. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  76. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  77. package/dist/components/Foundary/Views/index.js +6 -6
  78. package/dist/components/Foundary/Views/index.mjs +1 -1
  79. package/dist/components/Foundary/file-edit.js +6 -6
  80. package/dist/components/Foundary/file-edit.mjs +1 -1
  81. package/dist/components/Foundary/index.js +6 -6
  82. package/dist/components/Foundary/index.mjs +1 -1
  83. package/dist/components/HeaderFooter/Header.mjs +1 -1
  84. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  85. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  86. package/dist/components/HeaderFooter/index.mjs +1 -1
  87. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  88. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  89. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  90. package/dist/components/Heros/PostHero/index.mjs +1 -1
  91. package/dist/components/Heros/RenderHero.mjs +1 -1
  92. package/dist/components/Heros/index.mjs +1 -1
  93. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  94. package/dist/components/Layouts/Print.mjs +1 -1
  95. package/dist/components/Layouts/SlideShow.mjs +1 -1
  96. package/dist/components/Layouts/index.mjs +1 -1
  97. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  98. package/dist/components/Menus/SidebarRight.mjs +1 -1
  99. package/dist/components/Menus/index.mjs +1 -1
  100. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  101. package/dist/components/Payload/Media/index.mjs +1 -1
  102. package/dist/components/Payload/PayloadCard/index.mjs +1 -1
  103. package/dist/components/Payload/RichText/index.mjs +1 -1
  104. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  105. package/dist/components/Payload/index.mjs +1 -1
  106. package/dist/components/Projects/FileView.js +6 -6
  107. package/dist/components/Projects/FileView.mjs +1 -1
  108. package/dist/components/Projects/KanbanBoardView.js +6 -6
  109. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  110. package/dist/components/Projects/ProjectPage.js +6 -6
  111. package/dist/components/Projects/ProjectPage.mjs +1 -1
  112. package/dist/components/Projects/ProjectView.js +6 -6
  113. package/dist/components/Projects/ProjectView.mjs +1 -1
  114. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  115. package/dist/components/Projects/TaskDetailsModal.js +6 -6
  116. package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
  117. package/dist/components/Projects/file-list.js +6 -6
  118. package/dist/components/Projects/file-list.mjs +1 -1
  119. package/dist/components/Projects/index.js +6 -6
  120. package/dist/components/Projects/index.mjs +1 -1
  121. package/dist/components/dc-temp/index.js +6 -6
  122. package/dist/components/dc-temp/index.mjs +1 -1
  123. package/dist/components/index.js +19 -19
  124. package/dist/components/index.mjs +1 -1
  125. package/dist/components/ui/index.mjs +1 -1
  126. package/dist/components/ui/sidebar.mjs +1 -1
  127. package/dist/index.js +21 -21
  128. package/dist/index.mjs +1 -1
  129. package/dist/metafile-cjs.json +1 -1
  130. package/dist/metafile-esm.json +1 -1
  131. package/dist/pages/Blog.mjs +1 -1
  132. package/dist/pages/Documentation.mjs +1 -1
  133. package/dist/pages/IndexPage.mjs +1 -1
  134. package/dist/pages/Intranet.mjs +1 -1
  135. package/dist/pages/LandingPage.mjs +1 -1
  136. package/dist/pages/Page.mjs +1 -1
  137. package/dist/pages/Publish.mjs +1 -1
  138. package/dist/pages/Website.mjs +1 -1
  139. package/dist/sections/AboutSection.mjs +1 -1
  140. package/dist/sections/BlogDetail.mjs +1 -1
  141. package/dist/sections/BlogList.mjs +1 -1
  142. package/dist/sections/BlogListSection.mjs +1 -1
  143. package/dist/sections/ContactSection.mjs +1 -1
  144. package/dist/sections/PageSections.mjs +1 -1
  145. package/dist/sections/PricingSection.mjs +1 -1
  146. package/dist/sections/ServiceDetail.mjs +1 -1
  147. package/dist/sections/ServiceDetailSection.mjs +1 -1
  148. package/dist/sections/ServiceSection.mjs +1 -1
  149. package/dist/sections/form/index.mjs +1 -1
  150. package/dist/sections/index.mjs +1 -1
  151. package/package.json +1 -1
  152. package/dist/chunk-P5LSKHQC.mjs +0 -9
@@ -2,9 +2,9 @@
2
2
  "use strict";
3
3
  'use client'
4
4
 
5
- "use strict";var si=Object.create;var uo=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var di=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,mi=Object.prototype.hasOwnProperty;var pi=(e,t)=>{for(var o in t)uo(e,o,{get:t[o],enumerable:!0})},Na=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of di(t))!mi.call(e,r)&&r!==o&&uo(e,r,{get:()=>t[r],enumerable:!(a=li(t,r))||a.enumerable});return e};var ne=(e,t,o)=>(o=e!=null?si(ci(e)):{},Na(t||!e||!e.__esModule?uo(o,"default",{value:e,enumerable:!0}):o,e)),ui=e=>Na(uo({},"__esModule",{value:!0}),e);var Un={};pi(Un,{DCProjectCard:()=>za,EpicsView:()=>zn,KanbanBoardView:()=>Mn,PlanningView:()=>In,TasksView:()=>Vn});module.exports=ui(Un);var Va=require("motion/react"),Ht=require("lucide-react");var Ia=require("class-variance-authority");var Ma=require("clsx");var zo="-",gi=e=>{let t=vi(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:n=>{let s=n.split(zo);return s[0]===""&&s.length!==1&&s.shift(),Da(s,t)||fi(n)},getConflictingClassGroupIds:(n,s)=>{let m=o[n]||[];return s&&a[n]?[...m,...a[n]]:m}}},Da=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),r=a?Da(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(zo);return t.validators.find(({validator:n})=>n(i))?.classGroupId},Ca=/^\[(.+)\]$/,fi=e=>{if(Ca.test(e)){let t=Ca.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},vi=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return bi(Object.entries(e.classGroups),o).forEach(([i,n])=>{Vo(n,a,i,t)}),a},Vo=(e,t,o,a)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:Sa(t,r);i.classGroupId=o;return}if(typeof r=="function"){if(hi(r)){Vo(r(a),t,o,a);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([i,n])=>{Vo(n,Sa(t,i),o,a)})})},Sa=(e,t)=>{let o=e;return t.split(zo).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},hi=e=>e.isThemeGetter,bi=(e,t)=>t?e.map(([o,a])=>{let r=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([n,s])=>[t+n,s])):i);return[o,r]}):e,xi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,r=(i,n)=>{o.set(i,n),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let n=o.get(i);if(n!==void 0)return n;if((n=a.get(i))!==void 0)return r(i,n),n},set(i,n){o.has(i)?o.set(i,n):r(i,n)}}},Ta="!",yi=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,r=t[0],i=t.length,n=s=>{let m=[],u=0,d=0,g;for(let p=0;p<s.length;p++){let b=s[p];if(u===0){if(b===r&&(a||s.slice(p,p+i)===t)){m.push(s.slice(d,p)),d=p+i;continue}if(b==="/"){g=p;continue}}b==="["?u++:b==="]"&&u--}let v=m.length===0?s:s.substring(d),w=v.startsWith(Ta),N=w?v.substring(1):v,E=g&&g>d?g-d:void 0;return{modifiers:m,hasImportantModifier:w,baseClassName:N,maybePostfixModifierPosition:E}};return o?s=>o({className:s,parseClassName:n}):n},wi=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},Ni=e=>({cache:xi(e.cacheSize),parseClassName:yi(e),...gi(e)}),Ci=/\s+/,Si=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r}=t,i=[],n=e.trim().split(Ci),s="";for(let m=n.length-1;m>=0;m-=1){let u=n[m],{modifiers:d,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:w}=o(u),N=!!w,E=a(N?v.substring(0,w):v);if(!E){if(!N){s=u+(s.length>0?" "+s:s);continue}if(E=a(v),!E){s=u+(s.length>0?" "+s:s);continue}N=!1}let p=wi(d).join(":"),b=g?p+Ta:p,O=b+E;if(i.includes(O))continue;i.push(O);let y=r(E,N);for(let S=0;S<y.length;++S){let oe=y[S];i.push(b+oe)}s=u+(s.length>0?" "+s:s)}return s};function Di(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=ka(t))&&(a&&(a+=" "),a+=o);return a}var ka=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=ka(e[a]))&&(o&&(o+=" "),o+=t);return o};function Ti(e,...t){let o,a,r,i=n;function n(m){let u=t.reduce((d,g)=>g(d),e());return o=Ni(u),a=o.cache.get,r=o.cache.set,i=s,s(m)}function s(m){let u=a(m);if(u)return u;let d=Si(m,o);return r(m,d),d}return function(){return i(Di.apply(null,arguments))}}var ce=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Pa=/^\[(?:([a-z-]+):)?(.+)\]$/i,ki=/^\d+\/\d+$/,Pi=new Set(["px","full","screen"]),Ri=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ei=/\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$/,Mi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ii=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ai=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ct=e=>At(e)||Pi.has(e)||ki.test(e),ht=e=>Lt(e,"length",Ui),At=e=>!!e&&!Number.isNaN(Number(e)),Oo=e=>Lt(e,"number",At),zt=e=>!!e&&Number.isInteger(Number(e)),Li=e=>e.endsWith("%")&&At(e.slice(0,-1)),z=e=>Pa.test(e),bt=e=>Ri.test(e),Hi=new Set(["length","size","percentage"]),Bi=e=>Lt(e,Hi,Ra),Fi=e=>Lt(e,"position",Ra),Oi=new Set(["image","url"]),Vi=e=>Lt(e,Oi,_i),zi=e=>Lt(e,"",$i),Ut=()=>!0,Lt=(e,t,o)=>{let a=Pa.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Ui=e=>Ei.test(e)&&!Mi.test(e),Ra=()=>!1,$i=e=>Ii.test(e),_i=e=>Ai.test(e);var Gi=()=>{let e=ce("colors"),t=ce("spacing"),o=ce("blur"),a=ce("brightness"),r=ce("borderColor"),i=ce("borderRadius"),n=ce("borderSpacing"),s=ce("borderWidth"),m=ce("contrast"),u=ce("grayscale"),d=ce("hueRotate"),g=ce("invert"),v=ce("gap"),w=ce("gradientColorStops"),N=ce("gradientColorStopPositions"),E=ce("inset"),p=ce("margin"),b=ce("opacity"),O=ce("padding"),y=ce("saturate"),S=ce("scale"),oe=ce("sepia"),I=ce("skew"),ae=ce("space"),Q=ce("translate"),j=()=>["auto","contain","none"],xe=()=>["auto","hidden","clip","visible","scroll"],we=()=>["auto",z,t],$=()=>[z,t],je=()=>["",ct,ht],He=()=>["auto",At,z],k=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Te=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",z],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>[At,z];return{cacheSize:500,separator:":",theme:{colors:[Ut],spacing:[ct,ht],blur:["none","",bt,z],brightness:x(),borderColor:[e],borderRadius:["none","","full",bt,z],borderSpacing:$(),borderWidth:je(),contrast:x(),grayscale:ie(),hueRotate:x(),invert:ie(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Li,ht],inset:we(),margin:we(),opacity:x(),padding:$(),saturate:x(),scale:x(),sepia:ie(),skew:x(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",z]}],container:["container"],columns:[{columns:[bt]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...k(),z]}],overflow:[{overflow:xe()}],"overflow-x":[{"overflow-x":xe()}],"overflow-y":[{"overflow-y":xe()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",zt,z]}],basis:[{basis:we()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",zt,z]}],"grid-cols":[{"grid-cols":[Ut]}],"col-start-end":[{col:["auto",{span:["full",zt,z]},z]}],"col-start":[{"col-start":He()}],"col-end":[{"col-end":He()}],"grid-rows":[{"grid-rows":[Ut]}],"row-start-end":[{row:["auto",{span:[zt,z]},z]}],"row-start":[{"row-start":He()}],"row-end":[{"row-end":He()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","Aa",z]}],"auto-rows":[{"auto-rows":["auto","min","max","Aa",z]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...Te()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Te(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Te(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],Ht:[{Ht:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],Aa:[{Aa:[p]}],U:[{U:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[ae]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ae]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z,t]}],"min-w":[{"min-w":[z,t,"min","max","fit"]}],"max-w":[{"max-w":[z,t,"none","full","min","max","fit","prose",{screen:[bt]},bt]}],h:[{h:[z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z,t,"auto","min","max","fit"]}],"font-size":[{text:["base",bt,ht]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oo]}],"font-family":[{font:[Ut]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",z]}],"line-clamp":[{"line-clamp":["none",At,Oo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ct,z]}],"list-image":[{"list-image":["none",z]}],"list-style-type":[{list:["none","disc","decimal",z]}],"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:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ct,ht]}],"underline-offset":[{"underline-offset":["auto",ct,z]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z]}],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",z]}],"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:[...k(),Fi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Bi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","Aa","tl"]},Vi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-Aa":[{"rounded-Aa":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-Aa":[{"border-Aa":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:W()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-Aa":[{"border-Aa":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[ct,z]}],"outline-w":[{outline:[ct,ht]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ct,ht]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bt,zi]}],"shadow-color":[{shadow:[Ut]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",bt,z]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[y]}],sepia:[{sepia:[oe]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z]}],duration:[{duration:x()}],ease:[{ease:["linear","in","out","in-out",z]}],delay:[{delay:x()}],animate:[{animate:["none","spin","ping","pulse","bounce",z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[zt,z]}],"translate-x":[{"translate-x":[Q]}],"translate-y":[{"translate-y":[Q]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-Aa":[{"scroll-Aa":$()}],"scroll-U":[{"scroll-U":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-Ht":[{"scroll-Ht":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ct,ht,Oo]}],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","Ht","pb","pl"],px:["Ht","pl"],py:["pt","pb"],m:["mx","my","ms","me","Aa","U","mb","ml"],mx:["U","ml"],my:["Aa","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-Aa","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-Aa":["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-Aa"],"border-w-x":["border-w-r","border-w-Aa"],"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-Aa"],"border-color-x":["border-color-r","border-color-Aa"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-Aa","scroll-U","scroll-mb","scroll-ml"],"scroll-mx":["scroll-U","scroll-ml"],"scroll-my":["scroll-Aa","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-Ht","scroll-pb","scroll-pl"],"scroll-px":["scroll-Ht","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 Ea=Ti(Gi);function C(...e){return Ea((0,Ma.clsx)(e))}var Aa=require("react/jsx-runtime"),ji=(0,Ia.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function le({className:e,variant:t,...o}){return(0,Aa.jsx)("div",{className:C(ji({variant:t}),e),...o})}var La=require("@radix-ui/react-slot"),Ba=ne(require("react")),$t=(0,Ia.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"}}}),D=Ba.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...r},i)=>(0,Aa.jsx)(e?La.Slot:"button",{className:C($t({className:t,size:o,variant:a})),ref:i,...r}));D.displayName="Button";var Dt=ne(require("react"));var ue=Dt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ue.displayName="Card";var Uo=Dt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("flex flex-col space-y-1.5 p-6",e),...t}));Uo.displayName="CardHeader";var $o=Dt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("font-semibold leading-none tracking-tight",e),...t}));$o.displayName="CardTitle";var _o=Dt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("text-sm text-muted-foreground",e),...t}));_o.displayName="CardDescription";var _t=Dt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("p-6 pt-0",e),...t}));_t.displayName="CardContent";var Go=Dt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("flex items-center p-6 pt-0",e),...t}));Go.displayName="CardFooter";var Oa=ne(require("react")),Gt=ne(require("@radix-ui/react-progress"));var Wo=Oa.forwardRef(({className:e,value:t,...o},a)=>(0,Aa.jsx)(Gt.Root,{ref:a,className:C("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...o,children:(0,Aa.jsx)(Gt.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Wo.displayName=Gt.Root.displayName;function za({project:e,onOpen:t,onShare:o,className:a}){return(0,Aa.jsx)(Va.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Aa.jsxs)(ue,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Aa.jsxs)(Uo,{children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)($o,{children:e.name}),(0,Aa.jsxs)(le,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Aa.jsx)(_o,{children:e.description})]}),(0,Aa.jsxs)(_t,{className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Aa.jsx)("span",{children:"Progress"}),(0,Aa.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Aa.jsx)(Wo,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Aa.jsxs)("div",{className:"flex items-center",children:[(0,Aa.jsx)(Ht.Users,{className:"U-1 h-4 w-4"}),e.members," members"]}),(0,Aa.jsxs)("div",{className:"flex items-center",children:[(0,Aa.jsx)(Ht.FileText,{className:"U-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Aa.jsxs)(Go,{className:"flex gap-2",children:[(0,Aa.jsx)(D,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Aa.jsx)(D,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>o?.(e),children:(0,Aa.jsx)(Ht.Share2,{className:"h-4 w-4"})})]})]})})}var se=ne(require("react"));var Ua=({title:e,status:t,taskCount:o,children:a,onDrop:r,isCompact:i=!1,height:n})=>{let s=d=>{d.preventDefault()},m=d=>{d.preventDefault(),r(t)};return(0,Aa.jsxs)(ue,{className:`p-4 bg-card border-Aa-4 ${(()=>{switch(t){case"todo":return"border-Aa-gray-400";case"in-progress":return"border-Aa-blue-500";case"review":return"border-Aa-orange-500";case"done":return"border-Aa-green-500";default:return"border-Aa-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"lg:max-w-xs":""}`,style:{height:n||"calc(100vh - 350px)"},onDragOver:s,onDrop:m,children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Aa.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,Aa.jsx)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,Aa.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:a})]})};var jt=({task:e,epic:t,onDragStart:o,onTaskClick:a,isCompact:r=!1})=>{let i=d=>{o(e)},n=()=>{a(e)},s=()=>{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"}},m=()=>{switch(e.type){case"story":return(0,Aa.jsx)(Ht.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Aa.jsx)(Ht.Bug,{className:"h-3 w-3"});case"spike":return(0,Aa.jsx)(Ht.Zap,{className:"h-3 w-3"});case"task":default:return(0,Aa.jsx)(Ht.AlertCircle,{className:"h-3 w-3"})}},u=()=>{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 r?(0,Aa.jsx)(ue,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:i,onClick:n,children:(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${u()}`,children:m()}),(0,Aa.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Aa.jsxs)(ue,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:i,onClick:n,children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Aa.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${u()}`,children:[m(),(0,Aa.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Aa.jsxs)("div",{className:"flex gap-1",children:[(0,Aa.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,Aa.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,Aa.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Aa.jsx)(Ht.User,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Zt=require("react");var Wt=ne(require("react")),ke=ne(require("@radix-ui/react-dialog"));var Fe=ke.Root;var Ko=ke.Portal;var go=Wt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(ke.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}));go.displayName=ke.Overlay.displayName;var Ve=Wt.forwardRef(({className:e,children:t,...o},a)=>(0,Aa.jsxs)(Ko,{children:[(0,Aa.jsx)(go,{}),(0,Aa.jsxs)(ke.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,Aa.jsxs)(ke.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,Aa.jsx)($a.X,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ve.displayName=ke.Content.displayName;var ze=({className:e,...t})=>(0,Aa.jsx)("div",{className:C("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ze.displayName="DialogHeader";var Kt=({className:e,...t})=>(0,Aa.jsx)("div",{className:C("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kt.displayName="DialogFooter";var Me=Wt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(ke.Title,{ref:o,className:C("text-lg font-semibold leading-none tracking-tight",e),...t}));Me.displayName=ke.Title.displayName;var Wi=Wt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(ke.Description,{ref:o,className:C("text-sm text-muted-foreground",e),...t}));Wi.displayName=ke.Description.displayName;var _a=ne(require("react"));var te=_a.forwardRef(({className:e,type:t,...o},a)=>(0,Aa.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}));te.displayName="Input";var ja=ne(require("react")),Ne=ja.forwardRef(({className:e,...t},o)=>(0,Aa.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}));Ne.displayName="Textarea";var _=ne(require("@radix-ui/react-select")),xt=ne(require("react")),Ge=_.Root;var at=_.Value,Ue=xt.forwardRef(({children:e,className:t,...o},a)=>(0,Aa.jsxs)(_.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,Aa.jsx)(_.Icon,{asChild:!0,children:(0,Aa.jsx)(Ht.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ue.displayName=_.Trigger.displayName;var Ka=xt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(_.ScrollUpButton,{className:C("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Aa.jsx)(Ht.ChevronUp,{className:"h-4 w-4"})}));Ka.displayName=_.ScrollUpButton.displayName;var Za=xt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(_.ScrollDownButton,{className:C("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Aa.jsx)(Ht.ChevronDown,{className:"h-4 w-4"})}));Za.displayName=_.ScrollDownButton.displayName;var $e=xt.forwardRef(({children:e,className:t,position:o="popper",...a},r)=>(0,Aa.jsx)(_.Portal,{children:(0,Aa.jsxs)(_.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:r,...a,children:[(0,Aa.jsx)(Ka,{}),(0,Aa.jsx)(_.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,Aa.jsx)(Za,{})]})}));$e.displayName=_.Content.displayName;var Ki=xt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(_.Label,{className:C("py-1.5 pl-8 Ht-2 text-sm font-semibold",e),ref:o,...t}));Ki.displayName=_.Label.displayName;var me=xt.forwardRef(({children:e,className:t,...o},a)=>(0,Aa.jsxs)(_.Item,{className:C("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Ht-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,Aa.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Aa.jsx)(_.ItemIndicator,{children:(0,Aa.jsx)(Ht.Check,{className:"h-4 w-4"})})}),(0,Aa.jsx)(_.ItemText,{children:e})]}));me.displayName=_.Item.displayName;var Zi=xt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(_.Separator,{className:C("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Zi.displayName=_.Separator.displayName;var Ja=ne(require("react")),Zo=ne(require("@radix-ui/react-label"));var Ji=(0,Ia.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),H=Ja.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(Zo.Root,{ref:o,className:C(Ji(),e),...t}));H.displayName=Zo.Root.displayName;var Rt=ne(require("react")),Bt=ne(require("@radix-ui/react-toggle-group"));var Ya=ne(require("react")),Jo=ne(require("@radix-ui/react-toggle"));var qo=(0,Ia.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"}}),qi=Ya.forwardRef(({className:e,variant:t,size:o,...a},r)=>(0,Aa.jsx)(Jo.Root,{ref:r,className:C(qo({variant:t,size:o,className:e})),...a}));qi.displayName=Jo.Root.displayName;var tr=Rt.createContext({size:"default",variant:"default"}),Et=Rt.forwardRef(({className:e,variant:t,size:o,children:a,...r},i)=>(0,Aa.jsx)(Bt.Root,{ref:i,className:C("flex items-center justify-center gap-1",e),...r,children:(0,Aa.jsx)(tr.Provider,{value:{variant:t,size:o},children:a})}));Et.displayName=Bt.Root.displayName;var Mt=Rt.forwardRef(({className:e,children:t,variant:o,size:a,...r},i)=>{let n=Rt.useContext(tr);return(0,Aa.jsx)(Bt.Item,{ref:i,className:C(qo({variant:n.variant||o,size:n.size||a}),e),...r,children:t})});Mt.displayName=Bt.Item.displayName;var Xi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Ht.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Ht.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Ht.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Ht.Zap}],Yi=[{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"}],vo=({isOpen:e,onClose:t,onAddTask:o,epics:a,sprints:r,assignees:i,defaultEpicId:n})=>{let[s,m]=(0,Zt.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,Zt.useEffect)(()=>{e&&n&&m(g=>({...g,epic:n}))},[e,n]),(0,Zt.useEffect)(()=>{e&&m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"none",assignee:""})},[e]);let u=g=>{g.preventDefault(),s.name.trim()&&(o({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,storyPoints:s.storyPoints,epic:Number(s.epic),sprint:Number(s.sprint),assignee:s.assignee.trim()?{relationTo:"digital-colleagues",value:Number(s.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"",assignee:""}),t())},d=(g,v)=>{m(w=>({...w,[g]:v}))};return(0,Aa.jsx)(Fe,{open:e,onOpenChange:t,children:(0,Aa.jsxs)(Ve,{className:"sm:max-w-md",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Me,{children:"Add New Task"})}),(0,Aa.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"name",children:"Task Title"}),(0,Aa.jsx)(te,{id:"name",value:s.name,onChange:g=>d("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"description",value:s.description,onChange:g=>d("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Type"}),(0,Aa.jsx)(Et,{type:"single",value:s.type||"",onValueChange:g=>g&&d("type",g),children:Xi.map(g=>{let v=g.icon;return(0,Aa.jsxs)(Mt,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Aa.jsx)(v,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Priority"}),(0,Aa.jsx)(Et,{type:"single",value:s.priority||"",onValueChange:g=>g&&d("priority",g),children:Yi.map(g=>(0,Aa.jsx)(Mt,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"points",children:"Story Points"}),(0,Aa.jsx)(te,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:g=>d("storyPoints",parseInt(g.target.value)||1),placeholder:"Enter story points",required:!0})]}),!n&&(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"epic",children:"Epic"}),(0,Aa.jsxs)(Ge,{value:s.epic,onValueChange:g=>d("epic",g),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{placeholder:"Select an epic"})}),(0,Aa.jsx)($e,{children:a.map(g=>(0,Aa.jsx)(me,{value:g.id.toString(),children:(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Aa.jsxs)(Ge,{value:s.sprint,onValueChange:g=>d("sprint",g),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{placeholder:"Select a sprint"})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsx)(me,{value:"none",children:"No Sprint"}),r.map(g=>(0,Aa.jsx)(me,{value:g.id.toString(),children:(0,Aa.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"sprint",children:"Assignee"}),(0,Aa.jsxs)(Ge,{value:s.assignee,onValueChange:g=>d("assignee",g),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{placeholder:"Select an Assignee"})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsx)(me,{value:"none",children:"No Assignee"}),i.map(g=>(0,Aa.jsx)(me,{value:g.id.toString(),children:(0,Aa.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,Aa.jsxs)(Kt,{children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Jt=({fieldName:e,value:t,label:o,multiline:a=!1,onSave:r,className:i="",disabled:n=!1})=>{let[s,m]=(0,Zt.useState)(!1),[u,d]=(0,Zt.useState)(""),g=()=>{n||(m(!0),d(t))},v=async()=>{u!==t&&await r(e,u),m(!1)},w=N=>{N.key==="Enter"&&!a||N.key==="Enter"&&N.ctrlKey&&a?v():N.key==="Escape"&&(m(!1),d(""))};return(0,Aa.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Aa.jsx)(H,{children:o}),s?a?(0,Aa.jsx)(Ne,{value:u,onChange:N=>d(N.target.value),onBlur:v,onKeyDown:w,autoFocus:!0,rows:4,className:"resize-none"}):(0,Aa.jsx)(te,{value:u,onChange:N=>d(N.target.value),onBlur:v,onKeyPress:w,autoFocus:!0,className:"text-lg font-medium"}):(0,Aa.jsxs)("div",{onClick:g,className:`${n?"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,Aa.jsx)("span",{className:a?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,Aa.jsx)(Ht.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var ho=ne(require("react")),pt=ne(require("@radix-ui/react-avatar"));var Yo=ho.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(pt.Root,{ref:o,className:C("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Yo.displayName=pt.Root.displayName;var Qi=ho.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(pt.Image,{ref:o,className:C("aspect-square h-full w-full",e),...t}));Qi.displayName=pt.Image.displayName;var Qo=ho.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(pt.Fallback,{ref:o,className:C("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Qo.displayName=pt.Fallback.displayName;var rr=({comments:e,onAddComment:t})=>{let[o,a]=(0,Zt.useState)(""),r=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{o.trim()&&(t(o),a(""))};return(0,Aa.jsxs)("div",{className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)(Ht.MessageSquare,{className:"h-5 w-5"}),(0,Aa.jsx)(H,{className:"text-lg font-medium",children:"Comments"}),(0,Aa.jsx)(le,{variant:"secondary",children:e.length})]}),(0,Aa.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,Aa.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Aa.jsx)(Yo,{className:"h-8 w-8 Aa-1",children:(0,Aa.jsx)(Qo,{className:"text-xs bg-muted text-muted-foreground",children:r(n.author)})}),(0,Aa.jsxs)("div",{className:"flex-1",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Aa.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,Aa.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,Aa.jsxs)("div",{className:"flex gap-2",children:[(0,Aa.jsx)(Ne,{value:o,onChange:n=>a(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Aa.jsx)(D,{onClick:i,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,Aa.jsx)(Ht.Send,{className:"h-4 w-4"})})]})]})};var yo=({label:e,value:t,onValueChange:o,options:a,showColor:r=!1,disabled:i=!1})=>{let[n,s]=(0,Zt.useState)(!1),m=a.find(d=>d.value===t);return(0,Aa.jsxs)("div",{className:"space-y-1",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:e}),(0,Aa.jsxs)(Ge,{value:t,onValueChange:o,open:n,onOpenChange:d=>{i||s(d)},disabled:i,children:[(0,Aa.jsx)(Ue,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Aa.jsxs)(le,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!n),children:[r&&m?.color&&(0,Aa.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} U-1`}),m?.label||"Select..."]})}),(0,Aa.jsx)($e,{children:a.map(d=>(0,Aa.jsx)(me,{value:d.value,children:r&&d.color?(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var nr=({label:e,value:t,onValueChange:o,options:a,placeholder:r="Search...",allowCustomValue:i=!1,disabled:n=!1})=>{let[s,m]=(0,Zt.useState)(!1),[u,d]=(0,Zt.useState)(""),g=a.find(p=>p.value===t),v=a.filter(p=>p.label.toLowerCase().includes(u.toLowerCase())),w=p=>{o(p),m(!1),d("")},N=()=>{i&&u.trim()&&!a.find(p=>p.value===u.trim())&&(o(u.trim()),m(!1),d(""))};return(0,Aa.jsxs)("div",{className:"space-y-1",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:e}),(0,Aa.jsxs)(Ge,{value:t,onValueChange:w,open:s,onOpenChange:p=>{n||m(p)},disabled:n,children:[(0,Aa.jsx)(Ue,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Aa.jsx)(le,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&m(!s),children:g?.label||t||"Select..."})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsx)("div",{className:"p-2",children:(0,Aa.jsx)(te,{placeholder:r,value:u,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&i&&N()},className:"mb-2"})}),v.map(p=>(0,Aa.jsx)(me,{value:p.value,children:p.label},p.value)),i&&u.trim()&&!v.find(p=>p.value===u.trim())&&(0,Aa.jsxs)(me,{value:u.trim(),children:['Add "',u.trim(),'"']})]})]})]})};var Ie=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var en=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Ht.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Ht.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Ht.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Ht.Zap}],tn=[{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 sr=({task:e,epics:t,sprints:o,lastUpdated:a,onUpdateTask:r,onClose:i,onDelete:n,isUpdating:s=!1,isDeleting:m=!1,deleteState:u="idle",teamMembers:d})=>{let[g,v]=(0,Zt.useState)(e.storyPoints),w=(0,Zt.useRef)(null),[N,E]=(0,Zt.useState)(d);(0,Zt.useEffect)(()=>{E(d)},[d]);let p=(0,Zt.useCallback)((y,S)=>{w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{r(y,S)},500)},[r]);(0,Zt.useEffect)(()=>{p("storyPoints",g?.toString()||"1")},[g]);let b=y=>y.split(" ").map(S=>S[0]).join("").toUpperCase(),O=()=>u==="loading"?(0,Aa.jsxs)(D,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Aa.jsx)(Ht.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):u==="success"?(0,Aa.jsxs)(D,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Aa.jsx)(Ht.Check,{className:"h-3 w-3"}),"Deleted"]}):u==="error"?(0,Aa.jsxs)(D,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Aa.jsx)(Ht.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Aa.jsxs)(D,{onClick:n,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||m,children:[(0,Aa.jsx)(Ht.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Aa.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Aa.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Aa.jsx)(yo,{label:"",value:e.status,onValueChange:y=>r("status",y),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Aa.jsx)(Et,{type:"single",value:e.type||"",onValueChange:y=>y&&r("type",y),className:"grid grid-cols-2 gap-1",disabled:s,children:en.map(y=>{let S=y.icon;return(0,Aa.jsxs)(Mt,{value:y.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:s,children:[(0,Aa.jsx)(S,{className:"h-3 w-3"}),y.label]},y.value)})})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Aa.jsx)(Et,{type:"single",value:e.priority||"",onValueChange:y=>y&&r("priority",y),className:"grid grid-cols-3 gap-1",disabled:s,children:tn.map(y=>(0,Aa.jsx)(Mt,{value:y.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:y.label},y.value))})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Aa.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:y=>{let S=Number(y.target.value);S<1?v(1):S>100?v(100):v(S)},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:s})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Aa.jsx)(yo,{label:"",value:Ie(e.epic).toString(),onValueChange:y=>r("epic",y),options:(t||[]).map(y=>({value:y.id.toString(),label:y?.name,color:y.color})),showColor:!0,disabled:s})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Aa.jsx)(yo,{label:"",value:Ie(e.sprint).toString()||"none",onValueChange:y=>r("sprint",y==="none"?"":y),options:[{value:"none",label:"No Sprint"},...(o||[]).map(y=>({value:y.id.toString(),label:`${y?.name}`}))],disabled:s})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Aa.jsx)(nr,{label:"",value:e.assignee?.value?.name,onValueChange:y=>r("assignee",y),options:N.map(y=>({value:`${typeof y.email=="string"?"users":"digital-colleagues"}:${y.id}`,label:y?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Aa.jsxs)("div",{className:"Aa-auto pt-4 space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(D,{onClick:i,variant:"outline",className:"w-full h-8 text-xs",disabled:s||m,children:"Close"}),O()]}),(0,Aa.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Aa.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Aa.jsx)(Ht.User,{className:"h-3 w-3"}),(0,Aa.jsx)("span",{children:"System"})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-3 w-3"}),(0,Aa.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Aa.jsx)(Ht.Clock,{className:"h-3 w-3"}),(0,Aa.jsxs)("span",{children:[new Date(a).toLocaleDateString()," at"," ",new Date(a).toLocaleTimeString()]})]})]})]})]})]})};var Xr=ne(require("@radix-ui/react-dialog"));var Lr=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Hr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Br=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Fr=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Or=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Vr=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),zr=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Po=require("@payloadcms/richtext-lexical/lexical/list"),Ur=require("@payloadcms/richtext-lexical/lexical/rich-text"),$r=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Ir=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),oo=require("@payloadcms/richtext-lexical/lexical/utils"),U=require("@payloadcms/richtext-lexical/lexical"),ma=require("@payloadcms/richtext-lexical/lexical/selection");var br=require("@radix-ui/react-dialog"),So=require("@payloadcms/richtext-lexical/client");var oa=ne(require("bson-objectid"));var dr=require("@payloadcms/ui");var lr=ne(require("react")),rt=ne(require("@radix-ui/react-tooltip"));var wo=rt.Provider,No=rt.Root,Co=rt.Trigger,qt=lr.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Aa.jsx)(rt.Portal,{children:(0,Aa.jsx)(rt.Content,{ref:a,sideOffset:t,className:C("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));qt.displayName=rt.Content.displayName;var on=e=>{let{data:{relationTo:t,value:o},nodeKey:a}=e,[r]=(0,Ir.useLexicalComposerContext)(),[i,n]=(0,Zt.useState)(""),[s,m]=(0,Zt.useState)(""),[u,d]=(0,Zt.useState)(""),g=async p=>{console.log("fetchMedia",p)};(0,Zt.useEffect)(()=>{typeof o=="string"?o.length===24?g(o):(n(o||""),d(E(N())),m(w()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),d(E(o.filesize)),m(o.mimeType?.split("/")[1]||""))},[]);let v=(0,Zt.useCallback)(()=>{r.update(()=>{(0,U.$getNodeByKey)(a)?.remove()})},[r,a]),w=()=>{let p=e.data.value;return typeof p=="string"?p.split(";base64")[0]?.split("image/")[1]:""},N=()=>{let p=e.data.value;if(typeof p=="string"){let b=p.split(",")[1]?.length||0;return 4*Math.ceil(b/3)*.5624896334383812/1e3}return 0};function E(p){if(p>=1e6){let O=p/1e6;return`${O>=10?Math.round(O).toString():O.toFixed(1)} MB`}return`${Math.floor(p/1e3)} KB`}return(0,Aa.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Aa.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Aa.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Aa.jsx)("div",{className:"flex-1",children:e.data.value?(0,Aa.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:i}):(0,Aa.jsx)(dr.File,{})}),(0,Aa.jsx)(wo,{children:(0,Aa.jsxs)(No,{children:[(0,Aa.jsxs)(Co,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Aa.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Aa.jsx)("button",{onClick:p=>{p.preventDefault(),v()},className:"flex-1 flex justify-center items-center",children:(0,Aa.jsx)(Ht.X,{width:24,height:24,strokeWidth:1})})]}),(0,Aa.jsx)(qt,{children:(0,Aa.jsx)("span",{children:"Remove image"})})]})})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,Aa.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,Aa.jsx)("span",{children:u})]})]})})},ur=on;function an(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id");if(o)return{node:Ft({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Xt=class extends So.UploadNode{static importDOM(){return{img:()=>({conversion:an,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new oa.default().toHexString(),t.version=3);let o={id:t.id??new oa.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},a=Ft(o);return a.setFormat?.(t.format),a}decorate(){return(0,Aa.jsx)(ur,{data:this.__data,nodeKey:this.getKey()})}};function Ft(e){return new Xt({data:e})}var rn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nn=e=>rn?(e||window).getSelection():null,Bl=(0,U.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),aa=(0,U.createCommand)("INSERT_UPLOAD_COMMAND");function xr({activeEditor:e,onClose:t,isOpen:o=!1}){let a=(0,Zt.useRef)(!1),[r,i]=(0,Zt.useState)(!0),[n,s]=(0,Zt.useState)(""),[m,u]=(0,Zt.useState)(""),[d,g]=(0,Zt.useState)(!1),[v,w]=(0,Zt.useState)("left"),N=n==="",E=S=>{g(S.target.checked)},p=S=>{w(S.target.value)},b=S=>{let oe=new FileReader;oe.onload=function(){return typeof oe.result=="string"&&s(oe.result),""},S!==null&&S[0]&&oe.readAsDataURL(S[0])};(0,Zt.useEffect)(()=>{a.current=!1;let S=oe=>{a.current=oe.altKey};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[e]),(0,Zt.useEffect)(()=>{r||t()},[r]),(0,Zt.useEffect)(()=>{i(o)},[o]);let O=({editor:S,relationTo:oe,replaceNodeKey:I,value:ae})=>{if(I)S.update(()=>{let Q=(0,U.$getNodeByKey)(I);Q&&Q.replace(Ft({id:"",fields:{},relationTo:"media",value:ae}))});else{let Q=S.dispatchCommand(aa,{fields:null,relationTo:"media",value:ae})}},y=()=>{O({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:m,src:n,showCaption:d,position:v}.src}),i(!1),t()};return(0,Aa.jsx)(Fe,{open:r,onOpenChange:S=>i(S),children:(0,Aa.jsxs)(Ve,{children:[(0,Aa.jsxs)(ze,{children:[(0,Aa.jsx)(Me,{children:"Upload Image"}),(0,Aa.jsx)(br.DialogDescription,{children:"Description"})]}),(0,Aa.jsxs)("div",{className:"",children:[(0,Aa.jsx)("div",{style:{marginBottom:"1em"},children:(0,Aa.jsx)(te,{type:"file",onChange:S=>b(S.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Aa.jsx)("div",{style:{marginBottom:"1em"},children:(0,Aa.jsx)(te,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:S=>u(S.currentTarget.value),value:m,"data-test-id":"image-modal-alt-text-input"})}),(0,Aa.jsx)(D,{"data-test-id":"image-modal-file-upload-btn",disabled:N,onClick:()=>y(),children:"Confirm"})]})]})})}function ra({captionsEnabled:e}){let[t]=(0,Ir.useLexicalComposerContext)();return(0,Zt.useEffect)(()=>{if(!t.hasNodes([So.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,oo.mergeRegister)(t.registerCommand(U.DRAGSTART_COMMAND,o=>sn(o),U.COMMAND_PRIORITY_HIGH),t.registerCommand(U.DRAGOVER_COMMAND,o=>ln(o),U.COMMAND_PRIORITY_LOW),t.registerCommand(U.DROP_COMMAND,o=>dn(o,t),U.COMMAND_PRIORITY_HIGH))},[e,t]),null}function sn(e){if(!ia())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function ln(e){return ia()?(yr(e)||e.preventDefault(),!0):!1}function dn(e,t){let o=ia();if(!o)return!1;if(e.preventDefault(),yr(e)){let a=cn(e);o.remove();let r=(0,U.$createRangeSelection)();a!=null&&r.applyDOMRange(a),(0,U.$setSelection)(r)}return!0}function ia(){let e=(0,U.$getSelection)();if(!(0,U.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,So.$isUploadNode)(o)?o:null}function yr(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function cn(e){let t,o=e.target,a=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,r=nn(a);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&r!==null)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var mn=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),wr=mn;var pn=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),Nr=pn;var un=()=>(0,Aa.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Aa.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Aa.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Cr=un;var gn=()=>(0,Aa.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Aa.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Aa.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Sr=gn;var fn=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),Dr=fn;var vn=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),Tr=vn;var kr=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Pr=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),Rr=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),Er=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),Mr=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var ut=ne(require("react")),G=ne(require("@radix-ui/react-dropdown-menu")),Ot=require("@radix-ui/react-icons");var Do=G.Root,To=G.Trigger;var hn=ut.forwardRef(({className:e,inset:t,children:o,...a},r)=>(0,Aa.jsxs)(G.SubTrigger,{ref:r,className:C("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[o,(0,Aa.jsx)(Ot.ChevronRightIcon,{className:"ml-auto"})]}));hn.displayName=G.SubTrigger.displayName;var bn=ut.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(G.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}));bn.displayName=G.SubContent.displayName;var eo=ut.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Aa.jsx)(G.Portal,{children:(0,Aa.jsx)(G.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})}));eo.displayName=G.Content.displayName;var to=ut.forwardRef(({className:e,inset:t,...o},a)=>(0,Aa.jsx)(G.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}));to.displayName=G.Item.displayName;var xn=ut.forwardRef(({className:e,children:t,checked:o,...a},r)=>(0,Aa.jsxs)(G.CheckboxItem,{ref:r,className:C("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Ht-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,Aa.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Aa.jsx)(G.ItemIndicator,{children:(0,Aa.jsx)(Ot.CheckIcon,{className:"h-4 w-4"})})}),t]}));xn.displayName=G.CheckboxItem.displayName;var yn=ut.forwardRef(({className:e,children:t,...o},a)=>(0,Aa.jsxs)(G.RadioItem,{ref:a,className:C("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Ht-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,Aa.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Aa.jsx)(G.ItemIndicator,{children:(0,Aa.jsx)(Ot.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));yn.displayName=G.RadioItem.displayName;var wn=ut.forwardRef(({className:e,inset:t,...o},a)=>(0,Aa.jsx)(G.Label,{ref:a,className:C("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));wn.displayName=G.Label.displayName;var Nn=ut.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(G.Separator,{ref:o,className:C("-mx-1 my-1 h-px bg-muted",e),...t}));Nn.displayName=G.Separator.displayName;var Cn=({className:e,...t})=>(0,Aa.jsx)("span",{className:C("ml-auto text-xs tracking-widest opacity-60",e),...t});Cn.displayName="DropdownMenuShortcut";var ca=1;function Sn(){return(0,Aa.jsx)("span",{className:"border border-[#222222]"})}function pa(){let[e]=(0,Ir.useLexicalComposerContext)(),t=(0,Zt.useRef)(null),[o,a]=(0,Zt.useState)(!1),[r,i]=(0,Zt.useState)(!1),[n,s]=(0,Zt.useState)(!1),[m,u]=(0,Zt.useState)(!1),[d,g]=(0,Zt.useState)(!1),[v,w]=(0,Zt.useState)(!1),[N,E]=(0,Zt.useState)(!1),[p,b]=(0,Zt.useState)(!1),[O,y]=(0,Zt.useState)(!1),[S,oe]=(0,Zt.useState)("left"),[I,ae]=(0,Zt.useState)("p"),Q=k=>{e.update(()=>{let W=(0,U.$getSelection)();(0,U.$isRangeSelection)(W)&&(k==="p"?(0,ma.$setBlocksType)(W,()=>(0,U.$createParagraphNode)()):(0,ma.$setBlocksType)(W,()=>(0,Ur.$createHeadingNode)(k)))})},j=(0,Zt.useCallback)(()=>{let k=(0,U.$getSelection)();if((0,U.$isRangeSelection)(k)){s(k.hasFormat("bold")),u(k.hasFormat("italic")),g(k.hasFormat("underline")),w(k.hasFormat("strikethrough")),E(k.hasFormat("subscript")),b(k.hasFormat("superscript"));let W=k.anchor.getNode(),ee=W;for(;ee&&!(0,U.$isParagraphNode)(ee)&&ee!==(0,U.$getRoot)();){let ie=ee.getParent();ie&&(ee=ie)}if(ee){let ie=ee.getFormatType();oe(ie||"left")}let Te=W.getTopLevelElement()?.__tag;ae(Te||"p")}},[]);(0,Zt.useEffect)(()=>(0,oo.mergeRegister)(e.registerUpdateListener(({editorState:k})=>{k.read(()=>{j()})}),e.registerCommand(U.SELECTION_CHANGE_COMMAND,(k,W)=>(j(),!1),ca),e.registerCommand(U.CAN_UNDO_COMMAND,k=>(a(k),!1),ca),e.registerCommand(U.CAN_REDO_COMMAND,k=>(i(k),!1),ca),(0,oo.mergeRegister)(e.registerCommand(aa,k=>(e.update(()=>{let W=(0,U.$getSelection)()||(0,U.$getPreviousSelection)();if((0,U.$isRangeSelection)(W)){let ee=Ft({id:k.id,fields:k.fields,relationTo:k.relationTo,value:k.value}),{focus:Te}=W,ie=Te.getNode();(0,oo.$insertNodeToNearestRoot)(ee),(0,U.$isParagraphNode)(ie)&&!ie.__first&&ie.remove()}}),!0),U.COMMAND_PRIORITY_EDITOR))),[e,j]);let xe=[[{label:"Undo",icon:(0,Aa.jsx)(Ht.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,Aa.jsx)(Ht.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,Aa.jsx)(wr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,Aa.jsx)(Nr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:m},{label:"Underline",icon:(0,Aa.jsx)(Cr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,Aa.jsx)(Sr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:v},{label:"Subscript",icon:(0,Aa.jsx)(Dr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:N},{label:"Superscript",icon:(0,Aa.jsx)(Tr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:p}]],we=[{label:"Left Align",direction:"left",icon:(0,Aa.jsx)(Ht.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Aa.jsx)(Ht.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Aa.jsx)(Ht.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Aa.jsx)(Ht.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.FORMAT_ELEMENT_COMMAND,"justify")}}],je=[{label:"Normal Text",value:"p",icon:(0,Aa.jsx)(kr,{}),onClick:()=>Q("p")},{label:"Heading 1",value:"h1",icon:(0,Aa.jsx)(Pr,{}),onClick:()=>Q("h1")},{label:"Heading 2",value:"h2",icon:(0,Aa.jsx)(Rr,{}),onClick:()=>Q("h2")},{label:"Heading 3",value:"h3",icon:(0,Aa.jsx)(Er,{}),onClick:()=>Q("h3")},{label:"Heading 4",value:"h4",icon:(0,Aa.jsx)(Mr,{}),onClick:()=>Q("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Aa.jsx)(Ht.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Po.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Aa.jsx)(Ht.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Po.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],He=[{label:"Insert Image",icon:(0,Aa.jsx)(Ht.ImageUp,{width:15,height:15}),onClick:()=>{y(!0)},disabled:!1}];return(0,Aa.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,Aa.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[xe.map((k,W)=>(0,Aa.jsxs)(Zt.Fragment,{children:[(0,Aa.jsx)("div",{className:"flex items-center gap-2",children:k.map((ee,Te)=>(0,Aa.jsx)("div",{role:"button","aria-disabled":ee.disabled||!1,onClick:ee.onClick,className:C("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",ee.active&&"bg-[#3c3c3c]"),"aria-label":ee.label,children:(0,Aa.jsx)(wo,{children:(0,Aa.jsxs)(No,{children:[(0,Aa.jsx)(Co,{className:"text-[#b5b5b5]",children:ee.icon}),(0,Aa.jsx)(qt,{children:(0,Aa.jsx)("p",{children:ee.label})})]})})},Te))}),(0,Aa.jsx)(Sn,{})]},`toolbar-option-${k.length}-${W}`)),(0,Aa.jsxs)(Do,{children:[(0,Aa.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[we.find(k=>k.direction===S)?.icon,we.find(k=>k.direction===S)?.label,(0,Aa.jsx)(Ht.ChevronDown,{width:15,height:15})]}),(0,Aa.jsx)(eo,{className:"bg-black hover:bg-black",children:we.map((k,W)=>(0,Aa.jsxs)(to,{onClick:k.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Aa.jsx)("span",{children:k.icon}),(0,Aa.jsx)("span",{children:k.label})]},`${k.label}-${W}`))})]}),(0,Aa.jsxs)(Do,{children:[(0,Aa.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[je.find(k=>k.value===I)?.icon,je.find(k=>k.value===I)?.label,(0,Aa.jsx)(Ht.ChevronDown,{width:15,height:15})]}),(0,Aa.jsx)(eo,{className:"bg-black hover:bg-black",children:je.map((k,W)=>(0,Aa.jsxs)(to,{onClick:k.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Aa.jsx)("span",{children:k.icon}),(0,Aa.jsx)("span",{children:k.label})]},`heading-option-${k.label}-${W}`))})]}),(0,Aa.jsxs)(Do,{children:[(0,Aa.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Aa.jsx)(Ht.Plus,{width:15,height:15}),(0,Aa.jsx)(Ht.ChevronDown,{width:15,height:15})]}),(0,Aa.jsx)(eo,{className:"bg-black hover:bg-black",children:He.map((k,W)=>(0,Aa.jsxs)(to,{onClick:k.onClick,disabled:k.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Aa.jsx)("span",{children:k.icon}),(0,Aa.jsx)("span",{children:k.label})]},W))})]}),O&&(0,Aa.jsx)(xr,{activeEditor:e,onClose:()=>{y(!1)},isOpen:O})]})})}var Dn=({setValue:e,value:t,name:o,editable:a=!0})=>{let[r]=(0,Ir.useLexicalComposerContext)(),i=(0,Zt.useRef)(null),n=s=>{s.read(()=>{let m=s.toJSON();JSON.stringify(m)!==JSON.stringify(i.current)&&(i.current=m,e?.(()=>m))})};return(0,Zt.useEffect)(()=>{r.setEditable(a)},[a,r]),(0,Zt.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(i.current)&&r.update(()=>{try{let s=r.parseEditorState(t);r.setEditorState(s),i.current=t}catch(s){console.error("Error parsing editor state:",s)}},{discrete:!0})},[t,r]),(0,Aa.jsx)("div",{className:"w-full",children:(0,Aa.jsxs)("div",{className:" ",children:[a&&(0,Aa.jsx)(pa,{}),(0,Aa.jsxs)("div",{className:"px-4 my-4 border-Aa border-[#222222]",children:[(0,Aa.jsx)(Vr.RichTextPlugin,{contentEditable:(0,Aa.jsx)(Br.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Fr.LexicalErrorBoundary}),a&&(0,Aa.jsxs)(Aa.Fragment,{children:[(0,Aa.jsx)(Or.HistoryPlugin,{}),(0,Aa.jsx)(Lr.AutoFocusPlugin,{}),(0,Aa.jsx)(zr.ListPlugin,{}),(0,Aa.jsx)($r.OnChangePlugin,{onChange:n}),(0,Aa.jsx)(ra,{})]})]})]})})},Tn=({setValue:e,value:t,name:o,editable:a=!0})=>(0,Aa.jsx)(Hr.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Po.ListNode,Po.ListItemNode,Ur.HeadingNode,Xt],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Aa.jsx)(Dn,{value:t,setValue:e,name:o,editable:a})}),Gr=Tn;var jr=ne(require("react")),st=ne(require("@radix-ui/react-popover"));var ga=st.Root,fa=st.Trigger;var Ro=jr.forwardRef(({className:e,align:t="center",sideOffset:o=4,...a},r)=>(0,Aa.jsx)(st.Portal,{children:(0,Aa.jsx)(st.Content,{ref:r,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})}));Ro.displayName=st.Content.displayName;var Wr=require("react-day-picker");function Eo({className:e,classNames:t,showOutsideDays:o=!0,...a}){return(0,Aa.jsx)(Wr.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($t({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 Aa-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-Aa-md first:[&:has([aria-selected])]:rounded-Aa-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:C($t({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})}Eo.displayName="Calendar";var ro=e=>"mimeType"in e&&"url"in e&&!("format"in e),kn=e=>{if(!e?.root?.children)return"";let t=[],o=r=>{if(!r)return"";switch(r.type){case"heading":{let i=r.tag?parseInt(r.tag.replace("h","")):1,n=a(r.children||[]);return"#".repeat(i)+" "+n}case"paragraph":return a(r.children||[]);case"list":{let i=[],n=r.listType==="number"?"1.":"-";return r.children?.forEach((s,m)=>{if(s.type==="listitem"){let u=a(s.children||[]),d=r.listType==="number"?`${m+1}.`:n;i.push(`${d} ${u}`)}}),i.join(`
6
- `)}case"listitem":return a(r.children||[]);case"text":{let i=r.text||"";if(r.format){let n=(r.format&1)!==0,s=(r.format&2)!==0,m=(r.format&4)!==0,u=(r.format&8)!==0;(r.format&16)!==0?i=`\`${i}\``:(n&&(i=`**${i}**`),s&&(i=`*${i}*`),m&&(i=`~~${i}~~`),u&&(i=`<u>${i}</u>`))}return i}default:return r.children?a(r.children):""}},a=r=>r.map(i=>{if(i.type==="text"){let n=i.text||"";if(i.format){let s=(i.format&1)!==0,m=(i.format&2)!==0,u=(i.format&4)!==0,d=(i.format&8)!==0;(i.format&16)!==0?n=`\`${n}\``:(s&&(n=`**${n}**`),m&&(n=`*${n}*`),u&&(n=`~~${n}~~`),d&&(n=`<u>${n}</u>`))}return n}else{if(i.type==="paragraph")return a(i.children||[]);if(i.type==="listitem")return a(i.children||[]);if(i.type==="linebreak")return`
7
- `}return o(i)}).filter(Boolean).join("");return e.root.children.forEach(r=>{let i=o(r);i&&t.push(i)}),t.join(`
8
-
9
- `)},It=e=>{let t=[],o=0;for(;o<e.length;){let r=e.slice(o).match(/^<u\s*[^>]*>([\s\S]*?)<\/u>/i);if(r&&r[0]){let v=r[1]||"",w=v?It(v):[];w.length>0?(w.forEach(N=>{N.type==="text"&&(N.format=(N.format||0)|8)}),t.push(...w)):v===""&&t.push({type:"text",text:"",format:8}),o+=r[0].length;continue}if(e.slice(o).startsWith("</u>")){o+=4;continue}let i=e.slice(o).match(/^(`+)([^`]+)\1/);if(i){let v=i[2];v&&t.push({type:"text",text:v,format:16}),o+=i[0].length;continue}let n=e.slice(o).match(/^(~~)(.+?)\1/);if(n){let v=n[2],w=It(v);w.forEach(N=>{N.type==="text"&&(N.format=(N.format||0)|4)}),t.push(...w),o+=n[0].length;continue}let s=e.slice(o).match(/^(\*\*|__)(.+?)\1/);if(s){let v=s[2],w=It(v);w.forEach(N=>{N.type==="text"&&(N.format=(N.format||0)|1)}),t.push(...w),o+=s[0].length;continue}let m=e.slice(o).match(/^(\*|_)([^*_\n]+?)\1(?!\*|_)/);if(m&&m[0].length>2){let v=m[2],w=It(v);w.forEach(N=>{N.type==="text"&&(N.format=(N.format||0)|2)}),t.push(...w),o+=m[0].length;continue}let u=e.length,d=[{pattern:/<u>/i,offset:0},{pattern:/\*\*/,offset:0},{pattern:/__/,offset:0},{pattern:/~~/,offset:0},{pattern:/`+/,offset:0},{pattern:/\*[^*\n]/,offset:0},{pattern:/_[^_\n]/,offset:0}];for(let{pattern:v}of d){let w=e.slice(o+1).search(v);w!==-1&&w+1<u-o&&(u=o+w+1)}let g=e.slice(o,u);g&&t.push({type:"text",text:g,format:0}),o=u}let a=[];for(let r of t)a.length>0&&a[a.length-1].type==="text"&&a[a.length-1].format===r.format?a[a.length-1].text+=r.text:a.push(r);return a.length>0?a:[{type:"text",text:"",format:0}]},Pn=e=>{let t=e.split(`
10
- `),o=[],a=[],r=[],i=()=>{if(a.length>0){let s=a.join(" "),m=It(s);o.push({type:"paragraph",children:m.length>0?m:[{type:"text",text:"",format:0}]}),a=[]}},n=()=>{r.length>0&&(o.push({type:"list",listType:"bullet",children:r}),r=[])};for(let s of t){let m=s.trim();if(!m){i(),n();continue}let u=m.match(/^(#{1,6})\s+(.+)$/);if(u){i(),n();let g=u[1].length,v=u[2],w=It(v);o.push({type:"heading",tag:`h${g}`,children:w.length>0?w:[{type:"text",text:"",format:0}]});continue}let d=m.match(/^[-*+]\s+(.+)$/);if(d){i();let g=d[1],v=It(g);r.push({type:"listitem",children:[{type:"paragraph",children:v.length>0?v:[{type:"text",text:"",format:0}]}]});continue}r.length>0&&n(),a.push(m)}return i(),n(),o.length===0&&o.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:o,direction:"ltr",format:"",indent:0,version:1}}},Rn=async e=>{let t="",o,a="text";if(e.url)try{let r=e.url;!r.startsWith("http://")&&!r.startsWith("https://")&&!r.startsWith("/")&&(r="/"+r);let i=await fetch(r);i.ok?(t=await i.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed to fetch file content:",i.status,i.statusText)}catch(r){console.error("Failed to fetch file content:",r)}else console.warn("No URL provided for file:",e.name);return e.mimeType==="text/markdown"?(a="richText",o=Pn(t)):e.mimeType?.startsWith("text/")&&(a="text"),{id:e.id.toString(),title:e.name,description:void 0,content:a==="richText"?void 0:t,richTextContent:a==="richText"?o:void 0,format:a,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function Jr({document:e,onCancel:t,onSave:o,onFileUpdate:a}){let[r,i]=(0,Zt.useState)(ro(e)),[n,s]=(0,Zt.useState)(ro(e)?{id:e.id.toString(),title:e.name,description:void 0,content:"",format:"text",metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}:{...e,updatedAt:new Date}),[m,u]=(0,Zt.useState)(ro(e)?void 0:n.richTextContent),[d,g]=(0,Zt.useState)(!1),v=(0,Zt.useRef)(ro(e)?e:null);(0,Zt.useEffect)(()=>{ro(e)?(i(!0),Rn(e).then(p=>{s(p),u(p.richTextContent),i(!1)}).catch(p=>{p instanceof Error&&p.name!=="AbortError"&&(console.error("Failed to convert file:",p),i(!1))})):(s({...e,updatedAt:new Date}),u(e.richTextContent))},[e]);let w=p=>{switch(p){case"markdown":case"mdx":return(0,Aa.jsx)(Ht.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Aa.jsx)(Ht.File,{className:"h-6 w-6 text-success"});case"text":return(0,Aa.jsx)(Ht.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Aa.jsx)(Ht.File,{className:"h-6 w-6 text-muted-foreground"})}},N=p=>{switch(p){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"}},E=async()=>{g(!0);try{let p,b;if(v.current&&v.current.mimeType==="text/markdown"){let y=m?kn(m):"";p={...n,format:"markdown",content:y,richTextContent:void 0},b=y}else p={...n,richTextContent:m},b=n.content||"";let O=v.current?v.current.id.toString():n.id;await Promise.resolve(o()),a?.(O,b)}finally{g(!1)}};return(0,Aa.jsxs)(Va.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Aa.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,Aa.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Aa.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Aa.jsx)("div",{className:"flex-1 min-w-0",children:(0,Aa.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Aa.jsx)("div",{className:"flex-1 min-w-0",children:(0,Aa.jsx)(Jt,{fieldName:"title",value:n.title,label:"",onSave:(p,b)=>s(O=>({...O,title:b})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Aa.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${N(n.format)} flex-shrink-0 Aa-1`,children:n.format.toUpperCase()})]})})}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Aa.jsxs)(D,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"}),"Close"]}),(0,Aa.jsxs)(D,{size:"sm",onClick:E,className:"gap-2",disabled:d,children:[d?(0,Aa.jsx)(Ht.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Aa.jsx)(Ht.Save,{className:"h-4 w-4"}),d?"Saving...":"Save"]})]})]})}),(0,Aa.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Aa.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:r?(0,Aa.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,Aa.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,Aa.jsx)(Ht.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,Aa.jsx)(Aa.Fragment,{children:n.format==="richText"?(0,Aa.jsx)(Gr,{setValue:u,value:m,name:"richTextContent"},`richtext-${n.id}-${r?"loading":"loaded"}`):(0,Aa.jsx)(Ne,{value:n.content||"",onChange:p=>s(b=>({...b,content:p.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var qr=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function Qr({files:e,onFileClick:t,onFileDelete:o,onFileUpdate:a,showHeader:r=!0,className:i,viewMode:n="list"}){let[s,m]=(0,Zt.useState)(!1),[u,d]=(0,Zt.useState)(!1),[g,v]=(0,Zt.useState)(null),w=()=>{m(!1),v(null)},N=()=>{d(!0),setTimeout(()=>{d(!1),m(!1),v(null)},500)},E=p=>{v(p),m(!0)};return(0,Aa.jsxs)("div",{className:C("rounded-3xl border overflow-hidden",i),children:[(0,Aa.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[r&&n==="list"&&(0,Aa.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,Aa.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Aa.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Aa.jsx)("div",{className:"col-span-2",children:"Modified"})]}),n==="card"&&(0,Aa.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),n==="list"&&(0,Aa.jsx)("div",{className:"divide-y",children:e.map(p=>(0,Aa.jsxs)(Va.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?.(p),children:[(0,Aa.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Aa.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Aa.jsx)("div",{children:(0,Aa.jsx)("p",{className:"font-medium",children:p.name})})]}),(0,Aa.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:qr(p.filesize)}),(0,Aa.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Aa.jsx)("span",{className:"text-sm md:text-base",children:new Date(p.createdAt).toLocaleDateString()}),(0,Aa.jsxs)("div",{className:"flex gap-1",children:[p.mimeType==="text/markdown"&&(0,Aa.jsx)(D,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:b=>{b.stopPropagation(),E(p)},children:(0,Aa.jsx)(Ht.Edit,{className:"h-4 w-4"})}),(0,Aa.jsx)(D,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:b=>{b.stopPropagation(),o?.(p)},children:(0,Aa.jsx)(Ht.Trash2,{className:"h-4 w-4"})})]})]})]},p.name))}),n==="card"&&(0,Aa.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(p=>(0,Aa.jsx)(Va.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(p),children:(0,Aa.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Aa.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Aa.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,Aa.jsx)("div",{className:"min-w-0 flex-1",children:(0,Aa.jsx)("p",{className:"font-medium truncate",children:p.name})})]}),(0,Aa.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("span",{className:"font-medium",children:"Size:"}),(0,Aa.jsx)("span",{children:qr(p.filesize)})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,Aa.jsx)("span",{children:new Date(p.createdAt).toLocaleDateString()})]})]})]}),(0,Aa.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[p.mimeType==="text/markdown"&&(0,Aa.jsx)(D,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:b=>{b.stopPropagation(),E(p)},title:"Edit",children:(0,Aa.jsx)(Ht.Edit,{className:"h-4 w-4"})}),(0,Aa.jsx)(D,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:b=>{b.stopPropagation(),o?.(p)},title:"Delete",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-4 w-4"})})]})]})},p.name))}),(0,Aa.jsx)(Fe,{open:s,onOpenChange:p=>!p&&w(),children:(0,Aa.jsxs)(Ko,{children:[(0,Aa.jsx)(go,{}),(0,Aa.jsxs)(Xr.Content,{className:C("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[(0,Aa.jsx)(Me,{className:"sr-only",children:g?`Edit ${g.name}`:"Edit File"}),u&&(0,Aa.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,Aa.jsx)(Ht.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),g&&(0,Aa.jsx)(Jr,{document:g,onSave:N,onFileUpdate:a,onCancel:w})]})]})})]})}var ei=({isOpen:e,onClose:t,onAddFile:o})=>{let[a,r]=(0,Zt.useState)(null),[i,n]=(0,Zt.useState)(""),[s,m]=(0,Zt.useState)(""),[u,d]=(0,Zt.useState)(""),g=w=>{let N=w.target.files?.[0];N&&(r(N),i||n(N.name))},v=async w=>{if(w.preventDefault(),!a)return;let N=new FormData;N.append("file",a),N.append("name",i),s&&N.append("description",s),u&&N.append("tags",u),o?.(N),t(),r(null),n(""),m(""),d("")};return(0,Aa.jsx)(Fe,{open:e,onOpenChange:t,children:(0,Aa.jsxs)(Ve,{className:"sm:max-w-md",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Me,{children:"Add New File"})}),(0,Aa.jsxs)("form",{onSubmit:v,className:"grid gap-4",children:[(0,Aa.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Aa.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,Aa.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Aa.jsx)(En,{className:"w-10 h-10 text-gray-400"}),(0,Aa.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Aa.jsx)("span",{className:"font-semibold",children:"Click to upload"})," Ht drag and drop"]}),(0,Aa.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG Ht GIF (MAX. 800x400px)"})]}),(0,Aa.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),a&&(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("p",{className:"font-medium",children:a.name}),(0,Aa.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((a.size||0)/1024).toFixed(2)," KB"]})]}),(0,Aa.jsx)(D,{type:"submit",onClick:v,children:"Upload"})]})]})]})})};function En(e){return(0,Aa.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,Aa.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Aa.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Aa.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var ti=({isOpen:e,onClose:t,initialTask:o,epics:a,sprints:r,onUpdateTask:i,onDeleteTask:n,onAddComment:s,colleagues:m,onUploadFile:u,onDeleteFile:d,onFileUpdate:g})=>{let[v,w]=(0,Zt.useState)(o),[N,E]=(0,Zt.useState)(new Date),[p,b]=(0,Zt.useState)("idle"),[O,y]=(0,Zt.useState)("idle"),[S,oe]=(0,Zt.useState)(!1),[I,ae]=(0,Zt.useState)([]),[Q,j]=(0,Zt.useState)(m);(0,Zt.useEffect)(()=>{w(o)},[o]);let xe=async(X,x)=>{if(x!==v[X]){b("loading");try{await i(v.id.toString(),{[X]:x}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(re){console.log("error",re),b("error"),setTimeout(()=>b("idle"),3e3)}}},we=async(X,x)=>{if(x!==v[X]){b("loading");try{await i(v.id.toString(),{[X]:x}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(re){console.log("error",re),b("error"),setTimeout(()=>b("idle"),3e3)}}},$=async X=>{if(s){b("loading");try{await s?.({content:X,taskId:v.id.toString()}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}}},je=async()=>{y("loading");try{await n(v.id.toString()),y("success"),setTimeout(()=>{t(),y("idle")},1e3)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}},He=async X=>{if(u){b("loading");try{await u(v.id.toString(),X),E(new Date),b("success"),oe(!1),setTimeout(()=>b("idle"),1500)}catch(x){console.error("Error uploading file:",x),b("error"),setTimeout(()=>b("idle"),3e3)}}},k=async X=>{if(d){b("loading");try{await d(v.id.toString(),X.id.toString()),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(x){console.error("Error deleting file:",x),b("error"),setTimeout(()=>b("idle"),3e3)}}},W=(v.files||[]).map(X=>typeof X=="number"?null:X).filter(X=>X!==null),ee=p!=="loading"&&O!=="loading",Te=()=>{ee&&t()},ie=()=>p==="loading"?(0,Aa.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Aa.jsx)(Ht.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Aa.jsx)("span",{children:"Updating..."})]}):p==="success"?(0,Aa.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Aa.jsx)(Ht.Check,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:"Updated successfully"})]}):p==="error"?(0,Aa.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:"Update failed"})]}):null;return(0,Aa.jsxs)(Fe,{open:e,onOpenChange:Te,children:[(0,Aa.jsxs)(Ve,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Aa.jsxs)(ze,{children:[(0,Aa.jsx)(Me,{className:"sr-only",children:v?.name}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("div",{className:"flex-1",children:ie()}),!ee&&(0,Aa.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Aa.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Aa.jsx)(Jt,{fieldName:"name",value:v.name||"",label:"",onSave:xe,className:"border-b border-border pb-3",disabled:p==="loading"}),(0,Aa.jsx)(Jt,{fieldName:"description",value:v.description||"",label:"Description",multiline:!0,onSave:xe,disabled:p==="loading"}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)(Ht.File,{className:"h-4 w-4 text-muted-foreground"}),(0,Aa.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),u&&(0,Aa.jsxs)(D,{variant:"outline",size:"sm",onClick:()=>oe(!0),disabled:p==="loading",className:"gap-2",children:[(0,Aa.jsx)(Ht.Upload,{className:"h-4 w-4"}),"Upload"]})]}),W.length>0?(0,Aa.jsx)(Qr,{files:W,onFileDelete:d?k:void 0,onFileUpdate:g,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"No files attached"})]}),(0,Aa.jsx)(rr,{comments:(v?.comments||[]).map(X=>({author:X.author?.value.name||"",createdAt:new Date(X.timestamp),text:X.text,id:X.id||""})),onAddComment:$})]}),(0,Aa.jsx)(sr,{task:v,epics:a,sprints:r,lastUpdated:N,onUpdateTask:we,onClose:Te,onDelete:je,isUpdating:p==="loading",isDeleting:O==="loading",deleteState:O,teamMembers:Q})]})]}),u&&(0,Aa.jsx)(ei,{isOpen:S,onClose:()=>oe(!1),onAddFile:He})]})};var Io=({isOpen:e,onClose:t,onAddEpic:o})=>{let[a,r]=(0,Zt.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}),i=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],m=d=>{d.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}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},u=(d,g)=>{r(v=>({...v,[d]:g}))};return(0,Aa.jsx)(Fe,{open:e,onOpenChange:t,children:(0,Aa.jsxs)(Ve,{className:"sm:max-w-md",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Me,{children:"Add New Epic"})}),(0,Aa.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"name",children:"Epic Name"}),(0,Aa.jsx)(te,{id:"name",value:a.name,onChange:d=>u("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"description",value:a.description,onChange:d=>u("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Color"}),(0,Aa.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,Aa.jsx)("button",{type:"button",onClick:()=>u("color",d),className:`w-8 h-8 rounded-full ${d} ${a.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Confidence"}),(0,Aa.jsxs)(Ge,{value:a.confidence,onValueChange:d=>u("confidence",d),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{})}),(0,Aa.jsx)($e,{children:n.map(d=>(0,Aa.jsx)(me,{value:d.value,children:d.label},d.value))})]})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Phase"}),(0,Aa.jsxs)(Ge,{value:a.phase.toString(),onValueChange:d=>u("phase",parseInt(d)),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{})}),(0,Aa.jsx)($e,{children:s.map(d=>(0,Aa.jsx)(me,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Start Date"}),(0,Aa.jsx)(te,{type:"date",value:a.startDate,onChange:d=>u("startDate",d.target.value)})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"End Date"}),(0,Aa.jsx)(te,{type:"date",value:a.endDate,onChange:d=>u("endDate",d.target.value)})]})]}),(0,Aa.jsxs)(Kt,{children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};function ai(e,t){let[o,a]=(0,Zt.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{a(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,Zt.useEffect)(()=>{r(o)},[]),[o,r]}var Lo=require("react-icons/fa");function Nt({title:e,description:t,badge:o,primaryAction:a,secondaryAction:r,gradient:i,children:n,className:s}){let[m,u]=ai(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||m;return(0,Aa.jsxs)(Va.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,Aa.jsx)(le,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,Aa.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-3",children:[d&&a&&(0,Aa.jsx)(D,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),(r||t)&&(0,Aa.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>u(!m),style:{lineHeight:0},children:m?(0,Aa.jsx)(Lo.FaChevronDown,{size:22}):(0,Aa.jsx)(Lo.FaChevronUp,{size:22})})]})]}),!d&&(0,Aa.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Aa.jsxs)("div",{className:"space-y-4",children:[(0,Aa.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Aa.jsxs)("div",{className:"flex flex-wrap gap-3",children:[a&&(0,Aa.jsx)(D,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),r&&(0,Aa.jsx)(D,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),n&&(0,Aa.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var Mn=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:a=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:n,onUpdateTask:s,onDeleteTask:m,onTaskClick:u,onAddEpic:d,onAddComment:g,onUploadFile:v,onDeleteFile:w,onFileUpdate:N})=>{let[E,p]=(0,se.useState)([]),[b,O]=(0,se.useState)([]),[y,S]=(0,se.useState)([]),[oe,I]=(0,se.useState)(!1),[ae,Q]=(0,se.useState)(!1),[j,xe]=(0,se.useState)(null),[we,$]=(0,se.useState)(null),[je,He]=(0,se.useState)([]),[k,W]=(0,se.useState)([]),[ee,Te]=(0,se.useState)(0),ie=(0,se.useRef)(null),X=(0,se.useRef)(null),x=se.default.useMemo(()=>[...b.map(h=>h.id),0],[b]),re=(0,se.useRef)(""),Oe=(0,se.useRef)(""),ft=(0,se.useRef)(""),pe=(0,se.useRef)(""),ot=(h,P)=>h.map(F=>`${F.id}-${new Date(F.createdAt).getTime()}-${new Date(F.updatedAt).getTime()}`).join("-")+(P?`-${P}`:"");(0,se.useEffect)(()=>{let h=e.map(F=>F.files?.filter(K=>typeof K=="object").map(K=>new Date(K.updatedAt).getTime())).flat(),P=ot(e,h.join("-"));P!==re.current&&(p(e),j&&xe(e.find(F=>F.id===j.id)||null),re.current=P)},[e]),(0,se.useEffect)(()=>{let h=ot(t);h!==Oe.current&&(O(t),Oe.current=h)},[t]),(0,se.useEffect)(()=>{let h=ot(o);h!==ft.current&&(S(o),ft.current=h)},[o]),(0,se.useEffect)(()=>{let h=ot(r.map(P=>({id:P.id,updatedAt:P.updatedAt,createdAt:P.createdAt})));h!==pe.current&&(W(r),pe.current=h)},[r]),(0,se.useEffect)(()=>{let h=()=>{if(ie.current){let K=ie.current.offsetHeight;Te(K)}};h();let P=new ResizeObserver(h);ie.current&&P.observe(ie.current);let F=()=>{setTimeout(h,100)};return window.addEventListener("storage",F),()=>{P.disconnect(),window.removeEventListener("storage",F)}},[]),(0,se.useEffect)(()=>{let h=setTimeout(()=>{ie.current&&Te(ie.current.offsetHeight)},300);return()=>clearTimeout(h)},[oe,ae]);let Ho=E.filter(h=>!0),no=h=>Ho.filter(P=>P.status===h),Bo=h=>{let P={};return b.forEach(F=>{P[F.id]=h.filter(K=>Ie(K.epic)===F.id)}),P["no-epic"]=h.filter(F=>!Ie(F.epic)),P},so=h=>{$(h)},Fo=h=>{we&&(p(P=>P.map(F=>F.id===we.id?{...F,status:h}:F)),s?.(we.id.toString(),{status:h}),$(null))},lo=h=>{let P={...h,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};p(F=>[...F,P]),n?.(h)},co=async(h,P)=>{p(F=>F.map(K=>K.id===Number(h)?{...K,...P}:K)),s&&await s(h,P),j?.id===Number(h)&&xe(F=>({...F,...P}))},mo=async h=>{p(P=>P.filter(F=>F.id!==Number(h))),j?.id===Number(h)&&xe(null),m&&await m(h)},po=h=>{let P={...h,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};O(F=>[...F,P]),d?.(h)},vt=h=>{xe(h),u?.(h)},f=[{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"}],T=ee>0?`calc(100vh - ${ee+120}px)`:"calc(100vh - 12rem)";return(0,Aa.jsxs)("div",{ref:X,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Aa.jsx)("div",{ref:ie,className:"flex-shrink-0",children:(0,Aa.jsx)(Nt,{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:()=>I(!0)},secondaryAction:{label:"Add epic",onClick:()=>Q(!0)}})}),(0,Aa.jsx)("div",{className:"flex-1 min-h-0 Aa-8",children:(0,Aa.jsx)("div",{className:"h-full",style:{height:ee>0?`calc(100vh - ${ee+120}px)`:"calc(100vh - 12rem)"},children:(0,Aa.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:f.map(h=>{let P=no(h.status),F=Bo(P);return(0,Aa.jsxs)(Ua,{title:h.title,status:h.status,taskCount:P.length,onDrop:Fo,isCompact:h.status==="done",height:T,children:[F["no-epic"].map(K=>(0,Aa.jsx)(jt,{epic:null,task:K,onDragStart:so,onTaskClick:vt,isCompact:h.status==="done"},K.id)),x.map(K=>{let Be=b.find(St=>St.id===K),Ct=F[K]||[];return Ct.length===0?null:(0,Aa.jsxs)("div",{className:"mb-6",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${Be?.color}`}),(0,Aa.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Be?.name||"No Epic"}),(0,Aa.jsx)(le,{variant:"secondary",className:"text-xs",children:Ct.length})]})," ",(0,Aa.jsx)("div",{className:"space-y-3",children:Ct.map(St=>(0,Aa.jsx)(jt,{task:St,epic:Be,onDragStart:so,onTaskClick:vt,isCompact:h.status==="done"},St.id))})]},K)})]},h.id)})})})}),(0,Aa.jsx)(vo,{isOpen:oe,onClose:()=>I(!1),onAddTask:lo,assignees:[...k,...je],epics:b,sprints:y}),(0,Aa.jsx)(Io,{isOpen:ae,onClose:()=>Q(!1),onAddEpic:po}),j&&(0,Aa.jsx)(ti,{isOpen:!!j,onClose:()=>xe(null),initialTask:j,epics:b,sprints:y,onUpdateTask:co,onDeleteTask:mo,colleagues:k,onUploadFile:v,onDeleteFile:w,onFileUpdate:N,onAddComment:g})]})};var ba=require("date-fns");var ni=({isOpen:e,onClose:t,onAddSprint:o})=>{let[a,r]=(0,Zt.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),i=s=>{s.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()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},n=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Aa.jsx)(Fe,{open:e,onOpenChange:n,children:(0,Aa.jsxs)(Ve,{className:"sm:max-w-md",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Me,{children:"Add New Sprint"})}),(0,Aa.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"name",children:"Sprint Name *"}),(0,Aa.jsx)(te,{id:"name",value:a.name,onChange:s=>r(m=>({...m,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"description",value:a.description,onChange:s=>r(m=>({...m,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Start Date *"}),(0,Aa.jsxs)(ga,{children:[(0,Aa.jsx)(fa,{asChild:!0,children:(0,Aa.jsxs)(D,{variant:"outline",className:C("w-full justify-start text-left font-normal",!a.startDate&&"text-muted-foreground"),children:[(0,Aa.jsx)(Ht.CalendarIcon,{className:"U-2 h-4 w-4"}),a.startDate?(0,ba.format)(a.startDate,"PPP"):"Pick a date"]})}),(0,Aa.jsx)(Ro,{className:"w-auto p-0",align:"start",children:(0,Aa.jsx)(Eo,{mode:"single",selected:a.startDate,onSelect:s=>r(m=>({...m,startDate:s})),initialFocus:!0})})]})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"End Date *"}),(0,Aa.jsxs)(ga,{children:[(0,Aa.jsx)(fa,{asChild:!0,children:(0,Aa.jsxs)(D,{variant:"outline",className:C("w-full justify-start text-left font-normal",!a.endDate&&"text-muted-foreground"),children:[(0,Aa.jsx)(Ht.CalendarIcon,{className:"U-2 h-4 w-4"}),a.endDate?(0,ba.format)(a.endDate,"PPP"):"Pick a date"]})}),(0,Aa.jsx)(Ro,{className:"w-auto p-0",align:"start",children:(0,Aa.jsx)(Eo,{mode:"single",selected:a.endDate,onSelect:s=>r(m=>({...m,endDate:s})),initialFocus:!0,disabled:s=>a.startDate?s<a.startDate:!1})})]})]})]}),(0,Aa.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",disabled:!a.name||!a.startDate||!a.endDate,children:"Add Sprint"})]})]})]})})};var In=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:r,onAddSprint:i,onUpdateSprint:n,onDeleteSprint:s})=>{let[m,u]=(0,Zt.useState)([]),[d,g]=(0,Zt.useState)(new Set),[v,w]=(0,Zt.useState)(null),[N,E]=(0,Zt.useState)(!1),[p,b]=(0,Zt.useState)(null),[O,y]=(0,Zt.useState)(null),[S,oe]=(0,Zt.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[I,ae]=(0,Zt.useState)([]),[Q,j]=(0,Zt.useState)("upcoming"),[xe,we]=(0,Zt.useState)(!1),[$,je]=(0,Zt.useState)(0),He=(0,Zt.useRef)(null),k=(0,Zt.useRef)(null);(0,Zt.useEffect)(()=>{let f=()=>{He.current&&je(He.current.offsetHeight)};f();let T=new ResizeObserver(f);return He.current&&T.observe(He.current),()=>T.disconnect()},[]);let W=f=>t.find(T=>T.id===Number(f)),ee=f=>o.find(T=>T.id===Number(f)),Te=f=>{let T={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 T[f]||T.medium},ie=f=>{if(!f||f?.length===0)return"";let T=f?.trim().split(" ");if(T?.length===1)return T[0];let h=T[0],P=T[T.length-1][0].toUpperCase();return`${h} ${P}`},X=f=>{let T={},h=[];return f.forEach(P=>{P.epic?(T[Ie(P.epic)]||(T[Ie(P.epic)]=[]),T[Ie(P.epic)].push(P)):h.push(P)}),{tasksByEpic:T,unassignedTasks:h}};(0,Zt.useEffect)(()=>{ae(o)},[o]);let x=I.filter(f=>{switch(Q){default:return!0}}),re=I.filter(f=>m.includes(f.id.toString())),Oe=e.filter(f=>!f.sprint||f.status==="backlog"),ft=Oe.reduce((f,T)=>f+(T.storyPoints||0),0),pe=f=>{u(T=>T.includes(f)?T.filter(h=>h!==f):T?.length<3?[...T,f]:T)},ot=f=>{g(T=>{let h=new Set(T);return h.has(f)?h.delete(f):h.add(f),h})},Ho=f=>{i(f),E(!1)},no=f=>{y(f.id.toString()),oe({name:f.name,description:f.description||"",startDate:f.startDate?new Date(f.startDate).toISOString().split("T")[0]:f.startDate,endDate:f.endDate?new Date(f.endDate).toISOString().split("T")[0]:f.endDate,isActive:!1})},Bo=()=>{O&&(n(O,{name:S.name,description:S.description,startDate:S.startDate,endDate:S.endDate}),ae(f=>f.map(T=>(T.id===Number(O)&&(T.name=S.name,T.description=S.description,T.startDate=S.startDate,T.endDate=S.endDate),T))),y(null))},so=()=>{y(null),oe({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Fo=(f,T)=>{w(T),f.dataTransfer.effectAllowed="move"},lo=f=>{f.preventDefault(),f.dataTransfer.dropEffect="move"},co=f=>{b(f)},mo=()=>{b(null)},po=(f,T)=>{if(f.preventDefault(),b(null),!v)return;(Ie(v.sprint)||void 0)!==Number(T)&&a(v.id.toString(),{sprint:Number(T)}),w(null)},vt=({task:f,showSprint:T=!1})=>{let h=f.epic?W(Ie(f.epic).toString()):null,P=f.sprint?ee(Ie(f.sprint).toString()):null;return(0,Aa.jsx)(ue,{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:Be=>{Be.dataTransfer.effectAllowed="move",Be.dataTransfer.setData("text/plain",f.id.toString()),Fo(Be,f)},onClick:Be=>{v===null&&r(f)},style:{userSelect:"none"},children:(0,Aa.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Aa.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Aa.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:f.name}),(0,Aa.jsx)(le,{className:`text-xs ${Te(f.priority||"medium")}`,children:f.priority?.[0]?.toUpperCase()})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-1",children:[h&&(0,Aa.jsx)("div",{className:`w-2 h-2 rounded-full ${h.color}`}),(0,Aa.jsx)("span",{className:"text-muted-foreground truncate",children:h?.name})]}),(0,Aa.jsx)("span",{className:"text-muted-foreground",children:ie(f.assignee?.value?.name)})]}),T&&P&&(0,Aa.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-3 w-3"}),(0,Aa.jsx)("span",{children:P.name})]})]})})};return(0,Aa.jsxs)("div",{ref:k,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Aa.jsx)("div",{ref:He,className:"flex-shrink-0",children:(0,Aa.jsx)(Nt,{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:()=>E(!0)}})}),(0,Aa.jsx)("div",{className:"flex-1 min-h-0 Aa-8",children:(0,Aa.jsxs)("div",{className:"h-full",style:{height:$>0?`calc(100vh - ${$+120}px)`:"calc(100vh - 12rem)"},children:[(0,Aa.jsxs)("div",{className:"mb-4",children:[(0,Aa.jsx)(ue,{className:"p-3 bg-card shadow-sm",children:(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Aa.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m?.length,"/3 selected"]})]}),m?.length>0&&(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Aa.jsx)("div",{className:"flex flex-wrap gap-1",children:re.map(f=>(0,Aa.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Aa.jsx)("span",{className:"max-w-[80px] truncate",children:f.name}),(0,Aa.jsx)("button",{onClick:()=>pe(f.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"})})]},f.id))})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsxs)(D,{onClick:()=>E(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Aa.jsx)(Ht.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Aa.jsxs)(D,{onClick:()=>we(!xe),variant:"outline",size:"sm",className:"gap-1",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-3 w-3"}),xe?"Close":"Select"]})]})]})}),xe&&(0,Aa.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>we(!1)}),(0,Aa.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-Aa shadow-xl z-10 transition-all duration-300 ease-in-out ${xe?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Aa.jsxs)(ue,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Aa.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Aa.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>we(!1),className:"h-8 w-8 p-0",children:(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"})})]}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground Aa-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Aa.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Aa.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(f=>(0,Aa.jsxs)(D,{variant:Q===f.key?"default":"outline",size:"sm",onClick:()=>j(f.key),className:"text-xs h-8 px-3 flex-1",children:[f.label," (",f.count,")"]},f.key))}),(0,Aa.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:x.length>0?x.map(f=>{let T=m.includes(f.id.toString()),h=e.filter(F=>Ie(F.sprint)===f.id).length,P=!T&&m.length<3;return(0,Aa.jsx)("div",{className:`p-3 rounded-lg border transition-all ${T?"bg-primary/10 border-primary/30":P?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:O===f.id.toString()?(0,Aa.jsxs)("div",{className:"space-y-3",children:[(0,Aa.jsx)(te,{value:S.name,onChange:F=>oe(K=>({...K,name:F.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Aa.jsx)(Ne,{value:S.description,onChange:F=>oe(K=>({...K,description:F.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Aa.jsxs)("div",{className:"flex gap-2",children:[(0,Aa.jsxs)(D,{size:"sm",onClick:()=>Bo(),className:"flex-1",children:[(0,Aa.jsx)(Ht.Check,{className:"h-3 w-3 U-1"}),"Save"]}),(0,Aa.jsxs)(D,{size:"sm",variant:"outline",onClick:so,className:"flex-1",children:[(0,Aa.jsx)(Ht.X,{className:"h-3 w-3 U-1"}),"Cancel"]})]})]}):(0,Aa.jsxs)("div",{children:[(0,Aa.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Aa.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Aa.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:f.name}),(0,Aa.jsx)(le,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Aa.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:f.description}),(0,Aa.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Aa.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Aa.jsx)(Ht.CalendarDays,{className:"h-3 w-3"}),new Date(f.startDate).toLocaleDateString()]}),(0,Aa.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Aa.jsx)(Ht.User,{className:"h-3 w-3"}),h," tasks"]})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>no(f),className:"h-6 w-6 p-0",children:(0,Aa.jsx)(Ht.Edit2,{className:"h-3 w-3"})}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>s(f.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-3 w-3"})})]})]}),(0,Aa.jsx)("div",{className:"flex items-center justify-between Aa-2",children:(0,Aa.jsx)(D,{variant:T?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>pe(f.id.toString()),disabled:!T&&m?.length>=3,children:(0,Aa.jsx)("span",{className:"pointer-events-none select-none",children:T?"Deselect":m?.length>=3?"Limit Reached":"Select"})})})]})},f.id)}):(0,Aa.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Aa.jsxs)("p",{className:"text-sm",children:['No sprints found for "',Q,'" filter']}),(0,Aa.jsx)(D,{variant:"link",size:"sm",onClick:()=>j("all"),className:"text-xs",children:"Show all sprints"})]})}),m?.length===0&&(0,Aa.jsx)("div",{className:"Aa-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Aa.jsxs)("div",{className:"text-center",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Aa.jsx)("p",{className:"text-xs text-muted-foreground Aa-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Aa.jsx)("div",{className:"lg:col-span-1",children:(0,Aa.jsxs)(ue,{className:"p-4 h-full bg-card border-Aa-4 border-Aa-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:lo,onDragEnter:()=>co("backlog"),onDragLeave:mo,onDrop:f=>po(f,"backlog"),style:{height:$>0?`calc(100vh - ${$+200}px)`:"calc(100vh - 16rem)"},children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Aa.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsxs)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[Oe?.length," tasks"]}),(0,Aa.jsxs)(le,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[ft," pts"]})]})]}),(0,Aa.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${p==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:f,unassignedTasks:T}=X(Oe);return(0,Aa.jsxs)(Aa.Fragment,{children:[Object.entries(f).map(([h,P])=>{let F=W(h);if(!F)return null;let K=d.has(h);return(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.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:()=>ot(h),children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${F.color}`}),(0,Aa.jsx)("span",{className:"font-medium text-muted-foreground",children:F.name}),(0,Aa.jsxs)("span",{className:"text-muted-foreground",children:["(",P?.length,")"]}),(0,Aa.jsx)("div",{className:"ml-auto",children:K?(0,Aa.jsx)(Ht.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Aa.jsx)(Ht.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!K&&(0,Aa.jsx)("div",{className:"space-y-2 pl-2",children:P.map(Be=>(0,Aa.jsx)(vt,{task:Be},Be.id))})]},h)}),T?.length>0&&(()=>{let h=d.has("no-epic");return(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.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:()=>ot("no-epic"),children:[(0,Aa.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Aa.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Aa.jsxs)("span",{className:"text-muted-foreground",children:["(",T?.length,")"]}),(0,Aa.jsx)("div",{className:"ml-auto",children:h?(0,Aa.jsx)(Ht.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Aa.jsx)(Ht.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!h&&(0,Aa.jsx)("div",{className:"space-y-2 pl-2",children:T?.map(P=>(0,Aa.jsx)(vt,{task:P},P.id))})]})})(),Oe?.length===0&&(0,Aa.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"}),Oe?.length>0&&Object.keys(f).length===0&&T.length===0&&(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),Oe?.map(h=>(0,Aa.jsx)(vt,{task:h},h.id))]})]})})()})]})}),re.map(f=>{let T=e.filter(P=>Ie(P?.sprint)===f.id),h=T.reduce((P,F)=>P+(F?.storyPoints||0),0);return(0,Aa.jsxs)(ue,{className:"p-4 h-full bg-card border-Aa-4 border-Aa-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:lo,onDragEnter:()=>co(f.id.toString()),onDragLeave:mo,onDrop:P=>po(P,f.id.toString()),style:{height:$>0?`calc(100vh - ${$+200}px)`:"calc(100vh - 16rem)"},children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Aa.jsx)("div",{children:(0,Aa.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:f.name})}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsxs)(le,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[T?.length," tasks"]}),(0,Aa.jsxs)(le,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[h," pts"]}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>{we(!0),no(f)},className:"h-6 px-2",children:(0,Aa.jsx)(Ht.Edit2,{className:"h-3 w-3"})}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>s(f.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-3 w-3"})})]})]}),(0,Aa.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:P,unassignedTasks:F}=X(T);return(0,Aa.jsxs)(Aa.Fragment,{children:[Object.entries(P).map(([K,Be])=>{let Ct=W(K);if(!Ct)return null;let St=d.has(K);return(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.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:()=>ot(K),children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${Ct.color}`}),(0,Aa.jsx)("span",{className:"font-medium text-muted-foreground",children:Ct.name}),(0,Aa.jsxs)("span",{className:"text-muted-foreground",children:["(",Be?.length,")"]}),(0,Aa.jsx)("div",{className:"ml-auto",children:St?(0,Aa.jsx)(Ht.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Aa.jsx)(Ht.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!St&&(0,Aa.jsx)("div",{className:"space-y-2 pl-2",children:Be?.map(wa=>(0,Aa.jsx)(vt,{task:wa},wa.id))})]},K)}),F?.length>0&&(()=>{let K=d.has("no-epic");return(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.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:()=>ot("no-epic"),children:[(0,Aa.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Aa.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Aa.jsxs)("span",{className:"text-muted-foreground",children:["(",F?.length,")"]}),(0,Aa.jsx)("div",{className:"ml-auto",children:K?(0,Aa.jsx)(Ht.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Aa.jsx)(Ht.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!K&&(0,Aa.jsx)("div",{className:"space-y-2 pl-2",children:F?.map(Be=>(0,Aa.jsx)(vt,{task:Be},Be.id))})]})})(),T?.length===0&&(0,Aa.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},f.id)})]}),(0,Aa.jsx)(ni,{isOpen:N,onClose:()=>E(!1),onAddSprint:Ho})]})})]})};var An=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Ln=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})},xa=(e,t)=>{let o=new Date,a=new Date(e);if(t){let[r,i]=t.split(":");a.setHours(parseInt(r),parseInt(i))}return a<o},ya=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Hn=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Bn=({colleagues:e,onAddReminder:t,open:o,setOpen:a})=>{let[r,i]=(0,Zt.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[n,s]=(0,Zt.useState)(!1),m=d=>{if(d.preventDefault(),!e.find(w=>w?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),s(!0);return}s(!1);let v={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(v),a(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Zt.useEffect)(()=>{r.colleagueId&&s(!1)},[r.colleagueId]);let u=e.filter(Boolean);return(0,Aa.jsx)(Fe,{open:o,onOpenChange:a,children:(0,Aa.jsxs)(Ve,{className:"max-w-2xl",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Me,{children:"Add New Reminder"})}),(0,Aa.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Aa.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"title",children:"Title"}),(0,Aa.jsx)(te,{id:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"dueDate",children:"Due Date"}),(0,Aa.jsx)(te,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Aa.jsx)(te,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{className:`${n?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Aa.jsxs)(Ge,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,Aa.jsx)(Ue,{className:`${n?"text-destructive border-red-500":""}`,children:(0,Aa.jsx)(at,{className:`${n?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Aa.jsx)($e,{children:u.map(d=>(0,Aa.jsx)(me,{value:d.id.toString(),children:d.name},d.id))})]}),n&&(0,Aa.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Aa.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Aa.jsx)(H,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Aa.jsxs)(Ge,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsx)(me,{value:"daily",children:"Daily"}),(0,Aa.jsx)(me,{value:"weekly",children:"Weekly"}),(0,Aa.jsx)(me,{value:"monthly",children:"Monthly"}),(0,Aa.jsx)(me,{value:"yearly",children:"Yearly"})]})]})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Aa.jsx)(te,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Aa.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",children:"Add Reminder"})]})]})]})})},Fn=({reminder:e,colleagues:t,onUpdateReminder:o,open:a,onClose:r})=>{let[i,n]=(0,Zt.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=u=>{u.preventDefault(),o(e.id.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},m=t.filter(Boolean);return(0,Aa.jsx)(Fe,{open:a,onOpenChange:r,children:(0,Aa.jsxs)(Ve,{className:"max-w-2xl",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Me,{children:"Edit Reminder"})}),(0,Aa.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Aa.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"edit-title",children:"Title"}),(0,Aa.jsx)(te,{id:"edit-title",value:i.title,onChange:u=>n({...i,title:u.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"edit-description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"edit-description",value:i.description||"",onChange:u=>n({...i,description:u.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Aa.jsx)(te,{id:"edit-dueDate",type:"date",value:i.dueDate,onChange:u=>n({...i,dueDate:u.target.value}),required:!0})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Aa.jsx)(te,{id:"edit-dueTime",type:"time",value:i.dueTime,onChange:u=>n({...i,dueTime:u.target.value})})]})]}),(0,Aa.jsx)("div",{className:"space-y-2",children:(0,Aa.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Aa.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:i.isRecurring||!1,onChange:u=>n({...i,isRecurring:u.target.checked}),className:"rounded border-border"}),(0,Aa.jsx)(H,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Aa.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",children:"Save Changes"})]})]})]})})},On=({reminder:e,colleagues:t,onUpdateReminder:o,onDeleteReminder:a})=>{let[r,i]=(0,Zt.useState)(!1);if(!e||!e.id)return null;let n=xa(new Date(e.dueDate||""),e.dueTime||""),s=ya(new Date(e.dueDate||"")),m=Hn(new Date(e.dueDate||"")),u=()=>{o(e.id.toString(),{})},d=()=>s?"Today":m?"Tomorrow":An(new Date(e.dueDate||""));return(0,Aa.jsxs)(Aa.Fragment,{children:[(0,Aa.jsx)(Fn,{reminder:e,colleagues:t,onUpdateReminder:o,open:r,onClose:()=>i(!1)}),(0,Aa.jsx)(ue,{children:(0,Aa.jsx)(_t,{className:"p-4",children:(0,Aa.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Aa.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Aa.jsx)("button",{onClick:u,className:"Aa-1 text-primary hover:text-primary/80"}),(0,Aa.jsxs)("div",{className:"flex-1",children:[(0,Aa.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Aa.jsx)("h3",{children:e.title})}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Aa.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Aa.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{className:n?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Aa.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Aa.jsx)(Ht.Clock,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:Ln(e.dueTime)})]}),(0,Aa.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Aa.jsx)(Ht.User,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Aa.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,Aa.jsx)(Ht.Edit2,{className:"h-4 w-4"})}),(0,Aa.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>a(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Vn=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:o,onUpdateReminder:a,onDeleteReminder:r})=>{let[i,n]=(0,Zt.useState)(e.filter(Boolean)),[s,m]=(0,Zt.useState)(t.filter(Boolean)),[u,d]=(0,Zt.useState)("all"),[g,v]=(0,Zt.useState)(""),[w,N]=(0,Zt.useState)(!1);(0,Zt.useEffect)(()=>{n(e.filter(Boolean))},[e]),(0,Zt.useEffect)(()=>{m(t.filter(Boolean))},[t]);let E=I=>{if(!I.title){console.error("Invalid reminder data:",I);return}let ae={...I,id:Date.now(),createdAt:new Date().toISOString()};n(Q=>[...Q,ae]),o?.(I)},p=(I,ae)=>{if(!I){console.error("No reminder ID provided for update");return}n(Q=>Q.map(j=>j?.id.toString()===I?{...j,...ae}:j)),a?.(I,ae)},b=I=>{if(!I){console.error("No reminder ID provided for deletion");return}n(ae=>ae.filter(Q=>Q?.id.toString()!==I)),r?.(I)},y=i.filter(I=>{if(!I)return!1;if(g){let ae=g.toLowerCase();if(!(I.title.toLowerCase().includes(ae)||I.description?.toLowerCase().includes(ae)))return!1}switch(u){case"pending":case"completed":case"overdue":return xa(new Date(I.dueDate||""),I.dueTime||"");case"today":return ya(new Date(I.dueDate||""));default:return!0}}).sort((I,ae)=>{if(!I||!ae)return 0;let Q={high:3,medium:2,low:1},j=0;return j!==0?j:new Date(I.dueDate||"").getTime()-new Date(ae.dueDate||"").getTime()}),S={total:i.filter(Boolean).length,overdue:i.filter(I=>I&&xa(new Date(I.dueDate||""),I.dueTime||"")).length,today:i.filter(I=>I&&ya(new Date(I.dueDate||""))).length},oe=s.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,Aa.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Aa.jsx)(Nt,{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:()=>{N(!0)}}}),(0,Aa.jsxs)("div",{className:"h-full bg-background",children:[(0,Aa.jsx)(Bn,{colleagues:s,onAddReminder:E,open:w,setOpen:N}),(0,Aa.jsxs)("div",{className:"p-6",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Aa.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Aa.jsxs)(D,{className:"flex items-center space-x-2",onClick:()=>N(!0),children:[(0,Aa.jsx)(Ht.Plus,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:"Add Reminder"})]})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-foreground",children:S.total}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-primary",children:S.overdue}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-success",children:S.today}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-destructive",children:S.overdue}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-warning",children:S.today}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Aa.jsx)("div",{className:"flex-1",children:(0,Aa.jsx)(te,{placeholder:"Search reminders...",value:g,onChange:I=>v(I.target.value),className:"max-w-md"})}),(0,Aa.jsxs)(Ge,{value:u,onValueChange:I=>d(I),children:[(0,Aa.jsx)(Ue,{className:"w-40",children:(0,Aa.jsx)(at,{})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsxs)(me,{value:"all",children:["All (",S.total,")"]}),(0,Aa.jsxs)(me,{value:"overdue",children:["Overdue (",S.overdue,")"]}),(0,Aa.jsxs)(me,{value:"overdue",children:["Overdue (",S.overdue,")"]}),(0,Aa.jsxs)(me,{value:"today",children:["Today (",S.today,")"]})]})]})]}),(0,Aa.jsx)("div",{className:"space-y-4",children:y.length===0?(0,Aa.jsxs)(ue,{className:"p-8 text-center",children:[(0,Aa.jsx)("div",{className:"text-muted-foreground",children:g||u!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&u==="all"&&(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground/60 Aa-2",children:"Create your first reminder to get started"})]}):y.map(I=>I&&(0,Aa.jsx)(On,{reminder:I,colleagues:s,onUpdateReminder:p,onDeleteReminder:b},I.id))})]})]})]})};var zn=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:n,onUpdateEpic:s,onDeleteEpic:m})=>{let[u,d]=(0,Zt.useState)(t),[g,v]=(0,Zt.useState)(null),[w,N]=(0,Zt.useState)(null),[E,p]=(0,Zt.useState)({}),[b,O]=(0,Zt.useState)(0),[y,S]=(0,Zt.useState)(!1),[oe,I]=(0,Zt.useState)(!1),[ae,Q]=(0,Zt.useState)(null),j=(0,Zt.useRef)(null),xe=(0,Zt.useRef)(null);(0,Zt.useEffect)(()=>{d(t)},[t]),(0,Zt.useEffect)(()=>{let x=()=>{if(j.current){let ft=j.current.offsetHeight;O(ft)}};x();let re=new ResizeObserver(x);j.current&&re.observe(j.current);let Oe=()=>{setTimeout(x,100)};return window.addEventListener("storage",Oe),()=>{re.disconnect(),window.removeEventListener("storage",Oe)}},[]),(0,Zt.useEffect)(()=>{let x=setTimeout(()=>{j.current&&O(j.current.offsetHeight)},300);return()=>clearTimeout(x)},[w]);let we=x=>{v(x)},$=x=>{x.preventDefault()},je=(x,re)=>{x.preventDefault(),g&&Ie(g.epic).toString()!==re&&(a(g.id.toString(),{epic:Number(re)}),v(null))},He=x=>e.filter(re=>Ie(re.epic).toString()===x),k=x=>{N(x.id.toString()),p({name:x.name,description:x.description,confidence:x.confidence,phase:x.phase})},W=async()=>{w&&E.name&&(await s(w.toString(),E),d(x=>x.map(re=>re.id.toString()===w?{...re,...E}:re)),N(null),p({}))},ee=()=>{N(null),p({})},Te=async x=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await m(x),d(re=>re.filter(Oe=>Oe.id.toString()!==x)))},ie=x=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[x]||`Phase ${x}`,X=x=>{switch(x){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,Aa.jsxs)(Aa.Fragment,{children:[(0,Aa.jsxs)("div",{ref:xe,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Aa.jsx)("div",{ref:j,className:"flex-shrink-0",children:(0,Aa.jsx)(Nt,{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:()=>S(!0)}})}),(0,Aa.jsx)("div",{className:"flex-1 min-h-0 Aa-8",children:(0,Aa.jsx)("div",{className:"h-full overflow-y-auto",style:{height:b>0?`calc(100vh - ${b+120}px)`:"calc(100vh - 12rem)"},children:(0,Aa.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:u.map(x=>{let re=He(x.id.toString()),Oe=re.reduce((pe,ot)=>pe+(ot.storyPoints||0),0),ft=b>0?`calc(100vh - ${b+200}px)`:"calc(100vh - 14rem)";return(0,Aa.jsxs)(ue,{className:`flex flex-col ${w===x.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:w===x.id.toString()?"auto":ft,minHeight:"400px"},onDragOver:$,onDrop:pe=>je(pe,x.id.toString()),children:[(0,Aa.jsx)("div",{className:"p-4 border-b border-border",children:w===x.id.toString()?(0,Aa.jsxs)("div",{className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)(te,{value:E.name||"",onChange:pe=>p({...E,name:pe.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Aa.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:W,className:"p-1 h-8 w-8",children:(0,Aa.jsx)(Ht.Check,{className:"h-4 w-4"})}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:ee,className:"p-1 h-8 w-8",children:(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"})})]})]}),(0,Aa.jsx)(Ne,{value:E.description||"",onChange:pe=>p({...E,description:pe.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Aa.jsxs)("select",{value:E.confidence||x.confidence,onChange:pe=>p({...E,confidence:pe.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,Aa.jsx)("option",{value:"low",children:"Low"}),(0,Aa.jsx)("option",{value:"medium",children:"Medium"}),(0,Aa.jsx)("option",{value:"high",children:"High"})]})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Aa.jsx)("select",{value:E.phase?.toString()||x.phase.toString(),onChange:pe=>p({...E,phase:parseInt(pe.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(pe=>(0,Aa.jsxs)("option",{value:pe.toString(),children:["Phase ",pe]},pe))})]})]})]}):(0,Aa.jsxs)(Aa.Fragment,{children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Aa.jsx)("div",{className:`w-4 h-4 rounded-full ${x.color}`}),(0,Aa.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:x.name}),(0,Aa.jsxs)("div",{className:"flex gap-1",children:[(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>k(x),className:"p-1 h-8 w-8",children:(0,Aa.jsx)(Ht.Edit2,{className:"h-3 w-3"})}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>Te(x.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-3 w-3"})})]})]}),(0,Aa.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Aa.jsxs)(le,{className:`text-xs ${X(x.confidence)}`,children:[x.confidence," confidence"]}),(0,Aa.jsxs)(le,{variant:"outline",className:"text-xs",children:["Phase ",x.phase]}),(0,Aa.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[re.length," tasks"]}),(0,Aa.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Oe," pts"]})]}),x.description&&(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:x.description}),(0,Aa.jsxs)(D,{onClick:()=>{I(!0),Q(x)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Aa.jsx)(Ht.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Aa.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Aa.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${g?"border-primary bg-primary/10":"border-border"}`,children:re.length===0?(0,Aa.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,Aa.jsx)(Ht.Move,{className:"h-8 w-8 mb-2"}),(0,Aa.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):re.map(pe=>(0,Aa.jsx)(jt,{task:pe,epic:x,onDragStart:we,onTaskClick:r,isCompact:!0},pe.id))})})]},x.id)})})})})]}),(0,Aa.jsx)(Io,{isOpen:y,onClose:()=>S(!1),onAddEpic:n}),(0,Aa.jsx)(vo,{isOpen:oe,onClose:()=>I(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:ae?.id.toString()||"",sprints:o})]})};0&&(module.exports={DCProjectCard,EpicsView,KanbanBoardView,PlanningView,TasksView});
5
+ "use strict";var si=Object.create;var uo=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var di=Object.getOwnPropertyNames;var ci=Object.getPrototypeOf,mi=Object.prototype.hasOwnProperty;var pi=(e,t)=>{for(var o in t)uo(e,o,{get:t[o],enumerable:!0})},Na=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of di(t))!mi.call(e,r)&&r!==o&&uo(e,r,{get:()=>t[r],enumerable:!(a=li(t,r))||a.enumerable});return e};var ne=(e,t,o)=>(o=e!=null?si(ci(e)):{},Na(t||!e||!e.__esModule?uo(o,"default",{value:e,enumerable:!0}):o,e)),ui=e=>Na(uo({},"__esModule",{value:!0}),e);var Un={};pi(Un,{DCProjectCard:()=>za,EpicsView:()=>zn,KanbanBoardView:()=>En,PlanningView:()=>In,TasksView:()=>Vn});module.exports=ui(Un);var Va=require("motion/react"),Ht=require("lucide-react");var Ia=require("class-variance-authority");var Ea=require("clsx");var zo="-",gi=e=>{let t=vi(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:n=>{let s=n.split(zo);return s[0]===""&&s.length!==1&&s.shift(),Da(s,t)||fi(n)},getConflictingClassGroupIds:(n,s)=>{let m=o[n]||[];return s&&a[n]?[...m,...a[n]]:m}}},Da=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),r=a?Da(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(zo);return t.validators.find(({validator:n})=>n(i))?.classGroupId},Ca=/^\[(.+)\]$/,fi=e=>{if(Ca.test(e)){let t=Ca.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},vi=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return bi(Object.entries(e.classGroups),o).forEach(([i,n])=>{Vo(n,a,i,t)}),a},Vo=(e,t,o,a)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:Sa(t,r);i.classGroupId=o;return}if(typeof r=="function"){if(hi(r)){Vo(r(a),t,o,a);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([i,n])=>{Vo(n,Sa(t,i),o,a)})})},Sa=(e,t)=>{let o=e;return t.split(zo).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},hi=e=>e.isThemeGetter,bi=(e,t)=>t?e.map(([o,a])=>{let r=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([n,s])=>[t+n,s])):i);return[o,r]}):e,xi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,r=(i,n)=>{o.set(i,n),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let n=o.get(i);if(n!==void 0)return n;if((n=a.get(i))!==void 0)return r(i,n),n},set(i,n){o.has(i)?o.set(i,n):r(i,n)}}},Ta="!",yi=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,r=t[0],i=t.length,n=s=>{let m=[],u=0,d=0,g;for(let p=0;p<s.length;p++){let b=s[p];if(u===0){if(b===r&&(a||s.slice(p,p+i)===t)){m.push(s.slice(d,p)),d=p+i;continue}if(b==="/"){g=p;continue}}b==="["?u++:b==="]"&&u--}let v=m.length===0?s:s.substring(d),y=v.startsWith(Ta),x=y?v.substring(1):v,T=g&&g>d?g-d:void 0;return{modifiers:m,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:T}};return o?s=>o({className:s,parseClassName:n}):n},wi=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},Ni=e=>({cache:xi(e.cacheSize),parseClassName:yi(e),...gi(e)}),Ci=/\s+/,Si=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r}=t,i=[],n=e.trim().split(Ci),s="";for(let m=n.length-1;m>=0;m-=1){let u=n[m],{modifiers:d,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:y}=o(u),x=!!y,T=a(x?v.substring(0,y):v);if(!T){if(!x){s=u+(s.length>0?" "+s:s);continue}if(T=a(v),!T){s=u+(s.length>0?" "+s:s);continue}x=!1}let p=wi(d).join(":"),b=g?p+Ta:p,O=b+T;if(i.includes(O))continue;i.push(O);let N=r(T,x);for(let S=0;S<N.length;++S){let oe=N[S];i.push(b+oe)}s=u+(s.length>0?" "+s:s)}return s};function Di(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=ka(t))&&(a&&(a+=" "),a+=o);return a}var ka=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=ka(e[a]))&&(o&&(o+=" "),o+=t);return o};function Ti(e,...t){let o,a,r,i=n;function n(m){let u=t.reduce((d,g)=>g(d),e());return o=Ni(u),a=o.cache.get,r=o.cache.set,i=s,s(m)}function s(m){let u=a(m);if(u)return u;let d=Si(m,o);return r(m,d),d}return function(){return i(Di.apply(null,arguments))}}var ce=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Pa=/^\[(?:([a-z-]+):)?(.+)\]$/i,ki=/^\d+\/\d+$/,Pi=new Set(["px","full","screen"]),Ri=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mi=/\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$/,Ei=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ii=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ai=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ct=e=>At(e)||Pi.has(e)||ki.test(e),ht=e=>Lt(e,"length",Ui),At=e=>!!e&&!Number.isNaN(Number(e)),Oo=e=>Lt(e,"number",At),zt=e=>!!e&&Number.isInteger(Number(e)),Li=e=>e.endsWith("%")&&At(e.slice(0,-1)),z=e=>Pa.test(e),bt=e=>Ri.test(e),Hi=new Set(["length","size","percentage"]),Bi=e=>Lt(e,Hi,Ra),Fi=e=>Lt(e,"position",Ra),Oi=new Set(["image","url"]),Vi=e=>Lt(e,Oi,_i),zi=e=>Lt(e,"",$i),Ut=()=>!0,Lt=(e,t,o)=>{let a=Pa.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Ui=e=>Mi.test(e)&&!Ei.test(e),Ra=()=>!1,$i=e=>Ii.test(e),_i=e=>Ai.test(e);var Gi=()=>{let e=ce("colors"),t=ce("spacing"),o=ce("blur"),a=ce("brightness"),r=ce("borderColor"),i=ce("borderRadius"),n=ce("borderSpacing"),s=ce("borderWidth"),m=ce("contrast"),u=ce("grayscale"),d=ce("hueRotate"),g=ce("invert"),v=ce("gap"),y=ce("gradientColorStops"),x=ce("gradientColorStopPositions"),T=ce("inset"),p=ce("margin"),b=ce("opacity"),O=ce("padding"),N=ce("saturate"),S=ce("scale"),oe=ce("sepia"),I=ce("skew"),ae=ce("space"),Q=ce("translate"),j=()=>["auto","contain","none"],xe=()=>["auto","hidden","clip","visible","scroll"],we=()=>["auto",z,t],$=()=>[z,t],je=()=>["",ct,ht],He=()=>["auto",At,z],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Te=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",z],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>[At,z];return{cacheSize:500,separator:":",theme:{colors:[Ut],spacing:[ct,ht],blur:["none","",bt,z],brightness:w(),borderColor:[e],borderRadius:["none","","full",bt,z],borderSpacing:$(),borderWidth:je(),contrast:w(),grayscale:ie(),hueRotate:w(),invert:ie(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Li,ht],inset:we(),margin:we(),opacity:w(),padding:$(),saturate:w(),scale:w(),sepia:ie(),skew:w(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",z]}],container:["container"],columns:[{columns:[bt]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...P(),z]}],overflow:[{overflow:xe()}],"overflow-x":[{"overflow-x":xe()}],"overflow-y":[{"overflow-y":xe()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[T]}],"inset-x":[{"inset-x":[T]}],"inset-y":[{"inset-y":[T]}],start:[{start:[T]}],end:[{end:[T]}],top:[{top:[T]}],right:[{right:[T]}],bottom:[{bottom:[T]}],left:[{left:[T]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",zt,z]}],basis:[{basis:we()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",zt,z]}],"grid-cols":[{"grid-cols":[Ut]}],"col-start-end":[{col:["auto",{span:["full",zt,z]},z]}],"col-start":[{"col-start":He()}],"col-end":[{"col-end":He()}],"grid-rows":[{"grid-rows":[Ut]}],"row-start-end":[{row:["auto",{span:[zt,z]},z]}],"row-start":[{"row-start":He()}],"row-end":[{"row-end":He()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","Aa",z]}],"auto-rows":[{"auto-rows":["auto","min","max","Aa",z]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...Te()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Te(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Te(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],Ht:[{Ht:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],Aa:[{Aa:[p]}],U:[{U:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[ae]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ae]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z,t]}],"min-w":[{"min-w":[z,t,"min","max","fit"]}],"max-w":[{"max-w":[z,t,"none","full","min","max","fit","prose",{screen:[bt]},bt]}],h:[{h:[z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z,t,"auto","min","max","fit"]}],"font-size":[{text:["base",bt,ht]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oo]}],"font-family":[{font:[Ut]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",z]}],"line-clamp":[{"line-clamp":["none",At,Oo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ct,z]}],"list-image":[{"list-image":["none",z]}],"list-style-type":[{list:["none","disc","decimal",z]}],"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:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ct,ht]}],"underline-offset":[{"underline-offset":["auto",ct,z]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z]}],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",z]}],"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:[...P(),Fi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Bi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","Aa","tl"]},Vi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-Aa":[{"rounded-Aa":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-Aa":[{"border-Aa":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:W()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-Aa":[{"border-Aa":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[ct,z]}],"outline-w":[{outline:[ct,ht]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ct,ht]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bt,zi]}],"shadow-color":[{shadow:[Ut]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",bt,z]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[N]}],sepia:[{sepia:[oe]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z]}],duration:[{duration:w()}],ease:[{ease:["linear","in","out","in-out",z]}],delay:[{delay:w()}],animate:[{animate:["none","spin","ping","pulse","bounce",z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[zt,z]}],"translate-x":[{"translate-x":[Q]}],"translate-y":[{"translate-y":[Q]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",z]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-Aa":[{"scroll-Aa":$()}],"scroll-U":[{"scroll-U":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-Ht":[{"scroll-Ht":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ct,ht,Oo]}],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","Ht","pb","pl"],px:["Ht","pl"],py:["pt","pb"],m:["mx","my","ms","me","Aa","U","mb","ml"],mx:["U","ml"],my:["Aa","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-Aa","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-Aa":["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-Aa"],"border-w-x":["border-w-r","border-w-Aa"],"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-Aa"],"border-color-x":["border-color-r","border-color-Aa"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-Aa","scroll-U","scroll-mb","scroll-ml"],"scroll-mx":["scroll-U","scroll-ml"],"scroll-my":["scroll-Aa","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-Ht","scroll-pb","scroll-pl"],"scroll-px":["scroll-Ht","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 Ma=Ti(Gi);function C(...e){return Ma((0,Ea.clsx)(e))}var Aa=require("react/jsx-runtime"),ji=(0,Ia.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function le({className:e,variant:t,...o}){return(0,Aa.jsx)("div",{className:C(ji({variant:t}),e),...o})}var La=require("@radix-ui/react-slot"),Ba=ne(require("react")),$t=(0,Ia.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"}}}),D=Ba.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...r},i)=>(0,Aa.jsx)(e?La.Slot:"button",{className:C($t({className:t,size:o,variant:a})),ref:i,...r}));D.displayName="Button";var Tt=ne(require("react"));var ue=Tt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ue.displayName="Card";var Uo=Tt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("flex flex-col space-y-1.5 p-6",e),...t}));Uo.displayName="CardHeader";var $o=Tt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("font-semibold leading-none tracking-tight",e),...t}));$o.displayName="CardTitle";var _o=Tt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("text-sm text-muted-foreground",e),...t}));_o.displayName="CardDescription";var _t=Tt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("p-6 pt-0",e),...t}));_t.displayName="CardContent";var Go=Tt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)("div",{ref:o,className:C("flex items-center p-6 pt-0",e),...t}));Go.displayName="CardFooter";var Oa=ne(require("react")),Gt=ne(require("@radix-ui/react-progress"));var Wo=Oa.forwardRef(({className:e,value:t,...o},a)=>(0,Aa.jsx)(Gt.Root,{ref:a,className:C("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...o,children:(0,Aa.jsx)(Gt.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Wo.displayName=Gt.Root.displayName;function za({project:e,onOpen:t,onShare:o,className:a}){return(0,Aa.jsx)(Va.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Aa.jsxs)(ue,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Aa.jsxs)(Uo,{children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)($o,{children:e.name}),(0,Aa.jsxs)(le,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Aa.jsx)(_o,{children:e.description})]}),(0,Aa.jsxs)(_t,{className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Aa.jsx)("span",{children:"Progress"}),(0,Aa.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Aa.jsx)(Wo,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Aa.jsxs)("div",{className:"flex items-center",children:[(0,Aa.jsx)(Ht.Users,{className:"U-1 h-4 w-4"}),e.members," members"]}),(0,Aa.jsxs)("div",{className:"flex items-center",children:[(0,Aa.jsx)(Ht.FileText,{className:"U-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Aa.jsxs)(Go,{className:"flex gap-2",children:[(0,Aa.jsx)(D,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Aa.jsx)(D,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>o?.(e),children:(0,Aa.jsx)(Ht.Share2,{className:"h-4 w-4"})})]})]})})}var se=ne(require("react"));var Ua=({title:e,status:t,taskCount:o,children:a,onDrop:r,isCompact:i=!1,height:n})=>{let s=d=>{d.preventDefault()},m=d=>{d.preventDefault(),r(t)};return(0,Aa.jsxs)(ue,{className:`p-4 bg-card border-Aa-4 ${(()=>{switch(t){case"todo":return"border-Aa-gray-400";case"in-progress":return"border-Aa-blue-500";case"review":return"border-Aa-orange-500";case"done":return"border-Aa-green-500";default:return"border-Aa-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"lg:max-w-xs":""}`,style:{height:n||"calc(100vh - 350px)"},onDragOver:s,onDrop:m,children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Aa.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,Aa.jsx)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,Aa.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:a})]})};var jt=({task:e,epic:t,onDragStart:o,onTaskClick:a,isCompact:r=!1})=>{let i=d=>{o(e)},n=()=>{a(e)},s=()=>{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"}},m=()=>{switch(e.type){case"story":return(0,Aa.jsx)(Ht.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Aa.jsx)(Ht.Bug,{className:"h-3 w-3"});case"spike":return(0,Aa.jsx)(Ht.Zap,{className:"h-3 w-3"});case"task":default:return(0,Aa.jsx)(Ht.AlertCircle,{className:"h-3 w-3"})}},u=()=>{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 r?(0,Aa.jsx)(ue,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:i,onClick:n,children:(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${u()}`,children:m()}),(0,Aa.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Aa.jsxs)(ue,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:i,onClick:n,children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Aa.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${u()}`,children:[m(),(0,Aa.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Aa.jsxs)("div",{className:"flex gap-1",children:[(0,Aa.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,Aa.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,Aa.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Aa.jsx)(Ht.User,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Zt=require("react");var Wt=ne(require("react")),ke=ne(require("@radix-ui/react-dialog"));var Fe=ke.Root;var Ko=ke.Portal;var go=Wt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(ke.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}));go.displayName=ke.Overlay.displayName;var Ve=Wt.forwardRef(({className:e,children:t,...o},a)=>(0,Aa.jsxs)(Ko,{children:[(0,Aa.jsx)(go,{}),(0,Aa.jsxs)(ke.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,Aa.jsxs)(ke.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,Aa.jsx)($a.X,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ve.displayName=ke.Content.displayName;var ze=({className:e,...t})=>(0,Aa.jsx)("div",{className:C("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ze.displayName="DialogHeader";var Kt=({className:e,...t})=>(0,Aa.jsx)("div",{className:C("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kt.displayName="DialogFooter";var Ee=Wt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(ke.Title,{ref:o,className:C("text-lg font-semibold leading-none tracking-tight",e),...t}));Ee.displayName=ke.Title.displayName;var Wi=Wt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(ke.Description,{ref:o,className:C("text-sm text-muted-foreground",e),...t}));Wi.displayName=ke.Description.displayName;var _a=ne(require("react"));var te=_a.forwardRef(({className:e,type:t,...o},a)=>(0,Aa.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}));te.displayName="Input";var ja=ne(require("react")),Ne=ja.forwardRef(({className:e,...t},o)=>(0,Aa.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}));Ne.displayName="Textarea";var _=ne(require("@radix-ui/react-select")),xt=ne(require("react")),Ge=_.Root;var at=_.Value,Ue=xt.forwardRef(({children:e,className:t,...o},a)=>(0,Aa.jsxs)(_.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,Aa.jsx)(_.Icon,{asChild:!0,children:(0,Aa.jsx)(Ht.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ue.displayName=_.Trigger.displayName;var Ka=xt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(_.ScrollUpButton,{className:C("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Aa.jsx)(Ht.ChevronUp,{className:"h-4 w-4"})}));Ka.displayName=_.ScrollUpButton.displayName;var Za=xt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(_.ScrollDownButton,{className:C("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Aa.jsx)(Ht.ChevronDown,{className:"h-4 w-4"})}));Za.displayName=_.ScrollDownButton.displayName;var $e=xt.forwardRef(({children:e,className:t,position:o="popper",...a},r)=>(0,Aa.jsx)(_.Portal,{children:(0,Aa.jsxs)(_.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:r,...a,children:[(0,Aa.jsx)(Ka,{}),(0,Aa.jsx)(_.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,Aa.jsx)(Za,{})]})}));$e.displayName=_.Content.displayName;var Ki=xt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(_.Label,{className:C("py-1.5 pl-8 Ht-2 text-sm font-semibold",e),ref:o,...t}));Ki.displayName=_.Label.displayName;var me=xt.forwardRef(({children:e,className:t,...o},a)=>(0,Aa.jsxs)(_.Item,{className:C("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Ht-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,Aa.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Aa.jsx)(_.ItemIndicator,{children:(0,Aa.jsx)(Ht.Check,{className:"h-4 w-4"})})}),(0,Aa.jsx)(_.ItemText,{children:e})]}));me.displayName=_.Item.displayName;var Zi=xt.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(_.Separator,{className:C("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Zi.displayName=_.Separator.displayName;var Ja=ne(require("react")),Zo=ne(require("@radix-ui/react-label"));var Ji=(0,Ia.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),H=Ja.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(Zo.Root,{ref:o,className:C(Ji(),e),...t}));H.displayName=Zo.Root.displayName;var Mt=ne(require("react")),Bt=ne(require("@radix-ui/react-toggle-group"));var Ya=ne(require("react")),Jo=ne(require("@radix-ui/react-toggle"));var qo=(0,Ia.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"}}),qi=Ya.forwardRef(({className:e,variant:t,size:o,...a},r)=>(0,Aa.jsx)(Jo.Root,{ref:r,className:C(qo({variant:t,size:o,className:e})),...a}));qi.displayName=Jo.Root.displayName;var tr=Mt.createContext({size:"default",variant:"default"}),Et=Mt.forwardRef(({className:e,variant:t,size:o,children:a,...r},i)=>(0,Aa.jsx)(Bt.Root,{ref:i,className:C("flex items-center justify-center gap-1",e),...r,children:(0,Aa.jsx)(tr.Provider,{value:{variant:t,size:o},children:a})}));Et.displayName=Bt.Root.displayName;var It=Mt.forwardRef(({className:e,children:t,variant:o,size:a,...r},i)=>{let n=Mt.useContext(tr);return(0,Aa.jsx)(Bt.Item,{ref:i,className:C(qo({variant:n.variant||o,size:n.size||a}),e),...r,children:t})});It.displayName=Bt.Item.displayName;var Xi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Ht.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Ht.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Ht.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Ht.Zap}],Yi=[{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"}],vo=({isOpen:e,onClose:t,onAddTask:o,epics:a,sprints:r,assignees:i,defaultEpicId:n})=>{let[s,m]=(0,Zt.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,Zt.useEffect)(()=>{e&&n&&m(g=>({...g,epic:n}))},[e,n]),(0,Zt.useEffect)(()=>{e&&m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"none",assignee:""})},[e]);let u=g=>{g.preventDefault(),s.name.trim()&&(o({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,storyPoints:s.storyPoints,epic:Number(s.epic),sprint:Number(s.sprint),assignee:s.assignee.trim()?{relationTo:"digital-colleagues",value:Number(s.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"",assignee:""}),t())},d=(g,v)=>{m(y=>({...y,[g]:v}))};return(0,Aa.jsx)(Fe,{open:e,onOpenChange:t,children:(0,Aa.jsxs)(Ve,{className:"sm:max-w-md",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Ee,{children:"Add New Task"})}),(0,Aa.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"name",children:"Task Title"}),(0,Aa.jsx)(te,{id:"name",value:s.name,onChange:g=>d("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"description",value:s.description,onChange:g=>d("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Type"}),(0,Aa.jsx)(Et,{type:"single",value:s.type||"",onValueChange:g=>g&&d("type",g),children:Xi.map(g=>{let v=g.icon;return(0,Aa.jsxs)(It,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Aa.jsx)(v,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Priority"}),(0,Aa.jsx)(Et,{type:"single",value:s.priority||"",onValueChange:g=>g&&d("priority",g),children:Yi.map(g=>(0,Aa.jsx)(It,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"points",children:"Story Points"}),(0,Aa.jsx)(te,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:g=>d("storyPoints",parseInt(g.target.value)||1),placeholder:"Enter story points",required:!0})]}),!n&&(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"epic",children:"Epic"}),(0,Aa.jsxs)(Ge,{value:s.epic,onValueChange:g=>d("epic",g),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{placeholder:"Select an epic"})}),(0,Aa.jsx)($e,{children:a.map(g=>(0,Aa.jsx)(me,{value:g.id.toString(),children:(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Aa.jsxs)(Ge,{value:s.sprint,onValueChange:g=>d("sprint",g),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{placeholder:"Select a sprint"})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsx)(me,{value:"none",children:"No Sprint"}),r.map(g=>(0,Aa.jsx)(me,{value:g.id.toString(),children:(0,Aa.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"sprint",children:"Assignee"}),(0,Aa.jsxs)(Ge,{value:s.assignee,onValueChange:g=>d("assignee",g),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{placeholder:"Select an Assignee"})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsx)(me,{value:"none",children:"No Assignee"}),i.map(g=>(0,Aa.jsx)(me,{value:g.id.toString(),children:(0,Aa.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,Aa.jsxs)(Kt,{children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Jt=({fieldName:e,value:t,label:o,multiline:a=!1,onSave:r,className:i="",disabled:n=!1})=>{let[s,m]=(0,Zt.useState)(!1),[u,d]=(0,Zt.useState)(""),g=()=>{n||(m(!0),d(t))},v=async()=>{u!==t&&await r(e,u),m(!1)},y=x=>{x.key==="Enter"&&!a||x.key==="Enter"&&x.ctrlKey&&a?v():x.key==="Escape"&&(m(!1),d(""))};return(0,Aa.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Aa.jsx)(H,{children:o}),s?a?(0,Aa.jsx)(Ne,{value:u,onChange:x=>d(x.target.value),onBlur:v,onKeyDown:y,autoFocus:!0,rows:4,className:"resize-none"}):(0,Aa.jsx)(te,{value:u,onChange:x=>d(x.target.value),onBlur:v,onKeyPress:y,autoFocus:!0,className:"text-lg font-medium"}):(0,Aa.jsxs)("div",{onClick:g,className:`${n?"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,Aa.jsx)("span",{className:a?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,Aa.jsx)(Ht.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var ho=ne(require("react")),pt=ne(require("@radix-ui/react-avatar"));var Yo=ho.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(pt.Root,{ref:o,className:C("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Yo.displayName=pt.Root.displayName;var Qi=ho.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(pt.Image,{ref:o,className:C("aspect-square h-full w-full",e),...t}));Qi.displayName=pt.Image.displayName;var Qo=ho.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(pt.Fallback,{ref:o,className:C("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Qo.displayName=pt.Fallback.displayName;var rr=({comments:e,onAddComment:t})=>{let[o,a]=(0,Zt.useState)(""),r=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{o.trim()&&(t(o),a(""))};return(0,Aa.jsxs)("div",{className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)(Ht.MessageSquare,{className:"h-5 w-5"}),(0,Aa.jsx)(H,{className:"text-lg font-medium",children:"Comments"}),(0,Aa.jsx)(le,{variant:"secondary",children:e.length})]}),(0,Aa.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,Aa.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Aa.jsx)(Yo,{className:"h-8 w-8 Aa-1",children:(0,Aa.jsx)(Qo,{className:"text-xs bg-muted text-muted-foreground",children:r(n.author)})}),(0,Aa.jsxs)("div",{className:"flex-1",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Aa.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,Aa.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,Aa.jsxs)("div",{className:"flex gap-2",children:[(0,Aa.jsx)(Ne,{value:o,onChange:n=>a(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Aa.jsx)(D,{onClick:i,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,Aa.jsx)(Ht.Send,{className:"h-4 w-4"})})]})]})};var yo=({label:e,value:t,onValueChange:o,options:a,showColor:r=!1,disabled:i=!1})=>{let[n,s]=(0,Zt.useState)(!1),m=a.find(d=>d.value===t);return(0,Aa.jsxs)("div",{className:"space-y-1",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:e}),(0,Aa.jsxs)(Ge,{value:t,onValueChange:o,open:n,onOpenChange:d=>{i||s(d)},disabled:i,children:[(0,Aa.jsx)(Ue,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Aa.jsxs)(le,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!n),children:[r&&m?.color&&(0,Aa.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} U-1`}),m?.label||"Select..."]})}),(0,Aa.jsx)($e,{children:a.map(d=>(0,Aa.jsx)(me,{value:d.value,children:r&&d.color?(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var nr=({label:e,value:t,onValueChange:o,options:a,placeholder:r="Search...",allowCustomValue:i=!1,disabled:n=!1})=>{let[s,m]=(0,Zt.useState)(!1),[u,d]=(0,Zt.useState)(""),g=a.find(p=>p.value===t),v=a.filter(p=>p.label.toLowerCase().includes(u.toLowerCase())),y=p=>{o(p),m(!1),d("")},x=()=>{i&&u.trim()&&!a.find(p=>p.value===u.trim())&&(o(u.trim()),m(!1),d(""))};return(0,Aa.jsxs)("div",{className:"space-y-1",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:e}),(0,Aa.jsxs)(Ge,{value:t,onValueChange:y,open:s,onOpenChange:p=>{n||m(p)},disabled:n,children:[(0,Aa.jsx)(Ue,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Aa.jsx)(le,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&m(!s),children:g?.label||t||"Select..."})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsx)("div",{className:"p-2",children:(0,Aa.jsx)(te,{placeholder:r,value:u,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&i&&x()},className:"mb-2"})}),v.map(p=>(0,Aa.jsx)(me,{value:p.value,children:p.label},p.value)),i&&u.trim()&&!v.find(p=>p.value===u.trim())&&(0,Aa.jsxs)(me,{value:u.trim(),children:['Add "',u.trim(),'"']})]})]})]})};var Ie=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var en=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Ht.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Ht.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Ht.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Ht.Zap}],tn=[{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 sr=({task:e,epics:t,sprints:o,lastUpdated:a,onUpdateTask:r,onClose:i,onDelete:n,isUpdating:s=!1,isDeleting:m=!1,deleteState:u="idle",teamMembers:d})=>{let[g,v]=(0,Zt.useState)(e.storyPoints),y=(0,Zt.useRef)(null),[x,T]=(0,Zt.useState)(d);(0,Zt.useEffect)(()=>{T(d)},[d]);let p=(0,Zt.useCallback)((N,S)=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{r(N,S)},500)},[r]);(0,Zt.useEffect)(()=>{p("storyPoints",g?.toString()||"1")},[g]);let b=N=>N.split(" ").map(S=>S[0]).join("").toUpperCase(),O=()=>u==="loading"?(0,Aa.jsxs)(D,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Aa.jsx)(Ht.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):u==="success"?(0,Aa.jsxs)(D,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Aa.jsx)(Ht.Check,{className:"h-3 w-3"}),"Deleted"]}):u==="error"?(0,Aa.jsxs)(D,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Aa.jsx)(Ht.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Aa.jsxs)(D,{onClick:n,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||m,children:[(0,Aa.jsx)(Ht.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Aa.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Aa.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Aa.jsx)(yo,{label:"",value:e.status,onValueChange:N=>r("status",N),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Aa.jsx)(Et,{type:"single",value:e.type||"",onValueChange:N=>N&&r("type",N),className:"grid grid-cols-2 gap-1",disabled:s,children:en.map(N=>{let S=N.icon;return(0,Aa.jsxs)(It,{value:N.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:s,children:[(0,Aa.jsx)(S,{className:"h-3 w-3"}),N.label]},N.value)})})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Aa.jsx)(Et,{type:"single",value:e.priority||"",onValueChange:N=>N&&r("priority",N),className:"grid grid-cols-3 gap-1",disabled:s,children:tn.map(N=>(0,Aa.jsx)(It,{value:N.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:N.label},N.value))})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Aa.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:N=>{let S=Number(N.target.value);S<1?v(1):S>100?v(100):v(S)},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:s})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Aa.jsx)(yo,{label:"",value:Ie(e.epic).toString(),onValueChange:N=>r("epic",N),options:(t||[]).map(N=>({value:N.id.toString(),label:N?.name,color:N.color})),showColor:!0,disabled:s})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Aa.jsx)(yo,{label:"",value:Ie(e.sprint).toString()||"none",onValueChange:N=>r("sprint",N==="none"?"":N),options:[{value:"none",label:"No Sprint"},...(o||[]).map(N=>({value:N.id.toString(),label:`${N?.name}`}))],disabled:s})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Aa.jsx)(nr,{label:"",value:e.assignee?.value?.name,onValueChange:N=>r("assignee",N),options:x.map(N=>({value:`${typeof N.email=="string"?"users":"digital-colleagues"}:${N.id}`,label:N?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Aa.jsxs)("div",{className:"Aa-auto pt-4 space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(D,{onClick:i,variant:"outline",className:"w-full h-8 text-xs",disabled:s||m,children:"Close"}),O()]}),(0,Aa.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Aa.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Aa.jsx)(Ht.User,{className:"h-3 w-3"}),(0,Aa.jsx)("span",{children:"System"})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-3 w-3"}),(0,Aa.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Aa.jsx)(Ht.Clock,{className:"h-3 w-3"}),(0,Aa.jsxs)("span",{children:[new Date(a).toLocaleDateString()," at"," ",new Date(a).toLocaleTimeString()]})]})]})]})]})]})};var Xr=ne(require("@radix-ui/react-dialog"));var Lr=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Hr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Br=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Fr=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Or=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),Vr=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),zr=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Po=require("@payloadcms/richtext-lexical/lexical/list"),Ur=require("@payloadcms/richtext-lexical/lexical/rich-text"),$r=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Ir=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),oo=require("@payloadcms/richtext-lexical/lexical/utils"),U=require("@payloadcms/richtext-lexical/lexical"),ma=require("@payloadcms/richtext-lexical/lexical/selection");var br=require("@radix-ui/react-dialog"),So=require("@payloadcms/richtext-lexical/client");var oa=ne(require("bson-objectid"));var dr=require("@payloadcms/ui");var lr=ne(require("react")),rt=ne(require("@radix-ui/react-tooltip"));var wo=rt.Provider,No=rt.Root,Co=rt.Trigger,qt=lr.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Aa.jsx)(rt.Portal,{children:(0,Aa.jsx)(rt.Content,{ref:a,sideOffset:t,className:C("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));qt.displayName=rt.Content.displayName;var on=e=>{let{data:{relationTo:t,value:o},nodeKey:a}=e,[r]=(0,Ir.useLexicalComposerContext)(),[i,n]=(0,Zt.useState)(""),[s,m]=(0,Zt.useState)(""),[u,d]=(0,Zt.useState)(""),g=async p=>{console.log("fetchMedia",p)};(0,Zt.useEffect)(()=>{typeof o=="string"?o.length===24?g(o):(n(o||""),d(T(x())),m(y()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),d(T(o.filesize)),m(o.mimeType?.split("/")[1]||""))},[]);let v=(0,Zt.useCallback)(()=>{r.update(()=>{(0,U.$getNodeByKey)(a)?.remove()})},[r,a]),y=()=>{let p=e.data.value;return typeof p=="string"?p.split(";base64")[0]?.split("image/")[1]:""},x=()=>{let p=e.data.value;if(typeof p=="string"){let b=p.split(",")[1]?.length||0;return 4*Math.ceil(b/3)*.5624896334383812/1e3}return 0};function T(p){if(p>=1e6){let O=p/1e6;return`${O>=10?Math.round(O).toString():O.toFixed(1)} MB`}return`${Math.floor(p/1e3)} KB`}return(0,Aa.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Aa.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Aa.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Aa.jsx)("div",{className:"flex-1",children:e.data.value?(0,Aa.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:i}):(0,Aa.jsx)(dr.File,{})}),(0,Aa.jsx)(wo,{children:(0,Aa.jsxs)(No,{children:[(0,Aa.jsxs)(Co,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Aa.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Aa.jsx)("button",{onClick:p=>{p.preventDefault(),v()},className:"flex-1 flex justify-center items-center",children:(0,Aa.jsx)(Ht.X,{width:24,height:24,strokeWidth:1})})]}),(0,Aa.jsx)(qt,{children:(0,Aa.jsx)("span",{children:"Remove image"})})]})})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,Aa.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,Aa.jsx)("span",{children:u})]})]})})},ur=on;function an(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id");if(o)return{node:Ft({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Xt=class extends So.UploadNode{static importDOM(){return{img:()=>({conversion:an,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new oa.default().toHexString(),t.version=3);let o={id:t.id??new oa.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},a=Ft(o);return a.setFormat?.(t.format),a}decorate(){return(0,Aa.jsx)(ur,{data:this.__data,nodeKey:this.getKey()})}};function Ft(e){return new Xt({data:e})}var rn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nn=e=>rn?(e||window).getSelection():null,Bl=(0,U.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),aa=(0,U.createCommand)("INSERT_UPLOAD_COMMAND");function xr({activeEditor:e,onClose:t,isOpen:o=!1}){let a=(0,Zt.useRef)(!1),[r,i]=(0,Zt.useState)(!0),[n,s]=(0,Zt.useState)(""),[m,u]=(0,Zt.useState)(""),[d,g]=(0,Zt.useState)(!1),[v,y]=(0,Zt.useState)("left"),x=n==="",T=S=>{g(S.target.checked)},p=S=>{y(S.target.value)},b=S=>{let oe=new FileReader;oe.onload=function(){return typeof oe.result=="string"&&s(oe.result),""},S!==null&&S[0]&&oe.readAsDataURL(S[0])};(0,Zt.useEffect)(()=>{a.current=!1;let S=oe=>{a.current=oe.altKey};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[e]),(0,Zt.useEffect)(()=>{r||t()},[r]),(0,Zt.useEffect)(()=>{i(o)},[o]);let O=({editor:S,relationTo:oe,replaceNodeKey:I,value:ae})=>{if(I)S.update(()=>{let Q=(0,U.$getNodeByKey)(I);Q&&Q.replace(Ft({id:"",fields:{},relationTo:"media",value:ae}))});else{let Q=S.dispatchCommand(aa,{fields:null,relationTo:"media",value:ae})}},N=()=>{O({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:m,src:n,showCaption:d,position:v}.src}),i(!1),t()};return(0,Aa.jsx)(Fe,{open:r,onOpenChange:S=>i(S),children:(0,Aa.jsxs)(Ve,{children:[(0,Aa.jsxs)(ze,{children:[(0,Aa.jsx)(Ee,{children:"Upload Image"}),(0,Aa.jsx)(br.DialogDescription,{children:"Description"})]}),(0,Aa.jsxs)("div",{className:"",children:[(0,Aa.jsx)("div",{style:{marginBottom:"1em"},children:(0,Aa.jsx)(te,{type:"file",onChange:S=>b(S.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Aa.jsx)("div",{style:{marginBottom:"1em"},children:(0,Aa.jsx)(te,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:S=>u(S.currentTarget.value),value:m,"data-test-id":"image-modal-alt-text-input"})}),(0,Aa.jsx)(D,{"data-test-id":"image-modal-file-upload-btn",disabled:x,onClick:()=>N(),children:"Confirm"})]})]})})}function ra({captionsEnabled:e}){let[t]=(0,Ir.useLexicalComposerContext)();return(0,Zt.useEffect)(()=>{if(!t.hasNodes([So.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,oo.mergeRegister)(t.registerCommand(U.DRAGSTART_COMMAND,o=>sn(o),U.COMMAND_PRIORITY_HIGH),t.registerCommand(U.DRAGOVER_COMMAND,o=>ln(o),U.COMMAND_PRIORITY_LOW),t.registerCommand(U.DROP_COMMAND,o=>dn(o,t),U.COMMAND_PRIORITY_HIGH))},[e,t]),null}function sn(e){if(!ia())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function ln(e){return ia()?(yr(e)||e.preventDefault(),!0):!1}function dn(e,t){let o=ia();if(!o)return!1;if(e.preventDefault(),yr(e)){let a=cn(e);o.remove();let r=(0,U.$createRangeSelection)();a!=null&&r.applyDOMRange(a),(0,U.$setSelection)(r)}return!0}function ia(){let e=(0,U.$getSelection)();if(!(0,U.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,So.$isUploadNode)(o)?o:null}function yr(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function cn(e){let t,o=e.target,a=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,r=nn(a);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&r!==null)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var mn=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),wr=mn;var pn=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),Nr=pn;var un=()=>(0,Aa.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Aa.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Aa.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Cr=un;var gn=()=>(0,Aa.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Aa.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Aa.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Sr=gn;var fn=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),Dr=fn;var vn=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),Tr=vn;var kr=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Pr=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),Rr=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),Mr=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),Er=()=>(0,Aa.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Aa.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var ut=ne(require("react")),G=ne(require("@radix-ui/react-dropdown-menu")),Ot=require("@radix-ui/react-icons");var Do=G.Root,To=G.Trigger;var hn=ut.forwardRef(({className:e,inset:t,children:o,...a},r)=>(0,Aa.jsxs)(G.SubTrigger,{ref:r,className:C("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[o,(0,Aa.jsx)(Ot.ChevronRightIcon,{className:"ml-auto"})]}));hn.displayName=G.SubTrigger.displayName;var bn=ut.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(G.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}));bn.displayName=G.SubContent.displayName;var eo=ut.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Aa.jsx)(G.Portal,{children:(0,Aa.jsx)(G.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})}));eo.displayName=G.Content.displayName;var to=ut.forwardRef(({className:e,inset:t,...o},a)=>(0,Aa.jsx)(G.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}));to.displayName=G.Item.displayName;var xn=ut.forwardRef(({className:e,children:t,checked:o,...a},r)=>(0,Aa.jsxs)(G.CheckboxItem,{ref:r,className:C("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Ht-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,Aa.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Aa.jsx)(G.ItemIndicator,{children:(0,Aa.jsx)(Ot.CheckIcon,{className:"h-4 w-4"})})}),t]}));xn.displayName=G.CheckboxItem.displayName;var yn=ut.forwardRef(({className:e,children:t,...o},a)=>(0,Aa.jsxs)(G.RadioItem,{ref:a,className:C("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Ht-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,Aa.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Aa.jsx)(G.ItemIndicator,{children:(0,Aa.jsx)(Ot.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));yn.displayName=G.RadioItem.displayName;var wn=ut.forwardRef(({className:e,inset:t,...o},a)=>(0,Aa.jsx)(G.Label,{ref:a,className:C("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));wn.displayName=G.Label.displayName;var Nn=ut.forwardRef(({className:e,...t},o)=>(0,Aa.jsx)(G.Separator,{ref:o,className:C("-mx-1 my-1 h-px bg-muted",e),...t}));Nn.displayName=G.Separator.displayName;var Cn=({className:e,...t})=>(0,Aa.jsx)("span",{className:C("ml-auto text-xs tracking-widest opacity-60",e),...t});Cn.displayName="DropdownMenuShortcut";var ca=1;function Sn(){return(0,Aa.jsx)("span",{className:"border border-[#222222]"})}function pa(){let[e]=(0,Ir.useLexicalComposerContext)(),t=(0,Zt.useRef)(null),[o,a]=(0,Zt.useState)(!1),[r,i]=(0,Zt.useState)(!1),[n,s]=(0,Zt.useState)(!1),[m,u]=(0,Zt.useState)(!1),[d,g]=(0,Zt.useState)(!1),[v,y]=(0,Zt.useState)(!1),[x,T]=(0,Zt.useState)(!1),[p,b]=(0,Zt.useState)(!1),[O,N]=(0,Zt.useState)(!1),[S,oe]=(0,Zt.useState)("left"),[I,ae]=(0,Zt.useState)("p"),Q=P=>{e.update(()=>{let W=(0,U.$getSelection)();(0,U.$isRangeSelection)(W)&&(P==="p"?(0,ma.$setBlocksType)(W,()=>(0,U.$createParagraphNode)()):(0,ma.$setBlocksType)(W,()=>(0,Ur.$createHeadingNode)(P)))})},j=(0,Zt.useCallback)(()=>{let P=(0,U.$getSelection)();if((0,U.$isRangeSelection)(P)){s(P.hasFormat("bold")),u(P.hasFormat("italic")),g(P.hasFormat("underline")),y(P.hasFormat("strikethrough")),T(P.hasFormat("subscript")),b(P.hasFormat("superscript"));let W=P.anchor.getNode(),ee=W;for(;ee&&!(0,U.$isParagraphNode)(ee)&&ee!==(0,U.$getRoot)();){let ie=ee.getParent();ie&&(ee=ie)}if(ee){let ie=ee.getFormatType();oe(ie||"left")}let Te=W.getTopLevelElement()?.__tag;ae(Te||"p")}},[]);(0,Zt.useEffect)(()=>(0,oo.mergeRegister)(e.registerUpdateListener(({editorState:P})=>{P.read(()=>{j()})}),e.registerCommand(U.SELECTION_CHANGE_COMMAND,(P,W)=>(j(),!1),ca),e.registerCommand(U.CAN_UNDO_COMMAND,P=>(a(P),!1),ca),e.registerCommand(U.CAN_REDO_COMMAND,P=>(i(P),!1),ca),(0,oo.mergeRegister)(e.registerCommand(aa,P=>(e.update(()=>{let W=(0,U.$getSelection)()||(0,U.$getPreviousSelection)();if((0,U.$isRangeSelection)(W)){let ee=Ft({id:P.id,fields:P.fields,relationTo:P.relationTo,value:P.value}),{focus:Te}=W,ie=Te.getNode();(0,oo.$insertNodeToNearestRoot)(ee),(0,U.$isParagraphNode)(ie)&&!ie.__first&&ie.remove()}}),!0),U.COMMAND_PRIORITY_EDITOR))),[e,j]);let xe=[[{label:"Undo",icon:(0,Aa.jsx)(Ht.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,Aa.jsx)(Ht.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,Aa.jsx)(wr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,Aa.jsx)(Nr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:m},{label:"Underline",icon:(0,Aa.jsx)(Cr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,Aa.jsx)(Sr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:v},{label:"Subscript",icon:(0,Aa.jsx)(Dr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:x},{label:"Superscript",icon:(0,Aa.jsx)(Tr,{}),onClick:()=>{e.dispatchCommand(U.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:p}]],we=[{label:"Left Align",direction:"left",icon:(0,Aa.jsx)(Ht.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Aa.jsx)(Ht.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Aa.jsx)(Ht.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Aa.jsx)(Ht.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(U.FORMAT_ELEMENT_COMMAND,"justify")}}],je=[{label:"Normal Text",value:"p",icon:(0,Aa.jsx)(kr,{}),onClick:()=>Q("p")},{label:"Heading 1",value:"h1",icon:(0,Aa.jsx)(Pr,{}),onClick:()=>Q("h1")},{label:"Heading 2",value:"h2",icon:(0,Aa.jsx)(Rr,{}),onClick:()=>Q("h2")},{label:"Heading 3",value:"h3",icon:(0,Aa.jsx)(Mr,{}),onClick:()=>Q("h3")},{label:"Heading 4",value:"h4",icon:(0,Aa.jsx)(Er,{}),onClick:()=>Q("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Aa.jsx)(Ht.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Po.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Aa.jsx)(Ht.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Po.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],He=[{label:"Insert Image",icon:(0,Aa.jsx)(Ht.ImageUp,{width:15,height:15}),onClick:()=>{N(!0)},disabled:!1}];return(0,Aa.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,Aa.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[xe.map((P,W)=>(0,Aa.jsxs)(Zt.Fragment,{children:[(0,Aa.jsx)("div",{className:"flex items-center gap-2",children:P.map((ee,Te)=>(0,Aa.jsx)("div",{role:"button","aria-disabled":ee.disabled||!1,onClick:ee.onClick,className:C("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",ee.active&&"bg-[#3c3c3c]"),"aria-label":ee.label,children:(0,Aa.jsx)(wo,{children:(0,Aa.jsxs)(No,{children:[(0,Aa.jsx)(Co,{className:"text-[#b5b5b5]",children:ee.icon}),(0,Aa.jsx)(qt,{children:(0,Aa.jsx)("p",{children:ee.label})})]})})},Te))}),(0,Aa.jsx)(Sn,{})]},`toolbar-option-${P.length}-${W}`)),(0,Aa.jsxs)(Do,{children:[(0,Aa.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[we.find(P=>P.direction===S)?.icon,we.find(P=>P.direction===S)?.label,(0,Aa.jsx)(Ht.ChevronDown,{width:15,height:15})]}),(0,Aa.jsx)(eo,{className:"bg-black hover:bg-black",children:we.map((P,W)=>(0,Aa.jsxs)(to,{onClick:P.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Aa.jsx)("span",{children:P.icon}),(0,Aa.jsx)("span",{children:P.label})]},`${P.label}-${W}`))})]}),(0,Aa.jsxs)(Do,{children:[(0,Aa.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[je.find(P=>P.value===I)?.icon,je.find(P=>P.value===I)?.label,(0,Aa.jsx)(Ht.ChevronDown,{width:15,height:15})]}),(0,Aa.jsx)(eo,{className:"bg-black hover:bg-black",children:je.map((P,W)=>(0,Aa.jsxs)(to,{onClick:P.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Aa.jsx)("span",{children:P.icon}),(0,Aa.jsx)("span",{children:P.label})]},`heading-option-${P.label}-${W}`))})]}),(0,Aa.jsxs)(Do,{children:[(0,Aa.jsxs)(To,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Aa.jsx)(Ht.Plus,{width:15,height:15}),(0,Aa.jsx)(Ht.ChevronDown,{width:15,height:15})]}),(0,Aa.jsx)(eo,{className:"bg-black hover:bg-black",children:He.map((P,W)=>(0,Aa.jsxs)(to,{onClick:P.onClick,disabled:P.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Aa.jsx)("span",{children:P.icon}),(0,Aa.jsx)("span",{children:P.label})]},W))})]}),O&&(0,Aa.jsx)(xr,{activeEditor:e,onClose:()=>{N(!1)},isOpen:O})]})})}var Dn=({setValue:e,value:t,name:o,editable:a=!0})=>{let[r]=(0,Ir.useLexicalComposerContext)(),i=(0,Zt.useRef)(null),n=s=>{s.read(()=>{let m=s.toJSON();JSON.stringify(m)!==JSON.stringify(i.current)&&(i.current=m,e?.(()=>m))})};return(0,Zt.useEffect)(()=>{r.setEditable(a)},[a,r]),(0,Zt.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(i.current)&&r.update(()=>{try{let s=r.parseEditorState(t);r.setEditorState(s),i.current=t}catch(s){console.error("Error parsing editor state:",s)}},{discrete:!0})},[t,r]),(0,Aa.jsx)("div",{className:"w-full",children:(0,Aa.jsxs)("div",{className:" ",children:[a&&(0,Aa.jsx)(pa,{}),(0,Aa.jsxs)("div",{className:"px-4 my-4 border-Aa border-[#222222]",children:[(0,Aa.jsx)(Vr.RichTextPlugin,{contentEditable:(0,Aa.jsx)(Br.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Fr.LexicalErrorBoundary}),a&&(0,Aa.jsxs)(Aa.Fragment,{children:[(0,Aa.jsx)(Or.HistoryPlugin,{}),(0,Aa.jsx)(Lr.AutoFocusPlugin,{}),(0,Aa.jsx)(zr.ListPlugin,{}),(0,Aa.jsx)($r.OnChangePlugin,{onChange:n}),(0,Aa.jsx)(ra,{})]})]})]})})},Tn=({setValue:e,value:t,name:o,editable:a=!0})=>(0,Aa.jsx)(Hr.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Po.ListNode,Po.ListItemNode,Ur.HeadingNode,Xt],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Aa.jsx)(Dn,{value:t,setValue:e,name:o,editable:a})}),Gr=Tn;var jr=ne(require("react")),st=ne(require("@radix-ui/react-popover"));var ga=st.Root,fa=st.Trigger;var Ro=jr.forwardRef(({className:e,align:t="center",sideOffset:o=4,...a},r)=>(0,Aa.jsx)(st.Portal,{children:(0,Aa.jsx)(st.Content,{ref:r,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})}));Ro.displayName=st.Content.displayName;var Wr=require("react-day-picker");function Mo({className:e,classNames:t,showOutsideDays:o=!0,...a}){return(0,Aa.jsx)(Wr.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($t({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 Aa-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-Aa-md first:[&:has([aria-selected])]:rounded-Aa-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:C($t({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})}Mo.displayName="Calendar";var ro=e=>"mimeType"in e&&"url"in e&&!("format"in e),kn=e=>{if(!e?.root?.children)return"";let t=[],o=i=>{if(!i)return"";switch(i.type){case"heading":{let n=i.tag?parseInt(i.tag.replace("h","")):1,s=a(i.children||[]);return"#".repeat(n)+" "+s}case"paragraph":return i.children&&i.children.some(m=>m.type==="text"?m.text&&m.text.trim().length>0:(m.type==="linebreak",!0))?a(i.children||[]):"";case"list":{let n=[],s=i.listType==="number"?"1.":"-";return i.children?.forEach((m,u)=>{if(m.type==="listitem"){let d=a(m.children||[]),g=i.listType==="number"?`${u+1}.`:s;n.push(`${g} ${d}`)}}),n.join(`
6
+ `)}case"listitem":return a(i.children||[]);case"text":{let n=i.text||"";if(i.format){let s=(i.format&1)!==0,m=(i.format&2)!==0,u=(i.format&4)!==0,d=(i.format&8)!==0;(i.format&16)!==0?n=`\`${n}\``:(s&&(n=`**${n}**`),m&&(n=`*${n}*`),u&&(n=`~~${n}~~`),d&&(n=`<u>${n}</u>`))}return n}default:return i.children?a(i.children):""}},a=i=>i.map(n=>{if(n.type==="text"){let s=n.text||"";if(n.format){let m=(n.format&1)!==0,u=(n.format&2)!==0,d=(n.format&4)!==0,g=(n.format&8)!==0;(n.format&16)!==0?s=`\`${s}\``:(m&&(s=`**${s}**`),u&&(s=`*${s}*`),d&&(s=`~~${s}~~`),g&&(s=`<u>${s}</u>`))}return s}else{if(n.type==="paragraph")return a(n.children||[]);if(n.type==="listitem")return a(n.children||[]);if(n.type==="linebreak")return`
7
+ `}return o(n)}).filter(Boolean).join("");e.root.children.forEach(i=>{let n=o(i);i.type==="paragraph"?t.push(n||""):n&&t.push(n)});let r=[];for(let i=0;i<t.length;i++)r.push(t[i]),i<t.length-1&&(t[i]===""||t[i+1]===""||r.push(""));return r.join(`
8
+ `)},Nt=e=>{let t=[],o=0;for(;o<e.length;){let r=e.slice(o).match(/^<u\s*[^>]*>([\s\S]*?)<\/u>/i);if(r&&r[0]){let v=r[1]||"",y=v?Nt(v):[];y.length>0?(y.forEach(x=>{x.type==="text"&&(x.format=(x.format||0)|8)}),t.push(...y)):v===""&&t.push({type:"text",text:"",format:8}),o+=r[0].length;continue}if(e.slice(o).startsWith("</u>")){o+=4;continue}let i=e.slice(o).match(/^(`+)([^`]+)\1/);if(i){let v=i[2];v&&t.push({type:"text",text:v,format:16}),o+=i[0].length;continue}let n=e.slice(o).match(/^(~~)(.+?)\1/);if(n){let v=n[2],y=Nt(v);y.forEach(x=>{x.type==="text"&&(x.format=(x.format||0)|4)}),t.push(...y),o+=n[0].length;continue}let s=e.slice(o).match(/^(\*\*|__)(.+?)\1/);if(s){let v=s[2],y=Nt(v);y.forEach(x=>{x.type==="text"&&(x.format=(x.format||0)|1)}),t.push(...y),o+=s[0].length;continue}let m=e.slice(o).match(/^(\*|_)([^*_\n]+?)\1(?!\*|_)/);if(m&&m[0].length>2){let v=m[2],y=Nt(v);y.forEach(x=>{x.type==="text"&&(x.format=(x.format||0)|2)}),t.push(...y),o+=m[0].length;continue}if(e[o]===`
9
+ `){t.push({type:"linebreak",version:1}),o+=1;continue}let u=e.length,d=[{pattern:/<u>/i,offset:0},{pattern:/\*\*/,offset:0},{pattern:/__/,offset:0},{pattern:/~~/,offset:0},{pattern:/`+/,offset:0},{pattern:/\*[^*\n]/,offset:0},{pattern:/_[^_\n]/,offset:0},{pattern:/\n/,offset:0}];for(let{pattern:v}of d){let y=e.slice(o+1).search(v);y!==-1&&y+1<u-o&&(u=o+y+1)}let g=e.slice(o,u);g&&t.push({type:"text",text:g,format:0}),o=u}let a=[];for(let r of t)r.type==="linebreak"?a.push(r):a.length>0&&a[a.length-1].type==="text"&&r.type==="text"&&a[a.length-1].format===r.format?a[a.length-1].text+=r.text:a.push(r);return a.length>0?a:[{type:"text",text:"",format:0}]},Pn=e=>{let t=e.split(`
10
+ `),o=[],a=[],r=[],i=null,n=()=>{if(a.length>0){for(let m=0;m<a.length;m++){let u=a[m],d=Nt(u),g=d.length>0?d.map(v=>({...v,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];o.push({type:"paragraph",children:g,direction:"ltr",format:"",indent:0,version:1})}a=[]}},s=()=>{r.length>0&&i&&(o.push({type:"list",listType:i,tag:i==="number"?"ol":"ul",start:1,format:"",indent:0,version:1,direction:"ltr",children:r}),r=[],i=null)};for(let m of t){let u=m.trim();if(!u){n(),s(),o.push({children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""});continue}let d=u.match(/^(#{1,6})\s+(.+)$/);if(d){n(),s();let y=d[1].length,x=d[2],T=Nt(x);o.push({type:"heading",tag:`h${y}`,children:T.length>0?T:[{type:"text",text:"",format:0}]});continue}let g=u.match(/^(\d+)\.\s+(.*)$/);if(g){n(),i==="bullet"&&s(),i!=="number"&&(r.length>0&&s(),i="number");let y=g[2]||"",x=Nt(y),T=x.length>0?x.map(p=>({...p,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];r.push({type:"listitem",value:r.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:T,direction:"ltr",format:"",indent:0,version:1}]});continue}let v=u.match(/^[-*+]\s+(.+)$/);if(v){n(),i==="number"&&s(),i!=="bullet"&&(r.length>0&&s(),i="bullet");let y=v[1],x=Nt(y),T=x.length>0?x.map(p=>({...p,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];r.push({type:"listitem",value:r.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:T,direction:"ltr",format:"",indent:0,version:1}]});continue}r.length>0&&s(),a.push(m)}return n(),s(),o.length===0&&o.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:o,direction:"ltr",format:"",indent:0,version:1}}},Rn=async e=>{let t="",o,a="text";if(e.url)try{let r=e.url;!r.startsWith("http://")&&!r.startsWith("https://")&&!r.startsWith("/")&&(r="/"+r);let i=await fetch(r);i.ok?(t=await i.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed to fetch file content:",i.status,i.statusText)}catch(r){console.error("Failed to fetch file content:",r)}else console.warn("No URL provided for file:",e.name);return e.mimeType==="text/markdown"?(a="richText",o=Pn(t)):e.mimeType?.startsWith("text/")&&(a="text"),{id:e.id.toString(),title:e.name,description:void 0,content:a==="richText"?void 0:t,richTextContent:a==="richText"?o:void 0,format:a,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function Jr({document:e,onCancel:t,onSave:o,onFileUpdate:a}){let[r,i]=(0,Zt.useState)(ro(e)),[n,s]=(0,Zt.useState)(ro(e)?{id:e.id.toString(),title:e.name,description:void 0,content:"",format:"text",metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}:{...e,updatedAt:new Date}),[m,u]=(0,Zt.useState)(ro(e)?void 0:n.richTextContent),[d,g]=(0,Zt.useState)(!1),v=(0,Zt.useRef)(ro(e)?e:null);(0,Zt.useEffect)(()=>{ro(e)?(i(!0),Rn(e).then(p=>{s(p),u(p.richTextContent),i(!1)}).catch(p=>{p instanceof Error&&p.name!=="AbortError"&&(console.error("Failed to convert file:",p),i(!1))})):(s({...e,updatedAt:new Date}),u(e.richTextContent))},[e]);let y=p=>{switch(p){case"markdown":case"mdx":return(0,Aa.jsx)(Ht.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Aa.jsx)(Ht.File,{className:"h-6 w-6 text-success"});case"text":return(0,Aa.jsx)(Ht.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Aa.jsx)(Ht.File,{className:"h-6 w-6 text-muted-foreground"})}},x=p=>{switch(p){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"}},T=async()=>{g(!0);try{let p,b;if(v.current&&v.current.mimeType==="text/markdown"){let N=m?kn(m):"";p={...n,format:"markdown",content:N,richTextContent:void 0},b=N}else p={...n,richTextContent:m},b=n.content||"";let O=v.current?v.current.id.toString():n.id;await Promise.resolve(o()),a?.(O,b)}finally{g(!1)}};return(0,Aa.jsxs)(Va.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Aa.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,Aa.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Aa.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Aa.jsx)("div",{className:"flex-1 min-w-0",children:(0,Aa.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Aa.jsx)("div",{className:"flex-1 min-w-0",children:(0,Aa.jsx)(Jt,{fieldName:"title",value:n.title,label:"",onSave:(p,b)=>s(O=>({...O,title:b})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Aa.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${x(n.format)} flex-shrink-0 Aa-1`,children:n.format.toUpperCase()})]})})}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Aa.jsxs)(D,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"}),"Close"]}),(0,Aa.jsxs)(D,{size:"sm",onClick:T,className:"gap-2",disabled:d,children:[d?(0,Aa.jsx)(Ht.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Aa.jsx)(Ht.Save,{className:"h-4 w-4"}),d?"Saving...":"Save"]})]})]})}),(0,Aa.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Aa.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:r?(0,Aa.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,Aa.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,Aa.jsx)(Ht.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,Aa.jsx)(Aa.Fragment,{children:n.format==="richText"?(0,Aa.jsx)(Gr,{setValue:u,value:m,name:"richTextContent"},`richtext-${n.id}-${r?"loading":"loaded"}`):(0,Aa.jsx)(Ne,{value:n.content||"",onChange:p=>s(b=>({...b,content:p.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var qr=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function Qr({files:e,onFileClick:t,onFileDelete:o,onFileUpdate:a,showHeader:r=!0,className:i,viewMode:n="list"}){let[s,m]=(0,Zt.useState)(!1),[u,d]=(0,Zt.useState)(!1),[g,v]=(0,Zt.useState)(null),y=()=>{m(!1),v(null)},x=()=>{d(!0),setTimeout(()=>{d(!1),m(!1),v(null)},500)},T=p=>{v(p),m(!0)};return(0,Aa.jsxs)("div",{className:C("rounded-3xl border overflow-hidden",i),children:[(0,Aa.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[r&&n==="list"&&(0,Aa.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,Aa.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Aa.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Aa.jsx)("div",{className:"col-span-2",children:"Modified"})]}),n==="card"&&(0,Aa.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),n==="list"&&(0,Aa.jsx)("div",{className:"divide-y",children:e.map(p=>(0,Aa.jsxs)(Va.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?.(p),children:[(0,Aa.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Aa.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Aa.jsx)("div",{children:(0,Aa.jsx)("p",{className:"font-medium",children:p.name})})]}),(0,Aa.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:qr(p.filesize)}),(0,Aa.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Aa.jsx)("span",{className:"text-sm md:text-base",children:new Date(p.createdAt).toLocaleDateString()}),(0,Aa.jsxs)("div",{className:"flex gap-1",children:[p.mimeType==="text/markdown"&&(0,Aa.jsx)(D,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:b=>{b.stopPropagation(),T(p)},children:(0,Aa.jsx)(Ht.Edit,{className:"h-4 w-4"})}),(0,Aa.jsx)(D,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:b=>{b.stopPropagation(),o?.(p)},children:(0,Aa.jsx)(Ht.Trash2,{className:"h-4 w-4"})})]})]})]},p.name))}),n==="card"&&(0,Aa.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(p=>(0,Aa.jsx)(Va.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(p),children:(0,Aa.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Aa.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Aa.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,Aa.jsx)("div",{className:"min-w-0 flex-1",children:(0,Aa.jsx)("p",{className:"font-medium truncate",children:p.name})})]}),(0,Aa.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("span",{className:"font-medium",children:"Size:"}),(0,Aa.jsx)("span",{children:qr(p.filesize)})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,Aa.jsx)("span",{children:new Date(p.createdAt).toLocaleDateString()})]})]})]}),(0,Aa.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[p.mimeType==="text/markdown"&&(0,Aa.jsx)(D,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:b=>{b.stopPropagation(),T(p)},title:"Edit",children:(0,Aa.jsx)(Ht.Edit,{className:"h-4 w-4"})}),(0,Aa.jsx)(D,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:b=>{b.stopPropagation(),o?.(p)},title:"Delete",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-4 w-4"})})]})]})},p.name))}),(0,Aa.jsx)(Fe,{open:s,onOpenChange:p=>!p&&y(),children:(0,Aa.jsxs)(Ko,{children:[(0,Aa.jsx)(go,{}),(0,Aa.jsxs)(Xr.Content,{className:C("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[(0,Aa.jsx)(Ee,{className:"sr-only",children:g?`Edit ${g.name}`:"Edit File"}),u&&(0,Aa.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,Aa.jsx)(Ht.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),g&&(0,Aa.jsx)(Jr,{document:g,onSave:x,onFileUpdate:a,onCancel:y})]})]})})]})}var ei=({isOpen:e,onClose:t,onAddFile:o})=>{let[a,r]=(0,Zt.useState)(null),[i,n]=(0,Zt.useState)(""),[s,m]=(0,Zt.useState)(""),[u,d]=(0,Zt.useState)(""),g=y=>{let x=y.target.files?.[0];x&&(r(x),i||n(x.name))},v=async y=>{if(y.preventDefault(),!a)return;let x=new FormData;x.append("file",a),x.append("name",i),s&&x.append("description",s),u&&x.append("tags",u),o?.(x),t(),r(null),n(""),m(""),d("")};return(0,Aa.jsx)(Fe,{open:e,onOpenChange:t,children:(0,Aa.jsxs)(Ve,{className:"sm:max-w-md",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Ee,{children:"Add New File"})}),(0,Aa.jsxs)("form",{onSubmit:v,className:"grid gap-4",children:[(0,Aa.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Aa.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,Aa.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Aa.jsx)(Mn,{className:"w-10 h-10 text-gray-400"}),(0,Aa.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Aa.jsx)("span",{className:"font-semibold",children:"Click to upload"})," Ht drag and drop"]}),(0,Aa.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG Ht GIF (MAX. 800x400px)"})]}),(0,Aa.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),a&&(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("p",{className:"font-medium",children:a.name}),(0,Aa.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((a.size||0)/1024).toFixed(2)," KB"]})]}),(0,Aa.jsx)(D,{type:"submit",onClick:v,children:"Upload"})]})]})]})})};function Mn(e){return(0,Aa.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,Aa.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Aa.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Aa.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var ti=({isOpen:e,onClose:t,initialTask:o,epics:a,sprints:r,onUpdateTask:i,onDeleteTask:n,onAddComment:s,colleagues:m,onUploadFile:u,onDeleteFile:d,onFileUpdate:g})=>{let[v,y]=(0,Zt.useState)(o),[x,T]=(0,Zt.useState)(new Date),[p,b]=(0,Zt.useState)("idle"),[O,N]=(0,Zt.useState)("idle"),[S,oe]=(0,Zt.useState)(!1),[I,ae]=(0,Zt.useState)([]),[Q,j]=(0,Zt.useState)(m);(0,Zt.useEffect)(()=>{y(o)},[o]);let xe=async(X,w)=>{if(w!==v[X]){b("loading");try{await i(v.id.toString(),{[X]:w}),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(re){console.log("error",re),b("error"),setTimeout(()=>b("idle"),3e3)}}},we=async(X,w)=>{if(w!==v[X]){b("loading");try{await i(v.id.toString(),{[X]:w}),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(re){console.log("error",re),b("error"),setTimeout(()=>b("idle"),3e3)}}},$=async X=>{if(s){b("loading");try{await s?.({content:X,taskId:v.id.toString()}),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}}},je=async()=>{N("loading");try{await n(v.id.toString()),N("success"),setTimeout(()=>{t(),N("idle")},1e3)}catch{N("error"),setTimeout(()=>N("idle"),3e3)}},He=async X=>{if(u){b("loading");try{await u(v.id.toString(),X),T(new Date),b("success"),oe(!1),setTimeout(()=>b("idle"),1500)}catch(w){console.error("Error uploading file:",w),b("error"),setTimeout(()=>b("idle"),3e3)}}},P=async X=>{if(d){b("loading");try{await d(v.id.toString(),X.id.toString()),T(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(w){console.error("Error deleting file:",w),b("error"),setTimeout(()=>b("idle"),3e3)}}},W=(v.files||[]).map(X=>typeof X=="number"?null:X).filter(X=>X!==null),ee=p!=="loading"&&O!=="loading",Te=()=>{ee&&t()},ie=()=>p==="loading"?(0,Aa.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Aa.jsx)(Ht.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Aa.jsx)("span",{children:"Updating..."})]}):p==="success"?(0,Aa.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Aa.jsx)(Ht.Check,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:"Updated successfully"})]}):p==="error"?(0,Aa.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:"Update failed"})]}):null;return(0,Aa.jsxs)(Fe,{open:e,onOpenChange:Te,children:[(0,Aa.jsxs)(Ve,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Aa.jsxs)(ze,{children:[(0,Aa.jsx)(Ee,{className:"sr-only",children:v?.name}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("div",{className:"flex-1",children:ie()}),!ee&&(0,Aa.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Aa.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Aa.jsx)(Jt,{fieldName:"name",value:v.name||"",label:"",onSave:xe,className:"border-b border-border pb-3",disabled:p==="loading"}),(0,Aa.jsx)(Jt,{fieldName:"description",value:v.description||"",label:"Description",multiline:!0,onSave:xe,disabled:p==="loading"}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)(Ht.File,{className:"h-4 w-4 text-muted-foreground"}),(0,Aa.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),u&&(0,Aa.jsxs)(D,{variant:"outline",size:"sm",onClick:()=>oe(!0),disabled:p==="loading",className:"gap-2",children:[(0,Aa.jsx)(Ht.Upload,{className:"h-4 w-4"}),"Upload"]})]}),W.length>0?(0,Aa.jsx)(Qr,{files:W,onFileDelete:d?P:void 0,onFileUpdate:g,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"No files attached"})]}),(0,Aa.jsx)(rr,{comments:(v?.comments||[]).map(X=>({author:X.author?.value.name||"",createdAt:new Date(X.timestamp),text:X.text,id:X.id||""})),onAddComment:$})]}),(0,Aa.jsx)(sr,{task:v,epics:a,sprints:r,lastUpdated:x,onUpdateTask:we,onClose:Te,onDelete:je,isUpdating:p==="loading",isDeleting:O==="loading",deleteState:O,teamMembers:Q})]})]}),u&&(0,Aa.jsx)(ei,{isOpen:S,onClose:()=>oe(!1),onAddFile:He})]})};var Io=({isOpen:e,onClose:t,onAddEpic:o})=>{let[a,r]=(0,Zt.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}),i=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],n=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],m=d=>{d.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}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},u=(d,g)=>{r(v=>({...v,[d]:g}))};return(0,Aa.jsx)(Fe,{open:e,onOpenChange:t,children:(0,Aa.jsxs)(Ve,{className:"sm:max-w-md",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Ee,{children:"Add New Epic"})}),(0,Aa.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"name",children:"Epic Name"}),(0,Aa.jsx)(te,{id:"name",value:a.name,onChange:d=>u("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"description",value:a.description,onChange:d=>u("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Color"}),(0,Aa.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,Aa.jsx)("button",{type:"button",onClick:()=>u("color",d),className:`w-8 h-8 rounded-full ${d} ${a.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Confidence"}),(0,Aa.jsxs)(Ge,{value:a.confidence,onValueChange:d=>u("confidence",d),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{})}),(0,Aa.jsx)($e,{children:n.map(d=>(0,Aa.jsx)(me,{value:d.value,children:d.label},d.value))})]})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Phase"}),(0,Aa.jsxs)(Ge,{value:a.phase.toString(),onValueChange:d=>u("phase",parseInt(d)),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{})}),(0,Aa.jsx)($e,{children:s.map(d=>(0,Aa.jsx)(me,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Start Date"}),(0,Aa.jsx)(te,{type:"date",value:a.startDate,onChange:d=>u("startDate",d.target.value)})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"End Date"}),(0,Aa.jsx)(te,{type:"date",value:a.endDate,onChange:d=>u("endDate",d.target.value)})]})]}),(0,Aa.jsxs)(Kt,{children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};function ai(e,t){let[o,a]=(0,Zt.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{a(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,Zt.useEffect)(()=>{r(o)},[]),[o,r]}var Lo=require("react-icons/fa");function Ct({title:e,description:t,badge:o,primaryAction:a,secondaryAction:r,gradient:i,children:n,className:s}){let[m,u]=ai(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||m;return(0,Aa.jsxs)(Va.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,Aa.jsx)(le,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,Aa.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-3",children:[d&&a&&(0,Aa.jsx)(D,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),(r||t)&&(0,Aa.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>u(!m),style:{lineHeight:0},children:m?(0,Aa.jsx)(Lo.FaChevronDown,{size:22}):(0,Aa.jsx)(Lo.FaChevronUp,{size:22})})]})]}),!d&&(0,Aa.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Aa.jsxs)("div",{className:"space-y-4",children:[(0,Aa.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Aa.jsxs)("div",{className:"flex flex-wrap gap-3",children:[a&&(0,Aa.jsx)(D,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),r&&(0,Aa.jsx)(D,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),n&&(0,Aa.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var En=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:a=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:n,onUpdateTask:s,onDeleteTask:m,onTaskClick:u,onAddEpic:d,onAddComment:g,onUploadFile:v,onDeleteFile:y,onFileUpdate:x})=>{let[T,p]=(0,se.useState)([]),[b,O]=(0,se.useState)([]),[N,S]=(0,se.useState)([]),[oe,I]=(0,se.useState)(!1),[ae,Q]=(0,se.useState)(!1),[j,xe]=(0,se.useState)(null),[we,$]=(0,se.useState)(null),[je,He]=(0,se.useState)([]),[P,W]=(0,se.useState)([]),[ee,Te]=(0,se.useState)(0),ie=(0,se.useRef)(null),X=(0,se.useRef)(null),w=se.default.useMemo(()=>[...b.map(h=>h.id),0],[b]),re=(0,se.useRef)(""),Oe=(0,se.useRef)(""),ft=(0,se.useRef)(""),pe=(0,se.useRef)(""),ot=(h,R)=>h.map(F=>`${F.id}-${new Date(F.createdAt).getTime()}-${new Date(F.updatedAt).getTime()}`).join("-")+(R?`-${R}`:"");(0,se.useEffect)(()=>{let h=e.map(F=>F.files?.filter(K=>typeof K=="object").map(K=>new Date(K.updatedAt).getTime())).flat(),R=ot(e,h.join("-"));R!==re.current&&(p(e),j&&xe(e.find(F=>F.id===j.id)||null),re.current=R)},[e]),(0,se.useEffect)(()=>{let h=ot(t);h!==Oe.current&&(O(t),Oe.current=h)},[t]),(0,se.useEffect)(()=>{let h=ot(o);h!==ft.current&&(S(o),ft.current=h)},[o]),(0,se.useEffect)(()=>{let h=ot(r.map(R=>({id:R.id,updatedAt:R.updatedAt,createdAt:R.createdAt})));h!==pe.current&&(W(r),pe.current=h)},[r]),(0,se.useEffect)(()=>{let h=()=>{if(ie.current){let K=ie.current.offsetHeight;Te(K)}};h();let R=new ResizeObserver(h);ie.current&&R.observe(ie.current);let F=()=>{setTimeout(h,100)};return window.addEventListener("storage",F),()=>{R.disconnect(),window.removeEventListener("storage",F)}},[]),(0,se.useEffect)(()=>{let h=setTimeout(()=>{ie.current&&Te(ie.current.offsetHeight)},300);return()=>clearTimeout(h)},[oe,ae]);let Ho=T.filter(h=>!0),no=h=>Ho.filter(R=>R.status===h),Bo=h=>{let R={};return b.forEach(F=>{R[F.id]=h.filter(K=>Ie(K.epic)===F.id)}),R["no-epic"]=h.filter(F=>!Ie(F.epic)),R},so=h=>{$(h)},Fo=h=>{we&&(p(R=>R.map(F=>F.id===we.id?{...F,status:h}:F)),s?.(we.id.toString(),{status:h}),$(null))},lo=h=>{let R={...h,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};p(F=>[...F,R]),n?.(h)},co=async(h,R)=>{p(F=>F.map(K=>K.id===Number(h)?{...K,...R}:K)),s&&await s(h,R),j?.id===Number(h)&&xe(F=>({...F,...R}))},mo=async h=>{p(R=>R.filter(F=>F.id!==Number(h))),j?.id===Number(h)&&xe(null),m&&await m(h)},po=h=>{let R={...h,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};O(F=>[...F,R]),d?.(h)},vt=h=>{xe(h),u?.(h)},f=[{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"}],k=ee>0?`calc(100vh - ${ee+120}px)`:"calc(100vh - 12rem)";return(0,Aa.jsxs)("div",{ref:X,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Aa.jsx)("div",{ref:ie,className:"flex-shrink-0",children:(0,Aa.jsx)(Ct,{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:()=>I(!0)},secondaryAction:{label:"Add epic",onClick:()=>Q(!0)}})}),(0,Aa.jsx)("div",{className:"flex-1 min-h-0 Aa-8",children:(0,Aa.jsx)("div",{className:"h-full",style:{height:ee>0?`calc(100vh - ${ee+120}px)`:"calc(100vh - 12rem)"},children:(0,Aa.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:f.map(h=>{let R=no(h.status),F=Bo(R);return(0,Aa.jsxs)(Ua,{title:h.title,status:h.status,taskCount:R.length,onDrop:Fo,isCompact:h.status==="done",height:k,children:[F["no-epic"].map(K=>(0,Aa.jsx)(jt,{epic:null,task:K,onDragStart:so,onTaskClick:vt,isCompact:h.status==="done"},K.id)),w.map(K=>{let Be=b.find(Dt=>Dt.id===K),St=F[K]||[];return St.length===0?null:(0,Aa.jsxs)("div",{className:"mb-6",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${Be?.color}`}),(0,Aa.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Be?.name||"No Epic"}),(0,Aa.jsx)(le,{variant:"secondary",className:"text-xs",children:St.length})]})," ",(0,Aa.jsx)("div",{className:"space-y-3",children:St.map(Dt=>(0,Aa.jsx)(jt,{task:Dt,epic:Be,onDragStart:so,onTaskClick:vt,isCompact:h.status==="done"},Dt.id))})]},K)})]},h.id)})})})}),(0,Aa.jsx)(vo,{isOpen:oe,onClose:()=>I(!1),onAddTask:lo,assignees:[...P,...je],epics:b,sprints:N}),(0,Aa.jsx)(Io,{isOpen:ae,onClose:()=>Q(!1),onAddEpic:po}),j&&(0,Aa.jsx)(ti,{isOpen:!!j,onClose:()=>xe(null),initialTask:j,epics:b,sprints:N,onUpdateTask:co,onDeleteTask:mo,colleagues:P,onUploadFile:v,onDeleteFile:y,onFileUpdate:x,onAddComment:g})]})};var ba=require("date-fns");var ni=({isOpen:e,onClose:t,onAddSprint:o})=>{let[a,r]=(0,Zt.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),i=s=>{s.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()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},n=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Aa.jsx)(Fe,{open:e,onOpenChange:n,children:(0,Aa.jsxs)(Ve,{className:"sm:max-w-md",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Ee,{children:"Add New Sprint"})}),(0,Aa.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"name",children:"Sprint Name *"}),(0,Aa.jsx)(te,{id:"name",value:a.name,onChange:s=>r(m=>({...m,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"description",value:a.description,onChange:s=>r(m=>({...m,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"Start Date *"}),(0,Aa.jsxs)(ga,{children:[(0,Aa.jsx)(fa,{asChild:!0,children:(0,Aa.jsxs)(D,{variant:"outline",className:C("w-full justify-start text-left font-normal",!a.startDate&&"text-muted-foreground"),children:[(0,Aa.jsx)(Ht.CalendarIcon,{className:"U-2 h-4 w-4"}),a.startDate?(0,ba.format)(a.startDate,"PPP"):"Pick a date"]})}),(0,Aa.jsx)(Ro,{className:"w-auto p-0",align:"start",children:(0,Aa.jsx)(Mo,{mode:"single",selected:a.startDate,onSelect:s=>r(m=>({...m,startDate:s})),initialFocus:!0})})]})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)(H,{children:"End Date *"}),(0,Aa.jsxs)(ga,{children:[(0,Aa.jsx)(fa,{asChild:!0,children:(0,Aa.jsxs)(D,{variant:"outline",className:C("w-full justify-start text-left font-normal",!a.endDate&&"text-muted-foreground"),children:[(0,Aa.jsx)(Ht.CalendarIcon,{className:"U-2 h-4 w-4"}),a.endDate?(0,ba.format)(a.endDate,"PPP"):"Pick a date"]})}),(0,Aa.jsx)(Ro,{className:"w-auto p-0",align:"start",children:(0,Aa.jsx)(Mo,{mode:"single",selected:a.endDate,onSelect:s=>r(m=>({...m,endDate:s})),initialFocus:!0,disabled:s=>a.startDate?s<a.startDate:!1})})]})]})]}),(0,Aa.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",disabled:!a.name||!a.startDate||!a.endDate,children:"Add Sprint"})]})]})]})})};var In=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:r,onAddSprint:i,onUpdateSprint:n,onDeleteSprint:s})=>{let[m,u]=(0,Zt.useState)([]),[d,g]=(0,Zt.useState)(new Set),[v,y]=(0,Zt.useState)(null),[x,T]=(0,Zt.useState)(!1),[p,b]=(0,Zt.useState)(null),[O,N]=(0,Zt.useState)(null),[S,oe]=(0,Zt.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[I,ae]=(0,Zt.useState)([]),[Q,j]=(0,Zt.useState)("upcoming"),[xe,we]=(0,Zt.useState)(!1),[$,je]=(0,Zt.useState)(0),He=(0,Zt.useRef)(null),P=(0,Zt.useRef)(null);(0,Zt.useEffect)(()=>{let f=()=>{He.current&&je(He.current.offsetHeight)};f();let k=new ResizeObserver(f);return He.current&&k.observe(He.current),()=>k.disconnect()},[]);let W=f=>t.find(k=>k.id===Number(f)),ee=f=>o.find(k=>k.id===Number(f)),Te=f=>{let k={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 k[f]||k.medium},ie=f=>{if(!f||f?.length===0)return"";let k=f?.trim().split(" ");if(k?.length===1)return k[0];let h=k[0],R=k[k.length-1][0].toUpperCase();return`${h} ${R}`},X=f=>{let k={},h=[];return f.forEach(R=>{R.epic?(k[Ie(R.epic)]||(k[Ie(R.epic)]=[]),k[Ie(R.epic)].push(R)):h.push(R)}),{tasksByEpic:k,unassignedTasks:h}};(0,Zt.useEffect)(()=>{ae(o)},[o]);let w=I.filter(f=>{switch(Q){default:return!0}}),re=I.filter(f=>m.includes(f.id.toString())),Oe=e.filter(f=>!f.sprint||f.status==="backlog"),ft=Oe.reduce((f,k)=>f+(k.storyPoints||0),0),pe=f=>{u(k=>k.includes(f)?k.filter(h=>h!==f):k?.length<3?[...k,f]:k)},ot=f=>{g(k=>{let h=new Set(k);return h.has(f)?h.delete(f):h.add(f),h})},Ho=f=>{i(f),T(!1)},no=f=>{N(f.id.toString()),oe({name:f.name,description:f.description||"",startDate:f.startDate?new Date(f.startDate).toISOString().split("T")[0]:f.startDate,endDate:f.endDate?new Date(f.endDate).toISOString().split("T")[0]:f.endDate,isActive:!1})},Bo=()=>{O&&(n(O,{name:S.name,description:S.description,startDate:S.startDate,endDate:S.endDate}),ae(f=>f.map(k=>(k.id===Number(O)&&(k.name=S.name,k.description=S.description,k.startDate=S.startDate,k.endDate=S.endDate),k))),N(null))},so=()=>{N(null),oe({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Fo=(f,k)=>{y(k),f.dataTransfer.effectAllowed="move"},lo=f=>{f.preventDefault(),f.dataTransfer.dropEffect="move"},co=f=>{b(f)},mo=()=>{b(null)},po=(f,k)=>{if(f.preventDefault(),b(null),!v)return;(Ie(v.sprint)||void 0)!==Number(k)&&a(v.id.toString(),{sprint:Number(k)}),y(null)},vt=({task:f,showSprint:k=!1})=>{let h=f.epic?W(Ie(f.epic).toString()):null,R=f.sprint?ee(Ie(f.sprint).toString()):null;return(0,Aa.jsx)(ue,{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:Be=>{Be.dataTransfer.effectAllowed="move",Be.dataTransfer.setData("text/plain",f.id.toString()),Fo(Be,f)},onClick:Be=>{v===null&&r(f)},style:{userSelect:"none"},children:(0,Aa.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Aa.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Aa.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:f.name}),(0,Aa.jsx)(le,{className:`text-xs ${Te(f.priority||"medium")}`,children:f.priority?.[0]?.toUpperCase()})]}),(0,Aa.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-1",children:[h&&(0,Aa.jsx)("div",{className:`w-2 h-2 rounded-full ${h.color}`}),(0,Aa.jsx)("span",{className:"text-muted-foreground truncate",children:h?.name})]}),(0,Aa.jsx)("span",{className:"text-muted-foreground",children:ie(f.assignee?.value?.name)})]}),k&&R&&(0,Aa.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-3 w-3"}),(0,Aa.jsx)("span",{children:R.name})]})]})})};return(0,Aa.jsxs)("div",{ref:P,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Aa.jsx)("div",{ref:He,className:"flex-shrink-0",children:(0,Aa.jsx)(Ct,{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:()=>T(!0)}})}),(0,Aa.jsx)("div",{className:"flex-1 min-h-0 Aa-8",children:(0,Aa.jsxs)("div",{className:"h-full",style:{height:$>0?`calc(100vh - ${$+120}px)`:"calc(100vh - 12rem)"},children:[(0,Aa.jsxs)("div",{className:"mb-4",children:[(0,Aa.jsx)(ue,{className:"p-3 bg-card shadow-sm",children:(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Aa.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m?.length,"/3 selected"]})]}),m?.length>0&&(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Aa.jsx)("div",{className:"flex flex-wrap gap-1",children:re.map(f=>(0,Aa.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Aa.jsx)("span",{className:"max-w-[80px] truncate",children:f.name}),(0,Aa.jsx)("button",{onClick:()=>pe(f.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"})})]},f.id))})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsxs)(D,{onClick:()=>T(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Aa.jsx)(Ht.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Aa.jsxs)(D,{onClick:()=>we(!xe),variant:"outline",size:"sm",className:"gap-1",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-3 w-3"}),xe?"Close":"Select"]})]})]})}),xe&&(0,Aa.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>we(!1)}),(0,Aa.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-Aa shadow-xl z-10 transition-all duration-300 ease-in-out ${xe?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Aa.jsxs)(ue,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Aa.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Aa.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>we(!1),className:"h-8 w-8 p-0",children:(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"})})]}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground Aa-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Aa.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Aa.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(f=>(0,Aa.jsxs)(D,{variant:Q===f.key?"default":"outline",size:"sm",onClick:()=>j(f.key),className:"text-xs h-8 px-3 flex-1",children:[f.label," (",f.count,")"]},f.key))}),(0,Aa.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:w.length>0?w.map(f=>{let k=m.includes(f.id.toString()),h=e.filter(F=>Ie(F.sprint)===f.id).length,R=!k&&m.length<3;return(0,Aa.jsx)("div",{className:`p-3 rounded-lg border transition-all ${k?"bg-primary/10 border-primary/30":R?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:O===f.id.toString()?(0,Aa.jsxs)("div",{className:"space-y-3",children:[(0,Aa.jsx)(te,{value:S.name,onChange:F=>oe(K=>({...K,name:F.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Aa.jsx)(Ne,{value:S.description,onChange:F=>oe(K=>({...K,description:F.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Aa.jsxs)("div",{className:"flex gap-2",children:[(0,Aa.jsxs)(D,{size:"sm",onClick:()=>Bo(),className:"flex-1",children:[(0,Aa.jsx)(Ht.Check,{className:"h-3 w-3 U-1"}),"Save"]}),(0,Aa.jsxs)(D,{size:"sm",variant:"outline",onClick:so,className:"flex-1",children:[(0,Aa.jsx)(Ht.X,{className:"h-3 w-3 U-1"}),"Cancel"]})]})]}):(0,Aa.jsxs)("div",{children:[(0,Aa.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Aa.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Aa.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:f.name}),(0,Aa.jsx)(le,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Aa.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:f.description}),(0,Aa.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Aa.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Aa.jsx)(Ht.CalendarDays,{className:"h-3 w-3"}),new Date(f.startDate).toLocaleDateString()]}),(0,Aa.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Aa.jsx)(Ht.User,{className:"h-3 w-3"}),h," tasks"]})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>no(f),className:"h-6 w-6 p-0",children:(0,Aa.jsx)(Ht.Edit2,{className:"h-3 w-3"})}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>s(f.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-3 w-3"})})]})]}),(0,Aa.jsx)("div",{className:"flex items-center justify-between Aa-2",children:(0,Aa.jsx)(D,{variant:k?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>pe(f.id.toString()),disabled:!k&&m?.length>=3,children:(0,Aa.jsx)("span",{className:"pointer-events-none select-none",children:k?"Deselect":m?.length>=3?"Limit Reached":"Select"})})})]})},f.id)}):(0,Aa.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Aa.jsxs)("p",{className:"text-sm",children:['No sprints found for "',Q,'" filter']}),(0,Aa.jsx)(D,{variant:"link",size:"sm",onClick:()=>j("all"),className:"text-xs",children:"Show all sprints"})]})}),m?.length===0&&(0,Aa.jsx)("div",{className:"Aa-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Aa.jsxs)("div",{className:"text-center",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Aa.jsx)("p",{className:"text-xs text-muted-foreground Aa-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Aa.jsx)("div",{className:"lg:col-span-1",children:(0,Aa.jsxs)(ue,{className:"p-4 h-full bg-card border-Aa-4 border-Aa-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:lo,onDragEnter:()=>co("backlog"),onDragLeave:mo,onDrop:f=>po(f,"backlog"),style:{height:$>0?`calc(100vh - ${$+200}px)`:"calc(100vh - 16rem)"},children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Aa.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsxs)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[Oe?.length," tasks"]}),(0,Aa.jsxs)(le,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[ft," pts"]})]})]}),(0,Aa.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${p==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:f,unassignedTasks:k}=X(Oe);return(0,Aa.jsxs)(Aa.Fragment,{children:[Object.entries(f).map(([h,R])=>{let F=W(h);if(!F)return null;let K=d.has(h);return(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.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:()=>ot(h),children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${F.color}`}),(0,Aa.jsx)("span",{className:"font-medium text-muted-foreground",children:F.name}),(0,Aa.jsxs)("span",{className:"text-muted-foreground",children:["(",R?.length,")"]}),(0,Aa.jsx)("div",{className:"ml-auto",children:K?(0,Aa.jsx)(Ht.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Aa.jsx)(Ht.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!K&&(0,Aa.jsx)("div",{className:"space-y-2 pl-2",children:R.map(Be=>(0,Aa.jsx)(vt,{task:Be},Be.id))})]},h)}),k?.length>0&&(()=>{let h=d.has("no-epic");return(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.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:()=>ot("no-epic"),children:[(0,Aa.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Aa.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Aa.jsxs)("span",{className:"text-muted-foreground",children:["(",k?.length,")"]}),(0,Aa.jsx)("div",{className:"ml-auto",children:h?(0,Aa.jsx)(Ht.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Aa.jsx)(Ht.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!h&&(0,Aa.jsx)("div",{className:"space-y-2 pl-2",children:k?.map(R=>(0,Aa.jsx)(vt,{task:R},R.id))})]})})(),Oe?.length===0&&(0,Aa.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"}),Oe?.length>0&&Object.keys(f).length===0&&k.length===0&&(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),Oe?.map(h=>(0,Aa.jsx)(vt,{task:h},h.id))]})]})})()})]})}),re.map(f=>{let k=e.filter(R=>Ie(R?.sprint)===f.id),h=k.reduce((R,F)=>R+(F?.storyPoints||0),0);return(0,Aa.jsxs)(ue,{className:"p-4 h-full bg-card border-Aa-4 border-Aa-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:lo,onDragEnter:()=>co(f.id.toString()),onDragLeave:mo,onDrop:R=>po(R,f.id.toString()),style:{height:$>0?`calc(100vh - ${$+200}px)`:"calc(100vh - 16rem)"},children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Aa.jsx)("div",{children:(0,Aa.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:f.name})}),(0,Aa.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Aa.jsxs)(le,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[k?.length," tasks"]}),(0,Aa.jsxs)(le,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[h," pts"]}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>{we(!0),no(f)},className:"h-6 px-2",children:(0,Aa.jsx)(Ht.Edit2,{className:"h-3 w-3"})}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>s(f.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-3 w-3"})})]})]}),(0,Aa.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:R,unassignedTasks:F}=X(k);return(0,Aa.jsxs)(Aa.Fragment,{children:[Object.entries(R).map(([K,Be])=>{let St=W(K);if(!St)return null;let Dt=d.has(K);return(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.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:()=>ot(K),children:[(0,Aa.jsx)("div",{className:`w-3 h-3 rounded-full ${St.color}`}),(0,Aa.jsx)("span",{className:"font-medium text-muted-foreground",children:St.name}),(0,Aa.jsxs)("span",{className:"text-muted-foreground",children:["(",Be?.length,")"]}),(0,Aa.jsx)("div",{className:"ml-auto",children:Dt?(0,Aa.jsx)(Ht.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Aa.jsx)(Ht.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Dt&&(0,Aa.jsx)("div",{className:"space-y-2 pl-2",children:Be?.map(wa=>(0,Aa.jsx)(vt,{task:wa},wa.id))})]},K)}),F?.length>0&&(()=>{let K=d.has("no-epic");return(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.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:()=>ot("no-epic"),children:[(0,Aa.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Aa.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Aa.jsxs)("span",{className:"text-muted-foreground",children:["(",F?.length,")"]}),(0,Aa.jsx)("div",{className:"ml-auto",children:K?(0,Aa.jsx)(Ht.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Aa.jsx)(Ht.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!K&&(0,Aa.jsx)("div",{className:"space-y-2 pl-2",children:F?.map(Be=>(0,Aa.jsx)(vt,{task:Be},Be.id))})]})})(),k?.length===0&&(0,Aa.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},f.id)})]}),(0,Aa.jsx)(ni,{isOpen:x,onClose:()=>T(!1),onAddSprint:Ho})]})})]})};var An=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Ln=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})},xa=(e,t)=>{let o=new Date,a=new Date(e);if(t){let[r,i]=t.split(":");a.setHours(parseInt(r),parseInt(i))}return a<o},ya=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Hn=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Bn=({colleagues:e,onAddReminder:t,open:o,setOpen:a})=>{let[r,i]=(0,Zt.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[n,s]=(0,Zt.useState)(!1),m=d=>{if(d.preventDefault(),!e.find(y=>y?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),s(!0);return}s(!1);let v={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(v),a(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Zt.useEffect)(()=>{r.colleagueId&&s(!1)},[r.colleagueId]);let u=e.filter(Boolean);return(0,Aa.jsx)(Fe,{open:o,onOpenChange:a,children:(0,Aa.jsxs)(Ve,{className:"max-w-2xl",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Ee,{children:"Add New Reminder"})}),(0,Aa.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Aa.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"title",children:"Title"}),(0,Aa.jsx)(te,{id:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"dueDate",children:"Due Date"}),(0,Aa.jsx)(te,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Aa.jsx)(te,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{className:`${n?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Aa.jsxs)(Ge,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,Aa.jsx)(Ue,{className:`${n?"text-destructive border-red-500":""}`,children:(0,Aa.jsx)(at,{className:`${n?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Aa.jsx)($e,{children:u.map(d=>(0,Aa.jsx)(me,{value:d.id.toString(),children:d.name},d.id))})]}),n&&(0,Aa.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Aa.jsxs)("div",{className:"space-y-2",children:[(0,Aa.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Aa.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Aa.jsx)(H,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Aa.jsxs)(Ge,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,Aa.jsx)(Ue,{children:(0,Aa.jsx)(at,{})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsx)(me,{value:"daily",children:"Daily"}),(0,Aa.jsx)(me,{value:"weekly",children:"Weekly"}),(0,Aa.jsx)(me,{value:"monthly",children:"Monthly"}),(0,Aa.jsx)(me,{value:"yearly",children:"Yearly"})]})]})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Aa.jsx)(te,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Aa.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",children:"Add Reminder"})]})]})]})})},Fn=({reminder:e,colleagues:t,onUpdateReminder:o,open:a,onClose:r})=>{let[i,n]=(0,Zt.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=u=>{u.preventDefault(),o(e.id.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},m=t.filter(Boolean);return(0,Aa.jsx)(Fe,{open:a,onOpenChange:r,children:(0,Aa.jsxs)(Ve,{className:"max-w-2xl",children:[(0,Aa.jsx)(ze,{children:(0,Aa.jsx)(Ee,{children:"Edit Reminder"})}),(0,Aa.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Aa.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"edit-title",children:"Title"}),(0,Aa.jsx)(te,{id:"edit-title",value:i.title,onChange:u=>n({...i,title:u.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"edit-description",children:"Description"}),(0,Aa.jsx)(Ne,{id:"edit-description",value:i.description||"",onChange:u=>n({...i,description:u.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Aa.jsx)(te,{id:"edit-dueDate",type:"date",value:i.dueDate,onChange:u=>n({...i,dueDate:u.target.value}),required:!0})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)(H,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Aa.jsx)(te,{id:"edit-dueTime",type:"time",value:i.dueTime,onChange:u=>n({...i,dueTime:u.target.value})})]})]}),(0,Aa.jsx)("div",{className:"space-y-2",children:(0,Aa.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Aa.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:i.isRecurring||!1,onChange:u=>n({...i,isRecurring:u.target.checked}),className:"rounded border-border"}),(0,Aa.jsx)(H,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Aa.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Aa.jsx)(D,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,Aa.jsx)(D,{type:"submit",children:"Save Changes"})]})]})]})})},On=({reminder:e,colleagues:t,onUpdateReminder:o,onDeleteReminder:a})=>{let[r,i]=(0,Zt.useState)(!1);if(!e||!e.id)return null;let n=xa(new Date(e.dueDate||""),e.dueTime||""),s=ya(new Date(e.dueDate||"")),m=Hn(new Date(e.dueDate||"")),u=()=>{o(e.id.toString(),{})},d=()=>s?"Today":m?"Tomorrow":An(new Date(e.dueDate||""));return(0,Aa.jsxs)(Aa.Fragment,{children:[(0,Aa.jsx)(Fn,{reminder:e,colleagues:t,onUpdateReminder:o,open:r,onClose:()=>i(!1)}),(0,Aa.jsx)(ue,{children:(0,Aa.jsx)(_t,{className:"p-4",children:(0,Aa.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Aa.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Aa.jsx)("button",{onClick:u,className:"Aa-1 text-primary hover:text-primary/80"}),(0,Aa.jsxs)("div",{className:"flex-1",children:[(0,Aa.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Aa.jsx)("h3",{children:e.title})}),(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Aa.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Aa.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Aa.jsx)(Ht.Calendar,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{className:n?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Aa.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Aa.jsx)(Ht.Clock,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:Ln(e.dueTime)})]}),(0,Aa.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Aa.jsx)(Ht.User,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Aa.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,Aa.jsx)(Ht.Edit2,{className:"h-4 w-4"})}),(0,Aa.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>a(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Vn=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:o,onUpdateReminder:a,onDeleteReminder:r})=>{let[i,n]=(0,Zt.useState)(e.filter(Boolean)),[s,m]=(0,Zt.useState)(t.filter(Boolean)),[u,d]=(0,Zt.useState)("all"),[g,v]=(0,Zt.useState)(""),[y,x]=(0,Zt.useState)(!1);(0,Zt.useEffect)(()=>{n(e.filter(Boolean))},[e]),(0,Zt.useEffect)(()=>{m(t.filter(Boolean))},[t]);let T=I=>{if(!I.title){console.error("Invalid reminder data:",I);return}let ae={...I,id:Date.now(),createdAt:new Date().toISOString()};n(Q=>[...Q,ae]),o?.(I)},p=(I,ae)=>{if(!I){console.error("No reminder ID provided for update");return}n(Q=>Q.map(j=>j?.id.toString()===I?{...j,...ae}:j)),a?.(I,ae)},b=I=>{if(!I){console.error("No reminder ID provided for deletion");return}n(ae=>ae.filter(Q=>Q?.id.toString()!==I)),r?.(I)},N=i.filter(I=>{if(!I)return!1;if(g){let ae=g.toLowerCase();if(!(I.title.toLowerCase().includes(ae)||I.description?.toLowerCase().includes(ae)))return!1}switch(u){case"pending":case"completed":case"overdue":return xa(new Date(I.dueDate||""),I.dueTime||"");case"today":return ya(new Date(I.dueDate||""));default:return!0}}).sort((I,ae)=>{if(!I||!ae)return 0;let Q={high:3,medium:2,low:1},j=0;return j!==0?j:new Date(I.dueDate||"").getTime()-new Date(ae.dueDate||"").getTime()}),S={total:i.filter(Boolean).length,overdue:i.filter(I=>I&&xa(new Date(I.dueDate||""),I.dueTime||"")).length,today:i.filter(I=>I&&ya(new Date(I.dueDate||""))).length},oe=s.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,Aa.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Aa.jsx)(Ct,{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:()=>{x(!0)}}}),(0,Aa.jsxs)("div",{className:"h-full bg-background",children:[(0,Aa.jsx)(Bn,{colleagues:s,onAddReminder:T,open:y,setOpen:x}),(0,Aa.jsxs)("div",{className:"p-6",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Aa.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Aa.jsxs)(D,{className:"flex items-center space-x-2",onClick:()=>x(!0),children:[(0,Aa.jsx)(Ht.Plus,{className:"h-4 w-4"}),(0,Aa.jsx)("span",{children:"Add Reminder"})]})]}),(0,Aa.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-foreground",children:S.total}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-primary",children:S.overdue}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-success",children:S.today}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-destructive",children:S.overdue}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Aa.jsxs)(ue,{className:"p-4",children:[(0,Aa.jsx)("div",{className:"text-2xl font-bold text-warning",children:S.today}),(0,Aa.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Aa.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Aa.jsx)("div",{className:"flex-1",children:(0,Aa.jsx)(te,{placeholder:"Search reminders...",value:g,onChange:I=>v(I.target.value),className:"max-w-md"})}),(0,Aa.jsxs)(Ge,{value:u,onValueChange:I=>d(I),children:[(0,Aa.jsx)(Ue,{className:"w-40",children:(0,Aa.jsx)(at,{})}),(0,Aa.jsxs)($e,{children:[(0,Aa.jsxs)(me,{value:"all",children:["All (",S.total,")"]}),(0,Aa.jsxs)(me,{value:"overdue",children:["Overdue (",S.overdue,")"]}),(0,Aa.jsxs)(me,{value:"overdue",children:["Overdue (",S.overdue,")"]}),(0,Aa.jsxs)(me,{value:"today",children:["Today (",S.today,")"]})]})]})]}),(0,Aa.jsx)("div",{className:"space-y-4",children:N.length===0?(0,Aa.jsxs)(ue,{className:"p-8 text-center",children:[(0,Aa.jsx)("div",{className:"text-muted-foreground",children:g||u!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&u==="all"&&(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground/60 Aa-2",children:"Create your first reminder to get started"})]}):N.map(I=>I&&(0,Aa.jsx)(On,{reminder:I,colleagues:s,onUpdateReminder:p,onDeleteReminder:b},I.id))})]})]})]})};var zn=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:n,onUpdateEpic:s,onDeleteEpic:m})=>{let[u,d]=(0,Zt.useState)(t),[g,v]=(0,Zt.useState)(null),[y,x]=(0,Zt.useState)(null),[T,p]=(0,Zt.useState)({}),[b,O]=(0,Zt.useState)(0),[N,S]=(0,Zt.useState)(!1),[oe,I]=(0,Zt.useState)(!1),[ae,Q]=(0,Zt.useState)(null),j=(0,Zt.useRef)(null),xe=(0,Zt.useRef)(null);(0,Zt.useEffect)(()=>{d(t)},[t]),(0,Zt.useEffect)(()=>{let w=()=>{if(j.current){let ft=j.current.offsetHeight;O(ft)}};w();let re=new ResizeObserver(w);j.current&&re.observe(j.current);let Oe=()=>{setTimeout(w,100)};return window.addEventListener("storage",Oe),()=>{re.disconnect(),window.removeEventListener("storage",Oe)}},[]),(0,Zt.useEffect)(()=>{let w=setTimeout(()=>{j.current&&O(j.current.offsetHeight)},300);return()=>clearTimeout(w)},[y]);let we=w=>{v(w)},$=w=>{w.preventDefault()},je=(w,re)=>{w.preventDefault(),g&&Ie(g.epic).toString()!==re&&(a(g.id.toString(),{epic:Number(re)}),v(null))},He=w=>e.filter(re=>Ie(re.epic).toString()===w),P=w=>{x(w.id.toString()),p({name:w.name,description:w.description,confidence:w.confidence,phase:w.phase})},W=async()=>{y&&T.name&&(await s(y.toString(),T),d(w=>w.map(re=>re.id.toString()===y?{...re,...T}:re)),x(null),p({}))},ee=()=>{x(null),p({})},Te=async w=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await m(w),d(re=>re.filter(Oe=>Oe.id.toString()!==w)))},ie=w=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[w]||`Phase ${w}`,X=w=>{switch(w){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,Aa.jsxs)(Aa.Fragment,{children:[(0,Aa.jsxs)("div",{ref:xe,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Aa.jsx)("div",{ref:j,className:"flex-shrink-0",children:(0,Aa.jsx)(Ct,{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:()=>S(!0)}})}),(0,Aa.jsx)("div",{className:"flex-1 min-h-0 Aa-8",children:(0,Aa.jsx)("div",{className:"h-full overflow-y-auto",style:{height:b>0?`calc(100vh - ${b+120}px)`:"calc(100vh - 12rem)"},children:(0,Aa.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:u.map(w=>{let re=He(w.id.toString()),Oe=re.reduce((pe,ot)=>pe+(ot.storyPoints||0),0),ft=b>0?`calc(100vh - ${b+200}px)`:"calc(100vh - 14rem)";return(0,Aa.jsxs)(ue,{className:`flex flex-col ${y===w.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:y===w.id.toString()?"auto":ft,minHeight:"400px"},onDragOver:$,onDrop:pe=>je(pe,w.id.toString()),children:[(0,Aa.jsx)("div",{className:"p-4 border-b border-border",children:y===w.id.toString()?(0,Aa.jsxs)("div",{className:"space-y-4",children:[(0,Aa.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Aa.jsx)(te,{value:T.name||"",onChange:pe=>p({...T,name:pe.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Aa.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:W,className:"p-1 h-8 w-8",children:(0,Aa.jsx)(Ht.Check,{className:"h-4 w-4"})}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:ee,className:"p-1 h-8 w-8",children:(0,Aa.jsx)(Ht.X,{className:"h-4 w-4"})})]})]}),(0,Aa.jsx)(Ne,{value:T.description||"",onChange:pe=>p({...T,description:pe.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Aa.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Aa.jsxs)("select",{value:T.confidence||w.confidence,onChange:pe=>p({...T,confidence:pe.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,Aa.jsx)("option",{value:"low",children:"Low"}),(0,Aa.jsx)("option",{value:"medium",children:"Medium"}),(0,Aa.jsx)("option",{value:"high",children:"High"})]})]}),(0,Aa.jsxs)("div",{children:[(0,Aa.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Aa.jsx)("select",{value:T.phase?.toString()||w.phase.toString(),onChange:pe=>p({...T,phase:parseInt(pe.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(pe=>(0,Aa.jsxs)("option",{value:pe.toString(),children:["Phase ",pe]},pe))})]})]})]}):(0,Aa.jsxs)(Aa.Fragment,{children:[(0,Aa.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Aa.jsx)("div",{className:`w-4 h-4 rounded-full ${w.color}`}),(0,Aa.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:w.name}),(0,Aa.jsxs)("div",{className:"flex gap-1",children:[(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>P(w),className:"p-1 h-8 w-8",children:(0,Aa.jsx)(Ht.Edit2,{className:"h-3 w-3"})}),(0,Aa.jsx)(D,{size:"sm",variant:"ghost",onClick:()=>Te(w.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Aa.jsx)(Ht.Trash2,{className:"h-3 w-3"})})]})]}),(0,Aa.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Aa.jsxs)(le,{className:`text-xs ${X(w.confidence)}`,children:[w.confidence," confidence"]}),(0,Aa.jsxs)(le,{variant:"outline",className:"text-xs",children:["Phase ",w.phase]}),(0,Aa.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[re.length," tasks"]}),(0,Aa.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Oe," pts"]})]}),w.description&&(0,Aa.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:w.description}),(0,Aa.jsxs)(D,{onClick:()=>{I(!0),Q(w)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Aa.jsx)(Ht.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Aa.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Aa.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${g?"border-primary bg-primary/10":"border-border"}`,children:re.length===0?(0,Aa.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,Aa.jsx)(Ht.Move,{className:"h-8 w-8 mb-2"}),(0,Aa.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):re.map(pe=>(0,Aa.jsx)(jt,{task:pe,epic:w,onDragStart:we,onTaskClick:r,isCompact:!0},pe.id))})})]},w.id)})})})})]}),(0,Aa.jsx)(Io,{isOpen:N,onClose:()=>S(!1),onAddEpic:n}),(0,Aa.jsx)(vo,{isOpen:oe,onClose:()=>I(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:ae?.id.toString()||"",sprints:o})]})};0&&(module.exports={DCProjectCard,EpicsView,KanbanBoardView,PlanningView,TasksView});