anarock-widgets 1.0.24 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +2 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -196,7 +196,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
|
196
196
|
*
|
|
197
197
|
* This source code is licensed under the MIT license found in the
|
|
198
198
|
* LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/var hb;function Y8(){return hb||(hb=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,s=t.useDebugValue;Of.useSyncExternalStoreWithSelector=function(l,c,u,f,d){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=o(function(){function g(w){if(!v){if(v=!0,b=w,w=f(w),d!==void 0&&m.hasValue){var O=m.value;if(d(O,w))return x=O}return x=w}if(O=x,r(b,w))return O;var E=f(w);return d!==void 0&&d(O,E)?(b=w,O):(b=w,x=E)}var v=!1,b,x,S=u===void 0?null:u;return[function(){return g(c())},S===null?void 0:function(){return g(S())}]},[c,u,f,d]);var p=n(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=p},[p]),s(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Of}var pb;function G8(){return pb||(pb=1,process.env.NODE_ENV==="production"?us.exports=q8():us.exports=Y8()),us.exports}G8();function X8(e){e()}function Z8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){X8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var mb={notify(){},get:()=>[]};function J8(e,t){let r,n=mb,i=0,a=!1;function o(p){u();const g=n.subscribe(p);let v=!1;return()=>{v||(v=!0,g(),f())}}function s(){n.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return a}function u(){i++,r||(r=e.subscribe(l),n=Z8())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=mb)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return m}var Q8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ez=Q8(),tz=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rz=tz(),nz=()=>ez||rz?A.useLayoutEffect:A.useEffect,iz=nz(),az=Symbol.for("react-redux-context"),oz=typeof globalThis<"u"?globalThis:{};function sz(){if(!A.createContext)return{};const e=oz[az]??=new Map;let t=e.get(A.createContext);return t||(t=A.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(A.createContext,t)),t}var lz=sz();function cz(e){const{children:t,context:r,serverState:n,store:i}=e,a=A.useMemo(()=>{const l=J8(i),c={store:i,subscription:l,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return c;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(c,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),o=A.useMemo(()=>i.getState(),[i]);iz(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const s=r||lz;return A.createElement(s.Provider,{value:a},t)}var uz=cz,fz=(e,t)=>t,Up=N([fz,ue,c2,ft,eS,an,y$,ct],S$),Kp=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},QS=lr("mouseClick"),eO=yo();eO.startListening({actionCreator:QS,effect:(e,t)=>{var r=e.payload,n=Up(t.getState(),Kp(r));n?.activeIndex!=null&&t.dispatch(E4({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Nd=lr("mouseMove"),tO=yo();tO.startListening({actionCreator:Nd,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=mp(n,n.tooltip.settings.shared),a=Up(n,Kp(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(q2({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(K2()))}});var gb={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},rO=Qt({name:"rootProps",initialState:gb,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:gb.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),dz=rO.reducer,{updateOptions:hz}=rO.actions,nO=Qt({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:pz}=nO.actions,mz=nO.reducer,iO=lr("keyDown"),aO=lr("focus"),qp=yo();qp.startListening({actionCreator:iO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Number(gp(i,ia(r))),s=an(r);if(a==="Enter"){var l=hl(r,"axis","hover",String(i.index));t.dispatch(Ad({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:l}));return}var c=v4(r),u=c==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,d=o+f*u;if(!(s==null||d>=s.length||d<0)){var h=hl(r,"axis","hover",String(d));t.dispatch(Ad({active:!0,activeIndex:d.toString(),activeDataKey:void 0,activeCoordinate:h}))}}}}});qp.startListening({actionCreator:aO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=hl(r,"axis","hover",String(a));t.dispatch(Ad({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ir=lr("externalEvent"),oO=yo();oO.startListening({actionCreator:ir,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:l$(r),activeDataKey:iS(r),activeIndex:xn(r),activeLabel:nS(r),activeTooltipIndex:xn(r),isTooltipActive:c$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var gz=N([na],e=>e.tooltipItemPayloads),vz=N([gz,Mo,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(s=>s.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),sO=lr("touchMove"),lO=yo();lO.startListening({actionCreator:sO,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=mp(n,n.tooltip.settings.shared);if(i==="axis"){var a=Up(n,Kp({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(q2({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var o,s=r.touches[0],l=document.elementFromPoint(s.clientX,s.clientY);if(!l||!l.getAttribute)return;var c=l.getAttribute(Hw),u=(o=l.getAttribute(Uw))!==null&&o!==void 0?o:void 0,f=vz(t.getState(),c,u);t.dispatch(U2({activeDataKey:u,activeIndex:c,activeCoordinate:f}))}}});var yz=dw({brush:r3,cartesianAxis:R6,chartData:F$,errorBars:tB,graphicalItems:t6,layout:Mj,legend:bD,options:N$,polarAxis:yF,polarOptions:mz,referenceElements:c3,rootProps:dz,tooltip:P4}),bz=function(t){return rj({reducer:yz,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([eO.middleware,tO.middleware,qp.middleware,oO.middleware,lO.middleware]),devTools:En.devToolsEnabled})};function cO(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Ft(),a=k.useRef(null);if(i)return r;a.current==null&&(a.current=bz(t));var o=uh;return A.createElement(uz,{context:o,store:a.current},r)}function uO(e){var{layout:t,width:r,height:n,margin:i}=e,a=et(),o=Ft();return k.useEffect(()=>{o||(a(Cj(t)),a(kj({width:r,height:n})),a(Pj(i)))},[a,o,t,r,n,i]),null}function fO(e){var t=et();return k.useEffect(()=>{t(hz(e))},[t,e]),null}var xz=["children"];function wz(e,t){if(e==null)return{};var r,n,i=_z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _z(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function _l(){return _l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_l.apply(null,arguments)}var Sz={width:"100%",height:"100%"},Oz=k.forwardRef((e,t)=>{var r=qw(),n=Yw(),i=Jw();if(!Bi(r)||!Bi(n))return null;var{children:a,otherAttributes:o,title:s,desc:l}=e,c,u;return typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0,A.createElement(D1,_l({},o,{title:s,desc:l,role:u,tabIndex:c,width:r,height:n,style:Sz,ref:t}),a)}),Az=e=>{var{children:t}=e,r=G(oc);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return A.createElement(D1,{width:n,height:i,x:o,y:a},t)},vb=k.forwardRef((e,t)=>{var{children:r}=e,n=wz(e,xz),i=Ft();return i?A.createElement(Az,null,r):A.createElement(Oz,_l({ref:t},n),r)});function Ez(){var e=et(),[t,r]=k.useState(null),n=G(oD);return k.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Jt(a)&&a!==n&&e(Tj(a))}},[t,e,n]),r}function yb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yb(Object(r),!0).forEach(function(n){Cz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cz(e,t,r){return(t=kz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kz(e){var t=Tz(e,"string");return typeof t=="symbol"?t:t+""}function Tz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mz=k.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:m,onTouchStart:p,style:g,width:v}=e,b=et(),[x,S]=k.useState(null),[w,O]=k.useState(null);Y$();var E=Ez(),C=k.useCallback(V=>{E(V),typeof t=="function"&&t(V),S(V),O(V)},[E,t,S,O]),M=k.useCallback(V=>{b(QS(V)),b(ir({handler:a,reactEvent:V}))},[b,a]),R=k.useCallback(V=>{b(Nd(V)),b(ir({handler:c,reactEvent:V}))},[b,c]),j=k.useCallback(V=>{b(K2()),b(ir({handler:u,reactEvent:V}))},[b,u]),_=k.useCallback(V=>{b(Nd(V)),b(ir({handler:f,reactEvent:V}))},[b,f]),I=k.useCallback(()=>{b(aO())},[b]),D=k.useCallback(V=>{b(iO(V.key))},[b]),L=k.useCallback(V=>{b(ir({handler:o,reactEvent:V}))},[b,o]),W=k.useCallback(V=>{b(ir({handler:s,reactEvent:V}))},[b,s]),H=k.useCallback(V=>{b(ir({handler:l,reactEvent:V}))},[b,l]),te=k.useCallback(V=>{b(ir({handler:d,reactEvent:V}))},[b,d]),Q=k.useCallback(V=>{b(ir({handler:p,reactEvent:V}))},[b,p]),F=k.useCallback(V=>{b(sO(V)),b(ir({handler:m,reactEvent:V}))},[b,m]),U=k.useCallback(V=>{b(ir({handler:h,reactEvent:V}))},[b,h]);return A.createElement(uS.Provider,{value:x},A.createElement(Nk.Provider,{value:w},A.createElement("div",{className:he("recharts-wrapper",n),style:Pz({position:"relative",cursor:"default",width:v,height:i},g),onClick:M,onContextMenu:L,onDoubleClick:W,onFocus:I,onKeyDown:D,onMouseDown:H,onMouseEnter:R,onMouseLeave:j,onMouseMove:_,onMouseUp:te,onTouchEnd:U,onTouchMove:F,onTouchStart:Q,ref:C},r)))}),jz=["children","className","width","height","style","compact","title","desc"];function Dz(e,t){if(e==null)return{};var r,n,i=Nz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Nz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var dO=k.forwardRef((e,t)=>{var{children:r,className:n,width:i,height:a,style:o,compact:s,title:l,desc:c}=e,u=Dz(e,jz),f=Dr(u);return s?A.createElement(vb,{otherAttributes:f,title:l,desc:c},r):A.createElement(Mz,{className:n,style:o,width:i,height:a,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},A.createElement(vb,{otherAttributes:f,title:l,desc:c,ref:t},A.createElement(f3,null,r)))}),Iz=["width","height"];function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Id.apply(null,arguments)}function Rz(e,t){if(e==null)return{};var r,n,i=$z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function $z(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Lz={top:5,right:5,bottom:5,left:5},Fz={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Lz,reverseStackOrder:!1,syncMethod:"index"},hO=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,Fz),{width:a,height:o}=i,s=Rz(i,Iz);if(!Bi(a)||!Bi(o))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:d}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return A.createElement(cO,{preloadedState:{options:h},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:l},A.createElement(WS,{chartData:d.data}),A.createElement(uO,{width:a,height:o,layout:i.layout,margin:i.margin}),A.createElement(fO,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(dO,Id({},s,{width:a,height:o,ref:r})))}),Bz=["axis"],pO=k.forwardRef((e,t)=>A.createElement(hO,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Bz,tooltipPayloadSearcher:Op,categoricalChartProps:e,ref:t})),zz=["axis","item"],Wz=k.forwardRef((e,t)=>A.createElement(hO,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:zz,tooltipPayloadSearcher:Op,categoricalChartProps:e,ref:t}));function Vz(e){var t=et();return k.useEffect(()=>{t(pz(e))},[t,e]),null}var Hz=["width","height","layout"];function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rd.apply(null,arguments)}function Uz(e,t){if(e==null)return{};var r,n,i=Kz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Kz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var qz={top:5,right:5,bottom:5,left:5},Yz={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:qz,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},Gz=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,Yz),{width:a,height:o,layout:s}=i,l=Uz(i,Hz);if(!Bi(a)||!Bi(o))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d}=t,h={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d,eventEmitter:void 0};return A.createElement(cO,{preloadedState:{options:h},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:c},A.createElement(WS,{chartData:i.data}),A.createElement(uO,{width:a,height:o,layout:s,margin:i.margin}),A.createElement(fO,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(Vz,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),A.createElement(dO,Rd({width:a,height:o},l,{ref:r})))}),Xz=["item"],Zz={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Cc=k.forwardRef((e,t)=>{var r=_t(e,Zz);return A.createElement(Gz,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Xz,tooltipPayloadSearcher:Op,categoricalChartProps:r,ref:t})});function Jz({isStatic:e,data:t}){const r=({value:u})=>{const f=u??0,d=f>=0;return y.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${d?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[d?y.jsx(y1,{}):y.jsx(v1,{}),f]})},n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),i=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),a=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),s=[{name:"Move-ins",value:n},{name:"Move-outs",value:i}],l={purple:"#8B5CF6",indigo:"#6366F1"},c=({active:u,payload:f})=>!u||!f||!f.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:f.map((d,h)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:d.color,marginRight:6}}),d.name,": ",y.jsx("div",{className:"font-semibold",children:d.value})]},h))});return y.jsx(ge,{title:"Community",period:"This Month",icon:y.jsx(Qd,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+i})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[y.jsx(r,{value:((a+o)/2).toFixed(2)}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),y.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:y.jsx(vi,{width:"75%",height:"100%",children:y.jsxs(Cc,{children:[y.jsxs(Do,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[y.jsx(jr,{fill:l.purple}),y.jsx(jr,{fill:l.indigo})]}),y.jsx(gi,{content:y.jsx(c,{})})]})})})]})})}function Qz({isStatic:e,data:t}){const r=[{name:"Notice",value:Number(t?.total_notices||0)},{name:"Post",value:Number(t?.total_topics||0)},{name:"Poll",value:Number(t?.total_polls||0)},{name:"Survey",value:Number(t?.total_surveys||0)}],n={Notice:"#8B5CF6",Post:"#22C55E",Poll:"#3B82F6",Survey:"#F59E0B"},i=({active:a,payload:o,label:s})=>!a||!o||!o.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[s&&y.jsx("div",{className:"font-medium mb-1",children:s}),o.map((l,c)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:l.color,marginRight:6}}),l.name,": ",y.jsx("div",{className:"font-semibold",children:l.value})]},c))]});return y.jsx(ge,{title:"Engagement",period:"This Month",icon:y.jsx(x1,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,children:y.jsx(vi,{width:"100%",height:"100%",children:y.jsxs(Wz,{data:r,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[y.jsx(Ec,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),y.jsx(to,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Pc,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),y.jsx(gi,{content:y.jsx(i,{}),cursor:{fill:"transparent"}}),y.jsx(BS,{dataKey:"value",barSize:40,isAnimationActive:!1,children:r.map(a=>y.jsx(jr,{fill:n[a.name]},a.name))})]})})})}function e7(e){if(!e)return 0;const[t,r]=e.split(" ");let[n,i]=t.split(":").map(Number);return r==="PM"&&n!==12&&(n+=12),r==="AM"&&n===12&&(n=0),n*60+i}function t7(e){return Array.from({length:24},(n,i)=>i).map(n=>{const i=e.find(l=>{const c=e7(l.slot_start_time);return Math.floor(c/60)===n}),a=n>=12?"PM":"AM";return{time:`${n%12||12} ${a}`,bookings:i?.slot_bookings||0,total:i?.total_slots||0,utilization:i?.utilization_rate||0}})}function r7({isStatic:e,data:t}){const r=Number(t?.totalBookings||0),n=Number(t?.totalSlots||0),i=Number(t?.utilizationRate||0),a=k.useMemo(()=>t?.slots?.length?t7(t.slots):[],[t]),o=f=>["1 AM","6 AM","11 AM","5 PM","10 PM"].includes(f)?f:"",s=({active:f,payload:d,label:h})=>!f||!d||!d.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[h&&y.jsx("div",{className:"font-medium mb-1",children:h}),d.map((m,p)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:m.color}}),m.name,": ",y.jsx("div",{className:"font-semibold",children:m.value})]},p))]}),l=a.length>0?Math.max(...a.map(f=>f.total),5):5;function c(f){const d=f>=12?"PM":"AM";let h=f%12;return h===0&&(h=12),`${h} ${d}`}const u=a.length?a:Array.from({length:24},(f,d)=>({time:c(d),bookings:0,total:0,utilizationRate:0}));return y.jsxs(ge,{title:"Facilities",period:"Today",icon:y.jsx(b1,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),y.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:r})]}),y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Total Slots"}),y.jsx("div",{className:"!text-[24px] font-medium text-[#F59E0B]",children:n})]}),y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),y.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[i.toFixed(2),"%"]})]})]}),y.jsx("div",{className:"w-full h-[170px]",children:y.jsx(vi,{width:"100%",height:"100%",children:y.jsxs(pO,{data:u,margin:{top:0,right:-30,left:-40,bottom:0},children:[y.jsx(Ec,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Pc,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),y.jsx(to,{yAxisId:"left",domain:[0,l],tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),y.jsx(to,{yAxisId:"right",orientation:"right",domain:[20,100],ticks:[20,40,60,80,100],tickFormatter:f=>`${f}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),y.jsx(gi,{content:y.jsx(s,{})}),y.jsx(ri,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),y.jsx(ri,{yAxisId:"left",type:"monotone",dataKey:"total",name:"Total Slots",stroke:"#F59E0B",strokeWidth:2,dot:!1}),y.jsx(ri,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function n7({data:e}){const t=e?.incomeSummary||{},r=e?.expenditureSummary||{},n=["AED","USD","EUR"],i=["Rs","INR","₹"];function a(s){if(s==null||isNaN(s))return"0";const l=Number(s);return l>=1e9?(l/1e9).toFixed(l%1e9===0?0:2)+"B":l>=1e6?(l/1e6).toFixed(l%1e6===0?0:2)+"M":l>=1e3?(l/1e3).toFixed(l%1e3===0?0:2)+"K":l.toFixed(l%1===0?0:2)}function o(s,l){return l?i.includes(l)?`${l} ${a(s)}`:n.includes(l)?`${a(s)} ${l}`:`${a(s)} ${l}`:a(s)}return y.jsx(ge,{title:"Income",period:"This Month",icon:y.jsx(yg,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Income"}),y.jsx("div",{children:"Collection"}),y.jsx("div",{children:"Closing"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[y.jsx("div",{children:o(t.opening_balance,t?.currency_type)}),y.jsx("div",{children:o(t.income,t?.currency_type)}),y.jsx("div",{children:o(t.collection,t?.currency_type)}),y.jsx("div",{children:o(t.closing_balance,t?.currency_type)})]}),y.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),y.jsx("div",{className:"flex items-center justify-between",children:y.jsxs("div",{className:"flex items-center gap-[12px]",children:[y.jsx(yg,{className:"!text-[24px] text-red-600"}),y.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Expenditure"}),y.jsx("div",{children:"Payment"}),y.jsx("div",{children:"Outstanding"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[y.jsx("div",{children:o(r.opening_balance,r?.currency_type)}),y.jsx("div",{children:o(r.expenditure,r?.currency_type)}),y.jsx("div",{children:o(r.payment,r?.currency_type)}),y.jsx("div",{children:o(r.outstanding,r?.currency_type)})]})]})})}function i7(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function a7(e){return Array.from({length:24},(t,r)=>{const n=e.find(i=>i.hour===r)||{};return{hour:r,time:i7(r),walkins:n.walkins??0,checkins:n.preApproved??0,staffAttendance:n.staffAttendance??0}})}function o7({isStatic:e,data:t}){const r={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"},n=t?.summary?.activeWalkins||{},i=t?.summary?.preApprovedCheckins||{},a=t?.summary?.staffAttendance||{},o=a7(t?.chart||[]),s=Math.max(...o.flatMap(f=>[f.walkins,f.checkins,f.staffAttendance])),l=s>0?s:5,c=[0,Math.ceil(l/2),l],u=({active:f,payload:d,label:h})=>!f||!d||!d.length?null:y.jsxs("div",{className:"bg-black text-white text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[h&&y.jsx("div",{className:"font-medium mb-1",children:h}),d.map((m,p)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:m.color,marginRight:6}}),m.name,": ",y.jsx("div",{className:"font-semibold",children:m.value})]},p))]});return y.jsx(ge,{title:"Gate Updates",period:"Today",icon:y.jsx(_1,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#1FA05B] flex items-center",children:[n.visitor_in??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",n.total_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:"Pre-approved Check-ins"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#E7A015] flex items-center",children:[i.expected_pass_scanned??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",i.total_expected_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Staff Attendance"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#329DFF] flex items-center",children:[a.total_in_now??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",a.total_in_today??0]})]})]})]}),y.jsx("div",{className:"w-full h-[105px]",children:y.jsx(vi,{width:"100%",height:"100%",children:y.jsxs(pO,{data:o,margin:{top:1,right:0,left:-40,bottom:0},children:[y.jsx(Ec,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Pc,{dataKey:"time",tickFormatter:(f,d)=>d%4===0?f:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(to,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:c,domain:[0,l],allowDecimals:!1,axisLine:!1,tickLine:!1}),y.jsx(gi,{content:y.jsx(u,{})}),y.jsx(ri,{type:"monotone",dataKey:"walkins",stroke:r.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),y.jsx(ri,{type:"monotone",dataKey:"checkins",stroke:r.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),y.jsx(ri,{type:"monotone",dataKey:"staffAttendance",stroke:r.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function s7({isStatic:e,data:t}){const r=({value:l})=>{const c=l??0,u=c>=0;return y.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${u?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[u?y.jsx(y1,{}):y.jsx(v1,{}),c]})},n=[{name:"L1",value:Number(t?.today_L1||0)},{name:"L2",value:Number(t?.today_L2||0)},{name:"L3",value:Number(t?.today_L3||0)},{name:"No Level",value:Number(t?.today_NoLevel||0)}];n.reduce((l,c)=>l+c.value,0);const i=n,a=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],o=({color:l})=>y.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:l,marginRight:"6px"}}),s=({active:l,payload:c})=>!l||!c||!c.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:c.map((u,f)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx(o,{color:u.color}),u.name,": ",y.jsx("div",{className:"font-semibold",children:u.value})]},f))});return y.jsx(ge,{title:"Helpdesk",period:"Today",icon:y.jsx(gk,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex gap-[12px] h-fit",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Open Complaints"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[y.jsx(r,{value:t?.percent_change}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),y.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:y.jsx(vi,{width:"75%",height:"100%",children:y.jsxs(Cc,{children:[y.jsx(Do,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((l,c)=>y.jsx(jr,{fill:a[c]||"#CBD5E1"},l.name))}),y.jsx(gi,{content:y.jsx(s,{})})]})})})]})})}/*!
|
|
199
|
+
*/var hb;function Y8(){return hb||(hb=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,s=t.useDebugValue;Of.useSyncExternalStoreWithSelector=function(l,c,u,f,d){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=o(function(){function g(w){if(!v){if(v=!0,b=w,w=f(w),d!==void 0&&m.hasValue){var O=m.value;if(d(O,w))return x=O}return x=w}if(O=x,r(b,w))return O;var E=f(w);return d!==void 0&&d(O,E)?(b=w,O):(b=w,x=E)}var v=!1,b,x,S=u===void 0?null:u;return[function(){return g(c())},S===null?void 0:function(){return g(S())}]},[c,u,f,d]);var p=n(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=p},[p]),s(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Of}var pb;function G8(){return pb||(pb=1,process.env.NODE_ENV==="production"?us.exports=q8():us.exports=Y8()),us.exports}G8();function X8(e){e()}function Z8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){X8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var mb={notify(){},get:()=>[]};function J8(e,t){let r,n=mb,i=0,a=!1;function o(p){u();const g=n.subscribe(p);let v=!1;return()=>{v||(v=!0,g(),f())}}function s(){n.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return a}function u(){i++,r||(r=e.subscribe(l),n=Z8())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=mb)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return m}var Q8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ez=Q8(),tz=()=>typeof navigator<"u"&&navigator.product==="ReactNative",rz=tz(),nz=()=>ez||rz?A.useLayoutEffect:A.useEffect,iz=nz(),az=Symbol.for("react-redux-context"),oz=typeof globalThis<"u"?globalThis:{};function sz(){if(!A.createContext)return{};const e=oz[az]??=new Map;let t=e.get(A.createContext);return t||(t=A.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(A.createContext,t)),t}var lz=sz();function cz(e){const{children:t,context:r,serverState:n,store:i}=e,a=A.useMemo(()=>{const l=J8(i),c={store:i,subscription:l,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return c;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(c,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),o=A.useMemo(()=>i.getState(),[i]);iz(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const s=r||lz;return A.createElement(s.Provider,{value:a},t)}var uz=cz,fz=(e,t)=>t,Up=N([fz,ue,c2,ft,eS,an,y$,ct],S$),Kp=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},QS=lr("mouseClick"),eO=yo();eO.startListening({actionCreator:QS,effect:(e,t)=>{var r=e.payload,n=Up(t.getState(),Kp(r));n?.activeIndex!=null&&t.dispatch(E4({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Nd=lr("mouseMove"),tO=yo();tO.startListening({actionCreator:Nd,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=mp(n,n.tooltip.settings.shared),a=Up(n,Kp(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(q2({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(K2()))}});var gb={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},rO=Qt({name:"rootProps",initialState:gb,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:gb.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),dz=rO.reducer,{updateOptions:hz}=rO.actions,nO=Qt({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:pz}=nO.actions,mz=nO.reducer,iO=lr("keyDown"),aO=lr("focus"),qp=yo();qp.startListening({actionCreator:iO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Number(gp(i,ia(r))),s=an(r);if(a==="Enter"){var l=hl(r,"axis","hover",String(i.index));t.dispatch(Ad({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:l}));return}var c=v4(r),u=c==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,d=o+f*u;if(!(s==null||d>=s.length||d<0)){var h=hl(r,"axis","hover",String(d));t.dispatch(Ad({active:!0,activeIndex:d.toString(),activeDataKey:void 0,activeCoordinate:h}))}}}}});qp.startListening({actionCreator:aO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=hl(r,"axis","hover",String(a));t.dispatch(Ad({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ir=lr("externalEvent"),oO=yo();oO.startListening({actionCreator:ir,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:l$(r),activeDataKey:iS(r),activeIndex:xn(r),activeLabel:nS(r),activeTooltipIndex:xn(r),isTooltipActive:c$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var gz=N([na],e=>e.tooltipItemPayloads),vz=N([gz,Mo,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(s=>s.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),sO=lr("touchMove"),lO=yo();lO.startListening({actionCreator:sO,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=mp(n,n.tooltip.settings.shared);if(i==="axis"){var a=Up(n,Kp({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(q2({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var o,s=r.touches[0],l=document.elementFromPoint(s.clientX,s.clientY);if(!l||!l.getAttribute)return;var c=l.getAttribute(Hw),u=(o=l.getAttribute(Uw))!==null&&o!==void 0?o:void 0,f=vz(t.getState(),c,u);t.dispatch(U2({activeDataKey:u,activeIndex:c,activeCoordinate:f}))}}});var yz=dw({brush:r3,cartesianAxis:R6,chartData:F$,errorBars:tB,graphicalItems:t6,layout:Mj,legend:bD,options:N$,polarAxis:yF,polarOptions:mz,referenceElements:c3,rootProps:dz,tooltip:P4}),bz=function(t){return rj({reducer:yz,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([eO.middleware,tO.middleware,qp.middleware,oO.middleware,lO.middleware]),devTools:En.devToolsEnabled})};function cO(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Ft(),a=k.useRef(null);if(i)return r;a.current==null&&(a.current=bz(t));var o=uh;return A.createElement(uz,{context:o,store:a.current},r)}function uO(e){var{layout:t,width:r,height:n,margin:i}=e,a=et(),o=Ft();return k.useEffect(()=>{o||(a(Cj(t)),a(kj({width:r,height:n})),a(Pj(i)))},[a,o,t,r,n,i]),null}function fO(e){var t=et();return k.useEffect(()=>{t(hz(e))},[t,e]),null}var xz=["children"];function wz(e,t){if(e==null)return{};var r,n,i=_z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _z(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function _l(){return _l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_l.apply(null,arguments)}var Sz={width:"100%",height:"100%"},Oz=k.forwardRef((e,t)=>{var r=qw(),n=Yw(),i=Jw();if(!Bi(r)||!Bi(n))return null;var{children:a,otherAttributes:o,title:s,desc:l}=e,c,u;return typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0,A.createElement(D1,_l({},o,{title:s,desc:l,role:u,tabIndex:c,width:r,height:n,style:Sz,ref:t}),a)}),Az=e=>{var{children:t}=e,r=G(oc);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return A.createElement(D1,{width:n,height:i,x:o,y:a},t)},vb=k.forwardRef((e,t)=>{var{children:r}=e,n=wz(e,xz),i=Ft();return i?A.createElement(Az,null,r):A.createElement(Oz,_l({ref:t},n),r)});function Ez(){var e=et(),[t,r]=k.useState(null),n=G(oD);return k.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Jt(a)&&a!==n&&e(Tj(a))}},[t,e,n]),r}function yb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yb(Object(r),!0).forEach(function(n){Cz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cz(e,t,r){return(t=kz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kz(e){var t=Tz(e,"string");return typeof t=="symbol"?t:t+""}function Tz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mz=k.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:m,onTouchStart:p,style:g,width:v}=e,b=et(),[x,S]=k.useState(null),[w,O]=k.useState(null);Y$();var E=Ez(),C=k.useCallback(V=>{E(V),typeof t=="function"&&t(V),S(V),O(V)},[E,t,S,O]),M=k.useCallback(V=>{b(QS(V)),b(ir({handler:a,reactEvent:V}))},[b,a]),R=k.useCallback(V=>{b(Nd(V)),b(ir({handler:c,reactEvent:V}))},[b,c]),j=k.useCallback(V=>{b(K2()),b(ir({handler:u,reactEvent:V}))},[b,u]),_=k.useCallback(V=>{b(Nd(V)),b(ir({handler:f,reactEvent:V}))},[b,f]),I=k.useCallback(()=>{b(aO())},[b]),D=k.useCallback(V=>{b(iO(V.key))},[b]),L=k.useCallback(V=>{b(ir({handler:o,reactEvent:V}))},[b,o]),W=k.useCallback(V=>{b(ir({handler:s,reactEvent:V}))},[b,s]),H=k.useCallback(V=>{b(ir({handler:l,reactEvent:V}))},[b,l]),te=k.useCallback(V=>{b(ir({handler:d,reactEvent:V}))},[b,d]),Q=k.useCallback(V=>{b(ir({handler:p,reactEvent:V}))},[b,p]),F=k.useCallback(V=>{b(sO(V)),b(ir({handler:m,reactEvent:V}))},[b,m]),U=k.useCallback(V=>{b(ir({handler:h,reactEvent:V}))},[b,h]);return A.createElement(uS.Provider,{value:x},A.createElement(Nk.Provider,{value:w},A.createElement("div",{className:he("recharts-wrapper",n),style:Pz({position:"relative",cursor:"default",width:v,height:i},g),onClick:M,onContextMenu:L,onDoubleClick:W,onFocus:I,onKeyDown:D,onMouseDown:H,onMouseEnter:R,onMouseLeave:j,onMouseMove:_,onMouseUp:te,onTouchEnd:U,onTouchMove:F,onTouchStart:Q,ref:C},r)))}),jz=["children","className","width","height","style","compact","title","desc"];function Dz(e,t){if(e==null)return{};var r,n,i=Nz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Nz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var dO=k.forwardRef((e,t)=>{var{children:r,className:n,width:i,height:a,style:o,compact:s,title:l,desc:c}=e,u=Dz(e,jz),f=Dr(u);return s?A.createElement(vb,{otherAttributes:f,title:l,desc:c},r):A.createElement(Mz,{className:n,style:o,width:i,height:a,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},A.createElement(vb,{otherAttributes:f,title:l,desc:c,ref:t},A.createElement(f3,null,r)))}),Iz=["width","height"];function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Id.apply(null,arguments)}function Rz(e,t){if(e==null)return{};var r,n,i=$z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function $z(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Lz={top:5,right:5,bottom:5,left:5},Fz={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Lz,reverseStackOrder:!1,syncMethod:"index"},hO=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,Fz),{width:a,height:o}=i,s=Rz(i,Iz);if(!Bi(a)||!Bi(o))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:d}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return A.createElement(cO,{preloadedState:{options:h},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:l},A.createElement(WS,{chartData:d.data}),A.createElement(uO,{width:a,height:o,layout:i.layout,margin:i.margin}),A.createElement(fO,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(dO,Id({},s,{width:a,height:o,ref:r})))}),Bz=["axis"],pO=k.forwardRef((e,t)=>A.createElement(hO,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Bz,tooltipPayloadSearcher:Op,categoricalChartProps:e,ref:t})),zz=["axis","item"],Wz=k.forwardRef((e,t)=>A.createElement(hO,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:zz,tooltipPayloadSearcher:Op,categoricalChartProps:e,ref:t}));function Vz(e){var t=et();return k.useEffect(()=>{t(pz(e))},[t,e]),null}var Hz=["width","height","layout"];function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rd.apply(null,arguments)}function Uz(e,t){if(e==null)return{};var r,n,i=Kz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Kz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var qz={top:5,right:5,bottom:5,left:5},Yz={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:qz,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},Gz=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,Yz),{width:a,height:o,layout:s}=i,l=Uz(i,Hz);if(!Bi(a)||!Bi(o))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d}=t,h={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d,eventEmitter:void 0};return A.createElement(cO,{preloadedState:{options:h},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:c},A.createElement(WS,{chartData:i.data}),A.createElement(uO,{width:a,height:o,layout:s,margin:i.margin}),A.createElement(fO,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(Vz,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),A.createElement(dO,Rd({width:a,height:o},l,{ref:r})))}),Xz=["item"],Zz={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Cc=k.forwardRef((e,t)=>{var r=_t(e,Zz);return A.createElement(Gz,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Xz,tooltipPayloadSearcher:Op,categoricalChartProps:r,ref:t})});function Jz({isStatic:e,data:t}){const r=({value:u})=>{const f=u??0,d=f>=0;return y.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${d?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[d?y.jsx(y1,{}):y.jsx(v1,{}),f,"%"]})},n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),i=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),a=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),s=[{name:"Move-ins",value:n},{name:"Move-outs",value:i}],l={purple:"#8B5CF6",indigo:"#6366F1"},c=({active:u,payload:f})=>!u||!f||!f.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:f.map((d,h)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:d.color,marginRight:6}}),d.name,": ",y.jsx("div",{className:"font-semibold",children:d.value})]},h))});return y.jsx(ge,{title:"Community",period:"This Month",icon:y.jsx(Qd,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+i})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[y.jsx(r,{value:((a+o)/2).toFixed(2)}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),y.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:y.jsx(vi,{width:"75%",height:"100%",children:y.jsxs(Cc,{children:[y.jsxs(Do,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[y.jsx(jr,{fill:l.purple}),y.jsx(jr,{fill:l.indigo})]}),y.jsx(gi,{content:y.jsx(c,{})})]})})})]})})}function Qz({isStatic:e,data:t}){const r=[{name:"Notice",value:Number(t?.total_notices||0)},{name:"Post",value:Number(t?.total_topics||0)},{name:"Poll",value:Number(t?.total_polls||0)},{name:"Survey",value:Number(t?.total_surveys||0)}],n={Notice:"#8B5CF6",Post:"#22C55E",Poll:"#3B82F6",Survey:"#F59E0B"},i=({active:a,payload:o,label:s})=>!a||!o||!o.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[s&&y.jsx("div",{className:"font-medium mb-1",children:s}),o.map((l,c)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:l.color,marginRight:6}}),l.name,": ",y.jsx("div",{className:"font-semibold",children:l.value})]},c))]});return y.jsx(ge,{title:"Engagement",period:"This Month",icon:y.jsx(x1,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,children:y.jsx(vi,{width:"100%",height:"100%",children:y.jsxs(Wz,{data:r,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[y.jsx(Ec,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),y.jsx(to,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Pc,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),y.jsx(gi,{content:y.jsx(i,{}),cursor:{fill:"transparent"}}),y.jsx(BS,{dataKey:"value",barSize:40,isAnimationActive:!1,children:r.map(a=>y.jsx(jr,{fill:n[a.name]},a.name))})]})})})}function e7(e){if(!e)return 0;const[t,r]=e.split(" ");let[n,i]=t.split(":").map(Number);return r==="PM"&&n!==12&&(n+=12),r==="AM"&&n===12&&(n=0),n*60+i}function t7(e){return Array.from({length:24},(n,i)=>i).map(n=>{const i=e.find(l=>{const c=e7(l.slot_start_time);return Math.floor(c/60)===n}),a=n>=12?"PM":"AM";return{time:`${n%12||12} ${a}`,bookings:i?.slot_bookings||0,total:i?.total_slots||0,utilization:i?.utilization_rate||0}})}function r7({isStatic:e,data:t}){const r=Number(t?.totalBookings||0),n=Number(t?.totalSlots||0),i=Number(t?.utilizationRate||0),a=k.useMemo(()=>t?.slots?.length?t7(t.slots):[],[t]),o=f=>["1 AM","6 AM","11 AM","5 PM","10 PM"].includes(f)?f:"",s=({active:f,payload:d,label:h})=>!f||!d||!d.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[h&&y.jsx("div",{className:"font-medium mb-1",children:h}),d.map((m,p)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:m.color}}),m.name,": ",y.jsx("div",{className:"font-semibold",children:m.value})]},p))]}),l=a.length>0?Math.max(...a.map(f=>f.total),5):5;function c(f){const d=f>=12?"PM":"AM";let h=f%12;return h===0&&(h=12),`${h} ${d}`}const u=a.length?a:Array.from({length:24},(f,d)=>({time:c(d),bookings:0,total:0,utilizationRate:0}));return y.jsxs(ge,{title:"Facilities",period:"Today",icon:y.jsx(b1,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),y.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:r})]}),y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Total Slots"}),y.jsx("div",{className:"!text-[24px] font-medium text-[#F59E0B]",children:n})]}),y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),y.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[i.toFixed(2),"%"]})]})]}),y.jsx("div",{className:"w-full h-[170px]",children:y.jsx(vi,{width:"100%",height:"100%",children:y.jsxs(pO,{data:u,margin:{top:0,right:-30,left:-40,bottom:0},children:[y.jsx(Ec,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Pc,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),y.jsx(to,{yAxisId:"left",domain:[0,l],tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),y.jsx(to,{yAxisId:"right",orientation:"right",domain:[20,100],ticks:[20,40,60,80,100],tickFormatter:f=>`${f}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),y.jsx(gi,{content:y.jsx(s,{})}),y.jsx(ri,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),y.jsx(ri,{yAxisId:"left",type:"monotone",dataKey:"total",name:"Total Slots",stroke:"#F59E0B",strokeWidth:2,dot:!1}),y.jsx(ri,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function n7({data:e}){const t=e?.incomeSummary||{},r=e?.expenditureSummary||{},n=["AED","USD","EUR"],i=["Rs","INR","₹"];function a(s){if(s==null||isNaN(s))return"0";const l=Number(s);return l>=1e9?(l/1e9).toFixed(l%1e9===0?0:2)+"B":l>=1e6?(l/1e6).toFixed(l%1e6===0?0:2)+"M":l>=1e3?(l/1e3).toFixed(l%1e3===0?0:2)+"K":l.toFixed(l%1===0?0:2)}function o(s,l){return l?i.includes(l)?`${l} ${a(s)}`:n.includes(l)?`${a(s)} ${l}`:`${a(s)} ${l}`:a(s)}return y.jsx(ge,{title:"Income",period:"This Month",icon:y.jsx(yg,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Income"}),y.jsx("div",{children:"Collection"}),y.jsx("div",{children:"Closing"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[y.jsx("div",{children:o(t.opening_balance,t?.currency_type)}),y.jsx("div",{children:o(t.income,t?.currency_type)}),y.jsx("div",{children:o(t.collection,t?.currency_type)}),y.jsx("div",{children:o(t.closing_balance,t?.currency_type)})]}),y.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),y.jsx("div",{className:"flex items-center justify-between",children:y.jsxs("div",{className:"flex items-center gap-[12px]",children:[y.jsx(yg,{className:"!text-[24px] text-red-600"}),y.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Expenditure"}),y.jsx("div",{children:"Payment"}),y.jsx("div",{children:"Outstanding"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[y.jsx("div",{children:o(r.opening_balance,r?.currency_type)}),y.jsx("div",{children:o(r.expenditure,r?.currency_type)}),y.jsx("div",{children:o(r.payment,r?.currency_type)}),y.jsx("div",{children:o(r.outstanding,r?.currency_type)})]})]})})}function i7(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function a7(e){return Array.from({length:24},(t,r)=>{const n=e.find(i=>i.hour===r)||{};return{hour:r,time:i7(r),walkins:n.walkins??0,checkins:n.preApproved??0,staffAttendance:n.staffAttendance??0}})}function o7({isStatic:e,data:t}){const r={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"},n=t?.summary?.activeWalkins||{},i=t?.summary?.preApprovedCheckins||{},a=t?.summary?.staffAttendance||{},o=a7(t?.chart||[]),s=Math.max(...o.flatMap(f=>[f.walkins,f.checkins,f.staffAttendance])),l=s>0?s:5,c=[0,Math.ceil(l/2),l],u=({active:f,payload:d,label:h})=>!f||!d||!d.length?null:y.jsxs("div",{className:"bg-black text-white text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[h&&y.jsx("div",{className:"font-medium mb-1",children:h}),d.map((m,p)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:m.color,marginRight:6}}),m.name,": ",y.jsx("div",{className:"font-semibold",children:m.value})]},p))]});return y.jsx(ge,{title:"Gate Updates",period:"Today",icon:y.jsx(_1,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#1FA05B] flex items-center",children:[n.visitor_in??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",n.total_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:"Pre-approved Check-ins"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#E7A015] flex items-center",children:[i.expected_pass_scanned??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",i.total_expected_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Staff Attendance"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#329DFF] flex items-center",children:[a.total_in_now??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",a.total_in_today??0]})]})]})]}),y.jsx("div",{className:"w-full h-[105px]",children:y.jsx(vi,{width:"100%",height:"100%",children:y.jsxs(pO,{data:o,margin:{top:1,right:0,left:-40,bottom:0},children:[y.jsx(Ec,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Pc,{dataKey:"time",tickFormatter:(f,d)=>d%4===0?f:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(to,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:c,domain:[0,l],allowDecimals:!1,axisLine:!1,tickLine:!1}),y.jsx(gi,{content:y.jsx(u,{})}),y.jsx(ri,{type:"monotone",dataKey:"walkins",stroke:r.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),y.jsx(ri,{type:"monotone",dataKey:"checkins",stroke:r.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),y.jsx(ri,{type:"monotone",dataKey:"staffAttendance",stroke:r.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function s7({isStatic:e,data:t}){const r=({value:l})=>{const c=l??0,u=c>=0;return y.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${u?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[u?y.jsx(y1,{}):y.jsx(v1,{}),c]})},n=[{name:"L1",value:Number(t?.today_L1||0)},{name:"L2",value:Number(t?.today_L2||0)},{name:"L3",value:Number(t?.today_L3||0)},{name:"No Level",value:Number(t?.today_NoLevel||0)}];n.reduce((l,c)=>l+c.value,0);const i=n,a=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],o=({color:l})=>y.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:l,marginRight:"6px"}}),s=({active:l,payload:c})=>!l||!c||!c.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:c.map((u,f)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx(o,{color:u.color}),u.name,": ",y.jsx("div",{className:"font-semibold",children:u.value})]},f))});return y.jsx(ge,{title:"Helpdesk",period:"Today",icon:y.jsx(gk,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex gap-[12px] h-fit",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Open Complaints"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[y.jsx(r,{value:t?.percent_change}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),y.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:y.jsx(vi,{width:"75%",height:"100%",children:y.jsxs(Cc,{children:[y.jsx(Do,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((l,c)=>y.jsx(jr,{fill:a[c]||"#CBD5E1"},l.name))}),y.jsx(gi,{content:y.jsx(s,{})})]})})})]})})}/*!
|
|
200
200
|
* @kurkle/color v0.3.4
|
|
201
201
|
* https://github.com/kurkle/color#readme
|
|
202
202
|
* (c) 2024 Jukka Kurkela
|
package/dist/index.es.js
CHANGED
|
@@ -22504,7 +22504,8 @@ function SU({ isStatic: e, data: t }) {
|
|
|
22504
22504
|
className: `w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${d ? "bg-[#F7FEFA] text-[#1FA05B]" : "bg-[#FFF2F2] text-[#AB0000]"}`,
|
|
22505
22505
|
children: [
|
|
22506
22506
|
d ? /* @__PURE__ */ y.jsx(M1, {}) : /* @__PURE__ */ y.jsx(T1, {}),
|
|
22507
|
-
f
|
|
22507
|
+
f,
|
|
22508
|
+
"%"
|
|
22508
22509
|
]
|
|
22509
22510
|
}
|
|
22510
22511
|
);
|
package/dist/index.umd.js
CHANGED
|
@@ -196,7 +196,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
|
|
|
196
196
|
*
|
|
197
197
|
* This source code is licensed under the MIT license found in the
|
|
198
198
|
* LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/var v2;function O8(){return v2||(v2=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,s=t.useDebugValue;yp.useSyncExternalStoreWithSelector=function(l,c,u,f,d){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=o(function(){function g(w){if(!v){if(v=!0,b=w,w=f(w),d!==void 0&&m.hasValue){var O=m.value;if(d(O,w))return x=O}return x=w}if(O=x,r(b,w))return O;var E=f(w);return d!==void 0&&d(O,E)?(b=w,O):(b=w,x=E)}var v=!1,b,x,S=u===void 0?null:u;return[function(){return g(c())},S===null?void 0:function(){return g(S())}]},[c,u,f,d]);var p=n(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=p},[p]),s(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),yp}var y2;function A8(){return y2||(y2=1,process.env.NODE_ENV==="production"?ec.exports=S8():ec.exports=O8()),ec.exports}A8();function E8(e){e()}function P8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){E8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var b2={notify(){},get:()=>[]};function C8(e,t){let r,n=b2,i=0,a=!1;function o(p){u();const g=n.subscribe(p);let v=!1;return()=>{v||(v=!0,g(),f())}}function s(){n.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return a}function u(){i++,r||(r=e.subscribe(l),n=P8())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=b2)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return m}var k8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",T8=k8(),M8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",j8=M8(),D8=()=>T8||j8?A.useLayoutEffect:A.useEffect,N8=D8(),I8=Symbol.for("react-redux-context"),$8=typeof globalThis<"u"?globalThis:{};function R8(){if(!A.createContext)return{};const e=$8[I8]??=new Map;let t=e.get(A.createContext);return t||(t=A.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(A.createContext,t)),t}var L8=R8();function F8(e){const{children:t,context:r,serverState:n,store:i}=e,a=A.useMemo(()=>{const l=C8(i),c={store:i,subscription:l,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return c;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(c,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),o=A.useMemo(()=>i.getState(),[i]);N8(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const s=r||L8;return A.createElement(s.Provider,{value:a},t)}var B8=F8,z8=(e,t)=>t,bp=N([z8,ue,g1,ct,pw,Qr,Y$,st],Q$),xp=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},x2=ar("mouseClick"),w2=Ta();w2.startListening({actionCreator:x2,effect:(e,t)=>{var r=e.payload,n=bp(t.getState(),xp(r));n?.activeIndex!=null&&t.dispatch(r$({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var wp=ar("mouseMove"),_2=Ta();_2.startListening({actionCreator:wp,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gh(n,n.tooltip.settings.shared),a=bp(n,xp(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(iw({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(nw()))}});var S2={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},O2=qt({name:"rootProps",initialState:S2,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:S2.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),W8=O2.reducer,{updateOptions:V8}=O2.actions,A2=qt({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:H8}=A2.actions,U8=A2.reducer,E2=ar("keyDown"),P2=ar("focus"),_p=Ta();_p.startListening({actionCreator:E2,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Number(bh(i,Gi(r))),s=Qr(r);if(a==="Enter"){var l=Fl(r,"axis","hover",String(i.index));t.dispatch(yh({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:l}));return}var c=q4(r),u=c==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,d=o+f*u;if(!(s==null||d>=s.length||d<0)){var h=Fl(r,"axis","hover",String(d));t.dispatch(yh({active:!0,activeIndex:d.toString(),activeDataKey:void 0,activeCoordinate:h}))}}}}}),_p.startListening({actionCreator:P2,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=Fl(r,"axis","hover",String(a));t.dispatch(yh({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ur=ar("externalEvent"),C2=Ta();C2.startListening({actionCreator:ur,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:L$(r),activeDataKey:yw(r),activeIndex:wn(r),activeLabel:vw(r),activeTooltipIndex:wn(r),isTooltipActive:F$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var K8=N([Yi],e=>e.tooltipItemPayloads),q8=N([K8,io,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(s=>s.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),k2=ar("touchMove"),T2=Ta();T2.startListening({actionCreator:k2,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gh(n,n.tooltip.settings.shared);if(i==="axis"){var a=bp(n,xp({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(iw({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var o,s=r.touches[0],l=document.elementFromPoint(s.clientX,s.clientY);if(!l||!l.getAttribute)return;var c=l.getAttribute(W0),u=(o=l.getAttribute(V0))!==null&&o!==void 0?o:void 0,f=q8(t.getState(),c,u);t.dispatch(rw({activeDataKey:u,activeIndex:c,activeCoordinate:f}))}}});var Y8=Uy({brush:jB,cartesianAxis:d6,chartData:mR,errorBars:M6,graphicalItems:MF,layout:lj,legend:Xj,options:uR,polarAxis:YL,polarOptions:U8,referenceElements:FB,rootProps:W8,tooltip:n$}),G8=function(t){return DM({reducer:Y8,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([w2.middleware,_2.middleware,_p.middleware,C2.middleware,T2.middleware]),devTools:dn.devToolsEnabled})};function M2(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Nt(),a=k.useRef(null);if(i)return r;a.current==null&&(a.current=G8(t));var o=pf;return A.createElement(B8,{context:o,store:a.current},r)}function j2(e){var{layout:t,width:r,height:n,margin:i}=e,a=Ze(),o=Nt();return k.useEffect(()=>{o||(a(aj(t)),a(oj({width:r,height:n})),a(ij(i)))},[a,o,t,r,n,i]),null}function D2(e){var t=Ze();return k.useEffect(()=>{t(V8(e))},[t,e]),null}var X8=["children"];function Z8(e,t){if(e==null)return{};var r,n,i=J8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function J8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function tc(){return tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tc.apply(null,arguments)}var Q8={width:"100%",height:"100%"},ez=k.forwardRef((e,t)=>{var r=K0(),n=q0(),i=eb();if(!Ni(r)||!Ni(n))return null;var{children:a,otherAttributes:o,title:s,desc:l}=e,c,u;return typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0,A.createElement(dv,tc({},o,{title:s,desc:l,role:u,tabIndex:c,width:r,height:n,style:Q8,ref:t}),a)}),tz=e=>{var{children:t}=e,r=G(Js);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return A.createElement(dv,{width:n,height:i,x:o,y:a},t)},N2=k.forwardRef((e,t)=>{var{children:r}=e,n=Z8(e,X8),i=Nt();return i?A.createElement(tz,null,r):A.createElement(ez,tc({ref:t},n),r)});function rz(){var e=Ze(),[t,r]=k.useState(null),n=G(Rj);return k.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Yt(a)&&a!==n&&e(sj(a))}},[t,e,n]),r}function I2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I2(Object(r),!0).forEach(function(n){iz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I2(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iz(e,t,r){return(t=az(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function az(e){var t=oz(e,"string");return typeof t=="symbol"?t:t+""}function oz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sz=k.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:m,onTouchStart:p,style:g,width:v}=e,b=Ze(),[x,S]=k.useState(null),[w,O]=k.useState(null);OR();var E=rz(),C=k.useCallback(V=>{E(V),typeof t=="function"&&t(V),S(V),O(V)},[E,t,S,O]),M=k.useCallback(V=>{b(x2(V)),b(ur({handler:a,reactEvent:V}))},[b,a]),$=k.useCallback(V=>{b(wp(V)),b(ur({handler:c,reactEvent:V}))},[b,c]),j=k.useCallback(V=>{b(nw()),b(ur({handler:u,reactEvent:V}))},[b,u]),_=k.useCallback(V=>{b(wp(V)),b(ur({handler:f,reactEvent:V}))},[b,f]),I=k.useCallback(()=>{b(P2())},[b]),D=k.useCallback(V=>{b(E2(V.key))},[b]),L=k.useCallback(V=>{b(ur({handler:o,reactEvent:V}))},[b,o]),W=k.useCallback(V=>{b(ur({handler:s,reactEvent:V}))},[b,s]),H=k.useCallback(V=>{b(ur({handler:l,reactEvent:V}))},[b,l]),te=k.useCallback(V=>{b(ur({handler:d,reactEvent:V}))},[b,d]),Q=k.useCallback(V=>{b(ur({handler:p,reactEvent:V}))},[b,p]),F=k.useCallback(V=>{b(k2(V)),b(ur({handler:m,reactEvent:V}))},[b,m]),U=k.useCallback(V=>{b(ur({handler:h,reactEvent:V}))},[b,h]);return A.createElement(Pw.Provider,{value:x},A.createElement(fk.Provider,{value:w},A.createElement("div",{className:de("recharts-wrapper",n),style:nz({position:"relative",cursor:"default",width:v,height:i},g),onClick:M,onContextMenu:L,onDoubleClick:W,onFocus:I,onKeyDown:D,onMouseDown:H,onMouseEnter:$,onMouseLeave:j,onMouseMove:_,onMouseUp:te,onTouchEnd:U,onTouchMove:F,onTouchStart:Q,ref:C},r)))}),lz=["children","className","width","height","style","compact","title","desc"];function cz(e,t){if(e==null)return{};var r,n,i=uz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function uz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var $2=k.forwardRef((e,t)=>{var{children:r,className:n,width:i,height:a,style:o,compact:s,title:l,desc:c}=e,u=cz(e,lz),f=Ar(u);return s?A.createElement(N2,{otherAttributes:f,title:l,desc:c},r):A.createElement(sz,{className:n,style:o,width:i,height:a,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},A.createElement(N2,{otherAttributes:f,title:l,desc:c,ref:t},A.createElement(zB,null,r)))}),fz=["width","height"];function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sp.apply(null,arguments)}function dz(e,t){if(e==null)return{};var r,n,i=hz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function hz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var pz={top:5,right:5,bottom:5,left:5},mz={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:pz,reverseStackOrder:!1,syncMethod:"index"},R2=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,mz),{width:a,height:o}=i,s=dz(i,fz);if(!Ni(a)||!Ni(o))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:d}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return A.createElement(M2,{preloadedState:{options:h},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:l},A.createElement(Q_,{chartData:d.data}),A.createElement(j2,{width:a,height:o,layout:i.layout,margin:i.margin}),A.createElement(D2,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement($2,Sp({},s,{width:a,height:o,ref:r})))}),gz=["axis"],L2=k.forwardRef((e,t)=>A.createElement(R2,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:gz,tooltipPayloadSearcher:Th,categoricalChartProps:e,ref:t})),vz=["axis","item"],yz=k.forwardRef((e,t)=>A.createElement(R2,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:vz,tooltipPayloadSearcher:Th,categoricalChartProps:e,ref:t}));function bz(e){var t=Ze();return k.useEffect(()=>{t(H8(e))},[t,e]),null}var xz=["width","height","layout"];function Op(){return Op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Op.apply(null,arguments)}function wz(e,t){if(e==null)return{};var r,n,i=_z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _z(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Sz={top:5,right:5,bottom:5,left:5},Oz={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Sz,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},Az=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,Oz),{width:a,height:o,layout:s}=i,l=wz(i,xz);if(!Ni(a)||!Ni(o))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d}=t,h={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d,eventEmitter:void 0};return A.createElement(M2,{preloadedState:{options:h},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:c},A.createElement(Q_,{chartData:i.data}),A.createElement(j2,{width:a,height:o,layout:s,margin:i.margin}),A.createElement(D2,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(bz,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),A.createElement($2,Op({width:a,height:o},l,{ref:r})))}),Ez=["item"],Pz={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},rc=k.forwardRef((e,t)=>{var r=_t(e,Pz);return A.createElement(Az,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Ez,tooltipPayloadSearcher:Th,categoricalChartProps:r,ref:t})});function Cz({isStatic:e,data:t}){const r=({value:u})=>{const f=u??0,d=f>=0;return y.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${d?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[d?y.jsx(Bg,{}):y.jsx(Fg,{}),f]})},n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),i=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),a=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),s=[{name:"Move-ins",value:n},{name:"Move-outs",value:i}],l={purple:"#8B5CF6",indigo:"#6366F1"},c=({active:u,payload:f})=>!u||!f||!f.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:f.map((d,h)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:d.color,marginRight:6}}),d.name,": ",y.jsx("div",{className:"font-semibold",children:d.value})]},h))});return y.jsx(me,{title:"Community",period:"This Month",icon:y.jsx(su,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+i})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[y.jsx(r,{value:((a+o)/2).toFixed(2)}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),y.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:y.jsx(ii,{width:"75%",height:"100%",children:y.jsxs(rc,{children:[y.jsxs(co,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[y.jsx(kr,{fill:l.purple}),y.jsx(kr,{fill:l.indigo})]}),y.jsx(ni,{content:y.jsx(c,{})})]})})})]})})}function kz({isStatic:e,data:t}){const r=[{name:"Notice",value:Number(t?.total_notices||0)},{name:"Post",value:Number(t?.total_topics||0)},{name:"Poll",value:Number(t?.total_polls||0)},{name:"Survey",value:Number(t?.total_surveys||0)}],n={Notice:"#8B5CF6",Post:"#22C55E",Poll:"#3B82F6",Survey:"#F59E0B"},i=({active:a,payload:o,label:s})=>!a||!o||!o.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[s&&y.jsx("div",{className:"font-medium mb-1",children:s}),o.map((l,c)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:l.color,marginRight:6}}),l.name,": ",y.jsx("div",{className:"font-semibold",children:l.value})]},c))]});return y.jsx(me,{title:"Engagement",period:"This Month",icon:y.jsx(Vg,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(yz,{data:r,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[y.jsx(Xl,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),y.jsx(ho,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Jl,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),y.jsx(ni,{content:y.jsx(i,{}),cursor:{fill:"transparent"}}),y.jsx(G_,{dataKey:"value",barSize:40,isAnimationActive:!1,children:r.map(a=>y.jsx(kr,{fill:n[a.name]},a.name))})]})})})}function Tz(e){if(!e)return 0;const[t,r]=e.split(" ");let[n,i]=t.split(":").map(Number);return r==="PM"&&n!==12&&(n+=12),r==="AM"&&n===12&&(n=0),n*60+i}function Mz(e){return Array.from({length:24},(n,i)=>i).map(n=>{const i=e.find(l=>{const c=Tz(l.slot_start_time);return Math.floor(c/60)===n}),a=n>=12?"PM":"AM";return{time:`${n%12||12} ${a}`,bookings:i?.slot_bookings||0,total:i?.total_slots||0,utilization:i?.utilization_rate||0}})}function jz({isStatic:e,data:t}){const r=Number(t?.totalBookings||0),n=Number(t?.totalSlots||0),i=Number(t?.utilizationRate||0),a=k.useMemo(()=>t?.slots?.length?Mz(t.slots):[],[t]),o=f=>["1 AM","6 AM","11 AM","5 PM","10 PM"].includes(f)?f:"",s=({active:f,payload:d,label:h})=>!f||!d||!d.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[h&&y.jsx("div",{className:"font-medium mb-1",children:h}),d.map((m,p)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:m.color}}),m.name,": ",y.jsx("div",{className:"font-semibold",children:m.value})]},p))]}),l=a.length>0?Math.max(...a.map(f=>f.total),5):5;function c(f){const d=f>=12?"PM":"AM";let h=f%12;return h===0&&(h=12),`${h} ${d}`}const u=a.length?a:Array.from({length:24},(f,d)=>({time:c(d),bookings:0,total:0,utilizationRate:0}));return y.jsxs(me,{title:"Facilities",period:"Today",icon:y.jsx(Wg,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),y.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:r})]}),y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Total Slots"}),y.jsx("div",{className:"!text-[24px] font-medium text-[#F59E0B]",children:n})]}),y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),y.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[i.toFixed(2),"%"]})]})]}),y.jsx("div",{className:"w-full h-[170px]",children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(L2,{data:u,margin:{top:0,right:-30,left:-40,bottom:0},children:[y.jsx(Xl,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Jl,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),y.jsx(ho,{yAxisId:"left",domain:[0,l],tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),y.jsx(ho,{yAxisId:"right",orientation:"right",domain:[20,100],ticks:[20,40,60,80,100],tickFormatter:f=>`${f}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),y.jsx(ni,{content:y.jsx(s,{})}),y.jsx(li,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),y.jsx(li,{yAxisId:"left",type:"monotone",dataKey:"total",name:"Total Slots",stroke:"#F59E0B",strokeWidth:2,dot:!1}),y.jsx(li,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function Dz({data:e}){const t=e?.incomeSummary||{},r=e?.expenditureSummary||{},n=["AED","USD","EUR"],i=["Rs","INR","₹"];function a(s){if(s==null||isNaN(s))return"0";const l=Number(s);return l>=1e9?(l/1e9).toFixed(l%1e9===0?0:2)+"B":l>=1e6?(l/1e6).toFixed(l%1e6===0?0:2)+"M":l>=1e3?(l/1e3).toFixed(l%1e3===0?0:2)+"K":l.toFixed(l%1===0?0:2)}function o(s,l){return l?i.includes(l)?`${l} ${a(s)}`:n.includes(l)?`${a(s)} ${l}`:`${a(s)} ${l}`:a(s)}return y.jsx(me,{title:"Income",period:"This Month",icon:y.jsx(Hg,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Income"}),y.jsx("div",{children:"Collection"}),y.jsx("div",{children:"Closing"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[y.jsx("div",{children:o(t.opening_balance,t?.currency_type)}),y.jsx("div",{children:o(t.income,t?.currency_type)}),y.jsx("div",{children:o(t.collection,t?.currency_type)}),y.jsx("div",{children:o(t.closing_balance,t?.currency_type)})]}),y.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),y.jsx("div",{className:"flex items-center justify-between",children:y.jsxs("div",{className:"flex items-center gap-[12px]",children:[y.jsx(Hg,{className:"!text-[24px] text-red-600"}),y.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Expenditure"}),y.jsx("div",{children:"Payment"}),y.jsx("div",{children:"Outstanding"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[y.jsx("div",{children:o(r.opening_balance,r?.currency_type)}),y.jsx("div",{children:o(r.expenditure,r?.currency_type)}),y.jsx("div",{children:o(r.payment,r?.currency_type)}),y.jsx("div",{children:o(r.outstanding,r?.currency_type)})]})]})})}function Nz(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function Iz(e){return Array.from({length:24},(t,r)=>{const n=e.find(i=>i.hour===r)||{};return{hour:r,time:Nz(r),walkins:n.walkins??0,checkins:n.preApproved??0,staffAttendance:n.staffAttendance??0}})}function $z({isStatic:e,data:t}){const r={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"},n=t?.summary?.activeWalkins||{},i=t?.summary?.preApprovedCheckins||{},a=t?.summary?.staffAttendance||{},o=Iz(t?.chart||[]),s=Math.max(...o.flatMap(f=>[f.walkins,f.checkins,f.staffAttendance])),l=s>0?s:5,c=[0,Math.ceil(l/2),l],u=({active:f,payload:d,label:h})=>!f||!d||!d.length?null:y.jsxs("div",{className:"bg-black text-white text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[h&&y.jsx("div",{className:"font-medium mb-1",children:h}),d.map((m,p)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:m.color,marginRight:6}}),m.name,": ",y.jsx("div",{className:"font-semibold",children:m.value})]},p))]});return y.jsx(me,{title:"Gate Updates",period:"Today",icon:y.jsx(Kg,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#1FA05B] flex items-center",children:[n.visitor_in??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",n.total_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:"Pre-approved Check-ins"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#E7A015] flex items-center",children:[i.expected_pass_scanned??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",i.total_expected_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Staff Attendance"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#329DFF] flex items-center",children:[a.total_in_now??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",a.total_in_today??0]})]})]})]}),y.jsx("div",{className:"w-full h-[105px]",children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(L2,{data:o,margin:{top:1,right:0,left:-40,bottom:0},children:[y.jsx(Xl,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Jl,{dataKey:"time",tickFormatter:(f,d)=>d%4===0?f:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(ho,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:c,domain:[0,l],allowDecimals:!1,axisLine:!1,tickLine:!1}),y.jsx(ni,{content:y.jsx(u,{})}),y.jsx(li,{type:"monotone",dataKey:"walkins",stroke:r.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),y.jsx(li,{type:"monotone",dataKey:"checkins",stroke:r.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),y.jsx(li,{type:"monotone",dataKey:"staffAttendance",stroke:r.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function Rz({isStatic:e,data:t}){const r=({value:l})=>{const c=l??0,u=c>=0;return y.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${u?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[u?y.jsx(Bg,{}):y.jsx(Fg,{}),c]})},n=[{name:"L1",value:Number(t?.today_L1||0)},{name:"L2",value:Number(t?.today_L2||0)},{name:"L3",value:Number(t?.today_L3||0)},{name:"No Level",value:Number(t?.today_NoLevel||0)}];n.reduce((l,c)=>l+c.value,0);const i=n,a=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],o=({color:l})=>y.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:l,marginRight:"6px"}}),s=({active:l,payload:c})=>!l||!c||!c.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:c.map((u,f)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx(o,{color:u.color}),u.name,": ",y.jsx("div",{className:"font-semibold",children:u.value})]},f))});return y.jsx(me,{title:"Helpdesk",period:"Today",icon:y.jsx(qC,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex gap-[12px] h-fit",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Open Complaints"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[y.jsx(r,{value:t?.percent_change}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),y.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:y.jsx(ii,{width:"75%",height:"100%",children:y.jsxs(rc,{children:[y.jsx(co,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((l,c)=>y.jsx(kr,{fill:a[c]||"#CBD5E1"},l.name))}),y.jsx(ni,{content:y.jsx(s,{})})]})})})]})})}/*!
|
|
199
|
+
*/var v2;function O8(){return v2||(v2=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,s=t.useDebugValue;yp.useSyncExternalStoreWithSelector=function(l,c,u,f,d){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=o(function(){function g(w){if(!v){if(v=!0,b=w,w=f(w),d!==void 0&&m.hasValue){var O=m.value;if(d(O,w))return x=O}return x=w}if(O=x,r(b,w))return O;var E=f(w);return d!==void 0&&d(O,E)?(b=w,O):(b=w,x=E)}var v=!1,b,x,S=u===void 0?null:u;return[function(){return g(c())},S===null?void 0:function(){return g(S())}]},[c,u,f,d]);var p=n(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=p},[p]),s(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),yp}var y2;function A8(){return y2||(y2=1,process.env.NODE_ENV==="production"?ec.exports=S8():ec.exports=O8()),ec.exports}A8();function E8(e){e()}function P8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){E8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var b2={notify(){},get:()=>[]};function C8(e,t){let r,n=b2,i=0,a=!1;function o(p){u();const g=n.subscribe(p);let v=!1;return()=>{v||(v=!0,g(),f())}}function s(){n.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return a}function u(){i++,r||(r=e.subscribe(l),n=P8())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=b2)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return m}var k8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",T8=k8(),M8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",j8=M8(),D8=()=>T8||j8?A.useLayoutEffect:A.useEffect,N8=D8(),I8=Symbol.for("react-redux-context"),$8=typeof globalThis<"u"?globalThis:{};function R8(){if(!A.createContext)return{};const e=$8[I8]??=new Map;let t=e.get(A.createContext);return t||(t=A.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(A.createContext,t)),t}var L8=R8();function F8(e){const{children:t,context:r,serverState:n,store:i}=e,a=A.useMemo(()=>{const l=C8(i),c={store:i,subscription:l,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return c;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(c,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),o=A.useMemo(()=>i.getState(),[i]);N8(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const s=r||L8;return A.createElement(s.Provider,{value:a},t)}var B8=F8,z8=(e,t)=>t,bp=N([z8,ue,g1,ct,pw,Qr,Y$,st],Q$),xp=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},x2=ar("mouseClick"),w2=Ta();w2.startListening({actionCreator:x2,effect:(e,t)=>{var r=e.payload,n=bp(t.getState(),xp(r));n?.activeIndex!=null&&t.dispatch(r$({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var wp=ar("mouseMove"),_2=Ta();_2.startListening({actionCreator:wp,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gh(n,n.tooltip.settings.shared),a=bp(n,xp(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(iw({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(nw()))}});var S2={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},O2=qt({name:"rootProps",initialState:S2,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:S2.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),W8=O2.reducer,{updateOptions:V8}=O2.actions,A2=qt({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:H8}=A2.actions,U8=A2.reducer,E2=ar("keyDown"),P2=ar("focus"),_p=Ta();_p.startListening({actionCreator:E2,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Number(bh(i,Gi(r))),s=Qr(r);if(a==="Enter"){var l=Fl(r,"axis","hover",String(i.index));t.dispatch(yh({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:l}));return}var c=q4(r),u=c==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,d=o+f*u;if(!(s==null||d>=s.length||d<0)){var h=Fl(r,"axis","hover",String(d));t.dispatch(yh({active:!0,activeIndex:d.toString(),activeDataKey:void 0,activeCoordinate:h}))}}}}}),_p.startListening({actionCreator:P2,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=Fl(r,"axis","hover",String(a));t.dispatch(yh({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ur=ar("externalEvent"),C2=Ta();C2.startListening({actionCreator:ur,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:L$(r),activeDataKey:yw(r),activeIndex:wn(r),activeLabel:vw(r),activeTooltipIndex:wn(r),isTooltipActive:F$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var K8=N([Yi],e=>e.tooltipItemPayloads),q8=N([K8,io,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(s=>s.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),k2=ar("touchMove"),T2=Ta();T2.startListening({actionCreator:k2,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gh(n,n.tooltip.settings.shared);if(i==="axis"){var a=bp(n,xp({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(iw({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var o,s=r.touches[0],l=document.elementFromPoint(s.clientX,s.clientY);if(!l||!l.getAttribute)return;var c=l.getAttribute(W0),u=(o=l.getAttribute(V0))!==null&&o!==void 0?o:void 0,f=q8(t.getState(),c,u);t.dispatch(rw({activeDataKey:u,activeIndex:c,activeCoordinate:f}))}}});var Y8=Uy({brush:jB,cartesianAxis:d6,chartData:mR,errorBars:M6,graphicalItems:MF,layout:lj,legend:Xj,options:uR,polarAxis:YL,polarOptions:U8,referenceElements:FB,rootProps:W8,tooltip:n$}),G8=function(t){return DM({reducer:Y8,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([w2.middleware,_2.middleware,_p.middleware,C2.middleware,T2.middleware]),devTools:dn.devToolsEnabled})};function M2(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Nt(),a=k.useRef(null);if(i)return r;a.current==null&&(a.current=G8(t));var o=pf;return A.createElement(B8,{context:o,store:a.current},r)}function j2(e){var{layout:t,width:r,height:n,margin:i}=e,a=Ze(),o=Nt();return k.useEffect(()=>{o||(a(aj(t)),a(oj({width:r,height:n})),a(ij(i)))},[a,o,t,r,n,i]),null}function D2(e){var t=Ze();return k.useEffect(()=>{t(V8(e))},[t,e]),null}var X8=["children"];function Z8(e,t){if(e==null)return{};var r,n,i=J8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function J8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function tc(){return tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tc.apply(null,arguments)}var Q8={width:"100%",height:"100%"},ez=k.forwardRef((e,t)=>{var r=K0(),n=q0(),i=eb();if(!Ni(r)||!Ni(n))return null;var{children:a,otherAttributes:o,title:s,desc:l}=e,c,u;return typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0,A.createElement(dv,tc({},o,{title:s,desc:l,role:u,tabIndex:c,width:r,height:n,style:Q8,ref:t}),a)}),tz=e=>{var{children:t}=e,r=G(Js);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return A.createElement(dv,{width:n,height:i,x:o,y:a},t)},N2=k.forwardRef((e,t)=>{var{children:r}=e,n=Z8(e,X8),i=Nt();return i?A.createElement(tz,null,r):A.createElement(ez,tc({ref:t},n),r)});function rz(){var e=Ze(),[t,r]=k.useState(null),n=G(Rj);return k.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Yt(a)&&a!==n&&e(sj(a))}},[t,e,n]),r}function I2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I2(Object(r),!0).forEach(function(n){iz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I2(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iz(e,t,r){return(t=az(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function az(e){var t=oz(e,"string");return typeof t=="symbol"?t:t+""}function oz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sz=k.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:m,onTouchStart:p,style:g,width:v}=e,b=Ze(),[x,S]=k.useState(null),[w,O]=k.useState(null);OR();var E=rz(),C=k.useCallback(V=>{E(V),typeof t=="function"&&t(V),S(V),O(V)},[E,t,S,O]),M=k.useCallback(V=>{b(x2(V)),b(ur({handler:a,reactEvent:V}))},[b,a]),$=k.useCallback(V=>{b(wp(V)),b(ur({handler:c,reactEvent:V}))},[b,c]),j=k.useCallback(V=>{b(nw()),b(ur({handler:u,reactEvent:V}))},[b,u]),_=k.useCallback(V=>{b(wp(V)),b(ur({handler:f,reactEvent:V}))},[b,f]),I=k.useCallback(()=>{b(P2())},[b]),D=k.useCallback(V=>{b(E2(V.key))},[b]),L=k.useCallback(V=>{b(ur({handler:o,reactEvent:V}))},[b,o]),W=k.useCallback(V=>{b(ur({handler:s,reactEvent:V}))},[b,s]),H=k.useCallback(V=>{b(ur({handler:l,reactEvent:V}))},[b,l]),te=k.useCallback(V=>{b(ur({handler:d,reactEvent:V}))},[b,d]),Q=k.useCallback(V=>{b(ur({handler:p,reactEvent:V}))},[b,p]),F=k.useCallback(V=>{b(k2(V)),b(ur({handler:m,reactEvent:V}))},[b,m]),U=k.useCallback(V=>{b(ur({handler:h,reactEvent:V}))},[b,h]);return A.createElement(Pw.Provider,{value:x},A.createElement(fk.Provider,{value:w},A.createElement("div",{className:de("recharts-wrapper",n),style:nz({position:"relative",cursor:"default",width:v,height:i},g),onClick:M,onContextMenu:L,onDoubleClick:W,onFocus:I,onKeyDown:D,onMouseDown:H,onMouseEnter:$,onMouseLeave:j,onMouseMove:_,onMouseUp:te,onTouchEnd:U,onTouchMove:F,onTouchStart:Q,ref:C},r)))}),lz=["children","className","width","height","style","compact","title","desc"];function cz(e,t){if(e==null)return{};var r,n,i=uz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function uz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var $2=k.forwardRef((e,t)=>{var{children:r,className:n,width:i,height:a,style:o,compact:s,title:l,desc:c}=e,u=cz(e,lz),f=Ar(u);return s?A.createElement(N2,{otherAttributes:f,title:l,desc:c},r):A.createElement(sz,{className:n,style:o,width:i,height:a,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},A.createElement(N2,{otherAttributes:f,title:l,desc:c,ref:t},A.createElement(zB,null,r)))}),fz=["width","height"];function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sp.apply(null,arguments)}function dz(e,t){if(e==null)return{};var r,n,i=hz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function hz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var pz={top:5,right:5,bottom:5,left:5},mz={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:pz,reverseStackOrder:!1,syncMethod:"index"},R2=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,mz),{width:a,height:o}=i,s=dz(i,fz);if(!Ni(a)||!Ni(o))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:d}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return A.createElement(M2,{preloadedState:{options:h},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:l},A.createElement(Q_,{chartData:d.data}),A.createElement(j2,{width:a,height:o,layout:i.layout,margin:i.margin}),A.createElement(D2,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement($2,Sp({},s,{width:a,height:o,ref:r})))}),gz=["axis"],L2=k.forwardRef((e,t)=>A.createElement(R2,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:gz,tooltipPayloadSearcher:Th,categoricalChartProps:e,ref:t})),vz=["axis","item"],yz=k.forwardRef((e,t)=>A.createElement(R2,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:vz,tooltipPayloadSearcher:Th,categoricalChartProps:e,ref:t}));function bz(e){var t=Ze();return k.useEffect(()=>{t(H8(e))},[t,e]),null}var xz=["width","height","layout"];function Op(){return Op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Op.apply(null,arguments)}function wz(e,t){if(e==null)return{};var r,n,i=_z(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _z(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Sz={top:5,right:5,bottom:5,left:5},Oz={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Sz,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},Az=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,Oz),{width:a,height:o,layout:s}=i,l=wz(i,xz);if(!Ni(a)||!Ni(o))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d}=t,h={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d,eventEmitter:void 0};return A.createElement(M2,{preloadedState:{options:h},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:c},A.createElement(Q_,{chartData:i.data}),A.createElement(j2,{width:a,height:o,layout:s,margin:i.margin}),A.createElement(D2,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(bz,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),A.createElement($2,Op({width:a,height:o},l,{ref:r})))}),Ez=["item"],Pz={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},rc=k.forwardRef((e,t)=>{var r=_t(e,Pz);return A.createElement(Az,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Ez,tooltipPayloadSearcher:Th,categoricalChartProps:r,ref:t})});function Cz({isStatic:e,data:t}){const r=({value:u})=>{const f=u??0,d=f>=0;return y.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${d?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[d?y.jsx(Bg,{}):y.jsx(Fg,{}),f,"%"]})},n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),i=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),a=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),s=[{name:"Move-ins",value:n},{name:"Move-outs",value:i}],l={purple:"#8B5CF6",indigo:"#6366F1"},c=({active:u,payload:f})=>!u||!f||!f.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:f.map((d,h)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:d.color,marginRight:6}}),d.name,": ",y.jsx("div",{className:"font-semibold",children:d.value})]},h))});return y.jsx(me,{title:"Community",period:"This Month",icon:y.jsx(su,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+i})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[y.jsx(r,{value:((a+o)/2).toFixed(2)}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),y.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:y.jsx(ii,{width:"75%",height:"100%",children:y.jsxs(rc,{children:[y.jsxs(co,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[y.jsx(kr,{fill:l.purple}),y.jsx(kr,{fill:l.indigo})]}),y.jsx(ni,{content:y.jsx(c,{})})]})})})]})})}function kz({isStatic:e,data:t}){const r=[{name:"Notice",value:Number(t?.total_notices||0)},{name:"Post",value:Number(t?.total_topics||0)},{name:"Poll",value:Number(t?.total_polls||0)},{name:"Survey",value:Number(t?.total_surveys||0)}],n={Notice:"#8B5CF6",Post:"#22C55E",Poll:"#3B82F6",Survey:"#F59E0B"},i=({active:a,payload:o,label:s})=>!a||!o||!o.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[s&&y.jsx("div",{className:"font-medium mb-1",children:s}),o.map((l,c)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:l.color,marginRight:6}}),l.name,": ",y.jsx("div",{className:"font-semibold",children:l.value})]},c))]});return y.jsx(me,{title:"Engagement",period:"This Month",icon:y.jsx(Vg,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(yz,{data:r,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[y.jsx(Xl,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),y.jsx(ho,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Jl,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),y.jsx(ni,{content:y.jsx(i,{}),cursor:{fill:"transparent"}}),y.jsx(G_,{dataKey:"value",barSize:40,isAnimationActive:!1,children:r.map(a=>y.jsx(kr,{fill:n[a.name]},a.name))})]})})})}function Tz(e){if(!e)return 0;const[t,r]=e.split(" ");let[n,i]=t.split(":").map(Number);return r==="PM"&&n!==12&&(n+=12),r==="AM"&&n===12&&(n=0),n*60+i}function Mz(e){return Array.from({length:24},(n,i)=>i).map(n=>{const i=e.find(l=>{const c=Tz(l.slot_start_time);return Math.floor(c/60)===n}),a=n>=12?"PM":"AM";return{time:`${n%12||12} ${a}`,bookings:i?.slot_bookings||0,total:i?.total_slots||0,utilization:i?.utilization_rate||0}})}function jz({isStatic:e,data:t}){const r=Number(t?.totalBookings||0),n=Number(t?.totalSlots||0),i=Number(t?.utilizationRate||0),a=k.useMemo(()=>t?.slots?.length?Mz(t.slots):[],[t]),o=f=>["1 AM","6 AM","11 AM","5 PM","10 PM"].includes(f)?f:"",s=({active:f,payload:d,label:h})=>!f||!d||!d.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[h&&y.jsx("div",{className:"font-medium mb-1",children:h}),d.map((m,p)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:m.color}}),m.name,": ",y.jsx("div",{className:"font-semibold",children:m.value})]},p))]}),l=a.length>0?Math.max(...a.map(f=>f.total),5):5;function c(f){const d=f>=12?"PM":"AM";let h=f%12;return h===0&&(h=12),`${h} ${d}`}const u=a.length?a:Array.from({length:24},(f,d)=>({time:c(d),bookings:0,total:0,utilizationRate:0}));return y.jsxs(me,{title:"Facilities",period:"Today",icon:y.jsx(Wg,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),y.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:r})]}),y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Total Slots"}),y.jsx("div",{className:"!text-[24px] font-medium text-[#F59E0B]",children:n})]}),y.jsxs("div",{children:[y.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),y.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[i.toFixed(2),"%"]})]})]}),y.jsx("div",{className:"w-full h-[170px]",children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(L2,{data:u,margin:{top:0,right:-30,left:-40,bottom:0},children:[y.jsx(Xl,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Jl,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),y.jsx(ho,{yAxisId:"left",domain:[0,l],tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),y.jsx(ho,{yAxisId:"right",orientation:"right",domain:[20,100],ticks:[20,40,60,80,100],tickFormatter:f=>`${f}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),y.jsx(ni,{content:y.jsx(s,{})}),y.jsx(li,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),y.jsx(li,{yAxisId:"left",type:"monotone",dataKey:"total",name:"Total Slots",stroke:"#F59E0B",strokeWidth:2,dot:!1}),y.jsx(li,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function Dz({data:e}){const t=e?.incomeSummary||{},r=e?.expenditureSummary||{},n=["AED","USD","EUR"],i=["Rs","INR","₹"];function a(s){if(s==null||isNaN(s))return"0";const l=Number(s);return l>=1e9?(l/1e9).toFixed(l%1e9===0?0:2)+"B":l>=1e6?(l/1e6).toFixed(l%1e6===0?0:2)+"M":l>=1e3?(l/1e3).toFixed(l%1e3===0?0:2)+"K":l.toFixed(l%1===0?0:2)}function o(s,l){return l?i.includes(l)?`${l} ${a(s)}`:n.includes(l)?`${a(s)} ${l}`:`${a(s)} ${l}`:a(s)}return y.jsx(me,{title:"Income",period:"This Month",icon:y.jsx(Hg,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Income"}),y.jsx("div",{children:"Collection"}),y.jsx("div",{children:"Closing"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[y.jsx("div",{children:o(t.opening_balance,t?.currency_type)}),y.jsx("div",{children:o(t.income,t?.currency_type)}),y.jsx("div",{children:o(t.collection,t?.currency_type)}),y.jsx("div",{children:o(t.closing_balance,t?.currency_type)})]}),y.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),y.jsx("div",{className:"flex items-center justify-between",children:y.jsxs("div",{className:"flex items-center gap-[12px]",children:[y.jsx(Hg,{className:"!text-[24px] text-red-600"}),y.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Expenditure"}),y.jsx("div",{children:"Payment"}),y.jsx("div",{children:"Outstanding"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[y.jsx("div",{children:o(r.opening_balance,r?.currency_type)}),y.jsx("div",{children:o(r.expenditure,r?.currency_type)}),y.jsx("div",{children:o(r.payment,r?.currency_type)}),y.jsx("div",{children:o(r.outstanding,r?.currency_type)})]})]})})}function Nz(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function Iz(e){return Array.from({length:24},(t,r)=>{const n=e.find(i=>i.hour===r)||{};return{hour:r,time:Nz(r),walkins:n.walkins??0,checkins:n.preApproved??0,staffAttendance:n.staffAttendance??0}})}function $z({isStatic:e,data:t}){const r={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"},n=t?.summary?.activeWalkins||{},i=t?.summary?.preApprovedCheckins||{},a=t?.summary?.staffAttendance||{},o=Iz(t?.chart||[]),s=Math.max(...o.flatMap(f=>[f.walkins,f.checkins,f.staffAttendance])),l=s>0?s:5,c=[0,Math.ceil(l/2),l],u=({active:f,payload:d,label:h})=>!f||!d||!d.length?null:y.jsxs("div",{className:"bg-black text-white text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[h&&y.jsx("div",{className:"font-medium mb-1",children:h}),d.map((m,p)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:m.color,marginRight:6}}),m.name,": ",y.jsx("div",{className:"font-semibold",children:m.value})]},p))]});return y.jsx(me,{title:"Gate Updates",period:"Today",icon:y.jsx(Kg,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#1FA05B] flex items-center",children:[n.visitor_in??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",n.total_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:"Pre-approved Check-ins"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#E7A015] flex items-center",children:[i.expected_pass_scanned??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",i.total_expected_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Staff Attendance"}),y.jsxs("div",{className:"text-[28px] font-medium text-[#329DFF] flex items-center",children:[a.total_in_now??0,y.jsxs("div",{className:"text-[20px] text-[#64748B]",children:["/",a.total_in_today??0]})]})]})]}),y.jsx("div",{className:"w-full h-[105px]",children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(L2,{data:o,margin:{top:1,right:0,left:-40,bottom:0},children:[y.jsx(Xl,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Jl,{dataKey:"time",tickFormatter:(f,d)=>d%4===0?f:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(ho,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:c,domain:[0,l],allowDecimals:!1,axisLine:!1,tickLine:!1}),y.jsx(ni,{content:y.jsx(u,{})}),y.jsx(li,{type:"monotone",dataKey:"walkins",stroke:r.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins"}),y.jsx(li,{type:"monotone",dataKey:"checkins",stroke:r.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"}),y.jsx(li,{type:"monotone",dataKey:"staffAttendance",stroke:r.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance"})]})})})]})})}function Rz({isStatic:e,data:t}){const r=({value:l})=>{const c=l??0,u=c>=0;return y.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${u?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[u?y.jsx(Bg,{}):y.jsx(Fg,{}),c]})},n=[{name:"L1",value:Number(t?.today_L1||0)},{name:"L2",value:Number(t?.today_L2||0)},{name:"L3",value:Number(t?.today_L3||0)},{name:"No Level",value:Number(t?.today_NoLevel||0)}];n.reduce((l,c)=>l+c.value,0);const i=n,a=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],o=({color:l})=>y.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:l,marginRight:"6px"}}),s=({active:l,payload:c})=>!l||!c||!c.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:c.map((u,f)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx(o,{color:u.color}),u.name,": ",y.jsx("div",{className:"font-semibold",children:u.value})]},f))});return y.jsx(me,{title:"Helpdesk",period:"Today",icon:y.jsx(qC,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex gap-[12px] h-fit",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Open Complaints"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[y.jsx(r,{value:t?.percent_change}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),y.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:y.jsx(ii,{width:"75%",height:"100%",children:y.jsxs(rc,{children:[y.jsx(co,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((l,c)=>y.jsx(kr,{fill:a[c]||"#CBD5E1"},l.name))}),y.jsx(ni,{content:y.jsx(s,{})})]})})})]})})}/*!
|
|
200
200
|
* @kurkle/color v0.3.4
|
|
201
201
|
* https://github.com/kurkle/color#readme
|
|
202
202
|
* (c) 2024 Jukka Kurkela
|