(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4580,7370,1686,9240],{44267:function(e,t,a){"use strict";a.d(t,{Z:function(){return b}});var r=a(87462),o=a(63366),l=a(67294),n=a(86010),s=a(58510),i=a(90948),d=a(71657),u=a(1977),c=a(8027);function getCardContentUtilityClass(e){return(0,c.ZP)("MuiCardContent",e)}(0,u.Z)("MuiCardContent",["root"]);var p=a(85893);let f=["className","component"],useUtilityClasses=e=>{let{classes:t}=e;return(0,s.Z)({root:["root"]},getCardContentUtilityClass,t)},h=(0,i.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),m=l.forwardRef(function(e,t){let a=(0,d.Z)({props:e,name:"MuiCardContent"}),{className:l,component:s="div"}=a,i=(0,o.Z)(a,f),u=(0,r.Z)({},a,{component:s}),c=useUtilityClasses(u);return(0,p.jsx)(h,(0,r.Z)({as:s,className:(0,n.Z)(c.root,l),ownerState:u,ref:t},i))});var b=m},78445:function(e,t,a){"use strict";a.d(t,{Z:function(){return C}});var r=a(63366),o=a(87462),l=a(67294),n=a(86010),s=a(58510),i=a(15861),d=a(71657),u=a(90948),c=a(1977),p=a(8027);function getCardHeaderUtilityClass(e){return(0,p.ZP)("MuiCardHeader",e)}let f=(0,c.Z)("MuiCardHeader",["root","avatar","action","content","title","subheader"]);var h=a(85893);let m=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],useUtilityClasses=e=>{let{classes:t}=e;return(0,s.Z)({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},getCardHeaderUtilityClass,t)},b=(0,u.ZP)("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(e,t)=>(0,o.Z)({[`& .${f.title}`]:t.title,[`& .${f.subheader}`]:t.subheader},t.root)})({display:"flex",alignItems:"center",padding:16}),y=(0,u.ZP)("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(e,t)=>t.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),_=(0,u.ZP)("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(e,t)=>t.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),g=(0,u.ZP)("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(e,t)=>t.content})({flex:"1 1 auto"}),v=l.forwardRef(function(e,t){let a=(0,d.Z)({props:e,name:"MuiCardHeader"}),{action:l,avatar:s,className:u,component:c="div",disableTypography:p=!1,subheader:f,subheaderTypographyProps:v,title:C,titleTypographyProps:x}=a,Z=(0,r.Z)(a,m),w=(0,o.Z)({},a,{component:c,disableTypography:p}),S=useUtilityClasses(w),P=C;null==P||P.type===i.Z||p||(P=(0,h.jsx)(i.Z,(0,o.Z)({variant:s?"body2":"h5",className:S.title,component:"span",display:"block"},x,{children:P})));let M=f;return null==M||M.type===i.Z||p||(M=(0,h.jsx)(i.Z,(0,o.Z)({variant:s?"body2":"body1",className:S.subheader,color:"text.secondary",component:"span",display:"block"},v,{children:M}))),(0,h.jsxs)(b,(0,o.Z)({className:(0,n.Z)(S.root,u),as:c,ref:t,ownerState:w},Z,{children:[s&&(0,h.jsx)(y,{className:S.avatar,ownerState:w,children:s}),(0,h.jsxs)(g,{className:S.content,ownerState:w,children:[P,M]}),l&&(0,h.jsx)(_,{className:S.action,ownerState:w,children:l})]}))});var C=v},96249:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reports/ReportGraph",function(){return a(51366)}])},1342:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var a in t)Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}(t,{noSSR:function(){return noSSR},default:function(){return dynamic}});let r=a(38754),o=(a(67294),r._(a(24304)));function convertModule(e){return{default:(null==e?void 0:e.default)||e}}function noSSR(e,t){return delete t.webpack,delete t.modules,e(t)}function dynamic(e,t){let a=o.default,r={loading:e=>{let{error:t,isLoading:a,pastDelay:r}=e;return null}};e instanceof Promise?r.loader=()=>e:"function"==typeof e?r.loader=e:"object"==typeof e&&(r={...r,...e}),r={...r,...t};let l=r.loader;return(r.loadableGenerated&&(r={...r,...r.loadableGenerated},delete r.loadableGenerated),"boolean"!=typeof r.ssr||r.ssr)?a({...r,loader:()=>null!=l?l().then(convertModule):Promise.resolve(convertModule(()=>null))}):(delete r.webpack,delete r.modules,noSSR(a,r))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30043:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return l}});let r=a(38754),o=r._(a(67294)),l=o.default.createContext(null)},24304:function(e,t,a){"use strict";/**
@copyright (c) 2017-present James Kyle <me@thejameskyle.com>
 MIT License
 Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
 The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
