1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[7365],{56183(e,t,a){a.r(t),a.d(t,{default:()=>x});var r=a(10467),n=a(96540),l=a(69290),s=a(59146),o=a(65958),c=a(28137),d=a(56347),i=a(72267),m=a(6442),u=a(22254),p=a(37738),y=a(19649),g=a(77714),f=a(97722),h=a(74242),v=a(58065),b=a(49785),E=a(73683),C=a(69195),A=a(54688),_=a(25009);const M=()=>{const e=(0,m.A)(),t=(0,A.q2)(_.sr),a=(0,A.q2)(_.Cr),l=(0,A.q2)(_.Op),s=(0,A.B7)(),d=(0,b.mN)({mode:"onChange"}),{control:i,formState:{errors:u},formState:p}=d,y=(0,C.dj)(),g=e.formatMessage({defaultMessage:[{type:0,value:"Please enter a valid employee card number"}],id:"employeeCard.form.error.please_add_valid_card"}),f=function(){var n=(0,r.A)(function*({card:r}){const n=Number(r);try{const r={employeeCardNumber:n,firstName:a,lastName:l,birthDate:t};yield s.employeeCard.reference(r),y({title:e.formatMessage({defaultMessage:[{type:0,value:"Your employee card has been linked to your account."}],id:"employeeCard.form.notification.success"}),status:"success"})}catch{y({title:e.formatMessage({defaultMessage:[{type:0,value:"Unfortunately this did not work. Make sure that the name and date of birth on the card match the BIPA OnlineShop account and that the employee number is correct"}],id:"employeeCard.form.notification.error"}),status:"error"})}});return function(e){return n.apply(this,arguments)}}();return n.createElement("form",{onSubmit:e=>{d.handleSubmit(f)(e)},noValidate:!0},n.createElement(o.B,{bg:"gray.5",spacing:4,borderRadius:"base",p:{base:4,lg:8},maxW:"800px",m:"auto"},n.createElement(E.A,{name:"card",defaultValue:"",error:u.card,rules:{required:g},type:"number",label:e.formatMessage({id:"employeeCard.form.label.card_number",defaultMessage:[{type:0,value:"Employee card number"}]}),labelWidth:"180px",control:i,inputProps:({onChange:e})=>({onChange(t){e(t.target.value.trim())}})}),n.createElement(c.$,{variant:"primary",type:"submit",alignSelf:{base:"auto",lg:"end"},isLoading:p.isSubmitting},n.createElement(v.A,{id:"employeeCard.form.button.text",defaultMessage:[{type:0,value:"Activate employee card"}]}))))};var B=a(13398),O=a(23503);const I=(0,i.YK)({CollectAndRedeem:{id:"employeeCard.statuses.collect_and_redeem",defaultMessage:[{type:0,value:"Your employee card is already activated"}]},Redeem:{id:"employeeCard.statuses.redeem",defaultMessage:[{type:0,value:"Only redemption possible!"}]},ExtendedRedeem:{id:"employeeCard.statuses.redeem",defaultMessage:[{type:0,value:"Only redemption possible!"}]},Inactive:{id:"employeeCard.statuses.inactive",defaultMessage:[{type:0,value:"Your employee card is inactive. Please contact the BIPA eCom team."}]}}),S=()=>{const e=(0,B.X)(),t=(0,d.useHistory)(),a=(0,A.ai)(),i=(0,A.Xt)(_.Cz),v=(0,A.Xt)(_.zx),{formatMessage:b}=(0,m.A)(),{data:E}=(0,u.I)({queryKey:["employee-card-content",...(0,O.sS)(e)],queryFn:(C=(0,r.A)(function*(){try{return yield(0,h.BC)({context:e,pageId:"employeecard-top"})}catch{return null}}),function(){return C.apply(this,arguments)})});var C;const S="registered"===a.status&&"loading"===i.status,x="registered"===a.status&&"ready"===i.status,N="resolving"!==a.status&&"registered"!==a.status,P="ready"===i.status?i.value:null,R="ready"===v.status?v.value:null,D=x&&(!P||!R),L=(k=R)&&Object.prototype.hasOwnProperty.call(I,k)?R:null;var k;const q=Boolean(x&&P&&L);return n.createElement(n.Fragment,null,E&&n.createElement(y.A,E),n.createElement(l.m,null,n.createElement(s.a,{py:[4,8]},("resolving"===a.status||S)&&n.createElement(o.B,{spacing:4},n.createElement(p.A,{h:11}),n.createElement(p.A,{h:11}),n.createElement(p.A,{h:11})),N&&n.createElement(o.B,{spacing:4,width:{lg:"fit-content"}},n.createElement(c.$,{onClick:()=>{t.replace(g.R7.login,{directedFrom:g.R7.employeeCard})}},"Ich habe ein BIPA Online Konto"),n.createElement(c.$,{variant:"secondary",onClick:()=>{t.replace(g.R7.registration,{directedFrom:g.R7.employeeCard})}},"Ich habe noch kein BIPA Online Konto")),D&&n.createElement(M,null),q&&L&&n.createElement(f.Eg,{status:"Inactive"===L?"warning":"success",width:{lg:"max-content"}},n.createElement(f.He,null),n.createElement(f.Y5,null,b(I[L]))))))};
1S.getTemplateName=()=>"employeecard-top";const x=S}}]);
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.