"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9412],{39412:function(e,n,t){t.r(n),t.d(n,{default:function(){return R}});var i=t(59499),r=t(50029),a=t(64687),o=t.n(a),l=t(67294),s=t(87066),u=t(87103),c=t(96827),d=t(53964),m=t(53418),p=t(19521),h=(0,p.iv)(["&:after{content:'*';vertical-align:middle;margin-left:0.3rem;color:",";}"],function(e){return e.theme.colors.blue}),g=(0,p.ZP)(u.l0).withConfig({displayName:"FormLayout",componentId:"sc-kzoyx-0"})(["display:grid;grid-gap:2rem 2rem;text-align:left;grid-template-columns:1fr;width:100%;margin:2rem auto;@media only screen and (max-width:","){padding:0 2rem;}@media only screen and (max-width:","){padding:0 0;}"],function(e){return e.theme.breakpoints.desktop960},function(e){return e.theme.breakpoints.smtablet}),f=p.ZP.div.withConfig({displayName:"NotificationBox",componentId:"sc-kzoyx-1"})(["margin-top:3rem;text-align:left;"]),x=p.ZP.div.withConfig({displayName:"InputContainer",componentId:"sc-kzoyx-2"})(["label{text-align:left;font-size:",";",";}input,select{width:100%;padding-bottom:1rem;&:focus{border:1px solid #0f62fa;}}input[type='checkbox'],input[type='radio']{margin-right:1.5rem;width:auto;}"],function(e){return e.theme.fonts.textSmall},function(e){return e.required&&h}),y=p.ZP.label.withConfig({displayName:"OptInContainer",componentId:"sc-kzoyx-3"})(["display:flex;align-items:center;font-size:",";input[type='checkbox']{margin-right:1rem;min-width:3rem;}"],function(e){return e.theme.fonts.textSmall}),v=p.ZP.div.withConfig({displayName:"EmployeeCountContainer",componentId:"sc-kzoyx-4"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1rem;",";"],function(e){return e.required&&"\n p {\n ".concat(h,";\n } \n ")}),j=p.ZP.div.withConfig({displayName:"EmployeeCountOptions",componentId:"sc-kzoyx-5"})(["display:grid;grid-template-columns:repeat(2,1fr);gap:1.5rem 2rem;margin:0 auto;@media only screen and (max-width:","){max-width:100%;}@media only screen and (max-width:","){width:100%;grid-template-columns:1fr;gap:1rem;}"],function(e){return e.theme.breakpoints.desktop960},function(e){return e.theme.breakpoints.smphone}),b=p.ZP.div.withConfig({displayName:"EmployeeCountOption",componentId:"sc-kzoyx-6"})(["display:flex;align-items:center;min-width:10rem;input[type='radio']{margin-right:1rem;}label{white-space:nowrap;}"]),C=p.ZP.div.withConfig({displayName:"SubmitContainer",componentId:"sc-kzoyx-7"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0 auto 0 auto;max-width:36rem;p{font-size:",";text-align:center;margin:0 auto 2rem auto;}"],function(e){return e.theme.fonts.textSmall}),k=p.ZP.span.withConfig({displayName:"ErrorMessage",componentId:"sc-kzoyx-8"})(["display:inline-block;color:",";font-size:",";padding-top:1rem;"],function(e){return e.theme.colors.red},function(e){return e.theme.fonts.textSmall}),N=p.ZP.div.withConfig({displayName:"PhoneExtensionContainer",componentId:"sc-kzoyx-9"})(["display:flex;.mod-phone{flex:6.3;}.mod-extension{padding-left:1.2rem;flex:4;}"]),w=t(70440),_=t(7013),q=t(63570),O=t(67619),P=t(41011),B=t(96469),I=t(6693),S=t(85893);function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function F(e){for(var n=1;n;:[\]]{1,50}$/.test(e)}).required("Please enter your first name."),lastName:c.Z_().test("is-special-character","Please enter a valid name",function(e){return/^[\w'\-,.][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*(){}|~<>;:[\]]{1,50}$/.test(e)}).required("Please enter your last name."),title:c.Z_().required("Please select a title."),email:c.Z_().email("Please enter a valid email address.").required("Please enter your email address."),phone:c.Z_().test("is-number-phone","The phone number is not valid. +1 (123)456-7890",function(e){return/^[-+() 0-9]+$/.test(e)}).required("Please enter your phone number."),company:c.Z_().required("Please enter your company name."),country:c.Z_().required("Please select your country."),quantity:c.Z_().required("Please select an option.")}),R=function(e){var n,t=e.formTitle,a=e.pageLocation,c=e.formName,p=e.submitButtonLarge,h=e.dataAt,Z=(0,l.useState)("inital"),R=Z[0],T=Z[1],D=(0,l.useRef)(null),A=(0,l.useRef)(null),M=(0,l.useRef)(null),V=(0,l.useRef)(null),$=(0,l.useRef)(null),H=(0,l.useRef)(null),J=(0,l.useRef)(null),K=(0,l.useRef)(null),U=(0,l.useState)(),W=U[0],G=U[1];return"complete"===R?null:"pending"===R?(0,S.jsx)(f,{children:(0,S.jsx)(w.LoadingBubbles,{})}):"success"===R?(0,S.jsx)(f,{children:(0,S.jsxs)(w.Notice.Success,{visible:!0,onClose:function(){return T("inital")},children:[(0,S.jsxs)(w.Notice.Body,{children:[(0,S.jsx)("p",{children:(0,S.jsx)("strong",{children:"Thank you for contacting us."})}),(0,S.jsx)("p",{children:"A member of our team will get back to you as soon as possible."})]}),(0,S.jsx)(w.Notice.CloseButton,{onClick:function(){return T("complete")}})]})}):"error"===R?(0,S.jsx)(f,{children:(0,S.jsxs)(w.Notice.Error,{visible:!0,onClose:function(){return T("inital")},children:[(0,S.jsx)(w.Notice.Body,{children:(0,S.jsxs)("p",{children:[(0,S.jsx)("strong",{children:"There was an error submitting the form"}),", please refresh the page to try again."]})}),(0,S.jsx)(w.Notice.CloseButton,{onClick:function(){return T("initial")}})]})}):(0,S.jsx)(u.J9,{initialValues:{firstName:"",lastName:"",email:"",title:"",company:"",country:"United States",phone:"",quantity:"",department:"sales",gatrackid:"",gaclientid:"",gacampaign:"",gamedium:"",gasource:"",gauserid:"",optin:!1,formName:"",ext:""},validationSchema:L,onSubmit:(n=(0,r.Z)(o().mark(function e(n){var r,l,u,d,m,p,h,g,f,x,y,v,j,b,C,k,N,w,q,S;return o().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(l=n.company,u=n.email,d=n.firstName,m=n.lastName,p=n.phone,h=n.country,g=n.quantity,f=n.title,x=n.gaclientid,y=n.gauserid,v=n.optin,j=n.ext,T("pending"),!(W||(null==j?void 0:j.length)>20)){e.next=4;break}return e.abrupt("return",T("success"));case 4:return e.next=6,(0,B.W)();case 6:return b=e.sent,e.prev=7,e.next=10,s.Z.post("/api/crm/inbound-lead",{email:u,firstName:d,lastName:m,phone:p,country:h,jobTitle:f,companyName:l,source:(null==b?void 0:b.gasource)||c||"contact_sales_form",firstMedium:(null==b?void 0:b.gamedium)||"",firstCampaign:(null==b?void 0:b.gacampaign)||"",firstAdClickId:(null==b?void 0:b.gclid)||"",landing_page:(null==b?void 0:b.landing_page)||void 0,referrer:(null==b?void 0:b.referrer)||document.referrer||void 0,fbclid:(null==b?void 0:b.fbclid)||void 0,msclkid:(null==b?void 0:b.msclkid)||void 0,utm_term:(null==b?void 0:b.gaterm)||void 0,utm_content:(null==b?void 0:b.gacontent)||void 0,utm_id:(null==b?void 0:b.utm_id)||void 0,utm_adgroup:(null==b?void 0:b.utm_adgroup)||void 0,gad_campaignid:(null==b?void 0:b.gad_campaignid)||void 0,context:{type:I.KP.LEAD,eventTitle:null!=c?c:"contact_sales_form",details:"Number of Employees: ".concat(g),referrer:(null==b?void 0:b.referrer)||document.referrer}});case 10:T("success"),e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(7),console.error("Error creating inbound lead",e.t0),T("error"),e.abrupt("return");case 18:if(window.dataLayer.push({event:"formSubmission",enhanced_conversion_data:{email:"".concat(u.trim())}}),C="contact_sales_form","enterprise-lander"===a&&(C="enterprise_contact_form"),"government-lander"===a&&(C="government_contact_form"),r={},(0,i.Z)(r,C,{}),(0,i.Z)(r,"membership",{}),k=r,("enterprise-lander"===a||"government-lander"===a)&&(k[C].call_to_action=t),"contact_sales_form"!==C){e.next=40;break}return N=(0,P.i)(),e.next=28,s.Z.post("/api/request-ip");case 28:return w=e.sent.data,e.next=32,(0,O.U)({email:u});case 32:q=e.sent.hashedEmail,k.membership=F(F({},N),{},{email:q,ipaddress:w}),k[C].phone=p,k[C].email=q,k[C].first_name=d,k[C].last_name=m,k[C].country=h;case 40:if(k[C].job_title=f,k[C].company=l,k[C].number_of_employees=g,(0,_.w)(C,k),v){e.next=46;break}return e.abrupt("return");case 46:return e.prev=46,e.next=49,s.Z.post("/api/klaviyo/create-profile",{email:u,firstName:d,lastName:m,hasAgreedToNewsOptIn:!0,metadata:F(F(F(F(F({source:"contact_sales_form",referrer:null!==(S=null==b?void 0:b.referrer)&&void 0!==S?S:document.referrer},b.gacampaign&&{campaignIds:b.gacampaign}),x&&{clientId:x}),b.gamedium&&{medium:b.gamedium}),y&&{userId:y}),b.gclid&&{trackId:b.gclid})},{headers:{"Content-Type":"applicationhttps://www.cbtnuggets.com/json","klaviyo-profile-key":"c2985f7b-09db-4d47-8e05-70e23e32d662"}});case 49:e.next=54;break;case 51:e.prev=51,e.t1=e.catch(46),console.error("Error creating Klaviyo profile:",e.t1);case 54:case"end":return e.stop()}},e,null,[[7,13],[46,51]])})),function(e){return n.apply(this,arguments)}),children:function(e){var n=e.errors,t=e.touched,i=e.handleBlur,r=e.values,a=e.handleChange,o=e.setFieldValue,l=e.isSubmitting,s=function(){if(null!==M.current&&null!==V.current&&null!==$.current&&null!==H.current&&null!==K.current&&null!==J.current){var e="undefined"!==M.current.value?M.current.value:null,n="undefined"!==V.current.value?V.current.value:null,t="undefined"!==$.current.value?$.current.value:null,i="undefined"!==H.current.value?H.current.value:null,r="undefined"!==K.current.value?K.current.value:null,a="undefined"!==J.current.value?J.current.value:null;o("gaclientid",e),o("gacampaign",n),o("gamedium",t),o("gasource",i),o("gauserid",r),o("gatrackid",a)}},u=function(e,n){o(e,n.target.checked),s()};return(0,S.jsxs)(g,{children:[(0,S.jsx)("input",{type:"hidden",name:"gaCid",id:"gaCid",ref:D}),(0,S.jsx)("input",{type:"hidden",name:"gaHid",id:"gaHid",ref:A}),(0,S.jsx)("input",{type:"hidden",name:"gaclientid",id:"gaclientid",ref:M}),(0,S.jsx)("input",{type:"hidden",name:"gacampaign",id:"gacampaign",ref:V}),(0,S.jsx)("input",{type:"hidden",name:"gamedium",id:"gamedium",ref:$}),(0,S.jsx)("input",{type:"hidden",name:"gasource",id:"gasource",ref:H}),(0,S.jsx)("input",{type:"hidden",name:"gatrackid",id:"gatrackid",ref:J}),(0,S.jsx)("input",{type:"hidden",name:"gauserid",id:"gauserid",ref:K}),(0,S.jsxs)(x,{required:!0,children:[(0,S.jsx)(w.Form.Input,{label:"First name",id:"firstName",name:"firstName",type:"text",maxLength:50,onBlur:i,value:r.firstName,onChange:a,crossOrigin:""}),t.firstName&&n.firstName&&(0,S.jsxs)(k,{children:[" ",n.firstName," "]})]}),(0,S.jsxs)(x,{required:!0,children:[(0,S.jsx)(w.Form.Input,{label:"Last name",id:"lastName",name:"lastName",type:"text",maxLength:50,onBlur:i,value:r.lastName,onChange:a,crossOrigin:""}),t.lastName&&n.lastName&&(0,S.jsxs)(k,{children:[" ",n.lastName," "]})]}),(0,S.jsxs)(x,{required:!0,children:[(0,S.jsxs)(w.Form.Select.Basic,{"aria-label":"Select Title",id:"title",name:"title",label:"Title",defaultValue:r.title,onChange:a,onBlur:i,children:[(0,S.jsx)("option",{value:"",children:"Choose..."}),(0,S.jsx)("option",{value:"administrator",children:"Administrator"}),(0,S.jsx)("option",{value:"analyst",children:"Analyst"}),(0,S.jsx)("option",{value:"architect",children:"Architect"}),(0,S.jsx)("option",{value:"assistantDirector",children:"Assistant Director"}),(0,S.jsx)("option",{value:"assistantManager",children:"Assistant Manager"}),(0,S.jsx)("option",{value:"assistantVP",children:"Assistant VP"}),(0,S.jsx)("option",{value:"cio",children:"CIO (or other C-level)"}),(0,S.jsx)("option",{value:"coordinator",children:"Coordinator"}),(0,S.jsx)("option",{value:"director",children:"Director"}),(0,S.jsx)("option",{value:"engineer",children:"Engineer"}),(0,S.jsx)("option",{value:"manager",children:"Manager"}),(0,S.jsx)("option",{value:"projectManager",children:"Project Manager"}),(0,S.jsx)("option",{value:"specialist",children:"Specialist"}),(0,S.jsx)("option",{value:"technician",children:"Tech/Technician"}),(0,S.jsx)("option",{value:"vp",children:"VP"})]}),t.title&&n.title&&(0,S.jsxs)(k,{children:[" ",n.title," "]})]}),(0,S.jsxs)(x,{required:!0,children:[(0,S.jsx)(w.Form.Input,{label:"Work Email",name:"email",type:"email",maxLength:50,onChange:a,onBlur:i,value:r.email,crossOrigin:""}),t.email&&n.email&&(0,S.jsxs)(k,{children:[" ",n.email," "]})]}),(0,S.jsxs)(x,{required:!0,children:[(0,S.jsx)(w.Form.Input,{label:"Company",name:"company",type:"text",maxLength:50,onChange:a,onBlur:i,value:r.company,crossOrigin:""}),t.company&&n.company&&(0,S.jsxs)(k,{children:[" ",n.company," "]})]}),(0,S.jsxs)(N,{children:[(0,S.jsxs)(x,{required:!0,className:"mod-phone",children:[(0,S.jsx)(w.Form.Input,{label:"Phone",name:"phone",type:"phone",maxLength:70,onChange:a,onBlur:i,value:r.phone,crossOrigin:""}),t.phone&&n.phone&&(0,S.jsxs)(k,{children:[" ",n.phone," "]})]}),(0,S.jsx)(x,{className:"mod-extension",children:(0,S.jsx)(w.Form.Input,{label:"Ext. (opt)",name:"ext",type:"text",maxLength:30,onChange:a,onBlur:i,value:r.ext,crossOrigin:""})})]}),(0,S.jsxs)(x,{required:!0,children:[(0,S.jsx)(w.Form.Select.Basic,{label:"Country",name:"country",onChange:a,onBlur:i,value:r.country,children:d.J.map(function(e){return(0,S.jsx)("option",{value:e,children:e},e)})}),t.country&&n.country&&(0,S.jsxs)(k,{children:[" ",n.country," "]})]}),(0,S.jsxs)(y,{children:[(0,S.jsx)(w.Form.Checkbox,{name:"optIn",id:"optIn",onChange:function(e){return u("optin",e)},"aria-label":"Opt into CBT Nuggets news and resources emailer.",crossOrigin:""}),"Send me CBT Nuggets IT training news and resources. (optional)"]}),(0,S.jsxs)(v,{required:!0,children:[(0,S.jsx)("p",{className:"employee-count",children:"How many employees would you like to train?"}),(0,S.jsxs)(j,{children:[(0,S.jsxs)(b,{children:[(0,S.jsx)(w.Form.Radio,{"aria-label":"Company size is between 2-4",name:"quantity",id:"quantity",value:"2-4",checked:"2-4"===r.quantity,onChange:a,onBlur:i,crossOrigin:""}),(0,S.jsx)(w.StyledLabel.Right,{htmlFor:"quantity",changeCursorOnDisabled:!0,children:"2-4"})]}),(0,S.jsxs)(b,{children:[(0,S.jsx)(w.Form.Radio,{"aria-label":"Company size is between 5-20",name:"quantity",id:"quantity",value:z,checked:z===r.quantity,onChange:a,onBlur:i,crossOrigin:""}),(0,S.jsx)(w.StyledLabel.Right,{htmlFor:"quantity",changeCursorOnDisabled:!0,children:z})]}),(0,S.jsxs)(b,{children:[(0,S.jsx)(w.Form.Radio,{"aria-label":"Company size is 20+",name:"quantity",id:"quantity",value:"20+",checked:"20+"===r.quantity,onChange:a,onBlur:i,crossOrigin:""}),(0,S.jsx)(w.StyledLabel.Right,{htmlFor:"quantity",changeCursorOnDisabled:!0,children:"20+"})]}),(0,S.jsxs)(b,{children:[(0,S.jsx)(w.Form.Radio,{"aria-label":"Company size is 100+",name:"quantity",id:"quantity",value:E,checked:E===r.quantity,onChange:a,onBlur:i,crossOrigin:""}),(0,S.jsx)(w.StyledLabel.Right,{htmlFor:"quantity",changeCursorOnDisabled:!0,children:E})]})]}),t.quantity&&n.quantity&&(0,S.jsxs)(k,{children:[" ",n.quantity," "]})]}),(0,S.jsx)(q.R5,{tabIndex:-1,onChange:function(e){return G(e.target.value)}}),(0,S.jsxs)(C,{children:[(0,S.jsxs)("p",{children:["By submitting this form you agree that you have read, understood, and are able to consent to our"," ",(0,S.jsx)(m.l7,{href:"/privacy",children:"privacy policy"}),"."]}),p?(0,S.jsx)(w.ButtonBrand.PrimaryLarge,{"aria-label":"Submit form",type:"submit","data-at":null!=h?h:"signup-form-submit",disabled:l,children:"Submit"}):(0,S.jsx)(w.ButtonBrand.Primary,{"aria-label":"Submit form",type:"submit","data-at":null!=h?h:"signup-form-submit",disabled:l,children:"Submit"})]})]})}})}}}]);