(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{92128:(e,a,t)=>{Promise.resolve().then(t.t.bind(t,45214,23)),Promise.resolve().then(t.bind(t,92529)),Promise.resolve().then(t.bind(t,52545)),Promise.resolve().then(t.bind(t,71672)),Promise.resolve().then(t.t.bind(t,38173,23)),Promise.resolve().then(t.t.bind(t,231,23)),Promise.resolve().then(t.bind(t,27776)),Promise.resolve().then(t.bind(t,11315)),Promise.resolve().then(t.bind(t,36222))},92529:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>c});var s=t(57437),r=t(61544),l=t(2265),n=t(58064);let o=(0,n.createServerReference)("080bf998582c8d9067ef460e52b70bff5140ac37",n.callServer,void 0,n.findSourceMapURL,"default");var i=t(27776),d=t(50495);function c(){let[e,a]=l.useState(null),[t,n]=l.useState(null),[c,u]=l.useState(!1);return(0,s.jsxs)("div",{className:"lg:mx-[30%] mx-8 my-[10%] p-6  flex flex-col gap-4 border shadow-lg rounded-lg",children:["Upload the Master Data Excel Sheet to initialize system.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Seed Data:",(0,s.jsx)("input",{title:"Excel",type:"file",onChange:e=>{e.target.files&&a(e.target.files[0])}}),(0,s.jsx)("br",{}),"Utility Report Periods:",(0,s.jsx)("input",{title:"Excel",type:"file",onChange:e=>{e.target.files&&n(e.target.files[0])}}),(0,s.jsx)("br",{}),(0,s.jsx)(d.z,{className:c?"animate-bounce":"",onClick:async()=>{u(!0);try{let a=await (0,r.Z)(e,{sheet:"exp_dl_defs"}),s=await (0,r.Z)(e,{sheet:"exp_managed_lists"}),l=await (0,r.Z)(e,{sheet:"exp_managed_lists_types"}),n=await (0,r.Z)(e,{sheet:"exp_roles"}),d=await (0,r.Z)(e,{sheet:"exp_organisations"}),c=await (0,r.Z)(e,{sheet:"exp_service_areas"}),f=await (0,r.Z)(e,{sheet:"exp_locations"}),m=await (0,r.Z)(e,{sheet:"exp_countries"}),p=await (0,r.Z)(t,{sheet:"exp_utility_report_periods"}),b=await (0,r.Z)(e,{sheet:"exp_seed_users"}),h=await (0,r.Z)(e,{sheet:"exp_generators"}),x=await (0,r.Z)(e,{sheet:"exp_mapping_dl_to_kpi"}),g=await (0,r.Z)(e,{sheet:"exp_kpi_defs"}),v=await (0,r.Z)(e,{sheet:"exp_aggdl_defs"}),y=await (0,r.Z)(e,{sheet:"exp_mapping_dl_to_aggdl"}),w=await (0,r.Z)(e,{sheet:"exp_storage"}),j=await (0,r.Z)(e,{sheet:"exp_sub_regions"}),N=await o([a,s,l,n,d,c,f,m,p,b,h,x,g,v,y,w,j]);console.log(N),!0===N.success?window.location.reload():i.A.error(N.message),u(!1)}catch(e){i.A.error("Error: "+e)}},children:"Initialise"})]})}},88738:(e,a,t)=>{"use strict";t.d(a,{BackButton:()=>c,Kk:()=>u,Mm:()=>f});var s=t(57437);t(87138);var r=t(2265),l=t(54887),n=t(50495),o=t(16463),i=t(41942),d=t(28930);function c(){let e=(0,o.useRouter)();return(0,s.jsxs)(n.z,{className:"flex gap-1 items-center",onClick:()=>e.back(),children:[(0,s.jsx)(i.x_l,{})," Back"]})}function u(e){let[a,t]=(0,r.useState)(!1);return(0,s.jsx)(n.z,{disabled:a,className:a?"animate-bounce":"",onClick:async()=>{t(!0),await e.action(),t(!1)},children:e.label})}function f(e){let{pending:a}=(0,l.useFormStatus)();return(0,s.jsx)("button",{type:"submit",disabled:a,className:"".concat(a?"opacity-50":"opacity-100"," py-2 px-3 bg-slate-600 transition-colors mt-4 text-white font-semibold rounded-lg hover:bg-slate-700"),children:a?(0,s.jsx)(d.Z,{size:20,className:"text-white",color:"#FFFFFF"}):e.label})}},52545:(e,a,t)=>{"use strict";t.d(a,{default:()=>w});var s=t(57437),r=t(2265),l=t(39468),n=t(87592),o=t(22468),i=t(28165),d=t(37440);let c=l.fC,u=l.xz;l.ZA,l.Uv,l.Tr,l.Ee,r.forwardRef((e,a)=>{let{className:t,inset:r,children:o,...i}=e;return(0,s.jsxs)(l.fF,{ref:a,className:(0,d.cn)("flex cursor-default select-none items-center px-2 py-1.5 text-sm outline-none focus:bg-slate-100 data-[state=open]:bg-slate-100 dark:focus:bg-slate-800 dark:data-[state=open]:bg-slate-800",r&&"pl-8",t),...i,children:[o,(0,s.jsx)(n.Z,{className:"ml-auto h-4 w-4"})]})}).displayName=l.fF.displayName,r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.tu,{ref:a,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden border border-slate-200 bg-white p-2 text-slate-950 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",t),...r})}).displayName=l.tu.displayName;let f=r.forwardRef((e,a)=>{let{className:t,sideOffset:r=4,...n}=e;return(0,s.jsx)(l.Uv,{children:(0,s.jsx)(l.VY,{ref:a,sideOffset:r,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden border border-slate-200 bg-white p-2 text-slate-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",t),...n})})});f.displayName=l.VY.displayName;let m=r.forwardRef((e,a)=>{let{className:t,inset:r,...n}=e;return(0,s.jsx)(l.ck,{ref:a,className:(0,d.cn)("relative flex rounded-lg cursor-default select-none items-center p-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50",r&&"pl-8",t),...n})});m.displayName=l.ck.displayName,r.forwardRef((e,a)=>{let{className:t,children:r,checked:n,...i}=e;return(0,s.jsxs)(l.oC,{ref:a,className:(0,d.cn)("relative flex cursor-default select-none items-center -sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50",t),checked:n,...i,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(l.wU,{children:(0,s.jsx)(o.Z,{className:"h-4 w-4"})})}),r]})}).displayName=l.oC.displayName,r.forwardRef((e,a)=>{let{className:t,children:r,...n}=e;return(0,s.jsxs)(l.Rk,{ref:a,className:(0,d.cn)("relative flex cursor-default select-none items-center -sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50",t),...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(l.wU,{children:(0,s.jsx)(i.Z,{className:"h-2 w-2 fill-current"})})}),r]})}).displayName=l.Rk.displayName,r.forwardRef((e,a)=>{let{className:t,inset:r,...n}=e;return(0,s.jsx)(l.__,{ref:a,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",t),...n})}).displayName=l.__.displayName;let p=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.Z0,{ref:a,className:(0,d.cn)("-mx-1 my-1 h-px bg-slate-100 dark:bg-slate-800",t),...r})});p.displayName=l.Z0.displayName;var b=t(41942),h=t(50495),x=t(58064);let g=(0,x.createServerReference)("450b902d0759bb9e7e75a1431cf71124bd65bdd6",x.callServer,void 0,x.findSourceMapURL,"Logout");var v=t(87138),y=t(67545);function w(e){let a=[{label:"Dashboard",href:"/".concat(e.user.role.toLocaleLowerCase(),"/dashboard")},{label:"Data Entry",href:"/".concat(e.user.role.toLocaleLowerCase(),"/dataEntry")},{label:"Settings",href:"/".concat(e.user.role.toLocaleLowerCase(),"/settings")}];return(0,s.jsxs)("div",{className:"flex items-center gap-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"text-sm",children:e.user.organisation}),(0,s.jsx)("span",{className:"bg-amber-400 text-slate-800 rounded text-sm font-medium px-1",children:e.user.role})]}),(0,s.jsxs)(c,{children:[(0,s.jsx)(u,{children:(0,s.jsx)(b.m3W,{size:25})}),(0,s.jsxs)(f,{className:"p-4 rounded-lg flex flex-col gap-3 w-[300px]",children:[(0,s.jsx)(y.X,{size:5,text:e.user.name}),(0,s.jsx)(m,{onClick:()=>{window.location.href="/profile"},children:"Profile"}),(0,s.jsx)(p,{}),a.map(e=>(0,s.jsx)(v.default,{href:e.href,children:(0,s.jsx)(m,{children:e.label})},e.label)),(0,s.jsx)(p,{}),(0,s.jsx)(h.z,{onClick:async()=>{await g(),localStorage.clear()},children:"Logout"})]})]})]})}},71672:(e,a,t)=>{"use strict";t.d(a,{default:()=>v});var s=t(57437),r=t(2265),l=t(58064);let n=(0,l.createServerReference)("efa4bf524b52b9260e2c35f05e6333ff52f5381f",l.callServer,void 0,l.findSourceMapURL,"Login");var o=t(27776),i=t(37336),d=t(88738),c=t(67545),u=t(26792),f=t(90837);let m=(0,l.createServerReference)("b883ddebd7260e1e1446582a2475444138fcc269",l.callServer,void 0,l.findSourceMapURL,"SendForgotPasswordEmail");var p=t(50495);function b(){return(0,s.jsxs)(f.Vq,{children:[(0,s.jsx)(f.hg,{className:"font-medium underline text-sm",children:"Forgot Password"}),(0,s.jsxs)(f.cZ,{children:[(0,s.jsxs)(f.fK,{children:[(0,s.jsx)(f.$N,{children:"Reset Password Code"}),(0,s.jsx)(f.Be,{children:"This action will send a confirmation code to your email that you will enter into the app to reset your password. Enter your account email address below."})]}),(0,s.jsxs)("form",{action:async e=>{let a=await m(e.get("email"));!0===a.success?o.A.success(a.message):o.A.error(a.message)},className:"flex flex-col gap-4",children:[(0,s.jsx)("input",{className:"mb-4 p-2 rounded-lg border shadow bg-slate-100",placeholder:"Email",name:"email",type:"email",required:!0}),(0,s.jsx)(p.z,{type:"submit",children:"Send Code"})]})]})]})}let h=(0,l.createServerReference)("6341725c902bbfd06898b4c79c33caa2dfba7bff",l.callServer,void 0,l.findSourceMapURL,"Register");var x=t(85273);function g(e){let a=(0,r.useRef)(null),t=(0,r.useRef)(null),[l,c]=r.useState(!1);return(0,s.jsxs)(f.Vq,{children:[(0,s.jsx)(f.hg,{className:"underline transition-colors font-medium hover:text-slate-400 text-blue-600",children:"Register"}),(0,s.jsxs)(f.cZ,{children:[(0,s.jsxs)(f.fK,{children:[(0,s.jsx)(f.$N,{children:"Register"}),(0,s.jsx)(f.Be,{children:"Register to get access to the dashboard."})]}),(0,s.jsxs)(x.Tabs,{defaultValue:"account",className:"w-[400px]",children:[(0,s.jsxs)(x.TabsList,{children:[(0,s.jsx)(x.TabsTrigger,{value:"PPA Members",children:"PPA Utility"}),(0,s.jsx)(x.TabsTrigger,{value:"Non-PPA Members",children:"Non-PPA Utility"})]}),(0,s.jsx)(x.TabsContent,{value:"PPA Members",children:(0,s.jsxs)("form",{className:"flex flex-col gap-2",ref:t,action:e=>{h({name:e.get("name"),email:e.get("email"),organisation_id:Number(e.get("utility_id")),role_id:Number(e.get("role_id"))}).then(e=>{if(e.success){var a;o.A.success("Registration successful. Please check your email for confirmation."),null===(a=t.current)||void 0===a||a.reset(),c(!0),setTimeout(()=>{window.location.reload()},3e3)}else o.A.error(e.message)})},children:[(0,s.jsx)(i.II,{name:"name",type:"text"}),(0,s.jsx)(i.II,{name:"email",type:"email"}),(0,s.jsx)(i.lq,{list:e.utilities,name:"utility_id",optionVal:"id",optionLabel:"name",defaultValue:1}),(0,s.jsx)(i.lq,{list:e.roles.filter(e=>e.id>3),name:"role_id",optionVal:"id",optionLabel:"name",defaultValue:1}),(0,s.jsx)(d.Mm,{label:"Submit"}),l&&(0,s.jsx)("div",{className:"my-4 p-4 rounded-lg text-white bg-lime-600",children:"Registration successful. Please check your email for confirmation."})]})}),(0,s.jsx)(x.TabsContent,{value:"Non-PPA Members",children:(0,s.jsxs)("form",{className:"flex flex-col gap-2",ref:a,action:async e=>{let t=await n(e);if(t.success){var s,r;o.A.success("Login successful. Preparing dashboard..."),null===(s=a.current)||void 0===s||s.reset();let e="/dev";switch(null===(r=t.data)||void 0===r?void 0:r.user.roleId){case 1:e="/dev/dashboard";break;case 2:e="/blo/dashboard";break;case 3:e="/ceo";break;case 4:e="/dao";break;case 5:e="/cr";break;case 6:e="/afm";break;case 7:e="/alm";break;case 8:e="/don";break;case 9:e="/dev"}window.location.href=e}else o.A.error(t.message)},children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 h-[300px] overflow-y-scroll",children:[(0,s.jsx)(i.II,{type:"text",name:"name"}),(0,s.jsx)(i.II,{type:"email",name:"email"}),(0,s.jsx)(i.II,{name:"organisation",type:"text"}),(0,s.jsx)(i.Fz,{name:"dataset_required",type:"text"}),(0,s.jsx)(i.Fz,{name:"data_access_reason",type:"text"})]}),(0,s.jsx)(d.Mm,{label:"Submit"})]})})]})]})]})}function v(e){let a=(0,r.useRef)(null);return(0,s.jsxs)("form",{className:"flex flex-col gap-2 lg:w-4/12 rounded-2xl shadow-xl p-8 border",ref:a,action:e=>{try{n(e).then(e=>{if(e.success){var t,s;localStorage.setItem(u.OI,"0"),o.A.success("Login successful. Preparing dashboard..."),null===(t=a.current)||void 0===t||t.reset();let r="/dev/dashboard";switch(null===(s=e.data)||void 0===s?void 0:s.user.roleId){case 1:r="/dev/dashboard";break;case 2:r="/con/dashboard";break;case 3:r="/devPbi/dashboard";break;case 4:r="/bmo/dashboard";break;case 5:r="/blo/dataEntry";break;case 6:r="/ceo/dashboard";break;case 7:r="/daof/dataEntry";break;case 8:r="/daoh/dataEntry";break;case 9:r="/daoo/dataEntry";break;case 10:r="/afm/dashboard";break;case 11:r="/alm/dashboard";break;case 12:r="/don/dashboard";break;case 13:r="/dashUtil/dashboard";break;case 14:r="/dashCou/dashboard";break;case 15:r="/dashReg/dashboard";break;case 16:r="/dashPac/dashboard"}window.location.href=r}else o.A.error(e.message)}).catch(e=>{o.A.error("Error: "+e)})}catch(e){o.A.error("Error: "+e)}},children:[(0,s.jsx)(c.X,{size:3,text:"Login to get started"}),(0,s.jsx)(i.II,{type:"email",name:"email"}),(0,s.jsx)(i.II,{type:"password",name:"password"}),(0,s.jsx)(b,{}),(0,s.jsx)(d.Mm,{label:"Login"}),(0,s.jsxs)("span",{className:"mt-4",children:["Don't have an account?"," ",(0,s.jsx)(g,{utilities:e.utilities,roles:e.roles})]})]})}},67545:(e,a,t)=>{"use strict";t.d(a,{X:()=>r});var s=t(57437);function r(e){return(0,s.jsx)("h1",{className:"".concat((e=>{switch(e){case 1:return"text-4xl";case 2:return"text-3xl";case 3:default:return"text-2xl";case 4:return"text-xl";case 5:return"text-lg";case 6:return"text-base"}})(e.size)," font-bold text-slate-600 mb-").concat(e.marginBottom?e.marginBottom:0),children:e.text})}},37336:(e,a,t)=>{"use strict";t.d(a,{Fz:()=>c,I1:()=>f,II:()=>d,c4:()=>m,lq:()=>u});var s=t(57437),r=t(90225),l=t(43819),n=t(53409),o=t(2265),i=t(41942);function d(e){return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("label",{className:"text-sm font-medium",htmlFor:e.name,children:(0,n.KY)(e.name)}),(0,s.jsx)("input",{defaultValue:e.defaultValue,id:e.name,name:e.name,required:!0,type:e.type,className:"border rounded-lg shadow p-2 w-full",placeholder:(0,n.KY)(e.name),title:(0,n.KY)(e.name)})]})}function c(e){return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("label",{className:"text-sm font-medium",htmlFor:e.name,children:(0,n.KY)(e.name)}),(0,s.jsx)("textarea",{defaultValue:e.defaultValue,id:e.name,name:e.name,required:!0,className:"border shadow rounded-lg p-2 w-full",placeholder:(0,n.KY)(e.name),title:(0,n.KY)(e.name)})]})}function u(e){return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("label",{htmlFor:e.name,className:"text-sm font-medium",children:(0,n.KY)(e.name)}),(0,s.jsx)("select",{defaultValue:e.defaultValue||"",name:e.name,id:e.name,className:"border shadow rounded-lg p-2 w-full",children:e.list.sort((a,t)=>a[e.optionLabel]-t[e.optionLabel]).map((a,t)=>(0,s.jsx)("option",{value:Number(a[e.optionVal]),children:e.encrypted?(0,r.p)(a[e.optionLabel]):a[e.optionLabel]},t))})]})}function f(e){return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("label",{htmlFor:e.name,className:"text-sm font-medium",children:(0,n.KY)(e.name)+"?"}),(0,s.jsxs)("select",{name:e.name,id:e.name,className:"border shadow rounded-lg p-2 w-full",defaultValue:JSON.stringify(e.defaultValue),children:[(0,s.jsx)("option",{value:"true",children:"Yes"}),(0,s.jsx)("option",{value:"false",children:"No"})]})]})}function m(e){var a,t;let[r,n]=(0,o.useState)(null!==(a=e.defaultValue)&&void 0!==a?a:"#000000");return(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("label",{htmlFor:e.name,className:"text-sm font-medium",children:"Color"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[" ",(0,s.jsx)("select",{onChange:e=>n(e.target.value),name:e.name,id:e.name,defaultValue:null!==(t=e.defaultValue)&&void 0!==t?t:e.defaultValue,"aria-label":"color-selector",className:"border shadow rounded-lg p-2 w-full",children:l.bG.map(e=>(0,s.jsx)("option",{className:"bg-[".concat(e.hex,"]"),value:e.hex,children:e.name},e.hex))}),(0,s.jsx)(i.u9M,{size:40,color:r})]})]})}},50495:(e,a,t)=>{"use strict";t.d(a,{d:()=>i,z:()=>d});var s=t(57437),r=t(2265),l=t(71538),n=t(13027),o=t(37440);let i=(0,n.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300",{variants:{variant:{default:"bg-slate-700 text-slate-50 hover:bg-slate-500 dark:bg-slate-50 dark:text-slate-900 dark:hover:bg-slate-50/90",destructive:"bg-red-500 text-slate-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-slate-50 dark:hover:bg-red-900/90",outline:"border border-slate-200 bg-white hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:bg-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50",secondary:"bg-slate-100 text-slate-900 hover:bg-slate-100/80 dark:bg-slate-800 dark:text-slate-50 dark:hover:bg-slate-800/80",ghost:"hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-800 dark:hover:text-slate-50",link:"text-slate-900 underline-offset-4 hover:underline dark:text-slate-50"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=r.forwardRef((e,a)=>{let{className:t,variant:r,size:n,asChild:d=!1,...c}=e,u=d?l.g7:"button";return(0,s.jsx)(u,{className:(0,o.cn)(i({variant:r,size:n,className:t})),ref:a,...c})});d.displayName="Button"},90837:(e,a,t)=>{"use strict";t.d(a,{$N:()=>h,Be:()=>x,GG:()=>u,Vq:()=>i,cN:()=>b,cZ:()=>m,fK:()=>p,hg:()=>d});var s=t(57437),r=t(2265),l=t(13304),n=t(4867),o=t(37440);let i=l.fC,d=l.xz,c=l.h_,u=l.x8,f=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.aV,{ref:a,className:(0,o.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r})});f.displayName=l.aV.displayName;let m=r.forwardRef((e,a)=>{let{className:t,children:r,...i}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(f,{}),(0,s.jsxs)(l.VY,{ref:a,className:(0,o.cn)("fixed rounded-xl p-8 left-[50%] top-[38%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-slate-200 bg-white shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm: dark:border-slate-800 dark:bg-slate-950",t),...i,children:[r,(0,s.jsxs)(l.x8,{className:"absolute right-4 top-4  opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-100 data-[state=open]:text-slate-500 dark:ring-offset-slate-950 dark:focus:ring-slate-300 dark:data-[state=open]:bg-slate-800 dark:data-[state=open]:text-slate-400",children:[(0,s.jsx)(n.Pxu,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});m.displayName=l.VY.displayName;let p=e=>{let{className:a,...t}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-1.5 text-center sm:text-left",a),...t})};p.displayName="DialogHeader";let b=e=>{let{className:a,...t}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...t})};b.displayName="DialogFooter";let h=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.Dx,{ref:a,className:(0,o.cn)("text-xl font-bold text-slate-600 leading-none tracking-tight",t),...r})});h.displayName=l.Dx.displayName;let x=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.dk,{ref:a,className:(0,o.cn)("text-sm text-slate-500 dark:text-slate-400",t),...r})});x.displayName=l.dk.displayName},85273:(e,a,t)=>{"use strict";t.d(a,{Tabs:()=>o,TabsContent:()=>c,TabsList:()=>i,TabsTrigger:()=>d});var s=t(57437),r=t(2265),l=t(62447),n=t(37440);let o=l.fC,i=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.aV,{ref:a,className:(0,n.cn)("inline-flex items-center border-b border-slate-500 w-full",t),...r})});i.displayName=l.aV.displayName;let d=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.xz,{ref:a,className:(0,n.cn)("inline-flex rounded-t-lg items-center -t-lg justify-center whitespace-nowrap px-3 py-1.5 text-sm font-medium ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-slate-500 data-[state=active]:text-slate-100 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300 dark:data-[state=active]:bg-slate-950 dark:data-[state=active]:text-slate-50",t),...r})});d.displayName=l.xz.displayName;let c=r.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,s.jsx)(l.VY,{ref:a,className:(0,n.cn)("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300",t),...r})});c.displayName=l.VY.displayName},37440:(e,a,t)=>{"use strict";t.d(a,{cn:()=>l});var s=t(44839),r=t(96164);function l(){for(var e=arguments.length,a=Array(e),t=0;t<e;t++)a[t]=arguments[t];return(0,r.m6)((0,s.W)(a))}},16463:(e,a,t)=>{"use strict";var s=t(71169);t.o(s,"usePathname")&&t.d(a,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(a,{useRouter:function(){return s.useRouter}})},28930:(e,a,t)=>{"use strict";t.d(a,{Z:()=>d});var s=t(2265),r={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function l(e){var a=function(e){if("number"==typeof e)return{value:e,unit:"px"};var a,t=(e.match(/^[0-9.]*/)||"").toString();a=t.includes(".")?parseFloat(t):parseInt(t,10);var s=(e.match(/[^0-9]*$/)||"").toString();return r[s]?{value:a,unit:s}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(a,"px.")),{value:a,unit:"px"})}(e);return"".concat(a.value).concat(a.unit)}var n=function(){return(n=Object.assign||function(e){for(var a,t=1,s=arguments.length;t<s;t++)for(var r in a=arguments[t])Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);return e}).apply(this,arguments)},o=function(e,a){var t={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>a.indexOf(s)&&(t[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++)0>a.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(t[s[r]]=e[s[r]]);return t},i=function(e,a,t){var s="react-spinners-".concat(e,"-").concat(t);if("undefined"==typeof window||!window.document)return s;var r=document.createElement("style");document.head.appendChild(r);var l=r.sheet,n="\n    @keyframes ".concat(s," {\n      ").concat(a,"\n    }\n  ");return l&&l.insertRule(n,0),s}("ClipLoader","0% {transform: rotate(0deg) scale(1)} 50% {transform: rotate(180deg) scale(0.8)} 100% {transform: rotate(360deg) scale(1)}","clip");let d=function(e){var a=e.loading,t=e.color,r=void 0===t?"#000000":t,d=e.speedMultiplier,c=e.cssOverride,u=e.size,f=void 0===u?35:u,m=o(e,["loading","color","speedMultiplier","cssOverride","size"]),p=n({background:"transparent !important",width:l(f),height:l(f),borderRadius:"100%",border:"2px solid",borderTopColor:r,borderBottomColor:"transparent",borderLeftColor:r,borderRightColor:r,display:"inline-block",animation:"".concat(i," ").concat(.75/(void 0===d?1:d),"s 0s infinite linear"),animationFillMode:"both"},void 0===c?{}:c);return void 0===a||a?s.createElement("span",n({style:p},m)):null}},90225:(e,a,t)=>{"use strict";function s(e){let a="";if(!e)return"";for(let t=0;t<e.length;t++)a+=String.fromCharCode(e.charCodeAt(t)-9);return a}t.d(a,{p:()=>s})},43819:(e,a,t)=>{"use strict";t.d(a,{bG:()=>r});let s={red:"#FF0000",orange:"#FFA500",yellow:"#FFFF00",slate:"#008000",violet:"#EE82EE",purple:"#800080",pink:"#FFC0CB",black:"#000000",white:"#FFFFFF",gray:"#808080",brown:"#A52A2A",beige:"#F5F5DC",mint:"#BDFCC9",olive:"#808000",coral:"#FF7F50",navy:"#000080",slat:"#00FFFF"},r=Object.keys(s).map(e=>({name:e,hex:s[e]}))},26792:(e,a,t)=>{"use strict";t.d(a,{FH:()=>s,OI:()=>o,Qo:()=>n,Uf:()=>l,__:()=>r,d6:()=>i,wt:()=>d});let s={local:"http://localhost:7771/api/v1",cloud:"http://195.35.9.38/api/v1"},r=[{path:"managed-lists"},{path:"managed-lists-types"},{path:"kpi-inputs-definitions"},{path:"roles"},{path:"countries"},{path:"organisations"},{path:"serviceAreas"},{path:"serviceAreaBoundaries"},{path:"users"},{path:"kpiDefinitions"},{path:"kpiDefinitionHistory"},{path:"dataLabelDefinitions"},{path:"dataLabelsIntermediate"},{path:"dataLabelsRelevance"},{path:"dataLabelsRelevanceHistory"},{path:"dataLabelsRelevanceHistory"}],l=(e,a,t,s)=>{let r="approved";return!1===e&&!1===a&&!1===t?r="reviewRequired":!0===e&&!1===t&&!1===a?r="reviewed":null==s||""===s?r="missing":!1===a&&!0===e&&!0===t?r="approved":!0===a&&!0===e&&!0===t&&(r="endorsed"),r},n={jwtCookie:"jwtCookie",currentUser:"currentUser",organisation:"globalUtilityCookie",reportTypeCookie:"reportTypeCookie",dataEntryMedium:"dataEntryMethod",utilityReportPeriod:"utilityReportPeriod",serviceArea:"serviceArea",generator:"generator",dataWorkflowStatus:"dataWorkflowStatus",powerBiAccessToken:"powerBiAccessToken"},o="dataSubCategoryId",i="serviceAreaPageNo",d={clientId:"286a09c7-3057-44d0-94bb-e0434909b2c7",tenantId:"0e3c5fd5-da9c-47e4-99fb-5dd7aaa4168b",clientSecret:"HQ48Q~MmOc-KvX7TEYTbVqtXdf4g~Emyu-2ajbav",reportId:"9d304078-5e4f-45a2-adfc-888da5521e04",datasetId:"70c1f364-c105-45ee-88fa-7ec0e17e1885",workspaceId:"4e50cdee-8860-42f7-bf33-ed64a2382af6",scope:"https://analysis.windows.net/powerbi/api/.default",grantType:"client_credentials",embedUrl:"https://app.powerbi.com/reportEmbed?reportId=9d304078-5e4f-45a2-adfc-888da5521e04&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly9XQUJJLUFVU1RSQUxJQS1FQVNULUItUFJJTUFSWS1yZWRpcmVjdC5hbmFseXNpcy53aW5kb3dzLm5ldCIsImVtYmVkRmVhdHVyZXMiOnsidXNhZ2VNZXRyaWNzVk5leHQiOnRydWV9fQ%3d%3d"}},53409:(e,a,t)=>{"use strict";async function s(e){let a={};return e.forEach((e,t)=>{let s=e;isNaN(Number(s))?"false"===s||"FALSE"===s?s=!1:("true"===s||"TRUE"===s)&&(s=!0):s=Number(s),a[t]=s}),a}function r(e){let a=[];try{let t=e[0],s=e.slice(1).map(e=>{let a={};return e.forEach((e,s)=>{let r=t[s];"string"==typeof r?a[r]=e:"number"==typeof r?a[r]=parseFloat(e):void 0===r&&(a[r]=e)}),a});a.push(...s)}catch(e){console.log(e)}return a}function l(e){return e.replace(/_id$/g,"").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function n(e){let a=null;if(e){let t=new Date(e),s=t.getDate().toString().padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()],l=t.getFullYear().toString().split("")[2]+t.getFullYear().toString().split("")[3];a="".concat(s," ").concat(r," ").concat(l)}return a}function o(e){let a=new Date(e),t=String(a.getDate()).padStart(2,"0"),s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],r=a.getFullYear(),l=10>a.getHours()?"0"+a.getHours().toString():a.getHours(),n=String(a.getMinutes()).padStart(2,"0");return"".concat(t," ").concat(s," ").concat(r," | ").concat(l,":").concat(n)}function i(e){return!e||isNaN(Number(e))?e:Number(e).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",")}t.d(a,{CQ:()=>o,FU:()=>s,KY:()=>l,ME:()=>r,PD:()=>i,p6:()=>n})},45214:()=>{},11315:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>s});let s={src:"/_next/static/media/logo3.0d691bdc.svg",height:242,width:1021,blurWidth:0,blurHeight:0}},36222:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>s});let s={src:"/_next/static/media/ppaLogo.fa5cd69a.png",height:250,width:350,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAMAAADJ2y/JAAAAUVBMVEX19PfT1df7iovx1dnFyMvc3N3t7O8uS0vs6+3R1t3FxceWlpaeamrx///0lpjr8Ovx5eivx8iwr7D/OTnkS0vvFhf+///++fr/09Xw3uD/c3QOhmRuAAAAFnRSTlP6qf75XtbHAtNPt0lP+f0z/c7T/bShYX4kPQAAAAlwSFlzAAALEwAACxMBAJqcGAAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAA5SURBVHicFcbbFkAgFEXRVapTbhF2+P8PNcyniVXX9vMyCpJ/KaS++ANlkoZ1+xOeu0sEbHYxjpN9PgUCM+9WxbwAAAAASUVORK5CYII=",blurWidth:8,blurHeight:6}},62447:(e,a,t)=>{"use strict";t.d(a,{VY:()=>_,aV:()=>C,fC:()=>S,xz:()=>V});var s=t(2265),r=t(78149),l=t(98324),n=t(53398),o=t(31383),i=t(25171),d=t(87513),c=t(91715),u=t(53201),f=t(57437),m="Tabs",[p,b]=(0,l.b)(m,[n.Pc]),h=(0,n.Pc)(),[x,g]=p(m),v=s.forwardRef((e,a)=>{let{__scopeTabs:t,value:s,onValueChange:r,defaultValue:l,orientation:n="horizontal",dir:o,activationMode:m="automatic",...p}=e,b=(0,d.gm)(o),[h,g]=(0,c.T)({prop:s,onChange:r,defaultProp:l});return(0,f.jsx)(x,{scope:t,baseId:(0,u.M)(),value:h,onValueChange:g,orientation:n,dir:b,activationMode:m,children:(0,f.jsx)(i.WV.div,{dir:b,"data-orientation":n,...p,ref:a})})});v.displayName=m;var y="TabsList",w=s.forwardRef((e,a)=>{let{__scopeTabs:t,loop:s=!0,...r}=e,l=g(y,t),o=h(t);return(0,f.jsx)(n.fC,{asChild:!0,...o,orientation:l.orientation,dir:l.dir,loop:s,children:(0,f.jsx)(i.WV.div,{role:"tablist","aria-orientation":l.orientation,...r,ref:a})})});w.displayName=y;var j="TabsTrigger",N=s.forwardRef((e,a)=>{let{__scopeTabs:t,value:s,disabled:l=!1,...o}=e,d=g(j,t),c=h(t),u=F(d.baseId,s),m=R(d.baseId,s),p=s===d.value;return(0,f.jsx)(n.ck,{asChild:!0,...c,focusable:!l,active:p,children:(0,f.jsx)(i.WV.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":m,"data-state":p?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:u,...o,ref:a,onMouseDown:(0,r.M)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(s)}),onKeyDown:(0,r.M)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(s)}),onFocus:(0,r.M)(e.onFocus,()=>{let e="manual"!==d.activationMode;p||l||!e||d.onValueChange(s)})})})});N.displayName=j;var k="TabsContent",A=s.forwardRef((e,a)=>{let{__scopeTabs:t,value:r,forceMount:l,children:n,...d}=e,c=g(k,t),u=F(c.baseId,r),m=R(c.baseId,r),p=r===c.value,b=s.useRef(p);return s.useEffect(()=>{let e=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(o.z,{present:l||p,children:t=>{let{present:s}=t;return(0,f.jsx)(i.WV.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!s,id:m,tabIndex:0,...d,ref:a,style:{...e.style,animationDuration:b.current?"0s":void 0},children:s&&n})}})});function F(e,a){return"".concat(e,"-trigger-").concat(a)}function R(e,a){return"".concat(e,"-content-").concat(a)}A.displayName=k;var S=v,C=w,V=N,_=A}},e=>{var a=a=>e(e.s=a);e.O(0,[4788,7699,8310,4868,5252,2666,231,6196,1544,16,7130,6215,1744],()=>a(92128)),_N_E=e.O()}]);