1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5462],{84633:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/partners/[partnerId]",function(){return t(65366)}])},65366:function(e,r,t){"use strict";t.r(r);var o=t(85893),a=t(5152),i=t.n(a),n=t(32758);let l=i()(()=>Promise.all([t.e(6886),t.e(1903),t.e(6325),t.e(7918),t.e(3203),t.e(533),t.e(8679),t.e(7050)]).then(t.bind(t,7050)),{loadableGenerated:{webpack:()=>[7050]},ssr:!1});r.default=()=>(0,o.jsx)(n.l,{children:(0,o.jsx)(l,{})})},80186:function(e,r,t){"use strict";t.d(r,{Z:function(){return components_AffiliateSidebarBase}});var o=t(85893),a=t(80822),i=t(15861),n=t(54799),l=t(67720),s=t(82589),d=t(77232),c=t(78051),f=t(41664),u=t.n(f),x=t(11163),h=t(98619),g=t(48885),b=t(59334);let AffiliateNavLink=e=>{let{href:r,label:t,icon:a,collapsed:i,exact:n,onNavigate:l,colorMode:s="dark"}=e,d=(0,x.useRouter)(),c=d.pathname,f=n?c===r:c===r||c.startsWith("".concat(r,"/")),p="light"===s?{textActive:"#0f172a",textInactive:"#475569",activeBg:"rgba(59,130,246,0.12)",hoverBg:"rgba(59,130,246,0.08)"}:{textActive:"#f8fafc",textInactive:"var(--affiliate-muted)",activeBg:"rgba(255,255,255,0.08)",hoverBg:"rgba(148, 163, 184, 0.15)"};return(0,o.jsxs)(h.Z,{component:u(),href:r,onClick:e=>{l&&l(e)},sx:{borderRadius:2,mb:.5,color:f?p.textActive:p.textInactive,"&:hover":{backgroundColor:p.hoverBg},backgroundColor:f?p.activeBg:"transparent",minHeight:44,px:i?1.5:2},children:[a&&(0,o.jsx)(g.Z,{sx:{minWidth:i?32:40,color:"inherit"},children:(0,o.jsx)(a,{size:18})}),!i&&(0,o.jsx)(b.Z,{primary:t,primaryTypographyProps:{fontSize:"0.95rem",fontWeight:f?600:500}})]})};var components_AffiliateSidebarBase=e=>{let{title:r,navItems:t,collapsed:f,onCollapseToggle:u,footerMeta:x,onLogout:h,showToggle:g=!0,colorMode:b="dark"}=e,p="light"===b?{background:"var(--affiliate-card, #ffffff)",textPrimary:"#0f172a",textMuted:"rgba(15,23,42,0.65)",toggleBg:"rgba(15,23,42,0.06)",toggleColor:"#0f172a",divider:"rgba(15,23,42,0.08)",footerMeta:"rgba(15,23,42,0.6)",buttonColor:"#0f172a",buttonBorder:"rgba(15,23,42,0.2)",buttonHoverBg:"rgba(15,23,42,0.06)"}:{background:"var(--affiliate-surface)",textPrimary:"#f8fafc",textMuted:"rgba(248,250,252,0.7)",toggleBg:"rgba(248,250,252,0.08)",toggleColor:"#f8fafc",divider:"rgba(248,250,252,0.12)",footerMeta:"rgba(248,250,252,0.6)",buttonColor:"#f8fafc",buttonBorder:"rgba(248,250,252,0.3)",buttonHoverBg:"rgba(248,250,252,0.08)"};return(0,o.jsxs)(a.Z,{sx:{width:f?80:260,transition:"width 0.2s ease",backgroundColor:p.background,color:p.textPrimary,display:"flex",flexDirection:"column",minHeight:"100vh"},children:[(0,o.jsxs)(a.Z,{sx:{display:"flex",alignItems:"center",justifyContent:f?"center":"space-between",px:f?1:2.5,py:2.5},children:[!f&&(0,o.jsx)(i.Z,{variant:"subtitle2",sx:{fontSize:"0.75rem",letterSpacing:2,textTransform:"uppercase",color:p.textMuted},children:r}),g&&(0,o.jsx)(n.Z,{onClick:u,size:"small",sx:{color:p.toggleColor,backgroundColor:p.toggleBg},children:(0,o.jsx)(d.Z,{size:18})})]}),(0,o.jsx)(l.Z,{sx:{borderColor:p.divider}}),(0,o.jsx)(a.Z,{component:"nav",sx:{flexGrow:1,px:f?.5:1.5,py:2},children:t.map(e=>(0,o.jsx)(AffiliateNavLink,{...e,collapsed:f,colorMode:b},e.href))}),(0,o.jsx)(l.Z,{sx:{borderColor:p.divider}}),(0,o.jsxs)(a.Z,{sx:{p:f?1:2},children:[!f&&x&&(0,o.jsx)(i.Z,{variant:"caption",sx:{color:p.footerMeta,display:"block",mb:1,wordBreak:"break-all"},children:x}),(0,o.jsxs)(s.Z,{fullWidth:!f,variant:"outlined",onClick:h,sx:{color:p.buttonColor,borderColor:p.buttonBorder,borderRadius:2,minWidth:f?0:"auto",justifyContent:f?"center":"flex-start",px:f?0:1.5,"&:hover":{borderColor:p.buttonColor,backgroundColor:p.buttonHoverBg}},children:[(0,o.jsx)(c.Z,{size:18,style:{marginRight:f?0:8,color:p.buttonColor}}),!f&&"Logout"]})]})]})}},51811:function(e,r,t){"use strict";t.d(r,{r:function(){return useAffiliateGuard}});var o=t(67294),a=t(11163),i=t(86563);let useAffiliateGuard=e=>{let r=(0,a.useRouter)(),{isAuthenticated:t,user:n,isBootstrapped:l}=(0,i.D)(),s=(0,o.useMemo)(()=>!!l&&!!t&&(!e||(null==n?void 0:n.role)===e),[l,t,e,null==n?void 0:n.role]);(0,o.useEffect)(()=>
1{if(l){if(!t){r.replace("/login");return}e&&(null==n?void 0:n.role)!==e&&r.replace((null==n?void 0:n.role)==="admin"?"/admin":"/partner")}},[l,t,e,null==n?void 0:n.role,r]);let d=!l||!s;return{canRender:s,isChecking:d}}},32758:function(e,r,t){"use strict";t.d(r,{l:function(){return AdminLayout}});var o=t(85893),a=t(67294),i=t(80822),n=t(66489),l=t(15861),s=t(77533),d=t(54799),c=t(77232),f=t(39483),u=t(49525),x=t(15109);let h=(0,x.Z)("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),g=(0,x.Z)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var b=t(80186),p=t(86563);let v=[{label:"Overview",href:"/admin",icon:f.Z,exact:!0},{label:"Partners",href:"/admin/partners",icon:u.Z},{label:"Payouts",href:"/admin/payouts",icon:h},{label:"Audit Log",href:"/admin/audit",icon:g}],AdminSidebar=e=>{let{collapsed:r,onCollapseToggle:t,colorMode:a="dark"}=e,{user:i,logout:n}=(0,p.D)();return(0,o.jsx)(b.Z,{title:"NW FIT Admin",navItems:v,collapsed:r,onCollapseToggle:t,footerMeta:null==i?void 0:i.email,onLogout:n,colorMode:a})};var m=t(51811),j=t(2698);let GuardLoader=e=>{let{message:r}=e;return(0,o.jsx)(j.X,{children:(0,o.jsxs)(i.Z,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[(0,o.jsx)(n.Z,{size:28,sx:{color:"var(--affiliate-primary)"}}),(0,o.jsx)(l.Z,{variant:"body2",sx:{color:"var(--affiliate-muted)"},children:r})]})})},AdminLayout=e=>{let{children:r}=e,{canRender:t,isChecking:n}=(0,m.r)("admin"),[f,u]=(0,a.useState)(!1),[x,h]=(0,a.useState)(!1),[g,b]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{let handler=()=>b(window.innerWidth>=1024);return handler(),window.addEventListener("resize",handler),()=>window.removeEventListener("resize",handler)},[]),(0,a.useEffect)(()=>{g&&h(!1)},[g]),n)return(0,o.jsx)(GuardLoader,{message:"Preparing admin dashboard..."});if(!t)return null;let p=g?"dark":"light",v=(0,o.jsx)(AdminSidebar,{collapsed:!!g&&f,onCollapseToggle:()=>g?u(e=>!e):h(!1),colorMode:p});return(0,o.jsx)(j.X,{children:(0,o.jsxs)(i.Z,{sx:{display:"flex",minHeight:"100vh"},children:[g?v:(0,o.jsx)(s.ZP,{open:x,onClose:()=>h(!1),PaperProps:{sx:{backgroundColor:"light"===p?"var(--affiliate-card, #ffffff)":"var(--affiliate-surface)",color:"light"===p?"#0f172a":"#f8fafc",width:260}},ModalProps:{BackdropProps:{sx:{backgroundColor:"rgba(15, 23, 42, 0.75)"}}},children:v}),(0,o.jsxs)(i.Z,{sx:{flexGrow:1,display:"flex",flexDirection:"column",minWidth:0},children:[(0,o.jsxs)(i.Z,{className:"affiliate-header",children:[(0,o.jsx)(d.Z,{onClick:()=>{g?u(e=>!e):h(!0)},sx:{mr:2},children:(0,o.jsx)(c.Z,{size:18})}),(0,o.jsx)(l.Z,{variant:"body2",sx:{fontWeight:600,color:"#0f172a"},children:"Admin Dashboard"})]}),(0,o.jsx)(i.Z,{component:"main",sx:{flexGrow:1,overflow:"auto",p:{xs:3,md:4}},children:r})]})]})})}},2698:function(e,r,t){"use strict";t.d(r,{X:function(){return AffiliatePageShell}});var o=t(85893),a=t(80822);let AffiliatePageShell=e=>{let{children:r}=e;return(0,o.jsx)(a.Z,{className:"affiliate-portal",sx:{minHeight:"100vh",backgroundColor:"var(--affiliate-bg)",display:"flex",flexDirection:"column"},children:r})}}},function(e){e.O(0,[1559,52,2888,6003,179],function(){return e(e.s=84633)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.