PageSourceSearch

https://cdn.holded.com/frontend-next-gen/auth-components-survey-WelcomeSurveyWidget.A-K3kUJK.js

js holded.com collected 2026-09-24 09:12:53 UTC 29,649 bytes, 1 lines download raw bytes

1import{o as e,r as t}from"./rolldown-runtime.DAXXjFlN.js";import{o as n}from"./vendor-@mui-material-material-colors-createSimplePaletteValueFilter.Ph9BMT50.js";import{nn as r}from"./vendor-datadog.CbXwTgUc.js";import{t as i}from"./vendor-react-react-cjs-jsx-runtime.BfiOPkxk.js";import{i as a,t as o}from"./app-theme-dsm-Icon.XXxHe72V.js";import{n as s,t as c}from"./[email protected]";import{s as l}from"./app-hooks-useBoolean-LocalizationProvider.BXNw5IM4.js";import{t as u}from"./[email protected]";import{n as d,t as f}from"./vendor-@mui-utils-utils-isHostComponent-buttonClasses.jrPuKtOV.js";import{E as p,c as m,g as h,l as g,r as ee,x as _}from"./app-components-DialogTitle-DialogTitle.w2XCJGpC.js";import{t as v}from"./[email protected]";import{Gt as te,Lt as ne,yr as re}from"./account-application-demo-checkout.oilVSmvE.js";import{An as y,Cn as ie,Dn as ae,On as b,wn as oe}from"./platform-components-checkout-i18next.config.DIPKfKrc.js";import{Cd as se}from"./vendor-fortawesome.4BqgzknP.js";import{t as x}from"./vendor-void-elements-node_modules-void-elements-Trans.CPh5Egtt.js";import{t as S}from"./vendor-react-i18next-dist-es-useTranslation.py8bq3XP.js";import{r as ce}from"./platform-platform-infrastructure-useGlobalData.CUvVDtPq.js";import{L as le,n as ue}from"./auth-auth-domain-ui.D7gfI4Ti.js";import{A as de,C as fe,D as C,E as pe,F as me,I as he,L as ge,M as _e,N as ve,O as w,P as T,S as ye,T as be,_ as xe,a as Se,b as Ce,d as we,f as Te,g as E,h as D,i as Ee,j as O,k,m as A,n as De,o as Oe,p as ke,r as Ae,s as je,t as j,u as Me,v as M,w as Ne,x as Pe,y as N}from"./auth-auth-domain-Switch.DQ3RgktX.js";import{t as P}from"./app-shared-types-email.BxvASX7V.js";import{n as Fe}from"./auth-components-accounts-AccountCreationButtons.6ovoKQmn.js";import{t as F}from"./app-assets-brand-holded-logo-horizontal.CMCqc_WB.js";import{i as Ie,r as Le}from"./auth-shared-events-signup-events.DqLpZFlT.js";var I=e(r()),L=i(),Re=({step:e,type:t,formData:n})=>{let{t:r}=S(`auth`),i=(()=>{try{return T({type:t,step:e,formData:n})}catch{return null}})();if(i===null)return null;let o=ge({type:t,formData:n});return o<=0?null:(0,L.jsxs)(c,{direction:`row`,sx:{alignItems:`center`,width:`100%`},children:[(0,L.jsx)(F,{style:{height:22,flexShrink:0}}),(0,L.jsx)(c,{direction:`row`,spacing:.5,sx:{alignItems:`center`,ml:3},children:Array.from({length:o},(e,t)=>{let n=t===i-1,r=t<i-1;return(0,L.jsx)(a,{sx:{width:n?20:7,height:7,borderRadius:4,bgcolor:r||n?`grey.900`:`grey.200`,transition:`all 0.3s ease`}},`dot-${t}`)})}),(0,L.jsx)(a,{sx:{flex:1}}),(0,L.jsx)(s,{sx:({palette:e})=>({fontSize:`0.625rem`,fontWeight:700,color:e.text.secondary,whiteSpace:`nowrap`,flexShrink:0}),children:r(e=>e[`welcomesurvey.step`],{current:i,total:o})})]})},R=({isActive:e,icon:t,iconBg:n,value:r,children:i,subtitle:o,dense:l=!1,onHoverStart:u,onHoverEnd:d,onSelection:f})=>{let p=l?32:38;return(0,L.jsxs)(Ce,{"aria-pressed":e,className:e?`active`:``,component:`button`,direction:`row`,tabIndex:0,type:`button`,sx:({palette:e})=>({alignItems:`center`,...l&&{py:.75,minHeight:40,gap:1.25},"&:hover":{backgroundColor:e.gray[100],borderColor:e.gray[400]},"&.active":{backgroundColor:e.gray[100],borderColor:e.gray[900]},"&.active:hover":{backgroundColor:e.gray[100],borderColor:e.gray[900]},"& .MuiTypography-root.survey-title":{fontWeight:600},"&.active .MuiTypography-root.survey-title":{color:e.gray[800],fontWeight:600},"& .MuiTypography-root.survey-subtitle":{color:e.text.secondary,fontWeight:400},"&.active .MuiTypography-root.survey-subtitle":{color:e.text.secondary,fontWeight:400}}),onClick:()=>f(r),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),f(r))},onMouseEnter:u,onMouseLeave:d,children:[(0,L.jsx)(a,{sx:{width:p,height:p,minWidth:p,borderRadius:1.5,bgcolor:n??`grey.100`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,L.jsx)(xe,{icon:t,size:l?18:21})}),(0,L.jsxs)(c,{sx:{flex:1,minWidth:0,gap:.25},children:[(0,L.jsx)(s,{className:`survey-title`,sx:{fontWeight:600,fontSize:`0.875rem`},children:i}),o&&(0,L.jsx)(s,{className:`survey-subtitle`,sx:{fontSize:`0.75rem`,lineHeight:1.3},children:o})]}),(0,L.jsx)(a,{sx:({palette:t})=>({width:18,height:18,minWidth:18,borderRadius:`50%`,border:`1.5px solid ${e?t.gray[900]:t.grey[300]}`,bgcolor:e?t.gray[900]:`transparent`,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`}),children:e&&(0,L.jsx)(a,{sx:({palette:e})=>({width:6,height:6,borderRadius:`50%`,bgcolor:e.common.white})})})]})},z=e=>e<2?{display:`flex`,flexDirection:`row`,flexWrap:`wrap`,gap:.75}:e>=4?{display:`grid`,gridTemplateColumns:{xs:`1fr`,sm:`repeat(2, 1fr)`},gap:.75}:{display:`flex`,flexDirection:`column`,gap:.75},B={retails:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.businessType.retails`],ns:`auth`}),services:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.businessType.services`],ns:`auth`}),both:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.businessType.both`],ns:`auth`})},ze=({options:e,onSelection:t,onHover:n})=>{let{getValues:r}=b(),i=r(`businessType`);return(0,L.jsx)(a,{sx:z(e.length),children:e.map(([e])=>
1(0,L.jsx)(R,{icon:D(C.BusinessType,e),isActive:e===i,value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:t,children:B[e]},`option_${e}`))})},V=({field:e,descriptionField:t,value:n,icon:r,iconBg:i,placeholder:o,children:s,onSelection:c,onHoverStart:l,onHoverEnd:u})=>{let{control:d,watch:f,setValue:p}=b(),m=f(e)===n;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(R,{icon:r,iconBg:i,isActive:m,value:n,onHoverEnd:u,onHoverStart:l,onSelection:()=>p(e,n),children:s}),m&&(0,L.jsx)(a,{sx:{width:`100%`,mt:.5,"& .MuiOutlinedInput-root":{fontSize:`0.875rem`,borderRadius:2}},children:(0,L.jsx)(ie,{control:d,name:t,render:({field:e})=>(0,L.jsx)(N,{...e,autoFocus:!0,fullWidth:!0,placeholder:o,onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),typeof e.value==`string`&&e.value.trim()&&c(n))}})})})]})},H={taxaccounting:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.businessType_ao.taxaccounting`],ns:`auth`}),labor:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.businessType_ao.labor`],ns:`auth`}),otherservices:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.businessType_ao.otherservices`],ns:`auth`})},Be=({options:e,onSelection:t,onHover:n})=>{let{t:r}=S(`auth`),i=y({name:`businessType_ao`});return(0,L.jsx)(a,{sx:z(e.length),children:e.map(([e])=>e===`otherservices`?(0,L.jsx)(V,{descriptionField:`businessType_aoOther`,field:`businessType_ao`,icon:D(C.BusinessTypeAo,e),iconBg:A(C.BusinessTypeAo,e),placeholder:r(e=>e[`welcome_survey.businessType_ao.otherservices_placeholder`]),value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:t,children:H[e]},`option_${e}`):(0,L.jsx)(R,{icon:D(C.BusinessTypeAo,e),iconBg:A(C.BusinessTypeAo,e),isActive:e===i,value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:t,children:H[e]},`option_${e}`))})},U={lt50:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.clientsCount_ao.lt50`],ns:`auth`}),from50to100:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.clientsCount_ao.from50to100`],ns:`auth`}),from100to250:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.clientsCount_ao.from100to250`],ns:`auth`}),gt250:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.clientsCount_ao.gt250`],ns:`auth`})},Ve=({options:e,onSelection:t,onHover:n})=>{let{getValues:r}=b(),i=r(`clientsCount_ao`);return(0,L.jsx)(a,{sx:{display:`flex`,flexDirection:`column`,gap:.75},children:e.map(([e])=>(0,L.jsx)(R,{icon:D(C.ClientsCountAo,e),iconBg:A(C.ClientsCountAo,e),isActive:e===i,value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:t,children:U[e]},`option_${e}`))})},He={spreadsheet:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.spreadsheet`],ns:`auth`}),penpaper:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.penpaper`],ns:`auth`}),desktopsoftware:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.desktopsoftware`],ns:`auth`}),cloudsoftware:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.cloudsoftware`],ns:`auth`}),nothing:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.nothing`],ns:`auth`})},W={cloudsoftware:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.cloudsoftware_subtitle`],ns:`auth`}),spreadsheet:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.spreadsheet_subtitle`],ns:`auth`}),desktopsoftware:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.desktopsoftware_subtitle`],ns:`auth`}),penpaper:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.penpaper_subtitle`],ns:`auth`}),nothing:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool.nothing_subtitle`],ns:`auth`})},Ue=({options:e,onSelection:t,onHover:n})=>{let{getValues:r}=b(),i=r(`currentTool`);return(0,L.jsx)(a,{sx:{display:`flex`,flexDirection:`column`,gap:.75},children:e.map(([e])=>(0,L.jsx)(R,{icon:D(C.CurrentTool,e),iconBg:A(C.CurrentTool,e),isActive:e===i,subtitle:W[e],value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:t,children:He[e]},`option_${e}`))})},G={a3:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool_ao.a3`],ns:`auth`}),odoo:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool_ao.odoo`],ns:`auth`}),sage:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool_ao.sage`],ns:`auth`}),othertool:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.currentTool_ao.othertool`],ns:`auth`})},We=({options:e,onSelection:t})=>{let{t:n}=S(`auth`),r=y({name:`currentTool_ao`});return(0,L.jsx)(a,{sx:{display:`flex`,flexDirection:`column`,gap:.75},children:e.map(([e])=>e===`othertool`?(0,L.jsx)(V,{descriptionField:`currentTool_aoOther`,field:`currentTool_ao`,icon:D(C.CurrentToolAo,e),iconBg:A(C.CurrentToolAo,e),placeholder:n(e=>e[`welcome_survey.currentTool_ao.othertool_placeholder`]),value:e,onSelection:t,children:G[e]},`option_${e}`):(0,L.jsx)(R,{icon:D(C.CurrentToolAo,e),iconBg:A(C.CurrentToolAo,e),isActive:e===r,value:e,onSelection:t,children:G[e]},`option_${e}`))})},Ge={self:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.forWho_ao.self`],ns:`auth`}),clients:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.forWho_ao.clients`],ns:`auth`}),both:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.forWho_ao.both`],ns:`auth`})},K={self:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.forWho_ao.self_subtitle`],ns:`auth`}),clients:(0,L.jsx)(x,{components:M,i18nKey:e=>
1e[`welcome_survey.forWho_ao.clients_subtitle`],ns:`auth`}),both:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.forWho_ao.both_subtitle`],ns:`auth`})},Ke=({options:e,onSelection:t,onHover:n})=>{let{getValues:r}=b(),i=r(`forWho_ao`);return(0,L.jsx)(a,{sx:z(e.length),children:e.map(([e])=>(0,L.jsx)(a,{sx:{display:`flex`},onMouseEnter:()=>n?.(e),onMouseLeave:()=>n?.(null),children:(0,L.jsx)(R,{icon:D(C.ForWhoAo,e),iconBg:A(C.ForWhoAo,e),isActive:e===i,subtitle:K[e],value:e,onSelection:t,children:Ge[e]})},`option_${e}`))})},q=({isActive:e,icon:t,iconBg:n,value:r,children:i,question:o,dense:s=!1,onHoverStart:c,onHoverEnd:l,onSelection:u})=>{let{t:d}=S(`auth`),{setValue:f,control:p,watch:m,clearErrors:h,setError:g}=b(),ee=m(`howwemet`),_=m(`howwemetOtherDescription`),v=ee===`others`;return(0,I.useEffect)(()=>{let e=v&&!_;h(`howwemetOtherDescription`),e&&g(`howwemetOtherDescription`,{type:`required`})},[h,_,v,g]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(R,{dense:s,icon:t,iconBg:n,isActive:e||v,value:r,onHoverEnd:l,onHoverStart:c,onSelection:v?()=>{}:()=>{f(o,r)},children:i}),v&&(0,L.jsx)(a,{sx:{flexBasis:`100%`,height:0}}),v&&(0,L.jsx)(a,{sx:{width:`100%`,maxWidth:{xs:`100%`,sm:480},"& .MuiOutlinedInput-root":{fontSize:`0.875rem`,borderRadius:2,alignItems:`flex-start`}},children:(0,L.jsx)(ie,{control:p,name:`howwemetOtherDescription`,render:({field:e})=>(0,L.jsx)(N,{...e,autoFocus:!0,fullWidth:!0,placeholder:d(e=>e[`welcomesurvey.howwemet.others.description`]),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_.trim()&&u(r))}})})})]})},J={clientportal:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.clientportal`],ns:`auth`}),recommendation:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.recommendation`],ns:`auth`}),socialmedia:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.socialmedia`],ns:`auth`}),othersite:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.othersite`],ns:`auth`}),newuser:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.newuser`],ns:`auth`}),google:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.google`],ns:`auth`}),youtube:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.youtube`],ns:`auth`}),accountant:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.accountant`],ns:`auth`}),offline:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.offline`],ns:`auth`}),streetadvertising:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.streetadvertising`],ns:`auth`}),linkedin:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.linkedin`],ns:`auth`}),others:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.others`],ns:`auth`}),tiktok:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.tiktok`],ns:`auth`}),radio:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.radio`],ns:`auth`}),ai:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.ai`],ns:`auth`}),amazon:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.howwemet.amazon`],ns:`auth`})},qe=({options:e,onSelection:t,onHover:n})=>{let{setValue:r,getValues:i}=b(),o=i(`howwemet`),s=e=>{t(e),i(`howwemet`)!==`others`&&r(`howwemetOtherDescription`,``)};return(0,L.jsx)(a,{sx:z(e.length),children:e.map(([e])=>e===`others`?(0,L.jsx)(q,{dense:!0,icon:D(C.HowWeMet,e),iconBg:A(C.HowWeMet,e),isActive:e===o,question:C.HowWeMet,value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:s,children:J[e]},`option_${e}`):(0,L.jsx)(R,{dense:!0,icon:D(C.HowWeMet,e),iconBg:A(C.HowWeMet,e),isActive:e===o,value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:s,children:J[e]},`option_${e}`))})},Y=5,Je=()=>{let{t:e}=S(`auth`),{setValue:t,clearErrors:n,getValues:r}=b(),[i,l]=(0,I.useState)(()=>{let e=r(`inviteTeamEmails`);return e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[]}),[d,f]=(0,I.useState)(``),[p,m]=(0,I.useState)(``),h=r=>{let a=r.trim();if(!a){m(``);return}if(!P(a)){m(e(e=>e[`welcomesurvey.inviteTeam.invalidEmail`]));return}let o=a.toLowerCase();if(i.some(e=>e.toLowerCase()===o)){m(e(e=>e[`welcomesurvey.inviteTeam.duplicateEmail`]));return}if(i.length>=Y){m(e(e=>e[`welcomesurvey.inviteTeam.maxReached`]));return}let s=[...i,a];l(s),t(`inviteTeamEmails`,s.join(`, `)),n(`inviteTeamEmails`),f(``),m(``)}
1,g=e=>{let n=i.filter(t=>t!==e);l(n),t(`inviteTeamEmails`,n.join(`, `)),m(``)};return(0,L.jsx)(c,{sx:{gap:3},children:(0,L.jsxs)(c,{sx:{gap:1},children:[(0,L.jsxs)(a,{sx:({palette:e})=>({position:`relative`,border:`1px solid`,borderColor:p?e.error.main:e.grey[300],borderRadius:2,padding:1,minHeight:100,"&:focus-within":{borderColor:p?e.error.main:e.gray[900],borderWidth:`2px`,padding:`calc(8px - 1px)`}}),children:[(0,L.jsx)(c,{direction:`row`,sx:{flexWrap:`wrap`,gap:.5,mb:+(i.length>0)},children:i.map(e=>(0,L.jsxs)(a,{component:`span`,sx:({palette:e,spacing:t})=>({display:`inline-flex`,alignItems:`center`,gap:t(.5),border:`1px solid`,borderColor:e.gray[900],backgroundColor:e.gray[100],color:e.gray[900],fontSize:`0.875rem`,fontWeight:600,height:28,borderRadius:t(1.5),px:1}),children:[e,(0,L.jsx)(v,{size:`small`,sx:{padding:0,width:16,height:16,color:`inherit`},onClick:()=>g(e),children:(0,L.jsx)(o,{sx:{fontSize:12},variant:se})})]},e))}),(0,L.jsx)(u,{fullWidth:!0,disabled:i.length>=Y,value:d,variant:`standard`,placeholder:i.length>=Y?e(e=>e[`welcomesurvey.inviteTeam.maxReached`]):e(e=>e[`welcomesurvey.inviteTeam.placeholder`]),slotProps:{input:{disableUnderline:!0,sx:{fontSize:`0.875rem`,padding:0}}},onBlur:()=>{d.trim()&&h(d)},onChange:e=>{f(e.target.value),m(``)},onKeyDown:e=>{if(e.key===`Enter`||e.key===`,`)e.preventDefault(),h(d);else if(e.key===`Backspace`&&d===``&&i.length>0){e.preventDefault();let n=i.slice(0,-1);l(n),t(`inviteTeamEmails`,n.join(`, `))}},onPaste:r=>{r.preventDefault();let{toAdd:a,firstError:o}=r.clipboardData.getData(`text`).split(/[,\s]+/).map(e=>e.trim()).filter(Boolean).reduce(({toAdd:t,firstError:n},r)=>P(r)?[...i,...t].some(e=>e.toLowerCase()===r.toLowerCase())?{toAdd:t,firstError:n||e(e=>e[`welcomesurvey.inviteTeam.duplicateEmail`])}:i.length+t.length>=Y?{toAdd:t,firstError:n||e(e=>e[`welcomesurvey.inviteTeam.maxReached`])}:{toAdd:[...t,r],firstError:n}:{toAdd:t,firstError:n||e(e=>e[`welcomesurvey.inviteTeam.invalidEmail`])},{toAdd:[],firstError:``});if(a.length>0){let e=[...i,...a];l(e),t(`inviteTeamEmails`,e.join(`, `)),n(`inviteTeamEmails`),f(``)}m(o)}})]}),p&&(0,L.jsx)(s,{sx:({palette:e})=>({fontSize:`0.75rem`,color:e.error.main}),children:p}),(0,L.jsx)(s,{sx:({palette:e})=>({fontSize:`0.75rem`,color:e.text.secondary}),children:i.length>0?`${i.length}/${Y}`:e(e=>e[`welcomesurvey.inviteTeam.hint`])})]})})},Ye={yes:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.physicalStores.yes`],ns:`auth`}),no:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.physicalStores.no`],ns:`auth`})},Xe=({options:e,onSelection:t,onHover:n})=>{let{getValues:r}=b(),i=r(`physicalStores`);return(0,L.jsx)(a,{sx:z(e.length),children:e.map(([e])=>(0,L.jsx)(R,{icon:D(C.PhysicalStores,e),isActive:e===i,value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:t,children:Ye[e]},`option_${e}`))})},Ze={never:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.usedBefore.never`],ns:`auth`}),fewtimes:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.usedBefore.fewtimes`],ns:`auth`}),manytimes:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.usedBefore.manytimes`],ns:`auth`})},Qe={never:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.usedBefore.never_subtitle`],ns:`auth`}),fewtimes:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.usedBefore.fewtimes_subtitle`],ns:`auth`}),manytimes:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.usedBefore.manytimes_subtitle`],ns:`auth`})},$e=({options:e,onSelection:t,onHover:n})=>{let{getValues:r}=b(),i=r(`usedBefore`);return(0,L.jsx)(a,{sx:z(e.length),children:e.map(([e])=>(0,L.jsx)(R,{icon:D(C.UsedBefore,e),iconBg:A(C.UsedBefore,e),isActive:e===i,subtitle:Qe[e],value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:t,children:Ze[e]},`option_${e}`))})},et={browsing:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.startWhen.browsing`],ns:`auth`}),innextmonth:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.startWhen.innextmonth`],ns:`auth`}),comingmonths:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.startWhen.comingmonths`],ns:`auth`}),now:(0,L.jsx)(x,{components:M,i18nKey:e=>e[`welcome_survey.startWhen.now`],ns:`auth`})},tt=({options:e,onSelection:t,onHover:n})=>{let{getValues:r}=b(),i=r(`startWhen`);return(0,L.jsx)(a,{sx:{display:`flex`,flexDirection:`column`,gap:.75},children:e.map(([e])=>(0,L.jsx)(R,{icon:D(C.StartWhen,e),iconBg:A(C.StartWhen,e),isActive:e===i,value:e,onHoverEnd:()=>n?.(null),onHoverStart:()=>n?.(e),onSelection:t,children:et[e]},`option_${e}`))})},X=e=>e.sort(()=>Math.random()-.5),nt=function(e,t){let n=[...e],r=n.findIndex(e=>e[0]===t);if(r!==-1){let e=n.splice(r,1);n.push(...e)}return n},rt=n(h)(({theme:{palette:e}})=>({[`&.${f.contained}.${d(`colorGhost`)}`]:{"&:focus":{boxShadow:`0 0 0 2px ${e.gray[300]}`}}}
1)),it=({step:e,type:t,onStepUpdate:n,canContinue:r,formData:i})=>{let{t:o}=S(`auth`),l=T({type:t,step:e,formData:i}),u=()=>n(ve({type:t,step:e,formData:i})),d=()=>n(_e({type:t,step:e,formData:i})),f=e===w.Activity||e===w.InviteTeam||e===w.How&&i.howwemet===`others`||e===w.BusinessAo&&i.businessType_ao===`otherservices`||e===w.CurrentToolAo&&i.currentTool_ao===`othertool`,p=!O(e,i),m=(()=>{if(e!==w.Activity)return 0;let t=i.mainActivity;return!Array.isArray(t)||t.length===0?0:t.includes(`all`)?8:t.length})();return(0,L.jsxs)(c,{direction:`row`,sx:{justifyContent:`space-between`,alignItems:`center`,mt:2,mb:1},children:[(0,L.jsx)(a,{children:l>1&&(0,L.jsx)(rt,{color:`ghost`,sx:{textTransform:`none`,fontSize:`0.875rem`,fontWeight:500},onClick:u,children:o(e=>e[`welcomesurvey.back`])})}),(0,L.jsxs)(c,{direction:`row`,sx:{alignItems:`center`,gap:2},children:[e===w.Activity&&m>0&&(0,L.jsx)(s,{sx:({palette:e})=>({fontSize:`0.875rem`,color:e.text.secondary,fontWeight:500}),children:o(e=>e[`welcomesurvey.activity.selected`],{count:m})}),f&&(0,L.jsx)(Fe,{"data-ref":le.SurveyContinue,disabled:p||!r,sx:({spacing:e})=>({padding:e(1.25,3),fontSize:`0.875rem`}),onClick:d,children:o(e=>e[`welcomesurvey.continue`])})]})]})},at=()=>{let{user:e,account:t,pendingCart:n}=ce(),{t:r}=S(`auth`),{toast:i}=ne(),o=re(t),s=o?k.HelloAccount:k.Hello1,[u,d]=(0,I.useState)(`visible`),[f,h]=(0,I.useState)(o?w.ForWhoAo:w.How),[v,y]=(0,I.useState)(0),[ie,b]=(0,I.useState)(null),[se,x]=(0,I.useState)(null),[le,C]=(0,I.useState)(null),[ge,T]=(0,I.useState)(null),[xe,Ce]=(0,I.useState)(null),[D,O]=(0,I.useState)(null),[A,M]=(0,I.useState)(null),[N,P]=(0,I.useState)(null),[Fe,F]=(0,I.useState)(null),[R,z]=(0,I.useState)(null),[B,V]=(0,I.useState)(!1),H=(0,I.useRef)(null),U=u!==`hidden`,He=u===`fading`;(0,I.useEffect)(()=>{let e={visible:{delay:je,action:()=>d(`fading`)},fading:{delay:500,action:()=>d(`hidden`)},hidden:null}[u];if(!e)return;let t=setTimeout(e.action,e.delay);return()=>clearTimeout(t)},[u]);let W=(0,I.useRef)({howwemet:nt(X(Object.entries(E.howwemet)),`others`),businessType:X(Object.entries(E.businessType)),physicalStores:X(Object.entries(E.physicalStores)),mainActivity:Object.entries(E.mainActivity),startWhen:X(Object.entries(E.startWhen)),usedBefore:X(Object.entries(E.usedBefore)),currentTool:X(Object.entries(E.currentTool)),forWho_ao:Object.entries(E.forWho_ao),businessType_ao:nt(X(Object.entries(E.businessType_ao)),`otherservices`),clientsCount_ao:Object.entries(E.clientsCount_ao),currentTool_ao:nt(X(Object.entries(E.currentTool_ao)),`othertool`)}).current,G=ae({mode:`onChange`,defaultValues:me()}),{setValue:Ge,getValues:K,watch:q,formState:{errors:J}}=G,Y=q(`businessType_ao`);q(`currentTool_ao`),q(`businessType_aoOther`),q(`currentTool_aoOther`);let Ye=q(`forWho_ao`),Ze=ie??(Ye||`self`),Qe=se??(Y||null),et=q(`businessType`),rt=le??(et||null),at=q(`physicalStores`),ot=ge??(at||null),st=q(`currentTool`),ct=xe??(st||null),lt=q(`clientsCount_ao`),ut=A??(lt||null),dt=q(`startWhen`),ft=N??(dt||null),pt=q(`howwemet`),mt=Fe??(pt||null),ht=q(`usedBefore`),gt=R??(ht||null),_t=(!J.howwemetOtherDescription||f!==w.How)&&(!J.inviteTeamEmails||f!==w.InviteTeam),Z=q(`mainActivity`),vt=(()=>{let e=Z?Array.isArray(Z)?Z:[Z]:[],t=D?[...e,D]:e;return t.includes(`all`)?Ee:[...new Set(t.filter(e=>Ee.includes(e)))]})(),yt=q(`inviteTeamEmails`),bt=!yt||typeof yt!=`string`?[]:yt.split(`,`).map(e=>e.trim()).filter(e=>e.length>0),xt=1500,St=e=>{let t=H.current==null?xt:Date.now()-H.current,n=Math.max(0,xt-t);setTimeout(()=>{V(!1),e()},n)},Ct=l({mutationFn:e=>ue.submitSurvey({...he(e,o),type:k.Hello1}),onSuccess:()=>{St(()=>we({pendingCart:n,account:t,onProceedToPlanSelection:()=>h(w.PlanSelection)}))},onError:()=>{St(()=>{i(r(e=>e[`auth.error.general`]),{severity:`error`}),h(ve({type:s,step:w.Submit}))})}}),wt=e=>{let t=e;if(t===w.Submit){V(!0),H.current=Date.now(),Ct.mutate(K());return}if(y(e=>e+1),h(t),b(null),x(null),C(null),T(null),Ce(null),O(null),M(null),P(null),F(null),z(null),de.has(f)){let e=pe[f];e&&de.has(t)&&Ie(K(e)?`signup_survey_flow`:`signup_survey_step_skipped`,f)}},Q=e=>{let t=pe[f];t&&Ge(t,e),f===w.ForWhoAo&&Ge(`mainActivity`,e===`clients`?[`all`]:``),wt(_e({type:s,step:f,formData:K()}))};te(()=>{Le(`signup_survey_started`,{user_id:e?.id})});let $=(()=>{switch(f){case w.How:return{title:r(e=>e[`welcomesurvey.title.how`]),subtitle:r(e=>e[`welcomesurvey.subtitle.how`])};case w.Business:return{title:r(e=>e[`welcomesurvey.title.business`]),subtitle:r(e=>e[`welcomesurvey.subtitle.business`])};case w.Stores:return{title:r(e=>e[`welcomesurvey.title.store`]),subtitle:r(e=>e[`welcomesurvey.subtitle.store`])};case w.Activity:return{title:r(e=>e[`welcomesurvey.title.activity.account.use`]),subtitle:r(e=>e[`welcomesurvey.subtitle.activity`])};case w.When:return{title:r(e=>e[`welcomesurvey.title.when`]),subtitle:r(e=>e[`welcomesurvey.subtitle.when`])};case w.UsedBefore:return{title:r(e=>e[`welcomesurvey.title.usedBefore`]),subtitle:r(e=>e[`welcomesurvey.subtitle.usedBefore`])};case w.CurrentTool:return{title:r(e=>e[`welcomesurvey.title.currentTool`]),subtitle:r(e=>e[`welcomesurvey.subtitle.currentTool`])};case w.InviteTeam:return{title:r(e=>e[`welcomesurvey.inviteTeam.title`]),subtitle:r(e=>e[`welcomesurvey.inviteTeam.subtitle`])};case w.ForWhoAo:return{title:r(e=>e[`welcomesurvey.title.forWhoAo`]),subtitle:r(e=>e[`welcomesurvey.subtitle.forWhoAo`])};case w.BusinessAo:return{title:r(e=>e[`welcomesurvey.title.businessAo`]),subtitle:r(e=>e[`welcomesurvey.subtitle.businessAo`])};case w.ClientsCountAo:return{title:r(e=>e[`welcomesurvey.title.clientsCountAo`]),subtitle:r(e=>e[`welcomesurvey.subtitle.clientsCountAo`])};case w.CurrentToolAo:return{title:r(e=>e[`welcomesurvey.title.currentToolAo`]),subtitle:r(e=>e[`welcomesurvey.subtitle.currentToolAo`])};default:return null}})(),Tt=f===w.PlanSelection,Et=u===`visible`||Tt;return(0,L.jsx)(m,{open:!0,"aria-label":$?.title,maxWidth:!1,slotProps:{transition:{timeout:500}},slots:{transition:_},sx:({palette:e})=>({"& .MuiDialog-container":{alignItems:`center`},[`& .${p.root}`]:{bgcolor:e.background.paper,overflow:`hidden`,maxWidth:Oe,maxHeight:Se,width:`95%`,height:Et?`auto`:Se,interpolateSize:`allow-keywords`,transition:`height 0.45s cubic-bezier(0.22, 1, 0.36, 1)`,margin:`auto`,borderRadius:2.5},"& .MuiDialogContent-root":{padding:0},[`&.${g.root}`]:{zIndex:({zIndex:e})=>e.modal}}),children:(0,L.jsx)(oe,{...G,children:(0,L.jsx)(ee,{"data-ref":`welcome-survey`,sx:({palette:e})=>
1({p:0,display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`,position:`relative`,bgcolor:e.background.paper}),children:U?(0,L.jsx)(Ae,{isIntroFading:He,showIntro:U}):f===w.PlanSelection?(0,L.jsx)(a,{sx:{flex:1,width:`100%`,height:`100%`,display:`flex`,animation:`${be} 0.4s ease-out`},children:(0,L.jsx)(Me,{isPartner:o})}):(0,L.jsxs)(c,{direction:`row`,sx:{flex:1,width:`100%`,height:`100%`,overflow:`hidden`},children:[(0,L.jsx)(c,{sx:{flex:B?1:{xs:1,md:.6},minWidth:0,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:B?(0,L.jsx)(c,{sx:{flex:1,alignItems:`center`,justifyContent:`center`},children:(0,L.jsx)(Te,{})}):(0,L.jsxs)(c,{sx:{flex:1,minWidth:0,overflow:`hidden`,display:`flex`,flexDirection:`column`,pt:{xs:4,sm:4,md:5},pl:{xs:2,sm:2.5,md:5},pr:{xs:2,sm:2.5,md:3},pb:2.5,animation:`${be} 0.4s ease-out`},children:[(0,L.jsx)(a,{sx:{mb:2,flexShrink:0},children:(0,L.jsx)(Re,{formData:K(),step:f,type:s})}),(0,L.jsxs)(a,{sx:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`},children:[$&&(0,L.jsx)(a,{sx:{flexShrink:0,mb:2.5},children:(0,L.jsx)(Pe,{subtitle:$.subtitle,title:$.title})}),(0,L.jsx)(De,{scrollable:!0,children:(0,L.jsx)(a,{sx:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`,animation:`${Ne} 0.5s ${fe} 0.2s backwards`},children:(0,L.jsxs)(j,{condition:f,children:[(0,L.jsx)(j.Case,{when:w.How,children:(0,L.jsx)(qe,{options:W.howwemet,onHover:F,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.Business,children:(0,L.jsx)(ze,{options:W.businessType,onHover:C,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.Stores,children:(0,L.jsx)(Xe,{options:W.physicalStores,onHover:T,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.Activity,children:(0,L.jsx)(ke,{options:W.mainActivity,onHover:O})}),(0,L.jsx)(j.Case,{when:w.When,children:(0,L.jsx)(tt,{options:W.startWhen,onHover:P,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.UsedBefore,children:(0,L.jsx)($e,{options:W.usedBefore,onHover:z,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.CurrentTool,children:(0,L.jsx)(Ue,{options:W.currentTool,onHover:Ce,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.InviteTeam,children:(0,L.jsx)(Je,{})}),(0,L.jsx)(j.Case,{when:w.ForWhoAo,children:(0,L.jsx)(Ke,{options:W.forWho_ao,onHover:b,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.BusinessAo,children:(0,L.jsx)(Be,{options:W.businessType_ao,onHover:x,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.ClientsCountAo,children:(0,L.jsx)(Ve,{options:W.clientsCount_ao,onHover:M,onSelection:Q})}),(0,L.jsx)(j.Case,{when:w.CurrentToolAo,children:(0,L.jsx)(We,{options:W.currentTool_ao,onSelection:Q})})]})})}),(0,L.jsx)(a,{sx:{flexShrink:0},children:(0,L.jsx)(it,{canContinue:_t,formData:K(),step:f,type:s,onStepUpdate:wt})})]},`${f}-${v}`)]})}),!B&&(0,L.jsx)(a,{sx:{flex:.4,minWidth:0,display:{xs:`none`,md:`flex`},alignItems:`center`,justifyContent:`center`,overflow:`hidden`,position:`relative`,px:4,py:4,background:`linear-gradient(160deg, #E9EFFF 0%, #ECEBFB 50%, #E8E7F6 100%)`},children:(0,L.jsx)(ye,{activeModules:vt,businessType:Qe,clientsCount:ut,companyOffer:rt,currentTool:ct,forWho:Ze,howWeMet:mt,inviteEmails:bt,physicalStores:ot,startWhen:ft,step:f,usedBefore:gt})})]})})})})},ot=t({default:()=>st}),st=()=>(0,L.jsx)(at,{});export{ot as t};

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.