cortex-react-components 1.64.1 → 1.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-MUZO74UP.mjs → chunk-2VOU42KD.mjs} +1 -1
- package/dist/{chunk-PFWODHNV.mjs → chunk-3AUTMBDB.mjs} +1 -1
- package/dist/{chunk-X3MBDMXV.mjs → chunk-5ALQQYYE.mjs} +1 -1
- package/dist/{chunk-OT2LLDV2.mjs → chunk-65BHP4TM.mjs} +1 -1
- package/dist/{chunk-ROEJPYRW.mjs → chunk-77KWI6EL.mjs} +1 -1
- package/dist/{chunk-RWWF3HBN.mjs → chunk-B7STYVDB.mjs} +1 -1
- package/dist/{chunk-4XO4HI55.mjs → chunk-CDJP2IDQ.mjs} +1 -1
- package/dist/{chunk-VX4NPEMC.mjs → chunk-CJF6GVGP.mjs} +1 -1
- package/dist/{chunk-TASJS6US.mjs → chunk-COI2LCY2.mjs} +1 -1
- package/dist/chunk-DVF55CWB.mjs +4 -0
- package/dist/{chunk-UM3WHBE7.mjs → chunk-DVGPU4EL.mjs} +1 -1
- package/dist/{chunk-RVI4KPBJ.mjs → chunk-EVVDCPEA.mjs} +1 -1
- package/dist/{chunk-YQ2YVQBS.mjs → chunk-FN5C27GW.mjs} +1 -1
- package/dist/{chunk-5LF662B4.mjs → chunk-FSYU3D5O.mjs} +1 -1
- package/dist/{chunk-UVPODMUO.mjs → chunk-FYEE5UWZ.mjs} +1 -1
- package/dist/{chunk-QZJGH4W6.mjs → chunk-GHXEOXV4.mjs} +1 -1
- package/dist/{chunk-VXGRJCCM.mjs → chunk-IC57R2EU.mjs} +1 -1
- package/dist/{chunk-XGEMVLT5.mjs → chunk-IH37BDR2.mjs} +1 -1
- package/dist/chunk-IPVKFQEY.mjs +4 -0
- package/dist/{chunk-X7PHWC2I.mjs → chunk-JLCWVIEP.mjs} +1 -1
- package/dist/{chunk-3HDDBU3J.mjs → chunk-KEM3XJKI.mjs} +1 -1
- package/dist/{chunk-ELPMUABW.mjs → chunk-KGSTIGCT.mjs} +1 -1
- package/dist/{chunk-SVYUY3VF.mjs → chunk-L5MDFQGH.mjs} +1 -1
- package/dist/{chunk-WLA5QCBE.mjs → chunk-MQRRCCAR.mjs} +1 -1
- package/dist/{chunk-Y7TUU6BG.mjs → chunk-MUBDAI2K.mjs} +1 -1
- package/dist/{chunk-HQTSD5A3.mjs → chunk-NP2M5K7O.mjs} +1 -1
- package/dist/{chunk-ISYJGX2I.mjs → chunk-NUQ6Z3WQ.mjs} +1 -1
- package/dist/{chunk-ZKU7UP6U.mjs → chunk-OMVXDUX7.mjs} +1 -1
- package/dist/{chunk-DAJNZDN6.mjs → chunk-PBRC3UOA.mjs} +1 -1
- package/dist/{chunk-KETV2XVN.mjs → chunk-SX5U74MW.mjs} +1 -1
- package/dist/{chunk-6BZPTAOQ.mjs → chunk-T5W5LMEK.mjs} +1 -1
- package/dist/{chunk-666KIWPS.mjs → chunk-T6W76EOH.mjs} +1 -1
- package/dist/{chunk-PEL6QUMS.mjs → chunk-U7Q6ZRR3.mjs} +1 -1
- package/dist/{chunk-VT6DWUPF.mjs → chunk-UDQTFQR7.mjs} +1 -1
- package/dist/chunk-URPKAQGD.mjs +1 -0
- package/dist/{chunk-ERUB6LU6.mjs → chunk-VGQTRTPZ.mjs} +1 -1
- package/dist/{chunk-MDEYJGAN.mjs → chunk-WPL2QWNG.mjs} +1 -1
- package/dist/{chunk-TYROOO53.mjs → chunk-X4Q7WZZS.mjs} +1 -1
- package/dist/{chunk-B7VQUUH3.mjs → chunk-YGFSXGAJ.mjs} +1 -1
- package/dist/{chunk-CXZGSPKM.mjs → chunk-YPK6OLRS.mjs} +1 -1
- package/dist/{chunk-G72SIYN7.mjs → chunk-ZAXQ74I3.mjs} +1 -1
- package/dist/{chunk-Z6NED523.mjs → chunk-ZY2PDUUB.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +1 -1
- package/dist/components/Blocks/CallToAction.mjs +1 -1
- package/dist/components/Blocks/CallToAction.stories.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
- package/dist/components/Blocks/CollapsibleArea.stories.mjs +1 -1
- package/dist/components/Blocks/Content.mjs +1 -1
- package/dist/components/Blocks/Content.stories.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/ReusableContentBlock.mjs +1 -1
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/CogeBoard.js +1 -1
- package/dist/components/CRM/CogeBoard.mjs +1 -1
- package/dist/components/CRM/CogeBoard.stories.js +1 -1
- package/dist/components/CRM/CogeBoard.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.mjs +1 -1
- package/dist/components/CRM/KanbanColumn.stories.mjs +1 -1
- package/dist/components/CRM/NewCustomerForm.mjs +1 -1
- package/dist/components/CRM/NewCustomerForm.stories.mjs +1 -1
- package/dist/components/CRM/NewDealForm.mjs +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/Cards/ContentCard.mjs +1 -1
- package/dist/components/Cards/ContentCard.stories.mjs +1 -1
- package/dist/components/Cards/FeatureCard.mjs +1 -1
- package/dist/components/Cards/FeatureCard.stories.mjs +1 -1
- package/dist/components/Cards/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AddEpicModal.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/KanbanBoard.mjs +1 -1
- package/dist/components/DigitalColleagues/KanbanBoard.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskDetailsModal.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskDetailsModal.stories.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskSidebar.mjs +1 -1
- package/dist/components/DigitalColleagues/TaskSidebar.stories.mjs +1 -1
- package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
- package/dist/components/Heros/HighImpact/index.mjs +1 -1
- package/dist/components/Heros/LowImpact/index.mjs +1 -1
- package/dist/components/Heros/MediumImpact/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/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/FeatureGrid.stories.mjs +1 -1
- package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
- package/dist/components/Layouts/Print.mjs +1 -1
- package/dist/components/Layouts/Print.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 +9 -8
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +2 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/tabs.css +1 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/tabs.js +4 -0
- package/dist/components/ui/tabs.mjs +2 -0
- package/dist/globals.css +1 -1
- package/dist/index.js +14 -13
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.js +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Blog.stories.js +1 -1
- package/dist/pages/Blog.stories.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/IndexPage.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.js +8 -8
- package/dist/pages/Page.stories.mjs +1 -1
- package/dist/pages/Printable.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/BlogList.mjs +1 -1
- package/dist/sections/BlogList.stories.mjs +1 -1
- package/dist/sections/ContactSection.mjs +1 -1
- package/dist/sections/ContactSection.stories.mjs +1 -1
- package/dist/sections/ImageSection.stories.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PageSections.stories.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/PricingSection.stories.mjs +1 -1
- package/dist/sections/ServiceDetail.mjs +1 -1
- package/dist/sections/ServiceDetailSection.mjs +1 -1
- package/dist/sections/ServiceDetailSection.stories.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/ServiceSection.stories.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-MEWCJ4MA.mjs +0 -1
- package/dist/chunk-OIQ6GXBY.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
"use strict";"use client";var Mt=Object.create;var we=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Vt=(e,t)=>{for(var r in t)we(e,r,{get:t[r],enumerable:!0})},Ke=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zt(t))!Ht.call(e,i)&&i!==r&&we(e,i,{get:()=>t[i],enumerable:!(a=Et(t,i))||a.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Mt(Bt(e)):{},Ke(t||!e||!e.__esModule?we(r,"default",{value:e,enumerable:!0}):r,e)),Ft=e=>Ke(we({},"__esModule",{value:!0}),e);var Ar={};Vt(Ar,{CRMKanbanBoard:()=>kr});module.exports=Ft(Ar);var Le=require("react");var he=z(require("react")),I=z(require("@radix-ui/react-dialog")),rt=require("lucide-react");var tt=require("clsx");var Ve="-",Ut=e=>{let t=Gt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:m=>{let o=m.split(Ve);return o[0]===""&&o.length!==1&&o.shift(),Je(o,t)||Wt(m)},getConflictingClassGroupIds:(m,o)=>{let b=r[m]||[];return o&&a[m]?[...b,...a[m]]:b}}},Je=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),i=a?Je(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let l=e.join(Ve);return t.validators.find(({validator:m})=>m(l))?.classGroupId},$e=/^\[(.+)\]$/,Wt=e=>{if($e.test(e)){let t=$e.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Gt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return jt(Object.entries(e.classGroups),r).forEach(([l,m])=>{He(m,a,l,t)}),a},He=(e,t,r,a)=>{e.forEach(i=>{if(typeof i=="string"){let l=i===""?t:qe(t,i);l.classGroupId=r;return}if(typeof i=="function"){if(Ot(i)){He(i(a),t,r,a);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([l,m])=>{He(m,qe(t,l),r,a)})})},qe=(e,t)=>{let r=e;return t.split(Ve).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Ot=e=>e.isThemeGetter,jt=(e,t)=>t?e.map(([r,a])=>{let i=a.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([m,o])=>[t+m,o])):l);return[r,i]}):e,_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,i=(l,m)=>{r.set(l,m),t++,t>e&&(t=0,a=r,r=new Map)};return{get(l){let m=r.get(l);if(m!==void 0)return m;if((m=a.get(l))!==void 0)return i(l,m),m},set(l,m){r.has(l)?r.set(l,m):i(l,m)}}},Qe="!",Kt=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,i=t[0],l=t.length,m=o=>{let b=[],S=0,N=0,p;for(let g=0;g<o.length;g++){let T=o[g];if(S===0){if(T===i&&(a||o.slice(g,g+l)===t)){b.push(o.slice(N,g)),N=g+l;continue}if(T==="/"){p=g;continue}}T==="["?S++:T==="]"&&S--}let v=b.length===0?o:o.substring(N),C=v.startsWith(Qe),h=C?v.substring(1):v,P=p&&p>N?p-N:void 0;return{modifiers:b,hasImportantModifier:C,baseClassName:h,maybePostfixModifierPosition:P}};return r?o=>r({className:o,parseClassName:m}):m},$t=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},qt=e=>({cache:_t(e.cacheSize),parseClassName:Kt(e),...Ut(e)}),Jt=/\B+/,Qt=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:i}=t,l=[],m=e.trim().split(Jt),o="";for(let b=m.length-1;b>=0;b-=1){let S=m[b],{modifiers:N,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:C}=r(S),h=!!C,P=a(h?v.substring(0,C):v);if(!P){if(!h){o=S+(o.length>0?" "+o:o);continue}if(P=a(v),!P){o=S+(o.length>0?" "+o:o);continue}h=!1}let g=$t(N).join(":"),T=p?g+Qe:g,E=T+P;if(l.includes(E))continue;l.push(E);let d=i(P,h);for(let y=0;y<d.length;++y){let n=d[y];l.push(T+n)}o=S+(o.length>0?" "+o:o)}return o};function Xt(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Xe(t))&&(a&&(a+=" "),a+=r);return a}var Xe=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(e[a]))&&(r&&(r+=" "),r+=t);return r};function Zt(e,...t){let r,a,i,l=m;function m(b){let S=t.reduce((N,p)=>p(N),e());return r=qt(S),a=r.cache.get,i=r.cache.set,l=o,o(b)}function o(b){let S=a(b);if(S)return S;let N=Qt(b,r);return i(b,N),N}return function(){return l(Xt.apply(null,arguments))}}var R=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ze=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yt=/^\d+\/\d+$/,er=new Set(["px","full","screen"]),tr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|it|pc|in|cm|mm|cap|ch|ex|r?lh|cq(B|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,or=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ar=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>de(e)||er.has(e)||Yt.test(e),O=e=>me(e,"length",ur),de=e=>!!e&&!Number.isNaN(Number(e)),Be=e=>me(e,"number",de),be=e=>!!e&&Number.isInteger(Number(e)),ir=e=>e.endsWith("%")&&de(e.slice(0,-1)),u=e=>Ze.test(e),j=e=>tr.test(e),nr=new Set(["length","size","percentage"]),lr=e=>me(e,nr,Ye),cr=e=>me(e,"position",Ye),dr=new Set(["image","url"]),mr=e=>me(e,dr,gr),pr=e=>me(e,"",fr),ve=()=>!0,me=(e,t,r)=>{let a=Ze.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},ur=e=>rr.test(e)&&!or.test(e),Ye=()=>!1,fr=e=>ar.test(e),gr=e=>sr.test(e);var br=()=>{let e=R("colors"),t=R("spacing"),r=R("blur"),a=R("brightness"),i=R("borderColor"),l=R("borderRadius"),m=R("borderSpacing"),o=R("borderWidth"),b=R("contrast"),S=R("grayscale"),N=R("hueRotate"),p=R("invert"),v=R("gap"),C=R("gradientColorStops"),h=R("gradientColorStopPositions"),P=R("inset"),g=R("margin"),T=R("opacity"),E=R("padding"),d=R("saturate"),y=R("scale"),n=R("sepia"),D=R("skew"),ce=R("space"),We=R("translate"),Ie=()=>["auto","contain","none"],Me=()=>["auto","hidden","clip","visible","scroll"],Ee=()=>["auto",u,t],k=()=>[u,t],Ge=()=>["",G,O],ye=()=>["auto",de,u],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ce=()=>["solid","dashed","dotted","double","none"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],ge=()=>["","0",u],_e=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[de,u];return{cacheSize:500,separator:":",theme:{colors:[ve],spacing:[G,O],blur:["none","",j,u],brightness:W(),borderColor:[e],borderRadius:["none","","full",j,u],borderSpacing:k(),borderWidth:Ge(),contrast:W(),grayscale:ge(),hueRotate:W(),invert:ge(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[ir,O],inset:Ee(),margin:Ee(),opacity:W(),padding:k(),saturate:W(),scale:W(),sepia:ge(),skew:W(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[j]}],"break-after":[{"break-after":_e()}],"break-before":[{"break-before":_e()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Oe(),u]}],overflow:[{overflow:Me()}],"overflow-x":[{"overflow-x":Me()}],"overflow-y":[{"overflow-y":Me()}],overscroll:[{overscroll:Ie()}],"overscroll-x":[{"overscroll-x":Ie()}],"overscroll-y":[{"overscroll-y":Ie()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[P]}],"inset-x":[{"inset-x":[P]}],"inset-y":[{"inset-y":[P]}],start:[{start:[P]}],end:[{end:[P]}],top:[{top:[P]}],right:[{right:[P]}],bottom:[{bottom:[P]}],left:[{left:[P]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",be,u]}],basis:[{basis:Ee()}],"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:ge()}],shrink:[{shrink:ge()}],order:[{order:["first","last","none",be,u]}],"grid-cols":[{"grid-cols":[ve]}],"col-start-end":[{col:["auto",{span:["full",be,u]},u]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[ve]}],"row-start-end":[{row:["auto",{span:[be,u]},u]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"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:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],it:[{it:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[ce]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ce]}],"space-y-reverse":["space-y-reverse"],B:[{B:["auto","min","max","fit","svw","lvw","dvw",u,t]}],"min-B":[{"min-B":[u,t,"min","max","fit"]}],"max-B":[{"max-B":[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,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Be]}],"font-family":[{font:[ve]}],"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",de,Be]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,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":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,O]}],"underline-offset":[{"underline-offset":["auto",G,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:k()}],"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":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),cr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[l]}],"rounded-B":[{"rounded-B":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-Le":[{"rounded-Le":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-B":[{border:[o]}],"border-B-x":[{"border-x":[o]}],"border-B-y":[{"border-y":[o]}],"border-B-B":[{"border-B":[o]}],"border-B-e":[{"border-e":[o]}],"border-B-t":[{"border-t":[o]}],"border-B-r":[{"border-r":[o]}],"border-B-b":[{"border-b":[o]}],"border-B-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...Ce(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:Ce()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-B":[{"border-B":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Ce()]}],"outline-offset":[{"outline-offset":[G,u]}],"outline-B":[{outline:[G,O]}],"outline-color":[{outline:[e]}],"ring-B":[{ring:Ge()}],"ring-B-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-B":[{"ring-offset":[G,O]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",j,pr]}],"shadow-color":[{shadow:[ve]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":je()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",j,u]}],grayscale:[{grayscale:[S]}],"hue-rotate":[{"hue-rotate":[N]}],invert:[{invert:[p]}],saturate:[{saturate:[d]}],sepia:[{sepia:[n]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[S]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[N]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[d]}],"backdrop-sepia":[{"backdrop-sepia":[n]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[be,u]}],"translate-x":[{"translate-x":[We]}],"translate-y":[{"translate-y":[We]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",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","B-resize","B-resize","nw-resize","Le-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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-it":[{"scroll-it":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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-B":[{stroke:[G,O,Be]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","it","pr","pb","pl"],px:["pr","pl"],py:["it","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["B","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-Le","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-B":["rounded-ss","rounded-es"],"rounded-e":["rounded-Le","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-B":["border-B-B","border-B-e","border-B-t","border-B-r","border-B-b","border-B-l"],"border-B-x":["border-B-r","border-B-l"],"border-B-y":["border-B-t","border-B-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-it","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-it","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Zt(br);function f(...e){return et((0,tt.clsx)(e))}var B=require("react/jsx-runtime"),pe=I.Root,ot=I.Trigger,vr=I.Portal;var at=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Overlay,{ref:r,className:f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));at.displayName=I.Overlay.displayName;var X=he.forwardRef(({className:e,children:t,...r},a)=>(0,B.jsxs)(vr,{children:[(0,B.jsx)(at,{}),(0,B.jsxs)(I.Content,{ref:a,className:f("fixed left-[50%] top-[50%] z-50 grid B-full max-B-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,(0,B.jsxs)(I.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)(rt.X,{className:"h-4 B-4"}),(0,B.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));X.displayName=I.Content.displayName;var Z=({className:e,...t})=>(0,B.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Z.displayName="DialogHeader";var hr=({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});hr.displayName="DialogFooter";var Y=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Title,{ref:r,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));Y.displayName=I.Title.displayName;var xr=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Description,{ref:r,className:f("text-sm text-muted-foreground",e),...t}));xr.displayName=I.Description.displayName;var st=require("@radix-ui/react-slot"),it=require("class-variance-authority"),nt=z(require("react")),yr=(0,it.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 B-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),V=nt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...i},l)=>(0,B.jsx)(e?st.Slot:"button",{className:f(yr({className:t,size:r,variant:a})),ref:l,...i}));V.displayName="Button";var ct=z(require("react"));var U=ct.forwardRef(({className:e,type:t,...r},a)=>(0,B.jsx)("input",{type:t,className:f("flex h-9 B-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));U.displayName="Input";var mt=z(require("react")),Fe=z(require("@radix-ui/react-label"));var Cr=(0,it.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=mt.forwardRef(({className:e,...t},r)=>(0,B.jsx)(Fe.Root,{ref:r,className:f(Cr(),e),...t}));M.displayName=Fe.Root.displayName;var ft=z(require("react")),ee=ft.forwardRef(({className:e,...t},r)=>(0,B.jsx)("textarea",{className:f("flex min-h-[80px] B-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));ee.displayName="Textarea";var x=z(require("@radix-ui/react-select")),_=z(require("react")),re=x.Root;var oe=x.Value,K=_.forwardRef(({children:e,className:t,...r},a)=>(0,B.jsxs)(x.Trigger,{className:f("flex h-10 B-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...r,children:[e,(0,B.jsx)(x.Icon,{asChild:!0,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 B-4 opacity-50"})})]}));K.displayName=x.Trigger.displayName;var bt=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,B.jsx)(rt.ChevronUp,{className:"h-4 B-4"})}));bt.displayName=x.ScrollUpButton.displayName;var vt=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 B-4"})}));vt.displayName=x.ScrollDownButton.displayName;var $=_.forwardRef(({children:e,className:t,position:r="popper",...a},i)=>(0,B.jsx)(x.Portal,{children:(0,B.jsxs)(x.Content,{className:f("relative z-50 max-h-96 min-B-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,ref:i,...a,children:[(0,B.jsx)(bt,{}),(0,B.jsx)(x.Viewport,{className:f("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] B-full min-B-[var(--radix-select-trigger-width)]"),children:e}),(0,B.jsx)(vt,{})]})}));$.displayName=x.Content.displayName;var wr=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));wr.displayName=x.Label.displayName;var q=_.forwardRef(({children:e,className:t,...r},a)=>(0,B.jsxs)(x.Item,{className:f("relative flex B-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...r,children:[(0,B.jsx)("span",{className:"absolute left-2 flex h-3.5 B-3.5 items-center justify-center",children:(0,B.jsx)(x.ItemIndicator,{children:(0,B.jsx)(rt.Check,{className:"h-4 B-4"})})}),(0,B.jsx)(x.ItemText,{children:e})]}));q.displayName=x.Item.displayName;var Sr=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Sr.displayName=x.Separator.displayName;var xe=z(require("@radix-ui/react-checkbox")),xt=z(require("react")),ae=xt.forwardRef(({className:e,...t},r)=>(0,B.jsx)(xe.Root,{className:f("peer h-4 B-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:r,...t,children:(0,B.jsx)(xe.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,B.jsx)(rt.Check,{className:"h-4 B-4"})})}));ae.displayName=xe.Root.displayName;var Nr=(0,it.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ne({className:e,variant:t,...r}){return(0,B.jsx)("div",{className:f(Nr({variant:t}),e),...r})}var Ue=z(require("react")),F=z(require("@radix-ui/react-scroll-area"));var ue=Ue.forwardRef(({className:e,children:t,...r},a)=>(0,B.jsxs)(F.Root,{ref:a,className:f("relative overflow-hidden",e),...r,children:[(0,B.jsx)(F.Viewport,{className:"h-full B-full rounded-[inherit]",children:t}),(0,B.jsx)(wt,{}),(0,B.jsx)(F.Corner,{})]}));ue.displayName=F.Root.displayName;var wt=Ue.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,B.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full B-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,B.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=F.ScrollAreaScrollbar.displayName;function St({deal:e,users:t,customer:r,categories:a,onClose:i,onSave:l,onAddComment:m}){let[o,b]=(0,Le.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[S,N]=(0,Le.useState)(""),[p,v]=(0,Le.useState)(!1),[C,h]=(0,Le.useState)(null);(0,Le.useEffect)(()=>{v(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let P=async()=>{try{let n=await l(o);n.success?(v(!1),h(null)):console.error("Failed to save deal:",n.errors)}catch(n){console.error("Failed to save deal:",n)}},g=(n,D)=>{b(ce=>({...ce,[n]:D}))},T=n=>{let D=(o.categories||[]).includes(n)?(o.categories||[]).filter(ce=>ce!==n):[...o.categories||[],n];g("categories",D)},E=async()=>{if(S.trim()){let n={text:S,timestamp:new Date().toISOString()};try{let D=await m(n);if(!D.success){console.error("Failed to add comment:",D.errors);return}}catch(D){console.error("Failed to add comment:",D)}b(D=>({...D,comments:[...D.comments||[],n]})),N("")}},d=n=>{switch(n){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},y=n=>t?.find(D=>D.id===Number(n));return(0,B.jsx)(pe,{open:!0,children:(0,B.jsxs)(X,{className:"max-B-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,B.jsxs)(Z,{className:"flex flex-row items-center justify-between",children:[(0,B.jsx)(Y,{className:"text-2xl font-bold",children:r?.name}),(0,B.jsxs)("div",{className:"flex space-x-2",children:[(0,B.jsx)(V,{variant:"outline",onClick:i,children:"Close"}),(0,B.jsxs)(V,{onClick:P,disabled:!p,children:[(0,B.jsx)(rt.SaveIcon,{className:"B-4 h-4 mr-2"}),"Save"]})]})]}),(0,B.jsxs)(ue,{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 m-1",children:C==="value"?(0,B.jsx)(U,{type:"number",value:o.value,onChange:n=>g("value",Number(n.target.value)),onBlur:()=>h(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 p-1 border border-background hover:border-accent rounded",onClick:()=>h("value"),children:["\xA3",o.value?.toLocaleString()]})}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Assignee"}),C==="assignee"?(0,B.jsxs)(re,{value:o?.assignee?.id?.toString()||"",onValueChange:n=>g("assignee",y(n)),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select assignee"})}),(0,B.jsx)($,{children:t&&t.map(n=>(0,B.jsx)(q,{value:n?.id?.toString()||"",children:n.name},n.id))})]}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("assignee"),children:[(0,B.jsx)(rt.UserIcon,{className:"B-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:o.assignee.name})]})]}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Closure Date"}),C==="closureDate"?(0,B.jsx)(U,{type:"date",value:o.closureDate?.split("T")[0]??"",onChange:n=>g("closureDate",n.target.value),onBlur:()=>h(null),className:"mr-2",autoFocus:!0}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("closureDate"),children:[(0,B.jsx)(rt.CalendarIcon,{className:"B-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/B"})]})]})]}),(0,B.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Description"}),C==="description"?(0,B.jsx)(ee,{value:o.description||"",onChange:n=>g("description",n.target.value),onBlur:()=>h(null),className:"min-h-[100px]",autoFocus:!0}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>h("description"),children:o.description})]})}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 it-2 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Status"}),C==="status"?(0,B.jsxs)(re,{value:o.status,onValueChange:n=>{g("status",n),h(null)},children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select status"})}),(0,B.jsx)($,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(n=>(0,B.jsx)(q,{value:n,children:n},n))})]}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("status"),children:o.status})]}),(0,B.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Categories"}),C==="categories"?(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(n=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:n.id?.toString()||"",checked:(o.categories||[]).some(D=>D.id===n.id),onCheckedChange:()=>n.id!==void 0&&T(n)}),(0,B.jsx)("label",{htmlFor:(n.id??"").toString(),className:`text-sm font-medium ${d(n.type||"sector")} px-2 py-1 rounded`,children:n.name})]},n.id))}):(0,B.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("categories"),children:o.categories&&o.categories.map(n=>{let D=n;return D?(0,B.jsx)(Ne,{variant:"outline",className:d(D.type||"sector"),children:D.name},D.id):null})})]}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"COGE Status"}),C==="gecoStatus"?(0,B.jsxs)(re,{value:o.gecoStatus??void 0,onValueChange:n=>{g("gecoStatus",n),h(null)},children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select status"})}),(0,B.jsx)($,{children:["firm","forecast","other"].map(n=>(0,B.jsx)(q,{value:n,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("gecoStatus"),children:o.gecoStatus?o.gecoStatus.charAt(0).toUpperCase()+o.gecoStatus.slice(1):"N/B"})]})]}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 it-4 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,B.jsx)(ue,{className:"h-[200px] overflow-y-auto",children:(0,B.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((n,D)=>new Date(D.timestamp||"").getTime()-new Date(n.timestamp||"").getTime()).map(n=>(0,B.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,B.jsx)("p",{className:"text-sm text-foreground",children:n.text}),(0,B.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[n?.author?.name," - ",new Date(n.timestamp||"").toLocaleString()]})]},n.id))})}),(0,B.jsxs)("div",{className:"flex mt-2",children:[(0,B.jsx)(U,{value:S,onChange:n=>N(n.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,B.jsxs)(V,{onClick:E,className:"ml-2",children:[(0,B.jsx)(rt.PlusIcon,{className:"B-4 h-4 mr-2"}),"Add"]})]})]}),(0,B.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ie=z(require("react"));var Pe=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Pe.displayName="Card";var De=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("flex flex-col space-y-1.5 p-6",e),...t}));De.displayName="CardHeader";var Re=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("font-semibold leading-none tracking-tight",e),...t}));Re.displayName="CardTitle";var Pr=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Pr.displayName="CardDescription";var ke=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("p-6 it-0",e),...t}));ke.displayName="CardContent";var Dr=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("flex items-center p-6 it-0",e),...t}));Dr.displayName="CardFooter";function Nt({deal:e,customer:t,categories:r,onClick:a,compact:i=!1}){let l=r.find(m=>m.type==="proposition"&&(e.categories??[]).includes(m.id));return i?(0,B.jsxs)(Pe,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(De,{className:"pb-1 it-2",children:[(0,B.jsx)(Re,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,B.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,B.jsx)(ke,{className:"text-xs text-gray-500 pb-2",children:(0,B.jsx)("div",{className:"flex justify-between items-center mb-1",children:(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.jsxs)(Pe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(De,{className:"pb-2",children:[(0,B.jsx)("div",{className:"flex justify-between items-center",children:(0,B.jsx)(Re,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,B.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,B.jsxs)(ke,{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-accent",children:[(0,B.jsx)(rt.UserIcon,{className:"B-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)(rt.CalendarIcon,{className:"B-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:l&&(0,B.jsx)(Ne,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:l.name})})]})]})}var Te=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Dt({onSubmit:e}){let[t,r]=(0,Le.useState)({name:"",intro:"",active:!1});return(0,B.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),r({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(M,{htmlFor:"customerName",children:"Customer Name"}),(0,B.jsx)(U,{id:"customerName",value:t.name,onChange:i=>r({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(M,{htmlFor:"customerIntro",children:"Intro"}),(0,B.jsx)(ee,{id:"customerIntro",value:t.intro??"",onChange:i=>r({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>r({...t,active:i})}),(0,B.jsx)(M,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,B.jsx)(V,{type:"submit",className:"B-full",children:"Add Customer"})]})}function kt({customers:e,users:t,categories:r,onSubmit:a,initialDeal:i,onAddCustomer:l,onClose:m}){let[o,b]=(0,Le.useState)(i||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[S,N]=(0,Le.useState)(!1),[p,v]=(0,Le.useState)({});(0,Le.useEffect)(()=>{i&&b(i)},[i]);let C=()=>{let d={};return o.customer||(d.customer="Customer is required"),o.value||(d.value="Value is required"),o.assignee||(d.assignee="Assignee is required"),o.closureDate||(d.closureDate="Closure Date is required"),v(d),Object.keys(d).length===0},h=async d=>{d.preventDefault(),v({});try{if(C()){let y=await a({...o});y.success?(b({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),m?.()):v(y.errors||{})}}catch{v({submit:"An error occurred while submitting the form."})}},P=d=>{b(y=>({...y,categories:(y.categories||[]).includes(d.id)?(y.categories||[]).filter(n=>n!==d.id):[...y.categories||[],d.id]}))},g=async d=>{b({...o,customer:d});try{let y=await l(d);y.success?N(!1):v(y.errors||{})}catch{v({submit:"An error occurred while submitting the form."})}},T=d=>t?.find(y=>y.id===Number(d)),E=d=>e?.find(y=>y.id===Number(d));return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,B.jsx)(ue,{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)(M,{htmlFor:"customer",children:"Customer"}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsxs)(re,{value:o.customer?.id?.toString(),onValueChange:d=>b({...o,customer:E(d)}),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select customer"})}),(0,B.jsx)($,{children:e.map(d=>(0,B.jsx)(q,{value:d.id?.toString()||"",children:d.name},d.id))})]}),(0,B.jsx)(V,{variant:"outline",size:"icon",onClick:()=>N(!0),children:(0,B.jsx)(rt.PlusIcon,{className:"B-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)(M,{htmlFor:"value",children:"Value"}),(0,B.jsx)(U,{id:"value",type:"number",value:o.value||"",onChange:d=>b({...o,value:Number.parseFloat(d.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)(M,{htmlFor:"assignee",children:"Assignee"}),(0,B.jsxs)(re,{value:o.assignee?.id?.toString(),onValueChange:d=>b({...o,assignee:T(d)}),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select assignee"})}),(0,B.jsx)($,{children:t&&t.map(d=>(0,B.jsx)(q,{value:d.id?.toString()||"",children:d.name},d.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)(M,{htmlFor:"description",children:"Description"}),(0,B.jsx)(ee,{id:"description",value:o.description||"",onChange:d=>b({...o,description:d.target.value}),placeholder:"Enter deal description"})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{children:"Categories"}),(0,B.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(d=>(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)("h4",{className:"text-sm font-medium",children:d.charAt(0).toUpperCase()+d.slice(1)}),(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(y=>y.type===d).map(y=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:y.id.toString(),checked:o.categories?.includes(y.id),onCheckedChange:()=>P(y)}),(0,B.jsx)("label",{htmlFor:y.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:y.name})]},y.id))})]},d))})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"closureDate",children:"Closure Date"}),(0,B.jsx)(U,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:d=>b({...o,closureDate:d.target.value})}),p.closureDate&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,B.jsx)(V,{type:"submit",className:"B-full",children:i?"Update Deal":"Add Deal"})]}),(0,B.jsx)(pe,{open:S,onOpenChange:N,children:(0,B.jsxs)(X,{children:[(0,B.jsx)(Z,{children:(0,B.jsx)(Y,{children:"Add New Customer"})}),(0,B.jsx)(Dt,{onSubmit:g})]})})]})}function Lt({status:e,deals:t,users:r,customers:a,categories:i,onDealClick:l,calculateColumnValue:m,calculateWeightedValue:o,addNewDeal:b,onAddCustomer:S,compact:N=!1}){let[p,v]=(0,Le.useState)(!1);return(0,B.jsxs)("div",{className:"flex flex-col B-80",children:[(0,B.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),b&&(0,B.jsxs)(pe,{open:p,onOpenChange:v,children:[(0,B.jsx)(ot,{asChild:!0,children:(0,B.jsxs)(V,{className:"mb-4 B-full",children:[(0,B.jsx)(rt.PlusCircle,{className:"mr-2 h-4 B-4"}),"Add New Deal"]})}),(0,B.jsxs)(X,{children:[(0,B.jsx)(Z,{children:(0,B.jsx)(Y,{children:"Add New Deal"})}),(0,B.jsx)(kt,{customers:a,users:r,categories:i,onSubmit:b,onAddCustomer:S??(async()=>Promise.resolve({success:!1})),onClose:()=>v(!1)})]})]}),(0,B.jsx)(Te.Droppable,{droppableId:e,isDropDisabled:!1,children:C=>(0,B.jsxs)("div",{ref:C.innerRef,...C.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((h,P)=>(0,B.jsx)(Te.Draggable,{draggableId:h.id.toString(),index:h.id,children:g=>(0,B.jsx)("div",{ref:g.innerRef,...g.draggableProps,...g.dragHandleProps,children:(0,B.jsx)(Nt,{deal:h,customer:h.customer,categories:i,onClick:()=>l(h),compact:N})})},h.id.toString())),C.placeholder]})}),(0,B.jsxs)("div",{className:"mt-4 text-sm 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",m(t).toLocaleString()]})]}),(0,B.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,B.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var Rr=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function kr({initialData:e,addNewDeal:t,updateDeal:r,addComment:a,addNewCustomer:i}){let[l,m]=(0,Le.useState)(null),o=p=>(e.deals??[]).filter(v=>v.status===p),b=p=>p.reduce((v,C)=>v+(C.value||0),0),S=(p,v)=>{let C={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return p.reduce((h,P)=>h+(P.value||0)*C[v],0)},N=(0,Le.useCallback)(p=>{let{source:v,destination:C}=p;if(!C||v.droppableId===C.droppableId&&v.index===C.index)return;let h=v.droppableId,P=C.droppableId,g=e.deals?.filter(E=>E.id===v.index)[0],T=[...e.deals??[]];g&&(g.status=P,r(g))},[r]);return(0,B.jsx)(Te.DragDropContext,{onDragEnd:N,children:(0,B.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,B.jsx)("div",{className:"flex space-x-4 pb-4",children:Rr.filter(p=>p!=="Lost").map(p=>{let v=o(p);return(0,B.jsx)(Lt,{status:p,deals:v,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:m,calculateColumnValue:b,calculateWeightedValue:S,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:i},p)})}),l&&(0,B.jsx)(St,{deal:l,users:e.users,customer:l.customer,categories:e.categories??[],onClose:()=>m(null),onSave:r,onAddComment:p=>a(l.id.toString(),p)})]})})}0&&(module.exports={CRMKanbanBoard});
|
|
4
|
+
"use strict";"use client";var Mt=Object.create;var we=Object.defineProperty;var Et=Object.getOwnPropertyDescriptor;var zt=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Vt=(e,t)=>{for(var r in t)we(e,r,{get:t[r],enumerable:!0})},Ke=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zt(t))!Ht.call(e,i)&&i!==r&&we(e,i,{get:()=>t[i],enumerable:!(a=Et(t,i))||a.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Mt(Bt(e)):{},Ke(t||!e||!e.__esModule?we(r,"default",{value:e,enumerable:!0}):r,e)),Ft=e=>Ke(we({},"__esModule",{value:!0}),e);var Ar={};Vt(Ar,{CRMKanbanBoard:()=>kr});module.exports=Ft(Ar);var Le=require("react");var he=z(require("react")),I=z(require("@radix-ui/react-dialog")),rt=require("lucide-react");var tt=require("clsx");var Ve="-",Ut=e=>{let t=Gt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:m=>{let o=m.split(Ve);return o[0]===""&&o.length!==1&&o.shift(),Je(o,t)||Wt(m)},getConflictingClassGroupIds:(m,o)=>{let b=r[m]||[];return o&&a[m]?[...b,...a[m]]:b}}},Je=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),i=a?Je(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let l=e.join(Ve);return t.validators.find(({validator:m})=>m(l))?.classGroupId},$e=/^\[(.+)\]$/,Wt=e=>{if($e.test(e)){let t=$e.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Gt=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return jt(Object.entries(e.classGroups),r).forEach(([l,m])=>{He(m,a,l,t)}),a},He=(e,t,r,a)=>{e.forEach(i=>{if(typeof i=="string"){let l=i===""?t:qe(t,i);l.classGroupId=r;return}if(typeof i=="function"){if(Ot(i)){He(i(a),t,r,a);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([l,m])=>{He(m,qe(t,l),r,a)})})},qe=(e,t)=>{let r=e;return t.split(Ve).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},Ot=e=>e.isThemeGetter,jt=(e,t)=>t?e.map(([r,a])=>{let i=a.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([m,o])=>[t+m,o])):l);return[r,i]}):e,_t=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,i=(l,m)=>{r.set(l,m),t++,t>e&&(t=0,a=r,r=new Map)};return{get(l){let m=r.get(l);if(m!==void 0)return m;if((m=a.get(l))!==void 0)return i(l,m),m},set(l,m){r.has(l)?r.set(l,m):i(l,m)}}},Qe="!",Kt=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,i=t[0],l=t.length,m=o=>{let b=[],S=0,N=0,p;for(let g=0;g<o.length;g++){let T=o[g];if(S===0){if(T===i&&(a||o.slice(g,g+l)===t)){b.push(o.slice(N,g)),N=g+l;continue}if(T==="/"){p=g;continue}}T==="["?S++:T==="]"&&S--}let v=b.length===0?o:o.substring(N),C=v.startsWith(Qe),h=C?v.substring(1):v,P=p&&p>N?p-N:void 0;return{modifiers:b,hasImportantModifier:C,baseClassName:h,maybePostfixModifierPosition:P}};return r?o=>r({className:o,parseClassName:m}):m},$t=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},qt=e=>({cache:_t(e.cacheSize),parseClassName:Kt(e),...Ut(e)}),Jt=/\B+/,Qt=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:i}=t,l=[],m=e.trim().split(Jt),o="";for(let b=m.length-1;b>=0;b-=1){let S=m[b],{modifiers:N,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:C}=r(S),h=!!C,P=a(h?v.substring(0,C):v);if(!P){if(!h){o=S+(o.length>0?" "+o:o);continue}if(P=a(v),!P){o=S+(o.length>0?" "+o:o);continue}h=!1}let g=$t(N).join(":"),T=p?g+Qe:g,E=T+P;if(l.includes(E))continue;l.push(E);let d=i(P,h);for(let y=0;y<d.length;++y){let n=d[y];l.push(T+n)}o=S+(o.length>0?" "+o:o)}return o};function Xt(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Xe(t))&&(a&&(a+=" "),a+=r);return a}var Xe=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=Xe(e[a]))&&(r&&(r+=" "),r+=t);return r};function Zt(e,...t){let r,a,i,l=m;function m(b){let S=t.reduce((N,p)=>p(N),e());return r=qt(S),a=r.cache.get,i=r.cache.set,l=o,o(b)}function o(b){let S=a(b);if(S)return S;let N=Qt(b,r);return i(b,N),N}return function(){return l(Xt.apply(null,arguments))}}var R=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ze=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yt=/^\d+\/\d+$/,er=new Set(["px","full","screen"]),tr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|it|pc|in|cm|mm|cap|ch|ex|r?lh|cq(B|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,or=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ar=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>de(e)||er.has(e)||Yt.test(e),O=e=>me(e,"length",ur),de=e=>!!e&&!Number.isNaN(Number(e)),Be=e=>me(e,"number",de),be=e=>!!e&&Number.isInteger(Number(e)),ir=e=>e.endsWith("%")&&de(e.slice(0,-1)),u=e=>Ze.test(e),j=e=>tr.test(e),nr=new Set(["length","size","percentage"]),lr=e=>me(e,nr,Ye),cr=e=>me(e,"position",Ye),dr=new Set(["image","url"]),mr=e=>me(e,dr,gr),pr=e=>me(e,"",fr),ve=()=>!0,me=(e,t,r)=>{let a=Ze.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},ur=e=>rr.test(e)&&!or.test(e),Ye=()=>!1,fr=e=>ar.test(e),gr=e=>sr.test(e);var br=()=>{let e=R("colors"),t=R("spacing"),r=R("blur"),a=R("brightness"),i=R("borderColor"),l=R("borderRadius"),m=R("borderSpacing"),o=R("borderWidth"),b=R("contrast"),S=R("grayscale"),N=R("hueRotate"),p=R("invert"),v=R("gap"),C=R("gradientColorStops"),h=R("gradientColorStopPositions"),P=R("inset"),g=R("margin"),T=R("opacity"),E=R("padding"),d=R("saturate"),y=R("scale"),n=R("sepia"),D=R("skew"),ce=R("space"),We=R("translate"),Ie=()=>["auto","contain","none"],Me=()=>["auto","hidden","clip","visible","scroll"],Ee=()=>["auto",u,t],k=()=>[u,t],Ge=()=>["",G,O],ye=()=>["auto",de,u],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ce=()=>["solid","dashed","dotted","double","none"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>["start","end","center","between","around","evenly","stretch"],ge=()=>["","0",u],_e=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[de,u];return{cacheSize:500,separator:":",theme:{colors:[ve],spacing:[G,O],blur:["none","",j,u],brightness:W(),borderColor:[e],borderRadius:["none","","full",j,u],borderSpacing:k(),borderWidth:Ge(),contrast:W(),grayscale:ge(),hueRotate:W(),invert:ge(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[ir,O],inset:Ee(),margin:Ee(),opacity:W(),padding:k(),saturate:W(),scale:W(),sepia:ge(),skew:W(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",u]}],container:["container"],columns:[{columns:[j]}],"break-after":[{"break-after":_e()}],"break-before":[{"break-before":_e()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Oe(),u]}],overflow:[{overflow:Me()}],"overflow-x":[{"overflow-x":Me()}],"overflow-y":[{"overflow-y":Me()}],overscroll:[{overscroll:Ie()}],"overscroll-x":[{"overscroll-x":Ie()}],"overscroll-y":[{"overscroll-y":Ie()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[P]}],"inset-x":[{"inset-x":[P]}],"inset-y":[{"inset-y":[P]}],start:[{start:[P]}],end:[{end:[P]}],top:[{top:[P]}],right:[{right:[P]}],bottom:[{bottom:[P]}],left:[{left:[P]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",be,u]}],basis:[{basis:Ee()}],"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:ge()}],shrink:[{shrink:ge()}],order:[{order:["first","last","none",be,u]}],"grid-cols":[{"grid-cols":[ve]}],"col-start-end":[{col:["auto",{span:["full",be,u]},u]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[ve]}],"row-start-end":[{row:["auto",{span:[be,u]},u]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"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:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],it:[{it:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[ce]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ce]}],"space-y-reverse":["space-y-reverse"],B:[{B:["auto","min","max","fit","svw","lvw","dvw",u,t]}],"min-B":[{"min-B":[u,t,"min","max","fit"]}],"max-B":[{"max-B":[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,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Be]}],"font-family":[{font:[ve]}],"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",de,Be]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,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":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,O]}],"underline-offset":[{"underline-offset":["auto",G,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:k()}],"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":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),cr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",lr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[l]}],"rounded-B":[{"rounded-B":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-Le":[{"rounded-Le":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-B":[{border:[o]}],"border-B-x":[{"border-x":[o]}],"border-B-y":[{"border-y":[o]}],"border-B-B":[{"border-B":[o]}],"border-B-e":[{"border-e":[o]}],"border-B-t":[{"border-t":[o]}],"border-B-r":[{"border-r":[o]}],"border-B-b":[{"border-b":[o]}],"border-B-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...Ce(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[T]}],"divide-style":[{divide:Ce()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-B":[{"border-B":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Ce()]}],"outline-offset":[{"outline-offset":[G,u]}],"outline-B":[{outline:[G,O]}],"outline-color":[{outline:[e]}],"ring-B":[{ring:Ge()}],"ring-B-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-B":[{"ring-offset":[G,O]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",j,pr]}],"shadow-color":[{shadow:[ve]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...je(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":je()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[b]}],"drop-shadow":[{"drop-shadow":["","none",j,u]}],grayscale:[{grayscale:[S]}],"hue-rotate":[{"hue-rotate":[N]}],invert:[{invert:[p]}],saturate:[{saturate:[d]}],sepia:[{sepia:[n]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[b]}],"backdrop-grayscale":[{"backdrop-grayscale":[S]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[N]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[d]}],"backdrop-sepia":[{"backdrop-sepia":[n]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",u]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",u]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",u]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[be,u]}],"translate-x":[{"translate-x":[We]}],"translate-y":[{"translate-y":[We]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",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","B-resize","B-resize","nw-resize","Le-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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-it":[{"scroll-it":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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-B":[{stroke:[G,O,Be]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","it","pr","pb","pl"],px:["pr","pl"],py:["it","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["B","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-Le","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-B":["rounded-ss","rounded-es"],"rounded-e":["rounded-Le","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-B":["border-B-B","border-B-e","border-B-t","border-B-r","border-B-b","border-B-l"],"border-B-x":["border-B-r","border-B-l"],"border-B-y":["border-B-t","border-B-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-it","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-it","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var et=Zt(br);function f(...e){return et((0,tt.clsx)(e))}var B=require("react/jsx-runtime"),pe=I.Root,ot=I.Trigger,vr=I.Portal;var at=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Overlay,{ref:r,className:f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));at.displayName=I.Overlay.displayName;var X=he.forwardRef(({className:e,children:t,...r},a)=>(0,B.jsxs)(vr,{children:[(0,B.jsx)(at,{}),(0,B.jsxs)(I.Content,{ref:a,className:f("fixed left-[50%] top-[50%] z-50 grid B-full max-B-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,(0,B.jsxs)(I.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)(rt.X,{className:"h-4 B-4"}),(0,B.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));X.displayName=I.Content.displayName;var Z=({className:e,...t})=>(0,B.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Z.displayName="DialogHeader";var hr=({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});hr.displayName="DialogFooter";var Y=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Title,{ref:r,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));Y.displayName=I.Title.displayName;var xr=he.forwardRef(({className:e,...t},r)=>(0,B.jsx)(I.Description,{ref:r,className:f("text-sm text-muted-foreground",e),...t}));xr.displayName=I.Description.displayName;var st=require("@radix-ui/react-slot"),it=require("class-variance-authority"),nt=z(require("react")),yr=(0,it.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 B-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent-foreground",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),V=nt.forwardRef(({asChild:e=!1,className:t,size:r,variant:a,...i},l)=>(0,B.jsx)(e?st.Slot:"button",{className:f(yr({className:t,size:r,variant:a})),ref:l,...i}));V.displayName="Button";var ct=z(require("react"));var U=ct.forwardRef(({className:e,type:t,...r},a)=>(0,B.jsx)("input",{type:t,className:f("flex h-9 B-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));U.displayName="Input";var mt=z(require("react")),Fe=z(require("@radix-ui/react-label"));var Cr=(0,it.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=mt.forwardRef(({className:e,...t},r)=>(0,B.jsx)(Fe.Root,{ref:r,className:f(Cr(),e),...t}));M.displayName=Fe.Root.displayName;var ft=z(require("react")),ee=ft.forwardRef(({className:e,...t},r)=>(0,B.jsx)("textarea",{className:f("flex min-h-[80px] B-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));ee.displayName="Textarea";var x=z(require("@radix-ui/react-select")),_=z(require("react")),re=x.Root;var oe=x.Value,K=_.forwardRef(({children:e,className:t,...r},a)=>(0,B.jsxs)(x.Trigger,{className:f("flex h-10 B-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:a,...r,children:[e,(0,B.jsx)(x.Icon,{asChild:!0,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 B-4 opacity-50"})})]}));K.displayName=x.Trigger.displayName;var bt=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,B.jsx)(rt.ChevronUp,{className:"h-4 B-4"})}));bt.displayName=x.ScrollUpButton.displayName;var vt=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:r,...t,children:(0,B.jsx)(rt.ChevronDown,{className:"h-4 B-4"})}));vt.displayName=x.ScrollDownButton.displayName;var $=_.forwardRef(({children:e,className:t,position:r="popper",...a},i)=>(0,B.jsx)(x.Portal,{children:(0,B.jsxs)(x.Content,{className:f("relative z-50 max-h-96 min-B-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,ref:i,...a,children:[(0,B.jsx)(bt,{}),(0,B.jsx)(x.Viewport,{className:f("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] B-full min-B-[var(--radix-select-trigger-width)]"),children:e}),(0,B.jsx)(vt,{})]})}));$.displayName=x.Content.displayName;var wr=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.Label,{className:f("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:r,...t}));wr.displayName=x.Label.displayName;var q=_.forwardRef(({children:e,className:t,...r},a)=>(0,B.jsxs)(x.Item,{className:f("relative flex B-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...r,children:[(0,B.jsx)("span",{className:"absolute left-2 flex h-3.5 B-3.5 items-center justify-center",children:(0,B.jsx)(x.ItemIndicator,{children:(0,B.jsx)(rt.Check,{className:"h-4 B-4"})})}),(0,B.jsx)(x.ItemText,{children:e})]}));q.displayName=x.Item.displayName;var Sr=_.forwardRef(({className:e,...t},r)=>(0,B.jsx)(x.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:r,...t}));Sr.displayName=x.Separator.displayName;var xe=z(require("@radix-ui/react-checkbox")),xt=z(require("react")),ae=xt.forwardRef(({className:e,...t},r)=>(0,B.jsx)(xe.Root,{className:f("peer h-4 B-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:r,...t,children:(0,B.jsx)(xe.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,B.jsx)(rt.Check,{className:"h-4 B-4"})})}));ae.displayName=xe.Root.displayName;var Nr=(0,it.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ne({className:e,variant:t,...r}){return(0,B.jsx)("div",{className:f(Nr({variant:t}),e),...r})}var Ue=z(require("react")),F=z(require("@radix-ui/react-scroll-area"));var ue=Ue.forwardRef(({className:e,children:t,...r},a)=>(0,B.jsxs)(F.Root,{ref:a,className:f("relative overflow-hidden",e),...r,children:[(0,B.jsx)(F.Viewport,{className:"h-full B-full rounded-[inherit]",children:t}),(0,B.jsx)(wt,{}),(0,B.jsx)(F.Corner,{})]}));ue.displayName=F.Root.displayName;var wt=Ue.forwardRef(({className:e,orientation:t="vertical",...r},a)=>(0,B.jsx)(F.ScrollAreaScrollbar,{ref:a,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full B-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:(0,B.jsx)(F.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=F.ScrollAreaScrollbar.displayName;function St({deal:e,users:t,customer:r,categories:a,onClose:i,onSave:l,onAddComment:m}){let[o,b]=(0,Le.useState)({...e,value:e.value||0,comments:e.comments||[],customer:e.customer||{}}),[S,N]=(0,Le.useState)(""),[p,v]=(0,Le.useState)(!1),[C,h]=(0,Le.useState)(null);(0,Le.useEffect)(()=>{v(JSON.stringify(e)!==JSON.stringify(o))},[e,o]);let P=async()=>{try{let n=await l(o);n.success?(v(!1),h(null)):console.error("Failed to save deal:",n.errors)}catch(n){console.error("Failed to save deal:",n)}},g=(n,D)=>{b(ce=>({...ce,[n]:D}))},T=n=>{let D=(o.categories||[]).includes(n)?(o.categories||[]).filter(ce=>ce!==n):[...o.categories||[],n];g("categories",D)},E=async()=>{if(S.trim()){let n={text:S,timestamp:new Date().toISOString()};try{let D=await m(n);if(!D.success){console.error("Failed to add comment:",D.errors);return}}catch(D){console.error("Failed to add comment:",D)}b(D=>({...D,comments:[...D.comments||[],n]})),N("")}},d=n=>{switch(n){case"proposition":return"border-blue-800 text-blue-800";case"source":return"border-green-800 text-green-800";case"sector":return"border-purple-800 text-purple-800";default:return"border-gray-800 text-gray-800"}},y=n=>t?.find(D=>D.id===Number(n));return(0,B.jsx)(pe,{open:!0,children:(0,B.jsxs)(X,{className:"max-B-3xl max-h-[90vh] overflow-hidden flex flex-col [&>button:last-child]:hidden",children:[(0,B.jsxs)(Z,{className:"flex flex-row items-center justify-between",children:[(0,B.jsx)(Y,{className:"text-2xl font-bold",children:r?.name||"no customer"}),(0,B.jsxs)("div",{className:"flex space-x-2",children:[(0,B.jsx)(V,{variant:"outline",onClick:i,children:"Close"}),(0,B.jsxs)(V,{onClick:P,disabled:!p,children:[(0,B.jsx)(rt.SaveIcon,{className:"B-4 h-4 mr-2"}),"Save"]})]})]}),(0,B.jsxs)(ue,{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 m-1",children:C==="value"?(0,B.jsx)(U,{type:"number",value:o.value,onChange:n=>g("value",Number(n.target.value)),onBlur:()=>h(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 p-1 border border-background hover:border-accent rounded",onClick:()=>h("value"),children:["\xA3",o.value?.toLocaleString()]})}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Assignee"}),C==="assignee"?(0,B.jsxs)(re,{value:o?.assignee?.id?.toString()||"",onValueChange:n=>g("assignee",y(n)),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select assignee"})}),(0,B.jsx)($,{children:t&&t.map(n=>(0,B.jsx)(q,{value:n?.id?.toString()||"",children:n.name},n.id))})]}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("assignee"),children:[(0,B.jsx)(rt.UserIcon,{className:"B-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:o?.assignee?.name})]})]}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Closure Date"}),C==="closureDate"?(0,B.jsx)(U,{type:"date",value:o.closureDate?.split("T")[0]??"",onChange:n=>g("closureDate",n.target.value),onBlur:()=>h(null),className:"mr-2",autoFocus:!0}):(0,B.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("closureDate"),children:[(0,B.jsx)(rt.CalendarIcon,{className:"B-4 h-4 text-gray-400"}),(0,B.jsx)("span",{children:o.closureDate?new Date(o.closureDate).toLocaleDateString("en-GB"):"N/B"})]})]})]}),(0,B.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-1 gap-4",children:(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Description"}),C==="description"?(0,B.jsx)(ee,{value:o.description||"",onChange:n=>g("description",n.target.value),onBlur:()=>h(null),className:"min-h-[100px]",autoFocus:!0}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent pb-5 rounded",onClick:()=>h("description"),children:o.description})]})}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 it-2 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Status"}),C==="status"?(0,B.jsxs)(re,{value:o.status,onValueChange:n=>{g("status",n),h(null)},children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select status"})}),(0,B.jsx)($,{children:["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"].map(n=>(0,B.jsx)(q,{value:n,children:n},n))})]}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("status"),children:o.status})]}),(0,B.jsxs)("div",{className:"grid col-span-2 gap-2",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Categories"}),C==="categories"?(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2 m-1",children:a.map(n=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:n.id?.toString()||"",checked:(o.categories||[]).some(D=>D.id===n.id),onCheckedChange:()=>n.id!==void 0&&T(n)}),(0,B.jsx)("label",{htmlFor:(n.id??"").toString(),className:`text-sm font-medium ${d(n.type||"sector")} px-2 py-1 rounded`,children:n.name})]},n.id))}):(0,B.jsx)("div",{className:"flex flex-wrap gap-2 cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("categories"),children:o.categories&&o.categories.map(n=>{let D=n;return D?(0,B.jsx)(Ne,{variant:"outline",className:d(D.type||"sector"),children:D.name},D.id):null})})]}),(0,B.jsxs)("div",{className:"grid gap-2 m-1",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"COGE Status"}),C==="gecoStatus"?(0,B.jsxs)(re,{value:o.gecoStatus??void 0,onValueChange:n=>{g("gecoStatus",n),h(null)},children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select status"})}),(0,B.jsx)($,{children:["firm","forecast","other"].map(n=>(0,B.jsx)(q,{value:n,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]}):(0,B.jsx)("div",{className:"cursor-pointer p-1 border border-background hover:border-accent rounded",onClick:()=>h("gecoStatus"),children:o.gecoStatus?o.gecoStatus.charAt(0).toUpperCase()+o.gecoStatus.slice(1):"N/B"})]})]}),(0,B.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-1 it-4 gap-4",children:[(0,B.jsxs)("div",{className:"grid gap-2",children:[(0,B.jsx)(M,{className:"text-sm font-medium text-accent",children:"Comments"}),(0,B.jsx)(ue,{className:"h-[200px] overflow-y-auto",children:(0,B.jsx)("div",{className:"space-y-2",children:o.comments&&o.comments.slice().sort((n,D)=>new Date(D.timestamp||"").getTime()-new Date(n.timestamp||"").getTime()).map(n=>(0,B.jsxs)("div",{className:"p-3 rounded-lg",children:[(0,B.jsx)("p",{className:"text-sm text-foreground",children:n.text}),(0,B.jsxs)("p",{className:"text-xs text-foreground mt-1",children:[n?.author?.name," - ",new Date(n.timestamp||"").toLocaleString()]})]},n.id))})}),(0,B.jsxs)("div",{className:"flex mt-2",children:[(0,B.jsx)(U,{value:S,onChange:n=>N(n.target.value),placeholder:"Add a comment...",className:"flex-grow ml-1"}),(0,B.jsxs)(V,{onClick:E,className:"ml-2",children:[(0,B.jsx)(rt.PlusIcon,{className:"B-4 h-4 mr-2"}),"Add"]})]})]}),(0,B.jsxs)("div",{className:"text-xs text-gray-500 mt-4",children:["Last modified: ",new Date(o.updatedAt||"").toLocaleString()]})]})]})]})})}var ie=z(require("react"));var Pe=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Pe.displayName="Card";var De=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("flex flex-col space-y-1.5 p-6",e),...t}));De.displayName="CardHeader";var Re=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("font-semibold leading-none tracking-tight",e),...t}));Re.displayName="CardTitle";var Pr=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("text-sm text-muted-foreground",e),...t}));Pr.displayName="CardDescription";var ke=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("p-6 it-0",e),...t}));ke.displayName="CardContent";var Dr=ie.forwardRef(({className:e,...t},r)=>(0,B.jsx)("div",{ref:r,className:f("flex items-center p-6 it-0",e),...t}));Dr.displayName="CardFooter";function Nt({deal:e,customer:t,categories:r,onClick:a,compact:i=!1}){let l=r.find(m=>m.type==="proposition"&&(e.categories??[]).includes(m.id));return i?(0,B.jsxs)(Pe,{className:"mb-1 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(De,{className:"pb-1 it-2",children:[(0,B.jsx)(Re,{className:"text-sm font-semibold text-foreground",children:t?.name}),(0,B.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,B.jsx)(ke,{className:"text-xs text-gray-500 pb-2",children:(0,B.jsx)("div",{className:"flex justify-between items-center mb-1",children:(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.jsxs)(Pe,{className:"mb-4 cursor-pointer hover:shadow-md transition-shadow border-l-4 border-l-accent",onClick:a,children:[(0,B.jsxs)(De,{className:"pb-2",children:[(0,B.jsx)("div",{className:"flex justify-between items-center",children:(0,B.jsx)(Re,{className:"text-lg font-semibold text-foreground",children:t?.name})}),(0,B.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,B.jsxs)(ke,{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-accent",children:[(0,B.jsx)(rt.UserIcon,{className:"B-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)(rt.CalendarIcon,{className:"B-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:l&&(0,B.jsx)(Ne,{variant:"secondary",className:"bg-blue-100 text-blue-800 text-xs",children:l.name})})]})]})}var Te=require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration");function Dt({onSubmit:e}){let[t,r]=(0,Le.useState)({name:"",intro:"",active:!1});return(0,B.jsxs)("form",{onSubmit:i=>{i.preventDefault(),t.name&&(e({...t,name:t.name,updatedAt:new Date().toISOString(),createdAt:new Date().toISOString()}),r({name:"",intro:"",active:!0}))},className:"space-y-4",children:[(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(M,{htmlFor:"customerName",children:"Customer Name"}),(0,B.jsx)(U,{id:"customerName",value:t.name,onChange:i=>r({...t,name:i.target.value}),placeholder:"Enter customer name",required:!0})]}),(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)(M,{htmlFor:"customerIntro",children:"Intro"}),(0,B.jsx)(ee,{id:"customerIntro",value:t.intro??"",onChange:i=>r({...t,intro:i.target.value}),placeholder:"Enter customer intro"})]}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:"activeCustomer",checked:!!t.active,onCheckedChange:i=>r({...t,active:i})}),(0,B.jsx)(M,{htmlFor:"activeCustomer",children:"Active Customer"})]}),(0,B.jsx)(V,{type:"submit",className:"B-full",children:"Add Customer"})]})}function kt({customers:e,users:t,categories:r,onSubmit:a,initialDeal:i,onAddCustomer:l,onClose:m}){let[o,b]=(0,Le.useState)(i||{customer:void 0,value:0,assignee:void 0,status:"Cold",categories:[],dateLogged:new Date().toISOString().split("T")[0],closureDate:"",comments:[],description:""}),[S,N]=(0,Le.useState)(!1),[p,v]=(0,Le.useState)({});(0,Le.useEffect)(()=>{i&&b(i)},[i]);let C=()=>{let d={};return o.customer||(d.customer="Customer is required"),o.value||(d.value="Value is required"),o.assignee||(d.assignee="Assignee is required"),o.closureDate||(d.closureDate="Closure Date is required"),v(d),Object.keys(d).length===0},h=async d=>{d.preventDefault(),v({});try{if(C()){let y=await a({...o});y.success?(b({customer:void 0,value:0,assignee:void 0,description:"",status:"Cold",closureDate:""}),m?.()):v(y.errors||{})}}catch{v({submit:"An error occurred while submitting the form."})}},P=d=>{b(y=>({...y,categories:(y.categories||[]).includes(d.id)?(y.categories||[]).filter(n=>n!==d.id):[...y.categories||[],d.id]}))},g=async d=>{b({...o,customer:d});try{let y=await l(d);y.success?N(!1):v(y.errors||{})}catch{v({submit:"An error occurred while submitting the form."})}},T=d=>t?.find(y=>y.id===Number(d)),E=d=>e?.find(y=>y.id===Number(d));return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,B.jsx)(ue,{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)(M,{htmlFor:"customer",children:"Customer"}),(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsxs)(re,{value:o.customer?.id?.toString(),onValueChange:d=>b({...o,customer:E(d)}),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select customer"})}),(0,B.jsx)($,{children:e.map(d=>(0,B.jsx)(q,{value:d.id?.toString()||"",children:d.name},d.id))})]}),(0,B.jsx)(V,{variant:"outline",size:"icon",onClick:()=>N(!0),children:(0,B.jsx)(rt.PlusIcon,{className:"B-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)(M,{htmlFor:"value",children:"Value"}),(0,B.jsx)(U,{id:"value",type:"number",value:o.value||"",onChange:d=>b({...o,value:Number.parseFloat(d.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)(M,{htmlFor:"assignee",children:"Assignee"}),(0,B.jsxs)(re,{value:o.assignee?.id?.toString(),onValueChange:d=>b({...o,assignee:T(d)}),children:[(0,B.jsx)(K,{children:(0,B.jsx)(oe,{placeholder:"Select assignee"})}),(0,B.jsx)($,{children:t&&t.map(d=>(0,B.jsx)(q,{value:d.id?.toString()||"",children:d.name},d.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)(M,{htmlFor:"description",children:"Description"}),(0,B.jsx)(ee,{id:"description",value:o.description||"",onChange:d=>b({...o,description:d.target.value}),placeholder:"Enter deal description"})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{children:"Categories"}),(0,B.jsx)("div",{className:"space-y-4",children:["proposition","source","sector"].map(d=>(0,B.jsxs)("div",{className:"space-y-2",children:[(0,B.jsx)("h4",{className:"text-sm font-medium",children:d.charAt(0).toUpperCase()+d.slice(1)}),(0,B.jsx)("div",{className:"grid grid-cols-2 gap-2",children:r.filter(y=>y.type===d).map(y=>(0,B.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,B.jsx)(ae,{id:y.id.toString(),checked:o.categories?.includes(y.id),onCheckedChange:()=>P(y)}),(0,B.jsx)("label",{htmlFor:y.id.toString(),className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:y.name})]},y.id))})]},d))})]}),(0,B.jsxs)("div",{className:"space-y-2 space-x-2",children:[(0,B.jsx)(M,{htmlFor:"closureDate",children:"Closure Date"}),(0,B.jsx)(U,{id:"closureDate",type:"date",value:o.closureDate||"",onChange:d=>b({...o,closureDate:d.target.value})}),p.closureDate&&(0,B.jsx)("p",{className:"text-red-500 text-sm",children:p.closureDate})]})]})}),(0,B.jsx)(V,{type:"submit",className:"B-full",children:i?"Update Deal":"Add Deal"})]}),(0,B.jsx)(pe,{open:S,onOpenChange:N,children:(0,B.jsxs)(X,{children:[(0,B.jsx)(Z,{children:(0,B.jsx)(Y,{children:"Add New Customer"})}),(0,B.jsx)(Dt,{onSubmit:g})]})})]})}function Lt({status:e,deals:t,users:r,customers:a,categories:i,onDealClick:l,calculateColumnValue:m,calculateWeightedValue:o,addNewDeal:b,onAddCustomer:S,compact:N=!1}){let[p,v]=(0,Le.useState)(!1);return(0,B.jsxs)("div",{className:"flex flex-col B-80",children:[(0,B.jsxs)("h2",{className:"text-xl font-semibold mb-4",children:[" ",e.charAt(0).toUpperCase()+e.slice(1)]}),b&&(0,B.jsxs)(pe,{open:p,onOpenChange:v,children:[(0,B.jsx)(ot,{asChild:!0,children:(0,B.jsxs)(V,{className:"mb-4 B-full",children:[(0,B.jsx)(rt.PlusCircle,{className:"mr-2 h-4 B-4"}),"Add New Deal"]})}),(0,B.jsxs)(X,{children:[(0,B.jsx)(Z,{children:(0,B.jsx)(Y,{children:"Add New Deal"})}),(0,B.jsx)(kt,{customers:a,users:r,categories:i,onSubmit:b,onAddCustomer:S??(async()=>Promise.resolve({success:!1})),onClose:()=>v(!1)})]})]}),(0,B.jsx)(Te.Droppable,{droppableId:e,isDropDisabled:!1,children:C=>(0,B.jsxs)("div",{ref:C.innerRef,...C.droppableProps,className:"bg-background/90 p-4 rounded-lg flex-grow min-h-[200px] shadow-inner",children:[t.map((h,P)=>(0,B.jsx)(Te.Draggable,{draggableId:h.id.toString(),index:h.id,children:g=>(0,B.jsx)("div",{ref:g.innerRef,...g.draggableProps,...g.dragHandleProps,children:(0,B.jsx)(Nt,{deal:h,customer:h.customer,categories:i,onClick:()=>l(h),compact:N})})},h.id.toString())),C.placeholder]})}),(0,B.jsxs)("div",{className:"mt-4 text-sm 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",m(t).toLocaleString()]})]}),(0,B.jsxs)("p",{className:"font-semibold",children:["Weighted:"," ",(0,B.jsxs)("span",{className:"text-blue-600",children:["\xA3",o(t,e).toLocaleString()]})]})]})]})}var Rr=["Cold","Qualified","Proposal Made","SoW Submitted","Won","Lost"];function kr({initialData:e,addNewDeal:t,updateDeal:r,addComment:a,addNewCustomer:i}){let[l,m]=(0,Le.useState)(null),o=p=>(e.deals??[]).filter(v=>v.status===p),b=p=>p.reduce((v,C)=>v+(C.value||0),0),S=(p,v)=>{let C={Cold:0,Qualified:.2,"Proposal Made":.5,"SoW Submitted":.8,Won:1,Lost:0};return p.reduce((h,P)=>h+(P.value||0)*C[v],0)},N=(0,Le.useCallback)(p=>{let{source:v,destination:C}=p;if(!C||v.droppableId===C.droppableId&&v.index===C.index)return;let h=v.droppableId,P=C.droppableId,g=e.deals?.filter(E=>E.id===v.index)[0],T=[...e.deals??[]];g&&(g.status=P,r(g))},[r]);return(0,B.jsx)(Te.DragDropContext,{onDragEnd:N,children:(0,B.jsxs)("div",{className:"p-4 h-full overflow-auto",children:[(0,B.jsx)("div",{className:"flex space-x-4 pb-4",children:Rr.filter(p=>p!=="Lost").map(p=>{let v=o(p);return(0,B.jsx)(Lt,{status:p,deals:v,customers:e.customers??[],users:e.users,categories:e.categories??[],onDealClick:m,calculateColumnValue:b,calculateWeightedValue:S,addNewDeal:p==="Cold"?t:void 0,onAddCustomer:i},p)})}),l&&(0,B.jsx)(St,{deal:l,users:e.users,customer:l.customer,categories:e.categories??[],onClose:()=>m(null),onSave:r,onAddComment:p=>a(l.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-ZAXQ74I3.mjs";import"../../chunk-3AUTMBDB.mjs";import"../../chunk-COI2LCY2.mjs";import"../../chunk-VGQTRTPZ.mjs";import"../../chunk-FFESN4FM.mjs";import"../../chunk-URPKAQGD.mjs";import"../../chunk-OGZERPA4.mjs";import"../../chunk-6T322YHB.mjs";import"../../chunk-CX4XB5W2.mjs";import"../../chunk-EECIYMTX.mjs";import"../../chunk-KJIBE57R.mjs";import"../../chunk-BUCI7BPM.mjs";import"../../chunk-JPZJET3B.mjs";import"../../chunk-BPSLUO5I.mjs";import"../../chunk-J2IHT57D.mjs";import"../../chunk-4YFMDLHL.mjs";import"../../chunk-HTVHCBXQ.mjs";import"../../chunk-Q3G5UAAD.mjs";import"../../chunk-ZLSF5YXT.mjs";import"../../chunk-M6LJ4BNZ.mjs";export{a as CRMKanbanBoard};
|