cortex-react-components 2.26.2 → 2.26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GTZJWMZR.mjs → chunk-5MMNC65L.mjs} +1 -1
- package/dist/{chunk-GHOL5L32.mjs → chunk-7BYNW77I.mjs} +1 -1
- package/dist/{chunk-C4RWEPVF.mjs → chunk-7MPZOMXK.mjs} +1 -1
- package/dist/{chunk-75F3LJMX.mjs → chunk-AABB4TFO.mjs} +1 -1
- package/dist/chunk-AN744MXS.mjs +9 -0
- package/dist/{chunk-RGOKBIQ5.mjs → chunk-CC57QZMB.mjs} +1 -1
- package/dist/{chunk-LJXTXROJ.mjs → chunk-EM4CGGGV.mjs} +1 -1
- package/dist/{chunk-AJQHGVZ5.mjs → chunk-FB5PBKLV.mjs} +1 -1
- package/dist/{chunk-TVTTUSWM.mjs → chunk-FBEHQRZ4.mjs} +1 -1
- package/dist/{chunk-2SQVMYDK.mjs → chunk-FR4X2HHQ.mjs} +1 -1
- package/dist/{chunk-KQB6MFFS.mjs → chunk-HLRMUJPL.mjs} +1 -1
- package/dist/{chunk-2HKAJ4TZ.mjs → chunk-HTS3KCJL.mjs} +1 -1
- package/dist/{chunk-3Y7QG6VP.mjs → chunk-IISYRLNU.mjs} +1 -1
- package/dist/{chunk-6UDBIRMT.mjs → chunk-IO5ZSALG.mjs} +1 -1
- package/dist/{chunk-NINFDOV5.mjs → chunk-ITNR7N47.mjs} +1 -1
- package/dist/{chunk-EM3T2XYC.mjs → chunk-J3VJUPR7.mjs} +1 -1
- package/dist/{chunk-FE7ZGUPU.mjs → chunk-JU4TJYSZ.mjs} +1 -1
- package/dist/{chunk-RJGYVDOU.mjs → chunk-MU47F4UR.mjs} +1 -1
- package/dist/{chunk-WIRQ5IRT.mjs → chunk-NDBSSX6Q.mjs} +1 -1
- package/dist/{chunk-3MEOSYPN.mjs → chunk-NZJ7VVG6.mjs} +1 -1
- package/dist/{chunk-XDELWNND.mjs → chunk-OP6ZWZIM.mjs} +1 -1
- package/dist/{chunk-ZEALRBXW.mjs → chunk-OVZKO3Z5.mjs} +1 -1
- package/dist/{chunk-3HNU2NYP.mjs → chunk-QDP657UR.mjs} +1 -1
- package/dist/{chunk-36UEU4CT.mjs → chunk-RWHPQAWZ.mjs} +1 -1
- package/dist/{chunk-2BRDNDUB.mjs → chunk-SME3D72Q.mjs} +1 -1
- package/dist/{chunk-3NRXQBBS.mjs → chunk-TIIYFAV6.mjs} +1 -1
- package/dist/{chunk-7R47MHQE.mjs → chunk-TQKXHMD7.mjs} +1 -1
- package/dist/{chunk-CXOVEABI.mjs → chunk-VNKGAW4K.mjs} +1 -1
- package/dist/{chunk-GVDM4RRN.mjs → chunk-WRCRZUGO.mjs} +1 -1
- package/dist/{chunk-5MWZTJYP.mjs → chunk-YH72WKGC.mjs} +1 -1
- package/dist/{chunk-K4DQ5KUH.mjs → chunk-ZA423OPA.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.js +6 -6
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.js +6 -6
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/index.js +6 -6
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.js +6 -6
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/Views/index.js +6 -6
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/file-edit.js +6 -6
- package/dist/components/Foundary/file-edit.mjs +1 -1
- package/dist/components/Foundary/index.js +6 -6
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Foundary/types.d.ts +18 -7
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/FileView.js +6 -6
- package/dist/components/Projects/FileView.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.js +6 -6
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.js +6 -6
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.js +6 -6
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/TaskDetailsModal.js +6 -6
- package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
- package/dist/components/Projects/file-list.js +6 -6
- package/dist/components/Projects/file-list.mjs +1 -1
- package/dist/components/Projects/index.js +6 -6
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/index.js +6 -6
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +19 -19
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +21 -21
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- 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 Ca=Object.create;var Lt=Object.defineProperty;var Na=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Sa=Object.getPrototypeOf,Da=Object.prototype.hasOwnProperty;var Pa=(e,t)=>{for(var o in t)Lt(e,o,{get:t[o],enumerable:!0})},Io=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ta(t))!Da.call(e,a)&&a!==o&&Lt(e,a,{get:()=>t[a],enumerable:!(r=Na(t,a))||r.enumerable});return e};var X=(e,t,o)=>(o=e!=null?Ca(Sa(e)):{},Io(t||!e||!e.__esModule?Lt(o,"default",{value:e,enumerable:!0}):o,e)),ka=e=>Io(Lt({},"__esModule",{value:!0}),e);var qi={};Pa(qi,{KanbanBoardView:()=>Xi});module.exports=ka(qi);var _=X(require("react"));var zo=require("class-variance-authority");var Uo=require("clsx");var oo="-",Ra=e=>{let t=Ia(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let s=n.split(oo);return s[0]===""&&s.length!==1&&s.shift(),Lo(s,t)||Ma(n)},getConflictingClassGroupIds:(n,s)=>{let d=o[n]||[];return s&&r[n]?[...d,...r[n]]:d}}},Lo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?Lo(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let i=e.join(oo);return t.validators.find(({validator:n})=>n(i))?.classGroupId},Eo=/^\[(.+)\]$/,Ma=e=>{if(Eo.test(e)){let t=Eo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ia=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Aa(Object.entries(e.classGroups),o).forEach(([i,n])=>{to(n,r,i,t)}),r},to=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let i=a===""?t:Ao(t,a);i.classGroupId=o;return}if(typeof a=="function"){if(Ea(a)){to(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([i,n])=>{to(n,Ao(t,i),o,r)})})},Ao=(e,t)=>{let o=e;return t.split(oo).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Ea=e=>e.isThemeGetter,Aa=(e,t)=>t?e.map(([o,r])=>{let a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([n,s])=>[t+n,s])):i);return[o,a]}):e,La=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(i,n)=>{o.set(i,n),t++,t>e&&(t=0,r=o,o=new Map)};return{get(i){let n=o.get(i);if(n!==void 0)return n;if((n=r.get(i))!==void 0)return a(i,n),n},set(i,n){o.has(i)?o.set(i,n):a(i,n)}}},Ho="!",Ha=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,a=t[0],i=t.length,n=s=>{let d=[],p=0,l=0,m;for(let c=0;c<s.length;c++){let f=s[c];if(p===0){if(f===a&&(r||s.slice(c,c+i)===t)){d.push(s.slice(l,c)),l=c+i;continue}if(f==="/"){m=c;continue}}f==="["?p++:f==="]"&&p--}let u=d.length===0?s:s.substring(l),h=u.startsWith(Ho),v=h?u.substring(1):u,R=m&&m>l?m-l:void 0;return{modifiers:d,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:R}};return o?s=>o({className:s,parseClassName:n}):n},Fa=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},Ba=e=>({cache:La(e.cacheSize),parseClassName:Ha(e),...Ra(e)}),Oa=/\s+/,Va=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],n=e.trim().split(Oa),s="";for(let d=n.length-1;d>=0;d-=1){let p=n[d],{modifiers:l,hasImportantModifier:m,baseClassName:u,maybePostfixModifierPosition:h}=o(p),v=!!h,R=r(v?u.substring(0,h):u);if(!R){if(!v){s=p+(s.length>0?" "+s:s);continue}if(R=r(u),!R){s=p+(s.length>0?" "+s:s);continue}v=!1}let c=Fa(l).join(":"),f=m?c+Ho:c,E=f+R;if(i.includes(E))continue;i.push(E);let g=a(R,v);for(let S=0;S<g.length;++S){let Q=g[S];i.push(f+Q)}s=p+(s.length>0?" "+s:s)}return s};function Ua(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Fo(t))&&(r&&(r+=" "),r+=o);return r}var Fo=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Fo(e[r]))&&(o&&(o+=" "),o+=t);return o};function za(e,...t){let o,r,a,i=n;function n(d){let p=t.reduce((l,m)=>m(l),e());return o=Ba(p),r=o.cache.get,a=o.cache.set,i=s,s(d)}function s(d){let p=r(d);if(p)return p;let l=Va(d,o);return a(d,l),l}return function(){return i(Ua.apply(null,arguments))}}var W=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Bo=/^\[(?:([a-z-]+):)?(.+)\]$/i,$a=/^\d+\/\d+$/,_a=new Set(["px","full","screen"]),Ga=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wa=/\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$/,Ka=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ja=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Za=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$e=e=>lt(e)||_a.has(e)||$a.test(e),je=e=>ct(e,"length",oi),lt=e=>!!e&&!Number.isNaN(Number(e)),eo=e=>ct(e,"number",lt),vt=e=>!!e&&Number.isInteger(Number(e)),Ja=e=>e.endsWith("%")&<(e.slice(0,-1)),P=e=>Bo.test(e),Ze=e=>Ga.test(e),Xa=new Set(["length","size","percentage"]),qa=e=>ct(e,Xa,Oo),Ya=e=>ct(e,"position",Oo),Qa=new Set(["image","url"]),ei=e=>ct(e,Qa,ai),ti=e=>ct(e,"",ri),bt=()=>!0,ct=(e,t,o)=>{let r=Bo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},oi=e=>Wa.test(e)&&!Ka.test(e),Oo=()=>!1,ri=e=>ja.test(e),ai=e=>Za.test(e);var ii=()=>{let e=W("colors"),t=W("spacing"),o=W("blur"),r=W("brightness"),a=W("borderColor"),i=W("borderRadius"),n=W("borderSpacing"),s=W("borderWidth"),d=W("contrast"),p=W("grayscale"),l=W("hueRotate"),m=W("invert"),u=W("gap"),h=W("gradientColorStops"),v=W("gradientColorStopPositions"),R=W("inset"),c=W("margin"),f=W("opacity"),E=W("padding"),g=W("saturate"),S=W("scale"),Q=W("sepia"),Ce=W("skew"),Me=W("space"),de=W("translate"),me=()=>["auto","contain","none"],ge=()=>["auto","hidden","clip","visible","scroll"],be=()=>["auto",P,t],V=()=>[P,t],Be=()=>["",$e,je],ze=()=>["auto",lt,P],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",P],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[lt,P];return{cacheSize:500,separator:":",theme:{colors:[bt],spacing:[$e,je],blur:["none","",Ze,P],brightness:q(),borderColor:[e],borderRadius:["none","","full",Ze,P],borderSpacing:V(),borderWidth:Be(),contrast:q(),grayscale:K(),hueRotate:q(),invert:K(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[Ja,je],inset:be(),margin:be(),opacity:q(),padding:V(),saturate:q(),scale:q(),sepia:K(),skew:q(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",P]}],container:["container"],columns:[{columns:[Ze]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:[...x(),P]}],overflow:[{overflow:ge()}],"overflow-x":[{"overflow-x":ge()}],"overflow-$o":[{"overflow-$o":ge()}],overscroll:[{overscroll:me()}],"overscroll-x":[{"overscroll-x":me()}],"overscroll-$o":[{"overscroll-$o":me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-$o":[{"inset-$o":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",vt,P]}],basis:[{basis:be()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",P]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",vt,P]}],"grid-cols":[{"grid-cols":[bt]}],"col-start-end":[{col:["auto",{span:["full",vt,P]},P]}],"col-start":[{"col-start":ze()}],"col-end":[{"col-end":ze()}],"grid-rows":[{"grid-rows":[bt]}],"row-start-end":[{row:["auto",{span:[vt,P]},P]}],"row-start":[{"row-start":ze()}],"row-end":[{"row-end":ze()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",P]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",P]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-$o":[{"gap-$o":[u]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[c]}],mx:[{mx:[c]}],my:[{my:[c]}],ms:[{ms:[c]}],me:[{me:[c]}],mt:[{mt:[c]}],yt:[{yt:[c]}],mb:[{mb:[c]}],ml:[{ml:[c]}],"space-x":[{"space-x":[Me]}],"space-x-reverse":["space-x-reverse"],"space-$o":[{"space-$o":[Me]}],"space-$o-reverse":["space-$o-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",P,t]}],"min-w":[{"min-w":[P,t,"min","max","fit"]}],"max-w":[{"max-w":[P,t,"none","full","min","max","fit","prose",{screen:[Ze]},Ze]}],h:[{h:[P,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[P,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[P,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[P,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ze,je]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",eo]}],"font-family":[{font:[bt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",P]}],"line-clamp":[{"line-clamp":["none",lt,eo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$e,P]}],"list-image":[{"list-image":["none",P]}],"list-style-type":[{list:["none","disc","decimal",P]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$e,je]}],"underline-offset":[{"underline-offset":["auto",$e,P]}],"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:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",P]}],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",P]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),Ya]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","$o","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",qa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ei]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-$o":[{"rounded-$o":[i]}],"rounded-$o":[{"rounded-$o":[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-$o":[{"border-$o":[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-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-$o":[{"divide-$o":[s]}],"divide-$o-reverse":["divide-$o-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:U()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-$o":[{"border-$o":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[$e,P]}],"outline-w":[{outline:[$e,je]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Be()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[$e,je]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ze,ti]}],"shadow-color":[{shadow:[bt]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ze,P]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[m]}],saturate:[{saturate:[g]}],sepia:[{sepia:[Q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-$o":[{"border-spacing-$o":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",P]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",P]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",P]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-$o":[{"scale-$o":[S]}],rotate:[{rotate:[vt,P]}],"translate-x":[{"translate-x":[de]}],"translate-$o":[{"translate-$o":[de]}],"skew-x":[{"skew-x":[Ce]}],"skew-$o":[{"skew-$o":[Ce]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",P]}],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","$o-resize","nw-resize","$o-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",P]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","$o","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-yt":[{"scroll-yt":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","$o","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-$o":[{"touch-pan":["$o","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",P]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$e,je,eo]}],stroke:[{stroke:[e,"none"]}],$o:["$o-only","not-$o-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-$o"],overscroll:["overscroll-x","overscroll-$o"],inset:["inset-x","inset-$o","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-$o":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-$o"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","yt","mb","ml"],mx:["yt","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-$o","rounded-$o","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-$o","rounded-$o"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-$o"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-$o":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-$o":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-yt","scroll-mb","scroll-ml"],"scroll-mx":["scroll-yt","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-$o","touch-pz"],"touch-x":["touch"],"touch-$o":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Vo=za(ii);function b(...e){return Vo((0,Uo.clsx)(e))}var $o=require("react/jsx-runtime"),ni=(0,zo.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 Ne({className:e,variant:t,...o}){return(0,$o.jsx)("div",{className:b(ni({variant:t}),e),...o})}var Ye=X(require("react"));var dt=Ye.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:b("rounded-xl border bg-card text-card-foreground shadow",e),...t}));dt.displayName="Card";var si=Ye.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:b("flex flex-col space-$o-1.5 p-6",e),...t}));si.displayName="CardHeader";var li=Ye.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:b("font-semibold leading-none tracking-tight",e),...t}));li.displayName="CardTitle";var ci=Ye.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:b("text-sm text-muted-foreground",e),...t}));ci.displayName="CardDescription";var di=Ye.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:b("p-6 pt-0",e),...t}));di.displayName="CardContent";var mi=Ye.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:b("flex items-center p-6 pt-0",e),...t}));mi.displayName="CardFooter";var _o=({title:e,status:t,taskCount:o,children:r,onDrop:a,isCompact:i=!1,height:n})=>{let s=l=>{l.preventDefault()},d=l=>{l.preventDefault(),a(t)};return(0,$o.jsxs)(dt,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"lg:max-w-xs":""}`,style:{height:n||"calc(100vh - 350px)"},onDragOver:s,onDrop:d,children:[(0,$o.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,$o.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,$o.jsx)(Ne,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,$o.jsx)("div",{className:"flex-1 overflow-$o-auto space-$o-4 min-h-0",children:r})]})};var Te=require("lucide-react"),ro=({task:e,epic:t,onDragStart:o,onTaskClick:r,isCompact:a=!1})=>{let i=l=>{o(e)},n=()=>{r(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"}},d=()=>{switch(e.type){case"story":return(0,$o.jsx)(Te.BookOpen,{className:"h-3 w-3"});case"bug":return(0,$o.jsx)(Te.Bug,{className:"h-3 w-3"});case"spike":return(0,$o.jsx)(Te.Zap,{className:"h-3 w-3"});case"task":default:return(0,$o.jsx)(Te.AlertCircle,{className:"h-3 w-3"})}},p=()=>{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 a?(0,$o.jsx)(dt,{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,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:d()}),(0,$o.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,$o.jsxs)(dt,{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,$o.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,$o.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[d(),(0,$o.jsx)("span",{className:"capitalize",children:e.type})]}),(0,$o.jsxs)("div",{className:"flex gap-1",children:[(0,$o.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,$o.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,$o.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,$o.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,$o.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,$o.jsx)(Te.User,{className:"h-4 w-4"}),(0,$o.jsx)("span",{children:e.assignee?.value?.name})]}),(0,$o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,$o.jsx)(Te.Calendar,{className:"h-4 w-4"}),(0,$o.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var yt=require("react");var ht=X(require("react")),ae=X(require("@radix-ui/react-dialog"));var Se=ae.Root;var ao=ae.Portal;var Ht=ht.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(ae.Overlay,{ref:o,className:b("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}));Ht.displayName=ae.Overlay.displayName;var Ie=ht.forwardRef(({className:e,children:t,...o},r)=>(0,$o.jsxs)(ao,{children:[(0,$o.jsx)(Ht,{}),(0,$o.jsxs)(ae.Content,{ref:r,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-$o-[-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,$o.jsxs)(ae.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,$o.jsx)(Te.X,{className:"h-4 w-4"}),(0,$o.jsx)("span",{className:"$o-only",children:"Close"})]})]})]}));Ie.displayName=ae.Content.displayName;var Ee=({className:e,...t})=>(0,$o.jsx)("div",{className:b("flex flex-col space-$o-1.5 text-center sm:text-left",e),...t});Ee.displayName="DialogHeader";var xt=({className:e,...t})=>(0,$o.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xt.displayName="DialogFooter";var xe=ht.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(ae.Title,{ref:o,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));xe.displayName=ae.Title.displayName;var pi=ht.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(ae.Description,{ref:o,className:b("text-sm text-muted-foreground",e),...t}));pi.displayName=ae.Description.displayName;var Wo=require("@radix-ui/react-slot"),jo=X(require("react")),Zo=(0,zo.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),A=jo.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...a},i)=>(0,$o.jsx)(e?Wo.Slot:"button",{className:b(Zo({className:t,size:o,variant:r})),ref:i,...a}));A.displayName="Button";var Xo=X(require("react"));var ue=Xo.forwardRef(({className:e,type:t,...o},r)=>(0,$o.jsx)("input",{type:t,className:b("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:r,...o}));ue.displayName="Input";var Yo=X(require("react")),Ae=Yo.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("textarea",{className:b("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}));Ae.displayName="Textarea";var M=X(require("@radix-ui/react-select")),Je=X(require("react")),Le=M.Root;var ot=M.Value,De=Je.forwardRef(({children:e,className:t,...o},r)=>(0,$o.jsxs)(M.Trigger,{className:b("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:r,...o,children:[e,(0,$o.jsx)(M.Icon,{asChild:!0,children:(0,$o.jsx)(Te.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));De.displayName=M.Trigger.displayName;var er=Je.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(M.ScrollUpButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,$o.jsx)(Te.ChevronUp,{className:"h-4 w-4"})}));er.displayName=M.ScrollUpButton.displayName;var tr=Je.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(M.ScrollDownButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,$o.jsx)(Te.ChevronDown,{className:"h-4 w-4"})}));tr.displayName=M.ScrollDownButton.displayName;var Pe=Je.forwardRef(({children:e,className:t,position:o="popper",...r},a)=>(0,$o.jsx)(M.Portal,{children:(0,$o.jsxs)(M.Content,{className:b("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-$o-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-$o-1",t),position:o,ref:a,...r,children:[(0,$o.jsx)(er,{}),(0,$o.jsx)(M.Viewport,{className:b("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,$o.jsx)(tr,{})]})}));Pe.displayName=M.Content.displayName;var ui=Je.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(M.Label,{className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));ui.displayName=M.Label.displayName;var fe=Je.forwardRef(({children:e,className:t,...o},r)=>(0,$o.jsxs)(M.Item,{className:b("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:r,...o,children:[(0,$o.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$o.jsx)(M.ItemIndicator,{children:(0,$o.jsx)(Te.Check,{className:"h-4 w-4"})})}),(0,$o.jsx)(M.ItemText,{children:e})]}));fe.displayName=M.Item.displayName;var fi=Je.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(M.Separator,{className:b("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));fi.displayName=M.Separator.displayName;var or=X(require("react")),io=X(require("@radix-ui/react-label"));var gi=(0,zo.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=or.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(io.Root,{ref:o,className:b(gi(),e),...t}));L.displayName=io.Root.displayName;var rt=X(require("react")),mt=X(require("@radix-ui/react-toggle-group"));var ir=X(require("react")),no=X(require("@radix-ui/react-toggle"));var so=(0,zo.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"}}),vi=ir.forwardRef(({className:e,variant:t,size:o,...r},a)=>(0,$o.jsx)(no.Root,{ref:a,className:b(so({variant:t,size:o,className:e})),...r}));vi.displayName=no.Root.displayName;var lr=rt.createContext({size:"default",variant:"default"}),at=rt.forwardRef(({className:e,variant:t,size:o,children:r,...a},i)=>(0,$o.jsx)(mt.Root,{ref:i,className:b("flex items-center justify-center gap-1",e),...a,children:(0,$o.jsx)(lr.Provider,{value:{variant:t,size:o},children:r})}));at.displayName=mt.Root.displayName;var it=rt.forwardRef(({className:e,children:t,variant:o,size:r,...a},i)=>{let n=rt.useContext(lr);return(0,$o.jsx)(mt.Item,{ref:i,className:b(so({variant:n.variant||o,size:n.size||r}),e),...a,children:t})});it.displayName=mt.Item.displayName;var bi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Te.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Te.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Te.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Te.Zap}],hi=[{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"}],cr=({isOpen:e,onClose:t,onAddTask:o,epics:r,sprints:a,assignees:i,defaultEpicId:n})=>{let[s,d]=(0,yt.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,yt.useEffect)(()=>{e&&n&&d(m=>({...m,epic:n}))},[e,n]),(0,yt.useEffect)(()=>{e&&d({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"none",assignee:""})},[e]);let p=m=>{m.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}),d({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"",assignee:""}),t())},l=(m,u)=>{d(h=>({...h,[m]:u}))};return(0,$o.jsx)(Se,{open:e,onOpenChange:t,children:(0,$o.jsxs)(Ie,{className:"sm:max-w-md",children:[(0,$o.jsx)(Ee,{children:(0,$o.jsx)(xe,{children:"Add New Task"})}),(0,$o.jsxs)("form",{onSubmit:p,className:"space-$o-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"name",children:"Task Title"}),(0,$o.jsx)(ue,{id:"name",value:s.name,onChange:m=>l("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"description",children:"Description"}),(0,$o.jsx)(Ae,{id:"description",value:s.description,onChange:m=>l("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Type"}),(0,$o.jsx)(at,{type:"single",value:s.type||"",onValueChange:m=>m&&l("type",m),children:bi.map(m=>{let u=m.icon;return(0,$o.jsxs)(it,{value:m.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,$o.jsx)(u,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Priority"}),(0,$o.jsx)(at,{type:"single",value:s.priority||"",onValueChange:m=>m&&l("priority",m),children:hi.map(m=>(0,$o.jsx)(it,{value:m.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:m.label},m.value))})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"points",children:"Story Points"}),(0,$o.jsx)(ue,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:m=>l("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!n&&(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"epic",children:"Epic"}),(0,$o.jsxs)(Le,{value:s.epic,onValueChange:m=>l("epic",m),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(ot,{placeholder:"Select an epic"})}),(0,$o.jsx)(Pe,{children:r.map(m=>(0,$o.jsx)(fe,{value:m.id.toString(),children:(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.id))})]})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,$o.jsxs)(Le,{value:s.sprint,onValueChange:m=>l("sprint",m),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(ot,{placeholder:"Select a sprint"})}),(0,$o.jsxs)(Pe,{children:[(0,$o.jsx)(fe,{value:"none",children:"No Sprint"}),a.map(m=>(0,$o.jsx)(fe,{value:m.id.toString(),children:(0,$o.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"sprint",children:"Assignee"}),(0,$o.jsxs)(Le,{value:s.assignee,onValueChange:m=>l("assignee",m),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(ot,{placeholder:"Select an Assignee"})}),(0,$o.jsxs)(Pe,{children:[(0,$o.jsx)(fe,{value:"none",children:"No Assignee"}),i.map(m=>(0,$o.jsx)(fe,{value:m.id.toString(),children:(0,$o.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,$o.jsxs)(xt,{children:[(0,$o.jsx)(A,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,$o.jsx)(A,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var wt=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:a,className:i="",disabled:n=!1})=>{let[s,d]=(0,yt.useState)(!1),[p,l]=(0,yt.useState)(""),m=()=>{n||(d(!0),l(t))},u=async()=>{p!==t&&await a(e,p),d(!1)},h=v=>{v.key==="Enter"&&!r||v.key==="Enter"&&v.ctrlKey&&r?u():v.key==="Escape"&&(d(!1),l(""))};return(0,$o.jsxs)("div",{className:`space-$o-2 ${i}`,children:[(0,$o.jsx)(L,{children:o}),s?r?(0,$o.jsx)(Ae,{value:p,onChange:v=>l(v.target.value),onBlur:u,onKeyDown:h,autoFocus:!0,rows:4,className:"resize-none"}):(0,$o.jsx)(ue,{value:p,onChange:v=>l(v.target.value),onBlur:u,onKeyPress:h,autoFocus:!0,className:"text-lg font-medium"}):(0,$o.jsxs)("div",{onClick:m,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 ${r?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,$o.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,$o.jsx)(Te.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Bt=X(require("react")),Ge=X(require("@radix-ui/react-avatar"));var co=Bt.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(Ge.Root,{ref:o,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));co.displayName=Ge.Root.displayName;var xi=Bt.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(Ge.Image,{ref:o,className:b("aspect-square h-full w-full",e),...t}));xi.displayName=Ge.Image.displayName;var mo=Bt.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(Ge.Fallback,{ref:o,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));mo.displayName=Ge.Fallback.displayName;var pr=({comments:e,onAddComment:t})=>{let[o,r]=(0,yt.useState)(""),a=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{o.trim()&&(t(o),r(""))};return(0,$o.jsxs)("div",{className:"space-$o-4",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)(Te.MessageSquare,{className:"h-5 w-5"}),(0,$o.jsx)(L,{className:"text-lg font-medium",children:"Comments"}),(0,$o.jsx)(Ne,{variant:"secondary",children:e.length})]}),(0,$o.jsx)("div",{className:"space-$o-4 max-h-60 overflow-$o-auto",children:e.map(n=>(0,$o.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,$o.jsx)(co,{className:"h-8 w-8 mt-1",children:(0,$o.jsx)(mo,{className:"text-xs bg-muted text-muted-foreground",children:a(n.author)})}),(0,$o.jsxs)("div",{className:"flex-1",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,$o.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,$o.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,$o.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,$o.jsxs)("div",{className:"flex gap-2",children:[(0,$o.jsx)(Ae,{value:o,onChange:n=>r(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,$o.jsx)(A,{onClick:i,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,$o.jsx)(Te.Send,{className:"h-4 w-4"})})]})]})};var Ut=({label:e,value:t,onValueChange:o,options:r,showColor:a=!1,disabled:i=!1})=>{let[n,s]=(0,yt.useState)(!1),d=r.find(l=>l.value===t);return(0,$o.jsxs)("div",{className:"space-$o-1",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:e}),(0,$o.jsxs)(Le,{value:t,onValueChange:o,open:n,onOpenChange:l=>{i||s(l)},disabled:i,children:[(0,$o.jsx)(De,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,$o.jsxs)(Ne,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!n),children:[a&&d?.color&&(0,$o.jsx)("div",{className:`w-2 h-2 rounded-full ${d.color} yt-1`}),d?.label||"Select..."]})}),(0,$o.jsx)(Pe,{children:r.map(l=>(0,$o.jsx)(fe,{value:l.value,children:a&&l.color?(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var fr=({label:e,value:t,onValueChange:o,options:r,placeholder:a="Search...",allowCustomValue:i=!1,disabled:n=!1})=>{let[s,d]=(0,yt.useState)(!1),[p,l]=(0,yt.useState)(""),m=r.find(c=>c.value===t),u=r.filter(c=>c.label.toLowerCase().includes(p.toLowerCase())),h=c=>{o(c),d(!1),l("")},v=()=>{i&&p.trim()&&!r.find(c=>c.value===p.trim())&&(o(p.trim()),d(!1),l(""))};return(0,$o.jsxs)("div",{className:"space-$o-1",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:e}),(0,$o.jsxs)(Le,{value:t,onValueChange:h,open:s,onOpenChange:c=>{n||d(c)},disabled:n,children:[(0,$o.jsx)(De,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,$o.jsx)(Ne,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&d(!s),children:m?.label||t||"Select..."})}),(0,$o.jsxs)(Pe,{children:[(0,$o.jsx)("div",{className:"p-2",children:(0,$o.jsx)(ue,{placeholder:a,value:p,onChange:c=>l(c.target.value),onKeyDown:c=>{c.key==="Enter"&&i&&v()},className:"mb-2"})}),u.map(c=>(0,$o.jsx)(fe,{value:c.value,children:c.label},c.value)),i&&p.trim()&&!u.find(c=>c.value===p.trim())&&(0,$o.jsxs)(fe,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var pt=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var yi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Te.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Te.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Te.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Te.Zap}],wi=[{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 gr=({task:e,epics:t,sprints:o,lastUpdated:r,onUpdateTask:a,onClose:i,onDelete:n,isUpdating:s=!1,isDeleting:d=!1,deleteState:p="idle",teamMembers:l})=>{let[m,u]=(0,yt.useState)(e.storyPoints),h=(0,yt.useRef)(null),[v,R]=(0,yt.useState)(l);(0,yt.useEffect)(()=>{R(l)},[l]);let c=(0,yt.useCallback)((g,S)=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{a(g,S)},500)},[a]);(0,yt.useEffect)(()=>{c("storyPoints",m?.toString()||"1")},[m]);let f=g=>g.split(" ").map(S=>S[0]).join("").toUpperCase(),E=()=>p==="loading"?(0,$o.jsxs)(A,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,$o.jsx)(Te.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,$o.jsxs)(A,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,$o.jsx)(Te.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,$o.jsxs)(A,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,$o.jsx)(Te.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,$o.jsxs)(A,{onClick:n,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||d,children:[(0,$o.jsx)(Te.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,$o.jsxs)("div",{className:"flex flex-col h-full",children:[(0,$o.jsxs)("div",{className:"space-$o-4",style:{opacity:s?.6:1},children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Status"}),(0,$o.jsx)(Ut,{label:"",value:e.status,onValueChange:g=>a("status",g),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Type"}),(0,$o.jsx)(at,{type:"single",value:e.type||"",onValueChange:g=>g&&a("type",g),className:"grid grid-cols-2 gap-1",disabled:s,children:yi.map(g=>{let S=g.icon;return(0,$o.jsxs)(it,{value:g.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,$o.jsx)(S,{className:"h-3 w-3"}),g.label]},g.value)})})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,$o.jsx)(at,{type:"single",value:e.priority||"",onValueChange:g=>g&&a("priority",g),className:"grid grid-cols-3 gap-1",disabled:s,children:wi.map(g=>(0,$o.jsx)(it,{value:g.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:g.label},g.value))})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,$o.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:g=>{let S=Number(g.target.value);S<1?u(1):S>100?u(100):u(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,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,$o.jsx)(Ut,{label:"",value:pt(e.epic).toString(),onValueChange:g=>a("epic",g),options:(t||[]).map(g=>({value:g.id.toString(),label:g?.name,color:g.color})),showColor:!0,disabled:s})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,$o.jsx)(Ut,{label:"",value:pt(e.sprint).toString()||"none",onValueChange:g=>a("sprint",g==="none"?"":g),options:[{value:"none",label:"No Sprint"},...(o||[]).map(g=>({value:g.id.toString(),label:`${g?.name}`}))],disabled:s})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,$o.jsx)(fr,{label:"",value:e.assignee?.value?.name,onValueChange:g=>a("assignee",g),options:v.map(g=>({value:`${typeof g.email=="string"?"users":"digital-colleagues"}:${g.id}`,label:g?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,$o.jsxs)("div",{className:"mt-auto pt-4 space-$o-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(A,{onClick:i,variant:"outline",className:"w-full h-8 text-xs",disabled:s||d,children:"Close"}),E()]}),(0,$o.jsxs)("div",{className:"pt-4 border-t border-border space-$o-2",children:[(0,$o.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,$o.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,$o.jsx)(Te.User,{className:"h-3 w-3"}),(0,$o.jsx)("span",{children:"System"})]})]}),(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,$o.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,$o.jsx)(Te.Calendar,{className:"h-3 w-3"}),(0,$o.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,$o.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,$o.jsx)(Te.Clock,{className:"h-3 w-3"}),(0,$o.jsxs)("span",{children:[new Date(r).toLocaleDateString()," at"," ",new Date(r).toLocaleTimeString()]})]})]})]})]})]})};var So=require("motion/react");var oa=X(require("@radix-ui/react-dialog"));var $r=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),_r=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Gr=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Wr=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Kr=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),jr=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),Zr=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Zt=require("@payloadcms/richtext-lexical/lexical/list"),Jr=require("@payloadcms/richtext-lexical/lexical/rich-text"),Xr=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Ur=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),kt=require("@payloadcms/richtext-lexical/lexical/utils"),k=require("@payloadcms/richtext-lexical/lexical"),No=require("@payloadcms/richtext-lexical/lexical/selection");var Dr=require("@radix-ui/react-dialog"),Gt=require("@payloadcms/richtext-lexical/client");var fo=X(require("bson-objectid"));var br=require("@payloadcms/ui");var vr=X(require("react")),He=X(require("@radix-ui/react-tooltip"));var zt=He.Provider,$t=He.Root,_t=He.Trigger,Ct=vr.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,$o.jsx)(He.Portal,{children:(0,$o.jsx)(He.Content,{ref:r,sideOffset:t,className:b("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})}));Ct.displayName=He.Content.displayName;var Ci=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[a]=(0,Ur.useLexicalComposerContext)(),[i,n]=(0,yt.useState)(""),[s,d]=(0,yt.useState)(""),[p,l]=(0,yt.useState)(""),m=async c=>{console.log("fetchMedia",c)};(0,yt.useEffect)(()=>{typeof o=="string"?o.length===24?m(o):(n(o||""),l(R(v())),d(h()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),l(R(o.filesize)),d(o.mimeType?.split("/")[1]||""))},[]);let u=(0,yt.useCallback)(()=>{a.update(()=>{(0,k.$getNodeByKey)(r)?.remove()})},[a,r]),h=()=>{let c=e.data.value;return typeof c=="string"?c.split(";base64")[0]?.split("image/")[1]:""},v=()=>{let c=e.data.value;if(typeof c=="string"){let f=c.split(",")[1]?.length||0;return 4*Math.ceil(f/3)*.5624896334383812/1e3}return 0};function R(c){if(c>=1e6){let E=c/1e6;return`${E>=10?Math.round(E).toString():E.toFixed(1)} MB`}return`${Math.floor(c/1e3)} KB`}return(0,$o.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,$o.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,$o.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,$o.jsx)("div",{className:"flex-1",children:e.data.value?(0,$o.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,$o.jsx)(br.File,{})}),(0,$o.jsx)(zt,{children:(0,$o.jsxs)($t,{children:[(0,$o.jsxs)(_t,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,$o.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,$o.jsx)("button",{onClick:c=>{c.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,$o.jsx)(Te.X,{width:24,height:24,strokeWidth:1})})]}),(0,$o.jsx)(Ct,{children:(0,$o.jsx)("span",{children:"Remove image"})})]})})]}),(0,$o.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,$o.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,$o.jsx)("span",{children:p})]})]})})},wr=Ci;function Ni(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:ut({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Nt=class extends Gt.UploadNode{static importDOM(){return{img:()=>({conversion:Ni,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new fo.default().toHexString(),t.version=3);let o={id:t.id??new fo.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=ut(o);return r.setFormat?.(t.format),r}decorate(){return(0,$o.jsx)(wr,{data:this.__data,nodeKey:this.getKey()})}};function ut(e){return new Nt({data:e})}var Ti=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Si=e=>Ti?(e||window).getSelection():null,Us=(0,k.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),go=(0,k.createCommand)("INSERT_UPLOAD_COMMAND");function Pr({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,yt.useRef)(!1),[a,i]=(0,yt.useState)(!0),[n,s]=(0,yt.useState)(""),[d,p]=(0,yt.useState)(""),[l,m]=(0,yt.useState)(!1),[u,h]=(0,yt.useState)("left"),v=n==="",R=S=>{m(S.target.checked)},c=S=>{h(S.target.value)},f=S=>{let Q=new FileReader;Q.onload=function(){return typeof Q.result=="string"&&s(Q.result),""},S!==null&&S[0]&&Q.readAsDataURL(S[0])};(0,yt.useEffect)(()=>{r.current=!1;let S=Q=>{r.current=Q.altKey};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[e]),(0,yt.useEffect)(()=>{a||t()},[a]),(0,yt.useEffect)(()=>{i(o)},[o]);let E=({editor:S,relationTo:Q,replaceNodeKey:Ce,value:Me})=>{if(Ce)S.update(()=>{let de=(0,k.$getNodeByKey)(Ce);de&&de.replace(ut({id:"",fields:{},relationTo:"media",value:Me}))});else{let de=S.dispatchCommand(go,{fields:null,relationTo:"media",value:Me})}},g=()=>{E({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:d,src:n,showCaption:l,position:u}.src}),i(!1),t()};return(0,$o.jsx)(Se,{open:a,onOpenChange:S=>i(S),children:(0,$o.jsxs)(Ie,{children:[(0,$o.jsxs)(Ee,{children:[(0,$o.jsx)(xe,{children:"Upload Image"}),(0,$o.jsx)(Dr.DialogDescription,{children:"Description"})]}),(0,$o.jsxs)("div",{className:"",children:[(0,$o.jsx)("div",{style:{marginBottom:"1em"},children:(0,$o.jsx)(ue,{type:"file",onChange:S=>f(S.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,$o.jsx)("div",{style:{marginBottom:"1em"},children:(0,$o.jsx)(ue,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:S=>p(S.currentTarget.value),value:d,"data-test-id":"image-modal-alt-text-input"})}),(0,$o.jsx)(A,{"data-test-id":"image-modal-file-upload-btn",disabled:v,onClick:()=>g(),children:"Confirm"})]})]})})}function vo({captionsEnabled:e}){let[t]=(0,Ur.useLexicalComposerContext)();return(0,yt.useEffect)(()=>{if(!t.hasNodes([Gt.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,kt.mergeRegister)(t.registerCommand(k.DRAGSTART_COMMAND,o=>Di(o),k.COMMAND_PRIORITY_HIGH),t.registerCommand(k.DRAGOVER_COMMAND,o=>Pi(o),k.COMMAND_PRIORITY_LOW),t.registerCommand(k.DROP_COMMAND,o=>ki(o,t),k.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Di(e){if(!bo())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function Pi(e){return bo()?(kr(e)||e.preventDefault(),!0):!1}function ki(e,t){let o=bo();if(!o)return!1;if(e.preventDefault(),kr(e)){let r=Ri(e);o.remove();let a=(0,k.$createRangeSelection)();r!=null&&a.applyDOMRange(r),(0,k.$setSelection)(a)}return!0}function bo(){let e=(0,k.$getSelection)();if(!(0,k.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,Gt.$isUploadNode)(o)?o:null}function kr(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 Ri(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,a=Si(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&a!==null)a.collapse(e.rangeParent,e.rangeOffset||0),t=a.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Mi=()=>(0,$o.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,$o.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"})}),Rr=Mi;var Ii=()=>(0,$o.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,$o.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"})}),Mr=Ii;var Ei=()=>(0,$o.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,$o.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,$o.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Ir=Ei;var Ai=()=>(0,$o.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,$o.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,$o.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Er=Ai;var Li=()=>(0,$o.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,$o.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"})}),Ar=Li;var Hi=()=>(0,$o.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,$o.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"})}),Lr=Hi;var Hr=()=>(0,$o.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,$o.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"})}),Fr=()=>(0,$o.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,$o.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"})}),Br=()=>(0,$o.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,$o.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"})}),Or=()=>(0,$o.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,$o.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"})}),Vr=()=>(0,$o.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,$o.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 We=X(require("react")),I=X(require("@radix-ui/react-dropdown-menu")),ft=require("@radix-ui/react-icons");var Wt=I.Root,Kt=I.Trigger;var Fi=We.forwardRef(({className:e,inset:t,children:o,...r},a)=>(0,$o.jsxs)(I.SubTrigger,{ref:a,className:b("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),...r,children:[o,(0,$o.jsx)(ft.ChevronRightIcon,{className:"ml-auto"})]}));Fi.displayName=I.SubTrigger.displayName;var Bi=We.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(I.SubContent,{ref:o,className:b("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}));Bi.displayName=I.SubContent.displayName;var Dt=We.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,$o.jsx)(I.Portal,{children:(0,$o.jsx)(I.Content,{ref:r,sideOffset:t,className:b("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})}));Dt.displayName=I.Content.displayName;var Pt=We.forwardRef(({className:e,inset:t,...o},r)=>(0,$o.jsx)(I.Item,{ref:r,className:b("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}));Pt.displayName=I.Item.displayName;var Oi=We.forwardRef(({className:e,children:t,checked:o,...r},a)=>(0,$o.jsxs)(I.CheckboxItem,{ref:a,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[(0,$o.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$o.jsx)(I.ItemIndicator,{children:(0,$o.jsx)(ft.CheckIcon,{className:"h-4 w-4"})})}),t]}));Oi.displayName=I.CheckboxItem.displayName;var Vi=We.forwardRef(({className:e,children:t,...o},r)=>(0,$o.jsxs)(I.RadioItem,{ref:r,className:b("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,$o.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$o.jsx)(I.ItemIndicator,{children:(0,$o.jsx)(ft.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Vi.displayName=I.RadioItem.displayName;var Ui=We.forwardRef(({className:e,inset:t,...o},r)=>(0,$o.jsx)(I.Label,{ref:r,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Ui.displayName=I.Label.displayName;var zi=We.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(I.Separator,{ref:o,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));zi.displayName=I.Separator.displayName;var $i=({className:e,...t})=>(0,$o.jsx)("span",{className:b("ml-auto text-xs tracking-widest opacity-60",e),...t});$i.displayName="DropdownMenuShortcut";var Co=1;function _i(){return(0,$o.jsx)("span",{className:"border border-[#222222]"})}function To(){let[e]=(0,Ur.useLexicalComposerContext)(),t=(0,yt.useRef)(null),[o,r]=(0,yt.useState)(!1),[a,i]=(0,yt.useState)(!1),[n,s]=(0,yt.useState)(!1),[d,p]=(0,yt.useState)(!1),[l,m]=(0,yt.useState)(!1),[u,h]=(0,yt.useState)(!1),[v,R]=(0,yt.useState)(!1),[c,f]=(0,yt.useState)(!1),[E,g]=(0,yt.useState)(!1),[S,Q]=(0,yt.useState)("left"),[Ce,Me]=(0,yt.useState)("p"),de=x=>{e.update(()=>{let U=(0,k.$getSelection)();(0,k.$isRangeSelection)(U)&&(x==="p"?(0,No.$setBlocksType)(U,()=>(0,k.$createParagraphNode)()):(0,No.$setBlocksType)(U,()=>(0,Jr.$createHeadingNode)(x)))})},me=(0,yt.useCallback)(()=>{let x=(0,k.$getSelection)();if((0,k.$isRangeSelection)(x)){s(x.hasFormat("bold")),p(x.hasFormat("italic")),m(x.hasFormat("underline")),h(x.hasFormat("strikethrough")),R(x.hasFormat("subscript")),f(x.hasFormat("superscript"));let U=x.anchor.getNode(),z=U;for(;z&&!(0,k.$isParagraphNode)(z)&&z!==(0,k.$getRoot)();){let K=z.getParent();K&&(z=K)}if(z){let K=z.getFormatType();Q(K||"left")}let pe=U.getTopLevelElement()?.__tag;Me(pe||"p")}},[]);(0,yt.useEffect)(()=>(0,kt.mergeRegister)(e.registerUpdateListener(({editorState:x})=>{x.read(()=>{me()})}),e.registerCommand(k.SELECTION_CHANGE_COMMAND,(x,U)=>(me(),!1),Co),e.registerCommand(k.CAN_UNDO_COMMAND,x=>(r(x),!1),Co),e.registerCommand(k.CAN_REDO_COMMAND,x=>(i(x),!1),Co),(0,kt.mergeRegister)(e.registerCommand(go,x=>(e.update(()=>{let U=(0,k.$getSelection)()||(0,k.$getPreviousSelection)();if((0,k.$isRangeSelection)(U)){let z=ut({id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}),{focus:pe}=U,K=pe.getNode();(0,kt.$insertNodeToNearestRoot)(z),(0,k.$isParagraphNode)(K)&&!K.__first&&K.remove()}}),!0),k.COMMAND_PRIORITY_EDITOR))),[e,me]);let ge=[[{label:"Undo",icon:(0,$o.jsx)(Te.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(k.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,$o.jsx)(Te.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(k.UNDO_COMMAND,void 0)},disabled:!a}],[{label:"Bold",icon:(0,$o.jsx)(Rr,{}),onClick:()=>{e.dispatchCommand(k.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,$o.jsx)(Mr,{}),onClick:()=>{e.dispatchCommand(k.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:d},{label:"Underline",icon:(0,$o.jsx)(Ir,{}),onClick:()=>{e.dispatchCommand(k.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:l},{label:"Strikethrough",icon:(0,$o.jsx)(Er,{}),onClick:()=>{e.dispatchCommand(k.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,$o.jsx)(Ar,{}),onClick:()=>{e.dispatchCommand(k.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:v},{label:"Superscript",icon:(0,$o.jsx)(Lr,{}),onClick:()=>{e.dispatchCommand(k.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:c}]],be=[{label:"Left Align",direction:"left",icon:(0,$o.jsx)(Te.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(k.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,$o.jsx)(Te.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(k.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,$o.jsx)(Te.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(k.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,$o.jsx)(Te.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(k.FORMAT_ELEMENT_COMMAND,"justify")}}],Be=[{label:"Normal Text",value:"p",icon:(0,$o.jsx)(Hr,{}),onClick:()=>de("p")},{label:"Heading 1",value:"h1",icon:(0,$o.jsx)(Fr,{}),onClick:()=>de("h1")},{label:"Heading 2",value:"h2",icon:(0,$o.jsx)(Br,{}),onClick:()=>de("h2")},{label:"Heading 3",value:"h3",icon:(0,$o.jsx)(Or,{}),onClick:()=>de("h3")},{label:"Heading 4",value:"h4",icon:(0,$o.jsx)(Vr,{}),onClick:()=>de("h4")},...[{label:"Unordered List",value:"ul",icon:(0,$o.jsx)(Te.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Zt.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,$o.jsx)(Te.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Zt.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ze=[{label:"Insert Image",icon:(0,$o.jsx)(Te.ImageUp,{width:15,height:15}),onClick:()=>{g(!0)},disabled:!1}];return(0,$o.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,$o.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[ge.map((x,U)=>(0,$o.jsxs)(yt.Fragment,{children:[(0,$o.jsx)("div",{className:"flex items-center gap-2",children:x.map((z,pe)=>(0,$o.jsx)("div",{role:"button","aria-disabled":z.disabled||!1,onClick:z.onClick,className:b("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]",z.active&&"bg-[#3c3c3c]"),"aria-label":z.label,children:(0,$o.jsx)(zt,{children:(0,$o.jsxs)($t,{children:[(0,$o.jsx)(_t,{className:"text-[#b5b5b5]",children:z.icon}),(0,$o.jsx)(Ct,{children:(0,$o.jsx)("p",{children:z.label})})]})})},pe))}),(0,$o.jsx)(_i,{})]},`toolbar-option-${x.length}-${U}`)),(0,$o.jsxs)(Wt,{children:[(0,$o.jsxs)(Kt,{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:[be.find(x=>x.direction===S)?.icon,be.find(x=>x.direction===S)?.label,(0,$o.jsx)(Te.ChevronDown,{width:15,height:15})]}),(0,$o.jsx)(Dt,{className:"bg-black hover:bg-black",children:be.map((x,U)=>(0,$o.jsxs)(Pt,{onClick:x.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,$o.jsx)("span",{children:x.icon}),(0,$o.jsx)("span",{children:x.label})]},`${x.label}-${U}`))})]}),(0,$o.jsxs)(Wt,{children:[(0,$o.jsxs)(Kt,{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:[Be.find(x=>x.value===Ce)?.icon,Be.find(x=>x.value===Ce)?.label,(0,$o.jsx)(Te.ChevronDown,{width:15,height:15})]}),(0,$o.jsx)(Dt,{className:"bg-black hover:bg-black",children:Be.map((x,U)=>(0,$o.jsxs)(Pt,{onClick:x.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,$o.jsx)("span",{children:x.icon}),(0,$o.jsx)("span",{children:x.label})]},`heading-option-${x.label}-${U}`))})]}),(0,$o.jsxs)(Wt,{children:[(0,$o.jsxs)(Kt,{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,$o.jsx)(Te.Plus,{width:15,height:15}),(0,$o.jsx)(Te.ChevronDown,{width:15,height:15})]}),(0,$o.jsx)(Dt,{className:"bg-black hover:bg-black",children:ze.map((x,U)=>(0,$o.jsxs)(Pt,{onClick:x.onClick,disabled:x.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,$o.jsx)("span",{children:x.icon}),(0,$o.jsx)("span",{children:x.label})]},U))})]}),E&&(0,$o.jsx)(Pr,{activeEditor:e,onClose:()=>{g(!1)},isOpen:E})]})})}var Gi=({setValue:e,value:t,name:o,editable:r=!0})=>{let[a]=(0,Ur.useLexicalComposerContext)(),i=(0,yt.useRef)(null),n=s=>{s.read(()=>{let d=s.toJSON();JSON.stringify(d)!==JSON.stringify(i.current)&&(i.current=d,e?.(()=>d))})};return(0,yt.useEffect)(()=>{a.setEditable(r)},[r,a]),(0,yt.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(i.current)&&a.update(()=>{try{let s=a.parseEditorState(t);a.setEditorState(s),i.current=t}catch(s){console.error("Error parsing editor state:",s)}},{discrete:!0})},[t,a]),(0,$o.jsx)("div",{className:"w-full",children:(0,$o.jsxs)("div",{className:" ",children:[r&&(0,$o.jsx)(To,{}),(0,$o.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,$o.jsx)(jr.RichTextPlugin,{contentEditable:(0,$o.jsx)(Gr.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Wr.LexicalErrorBoundary}),r&&(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(Kr.HistoryPlugin,{}),(0,$o.jsx)($r.AutoFocusPlugin,{}),(0,$o.jsx)(Zr.ListPlugin,{}),(0,$o.jsx)(Xr.OnChangePlugin,{onChange:n}),(0,$o.jsx)(vo,{})]})]})]})})},Wi=({setValue:e,value:t,name:o,editable:r=!0})=>(0,$o.jsx)(_r.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Zt.ListNode,Zt.ListItemNode,Jr.HeadingNode,Nt],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,$o.jsx)(Gi,{value:t,setValue:e,name:o,editable:r})}),Yr=Wi;var Mt=e=>"mimeType"in e&&"url"in e&&!("format"in e),Ki=e=>{if(!e?.root?.children)return"";let t=[],o=a=>{if(!a)return"";switch(a.type){case"heading":{let i=a.tag?parseInt(a.tag.replace("h","")):1,n=r(a.children||[]);return"#".repeat(i)+" "+n}case"paragraph":return r(a.children||[]);case"list":{let i=[],n=a.listType==="number"?"1.":"-";return a.children?.forEach((s,d)=>{if(s.type==="listitem"){let p=r(s.children||[]),l=a.listType==="number"?`${d+1}.`:n;i.push(`${l} ${p}`)}}),i.join(`
|
|
6
|
-
`)}case"listitem":return r(a.children||[]);case"text":{let
|
|
7
|
-
`}return o(
|
|
8
|
-
|
|
9
|
-
`)
|
|
10
|
-
`),o=[],r=[],a=[],i=()=>{if(r.length>0){let s=r.join(" "),d=nt(s);o.push({type:"paragraph",children:d.length>0?d:[{type:"text",text:"",format:0}]}),r=[]}},n=()=>{a.length>0&&(o.push({type:"list",listType:"bullet",children:a}),a=[])};for(let s of t){let d=s.trim();if(!d){i(),n();continue}let p=d.match(/^(#{1,6})\s+(.+)$/);if(p){i(),n();let m=p[1].length,u=p[2],h=nt(u);o.push({type:"heading",tag:`h${m}`,children:h.length>0?h:[{type:"text",text:"",format:0}]});continue}let l=d.match(/^[-*+]\s+(.+)$/);if(l){i();let m=l[1],u=nt(m);a.push({type:"listitem",children:[{type:"paragraph",children:u.length>0?u:[{type:"text",text:"",format:0}]}]});continue}a.length>0&&n(),r.push(d)}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}}},Zi=async e=>{let t="",o,r="text";if(e.url)try{let a=e.url;!a.startsWith("http://")&&!a.startsWith("https://")&&!a.startsWith("/")&&(a="/"+a);let i=await fetch(a);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(a){console.error("Failed to fetch file content:",a)}else console.warn("No URL provided for file:",e.name);return e.mimeType==="text/markdown"?(r="richText",o=ji(t)):e.mimeType?.startsWith("text/")&&(r="text"),{id:e.id.toString(),title:e.name,description:void 0,content:r==="richText"?void 0:t,richTextContent:r==="richText"?o:void 0,format:r,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function ea({document:e,onCancel:t,onSave:o,onFileUpdate:r}){let[a,i]=(0,yt.useState)(Mt(e)),[n,s]=(0,yt.useState)(Mt(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}),[d,p]=(0,yt.useState)(Mt(e)?void 0:n.richTextContent),[l,m]=(0,yt.useState)(!1),u=(0,yt.useRef)(Mt(e)?e:null);(0,yt.useEffect)(()=>{Mt(e)?(i(!0),Zi(e).then(c=>{s(c),p(c.richTextContent),i(!1)}).catch(c=>{c instanceof Error&&c.name!=="AbortError"&&(console.error("Failed to convert file:",c),i(!1))})):(s({...e,updatedAt:new Date}),p(e.richTextContent))},[e]);let h=c=>{switch(c){case"markdown":case"mdx":return(0,$o.jsx)(Te.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,$o.jsx)(Te.File,{className:"h-6 w-6 text-success"});case"text":return(0,$o.jsx)(Te.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,$o.jsx)(Te.File,{className:"h-6 w-6 text-muted-foreground"})}},v=c=>{switch(c){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"}},R=async()=>{m(!0);try{let c,f;if(u.current&&u.current.mimeType==="text/markdown"){let g=d?Ki(d):"";c={...n,format:"markdown",content:g,richTextContent:void 0},f=g}else c={...n,richTextContent:d},f=n.content||"";let E=u.current?u.current.id.toString():n.id;await Promise.resolve(o()),r?.(E,f)}finally{m(!1)}};return(0,$o.jsxs)(So.motion.div,{initial:{opacity:0,$o:20},animate:{opacity:1,$o:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,$o.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,$o.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,$o.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,$o.jsx)("div",{className:"flex-1 min-w-0",children:(0,$o.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,$o.jsx)("div",{className:"flex-1 min-w-0",children:(0,$o.jsx)(wt,{fieldName:"title",value:n.title,label:"",onSave:(c,f)=>s(E=>({...E,title:f})),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,$o.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${v(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]})})}),(0,$o.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,$o.jsxs)(A,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,$o.jsx)(Te.X,{className:"h-4 w-4"}),"Close"]}),(0,$o.jsxs)(A,{size:"sm",onClick:R,className:"gap-2",disabled:l,children:[l?(0,$o.jsx)(Te.Loader2,{className:"h-4 w-4 animate-spin"}):(0,$o.jsx)(Te.Save,{className:"h-4 w-4"}),l?"Saving...":"Save"]})]})]})}),(0,$o.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,$o.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:a?(0,$o.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,$o.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,$o.jsx)(Te.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,$o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,$o.jsx)($o.Fragment,{children:n.format==="richText"?(0,$o.jsx)(Yr,{setValue:p,value:d,name:"richTextContent"},`richtext-${n.id}-${a?"loading":"loaded"}`):(0,$o.jsx)(Ae,{value:n.content||"",onChange:c=>s(f=>({...f,content:c.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var ta=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 aa({files:e,onFileClick:t,onFileDelete:o,onFileUpdate:r,showHeader:a=!0,className:i,viewMode:n="list"}){let[s,d]=(0,yt.useState)(!1),[p,l]=(0,yt.useState)(!1),[m,u]=(0,yt.useState)(null),h=()=>{d(!1),u(null)},v=()=>{l(!0),setTimeout(()=>{l(!1),d(!1),u(null)},500)},R=c=>{u(c),d(!0)};return(0,$o.jsxs)("div",{className:b("rounded-3xl border overflow-hidden",i),children:[(0,$o.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[a&&n==="list"&&(0,$o.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,$o.jsx)("div",{className:"col-span-6",children:"Name"}),(0,$o.jsx)("div",{className:"col-span-2",children:"Size"}),(0,$o.jsx)("div",{className:"col-span-2",children:"Modified"})]}),n==="card"&&(0,$o.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),n==="list"&&(0,$o.jsx)("div",{className:"divide-$o",children:e.map(c=>(0,$o.jsxs)(So.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(c),children:[(0,$o.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,$o.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,$o.jsx)("div",{children:(0,$o.jsx)("p",{className:"font-medium",children:c.name})})]}),(0,$o.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:ta(c.filesize)}),(0,$o.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,$o.jsx)("span",{className:"text-sm md:text-base",children:new Date(c.createdAt).toLocaleDateString()}),(0,$o.jsxs)("div",{className:"flex gap-1",children:[c.mimeType==="text/markdown"&&(0,$o.jsx)(A,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:f=>{f.stopPropagation(),R(c)},children:(0,$o.jsx)(Te.Edit,{className:"h-4 w-4"})}),(0,$o.jsx)(A,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:f=>{f.stopPropagation(),o?.(c)},children:(0,$o.jsx)(Te.Trash2,{className:"h-4 w-4"})})]})]})]},c.name))}),n==="card"&&(0,$o.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(c=>(0,$o.jsx)(So.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(c),children:(0,$o.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,$o.jsxs)("div",{className:"flex-1 min-w-0 space-$o-2",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$o.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,$o.jsx)("div",{className:"min-w-0 flex-1",children:(0,$o.jsx)("p",{className:"font-medium truncate",children:c.name})})]}),(0,$o.jsxs)("div",{className:"space-$o-1 text-sm text-muted-foreground pl-[52px]",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("span",{className:"font-medium",children:"Size:"}),(0,$o.jsx)("span",{children:ta(c.filesize)})]}),(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,$o.jsx)("span",{children:new Date(c.createdAt).toLocaleDateString()})]})]})]}),(0,$o.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[c.mimeType==="text/markdown"&&(0,$o.jsx)(A,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:f=>{f.stopPropagation(),R(c)},title:"Edit",children:(0,$o.jsx)(Te.Edit,{className:"h-4 w-4"})}),(0,$o.jsx)(A,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:f=>{f.stopPropagation(),o?.(c)},title:"Delete",children:(0,$o.jsx)(Te.Trash2,{className:"h-4 w-4"})})]})]})},c.name))}),(0,$o.jsx)(Se,{open:s,onOpenChange:c=>!c&&h(),children:(0,$o.jsxs)(ao,{children:[(0,$o.jsx)(Ht,{}),(0,$o.jsxs)(oa.Content,{className:b("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,$o.jsx)(xe,{className:"$o-only",children:m?`Edit ${m.name}`:"Edit File"}),p&&(0,$o.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,$o.jsx)(Te.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),m&&(0,$o.jsx)(ea,{document:m,onSave:v,onFileUpdate:r,onCancel:h})]})]})})]})}var ia=({isOpen:e,onClose:t,onAddFile:o})=>{let[r,a]=(0,yt.useState)(null),[i,n]=(0,yt.useState)(""),[s,d]=(0,yt.useState)(""),[p,l]=(0,yt.useState)(""),m=h=>{let v=h.target.files?.[0];v&&(a(v),i||n(v.name))},u=async h=>{if(h.preventDefault(),!r)return;let v=new FormData;v.append("file",r),v.append("name",i),s&&v.append("description",s),p&&v.append("tags",p),o?.(v),t(),a(null),n(""),d(""),l("")};return(0,$o.jsx)(Se,{open:e,onOpenChange:t,children:(0,$o.jsxs)(Ie,{className:"sm:max-w-md",children:[(0,$o.jsx)(Ee,{children:(0,$o.jsx)(xe,{children:"Add New File"})}),(0,$o.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,$o.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,$o.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,$o.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,$o.jsx)(Ji,{className:"w-10 h-10 text-gray-400"}),(0,$o.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,$o.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,$o.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,$o.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:m})]})}),r&&(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsxs)("div",{children:[(0,$o.jsx)("p",{className:"font-medium",children:r.name}),(0,$o.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((r.size||0)/1024).toFixed(2)," KB"]})]}),(0,$o.jsx)(A,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function Ji(e){return(0,$o.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,$o.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,$o.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,$o.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var na=({isOpen:e,onClose:t,initialTask:o,epics:r,sprints:a,onUpdateTask:i,onDeleteTask:n,onAddComment:s,colleagues:d,onUploadFile:p,onDeleteFile:l,onFileUpdate:m})=>{let[u,h]=(0,yt.useState)(o),[v,R]=(0,yt.useState)(new Date),[c,f]=(0,yt.useState)("idle"),[E,g]=(0,yt.useState)("idle"),[S,Q]=(0,yt.useState)(!1),[Ce,Me]=(0,yt.useState)([]),[de,me]=(0,yt.useState)(d);(0,yt.useEffect)(()=>{h(o)},[o]);let ge=async($,q)=>{if(q!==u[$]){f("loading");try{await i(u.id.toString(),{[$]:q}),R(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch(st){console.log("error",st),f("error"),setTimeout(()=>f("idle"),3e3)}}},be=async($,q)=>{if(q!==u[$]){f("loading");try{await i(u.id.toString(),{[$]:q}),R(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch(st){console.log("error",st),f("error"),setTimeout(()=>f("idle"),3e3)}}},V=async $=>{if(s){f("loading");try{await s?.({content:$,taskId:u.id.toString()}),R(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}}},Be=async()=>{g("loading");try{await n(u.id.toString()),g("success"),setTimeout(()=>{t(),g("idle")},1e3)}catch{g("error"),setTimeout(()=>g("idle"),3e3)}},ze=async $=>{if(p){f("loading");try{await p(u.id.toString(),$),R(new Date),f("success"),Q(!1),setTimeout(()=>f("idle"),1500)}catch(q){console.error("Error uploading file:",q),f("error"),setTimeout(()=>f("idle"),3e3)}}},x=async $=>{if(l){f("loading");try{await l(u.id.toString(),$.id.toString()),R(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch(q){console.error("Error deleting file:",q),f("error"),setTimeout(()=>f("idle"),3e3)}}},U=(u.files||[]).map($=>typeof $=="number"?null:$).filter($=>$!==null),z=c!=="loading"&&E!=="loading",pe=()=>{z&&t()},K=()=>c==="loading"?(0,$o.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,$o.jsx)(Te.Loader2,{className:"h-4 w-4 animate-spin"}),(0,$o.jsx)("span",{children:"Updating..."})]}):c==="success"?(0,$o.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,$o.jsx)(Te.Check,{className:"h-4 w-4"}),(0,$o.jsx)("span",{children:"Updated successfully"})]}):c==="error"?(0,$o.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,$o.jsx)(Te.X,{className:"h-4 w-4"}),(0,$o.jsx)("span",{children:"Update failed"})]}):null;return(0,$o.jsxs)(Se,{open:e,onOpenChange:pe,children:[(0,$o.jsxs)(Ie,{className:"max-w-3xl max-h-[80vh] overflow-$o-auto p-4",children:[(0,$o.jsxs)(Ee,{children:[(0,$o.jsx)(xe,{className:"$o-only",children:u?.name}),(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsx)("div",{className:"flex-1",children:K()}),!z&&(0,$o.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,$o.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,$o.jsxs)("div",{className:"lg:col-span-2 space-$o-4",children:[(0,$o.jsx)(wt,{fieldName:"name",value:u.name||"",label:"",onSave:ge,className:"border-b border-border pb-3",disabled:c==="loading"}),(0,$o.jsx)(wt,{fieldName:"description",value:u.description||"",label:"Description",multiline:!0,onSave:ge,disabled:c==="loading"}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)(Te.File,{className:"h-4 w-4 text-muted-foreground"}),(0,$o.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),p&&(0,$o.jsxs)(A,{variant:"outline",size:"sm",onClick:()=>Q(!0),disabled:c==="loading",className:"gap-2",children:[(0,$o.jsx)(Te.Upload,{className:"h-4 w-4"}),"Upload"]})]}),U.length>0?(0,$o.jsx)(aa,{files:U,onFileDelete:l?x:void 0,onFileUpdate:m,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,$o.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"No files attached"})]}),(0,$o.jsx)(pr,{comments:(u?.comments||[]).map($=>({author:$.author?.value.name||"",createdAt:new Date($.timestamp),text:$.text,id:$.id||""})),onAddComment:V})]}),(0,$o.jsx)(gr,{task:u,epics:r,sprints:a,lastUpdated:v,onUpdateTask:be,onClose:pe,onDelete:Be,isUpdating:c==="loading",isDeleting:E==="loading",deleteState:E,teamMembers:de})]})]}),p&&(0,$o.jsx)(ia,{isOpen:S,onClose:()=>Q(!1),onAddFile:ze})]})};var la=({isOpen:e,onClose:t,onAddEpic:o})=>{let[r,a]=(0,yt.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("$o")[0],endDate:new Date().toISOString().split("$o")[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"}],d=l=>{l.preventDefault(),r.name.trim()&&(o({name:r.name.trim(),description:r.description.trim(),color:r.color,confidence:r.confidence,phase:r.phase,startDate:r.startDate,endDate:r.endDate}),a({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(l,m)=>{a(u=>({...u,[l]:m}))};return(0,$o.jsx)(Se,{open:e,onOpenChange:t,children:(0,$o.jsxs)(Ie,{className:"sm:max-w-md",children:[(0,$o.jsx)(Ee,{children:(0,$o.jsx)(xe,{children:"Add New Epic"})}),(0,$o.jsxs)("form",{onSubmit:d,className:"space-$o-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"name",children:"Epic Name"}),(0,$o.jsx)(ue,{id:"name",value:r.name,onChange:l=>p("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"description",children:"Description"}),(0,$o.jsx)(Ae,{id:"description",value:r.description,onChange:l=>p("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Color"}),(0,$o.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(l=>(0,$o.jsx)("button",{type:"button",onClick:()=>p("color",l),className:`w-8 h-8 rounded-full ${l} ${r.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,$o.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Confidence"}),(0,$o.jsxs)(Le,{value:r.confidence,onValueChange:l=>p("confidence",l),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(ot,{})}),(0,$o.jsx)(Pe,{children:n.map(l=>(0,$o.jsx)(fe,{value:l.value,children:l.label},l.value))})]})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Phase"}),(0,$o.jsxs)(Le,{value:r.phase.toString(),onValueChange:l=>p("phase",parseInt(l)),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(ot,{})}),(0,$o.jsx)(Pe,{children:s.map(l=>(0,$o.jsx)(fe,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,$o.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Start Date"}),(0,$o.jsx)(ue,{type:"date",value:r.startDate,onChange:l=>p("startDate",l.target.value)})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"End Date"}),(0,$o.jsx)(ue,{type:"date",value:r.endDate,onChange:l=>p("endDate",l.target.value)})]})]}),(0,$o.jsxs)(xt,{children:[(0,$o.jsx)(A,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,$o.jsx)(A,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};function ca(e,t){let[o,r]=(0,yt.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),a=i=>{try{r(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,yt.useEffect)(()=>{a(o)},[]),[o,a]}var qt=require("react-icons/fa");function ma({title:e,description:t,badge:o,primaryAction:r,secondaryAction:a,gradient:i,children:n,className:s}){let[d,p]=ca(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!a&&!t),l=!a&&!t||d;return(0,$o.jsxs)(So.motion.div,{initial:{opacity:0,$o:20},animate:{opacity:1,$o:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,$o.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,$o.jsx)(Ne,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,$o.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,$o.jsxs)("div",{className:"flex items-center gap-3",children:[l&&r&&(0,$o.jsx)(A,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:r.onClick,children:r.label}),(a||t)&&(0,$o.jsx)("button",{"aria-label":d?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!d),style:{lineHeight:0},children:d?(0,$o.jsx)(qt.FaChevronDown,{size:22}):(0,$o.jsx)(qt.FaChevronUp,{size:22})})]})]}),!l&&(0,$o.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,$o.jsxs)("div",{className:"space-$o-4",children:[(0,$o.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,$o.jsxs)("div",{className:"flex flex-wrap gap-3",children:[r&&(0,$o.jsx)(A,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:r.onClick,children:r.label}),a&&(0,$o.jsx)(A,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:a.onClick,children:a.label})]})]}),n&&(0,$o.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var Xi=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:r=[],initialColleagues:a=[],initialProjects:i=[],onAddTask:n,onUpdateTask:s,onDeleteTask:d,onTaskClick:p,onAddEpic:l,onAddComment:m,onUploadFile:u,onDeleteFile:h,onFileUpdate:v})=>{let[R,c]=(0,_.useState)([]),[f,E]=(0,_.useState)([]),[g,S]=(0,_.useState)([]),[Q,Ce]=(0,_.useState)(!1),[Me,de]=(0,_.useState)(!1),[me,ge]=(0,_.useState)(null),[be,V]=(0,_.useState)(null),[Be,ze]=(0,_.useState)([]),[x,U]=(0,_.useState)([]),[z,pe]=(0,_.useState)(0),K=(0,_.useRef)(null),$=(0,_.useRef)(null),q=_.default.useMemo(()=>[...f.map(w=>w.id),0],[f]),st=(0,_.useRef)(""),Do=(0,_.useRef)(""),Po=(0,_.useRef)(""),ko=(0,_.useRef)(""),Et=(w,F)=>w.map(B=>`${B.id}-${new Date(B.createdAt).getTime()}-${new Date(B.updatedAt).getTime()}`).join("-")+(F?`-${F}`:"");(0,_.useEffect)(()=>{let w=e.map(B=>B.files?.filter(le=>typeof le=="object").map(le=>new Date(le.updatedAt).getTime())).flat(),F=Et(e,w.join("-"));F!==st.current&&(c(e),me&&ge(e.find(B=>B.id===me.id)||null),st.current=F)},[e]),(0,_.useEffect)(()=>{let w=Et(t);w!==Do.current&&(E(t),Do.current=w)},[t]),(0,_.useEffect)(()=>{let w=Et(o);w!==Po.current&&(S(o),Po.current=w)},[o]),(0,_.useEffect)(()=>{let w=Et(a.map(F=>({id:F.id,updatedAt:F.updatedAt,createdAt:F.createdAt})));w!==ko.current&&(U(a),ko.current=w)},[a]),(0,_.useEffect)(()=>{let w=()=>{if(K.current){let le=K.current.offsetHeight;pe(le)}};w();let F=new ResizeObserver(w);K.current&&F.observe(K.current);let B=()=>{setTimeout(w,100)};return window.addEventListener("storage",B),()=>{F.disconnect(),window.removeEventListener("storage",B)}},[]),(0,_.useEffect)(()=>{let w=setTimeout(()=>{K.current&&pe(K.current.offsetHeight)},300);return()=>clearTimeout(w)},[Q,Me]);let pa=R.filter(w=>!0),ua=w=>pa.filter(F=>F.status===w),fa=w=>{let F={};return f.forEach(B=>{F[B.id]=w.filter(le=>pt(le.epic)===B.id)}),F["no-epic"]=w.filter(B=>!pt(B.epic)),F},Ro=w=>{V(w)},ga=w=>{be&&(c(F=>F.map(B=>B.id===be.id?{...B,status:w}:B)),s?.(be.id.toString(),{status:w}),V(null))},va=w=>{let F={...w,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};c(B=>[...B,F]),n?.(w)},ba=async(w,F)=>{c(B=>B.map(le=>le.id===Number(w)?{...le,...F}:le)),s&&await s(w,F),me?.id===Number(w)&&ge(B=>({...B,...F}))},ha=async w=>{c(F=>F.filter(B=>B.id!==Number(w))),me?.id===Number(w)&&ge(null),d&&await d(w)},xa=w=>{let F={...w,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};E(B=>[...B,F]),l?.(w)},Mo=w=>{ge(w),p?.(w)},ya=[{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"}],wa=z>0?`calc(100vh - ${z+120}px)`:"calc(100vh - 12rem)";return(0,$o.jsxs)("div",{ref:$,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,$o.jsx)("div",{ref:K,className:"flex-shrink-0",children:(0,$o.jsx)(ma,{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:()=>Ce(!0)},secondaryAction:{label:"Add epic",onClick:()=>de(!0)}})}),(0,$o.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,$o.jsx)("div",{className:"h-full",style:{height:z>0?`calc(100vh - ${z+120}px)`:"calc(100vh - 12rem)"},children:(0,$o.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:ya.map(w=>{let F=ua(w.status),B=fa(F);return(0,$o.jsxs)(_o,{title:w.title,status:w.status,taskCount:F.length,onDrop:ga,isCompact:w.status==="done",height:wa,children:[B["no-epic"].map(le=>(0,$o.jsx)(ro,{epic:null,task:le,onDragStart:Ro,onTaskClick:Mo,isCompact:w.status==="done"},le.id)),q.map(le=>{let Yt=f.find(At=>At.id===le),Qt=B[le]||[];return Qt.length===0?null:(0,$o.jsxs)("div",{className:"mb-6",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,$o.jsx)("div",{className:`w-3 h-3 rounded-full ${Yt?.color}`}),(0,$o.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Yt?.name||"No Epic"}),(0,$o.jsx)(Ne,{variant:"secondary",className:"text-xs",children:Qt.length})]})," ",(0,$o.jsx)("div",{className:"space-$o-3",children:Qt.map(At=>(0,$o.jsx)(ro,{task:At,epic:Yt,onDragStart:Ro,onTaskClick:Mo,isCompact:w.status==="done"},At.id))})]},le)})]},w.id)})})})}),(0,$o.jsx)(cr,{isOpen:Q,onClose:()=>Ce(!1),onAddTask:va,assignees:[...x,...Be],epics:f,sprints:g}),(0,$o.jsx)(la,{isOpen:Me,onClose:()=>de(!1),onAddEpic:xa}),me&&(0,$o.jsx)(na,{isOpen:!!me,onClose:()=>ge(null),initialTask:me,epics:f,sprints:g,onUpdateTask:ba,onDeleteTask:ha,colleagues:x,onUploadFile:u,onDeleteFile:h,onFileUpdate:v,onAddComment:m})]})};0&&(module.exports={KanbanBoardView});
|
|
5
|
+
"use strict";var Ca=Object.create;var Lt=Object.defineProperty;var Na=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Sa=Object.getPrototypeOf,Da=Object.prototype.hasOwnProperty;var Pa=(e,t)=>{for(var o in t)Lt(e,o,{get:t[o],enumerable:!0})},Io=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ta(t))!Da.call(e,i)&&i!==o&&Lt(e,i,{get:()=>t[i],enumerable:!(r=Na(t,i))||r.enumerable});return e};var X=(e,t,o)=>(o=e!=null?Ca(Sa(e)):{},Io(t||!e||!e.__esModule?Lt(o,"default",{value:e,enumerable:!0}):o,e)),ka=e=>Io(Lt({},"__esModule",{value:!0}),e);var qi={};Pa(qi,{KanbanBoardView:()=>Xi});module.exports=ka(qi);var _=X(require("react"));var zo=require("class-variance-authority");var Uo=require("clsx");var oo="-",Ra=e=>{let t=Ia(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let s=n.split(oo);return s[0]===""&&s.length!==1&&s.shift(),Lo(s,t)||Ma(n)},getConflictingClassGroupIds:(n,s)=>{let d=o[n]||[];return s&&r[n]?[...d,...r[n]]:d}}},Lo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),i=r?Lo(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(oo);return t.validators.find(({validator:n})=>n(a))?.classGroupId},Eo=/^\[(.+)\]$/,Ma=e=>{if(Eo.test(e)){let t=Eo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ia=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Aa(Object.entries(e.classGroups),o).forEach(([a,n])=>{to(n,r,a,t)}),r},to=(e,t,o,r)=>{e.forEach(i=>{if(typeof i=="string"){let a=i===""?t:Ao(t,i);a.classGroupId=o;return}if(typeof i=="function"){if(Ea(i)){to(i(r),t,o,r);return}t.validators.push({validator:i,classGroupId:o});return}Object.entries(i).forEach(([a,n])=>{to(n,Ao(t,a),o,r)})})},Ao=(e,t)=>{let o=e;return t.split(oo).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Ea=e=>e.isThemeGetter,Aa=(e,t)=>t?e.map(([o,r])=>{let i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([n,s])=>[t+n,s])):a);return[o,i]}):e,La=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,i=(a,n)=>{o.set(a,n),t++,t>e&&(t=0,r=o,o=new Map)};return{get(a){let n=o.get(a);if(n!==void 0)return n;if((n=r.get(a))!==void 0)return i(a,n),n},set(a,n){o.has(a)?o.set(a,n):i(a,n)}}},Ho="!",Ha=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,i=t[0],a=t.length,n=s=>{let d=[],p=0,l=0,m;for(let c=0;c<s.length;c++){let f=s[c];if(p===0){if(f===i&&(r||s.slice(c,c+a)===t)){d.push(s.slice(l,c)),l=c+a;continue}if(f==="/"){m=c;continue}}f==="["?p++:f==="]"&&p--}let u=d.length===0?s:s.substring(l),b=u.startsWith(Ho),g=b?u.substring(1):u,S=m&&m>l?m-l:void 0;return{modifiers:d,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:S}};return o?s=>o({className:s,parseClassName:n}):n},Fa=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},Ba=e=>({cache:La(e.cacheSize),parseClassName:Ha(e),...Ra(e)}),Oa=/\s+/,Va=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],n=e.trim().split(Oa),s="";for(let d=n.length-1;d>=0;d-=1){let p=n[d],{modifiers:l,hasImportantModifier:m,baseClassName:u,maybePostfixModifierPosition:b}=o(p),g=!!b,S=r(g?u.substring(0,b):u);if(!S){if(!g){s=p+(s.length>0?" "+s:s);continue}if(S=r(u),!S){s=p+(s.length>0?" "+s:s);continue}g=!1}let c=Fa(l).join(":"),f=m?c+Ho:c,E=f+S;if(a.includes(E))continue;a.push(E);let v=i(S,g);for(let D=0;D<v.length;++D){let Q=v[D];a.push(f+Q)}s=p+(s.length>0?" "+s:s)}return s};function Ua(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Fo(t))&&(r&&(r+=" "),r+=o);return r}var Fo=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Fo(e[r]))&&(o&&(o+=" "),o+=t);return o};function za(e,...t){let o,r,i,a=n;function n(d){let p=t.reduce((l,m)=>m(l),e());return o=Ba(p),r=o.cache.get,i=o.cache.set,a=s,s(d)}function s(d){let p=r(d);if(p)return p;let l=Va(d,o);return i(d,l),l}return function(){return a(Ua.apply(null,arguments))}}var W=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Bo=/^\[(?:([a-z-]+):)?(.+)\]$/i,$a=/^\d+\/\d+$/,_a=new Set(["px","full","screen"]),Ga=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wa=/\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$/,Ka=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ja=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Za=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$e=e=>lt(e)||_a.has(e)||$a.test(e),je=e=>ct(e,"length",oi),lt=e=>!!e&&!Number.isNaN(Number(e)),eo=e=>ct(e,"number",lt),vt=e=>!!e&&Number.isInteger(Number(e)),Ja=e=>e.endsWith("%")&<(e.slice(0,-1)),k=e=>Bo.test(e),Ze=e=>Ga.test(e),Xa=new Set(["length","size","percentage"]),qa=e=>ct(e,Xa,Oo),Ya=e=>ct(e,"position",Oo),Qa=new Set(["image","url"]),ei=e=>ct(e,Qa,ai),ti=e=>ct(e,"",ri),bt=()=>!0,ct=(e,t,o)=>{let r=Bo.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},oi=e=>Wa.test(e)&&!Ka.test(e),Oo=()=>!1,ri=e=>ja.test(e),ai=e=>Za.test(e);var ii=()=>{let e=W("colors"),t=W("spacing"),o=W("blur"),r=W("brightness"),i=W("borderColor"),a=W("borderRadius"),n=W("borderSpacing"),s=W("borderWidth"),d=W("contrast"),p=W("grayscale"),l=W("hueRotate"),m=W("invert"),u=W("gap"),b=W("gradientColorStops"),g=W("gradientColorStopPositions"),S=W("inset"),c=W("margin"),f=W("opacity"),E=W("padding"),v=W("saturate"),D=W("scale"),Q=W("sepia"),Ce=W("skew"),Me=W("space"),de=W("translate"),me=()=>["auto","contain","none"],ge=()=>["auto","hidden","clip","visible","scroll"],be=()=>["auto",k,t],V=()=>[k,t],Be=()=>["",$e,je],ze=()=>["auto",lt,k],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",k],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[lt,k];return{cacheSize:500,separator:":",theme:{colors:[bt],spacing:[$e,je],blur:["none","",Ze,k],brightness:q(),borderColor:[e],borderRadius:["none","","full",Ze,k],borderSpacing:V(),borderWidth:Be(),contrast:q(),grayscale:K(),hueRotate:q(),invert:K(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[Ja,je],inset:be(),margin:be(),opacity:q(),padding:V(),saturate:q(),scale:q(),sepia:K(),skew:q(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",k]}],container:["container"],columns:[{columns:[Ze]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:[...x(),k]}],overflow:[{overflow:ge()}],"overflow-x":[{"overflow-x":ge()}],"overflow-$o":[{"overflow-$o":ge()}],overscroll:[{overscroll:me()}],"overscroll-x":[{"overscroll-x":me()}],"overscroll-$o":[{"overscroll-$o":me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-$o":[{"inset-$o":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",vt,k]}],basis:[{basis:be()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",k]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",vt,k]}],"grid-cols":[{"grid-cols":[bt]}],"col-start-end":[{col:["auto",{span:["full",vt,k]},k]}],"col-start":[{"col-start":ze()}],"col-end":[{"col-end":ze()}],"grid-rows":[{"grid-rows":[bt]}],"row-start-end":[{row:["auto",{span:[vt,k]},k]}],"row-start":[{"row-start":ze()}],"row-end":[{"row-end":ze()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",k]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",k]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-$o":[{"gap-$o":[u]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[c]}],mx:[{mx:[c]}],my:[{my:[c]}],ms:[{ms:[c]}],me:[{me:[c]}],mt:[{mt:[c]}],yt:[{yt:[c]}],mb:[{mb:[c]}],ml:[{ml:[c]}],"space-x":[{"space-x":[Me]}],"space-x-reverse":["space-x-reverse"],"space-$o":[{"space-$o":[Me]}],"space-$o-reverse":["space-$o-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",k,t]}],"min-w":[{"min-w":[k,t,"min","max","fit"]}],"max-w":[{"max-w":[k,t,"none","full","min","max","fit","prose",{screen:[Ze]},Ze]}],h:[{h:[k,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[k,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[k,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[k,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ze,je]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",eo]}],"font-family":[{font:[bt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",k]}],"line-clamp":[{"line-clamp":["none",lt,eo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$e,k]}],"list-image":[{"list-image":["none",k]}],"list-style-type":[{list:["none","disc","decimal",k]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$e,je]}],"underline-offset":[{"underline-offset":["auto",$e,k]}],"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:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",k]}],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",k]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),Ya]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","$o","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",qa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ei]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-$o":[{"rounded-$o":[a]}],"rounded-$o":[{"rounded-$o":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-$o":[{"border-$o":[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-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-$o":[{"divide-$o":[s]}],"divide-$o-reverse":["divide-$o-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:U()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-$o":[{"border-$o":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[$e,k]}],"outline-w":[{outline:[$e,je]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Be()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[$e,je]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ze,ti]}],"shadow-color":[{shadow:[bt]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ze,k]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[m]}],saturate:[{saturate:[v]}],sepia:[{sepia:[Q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-$o":[{"border-spacing-$o":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",k]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",k]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",k]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[D]}],"scale-x":[{"scale-x":[D]}],"scale-$o":[{"scale-$o":[D]}],rotate:[{rotate:[vt,k]}],"translate-x":[{"translate-x":[de]}],"translate-$o":[{"translate-$o":[de]}],"skew-x":[{"skew-x":[Ce]}],"skew-$o":[{"skew-$o":[Ce]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",k]}],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","$o-resize","nw-resize","$o-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",k]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","$o","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-yt":[{"scroll-yt":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","$o","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-$o":[{"touch-pan":["$o","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",k]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$e,je,eo]}],stroke:[{stroke:[e,"none"]}],$o:["$o-only","not-$o-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-$o"],overscroll:["overscroll-x","overscroll-$o"],inset:["inset-x","inset-$o","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-$o":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-$o"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","yt","mb","ml"],mx:["yt","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-$o","rounded-$o","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-$o","rounded-$o"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-$o"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-$o":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-$o":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-yt","scroll-mb","scroll-ml"],"scroll-mx":["scroll-yt","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-$o","touch-pz"],"touch-x":["touch"],"touch-$o":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Vo=za(ii);function h(...e){return Vo((0,Uo.clsx)(e))}var $o=require("react/jsx-runtime"),ni=(0,zo.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 Ne({className:e,variant:t,...o}){return(0,$o.jsx)("div",{className:h(ni({variant:t}),e),...o})}var Qe=X(require("react"));var dt=Qe.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:h("rounded-xl border bg-card text-card-foreground shadow",e),...t}));dt.displayName="Card";var si=Qe.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:h("flex flex-col space-$o-1.5 p-6",e),...t}));si.displayName="CardHeader";var li=Qe.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:h("font-semibold leading-none tracking-tight",e),...t}));li.displayName="CardTitle";var ci=Qe.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:h("text-sm text-muted-foreground",e),...t}));ci.displayName="CardDescription";var di=Qe.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:h("p-6 pt-0",e),...t}));di.displayName="CardContent";var mi=Qe.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("div",{ref:o,className:h("flex items-center p-6 pt-0",e),...t}));mi.displayName="CardFooter";var _o=({title:e,status:t,taskCount:o,children:r,onDrop:i,isCompact:a=!1,height:n})=>{let s=l=>{l.preventDefault()},d=l=>{l.preventDefault(),i(t)};return(0,$o.jsxs)(dt,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${a?"lg:max-w-xs":""}`,style:{height:n||"calc(100vh - 350px)"},onDragOver:s,onDrop:d,children:[(0,$o.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,$o.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${a?"text-base":"text-lg"}`,children:e}),(0,$o.jsx)(Ne,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,$o.jsx)("div",{className:"flex-1 overflow-$o-auto space-$o-4 min-h-0",children:r})]})};var Te=require("lucide-react"),ro=({task:e,epic:t,onDragStart:o,onTaskClick:r,isCompact:i=!1})=>{let a=l=>{o(e)},n=()=>{r(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"}},d=()=>{switch(e.type){case"story":return(0,$o.jsx)(Te.BookOpen,{className:"h-3 w-3"});case"bug":return(0,$o.jsx)(Te.Bug,{className:"h-3 w-3"});case"spike":return(0,$o.jsx)(Te.Zap,{className:"h-3 w-3"});case"task":default:return(0,$o.jsx)(Te.AlertCircle,{className:"h-3 w-3"})}},p=()=>{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 i?(0,$o.jsx)(dt,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:a,onClick:n,children:(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:d()}),(0,$o.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,$o.jsxs)(dt,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:a,onClick:n,children:[(0,$o.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,$o.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[d(),(0,$o.jsx)("span",{className:"capitalize",children:e.type})]}),(0,$o.jsxs)("div",{className:"flex gap-1",children:[(0,$o.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,$o.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,$o.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,$o.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,$o.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,$o.jsx)(Te.User,{className:"h-4 w-4"}),(0,$o.jsx)("span",{children:e.assignee?.value?.name})]}),(0,$o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,$o.jsx)(Te.Calendar,{className:"h-4 w-4"}),(0,$o.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var yt=require("react");var ht=X(require("react")),ae=X(require("@radix-ui/react-dialog"));var Se=ae.Root;var ao=ae.Portal;var Ht=ht.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(ae.Overlay,{ref:o,className:h("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}));Ht.displayName=ae.Overlay.displayName;var Ie=ht.forwardRef(({className:e,children:t,...o},r)=>(0,$o.jsxs)(ao,{children:[(0,$o.jsx)(Ht,{}),(0,$o.jsxs)(ae.Content,{ref:r,className:h("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-$o-[-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,$o.jsxs)(ae.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,$o.jsx)(Te.X,{className:"h-4 w-4"}),(0,$o.jsx)("span",{className:"$o-only",children:"Close"})]})]})]}));Ie.displayName=ae.Content.displayName;var Ee=({className:e,...t})=>(0,$o.jsx)("div",{className:h("flex flex-col space-$o-1.5 text-center sm:text-left",e),...t});Ee.displayName="DialogHeader";var xt=({className:e,...t})=>(0,$o.jsx)("div",{className:h("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xt.displayName="DialogFooter";var xe=ht.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(ae.Title,{ref:o,className:h("text-lg font-semibold leading-none tracking-tight",e),...t}));xe.displayName=ae.Title.displayName;var pi=ht.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(ae.Description,{ref:o,className:h("text-sm text-muted-foreground",e),...t}));pi.displayName=ae.Description.displayName;var Wo=require("@radix-ui/react-slot"),jo=X(require("react")),Zo=(0,zo.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),A=jo.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...i},a)=>(0,$o.jsx)(e?Wo.Slot:"button",{className:h(Zo({className:t,size:o,variant:r})),ref:a,...i}));A.displayName="Button";var Xo=X(require("react"));var ue=Xo.forwardRef(({className:e,type:t,...o},r)=>(0,$o.jsx)("input",{type:t,className:h("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:r,...o}));ue.displayName="Input";var Yo=X(require("react")),Ae=Yo.forwardRef(({className:e,...t},o)=>(0,$o.jsx)("textarea",{className:h("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}));Ae.displayName="Textarea";var M=X(require("@radix-ui/react-select")),Je=X(require("react")),Le=M.Root;var rt=M.Value,De=Je.forwardRef(({children:e,className:t,...o},r)=>(0,$o.jsxs)(M.Trigger,{className:h("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:r,...o,children:[e,(0,$o.jsx)(M.Icon,{asChild:!0,children:(0,$o.jsx)(Te.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));De.displayName=M.Trigger.displayName;var er=Je.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(M.ScrollUpButton,{className:h("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,$o.jsx)(Te.ChevronUp,{className:"h-4 w-4"})}));er.displayName=M.ScrollUpButton.displayName;var tr=Je.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(M.ScrollDownButton,{className:h("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,$o.jsx)(Te.ChevronDown,{className:"h-4 w-4"})}));tr.displayName=M.ScrollDownButton.displayName;var Pe=Je.forwardRef(({children:e,className:t,position:o="popper",...r},i)=>(0,$o.jsx)(M.Portal,{children:(0,$o.jsxs)(M.Content,{className:h("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-$o-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-$o-1",t),position:o,ref:i,...r,children:[(0,$o.jsx)(er,{}),(0,$o.jsx)(M.Viewport,{className:h("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,$o.jsx)(tr,{})]})}));Pe.displayName=M.Content.displayName;var ui=Je.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(M.Label,{className:h("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));ui.displayName=M.Label.displayName;var fe=Je.forwardRef(({children:e,className:t,...o},r)=>(0,$o.jsxs)(M.Item,{className:h("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:r,...o,children:[(0,$o.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$o.jsx)(M.ItemIndicator,{children:(0,$o.jsx)(Te.Check,{className:"h-4 w-4"})})}),(0,$o.jsx)(M.ItemText,{children:e})]}));fe.displayName=M.Item.displayName;var fi=Je.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(M.Separator,{className:h("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));fi.displayName=M.Separator.displayName;var or=X(require("react")),io=X(require("@radix-ui/react-label"));var gi=(0,zo.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=or.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(io.Root,{ref:o,className:h(gi(),e),...t}));L.displayName=io.Root.displayName;var at=X(require("react")),mt=X(require("@radix-ui/react-toggle-group"));var ir=X(require("react")),no=X(require("@radix-ui/react-toggle"));var so=(0,zo.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"}}),vi=ir.forwardRef(({className:e,variant:t,size:o,...r},i)=>(0,$o.jsx)(no.Root,{ref:i,className:h(so({variant:t,size:o,className:e})),...r}));vi.displayName=no.Root.displayName;var lr=at.createContext({size:"default",variant:"default"}),it=at.forwardRef(({className:e,variant:t,size:o,children:r,...i},a)=>(0,$o.jsx)(mt.Root,{ref:a,className:h("flex items-center justify-center gap-1",e),...i,children:(0,$o.jsx)(lr.Provider,{value:{variant:t,size:o},children:r})}));it.displayName=mt.Root.displayName;var nt=at.forwardRef(({className:e,children:t,variant:o,size:r,...i},a)=>{let n=at.useContext(lr);return(0,$o.jsx)(mt.Item,{ref:a,className:h(so({variant:n.variant||o,size:n.size||r}),e),...i,children:t})});nt.displayName=mt.Item.displayName;var bi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Te.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Te.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Te.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Te.Zap}],hi=[{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"}],cr=({isOpen:e,onClose:t,onAddTask:o,epics:r,sprints:i,assignees:a,defaultEpicId:n})=>{let[s,d]=(0,yt.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,yt.useEffect)(()=>{e&&n&&d(m=>({...m,epic:n}))},[e,n]),(0,yt.useEffect)(()=>{e&&d({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"none",assignee:""})},[e]);let p=m=>{m.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}),d({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:n||"",sprint:"",assignee:""}),t())},l=(m,u)=>{d(b=>({...b,[m]:u}))};return(0,$o.jsx)(Se,{open:e,onOpenChange:t,children:(0,$o.jsxs)(Ie,{className:"sm:max-w-md",children:[(0,$o.jsx)(Ee,{children:(0,$o.jsx)(xe,{children:"Add New Task"})}),(0,$o.jsxs)("form",{onSubmit:p,className:"space-$o-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"name",children:"Task Title"}),(0,$o.jsx)(ue,{id:"name",value:s.name,onChange:m=>l("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"description",children:"Description"}),(0,$o.jsx)(Ae,{id:"description",value:s.description,onChange:m=>l("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Type"}),(0,$o.jsx)(it,{type:"single",value:s.type||"",onValueChange:m=>m&&l("type",m),children:bi.map(m=>{let u=m.icon;return(0,$o.jsxs)(nt,{value:m.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,$o.jsx)(u,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Priority"}),(0,$o.jsx)(it,{type:"single",value:s.priority||"",onValueChange:m=>m&&l("priority",m),children:hi.map(m=>(0,$o.jsx)(nt,{value:m.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:m.label},m.value))})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"points",children:"Story Points"}),(0,$o.jsx)(ue,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:m=>l("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!n&&(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"epic",children:"Epic"}),(0,$o.jsxs)(Le,{value:s.epic,onValueChange:m=>l("epic",m),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(rt,{placeholder:"Select an epic"})}),(0,$o.jsx)(Pe,{children:r.map(m=>(0,$o.jsx)(fe,{value:m.id.toString(),children:(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.id))})]})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,$o.jsxs)(Le,{value:s.sprint,onValueChange:m=>l("sprint",m),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(rt,{placeholder:"Select a sprint"})}),(0,$o.jsxs)(Pe,{children:[(0,$o.jsx)(fe,{value:"none",children:"No Sprint"}),i.map(m=>(0,$o.jsx)(fe,{value:m.id.toString(),children:(0,$o.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"sprint",children:"Assignee"}),(0,$o.jsxs)(Le,{value:s.assignee,onValueChange:m=>l("assignee",m),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(rt,{placeholder:"Select an Assignee"})}),(0,$o.jsxs)(Pe,{children:[(0,$o.jsx)(fe,{value:"none",children:"No Assignee"}),a.map(m=>(0,$o.jsx)(fe,{value:m.id.toString(),children:(0,$o.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,$o.jsxs)(xt,{children:[(0,$o.jsx)(A,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,$o.jsx)(A,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var wt=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:i,className:a="",disabled:n=!1})=>{let[s,d]=(0,yt.useState)(!1),[p,l]=(0,yt.useState)(""),m=()=>{n||(d(!0),l(t))},u=async()=>{p!==t&&await i(e,p),d(!1)},b=g=>{g.key==="Enter"&&!r||g.key==="Enter"&&g.ctrlKey&&r?u():g.key==="Escape"&&(d(!1),l(""))};return(0,$o.jsxs)("div",{className:`space-$o-2 ${a}`,children:[(0,$o.jsx)(L,{children:o}),s?r?(0,$o.jsx)(Ae,{value:p,onChange:g=>l(g.target.value),onBlur:u,onKeyDown:b,autoFocus:!0,rows:4,className:"resize-none"}):(0,$o.jsx)(ue,{value:p,onChange:g=>l(g.target.value),onBlur:u,onKeyPress:b,autoFocus:!0,className:"text-lg font-medium"}):(0,$o.jsxs)("div",{onClick:m,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 ${r?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,$o.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,$o.jsx)(Te.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Bt=X(require("react")),Ge=X(require("@radix-ui/react-avatar"));var co=Bt.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(Ge.Root,{ref:o,className:h("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));co.displayName=Ge.Root.displayName;var xi=Bt.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(Ge.Image,{ref:o,className:h("aspect-square h-full w-full",e),...t}));xi.displayName=Ge.Image.displayName;var mo=Bt.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(Ge.Fallback,{ref:o,className:h("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));mo.displayName=Ge.Fallback.displayName;var pr=({comments:e,onAddComment:t})=>{let[o,r]=(0,yt.useState)(""),i=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),a=()=>{o.trim()&&(t(o),r(""))};return(0,$o.jsxs)("div",{className:"space-$o-4",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)(Te.MessageSquare,{className:"h-5 w-5"}),(0,$o.jsx)(L,{className:"text-lg font-medium",children:"Comments"}),(0,$o.jsx)(Ne,{variant:"secondary",children:e.length})]}),(0,$o.jsx)("div",{className:"space-$o-4 max-h-60 overflow-$o-auto",children:e.map(n=>(0,$o.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,$o.jsx)(co,{className:"h-8 w-8 mt-1",children:(0,$o.jsx)(mo,{className:"text-xs bg-muted text-muted-foreground",children:i(n.author)})}),(0,$o.jsxs)("div",{className:"flex-1",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,$o.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,$o.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,$o.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,$o.jsxs)("div",{className:"flex gap-2",children:[(0,$o.jsx)(Ae,{value:o,onChange:n=>r(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,$o.jsx)(A,{onClick:a,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,$o.jsx)(Te.Send,{className:"h-4 w-4"})})]})]})};var Ut=({label:e,value:t,onValueChange:o,options:r,showColor:i=!1,disabled:a=!1})=>{let[n,s]=(0,yt.useState)(!1),d=r.find(l=>l.value===t);return(0,$o.jsxs)("div",{className:"space-$o-1",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:e}),(0,$o.jsxs)(Le,{value:t,onValueChange:o,open:n,onOpenChange:l=>{a||s(l)},disabled:a,children:[(0,$o.jsx)(De,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,$o.jsxs)(Ne,{variant:"secondary",className:`${a?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!a&&s(!n),children:[i&&d?.color&&(0,$o.jsx)("div",{className:`w-2 h-2 rounded-full ${d.color} yt-1`}),d?.label||"Select..."]})}),(0,$o.jsx)(Pe,{children:r.map(l=>(0,$o.jsx)(fe,{value:l.value,children:i&&l.color?(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var fr=({label:e,value:t,onValueChange:o,options:r,placeholder:i="Search...",allowCustomValue:a=!1,disabled:n=!1})=>{let[s,d]=(0,yt.useState)(!1),[p,l]=(0,yt.useState)(""),m=r.find(c=>c.value===t),u=r.filter(c=>c.label.toLowerCase().includes(p.toLowerCase())),b=c=>{o(c),d(!1),l("")},g=()=>{a&&p.trim()&&!r.find(c=>c.value===p.trim())&&(o(p.trim()),d(!1),l(""))};return(0,$o.jsxs)("div",{className:"space-$o-1",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:e}),(0,$o.jsxs)(Le,{value:t,onValueChange:b,open:s,onOpenChange:c=>{n||d(c)},disabled:n,children:[(0,$o.jsx)(De,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,$o.jsx)(Ne,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&d(!s),children:m?.label||t||"Select..."})}),(0,$o.jsxs)(Pe,{children:[(0,$o.jsx)("div",{className:"p-2",children:(0,$o.jsx)(ue,{placeholder:i,value:p,onChange:c=>l(c.target.value),onKeyDown:c=>{c.key==="Enter"&&a&&g()},className:"mb-2"})}),u.map(c=>(0,$o.jsx)(fe,{value:c.value,children:c.label},c.value)),a&&p.trim()&&!u.find(c=>c.value===p.trim())&&(0,$o.jsxs)(fe,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var pt=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var yi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Te.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Te.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Te.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Te.Zap}],wi=[{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 gr=({task:e,epics:t,sprints:o,lastUpdated:r,onUpdateTask:i,onClose:a,onDelete:n,isUpdating:s=!1,isDeleting:d=!1,deleteState:p="idle",teamMembers:l})=>{let[m,u]=(0,yt.useState)(e.storyPoints),b=(0,yt.useRef)(null),[g,S]=(0,yt.useState)(l);(0,yt.useEffect)(()=>{S(l)},[l]);let c=(0,yt.useCallback)((v,D)=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{i(v,D)},500)},[i]);(0,yt.useEffect)(()=>{c("storyPoints",m?.toString()||"1")},[m]);let f=v=>v.split(" ").map(D=>D[0]).join("").toUpperCase(),E=()=>p==="loading"?(0,$o.jsxs)(A,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,$o.jsx)(Te.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,$o.jsxs)(A,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,$o.jsx)(Te.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,$o.jsxs)(A,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,$o.jsx)(Te.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,$o.jsxs)(A,{onClick:n,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||d,children:[(0,$o.jsx)(Te.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,$o.jsxs)("div",{className:"flex flex-col h-full",children:[(0,$o.jsxs)("div",{className:"space-$o-4",style:{opacity:s?.6:1},children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Status"}),(0,$o.jsx)(Ut,{label:"",value:e.status,onValueChange:v=>i("status",v),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Type"}),(0,$o.jsx)(it,{type:"single",value:e.type||"",onValueChange:v=>v&&i("type",v),className:"grid grid-cols-2 gap-1",disabled:s,children:yi.map(v=>{let D=v.icon;return(0,$o.jsxs)(nt,{value:v.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,$o.jsx)(D,{className:"h-3 w-3"}),v.label]},v.value)})})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,$o.jsx)(it,{type:"single",value:e.priority||"",onValueChange:v=>v&&i("priority",v),className:"grid grid-cols-3 gap-1",disabled:s,children:wi.map(v=>(0,$o.jsx)(nt,{value:v.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:v.label},v.value))})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,$o.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:v=>{let D=Number(v.target.value);D<1?u(1):D>100?u(100):u(D)},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,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,$o.jsx)(Ut,{label:"",value:pt(e.epic).toString(),onValueChange:v=>i("epic",v),options:(t||[]).map(v=>({value:v.id.toString(),label:v?.name,color:v.color})),showColor:!0,disabled:s})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,$o.jsx)(Ut,{label:"",value:pt(e.sprint).toString()||"none",onValueChange:v=>i("sprint",v==="none"?"":v),options:[{value:"none",label:"No Sprint"},...(o||[]).map(v=>({value:v.id.toString(),label:`${v?.name}`}))],disabled:s})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,$o.jsx)(fr,{label:"",value:e.assignee?.value?.name,onValueChange:v=>i("assignee",v),options:g.map(v=>({value:`${typeof v.email=="string"?"users":"digital-colleagues"}:${v.id}`,label:v?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,$o.jsxs)("div",{className:"mt-auto pt-4 space-$o-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(A,{onClick:a,variant:"outline",className:"w-full h-8 text-xs",disabled:s||d,children:"Close"}),E()]}),(0,$o.jsxs)("div",{className:"pt-4 border-t border-border space-$o-2",children:[(0,$o.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,$o.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,$o.jsx)(Te.User,{className:"h-3 w-3"}),(0,$o.jsx)("span",{children:"System"})]})]}),(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,$o.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,$o.jsx)(Te.Calendar,{className:"h-3 w-3"}),(0,$o.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,$o.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,$o.jsx)(Te.Clock,{className:"h-3 w-3"}),(0,$o.jsxs)("span",{children:[new Date(r).toLocaleDateString()," at"," ",new Date(r).toLocaleTimeString()]})]})]})]})]})]})};var So=require("motion/react");var oa=X(require("@radix-ui/react-dialog"));var $r=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),_r=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Gr=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Wr=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),Kr=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),jr=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),Zr=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Zt=require("@payloadcms/richtext-lexical/lexical/list"),Jr=require("@payloadcms/richtext-lexical/lexical/rich-text"),Xr=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Ur=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),kt=require("@payloadcms/richtext-lexical/lexical/utils"),R=require("@payloadcms/richtext-lexical/lexical"),No=require("@payloadcms/richtext-lexical/lexical/selection");var Dr=require("@radix-ui/react-dialog"),Gt=require("@payloadcms/richtext-lexical/client");var fo=X(require("bson-objectid"));var br=require("@payloadcms/ui");var vr=X(require("react")),He=X(require("@radix-ui/react-tooltip"));var zt=He.Provider,$t=He.Root,_t=He.Trigger,Ct=vr.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,$o.jsx)(He.Portal,{children:(0,$o.jsx)(He.Content,{ref:r,sideOffset:t,className:h("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})}));Ct.displayName=He.Content.displayName;var Ci=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[i]=(0,Ur.useLexicalComposerContext)(),[a,n]=(0,yt.useState)(""),[s,d]=(0,yt.useState)(""),[p,l]=(0,yt.useState)(""),m=async c=>{console.log("fetchMedia",c)};(0,yt.useEffect)(()=>{typeof o=="string"?o.length===24?m(o):(n(o||""),l(S(g())),d(b()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),l(S(o.filesize)),d(o.mimeType?.split("/")[1]||""))},[]);let u=(0,yt.useCallback)(()=>{i.update(()=>{(0,R.$getNodeByKey)(r)?.remove()})},[i,r]),b=()=>{let c=e.data.value;return typeof c=="string"?c.split(";base64")[0]?.split("image/")[1]:""},g=()=>{let c=e.data.value;if(typeof c=="string"){let f=c.split(",")[1]?.length||0;return 4*Math.ceil(f/3)*.5624896334383812/1e3}return 0};function S(c){if(c>=1e6){let E=c/1e6;return`${E>=10?Math.round(E).toString():E.toFixed(1)} MB`}return`${Math.floor(c/1e3)} KB`}return(0,$o.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,$o.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,$o.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,$o.jsx)("div",{className:"flex-1",children:e.data.value?(0,$o.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:a}):(0,$o.jsx)(br.File,{})}),(0,$o.jsx)(zt,{children:(0,$o.jsxs)($t,{children:[(0,$o.jsxs)(_t,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,$o.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,$o.jsx)("button",{onClick:c=>{c.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,$o.jsx)(Te.X,{width:24,height:24,strokeWidth:1})})]}),(0,$o.jsx)(Ct,{children:(0,$o.jsx)("span",{children:"Remove image"})})]})})]}),(0,$o.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,$o.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,$o.jsx)("span",{children:p})]})]})})},wr=Ci;function Ni(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:ut({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Nt=class extends Gt.UploadNode{static importDOM(){return{img:()=>({conversion:Ni,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new fo.default().toHexString(),t.version=3);let o={id:t.id??new fo.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=ut(o);return r.setFormat?.(t.format),r}decorate(){return(0,$o.jsx)(wr,{data:this.__data,nodeKey:this.getKey()})}};function ut(e){return new Nt({data:e})}var Ti=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Si=e=>Ti?(e||window).getSelection():null,Us=(0,R.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),go=(0,R.createCommand)("INSERT_UPLOAD_COMMAND");function Pr({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,yt.useRef)(!1),[i,a]=(0,yt.useState)(!0),[n,s]=(0,yt.useState)(""),[d,p]=(0,yt.useState)(""),[l,m]=(0,yt.useState)(!1),[u,b]=(0,yt.useState)("left"),g=n==="",S=D=>{m(D.target.checked)},c=D=>{b(D.target.value)},f=D=>{let Q=new FileReader;Q.onload=function(){return typeof Q.result=="string"&&s(Q.result),""},D!==null&&D[0]&&Q.readAsDataURL(D[0])};(0,yt.useEffect)(()=>{r.current=!1;let D=Q=>{r.current=Q.altKey};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[e]),(0,yt.useEffect)(()=>{i||t()},[i]),(0,yt.useEffect)(()=>{a(o)},[o]);let E=({editor:D,relationTo:Q,replaceNodeKey:Ce,value:Me})=>{if(Ce)D.update(()=>{let de=(0,R.$getNodeByKey)(Ce);de&&de.replace(ut({id:"",fields:{},relationTo:"media",value:Me}))});else{let de=D.dispatchCommand(go,{fields:null,relationTo:"media",value:Me})}},v=()=>{E({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:d,src:n,showCaption:l,position:u}.src}),a(!1),t()};return(0,$o.jsx)(Se,{open:i,onOpenChange:D=>a(D),children:(0,$o.jsxs)(Ie,{children:[(0,$o.jsxs)(Ee,{children:[(0,$o.jsx)(xe,{children:"Upload Image"}),(0,$o.jsx)(Dr.DialogDescription,{children:"Description"})]}),(0,$o.jsxs)("div",{className:"",children:[(0,$o.jsx)("div",{style:{marginBottom:"1em"},children:(0,$o.jsx)(ue,{type:"file",onChange:D=>f(D.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,$o.jsx)("div",{style:{marginBottom:"1em"},children:(0,$o.jsx)(ue,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:D=>p(D.currentTarget.value),value:d,"data-test-id":"image-modal-alt-text-input"})}),(0,$o.jsx)(A,{"data-test-id":"image-modal-file-upload-btn",disabled:g,onClick:()=>v(),children:"Confirm"})]})]})})}function vo({captionsEnabled:e}){let[t]=(0,Ur.useLexicalComposerContext)();return(0,yt.useEffect)(()=>{if(!t.hasNodes([Gt.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,kt.mergeRegister)(t.registerCommand(R.DRAGSTART_COMMAND,o=>Di(o),R.COMMAND_PRIORITY_HIGH),t.registerCommand(R.DRAGOVER_COMMAND,o=>Pi(o),R.COMMAND_PRIORITY_LOW),t.registerCommand(R.DROP_COMMAND,o=>ki(o,t),R.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Di(e){if(!bo())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function Pi(e){return bo()?(kr(e)||e.preventDefault(),!0):!1}function ki(e,t){let o=bo();if(!o)return!1;if(e.preventDefault(),kr(e)){let r=Ri(e);o.remove();let i=(0,R.$createRangeSelection)();r!=null&&i.applyDOMRange(r),(0,R.$setSelection)(i)}return!0}function bo(){let e=(0,R.$getSelection)();if(!(0,R.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,Gt.$isUploadNode)(o)?o:null}function kr(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 Ri(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,i=Si(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset||0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Mi=()=>(0,$o.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,$o.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"})}),Rr=Mi;var Ii=()=>(0,$o.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,$o.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"})}),Mr=Ii;var Ei=()=>(0,$o.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,$o.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,$o.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Ir=Ei;var Ai=()=>(0,$o.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,$o.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,$o.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Er=Ai;var Li=()=>(0,$o.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,$o.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"})}),Ar=Li;var Hi=()=>(0,$o.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,$o.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"})}),Lr=Hi;var Hr=()=>(0,$o.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,$o.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"})}),Fr=()=>(0,$o.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,$o.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"})}),Br=()=>(0,$o.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,$o.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"})}),Or=()=>(0,$o.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,$o.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"})}),Vr=()=>(0,$o.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,$o.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 We=X(require("react")),I=X(require("@radix-ui/react-dropdown-menu")),ft=require("@radix-ui/react-icons");var Wt=I.Root,Kt=I.Trigger;var Fi=We.forwardRef(({className:e,inset:t,children:o,...r},i)=>(0,$o.jsxs)(I.SubTrigger,{ref:i,className:h("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),...r,children:[o,(0,$o.jsx)(ft.ChevronRightIcon,{className:"ml-auto"})]}));Fi.displayName=I.SubTrigger.displayName;var Bi=We.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(I.SubContent,{ref:o,className:h("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}));Bi.displayName=I.SubContent.displayName;var Dt=We.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,$o.jsx)(I.Portal,{children:(0,$o.jsx)(I.Content,{ref:r,sideOffset:t,className:h("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})}));Dt.displayName=I.Content.displayName;var Pt=We.forwardRef(({className:e,inset:t,...o},r)=>(0,$o.jsx)(I.Item,{ref:r,className:h("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}));Pt.displayName=I.Item.displayName;var Oi=We.forwardRef(({className:e,children:t,checked:o,...r},i)=>(0,$o.jsxs)(I.CheckboxItem,{ref:i,className:h("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[(0,$o.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$o.jsx)(I.ItemIndicator,{children:(0,$o.jsx)(ft.CheckIcon,{className:"h-4 w-4"})})}),t]}));Oi.displayName=I.CheckboxItem.displayName;var Vi=We.forwardRef(({className:e,children:t,...o},r)=>(0,$o.jsxs)(I.RadioItem,{ref:r,className:h("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,$o.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$o.jsx)(I.ItemIndicator,{children:(0,$o.jsx)(ft.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Vi.displayName=I.RadioItem.displayName;var Ui=We.forwardRef(({className:e,inset:t,...o},r)=>(0,$o.jsx)(I.Label,{ref:r,className:h("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Ui.displayName=I.Label.displayName;var zi=We.forwardRef(({className:e,...t},o)=>(0,$o.jsx)(I.Separator,{ref:o,className:h("-mx-1 my-1 h-px bg-muted",e),...t}));zi.displayName=I.Separator.displayName;var $i=({className:e,...t})=>(0,$o.jsx)("span",{className:h("ml-auto text-xs tracking-widest opacity-60",e),...t});$i.displayName="DropdownMenuShortcut";var Co=1;function _i(){return(0,$o.jsx)("span",{className:"border border-[#222222]"})}function To(){let[e]=(0,Ur.useLexicalComposerContext)(),t=(0,yt.useRef)(null),[o,r]=(0,yt.useState)(!1),[i,a]=(0,yt.useState)(!1),[n,s]=(0,yt.useState)(!1),[d,p]=(0,yt.useState)(!1),[l,m]=(0,yt.useState)(!1),[u,b]=(0,yt.useState)(!1),[g,S]=(0,yt.useState)(!1),[c,f]=(0,yt.useState)(!1),[E,v]=(0,yt.useState)(!1),[D,Q]=(0,yt.useState)("left"),[Ce,Me]=(0,yt.useState)("p"),de=x=>{e.update(()=>{let U=(0,R.$getSelection)();(0,R.$isRangeSelection)(U)&&(x==="p"?(0,No.$setBlocksType)(U,()=>(0,R.$createParagraphNode)()):(0,No.$setBlocksType)(U,()=>(0,Jr.$createHeadingNode)(x)))})},me=(0,yt.useCallback)(()=>{let x=(0,R.$getSelection)();if((0,R.$isRangeSelection)(x)){s(x.hasFormat("bold")),p(x.hasFormat("italic")),m(x.hasFormat("underline")),b(x.hasFormat("strikethrough")),S(x.hasFormat("subscript")),f(x.hasFormat("superscript"));let U=x.anchor.getNode(),z=U;for(;z&&!(0,R.$isParagraphNode)(z)&&z!==(0,R.$getRoot)();){let K=z.getParent();K&&(z=K)}if(z){let K=z.getFormatType();Q(K||"left")}let pe=U.getTopLevelElement()?.__tag;Me(pe||"p")}},[]);(0,yt.useEffect)(()=>(0,kt.mergeRegister)(e.registerUpdateListener(({editorState:x})=>{x.read(()=>{me()})}),e.registerCommand(R.SELECTION_CHANGE_COMMAND,(x,U)=>(me(),!1),Co),e.registerCommand(R.CAN_UNDO_COMMAND,x=>(r(x),!1),Co),e.registerCommand(R.CAN_REDO_COMMAND,x=>(a(x),!1),Co),(0,kt.mergeRegister)(e.registerCommand(go,x=>(e.update(()=>{let U=(0,R.$getSelection)()||(0,R.$getPreviousSelection)();if((0,R.$isRangeSelection)(U)){let z=ut({id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}),{focus:pe}=U,K=pe.getNode();(0,kt.$insertNodeToNearestRoot)(z),(0,R.$isParagraphNode)(K)&&!K.__first&&K.remove()}}),!0),R.COMMAND_PRIORITY_EDITOR))),[e,me]);let ge=[[{label:"Undo",icon:(0,$o.jsx)(Te.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(R.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,$o.jsx)(Te.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(R.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,$o.jsx)(Rr,{}),onClick:()=>{e.dispatchCommand(R.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,$o.jsx)(Mr,{}),onClick:()=>{e.dispatchCommand(R.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:d},{label:"Underline",icon:(0,$o.jsx)(Ir,{}),onClick:()=>{e.dispatchCommand(R.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:l},{label:"Strikethrough",icon:(0,$o.jsx)(Er,{}),onClick:()=>{e.dispatchCommand(R.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,$o.jsx)(Ar,{}),onClick:()=>{e.dispatchCommand(R.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:g},{label:"Superscript",icon:(0,$o.jsx)(Lr,{}),onClick:()=>{e.dispatchCommand(R.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:c}]],be=[{label:"Left Align",direction:"left",icon:(0,$o.jsx)(Te.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(R.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,$o.jsx)(Te.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(R.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,$o.jsx)(Te.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(R.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,$o.jsx)(Te.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(R.FORMAT_ELEMENT_COMMAND,"justify")}}],Be=[{label:"Normal Text",value:"p",icon:(0,$o.jsx)(Hr,{}),onClick:()=>de("p")},{label:"Heading 1",value:"h1",icon:(0,$o.jsx)(Fr,{}),onClick:()=>de("h1")},{label:"Heading 2",value:"h2",icon:(0,$o.jsx)(Br,{}),onClick:()=>de("h2")},{label:"Heading 3",value:"h3",icon:(0,$o.jsx)(Or,{}),onClick:()=>de("h3")},{label:"Heading 4",value:"h4",icon:(0,$o.jsx)(Vr,{}),onClick:()=>de("h4")},...[{label:"Unordered List",value:"ul",icon:(0,$o.jsx)(Te.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Zt.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,$o.jsx)(Te.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Zt.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ze=[{label:"Insert Image",icon:(0,$o.jsx)(Te.ImageUp,{width:15,height:15}),onClick:()=>{v(!0)},disabled:!1}];return(0,$o.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,$o.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[ge.map((x,U)=>(0,$o.jsxs)(yt.Fragment,{children:[(0,$o.jsx)("div",{className:"flex items-center gap-2",children:x.map((z,pe)=>(0,$o.jsx)("div",{role:"button","aria-disabled":z.disabled||!1,onClick:z.onClick,className:h("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]",z.active&&"bg-[#3c3c3c]"),"aria-label":z.label,children:(0,$o.jsx)(zt,{children:(0,$o.jsxs)($t,{children:[(0,$o.jsx)(_t,{className:"text-[#b5b5b5]",children:z.icon}),(0,$o.jsx)(Ct,{children:(0,$o.jsx)("p",{children:z.label})})]})})},pe))}),(0,$o.jsx)(_i,{})]},`toolbar-option-${x.length}-${U}`)),(0,$o.jsxs)(Wt,{children:[(0,$o.jsxs)(Kt,{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:[be.find(x=>x.direction===D)?.icon,be.find(x=>x.direction===D)?.label,(0,$o.jsx)(Te.ChevronDown,{width:15,height:15})]}),(0,$o.jsx)(Dt,{className:"bg-black hover:bg-black",children:be.map((x,U)=>(0,$o.jsxs)(Pt,{onClick:x.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,$o.jsx)("span",{children:x.icon}),(0,$o.jsx)("span",{children:x.label})]},`${x.label}-${U}`))})]}),(0,$o.jsxs)(Wt,{children:[(0,$o.jsxs)(Kt,{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:[Be.find(x=>x.value===Ce)?.icon,Be.find(x=>x.value===Ce)?.label,(0,$o.jsx)(Te.ChevronDown,{width:15,height:15})]}),(0,$o.jsx)(Dt,{className:"bg-black hover:bg-black",children:Be.map((x,U)=>(0,$o.jsxs)(Pt,{onClick:x.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,$o.jsx)("span",{children:x.icon}),(0,$o.jsx)("span",{children:x.label})]},`heading-option-${x.label}-${U}`))})]}),(0,$o.jsxs)(Wt,{children:[(0,$o.jsxs)(Kt,{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,$o.jsx)(Te.Plus,{width:15,height:15}),(0,$o.jsx)(Te.ChevronDown,{width:15,height:15})]}),(0,$o.jsx)(Dt,{className:"bg-black hover:bg-black",children:ze.map((x,U)=>(0,$o.jsxs)(Pt,{onClick:x.onClick,disabled:x.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,$o.jsx)("span",{children:x.icon}),(0,$o.jsx)("span",{children:x.label})]},U))})]}),E&&(0,$o.jsx)(Pr,{activeEditor:e,onClose:()=>{v(!1)},isOpen:E})]})})}var Gi=({setValue:e,value:t,name:o,editable:r=!0})=>{let[i]=(0,Ur.useLexicalComposerContext)(),a=(0,yt.useRef)(null),n=s=>{s.read(()=>{let d=s.toJSON();JSON.stringify(d)!==JSON.stringify(a.current)&&(a.current=d,e?.(()=>d))})};return(0,yt.useEffect)(()=>{i.setEditable(r)},[r,i]),(0,yt.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(a.current)&&i.update(()=>{try{let s=i.parseEditorState(t);i.setEditorState(s),a.current=t}catch(s){console.error("Error parsing editor state:",s)}},{discrete:!0})},[t,i]),(0,$o.jsx)("div",{className:"w-full",children:(0,$o.jsxs)("div",{className:" ",children:[r&&(0,$o.jsx)(To,{}),(0,$o.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,$o.jsx)(jr.RichTextPlugin,{contentEditable:(0,$o.jsx)(Gr.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Wr.LexicalErrorBoundary}),r&&(0,$o.jsxs)($o.Fragment,{children:[(0,$o.jsx)(Kr.HistoryPlugin,{}),(0,$o.jsx)($r.AutoFocusPlugin,{}),(0,$o.jsx)(Zr.ListPlugin,{}),(0,$o.jsx)(Xr.OnChangePlugin,{onChange:n}),(0,$o.jsx)(vo,{})]})]})]})})},Wi=({setValue:e,value:t,name:o,editable:r=!0})=>(0,$o.jsx)(_r.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Zt.ListNode,Zt.ListItemNode,Jr.HeadingNode,Nt],onError(a){throw console.error("Lexical error:",a),a},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,$o.jsx)(Gi,{value:t,setValue:e,name:o,editable:r})}),Yr=Wi;var Mt=e=>"mimeType"in e&&"url"in e&&!("format"in e),Ki=e=>{if(!e?.root?.children)return"";let t=[],o=a=>{if(!a)return"";switch(a.type){case"heading":{let n=a.tag?parseInt(a.tag.replace("h","")):1,s=r(a.children||[]);return"#".repeat(n)+" "+s}case"paragraph":return a.children&&a.children.some(d=>d.type==="text"?d.text&&d.text.trim().length>0:(d.type==="linebreak",!0))?r(a.children||[]):"";case"list":{let n=[],s=a.listType==="number"?"1.":"-";return a.children?.forEach((d,p)=>{if(d.type==="listitem"){let l=r(d.children||[]),m=a.listType==="number"?`${p+1}.`:s;n.push(`${m} ${l}`)}}),n.join(`
|
|
6
|
+
`)}case"listitem":return r(a.children||[]);case"text":{let n=a.text||"";if(a.format){let s=(a.format&1)!==0,d=(a.format&2)!==0,p=(a.format&4)!==0,l=(a.format&8)!==0;(a.format&16)!==0?n=`\`${n}\``:(s&&(n=`**${n}**`),d&&(n=`*${n}*`),p&&(n=`~~${n}~~`),l&&(n=`<u>${n}</u>`))}return n}default:return a.children?r(a.children):""}},r=a=>a.map(n=>{if(n.type==="text"){let s=n.text||"";if(n.format){let d=(n.format&1)!==0,p=(n.format&2)!==0,l=(n.format&4)!==0,m=(n.format&8)!==0;(n.format&16)!==0?s=`\`${s}\``:(d&&(s=`**${s}**`),p&&(s=`*${s}*`),l&&(s=`~~${s}~~`),m&&(s=`<u>${s}</u>`))}return s}else{if(n.type==="paragraph")return r(n.children||[]);if(n.type==="listitem")return r(n.children||[]);if(n.type==="linebreak")return`
|
|
7
|
+
`}return o(n)}).filter(Boolean).join("");e.root.children.forEach(a=>{let n=o(a);a.type==="paragraph"?t.push(n||""):n&&t.push(n)});let i=[];for(let a=0;a<t.length;a++)i.push(t[a]),a<t.length-1&&(t[a]===""||t[a+1]===""||i.push(""));return i.join(`
|
|
8
|
+
`)},Ye=e=>{let t=[],o=0;for(;o<e.length;){let i=e.slice(o).match(/^<u\s*[^>]*>([\s\S]*?)<\/u>/i);if(i&&i[0]){let u=i[1]||"",b=u?Ye(u):[];b.length>0?(b.forEach(g=>{g.type==="text"&&(g.format=(g.format||0)|8)}),t.push(...b)):u===""&&t.push({type:"text",text:"",format:8}),o+=i[0].length;continue}if(e.slice(o).startsWith("</u>")){o+=4;continue}let a=e.slice(o).match(/^(`+)([^`]+)\1/);if(a){let u=a[2];u&&t.push({type:"text",text:u,format:16}),o+=a[0].length;continue}let n=e.slice(o).match(/^(~~)(.+?)\1/);if(n){let u=n[2],b=Ye(u);b.forEach(g=>{g.type==="text"&&(g.format=(g.format||0)|4)}),t.push(...b),o+=n[0].length;continue}let s=e.slice(o).match(/^(\*\*|__)(.+?)\1/);if(s){let u=s[2],b=Ye(u);b.forEach(g=>{g.type==="text"&&(g.format=(g.format||0)|1)}),t.push(...b),o+=s[0].length;continue}let d=e.slice(o).match(/^(\*|_)([^*_\n]+?)\1(?!\*|_)/);if(d&&d[0].length>2){let u=d[2],b=Ye(u);b.forEach(g=>{g.type==="text"&&(g.format=(g.format||0)|2)}),t.push(...b),o+=d[0].length;continue}if(e[o]===`
|
|
9
|
+
`){t.push({type:"linebreak",version:1}),o+=1;continue}let p=e.length,l=[{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:u}of l){let b=e.slice(o+1).search(u);b!==-1&&b+1<p-o&&(p=o+b+1)}let m=e.slice(o,p);m&&t.push({type:"text",text:m,format:0}),o=p}let r=[];for(let i of t)i.type==="linebreak"?r.push(i):r.length>0&&r[r.length-1].type==="text"&&i.type==="text"&&r[r.length-1].format===i.format?r[r.length-1].text+=i.text:r.push(i);return r.length>0?r:[{type:"text",text:"",format:0}]},ji=e=>{let t=e.split(`
|
|
10
|
+
`),o=[],r=[],i=[],a=null,n=()=>{if(r.length>0){for(let d=0;d<r.length;d++){let p=r[d],l=Ye(p),m=l.length>0?l.map(u=>({...u,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];o.push({type:"paragraph",children:m,direction:"ltr",format:"",indent:0,version:1})}r=[]}},s=()=>{i.length>0&&a&&(o.push({type:"list",listType:a,tag:a==="number"?"ol":"ul",start:1,format:"",indent:0,version:1,direction:"ltr",children:i}),i=[],a=null)};for(let d of t){let p=d.trim();if(!p){n(),s(),o.push({children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""});continue}let l=p.match(/^(#{1,6})\s+(.+)$/);if(l){n(),s();let b=l[1].length,g=l[2],S=Ye(g);o.push({type:"heading",tag:`h${b}`,children:S.length>0?S:[{type:"text",text:"",format:0}]});continue}let m=p.match(/^(\d+)\.\s+(.*)$/);if(m){n(),a==="bullet"&&s(),a!=="number"&&(i.length>0&&s(),a="number");let b=m[2]||"",g=Ye(b),S=g.length>0?g.map(c=>({...c,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];i.push({type:"listitem",value:i.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:S,direction:"ltr",format:"",indent:0,version:1}]});continue}let u=p.match(/^[-*+]\s+(.+)$/);if(u){n(),a==="number"&&s(),a!=="bullet"&&(i.length>0&&s(),a="bullet");let b=u[1],g=Ye(b),S=g.length>0?g.map(c=>({...c,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];i.push({type:"listitem",value:i.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:S,direction:"ltr",format:"",indent:0,version:1}]});continue}i.length>0&&s(),r.push(d)}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}}},Zi=async e=>{let t="",o,r="text";if(e.url)try{let i=e.url;!i.startsWith("http://")&&!i.startsWith("https://")&&!i.startsWith("/")&&(i="/"+i);let a=await fetch(i);a.ok?(t=await a.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed to fetch file content:",a.status,a.statusText)}catch(i){console.error("Failed to fetch file content:",i)}else console.warn("No URL provided for file:",e.name);return e.mimeType==="text/markdown"?(r="richText",o=ji(t)):e.mimeType?.startsWith("text/")&&(r="text"),{id:e.id.toString(),title:e.name,description:void 0,content:r==="richText"?void 0:t,richTextContent:r==="richText"?o:void 0,format:r,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function ea({document:e,onCancel:t,onSave:o,onFileUpdate:r}){let[i,a]=(0,yt.useState)(Mt(e)),[n,s]=(0,yt.useState)(Mt(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}),[d,p]=(0,yt.useState)(Mt(e)?void 0:n.richTextContent),[l,m]=(0,yt.useState)(!1),u=(0,yt.useRef)(Mt(e)?e:null);(0,yt.useEffect)(()=>{Mt(e)?(a(!0),Zi(e).then(c=>{s(c),p(c.richTextContent),a(!1)}).catch(c=>{c instanceof Error&&c.name!=="AbortError"&&(console.error("Failed to convert file:",c),a(!1))})):(s({...e,updatedAt:new Date}),p(e.richTextContent))},[e]);let b=c=>{switch(c){case"markdown":case"mdx":return(0,$o.jsx)(Te.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,$o.jsx)(Te.File,{className:"h-6 w-6 text-success"});case"text":return(0,$o.jsx)(Te.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,$o.jsx)(Te.File,{className:"h-6 w-6 text-muted-foreground"})}},g=c=>{switch(c){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"}},S=async()=>{m(!0);try{let c,f;if(u.current&&u.current.mimeType==="text/markdown"){let v=d?Ki(d):"";c={...n,format:"markdown",content:v,richTextContent:void 0},f=v}else c={...n,richTextContent:d},f=n.content||"";let E=u.current?u.current.id.toString():n.id;await Promise.resolve(o()),r?.(E,f)}finally{m(!1)}};return(0,$o.jsxs)(So.motion.div,{initial:{opacity:0,$o:20},animate:{opacity:1,$o:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,$o.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,$o.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,$o.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,$o.jsx)("div",{className:"flex-1 min-w-0",children:(0,$o.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,$o.jsx)("div",{className:"flex-1 min-w-0",children:(0,$o.jsx)(wt,{fieldName:"title",value:n.title,label:"",onSave:(c,f)=>s(E=>({...E,title:f})),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,$o.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${g(n.format)} flex-shrink-0 mt-1`,children:n.format.toUpperCase()})]})})}),(0,$o.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,$o.jsxs)(A,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,$o.jsx)(Te.X,{className:"h-4 w-4"}),"Close"]}),(0,$o.jsxs)(A,{size:"sm",onClick:S,className:"gap-2",disabled:l,children:[l?(0,$o.jsx)(Te.Loader2,{className:"h-4 w-4 animate-spin"}):(0,$o.jsx)(Te.Save,{className:"h-4 w-4"}),l?"Saving...":"Save"]})]})]})}),(0,$o.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,$o.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:i?(0,$o.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,$o.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,$o.jsx)(Te.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,$o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,$o.jsx)($o.Fragment,{children:n.format==="richText"?(0,$o.jsx)(Yr,{setValue:p,value:d,name:"richTextContent"},`richtext-${n.id}-${i?"loading":"loaded"}`):(0,$o.jsx)(Ae,{value:n.content||"",onChange:c=>s(f=>({...f,content:c.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var ta=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 aa({files:e,onFileClick:t,onFileDelete:o,onFileUpdate:r,showHeader:i=!0,className:a,viewMode:n="list"}){let[s,d]=(0,yt.useState)(!1),[p,l]=(0,yt.useState)(!1),[m,u]=(0,yt.useState)(null),b=()=>{d(!1),u(null)},g=()=>{l(!0),setTimeout(()=>{l(!1),d(!1),u(null)},500)},S=c=>{u(c),d(!0)};return(0,$o.jsxs)("div",{className:h("rounded-3xl border overflow-hidden",a),children:[(0,$o.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[i&&n==="list"&&(0,$o.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,$o.jsx)("div",{className:"col-span-6",children:"Name"}),(0,$o.jsx)("div",{className:"col-span-2",children:"Size"}),(0,$o.jsx)("div",{className:"col-span-2",children:"Modified"})]}),n==="card"&&(0,$o.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),n==="list"&&(0,$o.jsx)("div",{className:"divide-$o",children:e.map(c=>(0,$o.jsxs)(So.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(c),children:[(0,$o.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,$o.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,$o.jsx)("div",{children:(0,$o.jsx)("p",{className:"font-medium",children:c.name})})]}),(0,$o.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:ta(c.filesize)}),(0,$o.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,$o.jsx)("span",{className:"text-sm md:text-base",children:new Date(c.createdAt).toLocaleDateString()}),(0,$o.jsxs)("div",{className:"flex gap-1",children:[c.mimeType==="text/markdown"&&(0,$o.jsx)(A,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:f=>{f.stopPropagation(),S(c)},children:(0,$o.jsx)(Te.Edit,{className:"h-4 w-4"})}),(0,$o.jsx)(A,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:f=>{f.stopPropagation(),o?.(c)},children:(0,$o.jsx)(Te.Trash2,{className:"h-4 w-4"})})]})]})]},c.name))}),n==="card"&&(0,$o.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(c=>(0,$o.jsx)(So.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(c),children:(0,$o.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,$o.jsxs)("div",{className:"flex-1 min-w-0 space-$o-2",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$o.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,$o.jsx)("div",{className:"min-w-0 flex-1",children:(0,$o.jsx)("p",{className:"font-medium truncate",children:c.name})})]}),(0,$o.jsxs)("div",{className:"space-$o-1 text-sm text-muted-foreground pl-[52px]",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("span",{className:"font-medium",children:"Size:"}),(0,$o.jsx)("span",{children:ta(c.filesize)})]}),(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,$o.jsx)("span",{children:new Date(c.createdAt).toLocaleDateString()})]})]})]}),(0,$o.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[c.mimeType==="text/markdown"&&(0,$o.jsx)(A,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:f=>{f.stopPropagation(),S(c)},title:"Edit",children:(0,$o.jsx)(Te.Edit,{className:"h-4 w-4"})}),(0,$o.jsx)(A,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:f=>{f.stopPropagation(),o?.(c)},title:"Delete",children:(0,$o.jsx)(Te.Trash2,{className:"h-4 w-4"})})]})]})},c.name))}),(0,$o.jsx)(Se,{open:s,onOpenChange:c=>!c&&b(),children:(0,$o.jsxs)(ao,{children:[(0,$o.jsx)(Ht,{}),(0,$o.jsxs)(oa.Content,{className:h("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,$o.jsx)(xe,{className:"$o-only",children:m?`Edit ${m.name}`:"Edit File"}),p&&(0,$o.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,$o.jsx)(Te.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),m&&(0,$o.jsx)(ea,{document:m,onSave:g,onFileUpdate:r,onCancel:b})]})]})})]})}var ia=({isOpen:e,onClose:t,onAddFile:o})=>{let[r,i]=(0,yt.useState)(null),[a,n]=(0,yt.useState)(""),[s,d]=(0,yt.useState)(""),[p,l]=(0,yt.useState)(""),m=b=>{let g=b.target.files?.[0];g&&(i(g),a||n(g.name))},u=async b=>{if(b.preventDefault(),!r)return;let g=new FormData;g.append("file",r),g.append("name",a),s&&g.append("description",s),p&&g.append("tags",p),o?.(g),t(),i(null),n(""),d(""),l("")};return(0,$o.jsx)(Se,{open:e,onOpenChange:t,children:(0,$o.jsxs)(Ie,{className:"sm:max-w-md",children:[(0,$o.jsx)(Ee,{children:(0,$o.jsx)(xe,{children:"Add New File"})}),(0,$o.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,$o.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,$o.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,$o.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,$o.jsx)(Ji,{className:"w-10 h-10 text-gray-400"}),(0,$o.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,$o.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,$o.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,$o.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:m})]})}),r&&(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsxs)("div",{children:[(0,$o.jsx)("p",{className:"font-medium",children:r.name}),(0,$o.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((r.size||0)/1024).toFixed(2)," KB"]})]}),(0,$o.jsx)(A,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function Ji(e){return(0,$o.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,$o.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,$o.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,$o.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var na=({isOpen:e,onClose:t,initialTask:o,epics:r,sprints:i,onUpdateTask:a,onDeleteTask:n,onAddComment:s,colleagues:d,onUploadFile:p,onDeleteFile:l,onFileUpdate:m})=>{let[u,b]=(0,yt.useState)(o),[g,S]=(0,yt.useState)(new Date),[c,f]=(0,yt.useState)("idle"),[E,v]=(0,yt.useState)("idle"),[D,Q]=(0,yt.useState)(!1),[Ce,Me]=(0,yt.useState)([]),[de,me]=(0,yt.useState)(d);(0,yt.useEffect)(()=>{b(o)},[o]);let ge=async($,q)=>{if(q!==u[$]){f("loading");try{await a(u.id.toString(),{[$]:q}),S(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch(st){console.log("error",st),f("error"),setTimeout(()=>f("idle"),3e3)}}},be=async($,q)=>{if(q!==u[$]){f("loading");try{await a(u.id.toString(),{[$]:q}),S(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch(st){console.log("error",st),f("error"),setTimeout(()=>f("idle"),3e3)}}},V=async $=>{if(s){f("loading");try{await s?.({content:$,taskId:u.id.toString()}),S(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}}},Be=async()=>{v("loading");try{await n(u.id.toString()),v("success"),setTimeout(()=>{t(),v("idle")},1e3)}catch{v("error"),setTimeout(()=>v("idle"),3e3)}},ze=async $=>{if(p){f("loading");try{await p(u.id.toString(),$),S(new Date),f("success"),Q(!1),setTimeout(()=>f("idle"),1500)}catch(q){console.error("Error uploading file:",q),f("error"),setTimeout(()=>f("idle"),3e3)}}},x=async $=>{if(l){f("loading");try{await l(u.id.toString(),$.id.toString()),S(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch(q){console.error("Error deleting file:",q),f("error"),setTimeout(()=>f("idle"),3e3)}}},U=(u.files||[]).map($=>typeof $=="number"?null:$).filter($=>$!==null),z=c!=="loading"&&E!=="loading",pe=()=>{z&&t()},K=()=>c==="loading"?(0,$o.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,$o.jsx)(Te.Loader2,{className:"h-4 w-4 animate-spin"}),(0,$o.jsx)("span",{children:"Updating..."})]}):c==="success"?(0,$o.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,$o.jsx)(Te.Check,{className:"h-4 w-4"}),(0,$o.jsx)("span",{children:"Updated successfully"})]}):c==="error"?(0,$o.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,$o.jsx)(Te.X,{className:"h-4 w-4"}),(0,$o.jsx)("span",{children:"Update failed"})]}):null;return(0,$o.jsxs)(Se,{open:e,onOpenChange:pe,children:[(0,$o.jsxs)(Ie,{className:"max-w-3xl max-h-[80vh] overflow-$o-auto p-4",children:[(0,$o.jsxs)(Ee,{children:[(0,$o.jsx)(xe,{className:"$o-only",children:u?.name}),(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsx)("div",{className:"flex-1",children:K()}),!z&&(0,$o.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,$o.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,$o.jsxs)("div",{className:"lg:col-span-2 space-$o-4",children:[(0,$o.jsx)(wt,{fieldName:"name",value:u.name||"",label:"",onSave:ge,className:"border-b border-border pb-3",disabled:c==="loading"}),(0,$o.jsx)(wt,{fieldName:"description",value:u.description||"",label:"Description",multiline:!0,onSave:ge,disabled:c==="loading"}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$o.jsx)(Te.File,{className:"h-4 w-4 text-muted-foreground"}),(0,$o.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),p&&(0,$o.jsxs)(A,{variant:"outline",size:"sm",onClick:()=>Q(!0),disabled:c==="loading",className:"gap-2",children:[(0,$o.jsx)(Te.Upload,{className:"h-4 w-4"}),"Upload"]})]}),U.length>0?(0,$o.jsx)(aa,{files:U,onFileDelete:l?x:void 0,onFileUpdate:m,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,$o.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"No files attached"})]}),(0,$o.jsx)(pr,{comments:(u?.comments||[]).map($=>({author:$.author?.value.name||"",createdAt:new Date($.timestamp),text:$.text,id:$.id||""})),onAddComment:V})]}),(0,$o.jsx)(gr,{task:u,epics:r,sprints:i,lastUpdated:g,onUpdateTask:be,onClose:pe,onDelete:Be,isUpdating:c==="loading",isDeleting:E==="loading",deleteState:E,teamMembers:de})]})]}),p&&(0,$o.jsx)(ia,{isOpen:D,onClose:()=>Q(!1),onAddFile:ze})]})};var la=({isOpen:e,onClose:t,onAddEpic:o})=>{let[r,i]=(0,yt.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("$o")[0],endDate:new Date().toISOString().split("$o")[0],progress:0}),a=["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"}],d=l=>{l.preventDefault(),r.name.trim()&&(o({name:r.name.trim(),description:r.description.trim(),color:r.color,confidence:r.confidence,phase:r.phase,startDate:r.startDate,endDate:r.endDate}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(l,m)=>{i(u=>({...u,[l]:m}))};return(0,$o.jsx)(Se,{open:e,onOpenChange:t,children:(0,$o.jsxs)(Ie,{className:"sm:max-w-md",children:[(0,$o.jsx)(Ee,{children:(0,$o.jsx)(xe,{children:"Add New Epic"})}),(0,$o.jsxs)("form",{onSubmit:d,className:"space-$o-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"name",children:"Epic Name"}),(0,$o.jsx)(ue,{id:"name",value:r.name,onChange:l=>p("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{htmlFor:"description",children:"Description"}),(0,$o.jsx)(Ae,{id:"description",value:r.description,onChange:l=>p("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Color"}),(0,$o.jsx)("div",{className:"flex gap-2 flex-wrap",children:a.map(l=>(0,$o.jsx)("button",{type:"button",onClick:()=>p("color",l),className:`w-8 h-8 rounded-full ${l} ${r.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,$o.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Confidence"}),(0,$o.jsxs)(Le,{value:r.confidence,onValueChange:l=>p("confidence",l),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(rt,{})}),(0,$o.jsx)(Pe,{children:n.map(l=>(0,$o.jsx)(fe,{value:l.value,children:l.label},l.value))})]})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Phase"}),(0,$o.jsxs)(Le,{value:r.phase.toString(),onValueChange:l=>p("phase",parseInt(l)),children:[(0,$o.jsx)(De,{children:(0,$o.jsx)(rt,{})}),(0,$o.jsx)(Pe,{children:s.map(l=>(0,$o.jsx)(fe,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,$o.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"Start Date"}),(0,$o.jsx)(ue,{type:"date",value:r.startDate,onChange:l=>p("startDate",l.target.value)})]}),(0,$o.jsxs)("div",{className:"space-$o-2",children:[(0,$o.jsx)(L,{children:"End Date"}),(0,$o.jsx)(ue,{type:"date",value:r.endDate,onChange:l=>p("endDate",l.target.value)})]})]}),(0,$o.jsxs)(xt,{children:[(0,$o.jsx)(A,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,$o.jsx)(A,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};function ca(e,t){let[o,r]=(0,yt.useState)(()=>{if(typeof window>"u")return t;try{let a=window.localStorage.getItem(e);return a?JSON.parse(a):t}catch{return t}}),i=a=>{try{r(a),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(a))}catch{}};return(0,yt.useEffect)(()=>{i(o)},[]),[o,i]}var qt=require("react-icons/fa");function ma({title:e,description:t,badge:o,primaryAction:r,secondaryAction:i,gradient:a,children:n,className:s}){let[d,p]=ca(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),l=!i&&!t||d;return(0,$o.jsxs)(So.motion.div,{initial:{opacity:0,$o:20},animate:{opacity:1,$o:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${a} p-8 text-white ${s||""}`,children:[(0,$o.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,$o.jsx)(Ne,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,$o.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,$o.jsxs)("div",{className:"flex items-center gap-3",children:[l&&r&&(0,$o.jsx)(A,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:r.onClick,children:r.label}),(i||t)&&(0,$o.jsx)("button",{"aria-label":d?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!d),style:{lineHeight:0},children:d?(0,$o.jsx)(qt.FaChevronDown,{size:22}):(0,$o.jsx)(qt.FaChevronUp,{size:22})})]})]}),!l&&(0,$o.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,$o.jsxs)("div",{className:"space-$o-4",children:[(0,$o.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,$o.jsxs)("div",{className:"flex flex-wrap gap-3",children:[r&&(0,$o.jsx)(A,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:r.onClick,children:r.label}),i&&(0,$o.jsx)(A,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),n&&(0,$o.jsx)("div",{className:"hidden lg:block",children:n})]})]})}var Xi=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:r=[],initialColleagues:i=[],initialProjects:a=[],onAddTask:n,onUpdateTask:s,onDeleteTask:d,onTaskClick:p,onAddEpic:l,onAddComment:m,onUploadFile:u,onDeleteFile:b,onFileUpdate:g})=>{let[S,c]=(0,_.useState)([]),[f,E]=(0,_.useState)([]),[v,D]=(0,_.useState)([]),[Q,Ce]=(0,_.useState)(!1),[Me,de]=(0,_.useState)(!1),[me,ge]=(0,_.useState)(null),[be,V]=(0,_.useState)(null),[Be,ze]=(0,_.useState)([]),[x,U]=(0,_.useState)([]),[z,pe]=(0,_.useState)(0),K=(0,_.useRef)(null),$=(0,_.useRef)(null),q=_.default.useMemo(()=>[...f.map(w=>w.id),0],[f]),st=(0,_.useRef)(""),Do=(0,_.useRef)(""),Po=(0,_.useRef)(""),ko=(0,_.useRef)(""),Et=(w,F)=>w.map(B=>`${B.id}-${new Date(B.createdAt).getTime()}-${new Date(B.updatedAt).getTime()}`).join("-")+(F?`-${F}`:"");(0,_.useEffect)(()=>{let w=e.map(B=>B.files?.filter(le=>typeof le=="object").map(le=>new Date(le.updatedAt).getTime())).flat(),F=Et(e,w.join("-"));F!==st.current&&(c(e),me&&ge(e.find(B=>B.id===me.id)||null),st.current=F)},[e]),(0,_.useEffect)(()=>{let w=Et(t);w!==Do.current&&(E(t),Do.current=w)},[t]),(0,_.useEffect)(()=>{let w=Et(o);w!==Po.current&&(D(o),Po.current=w)},[o]),(0,_.useEffect)(()=>{let w=Et(i.map(F=>({id:F.id,updatedAt:F.updatedAt,createdAt:F.createdAt})));w!==ko.current&&(U(i),ko.current=w)},[i]),(0,_.useEffect)(()=>{let w=()=>{if(K.current){let le=K.current.offsetHeight;pe(le)}};w();let F=new ResizeObserver(w);K.current&&F.observe(K.current);let B=()=>{setTimeout(w,100)};return window.addEventListener("storage",B),()=>{F.disconnect(),window.removeEventListener("storage",B)}},[]),(0,_.useEffect)(()=>{let w=setTimeout(()=>{K.current&&pe(K.current.offsetHeight)},300);return()=>clearTimeout(w)},[Q,Me]);let pa=S.filter(w=>!0),ua=w=>pa.filter(F=>F.status===w),fa=w=>{let F={};return f.forEach(B=>{F[B.id]=w.filter(le=>pt(le.epic)===B.id)}),F["no-epic"]=w.filter(B=>!pt(B.epic)),F},Ro=w=>{V(w)},ga=w=>{be&&(c(F=>F.map(B=>B.id===be.id?{...B,status:w}:B)),s?.(be.id.toString(),{status:w}),V(null))},va=w=>{let F={...w,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};c(B=>[...B,F]),n?.(w)},ba=async(w,F)=>{c(B=>B.map(le=>le.id===Number(w)?{...le,...F}:le)),s&&await s(w,F),me?.id===Number(w)&&ge(B=>({...B,...F}))},ha=async w=>{c(F=>F.filter(B=>B.id!==Number(w))),me?.id===Number(w)&&ge(null),d&&await d(w)},xa=w=>{let F={...w,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};E(B=>[...B,F]),l?.(w)},Mo=w=>{ge(w),p?.(w)},ya=[{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"}],wa=z>0?`calc(100vh - ${z+120}px)`:"calc(100vh - 12rem)";return(0,$o.jsxs)("div",{ref:$,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,$o.jsx)("div",{ref:K,className:"flex-shrink-0",children:(0,$o.jsx)(ma,{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:()=>Ce(!0)},secondaryAction:{label:"Add epic",onClick:()=>de(!0)}})}),(0,$o.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,$o.jsx)("div",{className:"h-full",style:{height:z>0?`calc(100vh - ${z+120}px)`:"calc(100vh - 12rem)"},children:(0,$o.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:ya.map(w=>{let F=ua(w.status),B=fa(F);return(0,$o.jsxs)(_o,{title:w.title,status:w.status,taskCount:F.length,onDrop:ga,isCompact:w.status==="done",height:wa,children:[B["no-epic"].map(le=>(0,$o.jsx)(ro,{epic:null,task:le,onDragStart:Ro,onTaskClick:Mo,isCompact:w.status==="done"},le.id)),q.map(le=>{let Yt=f.find(At=>At.id===le),Qt=B[le]||[];return Qt.length===0?null:(0,$o.jsxs)("div",{className:"mb-6",children:[(0,$o.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,$o.jsx)("div",{className:`w-3 h-3 rounded-full ${Yt?.color}`}),(0,$o.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Yt?.name||"No Epic"}),(0,$o.jsx)(Ne,{variant:"secondary",className:"text-xs",children:Qt.length})]})," ",(0,$o.jsx)("div",{className:"space-$o-3",children:Qt.map(At=>(0,$o.jsx)(ro,{task:At,epic:Yt,onDragStart:Ro,onTaskClick:Mo,isCompact:w.status==="done"},At.id))})]},le)})]},w.id)})})})}),(0,$o.jsx)(cr,{isOpen:Q,onClose:()=>Ce(!1),onAddTask:va,assignees:[...x,...Be],epics:f,sprints:v}),(0,$o.jsx)(la,{isOpen:Me,onClose:()=>de(!1),onAddEpic:xa}),me&&(0,$o.jsx)(na,{isOpen:!!me,onClose:()=>ge(null),initialTask:me,epics:f,sprints:v,onUpdateTask:ba,onDeleteTask:ha,colleagues:x,onUploadFile:u,onDeleteFile:b,onFileUpdate:g,onAddComment:m})]})};0&&(module.exports={KanbanBoardView});
|