PageSourceSearch

https://www.newsletterify.ai/_next/static/chunks/pages/onboarding-21d8bbfae52228ca.js

js newsletterify.ai collected 2026-10-05 12:40:52 UTC 10,844 bytes, 24 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7411],{34622:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/**
2 * @license lucide-react v0.367.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */let n=(0,r(45711).Z)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},45077:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/**
7 * @license lucide-react v0.367.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */let n=(0,r(45711).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},56953:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/**
12 * @license lucide-react v0.367.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */let n=(0,r(45711).Z)("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"}]])},88162:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/onboarding",function(){return r(67170)}])},69441:function(e,t,r){"use strict";r.d(t,{C:function(){return s}});var n=r(85893);r(67294);var a=r(12003),i=r(31071);let o=(0,a.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 dark:focus:ring-gray-300",{variants:{variant:{default:"border-transparent bg-gray-900 text-gray-50 hover:bg-gray-900/80 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/80",secondary:"border-transparent bg-gray-100 text-gray-900 hover:bg-gray-100/80 dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-800/80",destructive:"border-transparent bg-red-500 text-gray-50 hover:bg-red-500/80 dark:bg-red-900 dark:text-gray-50 dark:hover:bg-red-900/80",outline:"text-gray-950 dark:text-gray-50"}},defaultVariants:{variant:"default"}});function s(e){let{className:t,variant:r,...a}=e;return(0,n.jsx)("div",{className:(0,i.cn)(o({variant:r}),t),...a})}},67170:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return m},default:function(){return x}});var n=r(85893),a=r(67294),i=r(33299),o=r(11163),s=r(92818),l=r(8336),c=r(42896),d=r(3838),u=r(71549),h=r(55678),p=r(29092),y=r(13114);function f(e){let{onComplete:t}=e,{data:r}=(0,i.useSession)(),f=(0,o.useRouter)(),[m,x]=(0,a.useState)(1),[g,w]=(0,a.useState)(!1),[v,b]=(0,a.useState)({goal:"drive-signups",cadence:"weekly",layoutStyle:"modern"}),j=m/4*100,k=async e=>{e&&b(t=>({...t,...e})),m<4?(3===m&&(e?await C({...v,...e}):await C()),x(m+1)):await S()},N=()=>{m>1&&x(m-1)},E=e=>{b(t=>({...t,...e}))},C=async e=>{w(!0);try{let t={...e||v,completed:!0,completedAt:new Date().toISOString()};if(!(await fetch("/api/onboarding/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok)throw Error("Failed to save onboarding data");b(t)}catch(e){throw console.error("Onboarding save error:",e),h.Am.error("Something went wrong saving your data. Please try again."),e}finally{w(!1)}},S=async()=>{try{h.Am.success("Welcome to Newsletterify! Your newsletter is ready to go."),null==t||t(v),f.push("/dashboard")}catch(e){console.error("Onboarding completion error:",e),h.Am.error("Something went wrong. Please try again.")}},P=()=>{switch(m){case 1:return(0,n.jsx)(l.V,{data:v,onComplete:E,onNext:()=>k()});case 2:return(0,n.jsx)(c.$,{data:v,onComplete:E,onNext:()=>k(),onPrevious:N});case 3:return(0,n.jsx)(d.Q,{data:v,onComplete:e=>k(e),onNext:()=>{},onPrevious:N,isLoading:g});case 4:return(0,n.jsx)(u.z,{onboardingData:v,onComplete:S});default:return null}},O=4===m;return(0,n.jsx)(p.E.div,{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 flex items-center justify-center p-4 ".concat(O?"py-8":""),initial:{opacity:0}
16,animate:{opacity:1},transition:{duration:.5},children:(0,n.jsxs)("div",{className:"w-full mx-auto ".concat(O?"max-w-6xl":"max-w-2xl"),children:[(0,n.jsxs)(p.E.div,{className:"text-center mb-8",initial:{y:-20,opacity:0},animate:{y:0,opacity:1},transition:{duration:.6,delay:.1},children:[(0,n.jsx)(p.E.h1,{className:"text-3xl font-bold text-gray-900 mb-2",initial:{scale:.9},animate:{scale:1},transition:{duration:.5,delay:.2},children:"Welcome to Newsletterify"}),(0,n.jsx)(p.E.p,{className:"text-gray-600 mb-6",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5,delay:.3},children:"Let's create newsletters that grow your audience and achieve your goals."}),(0,n.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2 mb-4 overflow-hidden max-w-md mx-auto",children:(0,n.jsx)(p.E.div,{className:"bg-blue-600 h-2 rounded-full",initial:{width:0},animate:{width:"".concat(j,"%")},transition:{duration:.5,ease:"easeInOut"}})}),(0,n.jsxs)(p.E.p,{className:"text-sm text-gray-500",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3},children:["Step ",m," of ",4]},m)]}),(0,n.jsx)(p.E.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{duration:.6,delay:.2},children:O?(0,n.jsx)(y.M,{mode:"wait",children:(0,n.jsx)(p.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.4,ease:"easeInOut"},children:P()},m)}):(0,n.jsxs)(s.Zb,{className:"shadow-xl border-0 overflow-hidden",children:[(0,n.jsx)(s.Ol,{className:"text-center pb-4",children:(0,n.jsxs)(p.E.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.4},children:[(0,n.jsx)(s.ll,{className:"text-xl font-semibold",children:(()=>{switch(m){case 1:return"Let's get to know your brand";case 2:return"What's your newsletter goal?";case 3:return"Choose your style & cadence";case 4:return"Customize Your Newsletter";default:return""}})()}),(0,n.jsx)(s.SZ,{className:"text-base",children:(()=>{switch(m){case 1:return"Drop your work email or website so we can personalize your experience";case 2:return"Help us understand what you want to achieve with your newsletter";case 3:return"Pick a schedule and style that works for your audience";case 4:return"Edit, reorder, and customize your newsletter sections before going live";default:return""}})()})]},m)}),(0,n.jsx)(s.aY,{className:"px-8 pb-8",children:(0,n.jsx)(y.M,{mode:"wait",children:(0,n.jsx)(p.E.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{duration:.4,ease:"easeInOut"},children:P()},m)})})]})}),!O&&(0,n.jsx)(p.E.div,{className:"text-center mt-6",initial:{opacity:0}
16,animate:{opacity:1},transition:{duration:.5,delay:.5},children:(0,n.jsx)(p.E.button,{onClick:()=>f.push("/dashboard"),className:"text-sm text-gray-500 hover:text-gray-700 underline",whileHover:{scale:1.05},whileTap:{scale:.95},transition:{duration:.2},children:"Skip & type manually"})})]})})}r(84675);var m=!0;function x(e){let{session:t}=e;return(0,n.jsx)(i.SessionProvider,{session:t,children:(0,n.jsxs)("div",{className:"min-h-screen",children:[(0,n.jsx)(f,{onComplete:e=>{console.log("Onboarding completed with data:",e)}}),(0,n.jsx)(h.Ix,{position:"top-right",autoClose:5e3,hideProgressBar:!1,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0})]})})}},13114:function(e,t,r){"use strict";r.d(t,{M:function(){return g}});var n=r(85893),a=r(67294),i=r(25364),o=r(96681),s=r(58868),l=r(240),c=r(93243),d=r(16014);class u extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=t.offsetParent,r=(0,c.R)(e)&&e.offsetWidth||0,n=this.props.sizeRef.current;n.height=t.offsetHeight||0,n.width=t.offsetWidth||0,n.top=t.offsetTop,n.left=t.offsetLeft,n.right=r-n.width-n.left}return null}componentDidUpdate(){}render(){return this.props.children}}function h({children:e,isPresent:t,anchorX:r}){let i=(0,a.useId)(),o=(0,a.useRef)(null),s=(0,a.useRef)({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=(0,a.useContext)(d._);return(0,a.useInsertionEffect)(()=>{let{width:e,height:n,top:a,left:c,right:d}=s.current;if(t||!o.current||!e||!n)return;let u="left"===r?`left: ${c}`:`right: ${d}`;o.current.dataset.motionPopId=i;let h=document.createElement("style");return l&&(h.nonce=l),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
17          [data-motion-pop-id="${i}"] {
18            position: absolute !important;
19            width: ${e}px !important;
20            height: ${n}px !important;
21            ${u}px !important;
22            top: ${a}px !important;
23          }
24        `),()=>{document.head.contains(h)&&document.head.removeChild(h)}},[t]),(0,n.jsx)(u,{isPresent:t,childRef:o,sizeRef:s,children:a.cloneElement(e,{ref:o})})}let p=({children:e,initial:t,isPresent:r,onExitComplete:i,custom:s,presenceAffectsLayout:c,mode:d,anchorX:u})=>{let p=(0,o.h)(y),f=(0,a.useId)(),m=!0,x=(0,a.useMemo)(()=>(m=!1,{id:f,initial:t,isPresent:r,custom:s,onExitComplete:e=>{for(let t of(p.set(e,!0),p.values()))if(!t)return;i&&i()},register:e=>(p.set(e,!1),()=>p.delete(e))}),[r,p,i]);return c&&m&&(x={...x}),(0,a.useMemo)(()=>{p.forEach((e,t)=>p.set(t,!1))},[r]),a.useEffect(()=>{r||p.size||!i||i()},[r]),"popLayout"===d&&(e=(0,n.jsx)(h,{isPresent:r,anchorX:u,children:e})),(0,n.jsx)(l.O.Provider,{value:x,children:e})};function y(){return new Map}var f=r(15947);let m=e=>e.key||"";function x(e){let t=[];return a.Children.forEach(e,e=>{(0,a.isValidElement)(e)&&t.push(e)}),t}let g=({children:e,custom:t,initial:r=!0,onExitComplete:l,presenceAffectsLayout:c=!0,mode:d="sync",propagate:u=!1,anchorX:h="left"})=>{let[y,g]=(0,f.oO)(u),w=(0,a.useMemo)(()=>x(e),[e]),v=u&&!y?[]:w.map(m),b=(0,a.useRef)(!0),j=(0,a.useRef)(w),k=(0,o.h)(()=>new Map),[N,E]=(0,a.useState)(w),[C,S]=(0,a.useState)(w);(0,s.L)(()=>{b.current=!1,j.current=w;for(let e=0;e<C.length;e++){let t=m(C[e]);v.includes(t)?k.delete(t):!0!==k.get(t)&&k.set(t,!1)}},[C,v.length,v.join("-")]);let P=[];if(w!==N){let e=[...w];for(let t=0;t<C.length;t++){let r=C[t],n=m(r);v.includes(n)||(e.splice(t,0,r),P.push(r))}return"wait"===d&&P.length&&(e=P),S(x(e)),E(w),null}let{forceRender:O}=(0,a.useContext)(i.p);return(0,n.jsx)(n.Fragment,{children:C.map(e=>{let a=m(e),i=(!u||!!y)&&(w===C||v.includes(a));return(0,n.jsx)(p,{isPresent:i,initial:(!b.current||!!r)&&void 0,custom:t,presenceAffectsLayout:c,mode:d,onExitComplete:i?void 0:()=>{if(!k.has(a))return;k.set(a,!0);let e=!0;k.forEach(t=>{t||(e=!1)}),e&&(O?.(),S(j.current),u&&g?.(),l&&l())},anchorX:h,children:e},a)})})}}},function(e){e.O(0,[9092,7780,6478,2888,9774,179],function(){return e(e.s=88162)}),_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.