cortex-react-components 1.64.1 → 1.65.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/dist/{chunk-MUZO74UP.mjs → chunk-2VOU42KD.mjs} +1 -1
  2. package/dist/{chunk-PFWODHNV.mjs → chunk-3AUTMBDB.mjs} +1 -1
  3. package/dist/{chunk-X3MBDMXV.mjs → chunk-5ALQQYYE.mjs} +1 -1
  4. package/dist/{chunk-OT2LLDV2.mjs → chunk-65BHP4TM.mjs} +1 -1
  5. package/dist/{chunk-ROEJPYRW.mjs → chunk-77KWI6EL.mjs} +1 -1
  6. package/dist/{chunk-RWWF3HBN.mjs → chunk-B7STYVDB.mjs} +1 -1
  7. package/dist/{chunk-4XO4HI55.mjs → chunk-CDJP2IDQ.mjs} +1 -1
  8. package/dist/{chunk-VX4NPEMC.mjs → chunk-CJF6GVGP.mjs} +1 -1
  9. package/dist/{chunk-TASJS6US.mjs → chunk-COI2LCY2.mjs} +1 -1
  10. package/dist/chunk-DVF55CWB.mjs +4 -0
  11. package/dist/{chunk-UM3WHBE7.mjs → chunk-DVGPU4EL.mjs} +1 -1
  12. package/dist/{chunk-RVI4KPBJ.mjs → chunk-EVVDCPEA.mjs} +1 -1
  13. package/dist/{chunk-YQ2YVQBS.mjs → chunk-FN5C27GW.mjs} +1 -1
  14. package/dist/{chunk-5LF662B4.mjs → chunk-FSYU3D5O.mjs} +1 -1
  15. package/dist/{chunk-UVPODMUO.mjs → chunk-FYEE5UWZ.mjs} +1 -1
  16. package/dist/{chunk-QZJGH4W6.mjs → chunk-GHXEOXV4.mjs} +1 -1
  17. package/dist/{chunk-VXGRJCCM.mjs → chunk-IC57R2EU.mjs} +1 -1
  18. package/dist/{chunk-XGEMVLT5.mjs → chunk-IH37BDR2.mjs} +1 -1
  19. package/dist/chunk-IPVKFQEY.mjs +4 -0
  20. package/dist/{chunk-X7PHWC2I.mjs → chunk-JLCWVIEP.mjs} +1 -1
  21. package/dist/{chunk-3HDDBU3J.mjs → chunk-KEM3XJKI.mjs} +1 -1
  22. package/dist/{chunk-ELPMUABW.mjs → chunk-KGSTIGCT.mjs} +1 -1
  23. package/dist/{chunk-SVYUY3VF.mjs → chunk-L5MDFQGH.mjs} +1 -1
  24. package/dist/{chunk-WLA5QCBE.mjs → chunk-MQRRCCAR.mjs} +1 -1
  25. package/dist/{chunk-Y7TUU6BG.mjs → chunk-MUBDAI2K.mjs} +1 -1
  26. package/dist/{chunk-HQTSD5A3.mjs → chunk-NP2M5K7O.mjs} +1 -1
  27. package/dist/{chunk-ISYJGX2I.mjs → chunk-NUQ6Z3WQ.mjs} +1 -1
  28. package/dist/{chunk-ZKU7UP6U.mjs → chunk-OMVXDUX7.mjs} +1 -1
  29. package/dist/{chunk-DAJNZDN6.mjs → chunk-PBRC3UOA.mjs} +1 -1
  30. package/dist/{chunk-KETV2XVN.mjs → chunk-SX5U74MW.mjs} +1 -1
  31. package/dist/{chunk-6BZPTAOQ.mjs → chunk-T5W5LMEK.mjs} +1 -1
  32. package/dist/{chunk-666KIWPS.mjs → chunk-T6W76EOH.mjs} +1 -1
  33. package/dist/{chunk-PEL6QUMS.mjs → chunk-U7Q6ZRR3.mjs} +1 -1
  34. package/dist/{chunk-VT6DWUPF.mjs → chunk-UDQTFQR7.mjs} +1 -1
  35. package/dist/chunk-URPKAQGD.mjs +1 -0
  36. package/dist/{chunk-ERUB6LU6.mjs → chunk-VGQTRTPZ.mjs} +1 -1
  37. package/dist/{chunk-MDEYJGAN.mjs → chunk-WPL2QWNG.mjs} +1 -1
  38. package/dist/{chunk-TYROOO53.mjs → chunk-X4Q7WZZS.mjs} +1 -1
  39. package/dist/{chunk-B7VQUUH3.mjs → chunk-YGFSXGAJ.mjs} +1 -1
  40. package/dist/{chunk-CXZGSPKM.mjs → chunk-YPK6OLRS.mjs} +1 -1
  41. package/dist/{chunk-G72SIYN7.mjs → chunk-ZAXQ74I3.mjs} +1 -1
  42. package/dist/{chunk-Z6NED523.mjs → chunk-ZY2PDUUB.mjs} +1 -1
  43. package/dist/components/Blocks/Banner.mjs +1 -1
  44. package/dist/components/Blocks/CallToAction.mjs +1 -1
  45. package/dist/components/Blocks/CallToAction.stories.mjs +1 -1
  46. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  47. package/dist/components/Blocks/CollapsibleArea.stories.mjs +1 -1
  48. package/dist/components/Blocks/Content.mjs +1 -1
  49. package/dist/components/Blocks/Content.stories.mjs +1 -1
  50. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  51. package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
  52. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  53. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  54. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  55. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  56. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  57. package/dist/components/Blocks/index.mjs +1 -1
  58. package/dist/components/CRM/CogeBoard.js +1 -1
  59. package/dist/components/CRM/CogeBoard.mjs +1 -1
  60. package/dist/components/CRM/CogeBoard.stories.js +1 -1
  61. package/dist/components/CRM/CogeBoard.stories.mjs +1 -1
  62. package/dist/components/CRM/DealDetails.js +1 -1
  63. package/dist/components/CRM/DealDetails.mjs +1 -1
  64. package/dist/components/CRM/DealDetails.stories.js +1 -1
  65. package/dist/components/CRM/DealDetails.stories.mjs +1 -1
  66. package/dist/components/CRM/KanbanBoard.js +1 -1
  67. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  68. package/dist/components/CRM/KanbanBoard.stories.js +1 -1
  69. package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
  70. package/dist/components/CRM/KanbanColumn.mjs +1 -1
  71. package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
  72. package/dist/components/CRM/NewCustomerForm.mjs +1 -1
  73. package/dist/components/CRM/NewCustomerForm.stories.mjs +1 -1
  74. package/dist/components/CRM/NewDealForm.mjs +1 -1
  75. package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
  76. package/dist/components/CRM/index.js +1 -1
  77. package/dist/components/CRM/index.mjs +1 -1
  78. package/dist/components/Cards/ContentCard.mjs +1 -1
  79. package/dist/components/Cards/ContentCard.stories.mjs +1 -1
  80. package/dist/components/Cards/FeatureCard.mjs +1 -1
  81. package/dist/components/Cards/FeatureCard.stories.mjs +1 -1
  82. package/dist/components/Cards/index.mjs +1 -1
  83. package/dist/components/DigitalColleagues/AddEpicModal.stories.mjs +1 -1
  84. package/dist/components/DigitalColleagues/KanbanBoard.mjs +1 -1
  85. package/dist/components/DigitalColleagues/KanbanBoard.stories.mjs +1 -1
  86. package/dist/components/DigitalColleagues/TaskDetailsModal.mjs +1 -1
  87. package/dist/components/DigitalColleagues/TaskDetailsModal.stories.mjs +1 -1
  88. package/dist/components/DigitalColleagues/TaskSidebar.mjs +1 -1
  89. package/dist/components/DigitalColleagues/TaskSidebar.stories.mjs +1 -1
  90. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  91. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  92. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  93. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  94. package/dist/components/Heros/PostHero/index.mjs +1 -1
  95. package/dist/components/Heros/RenderHero.mjs +1 -1
  96. package/dist/components/Heros/index.mjs +1 -1
  97. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  98. package/dist/components/Holidays/HolidayTracker.stories.mjs +1 -1
  99. package/dist/components/Holidays/index.mjs +1 -1
  100. package/dist/components/Layouts/FeatureGrid.stories.mjs +1 -1
  101. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  102. package/dist/components/Layouts/Print.mjs +1 -1
  103. package/dist/components/Layouts/Print.stories.mjs +1 -1
  104. package/dist/components/Layouts/SlideShow.mjs +1 -1
  105. package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
  106. package/dist/components/Layouts/index.mjs +1 -1
  107. package/dist/components/Payload/Card/index.mjs +1 -1
  108. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  109. package/dist/components/Payload/Media/index.mjs +1 -1
  110. package/dist/components/Payload/RichText/index.mjs +1 -1
  111. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  112. package/dist/components/Payload/RichText.stories.mjs +1 -1
  113. package/dist/components/Payload/index.mjs +1 -1
  114. package/dist/components/index.js +9 -8
  115. package/dist/components/index.mjs +1 -1
  116. package/dist/components/ui/index.d.ts +1 -0
  117. package/dist/components/ui/index.js +2 -1
  118. package/dist/components/ui/index.mjs +1 -1
  119. package/dist/components/ui/tabs.css +1 -0
  120. package/dist/components/ui/tabs.d.ts +7 -0
  121. package/dist/components/ui/tabs.js +4 -0
  122. package/dist/components/ui/tabs.mjs +2 -0
  123. package/dist/globals.css +1 -1
  124. package/dist/index.js +14 -13
  125. package/dist/index.mjs +1 -1
  126. package/dist/metafile-cjs.json +1 -1
  127. package/dist/metafile-esm.json +1 -1
  128. package/dist/pages/Blog.js +1 -1
  129. package/dist/pages/Blog.mjs +1 -1
  130. package/dist/pages/Blog.stories.js +1 -1
  131. package/dist/pages/Blog.stories.mjs +1 -1
  132. package/dist/pages/IndexPage.mjs +1 -1
  133. package/dist/pages/IndexPage.stories.mjs +1 -1
  134. package/dist/pages/LandingPage.mjs +1 -1
  135. package/dist/pages/LandingPage.stories.mjs +1 -1
  136. package/dist/pages/Page.mjs +1 -1
  137. package/dist/pages/Page.stories.js +8 -8
  138. package/dist/pages/Page.stories.mjs +1 -1
  139. package/dist/pages/Printable.stories.mjs +1 -1
  140. package/dist/pages/Publish.mjs +1 -1
  141. package/dist/pages/Publish.stories.mjs +1 -1
  142. package/dist/pages/Website.mjs +1 -1
  143. package/dist/pages/Website.stories.mjs +1 -1
  144. package/dist/sections/AboutSection.mjs +1 -1
  145. package/dist/sections/AboutSection.stories.mjs +1 -1
  146. package/dist/sections/BlogDetail.mjs +1 -1
  147. package/dist/sections/BlogDetail.stories.mjs +1 -1
  148. package/dist/sections/BlogList.mjs +1 -1
  149. package/dist/sections/BlogList.stories.mjs +1 -1
  150. package/dist/sections/ContactSection.mjs +1 -1
  151. package/dist/sections/ContactSection.stories.mjs +1 -1
  152. package/dist/sections/ImageSection.stories.mjs +1 -1
  153. package/dist/sections/PageSections.mjs +1 -1
  154. package/dist/sections/PageSections.stories.mjs +1 -1
  155. package/dist/sections/PricingSection.mjs +1 -1
  156. package/dist/sections/PricingSection.stories.mjs +1 -1
  157. package/dist/sections/ServiceDetail.mjs +1 -1
  158. package/dist/sections/ServiceDetailSection.mjs +1 -1
  159. package/dist/sections/ServiceDetailSection.stories.mjs +1 -1
  160. package/dist/sections/ServiceSection.mjs +1 -1
  161. package/dist/sections/ServiceSection.stories.mjs +1 -1
  162. package/dist/sections/index.mjs +1 -1
  163. package/package.json +2 -1
  164. package/dist/chunk-MEWCJ4MA.mjs +0 -1
  165. package/dist/chunk-OIQ6GXBY.mjs +0 -4
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";var Gt=Object.create;var De=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var _t=Object.getPrototypeOf,$t=Object.prototype.hasOwnProperty;var qt=(e,t)=>{for(var r in t)De(e,r,{get:t[r],enumerable:!0})},Ze=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of jt(t))!$t.call(e,s)&&s!==r&&De(e,s,{get:()=>t[s],enumerable:!(a=Ot(t,s))||a.enumerable});return e};var B=(e,t,r)=>(r=e!=null?Gt(_t(e)):{},Ze(t||!e||!e.__esModule?De(r,"default",{value:e,enumerable:!0}):r,e)),Jt=e=>Ze(De({},"__esModule",{value:!0}),e);var Fr={};qt(Fr,{Default:()=>Be,NoDeals:()=>Ut,default:()=>Vr});module.exports=Jt(Fr);var Vt=require("react");var xe=B(require("react")),L=B(require("@radix-ui/react-dialog")),nt=require("lucide-react");var it=require("clsx");var Ge="-",Kt=e=>{let t=Zt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{let o=d.split(Ge);return o[0]===""&&o.length!==1&&o.shift(),et(o,t)||Qt(d)},getConflictingClassGroupIds:(d,o)=>{let g=r[d]||[];return o&&a[d]?[...g,...a[d]]:g}}},et=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),s=a?et(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let l=e.join(Ge);return t.validators.find(({validator:d})=>d(l))?.classGroupId},Xe=/^\[(.+)\]$/,Qt=e=>{if(Xe.test(e)){let t=Xe.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Zt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return Yt(Object.entries(e.classGroups),r).forEach(([l,d])=>{We(d,a,l,t)}),a},We=(e,t,r,a)=>{e.forEach(s=>{if(typeof s=="string"){let l=s===""?t:Ye(t,s);l.classGroupId=r;return}if(typeof s=="function"){if(Xt(s)){We(s(a),t,r,a);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([l,d])=>{We(d,Ye(t,l),r,a)})})},Ye=(e,t)=>{let r=e;return t.split(Ge).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Xt=e=>e.isThemeGetter,Yt=(e,t)=>t?e.map(([r,a])=>{let s=a.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([d,o])=>[t+d,o])):l);return[r,s]}):e,er=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,s=(l,d)=>{r.set(l,d),t++,t>e&&(t=0,a=r,r=new Map)};return{get(l){let d=r.get(l);if(d!==void 0)return d;if((d=a.get(l))!==void 0)return s(l,d),d},set(l,d){r.has(l)?r.set(l,d):s(l,d)}}},tt="!",tr=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,s=t[0],l=t.length,d=o=>{let g=[],b=0,f=0,C;for(let h=0;h<o.length;h++){let M=o[h];if(b===0){if(M===s&&(a||o.slice(h,h+l)===t)){g.push(o.slice(f,h)),f=h+l;continue}if(M==="/"){C=h;continue}}M==="["?b++:M==="]"&&b--}let N=g.length===0?o:o.substring(f),w=N.startsWith(tt),v=w?N.substring(1):N,A=C&&C>f?C-f:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:v,maybePostfixModifierPosition:A}};return r?o=>r({className:o,parseClassName:d}):d},rr=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},or=e=>({cache:er(e.cacheSize),parseClassName:tr(e),...Kt(e)}),ar=/\s+/,sr=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:s}=t,l=[],d=e.trim().split(ar),o="";for(let g=d.length-1;g>=0;g-=1){let b=d[g],{modifiers:f,hasImportantModifier:C,baseClassName:N,maybePostfixModifierPosition:w}=r(b),v=!!w,A=a(v?N.substring(0,w):N);if(!A){if(!v){o=b+(o.length>0?" "+o:o);continue}if(A=a(N),!A){o=b+(o.length>0?" "+o:o);continue}v=!1}let h=rr(f).join(":"),M=C?h+tt:h,E=M+A;if(l.includes(E))continue;l.push(E);let m=s(A,v);for(let x=0;x<m.length;++x){let n=m[x];l.push(M+n)}o=b+(o.length>0?" "+o:o)}return o};function ir(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=rt(t))&&(a&&(a+=" "),a+=r);return a}var rt=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=rt(e[a]))&&(r&&(r+=" "),r+=t);return r};function nr(e,...t){let r,a,s,l=d;function d(g){let b=t.reduce((f,C)=>C(f),e());return r=or(b),a=r.cache.get,s=r.cache.set,l=o,o(g)}function o(g){let b=a(g);if(b)return b;let f=sr(g,r);return s(g,f),f}return function(){return l(ir.apply(null,arguments))}}var P=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},ot=/^\[(?:([a-z-]+):)?(.+)\]$/z,lr=/^\d+\/\d+$/,cr=new Set(["px","full","screen"]),dr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|z|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ur=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>me(e)||cr.has(e)||lr.test(e),O=e=>pe(e,"length",wr),me=e=>!!e&&!Number.isNaN(Number(e)),Ue=e=>pe(e,"number",me),he=e=>!!e&&Number.isInteger(Number(e)),gr=e=>e.endsWith("%")&&me(e.slice(0,-1)),p=e=>ot.test(e),j=e=>dr.test(e),br=new Set(["length","size","percentage"]),vr=e=>pe(e,br,at),hr=e=>pe(e,"position",at),yr=new Set(["image","url"]),xr=e=>pe(e,yr,Nr),Cr=e=>pe(e,"",Sr),ye=()=>!0,pe=(e,t,r)=>{let a=ot.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},wr=e=>mr.test(e)&&!pr.test(e),at=()=>!1,Sr=e=>ur.test(e),Nr=e=>fr.test(e);var Dr=()=>{let e=P("colors"),t=P("spacing"),r=P("blur"),a=P("brightness"),s=P("borderColor"),l=P("borderRadius"),d=P("borderSpacing"),o=P("borderWidth"),g=P("contrast"),b=P("grayscale"),f=P("hueRotate"),C=P("invert"),N=P("gap"),w=P("gradientColorStops"),v=P("gradientColorStopPositions"),A=P("inset"),h=P("margin"),M=P("opacity"),E=P("padding"),m=P("saturate"),x=P("scale"),n=P("sepia"),D=P("skew"),de=P("space"),$e=P("translate"),ze=()=>["auto","contain","none"],He=()=>["auto","hidden","clip","visible","scroll"],Ve=()=>["auto",p,t],R=()=>[p,t],qe=()=>["",G,O],Se=()=>["auto",me,p],Je=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ne=()=>["solid","dashed","dotted","double","none"],Ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Fe=()=>["start","end","center","between","around","evenly","stretch"],ve=()=>["","0",p],Qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[me,p];return{cacheSize:500,separator:":",theme:{colors:[ye],spacing:[G,O],blur:["none","",j,p],brightness:W(),borderColor:[e],borderRadius:["none","","full",j,p],borderSpacing:R(),borderWidth:qe(),contrast:W(),grayscale:ve(),hueRotate:W(),invert:ve(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[gr,O],inset:Ve(),margin:Ve(),opacity:W(),padding:R(),saturate:W(),scale:W(),sepia:ve(),skew:W(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",p]}],container:["container"],columns:[{columns:[j]}],"break-after":[{"break-after":Qe()}],"break-before":[{"break-before":Qe()}],"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:[...Je(),p]}],overflow:[{overflow:He()}],"overflow-x":[{"overflow-x":He()}],"overflow-y":[{"overflow-y":He()}],overscroll:[{overscroll:ze()}],"overscroll-x":[{"overscroll-x":ze()}],"overscroll-y":[{"overscroll-y":ze()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[A]}],"inset-x":[{"inset-x":[A]}],"inset-y":[{"inset-y":[A]}],start:[{start:[A]}],end:[{end:[A]}],top:[{top:[A]}],right:[{right:[A]}],bottom:[{bottom:[A]}],left:[{left:[A]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",he,p]}],basis:[{basis:Ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",p]}],grow:[{grow:ve()}],shrink:[{shrink:ve()}],order:[{order:["first","last","none",he,p]}],"grid-cols":[{"grid-cols":[ye]}],"col-start-end":[{col:["auto",{span:["full",he,p]},p]}],"col-start":[{"col-start":Se()}],"col-end":[{"col-end":Se()}],"grid-rows":[{"grid-rows":[ye]}],"row-start-end":[{row:["auto",{span:[he,p]},p]}],"row-start":[{"row-start":Se()}],"row-end":[{"row-end":Se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",p]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",p]}],gap:[{gap:[N]}],"gap-x":[{"gap-x":[N]}],"gap-y":[{"gap-y":[N]}],"justify-content":[{justify:["normal",...Fe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Fe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Fe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[de]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[de]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",p,t]}],"min-w":[{"min-w":[p,t,"min","max","fit"]}],"max-w":[{"max-w":[p,t,"none","full","min","max","fit","prose",{screen:[j]},j]}],h:[{h:[p,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[p,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[p,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[p,t,"auto","min","max","fit"]}],"font-size":[{text:["base",j,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ue]}],"font-family":[{font:[ye]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",p]}],"line-clamp":[{"line-clamp":["none",me,Ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,p]}],"list-image":[{"list-image":["none",p]}],"list-style-type":[{list:["none","disc","decimal",p]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[M]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[M]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,O]}],"underline-offset":[{"underline-offset":["auto",G,p]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",p]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",p]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[M]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Je(),hr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-Vt":[{"rounded-Vt":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[M]}],"border-style":[{border:[...Ne(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[M]}],"divide-style":[{divide:Ne()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Ne()]}],"outline-offset":[{"outline-offset":[G,p]}],"outline-w":[{outline:[G,O]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:qe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[M]}],"ring-offset-w":[{"ring-offset":[G,O]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",j,Cr]}],"shadow-color":[{shadow:[ye]}],opacity:[{opacity:[M]}],"mix-blend":[{"mix-blend":[...Ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ke()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",j,p]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[C]}],saturate:[{saturate:[m]}],sepia:[{sepia:[n]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[M]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[n]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",p]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",p]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",p]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[he,p]}],"translate-x":[{"translate-x":[$e]}],"translate-y":[{"translate-y":[$e]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",p]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","z-resize","nw-resize","Vt-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",p]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",p]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[G,O,Ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-Vt","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Vt","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var st=nr(Dr);function u(...e){return st((0,it.clsx)(e))}var z=require("react/jsx-runtime"),ue=L.Root,lt=L.Trigger,Pr=L.Portal;var ct=xe.forwardRef(({className:e,...t},r)=>(0,z.jsx)(L.Overlay,{ref:r,className:u("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=L.Overlay.displayName;var Z=xe.forwardRef(({className:e,children:t,...r},a)=>(0,z.jsxs)(Pr,{children:[(0,z.jsx)(ct,{}),(0,z.jsxs)(L.Content,{ref:a,className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,(0,z.jsxs)(L.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,z.jsx)(nt.X,{className:"h-4 w-4"}),(0,z.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Z.displayName=L.Content.displayName;var X=({className:e,...t})=>(0,z.jsx)("div",{className:u("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});X.displayName="DialogHeader";var Rr=({className:e,...t})=>(0,z.jsx)("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rr.displayName="DialogFooter";var Y=xe.forwardRef(({className:e,...t},r)=>(0,z.jsx)(L.Title,{ref:r,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}));Y.displayName=L.Title.displayName;var Ar=xe.forwardRef(({className:e,...t},r)=>(0,z.jsx)(L.Description,{ref:r,className:u("text-sm text-muted-foreground",e),...t}));Ar.displayName=L.Description.displayName;var dt=require("@radix-ui/react-slot"),mt=require("class-variance-authority"),pt=B(require("react")),kr=(0,mt.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),V=pt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...s},l)=>(0,z.jsx)(e?dt.Slot:"button",{className:u(kr({className:t,size:r,variant:a})),ref:l,...s}));V.displayName="Button";var ft=B(require("react"));var U=ft.forwardRef(({className:e,type:t,...r},a)=>(0,z.jsx)("input",{type:t,className:u("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));U.displayName="Input";var bt=B(require("react")),Oe=B(require("@radix-ui/react-label"));var Tr=(0,mt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=bt.forwardRef(({className:e,...t},r)=>(0,z.jsx)(Oe.Root,{ref:r,className:u(Tr(),e),...t}));I.displayName=Oe.Root.displayName;var yt=B(require("react")),ee=yt.forwardRef(({className:e,...t},r)=>(0,z.jsx)("textarea",{className:u("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));ee.displayName="Textarea";var y=B(require("@radix-ui/react-select")),_=B(require("react")),re=y.Root;var oe=y.Value,$=_.forwardRef(({children:e,className:t,...r},a)=>(0,z.jsxs)(y.Trigger,{className:u("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...r,children:[e,(0,z.jsx)(y.Icon,{asChild:!0,children:(0,z.jsx)(nt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));$.displayName=y.Trigger.displayName;var Ct=_.forwardRef(({className:e,...t},r)=>(0,z.jsx)(y.ScrollUpButton,{className:u("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,z.jsx)(nt.ChevronUp,{className:"h-4 w-4"})}));Ct.displayName=y.ScrollUpButton.displayName;var wt=_.forwardRef(({className:e,...t},r)=>(0,z.jsx)(y.ScrollDownButton,{className:u("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,z.jsx)(nt.ChevronDown,{className:"h-4 w-4"})}));wt.displayName=y.ScrollDownButton.displayName;var q=_.forwardRef(({children:e,className:t,position:r="popper",...a},s)=>(0,z.jsx)(y.Portal,{children:(0,z.jsxs)(y.Content,{className:u("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="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:r,ref:s,...a,children:[(0,z.jsx)(Ct,{}),(0,z.jsx)(y.Viewport,{className:u("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,z.jsx)(wt,{})]})}));q.displayName=y.Content.displayName;var Mr=_.forwardRef(({className:e,...t},r)=>(0,z.jsx)(y.Label,{className:u("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));Mr.displayName=y.Label.displayName;var J=_.forwardRef(({children:e,className:t,...r},a)=>(0,z.jsxs)(y.Item,{className:u("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...r,children:[(0,z.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,z.jsx)(y.ItemIndicator,{children:(0,z.jsx)(nt.Check,{className:"h-4 w-4"})})}),(0,z.jsx)(y.ItemText,{children:e})]}));J.displayName=y.Item.displayName;var Lr=_.forwardRef(({className:e,...t},r)=>(0,z.jsx)(y.Separator,{className:u("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Lr.displayName=y.Separator.displayName;var Ce=B(require("@radix-ui/react-checkbox")),Nt=B(require("react")),ae=Nt.forwardRef(({className:e,...t},r)=>(0,z.jsx)(Ce.Root,{className:u("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:r,...t,children:(0,z.jsx)(Ce.Indicator,{className:u("flex items-center justify-center text-current"),children:(0,z.jsx)(nt.Check,{className:"h-4 w-4"})})}));ae.displayName=Ce.Root.displayName;var Ir=(0,mt.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 Re({className:e,variant:t,...r}){return(0,z.jsx)("div",{className:u(Ir({variant:t}),e),...r})}var je=B(require("react")),F=B(require("@radix-ui/react-scroll-area"));var fe=je.forwardRef(({className:e,children:t,...r},a)=>(0,z.jsxs)(F.Root,{ref:a,className:u("relative overflow-hidden",e),...r,children:[(0,z.jsx)(F.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,z.jsx)(Rt,{}),(0,z.jsx)(F.Corner,{})]}));fe.displayName=F.Root.displayName;var Rt=je.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,z.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:u("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,z.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Rt.displayName=F.ScrollAreaScrollbar.displayName;function At({deal:e,users:t,customer:r,categories:a,onClose:s,onSave:l,onAddComment:d}){let[o,g]=(0,Vt.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[b,f]=(0,Vt.useState)(""),[C,N]=(0,Vt.useState)(!1),[w,v]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{N(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let A=async()=>{try{let n=await l(o);n.success?(N(!1),v(null)):console.error("Failed to save deal:",n.errors)}catch(n){console.error("Failed to save deal:",n)}},h=(n,D)=>{g(de=>({...de,[n]:D}))},M=n=>{let D=(o.categories||[]).includes(n)?(o.categories||[]).filter(de=>de!==n):[...o.categories||[],n];h("categories",D)},E=async()=>{if(b.trim()){let n={text:b,timestamp:new Date().toISOString()};try{let D=await d(n);if(!D.success){console.error("Failed to add comment:",D.errors);return}}catch(D){console.error("Failed to add comment:",D)}g(D=>({...D,comments:[...D.comments||[],n]})),f("")}},m=n=>{switch(n){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},x=n=>t?.find(D=>D.id===Number(n));return(0,z.jsx)(ue,{open:!0,children:(0,z.jsxs)(Z,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,z.jsxs)(X,{className:"flex flex-row items-center justify-between",children:[(0,z.jsx)(Y,{className:"text-2xl font-bold",children:r?.name}),(0,z.jsxs)("div",{className:"flex space-x-2",children:[(0,z.jsx)(V,{variant:"outline",onClick:s,children:"Close"}),(0,z.jsxs)(V,{onClick:A,disabled:!C,children:[(0,z.jsx)(nt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,z.jsxs)(fe,{className:"flex-grow pr-4",children:[(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,z.jsx)("div",{className:"grid gap-2 m-1",children:w==="value"?(0,z.jsx)(U,{type:"number",value:o.value,onChange:n=>h("value",Number(n.target.value)),onBlur:()=>v(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,z.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("value"),children:["\xA3",o.value?.toLocaleString()]})}),(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Assignee"}),w==="assignee"?(0,z.jsxs)(re,{value:o?.assignee?.id?.toString()||"",onValueChange:n=>h("assignee",x(n)),children:[(0,z.jsx)($,{children:(0,z.jsx)(oe,{placeholder:"Select assignee"})}),(0,z.jsx)(q,{children:t&&t.map(n=>(0,z.jsx)(J,{value:n?.id?.toString()||"",children:n.name},n.id))})]}):(0,z.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("assignee"),children:[(0,z.jsx)(nt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,z.jsx)("span",{children:o.assignee.name})]})]}),(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Closure Date"}),w==="closureDate"?(0,z.jsx)(U,{type:"date",value:o.closureDate?.split("z")[0]??"",onChange:n=>h("closureDate",n.target.value),onBlur:()=>v(null),className:"mr-2",autoFocus:!0}):(0,z.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("closureDate"),children:[(0,z.jsx)(nt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,z.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,z.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Description"}),w==="description"?(0,z.jsx)(ee,{value:o.description||"",onChange:n=>h("description",n.target.value),onBlur:()=>v(null),className:"min-h-[100px]",autoFocus:!0}):(0,z.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>v("description"),children:o.description})]})}),(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Status"}),w==="status"?(0,z.jsxs)(re,{value:o.status,onValueChange:n=>{h("status",n),v(null)},children:[(0,z.jsx)($,{children:(0,z.jsx)(oe,{placeholder:"Select status"})}),(0,z.jsx)(q,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(n=>(0,z.jsx)(J,{value:n,children:n},n))})]}):(0,z.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("status"),children:o.status})]}),(0,z.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Categories"}),w==="categories"?(0,z.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(n=>(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(ae,{id:n.id?.toString()||"",checked:(o.categories||[]).some(D=>D.id===n.id),onCheckedChange:()=>n.id!==void 0&&M(n)}),(0,z.jsx)("label",{htmlFor:(n.id??"").toString(),className:`text-sm font-medium ${m(n.type||"sector")} px-2 py-1 rounded`,children:n.name})]},n.id))}):(0,z.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("categories"),children:o.categories&&o.categories.map(n=>{let D=n;return D?(0,z.jsx)(Re,{variant:"outline",className:m(D.type||"sector"),children:D.name},D.id):null})})]}),(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"COGE Status"}),w==="gecoStatus"?(0,z.jsxs)(re,{value:o.gecoStatus??void 0,onValueChange:n=>{h("gecoStatus",n),v(null)},children:[(0,z.jsx)($,{children:(0,z.jsx)(oe,{placeholder:"Select status"})}),(0,z.jsx)(q,{children:["firm","forecast","other"].map(n=>(0,z.jsx)(J,{value:n,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]}):(0,z.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("gecoStatus"),children:o.gecoStatus?o.gecoStatus.charAt(0).toUpperCase()+o.gecoStatus.slice(1):"N/A"})]})]}),(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,z.jsx)(fe,{className:"h-[200px] overflow-y-auto",children:(0,z.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((n,D)=>new Date(D.timestamp||"").getTime()-new Date(n.timestamp||"").getTime()).map(n=>(0,z.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,z.jsx)("p",{className:"text-sm text-foreground",children:n.text}),(0,z.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[n?.author?.name," - ",new Date(n.timestamp||"").toLocaleString()]})]},n.id))})}),(0,z.jsxs)("div",{className:"flex mt-2",children:[(0,z.jsx)(U,{value:b,onChange:n=>f(n.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,z.jsxs)(V,{onClick:E,className:"ml-2",children:[(0,z.jsx)(nt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,z.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ie=B(require("react"));var Ae=ie.forwardRef(({className:e,...t},r)=>(0,z.jsx)("div",{ref:r,className:u("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Ae.displayName="Card";var ke=ie.forwardRef(({className:e,...t},r)=>(0,z.jsx)("div",{ref:r,className:u("flex flex-col space-y-1.5 p-6",e),...t}));ke.displayName="CardHeader";var Te=ie.forwardRef(({className:e,...t},r)=>(0,z.jsx)("div",{ref:r,className:u("font-semibold leading-none tracking-tight",e),...t}));Te.displayName="CardTitle";var Er=ie.forwardRef(({className:e,...t},r)=>(0,z.jsx)("div",{ref:r,className:u("text-sm text-muted-foreground",e),...t}));Er.displayName="CardDescription";var Me=ie.forwardRef(({className:e,...t},r)=>(0,z.jsx)("div",{ref:r,className:u("p-6 pt-0",e),...t}));Me.displayName="CardContent";var Br=ie.forwardRef(({className:e,...t},r)=>(0,z.jsx)("div",{ref:r,className:u("flex items-center p-6 pt-0",e),...t}));Br.displayName="CardFooter";function kt({deal:e,customer:t,categories:r,onClick:a,compact:s=!1}){let l=r.find(d=>d.type==="proposition"&&(e.categories??[]).includes(d.id));return s?(0,z.jsxs)(Ae,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,z.jsxs)(ke,{className:"pb-1 pt-2",children:[(0,z.jsx)(Te,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,z.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,z.jsx)(Me,{className:"text-xs text-gray-500 pb-2",children:(0,z.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,z.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,z.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,z.jsxs)(Ae,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,z.jsxs)(ke,{className:"pb-2",children:[(0,z.jsx)("div",{className:"flex justify-between items-center",children:(0,z.jsx)(Te,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,z.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,z.jsxs)(Me,{children:[(0,z.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,z.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,z.jsx)(nt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,z.jsx)("span",{children:e.assignee.name})]}),(0,z.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,z.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,z.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,z.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,z.jsx)(nt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,z.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,z.jsx)("div",{className:"flex justify-between items-left",children:l&&(0,z.jsx)(Re,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:l.name})})]})]})}var Ie=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Mt({onSubmit:e}){let[t,r]=(0,Vt.useState)({name:"",intro:"",active:!1});return(0,z.jsxs)("form",{onSubmit:s=>{s.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),r({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,z.jsx)(U,{id:"customerName",value:t.name,onChange:s=>r({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,z.jsx)(ee,{id:"customerIntro",value:t.intro??"",onChange:s=>r({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(ae,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>r({...t,active:s})}),(0,z.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,z.jsx)(V,{type:"submit",className:"w-full",children:"Add Customer"})]})}function It({customers:e,users:t,categories:r,onSubmit:a,initialDeal:s,onAddCustomer:l,onClose:d}){let[o,g]=(0,Vt.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("z")[0],closureDate:"",comments:[],description:""}),[b,f]=(0,Vt.useState)(!1),[C,N]=(0,Vt.useState)({});(0,Vt.useEffect)(()=>{s&&g(s)},[s]);let w=()=>{let m={};return o.customer||(m.customer="Customer is required"),o.value||(m.value="Value is required"),o.assignee||(m.assignee="Assignee is required"),o.closureDate||(m.closureDate="Closure Date is required"),N(m),Object.keys(m).length===0},v=async m=>{m.preventDefault(),N({});try{if(w()){let x=await a({...o});x.success?(g({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),d?.()):N(x.errors||{})}}catch{N({submit:"An error occurred while submitting the form."})}},A=m=>{g(x=>({...x,categories:(x.categories||[]).includes(m.id)?(x.categories||[]).filter(n=>n!==m.id):[...x.categories||[],m.id]}))},h=async m=>{g({...o,customer:m});try{let x=await l(m);x.success?f(!1):N(x.errors||{})}catch{N({submit:"An error occurred while submitting the form."})}},M=m=>t?.find(x=>x.id===Number(m)),E=m=>e?.find(x=>x.id===Number(m));return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("form",{onSubmit:v,className:"space-y-6",children:[(0,z.jsx)(fe,{className:"h-[60vh] pr-4",children:(0,z.jsxs)("div",{className:"space-y-6 px-4",children:[(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsxs)(re,{value:o.customer?.id?.toString(),onValueChange:m=>g({...o,customer:E(m)}),children:[(0,z.jsx)($,{children:(0,z.jsx)(oe,{placeholder:"Select customer"})}),(0,z.jsx)(q,{children:e.map(m=>(0,z.jsx)(J,{value:m.id?.toString()||"",children:m.name},m.id))})]}),(0,z.jsx)(V,{variant:"outline",size:"icon",onClick:()=>f(!0),children:(0,z.jsx)(nt.PlusIcon,{className:"w-5 h-5"})})]}),C.customerId&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:C.customerId})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"value",children:"Value"}),(0,z.jsx)(U,{id:"value",type:"number",value:o.value||"",onChange:m=>g({...o,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),C.value&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:C.value})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,z.jsxs)(re,{value:o.assignee?.id?.toString(),onValueChange:m=>g({...o,assignee:M(m)}),children:[(0,z.jsx)($,{children:(0,z.jsx)(oe,{placeholder:"Select assignee"})}),(0,z.jsx)(q,{children:t&&t.map(m=>(0,z.jsx)(J,{value:m.id?.toString()||"",children:m.name},m.id))})]}),C.assignee&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:C.assignee})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"description",children:"Description"}),(0,z.jsx)(ee,{id:"description",value:o.description||"",onChange:m=>g({...o,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{children:"Categories"}),(0,z.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,z.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(x=>x.type===m).map(x=>(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(ae,{id:x.id.toString(),checked:o.categories?.includes(x.id),onCheckedChange:()=>A(x)}),(0,z.jsx)("label",{htmlFor:x.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:x.name})]},x.id))})]},m))})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,z.jsx)(U,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:m=>g({...o,closureDate:m.target.value})}),C.closureDate&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:C.closureDate})]})]})}),(0,z.jsx)(V,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,z.jsx)(ue,{open:b,onOpenChange:f,children:(0,z.jsxs)(Z,{children:[(0,z.jsx)(X,{children:(0,z.jsx)(Y,{children:"Add New Customer"})}),(0,z.jsx)(Mt,{onSubmit:h})]})})]})}function zt({status:e,deals:t,users:r,customers:a,categories:s,onDealClick:l,calculateColumnValue:d,calculateWeightedValue:o,addNewDeal:g,onAddCustomer:b,compact:f=!1}){let[C,N]=(0,Vt.useState)(!1);return(0,z.jsxs)("div",{className:"flex flex-col w-80",children:[(0,z.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),g&&(0,z.jsxs)(ue,{open:C,onOpenChange:N,children:[(0,z.jsx)(lt,{asChild:!0,children:(0,z.jsxs)(V,{className:"mb-4 w-full",children:[(0,z.jsx)(nt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,z.jsxs)(Z,{children:[(0,z.jsx)(X,{children:(0,z.jsx)(Y,{children:"Add New Deal"})}),(0,z.jsx)(It,{customers:a,users:r,categories:s,onSubmit:g,onAddCustomer:b??(async()=>Promise.resolve({success:!1})),onClose:()=>N(!1)})]})]}),(0,z.jsx)(Ie.Droppable,{droppableId:e,isDropDisabled:!1,children:w=>(0,z.jsxs)("div",{ref:w.innerRef,...w.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((v,A)=>(0,z.jsx)(Ie.Draggable,{draggableId:v.id.toString(),index:v.id,children:h=>(0,z.jsx)("div",{ref:h.innerRef,...h.draggableProps,...h.dragHandleProps,children:(0,z.jsx)(kt,{deal:v,customer:v.customer,categories:s,onClick:()=>l(v),compact:f})})},v.id.toString())),w.placeholder]})}),(0,z.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,z.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,z.jsxs)("span",{className:"text-green-600",children:["\xA3",d(t).toLocaleString()]})]}),(0,z.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,z.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var zr=["firm","forecast","other"];function _e({initialData:e,updateDeal:t,addComment:r}){let[a,s]=(0,Vt.useState)(null),l=b=>(e.deals??[]).filter(f=>f.gecoStatus===b).filter(f=>f.status!=="Lost"&&f.status!=="Cold"),d=b=>b.reduce((f,C)=>f+(C.value||0),0),o=(b,f)=>{let C={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return b.reduce((N,w)=>N+(w.value||0)*(C[w.status]??0),0)},g=(0,Vt.useCallback)(b=>{let{source:f,destination:C}=b;if(!C||f.droppableId===C.droppableId&&f.index===C.index)return;let N=f.droppableId,w=C.droppableId,v=e.deals?.filter(h=>h.id===f.index)[0],A=[...e.deals??[]];v&&(v.gecoStatus=w,t(v))},[t]);return(0,z.jsx)(Ie.DragDropContext,{onDragEnd:g,children:(0,z.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,z.jsx)("div",{className:"flex space-x-4 pb-4",children:zr.map(b=>{let f=l(b);return(0,z.jsx)(zt,{status:b,deals:f,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:s,calculateColumnValue:d,calculateWeightedValue:o,compact:!0},b)})}),a&&(0,z.jsx)(At,{deal:a,users:e.users,customer:a.customer,categories:e.categories??[],onClose:()=>s(null),onSave:t,onAddComment:b=>r(a.id.toString(),b)})]})})}var we=[{id:1,name:"Acme Corp",intro:"A leading technology company",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1,createdAt:"2023-01-01",updatedAt:"2023-01-01"}],be=[{id:1,name:"Software",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Hardware",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Referral",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Outbound",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Tech",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:6,name:"Finance",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],ce=[{id:1,name:"John Doe",email:"john.doe@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Bob Johnson",email:"bob.johnson@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Alice Brown",email:"alice.brown@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Charlie Davis",email:"charlie.davis@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],aa=[{id:1,customer:we[0],value:5e4,assignee:ce[2],status:"Qualified",categories:be.slice(0,3),dateLogged:"2023-01-15",closureDate:"2023-06-30",updatedAt:"2023-05-01T10:00:00Z",createdAt:"2023-01-01",comments:[{id:"1",text:"Initial contact made",author:ce[5],timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},value:75e3,assignee:{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},status:"Proposal Made",categories:be.slice(0,3),dateLogged:"2023-02-01",closureDate:"2023-07-31",updatedAt:"2023-05-10T14:30:00Z",createdAt:"2023-01-01",comments:[{id:"2",text:"Proposal sent",author:ce[1],timestamp:"2023-02-15T09:00:00Z"}],description:"Custom hardware solution for GlobalTech"}];var Hr={title:"CRM/CogeBoard",tags:["autodocs"],component:_e},Vr=Hr,Ft=e=>{let[t,r]=(0,Vt.useState)(e.initialData);return(0,z.jsx)(_e,{...e,initialData:t,updateDeal:async s=>(console.log("Updating deal:",s),r(l=>({...l,deals:(l.deals??[]).map(d=>d.id===s.id?s:d)})),s)})},Be=Ft.bind({});Be.args={initialData:{deals:Array.from({length:13},(e,t)=>({id:t+1,customer:we[t%we.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:ce[Math.floor(Math.random()*ce.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],gecoStatus:["firm","forecast","other"][t%3],categories:[be[t%be.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:we,users:ce,categories:be},addComment:async(e,t)=>(console.log("Adding comment to deal:",e,t),{...t,id:"new-comment-id"})};var Ut=Ft.bind({});Ut.args={...Be.args,initialData:{...Be.args.initialData,deals:[]}};0&&(module.exports={Default,NoDeals});
4
+ "use strict";var Gt=Object.create;var Pe=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var _t=Object.getPrototypeOf,$t=Object.prototype.hasOwnProperty;var Kt=(e,t)=>{for(var o in t)Pe(e,o,{get:t[o],enumerable:!0})},Xe=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of jt(t))!$t.call(e,s)&&s!==o&&Pe(e,s,{get:()=>t[s],enumerable:!(a=Ot(t,s))||a.enumerable});return e};var B=(e,t,o)=>(o=e!=null?Gt(_t(e)):{},Xe(t||!e||!e.__esModule?Pe(o,"default",{value:e,enumerable:!0}):o,e)),qt=e=>Xe(Pe({},"__esModule",{value:!0}),e);var Uo={};Kt(Uo,{Default:()=>Se,NoDeals:()=>Ut,Test:()=>Ft,default:()=>Fo});module.exports=qt(Uo);var Vt=require("react");var xe=B(require("react")),M=B(require("@radix-ui/react-dialog")),lt=require("lucide-react");var nt=require("clsx");var We="-",Jt=e=>{let t=Xt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{let r=d.split(We);return r[0]===""&&r.length!==1&&r.shift(),tt(r,t)||Qt(d)},getConflictingClassGroupIds:(d,r)=>{let f=o[d]||[];return r&&a[d]?[...f,...a[d]]:f}}},tt=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),s=a?tt(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;let l=e.join(We);return t.validators.find(({validator:d})=>d(l))?.classGroupId},Ye=/^\[(.+)\]$/,Qt=e=>{if(Ye.test(e)){let t=Ye.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Xt=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return eo(Object.entries(e.classGroups),o).forEach(([l,d])=>{Ue(d,a,l,t)}),a},Ue=(e,t,o,a)=>{e.forEach(s=>{if(typeof s=="string"){let l=s===""?t:et(t,s);l.classGroupId=o;return}if(typeof s=="function"){if(Yt(s)){Ue(s(a),t,o,a);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([l,d])=>{Ue(d,et(t,l),o,a)})})},et=(e,t)=>{let o=e;return t.split(We).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Yt=e=>e.isThemeGetter,eo=(e,t)=>t?e.map(([o,a])=>{let s=a.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([d,r])=>[t+d,r])):l);return[o,s]}):e,to=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,s=(l,d)=>{o.set(l,d),t++,t>e&&(t=0,a=o,o=new Map)};return{get(l){let d=o.get(l);if(d!==void 0)return d;if((d=a.get(l))!==void 0)return s(l,d),d},set(l,d){o.has(l)?o.set(l,d):s(l,d)}}},ot="!",oo=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,s=t[0],l=t.length,d=r=>{let f=[],b=0,p=0,C;for(let h=0;h<r.length;h++){let L=r[h];if(b===0){if(L===s&&(a||r.slice(h,h+l)===t)){f.push(r.slice(p,h)),p=h+l;continue}if(L==="/"){C=h;continue}}L==="["?b++:L==="]"&&b--}let D=f.length===0?r:r.substring(p),w=D.startsWith(ot),v=w?D.substring(1):D,A=C&&C>p?C-p:void 0;return{modifiers:f,hasImportantModifier:w,baseClassName:v,maybePostfixModifierPosition:A}};return o?r=>o({className:r,parseClassName:d}):d},ro=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},ao=e=>({cache:to(e.cacheSize),parseClassName:oo(e),...Jt(e)}),so=/\s+/,io=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:s}=t,l=[],d=e.trim().split(so),r="";for(let f=d.length-1;f>=0;f-=1){let b=d[f],{modifiers:p,hasImportantModifier:C,baseClassName:D,maybePostfixModifierPosition:w}=o(b),v=!!w,A=a(v?D.substring(0,w):D);if(!A){if(!v){r=b+(r.length>0?" "+r:r);continue}if(A=a(D),!A){r=b+(r.length>0?" "+r:r);continue}v=!1}let h=ro(p).join(":"),L=C?h+ot:h,E=L+A;if(l.includes(E))continue;l.push(E);let m=s(A,v);for(let x=0;x<m.length;++x){let n=m[x];l.push(L+n)}r=b+(r.length>0?" "+r:r)}return r};function no(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=rt(t))&&(a&&(a+=" "),a+=o);return a}var rt=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=rt(e[a]))&&(o&&(o+=" "),o+=t);return o};function lo(e,...t){let o,a,s,l=d;function d(f){let b=t.reduce((p,C)=>C(p),e());return o=ao(b),a=o.cache.get,s=o.cache.set,l=r,r(f)}function r(f){let b=a(f);if(b)return b;let p=io(f,o);return s(f,p),p}return function(){return l(no.apply(null,arguments))}}var P=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},at=/^\[(?:([a-z-]+):)?(.+)\]$/z,co=/^\d+\/\d+$/,mo=new Set(["px","full","screen"]),uo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,po=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|z|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,go=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=e=>me(e)||mo.has(e)||co.test(e),G=e=>ue(e,"length",Do),me=e=>!!e&&!Number.isNaN(Number(e)),Fe=e=>ue(e,"number",me),he=e=>!!e&&Number.isInteger(Number(e)),vo=e=>e.endsWith("%")&&me(e.slice(0,-1)),u=e=>at.test(e),O=e=>uo.test(e),ho=new Set(["length","size","percentage"]),yo=e=>ue(e,ho,st),xo=e=>ue(e,"position",st),Co=new Set(["image","url"]),wo=e=>ue(e,Co,Po),So=e=>ue(e,"",No),ye=()=>!0,ue=(e,t,o)=>{let a=at.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Do=e=>po.test(e)&&!go.test(e),st=()=>!1,No=e=>fo.test(e),Po=e=>bo.test(e);var Ro=()=>{let e=P("colors"),t=P("spacing"),o=P("blur"),a=P("brightness"),s=P("borderColor"),l=P("borderRadius"),d=P("borderSpacing"),r=P("borderWidth"),f=P("contrast"),b=P("grayscale"),p=P("hueRotate"),C=P("invert"),D=P("gap"),w=P("gradientColorStops"),v=P("gradientColorStopPositions"),A=P("inset"),h=P("margin"),L=P("opacity"),E=P("padding"),m=P("saturate"),x=P("scale"),n=P("sepia"),N=P("skew"),de=P("space"),$e=P("translate"),ze=()=>["auto","contain","none"],Ze=()=>["auto","hidden","clip","visible","scroll"],He=()=>["auto",u,t],R=()=>[u,t],Ke=()=>["",W,G],De=()=>["auto",me,u],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ne=()=>["solid","dashed","dotted","double","none"],Je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ve=()=>["start","end","center","between","around","evenly","stretch"],ve=()=>["","0",u],Qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[me,u];return{cacheSize:500,separator:":",theme:{colors:[ye],spacing:[W,G],blur:["none","",O,u],brightness:U(),borderColor:[e],borderRadius:["none","","full",O,u],borderSpacing:R(),borderWidth:Ke(),contrast:U(),grayscale:ve(),hueRotate:U(),invert:ve(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[vo,G],inset:He(),margin:He(),opacity:U(),padding:R(),saturate:U(),scale:U(),sepia:ve(),skew:U(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[O]}],"break-after":[{"break-after":Qe()}],"break-before":[{"break-before":Qe()}],"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:[...qe(),u]}],overflow:[{overflow:Ze()}],"overflow-x":[{"overflow-x":Ze()}],"overflow-y":[{"overflow-y":Ze()}],overscroll:[{overscroll:ze()}],"overscroll-x":[{"overscroll-x":ze()}],"overscroll-y":[{"overscroll-y":ze()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[A]}],"inset-x":[{"inset-x":[A]}],"inset-y":[{"inset-y":[A]}],start:[{start:[A]}],end:[{end:[A]}],top:[{top:[A]}],right:[{right:[A]}],bottom:[{bottom:[A]}],left:[{left:[A]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",he,u]}],basis:[{basis:He()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",u]}],grow:[{grow:ve()}],shrink:[{shrink:ve()}],order:[{order:["first","last","none",he,u]}],"grid-cols":[{"grid-cols":[ye]}],"col-start-end":[{col:["auto",{span:["full",he,u]},u]}],"col-start":[{"col-start":De()}],"col-end":[{"col-end":De()}],"grid-rows":[{"grid-rows":[ye]}],"row-start-end":[{row:["auto",{span:[he,u]},u]}],"row-start":[{"row-start":De()}],"row-end":[{"row-end":De()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",u]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",u]}],gap:[{gap:[D]}],"gap-x":[{"gap-x":[D]}],"gap-y":[{"gap-y":[D]}],"justify-content":[{justify:["normal",...Ve()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ve(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ve(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[de]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[de]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",u,t]}],"min-w":[{"min-w":[u,t,"min","max","fit"]}],"max-w":[{"max-w":[u,t,"none","full","min","max","fit","prose",{screen:[O]},O]}],h:[{h:[u,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[u,t,"auto","min","max","fit"]}],"font-size":[{text:["base",O,G]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fe]}],"font-family":[{font:[ye]}],"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",u]}],"line-clamp":[{"line-clamp":["none",me,Fe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",W,u]}],"list-image":[{"list-image":["none",u]}],"list-style-type":[{list:["none","disc","decimal",u]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[L]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",W,G]}],"underline-offset":[{"underline-offset":["auto",W,u]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",u]}],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",u]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[L]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),xo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-Vt":[{"rounded-Vt":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-s":[{"border-s":[r]}],"border-w-e":[{"border-e":[r]}],"border-w-t":[{"border-t":[r]}],"border-w-r":[{"border-r":[r]}],"border-w-b":[{"border-b":[r]}],"border-w-l":[{"border-l":[r]}],"border-opacity":[{"border-opacity":[L]}],"border-style":[{border:[...Ne(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[L]}],"divide-style":[{divide:Ne()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Ne()]}],"outline-offset":[{"outline-offset":[W,u]}],"outline-w":[{outline:[W,G]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[L]}],"ring-offset-w":[{"ring-offset":[W,G]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",O,So]}],"shadow-color":[{shadow:[ye]}],opacity:[{opacity:[L]}],"mix-blend":[{"mix-blend":[...Je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Je()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",O,u]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[C]}],saturate:[{saturate:[m]}],sepia:[{sepia:[n]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[L]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[n]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[he,u]}],"translate-x":[{"translate-x":[$e]}],"translate-y":[{"translate-y":[$e]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",u]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","z-resize","nw-resize","Vt-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",u]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",u]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[W,G,Fe]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-Vt","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Vt","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var it=lo(Ro);function g(...e){return it((0,nt.clsx)(e))}var z=require("react/jsx-runtime"),pe=M.Root,ct=M.Trigger,Ao=M.Portal;var dt=xe.forwardRef(({className:e,...t},o)=>(0,z.jsx)(M.Overlay,{ref:o,className:g("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}));dt.displayName=M.Overlay.displayName;var Q=xe.forwardRef(({className:e,children:t,...o},a)=>(0,z.jsxs)(Ao,{children:[(0,z.jsx)(dt,{}),(0,z.jsxs)(M.Content,{ref:a,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,z.jsxs)(M.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,z.jsx)(lt.X,{className:"h-4 w-4"}),(0,z.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Q.displayName=M.Content.displayName;var X=({className:e,...t})=>(0,z.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});X.displayName="DialogHeader";var To=({className:e,...t})=>(0,z.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});To.displayName="DialogFooter";var Y=xe.forwardRef(({className:e,...t},o)=>(0,z.jsx)(M.Title,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));Y.displayName=M.Title.displayName;var ko=xe.forwardRef(({className:e,...t},o)=>(0,z.jsx)(M.Description,{ref:o,className:g("text-sm text-muted-foreground",e),...t}));ko.displayName=M.Description.displayName;var mt=require("@radix-ui/react-slot"),ut=require("class-variance-authority"),pt=B(require("react")),Lo=(0,ut.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),H=pt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...s},l)=>(0,z.jsx)(e?mt.Slot:"button",{className:g(Lo({className:t,size:o,variant:a})),ref:l,...s}));H.displayName="Button";var ft=B(require("react"));var F=ft.forwardRef(({className:e,type:t,...o},a)=>(0,z.jsx)("input",{type:t,className:g("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));F.displayName="Input";var vt=B(require("react")),Ge=B(require("@radix-ui/react-label"));var Mo=(0,ut.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=vt.forwardRef(({className:e,...t},o)=>(0,z.jsx)(Ge.Root,{ref:o,className:g(Mo(),e),...t}));I.displayName=Ge.Root.displayName;var xt=B(require("react")),ee=xt.forwardRef(({className:e,...t},o)=>(0,z.jsx)("textarea",{className:g("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));ee.displayName="Textarea";var y=B(require("@radix-ui/react-select")),j=B(require("react")),oe=y.Root;var re=y.Value,_=j.forwardRef(({children:e,className:t,...o},a)=>(0,z.jsxs)(y.Trigger,{className:g("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...o,children:[e,(0,z.jsx)(y.Icon,{asChild:!0,children:(0,z.jsx)(lt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));_.displayName=y.Trigger.displayName;var wt=j.forwardRef(({className:e,...t},o)=>(0,z.jsx)(y.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,z.jsx)(lt.ChevronUp,{className:"h-4 w-4"})}));wt.displayName=y.ScrollUpButton.displayName;var St=j.forwardRef(({className:e,...t},o)=>(0,z.jsx)(y.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,z.jsx)(lt.ChevronDown,{className:"h-4 w-4"})}));St.displayName=y.ScrollDownButton.displayName;var $=j.forwardRef(({children:e,className:t,position:o="popper",...a},s)=>(0,z.jsx)(y.Portal,{children:(0,z.jsxs)(y.Content,{className:g("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:s,...a,children:[(0,z.jsx)(wt,{}),(0,z.jsx)(y.Viewport,{className:g("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,z.jsx)(St,{})]})}));$.displayName=y.Content.displayName;var Io=j.forwardRef(({className:e,...t},o)=>(0,z.jsx)(y.Label,{className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Io.displayName=y.Label.displayName;var K=j.forwardRef(({children:e,className:t,...o},a)=>(0,z.jsxs)(y.Item,{className:g("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...o,children:[(0,z.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,z.jsx)(y.ItemIndicator,{children:(0,z.jsx)(lt.Check,{className:"h-4 w-4"})})}),(0,z.jsx)(y.ItemText,{children:e})]}));K.displayName=y.Item.displayName;var Eo=j.forwardRef(({className:e,...t},o)=>(0,z.jsx)(y.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Eo.displayName=y.Separator.displayName;var Ce=B(require("@radix-ui/react-checkbox")),Nt=B(require("react")),ae=Nt.forwardRef(({className:e,...t},o)=>(0,z.jsx)(Ce.Root,{className:g("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,z.jsx)(Ce.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,z.jsx)(lt.Check,{className:"h-4 w-4"})})}));ae.displayName=Ce.Root.displayName;var Bo=(0,ut.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 Ae({className:e,variant:t,...o}){return(0,z.jsx)("div",{className:g(Bo({variant:t}),e),...o})}var Oe=B(require("react")),V=B(require("@radix-ui/react-scroll-area"));var ge=Oe.forwardRef(({className:e,children:t,...o},a)=>(0,z.jsxs)(V.Root,{ref:a,className:g("relative overflow-hidden",e),...o,children:[(0,z.jsx)(V.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,z.jsx)(At,{}),(0,z.jsx)(V.Corner,{})]}));ge.displayName=V.Root.displayName;var At=Oe.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,z.jsx)(V.ScrollAreaScrollbar,{ref:a,orientation:t,className:g("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,z.jsx)(V.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));At.displayName=V.ScrollAreaScrollbar.displayName;function Tt({deal:e,users:t,customer:o,categories:a,onClose:s,onSave:l,onAddComment:d}){let[r,f]=(0,Vt.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[b,p]=(0,Vt.useState)(""),[C,D]=(0,Vt.useState)(!1),[w,v]=(0,Vt.useState)(null);(0,Vt.useEffect)(()=>{D(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let A=async()=>{try{let n=await l(r);n.success?(D(!1),v(null)):console.error("Failed to save deal:",n.errors)}catch(n){console.error("Failed to save deal:",n)}},h=(n,N)=>{f(de=>({...de,[n]:N}))},L=n=>{let N=(r.categories||[]).includes(n)?(r.categories||[]).filter(de=>de!==n):[...r.categories||[],n];h("categories",N)},E=async()=>{if(b.trim()){let n={text:b,timestamp:new Date().toISOString()};try{let N=await d(n);if(!N.success){console.error("Failed to add comment:",N.errors);return}}catch(N){console.error("Failed to add comment:",N)}f(N=>({...N,comments:[...N.comments||[],n]})),p("")}},m=n=>{switch(n){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},x=n=>t?.find(N=>N.id===Number(n));return(0,z.jsx)(pe,{open:!0,children:(0,z.jsxs)(Q,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,z.jsxs)(X,{className:"flex flex-row items-center justify-between",children:[(0,z.jsx)(Y,{className:"text-2xl font-bold",children:o?.name||"no customer"}),(0,z.jsxs)("div",{className:"flex space-x-2",children:[(0,z.jsx)(H,{variant:"outline",onClick:s,children:"Close"}),(0,z.jsxs)(H,{onClick:A,disabled:!C,children:[(0,z.jsx)(lt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,z.jsxs)(ge,{className:"flex-grow pr-4",children:[(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,z.jsx)("div",{className:"grid gap-2 m-1",children:w==="value"?(0,z.jsx)(F,{type:"number",value:r.value,onChange:n=>h("value",Number(n.target.value)),onBlur:()=>v(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,z.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("value"),children:["\xA3",r.value?.toLocaleString()]})}),(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Assignee"}),w==="assignee"?(0,z.jsxs)(oe,{value:r?.assignee?.id?.toString()||"",onValueChange:n=>h("assignee",x(n)),children:[(0,z.jsx)(_,{children:(0,z.jsx)(re,{placeholder:"Select assignee"})}),(0,z.jsx)($,{children:t&&t.map(n=>(0,z.jsx)(K,{value:n?.id?.toString()||"",children:n.name},n.id))})]}):(0,z.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("assignee"),children:[(0,z.jsx)(lt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,z.jsx)("span",{children:r?.assignee?.name})]})]}),(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Closure Date"}),w==="closureDate"?(0,z.jsx)(F,{type:"date",value:r.closureDate?.split("z")[0]??"",onChange:n=>h("closureDate",n.target.value),onBlur:()=>v(null),className:"mr-2",autoFocus:!0}):(0,z.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("closureDate"),children:[(0,z.jsx)(lt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,z.jsx)("span",{children:r.closureDate?new Date(r.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,z.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Description"}),w==="description"?(0,z.jsx)(ee,{value:r.description||"",onChange:n=>h("description",n.target.value),onBlur:()=>v(null),className:"min-h-[100px]",autoFocus:!0}):(0,z.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>v("description"),children:r.description})]})}),(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Status"}),w==="status"?(0,z.jsxs)(oe,{value:r.status,onValueChange:n=>{h("status",n),v(null)},children:[(0,z.jsx)(_,{children:(0,z.jsx)(re,{placeholder:"Select status"})}),(0,z.jsx)($,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(n=>(0,z.jsx)(K,{value:n,children:n},n))})]}):(0,z.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("status"),children:r.status})]}),(0,z.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Categories"}),w==="categories"?(0,z.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(n=>(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(ae,{id:n.id?.toString()||"",checked:(r.categories||[]).some(N=>N.id===n.id),onCheckedChange:()=>n.id!==void 0&&L(n)}),(0,z.jsx)("label",{htmlFor:(n.id??"").toString(),className:`text-sm font-medium ${m(n.type||"sector")} px-2 py-1 rounded`,children:n.name})]},n.id))}):(0,z.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("categories"),children:r.categories&&r.categories.map(n=>{let N=n;return N?(0,z.jsx)(Ae,{variant:"outline",className:m(N.type||"sector"),children:N.name},N.id):null})})]}),(0,z.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"COGE Status"}),w==="gecoStatus"?(0,z.jsxs)(oe,{value:r.gecoStatus??void 0,onValueChange:n=>{h("gecoStatus",n),v(null)},children:[(0,z.jsx)(_,{children:(0,z.jsx)(re,{placeholder:"Select status"})}),(0,z.jsx)($,{children:["firm","forecast","other"].map(n=>(0,z.jsx)(K,{value:n,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]}):(0,z.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>v("gecoStatus"),children:r.gecoStatus?r.gecoStatus.charAt(0).toUpperCase()+r.gecoStatus.slice(1):"N/A"})]})]}),(0,z.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,z.jsxs)("div",{className:"grid gap-2",children:[(0,z.jsx)(I,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,z.jsx)(ge,{className:"h-[200px] overflow-y-auto",children:(0,z.jsx)("div",{className:"space-y-2",children:r.comments&&r.comments.slice().sort((n,N)=>new Date(N.timestamp||"").getTime()-new Date(n.timestamp||"").getTime()).map(n=>(0,z.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,z.jsx)("p",{className:"text-sm text-foreground",children:n.text}),(0,z.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[n?.author?.name," - ",new Date(n.timestamp||"").toLocaleString()]})]},n.id))})}),(0,z.jsxs)("div",{className:"flex mt-2",children:[(0,z.jsx)(F,{value:b,onChange:n=>p(n.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,z.jsxs)(H,{onClick:E,className:"ml-2",children:[(0,z.jsx)(lt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,z.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.updatedAt||"").toLocaleString()]})]})]})]})})}var ie=B(require("react"));var Te=ie.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Te.displayName="Card";var ke=ie.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("flex flex-col space-y-1.5 p-6",e),...t}));ke.displayName="CardHeader";var Le=ie.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("font-semibold leading-none tracking-tight",e),...t}));Le.displayName="CardTitle";var zo=ie.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("text-sm text-muted-foreground",e),...t}));zo.displayName="CardDescription";var Me=ie.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("p-6 pt-0",e),...t}));Me.displayName="CardContent";var Zo=ie.forwardRef(({className:e,...t},o)=>(0,z.jsx)("div",{ref:o,className:g("flex items-center p-6 pt-0",e),...t}));Zo.displayName="CardFooter";function kt({deal:e,customer:t,categories:o,onClick:a,compact:s=!1}){let l=o.find(d=>d.type==="proposition"&&(e.categories??[]).includes(d.id));return s?(0,z.jsxs)(Te,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,z.jsxs)(ke,{className:"pb-1 pt-2",children:[(0,z.jsx)(Le,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,z.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,z.jsx)(Me,{className:"text-xs text-gray-500 pb-2",children:(0,z.jsx)("div",{className:"flex justify-between items-center mb-1",children:(0,z.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,z.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})})})]}):(0,z.jsxs)(Te,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,z.jsxs)(ke,{className:"pb-2",children:[(0,z.jsx)("div",{className:"flex justify-between items-center",children:(0,z.jsx)(Le,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,z.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,z.jsxs)(Me,{children:[(0,z.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,z.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,z.jsx)(lt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,z.jsx)("span",{children:e.assignee.name})]}),(0,z.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,z.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,z.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,z.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,z.jsx)(lt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,z.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,z.jsx)("div",{className:"flex justify-between items-left",children:l&&(0,z.jsx)(Ae,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:l.name})})]})]})}var Ee=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Mt({onSubmit:e}){let[t,o]=(0,Vt.useState)({name:"",intro:"",active:!1});return(0,z.jsxs)("form",{onSubmit:s=>{s.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,z.jsx)(F,{id:"customerName",value:t.name,onChange:s=>o({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,z.jsx)(ee,{id:"customerIntro",value:t.intro??"",onChange:s=>o({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(ae,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>o({...t,active:s})}),(0,z.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,z.jsx)(H,{type:"submit",className:"w-full",children:"Add Customer"})]})}function Et({customers:e,users:t,categories:o,onSubmit:a,initialDeal:s,onAddCustomer:l,onClose:d}){let[r,f]=(0,Vt.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("z")[0],closureDate:"",comments:[],description:""}),[b,p]=(0,Vt.useState)(!1),[C,D]=(0,Vt.useState)({});(0,Vt.useEffect)(()=>{s&&f(s)},[s]);let w=()=>{let m={};return r.customer||(m.customer="Customer is required"),r.value||(m.value="Value is required"),r.assignee||(m.assignee="Assignee is required"),r.closureDate||(m.closureDate="Closure Date is required"),D(m),Object.keys(m).length===0},v=async m=>{m.preventDefault(),D({});try{if(w()){let x=await a({...r});x.success?(f({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),d?.()):D(x.errors||{})}}catch{D({submit:"An error occurred while submitting the form."})}},A=m=>{f(x=>({...x,categories:(x.categories||[]).includes(m.id)?(x.categories||[]).filter(n=>n!==m.id):[...x.categories||[],m.id]}))},h=async m=>{f({...r,customer:m});try{let x=await l(m);x.success?p(!1):D(x.errors||{})}catch{D({submit:"An error occurred while submitting the form."})}},L=m=>t?.find(x=>x.id===Number(m)),E=m=>e?.find(x=>x.id===Number(m));return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("form",{onSubmit:v,className:"space-y-6",children:[(0,z.jsx)(ge,{className:"h-[60vh] pr-4",children:(0,z.jsxs)("div",{className:"space-y-6 px-4",children:[(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsxs)(oe,{value:r.customer?.id?.toString(),onValueChange:m=>f({...r,customer:E(m)}),children:[(0,z.jsx)(_,{children:(0,z.jsx)(re,{placeholder:"Select customer"})}),(0,z.jsx)($,{children:e.map(m=>(0,z.jsx)(K,{value:m.id?.toString()||"",children:m.name},m.id))})]}),(0,z.jsx)(H,{variant:"outline",size:"icon",onClick:()=>p(!0),children:(0,z.jsx)(lt.PlusIcon,{className:"w-5 h-5"})})]}),C.customerId&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:C.customerId})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"value",children:"Value"}),(0,z.jsx)(F,{id:"value",type:"number",value:r.value||"",onChange:m=>f({...r,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),C.value&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:C.value})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,z.jsxs)(oe,{value:r.assignee?.id?.toString(),onValueChange:m=>f({...r,assignee:L(m)}),children:[(0,z.jsx)(_,{children:(0,z.jsx)(re,{placeholder:"Select assignee"})}),(0,z.jsx)($,{children:t&&t.map(m=>(0,z.jsx)(K,{value:m.id?.toString()||"",children:m.name},m.id))})]}),C.assignee&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:C.assignee})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"description",children:"Description"}),(0,z.jsx)(ee,{id:"description",value:r.description||"",onChange:m=>f({...r,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{children:"Categories"}),(0,z.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,z.jsxs)("div",{className:"space-y-2",children:[(0,z.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,z.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(x=>x.type===m).map(x=>(0,z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,z.jsx)(ae,{id:x.id.toString(),checked:r.categories?.includes(x.id),onCheckedChange:()=>A(x)}),(0,z.jsx)("label",{htmlFor:x.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:x.name})]},x.id))})]},m))})]}),(0,z.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,z.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,z.jsx)(F,{id:"closureDate",type:"date",value:r.closureDate||"",onChange:m=>f({...r,closureDate:m.target.value})}),C.closureDate&&(0,z.jsx)("p",{className:"text-red-500 text-sm",children:C.closureDate})]})]})}),(0,z.jsx)(H,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,z.jsx)(pe,{open:b,onOpenChange:p,children:(0,z.jsxs)(Q,{children:[(0,z.jsx)(X,{children:(0,z.jsx)(Y,{children:"Add New Customer"})}),(0,z.jsx)(Mt,{onSubmit:h})]})})]})}function Zt({status:e,deals:t,users:o,customers:a,categories:s,onDealClick:l,calculateColumnValue:d,calculateWeightedValue:r,addNewDeal:f,onAddCustomer:b,compact:p=!1}){let[C,D]=(0,Vt.useState)(!1);return(0,z.jsxs)("div",{className:"flex flex-col w-80",children:[(0,z.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),f&&(0,z.jsxs)(pe,{open:C,onOpenChange:D,children:[(0,z.jsx)(ct,{asChild:!0,children:(0,z.jsxs)(H,{className:"mb-4 w-full",children:[(0,z.jsx)(lt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,z.jsxs)(Q,{children:[(0,z.jsx)(X,{children:(0,z.jsx)(Y,{children:"Add New Deal"})}),(0,z.jsx)(Et,{customers:a,users:o,categories:s,onSubmit:f,onAddCustomer:b??(async()=>Promise.resolve({success:!1})),onClose:()=>D(!1)})]})]}),(0,z.jsx)(Ee.Droppable,{droppableId:e,isDropDisabled:!1,children:w=>(0,z.jsxs)("div",{ref:w.innerRef,...w.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((v,A)=>(0,z.jsx)(Ee.Draggable,{draggableId:v.id.toString(),index:v.id,children:h=>(0,z.jsx)("div",{ref:h.innerRef,...h.draggableProps,...h.dragHandleProps,children:(0,z.jsx)(kt,{deal:v,customer:v.customer,categories:s,onClick:()=>l(v),compact:p})})},v.id.toString())),w.placeholder]})}),(0,z.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,z.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,z.jsxs)("span",{className:"text-green-600",children:["\xA3",d(t).toLocaleString()]})]}),(0,z.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,z.jsxs)("span",{className:"text-blue-600",children:["\xA3",r(t,e).toLocaleString()]})]})]})]})}var Ho=["firm","forecast","other"];function je({initialData:e,updateDeal:t,addComment:o}){let[a,s]=(0,Vt.useState)(null),l=b=>(e.deals??[]).filter(p=>p.gecoStatus===b).filter(p=>p.status!=="Lost").filter(p=>p.status!=="Cold"),d=b=>b.reduce((p,C)=>p+(C.value||0),0),r=(b,p)=>{let C={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return b.reduce((D,w)=>D+(w.value||0)*(C[w.status]??0),0)},f=(0,Vt.useCallback)(b=>{let{source:p,destination:C}=b;if(!C||p.droppableId===C.droppableId&&p.index===C.index)return;let D=p.droppableId,w=C.droppableId,v=e.deals?.filter(h=>h.id===p.index)[0],A=[...e.deals??[]];v&&(v.gecoStatus=w,t(v))},[t]);return(0,z.jsx)(Ee.DragDropContext,{onDragEnd:f,children:(0,z.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,z.jsx)("div",{className:"flex space-x-4 pb-4",children:Ho.map(b=>{let p=l(b);return(0,z.jsx)(Zt,{status:b,deals:p,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:s,calculateColumnValue:d,calculateWeightedValue:r,compact:!0},b)})}),a&&(0,z.jsx)(Tt,{deal:a,users:e.users,customer:a.customer,categories:e.categories??[],onClose:()=>s(null),onSave:t,onAddComment:b=>o(a.id.toString(),b)})]})})}var we=[{id:1,name:"Acme Corp",intro:"A leading technology company",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1,createdAt:"2023-01-01",updatedAt:"2023-01-01"}],be=[{id:1,name:"Software",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Hardware",type:"proposition",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Referral",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Outbound",type:"source",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Tech",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:6,name:"Finance",type:"sector",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],ce=[{id:1,name:"John Doe",email:"john.doe@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:3,name:"Bob Johnson",email:"bob.johnson@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:4,name:"Alice Brown",email:"alice.brown@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},{id:5,name:"Charlie Davis",email:"charlie.davis@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"}],sa=[{id:1,customer:we[0],value:5e4,assignee:ce[2],status:"Qualified",categories:be.slice(0,3),dateLogged:"2023-01-15",closureDate:"2023-06-30",updatedAt:"2023-05-01T10:00:00Z",createdAt:"2023-01-01",comments:[{id:"1",text:"Initial contact made",author:ce[5],timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0,createdAt:"2023-01-01",updatedAt:"2023-01-01"},value:75e3,assignee:{id:2,name:"Jane Smith",email:"jane.smith@example.com",role:"user",createdAt:"2023-01-01",updatedAt:"2023-01-01"},status:"Proposal Made",categories:be.slice(0,3),dateLogged:"2023-02-01",closureDate:"2023-07-31",updatedAt:"2023-05-10T14:30:00Z",createdAt:"2023-01-01",comments:[{id:"2",text:"Proposal sent",author:ce[1],timestamp:"2023-02-15T09:00:00Z"}],description:"Custom hardware solution for GlobalTech"}];var Vo={title:"CRM/CogeBoard",tags:["autodocs"],component:je},Fo=Vo,_e=e=>{let[t,o]=(0,Vt.useState)(e.initialData);return(0,z.jsx)(je,{...e,initialData:t,updateDeal:async s=>(console.log("Updating deal:",s),o(l=>({...l,deals:(l.deals??[]).map(d=>d.id===s.id?s:d)})),s)})},Se=_e.bind({});Se.args={initialData:{deals:Array.from({length:13},(e,t)=>({id:t+1,customer:we[t%we.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:ce[Math.floor(Math.random()*ce.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],gecoStatus:["firm","forecast","other"][t%3],categories:[be[t%be.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. lt's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:we,users:ce,categories:be},addComment:async(e,t)=>(console.log("Adding comment to deal:",e,t),{...t,id:"new-comment-id"})};var Ft=_e.bind({});Ft.args={...Se.args,initialData:{deals:[{id:11,customer:{id:1,name:"Customer 1",intro:null,active:!0,icon:null,updatedAt:"2025-04-28T21:56:26.595Z",createdAt:"2025-04-28T21:56:26.594Z"},value:1,assignee:{id:1,name:"Test user - do not delete",email:"test@test.com",jobRole:null,manager:null,about:null,profilePicture:null,holidaysRemaining:25,startingHolidays:25,dateOfBirth:null,joinDate:null,linkedIn:null,assets:[],role:"admin",updatedAt:"2025-04-28T21:23:55.792Z",createdAt:"2025-04-28T21:23:55.787Z",enableAPIKey:null,apiKey:null},status:"Won",gecoStatus:"firm",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-06-17T11:54:01.228Z",createdAt:"2025-04-29T21:09:20.627Z"},{id:10,value:1,status:"Lost",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"Lost deal example",comments:[],updatedAt:"2025-04-29T21:09:18.942Z",createdAt:"2025-04-29T21:09:18.940Z"},{id:9,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:17.611Z",createdAt:"2025-04-29T21:09:17.601Z"},{id:8,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:15.980Z",createdAt:"2025-04-29T21:09:15.979Z"},{id:7,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:14.452Z",createdAt:"2025-04-29T21:09:14.442Z"},{id:6,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:12.527Z",createdAt:"2025-04-29T21:09:12.526Z"},{id:5,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:10.603Z",createdAt:"2025-04-29T21:09:10.592Z"},{id:4,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:09.032Z",createdAt:"2025-04-29T21:09:09.031Z"},{id:3,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:07.464Z",createdAt:"2025-04-29T21:09:07.463Z"},{id:2,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:03.844Z",createdAt:"2025-04-29T21:09:03.840Z"},{id:1,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:08:45.164Z",createdAt:"2025-04-29T21:08:45.160Z"}],customers:[{id:1,name:"Customer 1",active:!0},{id:2,name:"Customer 2",active:!0},{id:3,name:"Customer 3",active:!0}],users:[{id:1,name:"Test user - do not delete",email:"test@test.com",jobRole:null,manager:null,about:null,profilePicture:null,holidaysRemaining:25,startingHolidays:25,dateOfBirth:null,joinDate:null,linkedIn:null,assets:[],role:"admin",updatedAt:"2025-04-28T21:23:55.792Z",createdAt:"2025-04-28T21:23:55.787Z",enableAPIKey:null,apiKey:null}],categories:[]}};var Ut=_e.bind({});Ut.args={...Se.args,initialData:{...Se.args.initialData,deals:[]}};0&&(module.exports={Default,NoDeals,Test});
@@ -1 +1 @@
1
- import{a as e,b as r,c as n}from"../../chunk-TLBLUYXL.mjs";import{a as s}from"../../chunk-OIQ6GXBY.mjs";import"../../chunk-PFWODHNV.mjs";import"../../chunk-TASJS6US.mjs";import"../../chunk-ERUB6LU6.mjs";import"../../chunk-FFESN4FM.mjs";import"../../chunk-MEWCJ4MA.mjs";import"../../chunk-OGZERPA4.mjs";import"../../chunk-6T322YHB.mjs";import"../../chunk-KJIBE57R.mjs";import"../../chunk-CX4XB5W2.mjs";import"../../chunk-EECIYMTX.mjs";import"../../chunk-BUCI7BPM.mjs";import"../../chunk-JPZJET3B.mjs";import"../../chunk-BPSLUO5I.mjs";import"../../chunk-J2IHT57D.mjs";import"../../chunk-4YFMDLHL.mjs";import"../../chunk-HTVHCBXQ.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-ZLSF5YXT.mjs";import"../../chunk-M6LJ4BNZ.mjs";import{useState as c}from"react";import{jsx as p}from"react/jsx-runtime";var h={title:"CRM/CogeBoard",tags:["autodocs"],component:s},y=h,m=a=>{let[t,g]=c(a.initialData);return p(s,{...a,initialData:t,updateDeal:async o=>(console.log("Updating deal:",o),g(d=>({...d,deals:(d.deals??[]).map(l=>l.id===o.id?o:l)})),o)})},i=m.bind({});i.args={initialData:{deals:Array.from({length:13},(a,t)=>({id:t+1,customer:e[t%e.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:n[Math.floor(Math.random()*n.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],gecoStatus:["firm","forecast","other"][t%3],categories:[r[t%r.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${t+1}. It's a ${["small","medium","large"][t%3]} deal with high potential.`})),customers:e,users:n,categories:r},addComment:async(a,t)=>(console.log("Adding comment to deal:",a,t),{...t,id:"new-comment-id"})};var f=m.bind({});f.args={...i.args,initialData:{...i.args.initialData,deals:[]}};export{i as Default,f as NoDeals,y as default};
1
+ import{a as o,b as s,c as d}from"../../chunk-TLBLUYXL.mjs";import{a as l}from"../../chunk-IPVKFQEY.mjs";import"../../chunk-3AUTMBDB.mjs";import"../../chunk-COI2LCY2.mjs";import"../../chunk-VGQTRTPZ.mjs";import"../../chunk-FFESN4FM.mjs";import"../../chunk-URPKAQGD.mjs";import"../../chunk-OGZERPA4.mjs";import"../../chunk-6T322YHB.mjs";import"../../chunk-CX4XB5W2.mjs";import"../../chunk-EECIYMTX.mjs";import"../../chunk-KJIBE57R.mjs";import"../../chunk-BUCI7BPM.mjs";import"../../chunk-JPZJET3B.mjs";import"../../chunk-BPSLUO5I.mjs";import"../../chunk-J2IHT57D.mjs";import"../../chunk-4YFMDLHL.mjs";import"../../chunk-HTVHCBXQ.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-ZLSF5YXT.mjs";import"../../chunk-M6LJ4BNZ.mjs";import{useState as m}from"react";import{jsx as p}from"react/jsx-runtime";var g={title:"CRM/CogeBoard",tags:["autodocs"],component:l},S=g,i=t=>{let[e,c]=m(t.initialData);return p(l,{...t,initialData:e,updateDeal:async a=>(console.log("Updating deal:",a),c(n=>({...n,deals:(n.deals??[]).map(u=>u.id===a.id?a:u)})),a)})},r=i.bind({});r.args={initialData:{deals:Array.from({length:13},(t,e)=>({id:e+1,customer:o[e%o.length],value:Math.floor(Math.random()*1e5)+5e3,assignee:d[Math.floor(Math.random()*d.length)].name,status:["Cold","Qualified","Proposal Made","Won","Lost"][Math.floor(Math.random()*5)],gecoStatus:["firm","forecast","other"][e%3],categories:[s[e%s.length].id],dateLogged:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString(),closureDate:new Date(Date.now()+Math.floor(Math.random()*90)*24*60*60*1e3).toISOString(),comments:[],updatedAt:new Date().toISOString(),description:`This is a mock description for deal ${e+1}. It's a ${["small","medium","large"][e%3]} deal with high potential.`})),customers:o,users:d,categories:s},addComment:async(t,e)=>(console.log("Adding comment to deal:",t,e),{...e,id:"new-comment-id"})};var w=i.bind({});w.args={...r.args,initialData:{deals:[{id:11,customer:{id:1,name:"Customer 1",intro:null,active:!0,icon:null,updatedAt:"2025-04-28T21:56:26.595Z",createdAt:"2025-04-28T21:56:26.594Z"},value:1,assignee:{id:1,name:"Test user - do not delete",email:"test@test.com",jobRole:null,manager:null,about:null,profilePicture:null,holidaysRemaining:25,startingHolidays:25,dateOfBirth:null,joinDate:null,linkedIn:null,assets:[],role:"admin",updatedAt:"2025-04-28T21:23:55.792Z",createdAt:"2025-04-28T21:23:55.787Z",enableAPIKey:null,apiKey:null},status:"Won",gecoStatus:"firm",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-06-17T11:54:01.228Z",createdAt:"2025-04-29T21:09:20.627Z"},{id:10,value:1,status:"Lost",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"Lost deal example",comments:[],updatedAt:"2025-04-29T21:09:18.942Z",createdAt:"2025-04-29T21:09:18.940Z"},{id:9,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:17.611Z",createdAt:"2025-04-29T21:09:17.601Z"},{id:8,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:15.980Z",createdAt:"2025-04-29T21:09:15.979Z"},{id:7,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:14.452Z",createdAt:"2025-04-29T21:09:14.442Z"},{id:6,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:12.527Z",createdAt:"2025-04-29T21:09:12.526Z"},{id:5,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:10.603Z",createdAt:"2025-04-29T21:09:10.592Z"},{id:4,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:09.032Z",createdAt:"2025-04-29T21:09:09.031Z"},{id:3,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:07.464Z",createdAt:"2025-04-29T21:09:07.463Z"},{id:2,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:09:03.844Z",createdAt:"2025-04-29T21:09:03.840Z"},{id:1,value:1,status:"Cold",gecoStatus:"other",categories:[],dateLogged:"2025-04-29T21:08:45.154Z",closureDate:"2025-04-30T00:00:00.000Z",description:"wewewewewedsds",comments:[],updatedAt:"2025-04-29T21:08:45.164Z",createdAt:"2025-04-29T21:08:45.160Z"}],customers:[{id:1,name:"Customer 1",active:!0},{id:2,name:"Customer 2",active:!0},{id:3,name:"Customer 3",active:!0}],users:[{id:1,name:"Test user - do not delete",email:"test@test.com",jobRole:null,manager:null,about:null,profilePicture:null,holidaysRemaining:25,startingHolidays:25,dateOfBirth:null,joinDate:null,linkedIn:null,assets:[],role:"admin",updatedAt:"2025-04-28T21:23:55.792Z",createdAt:"2025-04-28T21:23:55.787Z",enableAPIKey:null,apiKey:null}],categories:[]}};var T=i.bind({});T.args={...r.args,initialData:{...r.args.initialData,deals:[]}};export{r as Default,T as NoDeals,w as Test,S as default};