"use strict";(self.webpackChunknewfold_Onboarding=self.webpackChunknewfold_Onboarding||[]).push([[595],{1852:(e,a,s)=>{s.d(a,{A:()=>b});var t=s(1609),r=s(148),n=s(7143),i=s(7675),l=s(264),u=s(6079),c=s(8969),p=s(1056),o=s(2202),d=s(8559),m=s(6942),y=s.n(m),g=s(7677);const b=({text:e,disabled:a,className:s,icon:m})=>{const b=(0,r.Zp)(),{nextStep:f,currentData:T}=(0,n.useSelect)((e=>({nextStep:e(i.M).getNextStep(),currentData:e(i.M).getCurrentOnboardingData()})),[]),h=null===f||!1===f;return(0,t.createElement)(l.A,{className:y()("nfd-nav-card-button",s),handleClick:()=>h?async function(){T&&(T.isComplete=(new Date).getTime(),T.data.siteOverrideConsent=!1,(0,u.V1)(T)),(0,d.YR)(),(0,p.SV)(new p.iC(o.Vg)),window.location.replace(c.R0)}():b(f.path),disabled:a},(0,t.createElement)(t.Fragment,null,(0,t.createElement)("span",{className:`${s}__text`},e),m&&(0,t.createElement)(g.A,{className:`${s}__icon`,icon:m})))}},9595:(e,a,s)=>{s.r(a),s.d(a,{default:()=>T});var t=s(1609),r=s(3988),n=s(5842),i=s(8969),l=s(671),u=s(7675),c=s(7143),p=s(8468),o=s(9927),d=s(1852),m=s(9889),y=s(431),g=s(6094),b=s(1056),f=s(2202);const T=()=>{const{setDrawerActiveView:e,setIsDrawerSuppressed:a,setIsHeaderNavigationEnabled:s,setSidebarActiveView:T,setCurrentOnboardingData:h}=(0,c.useDispatch)(u.M),{currentData:v}=(0,c.useSelect)((e=>({currentData:e(u.M).getCurrentOnboardingData()})),[]);(0,p.useEffect)((()=>{T(i.Qe),a(!0),e(i.lf),s(!0),D()}),[]);const[w,_]=(0,p.useState)(!1),[E,C]=(0,p.useState)(),[A,N]=(0,p.useState)(""),[S,k]=(0,p.useState)(),x=(0,l.A)(),D=async()=>{var e;const a=await(0,g._)();if(C(a?.body),"string"==typeof v?.data?.siteType?.primary||"string"==typeof v?.data?.siteType?.secondary){const e=v?.data?.siteType?.primary,a=v?.data?.siteType?.secondary;v.data.siteType.primary={refers:"custom",value:e},v.data.siteType.secondary={refers:"custom",value:a},h(v)}N(null!==(e=v?.data?.siteType?.primary?.value)&&void 0!==e?e:""),"custom"===v?.data?.siteType?.primary?.refers&&I(v?.data?.siteType?.primary?.value)},O=e=>{_(!1),N(e),v.data.siteType.primary.refers="slug",v.data.siteType.primary.value=e,h(v),(0,b.v)(new b.iC(f.gH,e))},I=e=>{_(!0),v.data.siteType.primary.refers="custom",v.data.siteType.primary.value=e,h(v),""!==A&&A!==e&&(clearTimeout(S),k(setTimeout((()=>{(0,b.v)(new b.iC(f.gH,e))}),1e3))),N(e)};return(0,t.createElement)(r.A,{isBgPrimary:!0,isCentered:!0},(0,t.createElement)(n.A,null,(0,t.createElement)("div",{className:"nfd-card-heading center"},(0,t.createElement)(o.A,{heading:x.heading,subHeading:x.subheading,question:x.question})),(0,t.createElement)(y.A,{type:"fade-in-disabled",after:E},(0,t.createElement)("div",{className:"nfd-setup-primary-categories"},E&&(()=>{const e=E?.types;return Object.keys(e).map(((a,s)=>(0,t.createElement)("div",{key:e[a]?.slug,"data-slug":e[a]?.slug,tabIndex:s+1,role:"button",className:(e[a].slug!==A||w?"":"chosenPrimaryCategory ")+"nfd-card-pri-category",onClick:()=>O(e[a].slug),onKeyDown:()=>O(e[a].slug)},(0,t.createElement)("div",{className:"nfd-card-pri-category-wrapper"},(0,t.createElement)("span",{className:"nfd-card-pri-category-wrapper__icon "+(e[a].slug===A?"nfd-card-pri-category-wrapper__icon-selected ":""),style:{backgroundImage:`url(${e[a]?.icon})`}}),(0,t.createElement)("span",{className:"categName"},e[a]?.label)))))})()),(0,t.createElement)("div",{className:"nfd-setup-primary-custom"},(0,t.createElement)("p",{className:"nfd-setup-primary-custom__tellus-text"},x.customInputLabel),(0,t.createElement)("input",{type:"search",onChange:e=>I(e?.target?.value),className:"nfd-setup-primary-custom__tellus-input",placeholder:x.customInputPlaceholderText,value:w?A:""}))),(0,t.createElement)(d.A,{text:x.buttonText}),(0,t.createElement)(m.A,null)))}},671:(e,a,s)=>{s.d(a,{A:()=>n});var t=s(7723),r=s(3474);const n=()=>({heading:(0,t.sprintf)(/* translators: %s: website or store */ /* translators: %s: website or store */
(0,t.__)("Help us tailor this setup to your %s","wp-module-onboarding"),(0,r.P)("site")),subheading:(0,t.sprintf)(/* translators: %s: SITE or STORE */ /* translators: %s: SITE or STORE */
(0,t.__)("ABOUT YOUR %s","wp-module-onboarding"),(0,r.P)("SITE")),question:(0,t.sprintf)(/* translators: %s: site or store */ /* translators: %s: site or store */
(0,t.__)("What type of %s is it?","wp-module-onboarding"),(0,r.P)("site")),buttonText:(0,t.__)("Continue Setup","wp-module-onboarding"),customInputPlaceholderText:(0,t.sprintf)(/* translators: %s: site or store */ /* translators: %s: site or store */
(0,t.__)("Enter to search your %s type","wp-module-onboarding"),(0,r.P)("site")),customInputLabel:(0,t.__)("or tell us here:","wp-module-onboarding")})},6094:(e,a,s)=>{s.d(a,{_:()=>u});var t=s(5435),r=s(8674);const n=JSON.parse('{"body":{"types":{"business":{"slug":"business","label":"Business","icon":"https://cdn.hiive.space/site-classification/business.svg","emoji":"💼","schema":"Corporation","secondaryTypes":{"agency-consulting":{"primaryType":"business","slug":"agency-consulting","label":"Agency & Consulting"},"arts-crafts":{"primaryType":"business","slug":"arts-crafts","label":"Arts & Crafts"},"autos-repair":{"primaryType":"business","slug":"autos-repair","label":"Autos & Repair"},"child-care":{"primaryType":"business","slug":"child-care","label":"Child Care"},"events":{"primaryType":"business","slug":"events","label":"Events"},"finance":{"primaryType":"business","slug":"finance","label":"Finance"},"garden-florist":{"primaryType":"business","slug":"garden-florist","label":"Florist & Garden Center"},"hr-recruiting":{"primaryType":"business","slug":"hr-recruiting","label":"HR & Recruiting"},"insurance":{"primaryType":"business","slug":"insurance","label":"Insurance"},"legal":{"primaryType":"business","slug":"legal","label":"Legal"},"marketing":{"primaryType":"business","slug":"marketing","label":"Marketing"},"outdoors":{"primaryType":"business","slug":"outdoors","label":"Outdoors"},"pr-communications":{"primaryType":"business","slug":"pr-communications","label":"PR & Communications"},"real-estate-management":{"primaryType":"business","slug":"real-estate-management","label":"Real Estate & Management"},"shopping-retail":{"primaryType":"business","slug":"shopping-retail","label":"Shopping & Retail"},"trades-repair-services":{"primaryType":"business","slug":"trades-repair-services","label":"Trades & Repair Services"},"weddings":{"primaryType":"business","slug":"weddings","label":"Weddings"}}}}}}');var i=s(1455),l=s.n(i);async function u(){const e=await(0,t.h)(l()({url:(0,r.fG)("site-classification")}));return 0===e.body.length?n:e}}}]);