View file File name : 287.js Content :"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[287],{5287:(e,t,a)=>{a.r(t),a.d(t,{default:()=>N});var n=a(1609),s=a(7143),i=a(8468),r=a(7723);var l=a(1056),o=a(3988),d=a(6942),c=a.n(d),_=a(7677),g=a(6655);const u=(0,i.memo)((({idx:e,title:t,desc:a,isSelected:s,callback:i})=>(0,n.createElement)("div",{key:e,role:"button",tabIndex:0,className:"nfd__option_heading_subheading",onClick:()=>{i&&"function"==typeof i&&i(e+1)},onKeyDown:()=>{i&&"function"==typeof i&&i(e+1)}},(0,n.createElement)("div",{className:c()("nfd__option_heading_subheading__wrapper",s&&"nfd__option_heading_subheading__wrapper--selected")},(0,n.createElement)("div",{className:"nfd__option_heading_subheading__left"},(0,n.createElement)("div",{className:"nfd__option_heading_subheading__left_top"},t),(0,n.createElement)("div",{className:"nfd__option_heading_subheading__left_bottom"},a)),(0,n.createElement)(_.A,{className:"nfd__option_heading_subheading__right",icon:g.A}))))),m=(0,i.memo)((({title:e,options:t,selection:a,callback:s})=>(0,n.createElement)("div",{className:"nfd-sg-card"},(0,n.createElement)("div",{className:"nfd-sg-card__title"},e),(0,n.createElement)("div",{className:"nfd-sg-card__data"},t.map(((e,t)=>(0,n.createElement)(u,{key:t,idx:t,title:e.title,desc:e.desc,isSelected:e.key===a,callback:s})))))));var p=a(148),b=a(7675);const f=(0,i.memo)((({customNavPercentage:e,watcher:t=null})=>{let a=0;const l={title:(0,r.__)("Building Website","wp-module-onboarding"),status:[{title:(0,r.__)("Generating Website","wp-module-onboarding")},{title:(0,r.__)("Finding Font Pairings","wp-module-onboarding")},{title:(0,r.__)("Building Custom Color Palettes","wp-module-onboarding")},{title:(0,r.__)("Populating Images","wp-module-onboarding")},{title:(0,r.__)("Finalizing Previews","wp-module-onboarding")},{title:(0,r.__)("Packaging Website","wp-module-onboarding")}]},o=(0,p.Zp)(),[d,c]=(0,i.useState)(0),[_,g]=(0,i.useState)(l.status[a].title),{currentData:u,nextStep:m,isGeneratingHomepages:f}=(0,s.useSelect)((e=>({currentData:e(b.M).getCurrentOnboardingData(),nextStep:e(b.M).getNextStep(),isGeneratingHomepages:e(b.M).isGeneratingHomepages()})));return(0,i.useEffect)((()=>{const e=setInterval((()=>{a+=1,a===l.status.length&&(a=0),g(l.status[a].title)}),3e3);return()=>{clearInterval(e)}}),[]),(0,i.useEffect)((()=>{c(u?.sitegen?.siteGenMetaStatus?.currentStatus/u?.sitegen?.siteGenMetaStatus?.totalCount*100)}),[u?.sitegen?.siteGenMetaStatus?.currentStatus]),(0,i.useEffect)((()=>{if(d===e&&!f&&m){if(null!==t&&!1===t)return;o(m.path)}}),[d,t,f]),(0,n.createElement)("div",{className:"nfd-sg-loader"},(0,n.createElement)("div",{className:"nfd-sg-loader__title"},l.title),(0,n.createElement)("div",{className:"nfd-sg-loader__progress"},(0,n.createElement)("div",{className:"nfd-sg-loader__progress_bars"},(0,n.createElement)("div",{className:"nfd-sg-loader__progress_bars_bg"}),(0,n.createElement)("div",{className:"nfd-sg-loader__progress_bars_bar",style:{width:`${d}%`}}))),(0,n.createElement)("div",{className:"nfd-sg-loader__status"},`${_}...`))}));var v=a(1032),w=a(8969),E=a(2202),h=a(8744);const N=()=>{const[e,t]=(0,i.useState)(0),{currentData:a,siteGenErrorStatus:d}=(0,s.useSelect)((e=>({currentData:e(b.M).getCurrentOnboardingData(),siteGenErrorStatus:e(b.M).getSiteGenErrorStatus()}))),{setIsHeaderEnabled:c,setSidebarActiveView:_,setHeaderActiveView:g,setDrawerActiveView:u,setHideFooterNav:p,setCurrentOnboardingData:N,setIsHeaderNavigationEnabled:S}=(0,s.useDispatch)(b.M);(0,i.useEffect)((()=>{p(!0),c(!0),_(!1),S(!1),g(w.Ix),u(!1)}),[]),(0,i.useEffect)((()=>{!0!==d&&a.sitegen.experience?.level&&t(a.sitegen.experience.level)}),[d]);const k={heading:(0,r.__)("How familiar are you with using WordPress?","wp-module-onboarding"),options:[{key:1,title:(0,r.__)("Beginner","wp-module-onboarding"),desc:(0,r.__)("First time building a website using WordPress","wp-module-onboarding")},{key:2,title:(0,r.__)("Intermediate","wp-module-onboarding"),desc:(0,r.__)("I’ve built a few sites for myself or others","wp-module-onboarding")},{key:3,title:(0,r.__)("Expert","wp-module-onboarding"),desc:(0,r.__)("I do this frequently","wp-module-onboarding")}]};return(0,n.createElement)(v.tR,null,(0,n.createElement)(o.A,{isCentered:!0},(0,n.createElement)("div",{className:"nfd-sg-experience-level"},(0,n.createElement)(f,{watcher:0!==e,customNavPercentage:100}),(0,n.createElement)(m,{title:k.heading,options:k.options,selection:e,callback:e=>{t(e),a.sitegen.experience.level=e,N(a);let n=!1;switch(e){case 1:n="novice";break;case 2:n="intermediate";break;case 3:n="expert"}n&&(0,l.v)(new l.iC(E.k2,n,{source:h.d0}))}}))))}}}]);