anarock-widgets 1.0.48 → 1.0.50

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 CHANGED
@@ -306,7 +306,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
306
306
  `))}},[qt,xe,E,x,z]),Qt&&(E?it.length===0?de=null:de=it.reduce((X,le,pe)=>(X.push(le),pe<it.length-1&&X.push(", "),X),[]):de=Tt);let hn=oe;!a&&ie&&ee&&(hn=T.clientWidth);let $t;typeof j<"u"?$t=j:$t=d?null:0;const mn=R.id||(x?`mui-component-select-${x}`:void 0),ve={...t,variant:B,value:z,open:Ue,error:p},tn=jY(ve),Lt={...y.PaperProps,...typeof y.slotProps?.paper=="function"?y.slotProps.paper(ve):y.slotProps?.paper},W={...y.MenuListProps,...typeof y.slotProps?.list=="function"?y.slotProps.list(ve):y.slotProps?.list},se=RS();return O.jsxs(_.Fragment,{children:[O.jsx(AY,{as:"div",ref:J,tabIndex:$t,role:"combobox","aria-controls":Ue?se:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":Ue?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[v,mn].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":P?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:tt,onMouseDown:d||D?null:te,onBlur:ke,onFocus:C,...R,ownerState:ve,className:ue(R.className,tn.select,l),id:mn,children:MY(de)?_O||(_O=O.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):de}),O.jsx(kY,{"aria-invalid":p,value:Array.isArray(z)?z.join(","):z,name:x,ref:ne,"aria-hidden":!0,onChange:Se,tabIndex:-1,disabled:d,className:tn.nativeInput,autoFocus:o,required:P,...Y,ownerState:ve}),O.jsx(TY,{as:g,className:tn.icon,ownerState:ve}),O.jsx(AT,{id:`menu-${x||""}`,anchorEl:T,open:Ue,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...y,slotProps:{...y.slotProps,list:{"aria-labelledby":v,role:"listbox","aria-multiselectable":E?"true":void 0,disableListWrap:!0,id:se,...W},paper:{...Lt,style:{minWidth:hn,...Lt!=null?Lt.style:null}}},children:en})]})});process.env.NODE_ENV!=="production"&&(RT.propTypes={"aria-describedby":h.string,"aria-label":h.string,autoFocus:h.bool,autoWidth:h.bool,children:h.node,classes:h.object,className:h.string,defaultOpen:h.bool,defaultValue:h.any,disabled:h.bool,displayEmpty:h.bool,error:h.bool,IconComponent:h.elementType.isRequired,inputRef:Lr,labelId:h.string,MenuProps:h.object,multiple:h.bool,name:h.string,onBlur:h.func,onChange:h.func,onClose:h.func,onFocus:h.func,onOpen:h.func,open:h.bool,readOnly:h.bool,renderValue:h.func,required:h.bool,SelectDisplayProps:h.object,tabIndex:h.oneOfType([h.number,h.string]),type:h.any,value:h.any,variant:h.oneOf(["standard","outlined","filled"])});const NY=e=>{const{classes:t}=e,r=Nt({root:["root"]},NT,t);return{...t,...r}},Ey={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>Dr(e)&&e!=="variant"},RY=we(xy,Ey)(""),DY=we(Oy,Ey)(""),IY=we(by,Ey)(""),Sy=_.forwardRef(function(t,n){const r=Wt({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=wq,id:d,input:f,inputProps:p,label:g,labelId:m,MenuProps:v,multiple:y=!1,native:E=!1,onClose:x,onOpen:b,open:w,renderValue:S,SelectDisplayProps:C,variant:A="outlined",...k}=r,D=E?MT:RT,M=yy(),P=vy({props:r,muiFormControl:M,states:["variant","error"]}),R=P.variant||A,j={...r,variant:R,classes:a},N=NY(j),{root:L,...B}=N,Y=f||{standard:O.jsx(RY,{ownerState:j}),outlined:O.jsx(DY,{label:g,ownerState:j}),filled:O.jsx(IY,{ownerState:j})}[R],z=Vt(n,Ba(Y));return O.jsx(_.Fragment,{children:_.cloneElement(Y,{inputComponent:D,inputProps:{children:o,error:P.error,IconComponent:u,variant:R,type:void 0,multiple:y,...E?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:v,onClose:x,onOpen:b,open:w,renderValue:S,SelectDisplayProps:{id:d,...C}},...p,classes:p?sn(B,p.classes):B,...f?f.props.inputProps:{}},...(y&&E||c)&&R==="outlined"?{notched:!0}:{},ref:z,className:ue(Y.props.className,s,N.root),...!f&&{variant:R},...k})})});process.env.NODE_ENV!=="production"&&(Sy.propTypes={autoWidth:h.bool,children:h.node,classes:h.object,className:h.string,defaultOpen:h.bool,defaultValue:h.any,displayEmpty:h.bool,IconComponent:h.elementType,id:h.string,input:h.element,inputProps:h.object,label:h.node,labelId:h.string,MenuProps:h.object,multiple:h.bool,native:h.bool,onChange:h.func,onClose:h.func,onOpen:h.func,open:h.bool,renderValue:h.func,SelectDisplayProps:h.object,sx:h.oneOfType([h.arrayOf(h.oneOfType([h.func,h.object,h.bool])),h.func,h.object]),value:h.oneOfType([h.oneOf([""]),h.any]),variant:h.oneOf(["filled","outlined","standard"])});Sy.muiName="Select";function $Y(e){return At("MuiTooltip",e)}const ht=vt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function LY(e){return Math.round(e*1e5)/1e5}const FY=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${jt(o.split("-")[0])}`],arrow:["arrow"]};return Nt(a,$Y,t)},BY=we(gy,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(cn(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${ht.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${ht.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${ht.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${ht.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${ht.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${ht.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${ht.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${ht.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),zY=we("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${jt(n.placement.split("-")[0])}`]]}})(cn(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${ht.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${ht.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${ht.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${ht.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${LY(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${ht.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${ht.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${ht.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${ht.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${ht.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${ht.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${ht.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${ht.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${ht.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${ht.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),VY=we("span",{name:"MuiTooltip",slot:"Arrow"})(cn(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let yc=!1;const CO=new tf;let as={x:0,y:0};function bc(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Rm=_.forwardRef(function(t,n){const r=Wt({props:t,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:a,components:s={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:d=!1,disableInteractive:f=!1,disableTouchListener:p=!1,enterDelay:g=100,enterNextDelay:m=0,enterTouchDelay:v=700,followCursor:y=!1,id:E,leaveDelay:x=0,leaveTouchDelay:b=1500,onClose:w,onOpen:S,open:C,placement:A="bottom",PopperComponent:k,PopperProps:D={},slotProps:M={},slots:P={},title:R,TransitionComponent:j,TransitionProps:N,...L}=r,B=_.isValidElement(o)?o:O.jsx("span",{children:o}),Y=bd(),z=og(),[F,G]=_.useState(),[q,ne]=_.useState(null),Q=_.useRef(!1),ee=f||y,re=ra(),ie=ra(),oe=ra(),H=ra(),[K,J]=Nh({controlled:C,default:!1,name:"Tooltip",state:"open"});let T=K;if(process.env.NODE_ENV!=="production"){const{current:ye}=_.useRef(C!==void 0);_.useEffect(()=>{F&&F.disabled&&!ye&&R!==""&&F.tagName.toLowerCase()==="button"&&console.warn(["MUI: You are providing a disabled `button` child to the Tooltip component.","A disabled element does not fire events.","Tooltip needs to listen to the child element's events to display the title.","","Add a simple wrapper element, such as a `span`."].join(`
307
307
  `))},[R,F,ye])}const fe=RS(E),te=_.useRef(),me=Qr(()=>{te.current!==void 0&&(document.body.style.WebkitUserSelect=te.current,te.current=void 0),H.clear()});_.useEffect(()=>me,[me]);const xe=ye=>{CO.clear(),yc=!0,J(!0),S&&!T&&S(ye)},Se=Qr(ye=>{CO.start(800+x,()=>{yc=!1}),J(!1),w&&T&&w(ye),re.start(Y.transitions.duration.shortest,()=>{Q.current=!1})}),Ae=ye=>{Q.current&&ye.type!=="touchstart"||(F&&F.removeAttribute("title"),ie.clear(),oe.clear(),g||yc&&m?ie.start(yc?m:g,()=>{xe(ye)}):xe(ye))},tt=ye=>{ie.clear(),oe.start(x,()=>{Se(ye)})},[,Ue]=_.useState(!1),ke=ye=>{Bu(ye.target)||(Ue(!1),tt(ye))},de=ye=>{F||G(ye.currentTarget),Bu(ye.target)&&(Ue(!0),Ae(ye))},Tt=ye=>{Q.current=!0;const un=B.props;un.onTouchStart&&un.onTouchStart(ye)},it=ye=>{Tt(ye),oe.clear(),re.clear(),me(),te.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",H.start(v,()=>{document.body.style.WebkitUserSelect=te.current,Ae(ye)})},Qt=ye=>{B.props.onTouchEnd&&B.props.onTouchEnd(ye),me(),oe.start(b,()=>{Se(ye)})};_.useEffect(()=>{if(!T)return;function ye(un){un.key==="Escape"&&Se(un)}return document.addEventListener("keydown",ye),()=>{document.removeEventListener("keydown",ye)}},[Se,T]);const qt=Vt(Ba(B),G,n);!R&&R!==0&&(T=!1);const en=_.useRef(),hn=ye=>{const un=B.props;un.onMouseMove&&un.onMouseMove(ye),as={x:ye.clientX,y:ye.clientY},en.current&&en.current.update()},$t={},mn=typeof R=="string";c?($t.title=!T&&mn&&!d?R:null,$t["aria-describedby"]=T?fe:null):($t["aria-label"]=mn?R:null,$t["aria-labelledby"]=T&&!mn?fe:null);const ve={...$t,...L,...B.props,className:ue(L.className,B.props.className),onTouchStart:Tt,ref:qt,...y?{onMouseMove:hn}:{}};process.env.NODE_ENV!=="production"&&(ve["data-mui-internal-clone-element"]=!0,_.useEffect(()=>{F&&!F.getAttribute("data-mui-internal-clone-element")&&console.error(["MUI: The `children` component of the Tooltip is not forwarding its props correctly.","Please make sure that props are spread on the same element that the ref is applied to."].join(`
308
308
  `))},[F]));const tn={};p||(ve.onTouchStart=it,ve.onTouchEnd=Qt),d||(ve.onMouseOver=bc(Ae,ve.onMouseOver),ve.onMouseLeave=bc(tt,ve.onMouseLeave),ee||(tn.onMouseOver=Ae,tn.onMouseLeave=tt)),u||(ve.onFocus=bc(de,ve.onFocus),ve.onBlur=bc(ke,ve.onBlur),ee||(tn.onFocus=de,tn.onBlur=ke)),process.env.NODE_ENV!=="production"&&B.props.title&&console.error(["MUI: You have provided a `title` prop to the child of <Tooltip />.",`Remove this title prop \`${B.props.title}\` or the Tooltip component.`].join(`
309
- `));const Lt={...r,isRtl:z,arrow:i,disableInteractive:ee,placement:A,PopperComponentProp:k,touch:Q.current},W=typeof M.popper=="function"?M.popper(Lt):M.popper,se=_.useMemo(()=>{let ye=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return D.popperOptions?.modifiers&&(ye=ye.concat(D.popperOptions.modifiers)),W?.popperOptions?.modifiers&&(ye=ye.concat(W.popperOptions.modifiers)),{...D.popperOptions,...W?.popperOptions,modifiers:ye}},[q,D.popperOptions,W?.popperOptions]),X=FY(Lt),le=typeof M.transition=="function"?M.transition(Lt):M.transition,pe={slots:{popper:s.Popper,transition:s.Transition??j,tooltip:s.Tooltip,arrow:s.Arrow,...P},slotProps:{arrow:M.arrow??l.arrow,popper:{...D,...W??l.popper},tooltip:M.tooltip??l.tooltip,transition:{...N,...le??l.transition}}},[Ye,ot]=On("popper",{elementType:BY,externalForwardedProps:pe,ownerState:Lt,className:ue(X.popper,D?.className)}),[Un,vi]=On("transition",{elementType:Js,externalForwardedProps:pe,ownerState:Lt}),[Hn,qi]=On("tooltip",{elementType:zY,className:X.tooltip,externalForwardedProps:pe,ownerState:Lt}),[Fr,mr]=On("arrow",{elementType:VY,className:X.arrow,externalForwardedProps:pe,ownerState:Lt,ref:ne});return O.jsxs(_.Fragment,{children:[_.cloneElement(B,ve),O.jsx(Ye,{as:k??gy,placement:A,anchorEl:y?{getBoundingClientRect:()=>({top:as.y,left:as.x,right:as.x,bottom:as.y,width:0,height:0})}:F,popperRef:en,open:F?T:!1,id:fe,transition:!0,...tn,...ot,popperOptions:se,children:({TransitionProps:ye})=>O.jsx(Un,{timeout:Y.transitions.duration.shorter,...ye,...vi,children:O.jsxs(Hn,{...qi,children:[R,i?O.jsx(Fr,{...mr}):null]})})})]})});process.env.NODE_ENV!=="production"&&(Rm.propTypes={arrow:h.bool,children:za.isRequired,classes:h.object,className:h.string,components:h.shape({Arrow:h.elementType,Popper:h.elementType,Tooltip:h.elementType,Transition:h.elementType}),componentsProps:h.shape({arrow:h.object,popper:h.object,tooltip:h.object,transition:h.object}),describeChild:h.bool,disableFocusListener:h.bool,disableHoverListener:h.bool,disableInteractive:h.bool,disableTouchListener:h.bool,enterDelay:h.number,enterNextDelay:h.number,enterTouchDelay:h.number,followCursor:h.bool,id:h.string,leaveDelay:h.number,leaveTouchDelay:h.number,onClose:h.func,onOpen:h.func,open:h.bool,placement:h.oneOf(["auto-end","auto-start","auto","bottom-end","bottom-start","bottom","left-end","left-start","left","right-end","right-start","right","top-end","top-start","top"]),PopperComponent:h.elementType,PopperProps:h.object,slotProps:h.shape({arrow:h.oneOfType([h.func,h.object]),popper:h.oneOfType([h.func,h.object]),tooltip:h.oneOfType([h.func,h.object]),transition:h.oneOfType([h.func,h.object])}),slots:h.shape({arrow:h.elementType,popper:h.elementType,tooltip:h.elementType,transition:h.elementType}),sx:h.oneOfType([h.arrayOf(h.oneOfType([h.func,h.object,h.bool])),h.func,h.object]),title:h.node,TransitionComponent:h.elementType,TransitionProps:h.object});function WY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Box_List"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M6.562,8.062h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,8.062Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,20.938h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,20.938Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,14.5h-2a1.5,1.5,0,0,1-1.5-1.5V11a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,14.5Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V11a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M20.438,6.062h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,12.5h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,18.935h-9a.5.5,0,1,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]}]}]}]})(e)}function UY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Export"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M5.552,20.968a2.577,2.577,0,0,1-2.5-2.73c-.012-2.153,0-4.306,0-6.459a.5.5,0,0,1,1,0c0,2.2-.032,4.4,0,6.6.016,1.107.848,1.589,1.838,1.589H18.353A1.546,1.546,0,0,0,19.825,19a3.023,3.023,0,0,0,.1-1.061V11.779h0a.5.5,0,0,1,1,0c0,2.224.085,4.465,0,6.687a2.567,2.567,0,0,1-2.67,2.5Z"},child:[]},{tag:"path",attr:{d:"M12.337,3.176a.455.455,0,0,0-.311-.138c-.015,0-.028,0-.043-.006s-.027,0-.041.006a.457.457,0,0,0-.312.138L7.961,6.845a.5.5,0,0,0,.707.707l2.816-2.815V15.479a.5.5,0,0,0,1,0V4.737L15.3,7.552a.5.5,0,0,0,.707-.707Z"},child:[]}]}]}]})(e)}function HY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Warning"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12.5,8.752a.5.5,0,0,0-1,0h0v6a.5.5,0,0,0,1,0Z"},child:[]},{tag:"circle",attr:{cx:"11.999",cy:"16.736",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M18.642,20.934H5.385A2.5,2.5,0,0,1,3.163,17.29L9.792,4.421a2.5,2.5,0,0,1,4.444,0L20.865,17.29a2.5,2.5,0,0,1-2.223,3.644ZM12.014,4.065a1.478,1.478,0,0,0-1.334.814L4.052,17.748a1.5,1.5,0,0,0,1.333,2.186H18.642a1.5,1.5,0,0,0,1.334-2.186L13.348,4.879A1.478,1.478,0,0,0,12.014,4.065Z"},child:[]}]}]}]})(e)}const KY=Gc(Sy)(()=>({width:"fit-content",maxWidth:"100px",height:"28px",padding:"0 6px",display:"flex",fontSize:"12px",alignItems:"center","& .MuiSelect-select":{padding:0},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#C6C6C6",transition:"all 0.2s ease"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#B084CC"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#884EA7 !important",boxShadow:"0 0 0 3px rgba(136, 78, 167, 0.2)"}}));function DT({widgetId:e,options:t=[],defaultValue:n="all",onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=sessionStorage.getItem(`${e}_community_id`),[a,s]=I.useState(o||n),l=u=>{const d=u.target.value;s(d),d==="all"?sessionStorage.removeItem(`${e}_community_id`):sessionStorage.setItem(`${e}_community_id`,d),r(d,e)},c=()=>{sessionStorage.setItem(`${e}_export`,"true"),i(e)};return console.log(t,"options in action button"),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Rm,{title:"Select a community",children:O.jsx(OT,{size:"small",children:O.jsxs(KY,{value:a,onChange:l,children:[O.jsx(Nm,{value:"all",sx:{fontWeight:600},children:"All"}),t?.map(u=>O.jsx(Nm,{value:u.id,children:u.name},u.id))]})})}),O.jsx(Rm,{title:"Export CSV for this widget",children:O.jsx("button",{onClick:c,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:O.jsx(UY,{className:"stroke-[#884EA7] stroke-[1.4]"})})})]})}function qY({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}];return O.jsx(Ro,{title:"Engagement",period:"This Month",icon:O.jsx(qS,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,actionButtons:O.jsx(DT,{widgetId:"engagement",options:n,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:O.jsx("div",{className:"w-full h-[235px]",children:O.jsx(Fo,{width:"100%",height:"100%",children:O.jsxs(hH,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[O.jsx(Jd,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),O.jsx(Ys,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),O.jsx(Qd,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),O.jsx(Lo,{content:O.jsx(hl,{}),cursor:{fill:"transparent"}}),O.jsx(pA,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((o,a)=>O.jsx(Nr,{fill:r[a]},o.name))})]})})})})}function YY({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=I.useMemo(()=>{if(!t?.graph)return[];const{labels:s=[],bookings:l=[],utilization:c=[]}=t.graph;return s.map((u,d)=>({time:u,bookings:l[d]||0,utilization:c[d]||0}))},[t]),o=s=>["12 AM","6 AM","12 PM","6 PM","11 PM"].includes(s)?s:"",a=i.length?i:Array.from({length:24},(s,l)=>({time:`${l%12||12} ${l>=12?"PM":"AM"}`,bookings:0,utilization:0}));return O.jsxs(Ro,{title:"Facilities",period:"Today",icon:O.jsx(KS,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[O.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-[16px]",children:[O.jsxs("div",{children:[O.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),O.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),O.jsxs("div",{children:[O.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),O.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),O.jsx("div",{className:"w-full h-[170px]",children:O.jsx(Fo,{width:"100%",height:"100%",children:O.jsxs(zA,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[O.jsx(Jd,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),O.jsx(Qd,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),O.jsx(Ys,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),O.jsx(Ys,{yAxisId:"right",orientation:"right",domain:[0,100],ticks:[0,20,40,60,80,100],tickFormatter:s=>`${s}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),O.jsx(Lo,{content:O.jsx(hl,{})}),O.jsx(la,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),O.jsx(la,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function GY({data:e,communities:t}){const n=e?.incomeSummary||{},r=e?.expenditureSummary||{},i=["AED","USD","EUR"],o=["Rs","INR","₹"];function a(l){if(l==null||isNaN(l))return"0";const c=Number(l),u=Math.abs(c),d=c<0?"-":"";return u>=1e9?d+(u/1e9).toFixed(u%1e9===0?0:2)+"B":u>=1e6?d+(u/1e6).toFixed(u%1e6===0?0:2)+"M":u>=1e3?d+(u/1e3).toFixed(u%1e3===0?0:2)+"K":d+u.toFixed(u%1===0?0:2)}function s(l,c){return c?o.includes(c)?`${c} ${a(l)}`:i.includes(c)?`${a(l)} ${c}`:`${a(l)} ${c}`:a(l)}return O.jsx(Ro,{title:"Income",period:"This Month",icon:O.jsx(Xb,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:O.jsx(DT,{widgetId:"finance_summary",options:t,onFilterChange:(l,c)=>console.log(l,c),onExport:l=>console.log("Export triggered for",l)}),children:O.jsxs("div",{children:[O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[O.jsx("div",{children:"Opening"}),O.jsx("div",{children:"Income"}),O.jsx("div",{children:"Collection"}),O.jsx("div",{children:"Closing"})]}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[O.jsx("div",{children:s(n.opening_balance,n?.currency_type)}),O.jsx("div",{children:s(n.income,n?.currency_type)}),O.jsx("div",{children:s(n.collection,n?.currency_type)}),O.jsx("div",{children:s(n.closing_balance,n?.currency_type)})]}),O.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),O.jsx("div",{className:"flex items-center justify-between",children:O.jsxs("div",{className:"flex items-center gap-[12px]",children:[O.jsx(Xb,{className:"!text-[24px] text-red-600"}),O.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[O.jsx("div",{children:"Opening"}),O.jsx("div",{children:"Expenditure"}),O.jsx("div",{children:"Payment"}),O.jsx("div",{children:"Outstanding"})]}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[O.jsx("div",{children:s(r.opening_balance,r?.currency_type)}),O.jsx("div",{children:s(r.expenditure,r?.currency_type)}),O.jsx("div",{children:s(r.payment,r?.currency_type)}),O.jsx("div",{children:s(r.outstanding,r?.currency_type)})]})]})})}var XY="tippy-box",IT="tippy-content",ZY="tippy-backdrop",$T="tippy-arrow",LT="tippy-svg-arrow",ao={passive:!0,capture:!0},FT=function(){return document.body};function JY(e,t){return{}.hasOwnProperty.call(e,t)}function lh(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function _y(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function BT(e,t){return typeof e=="function"?e.apply(void 0,t):e}function AO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function QY(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function eG(e){return e.split(/\s+/).filter(Boolean)}function ta(e){return[].concat(e)}function TO(e,t){e.indexOf(t)===-1&&e.push(t)}function tG(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function nG(e){return e.split("-")[0]}function qu(e){return[].slice.call(e)}function kO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function As(){return document.createElement("div")}function Qs(e){return["Element","Fragment"].some(function(t){return _y(e,t)})}function rG(e){return _y(e,"NodeList")}function iG(e){return _y(e,"MouseEvent")}function oG(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function aG(e){return Qs(e)?[e]:rG(e)?qu(e):Array.isArray(e)?e:qu(document.querySelectorAll(e))}function ch(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function MO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function sG(e){var t,n=ta(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function lG(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=nG(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-r+d>l,v=r-o.bottom-f>l,y=o.left-n+p>l,E=n-o.right-g>l;return m||v||y||E})}function uh(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function jO(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Er={isTouch:!1},NO=0;function cG(){Er.isTouch||(Er.isTouch=!0,window.performance&&document.addEventListener("mousemove",zT))}function zT(){var e=performance.now();e-NO<20&&(Er.isTouch=!1,document.removeEventListener("mousemove",zT)),NO=e}function uG(){var e=document.activeElement;if(oG(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function dG(){document.addEventListener("touchstart",cG,ao),window.addEventListener("blur",uG)}var fG=typeof window<"u"&&typeof document<"u",pG=fG?!!window.msCrypto:!1;function Xo(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function RO(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function hG(e){return RO(`
309
+ `));const Lt={...r,isRtl:z,arrow:i,disableInteractive:ee,placement:A,PopperComponentProp:k,touch:Q.current},W=typeof M.popper=="function"?M.popper(Lt):M.popper,se=_.useMemo(()=>{let ye=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return D.popperOptions?.modifiers&&(ye=ye.concat(D.popperOptions.modifiers)),W?.popperOptions?.modifiers&&(ye=ye.concat(W.popperOptions.modifiers)),{...D.popperOptions,...W?.popperOptions,modifiers:ye}},[q,D.popperOptions,W?.popperOptions]),X=FY(Lt),le=typeof M.transition=="function"?M.transition(Lt):M.transition,pe={slots:{popper:s.Popper,transition:s.Transition??j,tooltip:s.Tooltip,arrow:s.Arrow,...P},slotProps:{arrow:M.arrow??l.arrow,popper:{...D,...W??l.popper},tooltip:M.tooltip??l.tooltip,transition:{...N,...le??l.transition}}},[Ye,ot]=On("popper",{elementType:BY,externalForwardedProps:pe,ownerState:Lt,className:ue(X.popper,D?.className)}),[Un,vi]=On("transition",{elementType:Js,externalForwardedProps:pe,ownerState:Lt}),[Hn,qi]=On("tooltip",{elementType:zY,className:X.tooltip,externalForwardedProps:pe,ownerState:Lt}),[Fr,mr]=On("arrow",{elementType:VY,className:X.arrow,externalForwardedProps:pe,ownerState:Lt,ref:ne});return O.jsxs(_.Fragment,{children:[_.cloneElement(B,ve),O.jsx(Ye,{as:k??gy,placement:A,anchorEl:y?{getBoundingClientRect:()=>({top:as.y,left:as.x,right:as.x,bottom:as.y,width:0,height:0})}:F,popperRef:en,open:F?T:!1,id:fe,transition:!0,...tn,...ot,popperOptions:se,children:({TransitionProps:ye})=>O.jsx(Un,{timeout:Y.transitions.duration.shorter,...ye,...vi,children:O.jsxs(Hn,{...qi,children:[R,i?O.jsx(Fr,{...mr}):null]})})})]})});process.env.NODE_ENV!=="production"&&(Rm.propTypes={arrow:h.bool,children:za.isRequired,classes:h.object,className:h.string,components:h.shape({Arrow:h.elementType,Popper:h.elementType,Tooltip:h.elementType,Transition:h.elementType}),componentsProps:h.shape({arrow:h.object,popper:h.object,tooltip:h.object,transition:h.object}),describeChild:h.bool,disableFocusListener:h.bool,disableHoverListener:h.bool,disableInteractive:h.bool,disableTouchListener:h.bool,enterDelay:h.number,enterNextDelay:h.number,enterTouchDelay:h.number,followCursor:h.bool,id:h.string,leaveDelay:h.number,leaveTouchDelay:h.number,onClose:h.func,onOpen:h.func,open:h.bool,placement:h.oneOf(["auto-end","auto-start","auto","bottom-end","bottom-start","bottom","left-end","left-start","left","right-end","right-start","right","top-end","top-start","top"]),PopperComponent:h.elementType,PopperProps:h.object,slotProps:h.shape({arrow:h.oneOfType([h.func,h.object]),popper:h.oneOfType([h.func,h.object]),tooltip:h.oneOfType([h.func,h.object]),transition:h.oneOfType([h.func,h.object])}),slots:h.shape({arrow:h.elementType,popper:h.elementType,tooltip:h.elementType,transition:h.elementType}),sx:h.oneOfType([h.arrayOf(h.oneOfType([h.func,h.object,h.bool])),h.func,h.object]),title:h.node,TransitionComponent:h.elementType,TransitionProps:h.object});function WY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Box_List"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M6.562,8.062h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,8.062Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,20.938h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,20.938Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,14.5h-2a1.5,1.5,0,0,1-1.5-1.5V11a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,14.5Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V11a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M20.438,6.062h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,12.5h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,18.935h-9a.5.5,0,1,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]}]}]}]})(e)}function UY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Export"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M5.552,20.968a2.577,2.577,0,0,1-2.5-2.73c-.012-2.153,0-4.306,0-6.459a.5.5,0,0,1,1,0c0,2.2-.032,4.4,0,6.6.016,1.107.848,1.589,1.838,1.589H18.353A1.546,1.546,0,0,0,19.825,19a3.023,3.023,0,0,0,.1-1.061V11.779h0a.5.5,0,0,1,1,0c0,2.224.085,4.465,0,6.687a2.567,2.567,0,0,1-2.67,2.5Z"},child:[]},{tag:"path",attr:{d:"M12.337,3.176a.455.455,0,0,0-.311-.138c-.015,0-.028,0-.043-.006s-.027,0-.041.006a.457.457,0,0,0-.312.138L7.961,6.845a.5.5,0,0,0,.707.707l2.816-2.815V15.479a.5.5,0,0,0,1,0V4.737L15.3,7.552a.5.5,0,0,0,.707-.707Z"},child:[]}]}]}]})(e)}function HY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Warning"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12.5,8.752a.5.5,0,0,0-1,0h0v6a.5.5,0,0,0,1,0Z"},child:[]},{tag:"circle",attr:{cx:"11.999",cy:"16.736",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M18.642,20.934H5.385A2.5,2.5,0,0,1,3.163,17.29L9.792,4.421a2.5,2.5,0,0,1,4.444,0L20.865,17.29a2.5,2.5,0,0,1-2.223,3.644ZM12.014,4.065a1.478,1.478,0,0,0-1.334.814L4.052,17.748a1.5,1.5,0,0,0,1.333,2.186H18.642a1.5,1.5,0,0,0,1.334-2.186L13.348,4.879A1.478,1.478,0,0,0,12.014,4.065Z"},child:[]}]}]}]})(e)}const KY=Gc(Sy)(()=>({width:"fit-content",maxWidth:"100px",height:"28px",padding:"0 6px",display:"flex",fontSize:"12px",alignItems:"center","& .MuiSelect-select":{padding:0},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#C6C6C6",transition:"all 0.2s ease"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#B084CC"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#884EA7 !important",boxShadow:"0 0 0 3px rgba(136, 78, 167, 0.2)"}}));function DT({widgetId:e,options:t=[],defaultValue:n="all",onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=sessionStorage.getItem("community_id"),[a,s]=I.useState(o||n),l=u=>{const d=u.target.value;s(d),d==="all"?sessionStorage.removeItem("community_id"):sessionStorage.setItem("community_id",d),r(d)},c=()=>{sessionStorage.setItem("export","true"),i()};return O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Rm,{slotProps:{tooltip:{sx:{fontSize:"12px"}}},title:"Select a community",children:O.jsx(OT,{size:"small",children:O.jsxs(KY,{value:a,onChange:l,children:[O.jsx(Nm,{value:"all",sx:{fontWeight:600},children:"All"}),t?.map(u=>O.jsx(Nm,{value:u.community_id,children:u.community_name},u.community_id))]})})}),O.jsx(Rm,{slotProps:{tooltip:{sx:{fontSize:"12px"}}},title:"Export CSV for this widget",children:O.jsx("button",{onClick:c,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:O.jsx(UY,{className:"stroke-[#884EA7] stroke-[1.4]"})})})]})}function qY({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}];return O.jsx(Ro,{title:"Engagement",period:"This Month",icon:O.jsx(qS,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,actionButtons:O.jsx(DT,{widgetId:"engagement",options:n,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:O.jsx("div",{className:"w-full h-[235px]",children:O.jsx(Fo,{width:"100%",height:"100%",children:O.jsxs(hH,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[O.jsx(Jd,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),O.jsx(Ys,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),O.jsx(Qd,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),O.jsx(Lo,{content:O.jsx(hl,{}),cursor:{fill:"transparent"}}),O.jsx(pA,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((o,a)=>O.jsx(Nr,{fill:r[a]},o.name))})]})})})})}function YY({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=I.useMemo(()=>{if(!t?.graph)return[];const{labels:s=[],bookings:l=[],utilization:c=[]}=t.graph;return s.map((u,d)=>({time:u,bookings:l[d]||0,utilization:c[d]||0}))},[t]),o=s=>["12 AM","6 AM","12 PM","6 PM","11 PM"].includes(s)?s:"",a=i.length?i:Array.from({length:24},(s,l)=>({time:`${l%12||12} ${l>=12?"PM":"AM"}`,bookings:0,utilization:0}));return O.jsxs(Ro,{title:"Facilities",period:"Today",icon:O.jsx(KS,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[O.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-[16px]",children:[O.jsxs("div",{children:[O.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),O.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),O.jsxs("div",{children:[O.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),O.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),O.jsx("div",{className:"w-full h-[170px]",children:O.jsx(Fo,{width:"100%",height:"100%",children:O.jsxs(zA,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[O.jsx(Jd,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),O.jsx(Qd,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),O.jsx(Ys,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),O.jsx(Ys,{yAxisId:"right",orientation:"right",domain:[0,100],ticks:[0,20,40,60,80,100],tickFormatter:s=>`${s}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),O.jsx(Lo,{content:O.jsx(hl,{})}),O.jsx(la,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),O.jsx(la,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function GY({data:e,communities:t}){const n=e?.incomeSummary||{},r=e?.expenditureSummary||{},i=["AED","USD","EUR"],o=["Rs","INR","₹"];function a(l){if(l==null||isNaN(l))return"0";const c=Number(l),u=Math.abs(c),d=c<0?"-":"";return u>=1e9?d+(u/1e9).toFixed(u%1e9===0?0:2)+"B":u>=1e6?d+(u/1e6).toFixed(u%1e6===0?0:2)+"M":u>=1e3?d+(u/1e3).toFixed(u%1e3===0?0:2)+"K":d+u.toFixed(u%1===0?0:2)}function s(l,c){return c?o.includes(c)?`${c} ${a(l)}`:i.includes(c)?`${a(l)} ${c}`:`${a(l)} ${c}`:a(l)}return O.jsx(Ro,{title:"Income",period:"This Month",icon:O.jsx(Xb,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:O.jsx(DT,{widgetId:"finance_summary",options:t,onFilterChange:(l,c)=>console.log(l,c),onExport:l=>console.log("Export triggered for",l)}),children:O.jsxs("div",{children:[O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[O.jsx("div",{children:"Opening"}),O.jsx("div",{children:"Income"}),O.jsx("div",{children:"Collection"}),O.jsx("div",{children:"Closing"})]}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[O.jsx("div",{children:s(n.opening_balance,n?.currency_type)}),O.jsx("div",{children:s(n.income,n?.currency_type)}),O.jsx("div",{children:s(n.collection,n?.currency_type)}),O.jsx("div",{children:s(n.closing_balance,n?.currency_type)})]}),O.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),O.jsx("div",{className:"flex items-center justify-between",children:O.jsxs("div",{className:"flex items-center gap-[12px]",children:[O.jsx(Xb,{className:"!text-[24px] text-red-600"}),O.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[O.jsx("div",{children:"Opening"}),O.jsx("div",{children:"Expenditure"}),O.jsx("div",{children:"Payment"}),O.jsx("div",{children:"Outstanding"})]}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[O.jsx("div",{children:s(r.opening_balance,r?.currency_type)}),O.jsx("div",{children:s(r.expenditure,r?.currency_type)}),O.jsx("div",{children:s(r.payment,r?.currency_type)}),O.jsx("div",{children:s(r.outstanding,r?.currency_type)})]})]})})}var XY="tippy-box",IT="tippy-content",ZY="tippy-backdrop",$T="tippy-arrow",LT="tippy-svg-arrow",ao={passive:!0,capture:!0},FT=function(){return document.body};function JY(e,t){return{}.hasOwnProperty.call(e,t)}function lh(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function _y(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function BT(e,t){return typeof e=="function"?e.apply(void 0,t):e}function AO(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function QY(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function eG(e){return e.split(/\s+/).filter(Boolean)}function ta(e){return[].concat(e)}function TO(e,t){e.indexOf(t)===-1&&e.push(t)}function tG(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function nG(e){return e.split("-")[0]}function qu(e){return[].slice.call(e)}function kO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function As(){return document.createElement("div")}function Qs(e){return["Element","Fragment"].some(function(t){return _y(e,t)})}function rG(e){return _y(e,"NodeList")}function iG(e){return _y(e,"MouseEvent")}function oG(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function aG(e){return Qs(e)?[e]:rG(e)?qu(e):Array.isArray(e)?e:qu(document.querySelectorAll(e))}function ch(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function MO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function sG(e){var t,n=ta(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function lG(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=nG(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-r+d>l,v=r-o.bottom-f>l,y=o.left-n+p>l,E=n-o.right-g>l;return m||v||y||E})}function uh(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function jO(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Er={isTouch:!1},NO=0;function cG(){Er.isTouch||(Er.isTouch=!0,window.performance&&document.addEventListener("mousemove",zT))}function zT(){var e=performance.now();e-NO<20&&(Er.isTouch=!1,document.removeEventListener("mousemove",zT)),NO=e}function uG(){var e=document.activeElement;if(oG(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function dG(){document.addEventListener("touchstart",cG,ao),window.addEventListener("blur",uG)}var fG=typeof window<"u"&&typeof document<"u",pG=fG?!!window.msCrypto:!1;function Xo(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function RO(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function hG(e){return RO(`
310
310
  %ctippy.js
311
311
 
312
312
  %c`+RO(e)+`
package/dist/index.es.js CHANGED
@@ -32907,25 +32907,43 @@ function XT({
32907
32907
  onExport: i = () => {
32908
32908
  }
32909
32909
  }) {
32910
- const o = sessionStorage.getItem(`${e}_community_id`), [a, s] = Rt(o || n), l = (u) => {
32910
+ const o = sessionStorage.getItem("community_id"), [a, s] = Rt(o || n), l = (u) => {
32911
32911
  const d = u.target.value;
32912
- s(d), d === "all" ? sessionStorage.removeItem(`${e}_community_id`) : sessionStorage.setItem(`${e}_community_id`, d), r(d, e);
32912
+ s(d), d === "all" ? sessionStorage.removeItem("community_id") : sessionStorage.setItem("community_id", d), r(d);
32913
32913
  }, c = () => {
32914
- sessionStorage.setItem(`${e}_export`, "true"), i(e);
32915
- };
32916
- return console.log(t, "options in action button"), /* @__PURE__ */ O.jsxs("div", { className: "flex items-center gap-2", children: [
32917
- /* @__PURE__ */ O.jsx(Um, { title: "Select a community", children: /* @__PURE__ */ O.jsx($T, { size: "small", children: /* @__PURE__ */ O.jsxs(iG, { value: a, onChange: l, children: [
32918
- /* @__PURE__ */ O.jsx(Vm, { value: "all", sx: { fontWeight: 600 }, children: "All" }),
32919
- t?.map((u) => /* @__PURE__ */ O.jsx(Vm, { value: u.id, children: u.name }, u.id))
32920
- ] }) }) }),
32921
- /* @__PURE__ */ O.jsx(Um, { title: "Export CSV for this widget", children: /* @__PURE__ */ O.jsx(
32922
- "button",
32914
+ sessionStorage.setItem("export", "true"), i();
32915
+ };
32916
+ return /* @__PURE__ */ O.jsxs("div", { className: "flex items-center gap-2", children: [
32917
+ /* @__PURE__ */ O.jsx(
32918
+ Um,
32923
32919
  {
32924
- onClick: c,
32925
- className: "px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",
32926
- children: /* @__PURE__ */ O.jsx(nG, { className: "stroke-[#884EA7] stroke-[1.4]" })
32920
+ slotProps: {
32921
+ tooltip: { sx: { fontSize: "12px" } }
32922
+ },
32923
+ title: "Select a community",
32924
+ children: /* @__PURE__ */ O.jsx($T, { size: "small", children: /* @__PURE__ */ O.jsxs(iG, { value: a, onChange: l, children: [
32925
+ /* @__PURE__ */ O.jsx(Vm, { value: "all", sx: { fontWeight: 600 }, children: "All" }),
32926
+ t?.map((u) => /* @__PURE__ */ O.jsx(Vm, { value: u.community_id, children: u.community_name }, u.community_id))
32927
+ ] }) })
32928
+ }
32929
+ ),
32930
+ /* @__PURE__ */ O.jsx(
32931
+ Um,
32932
+ {
32933
+ slotProps: {
32934
+ tooltip: { sx: { fontSize: "12px" } }
32935
+ },
32936
+ title: "Export CSV for this widget",
32937
+ children: /* @__PURE__ */ O.jsx(
32938
+ "button",
32939
+ {
32940
+ onClick: c,
32941
+ className: "px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",
32942
+ children: /* @__PURE__ */ O.jsx(nG, { className: "stroke-[#884EA7] stroke-[1.4]" })
32943
+ }
32944
+ )
32927
32945
  }
32928
- ) })
32946
+ )
32929
32947
  ] });
32930
32948
  }
32931
32949
  function Jee({ isStatic: e, data: t, communities: n }) {
package/dist/index.umd.js CHANGED
@@ -306,7 +306,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
306
306
  `))}},[Qt,we,E,x,z]),ln&&(E?ut.length===0?de=null:de=ut.reduce((X,ce,he)=>(X.push(ce),he<ut.length-1&&X.push(", "),X),[]):de=$t);let Cn=oe;!a&&ie&&ee&&(Cn=T.clientWidth);let Kt;typeof j<"u"?Kt=j:Kt=d?null:0;const An=D.id||(x?`mui-component-select-${x}`:void 0),ve={...t,variant:B,value:z,open:Ye,error:p},un=EY(ve),qt={...y.PaperProps,...typeof y.slotProps?.paper=="function"?y.slotProps.paper(ve):y.slotProps?.paper},W={...y.MenuListProps,...typeof y.slotProps?.list=="function"?y.slotProps.list(ve):y.slotProps?.list},se=d0();return O.jsxs(_.Fragment,{children:[O.jsx(bY,{as:"div",ref:J,tabIndex:Kt,role:"combobox","aria-controls":Ye?se:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":Ye?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[v,An].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":P?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:it,onMouseDown:d||R?null:te,onBlur:De,onFocus:C,...D,ownerState:ve,className:ue(D.className,un.select,l),id:An,children:OY(de)?QC||(QC=O.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):de}),O.jsx(wY,{"aria-invalid":p,value:Array.isArray(z)?z.join(","):z,name:x,ref:ne,"aria-hidden":!0,onChange:_e,tabIndex:-1,disabled:d,className:un.nativeInput,autoFocus:o,required:P,...Y,ownerState:ve}),O.jsx(xY,{as:g,className:un.icon,ownerState:ve}),O.jsx(KC,{id:`menu-${x||""}`,anchorEl:T,open:Ye,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...y,slotProps:{...y.slotProps,list:{"aria-labelledby":v,role:"listbox","aria-multiselectable":E?"true":void 0,disableListWrap:!0,id:se,...W},paper:{...qt,style:{minWidth:Cn,...qt!=null?qt.style:null}}},children:cn})]})});process.env.NODE_ENV!=="production"&&(tA.propTypes={"aria-describedby":h.string,"aria-label":h.string,autoFocus:h.bool,autoWidth:h.bool,children:h.node,classes:h.object,className:h.string,defaultOpen:h.bool,defaultValue:h.any,disabled:h.bool,displayEmpty:h.bool,error:h.bool,IconComponent:h.elementType.isRequired,inputRef:kr,labelId:h.string,MenuProps:h.object,multiple:h.bool,name:h.string,onBlur:h.func,onChange:h.func,onClose:h.func,onFocus:h.func,onOpen:h.func,open:h.bool,readOnly:h.bool,renderValue:h.func,required:h.bool,SelectDisplayProps:h.object,tabIndex:h.oneOfType([h.number,h.string]),type:h.any,value:h.any,variant:h.oneOf(["standard","outlined","filled"])});const SY=e=>{const{classes:t}=e,r=Mt({root:["root"]},JC,t);return{...t,...r}},Yv={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>Or(e)&&e!=="variant"},_Y=Oe(Wv,Yv)(""),PY=Oe(qv,Yv)(""),CY=Oe(Bv,Yv)(""),Gv=_.forwardRef(function(t,n){const r=Lt({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=fq,id:d,input:f,inputProps:p,label:g,labelId:m,MenuProps:v,multiple:y=!1,native:E=!1,onClose:x,onOpen:b,open:w,renderValue:S,SelectDisplayProps:C,variant:A="outlined",...k}=r,R=E?GC:tA,M=Lv(),P=$v({props:r,muiFormControl:M,states:["variant","error"]}),D=P.variant||A,j={...r,variant:D,classes:a},N=SY(j),{root:L,...B}=N,Y=f||{standard:O.jsx(_Y,{ownerState:j}),outlined:O.jsx(PY,{label:g,ownerState:j}),filled:O.jsx(CY,{ownerState:j})}[D],z=Ft(n,Ta(Y));return O.jsx(_.Fragment,{children:_.cloneElement(Y,{inputComponent:R,inputProps:{children:o,error:P.error,IconComponent:u,variant:D,type:void 0,multiple:y,...E?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:v,onClose:x,onOpen:b,open:w,renderValue:S,SelectDisplayProps:{id:d,...C}},...p,classes:p?en(B,p.classes):B,...f?f.props.inputProps:{}},...(y&&E||c)&&D==="outlined"?{notched:!0}:{},ref:z,className:ue(Y.props.className,s,N.root),...!f&&{variant:D},...k})})});process.env.NODE_ENV!=="production"&&(Gv.propTypes={autoWidth:h.bool,children:h.node,classes:h.object,className:h.string,defaultOpen:h.bool,defaultValue:h.any,displayEmpty:h.bool,IconComponent:h.elementType,id:h.string,input:h.element,inputProps:h.object,label:h.node,labelId:h.string,MenuProps:h.object,multiple:h.bool,native:h.bool,onChange:h.func,onClose:h.func,onOpen:h.func,open:h.bool,renderValue:h.func,SelectDisplayProps:h.object,sx:h.oneOfType([h.arrayOf(h.oneOfType([h.func,h.object,h.bool])),h.func,h.object]),value:h.oneOfType([h.oneOf([""]),h.any]),variant:h.oneOf(["filled","outlined","standard"])}),Gv.muiName="Select";function AY(e){return Pt("MuiTooltip",e)}const vt=mt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function TY(e){return Math.round(e*1e5)/1e5}const kY=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${kt(o.split("-")[0])}`],arrow:["arrow"]};return Mt(a,AY,t)},MY=Oe(Rv,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(nn(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${vt.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${vt.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${vt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${vt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${vt.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${vt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${vt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${vt.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),jY=Oe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${kt(n.placement.split("-")[0])}`]]}})(nn(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${vt.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${vt.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${vt.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${vt.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${TY(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${vt.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${vt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${vt.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${vt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${vt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${vt.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${vt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${vt.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${vt.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${vt.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),NY=Oe("span",{name:"MuiTooltip",slot:"Arrow"})(nn(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let Id=!1;const nA=new pd;let hl={x:0,y:0};function Rd(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Xv=_.forwardRef(function(t,n){const r=Lt({props:t,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:a,components:s={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:d=!1,disableInteractive:f=!1,disableTouchListener:p=!1,enterDelay:g=100,enterNextDelay:m=0,enterTouchDelay:v=700,followCursor:y=!1,id:E,leaveDelay:x=0,leaveTouchDelay:b=1500,onClose:w,onOpen:S,open:C,placement:A="bottom",PopperComponent:k,PopperProps:R={},slotProps:M={},slots:P={},title:D,TransitionComponent:j,TransitionProps:N,...L}=r,B=_.isValidElement(o)?o:O.jsx("span",{children:o}),Y=Oc(),z=Uf(),[F,G]=_.useState(),[q,ne]=_.useState(null),Q=_.useRef(!1),ee=f||y,re=Sa(),ie=Sa(),oe=Sa(),H=Sa(),[K,J]=ep({controlled:C,default:!1,name:"Tooltip",state:"open"});let T=K;if(process.env.NODE_ENV!=="production"){const{current:ye}=_.useRef(C!==void 0);_.useEffect(()=>{F&&F.disabled&&!ye&&D!==""&&F.tagName.toLowerCase()==="button"&&console.warn(["MUI: You are providing a disabled `button` child to the Tooltip component.","A disabled element does not fire events.","Tooltip needs to listen to the child element's events to display the title.","","Add a simple wrapper element, such as a `span`."].join(`
307
307
  `))},[D,F,ye])}const pe=d0(E),te=_.useRef(),me=Hr(()=>{te.current!==void 0&&(document.body.style.WebkitUserSelect=te.current,te.current=void 0),H.clear()});_.useEffect(()=>me,[me]);const we=ye=>{nA.clear(),Id=!0,J(!0),S&&!T&&S(ye)},_e=Hr(ye=>{nA.start(800+x,()=>{Id=!1}),J(!1),w&&T&&w(ye),re.start(Y.transitions.duration.shortest,()=>{Q.current=!1})}),ke=ye=>{Q.current&&ye.type!=="touchstart"||(F&&F.removeAttribute("title"),ie.clear(),oe.clear(),g||Id&&m?ie.start(Id?m:g,()=>{we(ye)}):we(ye))},it=ye=>{ie.clear(),oe.start(x,()=>{_e(ye)})},[,Ye]=_.useState(!1),De=ye=>{gd(ye.target)||(Ye(!1),it(ye))},de=ye=>{F||G(ye.currentTarget),gd(ye.target)&&(Ye(!0),ke(ye))},$t=ye=>{Q.current=!0;const pn=B.props;pn.onTouchStart&&pn.onTouchStart(ye)},ut=ye=>{$t(ye),oe.clear(),re.clear(),me(),te.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",H.start(v,()=>{document.body.style.WebkitUserSelect=te.current,ke(ye)})},ln=ye=>{B.props.onTouchEnd&&B.props.onTouchEnd(ye),me(),oe.start(b,()=>{_e(ye)})};_.useEffect(()=>{if(!T)return;function ye(pn){pn.key==="Escape"&&_e(pn)}return document.addEventListener("keydown",ye),()=>{document.removeEventListener("keydown",ye)}},[_e,T]);const Qt=Ft(Ta(B),G,n);!D&&D!==0&&(T=!1);const cn=_.useRef(),Cn=ye=>{const pn=B.props;pn.onMouseMove&&pn.onMouseMove(ye),hl={x:ye.clientX,y:ye.clientY},cn.current&&cn.current.update()},Kt={},An=typeof D=="string";c?(Kt.title=!T&&An&&!d?D:null,Kt["aria-describedby"]=T?pe:null):(Kt["aria-label"]=An?D:null,Kt["aria-labelledby"]=T&&!An?pe:null);const ve={...Kt,...L,...B.props,className:ue(L.className,B.props.className),onTouchStart:$t,ref:Qt,...y?{onMouseMove:Cn}:{}};process.env.NODE_ENV!=="production"&&(ve["data-mui-internal-clone-element"]=!0,_.useEffect(()=>{F&&!F.getAttribute("data-mui-internal-clone-element")&&console.error(["MUI: The `children` component of the Tooltip is not forwarding its props correctly.","Please make sure that props are spread on the same element that the ref is applied to."].join(`
308
308
  `))},[F]));const un={};p||(ve.onTouchStart=ut,ve.onTouchEnd=ln),d||(ve.onMouseOver=Rd(ke,ve.onMouseOver),ve.onMouseLeave=Rd(it,ve.onMouseLeave),ee||(un.onMouseOver=ke,un.onMouseLeave=it)),u||(ve.onFocus=Rd(de,ve.onFocus),ve.onBlur=Rd(De,ve.onBlur),ee||(un.onFocus=de,un.onBlur=De)),process.env.NODE_ENV!=="production"&&B.props.title&&console.error(["MUI: You have provided a `title` prop to the child of <Tooltip />.",`Remove this title prop \`${B.props.title}\` or the Tooltip component.`].join(`
309
- `));const qt={...r,isRtl:z,arrow:i,disableInteractive:ee,placement:A,PopperComponentProp:k,touch:Q.current},W=typeof M.popper=="function"?M.popper(qt):M.popper,se=_.useMemo(()=>{let ye=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return R.popperOptions?.modifiers&&(ye=ye.concat(R.popperOptions.modifiers)),W?.popperOptions?.modifiers&&(ye=ye.concat(W.popperOptions.modifiers)),{...R.popperOptions,...W?.popperOptions,modifiers:ye}},[q,R.popperOptions,W?.popperOptions]),X=kY(qt),ce=typeof M.transition=="function"?M.transition(qt):M.transition,he={slots:{popper:s.Popper,transition:s.Transition??j,tooltip:s.Tooltip,arrow:s.Arrow,...P},slotProps:{arrow:M.arrow??l.arrow,popper:{...R,...W??l.popper},tooltip:M.tooltip??l.tooltip,transition:{...N,...ce??l.transition}}},[Ze,dt]=xn("popper",{elementType:MY,externalForwardedProps:he,ownerState:qt,className:ue(X.popper,R?.className)}),[sr,qi]=xn("transition",{elementType:cl,externalForwardedProps:he,ownerState:qt}),[lr,Bo]=xn("tooltip",{elementType:jY,className:X.tooltip,externalForwardedProps:he,ownerState:qt}),[vi,Fr]=xn("arrow",{elementType:NY,className:X.arrow,externalForwardedProps:he,ownerState:qt,ref:ne});return O.jsxs(_.Fragment,{children:[_.cloneElement(B,ve),O.jsx(Ze,{as:k??Rv,placement:A,anchorEl:y?{getBoundingClientRect:()=>({top:hl.y,left:hl.x,right:hl.x,bottom:hl.y,width:0,height:0})}:F,popperRef:cn,open:F?T:!1,id:pe,transition:!0,...un,...dt,popperOptions:se,children:({TransitionProps:ye})=>O.jsx(sr,{timeout:Y.transitions.duration.shorter,...ye,...qi,children:O.jsxs(lr,{...Bo,children:[D,i?O.jsx(vi,{...Fr}):null]})})})]})});process.env.NODE_ENV!=="production"&&(Xv.propTypes={arrow:h.bool,children:Ma.isRequired,classes:h.object,className:h.string,components:h.shape({Arrow:h.elementType,Popper:h.elementType,Tooltip:h.elementType,Transition:h.elementType}),componentsProps:h.shape({arrow:h.object,popper:h.object,tooltip:h.object,transition:h.object}),describeChild:h.bool,disableFocusListener:h.bool,disableHoverListener:h.bool,disableInteractive:h.bool,disableTouchListener:h.bool,enterDelay:h.number,enterNextDelay:h.number,enterTouchDelay:h.number,followCursor:h.bool,id:h.string,leaveDelay:h.number,leaveTouchDelay:h.number,onClose:h.func,onOpen:h.func,open:h.bool,placement:h.oneOf(["auto-end","auto-start","auto","bottom-end","bottom-start","bottom","left-end","left-start","left","right-end","right-start","right","top-end","top-start","top"]),PopperComponent:h.elementType,PopperProps:h.object,slotProps:h.shape({arrow:h.oneOfType([h.func,h.object]),popper:h.oneOfType([h.func,h.object]),tooltip:h.oneOfType([h.func,h.object]),transition:h.oneOfType([h.func,h.object])}),slots:h.shape({arrow:h.elementType,popper:h.elementType,tooltip:h.elementType,transition:h.elementType}),sx:h.oneOfType([h.arrayOf(h.oneOfType([h.func,h.object,h.bool])),h.func,h.object]),title:h.node,TransitionComponent:h.elementType,TransitionProps:h.object});function DY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Box_List"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M6.562,8.062h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,8.062Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,20.938h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,20.938Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,14.5h-2a1.5,1.5,0,0,1-1.5-1.5V11a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,14.5Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V11a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M20.438,6.062h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,12.5h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,18.935h-9a.5.5,0,1,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]}]}]}]})(e)}function IY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Export"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M5.552,20.968a2.577,2.577,0,0,1-2.5-2.73c-.012-2.153,0-4.306,0-6.459a.5.5,0,0,1,1,0c0,2.2-.032,4.4,0,6.6.016,1.107.848,1.589,1.838,1.589H18.353A1.546,1.546,0,0,0,19.825,19a3.023,3.023,0,0,0,.1-1.061V11.779h0a.5.5,0,0,1,1,0c0,2.224.085,4.465,0,6.687a2.567,2.567,0,0,1-2.67,2.5Z"},child:[]},{tag:"path",attr:{d:"M12.337,3.176a.455.455,0,0,0-.311-.138c-.015,0-.028,0-.043-.006s-.027,0-.041.006a.457.457,0,0,0-.312.138L7.961,6.845a.5.5,0,0,0,.707.707l2.816-2.815V15.479a.5.5,0,0,0,1,0V4.737L15.3,7.552a.5.5,0,0,0,.707-.707Z"},child:[]}]}]}]})(e)}function RY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Warning"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12.5,8.752a.5.5,0,0,0-1,0h0v6a.5.5,0,0,0,1,0Z"},child:[]},{tag:"circle",attr:{cx:"11.999",cy:"16.736",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M18.642,20.934H5.385A2.5,2.5,0,0,1,3.163,17.29L9.792,4.421a2.5,2.5,0,0,1,4.444,0L20.865,17.29a2.5,2.5,0,0,1-2.223,3.644ZM12.014,4.065a1.478,1.478,0,0,0-1.334.814L4.052,17.748a1.5,1.5,0,0,0,1.333,2.186H18.642a1.5,1.5,0,0,0,1.334-2.186L13.348,4.879A1.478,1.478,0,0,0,12.014,4.065Z"},child:[]}]}]}]})(e)}const $Y=mc(Gv)(()=>({width:"fit-content",maxWidth:"100px",height:"28px",padding:"0 6px",display:"flex",fontSize:"12px",alignItems:"center","& .MuiSelect-select":{padding:0},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#C6C6C6",transition:"all 0.2s ease"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#B084CC"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#884EA7 !important",boxShadow:"0 0 0 3px rgba(136, 78, 167, 0.2)"}}));function rA({widgetId:e,options:t=[],defaultValue:n="all",onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=sessionStorage.getItem(`${e}_community_id`),[a,s]=I.useState(o||n),l=u=>{const d=u.target.value;s(d),d==="all"?sessionStorage.removeItem(`${e}_community_id`):sessionStorage.setItem(`${e}_community_id`,d),r(d,e)},c=()=>{sessionStorage.setItem(`${e}_export`,"true"),i(e)};return console.log(t,"options in action button"),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Xv,{title:"Select a community",children:O.jsx(DC,{size:"small",children:O.jsxs($Y,{value:a,onChange:l,children:[O.jsx(Hv,{value:"all",sx:{fontWeight:600},children:"All"}),t?.map(u=>O.jsx(Hv,{value:u.id,children:u.name},u.id))]})})}),O.jsx(Xv,{title:"Export CSV for this widget",children:O.jsx("button",{onClick:c,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:O.jsx(IY,{className:"stroke-[#884EA7] stroke-[1.4]"})})})]})}function LY({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}];return O.jsx(Zi,{title:"Engagement",period:"This Month",icon:O.jsx($0,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,actionButtons:O.jsx(rA,{widgetId:"engagement",options:n,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:O.jsx("div",{className:"w-full h-[235px]",children:O.jsx(bo,{width:"100%",height:"100%",children:O.jsxs(oH,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[O.jsx(od,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),O.jsx(Zs,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),O.jsx(sd,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),O.jsx(yo,{content:O.jsx(ss,{}),cursor:{fill:"transparent"}}),O.jsx(UP,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((o,a)=>O.jsx(Ar,{fill:r[a]},o.name))})]})})})})}function FY({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=I.useMemo(()=>{if(!t?.graph)return[];const{labels:s=[],bookings:l=[],utilization:c=[]}=t.graph;return s.map((u,d)=>({time:u,bookings:l[d]||0,utilization:c[d]||0}))},[t]),o=s=>["12 AM","6 AM","12 PM","6 PM","11 PM"].includes(s)?s:"",a=i.length?i:Array.from({length:24},(s,l)=>({time:`${l%12||12} ${l>=12?"PM":"AM"}`,bookings:0,utilization:0}));return O.jsxs(Zi,{title:"Facilities",period:"Today",icon:O.jsx(R0,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[O.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-[16px]",children:[O.jsxs("div",{children:[O.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),O.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),O.jsxs("div",{children:[O.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),O.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),O.jsx("div",{className:"w-full h-[170px]",children:O.jsx(bo,{width:"100%",height:"100%",children:O.jsxs(N2,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[O.jsx(od,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),O.jsx(sd,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),O.jsx(Zs,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),O.jsx(Zs,{yAxisId:"right",orientation:"right",domain:[0,100],ticks:[0,20,40,60,80,100],tickFormatter:s=>`${s}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),O.jsx(yo,{content:O.jsx(ss,{})}),O.jsx(xa,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),O.jsx(xa,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function BY({data:e,communities:t}){const n=e?.incomeSummary||{},r=e?.expenditureSummary||{},i=["AED","USD","EUR"],o=["Rs","INR","₹"];function a(l){if(l==null||isNaN(l))return"0";const c=Number(l),u=Math.abs(c),d=c<0?"-":"";return u>=1e9?d+(u/1e9).toFixed(u%1e9===0?0:2)+"B":u>=1e6?d+(u/1e6).toFixed(u%1e6===0?0:2)+"M":u>=1e3?d+(u/1e3).toFixed(u%1e3===0?0:2)+"K":d+u.toFixed(u%1===0?0:2)}function s(l,c){return c?o.includes(c)?`${c} ${a(l)}`:i.includes(c)?`${a(l)} ${c}`:`${a(l)} ${c}`:a(l)}return O.jsx(Zi,{title:"Income",period:"This Month",icon:O.jsx(L0,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:O.jsx(rA,{widgetId:"finance_summary",options:t,onFilterChange:(l,c)=>console.log(l,c),onExport:l=>console.log("Export triggered for",l)}),children:O.jsxs("div",{children:[O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[O.jsx("div",{children:"Opening"}),O.jsx("div",{children:"Income"}),O.jsx("div",{children:"Collection"}),O.jsx("div",{children:"Closing"})]}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[O.jsx("div",{children:s(n.opening_balance,n?.currency_type)}),O.jsx("div",{children:s(n.income,n?.currency_type)}),O.jsx("div",{children:s(n.collection,n?.currency_type)}),O.jsx("div",{children:s(n.closing_balance,n?.currency_type)})]}),O.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),O.jsx("div",{className:"flex items-center justify-between",children:O.jsxs("div",{className:"flex items-center gap-[12px]",children:[O.jsx(L0,{className:"!text-[24px] text-red-600"}),O.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[O.jsx("div",{children:"Opening"}),O.jsx("div",{children:"Expenditure"}),O.jsx("div",{children:"Payment"}),O.jsx("div",{children:"Outstanding"})]}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[O.jsx("div",{children:s(r.opening_balance,r?.currency_type)}),O.jsx("div",{children:s(r.expenditure,r?.currency_type)}),O.jsx("div",{children:s(r.payment,r?.currency_type)}),O.jsx("div",{children:s(r.outstanding,r?.currency_type)})]})]})})}var zY="tippy-box",iA="tippy-content",VY="tippy-backdrop",oA="tippy-arrow",aA="tippy-svg-arrow",To={passive:!0,capture:!0},sA=function(){return document.body};function WY(e,t){return{}.hasOwnProperty.call(e,t)}function Zv(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Jv(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function lA(e,t){return typeof e=="function"?e.apply(void 0,t):e}function cA(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function UY(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function HY(e){return e.split(/\s+/).filter(Boolean)}function ja(e){return[].concat(e)}function uA(e,t){e.indexOf(t)===-1&&e.push(t)}function KY(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function qY(e){return e.split("-")[0]}function $d(e){return[].slice.call(e)}function dA(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ml(){return document.createElement("div")}function gl(e){return["Element","Fragment"].some(function(t){return Jv(e,t)})}function YY(e){return Jv(e,"NodeList")}function GY(e){return Jv(e,"MouseEvent")}function XY(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function ZY(e){return gl(e)?[e]:YY(e)?$d(e):Array.isArray(e)?e:$d(document.querySelectorAll(e))}function Qv(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function fA(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function JY(e){var t,n=ja(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function QY(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=qY(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-r+d>l,v=r-o.bottom-f>l,y=o.left-n+p>l,E=n-o.right-g>l;return m||v||y||E})}function ey(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function pA(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Dr={isTouch:!1},hA=0;function eG(){Dr.isTouch||(Dr.isTouch=!0,window.performance&&document.addEventListener("mousemove",mA))}function mA(){var e=performance.now();e-hA<20&&(Dr.isTouch=!1,document.removeEventListener("mousemove",mA)),hA=e}function tG(){var e=document.activeElement;if(XY(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function nG(){document.addEventListener("touchstart",eG,To),window.addEventListener("blur",tG)}var rG=typeof window<"u"&&typeof document<"u",iG=rG?!!window.msCrypto:!1;function Na(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function gA(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function oG(e){return gA(`
309
+ `));const qt={...r,isRtl:z,arrow:i,disableInteractive:ee,placement:A,PopperComponentProp:k,touch:Q.current},W=typeof M.popper=="function"?M.popper(qt):M.popper,se=_.useMemo(()=>{let ye=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return R.popperOptions?.modifiers&&(ye=ye.concat(R.popperOptions.modifiers)),W?.popperOptions?.modifiers&&(ye=ye.concat(W.popperOptions.modifiers)),{...R.popperOptions,...W?.popperOptions,modifiers:ye}},[q,R.popperOptions,W?.popperOptions]),X=kY(qt),ce=typeof M.transition=="function"?M.transition(qt):M.transition,he={slots:{popper:s.Popper,transition:s.Transition??j,tooltip:s.Tooltip,arrow:s.Arrow,...P},slotProps:{arrow:M.arrow??l.arrow,popper:{...R,...W??l.popper},tooltip:M.tooltip??l.tooltip,transition:{...N,...ce??l.transition}}},[Ze,dt]=xn("popper",{elementType:MY,externalForwardedProps:he,ownerState:qt,className:ue(X.popper,R?.className)}),[sr,qi]=xn("transition",{elementType:cl,externalForwardedProps:he,ownerState:qt}),[lr,Bo]=xn("tooltip",{elementType:jY,className:X.tooltip,externalForwardedProps:he,ownerState:qt}),[vi,Fr]=xn("arrow",{elementType:NY,className:X.arrow,externalForwardedProps:he,ownerState:qt,ref:ne});return O.jsxs(_.Fragment,{children:[_.cloneElement(B,ve),O.jsx(Ze,{as:k??Rv,placement:A,anchorEl:y?{getBoundingClientRect:()=>({top:hl.y,left:hl.x,right:hl.x,bottom:hl.y,width:0,height:0})}:F,popperRef:cn,open:F?T:!1,id:pe,transition:!0,...un,...dt,popperOptions:se,children:({TransitionProps:ye})=>O.jsx(sr,{timeout:Y.transitions.duration.shorter,...ye,...qi,children:O.jsxs(lr,{...Bo,children:[D,i?O.jsx(vi,{...Fr}):null]})})})]})});process.env.NODE_ENV!=="production"&&(Xv.propTypes={arrow:h.bool,children:Ma.isRequired,classes:h.object,className:h.string,components:h.shape({Arrow:h.elementType,Popper:h.elementType,Tooltip:h.elementType,Transition:h.elementType}),componentsProps:h.shape({arrow:h.object,popper:h.object,tooltip:h.object,transition:h.object}),describeChild:h.bool,disableFocusListener:h.bool,disableHoverListener:h.bool,disableInteractive:h.bool,disableTouchListener:h.bool,enterDelay:h.number,enterNextDelay:h.number,enterTouchDelay:h.number,followCursor:h.bool,id:h.string,leaveDelay:h.number,leaveTouchDelay:h.number,onClose:h.func,onOpen:h.func,open:h.bool,placement:h.oneOf(["auto-end","auto-start","auto","bottom-end","bottom-start","bottom","left-end","left-start","left","right-end","right-start","right","top-end","top-start","top"]),PopperComponent:h.elementType,PopperProps:h.object,slotProps:h.shape({arrow:h.oneOfType([h.func,h.object]),popper:h.oneOfType([h.func,h.object]),tooltip:h.oneOfType([h.func,h.object]),transition:h.oneOfType([h.func,h.object])}),slots:h.shape({arrow:h.elementType,popper:h.elementType,tooltip:h.elementType,transition:h.elementType}),sx:h.oneOfType([h.arrayOf(h.oneOfType([h.func,h.object,h.bool])),h.func,h.object]),title:h.node,TransitionComponent:h.elementType,TransitionProps:h.object});function DY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Box_List"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M6.562,8.062h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,8.062Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,20.938h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,20.938Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,14.5h-2a1.5,1.5,0,0,1-1.5-1.5V11a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,14.5Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V11a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M20.438,6.062h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,12.5h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,18.935h-9a.5.5,0,1,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]}]}]}]})(e)}function IY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Export"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M5.552,20.968a2.577,2.577,0,0,1-2.5-2.73c-.012-2.153,0-4.306,0-6.459a.5.5,0,0,1,1,0c0,2.2-.032,4.4,0,6.6.016,1.107.848,1.589,1.838,1.589H18.353A1.546,1.546,0,0,0,19.825,19a3.023,3.023,0,0,0,.1-1.061V11.779h0a.5.5,0,0,1,1,0c0,2.224.085,4.465,0,6.687a2.567,2.567,0,0,1-2.67,2.5Z"},child:[]},{tag:"path",attr:{d:"M12.337,3.176a.455.455,0,0,0-.311-.138c-.015,0-.028,0-.043-.006s-.027,0-.041.006a.457.457,0,0,0-.312.138L7.961,6.845a.5.5,0,0,0,.707.707l2.816-2.815V15.479a.5.5,0,0,0,1,0V4.737L15.3,7.552a.5.5,0,0,0,.707-.707Z"},child:[]}]}]}]})(e)}function RY(e){return qe({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Warning"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12.5,8.752a.5.5,0,0,0-1,0h0v6a.5.5,0,0,0,1,0Z"},child:[]},{tag:"circle",attr:{cx:"11.999",cy:"16.736",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M18.642,20.934H5.385A2.5,2.5,0,0,1,3.163,17.29L9.792,4.421a2.5,2.5,0,0,1,4.444,0L20.865,17.29a2.5,2.5,0,0,1-2.223,3.644ZM12.014,4.065a1.478,1.478,0,0,0-1.334.814L4.052,17.748a1.5,1.5,0,0,0,1.333,2.186H18.642a1.5,1.5,0,0,0,1.334-2.186L13.348,4.879A1.478,1.478,0,0,0,12.014,4.065Z"},child:[]}]}]}]})(e)}const $Y=mc(Gv)(()=>({width:"fit-content",maxWidth:"100px",height:"28px",padding:"0 6px",display:"flex",fontSize:"12px",alignItems:"center","& .MuiSelect-select":{padding:0},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#C6C6C6",transition:"all 0.2s ease"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#B084CC"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#884EA7 !important",boxShadow:"0 0 0 3px rgba(136, 78, 167, 0.2)"}}));function rA({widgetId:e,options:t=[],defaultValue:n="all",onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=sessionStorage.getItem("community_id"),[a,s]=I.useState(o||n),l=u=>{const d=u.target.value;s(d),d==="all"?sessionStorage.removeItem("community_id"):sessionStorage.setItem("community_id",d),r(d)},c=()=>{sessionStorage.setItem("export","true"),i()};return O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Xv,{slotProps:{tooltip:{sx:{fontSize:"12px"}}},title:"Select a community",children:O.jsx(DC,{size:"small",children:O.jsxs($Y,{value:a,onChange:l,children:[O.jsx(Hv,{value:"all",sx:{fontWeight:600},children:"All"}),t?.map(u=>O.jsx(Hv,{value:u.community_id,children:u.community_name},u.community_id))]})})}),O.jsx(Xv,{slotProps:{tooltip:{sx:{fontSize:"12px"}}},title:"Export CSV for this widget",children:O.jsx("button",{onClick:c,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:O.jsx(IY,{className:"stroke-[#884EA7] stroke-[1.4]"})})})]})}function LY({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||0),color:r[3]}];return O.jsx(Zi,{title:"Engagement",period:"This Month",icon:O.jsx($0,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,actionButtons:O.jsx(rA,{widgetId:"engagement",options:n,onFilterChange:(o,a)=>console.log(o,a),onExport:o=>console.log("Export triggered for",o)}),children:O.jsx("div",{className:"w-full h-[235px]",children:O.jsx(bo,{width:"100%",height:"100%",children:O.jsxs(oH,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[O.jsx(od,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),O.jsx(Zs,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),O.jsx(sd,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),O.jsx(yo,{content:O.jsx(ss,{}),cursor:{fill:"transparent"}}),O.jsx(UP,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((o,a)=>O.jsx(Ar,{fill:r[a]},o.name))})]})})})})}function FY({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=I.useMemo(()=>{if(!t?.graph)return[];const{labels:s=[],bookings:l=[],utilization:c=[]}=t.graph;return s.map((u,d)=>({time:u,bookings:l[d]||0,utilization:c[d]||0}))},[t]),o=s=>["12 AM","6 AM","12 PM","6 PM","11 PM"].includes(s)?s:"",a=i.length?i:Array.from({length:24},(s,l)=>({time:`${l%12||12} ${l>=12?"PM":"AM"}`,bookings:0,utilization:0}));return O.jsxs(Zi,{title:"Facilities",period:"Today",icon:O.jsx(R0,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[O.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-[16px]",children:[O.jsxs("div",{children:[O.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),O.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),O.jsxs("div",{children:[O.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),O.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),O.jsx("div",{className:"w-full h-[170px]",children:O.jsx(bo,{width:"100%",height:"100%",children:O.jsxs(N2,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[O.jsx(od,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),O.jsx(sd,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),O.jsx(Zs,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),O.jsx(Zs,{yAxisId:"right",orientation:"right",domain:[0,100],ticks:[0,20,40,60,80,100],tickFormatter:s=>`${s}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),O.jsx(yo,{content:O.jsx(ss,{})}),O.jsx(xa,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),O.jsx(xa,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4"})]})})})]})}function BY({data:e,communities:t}){const n=e?.incomeSummary||{},r=e?.expenditureSummary||{},i=["AED","USD","EUR"],o=["Rs","INR","₹"];function a(l){if(l==null||isNaN(l))return"0";const c=Number(l),u=Math.abs(c),d=c<0?"-":"";return u>=1e9?d+(u/1e9).toFixed(u%1e9===0?0:2)+"B":u>=1e6?d+(u/1e6).toFixed(u%1e6===0?0:2)+"M":u>=1e3?d+(u/1e3).toFixed(u%1e3===0?0:2)+"K":d+u.toFixed(u%1===0?0:2)}function s(l,c){return c?o.includes(c)?`${c} ${a(l)}`:i.includes(c)?`${a(l)} ${c}`:`${a(l)} ${c}`:a(l)}return O.jsx(Zi,{title:"Income",period:"This Month",icon:O.jsx(L0,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:O.jsx(rA,{widgetId:"finance_summary",options:t,onFilterChange:(l,c)=>console.log(l,c),onExport:l=>console.log("Export triggered for",l)}),children:O.jsxs("div",{children:[O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[O.jsx("div",{children:"Opening"}),O.jsx("div",{children:"Income"}),O.jsx("div",{children:"Collection"}),O.jsx("div",{children:"Closing"})]}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[O.jsx("div",{children:s(n.opening_balance,n?.currency_type)}),O.jsx("div",{children:s(n.income,n?.currency_type)}),O.jsx("div",{children:s(n.collection,n?.currency_type)}),O.jsx("div",{children:s(n.closing_balance,n?.currency_type)})]}),O.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),O.jsx("div",{className:"flex items-center justify-between",children:O.jsxs("div",{className:"flex items-center gap-[12px]",children:[O.jsx(L0,{className:"!text-[24px] text-red-600"}),O.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[O.jsx("div",{children:"Opening"}),O.jsx("div",{children:"Expenditure"}),O.jsx("div",{children:"Payment"}),O.jsx("div",{children:"Outstanding"})]}),O.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[O.jsx("div",{children:s(r.opening_balance,r?.currency_type)}),O.jsx("div",{children:s(r.expenditure,r?.currency_type)}),O.jsx("div",{children:s(r.payment,r?.currency_type)}),O.jsx("div",{children:s(r.outstanding,r?.currency_type)})]})]})})}var zY="tippy-box",iA="tippy-content",VY="tippy-backdrop",oA="tippy-arrow",aA="tippy-svg-arrow",To={passive:!0,capture:!0},sA=function(){return document.body};function WY(e,t){return{}.hasOwnProperty.call(e,t)}function Zv(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Jv(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function lA(e,t){return typeof e=="function"?e.apply(void 0,t):e}function cA(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function UY(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function HY(e){return e.split(/\s+/).filter(Boolean)}function ja(e){return[].concat(e)}function uA(e,t){e.indexOf(t)===-1&&e.push(t)}function KY(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function qY(e){return e.split("-")[0]}function $d(e){return[].slice.call(e)}function dA(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function ml(){return document.createElement("div")}function gl(e){return["Element","Fragment"].some(function(t){return Jv(e,t)})}function YY(e){return Jv(e,"NodeList")}function GY(e){return Jv(e,"MouseEvent")}function XY(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function ZY(e){return gl(e)?[e]:YY(e)?$d(e):Array.isArray(e)?e:$d(document.querySelectorAll(e))}function Qv(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function fA(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function JY(e){var t,n=ja(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function QY(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=qY(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,g=c==="left"?u.right.x:0,m=o.top-r+d>l,v=r-o.bottom-f>l,y=o.left-n+p>l,E=n-o.right-g>l;return m||v||y||E})}function ey(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function pA(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Dr={isTouch:!1},hA=0;function eG(){Dr.isTouch||(Dr.isTouch=!0,window.performance&&document.addEventListener("mousemove",mA))}function mA(){var e=performance.now();e-hA<20&&(Dr.isTouch=!1,document.removeEventListener("mousemove",mA)),hA=e}function tG(){var e=document.activeElement;if(XY(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function nG(){document.addEventListener("touchstart",eG,To),window.addEventListener("blur",tG)}var rG=typeof window<"u"&&typeof document<"u",iG=rG?!!window.msCrypto:!1;function Na(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function gA(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function oG(e){return gA(`
310
310
  %ctippy.js
311
311
 
312
312
  %c`+gA(e)+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anarock-widgets",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",