1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[739],{235:(e,t,r)=>{r.d(t,{A:()=>s,O:()=>i});var n=r(5155),o=r(2115),a=r(4924);let l=(0,o.createContext)(),i=e=>{let{children:t}=e,[r,i]=(0,o.useState)(null),[s,d]=(0,o.useState)(!1),[u,c]=(0,o.useState)(!1),[f,p]=(0,o.useState)(!1),[m,g]=(0,o.useState)(null),[h,y]=(0,o.useState)(!1),[v,w]=(0,o.useState)({id:"affluenz-app",public_settings:{name:"Affluenz Magazine"}});(0,o.useEffect)(()=>{let e=(0,a.Ti)();e&&(0,a.gf)()&&(i(e),d(!0)),b()},[]);let b=async()=>{p(!0),g(null),w({id:"affluenz-app",public_settings:{name:"Affluenz Magazine",environment:"production"}}),await x(),p(!1)},x=async()=>{c(!0);let e=null;if((0,a.gf)())try{e=await a.ZQ.me(),(0,a.h)({user:e,token:(0,a.gf)()})}catch(t){(0,a.q7)(),e=null}return i(e),d(!!e),c(!1),y(!0),e},S=async(e,t)=>{let r=await a.ZQ.login(e,t),n=(0,a.h)(r);return i(n),d(!0),g(null),n},j=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"google",t=await a.ZQ.providerLogin(e),r=(0,a.h)(t);return i(r),d(!0),g(null),r},N=async e=>{let{email:t,password:r,name:n}=e,o=await a.ZQ.register({email:t,password:r,name:n}),l=(0,a.h)(o);return i(l),d(!0),g(null),l},z=async e=>{let t=await a.ZQ.forgotPassword(e);return(null==t?void 0:t.devResetToken)||null},k=async e=>{let{resetToken:t,newPassword:r}=e,n=await a.ZQ.resetPassword({resetToken:t,newPassword:r}),o=(0,a.h)(n);return i(o),d(!0),g(null),o};return(0,n.jsx)(l.Provider,{value:{user:r,isAuthenticated:s,isLoadingAuth:u,isLoadingPublicSettings:f,authError:m,appPublicSettings:v,authChecked:h,login:S,loginViaProvider:j,register:N,resetPasswordRequest:z,resetPassword:k,logout:function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];i(null),d(!1),a.ZQ.logout().catch(()=>{}),(0,a.q7)(),e&&(window.location.href="/login")},navigateToLogin:()=>{window.location.href="/login"},checkUserAuth:x,checkAppState:b},children:t})},s=()=>{let e=(0,o.useContext)(l);if(!e)throw Error("useAuth must be used within an AuthProvider");return e}},1907:(e,t,r)=>{r.d(t,{J:()=>c});var n=r(5155),o=r(2115);r(7650);var a=r(6673),l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=(0,a.TL)(`Primitive.${t}`),l=o.forwardRef((e,o)=>{let{asChild:a,...l}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,n.jsx)(a?r:t,{...l,ref:o})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{}),i=o.forwardRef((e,t)=>(0,n.jsx)(l.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label";var s=r(3101),d=r(3537);let u=(0,s.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=o.forwardRef((e,t)=>{let{className:r,...o}=e;return(0,n.jsx)(i,{ref:t,className:(0,d.cn)(u(),r),...o})});c.displayName=i.displayName},2033:(e,t,r)=>{r.d(t,{A:()=>n});let n=(0,r(4294).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3537:(e,t,r)=>{r.d(t,{cn:()=>a});var n=r(2821),o=r(5889);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,o.QP)((0,n.$)(t))}window.self,window.top},4294:(e,t,r)=>{r.d(t,{A:()=>i});var n=r(2115);let o=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:l=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:d="",children:u,iconNode:c,...f}=e;return(0,n.createElement)("svg",{ref:t,...a,width:l,height:l,stroke:r,strokeWidth:s?24*Number(i)/Number(l):i,className:o("lucide",d),...f},[...c.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(u)?u:[u]])}),i=(e,t)=>{let r=(0,n.forwardRef)((r,a)=>{let{className:i,...s}=r;return(0,n.createElement)(l,{ref:a,iconNode:t,className:o("lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),i),...s})});return r.displayName="".concat(e),r}},4516:(e,t,r)=>{r.d(t,{p:()=>l});var n=r(5155),o=r(2115),a=r(3537);let l=o.forwardRef((e,t)=>
1{let{className:r,type:o,...l}=e;return(0,n.jsx)("input",{type:o,className:(0,a.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t,...l})});l.displayName="Input"},4924:(e,t,r)=>{r.d(t,{Ez:()=>l,Ti:()=>c,VT:()=>y,YY:()=>w,ZQ:()=>z,b7:()=>j,cn:()=>N,gf:()=>d,h:()=>p,n0:()=>x,q7:()=>m,qq:()=>h,rC:()=>S,vl:()=>b,xZ:()=>v,zj:()=>a});let n="https://theaffluenzmedia.com/api",o=n.replace(/\/api\/?$/,""),a=e=>{let t=String(e||"");return/^https?:\/\//i.test(t)?t:"".concat(o,"/uploads/").concat(t.replace(/^\/+/,""))},l=e=>{let t=String(e||"");return/^https?:\/\//i.test(t)?t:"/_pdf/".concat(t.replace(/^\/+/,""))},i="affluenz_token",s="affluenz_user",d=()=>window.localStorage.getItem(i),u=e=>{e?window.localStorage.setItem(i,e):window.localStorage.removeItem(i)},c=()=>{try{let e=window.localStorage.getItem(s);return e?JSON.parse(e):null}catch(e){return null}},f=e=>{e?window.localStorage.setItem(s,JSON.stringify(e)):window.localStorage.removeItem(s)},p=function(){let{user:e,token:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u(t||null),f(e||null),e||null},m=()=>{u(null),f(null)};async function g(e){let t,{method:r="GET",body:o,headers:a={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l={...a},i={method:r,headers:l};void 0!==o&&(l["Content-Type"]="application/json",i.body=JSON.stringify(o));let s=d();s&&(l.Authorization="Bearer ".concat(s));try{t=await fetch("".concat(n).concat(e),i)}catch(e){throw Error("Unable to reach the server. Please check your connection and try again.")}let u=(t.headers.get("content-type")||"").includes("application/json")?await t.json():null;if(!t.ok){var c,f;let e=Error((null==u||null==(c=u.error)?void 0:c.message)||t.statusText||"Request failed (".concat(t.status,")"));throw e.status=t.status,e.details=null==u||null==(f=u.error)?void 0:f.details,e}return u}let h=e=>g("/articles".concat(e?"?category=".concat(encodeURIComponent(e)):"")).then(e=>e.data),y=()=>g("/articles/categories").then(e=>e.data),v=e=>g("/articles/".concat(e)).then(e=>e.data),w=e=>g("/magazines".concat(e?"?category=".concat(encodeURIComponent(e)):"")).then(e=>e.data),b=e=>g("/magazines/".concat(e)).then(e=>e.data),x=()=>d()?g("/magazines/purchases").then(e=>e.data||[]).catch(()=>[]):Promise.resolve([]),S=e=>g("/home/overview".concat(e?"?limit=".concat(encodeURIComponent(e)):"")).then(e=>e.data),j=()=>g("/pricing-plans").then(e=>e.data),N=e=>{let{reference:t,planId:r,magazineId:n}=e;return g("/payments/paystack/verify",{method:"POST",body:{reference:t,planId:r,...n?{magazineId:n}:{}}})},z={login:(e,t)=>g("/auth/login",{method:"POST",body:{email:e,password:t}}),providerLogin:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"google";return g("/auth/provider-login",{method:"POST",body:{provider:e}})},register:e=>{let{email:t,password:r,name:n}=e;return g("/auth/register",{method:"POST",body:{email:t,password:r,...n?{name:n}:{}}})},forgotPassword:e=>g("/auth/forgot-password",{method:"POST",body:{email:e}}),resetPassword:e=>{let{resetToken:t,newPassword:r}=e;return g("/auth/reset-password",{method:"POST",body:{resetToken:t,newPassword:r}})},logout:()=>g("/auth/logout",{method:"POST"}),me:()=>g("/auth/me").then(e=>e.user)}},6673:(e,t,r)=>{r.d(t,{DX:()=>c,TL:()=>u});var n=r(2115),o=r.t(n,2);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}var l=r(5155),i=Symbol.for("react.lazy"),s=o[" use ".trim().toString()];function d(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===i&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}function u(e){let t=function(e){let t=n.forwardRef((e,t)=>{let{children:r,...o}=e;if(d(r)&&"function"==typeof s&&(r=s(r._payload)),n.isValidElement(r)){var l;let e,i,s=(l=r,(i=(e=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in e&&e.
1isReactWarning)?l.ref:(i=(e=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?l.props.ref:l.props.ref||l.ref),d=function(e,t){let r={...t};for(let n in t){let o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{let t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(o,r.props);return r.type!==n.Fragment&&(d.ref=t?function(...e){return t=>{let r=!1,n=e.map(e=>{let n=a(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():a(e[t],null)}}}}(t,s):s),n.cloneElement(r,d)}return n.Children.count(r)>1?n.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),r=n.forwardRef((e,r)=>{let{children:o,...a}=e;d(o)&&"function"==typeof s&&(o=s(o._payload));let i=n.Children.toArray(o),u=i.find(p);if(u){let e=u.props.children,o=i.map(t=>t!==u?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,l.jsx)(t,{...a,ref:r,children:n.isValidElement(e)?n.cloneElement(e,void 0,o):null})}return(0,l.jsx)(t,{...a,ref:r,children:o})});return r.displayName=`${e}.Slot`,r}var c=u("Slot"),f=Symbol("radix.slottable");function p(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}},7356:(e,t,r)=>{r.d(t,{$:()=>d});var n=r(5155),o=r(2115),a=r(6673),l=r(3101),i=r(3537);let s=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=o.forwardRef((e,t)=>{let{className:r,variant:o,size:l,asChild:d=!1,...u}=e,c=d?a.DX:"button";return(0,n.jsx)(c,{className:(0,i.cn)(s({variant:o,size:l,className:r})),ref:t,...u})});d.displayName="Button"},8731:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(5155);function o(e){let{title:t,subtitle:r,footer:o,children:a}=e;return(0,n.jsx)("div",{className:"light-theme min-h-screen flex items-center justify-center bg-secondary px-4 py-12",children:(0,n.jsxs)("div",{className:"w-full max-w-md",children:[(0,n.jsxs)("div",{className:"text-center mb-10",children:[(0,n.jsx)("img",{src:"/images/logo1.png",alt:"Affluenz Magazine",className:"h-48 w-auto mx-auto mb-6 object-contain"}),(0,n.jsx)("h1",{className:"font-heading text-4xl font-bold tracking-tight text-foreground",children:t}),r&&(0,n.jsx)("p",{className:"text-sm uppercase tracking-[0.2em] text-muted-foreground mt-4",children:r})]}),(0,n.jsx)("div",{className:"bg-card border border-border shadow-sm p-8 sm:p-10",children:a}),o&&(0,n.jsx)("p",{className:"text-center text-sm text-muted-foreground mt-8",children:o})]})})}r(2115)}}]);
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.