2 lines
40 KiB
JavaScript
2 lines
40 KiB
JavaScript
(()=>{var a={};a.id=974,a.ids=[974],a.modules={71:(a,b,c)=>{"use strict";c.d(b,{u:()=>f});let d="http://localhost:8000/api";class e{getToken(){return null}async request(a,b={}){let c=this.getToken(),e={"Content-Type":"application/json",...b.headers};c&&(e.Authorization=`Bearer ${c}`);try{let c=await fetch(`${d}${a}`,{...b,headers:e}),f=await c.json();if(!c.ok)throw c.status,Error(f.message||"API request failed");return f}catch(a){throw console.error("API Error:",a),a}}async get(a){return this.request(a,{method:"GET"})}async post(a,b){return this.request(a,{method:"POST",body:b?JSON.stringify(b):void 0})}async put(a,b){return this.request(a,{method:"PUT",body:b?JSON.stringify(b):void 0})}async delete(a){return this.request(a,{method:"DELETE"})}async upload(a,b){let c=this.getToken(),e={};c&&(e.Authorization=`Bearer ${c}`);try{let c=await fetch(`${d}${a}`,{method:"POST",headers:e,body:b}),f=await c.json();if(!c.ok)throw c.status,Error(f.message||"Upload failed");return f}catch(a){throw console.error("Upload Error:",a),a}}}let f=new e},110:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/sorti/projects/hosting-frontend/components/launch-ui/footer.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/sorti/projects/hosting-frontend/components/launch-ui/footer.tsx","default")},261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},313:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(1124),e=c(3991),f=c.n(e),g=c(3339);let h=(0,g.A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),i=(0,g.A)("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),j=(0,g.A)("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);function k({year:a=new Date().getFullYear()}){return(0,d.jsx)("footer",{className:"border-t bg-gray-50",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 py-12",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8 mb-8",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-lg font-bold mb-4",children:"Portfolio Host"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Host your portfolio with ease and get discovered by opportunities."})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold mb-4",children:"Product"}),(0,d.jsxs)("ul",{className:"space-y-2 text-sm",children:[(0,d.jsx)("li",{children:(0,d.jsx)(f(),{href:"/register",className:"text-muted-foreground hover:text-primary",children:"Get Started"})}),(0,d.jsx)("li",{children:(0,d.jsx)("a",{href:"#features",className:"text-muted-foreground hover:text-primary",children:"Features"})}),(0,d.jsx)("li",{children:(0,d.jsx)("a",{href:"#pricing",className:"text-muted-foreground hover:text-primary",children:"Pricing"})})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold mb-4",children:"Resources"}),(0,d.jsxs)("ul",{className:"space-y-2 text-sm",children:[(0,d.jsx)("li",{children:(0,d.jsx)("a",{href:"#docs",className:"text-muted-foreground hover:text-primary",children:"Documentation"})}),(0,d.jsx)("li",{children:(0,d.jsx)("a",{href:"#blog",className:"text-muted-foreground hover:text-primary",children:"Blog"})}),(0,d.jsx)("li",{children:(0,d.jsx)("a",{href:"#support",className:"text-muted-foreground hover:text-primary",children:"Support"})})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-semibold mb-4",children:"Connect"}),(0,d.jsxs)("div",{className:"flex gap-4",children:[(0,d.jsx)("a",{href:"mailto:hello@portfoliohost.com","aria-label":"Email",className:"text-muted-foreground hover:text-primary",children:(0,d.jsx)(h,{size:20})}),(0,d.jsx)("a",{href:"https://github.com","aria-label":"GitHub",className:"text-muted-foreground hover:text-primary",children:(0,d.jsx)(i,{size:20})}),(0,d.jsx)("a",{href:"https://twitter.com","aria-label":"Twitter",className:"text-muted-foreground hover:text-primary",children:(0,d.jsx)(j,{size:20})})]})]})]}),(0,d.jsx)("div",{className:"border-t pt-8",children:(0,d.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-muted-foreground",children:["\xa9 ",a," Portfolio Host. All rights reserved."]}),(0,d.jsxs)("div",{className:"flex gap-6 text-sm",children:[(0,d.jsx)("a",{href:"#privacy",className:"text-muted-foreground hover:text-primary",children:"Privacy"}),(0,d.jsx)("a",{href:"#terms",className:"text-muted-foreground hover:text-primary",children:"Terms"}),(0,d.jsx)("a",{href:"#cookies",className:"text-muted-foreground hover:text-primary",children:"Cookies"})]})]})})]})})}},507:(a,b,c)=>{"use strict";c.d(b,{AuthProvider:()=>e});var d=c(7954);(0,d.registerClientReference)(function(){throw Error("Attempted to call AuthContext() from the server but AuthContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/sorti/projects/hosting-frontend/components/auth/auth-provider.tsx","AuthContext");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call AuthProvider() from the server but AuthProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/sorti/projects/hosting-frontend/components/auth/auth-provider.tsx","AuthProvider")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},971:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,4160,23)),Promise.resolve().then(c.t.bind(c,1603,23)),Promise.resolve().then(c.t.bind(c,8495,23)),Promise.resolve().then(c.t.bind(c,5170,23)),Promise.resolve().then(c.t.bind(c,7526,23)),Promise.resolve().then(c.t.bind(c,8922,23)),Promise.resolve().then(c.t.bind(c,9234,23)),Promise.resolve().then(c.t.bind(c,2263,23)),Promise.resolve().then(c.bind(c,2146))},1025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},1903:(a,b,c)=>{Promise.resolve().then(c.bind(c,9283)),Promise.resolve().then(c.bind(c,110)),Promise.resolve().then(c.bind(c,6043)),Promise.resolve().then(c.bind(c,2943)),Promise.resolve().then(c.bind(c,6829)),Promise.resolve().then(c.bind(c,6286))},2151:(a,b,c)=>{Promise.resolve().then(c.bind(c,2386)),Promise.resolve().then(c.bind(c,313)),Promise.resolve().then(c.bind(c,5113)),Promise.resolve().then(c.bind(c,2743)),Promise.resolve().then(c.bind(c,2925)),Promise.resolve().then(c.bind(c,7224))},2386:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(1124),e=c(8301);let f=(0,c(3339).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),g=[{id:"faq-1",question:"How do I upload my portfolio?",answer:'Navigate to your dashboard and click "Create New Portfolio". Fill in your portfolio details, then upload a ZIP file containing your website files. Our system will automatically extract and deploy your portfolio.'},{id:"faq-2",question:"What file formats are supported?",answer:"We support ZIP files containing standard web files (HTML, CSS, JavaScript, images). The root of your ZIP should contain an index.html file as the entry point."},{id:"faq-3",question:"Can I use a custom domain?",answer:"Yes! You can connect your custom domain during portfolio creation. Simply point your domain's DNS records to our servers, and we'll handle the rest."},{id:"faq-4",question:"Is SSL/HTTPS included?",answer:"Absolutely! All portfolios hosted on Portfolio Host include free SSL certificates. Your site will automatically be served over HTTPS for security and SEO benefits."},{id:"faq-5",question:"How do I update my portfolio?",answer:"Simply upload a new ZIP file for your portfolio. The system will automatically replace the old version while keeping your custom domain and settings intact."},{id:"faq-6",question:"What happens if I delete my portfolio?",answer:"Deleted portfolios are permanently removed and cannot be recovered. Your custom domain will become available for reassignment. Please download any important files before deletion."}];function h({items:a=g}){let[b,c]=(0,e.useState)(null);return(0,d.jsx)("section",{className:"py-16 md:py-24",children:(0,d.jsxs)("div",{className:"container mx-auto px-4",children:[(0,d.jsxs)("div",{className:"text-center mb-12",children:[(0,d.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Frequently Asked Questions"}),(0,d.jsx)("p",{className:"text-lg text-muted-foreground",children:"Find answers to common questions about Portfolio Host"})]}),(0,d.jsx)("div",{className:"max-w-2xl mx-auto space-y-4",children:a.map(a=>(0,d.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,d.jsxs)("button",{onClick:()=>{var d;c(b===(d=a.id)?null:d)},className:"w-full px-6 py-4 flex items-center justify-between hover:bg-gray-50 transition","aria-expanded":b===a.id,"aria-controls":`faq-answer-${a.id}`,children:[(0,d.jsx)("span",{className:"font-semibold text-left text-foreground",children:a.question}),(0,d.jsx)(f,{size:20,className:`text-muted-foreground transition-transform flex-shrink-0 ml-4 ${b===a.id?"rotate-180":""}`})]}),b===a.id&&(0,d.jsx)("div",{id:`faq-answer-${a.id}`,className:"px-6 py-4 bg-gray-50 border-t text-muted-foreground",children:a.answer})]},a.id))}),(0,d.jsxs)("div",{className:"text-center mt-12",children:[(0,d.jsx)("p",{className:"text-muted-foreground mb-4",children:"Still have questions?"}),(0,d.jsx)("a",{href:"mailto:support@portfoliohost.com",className:"text-primary hover:underline font-medium",children:"Contact our support team"})]})]})})}},2704:()=>{},2743:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(1124),e=c(3339);let f=(0,e.A)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),g=(0,e.A)("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),h=(0,e.A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),i=(0,e.A)("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),j=[{id:"fast",title:"Lightning Fast",description:"Deploy your portfolio instantly and reach global audiences with blazing-fast loading times.",icon:"zap"},{id:"secure",title:"Secure & Reliable",description:"Enterprise-grade security with automatic SSL certificates and 99.9% uptime guarantee.",icon:"shield"},{id:"domain",title:"Custom Domains",description:"Use your own domain name to create a professional online presence.",icon:"globe"},{id:"mobile",title:"Mobile Optimized",description:"Your portfolio looks perfect on all devices from smartphones to desktops.",icon:"smartphone"}],k={zap:f,shield:g,globe:h,smartphone:i};function l({items:a=j}){return(0,d.jsx)("section",{className:"py-16 md:py-24 bg-white",children:(0,d.jsxs)("div",{className:"container mx-auto px-4",children:[(0,d.jsxs)("div",{className:"text-center mb-12",children:[(0,d.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Why Choose Portfolio Host?"}),(0,d.jsx)("p",{className:"text-lg text-muted-foreground",children:"Everything you need to share your work with the world"})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:a.map(a=>{let b=k[a.icon];return(0,d.jsxs)("div",{className:"p-6 rounded-lg border hover:shadow-lg transition",children:[(0,d.jsx)(b,{size:40,className:"text-primary mb-4"}),(0,d.jsx)("h3",{className:"text-xl font-semibold mb-2",children:a.title}),(0,d.jsx)("p",{className:"text-muted-foreground",children:a.description})]},a.id)})})]})})}},2925:(a,b,c)=>{"use strict";c.d(b,{default:()=>n});var d=c(1124),e=c(8301),f=c(3991),g=c.n(f),h=c(3478),i=c(9217),j=c(9710),k=c(3339);let l=(0,k.A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),m=(0,k.A)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);function n(){let{user:a,logout:b}=(0,h.A)(),[c,f]=(0,e.useState)(!1),k=()=>{f(!1)},n=async()=>{await b(),k()};return(0,d.jsx)("nav",{className:"border-b bg-white sticky top-0 z-50",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 py-4",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center",children:[(0,d.jsx)(g(),{href:"/",className:"text-2xl font-bold text-primary hover:opacity-80",children:"Portfolio Host"}),(0,d.jsxs)("div",{className:"hidden md:flex items-center gap-6",children:[(0,d.jsx)(g(),{href:"/",className:"text-foreground hover:text-primary transition",children:"Home"}),a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g(),{href:"/dashboard",className:"text-foreground hover:text-primary transition",children:"Dashboard"}),(0,d.jsxs)(i.$,{onClick:n,variant:"ghost",className:"flex items-center gap-2","aria-label":"Logout",children:[(0,d.jsx)(j.A,{size:18}),"Logout"]})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g(),{href:"/login",children:(0,d.jsx)(i.$,{variant:"outline",children:"Login"})}),(0,d.jsx)(g(),{href:"/register",children:(0,d.jsx)(i.$,{children:"Sign Up"})})]})]}),(0,d.jsx)("button",{onClick:()=>{f(!c)},className:"md:hidden p-2 hover:bg-gray-100 rounded-md","aria-label":"Toggle menu","aria-expanded":c,children:c?(0,d.jsx)(l,{size:24}):(0,d.jsx)(m,{size:24})})]}),c&&(0,d.jsxs)("div",{className:"md:hidden mt-4 pb-4 border-t pt-4 space-y-3",children:[(0,d.jsx)(g(),{href:"/",className:"block text-foreground hover:text-primary transition py-2",onClick:k,children:"Home"}),a?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g(),{href:"/dashboard",className:"block text-foreground hover:text-primary transition py-2",onClick:k,children:"Dashboard"}),(0,d.jsxs)(i.$,{onClick:n,variant:"ghost",className:"w-full justify-start flex items-center gap-2","aria-label":"Logout",children:[(0,d.jsx)(j.A,{size:18}),"Logout"]})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(g(),{href:"/login",onClick:k,children:(0,d.jsx)(i.$,{variant:"outline",className:"w-full",children:"Login"})}),(0,d.jsx)(g(),{href:"/register",onClick:k,children:(0,d.jsx)(i.$,{className:"w-full",children:"Sign Up"})})]})]})]})})}},2943:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/sorti/projects/hosting-frontend/components/launch-ui/items.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/sorti/projects/hosting-frontend/components/launch-ui/items.tsx","default")},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3356:(a,b,c)=>{Promise.resolve().then(c.bind(c,9953))},3478:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});var d=c(8301),e=c(9953);function f(){let a=(0,d.useContext)(e.c);if(void 0===a)throw Error("useAuth must be used within an AuthProvider");return a}},5113:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(1124),e=c(3991),f=c.n(e),g=c(9217);function h({title:a="Host Your Portfolio",description:b="Deploy and manage your portfolio websites with custom domains. Simple, fast, and professional hosting for creatives and developers.",primaryCTA:c={text:"Get Started",href:"/register"},secondaryCTA:e={text:"View Example",href:"#"}}){return(0,d.jsx)("section",{className:"py-20 md:py-32 bg-gradient-to-br from-purple-50 to-pink-50",children:(0,d.jsxs)("div",{className:"container mx-auto px-4 text-center",children:[(0,d.jsx)("h1",{className:"text-4xl md:text-6xl font-bold mb-6 bg-gradient-to-r from-purple-600 to-pink-600 bg-clip-text text-transparent",children:a}),(0,d.jsx)("p",{className:"text-lg md:text-xl text-muted-foreground mb-8 max-w-2xl mx-auto",children:b}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[(0,d.jsx)(f(),{href:c.href,children:(0,d.jsx)(g.$,{size:"lg",className:"w-full sm:w-auto",children:c.text})}),e.text&&(0,d.jsx)(f(),{href:e.href,children:(0,d.jsx)(g.$,{size:"lg",variant:"outline",className:"w-full sm:w-auto",children:e.text})})]}),(0,d.jsx)("div",{className:"mt-16 pt-16 border-t border-gray-200",children:(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Trusted by portfolio creators and developers worldwide"})})]})})}},5315:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1170,23)),Promise.resolve().then(c.t.bind(c,3597,23)),Promise.resolve().then(c.t.bind(c,6893,23)),Promise.resolve().then(c.t.bind(c,9748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,9576,23)),Promise.resolve().then(c.t.bind(c,3041,23)),Promise.resolve().then(c.t.bind(c,1384,23))},5514:(a,b,c)=>{"use strict";c.d(b,{cn:()=>f});var d=c(3249),e=c(8829);function f(...a){return(0,e.QP)((0,d.$)(a))}},5919:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>D.a,__next_app__:()=>J,handler:()=>L,pages:()=>I,routeModule:()=>K,tree:()=>H});var d=c(9754),e=c(9117),f=c(6595),g=c(2324),h=c(9326),i=c(8928),j=c(175),k=c(12),l=c(4290),m=c(2696),n=c(2802),o=c(7533),p=c(5229),q=c(2822),r=c(261),s=c(6453),t=c(2474),u=c(6713),v=c(1356),w=c(2685),x=c(6225),y=c(3446),z=c(2762),A=c(5742),B=c(6439),C=c(1170),D=c.n(C),E=c(2506),F=c(1203),G={};for(let a in E)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(G[a]=()=>E[a]);c.d(b,G);let H=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,7742)),"/home/sorti/projects/hosting-frontend/app/page.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,6953)),"/home/sorti/projects/hosting-frontend/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,1170,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,7028,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,461,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,2768,23)),"next/dist/client/components/builtin/unauthorized.js"]}],I=["/home/sorti/projects/hosting-frontend/app/page.tsx"],J={require:c,loadChunk:()=>Promise.resolve()},K=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:H},distDir:".next",relativeProjectDir:""});async function L(a,b,d){var C;let G="/page";"/index"===G&&(G="/");let M=(0,h.getRequestMeta)(a,"postponed"),N=(0,h.getRequestMeta)(a,"minimalMode"),O=await K.prepare(a,b,{srcPage:G,multiZoneDraftMode:!1});if(!O)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:P,query:Q,params:R,parsedUrl:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:$,isDraftMode:_,resolvedPathname:aa,revalidateOnlyGenerated:ab,routerServerContext:ac,nextConfig:ad,interceptionRoutePatterns:ae}=O,af=S.pathname||"/",ag=(0,r.normalizeAppPath)(G),{isOnDemandRevalidate:ah}=O,ai=K.match(af,$),aj=!!$.routes[aa],ak=!!(ai||aj||$.routes[ag]),al=a.headers["user-agent"]||"",am=(0,u.getBotType)(al),an=(0,p.isHtmlBotRequest)(a),ao=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],ap=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[t.RSC_HEADER],aq=(0,s.getIsPossibleServerAction)(a),ar=(0,m.checkIsAppPPREnabled)(ad.experimental.ppr)&&(null==(C=$.routes[ag]??$.dynamicRoutes[ag])?void 0:C.renderingMode)==="PARTIALLY_STATIC",as=!1,at=!1,au=ar?M:void 0,av=ar&&ap&&!ao,aw=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ax=!al||(0,p.shouldServeStreamingMetadata)(al,ad.htmlLimitedBots);an&&ar&&(ak=!1,ax=!1);let ay=!0===K.isDev||!ak||"string"==typeof M||av,az=an&&ar,aA=null;_||!ak||ay||aq||au||av||(aA=aa);let aB=aA;!aB&&K.isDev&&(aB=aa),K.isDev||_||!ak||!ap||av||(0,k.d)(a.headers);let aC={...E,tree:H,pages:I,GlobalError:D(),handler:L,routeModule:K,__next_app__:J};X&&Y&&(0,o.setReferenceManifestsSingleton)({page:G,clientReferenceManifest:Y,serverActionsManifest:X,serverModuleMap:(0,q.createServerModuleMap)({serverActionsManifest:X})});let aD=a.method||"GET",aE=(0,g.getTracer)(),aF=aE.getActiveScopeSpan();try{let f=K.getVaryHeader(aa,ae);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return K.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aE.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aD} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aD} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:Q,params:R,page:ag,sharedContext:{buildId:P},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aC,Component:(0,j.T)(aC),params:R,routeModule:K,page:G,postponed:f,shouldWaitOnAllReady:az,serveStreamingMetadata:ax,supportsDynamicResponse:"string"==typeof f||ay,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,serverActionsManifest:X,clientReferenceManifest:Y,setIsrStatus:null==ac?void 0:ac.setIsrStatus,dir:c(9902).join(process.cwd(),K.relativeProjectDir),isDraftMode:_,isRevalidate:ak&&!f&&!av,botType:am,isOnDemandRevalidate:ah,isPossibleServerAction:aq,assetPrefix:ad.assetPrefix,nextConfigOutput:ad.output,crossOrigin:ad.crossOrigin,trailingSlash:ad.trailingSlash,previewProps:$.preview,deploymentId:ad.deploymentId,enableTainting:ad.experimental.taint,htmlLimitedBots:ad.htmlLimitedBots,devtoolSegmentExplorer:ad.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ad.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ad.experimental.cacheLife,basePath:ad.basePath,serverActions:ad.experimental.serverActions,...as?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:as}:{},experimental:{isRoutePPREnabled:ar,expireTime:ad.expireTime,staleTimes:ad.experimental.staleTimes,cacheComponents:!!ad.experimental.cacheComponents,clientSegmentCache:!!ad.experimental.clientSegmentCache,clientParamParsing:!!ad.experimental.clientParamParsing,dynamicOnHover:!!ad.experimental.dynamicOnHover,inlineCss:!!ad.experimental.inlineCss,authInterrupts:!!ad.experimental.authInterrupts,clientTraceMetadata:ad.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>K.onRequestError(a,b,d,ac),err:(0,h.getRequestMeta)(a,"invokeError"),dev:K.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[y.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,ak&&(null==n?void 0:n.revalidate)===0&&!K.isDev&&!ar){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${aa}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},o=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===K.isDev,l=c||b.writableEnded;if(ah&&ab&&!f&&!N)return(null==ac?void 0:ac.render404)?await ac.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(ai&&(j=(0,w.parseFallbackField)(ai.fallback)),j===w.FallbackMode.PRERENDER&&(0,u.isBot)(al)&&(!ar||an)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ah=!0),ah&&(j!==w.FallbackMode.NOT_FOUND||f)&&(j=w.FallbackMode.BLOCKING_STATIC_RENDER),!N&&j!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aB&&!l&&!_&&T&&(k||!aj)){let b;if((k||ai)&&j===w.FallbackMode.NOT_FOUND)throw new B.NoFallbackError;if(ar&&!ap){let c="string"==typeof(null==ai?void 0:ai.fallback)?ai.fallback:k?ag:null;if(b=await K.handleResponse({cacheKey:c,req:a,nextConfig:ad,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:$,isRoutePPREnabled:ar,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||at?(0,n.u)(ag):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let o=ah||g||!au?void 0:au;if(as&&void 0!==o)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=T&&ar&&((0,h.getRequestMeta)(a,"renderFallbackShell")||at)?(0,n.u)(af):null;return m({span:i,postponed:o,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,n=await K.handleResponse({cacheKey:aA,responseGenerator:a=>o({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ah,isRoutePPREnabled:ar,req:a,nextConfig:ad,prerenderManifest:$,waitUntil:d.waitUntil});if(_&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),K.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!n){if(aA)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof n.value.postponed;ak&&!av&&(!p||ao)&&(N||b.setHeader("x-nextjs-cache",ah?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=n;if(au)l={revalidate:0,expire:void 0};else if(N&&ap&&!ao&&ar)l={revalidate:0,expire:void 0};else if(!K.isDev)if(_)l={revalidate:0,expire:void 0};else if(ak){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??ad.expireTime}}else l={revalidate:y.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(n.cacheControl=l,"string"==typeof aw&&(null==q?void 0:q.kind)===v.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];N&&ak&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(aw);return void 0!==d?(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...n,value:{...n.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&au)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(N&&ak||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(N&&ak&&s&&"string"==typeof s&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,s),!q.status||ap&&ar||(b.statusCode=q.status),!N&&q.status&&F.RedirectStatusCode[q.status]&&ap&&(b.statusCode=200),p&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),ap&&!_){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:q.html,cacheControl:av?{revalidate:0,expire:void 0}:n.cacheControl})}return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:x.default.fromStatic(q.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let u=q.html;if(!p||N||ap)return(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:n.cacheControl});if(as)return u.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}});let w=new TransformStream;return u.push(w.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(w.writable)}).catch(a=>{w.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,A.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:u,cacheControl:{revalidate:0,expire:void 0}})};if(!aF)return await aE.withPropagatedContext(a.headers,()=>aE.trace(i.BaseServerSpan.handleRequest,{spanName:`${aD} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aD,"http.target":a.url}},p));await p(aF)}catch(b){throw b instanceof B.NoFallbackError||await K.onRequestError(a,b,{routerKind:"App Router",routePath:G,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:ak,isOnDemandRevalidate:ah})},ac),b}}},6043:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/sorti/projects/hosting-frontend/components/launch-ui/hero.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/sorti/projects/hosting-frontend/components/launch-ui/hero.tsx","default")},6286:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/sorti/projects/hosting-frontend/components/launch-ui/stats.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/sorti/projects/hosting-frontend/components/launch-ui/stats.tsx","default")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6508:(a,b,c)=>{Promise.resolve().then(c.bind(c,507))},6713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},6829:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/sorti/projects/hosting-frontend/components/launch-ui/navbar.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/sorti/projects/hosting-frontend/components/launch-ui/navbar.tsx","default")},6953:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>i,metadata:()=>h});var d=c(5338),e=c(1288),f=c.n(e);c(2704);var g=c(507);let h={title:"Portfolio Hosting Platform",description:"Host and manage your portfolio websites with ease"};function i({children:a}){return(0,d.jsx)("html",{lang:"en",children:(0,d.jsx)("body",{className:f().className,children:(0,d.jsx)(g.AuthProvider,{children:a})})})}},7224:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(1124);let e=[{id:"portfolios",label:"Portfolios Hosted",value:"10,000+"},{id:"uptime",label:"Uptime Guarantee",value:"99.9%"},{id:"users",label:"Active Users",value:"50,000+"},{id:"time",label:"Average Deploy Time",value:"<30s"}];function f({stats:a=e}){return(0,d.jsx)("section",{className:"py-16 md:py-24 bg-gradient-to-r from-purple-600 to-pink-600 text-white",children:(0,d.jsxs)("div",{className:"container mx-auto px-4",children:[(0,d.jsxs)("div",{className:"text-center mb-12",children:[(0,d.jsx)("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Trusted by Creators"}),(0,d.jsx)("p",{className:"text-lg text-white/80",children:"Portfolio Host is the platform of choice for creative professionals"})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:a.map(a=>(0,d.jsxs)("div",{className:"text-center",children:[(0,d.jsx)("div",{className:"text-4xl md:text-5xl font-bold mb-2",children:a.value}),(0,d.jsx)("p",{className:"text-lg text-white/80",children:a.label})]},a.id))})]})})}},7742:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>l,metadata:()=>k});var d=c(5338),e=c(6829),f=c(6043),g=c(2943),h=c(9283),i=c(6286),j=c(110);let k={title:"Portfolio Host | Host Your Portfolio with Custom Domains",description:"Deploy and manage your portfolio websites with custom domains. Simple, fast, and professional hosting for creatives and developers.",keywords:"portfolio hosting, custom domain, web hosting, creative professionals",openGraph:{title:"Portfolio Host | Host Your Portfolio with Custom Domains",description:"Deploy and manage your portfolio websites with custom domains.",url:"https://portfoliohost.com",type:"website",images:[{url:"https://portfoliohost.com/og-image.png",width:1200,height:630,alt:"Portfolio Host"}]},twitter:{card:"summary_large_image",title:"Portfolio Host | Host Your Portfolio with Custom Domains",description:"Deploy and manage your portfolio websites with custom domains.",image:"https://portfoliohost.com/og-image.png"}};function l(){return(0,d.jsxs)("div",{className:"min-h-screen flex flex-col",children:[(0,d.jsx)(e.default,{}),(0,d.jsxs)("main",{className:"flex-1",children:[(0,d.jsx)(f.default,{}),(0,d.jsx)(g.default,{}),(0,d.jsx)(h.default,{}),(0,d.jsx)(i.default,{})]}),(0,d.jsx)(j.default,{}),(0,d.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify({"@context":"https://schema.org","@type":"SoftwareApplication",name:"Portfolio Host",description:"Deploy and manage your portfolio websites with custom domains",url:"https://portfoliohost.com",applicationCategory:"WebApplication",offers:{"@type":"Offer",price:"0",priceCurrency:"USD",description:"Free portfolio hosting"},aggregateRating:{"@type":"AggregateRating",ratingValue:"4.9",ratingCount:"1000"}})}})]})}},8354:a=>{"use strict";a.exports=require("util")},9121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9217:(a,b,c)=>{"use strict";c.d(b,{$:()=>i});var d=c(1124),e=c(8301),f=c(6691),g=c(5514);let h=(0,f.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 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 hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},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"}}),i=e.forwardRef(({className:a,variant:b,size:c,...e},f)=>(0,d.jsx)("button",{className:(0,g.cn)(h({variant:b,size:c,className:a})),ref:f,...e}));i.displayName="Button"},9283:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/sorti/projects/hosting-frontend/components/launch-ui/faq.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/sorti/projects/hosting-frontend/components/launch-ui/faq.tsx","default")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9710:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(3339).A)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},9902:a=>{"use strict";a.exports=require("path")},9953:(a,b,c)=>{"use strict";c.d(b,{AuthProvider:()=>i,c:()=>h});var d=c(1124),e=c(8301),f=c(2378),g=c(71);let h=(0,e.createContext)(void 0);function i({children:a}){let[b,c]=(0,e.useState)(null),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(!0),m=(0,f.useRouter)(),n=async a=>{try{let b=await g.u.post("/auth/login",a);if(b.success&&b.data){let{token:a,user:d}=b.data;localStorage.setItem("auth_token",a),j(a),c(d),m.push("/dashboard")}else throw Error(b.message||"Login failed")}catch(a){throw console.error("Login error:",a),a}},o=async a=>{try{let b=await g.u.post("/auth/register",a);if(b.success&&b.data){let{token:a,user:d}=b.data;localStorage.setItem("auth_token",a),j(a),c(d),m.push("/dashboard")}else throw Error(b.message||"Registration failed")}catch(a){throw console.error("Registration error:",a),a}};return(0,d.jsx)(h.Provider,{value:{user:b,token:i,isAuthenticated:!!i,isLoading:k,login:n,register:o,logout:()=>{localStorage.removeItem("auth_token"),j(null),c(null),m.push("/login")}},children:a})}}};var b=require("../webpack-runtime.js");b.C(a);var c=b.X(0,[248,445,991],()=>b(b.s=5919));module.exports=c})(); |