cortex-react-components 1.42.4 → 1.42.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-3EVGORF6.mjs +1 -0
- package/dist/{chunk-7XSAYKJ7.mjs → chunk-3PC5BLK7.mjs} +1 -1
- package/dist/{chunk-KRJQF2ZW.mjs → chunk-3ZRLTNWG.mjs} +1 -1
- package/dist/{chunk-47TRCRZ7.mjs → chunk-6TQAMZEH.mjs} +1 -1
- package/dist/{chunk-IPHHUHS3.mjs → chunk-D43ENVPX.mjs} +1 -1
- package/dist/{chunk-GHBJK554.mjs → chunk-DESYC5BB.mjs} +1 -1
- package/dist/{chunk-R57OVXI5.mjs → chunk-DF3LBG6O.mjs} +1 -1
- package/dist/{chunk-VPVXJCL6.mjs → chunk-EI7PFWFS.mjs} +1 -1
- package/dist/{chunk-IMAQJ7N3.mjs → chunk-EMZQNDA7.mjs} +1 -1
- package/dist/{chunk-JK3XF6LP.mjs → chunk-GFV75XSU.mjs} +1 -1
- package/dist/{chunk-RZTXT4UD.mjs → chunk-GOMLTG5W.mjs} +1 -1
- package/dist/{chunk-LBKMUSVR.mjs → chunk-IE2A7UT3.mjs} +1 -1
- package/dist/{chunk-SF7DGZCZ.mjs → chunk-LRIIP54N.mjs} +1 -1
- package/dist/{chunk-KN2GNSS3.mjs → chunk-NOQUNWQW.mjs} +1 -1
- package/dist/{chunk-J7XKTH35.mjs → chunk-QH3BNFVD.mjs} +1 -1
- package/dist/chunk-SG5H4A2U.mjs +4 -0
- package/dist/{chunk-KKLZ6CCZ.mjs → chunk-SHN4XZWD.mjs} +1 -1
- package/dist/{chunk-L2PQKIU4.mjs → chunk-UDX5Y4SA.mjs} +1 -1
- package/dist/{chunk-JP7FA4RR.mjs → chunk-VWNFINDU.mjs} +1 -1
- package/dist/{chunk-UA7SFE4H.mjs → chunk-YOOGQIDR.mjs} +1 -1
- package/dist/{chunk-LFBWTXXG.mjs → chunk-ZCPNHUKK.mjs} +1 -1
- package/dist/chunk-ZXPDKKGX.mjs +1 -0
- package/dist/components/CRM/DealCard.js +1 -1
- package/dist/components/CRM/DealCard.mjs +1 -1
- package/dist/components/CRM/DealCard.stories.js +1 -1
- package/dist/components/CRM/DealCard.stories.mjs +1 -1
- package/dist/components/CRM/DealDetails.js +1 -1
- package/dist/components/CRM/DealDetails.mjs +1 -1
- package/dist/components/CRM/DealDetails.stories.js +1 -1
- package/dist/components/CRM/DealDetails.stories.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.js +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.stories.js +1 -1
- package/dist/components/CRM/KanbanBoard.stories.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.js +1 -1
- package/dist/components/CRM/KanbanColumn.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.stories.js +1 -1
- package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
- package/dist/components/CRM/NewDealForm.js +1 -1
- package/dist/components/CRM/NewDealForm.mjs +1 -1
- package/dist/components/CRM/NewDealForm.stories.js +1 -1
- package/dist/components/CRM/NewDealForm.stories.mjs +1 -1
- package/dist/components/CRM/index.js +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/CRM/mockData.js +1 -1
- package/dist/components/CRM/mockData.mjs +1 -1
- package/dist/components/CRM/types.d.ts +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/Header.stories.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.mjs +1 -1
- package/dist/components/Holidays/HolidayTracker.stories.mjs +1 -1
- package/dist/components/Holidays/index.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.stories.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/SidebarRight.stories.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Blog.stories.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/Documentation.stories.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/IndexPage.stories.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/Intranet.stories.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/LandingPage.stories.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Page.stories.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Publish.stories.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/pages/Website.stories.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/BlogListSection.stories.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/ContactSection.stories.mjs +1 -1
- package/dist/sections/form/index.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-QZ2ZSGL6.mjs +0 -4
- package/dist/chunk-RQLWJFYT.mjs +0 -1
- package/dist/chunk-RXJVXPNC.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
"use strict";var pt=Object.create;var ie=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var gt=Object.getPrototypeOf,bt=Object.prototype.hasOwnProperty;var vt=(e,t)=>{for(var o in t)ie(e,o,{get:t[o],enumerable:!0})},Ae=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ft(t))!bt.call(e,s)&&s!==o&&ie(e,s,{get:()=>t[s],enumerable:!(r=ut(t,s))||r.enumerable});return e};var k=(e,t,o)=>(o=e!=null?pt(gt(e)):{},Ae(t||!e||!e.__esModule?ie(o,"default",{value:e,enumerable:!0}):o,e)),ht=e=>Ae(ie({},"__esModule",{value:!0}),e);var so={};vt(so,{Default:()=>mt,EditExistingDeal:()=>io,default:()=>ao});module.exports=ht(so);var $=require("react");var Ve=require("clsx");var be="-",yt=e=>{let t=wt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{let a=c.split(be);return a[0]===""&&a.length!==1&&a.shift(),Me(a,t)||xt(c)},getConflictingClassGroupIds:(c,a)=>{let u=o[c]||[];return a&&r[c]?[...u,...r[c]]:u}}},Me=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),s=r?Me(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;let i=e.join(be);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.classGroupId},Te=/^\[(.+)\]$/,xt=e=>{if(Te.test(e)){let t=Te.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},wt=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Ct(Object.entries(e.classGroups),o).forEach(([i,c])=>{ge(c,r,i,t)}),r},ge=(e,t,o,r)=>{e.forEach(s=>{if(typeof s=="string"){let i=s===""?t:Ie(t,s);i.classGroupId=o;return}if(typeof s=="function"){if(St(s)){ge(s(r),t,o,r);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([i,c])=>{ge(c,Ie(t,i),o,r)})})},Ie=(e,t)=>{let o=e;return t.split(be).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},St=e=>e.isThemeGetter,Ct=(e,t)=>t?e.map(([o,r])=>{let s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([c,a])=>[t+c,a])):i);return[o,s]}):e,Pt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,s=(i,c)=>{o.set(i,c),t++,t>e&&(t=0,r=o,o=new Map)};return{get(i){let c=o.get(i);if(c!==void 0)return c;if((c=r.get(i))!==void 0)return s(i,c),c},set(i,c){o.has(i)?o.set(i,c):s(i,c)}}},ze="!",Rt=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,s=t[0],i=t.length,c=a=>{let u=[],P=0,x=0,y;for(let b=0;b<a.length;b++){let S=a[b];if(P===0){if(S===s&&(r||a.slice(b,b+i)===t)){u.push(a.slice(x,b)),x=b+i;continue}if(S==="/"){y=b;continue}}S==="["?P++:S==="]"&&P--}let N=u.length===0?a:a.substring(x),z=N.startsWith(ze),T=z?N.substring(1):N,w=y&&y>x?y-x:void 0;return{modifiers:u,hasImportantModifier:z,baseClassName:T,maybePostfixModifierPosition:w}};return o?a=>o({className:a,parseClassName:c}):c},Nt=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},kt=e=>({cache:Pt(e.cacheSize),parseClassName:Rt(e),...yt(e)}),Dt=/\s+/,At=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],c=e.trim().split(Dt),a="";for(let u=c.length-1;u>=0;u-=1){let P=c[u],{modifiers:x,hasImportantModifier:y,baseClassName:N,maybePostfixModifierPosition:z}=o(P),T=!!z,w=r(T?N.substring(0,z):N);if(!w){if(!T){a=P+(a.length>0?" "+a:a);continue}if(w=r(N),!w){a=P+(a.length>0?" "+a:a);continue}T=!1}let b=Nt(x).join(":"),S=y?b+ze:b,R=S+w;if(i.includes(R))continue;i.push(R);let G=s(w,T);for(let L=0;L<G.length;++L){let l=G[L];i.push(S+l)}a=P+(a.length>0?" "+a:a)}return a};function Tt(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Le(t))&&(r&&(r+=" "),r+=o);return r}var Le=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Le(e[r]))&&(o&&(o+=" "),o+=t);return o};function It(e,...t){let o,r,s,i=c;function c(u){let P=t.reduce((x,y)=>y(x),e());return o=kt(P),r=o.cache.get,s=o.cache.set,i=a,a(u)}function a(u){let P=r(u);if(P)return P;let x=At(u,o);return s(u,x),x}return function(){return i(Tt.apply(null,arguments))}}var f=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ee=/^\[(?:([a-z-]+):)?(.+)\]$/i,Mt=/^\d+\/\d+$/,zt=new Set(["px","full","screen"]),Lt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Et=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|He|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Gt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>j(e)||zt.has(e)||Mt.test(e),F=e=>_(e,"length",Jt),j=e=>!!e&&!Number.isNaN(Number(e)),fe=e=>_(e,"number",j),Q=e=>!!e&&Number.isInteger(Number(e)),Ft=e=>e.endsWith("%")&&j(e.slice(0,-1)),d=e=>Ee.test(e),W=e=>Lt.test(e),Wt=new Set(["length","size","percentage"]),Ot=e=>_(e,Wt,Be),Ht=e=>_(e,"position",Be),Ut=new Set(["image","url"]),jt=e=>_(e,Ut,$t),_t=e=>_(e,"",qt),X=()=>!0,_=(e,t,o)=>{let r=Ee.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},Jt=e=>Et.test(e)&&!Bt.test(e),Be=()=>!1,qt=e=>Gt.test(e),$t=e=>Vt.test(e);var Zt=()=>{let e=f("colors"),t=f("spacing"),o=f("blur"),r=f("brightness"),s=f("borderColor"),i=f("borderRadius"),c=f("borderSpacing"),a=f("borderWidth"),u=f("contrast"),P=f("grayscale"),x=f("hueRotate"),y=f("invert"),N=f("gap"),z=f("gradientColorStops"),T=f("gradientColorStopPositions"),w=f("inset"),b=f("margin"),S=f("opacity"),R=f("padding"),G=f("saturate"),L=f("scale"),l=f("sepia"),v=f("skew"),V=f("space"),oe=f("translate"),de=()=>["auto","contain","none"],me=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",d,t],g=()=>[d,t],Re=()=>["",B,F],re=()=>["auto",j,d],Ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ae=()=>["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"],ue=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",d],De=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>[j,d];return{cacheSize:500,separator:":",theme:{colors:[X],spacing:[B,F],blur:["none","",W,d],brightness:E(),borderColor:[e],borderRadius:["none","","full",W,d],borderSpacing:g(),borderWidth:Re(),contrast:E(),grayscale:Z(),hueRotate:E(),invert:Z(),gap:g(),gradientColorStops:[e],gradientColorStopPositions:[Ft,F],inset:pe(),margin:pe(),opacity:E(),padding:g(),saturate:E(),scale:E(),sepia:Z(),skew:E(),space:g(),translate:g()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[W]}],"break-after":[{"break-after":De()}],"break-before":[{"break-before":De()}],"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:[...Ne(),d]}],overflow:[{overflow:me()}],"overflow-x":[{"overflow-x":me()}],"overflow-y":[{"overflow-y":me()}],overscroll:[{overscroll:de()}],"overscroll-x":[{"overscroll-x":de()}],"overscroll-y":[{"overscroll-y":de()}],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",Q,d]}],basis:[{basis:pe()}],"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:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",Q,d]}],"grid-cols":[{"grid-cols":[X]}],"col-start-end":[{col:["auto",{span:["full",Q,d]},d]}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":[X]}],"row-start-end":[{row:["auto",{span:[Q,d]},d]}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"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-y":[{"gap-y":[N]}],"justify-content":[{justify:["normal",...ue()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ue(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ue(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[V]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[V]}],"space-y-reverse":["space-y-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:[W]},W]}],He:[{He:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-He":[{"min-He":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-He":[{"max-He":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",W,F]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fe]}],"font-family":[{font:[X]}],"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,fe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,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":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,F]}],"underline-offset":[{"underline-offset":["auto",B,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:g()}],"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":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ne(),Ht]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ot]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[T]}],"gradient-via-pos":[{via:[T]}],"gradient-to-pos":[{to:[T]}],"gradient-from":[{from:[z]}],"gradient-via":[{via:[z]}],"gradient-to":[{to:[z]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...ae(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:ae()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...ae()]}],"outline-offset":[{"outline-offset":[B,d]}],"outline-w":[{outline:[B,F]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[B,F]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",W,_t]}],"shadow-color":[{shadow:[X]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",W,d]}],grayscale:[{grayscale:[P]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[G]}],sepia:[{sepia:[l]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[G]}],"backdrop-sepia":[{"backdrop-sepia":[l]}],"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",d]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[Q,d]}],"translate-x":[{"translate-x":[oe]}],"translate-y":[{"translate-y":[oe]}],"skew-x":[{"skew-x":[v]}],"skew-y":[{"skew-y":[v]}],"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","He-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","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":g()}],"scroll-mx":[{"scroll-mx":g()}],"scroll-my":[{"scroll-my":g()}],"scroll-ms":[{"scroll-ms":g()}],"scroll-me":[{"scroll-me":g()}],"scroll-mt":[{"scroll-mt":g()}],"scroll-mr":[{"scroll-mr":g()}],"scroll-mb":[{"scroll-mb":g()}],"scroll-ml":[{"scroll-ml":g()}],"scroll-p":[{"scroll-p":g()}],"scroll-px":[{"scroll-px":g()}],"scroll-py":[{"scroll-py":g()}],"scroll-ps":[{"scroll-ps":g()}],"scroll-pe":[{"scroll-pe":g()}],"scroll-pt":[{"scroll-pt":g()}],"scroll-pr":[{"scroll-pr":g()}],"scroll-pb":[{"scroll-pb":g()}],"scroll-pl":[{"scroll-pl":g()}],"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",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[B,F,fe]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","He"],"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-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ge=It(Zt);function p(...e){return Ge((0,Ve.clsx)(e))}var Fe=require("@radix-ui/react-slot"),We=require("class-variance-authority"),Oe=k(require("react")),He=require("react/jsx-runtime"),Qt=(0,We.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:"He-10 px-4 py-2",icon:"He-10 w-10",lg:"He-11 rounded px-8",sm:"He-9 rounded px-3"},variant:{default:"bg-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),J=Oe.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...s},i)=>(0,He.jsx)(e?Fe.Slot:"button",{className:p(Qt({className:t,size:o,variant:r})),ref:i,...s}));J.displayName="Button";var Ue=k(require("react"));var q=Ue.forwardRef(({className:e,type:t,...o},r)=>(0,He.jsx)("input",{type:t,className:p("flex He-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));q.displayName="Input";var _e=k(require("react")),ve=k(require("@radix-ui/react-label"));var Xt=(0,We.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=_e.forwardRef(({className:e,...t},o)=>(0,He.jsx)(ve.Root,{ref:o,className:p(Xt(),e),...t}));I.displayName=ve.Root.displayName;var m=k(require("@radix-ui/react-select")),U=require("lucide-react"),O=k(require("react")),he=m.Root;var ye=m.Value,se=O.forwardRef(({children:e,className:t,...o},r)=>(0,He.jsxs)(m.Trigger,{className:p("flex He-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:r,...o,children:[e,(0,He.jsx)(m.Icon,{asChild:!0,children:(0,He.jsx)(U.ChevronDown,{className:"He-4 w-4 opacity-50"})})]}));se.displayName=m.Trigger.displayName;var $e=O.forwardRef(({className:e,...t},o)=>(0,He.jsx)(m.ScrollUpButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,He.jsx)(U.ChevronUp,{className:"He-4 w-4"})}));$e.displayName=m.ScrollUpButton.displayName;var Ze=O.forwardRef(({className:e,...t},o)=>(0,He.jsx)(m.ScrollDownButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,He.jsx)(U.ChevronDown,{className:"He-4 w-4"})}));Ze.displayName=m.ScrollDownButton.displayName;var ne=O.forwardRef(({children:e,className:t,position:o="popper",...r},s)=>(0,He.jsx)(m.Portal,{children:(0,He.jsxs)(m.Content,{className:p("relative z-50 max-He-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:s,...r,children:[(0,He.jsx)($e,{}),(0,He.jsx)(m.Viewport,{className:p("p-1",o==="popper"&&"He-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,He.jsx)(Ze,{})]})}));ne.displayName=m.Content.displayName;var Kt=O.forwardRef(({className:e,...t},o)=>(0,He.jsx)(m.Label,{className:p("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Kt.displayName=m.Label.displayName;var le=O.forwardRef(({children:e,className:t,...o},r)=>(0,He.jsxs)(m.Item,{className:p("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:r,...o,children:[(0,He.jsx)("span",{className:"absolute left-2 flex He-3.5 w-3.5 items-center justify-center",children:(0,He.jsx)(m.ItemIndicator,{children:(0,He.jsx)(U.Check,{className:"He-4 w-4"})})}),(0,He.jsx)(m.ItemText,{children:e})]}));le.displayName=m.Item.displayName;var Yt=O.forwardRef(({className:e,...t},o)=>(0,He.jsx)(m.Separator,{className:p("-mx-1 my-1 He-px bg-muted",e),ref:o,...t}));Yt.displayName=m.Separator.displayName;var K=k(require("@radix-ui/react-checkbox")),Xe=k(require("react")),Y=Xe.forwardRef(({className:e,...t},o)=>(0,He.jsx)(K.Root,{className:p("peer He-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,He.jsx)(K.Indicator,{className:p("flex items-center justify-center text-current"),children:(0,He.jsx)(U.Check,{className:"He-4 w-4"})})}));Y.displayName=K.Root.displayName;var Ke=k(require("react")),ee=Ke.forwardRef(({className:e,...t},o)=>(0,He.jsx)("textarea",{className:p("flex min-He-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));ee.displayName="Textarea";var xe=k(require("react")),M=k(require("@radix-ui/react-scroll-area"));var we=xe.forwardRef(({className:e,children:t,...o},r)=>(0,He.jsxs)(M.Root,{ref:r,className:p("relative overflow-hidden",e),...o,children:[(0,He.jsx)(M.Viewport,{className:"He-full w-full rounded-[inherit]",children:t}),(0,He.jsx)(et,{}),(0,He.jsx)(M.Corner,{})]}));we.displayName=M.Root.displayName;var et=xe.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,He.jsx)(M.ScrollAreaScrollbar,{ref:r,orientation:t,className:p("flex touch-none select-none transition-colors",t==="vertical"&&"He-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"He-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,He.jsx)(M.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));et.displayName=M.ScrollAreaScrollbar.displayName;var te=k(require("react")),C=k(require("@radix-ui/react-dialog"));var ot=C.Root;var eo=C.Portal;var rt=te.forwardRef(({className:e,...t},o)=>(0,He.jsx)(C.Overlay,{ref:o,className:p("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}));rt.displayName=C.Overlay.displayName;var Se=te.forwardRef(({className:e,children:t,...o},r)=>(0,He.jsxs)(eo,{children:[(0,He.jsx)(rt,{}),(0,He.jsxs)(C.Content,{ref:r,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,He.jsxs)(C.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,He.jsx)(U.X,{className:"He-4 w-4"}),(0,He.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Se.displayName=C.Content.displayName;var Ce=({className:e,...t})=>(0,He.jsx)("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ce.displayName="DialogHeader";var to=({className:e,...t})=>(0,He.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});to.displayName="DialogFooter";var Pe=te.forwardRef(({className:e,...t},o)=>(0,He.jsx)(C.Title,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));Pe.displayName=C.Title.displayName;var oo=te.forwardRef(({className:e,...t},o)=>(0,He.jsx)(C.Description,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));oo.displayName=C.Description.displayName;function it({onSubmit:e}){var s;let[t,o]=(0,$.useState)({name:"",intro:"",active:!0});return(0,He.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,He.jsxs)("div",{className:"space-y-2",children:[(0,He.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,He.jsx)(q,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,He.jsxs)("div",{className:"space-y-2",children:[(0,He.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,He.jsx)(ee,{id:"customerIntro",value:(s=t.intro)!=null?s:"",onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,He.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,He.jsx)(Y,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>o({...t,active:i})}),(0,He.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,He.jsx)(J,{type:"submit",className:"w-full",children:"Add Customer"})]})}function nt({customers:e,users:t,categories:o,onSubmit:r,initialDeal:s,onAddCustomer:i,onClose:c}){var S,R,G,L;let[a,u]=(0,$.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",lastModified:new Date().toISOString(),comments:[],description:""}),[P,x]=(0,$.useState)(!1),[y,N]=(0,$.useState)({});(0,$.useEffect)(()=>{s&&u(s)},[s]);let z=()=>{let l={};return a.customer||(l.customer="Customer is required"),a.value||(l.value="Value is required"),a.assignee||(l.assignee="Assignee is required"),a.closureDate||(l.closureDate="Closure Date is required"),N(l),Object.keys(l).length===0},T=l=>{l.preventDefault(),z()&&(r({...a,lastModified:new Date().toISOString()}),u({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),N({}),c==null||c())},w=l=>{u(v=>{var V;return{...v,categories:(V=v.categories)!=null&&V.includes(l)?v.categories.filter(oe=>oe!==l):[...v.categories||[],l]}})},b=l=>{e.push(l),u({...a,customer:l}),x(!1),i(l)};return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)("form",{onSubmit:T,className:"space-y-6",children:[(0,He.jsx)(we,{className:"He-[60vh] pr-4",children:(0,He.jsxs)("div",{className:"space-y-6 px-4",children:[(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,He.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,He.jsxs)(he,{value:(R=(S=a.customer)==null?void 0:S.id)==null?void 0:R.toString(),onValueChange:l=>u({...a,customer:{id:Number(l)}}),children:[(0,He.jsx)(se,{children:(0,He.jsx)(ye,{placeholder:"Select customer"})}),(0,He.jsx)(ne,{children:e.map(l=>{var v;return(0,He.jsx)(le,{value:((v=l.id)==null?void 0:v.toString())||"",children:l.name},l.id)})})]}),(0,He.jsx)(J,{variant:"outline",size:"icon",onClick:()=>x(!0),children:(0,He.jsx)(U.PlusIcon,{className:"w-5 He-5"})})]}),y.customerId&&(0,He.jsx)("p",{className:"text-red-500 text-sm",children:y.customerId})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"value",children:"Value"}),(0,He.jsx)(q,{id:"value",type:"number",value:a.value||"",onChange:l=>u({...a,value:Number.parseFloat(l.target.value)}),placeholder:"Enter deal value"}),y.value&&(0,He.jsx)("p",{className:"text-red-500 text-sm",children:y.value})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,He.jsxs)(he,{value:(L=(G=a.assignee)==null?void 0:G.id)==null?void 0:L.toString(),onValueChange:l=>u({...a,assignee:{id:Number(l)}}),children:[(0,He.jsx)(se,{children:(0,He.jsx)(ye,{placeholder:"Select assignee"})}),(0,He.jsx)(ne,{children:t&&t.map(l=>{var v;return(0,He.jsx)(le,{value:((v=l.id)==null?void 0:v.toString())||"",children:l.name},l.id)})})]}),y.assignee&&(0,He.jsx)("p",{className:"text-red-500 text-sm",children:y.assignee})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"description",children:"Description"}),(0,He.jsx)(ee,{id:"description",value:a.description||"",onChange:l=>u({...a,description:l.target.value}),placeholder:"Enter deal description"})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{children:"Categories"}),(0,He.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(l=>(0,He.jsxs)("div",{className:"space-y-2",children:[(0,He.jsx)("h4",{className:"text-sm font-medium",children:l.charAt(0).toUpperCase()+l.slice(1)}),(0,He.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(v=>v.type===l).map(v=>{var V;return(0,He.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,He.jsx)(Y,{id:v.id,checked:(V=a.categories)==null?void 0:V.includes(v.id),onCheckedChange:()=>w(v.id)}),(0,He.jsx)("label",{htmlFor:v.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:v.name})]},v.id)})})]},l))})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,He.jsx)(q,{id:"closureDate",type:"date",value:a.closureDate,onChange:l=>u({...a,closureDate:l.target.value})}),y.closureDate&&(0,He.jsx)("p",{className:"text-red-500 text-sm",children:y.closureDate})]})]})}),(0,He.jsx)(J,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,He.jsx)(ot,{open:P,onOpenChange:x,children:(0,He.jsxs)(Se,{children:[(0,He.jsx)(Ce,{children:(0,He.jsx)(Pe,{children:"Add New Customer"})}),(0,He.jsx)(it,{onSubmit:b})]})})]})}var lt=[{id:1,name:"Acme Corp",intro:"He leading technology company",active:!0},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1}],ct=[{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"}],dt=[{id:1,customer:{id:1,name:"Acme Corp",active:!0},value:5e4,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:["1","3","5"],dateLogged:"2023-01-15",closureDate:"2023-06-30",lastModified:"2023-05-01T10:00:00Z",comments:[{id:"1",text:"Initial contact made",author:"John Doe",timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0},value:75e3,assignee:{id:2,name:"Jane Smith"},status:"Proposal",categories:["2","4","6"],dateLogged:"2023-02-01",closureDate:"2023-07-31",lastModified:"2023-05-10T14:30:00Z",comments:[{id:"2",text:"Proposal sent",author:"Jane Smith",timestamp:"2023-05-10T14:30:00Z"}],description:"Custom hardware solution for GlobalTech"}];var ro={title:"CRM/NewDealForm",component:nt,parameters:{layout:"centered"}},ao=ro,mt={args:{customers:lt,categories:ct,onSubmit:async e=>console.log("Submitting deal:",e),onAddCustomer:async e=>console.log("Adding new customer:",e)}},io={args:{...mt.args,initialDeal:dt[0]}};0&&(module.exports={Default,EditExistingDeal});
|
|
4
|
+
"use strict";var pt=Object.create;var ie=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var gt=Object.getPrototypeOf,bt=Object.prototype.hasOwnProperty;var vt=(e,t)=>{for(var o in t)ie(e,o,{get:t[o],enumerable:!0})},Ae=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ft(t))!bt.call(e,s)&&s!==o&&ie(e,s,{get:()=>t[s],enumerable:!(r=ut(t,s))||r.enumerable});return e};var k=(e,t,o)=>(o=e!=null?pt(gt(e)):{},Ae(t||!e||!e.__esModule?ie(o,"default",{value:e,enumerable:!0}):o,e)),ht=e=>Ae(ie({},"__esModule",{value:!0}),e);var so={};vt(so,{Default:()=>mt,EditExistingDeal:()=>io,default:()=>ao});module.exports=ht(so);var $=require("react");var Ve=require("clsx");var be="-",yt=e=>{let t=wt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{let a=c.split(be);return a[0]===""&&a.length!==1&&a.shift(),ze(a,t)||xt(c)},getConflictingClassGroupIds:(c,a)=>{let u=o[c]||[];return a&&r[c]?[...u,...r[c]]:u}}},ze=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),s=r?ze(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;let i=e.join(be);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.classGroupId},Te=/^\[(.+)\]$/,xt=e=>{if(Te.test(e)){let t=Te.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},wt=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return Ct(Object.entries(e.classGroups),o).forEach(([i,c])=>{ge(c,r,i,t)}),r},ge=(e,t,o,r)=>{e.forEach(s=>{if(typeof s=="string"){let i=s===""?t:Ie(t,s);i.classGroupId=o;return}if(typeof s=="function"){if(St(s)){ge(s(r),t,o,r);return}t.validators.push({validator:s,classGroupId:o});return}Object.entries(s).forEach(([i,c])=>{ge(c,Ie(t,i),o,r)})})},Ie=(e,t)=>{let o=e;return t.split(be).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},St=e=>e.isThemeGetter,Ct=(e,t)=>t?e.map(([o,r])=>{let s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([c,a])=>[t+c,a])):i);return[o,s]}):e,Pt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,s=(i,c)=>{o.set(i,c),t++,t>e&&(t=0,r=o,o=new Map)};return{get(i){let c=o.get(i);if(c!==void 0)return c;if((c=r.get(i))!==void 0)return s(i,c),c},set(i,c){o.has(i)?o.set(i,c):s(i,c)}}},Me="!",Rt=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,s=t[0],i=t.length,c=a=>{let u=[],P=0,x=0,y;for(let b=0;b<a.length;b++){let S=a[b];if(P===0){if(S===s&&(r||a.slice(b,b+i)===t)){u.push(a.slice(x,b)),x=b+i;continue}if(S==="/"){y=b;continue}}S==="["?P++:S==="]"&&P--}let N=u.length===0?a:a.substring(x),M=N.startsWith(Me),T=M?N.substring(1):N,w=y&&y>x?y-x:void 0;return{modifiers:u,hasImportantModifier:M,baseClassName:T,maybePostfixModifierPosition:w}};return o?a=>o({className:a,parseClassName:c}):c},Nt=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(r=>{r[0]==="["?(t.push(...o.sort(),r),o=[]):o.push(r)}),t.push(...o.sort()),t},kt=e=>({cache:Pt(e.cacheSize),parseClassName:Rt(e),...yt(e)}),Dt=/\s+/,At=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],c=e.trim().split(Dt),a="";for(let u=c.length-1;u>=0;u-=1){let P=c[u],{modifiers:x,hasImportantModifier:y,baseClassName:N,maybePostfixModifierPosition:M}=o(P),T=!!M,w=r(T?N.substring(0,M):N);if(!w){if(!T){a=P+(a.length>0?" "+a:a);continue}if(w=r(N),!w){a=P+(a.length>0?" "+a:a);continue}T=!1}let b=Nt(x).join(":"),S=y?b+Me:b,R=S+w;if(i.includes(R))continue;i.push(R);let G=s(w,T);for(let L=0;L<G.length;++L){let l=G[L];i.push(S+l)}a=P+(a.length>0?" "+a:a)}return a};function Tt(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Le(t))&&(r&&(r+=" "),r+=o);return r}var Le=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=Le(e[r]))&&(o&&(o+=" "),o+=t);return o};function It(e,...t){let o,r,s,i=c;function c(u){let P=t.reduce((x,y)=>y(x),e());return o=kt(P),r=o.cache.get,s=o.cache.set,i=a,a(u)}function a(u){let P=r(u);if(P)return P;let x=At(u,o);return s(u,x),x}return function(){return i(Tt.apply(null,arguments))}}var f=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ee=/^\[(?:([a-z-]+):)?(.+)\]$/i,zt=/^\d+\/\d+$/,Mt=new Set(["px","full","screen"]),Lt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Et=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|He|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Gt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>j(e)||Mt.has(e)||zt.test(e),F=e=>_(e,"length",Jt),j=e=>!!e&&!Number.isNaN(Number(e)),fe=e=>_(e,"number",j),Q=e=>!!e&&Number.isInteger(Number(e)),Ft=e=>e.endsWith("%")&&j(e.slice(0,-1)),d=e=>Ee.test(e),W=e=>Lt.test(e),Wt=new Set(["length","size","percentage"]),Ot=e=>_(e,Wt,Be),Ht=e=>_(e,"position",Be),Ut=new Set(["image","url"]),jt=e=>_(e,Ut,$t),_t=e=>_(e,"",qt),X=()=>!0,_=(e,t,o)=>{let r=Ee.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):o(r[2]):!1},Jt=e=>Et.test(e)&&!Bt.test(e),Be=()=>!1,qt=e=>Gt.test(e),$t=e=>Vt.test(e);var Zt=()=>{let e=f("colors"),t=f("spacing"),o=f("blur"),r=f("brightness"),s=f("borderColor"),i=f("borderRadius"),c=f("borderSpacing"),a=f("borderWidth"),u=f("contrast"),P=f("grayscale"),x=f("hueRotate"),y=f("invert"),N=f("gap"),M=f("gradientColorStops"),T=f("gradientColorStopPositions"),w=f("inset"),b=f("margin"),S=f("opacity"),R=f("padding"),G=f("saturate"),L=f("scale"),l=f("sepia"),v=f("skew"),V=f("space"),oe=f("translate"),de=()=>["auto","contain","none"],me=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",d,t],g=()=>[d,t],Re=()=>["",B,F],re=()=>["auto",j,d],Ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ae=()=>["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"],ue=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",d],De=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>[j,d];return{cacheSize:500,separator:":",theme:{colors:[X],spacing:[B,F],blur:["none","",W,d],brightness:E(),borderColor:[e],borderRadius:["none","","full",W,d],borderSpacing:g(),borderWidth:Re(),contrast:E(),grayscale:Z(),hueRotate:E(),invert:Z(),gap:g(),gradientColorStops:[e],gradientColorStopPositions:[Ft,F],inset:pe(),margin:pe(),opacity:E(),padding:g(),saturate:E(),scale:E(),sepia:Z(),skew:E(),space:g(),translate:g()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[W]}],"break-after":[{"break-after":De()}],"break-before":[{"break-before":De()}],"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:[...Ne(),d]}],overflow:[{overflow:me()}],"overflow-x":[{"overflow-x":me()}],"overflow-y":[{"overflow-y":me()}],overscroll:[{overscroll:de()}],"overscroll-x":[{"overscroll-x":de()}],"overscroll-y":[{"overscroll-y":de()}],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",Q,d]}],basis:[{basis:pe()}],"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:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",Q,d]}],"grid-cols":[{"grid-cols":[X]}],"col-start-end":[{col:["auto",{span:["full",Q,d]},d]}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":[X]}],"row-start-end":[{row:["auto",{span:[Q,d]},d]}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"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-y":[{"gap-y":[N]}],"justify-content":[{justify:["normal",...ue()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ue(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ue(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[V]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[V]}],"space-y-reverse":["space-y-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:[W]},W]}],He:[{He:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-He":[{"min-He":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-He":[{"max-He":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",W,F]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fe]}],"font-family":[{font:[X]}],"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,fe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",B,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":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",B,F]}],"underline-offset":[{"underline-offset":["auto",B,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:g()}],"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":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ne(),Ht]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ot]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[T]}],"gradient-via-pos":[{via:[T]}],"gradient-to-pos":[{to:[T]}],"gradient-from":[{from:[M]}],"gradient-via":[{via:[M]}],"gradient-to":[{to:[M]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...ae(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:ae()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...ae()]}],"outline-offset":[{"outline-offset":[B,d]}],"outline-w":[{outline:[B,F]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[B,F]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",W,_t]}],"shadow-color":[{shadow:[X]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",W,d]}],grayscale:[{grayscale:[P]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[G]}],sepia:[{sepia:[l]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[G]}],"backdrop-sepia":[{"backdrop-sepia":[l]}],"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",d]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[L]}],"scale-x":[{"scale-x":[L]}],"scale-y":[{"scale-y":[L]}],rotate:[{rotate:[Q,d]}],"translate-x":[{"translate-x":[oe]}],"translate-y":[{"translate-y":[oe]}],"skew-x":[{"skew-x":[v]}],"skew-y":[{"skew-y":[v]}],"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","He-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","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":g()}],"scroll-mx":[{"scroll-mx":g()}],"scroll-my":[{"scroll-my":g()}],"scroll-ms":[{"scroll-ms":g()}],"scroll-me":[{"scroll-me":g()}],"scroll-mt":[{"scroll-mt":g()}],"scroll-mr":[{"scroll-mr":g()}],"scroll-mb":[{"scroll-mb":g()}],"scroll-ml":[{"scroll-ml":g()}],"scroll-p":[{"scroll-p":g()}],"scroll-px":[{"scroll-px":g()}],"scroll-py":[{"scroll-py":g()}],"scroll-ps":[{"scroll-ps":g()}],"scroll-pe":[{"scroll-pe":g()}],"scroll-pt":[{"scroll-pt":g()}],"scroll-pr":[{"scroll-pr":g()}],"scroll-pb":[{"scroll-pb":g()}],"scroll-pl":[{"scroll-pl":g()}],"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",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[B,F,fe]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","He"],"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-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ge=It(Zt);function p(...e){return Ge((0,Ve.clsx)(e))}var Fe=require("@radix-ui/react-slot"),We=require("class-variance-authority"),Oe=k(require("react")),He=require("react/jsx-runtime"),Qt=(0,We.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:"He-10 px-4 py-2",icon:"He-10 w-10",lg:"He-11 rounded px-8",sm:"He-9 rounded px-3"},variant:{default:"bg-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),J=Oe.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...s},i)=>(0,He.jsx)(e?Fe.Slot:"button",{className:p(Qt({className:t,size:o,variant:r})),ref:i,...s}));J.displayName="Button";var Ue=k(require("react"));var q=Ue.forwardRef(({className:e,type:t,...o},r)=>(0,He.jsx)("input",{type:t,className:p("flex He-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));q.displayName="Input";var _e=k(require("react")),ve=k(require("@radix-ui/react-label"));var Xt=(0,We.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=_e.forwardRef(({className:e,...t},o)=>(0,He.jsx)(ve.Root,{ref:o,className:p(Xt(),e),...t}));I.displayName=ve.Root.displayName;var m=k(require("@radix-ui/react-select")),U=require("lucide-react"),O=k(require("react")),he=m.Root;var ye=m.Value,se=O.forwardRef(({children:e,className:t,...o},r)=>(0,He.jsxs)(m.Trigger,{className:p("flex He-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:r,...o,children:[e,(0,He.jsx)(m.Icon,{asChild:!0,children:(0,He.jsx)(U.ChevronDown,{className:"He-4 w-4 opacity-50"})})]}));se.displayName=m.Trigger.displayName;var $e=O.forwardRef(({className:e,...t},o)=>(0,He.jsx)(m.ScrollUpButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,He.jsx)(U.ChevronUp,{className:"He-4 w-4"})}));$e.displayName=m.ScrollUpButton.displayName;var Ze=O.forwardRef(({className:e,...t},o)=>(0,He.jsx)(m.ScrollDownButton,{className:p("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,He.jsx)(U.ChevronDown,{className:"He-4 w-4"})}));Ze.displayName=m.ScrollDownButton.displayName;var ne=O.forwardRef(({children:e,className:t,position:o="popper",...r},s)=>(0,He.jsx)(m.Portal,{children:(0,He.jsxs)(m.Content,{className:p("relative z-50 max-He-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:s,...r,children:[(0,He.jsx)($e,{}),(0,He.jsx)(m.Viewport,{className:p("p-1",o==="popper"&&"He-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,He.jsx)(Ze,{})]})}));ne.displayName=m.Content.displayName;var Kt=O.forwardRef(({className:e,...t},o)=>(0,He.jsx)(m.Label,{className:p("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Kt.displayName=m.Label.displayName;var le=O.forwardRef(({children:e,className:t,...o},r)=>(0,He.jsxs)(m.Item,{className:p("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:r,...o,children:[(0,He.jsx)("span",{className:"absolute left-2 flex He-3.5 w-3.5 items-center justify-center",children:(0,He.jsx)(m.ItemIndicator,{children:(0,He.jsx)(U.Check,{className:"He-4 w-4"})})}),(0,He.jsx)(m.ItemText,{children:e})]}));le.displayName=m.Item.displayName;var Yt=O.forwardRef(({className:e,...t},o)=>(0,He.jsx)(m.Separator,{className:p("-mx-1 my-1 He-px bg-muted",e),ref:o,...t}));Yt.displayName=m.Separator.displayName;var K=k(require("@radix-ui/react-checkbox")),Xe=k(require("react")),Y=Xe.forwardRef(({className:e,...t},o)=>(0,He.jsx)(K.Root,{className:p("peer He-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,He.jsx)(K.Indicator,{className:p("flex items-center justify-center text-current"),children:(0,He.jsx)(U.Check,{className:"He-4 w-4"})})}));Y.displayName=K.Root.displayName;var Ke=k(require("react")),ee=Ke.forwardRef(({className:e,...t},o)=>(0,He.jsx)("textarea",{className:p("flex min-He-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));ee.displayName="Textarea";var xe=k(require("react")),z=k(require("@radix-ui/react-scroll-area"));var we=xe.forwardRef(({className:e,children:t,...o},r)=>(0,He.jsxs)(z.Root,{ref:r,className:p("relative overflow-hidden",e),...o,children:[(0,He.jsx)(z.Viewport,{className:"He-full w-full rounded-[inherit]",children:t}),(0,He.jsx)(et,{}),(0,He.jsx)(z.Corner,{})]}));we.displayName=z.Root.displayName;var et=xe.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,He.jsx)(z.ScrollAreaScrollbar,{ref:r,orientation:t,className:p("flex touch-none select-none transition-colors",t==="vertical"&&"He-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"He-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,He.jsx)(z.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));et.displayName=z.ScrollAreaScrollbar.displayName;var te=k(require("react")),C=k(require("@radix-ui/react-dialog"));var ot=C.Root;var eo=C.Portal;var rt=te.forwardRef(({className:e,...t},o)=>(0,He.jsx)(C.Overlay,{ref:o,className:p("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}));rt.displayName=C.Overlay.displayName;var Se=te.forwardRef(({className:e,children:t,...o},r)=>(0,He.jsxs)(eo,{children:[(0,He.jsx)(rt,{}),(0,He.jsxs)(C.Content,{ref:r,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,He.jsxs)(C.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,He.jsx)(U.X,{className:"He-4 w-4"}),(0,He.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Se.displayName=C.Content.displayName;var Ce=({className:e,...t})=>(0,He.jsx)("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ce.displayName="DialogHeader";var to=({className:e,...t})=>(0,He.jsx)("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});to.displayName="DialogFooter";var Pe=te.forwardRef(({className:e,...t},o)=>(0,He.jsx)(C.Title,{ref:o,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));Pe.displayName=C.Title.displayName;var oo=te.forwardRef(({className:e,...t},o)=>(0,He.jsx)(C.Description,{ref:o,className:p("text-sm text-muted-foreground",e),...t}));oo.displayName=C.Description.displayName;function it({onSubmit:e}){var s;let[t,o]=(0,$.useState)({name:"",intro:"",active:!0});return(0,He.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,He.jsxs)("div",{className:"space-y-2",children:[(0,He.jsx)(I,{htmlFor:"customerName",children:"Customer Name"}),(0,He.jsx)(q,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,He.jsxs)("div",{className:"space-y-2",children:[(0,He.jsx)(I,{htmlFor:"customerIntro",children:"Intro"}),(0,He.jsx)(ee,{id:"customerIntro",value:(s=t.intro)!=null?s:"",onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,He.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,He.jsx)(Y,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>o({...t,active:i})}),(0,He.jsx)(I,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,He.jsx)(J,{type:"submit",className:"w-full",children:"Add Customer"})]})}function nt({customers:e,users:t,categories:o,onSubmit:r,initialDeal:s,onAddCustomer:i,onClose:c}){var S,R,G,L;let[a,u]=(0,$.useState)(s||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[P,x]=(0,$.useState)(!1),[y,N]=(0,$.useState)({});(0,$.useEffect)(()=>{s&&u(s)},[s]);let M=()=>{let l={};return a.customer||(l.customer="Customer is required"),a.value||(l.value="Value is required"),a.assignee||(l.assignee="Assignee is required"),a.closureDate||(l.closureDate="Closure Date is required"),N(l),Object.keys(l).length===0},T=l=>{l.preventDefault(),M()&&(r({...a}),u({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),N({}),c==null||c())},w=l=>{u(v=>{var V;return{...v,categories:(V=v.categories)!=null&&V.includes(l)?v.categories.filter(oe=>oe!==l):[...v.categories||[],l]}})},b=l=>{e.push(l),u({...a,customer:l}),x(!1),i(l)};return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsxs)("form",{onSubmit:T,className:"space-y-6",children:[(0,He.jsx)(we,{className:"He-[60vh] pr-4",children:(0,He.jsxs)("div",{className:"space-y-6 px-4",children:[(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"customer",children:"Customer"}),(0,He.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,He.jsxs)(he,{value:(R=(S=a.customer)==null?void 0:S.id)==null?void 0:R.toString(),onValueChange:l=>u({...a,customer:{id:Number(l)}}),children:[(0,He.jsx)(se,{children:(0,He.jsx)(ye,{placeholder:"Select customer"})}),(0,He.jsx)(ne,{children:e.map(l=>{var v;return(0,He.jsx)(le,{value:((v=l.id)==null?void 0:v.toString())||"",children:l.name},l.id)})})]}),(0,He.jsx)(J,{variant:"outline",size:"icon",onClick:()=>x(!0),children:(0,He.jsx)(U.PlusIcon,{className:"w-5 He-5"})})]}),y.customerId&&(0,He.jsx)("p",{className:"text-red-500 text-sm",children:y.customerId})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"value",children:"Value"}),(0,He.jsx)(q,{id:"value",type:"number",value:a.value||"",onChange:l=>u({...a,value:Number.parseFloat(l.target.value)}),placeholder:"Enter deal value"}),y.value&&(0,He.jsx)("p",{className:"text-red-500 text-sm",children:y.value})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"assignee",children:"Assignee"}),(0,He.jsxs)(he,{value:(L=(G=a.assignee)==null?void 0:G.id)==null?void 0:L.toString(),onValueChange:l=>u({...a,assignee:{id:Number(l)}}),children:[(0,He.jsx)(se,{children:(0,He.jsx)(ye,{placeholder:"Select assignee"})}),(0,He.jsx)(ne,{children:t&&t.map(l=>{var v;return(0,He.jsx)(le,{value:((v=l.id)==null?void 0:v.toString())||"",children:l.name},l.id)})})]}),y.assignee&&(0,He.jsx)("p",{className:"text-red-500 text-sm",children:y.assignee})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"description",children:"Description"}),(0,He.jsx)(ee,{id:"description",value:a.description||"",onChange:l=>u({...a,description:l.target.value}),placeholder:"Enter deal description"})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{children:"Categories"}),(0,He.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(l=>(0,He.jsxs)("div",{className:"space-y-2",children:[(0,He.jsx)("h4",{className:"text-sm font-medium",children:l.charAt(0).toUpperCase()+l.slice(1)}),(0,He.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(v=>v.type===l).map(v=>{var V;return(0,He.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,He.jsx)(Y,{id:v.id,checked:(V=a.categories)==null?void 0:V.includes(v.id),onCheckedChange:()=>w(v.id)}),(0,He.jsx)("label",{htmlFor:v.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:v.name})]},v.id)})})]},l))})]}),(0,He.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,He.jsx)(I,{htmlFor:"closureDate",children:"Closure Date"}),(0,He.jsx)(q,{id:"closureDate",type:"date",value:a.closureDate,onChange:l=>u({...a,closureDate:l.target.value})}),y.closureDate&&(0,He.jsx)("p",{className:"text-red-500 text-sm",children:y.closureDate})]})]})}),(0,He.jsx)(J,{type:"submit",className:"w-full",children:s?"Update Deal":"Add Deal"})]}),(0,He.jsx)(ot,{open:P,onOpenChange:x,children:(0,He.jsxs)(Se,{children:[(0,He.jsx)(Ce,{children:(0,He.jsx)(Pe,{children:"Add New Customer"})}),(0,He.jsx)(it,{onSubmit:b})]})})]})}var lt=[{id:1,name:"Acme Corp",intro:"He leading technology company",active:!0},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1}],ct=[{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"}],dt=[{id:1,customer:{id:1,name:"Acme Corp",active:!0},value:5e4,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:["1","3","5"],dateLogged:"2023-01-15",closureDate:"2023-06-30",updatedAt:"2023-05-01T10:00:00Z",comments:[{id:"1",text:"Initial contact made",author:"John Doe",timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0},value:75e3,assignee:{id:2,name:"Jane Smith"},status:"Proposal",categories:["2","4","6"],dateLogged:"2023-02-01",closureDate:"2023-07-31",updatedAt:"2023-05-10T14:30:00Z",comments:[{id:"2",text:"Proposal sent",author:"Jane Smith",timestamp:"2023-05-10T14:30:00Z"}],description:"Custom hardware solution for GlobalTech"}];var ro={title:"CRM/NewDealForm",component:nt,parameters:{layout:"centered"}},ao=ro,mt={args:{customers:lt,categories:ct,onSubmit:async e=>console.log("Submitting deal:",e),onAddCustomer:async e=>console.log("Adding new customer:",e)}},io={args:{...mt.args,initialDeal:dt[0]}};0&&(module.exports={Default,EditExistingDeal});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as r,c as a}from"../../chunk-
|
|
1
|
+
import{a as t,b as r,c as a}from"../../chunk-3EVGORF6.mjs";import{a as e}from"../../chunk-ZXPDKKGX.mjs";import"../../chunk-3FW5YDNM.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-GLEWUUGS.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-6K2R3OAD.mjs";import"../../chunk-S7OK7D5I.mjs";var m={title:"CRM/NewDealForm",component:e,parameters:{layout:"centered"}},c=m,s={args:{customers:t,categories:r,onSubmit:async o=>console.log("Submitting deal:",o),onAddCustomer:async o=>console.log("Adding new customer:",o)}},i={args:{...s.args,initialDeal:a[0]}};export{s as Default,i as EditExistingDeal,c as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
'use client'
|
|
4
4
|
|
|
5
|
-
"use strict";var It=Object.create;var De=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Vt=(e,t)=>{for(var o in t)De(e,o,{get:t[o],enumerable:!0})},Xe=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zt(t))!Ht.call(e,n)&&n!==o&&De(e,n,{get:()=>t[n],enumerable:!(a=Et(t,n))||a.enumerable});return e};var B=(e,t,o)=>(o=e!=null?It(Bt(e)):{},Xe(t||!e||!e.__esModule?De(o,"default",{value:e,enumerable:!0}):o,e)),Ft=e=>Xe(De({},"__esModule",{value:!0}),e);var Mo={};Vt(Mo,{CRMKanbanBoard:()=>To,DealCard:()=>Ue,DealDetails:()=>Ve,KanbanColumn:()=>Ke,NewCustomerForm:()=>_e,NewDealForm:()=>je});module.exports=Ft(Mo);var Ne=require("react");var we=B(require("react")),A=B(require("@radix-ui/react-dialog")),nt=require("lucide-react");var st=require("clsx");var ze="-",Wt=e=>{let t=Ot(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{let r=d.split(ze);return r[0]===""&&r.length!==1&&r.shift(),et(r,t)||Gt(d)},getConflictingClassGroupIds:(d,r)=>{let b=o[d]||[];return r&&a[d]?[...b,...a[d]]:b}}},et=(e,t)=>{var d;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?et(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(ze);return(d=t.validators.find(({validator:r})=>r(i)))==null?void 0:d.classGroupId},Ze=/^\[(.+)\]$/,Gt=e=>{if(Ze.test(e)){let t=Ze.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ot=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return _t(Object.entries(e.classGroups),o).forEach(([i,d])=>{Ee(d,a,i,t)}),a},Ee=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Ye(t,n);i.classGroupId=o;return}if(typeof n=="function"){if(Ut(n)){Ee(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([i,d])=>{Ee(d,Ye(t,i),o,a)})})},Ye=(e,t)=>{let o=e;return t.split(ze).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Ut=e=>e.isThemeGetter,_t=(e,t)=>t?e.map(([o,a])=>{let n=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([d,r])=>[t+d,r])):i);return[o,n]}):e,jt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(i,d)=>{o.set(i,d),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let d=o.get(i);if(d!==void 0)return d;if((d=a.get(i))!==void 0)return n(i,d),d},set(i,d){o.has(i)?o.set(i,d):n(i,d)}}},tt="!",Kt=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,d=r=>{let b=[],C=0,w=0,y;for(let v=0;v<r.length;v++){let S=r[v];if(C===0){if(S===n&&(a||r.slice(v,v+i)===t)){b.push(r.slice(w,v)),w=v+i;continue}if(S==="/"){y=v;continue}}S==="["?C++:S==="]"&&C--}let D=b.length===0?r:r.substring(w),p=D.startsWith(tt),u=p?D.substring(1):D,x=y&&y>w?y-w:void 0;return{modifiers:b,hasImportantModifier:p,baseClassName:u,maybePostfixModifierPosition:x}};return o?r=>o({className:r,parseClassName:d}):d},$t=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},qt=e=>({cache:jt(e.cacheSize),parseClassName:Kt(e),...Wt(e)}),Jt=/\H+/,Qt=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],d=e.trim().split(Jt),r="";for(let b=d.length-1;b>=0;b-=1){let C=d[b],{modifiers:w,hasImportantModifier:y,baseClassName:D,maybePostfixModifierPosition:p}=o(C),u=!!p,x=a(u?D.substring(0,p):D);if(!x){if(!u){r=C+(r.length>0?" "+r:r);continue}if(x=a(D),!x){r=C+(r.length>0?" "+r:r);continue}u=!1}let v=$t(w).join(":"),S=y?v+tt:v,T=S+x;if(i.includes(T))continue;i.push(T);let z=n(x,u);for(let G=0;G<z.length;++G){let m=z[G];i.push(S+m)}r=C+(r.length>0?" "+r:r)}return r};function Xt(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=ot(t))&&(a&&(a+=" "),a+=o);return a}var ot=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=ot(e[a]))&&(o&&(o+=" "),o+=t);return o};function Zt(e,...t){let o,a,n,i=d;function d(b){let C=t.reduce((w,y)=>y(w),e());return o=qt(C),a=o.cache.get,n=o.cache.set,i=r,r(b)}function r(b){let C=a(b);if(C)return C;let w=Qt(b,o);return n(b,w),w}return function(){return i(Xt.apply(null,arguments))}}var P=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},rt=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yt=/^\d+\/\d+$/,eo=new Set(["px","full","screen"]),to=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ro=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ao=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,io=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$=e=>pe(e)||eo.has(e)||Yt.test(e),q=e=>ue(e,"length",fo),pe=e=>!!e&&!Number.isNaN(Number(e)),Ie=e=>ue(e,"number",pe),ye=e=>!!e&&Number.isInteger(Number(e)),so=e=>e.endsWith("%")&&pe(e.slice(0,-1)),f=e=>rt.test(e),J=e=>to.test(e),no=new Set(["length","size","percentage"]),lo=e=>ue(e,no,at),co=e=>ue(e,"position",at),mo=new Set(["image","url"]),po=e=>ue(e,mo,bo),uo=e=>ue(e,"",go),Ce=()=>!0,ue=(e,t,o)=>{let a=rt.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},fo=e=>oo.test(e)&&!ro.test(e),at=()=>!1,go=e=>ao.test(e),bo=e=>io.test(e);var vo=()=>{let e=P("colors"),t=P("spacing"),o=P("blur"),a=P("brightness"),n=P("borderColor"),i=P("borderRadius"),d=P("borderSpacing"),r=P("borderWidth"),b=P("contrast"),C=P("grayscale"),w=P("hueRotate"),y=P("invert"),D=P("gap"),p=P("gradientColorStops"),u=P("gradientColorStopPositions"),x=P("inset"),v=P("margin"),S=P("opacity"),T=P("padding"),z=P("saturate"),G=P("scale"),m=P("sepia"),R=P("skew"),O=P("space"),l=P("translate"),E=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",f,t],N=()=>[f,t],$e=()=>["",$,q],Re=()=>["auto",pe,f],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Pe=()=>["solid","dashed","dotted","double","none"],Je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Le=()=>["start","end","center","between","around","evenly","stretch"],xe=()=>["","0",f],Qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[pe,f];return{cacheSize:500,separator:":",theme:{colors:[Ce],spacing:[$,q],blur:["none","",J,f],brightness:K(),borderColor:[e],borderRadius:["none","","full",J,f],borderSpacing:N(),borderWidth:$e(),contrast:K(),grayscale:xe(),hueRotate:K(),invert:xe(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[so,q],inset:me(),margin:me(),opacity:K(),padding:N(),saturate:K(),scale:K(),sepia:xe(),skew:K(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",f]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":Qe()}],"break-before":[{"break-before":Qe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...qe(),f]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ye,f]}],basis:[{basis:me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",f]}],grow:[{grow:xe()}],shrink:[{shrink:xe()}],order:[{order:["first","last","none",ye,f]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",ye,f]},f]}],"col-start":[{"col-start":Re()}],"col-end":[{"col-end":Re()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[ye,f]},f]}],"row-start":[{"row-start":Re()}],"row-end":[{"row-end":Re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",f]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",f]}],gap:[{gap:[D]}],"gap-x":[{"gap-x":[D]}],"gap-y":[{"gap-y":[D]}],"justify-content":[{justify:["normal",...Le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",f,t]}],"min-w":[{"min-w":[f,t,"min","max","fit"]}],"max-w":[{"max-w":[f,t,"none","full","min","max","fit","prose",{screen:[J]},J]}],h:[{h:[f,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[f,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[f,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[f,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",Ie]}],"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",f]}],"line-clamp":[{"line-clamp":["none",pe,Ie]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$,f]}],"list-image":[{"list-image":["none",f]}],"list-style-type":[{list:["none","disc","decimal",f]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Pe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$,q]}],"underline-offset":[{"underline-offset":["auto",$,f]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",f]}],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",f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),co]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},po]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[u]}],"gradient-via-pos":[{via:[u]}],"gradient-to-pos":[{to:[u]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-H":[{"rounded-H":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-H":[{"border-H":[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":[S]}],"border-style":[{border:[...Pe(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:Pe()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-H":[{"border-H":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...Pe()]}],"outline-offset":[{"outline-offset":[$,f]}],"outline-w":[{outline:[$,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[$,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",J,uo]}],"shadow-color":[{shadow:[Ce]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Je()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",J,f]}],grayscale:[{grayscale:[C]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[y]}],saturate:[{saturate:[z]}],sepia:[{sepia:[m]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[C]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",f]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",f]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",f]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[ye,f]}],"translate-x":[{"translate-x":[l]}],"translate-y":[{"translate-y":[l]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",f]}],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","H-resize","w-resize","Ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",f]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",f]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$,q,Ie]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-H","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-H":["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-H","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-H","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var it=Zt(vo);function g(...e){return it((0,st.clsx)(e))}var H=require("react/jsx-runtime"),fe=A.Root,lt=A.Trigger,ho=A.Portal;var ct=we.forwardRef(({className:e,...t},o)=>(0,H.jsx)(A.Overlay,{ref:o,className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ct.displayName=A.Overlay.displayName;var Z=we.forwardRef(({className:e,children:t,...o},a)=>(0,H.jsxs)(ho,{children:[(0,H.jsx)(ct,{}),(0,H.jsxs)(A.Content,{ref:a,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,H.jsxs)(A.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,H.jsx)(nt.H,{className:"h-4 w-4"}),(0,H.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Z.displayName=A.Content.displayName;var Y=({className:e,...t})=>(0,H.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Y.displayName="DialogHeader";var xo=({className:e,...t})=>(0,H.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xo.displayName="DialogFooter";var ee=we.forwardRef(({className:e,...t},o)=>(0,H.jsx)(A.Title,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));ee.displayName=A.Title.displayName;var yo=we.forwardRef(({className:e,...t},o)=>(0,H.jsx)(A.Description,{ref:o,className:g("text-sm text-muted-foreground",e),...t}));yo.displayName=A.Description.displayName;var dt=require("@radix-ui/react-slot"),mt=require("class-variance-authority"),pt=B(require("react")),Co=(0,mt.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),V=pt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,H.jsx)(e?dt.Slot:"button",{className:g(Co({className:t,size:o,variant:a})),ref:i,...n}));V.displayName="Button";var ft=B(require("react"));var _=ft.forwardRef(({className:e,type:t,...o},a)=>(0,H.jsx)("input",{type:t,className:g("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));_.displayName="Input";var bt=B(require("react")),Be=B(require("@radix-ui/react-label"));var wo=(0,mt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=bt.forwardRef(({className:e,...t},o)=>(0,H.jsx)(Be.Root,{ref:o,className:g(wo(),e),...t}));L.displayName=Be.Root.displayName;var xt=B(require("react")),te=xt.forwardRef(({className:e,...t},o)=>(0,H.jsx)("textarea",{className:g("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));te.displayName="Textarea";var h=B(require("@radix-ui/react-select")),Q=B(require("react")),ge=h.Root;var be=h.Value,re=Q.forwardRef(({children:e,className:t,...o},a)=>(0,H.jsxs)(h.Trigger,{className:g("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...o,children:[e,(0,H.jsx)(h.Icon,{asChild:!0,children:(0,H.jsx)(nt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));re.displayName=h.Trigger.displayName;var Ct=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,H.jsx)(nt.ChevronUp,{className:"h-4 w-4"})}));Ct.displayName=h.ScrollUpButton.displayName;var wt=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,H.jsx)(nt.ChevronDown,{className:"h-4 w-4"})}));wt.displayName=h.ScrollDownButton.displayName;var ae=Q.forwardRef(({children:e,className:t,position:o="popper",...a},n)=>(0,H.jsx)(h.Portal,{children:(0,H.jsxs)(h.Content,{className:g("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:n,...a,children:[(0,H.jsx)(Ct,{}),(0,H.jsx)(h.Viewport,{className:g("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,H.jsx)(wt,{})]})}));ae.displayName=h.Content.displayName;var So=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.Label,{className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));So.displayName=h.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...o},a)=>(0,H.jsxs)(h.Item,{className:g("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...o,children:[(0,H.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,H.jsx)(h.ItemIndicator,{children:(0,H.jsx)(nt.Check,{className:"h-4 w-4"})})}),(0,H.jsx)(h.ItemText,{children:e})]}));ie.displayName=h.Item.displayName;var No=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));No.displayName=h.Separator.displayName;var Se=B(require("@radix-ui/react-checkbox")),Nt=B(require("react")),se=Nt.forwardRef(({className:e,...t},o)=>(0,H.jsx)(Se.Root,{className:g("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,H.jsx)(Se.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,H.jsx)(nt.Check,{className:"h-4 w-4"})})}));se.displayName=Se.Root.displayName;var Ro=(0,mt.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Te({className:e,variant:t,...o}){return(0,H.jsx)("div",{className:g(Ro({variant:t}),e),...o})}var He=B(require("react")),W=B(require("@radix-ui/react-scroll-area"));var ve=He.forwardRef(({className:e,children:t,...o},a)=>(0,H.jsxs)(W.Root,{ref:a,className:g("relative overflow-hidden",e),...o,children:[(0,H.jsx)(W.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,H.jsx)(Dt,{}),(0,H.jsx)(W.Corner,{})]}));ve.displayName=W.Root.displayName;var Dt=He.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,H.jsx)(W.ScrollAreaScrollbar,{ref:a,orientation:t,className:g("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,H.jsx)(W.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Dt.displayName=W.ScrollAreaScrollbar.displayName;function Ve({deal:e,users:t,customer:o,categories:a,onClose:n,onSave:i,onAddComment:d}){var m,R,O;let[r,b]=(0,Ne.useState)({...e,value:e.value||0}),[C,w]=(0,Ne.useState)(""),[y,D]=(0,Ne.useState)(!1),[p,u]=(0,Ne.useState)(null);(0,Ne.useEffect)(()=>{D(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let x=()=>{i(r),D(!1),u(null)},v=(l,E)=>{b(U=>({...U,[l]:E}))},S=l=>{let E=r.categories.includes(l)?r.categories.filter(U=>U!==l):[...r.categories,l];v("categories",E)},T=()=>{C.trim()&&(d({id:Date.now().toString(),text:C,timestamp:new Date().toISOString()}),w(""))},z=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"}},G=(l,E,U)=>{let me=p===l;return(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:E}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[U,me?(0,H.jsx)(_,{value:r[l],onChange:N=>v(l,N.target.value),onBlur:()=>u(null),autoFocus:!0}):(0,H.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>u(l),children:r[l]}),!me&&(0,H.jsx)(V,{variant:"ghost",size:"sm",onClick:()=>u(l),children:(0,H.jsx)(nt.Edit2Icon,{className:"w-4 h-4"})})]})]})};return(0,H.jsx)(fe,{open:!0,children:(0,H.jsxs)(Z,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,H.jsxs)(Y,{className:"flex flex-row items-center justify-between",children:[(0,H.jsx)(ee,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,H.jsxs)("div",{className:"flex space-x-2",children:[(0,H.jsx)(V,{variant:"outline",onClick:n,children:"Close"}),(0,H.jsxs)(V,{onClick:x,disabled:!y,children:[(0,H.jsx)(nt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,H.jsxs)(ve,{className:"flex-grow pr-4",children:[(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,H.jsx)("div",{className:"grid gap-2",children:p==="value"?(0,H.jsx)(_,{type:"number",value:r.value,onChange:l=>v("value",Number(l.target.value)),onBlur:()=>u(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,H.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("value"),children:["\xA3",(m=r.value)==null?void 0:m.toLocaleString()]})}),(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),p==="assignee"?(0,H.jsxs)(ge,{value:((O=(R=r==null?void 0:r.assignee)==null?void 0:R.id)==null?void 0:O.toString())||"",onValueChange:l=>v("assignee",l),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select assignee"})}),(0,H.jsx)(ae,{children:t&&t.map(l=>{var E;return(0,H.jsx)(ie,{value:((E=l==null?void 0:l.id)==null?void 0:E.toString())||"",children:l.name},l.id)})})]}):(0,H.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("assignee"),children:[(0,H.jsx)(nt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,H.jsx)("span",{children:r.assignee.name})]})]}),(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),p==="closureDate"?(0,H.jsx)(_,{type:"date",value:r.closureDate.split("T")[0],onChange:l=>v("closureDate",l.target.value),onBlur:()=>u(null),autoFocus:!0}):(0,H.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("closureDate"),children:[(0,H.jsx)(nt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,H.jsx)("span",{children:new Date(r.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Description"}),p==="description"?(0,H.jsx)(te,{value:r.description,onChange:l=>v("description",l.target.value),onBlur:()=>u(null),className:"min-h-[100px]",autoFocus:!0}):(0,H.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>u("description"),children:r.description})]})}),(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Status"}),p==="status"?(0,H.jsxs)(ge,{value:r.status,onValueChange:l=>{v("status",l),u(null)},children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select status"})}),(0,H.jsx)(ae,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(l=>(0,H.jsx)(ie,{value:l,children:l},l))})]}):(0,H.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("status"),children:r.status})]}),(0,H.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Categories"}),p==="categories"?(0,H.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(l=>(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:l.id,checked:r.categories.includes(l.id),onCheckedChange:()=>S(l.id)}),(0,H.jsx)("label",{htmlFor:l.id,className:`text-sm font-medium ${z(l.type)} px-2 py-1 rounded`,children:l.name})]},l.id))}):(0,H.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("categories"),children:r.categories.map(l=>{let E=a.find(U=>U.id===l);return E?(0,H.jsx)(Te,{variant:"secondary",className:z(E.type),children:E.name},E.id):null})})]})]}),(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,H.jsx)(ve,{className:"h-[200px] overflow-y-auto",children:(0,H.jsx)("div",{className:"space-y-2",children:r.comments.map(l=>(0,H.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,H.jsx)("p",{className:"text-sm text-gray-700",children:l.text}),(0,H.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[l.author," - ",new Date(l.timestamp).toLocaleString()]})]},l.id))})}),(0,H.jsxs)("div",{className:"flex mt-2",children:[(0,H.jsx)(_,{value:C,onChange:l=>w(l.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,H.jsxs)(V,{onClick:T,className:"ml-2",children:[(0,H.jsx)(nt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,H.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.lastModified).toLocaleString()]})]})]})]})})}var le=B(require("react"));var Fe=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Fe.displayName="Card";var We=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("flex flex-col space-y-1.5 p-6",e),...t}));We.displayName="CardHeader";var Ge=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("font-semibold leading-none tracking-tight",e),...t}));Ge.displayName="CardTitle";var Po=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Po.displayName="CardDescription";var Oe=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("p-6 pt-0",e),...t}));Oe.displayName="CardContent";var Do=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("flex items-center p-6 pt-0",e),...t}));Do.displayName="CardFooter";function Ue({deal:e,customer:t,categories:o,onClick:a}){let n=o.find(i=>i.type==="proposition"&&e.categories.includes(i.id));return(0,H.jsxs)(Fe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,H.jsxs)(We,{className:"pb-2",children:[(0,H.jsx)("div",{className:"flex justify-between items-center",children:(0,H.jsx)(Ge,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,H.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,H.jsxs)(Oe,{children:[(0,H.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,H.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,H.jsx)(nt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,H.jsx)("span",{children:e.assignee.name})]}),(0,H.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,H.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,H.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,H.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,H.jsx)(nt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,H.jsx)("span",{children:new Date(e.lastModified).toLocaleDateString()})]})}),(0,H.jsx)("div",{className:"flex justify-between items-left",children:n&&(0,H.jsx)(Te,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:n.name})})]})]})}var Ae=require("react-beautiful-dnd");function _e({onSubmit:e}){var n;let[t,o]=(0,Ne.useState)({name:"",intro:"",active:!0});return(0,H.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)(L,{htmlFor:"customerName",children:"Customer Name"}),(0,H.jsx)(_,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)(L,{htmlFor:"customerIntro",children:"Intro"}),(0,H.jsx)(te,{id:"customerIntro",value:(n=t.intro)!=null?n:"",onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>o({...t,active:i})}),(0,H.jsx)(L,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,H.jsx)(V,{type:"submit",className:"w-full",children:"Add Customer"})]})}function je({customers:e,users:t,categories:o,onSubmit:a,initialDeal:n,onAddCustomer:i,onClose:d}){var S,T,z,G;let[r,b]=(0,Ne.useState)(n||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",lastModified:new Date().toISOString(),comments:[],description:""}),[C,w]=(0,Ne.useState)(!1),[y,D]=(0,Ne.useState)({});(0,Ne.useEffect)(()=>{n&&b(n)},[n]);let p=()=>{let m={};return r.customer||(m.customer="Customer is required"),r.value||(m.value="Value is required"),r.assignee||(m.assignee="Assignee is required"),r.closureDate||(m.closureDate="Closure Date is required"),D(m),Object.keys(m).length===0},u=m=>{m.preventDefault(),p()&&(a({...r,lastModified:new Date().toISOString()}),b({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),D({}),d==null||d())},x=m=>{b(R=>{var O;return{...R,categories:(O=R.categories)!=null&&O.includes(m)?R.categories.filter(l=>l!==m):[...R.categories||[],m]}})},v=m=>{e.push(m),b({...r,customer:m}),w(!1),i(m)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,H.jsx)(ve,{className:"h-[60vh] pr-4",children:(0,H.jsxs)("div",{className:"space-y-6 px-4",children:[(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"customer",children:"Customer"}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsxs)(ge,{value:(T=(S=r.customer)==null?void 0:S.id)==null?void 0:T.toString(),onValueChange:m=>b({...r,customer:{id:Number(m)}}),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select customer"})}),(0,H.jsx)(ae,{children:e.map(m=>{var R;return(0,H.jsx)(ie,{value:((R=m.id)==null?void 0:R.toString())||"",children:m.name},m.id)})})]}),(0,H.jsx)(V,{variant:"outline",size:"icon",onClick:()=>w(!0),children:(0,H.jsx)(nt.PlusIcon,{className:"w-5 h-5"})})]}),y.customerId&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:y.customerId})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"value",children:"Value"}),(0,H.jsx)(_,{id:"value",type:"number",value:r.value||"",onChange:m=>b({...r,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),y.value&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:y.value})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"assignee",children:"Assignee"}),(0,H.jsxs)(ge,{value:(G=(z=r.assignee)==null?void 0:z.id)==null?void 0:G.toString(),onValueChange:m=>b({...r,assignee:{id:Number(m)}}),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select assignee"})}),(0,H.jsx)(ae,{children:t&&t.map(m=>{var R;return(0,H.jsx)(ie,{value:((R=m.id)==null?void 0:R.toString())||"",children:m.name},m.id)})})]}),y.assignee&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:y.assignee})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"description",children:"Description"}),(0,H.jsx)(te,{id:"description",value:r.description||"",onChange:m=>b({...r,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{children:"Categories"}),(0,H.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,H.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(R=>R.type===m).map(R=>{var O;return(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:R.id,checked:(O=r.categories)==null?void 0:O.includes(R.id),onCheckedChange:()=>x(R.id)}),(0,H.jsx)("label",{htmlFor:R.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:R.name})]},R.id)})})]},m))})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"closureDate",children:"Closure Date"}),(0,H.jsx)(_,{id:"closureDate",type:"date",value:r.closureDate,onChange:m=>b({...r,closureDate:m.target.value})}),y.closureDate&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:y.closureDate})]})]})}),(0,H.jsx)(V,{type:"submit",className:"w-full",children:n?"Update Deal":"Add Deal"})]}),(0,H.jsx)(fe,{open:C,onOpenChange:w,children:(0,H.jsxs)(Z,{children:[(0,H.jsx)(Y,{children:(0,H.jsx)(ee,{children:"Add New Customer"})}),(0,H.jsx)(_e,{onSubmit:v})]})})]})}function Ke({status:e,deals:t,users:o,customers:a,categories:n,onDealClick:i,calculateColumnValue:d,calculateWeightedValue:r,addNewDeal:b,onAddCustomer:C}){let[w,y]=(0,Ne.useState)(!1);return(0,H.jsxs)("div",{className:"flex flex-col w-80",children:[(0,H.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),b&&(0,H.jsxs)(fe,{open:w,onOpenChange:y,children:[(0,H.jsx)(lt,{asChild:!0,children:(0,H.jsxs)(V,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,H.jsx)(nt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,H.jsxs)(Z,{children:[(0,H.jsx)(Y,{children:(0,H.jsx)(ee,{children:"Add New Deal"})}),(0,H.jsx)(je,{customers:a,users:o,categories:n,onSubmit:b,onAddCustomer:C,onClose:()=>y(!1)})]})]}),(0,H.jsx)(Ae.Droppable,{droppableId:e,children:D=>(0,H.jsxs)("div",{ref:D.innerRef,...D.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((p,u)=>(0,H.jsx)(Ae.Draggable,{draggableId:p.id.toString(),index:u,children:x=>(0,H.jsx)("div",{ref:x.innerRef,...x.draggableProps,...x.dragHandleProps,children:(0,H.jsx)(Ue,{deal:p,customer:a.find(v=>v.id===p.customer.id),categories:n,onClick:()=>i(p)})})},p.id)),D.placeholder]})}),(0,H.jsxs)("div",{className:"mt-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,H.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,H.jsxs)("span",{className:"text-green-600",children:["\xA3",d(t).toLocaleString()]})]}),(0,H.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,H.jsxs)("span",{className:"text-blue-600",children:["\xA3",r(t,e).toLocaleString()]})]})]})]})}var ko=["Cold","Qualified","Proposal","SoW","Won","Lost"];function To({initialData:e,addNewDeal:t,updateDeal:o,addComment:a,addNewCustomer:n}){let[i,d]=(0,Ne.useState)(null),[r,b]=(0,Ne.useState)(e),C=p=>r.deals.filter(u=>u.status===p),w=p=>p.reduce((u,x)=>u+(x.value||0),0),y=(p,u)=>{let x={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return p.reduce((v,S)=>v+(S.value||0)*x[u],0)},D=(0,Ne.useCallback)(p=>{let{source:u,destination:x}=p;if(!x||u.droppableId===x.droppableId&&u.index===x.index)return;let v=u.droppableId,S=x.droppableId;console.log("Moving from ",v,"to",S);let T=[...r.deals],[z]=T.splice(u.index,1);z.status=S,T.splice(x.index,0,z),b({...r,deals:T}),o(z)},[r,o]);return(0,H.jsx)(Ae.DragDropContext,{onDragEnd:D,children:(0,H.jsxs)("div",{className:"p-4",children:[(0,H.jsx)("div",{className:"flex space-x-4 overflow-x-auto pb-4",children:ko.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{let u=C(p);return(0,H.jsx)(Ke,{status:p,deals:u,customers:e.customers,users:e.users,categories:e.categories,onDealClick:d,calculateColumnValue:w,calculateWeightedValue:y,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:n},p)})}),i&&(0,H.jsx)(Ve,{deal:i,users:e.users,customer:r.customers.find(p=>p.id===i.customer.id),categories:r.categories,onClose:()=>d(null),onSave:o,onAddComment:p=>a(i.id.toString(),p)})]})})}0&&(module.exports={CRMKanbanBoard,DealCard,DealDetails,KanbanColumn,NewCustomerForm,NewDealForm});
|
|
5
|
+
"use strict";var It=Object.create;var De=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Vt=(e,t)=>{for(var o in t)De(e,o,{get:t[o],enumerable:!0})},Xe=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zt(t))!Ht.call(e,n)&&n!==o&&De(e,n,{get:()=>t[n],enumerable:!(a=Et(t,n))||a.enumerable});return e};var B=(e,t,o)=>(o=e!=null?It(Bt(e)):{},Xe(t||!e||!e.__esModule?De(o,"default",{value:e,enumerable:!0}):o,e)),Ft=e=>Xe(De({},"__esModule",{value:!0}),e);var Ao={};Vt(Ao,{CRMKanbanBoard:()=>To,DealCard:()=>Ue,DealDetails:()=>Ve,KanbanColumn:()=>Ke,NewCustomerForm:()=>_e,NewDealForm:()=>je});module.exports=Ft(Ao);var Ne=require("react");var we=B(require("react")),M=B(require("@radix-ui/react-dialog")),nt=require("lucide-react");var st=require("clsx");var ze="-",Wt=e=>{let t=Ot(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{let r=d.split(ze);return r[0]===""&&r.length!==1&&r.shift(),et(r,t)||Gt(d)},getConflictingClassGroupIds:(d,r)=>{let b=o[d]||[];return r&&a[d]?[...b,...a[d]]:b}}},et=(e,t)=>{var d;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?et(e.slice(1),a):void 0;if(n)return n;if(t.validators.length===0)return;let i=e.join(ze);return(d=t.validators.find(({validator:r})=>r(i)))==null?void 0:d.classGroupId},Ze=/^\[(.+)\]$/,Gt=e=>{if(Ze.test(e)){let t=Ze.exec(e)[1],o=t==null?void 0:t.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Ot=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return _t(Object.entries(e.classGroups),o).forEach(([i,d])=>{Ee(d,a,i,t)}),a},Ee=(e,t,o,a)=>{e.forEach(n=>{if(typeof n=="string"){let i=n===""?t:Ye(t,n);i.classGroupId=o;return}if(typeof n=="function"){if(Ut(n)){Ee(n(a),t,o,a);return}t.validators.push({validator:n,classGroupId:o});return}Object.entries(n).forEach(([i,d])=>{Ee(d,Ye(t,i),o,a)})})},Ye=(e,t)=>{let o=e;return t.split(ze).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Ut=e=>e.isThemeGetter,_t=(e,t)=>t?e.map(([o,a])=>{let n=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([d,r])=>[t+d,r])):i);return[o,n]}):e,jt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,n=(i,d)=>{o.set(i,d),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let d=o.get(i);if(d!==void 0)return d;if((d=a.get(i))!==void 0)return n(i,d),d},set(i,d){o.has(i)?o.set(i,d):n(i,d)}}},tt="!",Kt=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,d=r=>{let b=[],C=0,w=0,y;for(let v=0;v<r.length;v++){let S=r[v];if(C===0){if(S===n&&(a||r.slice(v,v+i)===t)){b.push(r.slice(w,v)),w=v+i;continue}if(S==="/"){y=v;continue}}S==="["?C++:S==="]"&&C--}let D=b.length===0?r:r.substring(w),p=D.startsWith(tt),u=p?D.substring(1):D,x=y&&y>w?y-w:void 0;return{modifiers:b,hasImportantModifier:p,baseClassName:u,maybePostfixModifierPosition:x}};return o?r=>o({className:r,parseClassName:d}):d},$t=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},qt=e=>({cache:jt(e.cacheSize),parseClassName:Kt(e),...Wt(e)}),Jt=/\H+/,Qt=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],d=e.trim().split(Jt),r="";for(let b=d.length-1;b>=0;b-=1){let C=d[b],{modifiers:w,hasImportantModifier:y,baseClassName:D,maybePostfixModifierPosition:p}=o(C),u=!!p,x=a(u?D.substring(0,p):D);if(!x){if(!u){r=C+(r.length>0?" "+r:r);continue}if(x=a(D),!x){r=C+(r.length>0?" "+r:r);continue}u=!1}let v=$t(w).join(":"),S=y?v+tt:v,T=S+x;if(i.includes(T))continue;i.push(T);let z=n(x,u);for(let G=0;G<z.length;++G){let m=z[G];i.push(S+m)}r=C+(r.length>0?" "+r:r)}return r};function Xt(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=ot(t))&&(a&&(a+=" "),a+=o);return a}var ot=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=ot(e[a]))&&(o&&(o+=" "),o+=t);return o};function Zt(e,...t){let o,a,n,i=d;function d(b){let C=t.reduce((w,y)=>y(w),e());return o=qt(C),a=o.cache.get,n=o.cache.set,i=r,r(b)}function r(b){let C=a(b);if(C)return C;let w=Qt(b,o);return n(b,w),w}return function(){return i(Xt.apply(null,arguments))}}var P=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},rt=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yt=/^\d+\/\d+$/,eo=new Set(["px","full","screen"]),to=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ro=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ao=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,io=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$=e=>pe(e)||eo.has(e)||Yt.test(e),q=e=>ue(e,"length",fo),pe=e=>!!e&&!Number.isNaN(Number(e)),Ie=e=>ue(e,"number",pe),ye=e=>!!e&&Number.isInteger(Number(e)),so=e=>e.endsWith("%")&&pe(e.slice(0,-1)),f=e=>rt.test(e),J=e=>to.test(e),no=new Set(["length","size","percentage"]),lo=e=>ue(e,no,at),co=e=>ue(e,"position",at),mo=new Set(["image","url"]),po=e=>ue(e,mo,bo),uo=e=>ue(e,"",go),Ce=()=>!0,ue=(e,t,o)=>{let a=rt.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},fo=e=>oo.test(e)&&!ro.test(e),at=()=>!1,go=e=>ao.test(e),bo=e=>io.test(e);var vo=()=>{let e=P("colors"),t=P("spacing"),o=P("blur"),a=P("brightness"),n=P("borderColor"),i=P("borderRadius"),d=P("borderSpacing"),r=P("borderWidth"),b=P("contrast"),C=P("grayscale"),w=P("hueRotate"),y=P("invert"),D=P("gap"),p=P("gradientColorStops"),u=P("gradientColorStopPositions"),x=P("inset"),v=P("margin"),S=P("opacity"),T=P("padding"),z=P("saturate"),G=P("scale"),m=P("sepia"),R=P("skew"),O=P("space"),l=P("translate"),E=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",f,t],N=()=>[f,t],$e=()=>["",$,q],Re=()=>["auto",pe,f],qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Pe=()=>["solid","dashed","dotted","double","none"],Je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Le=()=>["start","end","center","between","around","evenly","stretch"],xe=()=>["","0",f],Qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[pe,f];return{cacheSize:500,separator:":",theme:{colors:[Ce],spacing:[$,q],blur:["none","",J,f],brightness:K(),borderColor:[e],borderRadius:["none","","full",J,f],borderSpacing:N(),borderWidth:$e(),contrast:K(),grayscale:xe(),hueRotate:K(),invert:xe(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[so,q],inset:me(),margin:me(),opacity:K(),padding:N(),saturate:K(),scale:K(),sepia:xe(),skew:K(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",f]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":Qe()}],"break-before":[{"break-before":Qe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...qe(),f]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ye,f]}],basis:[{basis:me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",f]}],grow:[{grow:xe()}],shrink:[{shrink:xe()}],order:[{order:["first","last","none",ye,f]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",ye,f]},f]}],"col-start":[{"col-start":Re()}],"col-end":[{"col-end":Re()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[ye,f]},f]}],"row-start":[{"row-start":Re()}],"row-end":[{"row-end":Re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",f]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",f]}],gap:[{gap:[D]}],"gap-x":[{"gap-x":[D]}],"gap-y":[{"gap-y":[D]}],"justify-content":[{justify:["normal",...Le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",f,t]}],"min-w":[{"min-w":[f,t,"min","max","fit"]}],"max-w":[{"max-w":[f,t,"none","full","min","max","fit","prose",{screen:[J]},J]}],h:[{h:[f,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[f,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[f,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[f,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",Ie]}],"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",f]}],"line-clamp":[{"line-clamp":["none",pe,Ie]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$,f]}],"list-image":[{"list-image":["none",f]}],"list-style-type":[{list:["none","disc","decimal",f]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Pe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$,q]}],"underline-offset":[{"underline-offset":["auto",$,f]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",f]}],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",f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...qe(),co]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},po]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[u]}],"gradient-via-pos":[{via:[u]}],"gradient-to-pos":[{to:[u]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-H":[{"rounded-H":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[r]}],"border-w-x":[{"border-x":[r]}],"border-w-y":[{"border-y":[r]}],"border-w-H":[{"border-H":[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":[S]}],"border-style":[{border:[...Pe(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:Pe()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-H":[{"border-H":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...Pe()]}],"outline-offset":[{"outline-offset":[$,f]}],"outline-w":[{outline:[$,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[$,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",J,uo]}],"shadow-color":[{shadow:[Ce]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Je()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",J,f]}],grayscale:[{grayscale:[C]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[y]}],saturate:[{saturate:[z]}],sepia:[{sepia:[m]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[C]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",f]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",f]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",f]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[ye,f]}],"translate-x":[{"translate-x":[l]}],"translate-y":[{"translate-y":[l]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",f]}],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","H-resize","w-resize","Ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",f]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",f]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[$,q,Ie]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-H","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-H":["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-H","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-H","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var it=Zt(vo);function g(...e){return it((0,st.clsx)(e))}var H=require("react/jsx-runtime"),fe=M.Root,lt=M.Trigger,ho=M.Portal;var ct=we.forwardRef(({className:e,...t},o)=>(0,H.jsx)(M.Overlay,{ref:o,className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ct.displayName=M.Overlay.displayName;var Z=we.forwardRef(({className:e,children:t,...o},a)=>(0,H.jsxs)(ho,{children:[(0,H.jsx)(ct,{}),(0,H.jsxs)(M.Content,{ref:a,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,H.jsxs)(M.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,H.jsx)(nt.H,{className:"h-4 w-4"}),(0,H.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Z.displayName=M.Content.displayName;var Y=({className:e,...t})=>(0,H.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Y.displayName="DialogHeader";var xo=({className:e,...t})=>(0,H.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xo.displayName="DialogFooter";var ee=we.forwardRef(({className:e,...t},o)=>(0,H.jsx)(M.Title,{ref:o,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));ee.displayName=M.Title.displayName;var yo=we.forwardRef(({className:e,...t},o)=>(0,H.jsx)(M.Description,{ref:o,className:g("text-sm text-muted-foreground",e),...t}));yo.displayName=M.Description.displayName;var dt=require("@radix-ui/react-slot"),mt=require("class-variance-authority"),pt=B(require("react")),Co=(0,mt.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-primary text-primary-foreground hover:bg-primary-ON_HOVER",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-secondary/80"}}}),V=pt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,H.jsx)(e?dt.Slot:"button",{className:g(Co({className:t,size:o,variant:a})),ref:i,...n}));V.displayName="Button";var ft=B(require("react"));var _=ft.forwardRef(({className:e,type:t,...o},a)=>(0,H.jsx)("input",{type:t,className:g("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));_.displayName="Input";var bt=B(require("react")),Be=B(require("@radix-ui/react-label"));var wo=(0,mt.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=bt.forwardRef(({className:e,...t},o)=>(0,H.jsx)(Be.Root,{ref:o,className:g(wo(),e),...t}));L.displayName=Be.Root.displayName;var xt=B(require("react")),te=xt.forwardRef(({className:e,...t},o)=>(0,H.jsx)("textarea",{className:g("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));te.displayName="Textarea";var h=B(require("@radix-ui/react-select")),Q=B(require("react")),ge=h.Root;var be=h.Value,re=Q.forwardRef(({children:e,className:t,...o},a)=>(0,H.jsxs)(h.Trigger,{className:g("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...o,children:[e,(0,H.jsx)(h.Icon,{asChild:!0,children:(0,H.jsx)(nt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));re.displayName=h.Trigger.displayName;var Ct=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,H.jsx)(nt.ChevronUp,{className:"h-4 w-4"})}));Ct.displayName=h.ScrollUpButton.displayName;var wt=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,H.jsx)(nt.ChevronDown,{className:"h-4 w-4"})}));wt.displayName=h.ScrollDownButton.displayName;var ae=Q.forwardRef(({children:e,className:t,position:o="popper",...a},n)=>(0,H.jsx)(h.Portal,{children:(0,H.jsxs)(h.Content,{className:g("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,ref:n,...a,children:[(0,H.jsx)(Ct,{}),(0,H.jsx)(h.Viewport,{className:g("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,H.jsx)(wt,{})]})}));ae.displayName=h.Content.displayName;var So=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.Label,{className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));So.displayName=h.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...o},a)=>(0,H.jsxs)(h.Item,{className:g("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...o,children:[(0,H.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,H.jsx)(h.ItemIndicator,{children:(0,H.jsx)(nt.Check,{className:"h-4 w-4"})})}),(0,H.jsx)(h.ItemText,{children:e})]}));ie.displayName=h.Item.displayName;var No=Q.forwardRef(({className:e,...t},o)=>(0,H.jsx)(h.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));No.displayName=h.Separator.displayName;var Se=B(require("@radix-ui/react-checkbox")),Nt=B(require("react")),se=Nt.forwardRef(({className:e,...t},o)=>(0,H.jsx)(Se.Root,{className:g("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,H.jsx)(Se.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,H.jsx)(nt.Check,{className:"h-4 w-4"})})}));se.displayName=Se.Root.displayName;var Ro=(0,mt.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Te({className:e,variant:t,...o}){return(0,H.jsx)("div",{className:g(Ro({variant:t}),e),...o})}var He=B(require("react")),W=B(require("@radix-ui/react-scroll-area"));var ve=He.forwardRef(({className:e,children:t,...o},a)=>(0,H.jsxs)(W.Root,{ref:a,className:g("relative overflow-hidden",e),...o,children:[(0,H.jsx)(W.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,H.jsx)(Dt,{}),(0,H.jsx)(W.Corner,{})]}));ve.displayName=W.Root.displayName;var Dt=He.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,H.jsx)(W.ScrollAreaScrollbar,{ref:a,orientation:t,className:g("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,H.jsx)(W.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Dt.displayName=W.ScrollAreaScrollbar.displayName;function Ve({deal:e,users:t,customer:o,categories:a,onClose:n,onSave:i,onAddComment:d}){var m,R,O;let[r,b]=(0,Ne.useState)({...e,value:e.value||0}),[C,w]=(0,Ne.useState)(""),[y,D]=(0,Ne.useState)(!1),[p,u]=(0,Ne.useState)(null);(0,Ne.useEffect)(()=>{D(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let x=()=>{i(r),D(!1),u(null)},v=(l,E)=>{b(U=>({...U,[l]:E}))},S=l=>{let E=r.categories.includes(l)?r.categories.filter(U=>U!==l):[...r.categories,l];v("categories",E)},T=()=>{C.trim()&&(d({id:Date.now().toString(),text:C,timestamp:new Date().toISOString()}),w(""))},z=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"}},G=(l,E,U)=>{let me=p===l;return(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:E}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[U,me?(0,H.jsx)(_,{value:r[l],onChange:N=>v(l,N.target.value),onBlur:()=>u(null),autoFocus:!0}):(0,H.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>u(l),children:r[l]}),!me&&(0,H.jsx)(V,{variant:"ghost",size:"sm",onClick:()=>u(l),children:(0,H.jsx)(nt.Edit2Icon,{className:"w-4 h-4"})})]})]})};return(0,H.jsx)(fe,{open:!0,children:(0,H.jsxs)(Z,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,H.jsxs)(Y,{className:"flex flex-row items-center justify-between",children:[(0,H.jsx)(ee,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,H.jsxs)("div",{className:"flex space-x-2",children:[(0,H.jsx)(V,{variant:"outline",onClick:n,children:"Close"}),(0,H.jsxs)(V,{onClick:x,disabled:!y,children:[(0,H.jsx)(nt.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,H.jsxs)(ve,{className:"flex-grow pr-4",children:[(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,H.jsx)("div",{className:"grid gap-2",children:p==="value"?(0,H.jsx)(_,{type:"number",value:r.value,onChange:l=>v("value",Number(l.target.value)),onBlur:()=>u(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,H.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("value"),children:["\xA3",(m=r.value)==null?void 0:m.toLocaleString()]})}),(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),p==="assignee"?(0,H.jsxs)(ge,{value:((O=(R=r==null?void 0:r.assignee)==null?void 0:R.id)==null?void 0:O.toString())||"",onValueChange:l=>v("assignee",l),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select assignee"})}),(0,H.jsx)(ae,{children:t&&t.map(l=>{var E;return(0,H.jsx)(ie,{value:((E=l==null?void 0:l.id)==null?void 0:E.toString())||"",children:l.name},l.id)})})]}):(0,H.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("assignee"),children:[(0,H.jsx)(nt.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,H.jsx)("span",{children:r.assignee.name})]})]}),(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),p==="closureDate"?(0,H.jsx)(_,{type:"date",value:r.closureDate.split("T")[0],onChange:l=>v("closureDate",l.target.value),onBlur:()=>u(null),autoFocus:!0}):(0,H.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("closureDate"),children:[(0,H.jsx)(nt.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,H.jsx)("span",{children:new Date(r.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Description"}),p==="description"?(0,H.jsx)(te,{value:r.description,onChange:l=>v("description",l.target.value),onBlur:()=>u(null),className:"min-h-[100px]",autoFocus:!0}):(0,H.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>u("description"),children:r.description})]})}),(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Status"}),p==="status"?(0,H.jsxs)(ge,{value:r.status,onValueChange:l=>{v("status",l),u(null)},children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select status"})}),(0,H.jsx)(ae,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(l=>(0,H.jsx)(ie,{value:l,children:l},l))})]}):(0,H.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("status"),children:r.status})]}),(0,H.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Categories"}),p==="categories"?(0,H.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(l=>(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:l.id,checked:r.categories.includes(l.id),onCheckedChange:()=>S(l.id)}),(0,H.jsx)("label",{htmlFor:l.id,className:`text-sm font-medium ${z(l.type)} px-2 py-1 rounded`,children:l.name})]},l.id))}):(0,H.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>u("categories"),children:r.categories.map(l=>{let E=a.find(U=>U.id===l);return E?(0,H.jsx)(Te,{variant:"secondary",className:z(E.type),children:E.name},E.id):null})})]})]}),(0,H.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,H.jsxs)("div",{className:"grid gap-2",children:[(0,H.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,H.jsx)(ve,{className:"h-[200px] overflow-y-auto",children:(0,H.jsx)("div",{className:"space-y-2",children:r.comments.map(l=>(0,H.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,H.jsx)("p",{className:"text-sm text-gray-700",children:l.text}),(0,H.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[l.author," - ",new Date(l.timestamp).toLocaleString()]})]},l.id))})}),(0,H.jsxs)("div",{className:"flex mt-2",children:[(0,H.jsx)(_,{value:C,onChange:l=>w(l.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,H.jsxs)(V,{onClick:T,className:"ml-2",children:[(0,H.jsx)(nt.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,H.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.updatedAt).toLocaleString()]})]})]})]})})}var le=B(require("react"));var Fe=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Fe.displayName="Card";var We=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("flex flex-col space-y-1.5 p-6",e),...t}));We.displayName="CardHeader";var Ge=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("font-semibold leading-none tracking-tight",e),...t}));Ge.displayName="CardTitle";var Po=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("text-sm text-muted-foreground",e),...t}));Po.displayName="CardDescription";var Oe=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("p-6 pt-0",e),...t}));Oe.displayName="CardContent";var Do=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("flex items-center p-6 pt-0",e),...t}));Do.displayName="CardFooter";function Ue({deal:e,customer:t,categories:o,onClick:a}){let n=o.find(i=>i.type==="proposition"&&e.categories.includes(i.id));return(0,H.jsxs)(Fe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,H.jsxs)(We,{className:"pb-2",children:[(0,H.jsx)("div",{className:"flex justify-between items-center",children:(0,H.jsx)(Ge,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,H.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,H.jsxs)(Oe,{children:[(0,H.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,H.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,H.jsx)(nt.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,H.jsx)("span",{children:e.assignee.name})]}),(0,H.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,H.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,H.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,H.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,H.jsx)(nt.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,H.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,H.jsx)("div",{className:"flex justify-between items-left",children:n&&(0,H.jsx)(Te,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:n.name})})]})]})}var Me=require("react-beautiful-dnd");function _e({onSubmit:e}){var n;let[t,o]=(0,Ne.useState)({name:"",intro:"",active:!0});return(0,H.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),o({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)(L,{htmlFor:"customerName",children:"Customer Name"}),(0,H.jsx)(_,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)(L,{htmlFor:"customerIntro",children:"Intro"}),(0,H.jsx)(te,{id:"customerIntro",value:(n=t.intro)!=null?n:"",onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>o({...t,active:i})}),(0,H.jsx)(L,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,H.jsx)(V,{type:"submit",className:"w-full",children:"Add Customer"})]})}function je({customers:e,users:t,categories:o,onSubmit:a,initialDeal:n,onAddCustomer:i,onClose:d}){var S,T,z,G;let[r,b]=(0,Ne.useState)(n||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[C,w]=(0,Ne.useState)(!1),[y,D]=(0,Ne.useState)({});(0,Ne.useEffect)(()=>{n&&b(n)},[n]);let p=()=>{let m={};return r.customer||(m.customer="Customer is required"),r.value||(m.value="Value is required"),r.assignee||(m.assignee="Assignee is required"),r.closureDate||(m.closureDate="Closure Date is required"),D(m),Object.keys(m).length===0},u=m=>{m.preventDefault(),p()&&(a({...r}),b({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),D({}),d==null||d())},x=m=>{b(R=>{var O;return{...R,categories:(O=R.categories)!=null&&O.includes(m)?R.categories.filter(l=>l!==m):[...R.categories||[],m]}})},v=m=>{e.push(m),b({...r,customer:m}),w(!1),i(m)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,H.jsx)(ve,{className:"h-[60vh] pr-4",children:(0,H.jsxs)("div",{className:"space-y-6 px-4",children:[(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"customer",children:"Customer"}),(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsxs)(ge,{value:(T=(S=r.customer)==null?void 0:S.id)==null?void 0:T.toString(),onValueChange:m=>b({...r,customer:{id:Number(m)}}),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select customer"})}),(0,H.jsx)(ae,{children:e.map(m=>{var R;return(0,H.jsx)(ie,{value:((R=m.id)==null?void 0:R.toString())||"",children:m.name},m.id)})})]}),(0,H.jsx)(V,{variant:"outline",size:"icon",onClick:()=>w(!0),children:(0,H.jsx)(nt.PlusIcon,{className:"w-5 h-5"})})]}),y.customerId&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:y.customerId})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"value",children:"Value"}),(0,H.jsx)(_,{id:"value",type:"number",value:r.value||"",onChange:m=>b({...r,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),y.value&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:y.value})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"assignee",children:"Assignee"}),(0,H.jsxs)(ge,{value:(G=(z=r.assignee)==null?void 0:z.id)==null?void 0:G.toString(),onValueChange:m=>b({...r,assignee:{id:Number(m)}}),children:[(0,H.jsx)(re,{children:(0,H.jsx)(be,{placeholder:"Select assignee"})}),(0,H.jsx)(ae,{children:t&&t.map(m=>{var R;return(0,H.jsx)(ie,{value:((R=m.id)==null?void 0:R.toString())||"",children:m.name},m.id)})})]}),y.assignee&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:y.assignee})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"description",children:"Description"}),(0,H.jsx)(te,{id:"description",value:r.description||"",onChange:m=>b({...r,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{children:"Categories"}),(0,H.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,H.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(R=>R.type===m).map(R=>{var O;return(0,H.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,H.jsx)(se,{id:R.id,checked:(O=r.categories)==null?void 0:O.includes(R.id),onCheckedChange:()=>x(R.id)}),(0,H.jsx)("label",{htmlFor:R.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:R.name})]},R.id)})})]},m))})]}),(0,H.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,H.jsx)(L,{htmlFor:"closureDate",children:"Closure Date"}),(0,H.jsx)(_,{id:"closureDate",type:"date",value:r.closureDate,onChange:m=>b({...r,closureDate:m.target.value})}),y.closureDate&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:y.closureDate})]})]})}),(0,H.jsx)(V,{type:"submit",className:"w-full",children:n?"Update Deal":"Add Deal"})]}),(0,H.jsx)(fe,{open:C,onOpenChange:w,children:(0,H.jsxs)(Z,{children:[(0,H.jsx)(Y,{children:(0,H.jsx)(ee,{children:"Add New Customer"})}),(0,H.jsx)(_e,{onSubmit:v})]})})]})}function Ke({status:e,deals:t,users:o,customers:a,categories:n,onDealClick:i,calculateColumnValue:d,calculateWeightedValue:r,addNewDeal:b,onAddCustomer:C}){let[w,y]=(0,Ne.useState)(!1);return(0,H.jsxs)("div",{className:"flex flex-col w-80",children:[(0,H.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),b&&(0,H.jsxs)(fe,{open:w,onOpenChange:y,children:[(0,H.jsx)(lt,{asChild:!0,children:(0,H.jsxs)(V,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,H.jsx)(nt.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,H.jsxs)(Z,{children:[(0,H.jsx)(Y,{children:(0,H.jsx)(ee,{children:"Add New Deal"})}),(0,H.jsx)(je,{customers:a,users:o,categories:n,onSubmit:b,onAddCustomer:C,onClose:()=>y(!1)})]})]}),(0,H.jsx)(Me.Droppable,{droppableId:e,children:D=>(0,H.jsxs)("div",{ref:D.innerRef,...D.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((p,u)=>(0,H.jsx)(Me.Draggable,{draggableId:p.id.toString(),index:u,children:x=>(0,H.jsx)("div",{ref:x.innerRef,...x.draggableProps,...x.dragHandleProps,children:(0,H.jsx)(Ue,{deal:p,customer:a.find(v=>v.id===p.customer.id),categories:n,onClick:()=>i(p)})})},p.id)),D.placeholder]})}),(0,H.jsxs)("div",{className:"mt-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,H.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,H.jsxs)("span",{className:"text-green-600",children:["\xA3",d(t).toLocaleString()]})]}),(0,H.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,H.jsxs)("span",{className:"text-blue-600",children:["\xA3",r(t,e).toLocaleString()]})]})]})]})}var ko=["Cold","Qualified","Proposal","SoW","Won","Lost"];function To({initialData:e,addNewDeal:t,updateDeal:o,addComment:a,addNewCustomer:n}){let[i,d]=(0,Ne.useState)(null),[r,b]=(0,Ne.useState)(e),C=p=>r.deals.filter(u=>u.status===p),w=p=>p.reduce((u,x)=>u+(x.value||0),0),y=(p,u)=>{let x={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return p.reduce((v,S)=>v+(S.value||0)*x[u],0)},D=(0,Ne.useCallback)(p=>{let{source:u,destination:x}=p;if(!x||u.droppableId===x.droppableId&&u.index===x.index)return;let v=u.droppableId,S=x.droppableId;console.log("Moving from ",v,"to",S);let T=[...r.deals],[z]=T.splice(u.index,1);z.status=S,T.splice(x.index,0,z),b({...r,deals:T}),o(z)},[r,o]);return(0,H.jsx)(Me.DragDropContext,{onDragEnd:D,children:(0,H.jsxs)("div",{className:"p-4",children:[(0,H.jsx)("div",{className:"flex space-x-4 overflow-x-auto pb-4",children:ko.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{let u=C(p);return(0,H.jsx)(Ke,{status:p,deals:u,customers:e.customers,users:e.users,categories:e.categories,onDealClick:d,calculateColumnValue:w,calculateWeightedValue:y,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:n},p)})}),i&&(0,H.jsx)(Ve,{deal:i,users:e.users,customer:r.customers.find(p=>p.id===i.customer.id),categories:r.categories,onClose:()=>d(null),onSave:o,onAddComment:p=>a(i.id.toString(),p)})]})})}0&&(module.exports={CRMKanbanBoard,DealCard,DealDetails,KanbanColumn,NewCustomerForm,NewDealForm});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"../../chunk-
|
|
1
|
+
import{a as f}from"../../chunk-SG5H4A2U.mjs";import{a as e}from"../../chunk-LRIIP54N.mjs";import{a as d}from"../../chunk-ZXPDKKGX.mjs";import{a as c}from"../../chunk-3FW5YDNM.mjs";import{a as b}from"../../chunk-QH3BNFVD.mjs";import{a}from"../../chunk-6TQAMZEH.mjs";import"../../chunk-4NKKWJ2X.mjs";import"../../chunk-4JC2TJML.mjs";import"../../chunk-JWDVKGZL.mjs";import"../../chunk-A5EYIB3V.mjs";import"../../chunk-DWRQHV42.mjs";import"../../chunk-Y5ZFXDW5.mjs";import"../../chunk-QOIH63J3.mjs";import"../../chunk-Q6SEVCRG.mjs";import"../../chunk-GLEWUUGS.mjs";import"../../chunk-D76EO57Z.mjs";import"../../chunk-NIQ4466A.mjs";import"../../chunk-6K2R3OAD.mjs";import"../../chunk-S7OK7D5I.mjs";export{f as CRMKanbanBoard,b as DealCard,a as DealDetails,e as KanbanColumn,c as NewCustomerForm,d as NewDealForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var a in e)r(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of l(e))!p.call(t,o)&&o!==a&&r(t,o,{get:()=>e[o],enumerable:!(i=c(e,o))||i.enumerable});return t};var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var a in e)r(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of l(e))!p.call(t,o)&&o!==a&&r(t,o,{get:()=>e[o],enumerable:!(i=c(e,o))||i.enumerable});return t};var A=t=>h(r({},"__esModule",{value:!0}),t);var y={};u(y,{mockBoardData:()=>C,mockCategories:()=>m,mockCustomers:()=>s,mockDeals:()=>n,mockStatuses:()=>g,mockUsers:()=>d});module.exports=A(y);var s=[{id:1,name:"Acme Corp",intro:"A leading technology company",active:!0},{id:2,name:"GlobalTech",intro:"Innovative solutions provider",active:!0},{id:3,name:"InnoSystems",intro:"Cutting-edge software development",active:!1}],m=[{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"}],n=[{id:1,customer:{id:1,name:"Acme Corp",active:!0},value:5e4,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:["1","3","5"],dateLogged:"2023-01-15",closureDate:"2023-06-30",updatedAt:"2023-05-01T10:00:00Z",comments:[{id:"1",text:"Initial contact made",author:"John Doe",timestamp:"2023-01-15T09:00:00Z"}],description:"Potential software solution for Acme Corp"},{id:2,customer:{id:2,name:"GlobalTech",active:!0},value:75e3,assignee:{id:2,name:"Jane Smith"},status:"Proposal",categories:["2","4","6"],dateLogged:"2023-02-01",closureDate:"2023-07-31",updatedAt:"2023-05-10T14:30:00Z",comments:[{id:"2",text:"Proposal sent",author:"Jane Smith",timestamp:"2023-05-10T14:30:00Z"}],description:"Custom hardware solution for GlobalTech"}],d=[{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"}],C={deals:n,users:d,customers:s,categories:m},g=["Cold","Qualified","Proposal","Won","Lost"];0&&(module.exports={mockBoardData,mockCategories,mockCustomers,mockDeals,mockStatuses,mockUsers});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../../chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"../../chunk-3EVGORF6.mjs";import"../../chunk-S7OK7D5I.mjs";export{e as mockBoardData,b as mockCategories,a as mockCustomers,c as mockDeals,f as mockStatuses,d as mockUsers};
|