cortex-react-components 2.26.2 → 2.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-P7S6XFU4.mjs → chunk-23XORW7A.mjs} +1 -1
- package/dist/{chunk-3HNU2NYP.mjs → chunk-2GZQYAN3.mjs} +1 -1
- package/dist/{chunk-FE7ZGUPU.mjs → chunk-4NHQXOKZ.mjs} +1 -1
- package/dist/{chunk-RGOKBIQ5.mjs → chunk-5KS3DITB.mjs} +1 -1
- package/dist/{chunk-AJQHGVZ5.mjs → chunk-66ODXUVL.mjs} +1 -1
- package/dist/{chunk-RS4VD3ML.mjs → chunk-67PJ7D4O.mjs} +1 -1
- package/dist/{chunk-JCWFPKF3.mjs → chunk-6LY5CH7J.mjs} +1 -1
- package/dist/{chunk-5NIEZE7A.mjs → chunk-AGWQ5S2Z.mjs} +1 -1
- package/dist/chunk-AN744MXS.mjs +9 -0
- package/dist/{chunk-WIRQ5IRT.mjs → chunk-BDNY6OKE.mjs} +1 -1
- package/dist/{chunk-2BRDNDUB.mjs → chunk-BGADMIWV.mjs} +1 -1
- package/dist/{chunk-C4RWEPVF.mjs → chunk-BN747TQM.mjs} +1 -1
- package/dist/{chunk-2SQVMYDK.mjs → chunk-CJ2ZX7QN.mjs} +1 -1
- package/dist/{chunk-LAQ3QAUW.mjs → chunk-CLGBBNRB.mjs} +1 -1
- package/dist/{chunk-AQQCH7Z2.mjs → chunk-CNCT3JZV.mjs} +1 -1
- package/dist/{chunk-KQB6MFFS.mjs → chunk-DJ2KA3MS.mjs} +1 -1
- package/dist/{chunk-K4DQ5KUH.mjs → chunk-DVE2KPLR.mjs} +1 -1
- package/dist/{chunk-LHO4WFYP.mjs → chunk-ERHNVIOZ.mjs} +1 -1
- package/dist/{chunk-LJXTXROJ.mjs → chunk-GIL2SMPM.mjs} +1 -1
- package/dist/{chunk-2HKAJ4TZ.mjs → chunk-HTS3KCJL.mjs} +1 -1
- package/dist/{chunk-GVDM4RRN.mjs → chunk-I6OBIS4J.mjs} +1 -1
- package/dist/{chunk-6UDBIRMT.mjs → chunk-IO5ZSALG.mjs} +1 -1
- package/dist/{chunk-RJGYVDOU.mjs → chunk-JLUX7EHB.mjs} +1 -1
- package/dist/{chunk-5MWZTJYP.mjs → chunk-JT65KF7C.mjs} +1 -1
- package/dist/{chunk-EM3T2XYC.mjs → chunk-JUFFNFV6.mjs} +1 -1
- package/dist/{chunk-3Y7QG6VP.mjs → chunk-KRLNPNMZ.mjs} +1 -1
- package/dist/{chunk-3NRXQBBS.mjs → chunk-M74BIPBM.mjs} +1 -1
- package/dist/{chunk-7R47MHQE.mjs → chunk-NXG2Y4N4.mjs} +1 -1
- package/dist/{chunk-XDELWNND.mjs → chunk-OP6ZWZIM.mjs} +1 -1
- package/dist/{chunk-CXOVEABI.mjs → chunk-PRK2XFAZ.mjs} +1 -1
- package/dist/{chunk-ZFUP5NVF.mjs → chunk-PXLSH6S2.mjs} +1 -1
- package/dist/{chunk-GTZJWMZR.mjs → chunk-PZZTGPEO.mjs} +1 -1
- package/dist/{chunk-36UEU4CT.mjs → chunk-R3SDBXF2.mjs} +1 -1
- package/dist/{chunk-3MEOSYPN.mjs → chunk-RIFUOB7A.mjs} +1 -1
- package/dist/{chunk-P55W6AFU.mjs → chunk-RIRZRO6U.mjs} +1 -1
- package/dist/{chunk-TVTTUSWM.mjs → chunk-S3P6OGB7.mjs} +1 -1
- package/dist/{chunk-TXVA6XJT.mjs → chunk-SRUG246N.mjs} +1 -1
- package/dist/{chunk-GHOL5L32.mjs → chunk-T36QUKC6.mjs} +1 -1
- package/dist/{chunk-RSDUFAIB.mjs → chunk-T5HJS6OF.mjs} +1 -1
- package/dist/{chunk-HSQAHQNP.mjs → chunk-TKCFCYEQ.mjs} +1 -1
- package/dist/{chunk-ZEALRBXW.mjs → chunk-UX5OJ3WS.mjs} +1 -1
- package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.mjs} +1 -1
- package/dist/{chunk-XGIYNUGC.mjs → chunk-VNYUNZ3M.mjs} +1 -1
- package/dist/{chunk-2BR55L74.mjs → chunk-VRE6VCHX.mjs} +1 -1
- package/dist/{chunk-75F3LJMX.mjs → chunk-WDZOGIT2.mjs} +1 -1
- package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
- package/dist/{chunk-NINFDOV5.mjs → chunk-Y62OBV2E.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/ImageBlock.mjs +1 -1
- package/dist/components/Blocks/MediaBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.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/AppSidebarLeft.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.js +6 -6
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.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/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/index.mjs +1 -1
- package/dist/components/Payload/PayloadCard/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/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/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.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/BlogListSection.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-P5LSKHQC.mjs +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../chunk-RIFUOB7A.mjs";import"../../chunk-QOZ2O3FG.mjs";import"../../chunk-2R3MJSQ7.mjs";import"../../chunk-NGX2VCHS.mjs";import"../../chunk-6PS55VJZ.mjs";import"../../chunk-OP6ZWZIM.mjs";import"../../chunk-R3SDBXF2.mjs";import"../../chunk-KZCIHFTM.mjs";import"../../chunk-IO5ZSALG.mjs";import"../../chunk-ZHBYZ4HE.mjs";import"../../chunk-AB43AQKL.mjs";import"../../chunk-KG7HG2VO.mjs";import"../../chunk-L3V5YDPH.mjs";import"../../chunk-QC2UWZWL.mjs";import"../../chunk-HTS3KCJL.mjs";import"../../chunk-DCOFQFVJ.mjs";import"../../chunk-Z22NSJMF.mjs";import"../../chunk-AN744MXS.mjs";import"../../chunk-EZC3YWSQ.mjs";import"../../chunk-VTFO5GXK.mjs";import"../../chunk-GULRIPMU.mjs";import"../../chunk-RKS7CWAP.mjs";import"../../chunk-IPRG56MW.mjs";import"../../chunk-HFEN3KJC.mjs";import"../../chunk-L2UJOICL.mjs";import"../../chunk-T3F3RQIC.mjs";import"../../chunk-UP67R64J.mjs";import"../../chunk-6QERRKM4.mjs";import"../../chunk-VSU7LYXZ.mjs";import"../../chunk-BZEGLKRZ.mjs";import"../../chunk-K7N3FRGH.mjs";import"../../chunk-EOR2BAI2.mjs";import"../../chunk-6SWKEZN6.mjs";import"../../chunk-DFIXTV2M.mjs";import"../../chunk-FGEFYI5E.mjs";import"../../chunk-UVHMI3PU.mjs";import"../../chunk-U5PBLRRV.mjs";import"../../chunk-Q5Q3DJWU.mjs";import"../../chunk-4QRKVSTE.mjs";import"../../chunk-E4TE4NV6.mjs";import"../../chunk-JFFTEK6Z.mjs";import"../../chunk-JHNVX4UB.mjs";import"../../chunk-7BXIU4ZM.mjs";import"../../chunk-YFAZQYK4.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-B4H6T2GP.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-RLVKIMGU.mjs";import"../../chunk-OCPX4QPC.mjs";import"../../chunk-FT3AE7L2.mjs";import"../../chunk-76M7JE4D.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-OYZDAMCS.mjs";import"../../chunk-5NRGSTPV.mjs";import"../../chunk-PXLSH6S2.mjs";import"../../chunk-D4IMQTVU.mjs";import"../../chunk-7GSXNSLD.mjs";import"../../chunk-4UIARERB.mjs";import"../../chunk-YNCJATT7.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-KY7WQYN4.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-SOLZ4VQH.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-FRWX5YES.mjs";import"../../chunk-CV7PH2KH.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../chunk-TKCFCYEQ.mjs";import"../../chunk-CDVRH3MC.mjs";import"../../chunk-KPTGYVDM.mjs";import"../../chunk-5RTGHMF3.mjs";import"../../chunk-Z22NSJMF.mjs";import"../../chunk-INCYANPB.mjs";import"../../chunk-B4H6T2GP.mjs";import"../../chunk-TVZOULLL.mjs";import"../../chunk-3UMMMQEH.mjs";import"../../chunk-L5JPAKPM.mjs";import"../../chunk-ZUA4KNIR.mjs";import"../../chunk-CSBGSBEU.mjs";import"../../chunk-YO3GQYRJ.mjs";import"../../chunk-QTW33JYG.mjs";import"../../chunk-MDJREBVI.mjs";import"../../chunk-ZWHGOTSF.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-XGRRLABA.mjs";import"../../chunk-FLHDNCNY.mjs";import"../../chunk-YEKQJ4YC.mjs";export{a as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
"use strict";var Dr=Object.create;var lt=Object.defineProperty;var Rr=Object.getOwnPropertyDescriptor;var kr=Object.getOwnPropertyNames;var Mr=Object.getPrototypeOf,Ir=Object.prototype.hasOwnProperty;var Er=(e,t)=>{for(var o in t)lt(e,o,{get:t[o],enumerable:!0})},Qt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of kr(t))!Ir.call(e,a)&&a!==o&<(e,a,{get:()=>t[a],enumerable:!(r=Rr(t,a))||r.enumerable});return e};var _=(e,t,o)=>(o=e!=null?Dr(Mr(e)):{},Qt(t||!e||!e.__esModule?lt(o,"default",{value:e,enumerable:!0}):o,e)),Lr=e=>Qt(lt({},"__esModule",{value:!0}),e);var Xa={};Er(Xa,{TaskDetailsModal:()=>Ja});module.exports=Lr(Xa);var me=require("react");var Ze=_(require("react")),j=_(require("@radix-ui/react-dialog")),co=require("lucide-react");var lo=require("clsx");var Mt="-",Ar=e=>{let t=Fr(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let s=n.split(Mt);return s[0]===""&&s.length!==1&&s.shift(),oo(s,t)||Hr(n)},getConflictingClassGroupIds:(n,s)=>{let c=o[n]||[];return s&&r[n]?[...c,...r[n]]:c}}},oo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?oo(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let i=e.join(Mt);return t.validators.find(({validator:n})=>n(i))?.classGroupId},eo=/^\[(.+)\]$/,Hr=e=>{if(eo.test(e)){let t=eo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Fr=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Br(Object.entries(e.classGroups),o).forEach(([i,n])=>{kt(n,r,i,t)}),r},kt=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let i=a===""?t:to(t,a);i.classGroupId=o;return}if(typeof a=="function"){if(Vr(a)){kt(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([i,n])=>{kt(n,to(t,i),o,r)})})},to=(e,t)=>{let o=e;return t.split(Mt).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Vr=e=>e.isThemeGetter,Br=(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,Or=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)}}},ro="!",zr=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,a=t[0],i=t.length,n=s=>{let c=[],m=0,p=0,C;for(let l=0;l<s.length;l++){let u=s[l];if(m===0){if(u===a&&(r||s.slice(l,l+i)===t)){c.push(s.slice(p,l)),p=l+i;continue}if(u==="/"){C=l;continue}}u==="["?m++:u==="]"&&m--}let d=c.length===0?s:s.substring(p),h=d.startsWith(ro),g=h?d.substring(1):d,P=C&&C>p?C-p:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:P}};return o?s=>o({className:s,parseClassName:n}):n},Ur=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},_r=e=>({cache:Or(e.cacheSize),parseClassName:zr(e),...Ar(e)}),Gr=/\s+/,$r=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],n=e.trim().split(Gr),s="";for(let c=n.length-1;c>=0;c-=1){let m=n[c],{modifiers:p,hasImportantModifier:C,baseClassName:d,maybePostfixModifierPosition:h}=o(m),g=!!h,P=r(g?d.substring(0,h):d);if(!P){if(!g){s=m+(s.length>0?" "+s:s);continue}if(P=r(d),!P){s=m+(s.length>0?" "+s:s);continue}g=!1}let l=Ur(p).join(":"),u=C?l+ro:l,M=u+P;if(i.includes(M))continue;i.push(M);let f=a(P,g);for(let N=0;N<f.length;++N){let X=f[N];i.push(u+X)}s=m+(s.length>0?" "+s:s)}return s};function Wr(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=ao(t))&&(r&&(r+=" "),r+=o);return r}var ao=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=ao(e[r]))&&(o&&(o+=" "),o+=t);return o};function Kr(e,...t){let o,r,a,i=n;function n(c){let m=t.reduce((p,C)=>C(p),e());return o=_r(m),r=o.cache.get,a=o.cache.set,i=s,s(c)}function s(c){let m=r(c);if(m)return m;let p=$r(c,o);return a(c,p),p}return function(){return i(Wr.apply(null,arguments))}}var H=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},io=/^\[(?:([a-z-]+):)?(.+)\]$/i,jr=/^\d+\/\d+$/,Zr=new Set(["px","full","screen"]),Jr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xr=/\d+(%|px|r?em|[sdl]?oe([hwib]|min|max)|co|pc|in|cm|mm|cap|ch|ex|r?lh|cq(oe|h|i|oe|min|max))|\oe(calc|min|max|clamp)\(.+\)|^0$/,qr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Yr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ge=e=>Be(e)||Zr.has(e)||jr.test(e),Pe=e=>Oe(e,"length",sa),Be=e=>!!e&&!Number.isNaN(Number(e)),Rt=e=>Oe(e,"number",Be),Ke=e=>!!e&&Number.isInteger(Number(e)),ea=e=>e.endsWith("%")&&Be(e.slice(0,-1)),S=e=>io.test(e),De=e=>Jr.test(e),ta=new Set(["length","size","percentage"]),oa=e=>Oe(e,ta,no),ra=e=>Oe(e,"position",no),aa=new Set(["image","url"]),ia=e=>Oe(e,aa,ca),na=e=>Oe(e,"",la),je=()=>!0,Oe=(e,t,o)=>{let r=io.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},sa=e=>Xr.test(e)&&!qr.test(e),no=()=>!1,la=e=>Yr.test(e),ca=e=>Qr.test(e);var da=()=>{let e=H("colors"),t=H("spacing"),o=H("blur"),r=H("brightness"),a=H("borderColor"),i=H("borderRadius"),n=H("borderSpacing"),s=H("borderWidth"),c=H("contrast"),m=H("grayscale"),p=H("hueRotate"),C=H("invert"),d=H("gap"),h=H("gradientColorStops"),g=H("gradientColorStopPositions"),P=H("inset"),l=H("margin"),u=H("opacity"),M=H("padding"),f=H("saturate"),N=H("scale"),X=H("sepia"),ue=H("skew"),we=H("space"),ee=H("translate"),Ce=()=>["auto","contain","none"],Ne=()=>["auto","hidden","clip","visible","scroll"],fe=()=>["auto",S,t],E=()=>[S,t],Se=()=>["",ge,Pe],Te=()=>["auto",Be,S],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["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"],ie=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",S],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[Be,S];return{cacheSize:500,separator:":",theme:{colors:[je],spacing:[ge,Pe],blur:["none","",De,S],brightness:$(),borderColor:[e],borderRadius:["none","","full",De,S],borderSpacing:E(),borderWidth:Se(),contrast:$(),grayscale:Q(),hueRotate:$(),invert:Q(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[ea,Pe],inset:fe(),margin:fe(),opacity:$(),padding:E(),saturate:$(),scale:$(),sepia:Q(),skew:$(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",S]}],container:["container"],columns:[{columns:[De]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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(),S]}],overflow:[{overflow:Ne()}],"overflow-x":[{"overflow-x":Ne()}],"overflow-y":[{"overflow-y":Ne()}],overscroll:[{overscroll:Ce()}],"overscroll-x":[{"overscroll-x":Ce()}],"overscroll-y":[{"overscroll-y":Ce()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[P]}],"inset-x":[{"inset-x":[P]}],"inset-y":[{"inset-y":[P]}],start:[{start:[P]}],end:[{end:[P]}],top:[{top:[P]}],right:[{right:[P]}],bottom:[{bottom:[P]}],left:[{left:[P]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ke,S]}],basis:[{basis:fe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",S]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",Ke,S]}],"grid-cols":[{"grid-cols":[je]}],"col-start-end":[{col:["auto",{span:["full",Ke,S]},S]}],"col-start":[{"col-start":Te()}],"col-end":[{"col-end":Te()}],"grid-rows":[{"grid-rows":[je]}],"row-start-end":[{row:["auto",{span:[Ke,S]},S]}],"row-start":[{"row-start":Te()}],"row-end":[{"row-end":Te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",S]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",S]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ie(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],co:[{co:[M]}],co:[{co:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[l]}],mx:[{mx:[l]}],my:[{my:[l]}],ms:[{ms:[l]}],me:[{me:[l]}],oe:[{oe:[l]}],mr:[{mr:[l]}],mb:[{mb:[l]}],ml:[{ml:[l]}],"space-x":[{"space-x":[we]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[we]}],"space-y-reverse":["space-y-reverse"],oe:[{oe:["auto","min","max","fit","svw","lvw","dvw",S,t]}],"min-oe":[{"min-oe":[S,t,"min","max","fit"]}],"max-oe":[{"max-oe":[S,t,"none","full","min","max","fit","prose",{screen:[De]},De]}],h:[{h:[S,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[S,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[S,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[S,t,"auto","min","max","fit"]}],"font-size":[{text:["base",De,Pe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Rt]}],"font-family":[{font:[je]}],"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",S]}],"line-clamp":[{"line-clamp":["none",Be,Rt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ge,S]}],"list-image":[{"list-image":["none",S]}],"list-style-type":[{list:["none","disc","decimal",S]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[u]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[u]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ge,Pe]}],"underline-offset":[{"underline-offset":["auto",ge,S]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",S]}],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",S]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[u]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),ra]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","oe","bl","l","tl"]},ia]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"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-oe":[{"rounded-oe":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-oe":[{"rounded-oe":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-oe":[{border:[s]}],"border-oe-x":[{"border-x":[s]}],"border-oe-y":[{"border-y":[s]}],"border-oe-s":[{"border-s":[s]}],"border-oe-e":[{"border-e":[s]}],"border-oe-t":[{"border-t":[s]}],"border-oe-r":[{"border-r":[s]}],"border-oe-oe":[{"border-oe":[s]}],"border-oe-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[u]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[u]}],"divide-style":[{divide:L()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-oe":[{"border-oe":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[ge,S]}],"outline-oe":[{outline:[ge,Pe]}],"outline-color":[{outline:[e]}],"ring-oe":[{ring:Se()}],"ring-oe-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[u]}],"ring-offset-oe":[{"ring-offset":[ge,Pe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",De,na]}],"shadow-color":[{shadow:[je]}],opacity:[{opacity:[u]}],"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:[c]}],"drop-shadow":[{"drop-shadow":["","none",De,S]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[C]}],saturate:[{saturate:[f]}],sepia:[{sepia:[X]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[u]}],"backdrop-saturate":[{"backdrop-saturate":[f]}],"backdrop-sepia":[{"backdrop-sepia":[X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",S]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",S]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",S]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Ke,S]}],"translate-x":[{"translate-x":[ee]}],"translate-y":[{"translate-y":[ee]}],"skew-x":[{"skew-x":[ue]}],"skew-y":[{"skew-y":[ue]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",S]}],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","oe-resize","oe-resize","nw-resize","oe-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",S]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-oe":[{"scroll-oe":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-co":[{"scroll-co":E()}],"scroll-co":[{"scroll-co":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",S]}],fill:[{fill:[e,"none"]}],"stroke-oe":[{stroke:[ge,Pe,Rt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","co","co","pr","pb","pl"],px:["pr","pl"],py:["co","pb"],m:["mx","my","ms","me","oe","mr","mb","ml"],mx:["mr","ml"],my:["oe","mb"],size:["oe","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-oe","rounded-l","rounded-ss","rounded-oe","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-oe","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-oe":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-oe":["border-oe-s","border-oe-e","border-oe-t","border-oe-r","border-oe-oe","border-oe-l"],"border-oe-x":["border-oe-r","border-oe-l"],"border-oe-y":["border-oe-t","border-oe-oe"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-oe","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-oe"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-oe","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-oe","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-co","scroll-co","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-co","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var so=Kr(da);function y(...e){return so((0,lo.clsx)(e))}var oe=require("react/jsx-runtime"),Re=j.Root;var It=j.Portal;var ct=Ze.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(j.Overlay,{ref:o,className:y("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}));ct.displayName=j.Overlay.displayName;var Ee=Ze.forwardRef(({className:e,children:t,...o},r)=>(0,oe.jsxs)(It,{children:[(0,oe.jsx)(ct,{}),(0,oe.jsxs)(j.Content,{ref:r,className:y("fixed left-[50%] top-[50%] z-50 grid oe-full max-oe-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,oe.jsxs)(j.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,oe.jsx)(co.X,{className:"h-4 oe-4"}),(0,oe.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ee.displayName=j.Content.displayName;var Le=({className:e,...t})=>(0,oe.jsx)("div",{className:y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Le.displayName="DialogHeader";var ma=({className:e,...t})=>(0,oe.jsx)("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ma.displayName="DialogFooter";var ve=Ze.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(j.Title,{ref:o,className:y("text-lg font-semibold leading-none tracking-tight",e),...t}));ve.displayName=j.Title.displayName;var pa=Ze.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(j.Description,{ref:o,className:y("text-sm text-muted-foreground",e),...t}));pa.displayName=j.Description.displayName;var mo=_(require("react"));var ke=mo.forwardRef(({className:e,type:t,...o},r)=>(0,oe.jsx)("input",{type:t,className:y("flex h-9 oe-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}));ke.displayName="Input";var uo=_(require("react")),Ae=uo.forwardRef(({className:e,...t},o)=>(0,oe.jsx)("textarea",{className:y("flex min-h-[80px] oe-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 go=_(require("react")),Et=_(require("@radix-ui/react-label")),vo=require("class-variance-authority");var ua=(0,vo.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Y=go.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(Et.Root,{ref:o,className:y(ua(),e),...t}));Y.displayName=Et.Root.displayName;var Je=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:a,className:i="",disabled:n=!1})=>{let[s,c]=(0,me.useState)(!1),[m,p]=(0,me.useState)(""),C=()=>{n||(c(!0),p(t))},d=async()=>{m!==t&&await a(e,m),c(!1)},h=g=>{g.key==="Enter"&&!r||g.key==="Enter"&&g.ctrlKey&&r?d():g.key==="Escape"&&(c(!1),p(""))};return(0,oe.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,oe.jsx)(Y,{children:o}),s?r?(0,oe.jsx)(Ae,{value:m,onChange:g=>p(g.target.value),onBlur:d,onKeyDown:h,autoFocus:!0,rows:4,className:"resize-none"}):(0,oe.jsx)(ke,{value:m,onChange:g=>p(g.target.value),onBlur:d,onKeyPress:h,autoFocus:!0,className:"text-lg font-medium"}):(0,oe.jsxs)("div",{onClick:C,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,oe.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,oe.jsx)(co.Edit,{className:"h-4 oe-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var fa=(0,vo.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 ze({className:e,variant:t,...o}){return(0,oe.jsx)("div",{className:y(fa({variant:t}),e),...o})}var dt=_(require("react")),he=_(require("@radix-ui/react-avatar"));var At=dt.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(he.Root,{ref:o,className:y("relative flex h-10 oe-10 shrink-0 overflow-hidden rounded-full",e),...t}));At.displayName=he.Root.displayName;var ga=dt.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(he.Image,{ref:o,className:y("aspect-square h-full oe-full",e),...t}));ga.displayName=he.Image.displayName;var Ht=dt.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(he.Fallback,{ref:o,className:y("flex h-full oe-full items-center justify-center rounded-full bg-muted",e),...t}));Ht.displayName=he.Fallback.displayName;var wo=require("@radix-ui/react-slot"),No=_(require("react")),So=(0,vo.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 oe-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"}}}),F=No.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...a},i)=>(0,oe.jsx)(e?wo.Slot:"button",{className:y(So({className:t,size:o,variant:r})),ref:i,...a}));F.displayName="Button";var Do=({comments:e,onAddComment:t})=>{let[o,r]=(0,me.useState)(""),a=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{o.trim()&&(t(o),r(""))};return(0,oe.jsxs)("div",{className:"space-y-4",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)(co.MessageSquare,{className:"h-5 oe-5"}),(0,oe.jsx)(Y,{className:"text-lg font-medium",children:"Comments"}),(0,oe.jsx)(ze,{variant:"secondary",children:e.length})]}),(0,oe.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(n=>(0,oe.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,oe.jsx)(At,{className:"h-8 oe-8 oe-1",children:(0,oe.jsx)(Ht,{className:"text-xs bg-muted text-muted-foreground",children:a(n.author)})}),(0,oe.jsxs)("div",{className:"flex-1",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,oe.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,oe.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,oe.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,oe.jsxs)("div",{className:"flex gap-2",children:[(0,oe.jsx)(Ae,{value:o,onChange:n=>r(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,oe.jsx)(F,{onClick:i,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,oe.jsx)(co.Send,{className:"h-4 oe-4"})})]})]})};var He=_(require("react")),Ue=_(require("@radix-ui/react-toggle-group"));var Ro=_(require("react")),Ft=_(require("@radix-ui/react-toggle"));var Vt=(0,vo.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-oe-9",sm:"h-8 px-1.5 min-oe-8",lg:"h-10 px-2.5 min-oe-10"}},defaultVariants:{variant:"default",size:"default"}}),va=Ro.forwardRef(({className:e,variant:t,size:o,...r},a)=>(0,oe.jsx)(Ft.Root,{ref:a,className:y(Vt({variant:t,size:o,className:e})),...r}));va.displayName=Ft.Root.displayName;var Io=He.createContext({size:"default",variant:"default"}),ft=He.forwardRef(({className:e,variant:t,size:o,children:r,...a},i)=>(0,oe.jsx)(Ue.Root,{ref:i,className:y("flex items-center justify-center gap-1",e),...a,children:(0,oe.jsx)(Io.Provider,{value:{variant:t,size:o},children:r})}));ft.displayName=Ue.Root.displayName;var gt=He.forwardRef(({className:e,children:t,variant:o,size:r,...a},i)=>{let n=He.useContext(Io);return(0,oe.jsx)(Ue.Item,{ref:i,className:y(Vt({variant:n.variant||o,size:n.size||r}),e),...a,children:t})});gt.displayName=Ue.Item.displayName;var R=_(require("@radix-ui/react-select")),Me=_(require("react")),vt=R.Root;var Xe=Me.forwardRef(({children:e,className:t,...o},r)=>(0,oe.jsxs)(R.Trigger,{className:y("flex h-10 oe-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,oe.jsx)(R.Icon,{asChild:!0,children:(0,oe.jsx)(co.ChevronDown,{className:"h-4 oe-4 opacity-50"})})]}));Xe.displayName=R.Trigger.displayName;var Eo=Me.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(R.ScrollUpButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,oe.jsx)(co.ChevronUp,{className:"h-4 oe-4"})}));Eo.displayName=R.ScrollUpButton.displayName;var Lo=Me.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(R.ScrollDownButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,oe.jsx)(co.ChevronDown,{className:"h-4 oe-4"})}));Lo.displayName=R.ScrollDownButton.displayName;var qe=Me.forwardRef(({children:e,className:t,position:o="popper",...r},a)=>(0,oe.jsx)(R.Portal,{children:(0,oe.jsxs)(R.Content,{className:y("relative z-50 max-h-96 min-oe-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:a,...r,children:[(0,oe.jsx)(Eo,{}),(0,oe.jsx)(R.Viewport,{className:y("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] oe-full min-oe-[var(--radix-select-trigger-width)]"),children:e}),(0,oe.jsx)(Lo,{})]})}));qe.displayName=R.Content.displayName;var ba=Me.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(R.Label,{className:y("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));ba.displayName=R.Label.displayName;var _e=Me.forwardRef(({children:e,className:t,...o},r)=>(0,oe.jsxs)(R.Item,{className:y("relative flex oe-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,oe.jsx)("span",{className:"absolute left-2 flex h-3.5 oe-3.5 items-center justify-center",children:(0,oe.jsx)(R.ItemIndicator,{children:(0,oe.jsx)(co.Check,{className:"h-4 oe-4"})})}),(0,oe.jsx)(R.ItemText,{children:e})]}));_e.displayName=R.Item.displayName;var ha=Me.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(R.Separator,{className:y("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));ha.displayName=R.Separator.displayName;var bt=({label:e,value:t,onValueChange:o,options:r,showColor:a=!1,disabled:i=!1})=>{let[n,s]=(0,me.useState)(!1),c=r.find(p=>p.value===t);return(0,oe.jsxs)("div",{className:"space-y-1",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:e}),(0,oe.jsxs)(vt,{value:t,onValueChange:o,open:n,onOpenChange:p=>{i||s(p)},disabled:i,children:[(0,oe.jsx)(Xe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,oe.jsxs)(ze,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!n),children:[a&&c?.color&&(0,oe.jsx)("div",{className:`oe-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,oe.jsx)(qe,{children:r.map(p=>(0,oe.jsx)(_e,{value:p.value,children:a&&p.color?(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)("div",{className:`oe-3 h-3 rounded-full ${p.color}`}),p.label]}):p.label},p.value))})]})]})};var Ho=({label:e,value:t,onValueChange:o,options:r,placeholder:a="Search...",allowCustomValue:i=!1,disabled:n=!1})=>{let[s,c]=(0,me.useState)(!1),[m,p]=(0,me.useState)(""),C=r.find(l=>l.value===t),d=r.filter(l=>l.label.toLowerCase().includes(m.toLowerCase())),h=l=>{o(l),c(!1),p("")},g=()=>{i&&m.trim()&&!r.find(l=>l.value===m.trim())&&(o(m.trim()),c(!1),p(""))};return(0,oe.jsxs)("div",{className:"space-y-1",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:e}),(0,oe.jsxs)(vt,{value:t,onValueChange:h,open:s,onOpenChange:l=>{n||c(l)},disabled:n,children:[(0,oe.jsx)(Xe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,oe.jsx)(ze,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&c(!s),children:C?.label||t||"Select..."})}),(0,oe.jsxs)(qe,{children:[(0,oe.jsx)("div",{className:"p-2",children:(0,oe.jsx)(ke,{placeholder:a,value:m,onChange:l=>p(l.target.value),onKeyDown:l=>{l.key==="Enter"&&i&&g()},className:"mb-2"})}),d.map(l=>(0,oe.jsx)(_e,{value:l.value,children:l.label},l.value)),i&&m.trim()&&!d.find(l=>l.value===m.trim())&&(0,oe.jsxs)(_e,{value:m.trim(),children:['Add "',m.trim(),'"']})]})]})]})};var Ot=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var xa=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:co.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:co.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:co.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:co.Zap}],ya=[{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 Fo=({task:e,epics:t,sprints:o,lastUpdated:r,onUpdateTask:a,onClose:i,onDelete:n,isUpdating:s=!1,isDeleting:c=!1,deleteState:m="idle",teamMembers:p})=>{let[C,d]=(0,me.useState)(e.storyPoints),h=(0,me.useRef)(null),[g,P]=(0,me.useState)(p);(0,me.useEffect)(()=>{P(p)},[p]);let l=(0,me.useCallback)((f,N)=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{a(f,N)},500)},[a]);(0,me.useEffect)(()=>{l("storyPoints",C?.toString()||"1")},[C]);let u=f=>f.split(" ").map(N=>N[0]).join("").toUpperCase(),M=()=>m==="loading"?(0,oe.jsxs)(F,{disabled:!0,variant:"destructive",className:"oe-full h-8 text-xs gap-1",children:[(0,oe.jsx)(co.Loader2,{className:"h-3 oe-3 animate-spin"}),"Deleting..."]}):m==="success"?(0,oe.jsxs)(F,{disabled:!0,variant:"destructive",className:"oe-full h-8 text-xs gap-1",children:[(0,oe.jsx)(co.Check,{className:"h-3 oe-3"}),"Deleted"]}):m==="error"?(0,oe.jsxs)(F,{disabled:!0,variant:"destructive",className:"oe-full h-8 text-xs gap-1",children:[(0,oe.jsx)(co.X,{className:"h-3 oe-3"}),"Delete failed"]}):(0,oe.jsxs)(F,{onClick:n,variant:"destructive",className:"oe-full h-8 text-xs gap-1",disabled:s||c,children:[(0,oe.jsx)(co.Trash2,{className:"h-3 oe-3"}),"Delete Task"]});return(0,oe.jsxs)("div",{className:"flex flex-col h-full",children:[(0,oe.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Status"}),(0,oe.jsx)(bt,{label:"",value:e.status,onValueChange:f=>a("status",f),options:[{value:"todo",label:"oe Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Type"}),(0,oe.jsx)(ft,{type:"single",value:e.type||"",onValueChange:f=>f&&a("type",f),className:"grid grid-cols-2 gap-1",disabled:s,children:xa.map(f=>{let N=f.icon;return(0,oe.jsxs)(gt,{value:f.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,oe.jsx)(N,{className:"h-3 oe-3"}),f.label]},f.value)})})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,oe.jsx)(ft,{type:"single",value:e.priority||"",onValueChange:f=>f&&a("priority",f),className:"grid grid-cols-3 gap-1",disabled:s,children:ya.map(f=>(0,oe.jsx)(gt,{value:f.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:f.label},f.value))})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,oe.jsx)("input",{type:"number",min:"1",max:"100",value:C||1,onChange:f=>{let N=Number(f.target.value);N<1?d(1):N>100?d(100):d(N)},className:"oe-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,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,oe.jsx)(bt,{label:"",value:Ot(e.epic).toString(),onValueChange:f=>a("epic",f),options:(t||[]).map(f=>({value:f.id.toString(),label:f?.name,color:f.color})),showColor:!0,disabled:s})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,oe.jsx)(bt,{label:"",value:Ot(e.sprint).toString()||"none",onValueChange:f=>a("sprint",f==="none"?"":f),options:[{value:"none",label:"No Sprint"},...(o||[]).map(f=>({value:f.id.toString(),label:`${f?.name}`}))],disabled:s})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,oe.jsx)(Ho,{label:"",value:e.assignee?.value?.name,onValueChange:f=>a("assignee",f),options:g.map(f=>({value:`${typeof f.email=="string"?"users":"digital-colleagues"}:${f.id}`,label:f?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,oe.jsxs)("div",{className:"oe-auto co-4 space-y-4",children:[(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(F,{onClick:i,variant:"outline",className:"oe-full h-8 text-xs",disabled:s||c,children:"Close"}),M()]}),(0,oe.jsxs)("div",{className:"co-4 border-t border-border space-y-2",children:[(0,oe.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,oe.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,oe.jsx)(co.User,{className:"h-3 oe-3"}),(0,oe.jsx)("span",{children:"System"})]})]}),(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,oe.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,oe.jsx)(co.Calendar,{className:"h-3 oe-3"}),(0,oe.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,oe.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,oe.jsx)(co.Clock,{className:"h-3 oe-3"}),(0,oe.jsxs)("span",{children:[new Date(r).toLocaleDateString()," at"," ",new Date(r).toLocaleTimeString()]})]})]})]})]})]})};var Yt=require("motion/react");var Nr=_(require("@radix-ui/react-dialog"));var cr=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),dr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),mr=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),pr=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),ur=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),fr=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),gr=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Tt=require("@payloadcms/richtext-lexical/lexical/list"),vr=require("@payloadcms/richtext-lexical/lexical/rich-text"),br=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var sr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),at=require("@payloadcms/richtext-lexical/lexical/utils"),T=require("@payloadcms/richtext-lexical/lexical"),Xt=require("@payloadcms/richtext-lexical/lexical/selection");var jo=require("@radix-ui/react-dialog"),wt=require("@payloadcms/richtext-lexical/client");var Ut=_(require("bson-objectid"));var Bo=require("@payloadcms/ui");var Vo=_(require("react")),le=_(require("@radix-ui/react-tooltip"));var ht=le.Provider,xt=le.Root,yt=le.Trigger,Ye=Vo.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,oe.jsx)(le.Portal,{children:(0,oe.jsx)(le.Content,{ref:r,sideOffset:t,className:y("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})}));Ye.displayName=le.Content.displayName;var wa=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[a]=(0,sr.useLexicalComposerContext)(),[i,n]=(0,me.useState)(""),[s,c]=(0,me.useState)(""),[m,p]=(0,me.useState)(""),C=async l=>{console.log("fetchMedia",l)};(0,me.useEffect)(()=>{typeof o=="string"?o.length===24?C(o):(n(o||""),p(P(g())),c(h()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),p(P(o.filesize)),c(o.mimeType?.split("/")[1]||""))},[]);let d=(0,me.useCallback)(()=>{a.update(()=>{(0,T.$getNodeByKey)(r)?.remove()})},[a,r]),h=()=>{let l=e.data.value;return typeof l=="string"?l.split(";base64")[0]?.split("image/")[1]:""},g=()=>{let l=e.data.value;if(typeof l=="string"){let u=l.split(",")[1]?.length||0;return 4*Math.ceil(u/3)*.5624896334383812/1e3}return 0};function P(l){if(l>=1e6){let M=l/1e6;return`${M>=10?Math.round(M).toString():M.toFixed(1)} MB`}return`${Math.floor(l/1e3)} KB`}return(0,oe.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,oe.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip oe-60 flex flex-col gap-2 bg-[#222222]",children:[(0,oe.jsxs)("div",{className:"flex gap-2 border-oe border-oe-slate-100/10",children:[(0,oe.jsx)("div",{className:"flex-1",children:e.data.value?(0,oe.jsx)("img",{className:"object-cover m-0 oe-full min-oe-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:i}):(0,oe.jsx)(Bo.File,{})}),(0,oe.jsx)(ht,{children:(0,oe.jsxs)(xt,{children:[(0,oe.jsxs)(yt,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,oe.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,oe.jsx)("button",{onClick:l=>{l.preventDefault(),d()},className:"flex-1 flex justify-center items-center",children:(0,oe.jsx)(co.X,{width:24,height:24,strokeWidth:1})})]}),(0,oe.jsx)(Ye,{children:(0,oe.jsx)("span",{children:"Remove image"})})]})})]}),(0,oe.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,oe.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,oe.jsx)("span",{children:m})]})]})})},_o=wa;function Ca(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:Ge({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Qe=class extends wt.UploadNode{static importDOM(){return{img:()=>({conversion:Ca,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new Ut.default().toHexString(),t.version=3);let o={id:t.id??new Ut.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=Ge(o);return r.setFormat?.(t.format),r}decorate(){return(0,$o.jsx)(_o,{data:this.__data,nodeKey:this.getKey()})}};function Ge(e){return new Qe({data:e})}var Na=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Sa=e=>Na?(e||window).getSelection():null,Nn=(0,T.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),_t=(0,T.createCommand)("INSERT_UPLOAD_COMMAND");function Zo({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,me.useRef)(!1),[a,i]=(0,me.useState)(!0),[n,s]=(0,me.useState)(""),[c,m]=(0,me.useState)(""),[p,C]=(0,me.useState)(!1),[d,h]=(0,me.useState)("left"),g=n==="",P=N=>{C(N.target.checked)},l=N=>{h(N.target.value)},u=N=>{let X=new FileReader;X.onload=function(){return typeof X.result=="string"&&s(X.result),""},N!==null&&N[0]&&X.readAsDataURL(N[0])};(0,me.useEffect)(()=>{r.current=!1;let N=X=>{r.current=X.altKey};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[e]),(0,me.useEffect)(()=>{a||t()},[a]),(0,me.useEffect)(()=>{i(o)},[o]);let M=({editor:N,relationTo:X,replaceNodeKey:ue,value:we})=>{if(ue)N.update(()=>{let ee=(0,T.$getNodeByKey)(ue);ee&&ee.replace(Ge({id:"",fields:{},relationTo:"media",value:we}))});else{let ee=N.dispatchCommand(_t,{fields:null,relationTo:"media",value:we})}},f=()=>{M({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:c,src:n,showCaption:p,position:d}.src}),i(!1),t()};return(0,oe.jsx)(Re,{open:a,onOpenChange:N=>i(N),children:(0,oe.jsxs)(Ee,{children:[(0,oe.jsxs)(Le,{children:[(0,oe.jsx)(ve,{children:"Upload Image"}),(0,oe.jsx)(jo.DialogDescription,{children:"Description"})]}),(0,oe.jsxs)("div",{className:"",children:[(0,oe.jsx)("div",{style:{marginBottom:"1em"},children:(0,oe.jsx)(ke,{type:"file",onChange:N=>u(N.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,oe.jsx)("div",{style:{marginBottom:"1em"},children:(0,oe.jsx)(ke,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:N=>m(N.currentTarget.value),value:c,"data-test-id":"image-modal-alt-text-input"})}),(0,oe.jsx)(F,{"data-test-id":"image-modal-file-upload-btn",disabled:g,onClick:()=>f(),children:"Confirm"})]})]})})}function Gt({captionsEnabled:e}){let[t]=(0,sr.useLexicalComposerContext)();return(0,me.useEffect)(()=>{if(!t.hasNodes([wt.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,at.mergeRegister)(t.registerCommand(T.DRAGSTART_COMMAND,o=>Ta(o),T.COMMAND_PRIORITY_HIGH),t.registerCommand(T.DRAGOVER_COMMAND,o=>Pa(o),T.COMMAND_PRIORITY_LOW),t.registerCommand(T.DROP_COMMAND,o=>Da(o,t),T.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Ta(e){if(!$t())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function Pa(e){return $t()?(Jo(e)||e.preventDefault(),!0):!1}function Da(e,t){let o=$t();if(!o)return!1;if(e.preventDefault(),Jo(e)){let r=Ra(e);o.remove();let a=(0,T.$createRangeSelection)();r!=null&&a.applyDOMRange(r),(0,T.$setSelection)(a)}return!0}function $t(){let e=(0,T.$getSelection)();if(!(0,T.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,wt.$isUploadNode)(o)?o:null}function Jo(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 Ra(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,a=Sa(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 ka=()=>(0,oe.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,oe.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"})}),Xo=ka;var Ma=()=>(0,oe.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,oe.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"})}),qo=Ma;var Ia=()=>(0,oe.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,oe.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,oe.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Yo=Ia;var Ea=()=>(0,oe.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,oe.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,oe.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Qo=Ea;var La=()=>(0,oe.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,oe.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"})}),er=La;var Aa=()=>(0,oe.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,oe.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),tr=Aa;var or=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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"})}),rr=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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"})}),ar=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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"})}),ir=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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"})}),nr=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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 xe=_(require("react")),D=_(require("@radix-ui/react-dropdown-menu")),$e=require("@radix-ui/react-icons");var Ct=D.Root,Nt=D.Trigger;var Ha=xe.forwardRef(({className:e,inset:t,children:o,...r},a)=>(0,oe.jsxs)(D.SubTrigger,{ref:a,className:y("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,oe.jsx)($e.ChevronRightIcon,{className:"ml-auto"})]}));Ha.displayName=D.SubTrigger.displayName;var Fa=xe.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(D.SubContent,{ref:o,className:y("z-50 min-oe-[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}));Fa.displayName=D.SubContent.displayName;var ot=xe.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,oe.jsx)(D.Portal,{children:(0,oe.jsx)(D.Content,{ref:r,sideOffset:t,className:y("z-50 min-oe-[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})}));ot.displayName=D.Content.displayName;var rt=xe.forwardRef(({className:e,inset:t,...o},r)=>(0,oe.jsx)(D.Item,{ref:r,className:y("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}));rt.displayName=D.Item.displayName;var Va=xe.forwardRef(({className:e,children:t,checked:o,...r},a)=>(0,oe.jsxs)(D.CheckboxItem,{ref:a,className:y("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,oe.jsx)("span",{className:"absolute left-2 flex h-3.5 oe-3.5 items-center justify-center",children:(0,oe.jsx)(D.ItemIndicator,{children:(0,oe.jsx)($e.CheckIcon,{className:"h-4 oe-4"})})}),t]}));Va.displayName=D.CheckboxItem.displayName;var Ba=xe.forwardRef(({className:e,children:t,...o},r)=>(0,oe.jsxs)(D.RadioItem,{ref:r,className:y("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,oe.jsx)("span",{className:"absolute left-2 flex h-3.5 oe-3.5 items-center justify-center",children:(0,oe.jsx)(D.ItemIndicator,{children:(0,oe.jsx)($e.DotFilledIcon,{className:"h-4 oe-4 fill-current"})})}),t]}));Ba.displayName=D.RadioItem.displayName;var Oa=xe.forwardRef(({className:e,inset:t,...o},r)=>(0,oe.jsx)(D.Label,{ref:r,className:y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Oa.displayName=D.Label.displayName;var za=xe.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(D.Separator,{ref:o,className:y("-mx-1 my-1 h-px bg-muted",e),...t}));za.displayName=D.Separator.displayName;var Ua=({className:e,...t})=>(0,oe.jsx)("span",{className:y("ml-auto text-xs tracking-widest opacity-60",e),...t});Ua.displayName="DropdownMenuShortcut";var Jt=1;function _a(){return(0,oe.jsx)("span",{className:"border border-[#222222]"})}function qt(){let[e]=(0,sr.useLexicalComposerContext)(),t=(0,me.useRef)(null),[o,r]=(0,me.useState)(!1),[a,i]=(0,me.useState)(!1),[n,s]=(0,me.useState)(!1),[c,m]=(0,me.useState)(!1),[p,C]=(0,me.useState)(!1),[d,h]=(0,me.useState)(!1),[g,P]=(0,me.useState)(!1),[l,u]=(0,me.useState)(!1),[M,f]=(0,me.useState)(!1),[N,X]=(0,me.useState)("left"),[ue,we]=(0,me.useState)("p"),ee=x=>{e.update(()=>{let L=(0,T.$getSelection)();(0,T.$isRangeSelection)(L)&&(x==="p"?(0,Xt.$setBlocksType)(L,()=>(0,T.$createParagraphNode)()):(0,Xt.$setBlocksType)(L,()=>(0,vr.$createHeadingNode)(x)))})},Ce=(0,me.useCallback)(()=>{let x=(0,T.$getSelection)();if((0,T.$isRangeSelection)(x)){s(x.hasFormat("bold")),m(x.hasFormat("italic")),C(x.hasFormat("underline")),h(x.hasFormat("strikethrough")),P(x.hasFormat("subscript")),u(x.hasFormat("superscript"));let L=x.anchor.getNode(),z=L;for(;z&&!(0,T.$isParagraphNode)(z)&&z!==(0,T.$getRoot)();){let Q=z.getParent();Q&&(z=Q)}if(z){let Q=z.getFormatType();X(Q||"left")}let ie=L.getTopLevelElement()?.__tag;we(ie||"p")}},[]);(0,me.useEffect)(()=>(0,at.mergeRegister)(e.registerUpdateListener(({editorState:x})=>{x.read(()=>{Ce()})}),e.registerCommand(T.SELECTION_CHANGE_COMMAND,(x,L)=>(Ce(),!1),Jt),e.registerCommand(T.CAN_UNDO_COMMAND,x=>(r(x),!1),Jt),e.registerCommand(T.CAN_REDO_COMMAND,x=>(i(x),!1),Jt),(0,at.mergeRegister)(e.registerCommand(_t,x=>(e.update(()=>{let L=(0,T.$getSelection)()||(0,T.$getPreviousSelection)();if((0,T.$isRangeSelection)(L)){let z=Ge({id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}),{focus:ie}=L,Q=ie.getNode();(0,at.$insertNodeToNearestRoot)(z),(0,T.$isParagraphNode)(Q)&&!Q.__first&&Q.remove()}}),!0),T.COMMAND_PRIORITY_EDITOR))),[e,Ce]);let Ne=[[{label:"Undo",icon:(0,oe.jsx)(co.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(T.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,oe.jsx)(co.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(T.UNDO_COMMAND,void 0)},disabled:!a}],[{label:"Bold",icon:(0,oe.jsx)(Xo,{}),onClick:()=>{e.dispatchCommand(T.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,oe.jsx)(qo,{}),onClick:()=>{e.dispatchCommand(T.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:c},{label:"Underline",icon:(0,oe.jsx)(Yo,{}),onClick:()=>{e.dispatchCommand(T.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:p},{label:"Strikethrough",icon:(0,oe.jsx)(Qo,{}),onClick:()=>{e.dispatchCommand(T.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:d},{label:"Subscript",icon:(0,oe.jsx)(er,{}),onClick:()=>{e.dispatchCommand(T.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:g},{label:"Superscript",icon:(0,oe.jsx)(tr,{}),onClick:()=>{e.dispatchCommand(T.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:l}]],fe=[{label:"Left Align",direction:"left",icon:(0,oe.jsx)(co.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(T.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,oe.jsx)(co.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(T.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,oe.jsx)(co.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(T.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,oe.jsx)(co.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(T.FORMAT_ELEMENT_COMMAND,"justify")}}],Se=[{label:"Normal Text",value:"p",icon:(0,oe.jsx)(or,{}),onClick:()=>ee("p")},{label:"Heading 1",value:"h1",icon:(0,oe.jsx)(rr,{}),onClick:()=>ee("h1")},{label:"Heading 2",value:"h2",icon:(0,oe.jsx)(ar,{}),onClick:()=>ee("h2")},{label:"Heading 3",value:"h3",icon:(0,oe.jsx)(ir,{}),onClick:()=>ee("h3")},{label:"Heading 4",value:"h4",icon:(0,oe.jsx)(nr,{}),onClick:()=>ee("h4")},...[{label:"Unordered List",value:"ul",icon:(0,oe.jsx)(co.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Tt.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,oe.jsx)(co.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Tt.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],Te=[{label:"Insert Image",icon:(0,oe.jsx)(co.ImageUp,{width:15,height:15}),onClick:()=>{f(!0)},disabled:!1}];return(0,oe.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,oe.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[Ne.map((x,L)=>(0,oe.jsxs)(me.Fragment,{children:[(0,oe.jsx)("div",{className:"flex items-center gap-2",children:x.map((z,ie)=>(0,oe.jsx)("div",{role:"button","aria-disabled":z.disabled||!1,onClick:z.onClick,className:y("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,oe.jsx)(ht,{children:(0,oe.jsxs)(xt,{children:[(0,oe.jsx)(yt,{className:"text-[#b5b5b5]",children:z.icon}),(0,oe.jsx)(Ye,{children:(0,oe.jsx)("p",{children:z.label})})]})})},ie))}),(0,oe.jsx)(_a,{})]},`toolbar-option-${x.length}-${L}`)),(0,oe.jsxs)(Ct,{children:[(0,oe.jsxs)(Nt,{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:[fe.find(x=>x.direction===N)?.icon,fe.find(x=>x.direction===N)?.label,(0,oe.jsx)(co.ChevronDown,{width:15,height:15})]}),(0,oe.jsx)(ot,{className:"bg-black hover:bg-black",children:fe.map((x,L)=>(0,oe.jsxs)(rt,{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,oe.jsx)("span",{children:x.icon}),(0,oe.jsx)("span",{children:x.label})]},`${x.label}-${L}`))})]}),(0,oe.jsxs)(Ct,{children:[(0,oe.jsxs)(Nt,{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:[Se.find(x=>x.value===ue)?.icon,Se.find(x=>x.value===ue)?.label,(0,oe.jsx)(co.ChevronDown,{width:15,height:15})]}),(0,oe.jsx)(ot,{className:"bg-black hover:bg-black",children:Se.map((x,L)=>(0,oe.jsxs)(rt,{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,oe.jsx)("span",{children:x.icon}),(0,oe.jsx)("span",{children:x.label})]},`heading-option-${x.label}-${L}`))})]}),(0,oe.jsxs)(Ct,{children:[(0,oe.jsxs)(Nt,{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,oe.jsx)(co.Plus,{width:15,height:15}),(0,oe.jsx)(co.ChevronDown,{width:15,height:15})]}),(0,oe.jsx)(ot,{className:"bg-black hover:bg-black",children:Te.map((x,L)=>(0,oe.jsxs)(rt,{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,oe.jsx)("span",{children:x.icon}),(0,oe.jsx)("span",{children:x.label})]},L))})]}),M&&(0,oe.jsx)(Zo,{activeEditor:e,onClose:()=>{f(!1)},isOpen:M})]})})}var Ga=({setValue:e,value:t,name:o,editable:r=!0})=>{let[a]=(0,sr.useLexicalComposerContext)(),i=(0,me.useRef)(null),n=s=>{s.read(()=>{let c=s.toJSON();JSON.stringify(c)!==JSON.stringify(i.current)&&(i.current=c,e?.(()=>c))})};return(0,me.useEffect)(()=>{a.setEditable(r)},[r,a]),(0,me.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,oe.jsx)("div",{className:"oe-full",children:(0,oe.jsxs)("div",{className:" ",children:[r&&(0,oe.jsx)(qt,{}),(0,oe.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,oe.jsx)(fr.RichTextPlugin,{contentEditable:(0,oe.jsx)(mr.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:pr.LexicalErrorBoundary}),r&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ur.HistoryPlugin,{}),(0,oe.jsx)(cr.AutoFocusPlugin,{}),(0,oe.jsx)(gr.ListPlugin,{}),(0,oe.jsx)(br.OnChangePlugin,{onChange:n}),(0,oe.jsx)(Gt,{})]})]})]})})},$a=({setValue:e,value:t,name:o,editable:r=!0})=>(0,oe.jsx)(dr.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Tt.ListNode,Tt.ListItemNode,vr.HeadingNode,Qe],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,oe.jsx)(Ga,{value:t,setValue:e,name:o,editable:r})}),xr=$a;var nt=e=>"mimeType"in e&&"url"in e&&!("format"in e),Wa=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,c)=>{if(s.type==="listitem"){let m=r(s.children||[]),p=a.listType==="number"?`${c+1}.`:n;i.push(`${p} ${m}`)}}),i.join(`
|
|
5
|
-
`)}case"listitem":return r(a.children||[]);case"text":{let
|
|
6
|
-
`}return o(
|
|
7
|
-
|
|
8
|
-
`)
|
|
9
|
-
`),o=[],r=[],a=[],i=()=>{if(r.length>0){let s=r.join(" "),c=Ve(s);o.push({type:"paragraph",children:c.length>0?c:[{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 c=s.trim();if(!c){i(),n();continue}let m=c.match(/^(#{1,6})\s+(.+)$/);if(m){i(),n();let C=m[1].length,d=m[2],h=Ve(d);o.push({type:"heading",tag:`h${C}`,children:h.length>0?h:[{type:"text",text:"",format:0}]});continue}let p=c.match(/^[-*+]\s+(.+)$/);if(p){i();let C=p[1],d=Ve(C);a.push({type:"listitem",children:[{type:"paragraph",children:d.length>0?d:[{type:"text",text:"",format:0}]}]});continue}a.length>0&&n(),r.push(c)}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}}},ja=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=Ka(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 wr({document:e,onCancel:t,onSave:o,onFileUpdate:r}){let[a,i]=(0,me.useState)(nt(e)),[n,s]=(0,me.useState)(nt(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}),[c,m]=(0,me.useState)(nt(e)?void 0:n.richTextContent),[p,C]=(0,me.useState)(!1),d=(0,me.useRef)(nt(e)?e:null);(0,me.useEffect)(()=>{nt(e)?(i(!0),ja(e).then(l=>{s(l),m(l.richTextContent),i(!1)}).catch(l=>{l instanceof Error&&l.name!=="AbortError"&&(console.error("Failed to convert file:",l),i(!1))})):(s({...e,updatedAt:new Date}),m(e.richTextContent))},[e]);let h=l=>{switch(l){case"markdown":case"mdx":return(0,oe.jsx)(co.FileText,{className:"h-6 oe-6 text-primary"});case"richText":return(0,oe.jsx)(co.File,{className:"h-6 oe-6 text-success"});case"text":return(0,oe.jsx)(co.Type,{className:"h-6 oe-6 text-muted-foreground"});default:return(0,oe.jsx)(co.File,{className:"h-6 oe-6 text-muted-foreground"})}},g=l=>{switch(l){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"}},P=async()=>{C(!0);try{let l,u;if(d.current&&d.current.mimeType==="text/markdown"){let f=c?Wa(c):"";l={...n,format:"markdown",content:f,richTextContent:void 0},u=f}else l={...n,richTextContent:c},u=n.content||"";let M=d.current?d.current.id.toString():n.id;await Promise.resolve(o()),r?.(M,u)}finally{C(!1)}};return(0,oe.jsxs)(Yt.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,oe.jsx)("div",{className:"border-oe border-border bg-card p-8 pb-6",children:(0,oe.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,oe.jsx)("div",{className:"flex items-start gap-4 flex-1 min-oe-0",children:(0,oe.jsx)("div",{className:"flex-1 min-oe-0",children:(0,oe.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,oe.jsx)("div",{className:"flex-1 min-oe-0",children:(0,oe.jsx)(Je,{fieldName:"title",value:n.title,label:"",onSave:(l,u)=>s(M=>({...M,title:u})),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,oe.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${g(n.format)} flex-shrink-0 oe-1`,children:n.format.toUpperCase()})]})})}),(0,oe.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,oe.jsxs)(F,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,oe.jsx)(co.X,{className:"h-4 oe-4"}),"Close"]}),(0,oe.jsxs)(F,{size:"sm",onClick:P,className:"gap-2",disabled:p,children:[p?(0,oe.jsx)(co.Loader2,{className:"h-4 oe-4 animate-spin"}):(0,oe.jsx)(co.Save,{className:"h-4 oe-4"}),p?"Saving...":"Save"]})]})]})}),(0,oe.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,oe.jsx)("div",{className:"p-8 co-0 h-full max-h-full overflow-auto",children:a?(0,oe.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,oe.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,oe.jsx)(co.Loader2,{className:"h-8 oe-8 animate-spin text-primary"}),(0,oe.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,oe.jsx)(oe.Fragment,{children:n.format==="richText"?(0,oe.jsx)(xr,{setValue:m,value:c,name:"richTextContent"},`richtext-${n.id}-${a?"loading":"loaded"}`):(0,oe.jsx)(Ae,{value:n.content||"",onChange:l=>s(u=>({...u,content:l.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var Cr=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 Tr({files:e,onFileClick:t,onFileDelete:o,onFileUpdate:r,showHeader:a=!0,className:i,viewMode:n="list"}){let[s,c]=(0,me.useState)(!1),[m,p]=(0,me.useState)(!1),[C,d]=(0,me.useState)(null),h=()=>{c(!1),d(null)},g=()=>{p(!0),setTimeout(()=>{p(!1),c(!1),d(null)},500)},P=l=>{d(l),c(!0)};return(0,oe.jsxs)("div",{className:y("rounded-3xl border overflow-hidden",i),children:[(0,oe.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[a&&n==="list"&&(0,oe.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,oe.jsx)("div",{className:"col-span-6",children:"Name"}),(0,oe.jsx)("div",{className:"col-span-2",children:"Size"}),(0,oe.jsx)("div",{className:"col-span-2",children:"Modified"})]}),n==="card"&&(0,oe.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),n==="list"&&(0,oe.jsx)("div",{className:"divide-y",children:e.map(l=>(0,oe.jsxs)(Yt.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?.(l),children:[(0,oe.jsxs)("div",{className:"col-span-6 flex items-center gap-3 oe-full md:oe-auto",children:[(0,oe.jsx)("div",{className:"flex h-10 oe-10 items-center justify-center rounded-2xl bg-muted"}),(0,oe.jsx)("div",{children:(0,oe.jsx)("p",{className:"font-medium",children:l.name})})]}),(0,oe.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:Cr(l.filesize)}),(0,oe.jsxs)("div",{className:"col-span-2 flex items-center justify-between oe-full md:oe-auto",children:[(0,oe.jsx)("span",{className:"text-sm md:text-base",children:new Date(l.createdAt).toLocaleDateString()}),(0,oe.jsxs)("div",{className:"flex gap-1",children:[l.mimeType==="text/markdown"&&(0,oe.jsx)(F,{variant:"ghost",size:"icon",className:"h-8 oe-8 rounded-xl",onClick:u=>{u.stopPropagation(),P(l)},children:(0,oe.jsx)(co.Edit,{className:"h-4 oe-4"})}),(0,oe.jsx)(F,{variant:"ghost",size:"icon",className:"h-8 oe-8 rounded-xl text-red-500 hover:text-red-600",onClick:u=>{u.stopPropagation(),o?.(l)},children:(0,oe.jsx)(co.Trash2,{className:"h-4 oe-4"})})]})]})]},l.name))}),n==="card"&&(0,oe.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(l=>(0,oe.jsx)(Yt.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(l),children:(0,oe.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,oe.jsxs)("div",{className:"flex-1 min-oe-0 space-y-2",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-3",children:[(0,oe.jsx)("div",{className:"flex h-10 oe-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,oe.jsx)("div",{className:"min-oe-0 flex-1",children:(0,oe.jsx)("p",{className:"font-medium truncate",children:l.name})})]}),(0,oe.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)("span",{className:"font-medium",children:"Size:"}),(0,oe.jsx)("span",{children:Cr(l.filesize)})]}),(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,oe.jsx)("span",{children:new Date(l.createdAt).toLocaleDateString()})]})]})]}),(0,oe.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[l.mimeType==="text/markdown"&&(0,oe.jsx)(F,{variant:"ghost",size:"icon",className:"h-8 oe-8 rounded-xl",onClick:u=>{u.stopPropagation(),P(l)},title:"Edit",children:(0,oe.jsx)(co.Edit,{className:"h-4 oe-4"})}),(0,oe.jsx)(F,{variant:"ghost",size:"icon",className:"h-8 oe-8 rounded-xl text-red-500 hover:text-red-600",onClick:u=>{u.stopPropagation(),o?.(l)},title:"Delete",children:(0,oe.jsx)(co.Trash2,{className:"h-4 oe-4"})})]})]})},l.name))}),(0,oe.jsx)(Re,{open:s,onOpenChange:l=>!l&&h(),children:(0,oe.jsxs)(It,{children:[(0,oe.jsx)(ct,{}),(0,oe.jsxs)(Nr.Content,{className:y("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,oe.jsx)(ve,{className:"sr-only",children:C?`Edit ${C.name}`:"Edit File"}),m&&(0,oe.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,oe.jsx)(co.Loader2,{className:"h-8 oe-8 animate-spin text-primary"})}),C&&(0,oe.jsx)(wr,{document:C,onSave:g,onFileUpdate:r,onCancel:h})]})]})})]})}var Pr=({isOpen:e,onClose:t,onAddFile:o})=>{let[r,a]=(0,me.useState)(null),[i,n]=(0,me.useState)(""),[s,c]=(0,me.useState)(""),[m,p]=(0,me.useState)(""),C=h=>{let g=h.target.files?.[0];g&&(a(g),i||n(g.name))},d=async h=>{if(h.preventDefault(),!r)return;let g=new FormData;g.append("file",r),g.append("name",i),s&&g.append("description",s),m&&g.append("tags",m),o?.(g),t(),a(null),n(""),c(""),p("")};return(0,oe.jsx)(Re,{open:e,onOpenChange:t,children:(0,oe.jsxs)(Ee,{className:"sm:max-oe-md",children:[(0,oe.jsx)(Le,{children:(0,oe.jsx)(ve,{children:"Add New File"})}),(0,oe.jsxs)("form",{onSubmit:d,className:"grid gap-4",children:[(0,oe.jsx)("div",{className:"flex items-center justify-center oe-full",children:(0,oe.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center oe-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,oe.jsxs)("div",{className:"flex flex-col items-center justify-center co-5 pb-6",children:[(0,oe.jsx)(Za,{className:"oe-10 h-10 text-gray-400"}),(0,oe.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,oe.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,oe.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,oe.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:C})]})}),r&&(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("p",{className:"font-medium",children:r.name}),(0,oe.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((r.size||0)/1024).toFixed(2)," KB"]})]}),(0,oe.jsx)(F,{type:"submit",onClick:d,children:"Upload"})]})]})]})})};function Za(e){return(0,oe.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,oe.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,oe.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,oe.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var Ja=({isOpen:e,onClose:t,initialTask:o,epics:r,sprints:a,onUpdateTask:i,onDeleteTask:n,onAddComment:s,colleagues:c,onUploadFile:m,onDeleteFile:p,onFileUpdate:C})=>{let[d,h]=(0,me.useState)(o),[g,P]=(0,me.useState)(new Date),[l,u]=(0,me.useState)("idle"),[M,f]=(0,me.useState)("idle"),[N,X]=(0,me.useState)(!1),[ue,we]=(0,me.useState)([]),[ee,Ce]=(0,me.useState)(c);(0,me.useEffect)(()=>{h(o)},[o]);let Ne=async(A,$)=>{if($!==d[A]){u("loading");try{await i(d.id.toString(),{[A]:$}),P(new Date),u("success"),setTimeout(()=>u("idle"),1500)}catch(Dt){console.log("error",Dt),u("error"),setTimeout(()=>u("idle"),3e3)}}},fe=async(A,$)=>{if($!==d[A]){u("loading");try{await i(d.id.toString(),{[A]:$}),P(new Date),u("success"),setTimeout(()=>u("idle"),1500)}catch(Dt){console.log("error",Dt),u("error"),setTimeout(()=>u("idle"),3e3)}}},E=async A=>{if(s){u("loading");try{await s?.({content:A,taskId:d.id.toString()}),P(new Date),u("success"),setTimeout(()=>u("idle"),1500)}catch{u("error"),setTimeout(()=>u("idle"),3e3)}}},Se=async()=>{f("loading");try{await n(d.id.toString()),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},Te=async A=>{if(m){u("loading");try{await m(d.id.toString(),A),P(new Date),u("success"),X(!1),setTimeout(()=>u("idle"),1500)}catch($){console.error("Error uploading file:",$),u("error"),setTimeout(()=>u("idle"),3e3)}}},x=async A=>{if(p){u("loading");try{await p(d.id.toString(),A.id.toString()),P(new Date),u("success"),setTimeout(()=>u("idle"),1500)}catch($){console.error("Error deleting file:",$),u("error"),setTimeout(()=>u("idle"),3e3)}}},L=(d.files||[]).map(A=>typeof A=="number"?null:A).filter(A=>A!==null),z=l!=="loading"&&M!=="loading",ie=()=>{z&&t()},Q=()=>l==="loading"?(0,oe.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,oe.jsx)(co.Loader2,{className:"h-4 oe-4 animate-spin"}),(0,oe.jsx)("span",{children:"Updating..."})]}):l==="success"?(0,oe.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,oe.jsx)(co.Check,{className:"h-4 oe-4"}),(0,oe.jsx)("span",{children:"Updated successfully"})]}):l==="error"?(0,oe.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,oe.jsx)(co.X,{className:"h-4 oe-4"}),(0,oe.jsx)("span",{children:"Update failed"})]}):null;return(0,oe.jsxs)(Re,{open:e,onOpenChange:ie,children:[(0,oe.jsxs)(Ee,{className:"max-oe-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,oe.jsxs)(Le,{children:[(0,oe.jsx)(ve,{className:"sr-only",children:d?.name}),(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsx)("div",{className:"flex-1",children:Q()}),!z&&(0,oe.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,oe.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,oe.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,oe.jsx)(Je,{fieldName:"name",value:d.name||"",label:"",onSave:Ne,className:"border-oe border-border pb-3",disabled:l==="loading"}),(0,oe.jsx)(Je,{fieldName:"description",value:d.description||"",label:"Description",multiline:!0,onSave:Ne,disabled:l==="loading"}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)(co.File,{className:"h-4 oe-4 text-muted-foreground"}),(0,oe.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),m&&(0,oe.jsxs)(F,{variant:"outline",size:"sm",onClick:()=>X(!0),disabled:l==="loading",className:"gap-2",children:[(0,oe.jsx)(co.Upload,{className:"h-4 oe-4"}),"Upload"]})]}),L.length>0?(0,oe.jsx)(Tr,{files:L,onFileDelete:p?x:void 0,onFileUpdate:C,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,oe.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"No files attached"})]}),(0,oe.jsx)(Do,{comments:(d?.comments||[]).map(A=>({author:A.author?.value.name||"",createdAt:new Date(A.timestamp),text:A.text,id:A.id||""})),onAddComment:E})]}),(0,oe.jsx)(Fo,{task:d,epics:r,sprints:a,lastUpdated:g,onUpdateTask:fe,onClose:ie,onDelete:Se,isUpdating:l==="loading",isDeleting:M==="loading",deleteState:M,teamMembers:ee})]})]}),m&&(0,oe.jsx)(Pr,{isOpen:N,onClose:()=>X(!1),onAddFile:Te})]})};0&&(module.exports={TaskDetailsModal});
|
|
4
|
+
"use strict";var Dr=Object.create;var lt=Object.defineProperty;var Rr=Object.getOwnPropertyDescriptor;var kr=Object.getOwnPropertyNames;var Mr=Object.getPrototypeOf,Ir=Object.prototype.hasOwnProperty;var Er=(e,t)=>{for(var o in t)lt(e,o,{get:t[o],enumerable:!0})},Qt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kr(t))!Ir.call(e,i)&&i!==o&<(e,i,{get:()=>t[i],enumerable:!(r=Rr(t,i))||r.enumerable});return e};var _=(e,t,o)=>(o=e!=null?Dr(Mr(e)):{},Qt(t||!e||!e.__esModule?lt(o,"default",{value:e,enumerable:!0}):o,e)),Lr=e=>Qt(lt({},"__esModule",{value:!0}),e);var Xa={};Er(Xa,{TaskDetailsModal:()=>Ja});module.exports=Lr(Xa);var me=require("react");var Ze=_(require("react")),j=_(require("@radix-ui/react-dialog")),co=require("lucide-react");var lo=require("clsx");var Mt="-",Ar=e=>{let t=Fr(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{let s=n.split(Mt);return s[0]===""&&s.length!==1&&s.shift(),oo(s,t)||Hr(n)},getConflictingClassGroupIds:(n,s)=>{let c=o[n]||[];return s&&r[n]?[...c,...r[n]]:c}}},oo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),i=r?oo(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(Mt);return t.validators.find(({validator:n})=>n(a))?.classGroupId},eo=/^\[(.+)\]$/,Hr=e=>{if(eo.test(e)){let t=eo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Fr=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Br(Object.entries(e.classGroups),o).forEach(([a,n])=>{kt(n,r,a,t)}),r},kt=(e,t,o,r)=>{e.forEach(i=>{if(typeof i=="string"){let a=i===""?t:to(t,i);a.classGroupId=o;return}if(typeof i=="function"){if(Vr(i)){kt(i(r),t,o,r);return}t.validators.push({validator:i,classGroupId:o});return}Object.entries(i).forEach(([a,n])=>{kt(n,to(t,a),o,r)})})},to=(e,t)=>{let o=e;return t.split(Mt).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Vr=e=>e.isThemeGetter,Br=(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,Or=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)}}},ro="!",zr=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,i=t[0],a=t.length,n=s=>{let c=[],m=0,p=0,C;for(let l=0;l<s.length;l++){let f=s[l];if(m===0){if(f===i&&(r||s.slice(l,l+a)===t)){c.push(s.slice(p,l)),p=l+a;continue}if(f==="/"){C=l;continue}}f==="["?m++:f==="]"&&m--}let d=c.length===0?s:s.substring(p),v=d.startsWith(ro),u=v?d.substring(1):d,N=C&&C>p?C-p:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:u,maybePostfixModifierPosition:N}};return o?s=>o({className:s,parseClassName:n}):n},Ur=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},_r=e=>({cache:Or(e.cacheSize),parseClassName:zr(e),...Ar(e)}),Gr=/\s+/,$r=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],n=e.trim().split(Gr),s="";for(let c=n.length-1;c>=0;c-=1){let m=n[c],{modifiers:p,hasImportantModifier:C,baseClassName:d,maybePostfixModifierPosition:v}=o(m),u=!!v,N=r(u?d.substring(0,v):d);if(!N){if(!u){s=m+(s.length>0?" "+s:s);continue}if(N=r(d),!N){s=m+(s.length>0?" "+s:s);continue}u=!1}let l=Ur(p).join(":"),f=C?l+ro:l,M=f+N;if(a.includes(M))continue;a.push(M);let g=i(N,u);for(let S=0;S<g.length;++S){let X=g[S];a.push(f+X)}s=m+(s.length>0?" "+s:s)}return s};function Wr(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=ao(t))&&(r&&(r+=" "),r+=o);return r}var ao=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=ao(e[r]))&&(o&&(o+=" "),o+=t);return o};function Kr(e,...t){let o,r,i,a=n;function n(c){let m=t.reduce((p,C)=>C(p),e());return o=_r(m),r=o.cache.get,i=o.cache.set,a=s,s(c)}function s(c){let m=r(c);if(m)return m;let p=$r(c,o);return i(c,p),p}return function(){return a(Wr.apply(null,arguments))}}var H=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},io=/^\[(?:([a-z-]+):)?(.+)\]$/i,jr=/^\d+\/\d+$/,Zr=new Set(["px","full","screen"]),Jr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|co|pc|in|cm|mm|cap|ch|ex|r?lh|cq(oe|oe|i|oe|min|max))|\oe(calc|min|max|clamp)\(.+\)|^0$/,qr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Yr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ge=e=>Be(e)||Zr.has(e)||jr.test(e),Pe=e=>Oe(e,"length",sa),Be=e=>!!e&&!Number.isNaN(Number(e)),Rt=e=>Oe(e,"number",Be),Ke=e=>!!e&&Number.isInteger(Number(e)),ea=e=>e.endsWith("%")&&Be(e.slice(0,-1)),T=e=>io.test(e),De=e=>Jr.test(e),ta=new Set(["length","size","percentage"]),oa=e=>Oe(e,ta,no),ra=e=>Oe(e,"position",no),aa=new Set(["image","url"]),ia=e=>Oe(e,aa,ca),na=e=>Oe(e,"",la),je=()=>!0,Oe=(e,t,o)=>{let r=io.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},sa=e=>Xr.test(e)&&!qr.test(e),no=()=>!1,la=e=>Yr.test(e),ca=e=>Qr.test(e);var da=()=>{let e=H("colors"),t=H("spacing"),o=H("blur"),r=H("brightness"),i=H("borderColor"),a=H("borderRadius"),n=H("borderSpacing"),s=H("borderWidth"),c=H("contrast"),m=H("grayscale"),p=H("hueRotate"),C=H("invert"),d=H("gap"),v=H("gradientColorStops"),u=H("gradientColorStopPositions"),N=H("inset"),l=H("margin"),f=H("opacity"),M=H("padding"),g=H("saturate"),S=H("scale"),X=H("sepia"),ue=H("skew"),we=H("space"),ee=H("translate"),Ce=()=>["auto","contain","none"],Ne=()=>["auto","hidden","clip","visible","scroll"],fe=()=>["auto",T,t],E=()=>[T,t],Se=()=>["",ge,Pe],Te=()=>["auto",Be,T],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["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"],ie=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",T],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[Be,T];return{cacheSize:500,separator:":",theme:{colors:[je],spacing:[ge,Pe],blur:["none","",De,T],brightness:$(),borderColor:[e],borderRadius:["none","","full",De,T],borderSpacing:E(),borderWidth:Se(),contrast:$(),grayscale:Q(),hueRotate:$(),invert:Q(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[ea,Pe],inset:fe(),margin:fe(),opacity:$(),padding:E(),saturate:$(),scale:$(),sepia:Q(),skew:$(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",T]}],container:["container"],columns:[{columns:[De]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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(),T]}],overflow:[{overflow:Ne()}],"overflow-x":[{"overflow-x":Ne()}],"overflow-y":[{"overflow-y":Ne()}],overscroll:[{overscroll:Ce()}],"overscroll-x":[{"overscroll-x":Ce()}],"overscroll-y":[{"overscroll-y":Ce()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[N]}],"inset-x":[{"inset-x":[N]}],"inset-y":[{"inset-y":[N]}],start:[{start:[N]}],end:[{end:[N]}],top:[{top:[N]}],right:[{right:[N]}],bottom:[{bottom:[N]}],left:[{left:[N]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ke,T]}],basis:[{basis:fe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",T]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",Ke,T]}],"grid-cols":[{"grid-cols":[je]}],"col-start-end":[{col:["auto",{span:["full",Ke,T]},T]}],"col-start":[{"col-start":Te()}],"col-end":[{"col-end":Te()}],"grid-rows":[{"grid-rows":[je]}],"row-start-end":[{row:["auto",{span:[Ke,T]},T]}],"row-start":[{"row-start":Te()}],"row-end":[{"row-end":Te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",T]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",T]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...ie()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ie(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ie(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],co:[{co:[M]}],co:[{co:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[l]}],mx:[{mx:[l]}],my:[{my:[l]}],ms:[{ms:[l]}],me:[{me:[l]}],oe:[{oe:[l]}],mr:[{mr:[l]}],mb:[{mb:[l]}],ml:[{ml:[l]}],"space-x":[{"space-x":[we]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[we]}],"space-y-reverse":["space-y-reverse"],oe:[{oe:["auto","min","max","fit","svw","lvw","dvw",T,t]}],"min-oe":[{"min-oe":[T,t,"min","max","fit"]}],"max-oe":[{"max-oe":[T,t,"none","full","min","max","fit","prose",{screen:[De]},De]}],oe:[{oe:[T,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-oe":[{"min-oe":[T,t,"min","max","fit","svh","lvh","dvh"]}],"max-oe":[{"max-oe":[T,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[T,t,"auto","min","max","fit"]}],"font-size":[{text:["base",De,Pe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Rt]}],"font-family":[{font:[je]}],"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",T]}],"line-clamp":[{"line-clamp":["none",Be,Rt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ge,T]}],"list-image":[{"list-image":["none",T]}],"list-style-type":[{list:["none","disc","decimal",T]}],"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:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ge,Pe]}],"underline-offset":[{"underline-offset":["auto",ge,T]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",T]}],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",T]}],"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(),ra]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oa]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","sr","oe","bl","l","tl"]},ia]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[u]}],"gradient-via-pos":[{via:[u]}],"gradient-to-pos":[{to:[u]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-oe":[{"rounded-oe":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-oe":[{"rounded-oe":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-sr":[{"rounded-sr":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-oe":[{border:[s]}],"border-oe-x":[{"border-x":[s]}],"border-oe-y":[{"border-y":[s]}],"border-oe-s":[{"border-s":[s]}],"border-oe-e":[{"border-e":[s]}],"border-oe-t":[{"border-t":[s]}],"border-oe-r":[{"border-r":[s]}],"border-oe-oe":[{"border-oe":[s]}],"border-oe-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:L()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[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-oe":[{"border-oe":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[ge,T]}],"outline-oe":[{outline:[ge,Pe]}],"outline-color":[{outline:[e]}],"ring-oe":[{ring:Se()}],"ring-oe-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-oe":[{"ring-offset":[ge,Pe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",De,na]}],"shadow-color":[{shadow:[je]}],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:[c]}],"drop-shadow":[{"drop-shadow":["","none",De,T]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[C]}],saturate:[{saturate:[g]}],sepia:[{sepia:[X]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-y":[{"border-spacing-y":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",T]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",T]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",T]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ke,T]}],"translate-x":[{"translate-x":[ee]}],"translate-y":[{"translate-y":[ee]}],"skew-x":[{"skew-x":[ue]}],"skew-y":[{"skew-y":[ue]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",T]}],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","oe-resize","oe-resize","nw-resize","oe-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",T]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-oe":[{"scroll-oe":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-co":[{"scroll-co":E()}],"scroll-co":[{"scroll-co":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",T]}],fill:[{fill:[e,"none"]}],"stroke-oe":[{stroke:[ge,Pe,Rt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","co","co","pr","pb","pl"],px:["pr","pl"],py:["co","pb"],m:["mx","my","ms","me","oe","mr","mb","ml"],mx:["mr","ml"],my:["oe","mb"],size:["oe","oe"],"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-oe","rounded-l","rounded-ss","rounded-oe","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-sr","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-oe","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-sr"],"rounded-oe":["rounded-sr","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-oe":["border-oe-s","border-oe-e","border-oe-t","border-oe-r","border-oe-oe","border-oe-l"],"border-oe-x":["border-oe-r","border-oe-l"],"border-oe-y":["border-oe-t","border-oe-oe"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-oe","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-oe"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-oe","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-oe","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-co","scroll-co","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-co","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var so=Kr(da);function y(...e){return so((0,lo.clsx)(e))}var oe=require("react/jsx-runtime"),Re=j.Root;var It=j.Portal;var ct=Ze.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(j.Overlay,{ref:o,className:y("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}));ct.displayName=j.Overlay.displayName;var Le=Ze.forwardRef(({className:e,children:t,...o},r)=>(0,oe.jsxs)(It,{children:[(0,oe.jsx)(ct,{}),(0,oe.jsxs)(j.Content,{ref:r,className:y("fixed left-[50%] top-[50%] z-50 grid oe-full max-oe-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,oe.jsxs)(j.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,oe.jsx)(co.X,{className:"oe-4 oe-4"}),(0,oe.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Le.displayName=j.Content.displayName;var Ae=({className:e,...t})=>(0,oe.jsx)("div",{className:y("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ae.displayName="DialogHeader";var ma=({className:e,...t})=>(0,oe.jsx)("div",{className:y("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ma.displayName="DialogFooter";var ve=Ze.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(j.Title,{ref:o,className:y("text-lg font-semibold leading-none tracking-tight",e),...t}));ve.displayName=j.Title.displayName;var pa=Ze.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(j.Description,{ref:o,className:y("text-sm text-muted-foreground",e),...t}));pa.displayName=j.Description.displayName;var mo=_(require("react"));var ke=mo.forwardRef(({className:e,type:t,...o},r)=>(0,oe.jsx)("input",{type:t,className:y("flex oe-9 oe-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}));ke.displayName="Input";var uo=_(require("react")),He=uo.forwardRef(({className:e,...t},o)=>(0,oe.jsx)("textarea",{className:y("flex min-oe-[80px] oe-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}));He.displayName="Textarea";var go=_(require("react")),Et=_(require("@radix-ui/react-label")),vo=require("class-variance-authority");var ua=(0,vo.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Y=go.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(Et.Root,{ref:o,className:y(ua(),e),...t}));Y.displayName=Et.Root.displayName;var Je=({fieldName:e,value:t,label:o,multiline:r=!1,onSave:i,className:a="",disabled:n=!1})=>{let[s,c]=(0,me.useState)(!1),[m,p]=(0,me.useState)(""),C=()=>{n||(c(!0),p(t))},d=async()=>{m!==t&&await i(e,m),c(!1)},v=u=>{u.key==="Enter"&&!r||u.key==="Enter"&&u.ctrlKey&&r?d():u.key==="Escape"&&(c(!1),p(""))};return(0,oe.jsxs)("div",{className:`space-y-2 ${a}`,children:[(0,oe.jsx)(Y,{children:o}),s?r?(0,oe.jsx)(He,{value:m,onChange:u=>p(u.target.value),onBlur:d,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,oe.jsx)(ke,{value:m,onChange:u=>p(u.target.value),onBlur:d,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,oe.jsxs)("div",{onClick:C,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-oe-[100px]":"min-oe-[40px]"} flex items-start gap-2`,children:[(0,oe.jsx)("span",{className:r?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!n&&(0,oe.jsx)(co.Edit,{className:"oe-4 oe-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var fa=(0,vo.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 ze({className:e,variant:t,...o}){return(0,oe.jsx)("div",{className:y(fa({variant:t}),e),...o})}var dt=_(require("react")),be=_(require("@radix-ui/react-avatar"));var At=dt.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(be.Root,{ref:o,className:y("relative flex oe-10 oe-10 shrink-0 overflow-hidden rounded-full",e),...t}));At.displayName=be.Root.displayName;var ga=dt.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(be.Image,{ref:o,className:y("aspect-square oe-full oe-full",e),...t}));ga.displayName=be.Image.displayName;var Ht=dt.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(be.Fallback,{ref:o,className:y("flex oe-full oe-full items-center justify-center rounded-full bg-muted",e),...t}));Ht.displayName=be.Fallback.displayName;var wo=require("@radix-ui/react-slot"),No=_(require("react")),So=(0,vo.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:"oe-10 px-4 py-2",icon:"oe-10 oe-10",lg:"oe-11 rounded px-8",sm:"oe-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"}}}),F=No.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...i},a)=>(0,oe.jsx)(e?wo.Slot:"button",{className:y(So({className:t,size:o,variant:r})),ref:a,...i}));F.displayName="Button";var Do=({comments:e,onAddComment:t})=>{let[o,r]=(0,me.useState)(""),i=n=>n.split(" ").map(s=>s[0]).join("").toUpperCase(),a=()=>{o.trim()&&(t(o),r(""))};return(0,oe.jsxs)("div",{className:"space-y-4",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)(co.MessageSquare,{className:"oe-5 oe-5"}),(0,oe.jsx)(Y,{className:"text-lg font-medium",children:"Comments"}),(0,oe.jsx)(ze,{variant:"secondary",children:e.length})]}),(0,oe.jsx)("div",{className:"space-y-4 max-oe-60 overflow-y-auto",children:e.map(n=>(0,oe.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,oe.jsx)(At,{className:"oe-8 oe-8 oe-1",children:(0,oe.jsx)(Ht,{className:"text-xs bg-muted text-muted-foreground",children:i(n.author)})}),(0,oe.jsxs)("div",{className:"flex-1",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,oe.jsx)("span",{className:"font-medium text-sm",children:n.author}),(0,oe.jsxs)("span",{className:"text-xs text-muted-foreground",children:[n.createdAt.toLocaleDateString()," at ",n.createdAt.toLocaleTimeString()]})]}),(0,oe.jsx)("p",{className:"text-sm text-muted-foreground",children:n.text})]})]},n.id))}),(0,oe.jsxs)("div",{className:"flex gap-2",children:[(0,oe.jsx)(He,{value:o,onChange:n=>r(n.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,oe.jsx)(F,{onClick:a,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,oe.jsx)(co.Send,{className:"oe-4 oe-4"})})]})]})};var Fe=_(require("react")),Ue=_(require("@radix-ui/react-toggle-group"));var Ro=_(require("react")),Ft=_(require("@radix-ui/react-toggle"));var Vt=(0,vo.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:"oe-9 px-2 min-oe-9",sm:"oe-8 px-1.5 min-oe-8",lg:"oe-10 px-2.5 min-oe-10"}},defaultVariants:{variant:"default",size:"default"}}),va=Ro.forwardRef(({className:e,variant:t,size:o,...r},i)=>(0,oe.jsx)(Ft.Root,{ref:i,className:y(Vt({variant:t,size:o,className:e})),...r}));va.displayName=Ft.Root.displayName;var Io=Fe.createContext({size:"default",variant:"default"}),ft=Fe.forwardRef(({className:e,variant:t,size:o,children:r,...i},a)=>(0,oe.jsx)(Ue.Root,{ref:a,className:y("flex items-center justify-center gap-1",e),...i,children:(0,oe.jsx)(Io.Provider,{value:{variant:t,size:o},children:r})}));ft.displayName=Ue.Root.displayName;var gt=Fe.forwardRef(({className:e,children:t,variant:o,size:r,...i},a)=>{let n=Fe.useContext(Io);return(0,oe.jsx)(Ue.Item,{ref:a,className:y(Vt({variant:n.variant||o,size:n.size||r}),e),...i,children:t})});gt.displayName=Ue.Item.displayName;var R=_(require("@radix-ui/react-select")),Me=_(require("react")),vt=R.Root;var Xe=Me.forwardRef(({children:e,className:t,...o},r)=>(0,oe.jsxs)(R.Trigger,{className:y("flex oe-10 oe-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,oe.jsx)(R.Icon,{asChild:!0,children:(0,oe.jsx)(co.ChevronDown,{className:"oe-4 oe-4 opacity-50"})})]}));Xe.displayName=R.Trigger.displayName;var Eo=Me.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(R.ScrollUpButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,oe.jsx)(co.ChevronUp,{className:"oe-4 oe-4"})}));Eo.displayName=R.ScrollUpButton.displayName;var Lo=Me.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(R.ScrollDownButton,{className:y("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,oe.jsx)(co.ChevronDown,{className:"oe-4 oe-4"})}));Lo.displayName=R.ScrollDownButton.displayName;var qe=Me.forwardRef(({children:e,className:t,position:o="popper",...r},i)=>(0,oe.jsx)(R.Portal,{children:(0,oe.jsxs)(R.Content,{className:y("relative z-50 max-oe-96 min-oe-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:i,...r,children:[(0,oe.jsx)(Eo,{}),(0,oe.jsx)(R.Viewport,{className:y("p-1",o==="popper"&&"oe-[var(--radix-select-trigger-height)] oe-full min-oe-[var(--radix-select-trigger-width)]"),children:e}),(0,oe.jsx)(Lo,{})]})}));qe.displayName=R.Content.displayName;var ha=Me.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(R.Label,{className:y("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));ha.displayName=R.Label.displayName;var _e=Me.forwardRef(({children:e,className:t,...o},r)=>(0,oe.jsxs)(R.Item,{className:y("relative flex oe-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,oe.jsx)("span",{className:"absolute left-2 flex oe-3.5 oe-3.5 items-center justify-center",children:(0,oe.jsx)(R.ItemIndicator,{children:(0,oe.jsx)(co.Check,{className:"oe-4 oe-4"})})}),(0,oe.jsx)(R.ItemText,{children:e})]}));_e.displayName=R.Item.displayName;var ba=Me.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(R.Separator,{className:y("-mx-1 my-1 oe-px bg-muted",e),ref:o,...t}));ba.displayName=R.Separator.displayName;var ht=({label:e,value:t,onValueChange:o,options:r,showColor:i=!1,disabled:a=!1})=>{let[n,s]=(0,me.useState)(!1),c=r.find(p=>p.value===t);return(0,oe.jsxs)("div",{className:"space-y-1",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:e}),(0,oe.jsxs)(vt,{value:t,onValueChange:o,open:n,onOpenChange:p=>{a||s(p)},disabled:a,children:[(0,oe.jsx)(Xe,{className:"oe-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,oe.jsxs)(ze,{variant:"secondary",className:`${a?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!a&&s(!n),children:[i&&c?.color&&(0,oe.jsx)("div",{className:`oe-2 oe-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,oe.jsx)(qe,{children:r.map(p=>(0,oe.jsx)(_e,{value:p.value,children:i&&p.color?(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)("div",{className:`oe-3 oe-3 rounded-full ${p.color}`}),p.label]}):p.label},p.value))})]})]})};var Ho=({label:e,value:t,onValueChange:o,options:r,placeholder:i="Search...",allowCustomValue:a=!1,disabled:n=!1})=>{let[s,c]=(0,me.useState)(!1),[m,p]=(0,me.useState)(""),C=r.find(l=>l.value===t),d=r.filter(l=>l.label.toLowerCase().includes(m.toLowerCase())),v=l=>{o(l),c(!1),p("")},u=()=>{a&&m.trim()&&!r.find(l=>l.value===m.trim())&&(o(m.trim()),c(!1),p(""))};return(0,oe.jsxs)("div",{className:"space-y-1",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:e}),(0,oe.jsxs)(vt,{value:t,onValueChange:v,open:s,onOpenChange:l=>{n||c(l)},disabled:n,children:[(0,oe.jsx)(Xe,{className:"oe-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,oe.jsx)(ze,{variant:"secondary",className:`${n?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!n&&c(!s),children:C?.label||t||"Select..."})}),(0,oe.jsxs)(qe,{children:[(0,oe.jsx)("div",{className:"p-2",children:(0,oe.jsx)(ke,{placeholder:i,value:m,onChange:l=>p(l.target.value),onKeyDown:l=>{l.key==="Enter"&&a&&u()},className:"mb-2"})}),d.map(l=>(0,oe.jsx)(_e,{value:l.value,children:l.label},l.value)),a&&m.trim()&&!d.find(l=>l.value===m.trim())&&(0,oe.jsxs)(_e,{value:m.trim(),children:['Add "',m.trim(),'"']})]})]})]})};var Ot=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var xa=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:co.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:co.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:co.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:co.Zap}],ya=[{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 Fo=({task:e,epics:t,sprints:o,lastUpdated:r,onUpdateTask:i,onClose:a,onDelete:n,isUpdating:s=!1,isDeleting:c=!1,deleteState:m="idle",teamMembers:p})=>{let[C,d]=(0,me.useState)(e.storyPoints),v=(0,me.useRef)(null),[u,N]=(0,me.useState)(p);(0,me.useEffect)(()=>{N(p)},[p]);let l=(0,me.useCallback)((g,S)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{i(g,S)},500)},[i]);(0,me.useEffect)(()=>{l("storyPoints",C?.toString()||"1")},[C]);let f=g=>g.split(" ").map(S=>S[0]).join("").toUpperCase(),M=()=>m==="loading"?(0,oe.jsxs)(F,{disabled:!0,variant:"destructive",className:"oe-full oe-8 text-xs gap-1",children:[(0,oe.jsx)(co.Loader2,{className:"oe-3 oe-3 animate-spin"}),"Deleting..."]}):m==="success"?(0,oe.jsxs)(F,{disabled:!0,variant:"destructive",className:"oe-full oe-8 text-xs gap-1",children:[(0,oe.jsx)(co.Check,{className:"oe-3 oe-3"}),"Deleted"]}):m==="error"?(0,oe.jsxs)(F,{disabled:!0,variant:"destructive",className:"oe-full oe-8 text-xs gap-1",children:[(0,oe.jsx)(co.X,{className:"oe-3 oe-3"}),"Delete failed"]}):(0,oe.jsxs)(F,{onClick:n,variant:"destructive",className:"oe-full oe-8 text-xs gap-1",disabled:s||c,children:[(0,oe.jsx)(co.Trash2,{className:"oe-3 oe-3"}),"Delete Task"]});return(0,oe.jsxs)("div",{className:"flex flex-col oe-full",children:[(0,oe.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Status"}),(0,oe.jsx)(ht,{label:"",value:e.status,onValueChange:g=>i("status",g),options:[{value:"todo",label:"oe Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Type"}),(0,oe.jsx)(ft,{type:"single",value:e.type||"",onValueChange:g=>g&&i("type",g),className:"grid grid-cols-2 gap-1",disabled:s,children:xa.map(g=>{let S=g.icon;return(0,oe.jsxs)(gt,{value:g.value,className:"flex items-center gap-1 text-xs oe-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,oe.jsx)(S,{className:"oe-3 oe-3"}),g.label]},g.value)})})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,oe.jsx)(ft,{type:"single",value:e.priority||"",onValueChange:g=>g&&i("priority",g),className:"grid grid-cols-3 gap-1",disabled:s,children:ya.map(g=>(0,oe.jsx)(gt,{value:g.value,className:"text-xs oe-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:g.label},g.value))})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,oe.jsx)("input",{type:"number",min:"1",max:"100",value:C||1,onChange:g=>{let S=Number(g.target.value);S<1?d(1):S>100?d(100):d(S)},className:"oe-full oe-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,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,oe.jsx)(ht,{label:"",value:Ot(e.epic).toString(),onValueChange:g=>i("epic",g),options:(t||[]).map(g=>({value:g.id.toString(),label:g?.name,color:g.color})),showColor:!0,disabled:s})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,oe.jsx)(ht,{label:"",value:Ot(e.sprint).toString()||"none",onValueChange:g=>i("sprint",g==="none"?"":g),options:[{value:"none",label:"No Sprint"},...(o||[]).map(g=>({value:g.id.toString(),label:`${g?.name}`}))],disabled:s})]}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(Y,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,oe.jsx)(Ho,{label:"",value:e.assignee?.value?.name,onValueChange:g=>i("assignee",g),options:u.map(g=>({value:`${typeof g.email=="string"?"users":"digital-colleagues"}:${g.id}`,label:g?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,oe.jsxs)("div",{className:"oe-auto co-4 space-y-4",children:[(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsx)(F,{onClick:a,variant:"outline",className:"oe-full oe-8 text-xs",disabled:s||c,children:"Close"}),M()]}),(0,oe.jsxs)("div",{className:"co-4 border-t border-border space-y-2",children:[(0,oe.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,oe.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,oe.jsx)(co.User,{className:"oe-3 oe-3"}),(0,oe.jsx)("span",{children:"System"})]})]}),(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,oe.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,oe.jsx)(co.Calendar,{className:"oe-3 oe-3"}),(0,oe.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,oe.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,oe.jsx)(co.Clock,{className:"oe-3 oe-3"}),(0,oe.jsxs)("span",{children:[new Date(r).toLocaleDateString()," at"," ",new Date(r).toLocaleTimeString()]})]})]})]})]})]})};var Yt=require("motion/react");var Nr=_(require("@radix-ui/react-dialog"));var cr=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),dr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),mr=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),pr=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),ur=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),fr=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),gr=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Tt=require("@payloadcms/richtext-lexical/lexical/list"),vr=require("@payloadcms/richtext-lexical/lexical/rich-text"),hr=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var sr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),at=require("@payloadcms/richtext-lexical/lexical/utils"),P=require("@payloadcms/richtext-lexical/lexical"),Xt=require("@payloadcms/richtext-lexical/lexical/selection");var jo=require("@radix-ui/react-dialog"),wt=require("@payloadcms/richtext-lexical/client");var Ut=_(require("bson-objectid"));var Bo=require("@payloadcms/ui");var Vo=_(require("react")),le=_(require("@radix-ui/react-tooltip"));var bt=le.Provider,xt=le.Root,yt=le.Trigger,Ye=Vo.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,oe.jsx)(le.Portal,{children:(0,oe.jsx)(le.Content,{ref:r,sideOffset:t,className:y("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})}));Ye.displayName=le.Content.displayName;var wa=e=>{let{data:{relationTo:t,value:o},nodeKey:r}=e,[i]=(0,sr.useLexicalComposerContext)(),[a,n]=(0,me.useState)(""),[s,c]=(0,me.useState)(""),[m,p]=(0,me.useState)(""),C=async l=>{console.log("fetchMedia",l)};(0,me.useEffect)(()=>{typeof o=="string"?o.length===24?C(o):(n(o||""),p(N(u())),c(v()||"")):typeof o=="object"&&(n(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),p(N(o.filesize)),c(o.mimeType?.split("/")[1]||""))},[]);let d=(0,me.useCallback)(()=>{i.update(()=>{(0,P.$getNodeByKey)(r)?.remove()})},[i,r]),v=()=>{let l=e.data.value;return typeof l=="string"?l.split(";base64")[0]?.split("image/")[1]:""},u=()=>{let l=e.data.value;if(typeof l=="string"){let f=l.split(",")[1]?.length||0;return 4*Math.ceil(f/3)*.5624896334383812/1e3}return 0};function N(l){if(l>=1e6){let M=l/1e6;return`${M>=10?Math.round(M).toString():M.toFixed(1)} MB`}return`${Math.floor(l/1e3)} KB`}return(0,oe.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,oe.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip oe-60 flex flex-col gap-2 bg-[#222222]",children:[(0,oe.jsxs)("div",{className:"flex gap-2 border-oe border-oe-slate-100/10",children:[(0,oe.jsx)("div",{className:"flex-1",children:e.data.value?(0,oe.jsx)("img",{className:"object-cover m-0 oe-full min-oe-[115px] min-oe-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:a}):(0,oe.jsx)(Bo.File,{})}),(0,oe.jsx)(bt,{children:(0,oe.jsxs)(xt,{children:[(0,oe.jsxs)(yt,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,oe.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,oe.jsx)("button",{onClick:l=>{l.preventDefault(),d()},className:"flex-1 flex justify-center items-center",children:(0,oe.jsx)(co.X,{width:24,height:24,strokeWidth:1})})]}),(0,oe.jsx)(Ye,{children:(0,oe.jsx)("span",{children:"Remove image"})})]})})]}),(0,oe.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,oe.jsx)("span",{className:"",children:s?.toLocaleUpperCase()}),(0,oe.jsx)("span",{children:m})]})]})})},_o=wa;function Ca(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:Ge({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var Qe=class extends wt.UploadNode{static importDOM(){return{img:()=>({conversion:Ca,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new Ut.default().toHexString(),t.version=3);let o={id:t.id??new Ut.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},r=Ge(o);return r.setFormat?.(t.format),r}decorate(){return(0,$o.jsx)(_o,{data:this.__data,nodeKey:this.getKey()})}};function Ge(e){return new Qe({data:e})}var Na=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Sa=e=>Na?(e||window).getSelection():null,Nn=(0,P.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),_t=(0,P.createCommand)("INSERT_UPLOAD_COMMAND");function Zo({activeEditor:e,onClose:t,isOpen:o=!1}){let r=(0,me.useRef)(!1),[i,a]=(0,me.useState)(!0),[n,s]=(0,me.useState)(""),[c,m]=(0,me.useState)(""),[p,C]=(0,me.useState)(!1),[d,v]=(0,me.useState)("left"),u=n==="",N=S=>{C(S.target.checked)},l=S=>{v(S.target.value)},f=S=>{let X=new FileReader;X.onload=function(){return typeof X.result=="string"&&s(X.result),""},S!==null&&S[0]&&X.readAsDataURL(S[0])};(0,me.useEffect)(()=>{r.current=!1;let S=X=>{r.current=X.altKey};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[e]),(0,me.useEffect)(()=>{i||t()},[i]),(0,me.useEffect)(()=>{a(o)},[o]);let M=({editor:S,relationTo:X,replaceNodeKey:ue,value:we})=>{if(ue)S.update(()=>{let ee=(0,P.$getNodeByKey)(ue);ee&&ee.replace(Ge({id:"",fields:{},relationTo:"media",value:we}))});else{let ee=S.dispatchCommand(_t,{fields:null,relationTo:"media",value:we})}},g=()=>{M({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:c,src:n,showCaption:p,position:d}.src}),a(!1),t()};return(0,oe.jsx)(Re,{open:i,onOpenChange:S=>a(S),children:(0,oe.jsxs)(Le,{children:[(0,oe.jsxs)(Ae,{children:[(0,oe.jsx)(ve,{children:"Upload Image"}),(0,oe.jsx)(jo.DialogDescription,{children:"Description"})]}),(0,oe.jsxs)("div",{className:"",children:[(0,oe.jsx)("div",{style:{marginBottom:"1em"},children:(0,oe.jsx)(ke,{type:"file",onChange:S=>f(S.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,oe.jsx)("div",{style:{marginBottom:"1em"},children:(0,oe.jsx)(ke,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:S=>m(S.currentTarget.value),value:c,"data-test-id":"image-modal-alt-text-input"})}),(0,oe.jsx)(F,{"data-test-id":"image-modal-file-upload-btn",disabled:u,onClick:()=>g(),children:"Confirm"})]})]})})}function Gt({captionsEnabled:e}){let[t]=(0,sr.useLexicalComposerContext)();return(0,me.useEffect)(()=>{if(!t.hasNodes([wt.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,at.mergeRegister)(t.registerCommand(P.DRAGSTART_COMMAND,o=>Ta(o),P.COMMAND_PRIORITY_HIGH),t.registerCommand(P.DRAGOVER_COMMAND,o=>Pa(o),P.COMMAND_PRIORITY_LOW),t.registerCommand(P.DROP_COMMAND,o=>Da(o,t),P.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Ta(e){if(!$t())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function Pa(e){return $t()?(Jo(e)||e.preventDefault(),!0):!1}function Da(e,t){let o=$t();if(!o)return!1;if(e.preventDefault(),Jo(e)){let r=Ra(e);o.remove();let i=(0,P.$createRangeSelection)();r!=null&&i.applyDOMRange(r),(0,P.$setSelection)(i)}return!0}function $t(){let e=(0,P.$getSelection)();if(!(0,P.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,wt.$isUploadNode)(o)?o:null}function Jo(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 Ra(e){let t,o=e.target,r=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,i=Sa(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 ka=()=>(0,oe.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,oe.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"})}),Xo=ka;var Ma=()=>(0,oe.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,oe.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"})}),qo=Ma;var Ia=()=>(0,oe.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,oe.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,oe.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Yo=Ia;var Ea=()=>(0,oe.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,oe.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,oe.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Qo=Ea;var La=()=>(0,oe.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,oe.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"})}),er=La;var Aa=()=>(0,oe.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,oe.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),tr=Aa;var or=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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"})}),rr=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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"})}),ar=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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"})}),ir=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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"})}),nr=()=>(0,oe.jsx)("svg",{"aria-hidden":"true",className:"oe-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,oe.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 xe=_(require("react")),D=_(require("@radix-ui/react-dropdown-menu")),$e=require("@radix-ui/react-icons");var Ct=D.Root,Nt=D.Trigger;var Ha=xe.forwardRef(({className:e,inset:t,children:o,...r},i)=>(0,oe.jsxs)(D.SubTrigger,{ref:i,className:y("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,oe.jsx)($e.ChevronRightIcon,{className:"ml-auto"})]}));Ha.displayName=D.SubTrigger.displayName;var Fa=xe.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(D.SubContent,{ref:o,className:y("z-50 min-oe-[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}));Fa.displayName=D.SubContent.displayName;var ot=xe.forwardRef(({className:e,sideOffset:t=4,...o},r)=>(0,oe.jsx)(D.Portal,{children:(0,oe.jsx)(D.Content,{ref:r,sideOffset:t,className:y("z-50 min-oe-[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})}));ot.displayName=D.Content.displayName;var rt=xe.forwardRef(({className:e,inset:t,...o},r)=>(0,oe.jsx)(D.Item,{ref:r,className:y("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}));rt.displayName=D.Item.displayName;var Va=xe.forwardRef(({className:e,children:t,checked:o,...r},i)=>(0,oe.jsxs)(D.CheckboxItem,{ref:i,className:y("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,oe.jsx)("span",{className:"absolute left-2 flex oe-3.5 oe-3.5 items-center justify-center",children:(0,oe.jsx)(D.ItemIndicator,{children:(0,oe.jsx)($e.CheckIcon,{className:"oe-4 oe-4"})})}),t]}));Va.displayName=D.CheckboxItem.displayName;var Ba=xe.forwardRef(({className:e,children:t,...o},r)=>(0,oe.jsxs)(D.RadioItem,{ref:r,className:y("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,oe.jsx)("span",{className:"absolute left-2 flex oe-3.5 oe-3.5 items-center justify-center",children:(0,oe.jsx)(D.ItemIndicator,{children:(0,oe.jsx)($e.DotFilledIcon,{className:"oe-4 oe-4 fill-current"})})}),t]}));Ba.displayName=D.RadioItem.displayName;var Oa=xe.forwardRef(({className:e,inset:t,...o},r)=>(0,oe.jsx)(D.Label,{ref:r,className:y("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));Oa.displayName=D.Label.displayName;var za=xe.forwardRef(({className:e,...t},o)=>(0,oe.jsx)(D.Separator,{ref:o,className:y("-mx-1 my-1 oe-px bg-muted",e),...t}));za.displayName=D.Separator.displayName;var Ua=({className:e,...t})=>(0,oe.jsx)("span",{className:y("ml-auto text-xs tracking-widest opacity-60",e),...t});Ua.displayName="DropdownMenuShortcut";var Jt=1;function _a(){return(0,oe.jsx)("span",{className:"border border-[#222222]"})}function qt(){let[e]=(0,sr.useLexicalComposerContext)(),t=(0,me.useRef)(null),[o,r]=(0,me.useState)(!1),[i,a]=(0,me.useState)(!1),[n,s]=(0,me.useState)(!1),[c,m]=(0,me.useState)(!1),[p,C]=(0,me.useState)(!1),[d,v]=(0,me.useState)(!1),[u,N]=(0,me.useState)(!1),[l,f]=(0,me.useState)(!1),[M,g]=(0,me.useState)(!1),[S,X]=(0,me.useState)("left"),[ue,we]=(0,me.useState)("p"),ee=x=>{e.update(()=>{let L=(0,P.$getSelection)();(0,P.$isRangeSelection)(L)&&(x==="p"?(0,Xt.$setBlocksType)(L,()=>(0,P.$createParagraphNode)()):(0,Xt.$setBlocksType)(L,()=>(0,vr.$createHeadingNode)(x)))})},Ce=(0,me.useCallback)(()=>{let x=(0,P.$getSelection)();if((0,P.$isRangeSelection)(x)){s(x.hasFormat("bold")),m(x.hasFormat("italic")),C(x.hasFormat("underline")),v(x.hasFormat("strikethrough")),N(x.hasFormat("subscript")),f(x.hasFormat("superscript"));let L=x.anchor.getNode(),z=L;for(;z&&!(0,P.$isParagraphNode)(z)&&z!==(0,P.$getRoot)();){let Q=z.getParent();Q&&(z=Q)}if(z){let Q=z.getFormatType();X(Q||"left")}let ie=L.getTopLevelElement()?.__tag;we(ie||"p")}},[]);(0,me.useEffect)(()=>(0,at.mergeRegister)(e.registerUpdateListener(({editorState:x})=>{x.read(()=>{Ce()})}),e.registerCommand(P.SELECTION_CHANGE_COMMAND,(x,L)=>(Ce(),!1),Jt),e.registerCommand(P.CAN_UNDO_COMMAND,x=>(r(x),!1),Jt),e.registerCommand(P.CAN_REDO_COMMAND,x=>(a(x),!1),Jt),(0,at.mergeRegister)(e.registerCommand(_t,x=>(e.update(()=>{let L=(0,P.$getSelection)()||(0,P.$getPreviousSelection)();if((0,P.$isRangeSelection)(L)){let z=Ge({id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}),{focus:ie}=L,Q=ie.getNode();(0,at.$insertNodeToNearestRoot)(z),(0,P.$isParagraphNode)(Q)&&!Q.__first&&Q.remove()}}),!0),P.COMMAND_PRIORITY_EDITOR))),[e,Ce]);let Ne=[[{label:"Undo",icon:(0,oe.jsx)(co.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,oe.jsx)(co.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,oe.jsx)(Xo,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:n},{label:"Italic",icon:(0,oe.jsx)(qo,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:c},{label:"Underline",icon:(0,oe.jsx)(Yo,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:p},{label:"Strikethrough",icon:(0,oe.jsx)(Qo,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:d},{label:"Subscript",icon:(0,oe.jsx)(er,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:u},{label:"Superscript",icon:(0,oe.jsx)(tr,{}),onClick:()=>{e.dispatchCommand(P.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:l}]],fe=[{label:"Left Align",direction:"left",icon:(0,oe.jsx)(co.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,oe.jsx)(co.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,oe.jsx)(co.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,oe.jsx)(co.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(P.FORMAT_ELEMENT_COMMAND,"justify")}}],Se=[{label:"Normal Text",value:"p",icon:(0,oe.jsx)(or,{}),onClick:()=>ee("p")},{label:"Heading 1",value:"h1",icon:(0,oe.jsx)(rr,{}),onClick:()=>ee("h1")},{label:"Heading 2",value:"h2",icon:(0,oe.jsx)(ar,{}),onClick:()=>ee("h2")},{label:"Heading 3",value:"h3",icon:(0,oe.jsx)(ir,{}),onClick:()=>ee("h3")},{label:"Heading 4",value:"h4",icon:(0,oe.jsx)(nr,{}),onClick:()=>ee("h4")},...[{label:"Unordered List",value:"ul",icon:(0,oe.jsx)(co.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Tt.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,oe.jsx)(co.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Tt.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],Te=[{label:"Insert Image",icon:(0,oe.jsx)(co.ImageUp,{width:15,height:15}),onClick:()=>{g(!0)},disabled:!1}];return(0,oe.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,oe.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[Ne.map((x,L)=>(0,oe.jsxs)(me.Fragment,{children:[(0,oe.jsx)("div",{className:"flex items-center gap-2",children:x.map((z,ie)=>(0,oe.jsx)("div",{role:"button","aria-disabled":z.disabled||!1,onClick:z.onClick,className:y("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,oe.jsx)(bt,{children:(0,oe.jsxs)(xt,{children:[(0,oe.jsx)(yt,{className:"text-[#b5b5b5]",children:z.icon}),(0,oe.jsx)(Ye,{children:(0,oe.jsx)("p",{children:z.label})})]})})},ie))}),(0,oe.jsx)(_a,{})]},`toolbar-option-${x.length}-${L}`)),(0,oe.jsxs)(Ct,{children:[(0,oe.jsxs)(Nt,{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:[fe.find(x=>x.direction===S)?.icon,fe.find(x=>x.direction===S)?.label,(0,oe.jsx)(co.ChevronDown,{width:15,height:15})]}),(0,oe.jsx)(ot,{className:"bg-black hover:bg-black",children:fe.map((x,L)=>(0,oe.jsxs)(rt,{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,oe.jsx)("span",{children:x.icon}),(0,oe.jsx)("span",{children:x.label})]},`${x.label}-${L}`))})]}),(0,oe.jsxs)(Ct,{children:[(0,oe.jsxs)(Nt,{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:[Se.find(x=>x.value===ue)?.icon,Se.find(x=>x.value===ue)?.label,(0,oe.jsx)(co.ChevronDown,{width:15,height:15})]}),(0,oe.jsx)(ot,{className:"bg-black hover:bg-black",children:Se.map((x,L)=>(0,oe.jsxs)(rt,{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,oe.jsx)("span",{children:x.icon}),(0,oe.jsx)("span",{children:x.label})]},`heading-option-${x.label}-${L}`))})]}),(0,oe.jsxs)(Ct,{children:[(0,oe.jsxs)(Nt,{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,oe.jsx)(co.Plus,{width:15,height:15}),(0,oe.jsx)(co.ChevronDown,{width:15,height:15})]}),(0,oe.jsx)(ot,{className:"bg-black hover:bg-black",children:Te.map((x,L)=>(0,oe.jsxs)(rt,{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,oe.jsx)("span",{children:x.icon}),(0,oe.jsx)("span",{children:x.label})]},L))})]}),M&&(0,oe.jsx)(Zo,{activeEditor:e,onClose:()=>{g(!1)},isOpen:M})]})})}var Ga=({setValue:e,value:t,name:o,editable:r=!0})=>{let[i]=(0,sr.useLexicalComposerContext)(),a=(0,me.useRef)(null),n=s=>{s.read(()=>{let c=s.toJSON();JSON.stringify(c)!==JSON.stringify(a.current)&&(a.current=c,e?.(()=>c))})};return(0,me.useEffect)(()=>{i.setEditable(r)},[r,i]),(0,me.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,oe.jsx)("div",{className:"oe-full",children:(0,oe.jsxs)("div",{className:" ",children:[r&&(0,oe.jsx)(qt,{}),(0,oe.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,oe.jsx)(fr.RichTextPlugin,{contentEditable:(0,oe.jsx)(mr.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-oe-40"}),ErrorBoundary:pr.LexicalErrorBoundary}),r&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ur.HistoryPlugin,{}),(0,oe.jsx)(cr.AutoFocusPlugin,{}),(0,oe.jsx)(gr.ListPlugin,{}),(0,oe.jsx)(hr.OnChangePlugin,{onChange:n}),(0,oe.jsx)(Gt,{})]})]})]})})},$a=({setValue:e,value:t,name:o,editable:r=!0})=>(0,oe.jsx)(dr.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Tt.ListNode,Tt.ListItemNode,vr.HeadingNode,Qe],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,oe.jsx)(Ga,{value:t,setValue:e,name:o,editable:r})}),xr=$a;var nt=e=>"mimeType"in e&&"url"in e&&!("format"in e),Wa=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("oe","")):1,s=r(a.children||[]);return"#".repeat(n)+" "+s}case"paragraph":return a.children&&a.children.some(c=>c.type==="text"?c.text&&c.text.trim().length>0:(c.type==="linebreak",!0))?r(a.children||[]):"";case"list":{let n=[],s=a.listType==="number"?"1.":"-";return a.children?.forEach((c,m)=>{if(c.type==="listitem"){let p=r(c.children||[]),C=a.listType==="number"?`${m+1}.`:s;n.push(`${C} ${p}`)}}),n.join(`
|
|
5
|
+
`)}case"listitem":return r(a.children||[]);case"text":{let n=a.text||"";if(a.format){let s=(a.format&1)!==0,c=(a.format&2)!==0,m=(a.format&4)!==0,p=(a.format&8)!==0;(a.format&16)!==0?n=`\`${n}\``:(s&&(n=`**${n}**`),c&&(n=`*${n}*`),m&&(n=`~~${n}~~`),p&&(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 c=(n.format&1)!==0,m=(n.format&2)!==0,p=(n.format&4)!==0,C=(n.format&8)!==0;(n.format&16)!==0?s=`\`${s}\``:(c&&(s=`**${s}**`),m&&(s=`*${s}*`),p&&(s=`~~${s}~~`),C&&(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`
|
|
6
|
+
`}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(`
|
|
7
|
+
`)},Ee=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 d=i[1]||"",v=d?Ee(d):[];v.length>0?(v.forEach(u=>{u.type==="text"&&(u.format=(u.format||0)|8)}),t.push(...v)):d===""&&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 d=a[2];d&&t.push({type:"text",text:d,format:16}),o+=a[0].length;continue}let n=e.slice(o).match(/^(~~)(.+?)\1/);if(n){let d=n[2],v=Ee(d);v.forEach(u=>{u.type==="text"&&(u.format=(u.format||0)|4)}),t.push(...v),o+=n[0].length;continue}let s=e.slice(o).match(/^(\*\*|__)(.+?)\1/);if(s){let d=s[2],v=Ee(d);v.forEach(u=>{u.type==="text"&&(u.format=(u.format||0)|1)}),t.push(...v),o+=s[0].length;continue}let c=e.slice(o).match(/^(\*|_)([^*_\n]+?)\1(?!\*|_)/);if(c&&c[0].length>2){let d=c[2],v=Ee(d);v.forEach(u=>{u.type==="text"&&(u.format=(u.format||0)|2)}),t.push(...v),o+=c[0].length;continue}if(e[o]===`
|
|
8
|
+
`){t.push({type:"linebreak",version:1}),o+=1;continue}let m=e.length,p=[{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:d}of p){let v=e.slice(o+1).search(d);v!==-1&&v+1<m-o&&(m=o+v+1)}let C=e.slice(o,m);C&&t.push({type:"text",text:C,format:0}),o=m}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}]},Ka=e=>{let t=e.split(`
|
|
9
|
+
`),o=[],r=[],i=[],a=null,n=()=>{if(r.length>0){for(let c=0;c<r.length;c++){let m=r[c],p=Ee(m),C=p.length>0?p.map(d=>({...d,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];o.push({type:"paragraph",children:C,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 c of t){let m=c.trim();if(!m){n(),s(),o.push({children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""});continue}let p=m.match(/^(#{1,6})\s+(.+)$/);if(p){n(),s();let v=p[1].length,u=p[2],N=Ee(u);o.push({type:"heading",tag:`oe${v}`,children:N.length>0?N:[{type:"text",text:"",format:0}]});continue}let C=m.match(/^(\d+)\.\s+(.*)$/);if(C){n(),a==="bullet"&&s(),a!=="number"&&(i.length>0&&s(),a="number");let v=C[2]||"",u=Ee(v),N=u.length>0?u.map(l=>({...l,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:N,direction:"ltr",format:"",indent:0,version:1}]});continue}let d=m.match(/^[-*+]\s+(.+)$/);if(d){n(),a==="number"&&s(),a!=="bullet"&&(i.length>0&&s(),a="bullet");let v=d[1],u=Ee(v),N=u.length>0?u.map(l=>({...l,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:N,direction:"ltr",format:"",indent:0,version:1}]});continue}i.length>0&&s(),r.push(c)}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}}},ja=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=Ka(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 wr({document:e,onCancel:t,onSave:o,onFileUpdate:r}){let[i,a]=(0,me.useState)(nt(e)),[n,s]=(0,me.useState)(nt(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}),[c,m]=(0,me.useState)(nt(e)?void 0:n.richTextContent),[p,C]=(0,me.useState)(!1),d=(0,me.useRef)(nt(e)?e:null);(0,me.useEffect)(()=>{nt(e)?(a(!0),ja(e).then(l=>{s(l),m(l.richTextContent),a(!1)}).catch(l=>{l instanceof Error&&l.name!=="AbortError"&&(console.error("Failed to convert file:",l),a(!1))})):(s({...e,updatedAt:new Date}),m(e.richTextContent))},[e]);let v=l=>{switch(l){case"markdown":case"mdx":return(0,oe.jsx)(co.FileText,{className:"oe-6 oe-6 text-primary"});case"richText":return(0,oe.jsx)(co.File,{className:"oe-6 oe-6 text-success"});case"text":return(0,oe.jsx)(co.Type,{className:"oe-6 oe-6 text-muted-foreground"});default:return(0,oe.jsx)(co.File,{className:"oe-6 oe-6 text-muted-foreground"})}},u=l=>{switch(l){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},N=async()=>{C(!0);try{let l,f;if(d.current&&d.current.mimeType==="text/markdown"){let g=c?Wa(c):"";l={...n,format:"markdown",content:g,richTextContent:void 0},f=g}else l={...n,richTextContent:c},f=n.content||"";let M=d.current?d.current.id.toString():n.id;await Promise.resolve(o()),r?.(M,f)}finally{C(!1)}};return(0,oe.jsxs)(Yt.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"oe-screen flex flex-col",children:[(0,oe.jsx)("div",{className:"border-oe border-border bg-card p-8 pb-6",children:(0,oe.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,oe.jsx)("div",{className:"flex items-start gap-4 flex-1 min-oe-0",children:(0,oe.jsx)("div",{className:"flex-1 min-oe-0",children:(0,oe.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,oe.jsx)("div",{className:"flex-1 min-oe-0",children:(0,oe.jsx)(Je,{fieldName:"title",value:n.title,label:"",onSave:(l,f)=>s(M=>({...M,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-oe-0"})}),(0,oe.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${u(n.format)} flex-shrink-0 oe-1`,children:n.format.toUpperCase()})]})})}),(0,oe.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,oe.jsxs)(F,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,oe.jsx)(co.X,{className:"oe-4 oe-4"}),"Close"]}),(0,oe.jsxs)(F,{size:"sm",onClick:N,className:"gap-2",disabled:p,children:[p?(0,oe.jsx)(co.Loader2,{className:"oe-4 oe-4 animate-spin"}):(0,oe.jsx)(co.Save,{className:"oe-4 oe-4"}),p?"Saving...":"Save"]})]})]})}),(0,oe.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,oe.jsx)("div",{className:"p-8 co-0 oe-full max-oe-full overflow-auto",children:i?(0,oe.jsx)("div",{className:"flex items-center justify-center oe-full",children:(0,oe.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,oe.jsx)(co.Loader2,{className:"oe-8 oe-8 animate-spin text-primary"}),(0,oe.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,oe.jsx)(oe.Fragment,{children:n.format==="richText"?(0,oe.jsx)(xr,{setValue:m,value:c,name:"richTextContent"},`richtext-${n.id}-${i?"loading":"loaded"}`):(0,oe.jsx)(He,{value:n.content||"",onChange:l=>s(f=>({...f,content:l.target.value})),placeholder:"Document content...",className:"min-oe-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var Cr=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 Tr({files:e,onFileClick:t,onFileDelete:o,onFileUpdate:r,showHeader:i=!0,className:a,viewMode:n="list"}){let[s,c]=(0,me.useState)(!1),[m,p]=(0,me.useState)(!1),[C,d]=(0,me.useState)(null),v=()=>{c(!1),d(null)},u=()=>{p(!0),setTimeout(()=>{p(!1),c(!1),d(null)},500)},N=l=>{d(l),c(!0)};return(0,oe.jsxs)("div",{className:y("rounded-3xl border overflow-hidden",a),children:[(0,oe.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[i&&n==="list"&&(0,oe.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,oe.jsx)("div",{className:"col-span-6",children:"Name"}),(0,oe.jsx)("div",{className:"col-span-2",children:"Size"}),(0,oe.jsx)("div",{className:"col-span-2",children:"Modified"})]}),n==="card"&&(0,oe.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),n==="list"&&(0,oe.jsx)("div",{className:"divide-y",children:e.map(l=>(0,oe.jsxs)(Yt.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?.(l),children:[(0,oe.jsxs)("div",{className:"col-span-6 flex items-center gap-3 oe-full md:oe-auto",children:[(0,oe.jsx)("div",{className:"flex oe-10 oe-10 items-center justify-center rounded-2xl bg-muted"}),(0,oe.jsx)("div",{children:(0,oe.jsx)("p",{className:"font-medium",children:l.name})})]}),(0,oe.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:Cr(l.filesize)}),(0,oe.jsxs)("div",{className:"col-span-2 flex items-center justify-between oe-full md:oe-auto",children:[(0,oe.jsx)("span",{className:"text-sm md:text-base",children:new Date(l.createdAt).toLocaleDateString()}),(0,oe.jsxs)("div",{className:"flex gap-1",children:[l.mimeType==="text/markdown"&&(0,oe.jsx)(F,{variant:"ghost",size:"icon",className:"oe-8 oe-8 rounded-xl",onClick:f=>{f.stopPropagation(),N(l)},children:(0,oe.jsx)(co.Edit,{className:"oe-4 oe-4"})}),(0,oe.jsx)(F,{variant:"ghost",size:"icon",className:"oe-8 oe-8 rounded-xl text-red-500 hover:text-red-600",onClick:f=>{f.stopPropagation(),o?.(l)},children:(0,oe.jsx)(co.Trash2,{className:"oe-4 oe-4"})})]})]})]},l.name))}),n==="card"&&(0,oe.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(l=>(0,oe.jsx)(Yt.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(l),children:(0,oe.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,oe.jsxs)("div",{className:"flex-1 min-oe-0 space-y-2",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-3",children:[(0,oe.jsx)("div",{className:"flex oe-10 oe-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,oe.jsx)("div",{className:"min-oe-0 flex-1",children:(0,oe.jsx)("p",{className:"font-medium truncate",children:l.name})})]}),(0,oe.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)("span",{className:"font-medium",children:"Size:"}),(0,oe.jsx)("span",{children:Cr(l.filesize)})]}),(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,oe.jsx)("span",{children:new Date(l.createdAt).toLocaleDateString()})]})]})]}),(0,oe.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[l.mimeType==="text/markdown"&&(0,oe.jsx)(F,{variant:"ghost",size:"icon",className:"oe-8 oe-8 rounded-xl",onClick:f=>{f.stopPropagation(),N(l)},title:"Edit",children:(0,oe.jsx)(co.Edit,{className:"oe-4 oe-4"})}),(0,oe.jsx)(F,{variant:"ghost",size:"icon",className:"oe-8 oe-8 rounded-xl text-red-500 hover:text-red-600",onClick:f=>{f.stopPropagation(),o?.(l)},title:"Delete",children:(0,oe.jsx)(co.Trash2,{className:"oe-4 oe-4"})})]})]})},l.name))}),(0,oe.jsx)(Re,{open:s,onOpenChange:l=>!l&&v(),children:(0,oe.jsxs)(It,{children:[(0,oe.jsx)(ct,{}),(0,oe.jsxs)(Nr.Content,{className:y("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,oe.jsx)(ve,{className:"sr-only",children:C?`Edit ${C.name}`:"Edit File"}),m&&(0,oe.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,oe.jsx)(co.Loader2,{className:"oe-8 oe-8 animate-spin text-primary"})}),C&&(0,oe.jsx)(wr,{document:C,onSave:u,onFileUpdate:r,onCancel:v})]})]})})]})}var Pr=({isOpen:e,onClose:t,onAddFile:o})=>{let[r,i]=(0,me.useState)(null),[a,n]=(0,me.useState)(""),[s,c]=(0,me.useState)(""),[m,p]=(0,me.useState)(""),C=v=>{let u=v.target.files?.[0];u&&(i(u),a||n(u.name))},d=async v=>{if(v.preventDefault(),!r)return;let u=new FormData;u.append("file",r),u.append("name",a),s&&u.append("description",s),m&&u.append("tags",m),o?.(u),t(),i(null),n(""),c(""),p("")};return(0,oe.jsx)(Re,{open:e,onOpenChange:t,children:(0,oe.jsxs)(Le,{className:"sm:max-oe-md",children:[(0,oe.jsx)(Ae,{children:(0,oe.jsx)(ve,{children:"Add New File"})}),(0,oe.jsxs)("form",{onSubmit:d,className:"grid gap-4",children:[(0,oe.jsx)("div",{className:"flex items-center justify-center oe-full",children:(0,oe.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center oe-full oe-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,oe.jsxs)("div",{className:"flex flex-col items-center justify-center co-5 pb-6",children:[(0,oe.jsx)(Za,{className:"oe-10 oe-10 text-gray-400"}),(0,oe.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,oe.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,oe.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,oe.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:C})]})}),r&&(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("p",{className:"font-medium",children:r.name}),(0,oe.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((r.size||0)/1024).toFixed(2)," KB"]})]}),(0,oe.jsx)(F,{type:"submit",onClick:d,children:"Upload"})]})]})]})})};function Za(e){return(0,oe.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,oe.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,oe.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,oe.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var Ja=({isOpen:e,onClose:t,initialTask:o,epics:r,sprints:i,onUpdateTask:a,onDeleteTask:n,onAddComment:s,colleagues:c,onUploadFile:m,onDeleteFile:p,onFileUpdate:C})=>{let[d,v]=(0,me.useState)(o),[u,N]=(0,me.useState)(new Date),[l,f]=(0,me.useState)("idle"),[M,g]=(0,me.useState)("idle"),[S,X]=(0,me.useState)(!1),[ue,we]=(0,me.useState)([]),[ee,Ce]=(0,me.useState)(c);(0,me.useEffect)(()=>{v(o)},[o]);let Ne=async(A,$)=>{if($!==d[A]){f("loading");try{await a(d.id.toString(),{[A]:$}),N(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch(Dt){console.log("error",Dt),f("error"),setTimeout(()=>f("idle"),3e3)}}},fe=async(A,$)=>{if($!==d[A]){f("loading");try{await a(d.id.toString(),{[A]:$}),N(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch(Dt){console.log("error",Dt),f("error"),setTimeout(()=>f("idle"),3e3)}}},E=async A=>{if(s){f("loading");try{await s?.({content:A,taskId:d.id.toString()}),N(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}}},Se=async()=>{g("loading");try{await n(d.id.toString()),g("success"),setTimeout(()=>{t(),g("idle")},1e3)}catch{g("error"),setTimeout(()=>g("idle"),3e3)}},Te=async A=>{if(m){f("loading");try{await m(d.id.toString(),A),N(new Date),f("success"),X(!1),setTimeout(()=>f("idle"),1500)}catch($){console.error("Error uploading file:",$),f("error"),setTimeout(()=>f("idle"),3e3)}}},x=async A=>{if(p){f("loading");try{await p(d.id.toString(),A.id.toString()),N(new Date),f("success"),setTimeout(()=>f("idle"),1500)}catch($){console.error("Error deleting file:",$),f("error"),setTimeout(()=>f("idle"),3e3)}}},L=(d.files||[]).map(A=>typeof A=="number"?null:A).filter(A=>A!==null),z=l!=="loading"&&M!=="loading",ie=()=>{z&&t()},Q=()=>l==="loading"?(0,oe.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,oe.jsx)(co.Loader2,{className:"oe-4 oe-4 animate-spin"}),(0,oe.jsx)("span",{children:"Updating..."})]}):l==="success"?(0,oe.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,oe.jsx)(co.Check,{className:"oe-4 oe-4"}),(0,oe.jsx)("span",{children:"Updated successfully"})]}):l==="error"?(0,oe.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,oe.jsx)(co.X,{className:"oe-4 oe-4"}),(0,oe.jsx)("span",{children:"Update failed"})]}):null;return(0,oe.jsxs)(Re,{open:e,onOpenChange:ie,children:[(0,oe.jsxs)(Le,{className:"max-oe-3xl max-oe-[80vh] overflow-y-auto p-4",children:[(0,oe.jsxs)(Ae,{children:[(0,oe.jsx)(ve,{className:"sr-only",children:d?.name}),(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsx)("div",{className:"flex-1",children:Q()}),!z&&(0,oe.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,oe.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,oe.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,oe.jsx)(Je,{fieldName:"name",value:d.name||"",label:"",onSave:Ne,className:"border-oe border-border pb-3",disabled:l==="loading"}),(0,oe.jsx)(Je,{fieldName:"description",value:d.description||"",label:"Description",multiline:!0,onSave:Ne,disabled:l==="loading"}),(0,oe.jsxs)("div",{className:"space-y-2",children:[(0,oe.jsxs)("div",{className:"flex items-center justify-between",children:[(0,oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,oe.jsx)(co.File,{className:"oe-4 oe-4 text-muted-foreground"}),(0,oe.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),m&&(0,oe.jsxs)(F,{variant:"outline",size:"sm",onClick:()=>X(!0),disabled:l==="loading",className:"gap-2",children:[(0,oe.jsx)(co.Upload,{className:"oe-4 oe-4"}),"Upload"]})]}),L.length>0?(0,oe.jsx)(Tr,{files:L,onFileDelete:p?x:void 0,onFileUpdate:C,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,oe.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"No files attached"})]}),(0,oe.jsx)(Do,{comments:(d?.comments||[]).map(A=>({author:A.author?.value.name||"",createdAt:new Date(A.timestamp),text:A.text,id:A.id||""})),onAddComment:E})]}),(0,oe.jsx)(Fo,{task:d,epics:r,sprints:i,lastUpdated:u,onUpdateTask:fe,onClose:ie,onDelete:Se,isUpdating:l==="loading",isDeleting:M==="loading",deleteState:M,teamMembers:ee})]})]}),m&&(0,oe.jsx)(Pr,{isOpen:S,onClose:()=>X(!1),onAddFile:Te})]})};0&&(module.exports={TaskDetailsModal});
|