diff --git a/build/2.1.9/619.js b/build/2.1.9/619.js index d7ad61670..11ea1bdfb 100644 --- a/build/2.1.9/619.js +++ b/build/2.1.9/619.js @@ -1 +1 @@ -"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[619],{619:(e,t,n)=>{n.r(t),n.d(t,{default:()=>E});var a=n(1609),r=n(8468),i=n(7143),s=n(148),o=n(6087),d=n(7723);var l=n(7708),g=n(7517),c=n(1056),p=n(3988),m=n(7044);const u=()=>(0,a.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"24",viewBox:"-5 -2 36 24",fill:"none",className:"heart"},(0,a.createElement)("g",{id:"State=Active"},(0,a.createElement)("path",{id:"Vector",d:"M10 19.1585L8.975 18.2335C7.20833 16.6168 5.75 15.221 4.6 14.046C3.45 12.871 2.53333 11.821 1.85 10.896C1.16667 9.971 0.6875 9.1335 0.4125 8.3835C0.1375 7.6335 0 6.87516 0 6.1085C0 4.6085 0.504167 3.35433 1.5125 2.346C2.52083 1.33766 3.76667 0.833496 5.25 0.833496C6.2 0.833496 7.07917 1.0585 7.8875 1.5085C8.69583 1.9585 9.4 2.6085 10 3.4585C10.7 2.5585 11.4417 1.896 12.225 1.471C13.0083 1.046 13.85 0.833496 14.75 0.833496C16.2333 0.833496 17.4792 1.33766 18.4875 2.346C19.4958 3.35433 20 4.6085 20 6.1085C20 6.87516 19.8625 7.6335 19.5875 8.3835C19.3125 9.1335 18.8333 9.971 18.15 10.896C17.4667 11.821 16.55 12.871 15.4 14.046C14.25 15.221 12.7917 16.6168 11.025 18.2335L10 19.1585Z",fill:"#EF4A71"}))),_=function({count:e=1,isRegenerating:t}){const n=[];for(let r=0;r{const[e,t]=(0,r.useState)(!1),[n,E]=(0,r.useState)(!1),[C,S]=(0,r.useState)(!1),[N,k]=(0,r.useState)(!1),F=(0,s.Zp)(),D=(0,r.useRef)(),{currentData:G,nextStep:x,siteGenErrorStatus:I,themeStatus:R}=(0,i.useSelect)((e=>({currentData:e(f.M).getCurrentOnboardingData(),nextStep:e(f.M).getNextStep(),siteGenErrorStatus:e(f.M).getSiteGenErrorStatus(),themeStatus:e(f.M).getThemeStatus()}))),{setIsHeaderEnabled:A,setSidebarActiveView:O,setHeaderActiveView:M,setDrawerActiveView:H,setCurrentOnboardingData:T,updateInitialize:V,setHideFooterNav:B,updateSiteGenErrorStatus:Z,setIsHeaderNavigationEnabled:z}=(0,i.useDispatch)(f.M);(0,r.useEffect)((()=>{A(!0),B(!0),O(!1),M(y.Ix),H(!1),V(!0)}),[]),(0,r.useEffect)((()=>{!0===D.current&&!1===I&&(L(),W(),z(!1)),D.current=I}),[I]);const L=async()=>{if(S(!0),!(0,o.isEmpty)(G.sitegen.homepages.data))return t(G.sitegen.homepages.data),S(!1),void P();if(""===G.sitegen.siteDetails?.prompt)return void S(!1);const e=await(0,l.c7)(G.sitegen.siteDetails.prompt);if(e.error)return S(!1),void Z(!0);G.sitegen.homepages.data=e.body,t(e.body),T(G),S(!1),P()},P=()=>{window.nfdOnboarding.siteGenTimerInterval&&(clearInterval(window.nfdOnboarding.siteGenTimerInterval),(0,c.v)(new c.iC(b.uv,window.nfdOnboarding.siteGenTime,{source:h.d0})))},W=async()=>{const e=await(0,g.w6)();e.error?S(!1):k(e.body)};(0,r.useEffect)((()=>{y.Er===R&&(L(),W())}),[R]);const j=(t,n)=>{if(!(t in e))return!1;G.sitegen.homepages.active=e[t],G.sitegen.skipCache=!1,T(G),(0,c.v)(new c.iC(b.Wi,t,{position:n,source:h.d0})),F(x.path)},q=(n,a)=>{if(!(n in e))return;const r=!e[n].isFavorite;e[n].isFavorite=r,G.sitegen.homepages.data=e,t(e),T(G),(0,c.v)(new c.iC(b.Nz,n,{favorite:r,placement:"preview_grid",position:a,source:h.d0}))},U=async(n,a,r,i)=>{if(document.getElementsByClassName("nfd-onboarding-step--site-gen__preview__note")&&document.getElementsByClassName("nfd-onboarding-step--site-gen__preview__note")[0].scrollIntoView({behavior:"smooth",block:"end"}),E(!0),!(n in e))return void E(!1);if(""===G.sitegen.siteDetails?.prompt)return void E(!1);const s=await(0,l.HA)(G.sitegen.siteDetails.prompt,n,a,r);if(s.error)return void E(!1);const o=s.body;e[o.slug]=o,G.sitegen.homepages.data=e,t(e),T(G),E(!1),(0,c.v)(new c.iC(b.Hf,n,{position:i,source:h.d0,placement:"preview_grid"}))},X={heading:(0,d.__)("Presto, here are 3 versions","wp-module-onboarding"),subheading:(0,d.__)("We've created 3 unique website designs for you to start with, preview click around or start over.","wp-module-onboarding"),favouriteNote:(0,d.__)("Favorite a generated version to find and use again in the future.","wp-module-onboarding"),generating:(0,d.__)("Generating Site","wp-module-onboarding"),regenerating:(0,d.__)("Regenerating Site","wp-module-onboarding")};return(0,a.createElement)(w.UX,{render:!1},(0,a.createElement)(w.tR,null,(0,a.createElement)(p.A,{className:"nfd-onboarding-step--site-gen__preview"},(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__container"},!C&&(0,a.createElement)(v.A,{type:"fade-in"},(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__container__heading"},(0,a.createElement)("p",{className:"nfd-onboarding-step--site-gen__preview__container__heading__text"},X.heading)),(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__container__sub-heading"},(0,a.createElement)("p",{className:"nfd-onboarding-step--site-gen__preview__container__sub-heading__text"},X.subheading)))),(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__options"},e&&N&&!C?Object.keys(e).map(((t,r)=>{const i=e[t],s=(0,o.cloneDeep)(N[0]);s.settings.color.palette=i.color.palette;const d=i.styles?.blocks[0]?.["core/body"]?.typography?.fontFamily,l=i.styles?.blocks[0]?.["core/heading"]?.typography?.fontFamily;s.styles.typography&&d&&(s.styles.typography.fontFamily=d),s.styles.blocks["core/heading"].typography&&l&&(s.styles.blocks["core/heading"].typography.fontFamily=l);let g="";return["header","content","footer"].forEach((e=>{e in i&&(g+=i[e])})),(0,a.createElement)(m.GZ,{key:r,blockGrammar:g,previewSettings:s,slug:t,position:r+1,title:i.title,isFavorite:i.isFavorite,palette:i.color,styling:"custom",overlay:!0,tabIndex:"0",role:"button",handleFavorite:q,handleRegenerate:U,handlePreview:j,isRegenerating:n})})):(0,a.createElement)(_,{count:3,isRegenerating:!1}),n&&(0,a.createElement)(_,{count:1,isRegenerating:!0})),(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__note"},(0,a.createElement)(u,null),(0,a.createElement)("span",null,X.favouriteNote)))))}}}]); \ No newline at end of file +"use strict";(globalThis.webpackChunknewfold_Onboarding=globalThis.webpackChunknewfold_Onboarding||[]).push([[619],{619:(e,t,n)=>{n.r(t),n.d(t,{default:()=>E});var a=n(1609),r=n(8468),i=n(7143),s=n(148),o=n(6087),d=n(7723);var l=n(7708),g=n(7517),c=n(1056),p=n(3988),m=n(7044);const u=()=>(0,a.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"24",viewBox:"-5 -2 36 24",fill:"none",className:"heart"},(0,a.createElement)("g",{id:"State=Active"},(0,a.createElement)("path",{id:"Vector",d:"M10 19.1585L8.975 18.2335C7.20833 16.6168 5.75 15.221 4.6 14.046C3.45 12.871 2.53333 11.821 1.85 10.896C1.16667 9.971 0.6875 9.1335 0.4125 8.3835C0.1375 7.6335 0 6.87516 0 6.1085C0 4.6085 0.504167 3.35433 1.5125 2.346C2.52083 1.33766 3.76667 0.833496 5.25 0.833496C6.2 0.833496 7.07917 1.0585 7.8875 1.5085C8.69583 1.9585 9.4 2.6085 10 3.4585C10.7 2.5585 11.4417 1.896 12.225 1.471C13.0083 1.046 13.85 0.833496 14.75 0.833496C16.2333 0.833496 17.4792 1.33766 18.4875 2.346C19.4958 3.35433 20 4.6085 20 6.1085C20 6.87516 19.8625 7.6335 19.5875 8.3835C19.3125 9.1335 18.8333 9.971 18.15 10.896C17.4667 11.821 16.55 12.871 15.4 14.046C14.25 15.221 12.7917 16.6168 11.025 18.2335L10 19.1585Z",fill:"#EF4A71"}))),_=function({count:e=1,isRegenerating:t}){const n=[];for(let r=0;r{const[e,t]=(0,r.useState)(!1),[n,E]=(0,r.useState)(!1),[C,S]=(0,r.useState)(!1),[N,k]=(0,r.useState)(!1),F=(0,s.Zp)(),D=(0,r.useRef)(),{currentData:G,nextStep:x,siteGenErrorStatus:I,themeStatus:R}=(0,i.useSelect)((e=>({currentData:e(f.M).getCurrentOnboardingData(),nextStep:e(f.M).getNextStep(),siteGenErrorStatus:e(f.M).getSiteGenErrorStatus(),themeStatus:e(f.M).getThemeStatus()}))),{setIsHeaderEnabled:A,setSidebarActiveView:O,setHeaderActiveView:M,setDrawerActiveView:H,setCurrentOnboardingData:T,updateInitialize:V,setHideFooterNav:B,updateSiteGenErrorStatus:Z,setIsHeaderNavigationEnabled:z}=(0,i.useDispatch)(f.M);(0,r.useEffect)((()=>{A(!0),B(!0),O(!1),M(y.Ix),H(!1),V(!0),z(!1)}),[]),(0,r.useEffect)((()=>{!0===D.current&&!1===I&&(L(),W(),z(!1)),D.current=I}),[I]);const L=async()=>{if(S(!0),!(0,o.isEmpty)(G.sitegen.homepages.data))return t(G.sitegen.homepages.data),S(!1),void P();if(""===G.sitegen.siteDetails?.prompt)return void S(!1);const e=await(0,l.c7)(G.sitegen.siteDetails.prompt);if(e.error)return S(!1),void Z(!0);G.sitegen.homepages.data=e.body,t(e.body),T(G),S(!1),P()},P=()=>{window.nfdOnboarding.siteGenTimerInterval&&(clearInterval(window.nfdOnboarding.siteGenTimerInterval),(0,c.v)(new c.iC(b.uv,window.nfdOnboarding.siteGenTime,{source:h.d0})))},W=async()=>{const e=await(0,g.w6)();e.error?S(!1):k(e.body)};(0,r.useEffect)((()=>{y.Er===R&&(L(),W())}),[R]);const j=(t,n)=>{if(!(t in e))return!1;G.sitegen.homepages.active=e[t],G.sitegen.skipCache=!1,T(G),(0,c.v)(new c.iC(b.Wi,t,{position:n,source:h.d0})),F(x.path)},q=(n,a)=>{if(!(n in e))return;const r=!e[n].isFavorite;e[n].isFavorite=r,G.sitegen.homepages.data=e,t(e),T(G),(0,c.v)(new c.iC(b.Nz,n,{favorite:r,placement:"preview_grid",position:a,source:h.d0}))},U=async(n,a,r,i)=>{if(document.getElementsByClassName("nfd-onboarding-step--site-gen__preview__note")&&document.getElementsByClassName("nfd-onboarding-step--site-gen__preview__note")[0].scrollIntoView({behavior:"smooth",block:"end"}),E(!0),!(n in e))return void E(!1);if(""===G.sitegen.siteDetails?.prompt)return void E(!1);const s=await(0,l.HA)(G.sitegen.siteDetails.prompt,n,a,r);if(s.error)return void E(!1);const o=s.body;e[o.slug]=o,G.sitegen.homepages.data=e,t(e),T(G),E(!1),(0,c.v)(new c.iC(b.Hf,n,{position:i,source:h.d0,placement:"preview_grid"}))},X={heading:(0,d.__)("Presto, here are 3 versions","wp-module-onboarding"),subheading:(0,d.__)("We've created 3 unique website designs for you to start with, preview click around or start over.","wp-module-onboarding"),favouriteNote:(0,d.__)("Favorite a generated version to find and use again in the future.","wp-module-onboarding"),generating:(0,d.__)("Generating Site","wp-module-onboarding"),regenerating:(0,d.__)("Regenerating Site","wp-module-onboarding")};return(0,a.createElement)(w.UX,{render:!1},(0,a.createElement)(w.tR,null,(0,a.createElement)(p.A,{className:"nfd-onboarding-step--site-gen__preview"},(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__container"},!C&&(0,a.createElement)(v.A,{type:"fade-in"},(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__container__heading"},(0,a.createElement)("p",{className:"nfd-onboarding-step--site-gen__preview__container__heading__text"},X.heading)),(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__container__sub-heading"},(0,a.createElement)("p",{className:"nfd-onboarding-step--site-gen__preview__container__sub-heading__text"},X.subheading)))),(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__options"},e&&N&&!C?Object.keys(e).map(((t,r)=>{const i=e[t],s=(0,o.cloneDeep)(N[0]);s.settings.color.palette=i.color.palette;const d=i.styles?.blocks[0]?.["core/body"]?.typography?.fontFamily,l=i.styles?.blocks[0]?.["core/heading"]?.typography?.fontFamily;s.styles.typography&&d&&(s.styles.typography.fontFamily=d),s.styles.blocks["core/heading"].typography&&l&&(s.styles.blocks["core/heading"].typography.fontFamily=l);let g="";return["header","content","footer"].forEach((e=>{e in i&&(g+=i[e])})),(0,a.createElement)(m.GZ,{key:r,blockGrammar:g,previewSettings:s,slug:t,position:r+1,title:i.title,isFavorite:i.isFavorite,palette:i.color,styling:"custom",overlay:!0,tabIndex:"0",role:"button",handleFavorite:q,handleRegenerate:U,handlePreview:j,isRegenerating:n})})):(0,a.createElement)(_,{count:3,isRegenerating:!1}),n&&(0,a.createElement)(_,{count:1,isRegenerating:!0})),(0,a.createElement)("div",{className:"nfd-onboarding-step--site-gen__preview__note"},(0,a.createElement)(u,null),(0,a.createElement)("span",null,X.favouriteNote)))))}}}]); \ No newline at end of file