*/Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return d}});let r=a(38754),o=r._(a(67294)),l=a(30043),n=[],s=[],i=!1;function load(e){let t=e(),a={loading:!0,loaded:null,error:null};return a.promise=t.then(e=>(a.loading=!1,a.loaded=e,e)).catch(e=>{throw a.loading=!1,a.error=e,e}),a}let LoadableSubscription=class LoadableSubscription{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}};function Loadable(e){return function(e,t){let a=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),r=null;function init(){if(!r){let t=new LoadableSubscription(e,a);r={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return r.promise()}if(!i){let e=a.webpack?a.webpack():a.modules;e&&s.push(t=>{for(let a of e)if(t.includes(a))return init()})}function LoadableComponent(e,t){!function(){init();let e=o.default.useContext(l.LoadableContext);e&&Array.isArray(a.modules)&&a.modules.forEach(t=>{e(t)})}();let n=o.default.useSyncExternalStore(r.subscribe,r.getCurrentValue,r.getCurrentValue);return o.default.useImperativeHandle(t,()=>({retry:r.retry}),[]),o.default.useMemo(()=>{var t;return n.loading||n.error?o.default.createElement(a.loading,{isLoading:n.loading,pastDelay:n.pastDelay,timedOut:n.timedOut,error:n.error,retry:r.retry}):n.loaded?o.default.createElement((t=n.loaded)&&t.default?t.default:t,e):null},[e,n])}return LoadableComponent.preload=()=>init(),LoadableComponent.displayName="LoadableComponent",o.default.forwardRef(LoadableComponent)}(load,e)}function flushInitializers(e,t){let a=[];for(;e.length;){let r=e.pop();a.push(r(t))}return Promise.all(a).then(()=>{if(e.length)return flushInitializers(e,t)})}Loadable.preloadAll=()=>new Promise((e,t)=>{flushInitializers(n).then(e,t)}),Loadable.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let res=()=>(i=!0,t());flushInitializers(s,e).then(res,res)})),window.__NEXT_PRELOADREADY=Loadable.preloadReady;let d=Loadable},94744:function(e,t,a){"use strict";var r=a(5152),o=a.n(r);let l=o()(()=>Promise.all([a.e(4814),a.e(7229)]).then(a.bind(a,47229)),{loadableGenerated:{webpack:()=>[47229]},ssr:!1});t.Z=l},51366:function(e,t,a){"use strict";a.r(t);var r=a(85893),o=a(66242),l=a(2734),n=a(78445),s=a(44267),i=a(42412),d=a(81223),u=a(94744),c=a(67294),p=a(87066),f=a(81406);let h=[{name:"Sales",data:[32,27,27,30,25,25]},{name:"Visits",data:[25,35,20,20,20,20]}];t.default=()=>{let[e,t]=(0,c.useState)(null),[a,m]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let fetchData=async()=>{m(!0);let e=localStorage.getItem("userData"),a=JSON.parse(e);if(null!==a){var r;null===(r=a[0])||void 0===r||r.organizationKeyId}let o=window.localStorage.getItem(i.Z.storageTokenKeyName);try{let e=await p.Z.get("".concat(f.Ao,"/api/reports/top-stores"),{headers:{Authorization:"Bearer ".concat(o)}});console.log(e,"response"),t(e.data),m(!1)}catch(e){console.error("Error fetching data:",e),m(!1)}};fetchData()},[]);let b=(0,l.Z)(),y={chart:{parentHeightOffset:0,toolbar:{show:!1}},colors:[b.palette.primary.main,b.palette.info.main],plotOptions:{radar:{size:110,polygons:{strokeColors:b.palette.divider,connectorColors:b.palette.divider}}},stroke:{width:0},fill:{opacity:[1,.85]},labels:["Jan","Feb","Mar","Apr","May","Jun"],markers:{size:0},legend:{fontSize:"13px",fontFamily:b.typography.fontFamily,labels:{colors:b.palette.text.secondary},itemMargin:{vertical:4,horizontal:10},markers:{width:12,height:12,radius:10,offsetY:1,offsetX:"ltr"===b.direction?-4:5}},grid:{show:!1,padding:{top:10}},xaxis:{labels:{show:!0,style:{fontSize:b.typography.body2.fontSize,colors:[b.palette.text.disabled,b.palette.text.disabled,b.palette.text.disabled,b.palette.text.disabled,b.palette.text.disabled,b.palette.text.disabled]}}},yaxis:{show:!1},responsive:[{breakpoint:b.breakpoints.values.lg,options:{chart:{height:337}}}]};return(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(n.Z,{title:"Sales",subheader:"Last 6 Months",action:(0,r.jsx)(d.Z,{options:["Last Month","Last 6 months","Last Year"],iconButtonProps:{size:"small",sx:{color:"text.disabled"}}})}),(0,r.jsx)(s.Z,{children:(0,r.jsx)(u.Z,{type:"radar",height:357,series:h,options:y})})]})}},5152:function(e,t,a){e.exports=a(1342)}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=96249)}),_N_E=e.O()}]);