"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[705],{6999:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(1609),s=n(6942),i=n.n(s),l=n(148),o=n(7143),r=n(6427),c=n(7677),d=n(6655),u=n(7675);const m=({text:e,className:t,callback:n=null,disabled:s=!1,showChevronRight:m=!0})=>{const g=(0,l.Zp)(),{nextStep:h}=(0,o.useSelect)((e=>({nextStep:e(u.M).getNextStep()})));return(0,a.createElement)(r.Button,{className:i()("nfd-onboarding-button--site-gen-next",{"nfd-onboarding-button--site-gen-next--disabled":s},t),onClick:()=>{s||(n&&"function"==typeof n&&n(),h&&g(h.path))}},(0,a.createElement)("p",{className:"nfd-onboarding-button--site-gen-next--text"},e),m&&(0,a.createElement)(c.A,{className:"nfd-onboarding-button--site-gen-next--icon",icon:d.A}))}},513:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(1609),s=n(8468),i=n(7673);const l=(0,s.memo)((({title:e})=>(0,a.createElement)("div",{className:"ai-heading"},(0,a.createElement)(i.A,{height:"40px"}),(0,a.createElement)("div",{className:"ai-heading--title"},e))))},8705:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var a=n(1609),s=n(9491),i=n(7143),l=n(8468),o=n(1056),r=n(7723);var c=n(431),d=n(513),u=n(3988);const m=(0,l.memo)((({hint:e,height:t,children:n,placeholder:s,customerInput:i,setCustomerInput:o,setCustomerInputStrength:r,customChildren:c=!1})=>{const d=(0,l.useRef)(null),[u,m]=(0,l.useState)("nfd-sg-input-box__field");(0,l.useEffect)((()=>{d.current.style.height=t;const e=d.current.scrollHeight;d.current.style.height=e+"px";const n=g(i?.trim());r(n)}),[i]);const g=e=>{const t=e?.length;let n=0;return t>200?n=3:t>150?n=2:t>100&&(n=1),n};return(0,a.createElement)("div",{className:"nfd-sg-input"},(0,a.createElement)("label",{htmlFor:u},(0,a.createElement)("div",{className:"nfd-sg-input-box"},(0,a.createElement)("textarea",{"data-wnd-ai-logo":!0,type:"text",className:u,ref:d,style:{height:"47px"},placeholder:s,value:i,onChange:e=>(e=>{e.preventDefault(),o(e.target.value),m("nfd-sg-input-box__field")})(e)})),(0,a.createElement)("div",{className:"nfd-sg-input-box_bottom"},(0,a.createElement)("p",{className:"nfd-sg-input-box__hint"},e),c&&n)))}));var g=n(6999),h=n(1032),p=n(8969),b=n(7675),f=n(2202),v=n(8744);const w=()=>{const[e,t]=(0,l.useState)(""),[n,w]=(0,l.useState)(0),[x,E]=(0,l.useState)(!1),{currentData:N}=(0,i.useSelect)((e=>({currentData:e(b.M).getCurrentOnboardingData()}))),{setIsFooterNavAllowed:_,setIsHeaderEnabled:C,setSidebarActiveView:A,setHeaderActiveView:k,setDrawerActiveView:D,setHideFooterNav:I,setCurrentOnboardingData:S,setIsHeaderNavigationEnabled:T}=(0,i.useDispatch)(b.M),y=(0,s.useViewportMatch)("small");(0,l.useEffect)((()=>{if(I(!1),C(!0),A(!1),k(p.Ix),T(!0),D(!1),""!==N.sitegen.siteDetails?.prompt)return E(!0),_(!0),t(N.sitegen.siteDetails.prompt);_(!1)}),[]),(0,l.useEffect)((()=>{if(void 0!==e){const t=e.trim();""!==t?(t!==N.sitegen.siteDetails.prompt&&(N.sitegen.siteDetails.prompt=t,N.sitegen.siteDetails.mode="simple",N.sitegen.skipCache=!0,N.sitegen.sitemapPagesGenerated=!1,N.sitegen.homepages.active={},N.sitegen.homepages.data={},S(N)),E(!0),_(!0)):(E(!1),_(!1))}}),[e]);const H={heading:(0,r.__)("Tell me some details about the site you want created?","wp-module-onboarding"),inputPlaceholder:(0,r.__)("Bean There Café - A cozy, sustainable coffee shop in Asheville, North Carolina, focused on fair-trade coffee and local pastries. Their site will feature their menu, special events, and a blog on coffee culture.","wp-module-onboarding"),inputHint:(0,r.__)("The more detail the better","wp-module-onboarding"),buttonText:(0,r.__)("Next","wp-module-onboarding"),walkThroughText:(0,r.__)("Not sure what to say? We can walk you through it.","wp-module-onboarding"),walkThroughlink:(0,r.__)("click here","wp-module-onboarding")};return(0,a.createElement)(h.tR,null,(0,a.createElement)(u.A,{isCentered:!0},(0,a.createElement)(c.A,{type:"fade-in"},(0,a.createElement)("div",{className:"nfd-sg-site-details"},(0,a.createElement)(d.A,{title:H.heading}),(0,a.createElement)(m,{placeholder:H.inputPlaceholder,hint:H.inputHint,height:"40px",customerInput:e,setCustomerInput:t,setCustomerInputStrength:w,customChildren:!0},y&&(0,a.createElement)("div",{className:"nfd-sg-site-details-endrow"},(0,a.createElement)(g.A,{className:"nfd-sg-site-details--next-btn",callback:()=>{(()=>{let t=!1;switch(n){case 2:t="MEDIUM";break;case 3:t="HIGH"}t&&(0,o.v)(new o.iC(f.WN,e,{strength:t,source:v.d0}))})()},text:H.buttonText,disabled:!x})))))))}}}]);