realtimex-crm 0.1.4 → 0.2.0
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/README.md +48 -1
- package/bin/create-realtimex-crm.js +655 -0
- package/dist/assets/{DealList-BVEX05UH.js → DealList-D2733gLg.js} +2 -2
- package/dist/assets/{DealList-BVEX05UH.js.map → DealList-D2733gLg.js.map} +1 -1
- package/dist/assets/index-DY3zstf2.css +1 -0
- package/dist/assets/{index-ChDTDzD2.js → index-NL4AEbnn.js} +2 -2
- package/dist/assets/{index-ChDTDzD2.js.map → index-NL4AEbnn.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/stats.html +1 -1
- package/package.json +5 -1
- package/dist/assets/index-BiQoGq1P.css +0 -1
|
@@ -148,5 +148,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
148
148
|
L`+r+" "+r+`
|
|
149
149
|
L0 `+r+`
|
|
150
150
|
L`+r/2+` 0
|
|
151
|
-
`,fill:a,opacity:s,strokeWidth:d,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})},"y");function Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ql.apply(null,arguments)}o(Ql,"b");var yi={translateX:0,translateY:0,padding:0,itemsSpacing:0,itemDirection:"left-to-right",justify:!1,symbolShape:"square",symbolSize:16,symbolSpacing:8},z$e={top:0,right:0,bottom:0,left:0},l3=o(function(e){var t,n=e.direction,r=e.itemsSpacing,a=e.padding,i=e.itemCount,s=e.itemWidth,l=e.itemHeight;if(typeof a!="number"&&(typeof(t=a)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var d=typeof a=="number"?{top:a,right:a,bottom:a,left:a}:Ql({},z$e,a),c=d.left+d.right,h=d.top+d.bottom,m=s+c,g=l+h,x=(i-1)*r;return n==="row"?m=s*i+x+c:n==="column"&&(g=l*i+x+h),{width:m,height:g,padding:d}},"A"),yae=o(function(e){var t=e.anchor,n=e.translateX,r=e.translateY,a=e.containerWidth,i=e.containerHeight,s=e.width,l=e.height,d=n,c=r;switch(t){case"top":d+=(a-s)/2;break;case"top-right":d+=a-s;break;case"right":d+=a-s,c+=(i-l)/2;break;case"bottom-right":d+=a-s,c+=i-l;break;case"bottom":d+=(a-s)/2,c+=i-l;break;case"bottom-left":c+=i-l;break;case"left":c+=(i-l)/2;break;case"center":d+=(a-s)/2,c+=(i-l)/2}return{x:d,y:c}},"C"),bae=o(function(e){var t,n,r,a,i,s,l=e.direction,d=e.justify,c=e.symbolSize,h=e.symbolSpacing,m=e.width,g=e.height;switch(l){case"left-to-right":t=0,n=(g-c)/2,a=g/2,s="central",d?(r=m,i="end"):(r=c+h,i="start");break;case"right-to-left":t=m-c,n=(g-c)/2,a=g/2,s="central",d?(r=0,i="start"):(r=m-c-h,i="end");break;case"top-to-bottom":t=(m-c)/2,n=0,r=m/2,i="middle",d?(a=g,s="alphabetic"):(a=c+h,s="text-before-edge");break;case"bottom-to-top":t=(m-c)/2,n=g-c,r=m/2,i="middle",d?(a=0,s="text-before-edge"):(a=g-c-h,s="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:a,labelAnchor:i,labelAlignment:s}},"z"),U$e={circle:F$e,diamond:L$e,square:$$e,triangle:q$e},B$e=o(function(e){var t,n,r,a,i,s,l,d,c,h,m,g=e.x,x=e.y,w=e.width,S=e.height,_=e.data,C=e.direction,E=C===void 0?yi.itemDirection:C,O=e.justify,j=O===void 0?yi.justify:O,k=e.textColor,A=e.background,T=A===void 0?"transparent":A,P=e.opacity,D=P===void 0?1:P,N=e.symbolShape,I=N===void 0?yi.symbolShape:N,F=e.symbolSize,L=F===void 0?yi.symbolSize:F,q=e.symbolSpacing,U=q===void 0?yi.symbolSpacing:q,$=e.symbolBorderWidth,H=$===void 0?0:$,z=e.symbolBorderColor,W=z===void 0?"transparent":z,V=e.onClick,Q=e.onMouseEnter,K=e.onMouseLeave,Y=e.toggleSerie,ee=e.effects,te=y.useState({}),oe=te[0],ne=te[1],fe=Or(),re=y.useCallback((function(X){if(ee){var se=ee.filter((function(me){return me.on==="hover"})).reduce((function(me,ke){return Ql({},me,ke.style)}),{});ne(se)}Q?.(_,X)}),[Q,_,ee]),ce=y.useCallback((function(X){if(ee){var se=ee.filter((function(me){return me.on!=="hover"})).reduce((function(me,ke){return Ql({},me,ke.style)}),{});ne(se)}K?.(_,X)}),[K,_,ee]),he=bae({direction:E,justify:j,symbolSize:(t=oe.symbolSize)!=null?t:L,symbolSpacing:U,width:w,height:S}),J=he.symbolX,Ne=he.symbolY,we=he.labelX,Ee=he.labelY,Ae=he.labelAnchor,Re=he.labelAlignment,Pe=[V,Q,K,Y].some((function(X){return X!==void 0})),ze=typeof I=="function"?I:U$e[I];return p.jsxs("g",{transform:"translate("+g+","+x+")",style:{opacity:(n=oe.itemOpacity)!=null?n:D},children:[p.jsx("rect",{width:w,height:S,fill:(r=oe.itemBackground)!=null?r:T,style:{cursor:Pe?"pointer":"auto"},onClick:o(function(X){V?.(_,X),Y?.(_.id)},"onClick"),onMouseEnter:re,onMouseLeave:ce}),y.createElement(ze,Ql({id:_.id,x:J,y:Ne,size:(a=oe.symbolSize)!=null?a:L,fill:(i=(s=_.fill)!=null?s:_.color)!=null?i:"black",borderWidth:(l=oe.symbolBorderWidth)!=null?l:H,borderColor:(d=oe.symbolBorderColor)!=null?d:W},_.hidden?fe.legends.hidden.symbol:void 0)),p.jsx(x_,{textAnchor:Ae,style:Ql({},fe.legends.text,{fill:(c=(h=(m=oe.itemTextColor)!=null?m:k)!=null?h:fe.legends.text.fill)!=null?c:"black",dominantBaseline:Re,pointerEvents:"none",userSelect:"none"},_.hidden?fe.legends.hidden.text:void 0),x:we,y:Ee,children:_.label})]})},"B"),H$e=o(function(e){var t=e.data,n=e.x,r=e.y,a=e.direction,i=e.padding,s=i===void 0?yi.padding:i,l=e.justify,d=e.effects,c=e.itemWidth,h=e.itemHeight,m=e.itemDirection,g=m===void 0?yi.itemDirection:m,x=e.itemsSpacing,w=x===void 0?yi.itemsSpacing:x,S=e.itemTextColor,_=e.itemBackground,C=_===void 0?"transparent":_,E=e.itemOpacity,O=E===void 0?1:E,j=e.symbolShape,k=e.symbolSize,A=e.symbolSpacing,T=e.symbolBorderWidth,P=e.symbolBorderColor,D=e.onClick,N=e.onMouseEnter,I=e.onMouseLeave,F=e.toggleSerie,L=l3({itemCount:t.length,itemWidth:c,itemHeight:h,itemsSpacing:w,direction:a,padding:s}).padding,q=a==="row"?c+w:0,U=a==="column"?h+w:0;return p.jsx("g",{transform:"translate("+n+","+r+")",children:t.map((function($,H){return p.jsx(B$e,{data:$,x:H*q+L.left,y:H*U+L.top,width:c,height:h,direction:g,justify:l,effects:d,textColor:S,background:C,opacity:O,symbolShape:j,symbolSize:k,symbolSpacing:A,symbolBorderWidth:T,symbolBorderColor:P,onClick:D,onMouseEnter:N,onMouseLeave:I,toggleSerie:F},H)}))})},"H"),V$e=o(function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,a=e.translateX,i=a===void 0?yi.translateX:a,s=e.translateY,l=s===void 0?yi.translateY:s,d=e.anchor,c=e.direction,h=e.padding,m=h===void 0?yi.padding:h,g=e.justify,x=e.itemsSpacing,w=x===void 0?yi.itemsSpacing:x,S=e.itemWidth,_=e.itemHeight,C=e.itemDirection,E=e.itemTextColor,O=e.itemBackground,j=e.itemOpacity,k=e.symbolShape,A=e.symbolSize,T=e.symbolSpacing,P=e.symbolBorderWidth,D=e.symbolBorderColor,N=e.onClick,I=e.onMouseEnter,F=e.onMouseLeave,L=e.toggleSerie,q=e.effects,U=l3({itemCount:t.length,itemsSpacing:w,itemWidth:S,itemHeight:_,direction:c,padding:m}),$=U.width,H=U.height,z=yae({anchor:d,translateX:i,translateY:l,containerWidth:n,containerHeight:r,width:$,height:H}),W=z.x,V=z.y;return p.jsx(H$e,{data:t,x:W,y:V,direction:c,padding:m,justify:g,effects:q,itemsSpacing:w,itemWidth:S,itemHeight:_,itemDirection:C,itemTextColor:E,itemBackground:O,itemOpacity:j,symbolShape:k,symbolSize:A,symbolSpacing:T,symbolBorderWidth:P,symbolBorderColor:D,onClick:N,onMouseEnter:I,onMouseLeave:F,toggleSerie:typeof L=="boolean"?void 0:L})},"E"),W$e={start:"left",middle:"center",end:"right"},G$e=o(function(e,t){var n=t.data,r=t.containerWidth,a=t.containerHeight,i=t.translateX,s=i===void 0?0:i,l=t.translateY,d=l===void 0?0:l,c=t.anchor,h=t.direction,m=t.padding,g=m===void 0?0:m,x=t.justify,w=x!==void 0&&x,S=t.itemsSpacing,_=S===void 0?0:S,C=t.itemWidth,E=t.itemHeight,O=t.itemDirection,j=O===void 0?"left-to-right":O,k=t.itemTextColor,A=t.symbolSize,T=A===void 0?16:A,P=t.symbolSpacing,D=P===void 0?8:P,N=t.theme,I=l3({itemCount:n.length,itemWidth:C,itemHeight:E,itemsSpacing:_,direction:h,padding:g}),F=I.width,L=I.height,q=I.padding,U=yae({anchor:c,translateX:s,translateY:d,containerWidth:r,containerHeight:a,width:F,height:L}),$=U.x,H=U.y,z=h==="row"?C+_:0,W=h==="column"?E+_:0;e.save(),e.translate($,H),vg(e,N.legends.text),n.forEach((function(V,Q){var K,Y=Q*z+q.left,ee=Q*W+q.top,te=bae({direction:j,justify:w,symbolSize:T,symbolSpacing:D,width:C,height:E}),oe=te.symbolX,ne=te.symbolY,fe=te.labelX,re=te.labelY,ce=te.labelAnchor,he=te.labelAlignment;e.fillStyle=(K=V.color)!=null?K:"black",e.fillRect(Y+oe,ee+ne,T,T),e.textAlign=W$e[ce],he==="central"&&(e.textBaseline="middle"),gg(e,Ql({},N.legends.text,{fill:k??N.legends.text.fill}),String(V.label),Y+fe,ee+re)})),e.restore()},"L"),Y$e=o(function(e,t,n,r,a,i){i>0?(e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+a-i),e.quadraticCurveTo(t+r,n+a,t+r-i,n+a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t,n+a,t,n+a-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath()):e.rect(t,n,r,a)},"o");function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fn.apply(null,arguments)}o(fn,"Q");function Sc(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}o(Sc,"U");var IV,K$e=o(function(e){var t=e.bars,n=e.annotations,r=pae({data:t,annotations:n,getPosition:o(function(a){return{x:a.x+a.width/2,y:a.y+a.height/2}},"getPosition"),getDimensions:o(function(a){var i=a.height,s=a.width;return{width:s,height:i,size:Math.max(s,i)}},"getDimensions")});return p.jsx(p.Fragment,{children:r.map((function(a,i){return p.jsx(x$e,fn({},a),i)}))})},"$"),Q$e=o(function(e){var t=e.width,n=e.height,r=e.legends,a=e.toggleSerie;return p.jsx(p.Fragment,{children:r.map((function(i,s){var l,d=i[0],c=i[1];return p.jsx(V$e,fn({},d,{containerWidth:t,containerHeight:n,data:(l=d.data)!=null?l:c,toggleSerie:d.toggleSerie&&d.dataFrom==="keys"?a:void 0}),s)}))})},"ee"),X$e=["data"],Z$e=o(function(e){var t,n=e.bar,r=n.data,a=Sc(n,X$e),i=e.style,s=i.borderColor,l=i.color,d=i.height,c=i.labelColor,h=i.labelOpacity,m=i.labelX,g=i.labelY,x=i.transform,w=i.width,S=i.textAnchor,_=e.borderRadius,C=e.borderWidth,E=e.label,O=e.shouldRenderLabel,j=e.isInteractive,k=e.onClick,A=e.onMouseEnter,T=e.onMouseLeave,P=e.tooltip,D=e.isFocusable,N=e.ariaLabel,I=e.ariaLabelledBy,F=e.ariaDescribedBy,L=e.ariaDisabled,q=e.ariaHidden,U=Or(),$=Gne(),H=$.showTooltipFromEvent,z=$.showTooltipAt,W=$.hideTooltip,V=y.useMemo((function(){return function(){return y.createElement(P,fn({},a,r))}}),[P,a,r]),Q=y.useCallback((function(ne){k?.(fn({color:a.color},r),ne)}),[a,r,k]),K=y.useCallback((function(ne){return H(V(),ne)}),[H,V]),Y=y.useCallback((function(ne){A?.(r,ne),H(V(),ne)}),[r,A,H,V]),ee=y.useCallback((function(ne){T?.(r,ne),W()}),[r,W,T]),te=y.useCallback((function(){z(V(),[a.absX+a.width/2,a.absY])}),[z,V,a]),oe=y.useCallback((function(){W()}),[W]);return p.jsxs(ar.g,{transform:x,children:[p.jsx(ar.rect,{width:wM(w,(function(ne){return Math.max(ne,0)})),height:wM(d,(function(ne){return Math.max(ne,0)})),rx:_,ry:_,fill:(t=r.fill)!=null?t:l,strokeWidth:C,stroke:s,focusable:D,tabIndex:D?0:void 0,"aria-label":N?N(r):void 0,"aria-labelledby":I?I(r):void 0,"aria-describedby":F?F(r):void 0,"aria-disabled":L?L(r):void 0,"aria-hidden":q?q(r):void 0,onMouseEnter:j?Y:void 0,onMouseMove:j?K:void 0,onMouseLeave:j?ee:void 0,onClick:j?Q:void 0,onFocus:j&&D?te:void 0,onBlur:j&&D?oe:void 0,"data-testid":"bar.item."+r.id+"."+r.index}),O&&p.jsx(x_,{x:m,y:g,textAnchor:S,dominantBaseline:"central",fillOpacity:h,style:fn({},U.labels.text,{pointerEvents:"none",fill:c}),children:E})]})},"ae"),J$e=["color","label"],e9e=o(function(e){var t=e.color,n=e.label,r=Sc(e,J$e);return p.jsx(x6e,{id:n,value:r.formattedValue,enableChip:!0,color:t})},"ne"),Mn={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",valueScale:{type:"linear",nice:!0,round:!1},indexScale:{type:"band",round:!1},padding:.1,innerPadding:0,enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelPosition:"middle",labelOffset:0,labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:e9e,tooltipLabel:o(function(e){return e.id+" - "+e.indexValue},"tooltipLabel"),legends:[],initialHiddenIds:[],annotations:[],enableTotals:!1,totalsOffset:10},Pn=fn({},Mn,{layers:["grid","axes","bars","totals","markers","legends","annotations"],axisTop:null,axisRight:null,axisBottom:{},axisLeft:{},barComponent:Z$e,defs:[],fill:[],markers:[],animate:!0,animateOnMount:!1,motionConfig:"default",role:"img",isFocusable:!1}),lr=fn({},Mn,{layers:["grid","axes","bars","totals","legends","annotations"],axisTop:null,axisRight:null,axisBottom:{},axisLeft:{},renderBar:o(function(e,t){var n=t.bar,r=n.color,a=n.height,i=n.width,s=n.x,l=n.y,d=t.borderColor,c=t.borderRadius,h=t.borderWidth,m=t.label,g=t.shouldRenderLabel,x=t.labelStyle,w=t.labelX,S=t.labelY,_=t.textAnchor;e.fillStyle=r,h>0&&(e.strokeStyle=d,e.lineWidth=h),e.beginPath(),Y$e(e,s,l,i,a,Math.min(c,a)),e.fill(),h>0&&e.stroke(),g&&(e.textBaseline="middle",e.textAlign=_==="middle"?"center":_,gg(e,x,m,s+w,l+S))},"renderBar"),pixelRatio:typeof window<"u"&&(IV=window.devicePixelRatio)!=null?IV:1}),xae=o(function(e,t,n,r,a,i){return s3(r,{all:e.map(t),min:0,max:0},a,i).padding(n)},"de"),wae=o(function(e,t){return e.map((function(n){return fn({},t.reduce((function(r,a){return r[a]=null,r}),{}),n)}))},"ue"),w_=o(function(e){return Object.keys(e).reduce((function(t,n){return e[n]&&(t[n]=e[n]),t}),{})},"se"),__=o(function(e){return[e,Number(e)]},"ce");function _ae(e,t,n,r){return e===void 0&&(e=Mn.layout),n===void 0&&(n=Mn.labelPosition),r===void 0&&(r=Mn.labelOffset),function(a,i){var s=r*(t?-1:1);if(e==="horizontal"){var l=a/2;return n==="start"?l=t?a:0:n==="end"&&(l=t?0:a),{labelX:l+s,labelY:i/2,textAnchor:n==="middle"?"middle":t?"end":"start"}}var d=i/2;return n==="start"?d=t?0:i:n==="end"&&(d=t?i:0),{labelX:a/2,labelY:d-s,textAnchor:"middle"}}}o(_ae,"he");var t9e=["layout","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],c3=o(function(e,t){return e>t},"be"),Sae=o(function(e,t){return e<t},"ge"),Eae=o(function(e,t){return Array.from(" ".repeat(t-e),(function(n,r){return e+r}))},"ve"),n9e=o(function(e){return c3(e,0)?0:e},"me"),r9e=o(function(e,t,n,r){var a=e.data,i=e.formatValue,s=e.getColor,l=e.getIndex,d=e.getTooltipLabel,c=e.innerPadding,h=c===void 0?0:c,m=e.keys,g=e.xScale,x=e.yScale,w=e.margin,S=n?Sae:c3,_=a.map(w_),C=[];return m.forEach((function(E,O){return Eae(0,g.domain().length).forEach((function(j){var k,A,T,P=__(a[j][E]),D=P[0],N=P[1],I=l(a[j]),F=((k=g(I))!=null?k:0)+t*O+h*O,L=S(A=N,0)?(T=x(A))!=null?T:0:r,q=(function($,H){var z;return S($,0)?r-H:((z=x($))!=null?z:0)-r})(N,L),U={id:E,value:D===null?D:N,formattedValue:i(N),hidden:!1,index:j,indexValue:I,data:_[j]};C.push({key:E+"."+U.indexValue,index:C.length,data:U,x:F,y:L,absX:w.left+F,absY:w.top+L,width:t,height:q,color:s(U),label:d(U)})}))})),C},"pe"),a9e=o(function(e,t,n,r){var a=e.data,i=e.formatValue,s=e.getIndex,l=e.getColor,d=e.getTooltipLabel,c=e.keys,h=e.innerPadding,m=h===void 0?0:h,g=e.xScale,x=e.yScale,w=e.margin,S=n?Sae:c3,_=a.map(w_),C=[];return c.forEach((function(E,O){return Eae(0,x.domain().length).forEach((function(j){var k,A,T,P=__(a[j][E]),D=P[0],N=P[1],I=s(a[j]),F=S(A=N,0)?r:(T=g(A))!=null?T:0,L=((k=x(I))!=null?k:0)+t*O+m*O,q=(function($,H){var z;return S($,0)?((z=g($))!=null?z:0)-r:r-H})(N,F),U={id:E,value:D===null?D:N,formattedValue:i(N),hidden:!1,index:j,indexValue:I,data:_[j]};C.push({key:E+"."+U.indexValue,index:C.length,data:U,x:F,y:L,absX:w.left+F,absY:w.top+L,width:q,height:t,color:l(U),label:d(U)})}))})),C},"ye"),i9e=o(function(e){var t,n,r,a=e.layout,i=e.width,s=e.height,l=e.padding,d=l===void 0?0:l,c=e.innerPadding,h=c===void 0?0:c,m=e.valueScale,g=e.indexScale,x=e.hiddenIds,w=x===void 0?[]:x,S=Sc(e,t9e),_=S.keys.filter((function(H){return!w.includes(H)})),C=wae(S.data,_),E=a==="vertical"?["y","x",i]:["x","y",s],O=E[0],j=E[1],k=E[2],A=xae(C,S.getIndex,d,g,k,j),T=m.min==="auto"?n9e:function(H){return H},P=C.reduce((function(H,z){return[].concat(H,_.map((function(W){return z[W]})))}),[]).filter(Boolean),D=T(Math.min.apply(Math,P)),N=(r=Math.max.apply(Math,P),isFinite(r)?r:0),I=s3(m,{all:P,min:D,max:N},O==="x"?i:s,O),F=a==="vertical"?[A,I]:[I,A],L=F[0],q=F[1],U=(A.bandwidth()-h*(_.length-1))/_.length,$=[fn({},S,{data:C,keys:_,innerPadding:h,xScale:L,yScale:q}),U,(t=m.reverse)!=null&&t,(n=I(0))!=null?n:0];return{xScale:L,yScale:q,bars:U>0?a==="vertical"?r9e.apply(void 0,$):a9e.apply(void 0,$):[]}},"xe"),o9e=["data","layout","width","height","padding","valueScale","indexScale","hiddenIds"],Cae=o(function(e){var t;return e.some(Array.isArray)?Cae((t=[]).concat.apply(t,e)):e},"ke"),s9e=o(function(e,t,n){var r=e.formatValue,a=e.getColor,i=e.getIndex,s=e.getTooltipLabel,l=e.innerPadding,d=e.stackedData,c=e.xScale,h=e.yScale,m=e.margin,g=[];return d.forEach((function(x){return c.domain().forEach((function(w,S){var _,C,E=x[S],O=(_=c(i(E.data)))!=null?_:0,j=((C=(function(N){return h(N[n?0:1])})(E))!=null?C:0)+.5*l,k=(function(N,I){var F;return((F=h(N[n?1:0]))!=null?F:0)-I})(E,j)-l,A=__(E.data[x.key]),T=A[0],P=A[1],D={id:x.key,value:T===null?T:P,formattedValue:r(P),hidden:!1,index:S,indexValue:w,data:w_(E.data)};g.push({key:x.key+"."+w,index:g.length,data:D,x:O,y:j,absX:m.left+O,absY:m.top+j,width:t,height:k,color:a(D),label:s(D)})}))})),g},"we"),l9e=o(function(e,t,n){var r=e.formatValue,a=e.getColor,i=e.getIndex,s=e.getTooltipLabel,l=e.innerPadding,d=e.stackedData,c=e.xScale,h=e.yScale,m=e.margin,g=[];return d.forEach((function(x){return h.domain().forEach((function(w,S){var _,C,E=x[S],O=(_=h(i(E.data)))!=null?_:0,j=((C=(function(N){return c(N[n?1:0])})(E))!=null?C:0)+.5*l,k=(function(N,I){var F;return((F=c(N[n?0:1]))!=null?F:0)-I})(E,j)-l,A=__(E.data[x.key]),T=A[0],P=A[1],D={id:x.key,value:T===null?T:P,formattedValue:r(P),hidden:!1,index:S,indexValue:w,data:w_(E.data)};g.push({key:x.key+"."+w,index:g.length,data:D,x:j,y:O,absX:m.left+j,absY:m.top+O,width:k,height:t,color:a(D),label:s(D)})}))})),g},"Le"),c9e=o(function(e){var t,n,r=e.data,a=e.layout,i=e.width,s=e.height,l=e.padding,d=l===void 0?0:l,c=e.valueScale,h=e.indexScale,m=e.hiddenIds,g=m===void 0?[]:m,x=Sc(e,o9e),w=x.keys.filter((function(U){return!g.includes(U)})),S=M8e().keys(w).offset(D8e)(wae(r,w)),_=a==="vertical"?["y","x",i]:["x","y",s],C=_[0],E=_[1],O=_[2],j=xae(r,x.getIndex,d,h,O,E),k=(n=Cae(S),c.type==="log"?n.filter((function(U){return U!==0})):n),A=Math.min.apply(Math,k),T=Math.max.apply(Math,k),P=s3(c,{all:k,min:A,max:T},C==="x"?i:s,C),D=a==="vertical"?[j,P]:[P,j],N=D[0],I=D[1],F=x.innerPadding>0?x.innerPadding:0,L=j.bandwidth(),q=[fn({},x,{innerPadding:F,stackedData:S,xScale:N,yScale:I}),L,(t=c.reverse)!=null&&t];return{xScale:N,yScale:I,bars:L>0?a==="vertical"?s9e.apply(void 0,q):l9e.apply(void 0,q):[]}},"Ce"),u9e=o(function(e){var t=e.bars,n=e.direction,r=e.from,a=e.groupMode,i=e.layout,s=e.legendLabel,l=e.reverse,d=aae(s??(r==="indexes"?"indexValue":"id"));return r==="indexes"?(function(c,h,m){var g=cV(c.map((function(x){var w,S;return{id:(w=x.data.indexValue)!=null?w:"",label:m(x.data),hidden:x.data.hidden,color:(S=x.color)!=null?S:"#000"}})),(function(x){return x.id}));return h==="horizontal"&&g.reverse(),g})(t,i,d):(function(c,h,m,g,x,w){var S=cV(c.map((function(_){var C;return{id:_.data.id,label:w(_.data),hidden:_.data.hidden,color:(C=_.color)!=null?C:"#000"}})),(function(_){return _.id}));return(h==="vertical"&&g==="stacked"&&m==="column"&&x!==!0||h==="horizontal"&&g==="stacked"&&x===!0)&&S.reverse(),S})(t,i,n,a,l,d)},"We"),FV=o(function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},"Me"),d9e=o(function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},"Be"),f9e=o(function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},"Re"),h9e=o(function(e,t){var n=e.get(t)||0;e.set(t,n+1)},"Oe"),jae=o(function(e){var t,n=e.indexBy,r=n===void 0?Mn.indexBy:n,a=e.keys,i=a===void 0?Mn.keys:a,s=e.label,l=s===void 0?Mn.label:s,d=e.tooltipLabel,c=d===void 0?Mn.tooltipLabel:d,h=e.valueFormat,m=e.colors,g=m===void 0?Mn.colors:m,x=e.colorBy,w=x===void 0?Mn.colorBy:x,S=e.borderColor,_=S===void 0?Mn.borderColor:S,C=e.labelTextColor,E=C===void 0?Mn.labelTextColor:C,O=e.groupMode,j=O===void 0?Mn.groupMode:O,k=e.layout,A=k===void 0?Mn.layout:k,T=e.data,P=e.margin,D=e.width,N=e.height,I=e.padding,F=I===void 0?Mn.padding:I,L=e.innerPadding,q=L===void 0?Mn.innerPadding:L,U=e.valueScale,$=U===void 0?Mn.valueScale:U,H=e.indexScale,z=H===void 0?Mn.indexScale:H,W=e.initialHiddenIds,V=W===void 0?Mn.initialHiddenIds:W,Q=e.enableLabel,K=Q===void 0?Mn.enableLabel:Q,Y=e.labelSkipWidth,ee=Y===void 0?Mn.labelSkipWidth:Y,te=e.labelSkipHeight,oe=te===void 0?Mn.labelSkipHeight:te,ne=e.legends,fe=ne===void 0?Mn.legends:ne,re=e.legendLabel,ce=e.totalsOffset,he=ce===void 0?Mn.totalsOffset:ce,J=y.useState(V??[]),Ne=J[0],we=J[1],Ee=y.useCallback((function(We){we((function(pt){return pt.indexOf(We)>-1?pt.filter((function(ge){return ge!==We})):[].concat(pt,[We])}))}),[]),Ae=bT(r),Re=bT(l),Pe=bT(c),ze=o3(h),X=Or(),se=I$e(g,w),me=NV(_,X),ke=NV(E,X),de=(j==="grouped"?i9e:c9e)({layout:A,data:T,getIndex:Ae,keys:i,width:D,height:N,getColor:se,padding:F,innerPadding:q,valueScale:$,indexScale:z,hiddenIds:Ne,formatValue:ze,getTooltipLabel:Pe,margin:P}),ue=de.bars,Te=de.xScale,Me=de.yScale,Fe=y.useMemo((function(){return ue.filter((function(We){return We.data.value!==null})).map((function(We,pt){return fn({},We,{index:pt})}))}),[ue]),Xe=y.useCallback((function(We){var pt=We.width,ge=We.height;return!!K&&!(ee>0&&pt<ee)&&!(oe>0&&ge<oe)}),[K,ee,oe]),Pt=y.useMemo((function(){return i.map((function(We){var pt=ue.find((function(ge){return ge.data.id===We}));return fn({},pt,{data:fn({id:We},pt?.data,{hidden:Ne.includes(We)})})}))}),[Ne,i,ue]),$t=(t=$.reverse)!=null&&t,At=y.useMemo((function(){return fe.map((function(We){return[We,u9e({bars:We.dataFrom==="keys"?Pt:ue,direction:We.direction,from:We.dataFrom,groupMode:j,layout:A,legendLabel:re,reverse:$t})]}))}),[fe,Pt,ue,j,A,re,$t]),qt=y.useMemo((function(){return(function(We,pt,ge,ye,ct,Le,Ke){ye===void 0&&(ye=Mn.layout),ct===void 0&&(ct=Mn.groupMode);var Ve=[];if(We.length===0)return Ve;var Ze=new Map,Et=We[0].width,Ge=We[0].height;if(ct==="stacked"){var mt=new Map;We.forEach((function(Tt){var wt=Tt.data,vt=wt.indexValue,jt=wt.value;FV(Ze,vt,Number(jt)),d9e(mt,vt,Number(jt))})),mt.forEach((function(Tt,wt){var vt,jt,Z,pe=Ze.get(wt)||0;ye==="vertical"?(vt=pt(wt),jt=ge(Tt),Z=ge(Tt/2)):(vt=pt(Tt),jt=ge(wt),Z=pt(Tt/2)),vt+=ye==="vertical"?Et/2:Le,jt+=ye==="vertical"?-Le:Ge/2,Ve.push({key:"total_"+wt,x:vt,y:jt,value:pe,formattedValue:Ke(pe),animationOffset:Z})}))}else if(ct==="grouped"){var Ft=new Map,Mt=new Map;We.forEach((function(Tt){var wt=Tt.data,vt=wt.indexValue,jt=wt.value;FV(Ze,vt,Number(jt)),f9e(Ft,vt,Number(jt)),h9e(Mt,vt)})),Ft.forEach((function(Tt,wt){var vt,jt,Z,pe=Ze.get(wt)||0,_e=Mt.get(wt);ye==="vertical"?(vt=pt(wt),jt=ge(Tt),Z=ge(Tt/2)):(vt=pt(Tt),jt=ge(wt),Z=pt(Tt/2)),vt+=ye==="vertical"?_e*Et/2:Le,jt+=ye==="vertical"?-Le:_e*Ge/2,Ve.push({key:"total_"+wt,x:vt,y:jt,value:pe,formattedValue:Ke(pe),animationOffset:Z})}))}return Ve})(ue,Te,Me,A,j,he,ze)}),[ue,Te,Me,A,j,he,ze]);return{bars:ue,barsWithValue:Fe,xScale:Te,yScale:Me,getIndex:Ae,getLabel:Re,getTooltipLabel:Pe,formatValue:ze,getColor:se,getBorderColor:me,getLabelColor:ke,shouldRenderBarLabel:Xe,hiddenIds:Ne,toggleSerie:Ee,legendsWithData:At,barTotals:qt}},"Ie"),p9e=o(function(e){var t=e.data,n=e.springConfig,r=e.animate,a=e.layout,i=a===void 0?Pn.layout:a,s=Or();return I1(t,{keys:o(function(l){return l.key},"keys"),from:o(function(l){return{x:i==="vertical"?l.x:l.animationOffset,y:i==="vertical"?l.animationOffset:l.y,labelOpacity:0}},"from"),enter:o(function(l){return{x:l.x,y:l.y,labelOpacity:1}},"enter"),update:o(function(l){return{x:l.x,y:l.y,labelOpacity:1}},"update"),leave:o(function(l){return{x:i==="vertical"?l.x:l.animationOffset,y:i==="vertical"?l.animationOffset:l.y,labelOpacity:0}},"leave"),config:n,immediate:!r,initial:r?void 0:null})((function(l,d){return p.jsx(ar.text,{x:l.x,y:l.y,fillOpacity:l.labelOpacity,style:fn({},s.labels.text,{pointerEvents:"none"}),fontWeight:"bold",fontSize:s.labels.text.fontSize,fontFamily:s.labels.text.fontFamily,textAnchor:i==="vertical"?"middle":"start",alignmentBaseline:i==="vertical"?"alphabetic":"middle",children:d.formattedValue},d.key)}))},"Ve"),m9e=["isInteractive","animate","motionConfig","theme","renderWrapper"],v9e=o(function(e){var t,n=e.data,r=e.indexBy,a=e.keys,i=e.margin,s=e.width,l=e.height,d=e.groupMode,c=e.layout,h=e.valueScale,m=e.indexScale,g=e.padding,x=e.innerPadding,w=e.axisTop,S=e.axisRight,_=e.axisBottom,C=_===void 0?Pn.axisBottom:_,E=e.axisLeft,O=E===void 0?Pn.axisLeft:E,j=e.enableGridX,k=j===void 0?Pn.enableGridX:j,A=e.enableGridY,T=A===void 0?Pn.enableGridY:A,P=e.gridXValues,D=e.gridYValues,N=e.layers,I=N===void 0?Pn.layers:N,F=e.barComponent,L=F===void 0?Pn.barComponent:F,q=e.enableLabel,U=q===void 0?Pn.enableLabel:q,$=e.label,H=e.labelSkipWidth,z=H===void 0?Pn.labelSkipWidth:H,W=e.labelSkipHeight,V=W===void 0?Pn.labelSkipHeight:W,Q=e.labelTextColor,K=e.labelPosition,Y=K===void 0?Pn.labelPosition:K,ee=e.labelOffset,te=ee===void 0?Pn.labelOffset:ee,oe=e.markers,ne=oe===void 0?Pn.markers:oe,fe=e.colorBy,re=e.colors,ce=e.defs,he=ce===void 0?Pn.defs:ce,J=e.fill,Ne=J===void 0?Pn.fill:J,we=e.borderRadius,Ee=we===void 0?Pn.borderRadius:we,Ae=e.borderWidth,Re=Ae===void 0?Pn.borderWidth:Ae,Pe=e.borderColor,ze=e.annotations,X=ze===void 0?Pn.annotations:ze,se=e.legendLabel,me=e.tooltipLabel,ke=e.valueFormat,de=e.isInteractive,ue=de===void 0?Pn.isInteractive:de,Te=e.tooltip,Me=Te===void 0?Pn.tooltip:Te,Fe=e.onClick,Xe=e.onMouseEnter,Pt=e.onMouseLeave,$t=e.legends,At=e.role,qt=At===void 0?Pn.role:At,We=e.ariaLabel,pt=e.ariaLabelledBy,ge=e.ariaDescribedBy,ye=e.isFocusable,ct=ye===void 0?Pn.isFocusable:ye,Le=e.barAriaLabel,Ke=e.barAriaLabelledBy,Ve=e.barAriaDescribedBy,Ze=e.barAriaHidden,Et=e.barAriaDisabled,Ge=e.initialHiddenIds,mt=e.enableTotals,Ft=mt===void 0?Pn.enableTotals:mt,Mt=e.totalsOffset,Tt=Mt===void 0?Pn.totalsOffset:Mt,wt=e.forwardedRef,vt=oo(),jt=vt.animate,Z=vt.config,pe=rae(s,l,i),_e=pe.outerWidth,$e=pe.outerHeight,Be=pe.margin,tt=pe.innerWidth,et=pe.innerHeight,Ye=jae({indexBy:r,label:$,tooltipLabel:me,valueFormat:ke,colors:re,colorBy:fe,borderColor:Pe,labelTextColor:Q,groupMode:d,layout:c,data:n,keys:a,margin:Be,width:tt,height:et,padding:g,innerPadding:x,valueScale:h,indexScale:m,enableLabel:U,labelSkipWidth:z,labelSkipHeight:V,legends:$t,legendLabel:se,initialHiddenIds:Ge,totalsOffset:Tt}),it=Ye.bars,ut=Ye.barsWithValue,st=Ye.xScale,lt=Ye.yScale,gt=Ye.getLabel,nt=Ye.getTooltipLabel,Rt=Ye.getBorderColor,bt=Ye.getLabelColor,Lt=Ye.shouldRenderBarLabel,Nt=Ye.toggleSerie,Ar=Ye.legendsWithData,ma=Ye.barTotals,ei=Ye.getColor,Jn=_ae(c,(t=h?.reverse)!=null&&t,Y,te),so=I1(ut,{keys:o(function(He){return He.key},"keys"),from:o(function(He){return fn({borderColor:Rt(He),color:He.color,height:0,labelColor:bt(He),labelOpacity:0},Jn(He.width,He.height),{transform:"translate("+He.x+", "+(He.y+He.height)+")",width:He.width},c==="vertical"?{}:{height:He.height,transform:"translate("+He.x+", "+He.y+")",width:0})},"from"),enter:o(function(He){return fn({borderColor:Rt(He),color:He.color,height:He.height,labelColor:bt(He),labelOpacity:1},Jn(He.width,He.height),{transform:"translate("+He.x+", "+He.y+")",width:He.width})},"enter"),update:o(function(He){return fn({borderColor:Rt(He),color:He.color,height:He.height,labelColor:bt(He),labelOpacity:1},Jn(He.width,He.height),{transform:"translate("+He.x+", "+He.y+")",width:He.width})},"update"),leave:o(function(He){return fn({borderColor:Rt(He),color:He.color,height:0,labelColor:bt(He),labelOpacity:0},Jn(He.width,He.height),{labelY:0,transform:"translate("+He.x+", "+(He.y+He.height)+")",width:He.width},c==="vertical"?{}:fn({},Jn(He.width,He.height),{labelX:0,height:He.height,transform:"translate("+He.x+", "+He.y+")",width:0}))},"leave"),config:Z,immediate:!jt,initial:jt?void 0:null}),Tr=y.useMemo((function(){return{borderRadius:Ee,borderWidth:Re,enableLabel:U,isInteractive:ue,labelSkipWidth:z,labelSkipHeight:V,onClick:Fe,onMouseEnter:Xe,onMouseLeave:Pt,getTooltipLabel:nt,tooltip:Me,isFocusable:ct,ariaLabel:Le,ariaLabelledBy:Ke,ariaDescribedBy:Ve,ariaHidden:Ze,ariaDisabled:Et}}),[Ee,Re,U,nt,ue,V,z,Fe,Xe,Pt,Me,ct,Le,Ke,Ve,Ze,Et]),Na=h7e(he,it,Ne,{dataKey:"data",targetKey:"data.fill"}),zr={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};I.includes("annotations")&&(zr.annotations=p.jsx(K$e,{bars:it,annotations:X},"annotations")),I.includes("axes")&&(zr.axes=p.jsx(G7e,{xScale:st,yScale:lt,width:tt,height:et,top:w,right:S,bottom:C,left:O},"axes")),I.includes("bars")&&(zr.bars=p.jsx(y.Fragment,{children:so((function(He,Nn){return y.createElement(L,fn({},Tr,{bar:Nn,style:He,shouldRenderLabel:Lt(Nn),label:gt(Nn.data)}))}))},"bars")),I.includes("grid")&&(zr.grid=p.jsx(K7e,{width:tt,height:et,xScale:k?st:null,yScale:T?lt:null,xValues:P,yValues:D},"grid")),I.includes("legends")&&(zr.legends=p.jsx(Q$e,{width:tt,height:et,legends:Ar,toggleSerie:Nt},"legends")),I.includes("markers")&&(zr.markers=p.jsx(r7e,{markers:ne,width:tt,height:et,xScale:st,yScale:lt},"markers")),I.includes("totals")&&Ft&&(zr.totals=p.jsx(p9e,{data:ma,springConfig:Z,animate:jt,layout:c},"totals"));var Ia=fn({},Tr,{margin:Be,width:s,height:l,innerWidth:tt,innerHeight:et,bars:it,legendData:Ar,enableLabel:U,xScale:st,yScale:lt,tooltip:Me,getTooltipLabel:nt,onClick:Fe,onMouseEnter:Xe,onMouseLeave:Pt,getColor:ei});return p.jsx(e7e,{width:_e,height:$e,margin:Be,defs:Na,role:qt,ariaLabel:We,ariaLabelledBy:pt,ariaDescribedBy:ge,isFocusable:ct,ref:wt,children:I.map((function(He,Nn){var Ri;return typeof He=="function"?p.jsx(y.Fragment,{children:y.createElement(He,Ia)},Nn):(Ri=zr?.[He])!=null?Ri:null}))})},"He"),g9e=y.forwardRef((function(e,t){var n=e.isInteractive,r=n===void 0?Pn.isInteractive:n,a=e.animate,i=a===void 0?Pn.animate:a,s=e.motionConfig,l=s===void 0?Pn.motionConfig:s,d=e.theme,c=e.renderWrapper,h=Sc(e,m9e);return p.jsx(Zre,{animate:i,isInteractive:r,motionConfig:l,renderWrapper:c,theme:d,children:p.jsx(v9e,fn({},h,{isInteractive:r,forwardedRef:t}))})})),y9e=["isInteractive","renderWrapper","theme"],BT=o(function(e,t,n,r){return e.find((function(a){return c7e(a.x+t.left,a.y+t.top,a.width,a.height,n,r)}))},"Fe"),b9e=o(function(e){var t,n=e.data,r=e.indexBy,a=e.keys,i=e.margin,s=e.width,l=e.height,d=e.groupMode,c=e.layout,h=e.valueScale,m=e.indexScale,g=e.padding,x=e.innerPadding,w=e.axisTop,S=e.axisRight,_=e.axisBottom,C=_===void 0?lr.axisBottom:_,E=e.axisLeft,O=E===void 0?lr.axisLeft:E,j=e.enableGridX,k=j===void 0?lr.enableGridX:j,A=e.enableGridY,T=A===void 0?lr.enableGridY:A,P=e.gridXValues,D=e.gridYValues,N=e.labelPosition,I=N===void 0?lr.labelPosition:N,F=e.labelOffset,L=F===void 0?lr.labelOffset:F,q=e.layers,U=q===void 0?lr.layers:q,$=e.renderBar,H=$===void 0?lr.renderBar:$,z=e.enableLabel,W=z===void 0?lr.enableLabel:z,V=e.label,Q=e.labelSkipWidth,K=Q===void 0?lr.labelSkipWidth:Q,Y=e.labelSkipHeight,ee=Y===void 0?lr.labelSkipHeight:Y,te=e.labelTextColor,oe=e.colorBy,ne=e.colors,fe=e.borderRadius,re=fe===void 0?lr.borderRadius:fe,ce=e.borderWidth,he=ce===void 0?lr.borderWidth:ce,J=e.borderColor,Ne=e.annotations,we=Ne===void 0?lr.annotations:Ne,Ee=e.legendLabel,Ae=e.tooltipLabel,Re=e.valueFormat,Pe=e.isInteractive,ze=Pe===void 0?lr.isInteractive:Pe,X=e.tooltip,se=X===void 0?lr.tooltip:X,me=e.onClick,ke=e.onMouseEnter,de=e.onMouseLeave,ue=e.legends,Te=e.pixelRatio,Me=Te===void 0?lr.pixelRatio:Te,Fe=e.role,Xe=e.forwardedRef,Pt=e.enableTotals,$t=Pt===void 0?lr.enableTotals:Pt,At=e.totalsOffset,qt=At===void 0?lr.totalsOffset:At,We=y.useRef(null),pt=Or(),ge=rae(s,l,i),ye=ge.margin,ct=ge.innerWidth,Le=ge.innerHeight,Ke=ge.outerWidth,Ve=ge.outerHeight,Ze=jae({indexBy:r,label:V,tooltipLabel:Ae,valueFormat:Re,colors:ne,colorBy:oe,borderColor:J,labelTextColor:te,groupMode:d,layout:c,data:n,keys:a,margin:ye,width:ct,height:Le,padding:g,innerPadding:x,valueScale:h,indexScale:m,enableLabel:W,labelSkipWidth:K,labelSkipHeight:ee,legends:ue,legendLabel:Ee,totalsOffset:qt}),Et=Ze.bars,Ge=Ze.barsWithValue,mt=Ze.xScale,Ft=Ze.yScale,Mt=Ze.getLabel,Tt=Ze.getTooltipLabel,wt=Ze.getBorderColor,vt=Ze.getLabelColor,jt=Ze.shouldRenderBarLabel,Z=Ze.legendsWithData,pe=Ze.barTotals,_e=Ze.getColor,$e=Gne(),Be=$e.showTooltipFromEvent,tt=$e.hideTooltip,et=p$e({annotations:pae({data:Et,annotations:we,getPosition:o(function(nt){return{x:nt.x,y:nt.y}},"getPosition"),getDimensions:o(function(nt){var Rt=nt.width,bt=nt.height;return{width:Rt,height:bt,size:Math.max(Rt,bt)}},"getDimensions")})}),Ye=y.useMemo((function(){return{borderRadius:re,borderWidth:he,isInteractive:ze,isFocusable:!1,labelSkipWidth:K,labelSkipHeight:ee,margin:ye,width:s,height:l,innerWidth:ct,innerHeight:Le,bars:Et,legendData:Z,enableLabel:W,xScale:mt,yScale:Ft,tooltip:se,getTooltipLabel:Tt,onClick:me,onMouseEnter:ke,onMouseLeave:de,getColor:_e}}),[re,he,ze,K,ee,ye,s,l,ct,Le,Et,Z,W,mt,Ft,se,Tt,me,ke,de,_e]),it=o3(Re),ut=_ae(c,(t=h?.reverse)!=null&&t,I,L);y.useEffect((function(){if(We.current){We.current.width=Ke*Me,We.current.height=Ve*Me;var nt=We.current.getContext("2d");nt.scale(Me,Me),nt.fillStyle=pt.background,nt.fillRect(0,0,Ke,Ve),nt.translate(ye.left,ye.top),U.forEach((function(Rt){Rt==="grid"?typeof pt.grid.line.strokeWidth=="number"&&pt.grid.line.strokeWidth>0&&(nt.lineWidth=pt.grid.line.strokeWidth,nt.strokeStyle=pt.grid.line.stroke,k&&_V(nt,{width:ct,height:Le,scale:mt,axis:"x",values:P}),T&&_V(nt,{width:ct,height:Le,scale:Ft,axis:"y",values:D})):Rt==="axes"?X7e(nt,{xScale:mt,yScale:Ft,width:ct,height:Le,top:w,right:S,bottom:C,left:O,theme:pt}):Rt==="bars"?(vg(nt,pt.text),Ge.forEach((function(bt){H(nt,fn({bar:bt,borderColor:wt(bt),borderRadius:re,borderWidth:he,label:Mt(bt.data),shouldRenderLabel:jt(bt),labelStyle:fn({},pt.labels.text,{fill:vt(bt)})},ut(bt.width,bt.height)))}))):Rt==="legends"?Z.forEach((function(bt){var Lt=bt[0],Nt=bt[1];G$e(nt,fn({},Lt,{data:Nt,containerWidth:ct,containerHeight:Le,theme:pt}))})):Rt==="annotations"?w$e(nt,{annotations:et,theme:pt}):Rt==="totals"&&$t?(function(bt,Lt,Nt,Ar){Ar===void 0&&(Ar=lr.layout),vg(bt,Nt.labels.text),bt.textBaseline=Ar==="vertical"?"alphabetic":"middle",bt.textAlign=Ar==="vertical"?"center":"start",Lt.forEach((function(ma){gg(bt,Nt.labels.text,ma.formattedValue,ma.x,ma.y)}))})(nt,pe,pt,c):typeof Rt=="function"&&Rt(nt,Ye)})),nt.save()}}),[C,O,S,w,Ge,re,he,et,k,T,wt,Mt,vt,P,D,d,l,Le,ct,Ye,U,c,Z,ye.left,ye.top,Ve,Ke,Me,H,mt,Ft,jt,pt,s,pe,$t,it,ut]);var st=y.useCallback((function(nt){if(Et&&We.current){var Rt=xT(We.current,nt),bt=Rt[0],Lt=Rt[1],Nt=BT(Et,ye,bt,Lt);Nt!==void 0?(Be(y.createElement(se,fn({},Nt.data,{color:Nt.color,label:Nt.label,value:Number(Nt.data.value)})),nt),nt.type==="mouseenter"&&ke?.(Nt.data,nt)):tt()}}),[tt,ye,ke,Et,Be,se]),lt=y.useCallback((function(nt){if(Et&&We.current){tt();var Rt=xT(We.current,nt),bt=Rt[0],Lt=Rt[1],Nt=BT(Et,ye,bt,Lt);Nt&&de?.(Nt.data,nt)}}),[tt,ye,de,Et]),gt=y.useCallback((function(nt){if(Et&&We.current){var Rt=xT(We.current,nt),bt=Rt[0],Lt=Rt[1],Nt=BT(Et,ye,bt,Lt);Nt!==void 0&&me?.(fn({},Nt.data,{color:Nt.color}),nt)}}),[ye,me,Et]);return p.jsx("canvas",{ref:p7e(We,Xe),width:Ke*Me,height:Ve*Me,style:{width:Ke,height:Ve,cursor:ze?"auto":"normal"},onMouseEnter:ze?st:void 0,onMouseMove:ze?st:void 0,onMouseLeave:ze?lt:void 0,onClick:ze?gt:void 0,role:Fe})},"ze"),x9e=y.forwardRef((function(e,t){var n=e.isInteractive,r=e.renderWrapper,a=e.theme,i=Sc(e,y9e);return p.jsx(Zre,{isInteractive:n,renderWrapper:r,theme:a,animate:!1,children:p.jsx(b9e,fn({},i,{isInteractive:n,forwardedRef:t}))})})),w9e=["defaultWidth","defaultHeight","onResize","debounceResize"],_9e=y.forwardRef((function(e,t){var n=e.defaultWidth,r=e.defaultHeight,a=e.onResize,i=e.debounceResize,s=Sc(e,w9e);return p.jsx(Jre,{defaultWidth:n,defaultHeight:r,onResize:a,debounceResize:i,children:o(function(l){var d=l.width,c=l.height;return p.jsx(g9e,fn({},s,{width:d,height:c,ref:t}))},"children")})})),S9e=["defaultWidth","defaultHeight","onResize","debounceResize"];y.forwardRef((function(e,t){var n=e.defaultWidth,r=e.defaultHeight,a=e.onResize,i=e.debounceResize,s=Sc(e,S9e);return p.jsx(Jre,{defaultWidth:n,defaultHeight:r,onResize:a,debounceResize:i,children:o(function(l){var d=l.width,c=l.height;return p.jsx(x9e,fn({},s,{width:d,height:c,ref:t}))},"children")})}));const E9e={opportunity:.2,"proposal-sent":.5,"in-negociation":.8,delayed:.3},C9e=new Date(new Date().setMonth(new Date().getMonth()-6)).toISOString(),LV="en-US",j9e="USD",O9e=y.memo(()=>{const e=navigator?navigator.languages||[navigator.language]:[LV],{data:t,isPending:n}=Qa("deals",{pagination:{perPage:100,page:1},sort:{field:"created_at",order:"ASC"},filter:{"created_at@gte":C9e}}),r=y.useMemo(()=>{if(!t)return[];const i=t.reduce((l,d)=>{const c=qk(d.created_at??new Date).toISOString();return l[c]||(l[c]=[]),l[c].push(d),l},{});return Object.keys(i).map(l=>({date:mK(l,"MMM"),won:i[l].filter(d=>d.stage==="won").reduce((d,c)=>(d+=c.amount,d),0),pending:i[l].filter(d=>!["won","lost"].includes(d.stage)).reduce((d,c)=>(d+=c.amount*E9e[c.stage],d),0),lost:i[l].filter(d=>d.stage==="lost").reduce((d,c)=>(d-=c.amount,d),0)}))},[t]);if(n)return null;const a=r.reduce((i,s)=>(i.min=Math.min(i.min,s.lost),i.max=Math.max(i.max,s.won+s.pending),i),{min:0,max:0});return p.jsxs("div",{className:"flex flex-col",children:[p.jsxs("div",{className:"flex items-center mb-4",children:[p.jsx("div",{className:"mr-3 flex",children:p.jsx(KK,{className:"text-muted-foreground w-6 h-6"})}),p.jsx("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Upcoming Deal Revenue"})]}),p.jsx("div",{className:"h-[400px]",children:p.jsx(_9e,{data:r,indexBy:"date",keys:["won","pending","lost"],colors:["#61cdbb","#97e3d5","#e25c3b"],margin:{top:30,right:50,bottom:30,left:0},padding:.3,valueScale:{type:"linear",min:a.min*1.2,max:a.max*1.2},indexScale:{type:"band",round:!0},enableGridX:!0,enableGridY:!1,enableLabel:!1,tooltip:o(({value:i,indexValue:s})=>p.jsxs("div",{className:"p-2 bg-secondary rounded shadow inline-flex items-center gap-1 text-secondary-foreground",children:[p.jsxs("strong",{children:[s,": "]})," ",i>0?"+":"",i.toLocaleString(e.at(0)??LV,{style:"currency",currency:j9e})]}),"tooltip"),axisTop:{tickSize:0,tickPadding:12,style:{ticks:{text:{fill:"var(--color-muted-foreground)"}},legend:{text:{fill:"var(--color-muted-foreground)"}}}},axisBottom:{legendPosition:"middle",legendOffset:50,tickSize:0,tickPadding:12,style:{ticks:{text:{fill:"var(--color-muted-foreground)"}},legend:{text:{fill:"var(--color-muted-foreground)"}}}},axisLeft:null,axisRight:{format:o(i=>`${Math.abs(i/1e3)}k`,"format"),tickValues:8,style:{ticks:{text:{fill:"var(--color-muted-foreground)"}},legend:{text:{fill:"var(--color-muted-foreground)"}}}},markers:[{axis:"y",value:0,lineStyle:{strokeOpacity:0},textStyle:{fill:"#2ebca6"},legend:"Won",legendPosition:"top-left",legendOrientation:"vertical"},{axis:"y",value:0,lineStyle:{stroke:"#f47560",strokeWidth:1},textStyle:{fill:"#e25c3b"},legend:"Lost",legendPosition:"bottom-left",legendOrientation:"vertical"}]})})]})}),R9e=o(e=>{const t=St(),n=Ht(e),{filterValues:r,setFilters:a}=pw(e),i=Zu();if(!n)throw new Error("<ListNoResults> must be used inside a <List> component");return p.jsx("div",{className:"p-6",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:r&&a&&Object.keys(r).length>0?p.jsxs(p.Fragment,{children:[t("ra.navigation.no_filtered_results",{resource:n,name:i(n,0),_:"No results found with the current filters."})," ",p.jsx(ot,{variant:"outline",size:"sm",onClick:o(()=>a({},[]),"onClick"),children:t("ra.navigation.clear_filters",{_:"Clear filters"})})]}):t("ra.navigation.no_results",{resource:n,name:i(n,0),_:"No results found."})})})},"ListNoResults"),A9e=o(e=>{const{children:t,linkType:n,rowClick:r,style:a}=e,i=Ht(e),s=Wt(e),l=Ja(),d=typeof n=="function"||typeof r=="function",c=bG({link:d?!1:n??r,resource:i}),h=_G(),m=Ct(async()=>{if(!d||!s)return;const g=typeof n=="function"?n(s,s.id):typeof r=="function"?(w,S)=>r(w.id,S,w):!1,x=await h({record:s,resource:i,link:g});x===!1||x==null||l(x)});return s?d?p.jsx("li",{className:"w-full",children:p.jsx("button",{onClick:m,style:a,className:"w-full text-left hover:bg-muted focus: bg-muted focus:outline-none",children:t})}):c?p.jsx("li",{className:"w-full",children:p.jsx(Rn,{to:c,style:a,className:"block w-full hover:bg-muted focus:bg-muted focus:outline-none",children:t})}):p.jsx("li",{className:"w-full",children:t}):null},"SimpleListItem"),HT=o(({className:e})=>p.jsx("span",{className:Ce("bg-gray-300 flex",e),children:" "}),"ListPlaceholder"),T9e=o(e=>{const{className:t,hasLeftAvatarOrIcon:n,hasRightAvatarOrIcon:r,hasSecondaryText:a,hasTertiaryText:i,nbFakeLines:s=5,...l}=e;return ZG(1e3)?p.jsx("ul",{className:t,...l,children:k9e(s,c=>p.jsxs("li",{className:"flex items-center space-x-3 p-3",children:[n&&p.jsx("div",{className:"w-10 h-10 bg-gray-300 rounded-full flex-shrink-0",children:" "}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"mb-1",children:[p.jsx(HT,{className:"w-1/3 inline-block mb-1"}),i&&p.jsx("span",{className:"float-right opacity-55 min-w-[10vw]",children:p.jsx(HT,{})})]}),a&&p.jsx(HT,{className:"w-1/4"})]}),r&&p.jsx("div",{className:"w-10 h-10 bg-gray-300 rounded-full flex-shrink-0",children:" "})]},c))}):null},"SimpleListLoading"),k9e=o((e,t)=>Array.from({length:e},(n,r)=>t(r)),"times"),P9e=o(e=>{const{className:t,empty:n=D9e,leftAvatar:r,leftIcon:a,linkType:i,rowClick:s,primaryText:l,rightAvatar:d,rightIcon:c,secondaryText:h,tertiaryText:m,resource:g,...x}=e,{data:w,isPending:S,total:_}=pw(e);return S===!0?p.jsx(T9e,{className:t,hasLeftAvatarOrIcon:!!a||!!r,hasRightAvatarOrIcon:!!c||!!d,hasSecondaryText:!!h,hasTertiaryText:!!m}):w==null||w.length===0||_===0?n||null:p.jsx("ul",{className:t,...Spe(x),children:p.jsx(Tpe,{data:w,total:_,render:o((C,E)=>p.jsx(A9e,{rowIndex:E,linkType:i,rowClick:s,resource:g,children:p.jsx(M9e,{leftAvatar:r,leftIcon:a,primaryText:l,rightAvatar:d,rightIcon:c,secondaryText:h,tertiaryText:m,rowIndex:E})},C.id),"render")})})},"SimpleList"),M9e=o(e=>{const{leftAvatar:t,leftIcon:n,primaryText:r,rightAvatar:a,rightIcon:i,secondaryText:s,tertiaryText:l}=e,d=Ht(e),c=Wt(e),h=mc(d),m=St(),g=o((x,w)=>{const S=w(x,x.id);return typeof S=="string"&&(S.startsWith("http")||S.startsWith("data:"))?p.jsx("img",{src:S,alt:"",className:"w-10 h-10 rounded-full object-cover"}):p.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center text-sm",children:S})},"renderAvatar");return c?p.jsxs("div",{className:"flex items-center space-x-3 p-3",children:[n&&p.jsx("div",{className:"flex-shrink-0",children:n(c,c.id)}),t&&p.jsx("div",{className:"flex-shrink-0",children:g(c,t)}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("div",{className:"text-sm font-medium truncate",children:r?typeof r=="string"?m(r,{...c,_:r}):y.isValidElement(r)?r:r(c,c.id):h(c)}),!!l&&p.jsx("div",{className:"text-xs text-muted-foreground ml-2",children:typeof l=="string"?m(l,{...c,_:l}):y.isValidElement(l)?l:l(c,c.id)})]}),!!s&&p.jsx("div",{className:"text-sm text-muted-foreground truncate",children:typeof s=="string"?m(s,{...c,_:s}):y.isValidElement(s)?s:s(c,c.id)})]}),(a||i)&&p.jsxs("div",{className:"flex-shrink-0 flex items-center space-x-2",children:[a&&g(c,a),i&&i(c,c.id)]})]}):null},"SimpleListItemContent"),D9e=p.jsx(R9e,{}),N9e=o(()=>{const{identity:e}=gr(),{data:t,total:n,isPending:r}=Qa("contacts",{pagination:{page:1,perPage:10},sort:{field:"last_seen",order:"DESC"},filter:{status:"hot",sales_id:e?.id}},{enabled:Number.isInteger(e?.id)});return p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"mr-3 flex",children:p.jsx(uN,{className:"text-muted-foreground w-6 h-6"})}),p.jsx("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Hot Contacts"}),p.jsx(Ei,{children:p.jsxs(Qi,{children:[p.jsx(Xi,{asChild:!0,children:p.jsx(ot,{variant:"ghost",size:"sm",className:"ml-auto text-muted-foreground",asChild:!0,children:p.jsx(Rn,{to:"/contacts/create",children:p.jsx(Fv,{className:"w-4 h-4 text-primary"})})})}),p.jsx(Zi,{children:"Create contact"})]})})]}),p.jsx(Wr,{className:"py-0",children:p.jsx(P9e,{linkType:"show",data:t,total:n,isPending:r,resource:"contacts",className:"[&>li:first-child>a]:rounded-t-xl [&>li:last-child>a]:rounded-b-xl",primaryText:o(a=>`${a.first_name} ${a.last_name}`,"primaryText"),secondaryText:o(a=>p.jsxs(p.Fragment,{children:[a.title," at ",a.company_name]}),"secondaryText"),leftAvatar:o(a=>p.jsx(Qo,{record:a}),"leftAvatar"),empty:p.jsxs("div",{className:"p-4",children:[p.jsx("p",{className:"text-sm mb-4",children:'Contacts with a "hot" status will appear here.'}),p.jsx("p",{className:"text-sm",children:'Change the status of a contact by adding a note to that contact and clicking on "show options".'})]})})})]})},"HotContacts"),I9e=o(()=>{const{identity:e}=gr(),{total:t}=Qa("tasks",{pagination:{page:1,perPage:1},filter:{sales_id:e?.id}},{enabled:!!e});return t?null:p.jsx("p",{className:"text-sm",children:"Tasks added to your contacts will appear here."})},"TasksListEmpty"),Qm=o(({title:e,filter:t})=>{const{identity:n}=gr(),{data:r,total:a,isPending:i}=Qa("tasks",{pagination:{page:1,perPage:100},sort:{field:"due_date",order:"ASC"},filter:{...t,sales_id:n?.id}},{enabled:!!n}),s=mw({data:r,isPending:i,resource:"tasks",perPage:5});return i||!r||!a?null:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium mb-2",children:e}),p.jsx(Xu,{value:"tasks",children:p.jsx(Fg,{value:s,children:p.jsx(Xte,{showContact:!0})})}),a>s.perPage&&p.jsx("div",{className:"flex justify-center",children:p.jsx("a",{href:"#",onClick:o(l=>{s.setPerPage(s.perPage+10),l.preventDefault()},"onClick"),className:"text-sm underline hover:no-underline",children:"Load more"})})]})},"TasksListFilter"),Oae=new Date,F9e=o0e(Oae),L9e=F9e<5,$V=l0e().toISOString(),qV=oye().toISOString(),zV=sye().toISOString(),UV=iye(Oae,{weekStartsOn:0}).toISOString(),Xm={overdue:{"done_date@is":null,"due_date@lt":$V},today:{"done_date@is":null,"due_date@gte":$V,"due_date@lte":qV},tomorrow:{"done_date@is":null,"due_date@gt":qV,"due_date@lt":zV},thisWeek:{"done_date@is":null,"due_date@gte":zV,"due_date@lte":UV},later:{"done_date@is":null,"due_date@gt":UV}},$9e=o(()=>p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"mr-3 flex",children:p.jsx(tQ,{className:"text-muted-foreground w-6 h-6"})}),p.jsx("h2",{className:"text-xl font-semibold text-muted-foreground flex-1",children:"Upcoming Tasks"}),p.jsx(Qte,{display:"icon",selectContact:!0})]}),p.jsx(Wr,{className:"p-4 mb-2",children:p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsx(I9e,{}),p.jsx(Qm,{title:"Overdue",filter:Xm.overdue}),p.jsx(Qm,{title:"Today",filter:Xm.today}),p.jsx(Qm,{title:"Tomorrow",filter:Xm.tomorrow}),L9e&&p.jsx(Qm,{title:"This week",filter:Xm.thisWeek}),p.jsx(Qm,{title:"Later",filter:Xm.later})]})})]}),"TasksList"),q9e=o(()=>{const{data:e,total:t,isPending:n}=Qa("contacts",{pagination:{page:1,perPage:1}}),{total:r,isPending:a}=Qa("contactNotes",{pagination:{page:1,perPage:1}}),{total:i,isPending:s}=Qa("deals",{pagination:{page:1,perPage:1}});return n||a||s?null:t?r?p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6 mt-1",children:[p.jsx("div",{className:"md:col-span-3",children:p.jsxs("div",{className:"flex flex-col gap-4",children:[null,p.jsx(N9e,{})]})}),p.jsx("div",{className:"md:col-span-6",children:p.jsxs("div",{className:"flex flex-col gap-6",children:[i?p.jsx(O9e,{}):null,p.jsx(F3e,{})]})}),p.jsx("div",{className:"md:col-span-3",children:p.jsx($9e,{})})]}):p.jsx(UB,{step:2,contactId:e?.[0]?.id}):p.jsx(UB,{step:1})},"Dashboard"),z9e=y.lazy(()=>Ep(()=>import("./DealList-BVEX05UH.js"),[],import.meta.url)),U9e={list:z9e},B9e=y.createContext(void 0),Rae=o(()=>y.useContext(B9e),"useUserMenu"),H9e=o(()=>{const{darkModeLogo:e,lightModeLogo:t,title:n}=Da(),r=jr();let a="/";return Ms("/",r.pathname)?a="/":Ms("/contacts/*",r.pathname)?a="/contacts":Ms("/companies/*",r.pathname)?a="/companies":Ms("/deals/*",r.pathname)?a="/deals":a=!1,p.jsx("nav",{className:"flex-grow",children:p.jsx("header",{className:"bg-secondary",children:p.jsx("div",{className:"px-4",children:p.jsxs("div",{className:"flex justify-between items-center flex-1",children:[p.jsxs(Rn,{to:"/",className:"flex items-center gap-2 text-secondary-foreground no-underline",children:[p.jsx("img",{className:"[.light_&]:hidden h-6",src:e,alt:n}),p.jsx("img",{className:"[.dark_&]:hidden h-6",src:t,alt:n}),p.jsx("h1",{className:"text-xl font-semibold",children:n})]}),p.jsx("div",{children:p.jsxs("nav",{className:"flex",children:[p.jsx(J0,{label:"Dashboard",to:"/",isActive:a==="/"}),p.jsx(J0,{label:"Contacts",to:"/contacts",isActive:a==="/contacts"}),p.jsx(J0,{label:"Companies",to:"/companies",isActive:a==="/companies"}),p.jsx(J0,{label:"Deals",to:"/deals",isActive:a==="/deals"})]})}),p.jsxs("div",{className:"flex items-center",children:[p.jsx(iZ,{}),p.jsx(oZ,{}),p.jsxs(nZ,{children:[p.jsx(W9e,{}),p.jsx(Wve,{resource:"sales",action:"list",children:p.jsx(V9e,{})})]})]})]})})})})},"Header"),J0=o(({label:e,to:t,isActive:n})=>p.jsx(Rn,{to:t,className:`px-6 py-3 text-sm font-medium transition-colors border-b-2 ${n?"text-secondary-foreground border-secondary-foreground":"text-secondary-foreground/70 border-transparent hover:text-secondary-foreground/80"}`,children:e}),"NavigationTab"),V9e=o(()=>{const{onClose:e}=Rae()??{};return p.jsx(Lr,{asChild:!0,onClick:e,children:p.jsxs(Rn,{to:"/sales",className:"flex items-center gap-2",children:[p.jsx(Qwe,{})," Users"]})})},"UsersMenu"),W9e=o(()=>{const{onClose:e}=Rae()??{};return p.jsx(Lr,{asChild:!0,onClick:e,children:p.jsxs(Rn,{to:"/settings",className:"flex items-center gap-2",children:[p.jsx(Hk,{}),"My info"]})})},"ConfigurationMenu"),G9e=o(({children:e})=>p.jsxs(p.Fragment,{children:[p.jsx(H9e,{}),p.jsx("main",{className:"max-w-screen-xl mx-auto pt-4 px-4",id:"main-content",children:p.jsx(Ub,{FallbackComponent:sZ,children:p.jsx(y.Suspense,{fallback:p.jsx(oa,{className:"h-12 w-12 rounded-full"}),children:e})})}),p.jsx(o1,{})]}),"Layout"),Aae=o(()=>p.jsx("div",{className:"max-w-screen-xl mx-auto h-screen pt-8",children:p.jsx("div",{className:"h-full",children:p.jsxs("div",{className:"max-w-sm mx-auto h-full flex flex-col justify-center gap-8",children:[p.jsx(oa,{className:"w-full h-[100px]"}),p.jsx(oa,{className:"w-4/5 h-[50px]"}),p.jsx(oa,{className:"w-full h-9"}),p.jsx(oa,{className:"w-full h-9"}),p.jsx(oa,{className:"w-full h-9"}),p.jsx(oa,{className:"w-2/5 h-9"})]})})}),"LoginSkeleton"),FM=o(()=>{const e=ir(),t=Yn(),{darkModeLogo:n,title:r}=Da(),{data:a,isPending:i}=Pa({queryKey:["init"],queryFn:o(async()=>t.isInitialized(),"queryFn")}),{isPending:s,mutate:l}=Vi({mutationKey:["signup"],mutationFn:o(async w=>t.signUp(w),"mutationFn"),onSuccess:o(w=>{d({email:w.email,password:w.password,redirectTo:"/contacts"}).then(()=>{c("Initial user successfully created"),e.invalidateQueries({queryKey:["auth","canAccess"]})})},"onSuccess"),onError:o(()=>{c("An error occurred. Please try again.")},"onError")}),d=BY(),c=mn(),{register:h,handleSubmit:m,formState:{isValid:g}}=VD({mode:"onChange"});if(i)return p.jsx(Aae,{});if(a)return p.jsx(Wx,{to:"/login"});const x=o(async w=>{l(w)},"onSubmit");return p.jsxs("div",{className:"h-screen p-8",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx("img",{src:n,alt:r,width:24,className:"filter brightness-0 invert"}),p.jsx("h1",{className:"text-xl font-semibold",children:r})]}),p.jsx("div",{className:"h-full",children:p.jsxs("div",{className:"max-w-sm mx-auto h-full flex flex-col justify-center gap-4",children:[p.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Welcome to CRM"}),p.jsx("p",{className:"text-base mb-4",children:"Create the first user account to complete the setup."}),p.jsxs("form",{onSubmit:m(x),className:"space-y-4",children:[p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(xi,{htmlFor:"first_name",children:"First name"}),p.jsx(bi,{...h("first_name",{required:!0}),id:"first_name",type:"text",required:!0})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(xi,{htmlFor:"last_name",children:"Last name"}),p.jsx(bi,{...h("last_name",{required:!0}),id:"last_name",type:"text",required:!0})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(xi,{htmlFor:"email",children:"Email"}),p.jsx(bi,{...h("email",{required:!0}),id:"email",type:"email",required:!0})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(xi,{htmlFor:"password",children:"Password"}),p.jsx(bi,{...h("password",{required:!0}),id:"password",type:"password",required:!0})]}),p.jsx("div",{className:"flex justify-between items-center mt-8",children:p.jsx(ot,{type:"submit",disabled:!g||s,className:"w-full",children:s?p.jsxs(p.Fragment,{children:[p.jsx(vp,{className:"w-4 h-4 animate-spin mr-2"}),"Creating..."]}):"Create account"})})]})]})})]})},"SignupPage");FM.path="/sign-up";const Y9e=o((e,t)=>e==="admin"?!0:t.resource!=="sales","canAccess"),xg="realtimex_crm_supabase_config";function S_(){const e=localStorage.getItem(xg);if(e)try{return JSON.parse(e)}catch(t){console.error("Failed to parse stored Supabase config:",t),localStorage.removeItem(xg)}return null}o(S_,"getSupabaseConfig");function K9e(e){const t={...e,configuredAt:new Date().toISOString()};localStorage.setItem(xg,JSON.stringify(t))}o(K9e,"saveSupabaseConfig");function Q9e(){localStorage.removeItem(xg)}o(Q9e,"clearSupabaseConfig");function X9e(){return S_()!==null}o(X9e,"isSupabaseConfigured");async function Z9e(e,t){try{if(!e.startsWith("http://")&&!e.startsWith("https://"))return{valid:!1,error:"Invalid URL format"};if(!t.startsWith("eyJ"))return{valid:!1,error:"Invalid anon key format"};const n=await fetch(`${e}/rest/v1/`,{method:"GET",headers:{apikey:t,Authorization:`Bearer ${t}`}});return n.ok?{valid:!0}:n.status===401||n.status===403?{valid:!1,error:"Invalid API key"}:{valid:!1,error:`Connection failed: ${n.statusText}`}}catch(n){return{valid:!1,error:n instanceof Error?n.message:"Connection failed"}}}o(Z9e,"validateSupabaseConnection");function J9e(){return localStorage.getItem(xg)?"ui":"none"}o(J9e,"getConfigSource");let eb=null;function eqe(){if(!eb){const e=S_();e?eb=AP(e.url,e.anonKey):(console.warn("[Supabase] No configuration found, using placeholder"),eb=AP("https://placeholder.supabase.co","placeholder-key"))}return eb}o(eqe,"getSupabaseClient");const Ra=new Proxy({},{get(e,t){const n=eqe(),r=n[t];return typeof r=="function"?r.bind(n):r}}),VT=Zje(Ra,{getIdentity:o(async()=>{const e=await Tae();if(e==null)throw new Error;return{id:e.id,fullName:`${e.first_name} ${e.last_name}`,avatar:e.avatar?.src}},"getIdentity")});async function Fs(){if(Fs._is_initialized_cache==null){const{data:e}=await Ra.from("init_state").select("is_initialized");Fs._is_initialized_cache=e?.at(0)?.is_initialized>0}return Fs._is_initialized_cache}o(Fs,"getIsInitialized");(e=>{e._is_initialized_cache=null})(Fs||(Fs={}));const tqe={...VT,login:o(async e=>{const t=await VT.login(e);return mb=void 0,t},"login"),checkAuth:o(async e=>{if(window.location.pathname==="/set-password"||window.location.hash.includes("#/set-password")||window.location.pathname==="/forgot-password"||window.location.hash.includes("#/forgot-password")||window.location.pathname==="/sign-up"||window.location.hash.includes("#/sign-up"))return;if(!await Fs())throw await Ra.auth.signOut(),{redirectTo:"/sign-up",message:!1};return VT.checkAuth(e)},"checkAuth"),canAccess:o(async e=>{if(!await Fs())return!1;const n=await Tae();if(n==null)return!1;const r=n.administrator?"admin":"user";return Y9e(r,e)},"canAccess")};let mb;const Tae=o(async()=>{if(mb!=null)return mb;const{data:e,error:t}=await Ra.auth.getSession();if(e?.session?.user==null||t)return;const{data:n,error:r}=await Ra.from("sales").select("id, first_name, last_name, avatar, administrator").match({user_id:e?.session?.user.id}).single();if(!(n==null||r))return mb=n,n},"getSaleFromCache");async function nqe(e,t,n){const r={};t&&(r.id=t);const a={};t&&(a.company_id=t);const[i,s,l]=await Promise.all([rqe(e,r),aqe(e,a),iqe(e,a)]);return[...i,...s,...l].sort((d,c)=>d.date&&c.date?d.date.localeCompare(c.date)*-1:0).slice(0,250)}o(nqe,"getActivityLog");const rqe=o(async(e,t)=>{const{data:n}=await e.getList("companies",{filter:t,pagination:{page:1,perPage:250},sort:{field:"created_at",order:"DESC"}});return n.map(r=>({id:`company.${r.id}.created`,type:Xee,company_id:r.id,company:r,sales_id:r.sales_id,date:r.created_at}))},"getNewCompanies");async function aqe(e,t){const{data:n}=await e.getList("contacts",{filter:t,pagination:{page:1,perPage:250},sort:{field:"first_seen",order:"DESC"}}),r={};if(t.sales_id&&(r.sales_id=t.sales_id),t.company_id){const l=n.map(d=>d.id).join(",");r["contact_id@in"]=`(${l})`}const{data:a}=await e.getList("contactNotes",{filter:r,pagination:{page:1,perPage:250},sort:{field:"date",order:"DESC"}}),i=n.map(l=>({id:`contact.${l.id}.created`,type:Zee,company_id:l.company_id,sales_id:l.sales_id,contact:l,date:l.first_seen})),s=a.map(l=>({id:`contactNote.${l.id}.created`,type:Jee,sales_id:l.sales_id,contactNote:l,date:l.date}));return[...i,...s]}o(aqe,"getNewContactsAndNotes");async function iqe(e,t){const{data:n}=await e.getList("deals",{filter:t,pagination:{page:1,perPage:250},sort:{field:"created_at",order:"DESC"}}),r={};if(t.sales_id&&(r.sales_id=t.sales_id),t.company_id){const l=n.map(d=>d.id).join(",");r["deal_id@in"]=`(${l})`}const{data:a}=await e.getList("dealNotes",{filter:r,pagination:{page:1,perPage:250},sort:{field:"date",order:"DESC"}}),i=n.map(l=>({id:`deal.${l.id}.created`,type:ete,company_id:l.company_id,sales_id:l.sales_id,deal:l,date:l.created_at})),s=a.map(l=>({id:`dealNote.${l.id}.created`,type:tte,sales_id:l.sales_id,dealNote:l,date:l.date}));return[...i,...s]}o(iqe,"getNewDealsAndNotes");async function oqe(e){return e.website?{src:`https://favicon.show/${e.website.replace(/^https?:\/\//,"").replace(/\/$/,"")}`,title:"Company favicon"}:null}o(oqe,"getCompanyAvatar");async function sqe(e,t={}){const{timeout:n=2e3}=t,r=new AbortController,a=setTimeout(()=>r.abort(),n),i=await fetch(e,{...t,signal:r.signal});return clearTimeout(a),i}o(sqe,"fetchWithTimeout");const lqe=["gmail.com","yahoo.com","hotmail.com","aol.com","hotmail.co.uk","hotmail.fr","msn.com","yahoo.fr","wanadoo.fr","orange.fr","comcast.net","yahoo.co.uk","yahoo.com.br","yahoo.co.in","live.com","rediffmail.com","free.fr","gmx.de","web.de","yandex.ru","ymail.com","libero.it","outlook.com","uol.com.br","bol.com.br","mail.ru","cox.net","hotmail.it","sbcglobal.net","sfr.fr","live.fr","verizon.net","live.co.uk","googlemail.com","yahoo.es","ig.com.br","live.nl","bigpond.com","terra.com.br","yahoo.it","neuf.fr","yahoo.de","alice.it","rocketmail.com","att.net","laposte.net","facebook.com","bellsouth.net","yahoo.in","hotmail.es","charter.net","yahoo.ca","yahoo.com.au","rambler.ru","hotmail.de","tiscali.it","shaw.ca","yahoo.co.jp","sky.com","earthlink.net","optonline.net","freenet.de","t-online.de","aliceadsl.fr","virgilio.it","home.nl","qq.com","telenet.be","me.com","yahoo.com.ar","tiscali.co.uk","yahoo.com.mx","voila.fr","gmx.net","mail.com","planet.nl","tin.it","live.it","ntlworld.com","arcor.de","yahoo.co.id","frontiernet.net","hetnet.nl","live.com.au","yahoo.com.sg","zonnet.nl","club-internet.fr","juno.com","optusnet.com.au","blueyonder.co.uk","bluewin.ch","skynet.be","sympatico.ca","windstream.net","mac.com","centurytel.net","chello.nl","live.ca","aim.com","bigpond.net.au","online.de","apple.com"];async function cqe(e){const t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}o(cqe,"hash");async function uqe(e){return`https://www.gravatar.com/avatar/${await cqe(e)}?d=404`}o(uqe,"getGravatarUrl");async function dqe(e){if(lqe.includes(e))return null;try{const t=`https://${e}/favicon.ico`;if((await sqe(t)).ok)return t}catch{return null}return null}o(dqe,"getFaviconUrl");async function fqe(e){if(!e.email_jsonb||!e.email_jsonb.length)return null;for(const{email:t}of e.email_jsonb){const n=await uqe(t);try{if((await fetch(n)).ok)return n}catch{}const r=t.split("@")[1],a=await dqe(r);if(a)return a}return null}o(fqe,"getContactAvatar");const BV=S_()||{url:"https://placeholder.supabase.co",anonKey:"placeholder-key"},go=rAe({instanceUrl:BV.url,apiKey:BV.anonKey,supabaseClient:Ra,sortOrder:"asc,desc.nullslast"}),HV=o(async e=>{let t=e.data.logo;return typeof t!="object"||t===null||!t.src?t=await oqe(e.data):t.rawFile instanceof File&&await vb(t),{...e,data:{...e.data,logo:t}}},"processCompanyLogo");async function VV(e){const{data:t}=e;if(t.avatar?.src||!t.email_jsonb||!t.email_jsonb.length)return e;const n=await fqe(t),r={...t,avatar:{src:n||void 0}};return{...e,data:r}}o(VV,"processContactAvatar");const hqe={...go,async getList(e,t){return e==="companies"?go.getList("companies_summary",t):e==="contacts"?go.getList("contacts_summary",t):go.getList(e,t)},async getOne(e,t){return e==="companies"?go.getOne("companies_summary",t):e==="contacts"?go.getOne("contacts_summary",t):go.getOne(e,t)},async signUp({email:e,password:t,first_name:n,last_name:r}){const a=await Ra.auth.signUp({email:e,password:t,options:{data:{first_name:n,last_name:r}}});if(!a.data?.user||a.error)throw console.error("signUp.error",a.error),new Error("Failed to create account");return Fs._is_initialized_cache=!0,{id:a.data.user.id,email:e,password:t}},async salesCreate(e){const{data:t,error:n}=await Ra.functions.invoke("users",{method:"POST",body:e});if(!t||n)throw console.error("salesCreate.error",n),new Error("Failed to create account manager");return t},async salesUpdate(e,t){const{email:n,first_name:r,last_name:a,administrator:i,avatar:s,disabled:l}=t,{data:d,error:c}=await Ra.functions.invoke("users",{method:"PATCH",body:{sales_id:e,email:n,first_name:r,last_name:a,administrator:i,disabled:l,avatar:s}});if(!d||c)throw console.error("salesCreate.error",c),new Error("Failed to update account manager");return t},async updatePassword(e){const{data:t,error:n}=await Ra.functions.invoke("updatePassword",{method:"PATCH",body:{sales_id:e}});if(!t||n)throw console.error("passwordUpdate.error",n),new Error("Failed to update password");return t},async unarchiveDeal(e){const{data:t}=await go.getList("deals",{filter:{stage:e.stage},pagination:{page:1,perPage:1e3},sort:{field:"index",order:"ASC"}}),n=t.map((r,a)=>({...r,index:r.id===e.id?0:a+1,archived_at:r.id===e.id?null:r.archived_at}));return await Promise.all(n.map(r=>go.update("deals",{id:r.id,data:r,previousData:t.find(a=>a.id===r.id)})))},async getActivityLog(e){return nqe(go,e)},async isInitialized(){return Fs()},async mergeContacts(e,t){const{data:n,error:r}=await Ra.functions.invoke("mergeContacts",{method:"POST",body:{loserId:e,winnerId:t}});if(r)throw console.error("mergeContacts.error",r),new Error("Failed to merge contacts");return n}},pqe=Mfe(hqe,[{resource:"contactNotes",beforeSave:o(async(e,t,n)=>{if(e.attachments)for(const r of e.attachments)await vb(r);return e},"beforeSave")},{resource:"dealNotes",beforeSave:o(async(e,t,n)=>{if(e.attachments)for(const r of e.attachments)await vb(r);return e},"beforeSave")},{resource:"sales",beforeSave:o(async(e,t,n)=>(e.avatar&&await vb(e.avatar),e),"beforeSave")},{resource:"contacts",beforeCreate:o(async e=>VV(e),"beforeCreate"),beforeUpdate:o(async e=>VV(e),"beforeUpdate"),beforeGetList:o(async e=>tb(["first_name","last_name","company_name","title","email","phone","background"])(e),"beforeGetList")},{resource:"companies",beforeGetList:o(async e=>tb(["name","phone_number","website","zipcode","city","stateAbbr"])(e),"beforeGetList"),beforeCreate:o(async e=>{const t=await HV(e);return{...t,data:{...t.data,created_at:new Date().toISOString()}}},"beforeCreate"),beforeUpdate:o(async e=>await HV(e),"beforeUpdate")},{resource:"contacts_summary",beforeGetList:o(async e=>tb(["first_name","last_name"])(e),"beforeGetList")},{resource:"deals",beforeGetList:o(async e=>tb(["name","type","description"])(e),"beforeGetList")}]),tb=o(e=>t=>{if(!t.filter?.q)return t;const{q:n,...r}=t.filter;return{...t,filter:{...r,"@or":e.reduce((a,i)=>i==="email"?{...a,"email_fts@ilike":n}:i==="phone"?{...a,"phone_fts@ilike":n}:{...a,[`${i}@ilike`]:n},{})}}},"applyFullTextSearch"),vb=o(async e=>{if(!e.src.startsWith("blob:")&&!e.src.startsWith("data:")&&e.path){const{error:c}=await Ra.storage.from("attachments").createSignedUrl(e.path,60);if(!c)return}const t=e.src?await fetch(e.src).then(c=>c.blob()):e.rawFile,n=e.rawFile,r=n.name.split(".").pop(),i=`${`${Math.random()}.${r}`}`,{error:s}=await Ra.storage.from("attachments").upload(i,t);if(s)throw console.error("uploadError",s),new Error("Failed to upload attachment");const{data:l}=Ra.storage.from("attachments").getPublicUrl(i);e.path=i,e.src=l.publicUrl;const d=n.type;return e.type=d,e},"uploadToBucket");function kae(){const{identity:e}=gr(),t=Wt();return p.jsxs("div",{className:"space-y-4 w-full",children:[p.jsx(un,{source:"first_name",validate:pr(),helperText:!1}),p.jsx(un,{source:"last_name",validate:pr(),helperText:!1}),p.jsx(un,{source:"email",validate:[pr(),_Y()],helperText:!1}),p.jsx(iM,{source:"administrator",readOnly:t?.id===e?.id,helperText:!1}),p.jsx(iM,{source:"disabled",readOnly:t?.id===e?.id,helperText:!1})]})}o(kae,"SalesInputs");function mqe(){const e=Yn(),t=mn(),n=ro(),{mutate:r}=Vi({mutationKey:["signup"],mutationFn:o(async i=>e.salesCreate(i),"mutationFn"),onSuccess:o(()=>{t("User created. They will soon receive an email to set their password."),n("/sales")},"onSuccess"),onError:o(()=>{t("An error occurred while creating the user.",{type:"error"})},"onError")}),a=o(async i=>{r(i)},"onSubmit");return p.jsx("div",{className:"max-w-lg w-full mx-auto mt-8",children:p.jsxs(Wr,{children:[p.jsx(UJ,{children:p.jsx(BJ,{children:"Create a new user"})}),p.jsx(io,{children:p.jsx(HJ,{onSubmit:a,children:p.jsx(kae,{})})})]})})}o(mqe,"SalesCreate");function vqe(){return p.jsxs("div",{className:"flex justify-end gap-4",children:[p.jsx(m1,{}),p.jsx(od,{})]})}o(vqe,"EditToolbar");function gqe(){const{record:e}=YG(),t=Yn(),n=mn(),r=ro(),{mutate:a}=Vi({mutationKey:["signup"],mutationFn:o(async s=>{if(!e)throw new Error("Record not found");return t.salesUpdate(e.id,s)},"mutationFn"),onSuccess:o(()=>{r("/sales"),n("User updated successfully")},"onSuccess"),onError:o(()=>{n("An error occurred. Please try again.")},"onError")}),i=o(async s=>{a(s)},"onSubmit");return p.jsx("div",{className:"max-w-lg w-full mx-auto mt-8",children:p.jsx(Wr,{children:p.jsx(io,{children:p.jsxs(HJ,{toolbar:p.jsx(vqe,{}),onSubmit:i,record:e,children:[p.jsx(yqe,{}),p.jsx(kae,{})]})})})})}o(gqe,"SalesEdit");const yqe=o(()=>{const e=Wt();return e?p.jsxs("h2",{className:"text-lg font-semibold mb-4",children:["Edit ",e?.first_name," ",e?.last_name]}):null},"SaleEditTitle"),bqe=o(()=>p.jsxs(XN,{children:[p.jsx(c1,{}),p.jsx(ld,{label:"New user"})]}),"SalesListActions"),xqe=[p.jsx(JN,{source:"q",alwaysOn:!0})],wqe=o(e=>{const t=Wt();return t?p.jsxs("div",{className:"flex flex-row gap-1",children:[t.administrator&&p.jsx(zu,{variant:"outline",className:"border-blue-300 dark:border-blue-700",children:"Admin"}),t.disabled&&p.jsx(zu,{variant:"outline",className:"border-orange-300 dark:border-orange-700",children:"Disabled"})]}):null},"OptionsField");function _qe(){return p.jsx(KN,{filters:xqe,actions:p.jsx(bqe,{}),sort:{field:"first_name",order:"ASC"},children:p.jsxs(Ml,{children:[p.jsx(Ml.Col,{source:"first_name"}),p.jsx(Ml.Col,{source:"last_name"}),p.jsx(Ml.Col,{source:"email"}),p.jsx(Ml.Col,{label:!1,children:p.jsx(wqe,{})})]})})}o(_qe,"SalesList");const Sqe={list:_qe,create:mqe,edit:gqe,recordRepresentation:o(e=>`${e.first_name} ${e.last_name}`,"recordRepresentation")};function Pae({open:e,onComplete:t,canClose:n=!1}){const[r,a]=y.useState("welcome"),[i,s]=y.useState(""),[l,d]=y.useState(""),[c,h]=y.useState(null),m=o(async()=>{h(null),a("validating");const x=await Z9e(i,l);x.valid?(K9e({url:i,anonKey:l}),a("success"),setTimeout(()=>{window.location.href=window.location.origin},1500)):(h(x.error||"Connection failed"),a("credentials"))},"handleValidateAndSave"),g=o(()=>{n&&t()},"handleClose");return p.jsx(Yo,{open:e,onOpenChange:n?g:void 0,children:p.jsxs(Ko,{className:"sm:max-w-md",onPointerDownOutside:o(x=>!n&&x.preventDefault(),"onPointerDownOutside"),onEscapeKeyDown:o(x=>!n&&x.preventDefault(),"onEscapeKeyDown"),children:[r==="welcome"&&p.jsxs(p.Fragment,{children:[p.jsxs(Ya,{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx(Bk,{className:"h-6 w-6 text-primary"}),p.jsx(Ka,{children:"Welcome to CRM"})]}),p.jsx(fu,{children:"To get started, you'll need to connect to a Supabase database."})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[p.jsx(Ui,{children:p.jsxs(To,{children:[p.jsx("strong",{children:"Don't have a Supabase project?"}),p.jsx("br",{}),"Create one for free at"," ",p.jsx("a",{href:"https://supabase.com",target:"_blank",rel:"noopener noreferrer",className:"underline text-primary",children:"supabase.com"})]})}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"font-medium text-sm",children:"What you'll need:"}),p.jsxs("ul",{className:"list-disc list-inside text-sm text-muted-foreground space-y-1",children:[p.jsx("li",{children:"Your Supabase project URL"}),p.jsx("li",{children:"Your anonymous (anon) API key"})]})]}),p.jsx(ot,{onClick:o(()=>a("credentials"),"onClick"),className:"w-full",children:"Continue"})]})]}),r==="credentials"&&p.jsxs(p.Fragment,{children:[p.jsxs(Ya,{children:[p.jsx(Ka,{children:"Connect to Supabase"}),p.jsx(fu,{children:"Enter your Supabase project credentials"})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[c&&p.jsxs(Ui,{variant:"destructive",children:[p.jsx(Mw,{className:"h-4 w-4"}),p.jsx(To,{children:c})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(xi,{htmlFor:"supabase-url",children:"Supabase URL"}),p.jsx(bi,{id:"supabase-url",placeholder:"https://xxxxx.supabase.co",value:i,onChange:o(x=>s(x.target.value),"onChange")}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Found in Project Settings → API"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(xi,{htmlFor:"anon-key",children:"Anonymous Key"}),p.jsx(bi,{id:"anon-key",type:"password",placeholder:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",value:l,onChange:o(x=>d(x.target.value),"onChange")}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Found in Project Settings → API → Project API keys"})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(ot,{variant:"outline",onClick:o(()=>a("welcome"),"onClick"),className:"flex-1",children:"Back"}),p.jsx(ot,{onClick:m,disabled:!i||!l,className:"flex-1",children:"Connect"})]})]})]}),r==="validating"&&p.jsxs(p.Fragment,{children:[p.jsxs(Ya,{children:[p.jsx(Ka,{children:"Validating Connection"}),p.jsx(fu,{children:"Testing your Supabase credentials..."})]}),p.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[p.jsx(vp,{className:"h-12 w-12 animate-spin text-primary mb-4"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Please wait..."})]})]}),r==="success"&&p.jsxs(p.Fragment,{children:[p.jsxs(Ya,{children:[p.jsx(Ka,{children:"Connection Successful!"}),p.jsx(fu,{children:"Your Supabase database is now connected"})]}),p.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[p.jsx(Iv,{className:"h-12 w-12 text-green-500 mb-4"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Reloading application..."})]})]})]})})}o(Pae,"SupabaseSetupWizard");function Eqe(){const[e,t]=y.useState(!1),n=S_(),r=J9e(),a=o(()=>{confirm("Are you sure you want to clear the database configuration? The app will need to be reconfigured on next launch.")&&(Q9e(),window.location.reload())},"handleClearConfig");return p.jsxs(p.Fragment,{children:[p.jsxs(Wr,{children:[p.jsxs(UJ,{children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Bk,{className:"h-5 w-5"}),p.jsx(BJ,{children:"Database Connection"})]}),n&&p.jsx(zu,{variant:r==="ui"?"default":"secondary",children:r==="ui"?"UI Configured":"Environment Variables"})]}),p.jsx(_ke,{children:"Manage your Supabase database connection settings"})]}),p.jsx(io,{className:"space-y-4",children:n?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-start gap-3 p-4 border rounded-lg",children:[p.jsx(Iv,{className:"h-5 w-5 text-green-500 mt-0.5"}),p.jsxs("div",{className:"flex-1 space-y-1",children:[p.jsx("p",{className:"font-medium",children:"Connected"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:n.url}),n.configuredAt&&p.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configured on"," ",new Date(n.configuredAt).toLocaleDateString()]})]})]}),r==="env"&&p.jsxs(Ui,{children:[p.jsx(Hk,{className:"h-4 w-4"}),p.jsx(To,{children:"Using configuration from environment variables. You can override this by setting up a new connection via the UI."})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(ot,{variant:"outline",onClick:o(()=>t(!0),"onClick"),className:"flex-1",children:[p.jsx(Hk,{className:"h-4 w-4 mr-2"}),"Change Connection"]}),r==="ui"&&p.jsxs(ot,{variant:"destructive",onClick:a,className:"flex-1",children:[p.jsx(rQ,{className:"h-4 w-4 mr-2"}),"Clear Configuration"]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(Cqe,{className:"text-sm font-medium",children:"Anonymous Key"}),p.jsxs("div",{className:"font-mono text-sm p-2 bg-muted rounded",children:[n.anonKey.substring(0,20),"...",n.anonKey.substring(n.anonKey.length-10)]})]})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-start gap-3 p-4 border border-dashed rounded-lg",children:[p.jsx(gc,{className:"h-5 w-5 text-destructive mt-0.5"}),p.jsxs("div",{className:"flex-1 space-y-1",children:[p.jsx("p",{className:"font-medium",children:"Not Connected"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"No Supabase database is configured"})]})]}),p.jsx(Ui,{children:p.jsxs(To,{children:["Connect to a Supabase database to start using Atomic CRM. You can create a free project at"," ",p.jsx("a",{href:"https://supabase.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"supabase.com"})]})}),p.jsxs(ot,{onClick:o(()=>t(!0),"onClick"),className:"w-full",children:[p.jsx(Bk,{className:"h-4 w-4 mr-2"}),"Connect to Supabase"]})]})})]}),p.jsx(Pae,{open:e,onComplete:o(()=>t(!1),"onComplete"),canClose:!0})]})}o(Eqe,"DatabaseSettings");function Cqe({children:e,className:t}){return p.jsx("label",{className:t,children:e})}o(Cqe,"Label");const LM=o(()=>{const[e,t]=y.useState(!1),{identity:n,refetch:r}=gr(),{data:a,refetch:i}=lw("sales",{id:n?.id}),s=mn(),l=Yn(),{mutate:d}=Vi({mutationKey:["signup"],mutationFn:o(async h=>{if(!n)throw new Error("Record not found");return l.salesUpdate(n.id,h)},"mutationFn"),onSuccess:o(()=>{r(),i(),t(!1),s("Your profile has been updated")},"onSuccess"),onError:o(h=>{s("An error occurred. Please try again",{type:"error"})},"onError")});if(!n)return null;const c=o(async h=>{d(h)},"handleOnSubmit");return p.jsx("div",{className:"max-w-lg mx-auto mt-8",children:p.jsx(da,{onSubmit:c,record:a,children:p.jsx(jqe,{isEditMode:e,setEditMode:t})})})},"SettingsPage"),jqe=o(({isEditMode:e,setEditMode:t})=>{const n=mn(),r=Wt(),{identity:a,refetch:i}=gr(),{isDirty:s}=$g(),l=Yn(),{mutate:d}=Vi({mutationKey:["updatePassword"],mutationFn:o(async()=>{if(!a)throw new Error("Record not found");return l.updatePassword(a.id)},"mutationFn"),onSuccess:o(()=>{n("A reset password email has been sent to your email address")},"onSuccess"),onError:o(g=>{n(`${g}`,{type:"error"})},"onError")}),{mutate:c}=Vi({mutationKey:["signup"],mutationFn:o(async g=>{if(!r)throw new Error("Record not found");return l.salesUpdate(r.id,g)},"mutationFn"),onSuccess:o(()=>{i(),n("Your profile has been updated")},"onSuccess"),onError:o(()=>{n("An error occurred. Please try again.")},"onError")});if(!a)return null;const h=o(()=>{d()},"handleClickOpenPasswordChange"),m=o(async g=>{c(g)},"handleAvatarUpdate");return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Eqe,{}),p.jsx(Wr,{children:p.jsxs(io,{children:[p.jsx("div",{className:"mb-4 flex flex-row justify-between",children:p.jsx("h2",{className:"text-xl font-semibold text-muted-foreground",children:"My info"})}),p.jsxs("div",{className:"space-y-4 mb-4",children:[p.jsx(Iee,{source:"avatar",type:"avatar",onSave:m,linkPosition:"right"}),p.jsx(WT,{source:"first_name",isEditMode:e}),p.jsx(WT,{source:"last_name",isEditMode:e}),p.jsx(WT,{source:"email",isEditMode:e})]}),p.jsxs("div",{className:"flex flex-row justify-end gap-2",children:[!e&&p.jsx(p.Fragment,{children:p.jsx(ot,{variant:"outline",type:"button",onClick:h,children:"Change password"})}),p.jsxs(ot,{type:"button",variant:e?"ghost":"outline",onClick:o(()=>t(!e),"onClick"),className:"flex items-center",children:[e?p.jsx(gc,{}):p.jsx(JK,{}),e?"Cancel":"Edit"]}),e&&p.jsxs(ot,{type:"submit",disabled:!s,variant:"outline",children:[p.jsx(Dw,{}),"Save"]})]})]})}),void 0]})},"SettingsForm"),WT=o(({source:e,isEditMode:t})=>t?p.jsx(un,{source:e,helperText:!1}):p.jsx("div",{className:"m-2",children:p.jsx(X4e,{source:e})}),"TextRender");LM.path="/settings";var Oqe={"ra-supabase":{auth:{email:"Email",confirm_password:"Confirm password",sign_in_with:"Sign in with %{provider}",forgot_password:"Forgot password?",reset_password:"Reset password",password_reset:"Your password has been reset. You will receive an email containing a link to log in.",missing_tokens:"Access and refresh tokens are missing",back_to_login:"Back to login"},reset_password:{forgot_password:"Forgot password?",forgot_password_details:"Enter your email for instructions."},set_password:{new_password:"Choose your password"},validation:{password_mismatch:"Passwords do not match"}}};const Rqe={"ra-supabase":{auth:{password_reset:"Check your emails for a Reset Password message."}}},Aqe=kK(()=>yde(yK,Oqe,Rqe),"en",[{locale:"en",name:"English"}],{allowMissing:!0}),Tqe=o(()=>{const e=Yn(),{data:t,error:n,isPending:r}=Pa({queryKey:["init"],queryFn:o(async()=>e.isInitialized(),"queryFn")});return r?p.jsx(Aae,{}):n?p.jsx(Xb,{}):t?p.jsx(Xb,{}):p.jsx(Wx,{to:"/sign-up"})},"StartPage"),kqe=o(({contactGender:e=wZ,companySectors:t=mZ,dealCategories:n=yZ,dealPipelineStatuses:r=gZ,dealStages:a=vZ,darkModeLogo:i=fZ,lightModeLogo:s=hZ,noteStatuses:l=bZ,taskTypes:d=xZ,title:c=pZ,dataProvider:h=pqe,authProvider:m=tqe,disableTelemetry:g,...x})=>(y.useEffect(()=>{if(g||typeof window>"u"||typeof window.location>"u"||typeof Image>"u")return;const w=new Image;w.src=`https://atomic-crm-telemetry.marmelab.com/atomic-crm-telemetry?domain=${window.location.hostname}`},[g]),p.jsx(Vje,{contactGender:e,companySectors:t,dealCategories:n,dealPipelineStatuses:r,dealStages:a,darkModeLogo:i,lightModeLogo:s,noteStatuses:l,taskTypes:d,title:c,children:p.jsxs(Qje,{dataProvider:h,authProvider:m,store:FW(void 0,"CRM"),layout:G9e,loginPage:Tqe,i18nProvider:Aqe,dashboard:q9e,requireAuth:!0,disableTelemetry:!0,...x,children:[p.jsxs(Pk,{noLayout:!0,children:[p.jsx(fr,{path:FM.path,element:p.jsx(FM,{})}),p.jsx(fr,{path:PP.path,element:p.jsx(PP,{})}),p.jsx(fr,{path:kP.path,element:p.jsx(kP,{})})]}),p.jsx(Pk,{children:p.jsx(fr,{path:LM.path,element:p.jsx(LM,{})})}),p.jsx(xo,{name:"deals",...U9e}),p.jsx(xo,{name:"contacts",...I3e}),p.jsx(xo,{name:"companies",...DNe}),p.jsx(xo,{name:"contactNotes"}),p.jsx(xo,{name:"dealNotes"}),p.jsx(xo,{name:"tasks"}),p.jsx(xo,{name:"sales",...Sqe}),p.jsx(xo,{name:"tags"})]})})),"CRM"),Pqe=o(()=>{const[e,t]=y.useState(()=>{const n=X9e();return console.log("[App] Supabase configured:",n),!n});return e?p.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:p.jsx(Pae,{open:!0,onComplete:o(()=>{t(!1)},"onComplete"),canClose:!1})}):p.jsx(kqe,{})},"App");Goe.createRoot(document.getElementById("root")).render(p.jsx(y.StrictMode,{children:p.jsx(Pqe,{})}));export{gr as $,Gs as A,zu as B,GG as C,LY as D,VN as E,$o as F,BN as G,Rn as H,qo as I,WZ as J,Ce as K,JG as L,hme as M,bi as N,qx as O,ie as P,IW as Q,Xu as R,Vs as S,Zn as T,ro as U,Wr as V,io as W,gp as X,Er as Y,Op as Z,Rp as _,qg as a,ot as a0,Yo as a1,Ko as a2,Ka as a3,Ju as a4,ed as a5,un as a6,pr as a7,ry as a8,n4e as a9,Qge as aA,hNe as aB,Kv as aC,M3e as aD,nne as aE,OD as aF,Vi as aG,Qu as aH,gte as aI,xi as aJ,JN as aK,b1 as aL,KN as aM,XN as aN,ZTe as aO,c1 as aP,sM as aa,Da as ab,Bs as ac,Vte as ad,Yn as ae,Bn as af,ir as ag,da as ah,v1 as ai,od as aj,mn as ak,ID as al,dte as am,Wt as an,d4 as ao,jr as ap,Ms as aq,ZN as ar,W3e as as,ld as at,yNe as au,Hi as av,Qo as aw,kY as ax,ite as ay,mK as az,UD as b,PG as c,ime as d,Qa as e,at as f,XD as g,vc as h,St as i,mc as j,Ow as k,Ct as l,p as m,Us as n,Zr as o,Zg as p,rPe as q,y as r,iPe as s,sPe as t,Jr as u,lPe as v,Ks as w,fw as x,Ht as y,Zu as z};
|
|
152
|
-
//# sourceMappingURL=index-
|
|
151
|
+
`,fill:a,opacity:s,strokeWidth:d,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})},"y");function Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ql.apply(null,arguments)}o(Ql,"b");var yi={translateX:0,translateY:0,padding:0,itemsSpacing:0,itemDirection:"left-to-right",justify:!1,symbolShape:"square",symbolSize:16,symbolSpacing:8},z$e={top:0,right:0,bottom:0,left:0},l3=o(function(e){var t,n=e.direction,r=e.itemsSpacing,a=e.padding,i=e.itemCount,s=e.itemWidth,l=e.itemHeight;if(typeof a!="number"&&(typeof(t=a)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var d=typeof a=="number"?{top:a,right:a,bottom:a,left:a}:Ql({},z$e,a),c=d.left+d.right,h=d.top+d.bottom,m=s+c,g=l+h,x=(i-1)*r;return n==="row"?m=s*i+x+c:n==="column"&&(g=l*i+x+h),{width:m,height:g,padding:d}},"A"),yae=o(function(e){var t=e.anchor,n=e.translateX,r=e.translateY,a=e.containerWidth,i=e.containerHeight,s=e.width,l=e.height,d=n,c=r;switch(t){case"top":d+=(a-s)/2;break;case"top-right":d+=a-s;break;case"right":d+=a-s,c+=(i-l)/2;break;case"bottom-right":d+=a-s,c+=i-l;break;case"bottom":d+=(a-s)/2,c+=i-l;break;case"bottom-left":c+=i-l;break;case"left":c+=(i-l)/2;break;case"center":d+=(a-s)/2,c+=(i-l)/2}return{x:d,y:c}},"C"),bae=o(function(e){var t,n,r,a,i,s,l=e.direction,d=e.justify,c=e.symbolSize,h=e.symbolSpacing,m=e.width,g=e.height;switch(l){case"left-to-right":t=0,n=(g-c)/2,a=g/2,s="central",d?(r=m,i="end"):(r=c+h,i="start");break;case"right-to-left":t=m-c,n=(g-c)/2,a=g/2,s="central",d?(r=0,i="start"):(r=m-c-h,i="end");break;case"top-to-bottom":t=(m-c)/2,n=0,r=m/2,i="middle",d?(a=g,s="alphabetic"):(a=c+h,s="text-before-edge");break;case"bottom-to-top":t=(m-c)/2,n=g-c,r=m/2,i="middle",d?(a=0,s="text-before-edge"):(a=g-c-h,s="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:a,labelAnchor:i,labelAlignment:s}},"z"),U$e={circle:F$e,diamond:L$e,square:$$e,triangle:q$e},B$e=o(function(e){var t,n,r,a,i,s,l,d,c,h,m,g=e.x,x=e.y,w=e.width,S=e.height,_=e.data,C=e.direction,E=C===void 0?yi.itemDirection:C,O=e.justify,j=O===void 0?yi.justify:O,k=e.textColor,A=e.background,T=A===void 0?"transparent":A,P=e.opacity,D=P===void 0?1:P,N=e.symbolShape,I=N===void 0?yi.symbolShape:N,F=e.symbolSize,L=F===void 0?yi.symbolSize:F,q=e.symbolSpacing,U=q===void 0?yi.symbolSpacing:q,$=e.symbolBorderWidth,H=$===void 0?0:$,z=e.symbolBorderColor,W=z===void 0?"transparent":z,V=e.onClick,Q=e.onMouseEnter,K=e.onMouseLeave,Y=e.toggleSerie,ee=e.effects,te=y.useState({}),oe=te[0],ne=te[1],fe=Or(),re=y.useCallback((function(X){if(ee){var se=ee.filter((function(me){return me.on==="hover"})).reduce((function(me,ke){return Ql({},me,ke.style)}),{});ne(se)}Q?.(_,X)}),[Q,_,ee]),ce=y.useCallback((function(X){if(ee){var se=ee.filter((function(me){return me.on!=="hover"})).reduce((function(me,ke){return Ql({},me,ke.style)}),{});ne(se)}K?.(_,X)}),[K,_,ee]),he=bae({direction:E,justify:j,symbolSize:(t=oe.symbolSize)!=null?t:L,symbolSpacing:U,width:w,height:S}),J=he.symbolX,Ne=he.symbolY,we=he.labelX,Ee=he.labelY,Ae=he.labelAnchor,Re=he.labelAlignment,Pe=[V,Q,K,Y].some((function(X){return X!==void 0})),ze=typeof I=="function"?I:U$e[I];return p.jsxs("g",{transform:"translate("+g+","+x+")",style:{opacity:(n=oe.itemOpacity)!=null?n:D},children:[p.jsx("rect",{width:w,height:S,fill:(r=oe.itemBackground)!=null?r:T,style:{cursor:Pe?"pointer":"auto"},onClick:o(function(X){V?.(_,X),Y?.(_.id)},"onClick"),onMouseEnter:re,onMouseLeave:ce}),y.createElement(ze,Ql({id:_.id,x:J,y:Ne,size:(a=oe.symbolSize)!=null?a:L,fill:(i=(s=_.fill)!=null?s:_.color)!=null?i:"black",borderWidth:(l=oe.symbolBorderWidth)!=null?l:H,borderColor:(d=oe.symbolBorderColor)!=null?d:W},_.hidden?fe.legends.hidden.symbol:void 0)),p.jsx(x_,{textAnchor:Ae,style:Ql({},fe.legends.text,{fill:(c=(h=(m=oe.itemTextColor)!=null?m:k)!=null?h:fe.legends.text.fill)!=null?c:"black",dominantBaseline:Re,pointerEvents:"none",userSelect:"none"},_.hidden?fe.legends.hidden.text:void 0),x:we,y:Ee,children:_.label})]})},"B"),H$e=o(function(e){var t=e.data,n=e.x,r=e.y,a=e.direction,i=e.padding,s=i===void 0?yi.padding:i,l=e.justify,d=e.effects,c=e.itemWidth,h=e.itemHeight,m=e.itemDirection,g=m===void 0?yi.itemDirection:m,x=e.itemsSpacing,w=x===void 0?yi.itemsSpacing:x,S=e.itemTextColor,_=e.itemBackground,C=_===void 0?"transparent":_,E=e.itemOpacity,O=E===void 0?1:E,j=e.symbolShape,k=e.symbolSize,A=e.symbolSpacing,T=e.symbolBorderWidth,P=e.symbolBorderColor,D=e.onClick,N=e.onMouseEnter,I=e.onMouseLeave,F=e.toggleSerie,L=l3({itemCount:t.length,itemWidth:c,itemHeight:h,itemsSpacing:w,direction:a,padding:s}).padding,q=a==="row"?c+w:0,U=a==="column"?h+w:0;return p.jsx("g",{transform:"translate("+n+","+r+")",children:t.map((function($,H){return p.jsx(B$e,{data:$,x:H*q+L.left,y:H*U+L.top,width:c,height:h,direction:g,justify:l,effects:d,textColor:S,background:C,opacity:O,symbolShape:j,symbolSize:k,symbolSpacing:A,symbolBorderWidth:T,symbolBorderColor:P,onClick:D,onMouseEnter:N,onMouseLeave:I,toggleSerie:F},H)}))})},"H"),V$e=o(function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,a=e.translateX,i=a===void 0?yi.translateX:a,s=e.translateY,l=s===void 0?yi.translateY:s,d=e.anchor,c=e.direction,h=e.padding,m=h===void 0?yi.padding:h,g=e.justify,x=e.itemsSpacing,w=x===void 0?yi.itemsSpacing:x,S=e.itemWidth,_=e.itemHeight,C=e.itemDirection,E=e.itemTextColor,O=e.itemBackground,j=e.itemOpacity,k=e.symbolShape,A=e.symbolSize,T=e.symbolSpacing,P=e.symbolBorderWidth,D=e.symbolBorderColor,N=e.onClick,I=e.onMouseEnter,F=e.onMouseLeave,L=e.toggleSerie,q=e.effects,U=l3({itemCount:t.length,itemsSpacing:w,itemWidth:S,itemHeight:_,direction:c,padding:m}),$=U.width,H=U.height,z=yae({anchor:d,translateX:i,translateY:l,containerWidth:n,containerHeight:r,width:$,height:H}),W=z.x,V=z.y;return p.jsx(H$e,{data:t,x:W,y:V,direction:c,padding:m,justify:g,effects:q,itemsSpacing:w,itemWidth:S,itemHeight:_,itemDirection:C,itemTextColor:E,itemBackground:O,itemOpacity:j,symbolShape:k,symbolSize:A,symbolSpacing:T,symbolBorderWidth:P,symbolBorderColor:D,onClick:N,onMouseEnter:I,onMouseLeave:F,toggleSerie:typeof L=="boolean"?void 0:L})},"E"),W$e={start:"left",middle:"center",end:"right"},G$e=o(function(e,t){var n=t.data,r=t.containerWidth,a=t.containerHeight,i=t.translateX,s=i===void 0?0:i,l=t.translateY,d=l===void 0?0:l,c=t.anchor,h=t.direction,m=t.padding,g=m===void 0?0:m,x=t.justify,w=x!==void 0&&x,S=t.itemsSpacing,_=S===void 0?0:S,C=t.itemWidth,E=t.itemHeight,O=t.itemDirection,j=O===void 0?"left-to-right":O,k=t.itemTextColor,A=t.symbolSize,T=A===void 0?16:A,P=t.symbolSpacing,D=P===void 0?8:P,N=t.theme,I=l3({itemCount:n.length,itemWidth:C,itemHeight:E,itemsSpacing:_,direction:h,padding:g}),F=I.width,L=I.height,q=I.padding,U=yae({anchor:c,translateX:s,translateY:d,containerWidth:r,containerHeight:a,width:F,height:L}),$=U.x,H=U.y,z=h==="row"?C+_:0,W=h==="column"?E+_:0;e.save(),e.translate($,H),vg(e,N.legends.text),n.forEach((function(V,Q){var K,Y=Q*z+q.left,ee=Q*W+q.top,te=bae({direction:j,justify:w,symbolSize:T,symbolSpacing:D,width:C,height:E}),oe=te.symbolX,ne=te.symbolY,fe=te.labelX,re=te.labelY,ce=te.labelAnchor,he=te.labelAlignment;e.fillStyle=(K=V.color)!=null?K:"black",e.fillRect(Y+oe,ee+ne,T,T),e.textAlign=W$e[ce],he==="central"&&(e.textBaseline="middle"),gg(e,Ql({},N.legends.text,{fill:k??N.legends.text.fill}),String(V.label),Y+fe,ee+re)})),e.restore()},"L"),Y$e=o(function(e,t,n,r,a,i){i>0?(e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+a-i),e.quadraticCurveTo(t+r,n+a,t+r-i,n+a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t,n+a,t,n+a-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath()):e.rect(t,n,r,a)},"o");function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fn.apply(null,arguments)}o(fn,"Q");function Sc(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}o(Sc,"U");var IV,K$e=o(function(e){var t=e.bars,n=e.annotations,r=pae({data:t,annotations:n,getPosition:o(function(a){return{x:a.x+a.width/2,y:a.y+a.height/2}},"getPosition"),getDimensions:o(function(a){var i=a.height,s=a.width;return{width:s,height:i,size:Math.max(s,i)}},"getDimensions")});return p.jsx(p.Fragment,{children:r.map((function(a,i){return p.jsx(x$e,fn({},a),i)}))})},"$"),Q$e=o(function(e){var t=e.width,n=e.height,r=e.legends,a=e.toggleSerie;return p.jsx(p.Fragment,{children:r.map((function(i,s){var l,d=i[0],c=i[1];return p.jsx(V$e,fn({},d,{containerWidth:t,containerHeight:n,data:(l=d.data)!=null?l:c,toggleSerie:d.toggleSerie&&d.dataFrom==="keys"?a:void 0}),s)}))})},"ee"),X$e=["data"],Z$e=o(function(e){var t,n=e.bar,r=n.data,a=Sc(n,X$e),i=e.style,s=i.borderColor,l=i.color,d=i.height,c=i.labelColor,h=i.labelOpacity,m=i.labelX,g=i.labelY,x=i.transform,w=i.width,S=i.textAnchor,_=e.borderRadius,C=e.borderWidth,E=e.label,O=e.shouldRenderLabel,j=e.isInteractive,k=e.onClick,A=e.onMouseEnter,T=e.onMouseLeave,P=e.tooltip,D=e.isFocusable,N=e.ariaLabel,I=e.ariaLabelledBy,F=e.ariaDescribedBy,L=e.ariaDisabled,q=e.ariaHidden,U=Or(),$=Gne(),H=$.showTooltipFromEvent,z=$.showTooltipAt,W=$.hideTooltip,V=y.useMemo((function(){return function(){return y.createElement(P,fn({},a,r))}}),[P,a,r]),Q=y.useCallback((function(ne){k?.(fn({color:a.color},r),ne)}),[a,r,k]),K=y.useCallback((function(ne){return H(V(),ne)}),[H,V]),Y=y.useCallback((function(ne){A?.(r,ne),H(V(),ne)}),[r,A,H,V]),ee=y.useCallback((function(ne){T?.(r,ne),W()}),[r,W,T]),te=y.useCallback((function(){z(V(),[a.absX+a.width/2,a.absY])}),[z,V,a]),oe=y.useCallback((function(){W()}),[W]);return p.jsxs(ar.g,{transform:x,children:[p.jsx(ar.rect,{width:wM(w,(function(ne){return Math.max(ne,0)})),height:wM(d,(function(ne){return Math.max(ne,0)})),rx:_,ry:_,fill:(t=r.fill)!=null?t:l,strokeWidth:C,stroke:s,focusable:D,tabIndex:D?0:void 0,"aria-label":N?N(r):void 0,"aria-labelledby":I?I(r):void 0,"aria-describedby":F?F(r):void 0,"aria-disabled":L?L(r):void 0,"aria-hidden":q?q(r):void 0,onMouseEnter:j?Y:void 0,onMouseMove:j?K:void 0,onMouseLeave:j?ee:void 0,onClick:j?Q:void 0,onFocus:j&&D?te:void 0,onBlur:j&&D?oe:void 0,"data-testid":"bar.item."+r.id+"."+r.index}),O&&p.jsx(x_,{x:m,y:g,textAnchor:S,dominantBaseline:"central",fillOpacity:h,style:fn({},U.labels.text,{pointerEvents:"none",fill:c}),children:E})]})},"ae"),J$e=["color","label"],e9e=o(function(e){var t=e.color,n=e.label,r=Sc(e,J$e);return p.jsx(x6e,{id:n,value:r.formattedValue,enableChip:!0,color:t})},"ne"),Mn={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",valueScale:{type:"linear",nice:!0,round:!1},indexScale:{type:"band",round:!1},padding:.1,innerPadding:0,enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelPosition:"middle",labelOffset:0,labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:e9e,tooltipLabel:o(function(e){return e.id+" - "+e.indexValue},"tooltipLabel"),legends:[],initialHiddenIds:[],annotations:[],enableTotals:!1,totalsOffset:10},Pn=fn({},Mn,{layers:["grid","axes","bars","totals","markers","legends","annotations"],axisTop:null,axisRight:null,axisBottom:{},axisLeft:{},barComponent:Z$e,defs:[],fill:[],markers:[],animate:!0,animateOnMount:!1,motionConfig:"default",role:"img",isFocusable:!1}),lr=fn({},Mn,{layers:["grid","axes","bars","totals","legends","annotations"],axisTop:null,axisRight:null,axisBottom:{},axisLeft:{},renderBar:o(function(e,t){var n=t.bar,r=n.color,a=n.height,i=n.width,s=n.x,l=n.y,d=t.borderColor,c=t.borderRadius,h=t.borderWidth,m=t.label,g=t.shouldRenderLabel,x=t.labelStyle,w=t.labelX,S=t.labelY,_=t.textAnchor;e.fillStyle=r,h>0&&(e.strokeStyle=d,e.lineWidth=h),e.beginPath(),Y$e(e,s,l,i,a,Math.min(c,a)),e.fill(),h>0&&e.stroke(),g&&(e.textBaseline="middle",e.textAlign=_==="middle"?"center":_,gg(e,x,m,s+w,l+S))},"renderBar"),pixelRatio:typeof window<"u"&&(IV=window.devicePixelRatio)!=null?IV:1}),xae=o(function(e,t,n,r,a,i){return s3(r,{all:e.map(t),min:0,max:0},a,i).padding(n)},"de"),wae=o(function(e,t){return e.map((function(n){return fn({},t.reduce((function(r,a){return r[a]=null,r}),{}),n)}))},"ue"),w_=o(function(e){return Object.keys(e).reduce((function(t,n){return e[n]&&(t[n]=e[n]),t}),{})},"se"),__=o(function(e){return[e,Number(e)]},"ce");function _ae(e,t,n,r){return e===void 0&&(e=Mn.layout),n===void 0&&(n=Mn.labelPosition),r===void 0&&(r=Mn.labelOffset),function(a,i){var s=r*(t?-1:1);if(e==="horizontal"){var l=a/2;return n==="start"?l=t?a:0:n==="end"&&(l=t?0:a),{labelX:l+s,labelY:i/2,textAnchor:n==="middle"?"middle":t?"end":"start"}}var d=i/2;return n==="start"?d=t?0:i:n==="end"&&(d=t?i:0),{labelX:a/2,labelY:d-s,textAnchor:"middle"}}}o(_ae,"he");var t9e=["layout","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],c3=o(function(e,t){return e>t},"be"),Sae=o(function(e,t){return e<t},"ge"),Eae=o(function(e,t){return Array.from(" ".repeat(t-e),(function(n,r){return e+r}))},"ve"),n9e=o(function(e){return c3(e,0)?0:e},"me"),r9e=o(function(e,t,n,r){var a=e.data,i=e.formatValue,s=e.getColor,l=e.getIndex,d=e.getTooltipLabel,c=e.innerPadding,h=c===void 0?0:c,m=e.keys,g=e.xScale,x=e.yScale,w=e.margin,S=n?Sae:c3,_=a.map(w_),C=[];return m.forEach((function(E,O){return Eae(0,g.domain().length).forEach((function(j){var k,A,T,P=__(a[j][E]),D=P[0],N=P[1],I=l(a[j]),F=((k=g(I))!=null?k:0)+t*O+h*O,L=S(A=N,0)?(T=x(A))!=null?T:0:r,q=(function($,H){var z;return S($,0)?r-H:((z=x($))!=null?z:0)-r})(N,L),U={id:E,value:D===null?D:N,formattedValue:i(N),hidden:!1,index:j,indexValue:I,data:_[j]};C.push({key:E+"."+U.indexValue,index:C.length,data:U,x:F,y:L,absX:w.left+F,absY:w.top+L,width:t,height:q,color:s(U),label:d(U)})}))})),C},"pe"),a9e=o(function(e,t,n,r){var a=e.data,i=e.formatValue,s=e.getIndex,l=e.getColor,d=e.getTooltipLabel,c=e.keys,h=e.innerPadding,m=h===void 0?0:h,g=e.xScale,x=e.yScale,w=e.margin,S=n?Sae:c3,_=a.map(w_),C=[];return c.forEach((function(E,O){return Eae(0,x.domain().length).forEach((function(j){var k,A,T,P=__(a[j][E]),D=P[0],N=P[1],I=s(a[j]),F=S(A=N,0)?r:(T=g(A))!=null?T:0,L=((k=x(I))!=null?k:0)+t*O+m*O,q=(function($,H){var z;return S($,0)?((z=g($))!=null?z:0)-r:r-H})(N,F),U={id:E,value:D===null?D:N,formattedValue:i(N),hidden:!1,index:j,indexValue:I,data:_[j]};C.push({key:E+"."+U.indexValue,index:C.length,data:U,x:F,y:L,absX:w.left+F,absY:w.top+L,width:q,height:t,color:l(U),label:d(U)})}))})),C},"ye"),i9e=o(function(e){var t,n,r,a=e.layout,i=e.width,s=e.height,l=e.padding,d=l===void 0?0:l,c=e.innerPadding,h=c===void 0?0:c,m=e.valueScale,g=e.indexScale,x=e.hiddenIds,w=x===void 0?[]:x,S=Sc(e,t9e),_=S.keys.filter((function(H){return!w.includes(H)})),C=wae(S.data,_),E=a==="vertical"?["y","x",i]:["x","y",s],O=E[0],j=E[1],k=E[2],A=xae(C,S.getIndex,d,g,k,j),T=m.min==="auto"?n9e:function(H){return H},P=C.reduce((function(H,z){return[].concat(H,_.map((function(W){return z[W]})))}),[]).filter(Boolean),D=T(Math.min.apply(Math,P)),N=(r=Math.max.apply(Math,P),isFinite(r)?r:0),I=s3(m,{all:P,min:D,max:N},O==="x"?i:s,O),F=a==="vertical"?[A,I]:[I,A],L=F[0],q=F[1],U=(A.bandwidth()-h*(_.length-1))/_.length,$=[fn({},S,{data:C,keys:_,innerPadding:h,xScale:L,yScale:q}),U,(t=m.reverse)!=null&&t,(n=I(0))!=null?n:0];return{xScale:L,yScale:q,bars:U>0?a==="vertical"?r9e.apply(void 0,$):a9e.apply(void 0,$):[]}},"xe"),o9e=["data","layout","width","height","padding","valueScale","indexScale","hiddenIds"],Cae=o(function(e){var t;return e.some(Array.isArray)?Cae((t=[]).concat.apply(t,e)):e},"ke"),s9e=o(function(e,t,n){var r=e.formatValue,a=e.getColor,i=e.getIndex,s=e.getTooltipLabel,l=e.innerPadding,d=e.stackedData,c=e.xScale,h=e.yScale,m=e.margin,g=[];return d.forEach((function(x){return c.domain().forEach((function(w,S){var _,C,E=x[S],O=(_=c(i(E.data)))!=null?_:0,j=((C=(function(N){return h(N[n?0:1])})(E))!=null?C:0)+.5*l,k=(function(N,I){var F;return((F=h(N[n?1:0]))!=null?F:0)-I})(E,j)-l,A=__(E.data[x.key]),T=A[0],P=A[1],D={id:x.key,value:T===null?T:P,formattedValue:r(P),hidden:!1,index:S,indexValue:w,data:w_(E.data)};g.push({key:x.key+"."+w,index:g.length,data:D,x:O,y:j,absX:m.left+O,absY:m.top+j,width:t,height:k,color:a(D),label:s(D)})}))})),g},"we"),l9e=o(function(e,t,n){var r=e.formatValue,a=e.getColor,i=e.getIndex,s=e.getTooltipLabel,l=e.innerPadding,d=e.stackedData,c=e.xScale,h=e.yScale,m=e.margin,g=[];return d.forEach((function(x){return h.domain().forEach((function(w,S){var _,C,E=x[S],O=(_=h(i(E.data)))!=null?_:0,j=((C=(function(N){return c(N[n?1:0])})(E))!=null?C:0)+.5*l,k=(function(N,I){var F;return((F=c(N[n?0:1]))!=null?F:0)-I})(E,j)-l,A=__(E.data[x.key]),T=A[0],P=A[1],D={id:x.key,value:T===null?T:P,formattedValue:r(P),hidden:!1,index:S,indexValue:w,data:w_(E.data)};g.push({key:x.key+"."+w,index:g.length,data:D,x:j,y:O,absX:m.left+j,absY:m.top+O,width:k,height:t,color:a(D),label:s(D)})}))})),g},"Le"),c9e=o(function(e){var t,n,r=e.data,a=e.layout,i=e.width,s=e.height,l=e.padding,d=l===void 0?0:l,c=e.valueScale,h=e.indexScale,m=e.hiddenIds,g=m===void 0?[]:m,x=Sc(e,o9e),w=x.keys.filter((function(U){return!g.includes(U)})),S=M8e().keys(w).offset(D8e)(wae(r,w)),_=a==="vertical"?["y","x",i]:["x","y",s],C=_[0],E=_[1],O=_[2],j=xae(r,x.getIndex,d,h,O,E),k=(n=Cae(S),c.type==="log"?n.filter((function(U){return U!==0})):n),A=Math.min.apply(Math,k),T=Math.max.apply(Math,k),P=s3(c,{all:k,min:A,max:T},C==="x"?i:s,C),D=a==="vertical"?[j,P]:[P,j],N=D[0],I=D[1],F=x.innerPadding>0?x.innerPadding:0,L=j.bandwidth(),q=[fn({},x,{innerPadding:F,stackedData:S,xScale:N,yScale:I}),L,(t=c.reverse)!=null&&t];return{xScale:N,yScale:I,bars:L>0?a==="vertical"?s9e.apply(void 0,q):l9e.apply(void 0,q):[]}},"Ce"),u9e=o(function(e){var t=e.bars,n=e.direction,r=e.from,a=e.groupMode,i=e.layout,s=e.legendLabel,l=e.reverse,d=aae(s??(r==="indexes"?"indexValue":"id"));return r==="indexes"?(function(c,h,m){var g=cV(c.map((function(x){var w,S;return{id:(w=x.data.indexValue)!=null?w:"",label:m(x.data),hidden:x.data.hidden,color:(S=x.color)!=null?S:"#000"}})),(function(x){return x.id}));return h==="horizontal"&&g.reverse(),g})(t,i,d):(function(c,h,m,g,x,w){var S=cV(c.map((function(_){var C;return{id:_.data.id,label:w(_.data),hidden:_.data.hidden,color:(C=_.color)!=null?C:"#000"}})),(function(_){return _.id}));return(h==="vertical"&&g==="stacked"&&m==="column"&&x!==!0||h==="horizontal"&&g==="stacked"&&x===!0)&&S.reverse(),S})(t,i,n,a,l,d)},"We"),FV=o(function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},"Me"),d9e=o(function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},"Be"),f9e=o(function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},"Re"),h9e=o(function(e,t){var n=e.get(t)||0;e.set(t,n+1)},"Oe"),jae=o(function(e){var t,n=e.indexBy,r=n===void 0?Mn.indexBy:n,a=e.keys,i=a===void 0?Mn.keys:a,s=e.label,l=s===void 0?Mn.label:s,d=e.tooltipLabel,c=d===void 0?Mn.tooltipLabel:d,h=e.valueFormat,m=e.colors,g=m===void 0?Mn.colors:m,x=e.colorBy,w=x===void 0?Mn.colorBy:x,S=e.borderColor,_=S===void 0?Mn.borderColor:S,C=e.labelTextColor,E=C===void 0?Mn.labelTextColor:C,O=e.groupMode,j=O===void 0?Mn.groupMode:O,k=e.layout,A=k===void 0?Mn.layout:k,T=e.data,P=e.margin,D=e.width,N=e.height,I=e.padding,F=I===void 0?Mn.padding:I,L=e.innerPadding,q=L===void 0?Mn.innerPadding:L,U=e.valueScale,$=U===void 0?Mn.valueScale:U,H=e.indexScale,z=H===void 0?Mn.indexScale:H,W=e.initialHiddenIds,V=W===void 0?Mn.initialHiddenIds:W,Q=e.enableLabel,K=Q===void 0?Mn.enableLabel:Q,Y=e.labelSkipWidth,ee=Y===void 0?Mn.labelSkipWidth:Y,te=e.labelSkipHeight,oe=te===void 0?Mn.labelSkipHeight:te,ne=e.legends,fe=ne===void 0?Mn.legends:ne,re=e.legendLabel,ce=e.totalsOffset,he=ce===void 0?Mn.totalsOffset:ce,J=y.useState(V??[]),Ne=J[0],we=J[1],Ee=y.useCallback((function(We){we((function(pt){return pt.indexOf(We)>-1?pt.filter((function(ge){return ge!==We})):[].concat(pt,[We])}))}),[]),Ae=bT(r),Re=bT(l),Pe=bT(c),ze=o3(h),X=Or(),se=I$e(g,w),me=NV(_,X),ke=NV(E,X),de=(j==="grouped"?i9e:c9e)({layout:A,data:T,getIndex:Ae,keys:i,width:D,height:N,getColor:se,padding:F,innerPadding:q,valueScale:$,indexScale:z,hiddenIds:Ne,formatValue:ze,getTooltipLabel:Pe,margin:P}),ue=de.bars,Te=de.xScale,Me=de.yScale,Fe=y.useMemo((function(){return ue.filter((function(We){return We.data.value!==null})).map((function(We,pt){return fn({},We,{index:pt})}))}),[ue]),Xe=y.useCallback((function(We){var pt=We.width,ge=We.height;return!!K&&!(ee>0&&pt<ee)&&!(oe>0&&ge<oe)}),[K,ee,oe]),Pt=y.useMemo((function(){return i.map((function(We){var pt=ue.find((function(ge){return ge.data.id===We}));return fn({},pt,{data:fn({id:We},pt?.data,{hidden:Ne.includes(We)})})}))}),[Ne,i,ue]),$t=(t=$.reverse)!=null&&t,At=y.useMemo((function(){return fe.map((function(We){return[We,u9e({bars:We.dataFrom==="keys"?Pt:ue,direction:We.direction,from:We.dataFrom,groupMode:j,layout:A,legendLabel:re,reverse:$t})]}))}),[fe,Pt,ue,j,A,re,$t]),qt=y.useMemo((function(){return(function(We,pt,ge,ye,ct,Le,Ke){ye===void 0&&(ye=Mn.layout),ct===void 0&&(ct=Mn.groupMode);var Ve=[];if(We.length===0)return Ve;var Ze=new Map,Et=We[0].width,Ge=We[0].height;if(ct==="stacked"){var mt=new Map;We.forEach((function(Tt){var wt=Tt.data,vt=wt.indexValue,jt=wt.value;FV(Ze,vt,Number(jt)),d9e(mt,vt,Number(jt))})),mt.forEach((function(Tt,wt){var vt,jt,Z,pe=Ze.get(wt)||0;ye==="vertical"?(vt=pt(wt),jt=ge(Tt),Z=ge(Tt/2)):(vt=pt(Tt),jt=ge(wt),Z=pt(Tt/2)),vt+=ye==="vertical"?Et/2:Le,jt+=ye==="vertical"?-Le:Ge/2,Ve.push({key:"total_"+wt,x:vt,y:jt,value:pe,formattedValue:Ke(pe),animationOffset:Z})}))}else if(ct==="grouped"){var Ft=new Map,Mt=new Map;We.forEach((function(Tt){var wt=Tt.data,vt=wt.indexValue,jt=wt.value;FV(Ze,vt,Number(jt)),f9e(Ft,vt,Number(jt)),h9e(Mt,vt)})),Ft.forEach((function(Tt,wt){var vt,jt,Z,pe=Ze.get(wt)||0,_e=Mt.get(wt);ye==="vertical"?(vt=pt(wt),jt=ge(Tt),Z=ge(Tt/2)):(vt=pt(Tt),jt=ge(wt),Z=pt(Tt/2)),vt+=ye==="vertical"?_e*Et/2:Le,jt+=ye==="vertical"?-Le:_e*Ge/2,Ve.push({key:"total_"+wt,x:vt,y:jt,value:pe,formattedValue:Ke(pe),animationOffset:Z})}))}return Ve})(ue,Te,Me,A,j,he,ze)}),[ue,Te,Me,A,j,he,ze]);return{bars:ue,barsWithValue:Fe,xScale:Te,yScale:Me,getIndex:Ae,getLabel:Re,getTooltipLabel:Pe,formatValue:ze,getColor:se,getBorderColor:me,getLabelColor:ke,shouldRenderBarLabel:Xe,hiddenIds:Ne,toggleSerie:Ee,legendsWithData:At,barTotals:qt}},"Ie"),p9e=o(function(e){var t=e.data,n=e.springConfig,r=e.animate,a=e.layout,i=a===void 0?Pn.layout:a,s=Or();return I1(t,{keys:o(function(l){return l.key},"keys"),from:o(function(l){return{x:i==="vertical"?l.x:l.animationOffset,y:i==="vertical"?l.animationOffset:l.y,labelOpacity:0}},"from"),enter:o(function(l){return{x:l.x,y:l.y,labelOpacity:1}},"enter"),update:o(function(l){return{x:l.x,y:l.y,labelOpacity:1}},"update"),leave:o(function(l){return{x:i==="vertical"?l.x:l.animationOffset,y:i==="vertical"?l.animationOffset:l.y,labelOpacity:0}},"leave"),config:n,immediate:!r,initial:r?void 0:null})((function(l,d){return p.jsx(ar.text,{x:l.x,y:l.y,fillOpacity:l.labelOpacity,style:fn({},s.labels.text,{pointerEvents:"none"}),fontWeight:"bold",fontSize:s.labels.text.fontSize,fontFamily:s.labels.text.fontFamily,textAnchor:i==="vertical"?"middle":"start",alignmentBaseline:i==="vertical"?"alphabetic":"middle",children:d.formattedValue},d.key)}))},"Ve"),m9e=["isInteractive","animate","motionConfig","theme","renderWrapper"],v9e=o(function(e){var t,n=e.data,r=e.indexBy,a=e.keys,i=e.margin,s=e.width,l=e.height,d=e.groupMode,c=e.layout,h=e.valueScale,m=e.indexScale,g=e.padding,x=e.innerPadding,w=e.axisTop,S=e.axisRight,_=e.axisBottom,C=_===void 0?Pn.axisBottom:_,E=e.axisLeft,O=E===void 0?Pn.axisLeft:E,j=e.enableGridX,k=j===void 0?Pn.enableGridX:j,A=e.enableGridY,T=A===void 0?Pn.enableGridY:A,P=e.gridXValues,D=e.gridYValues,N=e.layers,I=N===void 0?Pn.layers:N,F=e.barComponent,L=F===void 0?Pn.barComponent:F,q=e.enableLabel,U=q===void 0?Pn.enableLabel:q,$=e.label,H=e.labelSkipWidth,z=H===void 0?Pn.labelSkipWidth:H,W=e.labelSkipHeight,V=W===void 0?Pn.labelSkipHeight:W,Q=e.labelTextColor,K=e.labelPosition,Y=K===void 0?Pn.labelPosition:K,ee=e.labelOffset,te=ee===void 0?Pn.labelOffset:ee,oe=e.markers,ne=oe===void 0?Pn.markers:oe,fe=e.colorBy,re=e.colors,ce=e.defs,he=ce===void 0?Pn.defs:ce,J=e.fill,Ne=J===void 0?Pn.fill:J,we=e.borderRadius,Ee=we===void 0?Pn.borderRadius:we,Ae=e.borderWidth,Re=Ae===void 0?Pn.borderWidth:Ae,Pe=e.borderColor,ze=e.annotations,X=ze===void 0?Pn.annotations:ze,se=e.legendLabel,me=e.tooltipLabel,ke=e.valueFormat,de=e.isInteractive,ue=de===void 0?Pn.isInteractive:de,Te=e.tooltip,Me=Te===void 0?Pn.tooltip:Te,Fe=e.onClick,Xe=e.onMouseEnter,Pt=e.onMouseLeave,$t=e.legends,At=e.role,qt=At===void 0?Pn.role:At,We=e.ariaLabel,pt=e.ariaLabelledBy,ge=e.ariaDescribedBy,ye=e.isFocusable,ct=ye===void 0?Pn.isFocusable:ye,Le=e.barAriaLabel,Ke=e.barAriaLabelledBy,Ve=e.barAriaDescribedBy,Ze=e.barAriaHidden,Et=e.barAriaDisabled,Ge=e.initialHiddenIds,mt=e.enableTotals,Ft=mt===void 0?Pn.enableTotals:mt,Mt=e.totalsOffset,Tt=Mt===void 0?Pn.totalsOffset:Mt,wt=e.forwardedRef,vt=oo(),jt=vt.animate,Z=vt.config,pe=rae(s,l,i),_e=pe.outerWidth,$e=pe.outerHeight,Be=pe.margin,tt=pe.innerWidth,et=pe.innerHeight,Ye=jae({indexBy:r,label:$,tooltipLabel:me,valueFormat:ke,colors:re,colorBy:fe,borderColor:Pe,labelTextColor:Q,groupMode:d,layout:c,data:n,keys:a,margin:Be,width:tt,height:et,padding:g,innerPadding:x,valueScale:h,indexScale:m,enableLabel:U,labelSkipWidth:z,labelSkipHeight:V,legends:$t,legendLabel:se,initialHiddenIds:Ge,totalsOffset:Tt}),it=Ye.bars,ut=Ye.barsWithValue,st=Ye.xScale,lt=Ye.yScale,gt=Ye.getLabel,nt=Ye.getTooltipLabel,Rt=Ye.getBorderColor,bt=Ye.getLabelColor,Lt=Ye.shouldRenderBarLabel,Nt=Ye.toggleSerie,Ar=Ye.legendsWithData,ma=Ye.barTotals,ei=Ye.getColor,Jn=_ae(c,(t=h?.reverse)!=null&&t,Y,te),so=I1(ut,{keys:o(function(He){return He.key},"keys"),from:o(function(He){return fn({borderColor:Rt(He),color:He.color,height:0,labelColor:bt(He),labelOpacity:0},Jn(He.width,He.height),{transform:"translate("+He.x+", "+(He.y+He.height)+")",width:He.width},c==="vertical"?{}:{height:He.height,transform:"translate("+He.x+", "+He.y+")",width:0})},"from"),enter:o(function(He){return fn({borderColor:Rt(He),color:He.color,height:He.height,labelColor:bt(He),labelOpacity:1},Jn(He.width,He.height),{transform:"translate("+He.x+", "+He.y+")",width:He.width})},"enter"),update:o(function(He){return fn({borderColor:Rt(He),color:He.color,height:He.height,labelColor:bt(He),labelOpacity:1},Jn(He.width,He.height),{transform:"translate("+He.x+", "+He.y+")",width:He.width})},"update"),leave:o(function(He){return fn({borderColor:Rt(He),color:He.color,height:0,labelColor:bt(He),labelOpacity:0},Jn(He.width,He.height),{labelY:0,transform:"translate("+He.x+", "+(He.y+He.height)+")",width:He.width},c==="vertical"?{}:fn({},Jn(He.width,He.height),{labelX:0,height:He.height,transform:"translate("+He.x+", "+He.y+")",width:0}))},"leave"),config:Z,immediate:!jt,initial:jt?void 0:null}),Tr=y.useMemo((function(){return{borderRadius:Ee,borderWidth:Re,enableLabel:U,isInteractive:ue,labelSkipWidth:z,labelSkipHeight:V,onClick:Fe,onMouseEnter:Xe,onMouseLeave:Pt,getTooltipLabel:nt,tooltip:Me,isFocusable:ct,ariaLabel:Le,ariaLabelledBy:Ke,ariaDescribedBy:Ve,ariaHidden:Ze,ariaDisabled:Et}}),[Ee,Re,U,nt,ue,V,z,Fe,Xe,Pt,Me,ct,Le,Ke,Ve,Ze,Et]),Na=h7e(he,it,Ne,{dataKey:"data",targetKey:"data.fill"}),zr={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};I.includes("annotations")&&(zr.annotations=p.jsx(K$e,{bars:it,annotations:X},"annotations")),I.includes("axes")&&(zr.axes=p.jsx(G7e,{xScale:st,yScale:lt,width:tt,height:et,top:w,right:S,bottom:C,left:O},"axes")),I.includes("bars")&&(zr.bars=p.jsx(y.Fragment,{children:so((function(He,Nn){return y.createElement(L,fn({},Tr,{bar:Nn,style:He,shouldRenderLabel:Lt(Nn),label:gt(Nn.data)}))}))},"bars")),I.includes("grid")&&(zr.grid=p.jsx(K7e,{width:tt,height:et,xScale:k?st:null,yScale:T?lt:null,xValues:P,yValues:D},"grid")),I.includes("legends")&&(zr.legends=p.jsx(Q$e,{width:tt,height:et,legends:Ar,toggleSerie:Nt},"legends")),I.includes("markers")&&(zr.markers=p.jsx(r7e,{markers:ne,width:tt,height:et,xScale:st,yScale:lt},"markers")),I.includes("totals")&&Ft&&(zr.totals=p.jsx(p9e,{data:ma,springConfig:Z,animate:jt,layout:c},"totals"));var Ia=fn({},Tr,{margin:Be,width:s,height:l,innerWidth:tt,innerHeight:et,bars:it,legendData:Ar,enableLabel:U,xScale:st,yScale:lt,tooltip:Me,getTooltipLabel:nt,onClick:Fe,onMouseEnter:Xe,onMouseLeave:Pt,getColor:ei});return p.jsx(e7e,{width:_e,height:$e,margin:Be,defs:Na,role:qt,ariaLabel:We,ariaLabelledBy:pt,ariaDescribedBy:ge,isFocusable:ct,ref:wt,children:I.map((function(He,Nn){var Ri;return typeof He=="function"?p.jsx(y.Fragment,{children:y.createElement(He,Ia)},Nn):(Ri=zr?.[He])!=null?Ri:null}))})},"He"),g9e=y.forwardRef((function(e,t){var n=e.isInteractive,r=n===void 0?Pn.isInteractive:n,a=e.animate,i=a===void 0?Pn.animate:a,s=e.motionConfig,l=s===void 0?Pn.motionConfig:s,d=e.theme,c=e.renderWrapper,h=Sc(e,m9e);return p.jsx(Zre,{animate:i,isInteractive:r,motionConfig:l,renderWrapper:c,theme:d,children:p.jsx(v9e,fn({},h,{isInteractive:r,forwardedRef:t}))})})),y9e=["isInteractive","renderWrapper","theme"],BT=o(function(e,t,n,r){return e.find((function(a){return c7e(a.x+t.left,a.y+t.top,a.width,a.height,n,r)}))},"Fe"),b9e=o(function(e){var t,n=e.data,r=e.indexBy,a=e.keys,i=e.margin,s=e.width,l=e.height,d=e.groupMode,c=e.layout,h=e.valueScale,m=e.indexScale,g=e.padding,x=e.innerPadding,w=e.axisTop,S=e.axisRight,_=e.axisBottom,C=_===void 0?lr.axisBottom:_,E=e.axisLeft,O=E===void 0?lr.axisLeft:E,j=e.enableGridX,k=j===void 0?lr.enableGridX:j,A=e.enableGridY,T=A===void 0?lr.enableGridY:A,P=e.gridXValues,D=e.gridYValues,N=e.labelPosition,I=N===void 0?lr.labelPosition:N,F=e.labelOffset,L=F===void 0?lr.labelOffset:F,q=e.layers,U=q===void 0?lr.layers:q,$=e.renderBar,H=$===void 0?lr.renderBar:$,z=e.enableLabel,W=z===void 0?lr.enableLabel:z,V=e.label,Q=e.labelSkipWidth,K=Q===void 0?lr.labelSkipWidth:Q,Y=e.labelSkipHeight,ee=Y===void 0?lr.labelSkipHeight:Y,te=e.labelTextColor,oe=e.colorBy,ne=e.colors,fe=e.borderRadius,re=fe===void 0?lr.borderRadius:fe,ce=e.borderWidth,he=ce===void 0?lr.borderWidth:ce,J=e.borderColor,Ne=e.annotations,we=Ne===void 0?lr.annotations:Ne,Ee=e.legendLabel,Ae=e.tooltipLabel,Re=e.valueFormat,Pe=e.isInteractive,ze=Pe===void 0?lr.isInteractive:Pe,X=e.tooltip,se=X===void 0?lr.tooltip:X,me=e.onClick,ke=e.onMouseEnter,de=e.onMouseLeave,ue=e.legends,Te=e.pixelRatio,Me=Te===void 0?lr.pixelRatio:Te,Fe=e.role,Xe=e.forwardedRef,Pt=e.enableTotals,$t=Pt===void 0?lr.enableTotals:Pt,At=e.totalsOffset,qt=At===void 0?lr.totalsOffset:At,We=y.useRef(null),pt=Or(),ge=rae(s,l,i),ye=ge.margin,ct=ge.innerWidth,Le=ge.innerHeight,Ke=ge.outerWidth,Ve=ge.outerHeight,Ze=jae({indexBy:r,label:V,tooltipLabel:Ae,valueFormat:Re,colors:ne,colorBy:oe,borderColor:J,labelTextColor:te,groupMode:d,layout:c,data:n,keys:a,margin:ye,width:ct,height:Le,padding:g,innerPadding:x,valueScale:h,indexScale:m,enableLabel:W,labelSkipWidth:K,labelSkipHeight:ee,legends:ue,legendLabel:Ee,totalsOffset:qt}),Et=Ze.bars,Ge=Ze.barsWithValue,mt=Ze.xScale,Ft=Ze.yScale,Mt=Ze.getLabel,Tt=Ze.getTooltipLabel,wt=Ze.getBorderColor,vt=Ze.getLabelColor,jt=Ze.shouldRenderBarLabel,Z=Ze.legendsWithData,pe=Ze.barTotals,_e=Ze.getColor,$e=Gne(),Be=$e.showTooltipFromEvent,tt=$e.hideTooltip,et=p$e({annotations:pae({data:Et,annotations:we,getPosition:o(function(nt){return{x:nt.x,y:nt.y}},"getPosition"),getDimensions:o(function(nt){var Rt=nt.width,bt=nt.height;return{width:Rt,height:bt,size:Math.max(Rt,bt)}},"getDimensions")})}),Ye=y.useMemo((function(){return{borderRadius:re,borderWidth:he,isInteractive:ze,isFocusable:!1,labelSkipWidth:K,labelSkipHeight:ee,margin:ye,width:s,height:l,innerWidth:ct,innerHeight:Le,bars:Et,legendData:Z,enableLabel:W,xScale:mt,yScale:Ft,tooltip:se,getTooltipLabel:Tt,onClick:me,onMouseEnter:ke,onMouseLeave:de,getColor:_e}}),[re,he,ze,K,ee,ye,s,l,ct,Le,Et,Z,W,mt,Ft,se,Tt,me,ke,de,_e]),it=o3(Re),ut=_ae(c,(t=h?.reverse)!=null&&t,I,L);y.useEffect((function(){if(We.current){We.current.width=Ke*Me,We.current.height=Ve*Me;var nt=We.current.getContext("2d");nt.scale(Me,Me),nt.fillStyle=pt.background,nt.fillRect(0,0,Ke,Ve),nt.translate(ye.left,ye.top),U.forEach((function(Rt){Rt==="grid"?typeof pt.grid.line.strokeWidth=="number"&&pt.grid.line.strokeWidth>0&&(nt.lineWidth=pt.grid.line.strokeWidth,nt.strokeStyle=pt.grid.line.stroke,k&&_V(nt,{width:ct,height:Le,scale:mt,axis:"x",values:P}),T&&_V(nt,{width:ct,height:Le,scale:Ft,axis:"y",values:D})):Rt==="axes"?X7e(nt,{xScale:mt,yScale:Ft,width:ct,height:Le,top:w,right:S,bottom:C,left:O,theme:pt}):Rt==="bars"?(vg(nt,pt.text),Ge.forEach((function(bt){H(nt,fn({bar:bt,borderColor:wt(bt),borderRadius:re,borderWidth:he,label:Mt(bt.data),shouldRenderLabel:jt(bt),labelStyle:fn({},pt.labels.text,{fill:vt(bt)})},ut(bt.width,bt.height)))}))):Rt==="legends"?Z.forEach((function(bt){var Lt=bt[0],Nt=bt[1];G$e(nt,fn({},Lt,{data:Nt,containerWidth:ct,containerHeight:Le,theme:pt}))})):Rt==="annotations"?w$e(nt,{annotations:et,theme:pt}):Rt==="totals"&&$t?(function(bt,Lt,Nt,Ar){Ar===void 0&&(Ar=lr.layout),vg(bt,Nt.labels.text),bt.textBaseline=Ar==="vertical"?"alphabetic":"middle",bt.textAlign=Ar==="vertical"?"center":"start",Lt.forEach((function(ma){gg(bt,Nt.labels.text,ma.formattedValue,ma.x,ma.y)}))})(nt,pe,pt,c):typeof Rt=="function"&&Rt(nt,Ye)})),nt.save()}}),[C,O,S,w,Ge,re,he,et,k,T,wt,Mt,vt,P,D,d,l,Le,ct,Ye,U,c,Z,ye.left,ye.top,Ve,Ke,Me,H,mt,Ft,jt,pt,s,pe,$t,it,ut]);var st=y.useCallback((function(nt){if(Et&&We.current){var Rt=xT(We.current,nt),bt=Rt[0],Lt=Rt[1],Nt=BT(Et,ye,bt,Lt);Nt!==void 0?(Be(y.createElement(se,fn({},Nt.data,{color:Nt.color,label:Nt.label,value:Number(Nt.data.value)})),nt),nt.type==="mouseenter"&&ke?.(Nt.data,nt)):tt()}}),[tt,ye,ke,Et,Be,se]),lt=y.useCallback((function(nt){if(Et&&We.current){tt();var Rt=xT(We.current,nt),bt=Rt[0],Lt=Rt[1],Nt=BT(Et,ye,bt,Lt);Nt&&de?.(Nt.data,nt)}}),[tt,ye,de,Et]),gt=y.useCallback((function(nt){if(Et&&We.current){var Rt=xT(We.current,nt),bt=Rt[0],Lt=Rt[1],Nt=BT(Et,ye,bt,Lt);Nt!==void 0&&me?.(fn({},Nt.data,{color:Nt.color}),nt)}}),[ye,me,Et]);return p.jsx("canvas",{ref:p7e(We,Xe),width:Ke*Me,height:Ve*Me,style:{width:Ke,height:Ve,cursor:ze?"auto":"normal"},onMouseEnter:ze?st:void 0,onMouseMove:ze?st:void 0,onMouseLeave:ze?lt:void 0,onClick:ze?gt:void 0,role:Fe})},"ze"),x9e=y.forwardRef((function(e,t){var n=e.isInteractive,r=e.renderWrapper,a=e.theme,i=Sc(e,y9e);return p.jsx(Zre,{isInteractive:n,renderWrapper:r,theme:a,animate:!1,children:p.jsx(b9e,fn({},i,{isInteractive:n,forwardedRef:t}))})})),w9e=["defaultWidth","defaultHeight","onResize","debounceResize"],_9e=y.forwardRef((function(e,t){var n=e.defaultWidth,r=e.defaultHeight,a=e.onResize,i=e.debounceResize,s=Sc(e,w9e);return p.jsx(Jre,{defaultWidth:n,defaultHeight:r,onResize:a,debounceResize:i,children:o(function(l){var d=l.width,c=l.height;return p.jsx(g9e,fn({},s,{width:d,height:c,ref:t}))},"children")})})),S9e=["defaultWidth","defaultHeight","onResize","debounceResize"];y.forwardRef((function(e,t){var n=e.defaultWidth,r=e.defaultHeight,a=e.onResize,i=e.debounceResize,s=Sc(e,S9e);return p.jsx(Jre,{defaultWidth:n,defaultHeight:r,onResize:a,debounceResize:i,children:o(function(l){var d=l.width,c=l.height;return p.jsx(x9e,fn({},s,{width:d,height:c,ref:t}))},"children")})}));const E9e={opportunity:.2,"proposal-sent":.5,"in-negociation":.8,delayed:.3},C9e=new Date(new Date().setMonth(new Date().getMonth()-6)).toISOString(),LV="en-US",j9e="USD",O9e=y.memo(()=>{const e=navigator?navigator.languages||[navigator.language]:[LV],{data:t,isPending:n}=Qa("deals",{pagination:{perPage:100,page:1},sort:{field:"created_at",order:"ASC"},filter:{"created_at@gte":C9e}}),r=y.useMemo(()=>{if(!t)return[];const i=t.reduce((l,d)=>{const c=qk(d.created_at??new Date).toISOString();return l[c]||(l[c]=[]),l[c].push(d),l},{});return Object.keys(i).map(l=>({date:mK(l,"MMM"),won:i[l].filter(d=>d.stage==="won").reduce((d,c)=>(d+=c.amount,d),0),pending:i[l].filter(d=>!["won","lost"].includes(d.stage)).reduce((d,c)=>(d+=c.amount*E9e[c.stage],d),0),lost:i[l].filter(d=>d.stage==="lost").reduce((d,c)=>(d-=c.amount,d),0)}))},[t]);if(n)return null;const a=r.reduce((i,s)=>(i.min=Math.min(i.min,s.lost),i.max=Math.max(i.max,s.won+s.pending),i),{min:0,max:0});return p.jsxs("div",{className:"flex flex-col",children:[p.jsxs("div",{className:"flex items-center mb-4",children:[p.jsx("div",{className:"mr-3 flex",children:p.jsx(KK,{className:"text-muted-foreground w-6 h-6"})}),p.jsx("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Upcoming Deal Revenue"})]}),p.jsx("div",{className:"h-[400px]",children:p.jsx(_9e,{data:r,indexBy:"date",keys:["won","pending","lost"],colors:["#61cdbb","#97e3d5","#e25c3b"],margin:{top:30,right:50,bottom:30,left:0},padding:.3,valueScale:{type:"linear",min:a.min*1.2,max:a.max*1.2},indexScale:{type:"band",round:!0},enableGridX:!0,enableGridY:!1,enableLabel:!1,tooltip:o(({value:i,indexValue:s})=>p.jsxs("div",{className:"p-2 bg-secondary rounded shadow inline-flex items-center gap-1 text-secondary-foreground",children:[p.jsxs("strong",{children:[s,": "]})," ",i>0?"+":"",i.toLocaleString(e.at(0)??LV,{style:"currency",currency:j9e})]}),"tooltip"),axisTop:{tickSize:0,tickPadding:12,style:{ticks:{text:{fill:"var(--color-muted-foreground)"}},legend:{text:{fill:"var(--color-muted-foreground)"}}}},axisBottom:{legendPosition:"middle",legendOffset:50,tickSize:0,tickPadding:12,style:{ticks:{text:{fill:"var(--color-muted-foreground)"}},legend:{text:{fill:"var(--color-muted-foreground)"}}}},axisLeft:null,axisRight:{format:o(i=>`${Math.abs(i/1e3)}k`,"format"),tickValues:8,style:{ticks:{text:{fill:"var(--color-muted-foreground)"}},legend:{text:{fill:"var(--color-muted-foreground)"}}}},markers:[{axis:"y",value:0,lineStyle:{strokeOpacity:0},textStyle:{fill:"#2ebca6"},legend:"Won",legendPosition:"top-left",legendOrientation:"vertical"},{axis:"y",value:0,lineStyle:{stroke:"#f47560",strokeWidth:1},textStyle:{fill:"#e25c3b"},legend:"Lost",legendPosition:"bottom-left",legendOrientation:"vertical"}]})})]})}),R9e=o(e=>{const t=St(),n=Ht(e),{filterValues:r,setFilters:a}=pw(e),i=Zu();if(!n)throw new Error("<ListNoResults> must be used inside a <List> component");return p.jsx("div",{className:"p-6",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:r&&a&&Object.keys(r).length>0?p.jsxs(p.Fragment,{children:[t("ra.navigation.no_filtered_results",{resource:n,name:i(n,0),_:"No results found with the current filters."})," ",p.jsx(ot,{variant:"outline",size:"sm",onClick:o(()=>a({},[]),"onClick"),children:t("ra.navigation.clear_filters",{_:"Clear filters"})})]}):t("ra.navigation.no_results",{resource:n,name:i(n,0),_:"No results found."})})})},"ListNoResults"),A9e=o(e=>{const{children:t,linkType:n,rowClick:r,style:a}=e,i=Ht(e),s=Wt(e),l=Ja(),d=typeof n=="function"||typeof r=="function",c=bG({link:d?!1:n??r,resource:i}),h=_G(),m=Ct(async()=>{if(!d||!s)return;const g=typeof n=="function"?n(s,s.id):typeof r=="function"?(w,S)=>r(w.id,S,w):!1,x=await h({record:s,resource:i,link:g});x===!1||x==null||l(x)});return s?d?p.jsx("li",{className:"w-full",children:p.jsx("button",{onClick:m,style:a,className:"w-full text-left hover:bg-muted focus: bg-muted focus:outline-none",children:t})}):c?p.jsx("li",{className:"w-full",children:p.jsx(Rn,{to:c,style:a,className:"block w-full hover:bg-muted focus:bg-muted focus:outline-none",children:t})}):p.jsx("li",{className:"w-full",children:t}):null},"SimpleListItem"),HT=o(({className:e})=>p.jsx("span",{className:Ce("bg-gray-300 flex",e),children:" "}),"ListPlaceholder"),T9e=o(e=>{const{className:t,hasLeftAvatarOrIcon:n,hasRightAvatarOrIcon:r,hasSecondaryText:a,hasTertiaryText:i,nbFakeLines:s=5,...l}=e;return ZG(1e3)?p.jsx("ul",{className:t,...l,children:k9e(s,c=>p.jsxs("li",{className:"flex items-center space-x-3 p-3",children:[n&&p.jsx("div",{className:"w-10 h-10 bg-gray-300 rounded-full flex-shrink-0",children:" "}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"mb-1",children:[p.jsx(HT,{className:"w-1/3 inline-block mb-1"}),i&&p.jsx("span",{className:"float-right opacity-55 min-w-[10vw]",children:p.jsx(HT,{})})]}),a&&p.jsx(HT,{className:"w-1/4"})]}),r&&p.jsx("div",{className:"w-10 h-10 bg-gray-300 rounded-full flex-shrink-0",children:" "})]},c))}):null},"SimpleListLoading"),k9e=o((e,t)=>Array.from({length:e},(n,r)=>t(r)),"times"),P9e=o(e=>{const{className:t,empty:n=D9e,leftAvatar:r,leftIcon:a,linkType:i,rowClick:s,primaryText:l,rightAvatar:d,rightIcon:c,secondaryText:h,tertiaryText:m,resource:g,...x}=e,{data:w,isPending:S,total:_}=pw(e);return S===!0?p.jsx(T9e,{className:t,hasLeftAvatarOrIcon:!!a||!!r,hasRightAvatarOrIcon:!!c||!!d,hasSecondaryText:!!h,hasTertiaryText:!!m}):w==null||w.length===0||_===0?n||null:p.jsx("ul",{className:t,...Spe(x),children:p.jsx(Tpe,{data:w,total:_,render:o((C,E)=>p.jsx(A9e,{rowIndex:E,linkType:i,rowClick:s,resource:g,children:p.jsx(M9e,{leftAvatar:r,leftIcon:a,primaryText:l,rightAvatar:d,rightIcon:c,secondaryText:h,tertiaryText:m,rowIndex:E})},C.id),"render")})})},"SimpleList"),M9e=o(e=>{const{leftAvatar:t,leftIcon:n,primaryText:r,rightAvatar:a,rightIcon:i,secondaryText:s,tertiaryText:l}=e,d=Ht(e),c=Wt(e),h=mc(d),m=St(),g=o((x,w)=>{const S=w(x,x.id);return typeof S=="string"&&(S.startsWith("http")||S.startsWith("data:"))?p.jsx("img",{src:S,alt:"",className:"w-10 h-10 rounded-full object-cover"}):p.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center text-sm",children:S})},"renderAvatar");return c?p.jsxs("div",{className:"flex items-center space-x-3 p-3",children:[n&&p.jsx("div",{className:"flex-shrink-0",children:n(c,c.id)}),t&&p.jsx("div",{className:"flex-shrink-0",children:g(c,t)}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("div",{className:"text-sm font-medium truncate",children:r?typeof r=="string"?m(r,{...c,_:r}):y.isValidElement(r)?r:r(c,c.id):h(c)}),!!l&&p.jsx("div",{className:"text-xs text-muted-foreground ml-2",children:typeof l=="string"?m(l,{...c,_:l}):y.isValidElement(l)?l:l(c,c.id)})]}),!!s&&p.jsx("div",{className:"text-sm text-muted-foreground truncate",children:typeof s=="string"?m(s,{...c,_:s}):y.isValidElement(s)?s:s(c,c.id)})]}),(a||i)&&p.jsxs("div",{className:"flex-shrink-0 flex items-center space-x-2",children:[a&&g(c,a),i&&i(c,c.id)]})]}):null},"SimpleListItemContent"),D9e=p.jsx(R9e,{}),N9e=o(()=>{const{identity:e}=gr(),{data:t,total:n,isPending:r}=Qa("contacts",{pagination:{page:1,perPage:10},sort:{field:"last_seen",order:"DESC"},filter:{status:"hot",sales_id:e?.id}},{enabled:Number.isInteger(e?.id)});return p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"mr-3 flex",children:p.jsx(uN,{className:"text-muted-foreground w-6 h-6"})}),p.jsx("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Hot Contacts"}),p.jsx(Ei,{children:p.jsxs(Qi,{children:[p.jsx(Xi,{asChild:!0,children:p.jsx(ot,{variant:"ghost",size:"sm",className:"ml-auto text-muted-foreground",asChild:!0,children:p.jsx(Rn,{to:"/contacts/create",children:p.jsx(Fv,{className:"w-4 h-4 text-primary"})})})}),p.jsx(Zi,{children:"Create contact"})]})})]}),p.jsx(Wr,{className:"py-0",children:p.jsx(P9e,{linkType:"show",data:t,total:n,isPending:r,resource:"contacts",className:"[&>li:first-child>a]:rounded-t-xl [&>li:last-child>a]:rounded-b-xl",primaryText:o(a=>`${a.first_name} ${a.last_name}`,"primaryText"),secondaryText:o(a=>p.jsxs(p.Fragment,{children:[a.title," at ",a.company_name]}),"secondaryText"),leftAvatar:o(a=>p.jsx(Qo,{record:a}),"leftAvatar"),empty:p.jsxs("div",{className:"p-4",children:[p.jsx("p",{className:"text-sm mb-4",children:'Contacts with a "hot" status will appear here.'}),p.jsx("p",{className:"text-sm",children:'Change the status of a contact by adding a note to that contact and clicking on "show options".'})]})})})]})},"HotContacts"),I9e=o(()=>{const{identity:e}=gr(),{total:t}=Qa("tasks",{pagination:{page:1,perPage:1},filter:{sales_id:e?.id}},{enabled:!!e});return t?null:p.jsx("p",{className:"text-sm",children:"Tasks added to your contacts will appear here."})},"TasksListEmpty"),Qm=o(({title:e,filter:t})=>{const{identity:n}=gr(),{data:r,total:a,isPending:i}=Qa("tasks",{pagination:{page:1,perPage:100},sort:{field:"due_date",order:"ASC"},filter:{...t,sales_id:n?.id}},{enabled:!!n}),s=mw({data:r,isPending:i,resource:"tasks",perPage:5});return i||!r||!a?null:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium mb-2",children:e}),p.jsx(Xu,{value:"tasks",children:p.jsx(Fg,{value:s,children:p.jsx(Xte,{showContact:!0})})}),a>s.perPage&&p.jsx("div",{className:"flex justify-center",children:p.jsx("a",{href:"#",onClick:o(l=>{s.setPerPage(s.perPage+10),l.preventDefault()},"onClick"),className:"text-sm underline hover:no-underline",children:"Load more"})})]})},"TasksListFilter"),Oae=new Date,F9e=o0e(Oae),L9e=F9e<5,$V=l0e().toISOString(),qV=oye().toISOString(),zV=sye().toISOString(),UV=iye(Oae,{weekStartsOn:0}).toISOString(),Xm={overdue:{"done_date@is":null,"due_date@lt":$V},today:{"done_date@is":null,"due_date@gte":$V,"due_date@lte":qV},tomorrow:{"done_date@is":null,"due_date@gt":qV,"due_date@lt":zV},thisWeek:{"done_date@is":null,"due_date@gte":zV,"due_date@lte":UV},later:{"done_date@is":null,"due_date@gt":UV}},$9e=o(()=>p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center",children:[p.jsx("div",{className:"mr-3 flex",children:p.jsx(tQ,{className:"text-muted-foreground w-6 h-6"})}),p.jsx("h2",{className:"text-xl font-semibold text-muted-foreground flex-1",children:"Upcoming Tasks"}),p.jsx(Qte,{display:"icon",selectContact:!0})]}),p.jsx(Wr,{className:"p-4 mb-2",children:p.jsxs("div",{className:"flex flex-col gap-4",children:[p.jsx(I9e,{}),p.jsx(Qm,{title:"Overdue",filter:Xm.overdue}),p.jsx(Qm,{title:"Today",filter:Xm.today}),p.jsx(Qm,{title:"Tomorrow",filter:Xm.tomorrow}),L9e&&p.jsx(Qm,{title:"This week",filter:Xm.thisWeek}),p.jsx(Qm,{title:"Later",filter:Xm.later})]})})]}),"TasksList"),q9e=o(()=>{const{data:e,total:t,isPending:n}=Qa("contacts",{pagination:{page:1,perPage:1}}),{total:r,isPending:a}=Qa("contactNotes",{pagination:{page:1,perPage:1}}),{total:i,isPending:s}=Qa("deals",{pagination:{page:1,perPage:1}});return n||a||s?null:t?r?p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6 mt-1",children:[p.jsx("div",{className:"md:col-span-3",children:p.jsxs("div",{className:"flex flex-col gap-4",children:[null,p.jsx(N9e,{})]})}),p.jsx("div",{className:"md:col-span-6",children:p.jsxs("div",{className:"flex flex-col gap-6",children:[i?p.jsx(O9e,{}):null,p.jsx(F3e,{})]})}),p.jsx("div",{className:"md:col-span-3",children:p.jsx($9e,{})})]}):p.jsx(UB,{step:2,contactId:e?.[0]?.id}):p.jsx(UB,{step:1})},"Dashboard"),z9e=y.lazy(()=>Ep(()=>import("./DealList-D2733gLg.js"),[],import.meta.url)),U9e={list:z9e},B9e=y.createContext(void 0),Rae=o(()=>y.useContext(B9e),"useUserMenu"),H9e=o(()=>{const{darkModeLogo:e,lightModeLogo:t,title:n}=Da(),r=jr();let a="/";return Ms("/",r.pathname)?a="/":Ms("/contacts/*",r.pathname)?a="/contacts":Ms("/companies/*",r.pathname)?a="/companies":Ms("/deals/*",r.pathname)?a="/deals":a=!1,p.jsx("nav",{className:"flex-grow",children:p.jsx("header",{className:"bg-secondary",children:p.jsx("div",{className:"px-4",children:p.jsxs("div",{className:"flex justify-between items-center flex-1",children:[p.jsxs(Rn,{to:"/",className:"flex items-center gap-2 text-secondary-foreground no-underline",children:[p.jsx("img",{className:"[.light_&]:hidden h-6",src:e,alt:n}),p.jsx("img",{className:"[.dark_&]:hidden h-6",src:t,alt:n}),p.jsx("h1",{className:"text-xl font-semibold",children:n})]}),p.jsx("div",{children:p.jsxs("nav",{className:"flex",children:[p.jsx(J0,{label:"Dashboard",to:"/",isActive:a==="/"}),p.jsx(J0,{label:"Contacts",to:"/contacts",isActive:a==="/contacts"}),p.jsx(J0,{label:"Companies",to:"/companies",isActive:a==="/companies"}),p.jsx(J0,{label:"Deals",to:"/deals",isActive:a==="/deals"})]})}),p.jsxs("div",{className:"flex items-center",children:[p.jsx(iZ,{}),p.jsx(oZ,{}),p.jsxs(nZ,{children:[p.jsx(W9e,{}),p.jsx(Wve,{resource:"sales",action:"list",children:p.jsx(V9e,{})})]})]})]})})})})},"Header"),J0=o(({label:e,to:t,isActive:n})=>p.jsx(Rn,{to:t,className:`px-6 py-3 text-sm font-medium transition-colors border-b-2 ${n?"text-secondary-foreground border-secondary-foreground":"text-secondary-foreground/70 border-transparent hover:text-secondary-foreground/80"}`,children:e}),"NavigationTab"),V9e=o(()=>{const{onClose:e}=Rae()??{};return p.jsx(Lr,{asChild:!0,onClick:e,children:p.jsxs(Rn,{to:"/sales",className:"flex items-center gap-2",children:[p.jsx(Qwe,{})," Users"]})})},"UsersMenu"),W9e=o(()=>{const{onClose:e}=Rae()??{};return p.jsx(Lr,{asChild:!0,onClick:e,children:p.jsxs(Rn,{to:"/settings",className:"flex items-center gap-2",children:[p.jsx(Hk,{}),"My info"]})})},"ConfigurationMenu"),G9e=o(({children:e})=>p.jsxs(p.Fragment,{children:[p.jsx(H9e,{}),p.jsx("main",{className:"max-w-screen-xl mx-auto pt-4 px-4",id:"main-content",children:p.jsx(Ub,{FallbackComponent:sZ,children:p.jsx(y.Suspense,{fallback:p.jsx(oa,{className:"h-12 w-12 rounded-full"}),children:e})})}),p.jsx(o1,{})]}),"Layout"),Aae=o(()=>p.jsx("div",{className:"max-w-screen-xl mx-auto h-screen pt-8",children:p.jsx("div",{className:"h-full",children:p.jsxs("div",{className:"max-w-sm mx-auto h-full flex flex-col justify-center gap-8",children:[p.jsx(oa,{className:"w-full h-[100px]"}),p.jsx(oa,{className:"w-4/5 h-[50px]"}),p.jsx(oa,{className:"w-full h-9"}),p.jsx(oa,{className:"w-full h-9"}),p.jsx(oa,{className:"w-full h-9"}),p.jsx(oa,{className:"w-2/5 h-9"})]})})}),"LoginSkeleton"),FM=o(()=>{const e=ir(),t=Yn(),{darkModeLogo:n,title:r}=Da(),{data:a,isPending:i}=Pa({queryKey:["init"],queryFn:o(async()=>t.isInitialized(),"queryFn")}),{isPending:s,mutate:l}=Vi({mutationKey:["signup"],mutationFn:o(async w=>t.signUp(w),"mutationFn"),onSuccess:o(w=>{d({email:w.email,password:w.password,redirectTo:"/contacts"}).then(()=>{c("Initial user successfully created"),e.invalidateQueries({queryKey:["auth","canAccess"]})})},"onSuccess"),onError:o(()=>{c("An error occurred. Please try again.")},"onError")}),d=BY(),c=mn(),{register:h,handleSubmit:m,formState:{isValid:g}}=VD({mode:"onChange"});if(i)return p.jsx(Aae,{});if(a)return p.jsx(Wx,{to:"/login"});const x=o(async w=>{l(w)},"onSubmit");return p.jsxs("div",{className:"h-screen p-8",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsx("img",{src:n,alt:r,width:24,className:"filter brightness-0 invert"}),p.jsx("h1",{className:"text-xl font-semibold",children:r})]}),p.jsx("div",{className:"h-full",children:p.jsxs("div",{className:"max-w-sm mx-auto h-full flex flex-col justify-center gap-4",children:[p.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Welcome to CRM"}),p.jsx("p",{className:"text-base mb-4",children:"Create the first user account to complete the setup."}),p.jsxs("form",{onSubmit:m(x),className:"space-y-4",children:[p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(xi,{htmlFor:"first_name",children:"First name"}),p.jsx(bi,{...h("first_name",{required:!0}),id:"first_name",type:"text",required:!0})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(xi,{htmlFor:"last_name",children:"Last name"}),p.jsx(bi,{...h("last_name",{required:!0}),id:"last_name",type:"text",required:!0})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(xi,{htmlFor:"email",children:"Email"}),p.jsx(bi,{...h("email",{required:!0}),id:"email",type:"email",required:!0})]}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx(xi,{htmlFor:"password",children:"Password"}),p.jsx(bi,{...h("password",{required:!0}),id:"password",type:"password",required:!0})]}),p.jsx("div",{className:"flex justify-between items-center mt-8",children:p.jsx(ot,{type:"submit",disabled:!g||s,className:"w-full",children:s?p.jsxs(p.Fragment,{children:[p.jsx(vp,{className:"w-4 h-4 animate-spin mr-2"}),"Creating..."]}):"Create account"})})]})]})})]})},"SignupPage");FM.path="/sign-up";const Y9e=o((e,t)=>e==="admin"?!0:t.resource!=="sales","canAccess"),xg="realtimex_crm_supabase_config";function S_(){const e=localStorage.getItem(xg);if(e)try{return JSON.parse(e)}catch(t){console.error("Failed to parse stored Supabase config:",t),localStorage.removeItem(xg)}return null}o(S_,"getSupabaseConfig");function K9e(e){const t={...e,configuredAt:new Date().toISOString()};localStorage.setItem(xg,JSON.stringify(t))}o(K9e,"saveSupabaseConfig");function Q9e(){localStorage.removeItem(xg)}o(Q9e,"clearSupabaseConfig");function X9e(){return S_()!==null}o(X9e,"isSupabaseConfigured");async function Z9e(e,t){try{if(!e.startsWith("http://")&&!e.startsWith("https://"))return{valid:!1,error:"Invalid URL format"};if(!t.startsWith("eyJ"))return{valid:!1,error:"Invalid anon key format"};const n=await fetch(`${e}/rest/v1/`,{method:"GET",headers:{apikey:t,Authorization:`Bearer ${t}`}});return n.ok?{valid:!0}:n.status===401||n.status===403?{valid:!1,error:"Invalid API key"}:{valid:!1,error:`Connection failed: ${n.statusText}`}}catch(n){return{valid:!1,error:n instanceof Error?n.message:"Connection failed"}}}o(Z9e,"validateSupabaseConnection");function J9e(){return localStorage.getItem(xg)?"ui":"none"}o(J9e,"getConfigSource");let eb=null;function eqe(){if(!eb){const e=S_();e?eb=AP(e.url,e.anonKey):(console.warn("[Supabase] No configuration found, using placeholder"),eb=AP("https://placeholder.supabase.co","placeholder-key"))}return eb}o(eqe,"getSupabaseClient");const Ra=new Proxy({},{get(e,t){const n=eqe(),r=n[t];return typeof r=="function"?r.bind(n):r}}),VT=Zje(Ra,{getIdentity:o(async()=>{const e=await Tae();if(e==null)throw new Error;return{id:e.id,fullName:`${e.first_name} ${e.last_name}`,avatar:e.avatar?.src}},"getIdentity")});async function Fs(){if(Fs._is_initialized_cache==null){const{data:e}=await Ra.from("init_state").select("is_initialized");Fs._is_initialized_cache=e?.at(0)?.is_initialized>0}return Fs._is_initialized_cache}o(Fs,"getIsInitialized");(e=>{e._is_initialized_cache=null})(Fs||(Fs={}));const tqe={...VT,login:o(async e=>{const t=await VT.login(e);return mb=void 0,t},"login"),checkAuth:o(async e=>{if(window.location.pathname==="/set-password"||window.location.hash.includes("#/set-password")||window.location.pathname==="/forgot-password"||window.location.hash.includes("#/forgot-password")||window.location.pathname==="/sign-up"||window.location.hash.includes("#/sign-up"))return;if(!await Fs())throw await Ra.auth.signOut(),{redirectTo:"/sign-up",message:!1};return VT.checkAuth(e)},"checkAuth"),canAccess:o(async e=>{if(!await Fs())return!1;const n=await Tae();if(n==null)return!1;const r=n.administrator?"admin":"user";return Y9e(r,e)},"canAccess")};let mb;const Tae=o(async()=>{if(mb!=null)return mb;const{data:e,error:t}=await Ra.auth.getSession();if(e?.session?.user==null||t)return;const{data:n,error:r}=await Ra.from("sales").select("id, first_name, last_name, avatar, administrator").match({user_id:e?.session?.user.id}).single();if(!(n==null||r))return mb=n,n},"getSaleFromCache");async function nqe(e,t,n){const r={};t&&(r.id=t);const a={};t&&(a.company_id=t);const[i,s,l]=await Promise.all([rqe(e,r),aqe(e,a),iqe(e,a)]);return[...i,...s,...l].sort((d,c)=>d.date&&c.date?d.date.localeCompare(c.date)*-1:0).slice(0,250)}o(nqe,"getActivityLog");const rqe=o(async(e,t)=>{const{data:n}=await e.getList("companies",{filter:t,pagination:{page:1,perPage:250},sort:{field:"created_at",order:"DESC"}});return n.map(r=>({id:`company.${r.id}.created`,type:Xee,company_id:r.id,company:r,sales_id:r.sales_id,date:r.created_at}))},"getNewCompanies");async function aqe(e,t){const{data:n}=await e.getList("contacts",{filter:t,pagination:{page:1,perPage:250},sort:{field:"first_seen",order:"DESC"}}),r={};if(t.sales_id&&(r.sales_id=t.sales_id),t.company_id){const l=n.map(d=>d.id).join(",");r["contact_id@in"]=`(${l})`}const{data:a}=await e.getList("contactNotes",{filter:r,pagination:{page:1,perPage:250},sort:{field:"date",order:"DESC"}}),i=n.map(l=>({id:`contact.${l.id}.created`,type:Zee,company_id:l.company_id,sales_id:l.sales_id,contact:l,date:l.first_seen})),s=a.map(l=>({id:`contactNote.${l.id}.created`,type:Jee,sales_id:l.sales_id,contactNote:l,date:l.date}));return[...i,...s]}o(aqe,"getNewContactsAndNotes");async function iqe(e,t){const{data:n}=await e.getList("deals",{filter:t,pagination:{page:1,perPage:250},sort:{field:"created_at",order:"DESC"}}),r={};if(t.sales_id&&(r.sales_id=t.sales_id),t.company_id){const l=n.map(d=>d.id).join(",");r["deal_id@in"]=`(${l})`}const{data:a}=await e.getList("dealNotes",{filter:r,pagination:{page:1,perPage:250},sort:{field:"date",order:"DESC"}}),i=n.map(l=>({id:`deal.${l.id}.created`,type:ete,company_id:l.company_id,sales_id:l.sales_id,deal:l,date:l.created_at})),s=a.map(l=>({id:`dealNote.${l.id}.created`,type:tte,sales_id:l.sales_id,dealNote:l,date:l.date}));return[...i,...s]}o(iqe,"getNewDealsAndNotes");async function oqe(e){return e.website?{src:`https://favicon.show/${e.website.replace(/^https?:\/\//,"").replace(/\/$/,"")}`,title:"Company favicon"}:null}o(oqe,"getCompanyAvatar");async function sqe(e,t={}){const{timeout:n=2e3}=t,r=new AbortController,a=setTimeout(()=>r.abort(),n),i=await fetch(e,{...t,signal:r.signal});return clearTimeout(a),i}o(sqe,"fetchWithTimeout");const lqe=["gmail.com","yahoo.com","hotmail.com","aol.com","hotmail.co.uk","hotmail.fr","msn.com","yahoo.fr","wanadoo.fr","orange.fr","comcast.net","yahoo.co.uk","yahoo.com.br","yahoo.co.in","live.com","rediffmail.com","free.fr","gmx.de","web.de","yandex.ru","ymail.com","libero.it","outlook.com","uol.com.br","bol.com.br","mail.ru","cox.net","hotmail.it","sbcglobal.net","sfr.fr","live.fr","verizon.net","live.co.uk","googlemail.com","yahoo.es","ig.com.br","live.nl","bigpond.com","terra.com.br","yahoo.it","neuf.fr","yahoo.de","alice.it","rocketmail.com","att.net","laposte.net","facebook.com","bellsouth.net","yahoo.in","hotmail.es","charter.net","yahoo.ca","yahoo.com.au","rambler.ru","hotmail.de","tiscali.it","shaw.ca","yahoo.co.jp","sky.com","earthlink.net","optonline.net","freenet.de","t-online.de","aliceadsl.fr","virgilio.it","home.nl","qq.com","telenet.be","me.com","yahoo.com.ar","tiscali.co.uk","yahoo.com.mx","voila.fr","gmx.net","mail.com","planet.nl","tin.it","live.it","ntlworld.com","arcor.de","yahoo.co.id","frontiernet.net","hetnet.nl","live.com.au","yahoo.com.sg","zonnet.nl","club-internet.fr","juno.com","optusnet.com.au","blueyonder.co.uk","bluewin.ch","skynet.be","sympatico.ca","windstream.net","mac.com","centurytel.net","chello.nl","live.ca","aim.com","bigpond.net.au","online.de","apple.com"];async function cqe(e){const t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}o(cqe,"hash");async function uqe(e){return`https://www.gravatar.com/avatar/${await cqe(e)}?d=404`}o(uqe,"getGravatarUrl");async function dqe(e){if(lqe.includes(e))return null;try{const t=`https://${e}/favicon.ico`;if((await sqe(t)).ok)return t}catch{return null}return null}o(dqe,"getFaviconUrl");async function fqe(e){if(!e.email_jsonb||!e.email_jsonb.length)return null;for(const{email:t}of e.email_jsonb){const n=await uqe(t);try{if((await fetch(n)).ok)return n}catch{}const r=t.split("@")[1],a=await dqe(r);if(a)return a}return null}o(fqe,"getContactAvatar");const BV=S_()||{url:"https://placeholder.supabase.co",anonKey:"placeholder-key"},go=rAe({instanceUrl:BV.url,apiKey:BV.anonKey,supabaseClient:Ra,sortOrder:"asc,desc.nullslast"}),HV=o(async e=>{let t=e.data.logo;return typeof t!="object"||t===null||!t.src?t=await oqe(e.data):t.rawFile instanceof File&&await vb(t),{...e,data:{...e.data,logo:t}}},"processCompanyLogo");async function VV(e){const{data:t}=e;if(t.avatar?.src||!t.email_jsonb||!t.email_jsonb.length)return e;const n=await fqe(t),r={...t,avatar:{src:n||void 0}};return{...e,data:r}}o(VV,"processContactAvatar");const hqe={...go,async getList(e,t){return e==="companies"?go.getList("companies_summary",t):e==="contacts"?go.getList("contacts_summary",t):go.getList(e,t)},async getOne(e,t){return e==="companies"?go.getOne("companies_summary",t):e==="contacts"?go.getOne("contacts_summary",t):go.getOne(e,t)},async signUp({email:e,password:t,first_name:n,last_name:r}){const a=await Ra.auth.signUp({email:e,password:t,options:{data:{first_name:n,last_name:r}}});if(!a.data?.user||a.error)throw console.error("signUp.error",a.error),new Error("Failed to create account");return Fs._is_initialized_cache=!0,{id:a.data.user.id,email:e,password:t}},async salesCreate(e){const{data:t,error:n}=await Ra.functions.invoke("users",{method:"POST",body:e});if(!t||n)throw console.error("salesCreate.error",n),new Error("Failed to create account manager");return t},async salesUpdate(e,t){const{email:n,first_name:r,last_name:a,administrator:i,avatar:s,disabled:l}=t,{data:d,error:c}=await Ra.functions.invoke("users",{method:"PATCH",body:{sales_id:e,email:n,first_name:r,last_name:a,administrator:i,disabled:l,avatar:s}});if(!d||c)throw console.error("salesCreate.error",c),new Error("Failed to update account manager");return t},async updatePassword(e){const{data:t,error:n}=await Ra.functions.invoke("updatePassword",{method:"PATCH",body:{sales_id:e}});if(!t||n)throw console.error("passwordUpdate.error",n),new Error("Failed to update password");return t},async unarchiveDeal(e){const{data:t}=await go.getList("deals",{filter:{stage:e.stage},pagination:{page:1,perPage:1e3},sort:{field:"index",order:"ASC"}}),n=t.map((r,a)=>({...r,index:r.id===e.id?0:a+1,archived_at:r.id===e.id?null:r.archived_at}));return await Promise.all(n.map(r=>go.update("deals",{id:r.id,data:r,previousData:t.find(a=>a.id===r.id)})))},async getActivityLog(e){return nqe(go,e)},async isInitialized(){return Fs()},async mergeContacts(e,t){const{data:n,error:r}=await Ra.functions.invoke("mergeContacts",{method:"POST",body:{loserId:e,winnerId:t}});if(r)throw console.error("mergeContacts.error",r),new Error("Failed to merge contacts");return n}},pqe=Mfe(hqe,[{resource:"contactNotes",beforeSave:o(async(e,t,n)=>{if(e.attachments)for(const r of e.attachments)await vb(r);return e},"beforeSave")},{resource:"dealNotes",beforeSave:o(async(e,t,n)=>{if(e.attachments)for(const r of e.attachments)await vb(r);return e},"beforeSave")},{resource:"sales",beforeSave:o(async(e,t,n)=>(e.avatar&&await vb(e.avatar),e),"beforeSave")},{resource:"contacts",beforeCreate:o(async e=>VV(e),"beforeCreate"),beforeUpdate:o(async e=>VV(e),"beforeUpdate"),beforeGetList:o(async e=>tb(["first_name","last_name","company_name","title","email","phone","background"])(e),"beforeGetList")},{resource:"companies",beforeGetList:o(async e=>tb(["name","phone_number","website","zipcode","city","stateAbbr"])(e),"beforeGetList"),beforeCreate:o(async e=>{const t=await HV(e);return{...t,data:{...t.data,created_at:new Date().toISOString()}}},"beforeCreate"),beforeUpdate:o(async e=>await HV(e),"beforeUpdate")},{resource:"contacts_summary",beforeGetList:o(async e=>tb(["first_name","last_name"])(e),"beforeGetList")},{resource:"deals",beforeGetList:o(async e=>tb(["name","type","description"])(e),"beforeGetList")}]),tb=o(e=>t=>{if(!t.filter?.q)return t;const{q:n,...r}=t.filter;return{...t,filter:{...r,"@or":e.reduce((a,i)=>i==="email"?{...a,"email_fts@ilike":n}:i==="phone"?{...a,"phone_fts@ilike":n}:{...a,[`${i}@ilike`]:n},{})}}},"applyFullTextSearch"),vb=o(async e=>{if(!e.src.startsWith("blob:")&&!e.src.startsWith("data:")&&e.path){const{error:c}=await Ra.storage.from("attachments").createSignedUrl(e.path,60);if(!c)return}const t=e.src?await fetch(e.src).then(c=>c.blob()):e.rawFile,n=e.rawFile,r=n.name.split(".").pop(),i=`${`${Math.random()}.${r}`}`,{error:s}=await Ra.storage.from("attachments").upload(i,t);if(s)throw console.error("uploadError",s),new Error("Failed to upload attachment");const{data:l}=Ra.storage.from("attachments").getPublicUrl(i);e.path=i,e.src=l.publicUrl;const d=n.type;return e.type=d,e},"uploadToBucket");function kae(){const{identity:e}=gr(),t=Wt();return p.jsxs("div",{className:"space-y-4 w-full",children:[p.jsx(un,{source:"first_name",validate:pr(),helperText:!1}),p.jsx(un,{source:"last_name",validate:pr(),helperText:!1}),p.jsx(un,{source:"email",validate:[pr(),_Y()],helperText:!1}),p.jsx(iM,{source:"administrator",readOnly:t?.id===e?.id,helperText:!1}),p.jsx(iM,{source:"disabled",readOnly:t?.id===e?.id,helperText:!1})]})}o(kae,"SalesInputs");function mqe(){const e=Yn(),t=mn(),n=ro(),{mutate:r}=Vi({mutationKey:["signup"],mutationFn:o(async i=>e.salesCreate(i),"mutationFn"),onSuccess:o(()=>{t("User created. They will soon receive an email to set their password."),n("/sales")},"onSuccess"),onError:o(()=>{t("An error occurred while creating the user.",{type:"error"})},"onError")}),a=o(async i=>{r(i)},"onSubmit");return p.jsx("div",{className:"max-w-lg w-full mx-auto mt-8",children:p.jsxs(Wr,{children:[p.jsx(UJ,{children:p.jsx(BJ,{children:"Create a new user"})}),p.jsx(io,{children:p.jsx(HJ,{onSubmit:a,children:p.jsx(kae,{})})})]})})}o(mqe,"SalesCreate");function vqe(){return p.jsxs("div",{className:"flex justify-end gap-4",children:[p.jsx(m1,{}),p.jsx(od,{})]})}o(vqe,"EditToolbar");function gqe(){const{record:e}=YG(),t=Yn(),n=mn(),r=ro(),{mutate:a}=Vi({mutationKey:["signup"],mutationFn:o(async s=>{if(!e)throw new Error("Record not found");return t.salesUpdate(e.id,s)},"mutationFn"),onSuccess:o(()=>{r("/sales"),n("User updated successfully")},"onSuccess"),onError:o(()=>{n("An error occurred. Please try again.")},"onError")}),i=o(async s=>{a(s)},"onSubmit");return p.jsx("div",{className:"max-w-lg w-full mx-auto mt-8",children:p.jsx(Wr,{children:p.jsx(io,{children:p.jsxs(HJ,{toolbar:p.jsx(vqe,{}),onSubmit:i,record:e,children:[p.jsx(yqe,{}),p.jsx(kae,{})]})})})})}o(gqe,"SalesEdit");const yqe=o(()=>{const e=Wt();return e?p.jsxs("h2",{className:"text-lg font-semibold mb-4",children:["Edit ",e?.first_name," ",e?.last_name]}):null},"SaleEditTitle"),bqe=o(()=>p.jsxs(XN,{children:[p.jsx(c1,{}),p.jsx(ld,{label:"New user"})]}),"SalesListActions"),xqe=[p.jsx(JN,{source:"q",alwaysOn:!0})],wqe=o(e=>{const t=Wt();return t?p.jsxs("div",{className:"flex flex-row gap-1",children:[t.administrator&&p.jsx(zu,{variant:"outline",className:"border-blue-300 dark:border-blue-700",children:"Admin"}),t.disabled&&p.jsx(zu,{variant:"outline",className:"border-orange-300 dark:border-orange-700",children:"Disabled"})]}):null},"OptionsField");function _qe(){return p.jsx(KN,{filters:xqe,actions:p.jsx(bqe,{}),sort:{field:"first_name",order:"ASC"},children:p.jsxs(Ml,{children:[p.jsx(Ml.Col,{source:"first_name"}),p.jsx(Ml.Col,{source:"last_name"}),p.jsx(Ml.Col,{source:"email"}),p.jsx(Ml.Col,{label:!1,children:p.jsx(wqe,{})})]})})}o(_qe,"SalesList");const Sqe={list:_qe,create:mqe,edit:gqe,recordRepresentation:o(e=>`${e.first_name} ${e.last_name}`,"recordRepresentation")};function Pae({open:e,onComplete:t,canClose:n=!1}){const[r,a]=y.useState("welcome"),[i,s]=y.useState(""),[l,d]=y.useState(""),[c,h]=y.useState(null),m=o(async()=>{h(null),a("validating");const x=await Z9e(i,l);x.valid?(K9e({url:i,anonKey:l}),a("success"),setTimeout(()=>{window.location.href=window.location.origin},1500)):(h(x.error||"Connection failed"),a("credentials"))},"handleValidateAndSave"),g=o(()=>{n&&t()},"handleClose");return p.jsx(Yo,{open:e,onOpenChange:n?g:void 0,children:p.jsxs(Ko,{className:"sm:max-w-md",onPointerDownOutside:o(x=>!n&&x.preventDefault(),"onPointerDownOutside"),onEscapeKeyDown:o(x=>!n&&x.preventDefault(),"onEscapeKeyDown"),children:[r==="welcome"&&p.jsxs(p.Fragment,{children:[p.jsxs(Ya,{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx(Bk,{className:"h-6 w-6 text-primary"}),p.jsx(Ka,{children:"Welcome to CRM"})]}),p.jsx(fu,{children:"To get started, you'll need to connect to a Supabase database."})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[p.jsx(Ui,{children:p.jsxs(To,{children:[p.jsx("strong",{children:"Don't have a Supabase project?"}),p.jsx("br",{}),"Create one for free at"," ",p.jsx("a",{href:"https://supabase.com",target:"_blank",rel:"noopener noreferrer",className:"underline text-primary",children:"supabase.com"})]})}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"font-medium text-sm",children:"What you'll need:"}),p.jsxs("ul",{className:"list-disc list-inside text-sm text-muted-foreground space-y-1",children:[p.jsx("li",{children:"Your Supabase project URL"}),p.jsx("li",{children:"Your anonymous (anon) API key"})]})]}),p.jsx(ot,{onClick:o(()=>a("credentials"),"onClick"),className:"w-full",children:"Continue"})]})]}),r==="credentials"&&p.jsxs(p.Fragment,{children:[p.jsxs(Ya,{children:[p.jsx(Ka,{children:"Connect to Supabase"}),p.jsx(fu,{children:"Enter your Supabase project credentials"})]}),p.jsxs("div",{className:"space-y-4 py-4",children:[c&&p.jsxs(Ui,{variant:"destructive",children:[p.jsx(Mw,{className:"h-4 w-4"}),p.jsx(To,{children:c})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(xi,{htmlFor:"supabase-url",children:"Supabase URL"}),p.jsx(bi,{id:"supabase-url",placeholder:"https://xxxxx.supabase.co",value:i,onChange:o(x=>s(x.target.value),"onChange")}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Found in Project Settings → API"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(xi,{htmlFor:"anon-key",children:"Anonymous Key"}),p.jsx(bi,{id:"anon-key",type:"password",placeholder:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",value:l,onChange:o(x=>d(x.target.value),"onChange")}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Found in Project Settings → API → Project API keys"})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(ot,{variant:"outline",onClick:o(()=>a("welcome"),"onClick"),className:"flex-1",children:"Back"}),p.jsx(ot,{onClick:m,disabled:!i||!l,className:"flex-1",children:"Connect"})]})]})]}),r==="validating"&&p.jsxs(p.Fragment,{children:[p.jsxs(Ya,{children:[p.jsx(Ka,{children:"Validating Connection"}),p.jsx(fu,{children:"Testing your Supabase credentials..."})]}),p.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[p.jsx(vp,{className:"h-12 w-12 animate-spin text-primary mb-4"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Please wait..."})]})]}),r==="success"&&p.jsxs(p.Fragment,{children:[p.jsxs(Ya,{children:[p.jsx(Ka,{children:"Connection Successful!"}),p.jsx(fu,{children:"Your Supabase database is now connected"})]}),p.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[p.jsx(Iv,{className:"h-12 w-12 text-green-500 mb-4"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Reloading application..."})]})]})]})})}o(Pae,"SupabaseSetupWizard");function Eqe(){const[e,t]=y.useState(!1),n=S_(),r=J9e(),a=o(()=>{confirm("Are you sure you want to clear the database configuration? The app will need to be reconfigured on next launch.")&&(Q9e(),window.location.reload())},"handleClearConfig");return p.jsxs(p.Fragment,{children:[p.jsxs(Wr,{children:[p.jsxs(UJ,{children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Bk,{className:"h-5 w-5"}),p.jsx(BJ,{children:"Database Connection"})]}),n&&p.jsx(zu,{variant:r==="ui"?"default":"secondary",children:r==="ui"?"UI Configured":"Environment Variables"})]}),p.jsx(_ke,{children:"Manage your Supabase database connection settings"})]}),p.jsx(io,{className:"space-y-4",children:n?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-start gap-3 p-4 border rounded-lg",children:[p.jsx(Iv,{className:"h-5 w-5 text-green-500 mt-0.5"}),p.jsxs("div",{className:"flex-1 space-y-1",children:[p.jsx("p",{className:"font-medium",children:"Connected"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:n.url}),n.configuredAt&&p.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configured on"," ",new Date(n.configuredAt).toLocaleDateString()]})]})]}),r==="env"&&p.jsxs(Ui,{children:[p.jsx(Hk,{className:"h-4 w-4"}),p.jsx(To,{children:"Using configuration from environment variables. You can override this by setting up a new connection via the UI."})]}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs(ot,{variant:"outline",onClick:o(()=>t(!0),"onClick"),className:"flex-1",children:[p.jsx(Hk,{className:"h-4 w-4 mr-2"}),"Change Connection"]}),r==="ui"&&p.jsxs(ot,{variant:"destructive",onClick:a,className:"flex-1",children:[p.jsx(rQ,{className:"h-4 w-4 mr-2"}),"Clear Configuration"]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(Cqe,{className:"text-sm font-medium",children:"Anonymous Key"}),p.jsxs("div",{className:"font-mono text-sm p-2 bg-muted rounded",children:[n.anonKey.substring(0,20),"...",n.anonKey.substring(n.anonKey.length-10)]})]})]}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-start gap-3 p-4 border border-dashed rounded-lg",children:[p.jsx(gc,{className:"h-5 w-5 text-destructive mt-0.5"}),p.jsxs("div",{className:"flex-1 space-y-1",children:[p.jsx("p",{className:"font-medium",children:"Not Connected"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"No Supabase database is configured"})]})]}),p.jsx(Ui,{children:p.jsxs(To,{children:["Connect to a Supabase database to start using Atomic CRM. You can create a free project at"," ",p.jsx("a",{href:"https://supabase.com",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"supabase.com"})]})}),p.jsxs(ot,{onClick:o(()=>t(!0),"onClick"),className:"w-full",children:[p.jsx(Bk,{className:"h-4 w-4 mr-2"}),"Connect to Supabase"]})]})})]}),p.jsx(Pae,{open:e,onComplete:o(()=>t(!1),"onComplete"),canClose:!0})]})}o(Eqe,"DatabaseSettings");function Cqe({children:e,className:t}){return p.jsx("label",{className:t,children:e})}o(Cqe,"Label");const LM=o(()=>{const[e,t]=y.useState(!1),{identity:n,refetch:r}=gr(),{data:a,refetch:i}=lw("sales",{id:n?.id}),s=mn(),l=Yn(),{mutate:d}=Vi({mutationKey:["signup"],mutationFn:o(async h=>{if(!n)throw new Error("Record not found");return l.salesUpdate(n.id,h)},"mutationFn"),onSuccess:o(()=>{r(),i(),t(!1),s("Your profile has been updated")},"onSuccess"),onError:o(h=>{s("An error occurred. Please try again",{type:"error"})},"onError")});if(!n)return null;const c=o(async h=>{d(h)},"handleOnSubmit");return p.jsx("div",{className:"max-w-lg mx-auto mt-8",children:p.jsx(da,{onSubmit:c,record:a,children:p.jsx(jqe,{isEditMode:e,setEditMode:t})})})},"SettingsPage"),jqe=o(({isEditMode:e,setEditMode:t})=>{const n=mn(),r=Wt(),{identity:a,refetch:i}=gr(),{isDirty:s}=$g(),l=Yn(),{mutate:d}=Vi({mutationKey:["updatePassword"],mutationFn:o(async()=>{if(!a)throw new Error("Record not found");return l.updatePassword(a.id)},"mutationFn"),onSuccess:o(()=>{n("A reset password email has been sent to your email address")},"onSuccess"),onError:o(g=>{n(`${g}`,{type:"error"})},"onError")}),{mutate:c}=Vi({mutationKey:["signup"],mutationFn:o(async g=>{if(!r)throw new Error("Record not found");return l.salesUpdate(r.id,g)},"mutationFn"),onSuccess:o(()=>{i(),n("Your profile has been updated")},"onSuccess"),onError:o(()=>{n("An error occurred. Please try again.")},"onError")});if(!a)return null;const h=o(()=>{d()},"handleClickOpenPasswordChange"),m=o(async g=>{c(g)},"handleAvatarUpdate");return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Eqe,{}),p.jsx(Wr,{children:p.jsxs(io,{children:[p.jsx("div",{className:"mb-4 flex flex-row justify-between",children:p.jsx("h2",{className:"text-xl font-semibold text-muted-foreground",children:"My info"})}),p.jsxs("div",{className:"space-y-4 mb-4",children:[p.jsx(Iee,{source:"avatar",type:"avatar",onSave:m,linkPosition:"right"}),p.jsx(WT,{source:"first_name",isEditMode:e}),p.jsx(WT,{source:"last_name",isEditMode:e}),p.jsx(WT,{source:"email",isEditMode:e})]}),p.jsxs("div",{className:"flex flex-row justify-end gap-2",children:[!e&&p.jsx(p.Fragment,{children:p.jsx(ot,{variant:"outline",type:"button",onClick:h,children:"Change password"})}),p.jsxs(ot,{type:"button",variant:e?"ghost":"outline",onClick:o(()=>t(!e),"onClick"),className:"flex items-center",children:[e?p.jsx(gc,{}):p.jsx(JK,{}),e?"Cancel":"Edit"]}),e&&p.jsxs(ot,{type:"submit",disabled:!s,variant:"outline",children:[p.jsx(Dw,{}),"Save"]})]})]})}),void 0]})},"SettingsForm"),WT=o(({source:e,isEditMode:t})=>t?p.jsx(un,{source:e,helperText:!1}):p.jsx("div",{className:"m-2",children:p.jsx(X4e,{source:e})}),"TextRender");LM.path="/settings";var Oqe={"ra-supabase":{auth:{email:"Email",confirm_password:"Confirm password",sign_in_with:"Sign in with %{provider}",forgot_password:"Forgot password?",reset_password:"Reset password",password_reset:"Your password has been reset. You will receive an email containing a link to log in.",missing_tokens:"Access and refresh tokens are missing",back_to_login:"Back to login"},reset_password:{forgot_password:"Forgot password?",forgot_password_details:"Enter your email for instructions."},set_password:{new_password:"Choose your password"},validation:{password_mismatch:"Passwords do not match"}}};const Rqe={"ra-supabase":{auth:{password_reset:"Check your emails for a Reset Password message."}}},Aqe=kK(()=>yde(yK,Oqe,Rqe),"en",[{locale:"en",name:"English"}],{allowMissing:!0}),Tqe=o(()=>{const e=Yn(),{data:t,error:n,isPending:r}=Pa({queryKey:["init"],queryFn:o(async()=>e.isInitialized(),"queryFn")});return r?p.jsx(Aae,{}):n?p.jsx(Xb,{}):t?p.jsx(Xb,{}):p.jsx(Wx,{to:"/sign-up"})},"StartPage"),kqe=o(({contactGender:e=wZ,companySectors:t=mZ,dealCategories:n=yZ,dealPipelineStatuses:r=gZ,dealStages:a=vZ,darkModeLogo:i=fZ,lightModeLogo:s=hZ,noteStatuses:l=bZ,taskTypes:d=xZ,title:c=pZ,dataProvider:h=pqe,authProvider:m=tqe,disableTelemetry:g,...x})=>(y.useEffect(()=>{if(g||typeof window>"u"||typeof window.location>"u"||typeof Image>"u")return;const w=new Image;w.src=`https://atomic-crm-telemetry.marmelab.com/atomic-crm-telemetry?domain=${window.location.hostname}`},[g]),p.jsx(Vje,{contactGender:e,companySectors:t,dealCategories:n,dealPipelineStatuses:r,dealStages:a,darkModeLogo:i,lightModeLogo:s,noteStatuses:l,taskTypes:d,title:c,children:p.jsxs(Qje,{dataProvider:h,authProvider:m,store:FW(void 0,"CRM"),layout:G9e,loginPage:Tqe,i18nProvider:Aqe,dashboard:q9e,requireAuth:!0,disableTelemetry:!0,...x,children:[p.jsxs(Pk,{noLayout:!0,children:[p.jsx(fr,{path:FM.path,element:p.jsx(FM,{})}),p.jsx(fr,{path:PP.path,element:p.jsx(PP,{})}),p.jsx(fr,{path:kP.path,element:p.jsx(kP,{})})]}),p.jsx(Pk,{children:p.jsx(fr,{path:LM.path,element:p.jsx(LM,{})})}),p.jsx(xo,{name:"deals",...U9e}),p.jsx(xo,{name:"contacts",...I3e}),p.jsx(xo,{name:"companies",...DNe}),p.jsx(xo,{name:"contactNotes"}),p.jsx(xo,{name:"dealNotes"}),p.jsx(xo,{name:"tasks"}),p.jsx(xo,{name:"sales",...Sqe}),p.jsx(xo,{name:"tags"})]})})),"CRM"),Pqe=o(()=>{const[e,t]=y.useState(()=>{const n=X9e();return console.log("[App] Supabase configured:",n),!n});return e?p.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:p.jsx(Pae,{open:!0,onComplete:o(()=>{t(!1)},"onComplete"),canClose:!1})}):p.jsx(kqe,{})},"App");Goe.createRoot(document.getElementById("root")).render(p.jsx(y.StrictMode,{children:p.jsx(Pqe,{})}));export{gr as $,Gs as A,zu as B,GG as C,LY as D,VN as E,$o as F,BN as G,Rn as H,qo as I,WZ as J,Ce as K,JG as L,hme as M,bi as N,qx as O,ie as P,IW as Q,Xu as R,Vs as S,Zn as T,ro as U,Wr as V,io as W,gp as X,Er as Y,Op as Z,Rp as _,qg as a,ot as a0,Yo as a1,Ko as a2,Ka as a3,Ju as a4,ed as a5,un as a6,pr as a7,ry as a8,n4e as a9,Qge as aA,hNe as aB,Kv as aC,M3e as aD,nne as aE,OD as aF,Vi as aG,Qu as aH,gte as aI,xi as aJ,JN as aK,b1 as aL,KN as aM,XN as aN,ZTe as aO,c1 as aP,sM as aa,Da as ab,Bs as ac,Vte as ad,Yn as ae,Bn as af,ir as ag,da as ah,v1 as ai,od as aj,mn as ak,ID as al,dte as am,Wt as an,d4 as ao,jr as ap,Ms as aq,ZN as ar,W3e as as,ld as at,yNe as au,Hi as av,Qo as aw,kY as ax,ite as ay,mK as az,UD as b,PG as c,ime as d,Qa as e,at as f,XD as g,vc as h,St as i,mc as j,Ow as k,Ct as l,p as m,Us as n,Zr as o,Zg as p,rPe as q,y as r,iPe as s,sPe as t,Jr as u,lPe as v,Ks as w,fw as x,Ht as y,Zu as z};
|
|
152
|
+
//# sourceMappingURL=index-NL4AEbnn.js.map
|