cortex-react-components 1.58.23 → 1.59.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 (154) hide show
  1. package/dist/{chunk-JVM2ZAN6.mjs → chunk-2QKC72KJ.mjs} +1 -1
  2. package/dist/{chunk-NO3JTFER.mjs → chunk-3S7DEGD3.mjs} +1 -1
  3. package/dist/{chunk-LCRFWXVK.mjs → chunk-4SHAKQSO.mjs} +1 -1
  4. package/dist/{chunk-HJXEIYVK.mjs → chunk-4XZH7H6Z.mjs} +1 -1
  5. package/dist/{chunk-C2GNS62O.mjs → chunk-54TJBDXV.mjs} +1 -1
  6. package/dist/{chunk-K7XFS6IQ.mjs → chunk-5SW4N6XT.mjs} +1 -1
  7. package/dist/{chunk-PIM2JQYT.mjs → chunk-7PNAXVQ2.mjs} +1 -1
  8. package/dist/{chunk-CSNKYRV5.mjs → chunk-7XB4Y3U2.mjs} +1 -1
  9. package/dist/{chunk-UFDQJZAB.mjs → chunk-AFHR37IB.mjs} +1 -1
  10. package/dist/{chunk-L2QAYSRV.mjs → chunk-D4DEMLBK.mjs} +1 -1
  11. package/dist/{chunk-HPMQRCDC.mjs → chunk-DKN3LCV5.mjs} +1 -1
  12. package/dist/{chunk-UHW6FJUK.mjs → chunk-E3CE275D.mjs} +1 -1
  13. package/dist/{chunk-JZE6HGP6.mjs → chunk-E3OJ5OL6.mjs} +1 -1
  14. package/dist/{chunk-OJPHYSRN.mjs → chunk-EIEBANVZ.mjs} +1 -1
  15. package/dist/{chunk-Q32SRZ5X.mjs → chunk-ELSPLJLY.mjs} +1 -1
  16. package/dist/{chunk-6SQK6BMG.mjs → chunk-EUAYEIH6.mjs} +1 -1
  17. package/dist/{chunk-BTY3MRVI.mjs → chunk-GETBIECR.mjs} +1 -1
  18. package/dist/{chunk-3TNHR4R3.mjs → chunk-HAOGHXCM.mjs} +1 -1
  19. package/dist/{chunk-VNPAYMAG.mjs → chunk-IEC7SW45.mjs} +1 -1
  20. package/dist/{chunk-C3TKY5VE.mjs → chunk-J2S55IKX.mjs} +1 -1
  21. package/dist/chunk-K2RDP7A3.mjs +1 -0
  22. package/dist/chunk-KLTE56MS.mjs +1 -0
  23. package/dist/{chunk-BRYZOZKY.mjs → chunk-KTQEW4OB.mjs} +1 -1
  24. package/dist/chunk-KUJXSGYS.mjs +1 -0
  25. package/dist/{chunk-IABQ3JMG.mjs → chunk-L7DXIYCC.mjs} +1 -1
  26. package/dist/{chunk-IFZ6ABCM.mjs → chunk-LNPXUJPX.mjs} +1 -1
  27. package/dist/{chunk-75OAUMGO.mjs → chunk-M53XY4LJ.mjs} +1 -1
  28. package/dist/{chunk-IAP7Y2DK.mjs → chunk-MBMWYNTW.mjs} +1 -1
  29. package/dist/{chunk-GM53J62R.mjs → chunk-QOXCD64Q.mjs} +1 -1
  30. package/dist/{chunk-WDVSSHIB.mjs → chunk-S4K46TIQ.mjs} +1 -1
  31. package/dist/{chunk-KLCZHZKQ.mjs → chunk-S7I4XJS6.mjs} +1 -1
  32. package/dist/{chunk-6ARDJ33C.mjs → chunk-TGZJYJ2U.mjs} +1 -1
  33. package/dist/{chunk-MFTCHZFC.mjs → chunk-ULDVX7QK.mjs} +1 -1
  34. package/dist/{chunk-VV6P75VN.mjs → chunk-XT5GKZWD.mjs} +1 -1
  35. package/dist/{chunk-26FHIJPI.mjs → chunk-YFEJX756.mjs} +1 -1
  36. package/dist/chunk-Z2EKZZJU.mjs +1 -0
  37. package/dist/components/Blocks/Banner.mjs +1 -1
  38. package/dist/components/Blocks/CallToAction.mjs +1 -1
  39. package/dist/components/Blocks/CallToAction.stories.mjs +1 -1
  40. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  41. package/dist/components/Blocks/CollapsibleArea.stories.mjs +1 -1
  42. package/dist/components/Blocks/Content.mjs +1 -1
  43. package/dist/components/Blocks/Content.stories.mjs +1 -1
  44. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  45. package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
  46. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  47. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  48. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  49. package/dist/components/Blocks/index.mjs +1 -1
  50. package/dist/components/CRM/DealCard.js +1 -1
  51. package/dist/components/CRM/DealCard.mjs +1 -1
  52. package/dist/components/CRM/DealCard.stories.js +1 -1
  53. package/dist/components/CRM/DealCard.stories.mjs +1 -1
  54. package/dist/components/CRM/DealDetails.js +1 -1
  55. package/dist/components/CRM/DealDetails.mjs +1 -1
  56. package/dist/components/CRM/DealDetails.stories.js +1 -1
  57. package/dist/components/CRM/DealDetails.stories.mjs +1 -1
  58. package/dist/components/CRM/KanbanBoard.js +1 -1
  59. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  60. package/dist/components/CRM/KanbanBoard.stories.js +1 -1
  61. package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
  62. package/dist/components/CRM/KanbanColumn.js +1 -1
  63. package/dist/components/CRM/KanbanColumn.mjs +1 -1
  64. package/dist/components/CRM/KanbanColumn.stories.js +1 -1
  65. package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
  66. package/dist/components/CRM/NewCustomerForm.js +1 -1
  67. package/dist/components/CRM/NewCustomerForm.mjs +1 -1
  68. package/dist/components/CRM/NewCustomerForm.stories.js +1 -1
  69. package/dist/components/CRM/NewCustomerForm.stories.mjs +1 -1
  70. package/dist/components/CRM/NewDealForm.js +1 -1
  71. package/dist/components/CRM/NewDealForm.mjs +1 -1
  72. package/dist/components/CRM/NewDealForm.stories.js +1 -1
  73. package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
  74. package/dist/components/CRM/index.js +1 -1
  75. package/dist/components/CRM/index.mjs +1 -1
  76. package/dist/components/Cards/ContentCard.mjs +1 -1
  77. package/dist/components/Cards/ContentCard.stories.mjs +1 -1
  78. package/dist/components/Cards/FeatureCard.mjs +1 -1
  79. package/dist/components/Cards/FeatureCard.stories.mjs +1 -1
  80. package/dist/components/Cards/index.mjs +1 -1
  81. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  82. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  83. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  84. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  85. package/dist/components/Heros/PostHero/index.mjs +1 -1
  86. package/dist/components/Heros/RenderHero.mjs +1 -1
  87. package/dist/components/Heros/index.mjs +1 -1
  88. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  89. package/dist/components/Holidays/HolidayTracker.stories.mjs +1 -1
  90. package/dist/components/Holidays/index.mjs +1 -1
  91. package/dist/components/Layouts/FeatureGrid.stories.mjs +1 -1
  92. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  93. package/dist/components/Layouts/Print.mjs +1 -1
  94. package/dist/components/Layouts/Print.stories.mjs +1 -1
  95. package/dist/components/Layouts/SlideShow.mjs +1 -1
  96. package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
  97. package/dist/components/Layouts/index.mjs +1 -1
  98. package/dist/components/Payload/RichText/index.mjs +1 -1
  99. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  100. package/dist/components/Payload/RichText.stories.mjs +1 -1
  101. package/dist/components/Payload/index.mjs +1 -1
  102. package/dist/components/index.js +3 -3
  103. package/dist/components/index.mjs +1 -1
  104. package/dist/components/ui/index.mjs +1 -1
  105. package/dist/globals.css +1 -1
  106. package/dist/index.js +7 -7
  107. package/dist/index.mjs +1 -1
  108. package/dist/metafile-cjs.json +1 -1
  109. package/dist/metafile-esm.json +1 -1
  110. package/dist/pages/Blog.js +1 -1
  111. package/dist/pages/Blog.mjs +1 -1
  112. package/dist/pages/Blog.stories.js +1 -1
  113. package/dist/pages/Blog.stories.mjs +1 -1
  114. package/dist/pages/IndexPage.mjs +1 -1
  115. package/dist/pages/IndexPage.stories.mjs +1 -1
  116. package/dist/pages/Intranet.mjs +1 -1
  117. package/dist/pages/Intranet.stories.mjs +1 -1
  118. package/dist/pages/LandingPage.mjs +1 -1
  119. package/dist/pages/LandingPage.stories.mjs +1 -1
  120. package/dist/pages/Page.mjs +1 -1
  121. package/dist/pages/Page.stories.mjs +1 -1
  122. package/dist/pages/Printable.stories.mjs +1 -1
  123. package/dist/pages/Publish.mjs +1 -1
  124. package/dist/pages/Publish.stories.mjs +1 -1
  125. package/dist/pages/Website.mjs +1 -1
  126. package/dist/pages/Website.stories.mjs +1 -1
  127. package/dist/sections/AboutSection.mjs +1 -1
  128. package/dist/sections/AboutSection.stories.mjs +1 -1
  129. package/dist/sections/BlogDetail.js +1 -1
  130. package/dist/sections/BlogDetail.mjs +1 -1
  131. package/dist/sections/BlogDetail.stories.js +1 -1
  132. package/dist/sections/BlogDetail.stories.mjs +1 -1
  133. package/dist/sections/BlogList.mjs +1 -1
  134. package/dist/sections/BlogList.stories.mjs +1 -1
  135. package/dist/sections/ContactSection.mjs +1 -1
  136. package/dist/sections/ContactSection.stories.mjs +1 -1
  137. package/dist/sections/ImageSection.stories.mjs +1 -1
  138. package/dist/sections/PageSections.mjs +1 -1
  139. package/dist/sections/PageSections.stories.mjs +1 -1
  140. package/dist/sections/PricingSection.mjs +1 -1
  141. package/dist/sections/PricingSection.stories.mjs +1 -1
  142. package/dist/sections/ServiceDetail.mjs +1 -1
  143. package/dist/sections/ServiceDetailSection.mjs +1 -1
  144. package/dist/sections/ServiceDetailSection.stories.mjs +1 -1
  145. package/dist/sections/ServiceSection.mjs +1 -1
  146. package/dist/sections/ServiceSection.stories.mjs +1 -1
  147. package/dist/sections/form/index.mjs +1 -1
  148. package/dist/sections/index.js +2 -2
  149. package/dist/sections/index.mjs +1 -1
  150. package/package.json +1 -1
  151. package/dist/chunk-4TCLIMFP.mjs +0 -1
  152. package/dist/chunk-6YWAX7NS.mjs +0 -1
  153. package/dist/chunk-OWBJTXZL.mjs +0 -1
  154. package/dist/chunk-QT5WSNLK.mjs +0 -1
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";var ft=Object.create;var le=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var bt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var yt=(e,t)=>{for(var o in t)le(e,o,{get:t[o],enumerable:!0})},Te=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of bt(t))!ht.call(e,l)&&l!==o&&le(e,l,{get:()=>t[l],enumerable:!(a=gt(t,l))||a.enumerable});return e};var A=(e,t,o)=>(o=e!=null?ft(vt(e)):{},Te(t||!e||!e.__esModule?le(o,"default",{value:e,enumerable:!0}):o,e)),xt=e=>Te(le({},"__esModule",{value:!0}),e);var po={};yt(po,{Default:()=>ut,WithManyComments:()=>mo,default:()=>lo});module.exports=xt(po);var O=require("react");var ee=A(require("react")),S=A(require("@radix-ui/react-dialog")),Ue=require("lucide-react");var We=require("clsx");var ve="-",wt=e=>{let t=Ct(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let r=c.split(ve);return r[0]===""&&r.length!==1&&r.shift(),Me(r,t)||St(c)},getConflictingClassGroupIds:(c,r)=>{let v=o[c]||[];return r&&a[c]?[...v,...a[c]]:v}}},Me=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),l=a?Me(e.slice(1),a):void 0;if(l)return l;if(t.validators.length===0)return;let n=e.join(ve);return(c=t.validators.find(({validator:r})=>r(n)))==null?void 0:c.classGroupId},Ie=/^\[(.+)\]$/,St=e=>{if(Ie.test(e)){let t=Ie.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ct=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Rt(Object.entries(e.classGroups),o).forEach(([n,c])=>{be(c,a,n,t)}),a},be=(e,t,o,a)=>{e.forEach(l=>{if(typeof l=="string"){let n=l===""?t:ze(t,l);n.classGroupId=o;return}if(typeof l=="function"){if(Pt(l)){be(l(a),t,o,a);return}t.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([n,c])=>{be(c,ze(t,n),o,a)})})},ze=(e,t)=>{let o=e;return t.split(ve).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Pt=e=>e.isThemeGetter,Rt=(e,t)=>t?e.map(([o,a])=>{let l=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([c,r])=>[t+c,r])):n);return[o,l]}):e,Nt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,l=(n,c)=>{o.set(n,c),t++,t>e&&(t=0,a=o,o=new Map)};return{get(n){let c=o.get(n);if(c!==void 0)return c;if((c=a.get(n))!==void 0)return l(n,c),c},set(n,c){o.has(n)?o.set(n,c):l(n,c)}}},Le="!",Dt=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,l=t[0],n=t.length,c=r=>{let v=[],x=0,C=0,k;for(let g=0;g<r.length;g++){let P=r[g];if(x===0){if(P===l&&(a||r.slice(g,g+n)===t)){v.push(r.slice(C,g)),C=g+n;continue}if(P==="/"){k=g;continue}}P==="["?x++:P==="]"&&x--}let N=v.length===0?r:r.substring(C),R=N.startsWith(Le),h=R?N.substring(1):N,w=k&&k>C?k-C:void 0;return{modifiers:v,hasImportantModifier:R,baseClassName:h,maybePostfixModifierPosition:w}};return o?r=>o({className:r,parseClassName:c}):c},kt=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},At=e=>({cache:Nt(e.cacheSize),parseClassName:Dt(e),...wt(e)}),Tt=/\s+/,It=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:l}=t,n=[],c=e.trim().split(Tt),r="";for(let v=c.length-1;v>=0;v-=1){let x=c[v],{modifiers:C,hasImportantModifier:k,baseClassName:N,maybePostfixModifierPosition:R}=o(x),h=!!R,w=a(h?N.substring(0,R):N);if(!w){if(!h){r=x+(r.length>0?" "+r:r);continue}if(w=a(N),!w){r=x+(r.length>0?" "+r:r);continue}h=!1}let g=kt(C).join(":"),P=k?g+Le:g,D=P+w;if(n.includes(D))continue;n.push(D);let E=l(w,h);for(let z=0;z<E.length;++z){let j=E[z];n.push(P+j)}r=x+(r.length>0?" "+r:r)}return r};function zt(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ee(t))&&(a&&(a+=" "),a+=o);return a}var Ee=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Ee(e[a]))&&(o&&(o+=" "),o+=t);return o};function Mt(e,...t){let o,a,l,n=c;function c(v){let x=t.reduce((C,k)=>k(C),e());return o=At(x),a=o.cache.get,l=o.cache.set,n=r,r(v)}function r(v){let x=a(v);if(x)return x;let C=It(v,o);return l(v,C),C}return function(){return n(zt.apply(null,arguments))}}var b=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Be=/^\[(?:([a-z-]+):)?(.+)\]$/T,Lt=/^\d+\/\d+$/,Et=new Set(["px","full","screen"]),Bt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|T|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Gt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ut=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,L=e=>J(e)||Et.has(e)||Lt.test(e),B=e=>$(e,"length",Zt),J=e=>!!e&&!Number.isNaN(Number(e)),ge=e=>$(e,"number",J),K=e=>!!e&&Number.isInteger(Number(e)),Ht=e=>e.endsWith("%")&&J(e.slice(0,-1)),d=e=>Be.test(e),V=e=>Bt.test(e),jt=new Set(["length","size","percentage"]),Ft=e=>$(e,jt,Ve),Ot=e=>$(e,"position",Ve),_t=new Set(["image","url"]),Jt=e=>$(e,_t,qt),$t=e=>$(e,"",Qt),Y=()=>!0,$=(e,t,o)=>{let a=Be.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Zt=e=>Vt.test(e)&&!Gt.test(e),Ve=()=>!1,Qt=e=>Wt.test(e),qt=e=>Ut.test(e);var Xt=()=>{let e=b("colors"),t=b("spacing"),o=b("blur"),a=b("brightness"),l=b("borderColor"),n=b("borderRadius"),c=b("borderSpacing"),r=b("borderWidth"),v=b("contrast"),x=b("grayscale"),C=b("hueRotate"),k=b("invert"),N=b("gap"),R=b("gradientColorStops"),h=b("gradientColorStopPositions"),w=b("inset"),g=b("margin"),P=b("opacity"),D=b("padding"),E=b("saturate"),z=b("scale"),j=b("sepia"),Z=b("skew"),Q=b("space"),q=b("translate"),_=()=>["auto","contain","none"],s=()=>["auto","hidden","clip","visible","scroll"],p=()=>["auto",d,t],f=()=>[d,t],ie=()=>["",L,B],se=()=>["auto",J,d],De=()=>["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"],X=()=>["","0",d],Ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[J,d];return{cacheSize:500,separator:":",theme:{colors:[Y],spacing:[L,B],blur:["none","",V,d],brightness:M(),borderColor:[e],borderRadius:["none","","full",V,d],borderSpacing:f(),borderWidth:ie(),contrast:M(),grayscale:X(),hueRotate:M(),invert:X(),gap:f(),gradientColorStops:[e],gradientColorStopPositions:[Ht,B],inset:p(),margin:p(),opacity:M(),padding:f(),saturate:M(),scale:M(),sepia:X(),skew:M(),space:f(),translate:f()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[V]}],"break-after":[{"break-after":Ae()}],"break-before":[{"break-before":Ae()}],"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:[...De(),d]}],overflow:[{overflow:s()}],"overflow-x":[{"overflow-x":s()}],"overflow-T":[{"overflow-T":s()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-T":[{"overscroll-T":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-T":[{"inset-T":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",K,d]}],basis:[{basis:p()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",d]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",K,d]}],"grid-cols":[{"grid-cols":[Y]}],"col-start-end":[{col:["auto",{span:["full",K,d]},d]}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":[Y]}],"row-start-end":[{row:["auto",{span:[K,d]},d]}],"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",d]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",d]}],gap:[{gap:[N]}],"gap-x":[{"gap-x":[N]}],"gap-T":[{"gap-T":[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:[D]}],px:[{px:[D]}],py:[{py:[D]}],ps:[{ps:[D]}],T:[{T:[D]}],pt:[{pt:[D]}],pr:[{pr:[D]}],pb:[{pb:[D]}],pl:[{pl:[D]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-T":[{"space-T":[Q]}],"space-T-reverse":["space-T-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",d,t]}],"min-w":[{"min-w":[d,t,"min","max","fit"]}],"max-w":[{"max-w":[d,t,"none","full","min","max","fit","prose",{screen:[V]},V]}],h:[{h:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",V,B]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ge]}],"font-family":[{font:[Y]}],"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",d]}],"line-clamp":[{"line-clamp":["none",J,ge]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",L,d]}],"list-image":[{"list-image":["none",d]}],"list-style-type":[{list:["none","disc","decimal",d]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",L,B]}],"underline-offset":[{"underline-offset":["auto",L,d]}],"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:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",d]}],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",d]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...De(),Ot]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","T","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ft]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-T":[{"border-T":[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":[P]}],"border-style":[{border:[...ne(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-T":[{"divide-T":[r]}],"divide-T-reverse":["divide-T-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:ne()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-T":[{"border-T":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...ne()]}],"outline-offset":[{"outline-offset":[L,d]}],"outline-w":[{outline:[L,B]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[L,B]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",V,$t]}],"shadow-color":[{shadow:[Y]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",V,d]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[k]}],saturate:[{saturate:[E]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[k]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-T":[{"border-spacing-T":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",d]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-T":[{"scale-T":[z]}],rotate:[{rotate:[K,d]}],"translate-x":[{"translate-x":[q]}],"translate-T":[{"translate-T":[q]}],"skew-x":[{"skew-x":[Z]}],"skew-T":[{"skew-T":[Z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",d]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",d]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","T","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-T":[{"scroll-T":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","T","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-T":[{"touch-pan":["T","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[L,B,ge]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-T"],overscroll:["overscroll-x","overscroll-T"],inset:["inset-x","inset-T","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-T":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-T"],p:["px","py","ps","T","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-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-T"],"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-T":["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-T":["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-T","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-T","touch-pz"],"touch-x":["touch"],"touch-T":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ge=Mt(Xt);function u(...e){return Ge((0,We.clsx)(e))}var T=require("react/jsx-runtime"),He=S.Root;var Kt=S.Portal;var je=ee.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Overlay,{ref:o,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}));je.displayName=S.Overlay.displayName;var he=ee.forwardRef(({className:e,children:t,...o},a)=>(0,T.jsxs)(Kt,{children:[(0,T.jsx)(je,{}),(0,T.jsxs)(S.Content,{ref:a,className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-T-[-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,T.jsxs)(S.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,T.jsx)(Ue.X,{className:"h-4 w-4"}),(0,T.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));he.displayName=S.Content.displayName;var ye=({className:e,...t})=>(0,T.jsx)("div",{className:u("flex flex-col space-T-1.5 text-center sm:text-left",e),...t});ye.displayName="DialogHeader";var Yt=({className:e,...t})=>(0,T.jsx)("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yt.displayName="DialogFooter";var xe=ee.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Title,{ref:o,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}));xe.displayName=S.Title.displayName;var eo=ee.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Description,{ref:o,className:u("text-sm text-muted-foreground",e),...t}));eo.displayName=S.Description.displayName;var Fe=require("@radix-ui/react-slot"),Oe=require("class-variance-authority"),_e=A(require("react")),to=(0,Oe.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"}}}),te=_e.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...l},n)=>(0,T.jsx)(e?Fe.Slot:"button",{className:u(to({className:t,size:o,variant:a})),ref:n,...l}));te.displayName="Button";var $e=A(require("react"));var oe=$e.forwardRef(({className:e,type:t,...o},a)=>(0,T.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,...o}));oe.displayName="Input";var Qe=A(require("react")),we=A(require("@radix-ui/react-label"));var oo=(0,Oe.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),G=Qe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(we.Root,{ref:o,className:u(oo(),e),...t}));G.displayName=we.Root.displayName;var Ke=A(require("react")),Se=Ke.forwardRef(({className:e,...t},o)=>(0,T.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:o,...t}));Se.displayName="Textarea";var m=A(require("@radix-ui/react-select")),W=A(require("react")),Ce=m.Root;var Pe=m.Value,ce=W.forwardRef(({children:e,className:t,...o},a)=>(0,T.jsxs)(m.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,...o,children:[e,(0,T.jsx)(m.Icon,{asChild:!0,children:(0,T.jsx)(Ue.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ce.displayName=m.Trigger.displayName;var et=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.ScrollUpButton,{className:u("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(Ue.ChevronUp,{className:"h-4 w-4"})}));et.displayName=m.ScrollUpButton.displayName;var tt=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.ScrollDownButton,{className:u("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(Ue.ChevronDown,{className:"h-4 w-4"})}));tt.displayName=m.ScrollDownButton.displayName;var de=W.forwardRef(({children:e,className:t,position:o="popper",...a},l)=>(0,T.jsx)(m.Portal,{children:(0,T.jsxs)(m.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",o==="popper"&&"data-[side=bottom]:translate-T-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-T-1",t),position:o,ref:l,...a,children:[(0,T.jsx)(et,{}),(0,T.jsx)(m.Viewport,{className:u("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,T.jsx)(tt,{})]})}));de.displayName=m.Content.displayName;var ro=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.Label,{className:u("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));ro.displayName=m.Label.displayName;var me=W.forwardRef(({children:e,className:t,...o},a)=>(0,T.jsxs)(m.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,...o,children:[(0,T.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,T.jsx)(m.ItemIndicator,{children:(0,T.jsx)(Ue.Check,{className:"h-4 w-4"})})}),(0,T.jsx)(m.ItemText,{children:e})]}));me.displayName=m.Item.displayName;var ao=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.Separator,{className:u("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));ao.displayName=m.Separator.displayName;var re=A(require("@radix-ui/react-checkbox")),rt=A(require("react")),Re=rt.forwardRef(({className:e,...t},o)=>(0,T.jsx)(re.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:o,...t,children:(0,T.jsx)(re.Indicator,{className:u("flex items-center justify-center text-current"),children:(0,T.jsx)(Ue.Check,{className:"h-4 w-4"})})}));Re.displayName=re.Root.displayName;var io=(0,Oe.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 it({className:e,variant:t,...o}){return(0,T.jsx)("div",{className:u(io({variant:t}),e),...o})}var Ne=A(require("react")),I=A(require("@radix-ui/react-scroll-area"));var ue=Ne.forwardRef(({className:e,children:t,...o},a)=>(0,T.jsxs)(I.Root,{ref:a,className:u("relative overflow-hidden",e),...o,children:[(0,T.jsx)(I.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,T.jsx)(nt,{}),(0,T.jsx)(I.Corner,{})]}));ue.displayName=I.Root.displayName;var nt=Ne.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,T.jsx)(I.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),...o,children:(0,T.jsx)(I.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));nt.displayName=I.ScrollAreaScrollbar.displayName;function lt({deal:e,users:t,customer:o,categories:a,onClose:l,onSave:n,onAddComment:c}){var j,Z,Q,q,_;let[r,v]=(0,O.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[x,C]=(0,O.useState)(""),[k,N]=(0,O.useState)(!1),[R,h]=(0,O.useState)(null);(0,O.useEffect)(()=>{N(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let w=async()=>{try{let s=await n(r);s.success?(N(!1),h(null)):console.error("Failed to save deal:",s.errors)}catch(s){console.error("Failed to save deal:",s)}},g=(s,p)=>{v(f=>({...f,[s]:p}))},P=s=>{let p=(r.categories||[]).includes(s)?(r.categories||[]).filter(f=>f!==s):[...r.categories||[],s];g("categories",p)},D=async()=>{if(x.trim()){let s={text:x,timestamp:new Date().toISOString()};try{let p=await c(s);if(!p.success){console.error("Failed to add comment:",p.errors);return}}catch(p){console.error("Failed to add comment:",p)}v(p=>({...p,comments:[...p.comments||[],s]})),C("")}},E=s=>{switch(s){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},z=s=>t==null?void 0:t.find(p=>p.id===Number(s));return(0,T.jsx)(He,{open:!0,children:(0,T.jsxs)(he,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,T.jsxs)(ye,{className:"flex flex-row items-center justify-between",children:[(0,T.jsx)(xe,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,T.jsxs)("div",{className:"flex space-x-2",children:[(0,T.jsx)(te,{variant:"outline",onClick:l,children:"Close"}),(0,T.jsxs)(te,{onClick:w,disabled:!k,children:[(0,T.jsx)(Ue.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,T.jsxs)(ue,{className:"flex-grow pr-4",children:[(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,T.jsx)("div",{className:"grid gap-2",children:R==="value"?(0,T.jsx)(oe,{type:"number",value:r.value,onChange:s=>g("value",Number(s.target.value)),onBlur:()=>h(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,T.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>h("value"),children:["\xA3",(j=r.value)==null?void 0:j.toLocaleString()]})}),(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),R==="assignee"?(0,T.jsxs)(Ce,{value:((Q=(Z=r==null?void 0:r.assignee)==null?void 0:Z.id)==null?void 0:Q.toString())||"",onValueChange:s=>g("assignee",z(s)),children:[(0,T.jsx)(ce,{children:(0,T.jsx)(Pe,{placeholder:"Select assignee"})}),(0,T.jsx)(de,{children:t&&t.map(s=>{var p;return(0,T.jsx)(me,{value:((p=s==null?void 0:s.id)==null?void 0:p.toString())||"",children:s.name},s.id)})})]}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>h("assignee"),children:[(0,T.jsx)(Ue.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:r.assignee.name})]})]}),(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),R==="closureDate"?(0,T.jsx)(oe,{type:"date",value:(_=(q=r.closureDate)==null?void 0:q.split("T")[0])!=null?_:"",onChange:s=>g("closureDate",s.target.value),onBlur:()=>h(null),autoFocus:!0}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>h("closureDate"),children:[(0,T.jsx)(Ue.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:r.closureDate?new Date(r.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,T.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-gray-500",children:"Description"}),R==="description"?(0,T.jsx)(Se,{value:r.description||"",onChange:s=>g("description",s.target.value),onBlur:()=>h(null),className:"min-h-[100px]",autoFocus:!0}):(0,T.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>h("description"),children:r.description})]})}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-gray-500",children:"Status"}),R==="status"?(0,T.jsxs)(Ce,{value:r.status,onValueChange:s=>{g("status",s),h(null)},children:[(0,T.jsx)(ce,{children:(0,T.jsx)(Pe,{placeholder:"Select status"})}),(0,T.jsx)(de,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(s=>(0,T.jsx)(me,{value:s,children:s},s))})]}):(0,T.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>h("status"),children:r.status})]}),(0,T.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-gray-500",children:"Categories"}),R==="categories"?(0,T.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(s=>{var p,f;return(0,T.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,T.jsx)(Re,{id:((p=s.id)==null?void 0:p.toString())||"",checked:(r.categories||[]).some(ie=>ie.id===s.id),onCheckedChange:()=>s.id!==void 0&&P(s)}),(0,T.jsx)("label",{htmlFor:((f=s.id)!=null?f:"").toString(),className:`text-sm font-medium ${E(s.type||"sector")} px-2 py-1 rounded`,children:s.name})]},s.id)})}):(0,T.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>h("categories"),children:r.categories&&r.categories.map(s=>{let p=s;return p?(0,T.jsx)(it,{variant:"secondary",className:E(p.type||"sector"),children:p.name},p.id):null})})]})]}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,T.jsx)(ue,{className:"h-[200px] overflow-T-auto",children:(0,T.jsx)("div",{className:"space-T-2",children:r.comments&&r.comments.slice().sort((s,p)=>new Date(p.timestamp||"").getTime()-new Date(s.timestamp||"").getTime()).map(s=>{var p;return(0,T.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,T.jsx)("p",{className:"text-sm text-gray-700",children:s.text}),(0,T.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[(p=s==null?void 0:s.author)==null?void 0:p.name," - ",new Date(s.timestamp||"").toLocaleString()]})]},s.id)})})}),(0,T.jsxs)("div",{className:"flex mt-2",children:[(0,T.jsx)(oe,{value:x,onChange:s=>C(s.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,T.jsxs)(te,{onClick:D,className:"ml-2",children:[(0,T.jsx)(Ue.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,T.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.updatedAt||"").toLocaleString()]})]})]})]})})}var so=[{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"}],ct=[{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"}],ae=[{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"}],Xo=[{id:1,customer:so[0],value:5e4,assignee:ae[2],status:"Qualified",categories:ct.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:ae[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:ct.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:ae[1],timestamp:"2023-02-15T09:00:00Z"}],description:"Custom hardware solution for GlobalTech"}];var no={title:"CRM/DealDetails",component:lt,parameters:{layout:"centered"},tags:["autodocs"]},lo=no,co={id:"1",name:"Acme Corp",active:!0},dt=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}],mt=e=>Array.from({length:e},(t,o)=>({id:`comment-${o+1}`,text:`This is comment number ${o+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][o%3],timestamp:new Date(Date.now()-(e-o)*24*60*60*1e3).toISOString()})),pt={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:dt.slice(0,3),dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:mt(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},ut={args:{deal:pt,customer:co,categories:dt,users:ae,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},mo={args:{...ut.args,deal:{...pt,comments:mt(100)}}};0&&(module.exports={Default,WithManyComments});
4
+ "use strict";var ft=Object.create;var le=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var bt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var yt=(e,t)=>{for(var o in t)le(e,o,{get:t[o],enumerable:!0})},Te=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of bt(t))!ht.call(e,l)&&l!==o&&le(e,l,{get:()=>t[l],enumerable:!(a=gt(t,l))||a.enumerable});return e};var A=(e,t,o)=>(o=e!=null?ft(vt(e)):{},Te(t||!e||!e.__esModule?le(o,"default",{value:e,enumerable:!0}):o,e)),xt=e=>Te(le({},"__esModule",{value:!0}),e);var po={};yt(po,{Default:()=>ut,WithManyComments:()=>mo,default:()=>lo});module.exports=xt(po);var O=require("react");var ee=A(require("react")),S=A(require("@radix-ui/react-dialog")),Ue=require("lucide-react");var We=require("clsx");var ve="-",wt=e=>{let t=Ct(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let r=c.split(ve);return r[0]===""&&r.length!==1&&r.shift(),Me(r,t)||St(c)},getConflictingClassGroupIds:(c,r)=>{let v=o[c]||[];return r&&a[c]?[...v,...a[c]]:v}}},Me=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),l=a?Me(e.slice(1),a):void 0;if(l)return l;if(t.validators.length===0)return;let s=e.join(ve);return(c=t.validators.find(({validator:r})=>r(s)))==null?void 0:c.classGroupId},Ie=/^\[(.+)\]$/,St=e=>{if(Ie.test(e)){let t=Ie.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ct=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Rt(Object.entries(e.classGroups),o).forEach(([s,c])=>{be(c,a,s,t)}),a},be=(e,t,o,a)=>{e.forEach(l=>{if(typeof l=="string"){let s=l===""?t:ze(t,l);s.classGroupId=o;return}if(typeof l=="function"){if(Pt(l)){be(l(a),t,o,a);return}t.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([s,c])=>{be(c,ze(t,s),o,a)})})},ze=(e,t)=>{let o=e;return t.split(ve).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Pt=e=>e.isThemeGetter,Rt=(e,t)=>t?e.map(([o,a])=>{let l=a.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,r])=>[t+c,r])):s);return[o,l]}):e,Nt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,l=(s,c)=>{o.set(s,c),t++,t>e&&(t=0,a=o,o=new Map)};return{get(s){let c=o.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return l(s,c),c},set(s,c){o.has(s)?o.set(s,c):l(s,c)}}},Le="!",kt=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,l=t[0],s=t.length,c=r=>{let v=[],x=0,C=0,D;for(let g=0;g<r.length;g++){let P=r[g];if(x===0){if(P===l&&(a||r.slice(g,g+s)===t)){v.push(r.slice(C,g)),C=g+s;continue}if(P==="/"){D=g;continue}}P==="["?x++:P==="]"&&x--}let N=v.length===0?r:r.substring(C),R=N.startsWith(Le),h=R?N.substring(1):N,w=D&&D>C?D-C:void 0;return{modifiers:v,hasImportantModifier:R,baseClassName:h,maybePostfixModifierPosition:w}};return o?r=>o({className:r,parseClassName:c}):c},Dt=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},At=e=>({cache:Nt(e.cacheSize),parseClassName:kt(e),...wt(e)}),Tt=/\s+/,It=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:l}=t,s=[],c=e.trim().split(Tt),r="";for(let v=c.length-1;v>=0;v-=1){let x=c[v],{modifiers:C,hasImportantModifier:D,baseClassName:N,maybePostfixModifierPosition:R}=o(x),h=!!R,w=a(h?N.substring(0,R):N);if(!w){if(!h){r=x+(r.length>0?" "+r:r);continue}if(w=a(N),!w){r=x+(r.length>0?" "+r:r);continue}h=!1}let g=Dt(C).join(":"),P=D?g+Le:g,k=P+w;if(s.includes(k))continue;s.push(k);let E=l(w,h);for(let z=0;z<E.length;++z){let j=E[z];s.push(P+j)}r=x+(r.length>0?" "+r:r)}return r};function zt(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ee(t))&&(a&&(a+=" "),a+=o);return a}var Ee=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Ee(e[a]))&&(o&&(o+=" "),o+=t);return o};function Mt(e,...t){let o,a,l,s=c;function c(v){let x=t.reduce((C,D)=>D(C),e());return o=At(x),a=o.cache.get,l=o.cache.set,s=r,r(v)}function r(v){let x=a(v);if(x)return x;let C=It(v,o);return l(v,C),C}return function(){return s(zt.apply(null,arguments))}}var b=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Be=/^\[(?:([a-z-]+):)?(.+)\]$/T,Lt=/^\d+\/\d+$/,Et=new Set(["px","full","screen"]),Bt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|T|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Gt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ut=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,L=e=>J(e)||Et.has(e)||Lt.test(e),B=e=>$(e,"length",Zt),J=e=>!!e&&!Number.isNaN(Number(e)),ge=e=>$(e,"number",J),K=e=>!!e&&Number.isInteger(Number(e)),Ht=e=>e.endsWith("%")&&J(e.slice(0,-1)),d=e=>Be.test(e),V=e=>Bt.test(e),jt=new Set(["length","size","percentage"]),Ft=e=>$(e,jt,Ve),Ot=e=>$(e,"position",Ve),_t=new Set(["image","url"]),Jt=e=>$(e,_t,qt),$t=e=>$(e,"",Qt),Y=()=>!0,$=(e,t,o)=>{let a=Be.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Zt=e=>Vt.test(e)&&!Gt.test(e),Ve=()=>!1,Qt=e=>Wt.test(e),qt=e=>Ut.test(e);var Xt=()=>{let e=b("colors"),t=b("spacing"),o=b("blur"),a=b("brightness"),l=b("borderColor"),s=b("borderRadius"),c=b("borderSpacing"),r=b("borderWidth"),v=b("contrast"),x=b("grayscale"),C=b("hueRotate"),D=b("invert"),N=b("gap"),R=b("gradientColorStops"),h=b("gradientColorStopPositions"),w=b("inset"),g=b("margin"),P=b("opacity"),k=b("padding"),E=b("saturate"),z=b("scale"),j=b("sepia"),Z=b("skew"),Q=b("space"),q=b("translate"),_=()=>["auto","contain","none"],n=()=>["auto","hidden","clip","visible","scroll"],p=()=>["auto",d,t],f=()=>[d,t],ie=()=>["",L,B],ne=()=>["auto",J,d],ke=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],se=()=>["solid","dashed","dotted","double","none"],De=()=>["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"],X=()=>["","0",d],Ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[J,d];return{cacheSize:500,separator:":",theme:{colors:[Y],spacing:[L,B],blur:["none","",V,d],brightness:M(),borderColor:[e],borderRadius:["none","","full",V,d],borderSpacing:f(),borderWidth:ie(),contrast:M(),grayscale:X(),hueRotate:M(),invert:X(),gap:f(),gradientColorStops:[e],gradientColorStopPositions:[Ht,B],inset:p(),margin:p(),opacity:M(),padding:f(),saturate:M(),scale:M(),sepia:X(),skew:M(),space:f(),translate:f()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[V]}],"break-after":[{"break-after":Ae()}],"break-before":[{"break-before":Ae()}],"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:[...ke(),d]}],overflow:[{overflow:n()}],"overflow-x":[{"overflow-x":n()}],"overflow-T":[{"overflow-T":n()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-T":[{"overscroll-T":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-T":[{"inset-T":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",K,d]}],basis:[{basis:p()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",d]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",K,d]}],"grid-cols":[{"grid-cols":[Y]}],"col-start-end":[{col:["auto",{span:["full",K,d]},d]}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":[Y]}],"row-start-end":[{row:["auto",{span:[K,d]},d]}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",d]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",d]}],gap:[{gap:[N]}],"gap-x":[{"gap-x":[N]}],"gap-T":[{"gap-T":[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:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],T:[{T:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-T":[{"space-T":[Q]}],"space-T-reverse":["space-T-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",d,t]}],"min-w":[{"min-w":[d,t,"min","max","fit"]}],"max-w":[{"max-w":[d,t,"none","full","min","max","fit","prose",{screen:[V]},V]}],h:[{h:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",V,B]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ge]}],"font-family":[{font:[Y]}],"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",d]}],"line-clamp":[{"line-clamp":["none",J,ge]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",L,d]}],"list-image":[{"list-image":["none",d]}],"list-style-type":[{list:["none","disc","decimal",d]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",L,B]}],"underline-offset":[{"underline-offset":["auto",L,d]}],"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:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",d]}],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",d]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ke(),Ot]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","T","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ft]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-T":[{"border-T":[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":[P]}],"border-style":[{border:[...se(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-T":[{"divide-T":[r]}],"divide-T-reverse":["divide-T-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:se()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-T":[{"border-T":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...se()]}],"outline-offset":[{"outline-offset":[L,d]}],"outline-w":[{outline:[L,B]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[L,B]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",V,$t]}],"shadow-color":[{shadow:[Y]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...De(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":De()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",V,d]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[D]}],saturate:[{saturate:[E]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[D]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-T":[{"border-spacing-T":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",d]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-T":[{"scale-T":[z]}],rotate:[{rotate:[K,d]}],"translate-x":[{"translate-x":[q]}],"translate-T":[{"translate-T":[q]}],"skew-x":[{"skew-x":[Z]}],"skew-T":[{"skew-T":[Z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",d]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",d]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","T","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-T":[{"scroll-T":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","T","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-T":[{"touch-pan":["T","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[L,B,ge]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-T"],overscroll:["overscroll-x","overscroll-T"],inset:["inset-x","inset-T","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-T":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-T"],p:["px","py","ps","T","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-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-T"],"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-T":["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-T":["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-T","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-T","touch-pz"],"touch-x":["touch"],"touch-T":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ge=Mt(Xt);function u(...e){return Ge((0,We.clsx)(e))}var T=require("react/jsx-runtime"),He=S.Root;var Kt=S.Portal;var je=ee.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Overlay,{ref:o,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}));je.displayName=S.Overlay.displayName;var he=ee.forwardRef(({className:e,children:t,...o},a)=>(0,T.jsxs)(Kt,{children:[(0,T.jsx)(je,{}),(0,T.jsxs)(S.Content,{ref:a,className:u("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-T-[-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,T.jsxs)(S.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,T.jsx)(Ue.X,{className:"h-4 w-4"}),(0,T.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));he.displayName=S.Content.displayName;var ye=({className:e,...t})=>(0,T.jsx)("div",{className:u("flex flex-col space-T-1.5 text-center sm:text-left",e),...t});ye.displayName="DialogHeader";var Yt=({className:e,...t})=>(0,T.jsx)("div",{className:u("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yt.displayName="DialogFooter";var xe=ee.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Title,{ref:o,className:u("text-lg font-semibold leading-none tracking-tight",e),...t}));xe.displayName=S.Title.displayName;var eo=ee.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Description,{ref:o,className:u("text-sm text-muted-foreground",e),...t}));eo.displayName=S.Description.displayName;var Fe=require("@radix-ui/react-slot"),Oe=require("class-variance-authority"),_e=A(require("react")),to=(0,Oe.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"}}}),te=_e.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...l},s)=>(0,T.jsx)(e?Fe.Slot:"button",{className:u(to({className:t,size:o,variant:a})),ref:s,...l}));te.displayName="Button";var $e=A(require("react"));var oe=$e.forwardRef(({className:e,type:t,...o},a)=>(0,T.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,...o}));oe.displayName="Input";var Qe=A(require("react")),we=A(require("@radix-ui/react-label"));var oo=(0,Oe.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),G=Qe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(we.Root,{ref:o,className:u(oo(),e),...t}));G.displayName=we.Root.displayName;var Ke=A(require("react")),Se=Ke.forwardRef(({className:e,...t},o)=>(0,T.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:o,...t}));Se.displayName="Textarea";var m=A(require("@radix-ui/react-select")),W=A(require("react")),Ce=m.Root;var Pe=m.Value,ce=W.forwardRef(({children:e,className:t,...o},a)=>(0,T.jsxs)(m.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,...o,children:[e,(0,T.jsx)(m.Icon,{asChild:!0,children:(0,T.jsx)(Ue.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ce.displayName=m.Trigger.displayName;var et=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.ScrollUpButton,{className:u("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(Ue.ChevronUp,{className:"h-4 w-4"})}));et.displayName=m.ScrollUpButton.displayName;var tt=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.ScrollDownButton,{className:u("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(Ue.ChevronDown,{className:"h-4 w-4"})}));tt.displayName=m.ScrollDownButton.displayName;var de=W.forwardRef(({children:e,className:t,position:o="popper",...a},l)=>(0,T.jsx)(m.Portal,{children:(0,T.jsxs)(m.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",o==="popper"&&"data-[side=bottom]:translate-T-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-T-1",t),position:o,ref:l,...a,children:[(0,T.jsx)(et,{}),(0,T.jsx)(m.Viewport,{className:u("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,T.jsx)(tt,{})]})}));de.displayName=m.Content.displayName;var ro=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.Label,{className:u("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));ro.displayName=m.Label.displayName;var me=W.forwardRef(({children:e,className:t,...o},a)=>(0,T.jsxs)(m.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,...o,children:[(0,T.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,T.jsx)(m.ItemIndicator,{children:(0,T.jsx)(Ue.Check,{className:"h-4 w-4"})})}),(0,T.jsx)(m.ItemText,{children:e})]}));me.displayName=m.Item.displayName;var ao=W.forwardRef(({className:e,...t},o)=>(0,T.jsx)(m.Separator,{className:u("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));ao.displayName=m.Separator.displayName;var re=A(require("@radix-ui/react-checkbox")),rt=A(require("react")),Re=rt.forwardRef(({className:e,...t},o)=>(0,T.jsx)(re.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:o,...t,children:(0,T.jsx)(re.Indicator,{className:u("flex items-center justify-center text-current"),children:(0,T.jsx)(Ue.Check,{className:"h-4 w-4"})})}));Re.displayName=re.Root.displayName;var io=(0,Oe.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 it({className:e,variant:t,...o}){return(0,T.jsx)("div",{className:u(io({variant:t}),e),...o})}var Ne=A(require("react")),I=A(require("@radix-ui/react-scroll-area"));var ue=Ne.forwardRef(({className:e,children:t,...o},a)=>(0,T.jsxs)(I.Root,{ref:a,className:u("relative overflow-hidden",e),...o,children:[(0,T.jsx)(I.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,T.jsx)(st,{}),(0,T.jsx)(I.Corner,{})]}));ue.displayName=I.Root.displayName;var st=Ne.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,T.jsx)(I.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),...o,children:(0,T.jsx)(I.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));st.displayName=I.ScrollAreaScrollbar.displayName;function lt({deal:e,users:t,customer:o,categories:a,onClose:l,onSave:s,onAddComment:c}){var j,Z,Q,q,_;let[r,v]=(0,O.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[x,C]=(0,O.useState)(""),[D,N]=(0,O.useState)(!1),[R,h]=(0,O.useState)(null);(0,O.useEffect)(()=>{N(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let w=async()=>{try{let n=await s(r);n.success?(N(!1),h(null)):console.error("Failed to save deal:",n.errors)}catch(n){console.error("Failed to save deal:",n)}},g=(n,p)=>{v(f=>({...f,[n]:p}))},P=n=>{let p=(r.categories||[]).includes(n)?(r.categories||[]).filter(f=>f!==n):[...r.categories||[],n];g("categories",p)},k=async()=>{if(x.trim()){let n={text:x,timestamp:new Date().toISOString()};try{let p=await c(n);if(!p.success){console.error("Failed to add comment:",p.errors);return}}catch(p){console.error("Failed to add comment:",p)}v(p=>({...p,comments:[...p.comments||[],n]})),C("")}},E=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"}},z=n=>t==null?void 0:t.find(p=>p.id===Number(n));return(0,T.jsx)(He,{open:!0,children:(0,T.jsxs)(he,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,T.jsxs)(ye,{className:"flex flex-row items-center justify-between",children:[(0,T.jsx)(xe,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,T.jsxs)("div",{className:"flex space-x-2",children:[(0,T.jsx)(te,{variant:"outline",onClick:l,children:"Close"}),(0,T.jsxs)(te,{onClick:w,disabled:!D,children:[(0,T.jsx)(Ue.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,T.jsxs)(ue,{className:"flex-grow pr-4",children:[(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,T.jsx)("div",{className:"grid gap-2 m-1",children:R==="value"?(0,T.jsx)(oe,{type:"number",value:r.value,onChange:n=>g("value",Number(n.target.value)),onBlur:()=>h(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,T.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("value"),children:["\xA3",(j=r.value)==null?void 0:j.toLocaleString()]})}),(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Assignee"}),R==="assignee"?(0,T.jsxs)(Ce,{value:((Q=(Z=r==null?void 0:r.assignee)==null?void 0:Z.id)==null?void 0:Q.toString())||"",onValueChange:n=>g("assignee",z(n)),children:[(0,T.jsx)(ce,{children:(0,T.jsx)(Pe,{placeholder:"Select assignee"})}),(0,T.jsx)(de,{children:t&&t.map(n=>{var p;return(0,T.jsx)(me,{value:((p=n==null?void 0:n.id)==null?void 0:p.toString())||"",children:n.name},n.id)})})]}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("assignee"),children:[(0,T.jsx)(Ue.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:r.assignee.name})]})]}),(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Closure Date"}),R==="closureDate"?(0,T.jsx)(oe,{type:"date",value:(_=(q=r.closureDate)==null?void 0:q.split("T")[0])!=null?_:"",onChange:n=>g("closureDate",n.target.value),onBlur:()=>h(null),className:"mr-2",autoFocus:!0}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("closureDate"),children:[(0,T.jsx)(Ue.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:r.closureDate?new Date(r.closureDate).toLocaleDateString("en-GB"):"N/A"})]})]})]}),(0,T.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Description"}),R==="description"?(0,T.jsx)(Se,{value:r.description||"",onChange:n=>g("description",n.target.value),onBlur:()=>h(null),className:"min-h-[100px]",autoFocus:!0}):(0,T.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>h("description"),children:r.description})]})}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Status"}),R==="status"?(0,T.jsxs)(Ce,{value:r.status,onValueChange:n=>{g("status",n),h(null)},children:[(0,T.jsx)(ce,{children:(0,T.jsx)(Pe,{placeholder:"Select status"})}),(0,T.jsx)(de,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(n=>(0,T.jsx)(me,{value:n,children:n},n))})]}):(0,T.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("status"),children:r.status})]}),(0,T.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Categories"}),R==="categories"?(0,T.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(n=>{var p,f;return(0,T.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,T.jsx)(Re,{id:((p=n.id)==null?void 0:p.toString())||"",checked:(r.categories||[]).some(ie=>ie.id===n.id),onCheckedChange:()=>n.id!==void 0&&P(n)}),(0,T.jsx)("label",{htmlFor:((f=n.id)!=null?f:"").toString(),className:`text-sm font-medium ${E(n.type||"sector")} px-2 py-1 rounded`,children:n.name})]},n.id)})}):(0,T.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("categories"),children:r.categories&&r.categories.map(n=>{let p=n;return p?(0,T.jsx)(it,{variant:"outline",className:E(p.type||"sector"),children:p.name},p.id):null})})]})]}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(G,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,T.jsx)(ue,{className:"h-[200px] overflow-T-auto",children:(0,T.jsx)("div",{className:"space-T-2",children:r.comments&&r.comments.slice().sort((n,p)=>new Date(p.timestamp||"").getTime()-new Date(n.timestamp||"").getTime()).map(n=>{var p;return(0,T.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,T.jsx)("p",{className:"text-sm text-foreground",children:n.text}),(0,T.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[(p=n==null?void 0:n.author)==null?void 0:p.name," - ",new Date(n.timestamp||"").toLocaleString()]})]},n.id)})})}),(0,T.jsxs)("div",{className:"flex mt-2",children:[(0,T.jsx)(oe,{value:x,onChange:n=>C(n.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,T.jsxs)(te,{onClick:k,className:"ml-2",children:[(0,T.jsx)(Ue.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,T.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.updatedAt||"").toLocaleString()]})]})]})]})})}var no=[{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"}],ct=[{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"}],ae=[{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"}],Xo=[{id:1,customer:no[0],value:5e4,assignee:ae[2],status:"Qualified",categories:ct.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:ae[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:ct.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:ae[1],timestamp:"2023-02-15T09:00:00Z"}],description:"Custom hardware solution for GlobalTech"}];var so={title:"CRM/DealDetails",component:lt,parameters:{layout:"centered"},tags:["autodocs"]},lo=so,co={id:"1",name:"Acme Corp",active:!0},dt=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}],mt=e=>Array.from({length:e},(t,o)=>({id:`comment-${o+1}`,text:`This is comment number ${o+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][o%3],timestamp:new Date(Date.now()-(e-o)*24*60*60*1e3).toISOString()})),pt={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:dt.slice(0,3),dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:mt(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},ut={args:{deal:pt,customer:co,categories:dt,users:ae,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},mo={args:{...ut.args,deal:{...pt,comments:mt(100)}}};0&&(module.exports={Default,WithManyComments});
@@ -1 +1 @@
1
- import{c as a}from"../../chunk-TLBLUYXL.mjs";import{a as t}from"../../chunk-6YWAX7NS.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";var n={title:"CRM/DealDetails",component:t,parameters:{layout:"centered"},tags:["autodocs"]},u=n,i={id:"1",name:"Acme Corp",active:!0},r=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}],s=e=>Array.from({length:e},(l,o)=>({id:`comment-${o+1}`,text:`This is comment number ${o+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][o%3],timestamp:new Date(Date.now()-(e-o)*24*60*60*1e3).toISOString()})),m={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:r.slice(0,3),dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:s(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},c={args:{deal:m,customer:i,categories:r,users:a,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},D={args:{...c.args,deal:{...m,comments:s(100)}}};export{c as Default,D as WithManyComments,u as default};
1
+ import{c as a}from"../../chunk-TLBLUYXL.mjs";import{a as t}from"../../chunk-KUJXSGYS.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";var n={title:"CRM/DealDetails",component:t,parameters:{layout:"centered"},tags:["autodocs"]},u=n,i={id:"1",name:"Acme Corp",active:!0},r=[{id:"1",name:"Software",type:"proposition"},{id:"2",name:"Hardware",type:"proposition"},{id:"3",name:"Referral",type:"source"},{id:"4",name:"Outbound",type:"source"},{id:"5",name:"Tech",type:"sector"},{id:"6",name:"Finance",type:"sector"}],s=e=>Array.from({length:e},(l,o)=>({id:`comment-${o+1}`,text:`This is comment number ${o+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][o%3],timestamp:new Date(Date.now()-(e-o)*24*60*60*1e3).toISOString()})),m={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:r.slice(0,3),dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:s(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},c={args:{deal:m,customer:i,categories:r,users:a,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},D={args:{...c.args,deal:{...m,comments:s(100)}}};export{c as Default,D as WithManyComments,u as default};
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
  "use strict";
3
3
 
4
- "use strict";"use client";var Mt=Object.create;var Re=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Vt=(e,t)=>{for(var r in t)Re(e,r,{get:t[r],enumerable:!0})},Ke=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zt(t))!Ht.call(e,i)&&i!==r&&Re(e,i,{get:()=>t[i],enumerable:!(a=Et(t,i))||a.enumerable});return e};var H=(e,t,r)=>(r=e!=null?Mt(Bt(e)):{},Ke(t||!e||!e.__esModule?Re(r,"default",{value:e,enumerable:!0}):r,e)),Ft=e=>Ke(Re({},"__esModule",{value:!0}),e);var Ar={};Vt(Ar,{CRMKanbanBoard:()=>kr});module.exports=Ft(Ar);var Ie=require("react");var we=H(require("react")),L=H(require("@radix-ui/react-dialog")),rt=require("lucide-react");var tt=require("clsx");var Be="-",Wt=e=>{let t=Gt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let o=c.split(Be);return o[0]===""&&o.length!==1&&o.shift(),Je(o,t)||Ut(c)},getConflictingClassGroupIds:(c,o)=>{let v=r[c]||[];return o&&a[c]?[...v,...a[c]]:v}}},Je=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),i=a?Je(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let s=e.join(Be);return(c=t.validators.find(({validator:o})=>o(s)))==null?void 0:c.classGroupId},$e=/^\[(.+)\]$/,Ut=e=>{if($e.test(e)){let t=$e.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Gt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return _t(Object.entries(e.classGroups),r).forEach(([s,c])=>{ze(c,a,s,t)}),a},ze=(e,t,r,a)=>{e.forEach(i=>{if(typeof i=="string"){let s=i===""?t:qe(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(Ot(i)){ze(i(a),t,r,a);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,c])=>{ze(c,qe(t,s),r,a)})})},qe=(e,t)=>{let r=e;return t.split(Be).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Ot=e=>e.isThemeGetter,_t=(e,t)=>t?e.map(([r,a])=>{let i=a.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,o])=>[t+c,o])):s);return[r,i]}):e,jt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,i=(s,c)=>{r.set(s,c),t++,t>e&&(t=0,a=r,r=new Map)};return{get(s){let c=r.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return i(s,c),c},set(s,c){r.has(s)?r.set(s,c):i(s,c)}}},Qe="!",Kt=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,i=t[0],s=t.length,c=o=>{let v=[],P=0,D=0,N;for(let x=0;x<o.length;x++){let k=o[x];if(P===0){if(k===i&&(a||o.slice(x,x+s)===t)){v.push(o.slice(D,x)),D=x+s;continue}if(k==="/"){N=x;continue}}k==="["?P++:k==="]"&&P--}let p=v.length===0?o:o.substring(D),g=p.startsWith(Qe),b=g?p.substring(1):p,w=N&&N>D?N-D:void 0;return{modifiers:v,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:w}};return r?o=>r({className:o,parseClassName:c}):c},$t=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},qt=e=>({cache:jt(e.cacheSize),parseClassName:Kt(e),...Wt(e)}),Jt=/\s+/,Qt=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:i}=t,s=[],c=e.trim().split(Jt),o="";for(let v=c.length-1;v>=0;v-=1){let P=c[v],{modifiers:D,hasImportantModifier:N,baseClassName:p,maybePostfixModifierPosition:g}=r(P),b=!!g,w=a(b?p.substring(0,g):p);if(!w){if(!b){o=P+(o.length>0?" "+o:o);continue}if(w=a(p),!w){o=P+(o.length>0?" "+o:o);continue}b=!1}let x=$t(D).join(":"),k=N?x+Qe:x,E=k+w;if(s.includes(E))continue;s.push(E);let B=i(w,b);for(let z=0;z<B.length;++z){let W=B[z];s.push(k+W)}o=P+(o.length>0?" "+o:o)}return o};function Xt(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Xe(t))&&(a&&(a+=" "),a+=r);return a}var Xe=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(e[a]))&&(r&&(r+=" "),r+=t);return r};function Zt(e,...t){let r,a,i,s=c;function c(v){let P=t.reduce((D,N)=>N(D),e());return r=qt(P),a=r.cache.get,i=r.cache.set,s=o,o(v)}function o(v){let P=a(v);if(P)return P;let D=Qt(v,r);return i(v,D),D}return function(){return s(Xt.apply(null,arguments))}}var R=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ze=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yt=/^\V+\/\V+$/,er=new Set(["px","full","screen"]),tr=/^(\V+(\.\V+)?)?(xs|sm|md|lg|xl)$/,rr=/\V+(%|px|r?em|[sdl]?v([hwib]|min|max)|it|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,or=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ar=/^(inset_)?-?((\V+)?\.?(\V+)[a-z]+|0)_-?((\V+)?\.?(\V+)[a-z]+|0)/,sr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,K=e=>pe(e)||er.has(e)||Yt.test(e),q=e=>ue(e,"length",ur),pe=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>ue(e,"number",pe),xe=e=>!!e&&Number.isInteger(Number(e)),ir=e=>e.endsWith("%")&&pe(e.slice(0,-1)),u=e=>Ze.test(e),J=e=>tr.test(e),nr=new Set(["length","size","percentage"]),lr=e=>ue(e,nr,Ye),cr=e=>ue(e,"position",Ye),dr=new Set(["image","url"]),mr=e=>ue(e,dr,gr),pr=e=>ue(e,"",fr),Ce=()=>!0,ue=(e,t,r)=>{let a=Ze.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},ur=e=>rr.test(e)&&!or.test(e),Ye=()=>!1,fr=e=>ar.test(e),gr=e=>sr.test(e);var br=()=>{let e=R("colors"),t=R("spacing"),r=R("blur"),a=R("brightness"),i=R("borderColor"),s=R("borderRadius"),c=R("borderSpacing"),o=R("borderWidth"),v=R("contrast"),P=R("grayscale"),D=R("hueRotate"),N=R("invert"),p=R("gap"),g=R("gradientColorStops"),b=R("gradientColorStopPositions"),w=R("inset"),x=R("margin"),k=R("opacity"),E=R("padding"),B=R("saturate"),z=R("scale"),W=R("sepia"),$=R("skew"),m=R("space"),h=R("translate"),O=()=>["auto","contain","none"],l=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto",u,t],S=()=>[u,t],Ne=()=>["",K,q],Pe=()=>["auto",pe,u],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],De=()=>["solid","dashed","dotted","double","none"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Me=()=>["start","end","center","between","around","evenly","stretch"],ye=()=>["","0",u],je=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[pe,u];return{cacheSize:500,separator:":",theme:{colors:[Ce],spacing:[K,q],blur:["none","",J,u],brightness:j(),borderColor:[e],borderRadius:["none","","full",J,u],borderSpacing:S(),borderWidth:Ne(),contrast:j(),grayscale:ye(),hueRotate:j(),invert:ye(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[ir,q],inset:C(),margin:C(),opacity:j(),padding:S(),saturate:j(),scale:j(),sepia:ye(),skew:j(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":je()}],"break-before":[{"break-before":je()}],"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:[...Oe(),u]}],overflow:[{overflow:l()}],"overflow-x":[{"overflow-x":l()}],"overflow-y":[{"overflow-y":l()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xe,u]}],basis:[{basis:C()}],"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:ye()}],shrink:[{shrink:ye()}],order:[{order:["first","last","none",xe,u]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",xe,u]},u]}],"col-start":[{"col-start":Pe()}],"col-end":[{"col-end":Pe()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[xe,u]},u]}],"row-start":[{"row-start":Pe()}],"row-end":[{"row-end":Pe()}],"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:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Me(),"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]}],it:[{it:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],V:[{V:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[m]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[m]}],"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:[J]},J]}],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",J,q]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ee]}],"font-family":[{font:[Ce]}],"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",pe,Ee]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",K,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":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",K,q]}],"underline-offset":[{"underline-offset":["auto",K,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:S()}],"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":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),cr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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":[k]}],"border-style":[{border:[...De(),"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":[k]}],"divide-style":[{divide:De()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...De()]}],"outline-offset":[{"outline-offset":[K,u]}],"outline-w":[{outline:[K,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[K,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",J,pr]}],"shadow-color":[{shadow:[Ce]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[..._e(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_e()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",J,u]}],grayscale:[{grayscale:[P]}],"hue-rotate":[{"hue-rotate":[D]}],invert:[{invert:[N]}],saturate:[{saturate:[B]}],sepia:[{sepia:[W]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[D]}],"backdrop-invert":[{"backdrop-invert":[N]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[B]}],"backdrop-sepia":[{"backdrop-sepia":[W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[xe,u]}],"translate-x":[{"translate-x":[h]}],"translate-y":[{"translate-y":[h]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"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","V-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",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":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-V":[{"scroll-V":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-it":[{"scroll-it":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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:[K,q,Ee]}],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","it","pr","pb","pl"],px:["pr","pl"],py:["it","pb"],m:["mx","my","ms","V","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-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-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-V","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-it","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-it","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Zt(br);function f(...e){return et((0,tt.clsx)(e))}var V=require("react/jsx-runtime"),fe=L.Root,ot=L.Trigger,vr=L.Portal;var at=we.forwardRef(({className:e,...t},r)=>(0,V.jsx)(L.Overlay,{ref:r,className:f("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}));at.displayName=L.Overlay.displayName;var Y=we.forwardRef(({className:e,children:t,...r},a)=>(0,V.jsxs)(vr,{children:[(0,V.jsx)(at,{}),(0,V.jsxs)(L.Content,{ref:a,className:f("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,V.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,V.jsx)(rt.V,{className:"h-4 w-4"}),(0,V.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Y.displayName=L.Content.displayName;var ee=({className:e,...t})=>(0,V.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ee.displayName="DialogHeader";var hr=({className:e,...t})=>(0,V.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hr.displayName="DialogFooter";var te=we.forwardRef(({className:e,...t},r)=>(0,V.jsx)(L.Title,{ref:r,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));te.displayName=L.Title.displayName;var yr=we.forwardRef(({className:e,...t},r)=>(0,V.jsx)(L.Description,{ref:r,className:f("text-sm text-muted-foreground",e),...t}));yr.displayName=L.Description.displayName;var st=require("@radix-ui/react-slot"),it=require("class-variance-authority"),nt=H(require("react")),xr=(0,it.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"}}}),U=nt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...i},s)=>(0,V.jsx)(e?st.Slot:"button",{className:f(xr({className:t,size:r,variant:a})),ref:s,...i}));U.displayName="Button";var ct=H(require("react"));var _=ct.forwardRef(({className:e,type:t,...r},a)=>(0,V.jsx)("input",{type:t,className:f("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}));_.displayName="Input";var mt=H(require("react")),He=H(require("@radix-ui/react-label"));var Cr=(0,it.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=mt.forwardRef(({className:e,...t},r)=>(0,V.jsx)(He.Root,{ref:r,className:f(Cr(),e),...t}));M.displayName=He.Root.displayName;var ft=H(require("react")),re=ft.forwardRef(({className:e,...t},r)=>(0,V.jsx)("textarea",{className:f("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}));re.displayName="Textarea";var y=H(require("@radix-ui/react-select")),Q=H(require("react")),ge=y.Root;var be=y.Value,ae=Q.forwardRef(({children:e,className:t,...r},a)=>(0,V.jsxs)(y.Trigger,{className:f("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,V.jsx)(y.Icon,{asChild:!0,children:(0,V.jsx)(rt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ae.displayName=y.Trigger.displayName;var bt=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,V.jsx)(rt.ChevronUp,{className:"h-4 w-4"})}));bt.displayName=y.ScrollUpButton.displayName;var vt=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,V.jsx)(rt.ChevronDown,{className:"h-4 w-4"})}));vt.displayName=y.ScrollDownButton.displayName;var se=Q.forwardRef(({children:e,className:t,position:r="popper",...a},i)=>(0,V.jsx)(y.Portal,{children:(0,V.jsxs)(y.Content,{className:f("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:i,...a,children:[(0,V.jsx)(bt,{}),(0,V.jsx)(y.Viewport,{className:f("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,V.jsx)(vt,{})]})}));se.displayName=y.Content.displayName;var wr=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));wr.displayName=y.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...r},a)=>(0,V.jsxs)(y.Item,{className:f("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,V.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,V.jsx)(y.ItemIndicator,{children:(0,V.jsx)(rt.Check,{className:"h-4 w-4"})})}),(0,V.jsx)(y.ItemText,{children:e})]}));ie.displayName=y.Item.displayName;var Sr=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(y.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Sr.displayName=y.Separator.displayName;var Se=H(require("@radix-ui/react-checkbox")),yt=H(require("react")),ne=yt.forwardRef(({className:e,...t},r)=>(0,V.jsx)(Se.Root,{className:f("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,V.jsx)(Se.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,V.jsx)(rt.Check,{className:"h-4 w-4"})})}));ne.displayName=Se.Root.displayName;var Nr=(0,it.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,...r}){return(0,V.jsx)("div",{className:f(Nr({variant:t}),e),...r})}var Ve=H(require("react")),G=H(require("@radix-ui/react-scroll-area"));var ve=Ve.forwardRef(({className:e,children:t,...r},a)=>(0,V.jsxs)(G.Root,{ref:a,className:f("relative overflow-hidden",e),...r,children:[(0,V.jsx)(G.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,V.jsx)(wt,{}),(0,V.jsx)(G.Corner,{})]}));ve.displayName=G.Root.displayName;var wt=Ve.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,V.jsx)(G.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("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,V.jsx)(G.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=G.ScrollAreaScrollbar.displayName;function St({deal:e,users:t,customer:r,categories:a,onClose:i,onSave:s,onAddComment:c}){var W,$,m,h,O;let[o,v]=(0,Ie.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[P,D]=(0,Ie.useState)(""),[N,p]=(0,Ie.useState)(!1),[g,b]=(0,Ie.useState)(null);(0,Ie.useEffect)(()=>{p(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let w=async()=>{try{let l=await s(o);l.success?(p(!1),b(null)):console.error("Failed to save deal:",l.errors)}catch(l){console.error("Failed to save deal:",l)}},x=(l,C)=>{v(S=>({...S,[l]:C}))},k=l=>{let C=(o.categories||[]).includes(l)?(o.categories||[]).filter(S=>S!==l):[...o.categories||[],l];x("categories",C)},E=async()=>{if(P.trim()){let l={text:P,timestamp:new Date().toISOString()};try{let C=await c(l);if(!C.success){console.error("Failed to add comment:",C.errors);return}}catch(C){console.error("Failed to add comment:",C)}v(C=>({...C,comments:[...C.comments||[],l]})),D("")}},B=l=>{switch(l){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},z=l=>t==null?void 0:t.find(C=>C.id===Number(l));return(0,V.jsx)(fe,{open:!0,children:(0,V.jsxs)(Y,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,V.jsxs)(ee,{className:"flex flex-row items-center justify-between",children:[(0,V.jsx)(te,{className:"text-2xl font-bold",children:r==null?void 0:r.name}),(0,V.jsxs)("div",{className:"flex space-x-2",children:[(0,V.jsx)(U,{variant:"outline",onClick:i,children:"Close"}),(0,V.jsxs)(U,{onClick:w,disabled:!N,children:[(0,V.jsx)(rt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,V.jsxs)(ve,{className:"flex-grow pr-4",children:[(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,V.jsx)("div",{className:"grid gap-2",children:g==="value"?(0,V.jsx)(_,{type:"number",value:o.value,onChange:l=>x("value",Number(l.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,V.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>b("value"),children:["\xA3",(W=o.value)==null?void 0:W.toLocaleString()]})}),(0,V.jsxs)("div",{className:"grid gap-2",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),g==="assignee"?(0,V.jsxs)(ge,{value:((m=($=o==null?void 0:o.assignee)==null?void 0:$.id)==null?void 0:m.toString())||"",onValueChange:l=>x("assignee",z(l)),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(be,{placeholder:"Select assignee"})}),(0,V.jsx)(se,{children:t&&t.map(l=>{var C;return(0,V.jsx)(ie,{value:((C=l==null?void 0:l.id)==null?void 0:C.toString())||"",children:l.name},l.id)})})]}):(0,V.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>b("assignee"),children:[(0,V.jsx)(rt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,V.jsx)("span",{children:o.assignee.name})]})]}),(0,V.jsxs)("div",{className:"grid gap-2",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),g==="closureDate"?(0,V.jsx)(_,{type:"date",value:(O=(h=o.closureDate)==null?void 0:h.split("V")[0])!=null?O:"",onChange:l=>x("closureDate",l.target.value),onBlur:()=>b(null),autoFocus:!0}):(0,V.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>b("closureDate"),children:[(0,V.jsx)(rt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,V.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/V"})]})]})]}),(0,V.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,V.jsxs)("div",{className:"grid gap-2",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-gray-500",children:"Description"}),g==="description"?(0,V.jsx)(re,{value:o.description||"",onChange:l=>x("description",l.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,V.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>b("description"),children:o.description})]})}),(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 it-2 gap-4",children:[(0,V.jsxs)("div",{className:"grid gap-2",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-gray-500",children:"Status"}),g==="status"?(0,V.jsxs)(ge,{value:o.status,onValueChange:l=>{x("status",l),b(null)},children:[(0,V.jsx)(ae,{children:(0,V.jsx)(be,{placeholder:"Select status"})}),(0,V.jsx)(se,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(l=>(0,V.jsx)(ie,{value:l,children:l},l))})]}):(0,V.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>b("status"),children:o.status})]}),(0,V.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-gray-500",children:"Categories"}),g==="categories"?(0,V.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(l=>{var C,S;return(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:((C=l.id)==null?void 0:C.toString())||"",checked:(o.categories||[]).some(Ne=>Ne.id===l.id),onCheckedChange:()=>l.id!==void 0&&k(l)}),(0,V.jsx)("label",{htmlFor:((S=l.id)!=null?S:"").toString(),className:`text-sm font-medium ${B(l.type||"sector")} px-2 py-1 rounded`,children:l.name})]},l.id)})}):(0,V.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>b("categories"),children:o.categories&&o.categories.map(l=>{let C=l;return C?(0,V.jsx)(Ae,{variant:"secondary",className:B(C.type||"sector"),children:C.name},C.id):null})})]})]}),(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 it-4 gap-4",children:[(0,V.jsxs)("div",{className:"grid gap-2",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,V.jsx)(ve,{className:"h-[200px] overflow-y-auto",children:(0,V.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((l,C)=>new Date(C.timestamp||"").getTime()-new Date(l.timestamp||"").getTime()).map(l=>{var C;return(0,V.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,V.jsx)("p",{className:"text-sm text-gray-700",children:l.text}),(0,V.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[(C=l==null?void 0:l.author)==null?void 0:C.name," - ",new Date(l.timestamp||"").toLocaleString()]})]},l.id)})})}),(0,V.jsxs)("div",{className:"flex mt-2",children:[(0,V.jsx)(_,{value:P,onChange:l=>D(l.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,V.jsxs)(U,{onClick:E,className:"ml-2",children:[(0,V.jsx)(rt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,V.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ce=H(require("react"));var Fe=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Fe.displayName="Card";var We=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("flex flex-col space-y-1.5 p-6",e),...t}));We.displayName="CardHeader";var Ue=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("font-semibold leading-none tracking-tight",e),...t}));Ue.displayName="CardTitle";var Pr=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Pr.displayName="CardDescription";var Ge=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("p-6 it-0",e),...t}));Ge.displayName="CardContent";var Dr=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("flex items-center p-6 it-0",e),...t}));Dr.displayName="CardFooter";function Nt({deal:e,customer:t,categories:r,onClick:a}){let i=r.find(s=>{var c;return s.type==="proposition"&&((c=e.categories)!=null?c:[]).includes(s.id)});return(0,V.jsxs)(Fe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,V.jsxs)(We,{className:"pb-2",children:[(0,V.jsx)("div",{className:"flex justify-between items-center",children:(0,V.jsx)(Ue,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,V.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,V.jsxs)(Ge,{children:[(0,V.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,V.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,V.jsx)(rt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,V.jsx)("span",{children:e.assignee.name})]}),(0,V.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,V.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,V.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,V.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,V.jsx)(rt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,V.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,V.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,V.jsx)(Ae,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:i.name})})]})]})}var Le=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Dt({onSubmit:e}){var i;let[t,r]=(0,Ie.useState)({name:"",intro:"",active:!0});return(0,V.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,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)(M,{htmlFor:"customerName",children:"Customer Name"}),(0,V.jsx)(_,{id:"customerName",value:t.name,onChange:s=>r({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)(M,{htmlFor:"customerIntro",children:"Intro"}),(0,V.jsx)(re,{id:"customerIntro",value:(i=t.intro)!=null?i:"",onChange:s=>r({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>r({...t,active:s})}),(0,V.jsx)(M,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,V.jsx)(U,{type:"submit",className:"w-full",children:"Add Customer"})]})}function kt({customers:e,users:t,categories:r,onSubmit:a,initialDeal:i,onAddCustomer:s,onClose:c}){var B,z,W,$;let[o,v]=(0,Ie.useState)(i||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("V")[0],closureDate:"",comments:[],description:""}),[P,D]=(0,Ie.useState)(!1),[N,p]=(0,Ie.useState)({});(0,Ie.useEffect)(()=>{i&&v(i)},[i]);let g=()=>{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"),p(m),Object.keys(m).length===0},b=async m=>{m.preventDefault(),p({});try{if(g()){let h=await a({...o});h.success?(v({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),c==null||c()):p(h.errors||{})}}catch{p({submit:"An error occurred while submitting the form."})}},w=m=>{v(h=>({...h,categories:(h.categories||[]).includes(m.id)?(h.categories||[]).filter(O=>O!==m.id):[...h.categories||[],m.id]}))},x=async m=>{v({...o,customer:m});try{let h=await s(m);h.success?D(!1):p(h.errors||{})}catch{p({submit:"An error occurred while submitting the form."})}},k=m=>t==null?void 0:t.find(h=>h.id===Number(m)),E=m=>e==null?void 0:e.find(h=>h.id===Number(m));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,V.jsx)(ve,{className:"h-[60vh] pr-4",children:(0,V.jsxs)("div",{className:"space-y-6 px-4",children:[(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"customer",children:"Customer"}),(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsxs)(ge,{value:(z=(B=o.customer)==null?void 0:B.id)==null?void 0:z.toString(),onValueChange:m=>v({...o,customer:E(m)}),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(be,{placeholder:"Select customer"})}),(0,V.jsx)(se,{children:e.map(m=>{var h;return(0,V.jsx)(ie,{value:((h=m.id)==null?void 0:h.toString())||"",children:m.name},m.id)})})]}),(0,V.jsx)(U,{variant:"outline",size:"icon",onClick:()=>D(!0),children:(0,V.jsx)(rt.PlusIcon,{className:"w-5 h-5"})})]}),N.customerId&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:N.customerId})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"value",children:"Value"}),(0,V.jsx)(_,{id:"value",type:"number",value:o.value||"",onChange:m=>v({...o,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),N.value&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:N.value})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"assignee",children:"Assignee"}),(0,V.jsxs)(ge,{value:($=(W=o.assignee)==null?void 0:W.id)==null?void 0:$.toString(),onValueChange:m=>v({...o,assignee:k(m)}),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(be,{placeholder:"Select assignee"})}),(0,V.jsx)(se,{children:t&&t.map(m=>{var h;return(0,V.jsx)(ie,{value:((h=m.id)==null?void 0:h.toString())||"",children:m.name},m.id)})})]}),N.assignee&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:N.assignee})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"description",children:"Description"}),(0,V.jsx)(re,{id:"description",value:o.description||"",onChange:m=>v({...o,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{children:"Categories"}),(0,V.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,V.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(h=>h.type===m).map(h=>{var O;return(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:h.id.toString(),checked:(O=o.categories)==null?void 0:O.includes(h.id),onCheckedChange:()=>w(h)}),(0,V.jsx)("label",{htmlFor:h.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:h.name})]},h.id)})})]},m))})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"closureDate",children:"Closure Date"}),(0,V.jsx)(_,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:m=>v({...o,closureDate:m.target.value})}),N.closureDate&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:N.closureDate})]})]})}),(0,V.jsx)(U,{type:"submit",className:"w-full",children:i?"Update Deal":"Add Deal"})]}),(0,V.jsx)(fe,{open:P,onOpenChange:D,children:(0,V.jsxs)(Y,{children:[(0,V.jsx)(ee,{children:(0,V.jsx)(te,{children:"Add New Customer"})}),(0,V.jsx)(Dt,{onSubmit:x})]})})]})}function Lt({status:e,deals:t,users:r,customers:a,categories:i,onDealClick:s,calculateColumnValue:c,calculateWeightedValue:o,addNewDeal:v,onAddCustomer:P}){let[D,N]=(0,Ie.useState)(!1);return(0,V.jsxs)("div",{className:"flex flex-col w-80",children:[(0,V.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),v&&(0,V.jsxs)(fe,{open:D,onOpenChange:N,children:[(0,V.jsx)(ot,{asChild:!0,children:(0,V.jsxs)(U,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,V.jsx)(rt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,V.jsxs)(Y,{children:[(0,V.jsx)(ee,{children:(0,V.jsx)(te,{children:"Add New Deal"})}),(0,V.jsx)(kt,{customers:a,users:r,categories:i,onSubmit:v,onAddCustomer:P,onClose:()=>N(!1)})]})]}),(0,V.jsx)(Le.Droppable,{droppableId:e,isDropDisabled:!1,children:p=>(0,V.jsxs)("div",{ref:p.innerRef,...p.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((g,b)=>(0,V.jsx)(Le.Draggable,{draggableId:g.id.toString(),index:g.id,children:w=>(0,V.jsx)("div",{ref:w.innerRef,...w.draggableProps,...w.dragHandleProps,children:(0,V.jsx)(Nt,{deal:g,customer:g.customer,categories:i,onClick:()=>s(g)})})},g.id.toString())),p.placeholder]})}),(0,V.jsxs)("div",{className:"mt-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,V.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,V.jsxs)("span",{className:"text-green-600",children:["\xA3",c(t).toLocaleString()]})]}),(0,V.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,V.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var Rr=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function kr({initialData:e,addNewDeal:t,updateDeal:r,addComment:a,addNewCustomer:i}){var N;let[s,c]=(0,Ie.useState)(null),o=p=>{var g;return((g=e.deals)!=null?g:[]).filter(b=>b.status===p)},v=p=>p.reduce((g,b)=>g+(b.value||0),0),P=(p,g)=>{let b={Cold:.2,Qualified:.4,"Proposal Made":.6,"SoW Submitted":.7,Won:1,Lost:0};return p.reduce((w,x)=>w+(x.value||0)*b[g],0)},D=(0,Ie.useCallback)(p=>{var B,z;let{source:g,destination:b}=p;if(!b||g.droppableId===b.droppableId&&g.index===b.index)return;let w=g.droppableId,x=b.droppableId,k=(B=e.deals)==null?void 0:B.filter(W=>W.id===g.index)[0],E=[...(z=e.deals)!=null?z:[]];k&&(k.status=x,r(k))},[r]);return(0,V.jsx)(Le.DragDropContext,{onDragEnd:D,children:(0,V.jsxs)("div",{className:"p-4 max-h-[90vh] overflow-auto",children:[(0,V.jsx)("div",{className:"flex space-x-4 pb-4",children:Rr.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{var b,w;let g=o(p);return(0,V.jsx)(Lt,{status:p,deals:g,customers:(b=e.customers)!=null?b:[],users:e.users,categories:(w=e.categories)!=null?w:[],onDealClick:c,calculateColumnValue:v,calculateWeightedValue:P,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:i},p)})}),s&&(0,V.jsx)(St,{deal:s,users:e.users,customer:s.customer,categories:(N=e.categories)!=null?N:[],onClose:()=>c(null),onSave:r,onAddComment:p=>a(s.id.toString(),p)})]})})}0&&(module.exports={CRMKanbanBoard});
4
+ "use strict";"use client";var Mt=Object.create;var Re=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Vt=(e,t)=>{for(var r in t)Re(e,r,{get:t[r],enumerable:!0})},Ke=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zt(t))!Ht.call(e,i)&&i!==r&&Re(e,i,{get:()=>t[i],enumerable:!(a=Et(t,i))||a.enumerable});return e};var H=(e,t,r)=>(r=e!=null?Mt(Bt(e)):{},Ke(t||!e||!e.__esModule?Re(r,"default",{value:e,enumerable:!0}):r,e)),Ft=e=>Ke(Re({},"__esModule",{value:!0}),e);var Ar={};Vt(Ar,{CRMKanbanBoard:()=>kr});module.exports=Ft(Ar);var Ie=require("react");var we=H(require("react")),L=H(require("@radix-ui/react-dialog")),rt=require("lucide-react");var tt=require("clsx");var Be="-",Wt=e=>{let t=Gt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{let o=c.split(Be);return o[0]===""&&o.length!==1&&o.shift(),Je(o,t)||Ut(c)},getConflictingClassGroupIds:(c,o)=>{let v=r[c]||[];return o&&a[c]?[...v,...a[c]]:v}}},Je=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),i=a?Je(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let s=e.join(Be);return(c=t.validators.find(({validator:o})=>o(s)))==null?void 0:c.classGroupId},$e=/^\[(.+)\]$/,Ut=e=>{if($e.test(e)){let t=$e.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Gt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return _t(Object.entries(e.classGroups),r).forEach(([s,c])=>{ze(c,a,s,t)}),a},ze=(e,t,r,a)=>{e.forEach(i=>{if(typeof i=="string"){let s=i===""?t:qe(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(Ot(i)){ze(i(a),t,r,a);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,c])=>{ze(c,qe(t,s),r,a)})})},qe=(e,t)=>{let r=e;return t.split(Be).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Ot=e=>e.isThemeGetter,_t=(e,t)=>t?e.map(([r,a])=>{let i=a.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,o])=>[t+c,o])):s);return[r,i]}):e,jt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,i=(s,c)=>{r.set(s,c),t++,t>e&&(t=0,a=r,r=new Map)};return{get(s){let c=r.get(s);if(c!==void 0)return c;if((c=a.get(s))!==void 0)return i(s,c),c},set(s,c){r.has(s)?r.set(s,c):i(s,c)}}},Qe="!",Kt=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,i=t[0],s=t.length,c=o=>{let v=[],P=0,D=0,N;for(let y=0;y<o.length;y++){let k=o[y];if(P===0){if(k===i&&(a||o.slice(y,y+s)===t)){v.push(o.slice(D,y)),D=y+s;continue}if(k==="/"){N=y;continue}}k==="["?P++:k==="]"&&P--}let p=v.length===0?o:o.substring(D),g=p.startsWith(Qe),b=g?p.substring(1):p,w=N&&N>D?N-D:void 0;return{modifiers:v,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:w}};return r?o=>r({className:o,parseClassName:c}):c},$t=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},qt=e=>({cache:jt(e.cacheSize),parseClassName:Kt(e),...Wt(e)}),Jt=/\s+/,Qt=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:i}=t,s=[],c=e.trim().split(Jt),o="";for(let v=c.length-1;v>=0;v-=1){let P=c[v],{modifiers:D,hasImportantModifier:N,baseClassName:p,maybePostfixModifierPosition:g}=r(P),b=!!g,w=a(b?p.substring(0,g):p);if(!w){if(!b){o=P+(o.length>0?" "+o:o);continue}if(w=a(p),!w){o=P+(o.length>0?" "+o:o);continue}b=!1}let y=$t(D).join(":"),k=N?y+Qe:y,E=k+w;if(s.includes(E))continue;s.push(E);let B=i(w,b);for(let z=0;z<B.length;++z){let W=B[z];s.push(k+W)}o=P+(o.length>0?" "+o:o)}return o};function Xt(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Xe(t))&&(a&&(a+=" "),a+=r);return a}var Xe=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(e[a]))&&(r&&(r+=" "),r+=t);return r};function Zt(e,...t){let r,a,i,s=c;function c(v){let P=t.reduce((D,N)=>N(D),e());return r=qt(P),a=r.cache.get,i=r.cache.set,s=o,o(v)}function o(v){let P=a(v);if(P)return P;let D=Qt(v,r);return i(v,D),D}return function(){return s(Xt.apply(null,arguments))}}var R=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ze=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yt=/^\V+\/\V+$/,er=new Set(["px","full","screen"]),tr=/^(\V+(\.\V+)?)?(xs|sm|md|lg|xl)$/,rr=/\V+(%|px|r?em|[sdl]?v([hwib]|min|max)|it|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,or=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ar=/^(inset_)?-?((\V+)?\.?(\V+)[a-z]+|0)_-?((\V+)?\.?(\V+)[a-z]+|0)/,sr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,K=e=>pe(e)||er.has(e)||Yt.test(e),q=e=>ue(e,"length",ur),pe=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>ue(e,"number",pe),ye=e=>!!e&&Number.isInteger(Number(e)),ir=e=>e.endsWith("%")&&pe(e.slice(0,-1)),u=e=>Ze.test(e),J=e=>tr.test(e),nr=new Set(["length","size","percentage"]),lr=e=>ue(e,nr,Ye),cr=e=>ue(e,"position",Ye),dr=new Set(["image","url"]),mr=e=>ue(e,dr,gr),pr=e=>ue(e,"",fr),Ce=()=>!0,ue=(e,t,r)=>{let a=Ze.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},ur=e=>rr.test(e)&&!or.test(e),Ye=()=>!1,fr=e=>ar.test(e),gr=e=>sr.test(e);var br=()=>{let e=R("colors"),t=R("spacing"),r=R("blur"),a=R("brightness"),i=R("borderColor"),s=R("borderRadius"),c=R("borderSpacing"),o=R("borderWidth"),v=R("contrast"),P=R("grayscale"),D=R("hueRotate"),N=R("invert"),p=R("gap"),g=R("gradientColorStops"),b=R("gradientColorStopPositions"),w=R("inset"),y=R("margin"),k=R("opacity"),E=R("padding"),B=R("saturate"),z=R("scale"),W=R("sepia"),$=R("skew"),m=R("space"),h=R("translate"),O=()=>["auto","contain","none"],l=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto",u,t],S=()=>[u,t],Ne=()=>["",K,q],Pe=()=>["auto",pe,u],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],De=()=>["solid","dashed","dotted","double","none"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Me=()=>["start","end","center","between","around","evenly","stretch"],xe=()=>["","0",u],je=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[pe,u];return{cacheSize:500,separator:":",theme:{colors:[Ce],spacing:[K,q],blur:["none","",J,u],brightness:j(),borderColor:[e],borderRadius:["none","","full",J,u],borderSpacing:S(),borderWidth:Ne(),contrast:j(),grayscale:xe(),hueRotate:j(),invert:xe(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[ir,q],inset:C(),margin:C(),opacity:j(),padding:S(),saturate:j(),scale:j(),sepia:xe(),skew:j(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":je()}],"break-before":[{"break-before":je()}],"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:[...Oe(),u]}],overflow:[{overflow:l()}],"overflow-x":[{"overflow-x":l()}],"overflow-y":[{"overflow-y":l()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ye,u]}],basis:[{basis:C()}],"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:xe()}],shrink:[{shrink:xe()}],order:[{order:["first","last","none",ye,u]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",ye,u]},u]}],"col-start":[{"col-start":Pe()}],"col-end":[{"col-end":Pe()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[ye,u]},u]}],"row-start":[{"row-start":Pe()}],"row-end":[{"row-end":Pe()}],"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:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Me(),"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]}],it:[{it:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],V:[{V:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[m]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[m]}],"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:[J]},J]}],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",J,q]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ee]}],"font-family":[{font:[Ce]}],"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",pe,Ee]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",K,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":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",K,q]}],"underline-offset":[{"underline-offset":["auto",K,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:S()}],"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":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),cr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"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":[k]}],"border-style":[{border:[...De(),"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":[k]}],"divide-style":[{divide:De()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...De()]}],"outline-offset":[{"outline-offset":[K,u]}],"outline-w":[{outline:[K,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[K,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",J,pr]}],"shadow-color":[{shadow:[Ce]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[..._e(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_e()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",J,u]}],grayscale:[{grayscale:[P]}],"hue-rotate":[{"hue-rotate":[D]}],invert:[{invert:[N]}],saturate:[{saturate:[B]}],sepia:[{sepia:[W]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[D]}],"backdrop-invert":[{"backdrop-invert":[N]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[B]}],"backdrop-sepia":[{"backdrop-sepia":[W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[ye,u]}],"translate-x":[{"translate-x":[h]}],"translate-y":[{"translate-y":[h]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"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","V-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",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":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-V":[{"scroll-V":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-it":[{"scroll-it":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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:[K,q,Ee]}],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","it","pr","pb","pl"],px:["pr","pl"],py:["it","pb"],m:["mx","my","ms","V","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-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-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-V","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-it","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-it","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Zt(br);function f(...e){return et((0,tt.clsx)(e))}var V=require("react/jsx-runtime"),fe=L.Root,ot=L.Trigger,vr=L.Portal;var at=we.forwardRef(({className:e,...t},r)=>(0,V.jsx)(L.Overlay,{ref:r,className:f("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}));at.displayName=L.Overlay.displayName;var Y=we.forwardRef(({className:e,children:t,...r},a)=>(0,V.jsxs)(vr,{children:[(0,V.jsx)(at,{}),(0,V.jsxs)(L.Content,{ref:a,className:f("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,V.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,V.jsx)(rt.V,{className:"h-4 w-4"}),(0,V.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Y.displayName=L.Content.displayName;var ee=({className:e,...t})=>(0,V.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ee.displayName="DialogHeader";var hr=({className:e,...t})=>(0,V.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hr.displayName="DialogFooter";var te=we.forwardRef(({className:e,...t},r)=>(0,V.jsx)(L.Title,{ref:r,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));te.displayName=L.Title.displayName;var xr=we.forwardRef(({className:e,...t},r)=>(0,V.jsx)(L.Description,{ref:r,className:f("text-sm text-muted-foreground",e),...t}));xr.displayName=L.Description.displayName;var st=require("@radix-ui/react-slot"),it=require("class-variance-authority"),nt=H(require("react")),yr=(0,it.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"}}}),U=nt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...i},s)=>(0,V.jsx)(e?st.Slot:"button",{className:f(yr({className:t,size:r,variant:a})),ref:s,...i}));U.displayName="Button";var ct=H(require("react"));var _=ct.forwardRef(({className:e,type:t,...r},a)=>(0,V.jsx)("input",{type:t,className:f("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}));_.displayName="Input";var mt=H(require("react")),He=H(require("@radix-ui/react-label"));var Cr=(0,it.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=mt.forwardRef(({className:e,...t},r)=>(0,V.jsx)(He.Root,{ref:r,className:f(Cr(),e),...t}));M.displayName=He.Root.displayName;var ft=H(require("react")),re=ft.forwardRef(({className:e,...t},r)=>(0,V.jsx)("textarea",{className:f("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}));re.displayName="Textarea";var x=H(require("@radix-ui/react-select")),Q=H(require("react")),ge=x.Root;var be=x.Value,ae=Q.forwardRef(({children:e,className:t,...r},a)=>(0,V.jsxs)(x.Trigger,{className:f("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,V.jsx)(x.Icon,{asChild:!0,children:(0,V.jsx)(rt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));ae.displayName=x.Trigger.displayName;var bt=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(x.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,V.jsx)(rt.ChevronUp,{className:"h-4 w-4"})}));bt.displayName=x.ScrollUpButton.displayName;var vt=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(x.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,V.jsx)(rt.ChevronDown,{className:"h-4 w-4"})}));vt.displayName=x.ScrollDownButton.displayName;var se=Q.forwardRef(({children:e,className:t,position:r="popper",...a},i)=>(0,V.jsx)(x.Portal,{children:(0,V.jsxs)(x.Content,{className:f("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:i,...a,children:[(0,V.jsx)(bt,{}),(0,V.jsx)(x.Viewport,{className:f("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,V.jsx)(vt,{})]})}));se.displayName=x.Content.displayName;var wr=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(x.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));wr.displayName=x.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...r},a)=>(0,V.jsxs)(x.Item,{className:f("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,V.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,V.jsx)(x.ItemIndicator,{children:(0,V.jsx)(rt.Check,{className:"h-4 w-4"})})}),(0,V.jsx)(x.ItemText,{children:e})]}));ie.displayName=x.Item.displayName;var Sr=Q.forwardRef(({className:e,...t},r)=>(0,V.jsx)(x.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Sr.displayName=x.Separator.displayName;var Se=H(require("@radix-ui/react-checkbox")),xt=H(require("react")),ne=xt.forwardRef(({className:e,...t},r)=>(0,V.jsx)(Se.Root,{className:f("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,V.jsx)(Se.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,V.jsx)(rt.Check,{className:"h-4 w-4"})})}));ne.displayName=Se.Root.displayName;var Nr=(0,it.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,...r}){return(0,V.jsx)("div",{className:f(Nr({variant:t}),e),...r})}var Ve=H(require("react")),G=H(require("@radix-ui/react-scroll-area"));var ve=Ve.forwardRef(({className:e,children:t,...r},a)=>(0,V.jsxs)(G.Root,{ref:a,className:f("relative overflow-hidden",e),...r,children:[(0,V.jsx)(G.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,V.jsx)(wt,{}),(0,V.jsx)(G.Corner,{})]}));ve.displayName=G.Root.displayName;var wt=Ve.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,V.jsx)(G.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("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,V.jsx)(G.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=G.ScrollAreaScrollbar.displayName;function St({deal:e,users:t,customer:r,categories:a,onClose:i,onSave:s,onAddComment:c}){var W,$,m,h,O;let[o,v]=(0,Ie.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[P,D]=(0,Ie.useState)(""),[N,p]=(0,Ie.useState)(!1),[g,b]=(0,Ie.useState)(null);(0,Ie.useEffect)(()=>{p(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let w=async()=>{try{let l=await s(o);l.success?(p(!1),b(null)):console.error("Failed to save deal:",l.errors)}catch(l){console.error("Failed to save deal:",l)}},y=(l,C)=>{v(S=>({...S,[l]:C}))},k=l=>{let C=(o.categories||[]).includes(l)?(o.categories||[]).filter(S=>S!==l):[...o.categories||[],l];y("categories",C)},E=async()=>{if(P.trim()){let l={text:P,timestamp:new Date().toISOString()};try{let C=await c(l);if(!C.success){console.error("Failed to add comment:",C.errors);return}}catch(C){console.error("Failed to add comment:",C)}v(C=>({...C,comments:[...C.comments||[],l]})),D("")}},B=l=>{switch(l){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"}},z=l=>t==null?void 0:t.find(C=>C.id===Number(l));return(0,V.jsx)(fe,{open:!0,children:(0,V.jsxs)(Y,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,V.jsxs)(ee,{className:"flex flex-row items-center justify-between",children:[(0,V.jsx)(te,{className:"text-2xl font-bold",children:r==null?void 0:r.name}),(0,V.jsxs)("div",{className:"flex space-x-2",children:[(0,V.jsx)(U,{variant:"outline",onClick:i,children:"Close"}),(0,V.jsxs)(U,{onClick:w,disabled:!N,children:[(0,V.jsx)(rt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,V.jsxs)(ve,{className:"flex-grow pr-4",children:[(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,V.jsx)("div",{className:"grid gap-2 m-1",children:g==="value"?(0,V.jsx)(_,{type:"number",value:o.value,onChange:l=>y("value",Number(l.target.value)),onBlur:()=>b(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,V.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("value"),children:["\xA3",(W=o.value)==null?void 0:W.toLocaleString()]})}),(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-accent",children:"Assignee"}),g==="assignee"?(0,V.jsxs)(ge,{value:((m=($=o==null?void 0:o.assignee)==null?void 0:$.id)==null?void 0:m.toString())||"",onValueChange:l=>y("assignee",z(l)),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(be,{placeholder:"Select assignee"})}),(0,V.jsx)(se,{children:t&&t.map(l=>{var C;return(0,V.jsx)(ie,{value:((C=l==null?void 0:l.id)==null?void 0:C.toString())||"",children:l.name},l.id)})})]}):(0,V.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("assignee"),children:[(0,V.jsx)(rt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,V.jsx)("span",{children:o.assignee.name})]})]}),(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-accent",children:"Closure Date"}),g==="closureDate"?(0,V.jsx)(_,{type:"date",value:(O=(h=o.closureDate)==null?void 0:h.split("V")[0])!=null?O:"",onChange:l=>y("closureDate",l.target.value),onBlur:()=>b(null),className:"mr-2",autoFocus:!0}):(0,V.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("closureDate"),children:[(0,V.jsx)(rt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,V.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/V"})]})]})]}),(0,V.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-accent",children:"Description"}),g==="description"?(0,V.jsx)(re,{value:o.description||"",onChange:l=>y("description",l.target.value),onBlur:()=>b(null),className:"min-h-[100px]",autoFocus:!0}):(0,V.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>b("description"),children:o.description})]})}),(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 it-2 gap-4",children:[(0,V.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-accent",children:"Status"}),g==="status"?(0,V.jsxs)(ge,{value:o.status,onValueChange:l=>{y("status",l),b(null)},children:[(0,V.jsx)(ae,{children:(0,V.jsx)(be,{placeholder:"Select status"})}),(0,V.jsx)(se,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(l=>(0,V.jsx)(ie,{value:l,children:l},l))})]}):(0,V.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("status"),children:o.status})]}),(0,V.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-accent",children:"Categories"}),g==="categories"?(0,V.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(l=>{var C,S;return(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:((C=l.id)==null?void 0:C.toString())||"",checked:(o.categories||[]).some(Ne=>Ne.id===l.id),onCheckedChange:()=>l.id!==void 0&&k(l)}),(0,V.jsx)("label",{htmlFor:((S=l.id)!=null?S:"").toString(),className:`text-sm font-medium ${B(l.type||"sector")} px-2 py-1 rounded`,children:l.name})]},l.id)})}):(0,V.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>b("categories"),children:o.categories&&o.categories.map(l=>{let C=l;return C?(0,V.jsx)(Ae,{variant:"outline",className:B(C.type||"sector"),children:C.name},C.id):null})})]})]}),(0,V.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 it-4 gap-4",children:[(0,V.jsxs)("div",{className:"grid gap-2",children:[(0,V.jsx)(M,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,V.jsx)(ve,{className:"h-[200px] overflow-y-auto",children:(0,V.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((l,C)=>new Date(C.timestamp||"").getTime()-new Date(l.timestamp||"").getTime()).map(l=>{var C;return(0,V.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,V.jsx)("p",{className:"text-sm text-foreground",children:l.text}),(0,V.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[(C=l==null?void 0:l.author)==null?void 0:C.name," - ",new Date(l.timestamp||"").toLocaleString()]})]},l.id)})})}),(0,V.jsxs)("div",{className:"flex mt-2",children:[(0,V.jsx)(_,{value:P,onChange:l=>D(l.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,V.jsxs)(U,{onClick:E,className:"ml-2",children:[(0,V.jsx)(rt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,V.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ce=H(require("react"));var Fe=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Fe.displayName="Card";var We=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("flex flex-col space-y-1.5 p-6",e),...t}));We.displayName="CardHeader";var Ue=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("font-semibold leading-none tracking-tight",e),...t}));Ue.displayName="CardTitle";var Pr=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Pr.displayName="CardDescription";var Ge=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("p-6 it-0",e),...t}));Ge.displayName="CardContent";var Dr=ce.forwardRef(({className:e,...t},r)=>(0,V.jsx)("div",{ref:r,className:f("flex items-center p-6 it-0",e),...t}));Dr.displayName="CardFooter";function Nt({deal:e,customer:t,categories:r,onClick:a}){let i=r.find(s=>{var c;return s.type==="proposition"&&((c=e.categories)!=null?c:[]).includes(s.id)});return(0,V.jsxs)(Fe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,V.jsxs)(We,{className:"pb-2",children:[(0,V.jsx)("div",{className:"flex justify-between items-center",children:(0,V.jsx)(Ue,{className:"text-lg font-semibold text-foreground",children:t==null?void 0:t.name})}),(0,V.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,V.jsxs)(Ge,{children:[(0,V.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,V.jsxs)("div",{className:"flex items-center text-sm text-accent",children:[(0,V.jsx)(rt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,V.jsx)("span",{children:e.assignee.name})]}),(0,V.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,V.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,V.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,V.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,V.jsx)(rt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,V.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,V.jsx)("div",{className:"flex justify-between items-left",children:i&&(0,V.jsx)(Ae,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:i.name})})]})]})}var Le=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Dt({onSubmit:e}){var i;let[t,r]=(0,Ie.useState)({name:"",intro:"",active:!1});return(0,V.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,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)(M,{htmlFor:"customerName",children:"Customer Name"}),(0,V.jsx)(_,{id:"customerName",value:t.name,onChange:s=>r({...t,name:s.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)(M,{htmlFor:"customerIntro",children:"Intro"}),(0,V.jsx)(re,{id:"customerIntro",value:(i=t.intro)!=null?i:"",onChange:s=>r({...t,intro:s.target.value}),placeholder:"Enter customer intro"})]}),(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:"activeCustomer",checked:!!t.active,onCheckedChange:s=>r({...t,active:s})}),(0,V.jsx)(M,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,V.jsx)(U,{type:"submit",className:"w-full",children:"Add Customer"})]})}function kt({customers:e,users:t,categories:r,onSubmit:a,initialDeal:i,onAddCustomer:s,onClose:c}){var B,z,W,$;let[o,v]=(0,Ie.useState)(i||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("V")[0],closureDate:"",comments:[],description:""}),[P,D]=(0,Ie.useState)(!1),[N,p]=(0,Ie.useState)({});(0,Ie.useEffect)(()=>{i&&v(i)},[i]);let g=()=>{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"),p(m),Object.keys(m).length===0},b=async m=>{m.preventDefault(),p({});try{if(g()){let h=await a({...o});h.success?(v({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),c==null||c()):p(h.errors||{})}}catch{p({submit:"An error occurred while submitting the form."})}},w=m=>{v(h=>({...h,categories:(h.categories||[]).includes(m.id)?(h.categories||[]).filter(O=>O!==m.id):[...h.categories||[],m.id]}))},y=async m=>{v({...o,customer:m});try{let h=await s(m);h.success?D(!1):p(h.errors||{})}catch{p({submit:"An error occurred while submitting the form."})}},k=m=>t==null?void 0:t.find(h=>h.id===Number(m)),E=m=>e==null?void 0:e.find(h=>h.id===Number(m));return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,V.jsx)(ve,{className:"h-[60vh] pr-4",children:(0,V.jsxs)("div",{className:"space-y-6 px-4",children:[(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"customer",children:"Customer"}),(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsxs)(ge,{value:(z=(B=o.customer)==null?void 0:B.id)==null?void 0:z.toString(),onValueChange:m=>v({...o,customer:E(m)}),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(be,{placeholder:"Select customer"})}),(0,V.jsx)(se,{children:e.map(m=>{var h;return(0,V.jsx)(ie,{value:((h=m.id)==null?void 0:h.toString())||"",children:m.name},m.id)})})]}),(0,V.jsx)(U,{variant:"outline",size:"icon",onClick:()=>D(!0),children:(0,V.jsx)(rt.PlusIcon,{className:"w-5 h-5"})})]}),N.customerId&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:N.customerId})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"value",children:"Value"}),(0,V.jsx)(_,{id:"value",type:"number",value:o.value||"",onChange:m=>v({...o,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),N.value&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:N.value})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"assignee",children:"Assignee"}),(0,V.jsxs)(ge,{value:($=(W=o.assignee)==null?void 0:W.id)==null?void 0:$.toString(),onValueChange:m=>v({...o,assignee:k(m)}),children:[(0,V.jsx)(ae,{children:(0,V.jsx)(be,{placeholder:"Select assignee"})}),(0,V.jsx)(se,{children:t&&t.map(m=>{var h;return(0,V.jsx)(ie,{value:((h=m.id)==null?void 0:h.toString())||"",children:m.name},m.id)})})]}),N.assignee&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:N.assignee})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"description",children:"Description"}),(0,V.jsx)(re,{id:"description",value:o.description||"",onChange:m=>v({...o,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{children:"Categories"}),(0,V.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,V.jsxs)("div",{className:"space-y-2",children:[(0,V.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,V.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(h=>h.type===m).map(h=>{var O;return(0,V.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,V.jsx)(ne,{id:h.id.toString(),checked:(O=o.categories)==null?void 0:O.includes(h.id),onCheckedChange:()=>w(h)}),(0,V.jsx)("label",{htmlFor:h.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:h.name})]},h.id)})})]},m))})]}),(0,V.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,V.jsx)(M,{htmlFor:"closureDate",children:"Closure Date"}),(0,V.jsx)(_,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:m=>v({...o,closureDate:m.target.value})}),N.closureDate&&(0,V.jsx)("p",{className:"text-red-500 text-sm",children:N.closureDate})]})]})}),(0,V.jsx)(U,{type:"submit",className:"w-full",children:i?"Update Deal":"Add Deal"})]}),(0,V.jsx)(fe,{open:P,onOpenChange:D,children:(0,V.jsxs)(Y,{children:[(0,V.jsx)(ee,{children:(0,V.jsx)(te,{children:"Add New Customer"})}),(0,V.jsx)(Dt,{onSubmit:y})]})})]})}function Lt({status:e,deals:t,users:r,customers:a,categories:i,onDealClick:s,calculateColumnValue:c,calculateWeightedValue:o,addNewDeal:v,onAddCustomer:P}){let[D,N]=(0,Ie.useState)(!1);return(0,V.jsxs)("div",{className:"flex flex-col w-80",children:[(0,V.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),v&&(0,V.jsxs)(fe,{open:D,onOpenChange:N,children:[(0,V.jsx)(ot,{asChild:!0,children:(0,V.jsxs)(U,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,V.jsx)(rt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,V.jsxs)(Y,{children:[(0,V.jsx)(ee,{children:(0,V.jsx)(te,{children:"Add New Deal"})}),(0,V.jsx)(kt,{customers:a,users:r,categories:i,onSubmit:v,onAddCustomer:P,onClose:()=>N(!1)})]})]}),(0,V.jsx)(Le.Droppable,{droppableId:e,isDropDisabled:!1,children:p=>(0,V.jsxs)("div",{ref:p.innerRef,...p.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((g,b)=>(0,V.jsx)(Le.Draggable,{draggableId:g.id.toString(),index:g.id,children:w=>(0,V.jsx)("div",{ref:w.innerRef,...w.draggableProps,...w.dragHandleProps,children:(0,V.jsx)(Nt,{deal:g,customer:g.customer,categories:i,onClick:()=>s(g)})})},g.id.toString())),p.placeholder]})}),(0,V.jsxs)("div",{className:"mt-4 text-sm p-3 rounded-lg shadow",children:[(0,V.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,V.jsxs)("span",{className:"text-green-600",children:["\xA3",c(t).toLocaleString()]})]}),(0,V.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,V.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var Rr=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function kr({initialData:e,addNewDeal:t,updateDeal:r,addComment:a,addNewCustomer:i}){var N;let[s,c]=(0,Ie.useState)(null),o=p=>{var g;return((g=e.deals)!=null?g:[]).filter(b=>b.status===p)},v=p=>p.reduce((g,b)=>g+(b.value||0),0),P=(p,g)=>{let b={Cold:.2,Qualified:.4,"Proposal Made":.6,"SoW Submitted":.7,Won:1,Lost:0};return p.reduce((w,y)=>w+(y.value||0)*b[g],0)},D=(0,Ie.useCallback)(p=>{var B,z;let{source:g,destination:b}=p;if(!b||g.droppableId===b.droppableId&&g.index===b.index)return;let w=g.droppableId,y=b.droppableId,k=(B=e.deals)==null?void 0:B.filter(W=>W.id===g.index)[0],E=[...(z=e.deals)!=null?z:[]];k&&(k.status=y,r(k))},[r]);return(0,V.jsx)(Le.DragDropContext,{onDragEnd:D,children:(0,V.jsxs)("div",{className:"p-4 max-h-[90vh] overflow-auto",children:[(0,V.jsx)("div",{className:"flex space-x-4 pb-4",children:Rr.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{var b,w;let g=o(p);return(0,V.jsx)(Lt,{status:p,deals:g,customers:(b=e.customers)!=null?b:[],users:e.users,categories:(w=e.categories)!=null?w:[],onDealClick:c,calculateColumnValue:v,calculateWeightedValue:P,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:i},p)})}),s&&(0,V.jsx)(St,{deal:s,users:e.users,customer:s.customer,categories:(N=e.categories)!=null?N:[],onClose:()=>c(null),onSave:r,onAddComment:p=>a(s.id.toString(),p)})]})})}0&&(module.exports={CRMKanbanBoard});
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a}from"../../chunk-OJPHYSRN.mjs";import"../../chunk-6YWAX7NS.mjs";import"../../chunk-4TCLIMFP.mjs";import"../../chunk-PIM2JQYT.mjs";import"../../chunk-OWBJTXZL.mjs";import"../../chunk-BRYZOZKY.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";export{a as CRMKanbanBoard};
2
+ "use strict";import{a}from"../../chunk-EIEBANVZ.mjs";import"../../chunk-K2RDP7A3.mjs";import"../../chunk-7PNAXVQ2.mjs";import"../../chunk-Z2EKZZJU.mjs";import"../../chunk-KTQEW4OB.mjs";import"../../chunk-KUJXSGYS.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-BDX257W2.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-C5XNOZXC.mjs";import"../../chunk-SPOYKTBR.mjs";import"../../chunk-S7OK7D5I.mjs";export{a as CRMKanbanBoard};