1var _global;!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=(new Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="ff60515b-ed6c-4cf7-af90-91a867113ebd",e._sentryDebugIdIdentifier="sentry-dbid-ff60515b-ed6c-4cf7-af90-91a867113ebd")}catch(e){}}(),(_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"1.30.3.5"},function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=(new Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="ff60515b-ed6c-4cf7-af90-91a867113ebd",e._sentryDebugIdIdentifier="sentry-dbid-ff60515b-ed6c-4cf7-af90-91a867113ebd")}catch(e){}}(),(_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"94c52878174d063fe834ad5b32e500e278fea03b"},(self.webpackChunkbiesse_website=self.webpackChunkbiesse_website||[]).push([[874],{37664:function(e,l,a){a.d(l,{c:function(){return d}});var s=a(90512),t=a(20146),n=a(6973),i=a(76251),r=a(85893);const o=e=>{let{icon:l,className:a,active:t=!1,linkUrl:n,label:o,...d}=e;return(0,r.jsxs)("a",{className:(0,s.Z)("rounded-3xl overflow-hidden flex flex-col gap-3 p-5 items-center",t?"bg-primary":"bg-neutral",a),href:n,...d,children:[(0,r.jsx)("div",{className:"bg-light overflow-hidden rounded-full flex justify-center items-center w-24 h-24",children:(0,r.jsx)(i.J,{icon:l,size:45,className:"text-primary"})}),(0,r.jsx)("div",{className:(0,s.Z)("font-light text-lg leading-snug text-center truncate",t?"text-light":"text-primary"),children:o})]})},d=e=>{var l,a,i,d;let{node_locale:c,className:u,currentPage:f,isCorporateAccount:m=!1}=e;const{labels:p}=(0,t.bE)(),g=(0,n.yF)("/personal-area/profile",c),b=(0,n.yF)("/personal-area/calendar",c);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:(0,s.Z)("flex justify-center gap-6 w-full invisible lg:visible",u),children:[!m&&(0,r.jsx)(o,{linkUrl:g,label:null!==(l=p["personal-area-profile-tab-cta"])&&void 0!==l?l:"",icon:"profile",active:"profile"===f,className:"flex-[0_0_50%]"}),(0,r.jsx)(o,{linkUrl:b,label:null!==(a=p["personal-area-calendar-tab-cta"])&&void 0!==a?a:"",icon:"calendar-check",className:"flex-[0_0_50%]",active:"calendar"===f})]}),(0,r.jsxs)("div",{className:(0,s.Z)("flex gap-6 w-full lg:invisible visible justify-center",u),children:[!m&&(0,r.jsx)("a",{href:g,className:(0,s.Z)("text-lg leading-tight font-normal p-4","profile"===f?"bg-light text-primary rounded-4xl border border-primary":"text-dark"),children:null!==(i=p["personal-area-profile-tab-cta"])&&void 0!==i?i:""}),(0,r.jsx)("a",{href:b,className:(0,s.Z)("text-lg leading-tight font-normal p-4","calendar"===f?"bg-light text-primary rounded-4xl border border-primary":"text-dark"),children:null!==(d=p["personal-area-calendar-tab-cta"])&&void 0!==d?d:""})]})]})}},63249:function(e,l,a){a.r(l),a.d(l,{default:function(){return V}});var s=a(67294),t=a(10768),n=a(39185),i=a(21550),r=a(20146),o=a(5972),d=a(68152),c=a(35088),u=a(14160),f=a(9689),m=a(25265),p=a(32948),g=a(22072),b=a(20230),v=a(17288),x=a(57281),h=a(63659),y=a(87536),N=a(63154),j=a(87328),L=a(90512),w=a(85893);function E(e){var l,a,s;let{labels:t,className:n,defaultValue:i,optionsList:r}=e;const o=(0,y.Gc)(),{errors:d}=o.formState;return(0,w.jsx)(N.Ph,{className:(0,L.Z)("w-full",n),label:t.businessRelationship,message:null!==(l=null===(a=d.businessRelationship)||void 0===a?void 0:a.message)&&void 0!==l?l:void 0,status:null!==(s=d.businessRelationship)&&void 0!==s&&s.message?N.o2.Error:N.o2.Warning,required:!0,optionalLabel:t.optionalLabel,defaultValue:i,...null==o?void 0:o.register("businessRelationship",{required:t.requiredFieldMessage}),children:null==r?void 0:r.map((e=>{let{value:l,id:a}=e;return(0,w.jsx)("option",{value:a,children:l},a)}))})}var I=a(41452),S=a(24938);function C(e){var l,a,s,t,n;let{labels:i,countriesList:r,businessRelationshipList:o,materialsList:d,statesList:c}=e;const u=(0,y.Gc)(),{errors:f}=u.formState;return(0,w.jsxs)("div",{className:"grid gap-x-5 gap-y-8 grid-cols-1 lg:grid-cols-2 w-full",children:[(0,w.jsx)(N.II,{label:i.firstName,required:!0,optionalLabel:i.optionalLabel,...null==u?void 0:u.register("firstName",{required:i.requiredFieldMessage}),message:null===(l=f.firstName)||void 0===l?void 0:l.message,status:N.o2.Error}),(0,w.jsx)(N.II,{label:i.lastName,required:!0,optionalLabel:i.optionalLabel,...null==u?void 0:u.register("lastName",{required:i.requiredFieldMessage}),message:null===(a=f.lastName)||void 0===a?void 0:a.message,status:N.o2.Error}),(0,w.jsx)(N.II,{label:i.email,...null==u?void 0:u.register("email",{pattern:{value:I.H,message:i.wrongEmailFormat}}),message:null===(s=f.email)||void 0===s?void 0:s.message,status:N.o2.Error,readOnly:!0}),(0,w.jsx)(N.II,{label:i.phone,...null==u?void 0:u.register("phone",{pattern:{value:I.n,message:i.wrongPhoneFormat}}),message:null===(t=f.phone)||void 0===t?void 0:t.message,status:N.o2.Error}),(0,w.jsx)(E,{labels:i,optionsList:o}),(0,w.jsx)(N.II,{className:"lg:col-span-2",label:i.company,required:!0,optionalLabel:i.optionalLabel,...null==u?void 0:u.register("company",{required:i.requiredFieldMessage}),message:null===(n=f.company)||void 0===n?void 0:n.message,status:N.o2.Error}),(0,w.jsx)(j.i,{labels:i,className:"lg:col-span-2",countriesList:r,statesList:c}),(0,w.jsx)(S.c,{labels:i,className:"lg:col-span-2",optionsList:d})]})}var k=a(5421),R=a(47932);const _=(0,s.forwardRef)(((e,l)=>{let{labels:a,consents:t,onSubmit:n,defaultValues:i,businessRelationshipList:r,countriesList:o,materialsList:d,statesList:c}=e;const u=(0,y.cI)({mode:"onBlur",reValidateMode:"onChange",defaultValues:{...i}}),{formState:{isValid:f}}=u,m=f;return(0,s.useImperativeHandle)(l,(()=>({resetForm:e=>{null==u||u.reset({...e})}}))),(0,w.jsx)("form",{className:"w-full",onSubmit:u.handleSubmit(n),children:(0,w.jsx)(y.RV,{...u,children:(0,w.jsxs)("div",{className:"w-full flex flex-col gap-8 items-center",children:[(0,w.jsx)(C,{labels:a,materialsList:d,businessRelationshipList:r,countriesList:o,statesList:c}),(0,w.jsx)(k.S,{labels:a,consents:t}),(0,w.jsx)(R.M,{disabled:!m,children:a.submit})]})})})})),P=e=>{var l,a,s,t,n,i,r,o,d,c,u;let f={};
1return e.consents.forEach((e=>{f[e.consentId]="active"===e.status})),{businessRelationship:null!==(l=null===(a=e.businessRelationship)||void 0===a?void 0:a.id)&&void 0!==l?l:"",city:e.city,company:e.company,country:null!==(s=null===(t=e.country)||void 0===t?void 0:t.id)&&void 0!==s?s:"",email:e.email,firstName:e.firstName,lastName:e.lastName,materials:null!==(n=null===(i=e.materials)||void 0===i||null===(r=i.map((e=>e.id)))||void 0===r?void 0:r.filter((e=>void 0!==e)))&&void 0!==n?n:[],phone:e.phone,stateId:null!==(o=null===(d=e.province)||void 0===d?void 0:d.id)&&void 0!==o?o:null,state:null!==(c=null===(u=e.province)||void 0===u?void 0:u.value)&&void 0!==c?c:null,zipCode:e.zipCode,consents:null!=f?f:{}}};var A=a(20757),F=a(60501);const U=e=>{let{responseStatus:l,labels:a,isOpen:s}=e;return(0,w.jsx)(F.u,{isOpen:s,onClose:()=>{var e,l;return null===(e=window)||void 0===e||null===(l=e.location)||void 0===l?void 0:l.reload()},children:l===p.ag.LOADING?(0,w.jsxs)("div",{className:"flex flex-col gap-5 p-5 items-center",children:[(0,w.jsx)("div",{className:"text-lg text-dark font-light",children:a["forms-personal-area-sending-request"]}),(0,w.jsx)(h.$,{className:"mx-auto",size:"large"})]}):(0,w.jsxs)("div",{className:"flex flex-col gap-5 p-5 items-center",children:[(0,w.jsx)("div",{className:"text-3xl text-primary font-medium",children:l===p.ag.SUCCESS?a["forms-personal-area-success-title"]:a["forms-personal-area-failed-title"]}),(0,w.jsx)("div",{className:"text-lg text-dark font-light",children:l===p.ag.SUCCESS?a["forms-personal-area-success-abstract"]:a["forms-personal-area-failed-abstract"]}),(0,w.jsx)(A.z,{variant:"primary",onClick:()=>{var e,l;return null===(e=window)||void 0===e||null===(l=e.location)||void 0===l?void 0:l.reload()},children:a["forms-personal-area-close-modal"]})]})})};var q=a(83063),z=a(51922);function D(e){let{lang:l}=e;const{labels:a}=(0,r.bE)(),t=(0,x.I)({...a},{firstName:"forms-first-name",lastName:"forms-last-name",email:"forms-email",phone:"forms-phone",company:"forms-company",materials:"forms-materials",country:"forms-country",zipCode:"forms-zip-code",state:"forms-state",optionalLabel:"forms-optional-label",requiredFieldMessage:"forms-required-field-message",wrongPhoneFormat:"forms-wrong-phone-format",wrongEmailFormat:"forms-wrong-email-format",selectCountryPlaceholder:"forms-select-country-placeholder",businessRelationship:"forms-business-relationship",city:"forms-city",submit:"forms-profile-update-data"}),[n,i]=(0,b.T)(l,p.zU.MATERIALS),[o,d]=(0,b.T)(l,p.zU.BUSINESS_RELATIONSHIP),[u,y]=(0,b.T)(l,p.zU.COUNTRY),[N,j]=(0,b.T)(l,p.zU.PROVINCES),[L,E]=(0,g.b)(l),{userInfo:I,checking:S}=(0,f.Eu)(),[C,k]=(0,s.useState)(),[R,A]=(0,s.useState)(p.ag.LOADING),[F,D,O]=(0,v.J)(null==I?void 0:I.sub,l);(0,s.useEffect)((()=>{F&&k({...P(F)})}),[F,k]),(0,s.useEffect)((()=>{const e=[i,d,y,j,E,D];e.every((e=>e===p.ag.SUCCESS))?A(p.ag.SUCCESS):e.some((e=>e===p.ag.FAILED))?A(p.ag.FAILED):(S||e.some((e=>e===p.ag.LOADING)))&&A(p.ag.LOADING)}),[i,d,y,j,E,D,S]);const[T,M]=(()=>{const[e,l]=(0,s.useState)(q.ag.LOADING),{pushEvent:a}=(0,z.P)();return[(0,s.useCallback)(((e,s)=>{(0,q.sT)().patch(`${q.zU.USERS}/${e}`,s,{headers:{"Accept-Language":"en-GB"}}).then((()=>{l(q.ag.SUCCESS),a({event:c.bg.UpdatePersonalAreaProfile})})).catch((e=>{console.error(e),l(q.ag.FAILED)}))}),[a]),e]})(),[V,G]=(0,s.useState)(!1);return R===p.ag.LOADING?(0,w.jsx)(h.$,{size:"large",className:"mx-auto"}):R===p.ag.SUCCESS?(0,w.jsxs)(m.W,{className:"py-8 bg-neutral-light",pagePaddingX:!0,children:[(0,w.jsx)("div",{className:"max-w-4xl mx-auto",children:(0,w.jsx)(_,{consents:L,labels:t,onSubmit:e=>{var l,a,s,t,n;(null==I?void 0:I.sub)&&T(I.sub,{businessRelationship:{id:(l=e).businessRelationship},city:null!==(a=l.city)&&void 0!==a?a:"",company:l.company,consents:Object.keys(l.consents).map((e=>({status:l.consents[e]?"active":"inactive",consentId:e}))),country:{id:l.country},email:l.email,firstName:l.firstName,lastName:l.lastName,materials:null===(s=l.materials)||void 0===s?void 0:s.map((e=>({id:e}))),phone:l.phone,province:l.stateId||l.state?{id:null!==(t=l.stateId)&&void 0!==t?t:void 0,value:null!==(n=l.state)&&void 0!==n?n:void 0}:void 0,zipCode:l.zipCode}),G(!0)},defaultValues:C,businessRelationshipList:o,countriesList:u,materialsList:n,statesList:N})}),(0,w.jsx)(U,{isOpen:V,responseStatus:M,labels:a})]}):(0,w.jsx)("div",{className:"text-lg text-dark font-light mx-auto p-8 text-center",children:O&&O<500&&O>=400?t["api-network-error-user-not-found"]:t["api-network-error"]})}var O=a(37664),T=a(6973);const M=e=>{let{labels:l,locale:a}=e;const{logged:t,checking:n,userInfo:i}=(0,f.Eu)();(0,s.useEffect)((()=>{!n&&(!t||t&&(null==i?void 0:i.idp))&&(0,u.navigate)((0,T.yF)("/",a))}),[n,t,a,null==i?void 0:i.idp]);const{pushEvent:r}=(0,z.P)(),o=(0,s.useRef)(!1);return(0,s.useEffect)((()=>{n||!t||null!=i&&i.idp||o.current||(r({event:c.bg.ViewPersonalAreaProfile}),o.current=!0)}),[r,n,t,i]),t?(0,w.jsx)(m.W,{pagePaddingX:!0,children:(0,w.jsxs)("div",{className:"flex flex-col items-center mt-5",children:[(0,w.jsx)(O.c,{currentPage:"profile",node_locale:a,className:"max-w-5xl"}),(0,w.jsxs)("div",{className:"flex flex-col py-16 gap-11",children:[(0,w.jsxs)("div",{className:"text-center flex flex-col gap-8 items-center",children:[(0,w.jsx)("div",{className:"text-primary text-5xl lg:text-7xl font-medium leading-tight",children:l["personal-area-profile-title"]}),(0,w.jsx)("div",{className:"text-base lg:text-lg leading-snug font-light",children:l["personal-area-profile-abstract"]})]}),(0,w.jsx)(D,{lang:a})]})]})}):(0,w.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,w.jsx)(h.$,{size:"large",className:"m-auto"})})};var V=e=>{let{data:{allContentfulHeaderMenu:l,allContentfulLabel:a,allContentfulRichTextLabel:u,allContentfulFooter:f},pageContext:{locale:m,allPageNodes:p,localizedUrls:g}}=e;const b=l.nodes.find((e=>e.node_locale===m)),v=f.nodes.find((e=>e.node_locale===m)),x=(0,r.N9)(Array.from(a.nodes),(e=>null!=e?e:"")),h=(0,r.N9)(Array.from(u.nodes),(e=>{var l;return null!==(l=null==e?void 0:e.raw)&&void 0!==l?l:""})),y=(0,o.C)();return(0,s.useEffect)((()=>{y({breadcrumbs:[{label:c.kq.PersonalArea,defaultLocaleLabel:c.kq.PersonalArea,url:""},{label:c.kq.Profile,defaultLocaleLabel:c.kq.Profile,url:""}],content_group:d.j.Other,locale:m})}),[y,m]),(0,w.jsxs)(i.B,{labels:x,richTextLabels:h,localizedUrls:g,locale:m,pageNodes:null!=p?p:[],className:"bg-neutral-light",children:[b&&(0,w.jsx)(n.A,{headerMenu:b,internalPagePath:"/pers
1onal-area/profile",pageContentfulId:null}),(0,w.jsx)(M,{labels:x,locale:m}),v&&(0,w.jsx)(t.$,{...v})]})}},68152:function(e,l,a){a.d(l,{j:function(){return s}});let s=function(e){return e.Home="home",e.Content="content",e.NotFound="404",e.Form="form",e.Product="product",e.Events="events",e.Other="other",e}({})}}]); 2//# sourceMappingURL=component---src-templates-personal-area-profile-page-index-tsx-6e890462579fc3958307.js.map
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.