cortex-react-components 1.42.5 → 1.42.7
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-423OEU3K.mjs → chunk-23EQTK7B.mjs} +1 -1
- package/dist/{chunk-NOQUNWQW.mjs → chunk-3W5FR6O2.mjs} +1 -1
- package/dist/{chunk-74TGU5CZ.mjs → chunk-4KGFHVYD.mjs} +1 -1
- package/dist/{chunk-YQZH5MJU.mjs → chunk-4L4RAUPG.mjs} +1 -1
- package/dist/chunk-4NETKTTT.mjs +1 -0
- package/dist/{chunk-NLTSDI7A.mjs → chunk-4R7S6EEU.mjs} +1 -1
- package/dist/{chunk-YDGF5GEU.mjs → chunk-4ZT572BM.mjs} +1 -1
- package/dist/{chunk-Q77U5BXI.mjs → chunk-AEDBEVEE.mjs} +1 -1
- package/dist/{chunk-AS3NR4OU.mjs → chunk-AEPYNOEK.mjs} +1 -1
- package/dist/chunk-AHLX3GTH.mjs +1 -0
- package/dist/{chunk-M7BWRL34.mjs → chunk-EW2X7RMJ.mjs} +1 -1
- package/dist/{chunk-ZCPNHUKK.mjs → chunk-HW7IFZXS.mjs} +1 -1
- package/dist/{chunk-QIGWPB3D.mjs → chunk-HZ5QHCGZ.mjs} +1 -1
- package/dist/{chunk-VWNFINDU.mjs → chunk-ICWOOSJR.mjs} +1 -1
- package/dist/{chunk-3ZRLTNWG.mjs → chunk-J3QZZ62Z.mjs} +1 -1
- package/dist/chunk-KDERFUAW.mjs +4 -0
- package/dist/{chunk-ICTOXY7D.mjs → chunk-NGK3IDFP.mjs} +1 -1
- package/dist/{chunk-Q5EQOIL7.mjs → chunk-PBAL3B6N.mjs} +1 -1
- package/dist/{chunk-UK4IPFAO.mjs → chunk-PVRWMAHW.mjs} +1 -1
- package/dist/{chunk-7322R3ID.mjs → chunk-REHZTVVN.mjs} +1 -1
- package/dist/{chunk-AF5ISZTG.mjs → chunk-ROEHSKFW.mjs} +1 -1
- package/dist/{chunk-DF3LBG6O.mjs → chunk-U3RGJJNS.mjs} +1 -1
- package/dist/{chunk-MANZDSTF.mjs → chunk-UD7JYMRU.mjs} +1 -1
- package/dist/{chunk-PV5S3GA7.mjs → chunk-WPTEMDOP.mjs} +1 -1
- package/dist/{chunk-R7P4VVM3.mjs → chunk-XBBQGSYP.mjs} +1 -1
- package/dist/{chunk-HUN2X4VH.mjs → chunk-Y6CZVVJF.mjs} +1 -1
- package/dist/{chunk-HVA2GFDG.mjs → chunk-YDQUZWFZ.mjs} +1 -1
- package/dist/{chunk-YOOGQIDR.mjs → chunk-YKDVNCHV.mjs} +1 -1
- package/dist/{chunk-D3PXELYK.mjs → chunk-ZOLLFX4E.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
- package/dist/components/Blocks/FeaturesBlock.stories.mjs +1 -1
- package/dist/components/Blocks/ImageBlock.mjs +1 -1
- package/dist/components/Blocks/MediaBlock.mjs +1 -1
- package/dist/components/Blocks/RelatedPosts.mjs +1 -1
- package/dist/components/Blocks/RenderBlocks.mjs +1 -1
- package/dist/components/Blocks/index.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.stories.js +1 -1
- package/dist/components/CRM/KanbanColumn.stories.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/CRM/types.js +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/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/BlogList.mjs +1 -1
- package/dist/components/Layouts/BlogList.stories.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/SlideShow.stories.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Payload/Card/index.mjs +1 -1
- package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
- package/dist/components/Payload/Media/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/RichText.stories.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/index.js +3 -3
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +3 -3
- 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/AboutSection.mjs +1 -1
- package/dist/sections/AboutSection.stories.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogDetail.stories.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/ContactSection.stories.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/PricingSection.stories.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-3EVGORF6.mjs +0 -1
- package/dist/chunk-6TQAMZEH.mjs +0 -1
- package/dist/chunk-SG5H4A2U.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
"use strict";var pt=Object.create;var ne=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var ft=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var bt=(e,t)=>{for(var o in t)ne(e,o,{get:t[o],enumerable:!0})},Ae=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ut(t))!gt.call(e,l)&&l!==o&&ne(e,l,{get:()=>t[l],enumerable:!(r=mt(t,l))||r.enumerable});return e};var A=(e,t,o)=>(o=e!=null?pt(ft(e)):{},Ae(t||!e||!e.__esModule?ne(o,"default",{value:e,enumerable:!0}):o,e)),vt=e=>Ae(ne({},"__esModule",{value:!0}),e);var lo={};bt(lo,{Default:()=>dt,WithManyComments:()=>so,default:()=>ao});module.exports=vt(lo);var _=require("react");var oe=A(require("react")),w=A(require("@radix-ui/react-dialog")),We=require("lucide-react");var Ge=require("clsx");var ge="-",ht=e=>{let t=xt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{let a=c.split(ge);return a[0]===""&&a.length!==1&&a.shift(),ze(a,t)||yt(c)},getConflictingClassGroupIds:(c,a)=>{let v=o[c]||[];return a&&r[c]?[...v,...r[c]]:v}}},ze=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),l=r?ze(e.slice(1),r):void 0;if(l)return l;if(t.validators.length===0)return;let n=e.join(ge);return(c=t.validators.find(({validator:a})=>a(n)))==null?void 0:c.classGroupId},Te=/^\[(.+)\]$/,yt=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}},xt=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return St(Object.entries(e.classGroups),o).forEach(([n,c])=>{fe(c,r,n,t)}),r},fe=(e,t,o,r)=>{e.forEach(l=>{if(typeof l=="string"){let n=l===""?t:Me(t,l);n.classGroupId=o;return}if(typeof l=="function"){if(wt(l)){fe(l(r),t,o,r);return}t.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([n,c])=>{fe(c,Me(t,n),o,r)})})},Me=(e,t)=>{let o=e;return t.split(ge).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},wt=e=>e.isThemeGetter,St=(e,t)=>t?e.map(([o,r])=>{let l=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([c,a])=>[t+c,a])):n);return[o,l]}):e,Ct=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,l=(n,c)=>{o.set(n,c),t++,t>e&&(t=0,r=o,o=new Map)};return{get(n){let c=o.get(n);if(c!==void 0)return c;if((c=r.get(n))!==void 0)return l(n,c),c},set(n,c){o.has(n)?o.set(n,c):l(n,c)}}},Ie="!",Pt=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,l=t[0],n=t.length,c=a=>{let v=[],y=0,S=0,D;for(let u=0;u<a.length;u++){let C=a[u];if(y===0){if(C===l&&(r||a.slice(u,u+n)===t)){v.push(a.slice(S,u)),S=u+n;continue}if(C==="/"){D=u;continue}}C==="["?y++:C==="]"&&y--}let N=v.length===0?a:a.substring(S),P=N.startsWith(Ie),g=P?N.substring(1):N,x=D&&D>S?D-S:void 0;return{modifiers:v,hasImportantModifier:P,baseClassName:g,maybePostfixModifierPosition:x}};return o?a=>o({className:a,parseClassName:c}):c},Rt=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},Nt=e=>({cache:Ct(e.cacheSize),parseClassName:Pt(e),...ht(e)}),kt=/\s+/,Dt=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:l}=t,n=[],c=e.trim().split(kt),a="";for(let v=c.length-1;v>=0;v-=1){let y=c[v],{modifiers:S,hasImportantModifier:D,baseClassName:N,maybePostfixModifierPosition:P}=o(y),g=!!P,x=r(g?N.substring(0,P):N);if(!x){if(!g){a=y+(a.length>0?" "+a:a);continue}if(x=r(N),!x){a=y+(a.length>0?" "+a:a);continue}g=!1}let u=Rt(S).join(":"),C=D?u+Ie:u,k=C+x;if(n.includes(k))continue;n.push(k);let V=l(x,g);for(let G=0;G<V.length;++G){let U=V[G];n.push(C+U)}a=y+(a.length>0?" "+a:a)}return a};function At(){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 Tt(e,...t){let o,r,l,n=c;function c(v){let y=t.reduce((S,D)=>D(S),e());return o=Nt(y),r=o.cache.get,l=o.cache.set,n=a,a(v)}function a(v){let y=r(v);if(y)return y;let S=Dt(v,o);return l(v,S),S}return function(){return n(At.apply(null,arguments))}}var b=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ee=/^\[(?:([a-z-]+):)?(.+)\]$/T,Mt=/^\d+\/\d+$/,zt=new Set(["px","full","screen"]),It=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|T|T|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Et=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Bt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,E=e=>J(e)||zt.has(e)||Mt.test(e),W=e=>Z(e,"length",_t),J=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>Z(e,"number",J),ee=e=>!!e&&Number.isInteger(Number(e)),Gt=e=>e.endsWith("%")&&J(e.slice(0,-1)),d=e=>Ee.test(e),H=e=>It.test(e),Wt=new Set(["length","size","percentage"]),Ht=e=>Z(e,Wt,Be),Ot=e=>Z(e,"position",Be),Ft=new Set(["image","url"]),Ut=e=>Z(e,Ft,Jt),jt=e=>Z(e,"",$t),te=()=>!0,Z=(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},_t=e=>Lt.test(e)&&!Et.test(e),Be=()=>!1,$t=e=>Bt.test(e),Jt=e=>Vt.test(e);var Zt=()=>{let e=b("colors"),t=b("spacing"),o=b("blur"),r=b("brightness"),l=b("borderColor"),n=b("borderRadius"),c=b("borderSpacing"),a=b("borderWidth"),v=b("contrast"),y=b("grayscale"),S=b("hueRotate"),D=b("invert"),N=b("gap"),P=b("gradientColorStops"),g=b("gradientColorStopPositions"),x=b("inset"),u=b("margin"),C=b("opacity"),k=b("padding"),V=b("saturate"),G=b("scale"),U=b("sepia"),X=b("skew"),K=b("space"),s=b("translate"),R=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",d,t],f=()=>[d,t],Re=()=>["",E,W],ae=()=>["auto",J,d],Ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ie=()=>["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"],me=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",d],De=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[J,d];return{cacheSize:500,separator:":",theme:{colors:[te],spacing:[E,W],blur:["none","",H,d],brightness:L(),borderColor:[e],borderRadius:["none","","full",H,d],borderSpacing:f(),borderWidth:Re(),contrast:L(),grayscale:Y(),hueRotate:L(),invert:Y(),gap:f(),gradientColorStops:[e],gradientColorStopPositions:[Gt,W],inset:$(),margin:$(),opacity:L(),padding:f(),saturate:L(),scale:L(),sepia:Y(),skew:L(),space:f(),translate:f()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[H]}],"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:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],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",ee,d]}],basis:[{basis:$()}],"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:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",ee,d]}],"grid-cols":[{"grid-cols":[te]}],"col-start-end":[{col:["auto",{span:["full",ee,d]},d]}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":[te]}],"row-start-end":[{row:["auto",{span:[ee,d]},d]}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"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",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[K]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[K]}],"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:[H]},H]}],T:[{T:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-T":[{"min-T":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-T":[{"max-T":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",H,W]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[te]}],"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,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",E,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":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",E,W]}],"underline-offset":[{"underline-offset":["auto",E,d]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",d]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",d]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ne(),Ot]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ht]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ut]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[P]}],"gradient-via":[{via:[P]}],"gradient-to":[{to:[P]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[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":[C]}],"border-style":[{border:[...ie(),"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":[C]}],"divide-style":[{divide:ie()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...ie()]}],"outline-offset":[{"outline-offset":[E,d]}],"outline-w":[{outline:[E,W]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[E,W]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",H,jt]}],"shadow-color":[{shadow:[te]}],opacity:[{opacity:[C]}],"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:[v]}],"drop-shadow":[{"drop-shadow":["","none",H,d]}],grayscale:[{grayscale:[y]}],"hue-rotate":[{"hue-rotate":[S]}],invert:[{invert:[D]}],saturate:[{saturate:[V]}],sepia:[{sepia:[U]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S]}],"backdrop-invert":[{"backdrop-invert":[D]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[V]}],"backdrop-sepia":[{"backdrop-sepia":[U]}],"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:L()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[ee,d]}],"translate-x":[{"translate-x":[s]}],"translate-y":[{"translate-y":[s]}],"skew-x":[{"skew-x":[X]}],"skew-y":[{"skew-y":[X]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",d]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",d]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-pe":[{"scroll-pe":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","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:[E,W,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","T"],"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 Ve=Tt(Zt);function m(...e){return Ve((0,Ge.clsx)(e))}var T=require("react/jsx-runtime"),He=w.Root;var qt=w.Portal;var Oe=oe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(w.Overlay,{ref:o,className:m("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}));Oe.displayName=w.Overlay.displayName;var be=oe.forwardRef(({className:e,children:t,...o},r)=>(0,T.jsxs)(qt,{children:[(0,T.jsx)(Oe,{}),(0,T.jsxs)(w.Content,{ref:r,className:m("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,T.jsxs)(w.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,T.jsx)(We.X,{className:"T-4 w-4"}),(0,T.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));be.displayName=w.Content.displayName;var ve=({className:e,...t})=>(0,T.jsx)("div",{className:m("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ve.displayName="DialogHeader";var Qt=({className:e,...t})=>(0,T.jsx)("div",{className:m("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qt.displayName="DialogFooter";var he=oe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(w.Title,{ref:o,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}));he.displayName=w.Title.displayName;var Xt=oe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(w.Description,{ref:o,className:m("text-sm text-muted-foreground",e),...t}));Xt.displayName=w.Description.displayName;var Fe=require("@radix-ui/react-slot"),Ue=require("class-variance-authority"),je=A(require("react")),Kt=(0,Ue.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:"T-10 px-4 py-2",icon:"T-10 w-10",lg:"T-11 rounded px-8",sm:"T-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"}}}),q=je.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...l},n)=>(0,T.jsx)(e?Fe.Slot:"button",{className:m(Kt({className:t,size:o,variant:r})),ref:n,...l}));q.displayName="Button";var $e=A(require("react"));var Q=$e.forwardRef(({className:e,type:t,...o},r)=>(0,T.jsx)("input",{type:t,className:m("flex T-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 Ze=A(require("react")),ye=A(require("@radix-ui/react-label"));var Yt=(0,Ue.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),B=Ze.forwardRef(({className:e,...t},o)=>(0,T.jsx)(ye.Root,{ref:o,className:m(Yt(),e),...t}));B.displayName=ye.Root.displayName;var Xe=A(require("react")),xe=Xe.forwardRef(({className:e,...t},o)=>(0,T.jsx)("textarea",{className:m("flex min-T-[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}));xe.displayName="Textarea";var p=A(require("@radix-ui/react-select")),O=A(require("react")),we=p.Root;var Se=p.Value,se=O.forwardRef(({children:e,className:t,...o},r)=>(0,T.jsxs)(p.Trigger,{className:m("flex T-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,T.jsx)(p.Icon,{asChild:!0,children:(0,T.jsx)(We.ChevronDown,{className:"T-4 w-4 opacity-50"})})]}));se.displayName=p.Trigger.displayName;var Ye=O.forwardRef(({className:e,...t},o)=>(0,T.jsx)(p.ScrollUpButton,{className:m("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(We.ChevronUp,{className:"T-4 w-4"})}));Ye.displayName=p.ScrollUpButton.displayName;var et=O.forwardRef(({className:e,...t},o)=>(0,T.jsx)(p.ScrollDownButton,{className:m("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(We.ChevronDown,{className:"T-4 w-4"})}));et.displayName=p.ScrollDownButton.displayName;var le=O.forwardRef(({children:e,className:t,position:o="popper",...r},l)=>(0,T.jsx)(p.Portal,{children:(0,T.jsxs)(p.Content,{className:m("relative z-50 max-T-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:l,...r,children:[(0,T.jsx)(Ye,{}),(0,T.jsx)(p.Viewport,{className:m("p-1",o==="popper"&&"T-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,T.jsx)(et,{})]})}));le.displayName=p.Content.displayName;var eo=O.forwardRef(({className:e,...t},o)=>(0,T.jsx)(p.Label,{className:m("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));eo.displayName=p.Label.displayName;var ce=O.forwardRef(({children:e,className:t,...o},r)=>(0,T.jsxs)(p.Item,{className:m("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,T.jsx)("span",{className:"absolute left-2 flex T-3.5 w-3.5 items-center justify-center",children:(0,T.jsx)(p.ItemIndicator,{children:(0,T.jsx)(We.Check,{className:"T-4 w-4"})})}),(0,T.jsx)(p.ItemText,{children:e})]}));ce.displayName=p.Item.displayName;var to=O.forwardRef(({className:e,...t},o)=>(0,T.jsx)(p.Separator,{className:m("-mx-1 my-1 T-px bg-muted",e),ref:o,...t}));to.displayName=p.Separator.displayName;var re=A(require("@radix-ui/react-checkbox")),ot=A(require("react")),Ce=ot.forwardRef(({className:e,...t},o)=>(0,T.jsx)(re.Root,{className:m("peer T-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,T.jsx)(re.Indicator,{className:m("flex items-center justify-center text-current"),children:(0,T.jsx)(We.Check,{className:"T-4 w-4"})})}));Ce.displayName=re.Root.displayName;var oo=(0,Ue.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 at({className:e,variant:t,...o}){return(0,T.jsx)("div",{className:m(oo({variant:t}),e),...o})}var Pe=A(require("react")),M=A(require("@radix-ui/react-scroll-area"));var pe=Pe.forwardRef(({className:e,children:t,...o},r)=>(0,T.jsxs)(M.Root,{ref:r,className:m("relative overflow-hidden",e),...o,children:[(0,T.jsx)(M.Viewport,{className:"T-full w-full rounded-[inherit]",children:t}),(0,T.jsx)(nt,{}),(0,T.jsx)(M.Corner,{})]}));pe.displayName=M.Root.displayName;var nt=Pe.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,T.jsx)(M.ScrollAreaScrollbar,{ref:r,orientation:t,className:m("flex touch-none select-none transition-colors",t==="vertical"&&"T-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"T-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,T.jsx)(M.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));nt.displayName=M.ScrollAreaScrollbar.displayName;function st({deal:e,users:t,customer:o,categories:r,onClose:l,onSave:n,onAddComment:c}){var U,X,K;let[a,v]=(0,_.useState)({...e,value:e.value||0}),[y,S]=(0,_.useState)(""),[D,N]=(0,_.useState)(!1),[P,g]=(0,_.useState)(null);(0,_.useEffect)(()=>{N(JSON.stringify(e)!==JSON.stringify(a))},[e,a]);let x=()=>{n(a),N(!1),g(null)},u=(s,R)=>{v(z=>({...z,[s]:R}))},C=s=>{let R=a.categories.includes(s)?a.categories.filter(z=>z!==s):[...a.categories,s];u("categories",R)},k=()=>{y.trim()&&(c({id:Date.now().toString(),text:y,timestamp:new Date().toISOString()}),S(""))},V=s=>{switch(s){case"proposition":return"bg-blue-100 text-blue-800";case"source":return"bg-green-100 text-green-800";case"sector":return"bg-purple-100 text-purple-800";default:return"bg-gray-100 text-gray-800"}},G=(s,R,z)=>{let $=P===s;return(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:R}),(0,T.jsxs)("div",{className:"flex items-center space-x-2",children:[z,$?(0,T.jsx)(Q,{value:a[s],onChange:f=>u(s,f.target.value),onBlur:()=>g(null),autoFocus:!0}):(0,T.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>g(s),children:a[s]}),!$&&(0,T.jsx)(q,{variant:"ghost",size:"sm",onClick:()=>g(s),children:(0,T.jsx)(We.Edit2Icon,{className:"w-4 T-4"})})]})]})};return(0,T.jsx)(He,{open:!0,children:(0,T.jsxs)(be,{className:"max-w-3xl max-T-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,T.jsxs)(ve,{className:"flex flex-row items-center justify-between",children:[(0,T.jsx)(he,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,T.jsxs)("div",{className:"flex space-x-2",children:[(0,T.jsx)(q,{variant:"outline",onClick:l,children:"Close"}),(0,T.jsxs)(q,{onClick:x,disabled:!D,children:[(0,T.jsx)(We.SaveIcon,{className:"w-4 T-4 mr-2"}),"Save"]})]})]}),(0,T.jsxs)(pe,{className:"flex-grow pr-4",children:[(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,T.jsx)("div",{className:"grid gap-2",children:P==="value"?(0,T.jsx)(Q,{type:"number",value:a.value,onChange:s=>u("value",Number(s.target.value)),onBlur:()=>g(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,T.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("value"),children:["\xA3",(U=a.value)==null?void 0:U.toLocaleString()]})}),(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),P==="assignee"?(0,T.jsxs)(we,{value:((K=(X=a==null?void 0:a.assignee)==null?void 0:X.id)==null?void 0:K.toString())||"",onValueChange:s=>u("assignee",s),children:[(0,T.jsx)(se,{children:(0,T.jsx)(Se,{placeholder:"Select assignee"})}),(0,T.jsx)(le,{children:t&&t.map(s=>{var R;return(0,T.jsx)(ce,{value:((R=s==null?void 0:s.id)==null?void 0:R.toString())||"",children:s.name},s.id)})})]}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("assignee"),children:[(0,T.jsx)(We.UserIcon,{className:"w-4 T-4 text-gray-400"}),(0,T.jsx)("span",{children:a.assignee.name})]})]}),(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),P==="closureDate"?(0,T.jsx)(Q,{type:"date",value:a.closureDate.split("T")[0],onChange:s=>u("closureDate",s.target.value),onBlur:()=>g(null),autoFocus:!0}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("closureDate"),children:[(0,T.jsx)(We.CalendarIcon,{className:"w-4 T-4 text-gray-400"}),(0,T.jsx)("span",{children:new Date(a.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,T.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Description"}),P==="description"?(0,T.jsx)(xe,{value:a.description,onChange:s=>u("description",s.target.value),onBlur:()=>g(null),className:"min-T-[100px]",autoFocus:!0}):(0,T.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>g("description"),children:a.description})]})}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Status"}),P==="status"?(0,T.jsxs)(we,{value:a.status,onValueChange:s=>{u("status",s),g(null)},children:[(0,T.jsx)(se,{children:(0,T.jsx)(Se,{placeholder:"Select status"})}),(0,T.jsx)(le,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(s=>(0,T.jsx)(ce,{value:s,children:s},s))})]}):(0,T.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("status"),children:a.status})]}),(0,T.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Categories"}),P==="categories"?(0,T.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.map(s=>(0,T.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,T.jsx)(Ce,{id:s.id,checked:a.categories.includes(s.id),onCheckedChange:()=>C(s.id)}),(0,T.jsx)("label",{htmlFor:s.id,className:`text-sm font-medium ${V(s.type)} px-2 py-1 rounded`,children:s.name})]},s.id))}):(0,T.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("categories"),children:a.categories.map(s=>{let R=r.find(z=>z.id===s);return R?(0,T.jsx)(at,{variant:"secondary",className:V(R.type),children:R.name},R.id):null})})]})]}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,T.jsx)(pe,{className:"T-[200px] overflow-y-auto",children:(0,T.jsx)("div",{className:"space-y-2",children:a.comments.map(s=>(0,T.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,T.jsx)("p",{className:"text-sm text-gray-700",children:s.text}),(0,T.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[s.author," - ",new Date(s.timestamp).toLocaleString()]})]},s.id))})}),(0,T.jsxs)("div",{className:"flex mt-2",children:[(0,T.jsx)(Q,{value:y,onChange:s=>S(s.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,T.jsxs)(q,{onClick:k,className:"ml-2",children:[(0,T.jsx)(We.PlusIcon,{className:"w-4 T-4 mr-2"}),"Add"]})]})]}),(0,T.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(a.updatedAt).toLocaleString()]})]})]})]})})}var ro={title:"CRM/DealDetails",component:st,parameters:{layout:"centered"},tags:["autodocs"]},ao=ro,io={id:"1",name:"Acme Corp",active:!0},no=[{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"}],lt=e=>Array.from({length:e},(t,o)=>({id:`comment-${o+1}`,text:`This is comment number ${o+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][o%3],timestamp:new Date(Date.now()-(e-o)*24*60*60*1e3).toISOString()})),ct={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:["1","3","5"],dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:lt(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},dt={args:{deal:ct,customer:io,categories:no,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},so={args:{...dt.args,deal:{...ct,comments:lt(100)}}};0&&(module.exports={Default,WithManyComments});
|
|
4
|
+
"use strict";var pt=Object.create;var ne=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var ft=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var bt=(e,t)=>{for(var o in t)ne(e,o,{get:t[o],enumerable:!0})},Ae=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ut(t))!gt.call(e,l)&&l!==o&&ne(e,l,{get:()=>t[l],enumerable:!(r=mt(t,l))||r.enumerable});return e};var A=(e,t,o)=>(o=e!=null?pt(ft(e)):{},Ae(t||!e||!e.__esModule?ne(o,"default",{value:e,enumerable:!0}):o,e)),vt=e=>Ae(ne({},"__esModule",{value:!0}),e);var lo={};bt(lo,{Default:()=>dt,WithManyComments:()=>so,default:()=>ao});module.exports=vt(lo);var _=require("react");var oe=A(require("react")),S=A(require("@radix-ui/react-dialog")),We=require("lucide-react");var Ge=require("clsx");var ge="-",ht=e=>{let t=xt(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{let a=c.split(ge);return a[0]===""&&a.length!==1&&a.shift(),ze(a,t)||yt(c)},getConflictingClassGroupIds:(c,a)=>{let v=o[c]||[];return a&&r[c]?[...v,...r[c]]:v}}},ze=(e,t)=>{var c;if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),l=r?ze(e.slice(1),r):void 0;if(l)return l;if(t.validators.length===0)return;let s=e.join(ge);return(c=t.validators.find(({validator:a})=>a(s)))==null?void 0:c.classGroupId},Te=/^\[(.+)\]$/,yt=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}},xt=e=>{let{theme:t,prefix:o}=e,r={nextPart:new Map,validators:[]};return St(Object.entries(e.classGroups),o).forEach(([s,c])=>{fe(c,r,s,t)}),r},fe=(e,t,o,r)=>{e.forEach(l=>{if(typeof l=="string"){let s=l===""?t:Me(t,l);s.classGroupId=o;return}if(typeof l=="function"){if(wt(l)){fe(l(r),t,o,r);return}t.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([s,c])=>{fe(c,Me(t,s),o,r)})})},Me=(e,t)=>{let o=e;return t.split(ge).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},wt=e=>e.isThemeGetter,St=(e,t)=>t?e.map(([o,r])=>{let l=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,a])=>[t+c,a])):s);return[o,l]}):e,Ct=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,l=(s,c)=>{o.set(s,c),t++,t>e&&(t=0,r=o,o=new Map)};return{get(s){let c=o.get(s);if(c!==void 0)return c;if((c=r.get(s))!==void 0)return l(s,c),c},set(s,c){o.has(s)?o.set(s,c):l(s,c)}}},Ie="!",Pt=e=>{let{separator:t,experimentalParseClassName:o}=e,r=t.length===1,l=t[0],s=t.length,c=a=>{let v=[],h=0,C=0,D;for(let u=0;u<a.length;u++){let P=a[u];if(h===0){if(P===l&&(r||a.slice(u,u+s)===t)){v.push(a.slice(C,u)),C=u+s;continue}if(P==="/"){D=u;continue}}P==="["?h++:P==="]"&&h--}let N=v.length===0?a:a.substring(C),R=N.startsWith(Ie),g=R?N.substring(1):N,w=D&&D>C?D-C:void 0;return{modifiers:v,hasImportantModifier:R,baseClassName:g,maybePostfixModifierPosition:w}};return o?a=>o({className:a,parseClassName:c}):c},Rt=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},Nt=e=>({cache:Ct(e.cacheSize),parseClassName:Pt(e),...ht(e)}),kt=/\s+/,Dt=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:l}=t,s=[],c=e.trim().split(kt),a="";for(let v=c.length-1;v>=0;v-=1){let h=c[v],{modifiers:C,hasImportantModifier:D,baseClassName:N,maybePostfixModifierPosition:R}=o(h),g=!!R,w=r(g?N.substring(0,R):N);if(!w){if(!g){a=h+(a.length>0?" "+a:a);continue}if(w=r(N),!w){a=h+(a.length>0?" "+a:a);continue}g=!1}let u=Rt(C).join(":"),P=D?u+Ie:u,k=P+w;if(s.includes(k))continue;s.push(k);let V=l(w,g);for(let G=0;G<V.length;++G){let U=V[G];s.push(P+U)}a=h+(a.length>0?" "+a:a)}return a};function At(){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 Tt(e,...t){let o,r,l,s=c;function c(v){let h=t.reduce((C,D)=>D(C),e());return o=Nt(h),r=o.cache.get,l=o.cache.set,s=a,a(v)}function a(v){let h=r(v);if(h)return h;let C=Dt(v,o);return l(v,C),C}return function(){return s(At.apply(null,arguments))}}var b=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ee=/^\[(?:([a-z-]+):)?(.+)\]$/T,Mt=/^\d+\/\d+$/,zt=new Set(["px","full","screen"]),It=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|T|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Et=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Bt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,E=e=>J(e)||zt.has(e)||Mt.test(e),W=e=>Z(e,"length",_t),J=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>Z(e,"number",J),ee=e=>!!e&&Number.isInteger(Number(e)),Gt=e=>e.endsWith("%")&&J(e.slice(0,-1)),d=e=>Ee.test(e),H=e=>It.test(e),Wt=new Set(["length","size","percentage"]),Ht=e=>Z(e,Wt,Be),Ot=e=>Z(e,"position",Be),Ft=new Set(["image","url"]),Ut=e=>Z(e,Ft,Jt),jt=e=>Z(e,"",$t),te=()=>!0,Z=(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},_t=e=>Lt.test(e)&&!Et.test(e),Be=()=>!1,$t=e=>Bt.test(e),Jt=e=>Vt.test(e);var Zt=()=>{let e=b("colors"),t=b("spacing"),o=b("blur"),r=b("brightness"),l=b("borderColor"),s=b("borderRadius"),c=b("borderSpacing"),a=b("borderWidth"),v=b("contrast"),h=b("grayscale"),C=b("hueRotate"),D=b("invert"),N=b("gap"),R=b("gradientColorStops"),g=b("gradientColorStopPositions"),w=b("inset"),u=b("margin"),P=b("opacity"),k=b("padding"),V=b("saturate"),G=b("scale"),U=b("sepia"),X=b("skew"),K=b("space"),n=b("translate"),x=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",d,t],f=()=>[d,t],Re=()=>["",E,W],ae=()=>["auto",J,d],Ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ie=()=>["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"],me=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",d],De=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[J,d];return{cacheSize:500,separator:":",theme:{colors:[te],spacing:[E,W],blur:["none","",H,d],brightness:L(),borderColor:[e],borderRadius:["none","","full",H,d],borderSpacing:f(),borderWidth:Re(),contrast:L(),grayscale:Y(),hueRotate:L(),invert:Y(),gap:f(),gradientColorStops:[e],gradientColorStopPositions:[Gt,W],inset:$(),margin:$(),opacity:L(),padding:f(),saturate:L(),scale:L(),sepia:Y(),skew:L(),space:f(),translate:f()},classGroups:{aspect:[{aspect:["auto","square","video",d]}],container:["container"],columns:[{columns:[H]}],"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:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-T":[{"overflow-T":z()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-T":[{"overscroll-T":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-T":[{"inset-T":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ee,d]}],basis:[{basis:$()}],"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:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",ee,d]}],"grid-cols":[{"grid-cols":[te]}],"col-start-end":[{col:["auto",{span:["full",ee,d]},d]}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":[te]}],"row-start-end":[{row:["auto",{span:[ee,d]},d]}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",d]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",d]}],gap:[{gap:[N]}],"gap-x":[{"gap-x":[N]}],"gap-T":[{"gap-T":[N]}],"justify-content":[{justify:["normal",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],me:[{me:[u]}],mt:[{mt:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[K]}],"space-x-reverse":["space-x-reverse"],"space-T":[{"space-T":[K]}],"space-T-reverse":["space-T-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",d,t]}],"min-w":[{"min-w":[d,t,"min","max","fit"]}],"max-w":[{"max-w":[d,t,"none","full","min","max","fit","prose",{screen:[H]},H]}],h:[{h:[d,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[d,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[d,t,"auto","min","max","fit"]}],"font-size":[{text:["base",H,W]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[te]}],"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,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",E,d]}],"list-image":[{"list-image":["none",d]}],"list-style-type":[{list:["none","disc","decimal",d]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",E,W]}],"underline-offset":[{"underline-offset":["auto",E,d]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:f()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",d]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",d]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ne(),Ot]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","T","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ht]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ut]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-T":[{"border-T":[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":[P]}],"border-style":[{border:[...ie(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-T":[{"divide-T":[a]}],"divide-T-reverse":["divide-T-reverse"],"divide-opacity":[{"divide-opacity":[P]}],"divide-style":[{divide:ie()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-T":[{"border-T":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...ie()]}],"outline-offset":[{"outline-offset":[E,d]}],"outline-w":[{outline:[E,W]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[E,W]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",H,jt]}],"shadow-color":[{shadow:[te]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[r]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",H,d]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[C]}],invert:[{invert:[D]}],saturate:[{saturate:[V]}],sepia:[{sepia:[U]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[C]}],"backdrop-invert":[{"backdrop-invert":[D]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[V]}],"backdrop-sepia":[{"backdrop-sepia":[U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-T":[{"border-spacing-T":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",d]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",d]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",d]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-T":[{"scale-T":[G]}],rotate:[{rotate:[ee,d]}],"translate-x":[{"translate-x":[n]}],"translate-T":[{"translate-T":[n]}],"skew-x":[{"skew-x":[X]}],"skew-T":[{"skew-T":[X]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",d]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",d]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","T","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-pe":[{"scroll-pe":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","T","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-T":[{"touch-pan":["T","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",d]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[E,W,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-T"],overscroll:["overscroll-x","overscroll-T"],inset:["inset-x","inset-T","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-T":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-T"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-T"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-T":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-T":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-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-T","touch-pz"],"touch-x":["touch"],"touch-T":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ve=Tt(Zt);function m(...e){return Ve((0,Ge.clsx)(e))}var T=require("react/jsx-runtime"),He=S.Root;var qt=S.Portal;var Oe=oe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Overlay,{ref:o,className:m("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}));Oe.displayName=S.Overlay.displayName;var be=oe.forwardRef(({className:e,children:t,...o},r)=>(0,T.jsxs)(qt,{children:[(0,T.jsx)(Oe,{}),(0,T.jsxs)(S.Content,{ref:r,className:m("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-T-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,T.jsxs)(S.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,T.jsx)(We.X,{className:"h-4 w-4"}),(0,T.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));be.displayName=S.Content.displayName;var ve=({className:e,...t})=>(0,T.jsx)("div",{className:m("flex flex-col space-T-1.5 text-center sm:text-left",e),...t});ve.displayName="DialogHeader";var Qt=({className:e,...t})=>(0,T.jsx)("div",{className:m("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qt.displayName="DialogFooter";var he=oe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Title,{ref:o,className:m("text-lg font-semibold leading-none tracking-tight",e),...t}));he.displayName=S.Title.displayName;var Xt=oe.forwardRef(({className:e,...t},o)=>(0,T.jsx)(S.Description,{ref:o,className:m("text-sm text-muted-foreground",e),...t}));Xt.displayName=S.Description.displayName;var Fe=require("@radix-ui/react-slot"),Ue=require("class-variance-authority"),je=A(require("react")),Kt=(0,Ue.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"}}}),q=je.forwardRef(({asChild:e=!1,className:t,size:o,variant:r,...l},s)=>(0,T.jsx)(e?Fe.Slot:"button",{className:m(Kt({className:t,size:o,variant:r})),ref:s,...l}));q.displayName="Button";var $e=A(require("react"));var Q=$e.forwardRef(({className:e,type:t,...o},r)=>(0,T.jsx)("input",{type:t,className:m("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));Q.displayName="Input";var Ze=A(require("react")),ye=A(require("@radix-ui/react-label"));var Yt=(0,Ue.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),B=Ze.forwardRef(({className:e,...t},o)=>(0,T.jsx)(ye.Root,{ref:o,className:m(Yt(),e),...t}));B.displayName=ye.Root.displayName;var Xe=A(require("react")),xe=Xe.forwardRef(({className:e,...t},o)=>(0,T.jsx)("textarea",{className:m("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}));xe.displayName="Textarea";var p=A(require("@radix-ui/react-select")),O=A(require("react")),we=p.Root;var Se=p.Value,se=O.forwardRef(({children:e,className:t,...o},r)=>(0,T.jsxs)(p.Trigger,{className:m("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:r,...o,children:[e,(0,T.jsx)(p.Icon,{asChild:!0,children:(0,T.jsx)(We.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));se.displayName=p.Trigger.displayName;var Ye=O.forwardRef(({className:e,...t},o)=>(0,T.jsx)(p.ScrollUpButton,{className:m("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(We.ChevronUp,{className:"h-4 w-4"})}));Ye.displayName=p.ScrollUpButton.displayName;var et=O.forwardRef(({className:e,...t},o)=>(0,T.jsx)(p.ScrollDownButton,{className:m("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,T.jsx)(We.ChevronDown,{className:"h-4 w-4"})}));et.displayName=p.ScrollDownButton.displayName;var le=O.forwardRef(({children:e,className:t,position:o="popper",...r},l)=>(0,T.jsx)(p.Portal,{children:(0,T.jsxs)(p.Content,{className:m("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-T-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-T-1",t),position:o,ref:l,...r,children:[(0,T.jsx)(Ye,{}),(0,T.jsx)(p.Viewport,{className:m("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,T.jsx)(et,{})]})}));le.displayName=p.Content.displayName;var eo=O.forwardRef(({className:e,...t},o)=>(0,T.jsx)(p.Label,{className:m("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));eo.displayName=p.Label.displayName;var ce=O.forwardRef(({children:e,className:t,...o},r)=>(0,T.jsxs)(p.Item,{className:m("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,T.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,T.jsx)(p.ItemIndicator,{children:(0,T.jsx)(We.Check,{className:"h-4 w-4"})})}),(0,T.jsx)(p.ItemText,{children:e})]}));ce.displayName=p.Item.displayName;var to=O.forwardRef(({className:e,...t},o)=>(0,T.jsx)(p.Separator,{className:m("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));to.displayName=p.Separator.displayName;var re=A(require("@radix-ui/react-checkbox")),ot=A(require("react")),Ce=ot.forwardRef(({className:e,...t},o)=>(0,T.jsx)(re.Root,{className:m("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,T.jsx)(re.Indicator,{className:m("flex items-center justify-center text-current"),children:(0,T.jsx)(We.Check,{className:"h-4 w-4"})})}));Ce.displayName=re.Root.displayName;var oo=(0,Ue.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 at({className:e,variant:t,...o}){return(0,T.jsx)("div",{className:m(oo({variant:t}),e),...o})}var Pe=A(require("react")),M=A(require("@radix-ui/react-scroll-area"));var pe=Pe.forwardRef(({className:e,children:t,...o},r)=>(0,T.jsxs)(M.Root,{ref:r,className:m("relative overflow-hidden",e),...o,children:[(0,T.jsx)(M.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,T.jsx)(nt,{}),(0,T.jsx)(M.Corner,{})]}));pe.displayName=M.Root.displayName;var nt=Pe.forwardRef(({className:e,orientation:t="vertical",...o},r)=>(0,T.jsx)(M.ScrollAreaScrollbar,{ref:r,orientation:t,className:m("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,T.jsx)(M.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));nt.displayName=M.ScrollAreaScrollbar.displayName;function st({deal:e,users:t,customer:o,categories:r,onClose:l,onSave:s,onAddComment:c}){var U,X,K;let[a,v]=(0,_.useState)({...e,value:e.value||0}),[h,C]=(0,_.useState)(""),[D,N]=(0,_.useState)(!1),[R,g]=(0,_.useState)(null);(0,_.useEffect)(()=>{N(JSON.stringify(e)!==JSON.stringify(a))},[e,a]);let w=()=>{s(a),N(!1),g(null)},u=(n,x)=>{v(z=>({...z,[n]:x}))},P=n=>{let x=a.categories.includes(n)?a.categories.filter(z=>z!==n):[...a.categories,n];u("categories",x)},k=()=>{h.trim()&&(c({id:Date.now().toString(),text:h,timestamp:new Date().toISOString()}),v(n=>({...n,comments:[...n.comments,{id:"0",text:h,timestamp:new Date().toISOString()}]})),C(""))},V=n=>{switch(n){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=(n,x,z)=>{let $=R===n;return(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:x}),(0,T.jsxs)("div",{className:"flex items-center space-x-2",children:[z,$?(0,T.jsx)(Q,{value:a[n],onChange:f=>u(n,f.target.value),onBlur:()=>g(null),autoFocus:!0}):(0,T.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>g(n),children:a[n]}),!$&&(0,T.jsx)(q,{variant:"ghost",size:"sm",onClick:()=>g(n),children:(0,T.jsx)(We.Edit2Icon,{className:"w-4 h-4"})})]})]})};return(0,T.jsx)(He,{open:!0,children:(0,T.jsxs)(be,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,T.jsxs)(ve,{className:"flex flex-row items-center justify-between",children:[(0,T.jsx)(he,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,T.jsxs)("div",{className:"flex space-x-2",children:[(0,T.jsx)(q,{variant:"outline",onClick:l,children:"Close"}),(0,T.jsxs)(q,{onClick:w,disabled:!D,children:[(0,T.jsx)(We.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,T.jsxs)(pe,{className:"flex-grow pr-4",children:[(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,T.jsx)("div",{className:"grid gap-2",children:R==="value"?(0,T.jsx)(Q,{type:"number",value:a.value,onChange:n=>u("value",Number(n.target.value)),onBlur:()=>g(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,T.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("value"),children:["\xA3",(U=a.value)==null?void 0:U.toLocaleString()]})}),(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),R==="assignee"?(0,T.jsxs)(we,{value:((K=(X=a==null?void 0:a.assignee)==null?void 0:X.id)==null?void 0:K.toString())||"",onValueChange:n=>u("assignee",n),children:[(0,T.jsx)(se,{children:(0,T.jsx)(Se,{placeholder:"Select assignee"})}),(0,T.jsx)(le,{children:t&&t.map(n=>{var x;return(0,T.jsx)(ce,{value:((x=n==null?void 0:n.id)==null?void 0:x.toString())||"",children:n.name},n.id)})})]}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("assignee"),children:[(0,T.jsx)(We.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:a.assignee.name})]})]}),(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),R==="closureDate"?(0,T.jsx)(Q,{type:"date",value:a.closureDate.split("T")[0],onChange:n=>u("closureDate",n.target.value),onBlur:()=>g(null),autoFocus:!0}):(0,T.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("closureDate"),children:[(0,T.jsx)(We.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,T.jsx)("span",{children:new Date(a.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,T.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Description"}),R==="description"?(0,T.jsx)(xe,{value:a.description,onChange:n=>u("description",n.target.value),onBlur:()=>g(null),className:"min-h-[100px]",autoFocus:!0}):(0,T.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>g("description"),children:a.description})]})}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 pt-2 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Status"}),R==="status"?(0,T.jsxs)(we,{value:a.status,onValueChange:n=>{u("status",n),g(null)},children:[(0,T.jsx)(se,{children:(0,T.jsx)(Se,{placeholder:"Select status"})}),(0,T.jsx)(le,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(n=>(0,T.jsx)(ce,{value:n,children:n},n))})]}):(0,T.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("status"),children:a.status})]}),(0,T.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Categories"}),R==="categories"?(0,T.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.map(n=>(0,T.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,T.jsx)(Ce,{id:n.id,checked:a.categories.includes(n.id),onCheckedChange:()=>P(n.id)}),(0,T.jsx)("label",{htmlFor:n.id,className:`text-sm font-medium ${V(n.type)} px-2 py-1 rounded`,children:n.name})]},n.id))}):(0,T.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>g("categories"),children:a.categories.map(n=>{let x=r.find(z=>z.id===n);return x?(0,T.jsx)(at,{variant:"secondary",className:V(x.type),children:x.name},x.id):null})})]})]}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 pt-4 gap-4",children:[(0,T.jsxs)("div",{className:"grid gap-2",children:[(0,T.jsx)(B,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,T.jsx)(pe,{className:"h-[200px] overflow-T-auto",children:(0,T.jsx)("div",{className:"space-T-2",children:a.comments.map(n=>{var x;return(0,T.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,T.jsx)("p",{className:"text-sm text-gray-700",children:n.text}),(0,T.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[(x=n.author)==null?void 0:x.name," - ",new Date(n.timestamp).toLocaleString()]})]},n.id)})})}),(0,T.jsxs)("div",{className:"flex mt-2",children:[(0,T.jsx)(Q,{value:h,onChange:n=>C(n.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,T.jsxs)(q,{onClick:k,className:"ml-2",children:[(0,T.jsx)(We.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,T.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(a.updatedAt).toLocaleString()]})]})]})]})})}var ro={title:"CRM/DealDetails",component:st,parameters:{layout:"centered"},tags:["autodocs"]},ao=ro,io={id:"1",name:"Acme Corp",active:!0},no=[{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"}],lt=e=>Array.from({length:e},(t,o)=>({id:`comment-${o+1}`,text:`This is comment number ${o+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][o%3],timestamp:new Date(Date.now()-(e-o)*24*60*60*1e3).toISOString()})),ct={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:["1","3","5"],dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:lt(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},dt={args:{deal:ct,customer:io,categories:no,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},so={args:{...dt.args,deal:{...ct,comments:lt(100)}}};0&&(module.exports={Default,WithManyComments});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../../chunk-
|
|
1
|
+
import{a as o}from"../../chunk-4NETKTTT.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-NIQ4466A.mjs";import"../../chunk-6K2R3OAD.mjs";import"../../chunk-S7OK7D5I.mjs";var n={title:"CRM/DealDetails",component:o,parameters:{layout:"centered"},tags:["autodocs"]},p=n,m={id:"1",name:"Acme Corp",active:!0},s=[{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"}],a=e=>Array.from({length:e},(c,t)=>({id:`comment-${t+1}`,text:`This is comment number ${t+1}. It's a mock comment to test the scrolling behavior of the comments section in the DealDetails component.`,author:["John Doe","Jane Smith","Bob Johnson"][t%3],timestamp:new Date(Date.now()-(e-t)*24*60*60*1e3).toISOString()})),r={id:1,customer:{id:1,name:"Acme Corp",active:!0},value:1e5,assignee:{id:1,name:"John Doe"},status:"Qualified",categories:["1","3","5"],dateLogged:"2023-01-01T00:00:00.000Z",closureDate:"2023-12-31T00:00:00.000Z",updatedAt:"2023-06-15T12:00:00.000Z",comments:a(50),description:"This is a mock deal for Acme Corp. It involves a large software project with potential for hardware integration."},i={args:{deal:r,customer:m,categories:s,onClose:()=>console.log("Close clicked"),onSave:e=>console.log("Save clicked",e),onAddComment:e=>console.log("Comment added",e)}},d={args:{...i.args,deal:{...r,comments:a(100)}}};export{i as Default,d as WithManyComments,p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
'use client'
|
|
4
4
|
|
|
5
|
-
"use strict";"use client";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})},Ke=(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)):{},Ke(t||!e||!e.__esModule?De(o,"default",{value:e,enumerable:!0}):o,e)),Ft=e=>Ke(De({},"__esModule",{value:!0}),e);var Ao={};Vt(Ao,{CRMKanbanBoard:()=>To});module.exports=Ft(Ao);var Ne=require("react");var we=B(require("react")),M=B(require("@radix-ui/react-dialog")),ot=require("lucide-react");var tt=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(),Je(r,t)||Gt(d)},getConflictingClassGroupIds:(d,r)=>{let b=o[d]||[];return r&&a[d]?[...b,...a[d]]:b}}},Je=(e,t)=>{var d;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?Je(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},$e=/^\[(.+)\]$/,Gt=e=>{if($e.test(e)){let t=$e.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:qe(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,qe(t,i),o,a)})})},qe=(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)}}},Qe="!",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,x;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==="/"){x=v;continue}}S==="["?C++:S==="]"&&C--}let D=b.length===0?r:r.substring(w),p=D.startsWith(Qe),u=p?D.substring(1):D,y=x&&x>w?x-w:void 0;return{modifiers:b,hasImportantModifier:p,baseClassName:u,maybePostfixModifierPosition:y}};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:x,baseClassName:D,maybePostfixModifierPosition:p}=o(C),u=!!p,y=a(u?D.substring(0,p):D);if(!y){if(!u){r=C+(r.length>0?" "+r:r);continue}if(y=a(D),!y){r=C+(r.length>0?" "+r:r);continue}u=!1}let v=$t(w).join(":"),S=x?v+Qe:v,T=S+y;if(i.includes(T))continue;i.push(T);let z=n(y,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=Xe(t))&&(a&&(a+=" "),a+=o);return a}var Xe=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(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,x)=>x(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},Ze=/^\[(?:([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)|st|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),xe=e=>!!e&&Number.isInteger(Number(e)),so=e=>e.endsWith("%")&&pe(e.slice(0,-1)),f=e=>Ze.test(e),J=e=>to.test(e),no=new Set(["length","size","percentage"]),lo=e=>ue(e,no,Ye),co=e=>ue(e,"position",Ye),mo=new Set(["image","url"]),po=e=>ue(e,mo,bo),uo=e=>ue(e,"",go),Ce=()=>!0,ue=(e,t,o)=>{let a=Ze.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),Ye=()=>!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"),x=P("invert"),D=P("gap"),p=P("gradientColorStops"),u=P("gradientColorStopPositions"),y=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],Oe=()=>["",$,q],Re=()=>["auto",pe,f],Ue=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Pe=()=>["solid","dashed","dotted","double","none"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Le=()=>["start","end","center","between","around","evenly","stretch"],ye=()=>["","0",f],je=()=>["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:Oe(),contrast:K(),grayscale:ye(),hueRotate:K(),invert:ye(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[so,q],inset:me(),margin:me(),opacity:K(),padding:N(),saturate:K(),scale:K(),sepia:ye(),skew:K(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",f]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":je()}],"break-before":[{"break-before":je()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ue(),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:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xe,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:ye()}],shrink:[{shrink:ye()}],order:[{order:["first","last","none",xe,f]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",xe,f]},f]}],"col-start":[{"col-start":Re()}],"col-end":[{"col-end":Re()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[xe,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]}],st:[{st:[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:[...Ue(),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:Oe()}],"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":[..._e(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_e()}],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:[x]}],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":[x]}],"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:[xe,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-st":[{"scroll-st":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","st","pr","pb","pl"],px:["pr","pl"],py:["st","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-st","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-st","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Zt(vo);function g(...e){return et((0,tt.clsx)(e))}var H=require("react/jsx-runtime"),fe=M.Root,rt=M.Trigger,ho=M.Portal;var at=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}));at.displayName=M.Overlay.displayName;var Z=we.forwardRef(({className:e,children:t,...o},a)=>(0,H.jsxs)(ho,{children:[(0,H.jsx)(at,{}),(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)(ot.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 yo=({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});yo.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 xo=we.forwardRef(({className:e,...t},o)=>(0,H.jsx)(M.Description,{ref:o,className:g("text-sm text-muted-foreground",e),...t}));xo.displayName=M.Description.displayName;var it=require("@radix-ui/react-slot"),st=require("class-variance-authority"),nt=B(require("react")),Co=(0,st.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=nt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,H.jsx)(e?it.Slot:"button",{className:g(Co({className:t,size:o,variant:a})),ref:i,...n}));V.displayName="Button";var ct=B(require("react"));var _=ct.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 mt=B(require("react")),Be=B(require("@radix-ui/react-label"));var wo=(0,st.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=mt.forwardRef(({className:e,...t},o)=>(0,H.jsx)(Be.Root,{ref:o,className:g(wo(),e),...t}));L.displayName=Be.Root.displayName;var ft=B(require("react")),te=ft.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)(ot.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));re.displayName=h.Trigger.displayName;var bt=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)(ot.ChevronUp,{className:"h-4 w-4"})}));bt.displayName=h.ScrollUpButton.displayName;var vt=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)(ot.ChevronDown,{className:"h-4 w-4"})}));vt.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)(bt,{}),(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)(vt,{})]})}));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)(ot.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")),yt=B(require("react")),se=yt.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)(ot.Check,{className:"h-4 w-4"})})}));se.displayName=Se.Root.displayName;var Ro=(0,st.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)(wt,{}),(0,H.jsx)(W.Corner,{})]}));ve.displayName=W.Root.displayName;var wt=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"})}));wt.displayName=W.ScrollAreaScrollbar.displayName;function St({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)(""),[x,D]=(0,Ne.useState)(!1),[p,u]=(0,Ne.useState)(null);(0,Ne.useEffect)(()=>{D(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let y=()=>{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)(ot.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:y,disabled:!x,children:[(0,H.jsx)(ot.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)(ot.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)(ot.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 st-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 st-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)(ot.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 Ve=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}));Ve.displayName="Card";var Fe=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}));Fe.displayName="CardHeader";var We=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("font-semibold leading-none tracking-tight",e),...t}));We.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 Ge=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("p-6 st-0",e),...t}));Ge.displayName="CardContent";var Do=le.forwardRef(({className:e,...t},o)=>(0,H.jsx)("div",{ref:o,className:g("flex items-center p-6 st-0",e),...t}));Do.displayName="CardFooter";function Nt({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)(Ve,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,H.jsxs)(Fe,{className:"pb-2",children:[(0,H.jsx)("div",{className:"flex justify-between items-center",children:(0,H.jsx)(We,{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)(Ge,{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)(ot.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)(ot.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 Pt({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 kt({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),[x,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())},y=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)(ot.PlusIcon,{className:"w-5 h-5"})})]}),x.customerId&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:x.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"}),x.value&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:x.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)})})]}),x.assignee&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:x.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:()=>y(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})}),x.closureDate&&(0,H.jsx)("p",{className:"text-red-500 text-sm",children:x.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)(Pt,{onSubmit:v})]})})]})}function Mt({status:e,deals:t,users:o,customers:a,categories:n,onDealClick:i,calculateColumnValue:d,calculateWeightedValue:r,addNewDeal:b,onAddCustomer:C}){let[w,x]=(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:x,children:[(0,H.jsx)(rt,{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)(ot.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)(kt,{customers:a,users:o,categories:n,onSubmit:b,onAddCustomer:C,onClose:()=>x(!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:y=>(0,H.jsx)("div",{ref:y.innerRef,...y.draggableProps,...y.dragHandleProps,children:(0,H.jsx)(Nt,{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,y)=>u+(y.value||0),0),x=(p,u)=>{let y={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return p.reduce((v,S)=>v+(S.value||0)*y[u],0)},D=(0,Ne.useCallback)(p=>{let{source:u,destination:y}=p;if(!y||u.droppableId===y.droppableId&&u.index===y.index)return;let v=u.droppableId,S=y.droppableId;console.log("Moving from ",v,"to",S);let T=[...r.deals],[z]=T.splice(u.index,1);z.status=S,T.splice(y.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)(Mt,{status:p,deals:u,customers:e.customers,users:e.users,categories:e.categories,onDealClick:d,calculateColumnValue:w,calculateWeightedValue:x,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:n},p)})}),i&&(0,H.jsx)(St,{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});
|
|
5
|
+
"use strict";"use client";var It=Object.create;var Pe=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)Pe(e,o,{get:t[o],enumerable:!0})},Ke=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zt(t))!Ht.call(e,n)&&n!==o&&Pe(e,n,{get:()=>t[n],enumerable:!(a=Et(t,n))||a.enumerable});return e};var z=(e,t,o)=>(o=e!=null?It(Bt(e)):{},Ke(t||!e||!e.__esModule?Pe(o,"default",{value:e,enumerable:!0}):o,e)),Ft=e=>Ke(Pe({},"__esModule",{value:!0}),e);var Ao={};Vt(Ao,{CRMKanbanBoard:()=>To});module.exports=Ft(Ao);var Me=require("react");var we=z(require("react")),M=z(require("@radix-ui/react-dialog")),ot=require("lucide-react");var tt=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(),Je(r,t)||Gt(d)},getConflictingClassGroupIds:(d,r)=>{let g=o[d]||[];return r&&a[d]?[...g,...a[d]]:g}}},Je=(e,t)=>{var d;if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),n=a?Je(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},$e=/^\[(.+)\]$/,Gt=e=>{if($e.test(e)){let t=$e.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:qe(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,qe(t,i),o,a)})})},qe=(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)}}},Qe="!",Kt=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,n=t[0],i=t.length,d=r=>{let g=[],w=0,S=0,p;for(let b=0;b<r.length;b++){let R=r[b];if(w===0){if(R===n&&(a||r.slice(b,b+i)===t)){g.push(r.slice(S,b)),S=b+i;continue}if(R==="/"){p=b;continue}}R==="["?w++:R==="]"&&w--}let y=g.length===0?r:r.substring(S),h=y.startsWith(Qe),x=h?y.substring(1):y,C=p&&p>S?p-S:void 0;return{modifiers:g,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:C}};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=/\B+/,Qt=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:n}=t,i=[],d=e.trim().split(Jt),r="";for(let g=d.length-1;g>=0;g-=1){let w=d[g],{modifiers:S,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:h}=o(w),x=!!h,C=a(x?y.substring(0,h):y);if(!C){if(!x){r=w+(r.length>0?" "+r:r);continue}if(C=a(y),!C){r=w+(r.length>0?" "+r:r);continue}x=!1}let b=$t(S).join(":"),R=p?b+Qe:b,E=R+C;if(i.includes(E))continue;i.push(E);let W=n(C,x);for(let G=0;G<W.length;++G){let m=W[G];i.push(R+m)}r=w+(r.length>0?" "+r:r)}return r};function Xt(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Xe(t))&&(a&&(a+=" "),a+=o);return a}var Xe=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(e[a]))&&(o&&(o+=" "),o+=t);return o};function Zt(e,...t){let o,a,n,i=d;function d(g){let w=t.reduce((S,p)=>p(S),e());return o=qt(w),a=o.cache.get,n=o.cache.set,i=r,r(g)}function r(g){let w=a(g);if(w)return w;let S=Qt(g,o);return n(g,S),S}return function(){return i(Xt.apply(null,arguments))}}var D=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ze=/^\[(?:([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)|st|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),xe=e=>!!e&&Number.isInteger(Number(e)),so=e=>e.endsWith("%")&&pe(e.slice(0,-1)),u=e=>Ze.test(e),J=e=>to.test(e),no=new Set(["length","size","percentage"]),lo=e=>ue(e,no,Ye),co=e=>ue(e,"position",Ye),mo=new Set(["image","url"]),po=e=>ue(e,mo,bo),uo=e=>ue(e,"",go),Ce=()=>!0,ue=(e,t,o)=>{let a=Ze.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),Ye=()=>!1,go=e=>ao.test(e),bo=e=>io.test(e);var vo=()=>{let e=D("colors"),t=D("spacing"),o=D("blur"),a=D("brightness"),n=D("borderColor"),i=D("borderRadius"),d=D("borderSpacing"),r=D("borderWidth"),g=D("contrast"),w=D("grayscale"),S=D("hueRotate"),p=D("invert"),y=D("gap"),h=D("gradientColorStops"),x=D("gradientColorStopPositions"),C=D("inset"),b=D("margin"),R=D("opacity"),E=D("padding"),W=D("saturate"),G=D("scale"),m=D("sepia"),P=D("skew"),O=D("space"),l=D("translate"),A=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",u,t],N=()=>[u,t],Oe=()=>["",$,q],Ne=()=>["auto",pe,u],Ue=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Re=()=>["solid","dashed","dotted","double","none"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Le=()=>["start","end","center","between","around","evenly","stretch"],ye=()=>["","0",u],je=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[pe,u];return{cacheSize:500,separator:":",theme:{colors:[Ce],spacing:[$,q],blur:["none","",J,u],brightness:K(),borderColor:[e],borderRadius:["none","","full",J,u],borderSpacing:N(),borderWidth:Oe(),contrast:K(),grayscale:ye(),hueRotate:K(),invert:ye(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[so,q],inset:me(),margin:me(),opacity:K(),padding:N(),saturate:K(),scale:K(),sepia:ye(),skew:K(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[J]}],"break-after":[{"break-after":je()}],"break-before":[{"break-before":je()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ue(),u]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[C]}],"inset-x":[{"inset-x":[C]}],"inset-y":[{"inset-y":[C]}],start:[{start:[C]}],end:[{end:[C]}],top:[{top:[C]}],right:[{right:[C]}],bottom:[{bottom:[C]}],left:[{left:[C]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xe,u]}],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",u]}],grow:[{grow:ye()}],shrink:[{shrink:ye()}],order:[{order:["first","last","none",xe,u]}],"grid-cols":[{"grid-cols":[Ce]}],"col-start-end":[{col:["auto",{span:["full",xe,u]},u]}],"col-start":[{"col-start":Ne()}],"col-end":[{"col-end":Ne()}],"grid-rows":[{"grid-rows":[Ce]}],"row-start-end":[{row:["auto",{span:[xe,u]},u]}],"row-start":[{"row-start":Ne()}],"row-end":[{"row-end":Ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",u]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",u]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"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:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],st:[{st:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],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":[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",u,t]}],"min-w":[{"min-w":[u,t,"min","max","fit"]}],"max-w":[{"max-w":[u,t,"none","full","min","max","fit","prose",{screen:[J]},J]}],h:[{h:[u,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[u,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[u,t,"auto","min","max","fit"]}],"font-size":[{text:["base",J,q]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",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",u]}],"line-clamp":[{"line-clamp":["none",pe,Ie]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$,u]}],"list-image":[{"list-image":["none",u]}],"list-style-type":[{list:["none","disc","decimal",u]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$,q]}],"underline-offset":[{"underline-offset":["auto",$,u]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",u]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",u]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ue(),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:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-B":[{"rounded-B":[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-B":[{"border-B":[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":[R]}],"border-style":[{border:[...Re(),"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":[R]}],"divide-style":[{divide:Re()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-B":[{"border-B":[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:["",...Re()]}],"outline-offset":[{"outline-offset":[$,u]}],"outline-w":[{outline:[$,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[$,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",J,uo]}],"shadow-color":[{shadow:[Ce]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[..._e(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_e()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",J,u]}],grayscale:[{grayscale:[w]}],"hue-rotate":[{"hue-rotate":[S]}],invert:[{invert:[p]}],saturate:[{saturate:[W]}],sepia:[{sepia:[m]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[w]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[W]}],"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",u]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[G]}],"scale-x":[{"scale-x":[G]}],"scale-y":[{"scale-y":[G]}],rotate:[{rotate:[xe,u]}],"translate-x":[{"translate-x":[l]}],"translate-y":[{"translate-y":[l]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",u]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","B-resize","w-resize","Me-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",u]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":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-st":[{"scroll-st":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",u]}],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","st","pr","pb","pl"],px:["pr","pl"],py:["st","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-B","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-B":["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-B","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-B","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-st","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-st","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Zt(vo);function f(...e){return et((0,tt.clsx)(e))}var B=require("react/jsx-runtime"),fe=M.Root,rt=M.Trigger,ho=M.Portal;var at=we.forwardRef(({className:e,...t},o)=>(0,B.jsx)(M.Overlay,{ref:o,className:f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));at.displayName=M.Overlay.displayName;var Z=we.forwardRef(({className:e,children:t,...o},a)=>(0,B.jsxs)(ho,{children:[(0,B.jsx)(at,{}),(0,B.jsxs)(M.Content,{ref:a,className:f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,B.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,B.jsx)(ot.B,{className:"h-4 w-4"}),(0,B.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Z.displayName=M.Content.displayName;var Y=({className:e,...t})=>(0,B.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Y.displayName="DialogHeader";var yo=({className:e,...t})=>(0,B.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});yo.displayName="DialogFooter";var ee=we.forwardRef(({className:e,...t},o)=>(0,B.jsx)(M.Title,{ref:o,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));ee.displayName=M.Title.displayName;var xo=we.forwardRef(({className:e,...t},o)=>(0,B.jsx)(M.Description,{ref:o,className:f("text-sm text-muted-foreground",e),...t}));xo.displayName=M.Description.displayName;var it=require("@radix-ui/react-slot"),st=require("class-variance-authority"),nt=z(require("react")),Co=(0,st.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"}}}),H=nt.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...n},i)=>(0,B.jsx)(e?it.Slot:"button",{className:f(Co({className:t,size:o,variant:a})),ref:i,...n}));H.displayName="Button";var ct=z(require("react"));var _=ct.forwardRef(({className:e,type:t,...o},a)=>(0,B.jsx)("input",{type:t,className:f("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));_.displayName="Input";var mt=z(require("react")),Be=z(require("@radix-ui/react-label"));var wo=(0,st.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),L=mt.forwardRef(({className:e,...t},o)=>(0,B.jsx)(Be.Root,{ref:o,className:f(wo(),e),...t}));L.displayName=Be.Root.displayName;var ft=z(require("react")),te=ft.forwardRef(({className:e,...t},o)=>(0,B.jsx)("textarea",{className:f("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));te.displayName="Textarea";var v=z(require("@radix-ui/react-select")),Q=z(require("react")),ge=v.Root;var be=v.Value,re=Q.forwardRef(({children:e,className:t,...o},a)=>(0,B.jsxs)(v.Trigger,{className:f("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...o,children:[e,(0,B.jsx)(v.Icon,{asChild:!0,children:(0,B.jsx)(ot.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));re.displayName=v.Trigger.displayName;var bt=Q.forwardRef(({className:e,...t},o)=>(0,B.jsx)(v.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,B.jsx)(ot.ChevronUp,{className:"h-4 w-4"})}));bt.displayName=v.ScrollUpButton.displayName;var vt=Q.forwardRef(({className:e,...t},o)=>(0,B.jsx)(v.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,B.jsx)(ot.ChevronDown,{className:"h-4 w-4"})}));vt.displayName=v.ScrollDownButton.displayName;var ae=Q.forwardRef(({children:e,className:t,position:o="popper",...a},n)=>(0,B.jsx)(v.Portal,{children:(0,B.jsxs)(v.Content,{className:f("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",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,B.jsx)(bt,{}),(0,B.jsx)(v.Viewport,{className:f("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,B.jsx)(vt,{})]})}));ae.displayName=v.Content.displayName;var So=Q.forwardRef(({className:e,...t},o)=>(0,B.jsx)(v.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));So.displayName=v.Label.displayName;var ie=Q.forwardRef(({children:e,className:t,...o},a)=>(0,B.jsxs)(v.Item,{className:f("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...o,children:[(0,B.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,B.jsx)(v.ItemIndicator,{children:(0,B.jsx)(ot.Check,{className:"h-4 w-4"})})}),(0,B.jsx)(v.ItemText,{children:e})]}));ie.displayName=v.Item.displayName;var No=Q.forwardRef(({className:e,...t},o)=>(0,B.jsx)(v.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));No.displayName=v.Separator.displayName;var Se=z(require("@radix-ui/react-checkbox")),yt=z(require("react")),se=yt.forwardRef(({className:e,...t},o)=>(0,B.jsx)(Se.Root,{className:f("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,B.jsx)(Se.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,B.jsx)(ot.Check,{className:"h-4 w-4"})})}));se.displayName=Se.Root.displayName;var Ro=(0,st.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 ke({className:e,variant:t,...o}){return(0,B.jsx)("div",{className:f(Ro({variant:t}),e),...o})}var He=z(require("react")),F=z(require("@radix-ui/react-scroll-area"));var ve=He.forwardRef(({className:e,children:t,...o},a)=>(0,B.jsxs)(F.Root,{ref:a,className:f("relative overflow-hidden",e),...o,children:[(0,B.jsx)(F.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,B.jsx)(wt,{}),(0,B.jsx)(F.Corner,{})]}));ve.displayName=F.Root.displayName;var wt=He.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,B.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,B.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=F.ScrollAreaScrollbar.displayName;function St({deal:e,users:t,customer:o,categories:a,onClose:n,onSave:i,onAddComment:d}){var m,P,O;let[r,g]=(0,Me.useState)({...e,value:e.value||0}),[w,S]=(0,Me.useState)(""),[p,y]=(0,Me.useState)(!1),[h,x]=(0,Me.useState)(null);(0,Me.useEffect)(()=>{y(JSON.stringify(e)!==JSON.stringify(r))},[e,r]);let C=()=>{i(r),y(!1),x(null)},b=(l,A)=>{g(U=>({...U,[l]:A}))},R=l=>{let A=r.categories.includes(l)?r.categories.filter(U=>U!==l):[...r.categories,l];b("categories",A)},E=()=>{w.trim()&&(d({id:Date.now().toString(),text:w,timestamp:new Date().toISOString()}),g(l=>({...l,comments:[...l.comments,{id:"0",text:w,timestamp:new Date().toISOString()}]})),S(""))},W=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,A,U)=>{let me=h===l;return(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(L,{className:"text-sm font-medium text-gray-500",children:A}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[U,me?(0,B.jsx)(_,{value:r[l],onChange:N=>b(l,N.target.value),onBlur:()=>x(null),autoFocus:!0}):(0,B.jsx)("div",{className:"flex-grow cursor-pointer hover:bg-gray-100 p-2 rounded",onClick:()=>x(l),children:r[l]}),!me&&(0,B.jsx)(H,{variant:"ghost",size:"sm",onClick:()=>x(l),children:(0,B.jsx)(ot.Edit2Icon,{className:"w-4 h-4"})})]})]})};return(0,B.jsx)(fe,{open:!0,children:(0,B.jsxs)(Z,{className:"max-w-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,B.jsxs)(Y,{className:"flex flex-row items-center justify-between",children:[(0,B.jsx)(ee,{className:"text-2xl font-bold",children:o==null?void 0:o.name}),(0,B.jsxs)("div",{className:"flex space-x-2",children:[(0,B.jsx)(H,{variant:"outline",onClick:n,children:"Close"}),(0,B.jsxs)(H,{onClick:C,disabled:!p,children:[(0,B.jsx)(ot.SaveIcon,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),(0,B.jsxs)(ve,{className:"flex-grow pr-4",children:[(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,B.jsx)("div",{className:"grid gap-2",children:h==="value"?(0,B.jsx)(_,{type:"number",value:r.value,onChange:l=>b("value",Number(l.target.value)),onBlur:()=>x(null),className:"text-3xl font-bold text-green-600",autoFocus:!0}):(0,B.jsxs)("div",{className:"text-3xl font-bold text-green-600 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("value"),children:["\xA3",(m=r.value)==null?void 0:m.toLocaleString()]})}),(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Assignee"}),h==="assignee"?(0,B.jsxs)(ge,{value:((O=(P=r==null?void 0:r.assignee)==null?void 0:P.id)==null?void 0:O.toString())||"",onValueChange:l=>b("assignee",l),children:[(0,B.jsx)(re,{children:(0,B.jsx)(be,{placeholder:"Select assignee"})}),(0,B.jsx)(ae,{children:t&&t.map(l=>{var A;return(0,B.jsx)(ie,{value:((A=l==null?void 0:l.id)==null?void 0:A.toString())||"",children:l.name},l.id)})})]}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("assignee"),children:[(0,B.jsx)(ot.UserIcon,{className:"w-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:r.assignee.name})]})]}),(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Closure Date"}),h==="closureDate"?(0,B.jsx)(_,{type:"date",value:r.closureDate.split("B")[0],onChange:l=>b("closureDate",l.target.value),onBlur:()=>x(null),autoFocus:!0}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("closureDate"),children:[(0,B.jsx)(ot.CalendarIcon,{className:"w-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:new Date(r.closureDate).toLocaleDateString("en-GB")})]})]})]}),(0,B.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Description"}),h==="description"?(0,B.jsx)(te,{value:r.description,onChange:l=>b("description",l.target.value),onBlur:()=>x(null),className:"min-h-[100px]",autoFocus:!0}):(0,B.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 pb-5 rounded",onClick:()=>x("description"),children:r.description})]})}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 st-2 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Status"}),h==="status"?(0,B.jsxs)(ge,{value:r.status,onValueChange:l=>{b("status",l),x(null)},children:[(0,B.jsx)(re,{children:(0,B.jsx)(be,{placeholder:"Select status"})}),(0,B.jsx)(ae,{children:["Cold","Qualified","Proposal Made","Won","Lost"].map(l=>(0,B.jsx)(ie,{value:l,children:l},l))})]}):(0,B.jsx)("div",{className:"cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("status"),children:r.status})]}),(0,B.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,B.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Categories"}),h==="categories"?(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2",children:a.map(l=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(se,{id:l.id,checked:r.categories.includes(l.id),onCheckedChange:()=>R(l.id)}),(0,B.jsx)("label",{htmlFor:l.id,className:`text-sm font-medium ${W(l.type)} px-2 py-1 rounded`,children:l.name})]},l.id))}):(0,B.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer hover:bg-gray-100 p-0 rounded",onClick:()=>x("categories"),children:r.categories.map(l=>{let A=a.find(U=>U.id===l);return A?(0,B.jsx)(ke,{variant:"secondary",className:W(A.type),children:A.name},A.id):null})})]})]}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 st-4 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(L,{className:"text-sm font-medium text-gray-500",children:"Comments"}),(0,B.jsx)(ve,{className:"h-[200px] overflow-y-auto",children:(0,B.jsx)("div",{className:"space-y-2",children:r.comments.map(l=>{var A;return(0,B.jsxs)("div",{className:"bg-gray-50 p-3 rounded-lg",children:[(0,B.jsx)("p",{className:"text-sm text-gray-700",children:l.text}),(0,B.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:[(A=l.author)==null?void 0:A.name," - ",new Date(l.timestamp).toLocaleString()]})]},l.id)})})}),(0,B.jsxs)("div",{className:"flex mt-2",children:[(0,B.jsx)(_,{value:w,onChange:l=>S(l.target.value),placeholder:"Add a comment...",className:"flex-grow"}),(0,B.jsxs)(H,{onClick:E,className:"ml-2",children:[(0,B.jsx)(ot.PlusIcon,{className:"w-4 h-4 mr-2"}),"Add"]})]})]}),(0,B.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(r.updatedAt).toLocaleString()]})]})]})]})})}var le=z(require("react"));var Ve=le.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Ve.displayName="Card";var Fe=le.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:f("flex flex-col space-y-1.5 p-6",e),...t}));Fe.displayName="CardHeader";var We=le.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:f("font-semibold leading-none tracking-tight",e),...t}));We.displayName="CardTitle";var Po=le.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:f("text-sm text-muted-foreground",e),...t}));Po.displayName="CardDescription";var Ge=le.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:f("p-6 st-0",e),...t}));Ge.displayName="CardContent";var Do=le.forwardRef(({className:e,...t},o)=>(0,B.jsx)("div",{ref:o,className:f("flex items-center p-6 st-0",e),...t}));Do.displayName="CardFooter";function Nt({deal:e,customer:t,categories:o,onClick:a}){let n=o.find(i=>i.type==="proposition"&&e.categories.includes(i.id));return(0,B.jsxs)(Ve,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(Fe,{className:"pb-2",children:[(0,B.jsx)("div",{className:"flex justify-between items-center",children:(0,B.jsx)(We,{className:"text-lg font-semibold text-gray-800",children:t==null?void 0:t.name})}),(0,B.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,B.jsxs)(Ge,{children:[(0,B.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,B.jsxs)("div",{className:"flex items-center text-sm text-gray-600",children:[(0,B.jsx)(ot.UserIcon,{className:"w-4 h-4 mr-1 text-xs"}),(0,B.jsx)("span",{children:e.assignee.name})]}),(0,B.jsx)("div",{className:"flex items-center text-sm font-bold text-green-600",children:(0,B.jsxs)("span",{children:["\xA3",e.value.toLocaleString()]})})]}),(0,B.jsx)("div",{className:"flex justify-between items-left mb-3",children:(0,B.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,B.jsx)(ot.CalendarIcon,{className:"w-3 h-3 mr-1"}),(0,B.jsx)("span",{children:new Date(e.updatedAt).toLocaleDateString()})]})}),(0,B.jsx)("div",{className:"flex justify-between items-left",children:n&&(0,B.jsx)(ke,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:n.name})})]})]})}var Ae=require("react-beautiful-dnd");function Pt({onSubmit:e}){var n;let[t,o]=(0,Me.useState)({name:"",intro:"",active:!0});return(0,B.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,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(L,{htmlFor:"customerName",children:"Customer Name"}),(0,B.jsx)(_,{id:"customerName",value:t.name,onChange:i=>o({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(L,{htmlFor:"customerIntro",children:"Intro"}),(0,B.jsx)(te,{id:"customerIntro",value:(n=t.intro)!=null?n:"",onChange:i=>o({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(se,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>o({...t,active:i})}),(0,B.jsx)(L,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,B.jsx)(H,{type:"submit",className:"w-full",children:"Add Customer"})]})}function kt({customers:e,users:t,categories:o,onSubmit:a,initialDeal:n,onAddCustomer:i,onClose:d}){var R,E,W,G;let[r,g]=(0,Me.useState)(n||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("B")[0],closureDate:"",comments:[],description:""}),[w,S]=(0,Me.useState)(!1),[p,y]=(0,Me.useState)({});(0,Me.useEffect)(()=>{n&&g(n)},[n]);let h=()=>{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"),y(m),Object.keys(m).length===0},x=m=>{m.preventDefault(),h()&&(a({...r}),g({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),y({}),d==null||d())},C=m=>{g(P=>{var O;return{...P,categories:(O=P.categories)!=null&&O.includes(m)?P.categories.filter(l=>l!==m):[...P.categories||[],m]}})},b=m=>{e.push(m),g({...r,customer:m}),S(!1),i(m)};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("form",{onSubmit:x,className:"space-y-6",children:[(0,B.jsx)(ve,{className:"h-[60vh] pr-4",children:(0,B.jsxs)("div",{className:"space-y-6 px-4",children:[(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(L,{htmlFor:"customer",children:"Customer"}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsxs)(ge,{value:(E=(R=r.customer)==null?void 0:R.id)==null?void 0:E.toString(),onValueChange:m=>g({...r,customer:{id:Number(m)}}),children:[(0,B.jsx)(re,{children:(0,B.jsx)(be,{placeholder:"Select customer"})}),(0,B.jsx)(ae,{children:e.map(m=>{var P;return(0,B.jsx)(ie,{value:((P=m.id)==null?void 0:P.toString())||"",children:m.name},m.id)})})]}),(0,B.jsx)(H,{variant:"outline",size:"icon",onClick:()=>S(!0),children:(0,B.jsx)(ot.PlusIcon,{className:"w-5 h-5"})})]}),p.customerId&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.customerId})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(L,{htmlFor:"value",children:"Value"}),(0,B.jsx)(_,{id:"value",type:"number",value:r.value||"",onChange:m=>g({...r,value:Number.parseFloat(m.target.value)}),placeholder:"Enter deal value"}),p.value&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.value})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(L,{htmlFor:"assignee",children:"Assignee"}),(0,B.jsxs)(ge,{value:(G=(W=r.assignee)==null?void 0:W.id)==null?void 0:G.toString(),onValueChange:m=>g({...r,assignee:{id:Number(m)}}),children:[(0,B.jsx)(re,{children:(0,B.jsx)(be,{placeholder:"Select assignee"})}),(0,B.jsx)(ae,{children:t&&t.map(m=>{var P;return(0,B.jsx)(ie,{value:((P=m.id)==null?void 0:P.toString())||"",children:m.name},m.id)})})]}),p.assignee&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.assignee})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(L,{htmlFor:"description",children:"Description"}),(0,B.jsx)(te,{id:"description",value:r.description||"",onChange:m=>g({...r,description:m.target.value}),placeholder:"Enter deal description"})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(L,{children:"Categories"}),(0,B.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(m=>(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)("h4",{className:"text-sm font-medium",children:m.charAt(0).toUpperCase()+m.slice(1)}),(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2",children:o.filter(P=>P.type===m).map(P=>{var O;return(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(se,{id:P.id,checked:(O=r.categories)==null?void 0:O.includes(P.id),onCheckedChange:()=>C(P.id)}),(0,B.jsx)("label",{htmlFor:P.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:P.name})]},P.id)})})]},m))})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(L,{htmlFor:"closureDate",children:"Closure Date"}),(0,B.jsx)(_,{id:"closureDate",type:"date",value:r.closureDate,onChange:m=>g({...r,closureDate:m.target.value})}),p.closureDate&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,B.jsx)(H,{type:"submit",className:"w-full",children:n?"Update Deal":"Add Deal"})]}),(0,B.jsx)(fe,{open:w,onOpenChange:S,children:(0,B.jsxs)(Z,{children:[(0,B.jsx)(Y,{children:(0,B.jsx)(ee,{children:"Add New Customer"})}),(0,B.jsx)(Pt,{onSubmit:b})]})})]})}function Mt({status:e,deals:t,users:o,customers:a,categories:n,onDealClick:i,calculateColumnValue:d,calculateWeightedValue:r,addNewDeal:g,onAddCustomer:w}){let[S,p]=(0,Me.useState)(!1);return(0,B.jsxs)("div",{className:"flex flex-col w-80",children:[(0,B.jsx)("h2",{className:"text-xl font-semibold mb-4",children:e}),g&&(0,B.jsxs)(fe,{open:S,onOpenChange:p,children:[(0,B.jsx)(rt,{asChild:!0,children:(0,B.jsxs)(H,{className:"mb-4 w-full bg-green-500 hover:bg-green-600 text-white",children:[(0,B.jsx)(ot.PlusCircle,{className:"mr-2 h-4 w-4"}),"Add New Deal"]})}),(0,B.jsxs)(Z,{children:[(0,B.jsx)(Y,{children:(0,B.jsx)(ee,{children:"Add New Deal"})}),(0,B.jsx)(kt,{customers:a,users:o,categories:n,onSubmit:g,onAddCustomer:w,onClose:()=>p(!1)})]})]}),(0,B.jsx)(Ae.Droppable,{droppableId:e,children:y=>(0,B.jsxs)("div",{ref:y.innerRef,...y.droppableProps,className:"bg-gray-100 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((h,x)=>(0,B.jsx)(Ae.Draggable,{draggableId:h.id.toString(),index:x,children:C=>(0,B.jsx)("div",{ref:C.innerRef,...C.draggableProps,...C.dragHandleProps,children:(0,B.jsx)(Nt,{deal:h,customer:a.find(b=>b.id===h.customer.id),categories:n,onClick:()=>i(h)})})},h.id)),y.placeholder]})}),(0,B.jsxs)("div",{className:"mt-4 text-sm bg-white p-3 rounded-lg shadow",children:[(0,B.jsxs)("p",{className:"font-semibold",children:["Total:"," ",(0,B.jsxs)("span",{className:"text-green-600",children:["\xA3",d(t).toLocaleString()]})]}),(0,B.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,B.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,Me.useState)(null),r=p=>e.deals.filter(y=>y.status===p),g=p=>p.reduce((y,h)=>y+(h.value||0),0),w=(p,y)=>{let h={Cold:.2,Qualified:.4,Proposal:.6,SoW:.7,Won:1,Lost:0};return p.reduce((x,C)=>x+(C.value||0)*h[y],0)},S=(0,Me.useCallback)(p=>{let{source:y,destination:h}=p;if(!h||y.droppableId===h.droppableId&&y.index===h.index)return;let x=y.droppableId,C=h.droppableId;console.log("Moving from ",x,"to",C);let b=[...e.deals],[R]=b.splice(y.index,1);R.status=C,b.splice(h.index,0,R),o(R)},[o]);return(0,B.jsx)(Ae.DragDropContext,{onDragEnd:S,children:(0,B.jsxs)("div",{className:"p-4",children:[(0,B.jsx)("div",{className:"flex space-x-4 overflow-x-auto pb-4",children:ko.filter(p=>p!=="Won"&&p!=="Lost").map(p=>{let y=r(p);return(0,B.jsx)(Mt,{status:p,deals:y,customers:e.customers,users:e.users,categories:e.categories,onDealClick:d,calculateColumnValue:g,calculateWeightedValue:w,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:n},p)})}),i&&(0,B.jsx)(St,{deal:i,users:e.users,customer:e.customers.find(p=>p.id===i.customer.id),categories:e.categories,onClose:()=>d(null),onSave:o,onAddComment:p=>a(i.id.toString(),p)})]})})}0&&(module.exports={CRMKanbanBoard});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a}from"../../chunk-
|
|
2
|
+
"use strict";import{a}from"../../chunk-KDERFUAW.mjs";import"../../chunk-LRIIP54N.mjs";import"../../chunk-ZXPDKKGX.mjs";import"../../chunk-3FW5YDNM.mjs";import"../../chunk-QH3BNFVD.mjs";import"../../chunk-4NETKTTT.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{a as CRMKanbanBoard};
|