(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[434],{5748:function(e,l,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/insurance-claim",function(){return a(2154)}])},7849:function(e,l,a){"use strict";var s=a(5893);a(7294);var t=a(5675),n=a.n(t),i=a(1664),r=a.n(i),d=a(9297),c=a(3213),m=a(3806),o=a(5290),x=a(9473);let f=()=>{let e=(0,x.v9)((0,o.XL)("General"));return(0,s.jsxs)("div",{className:"max-w-registrationForm mx-auto bg-lightGray flex flex-col justify-center",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 md:grid-cols-9 py-7 justify-center p-2 text-black items-left items-center",children:[(0,s.jsxs)("div",{className:"flex col-span-1 sm:col-span-3 py-2 justify-center border-r-0 sm:border-r",children:[(0,s.jsx)(n(),{src:d.qQ,alt:"pin-icon"}),(0,s.jsx)(r(),{href:"/contacts/offices",className:"my-0 mx-2 text-sm",children:e("offices_and_service_centers")})]}),(0,s.jsxs)("div",{className:"flex justify-center py-2 col-span-1 sm:col-span-2 border-r-0 sm:border-r",children:[(0,s.jsx)(n(),{className:"mx-2",src:d.qW,alt:"phone-icon"}),(0,s.jsx)(r(),{href:"tel:070013939",className:"my-0 mx-2 text-sm",children:"0 700 1 3939"})]}),(0,s.jsx)("div",{className:"flex py-2 justify-center col-span-1 border-r-0 sm:border-r",children:(0,s.jsx)(r(),{href:"/contacts",className:"my-0 mx-2 text-sm",children:e("help")})}),(0,s.jsx)("div",{className:"flex py-2 justify-center col-span-1 sm:col-span-2",children:(0,s.jsx)(r(),{href:"/about-us/history",className:"my-0 mx-2 text-sm ",children:e("about_the_company")})}),(0,s.jsx)("div",{className:"flex justify-center items-center col-span-1",children:(0,s.jsx)(c.Yu,{})})]}),(0,s.jsx)("div",{children:(0,s.jsx)("hr",{className:"flex border-gray mx-auto"})}),(0,s.jsxs)("div",{className:"px-4 gap-6 md:px-2 font-sans m-5 flex sm:items-center sm:justify-evenly",children:[(0,s.jsxs)("span",{className:"text-sm text-gray-500 sm:text-center",children:["\xa9 ",m.VK," ",(0,s.jsx)("a",{href:"https://armeec.bg",className:"hover:underline",children:e("armeec_jsc")}),". ",e("all_rights_reserved"),"."]}),(0,s.jsxs)("span",{className:"flex items-center text-sm text-gray-500 sm:text-center",children:["Powered by"," ",(0,s.jsx)("a",{href:"https://www.a1.bg",className:"ml-2 hover:underline",children:(0,s.jsx)(n(),{width:34,height:34,src:d.vg,alt:"a1 logo"})})]})]})]})};l.Z=f},2154:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return L}});var s=a(5893),t=a(5675),n=a.n(t),i=a(1163),r=a(7294),d=a(9473),c=a(9297),m=a(1254),o=a(5290),x=a(3213),f=a(9652),u=a(381),h=a.n(u),v=a(2802),p=a(1195),j=a(3806);let g=async(e,l)=>{try{await e()}catch(a){(null==a?void 0:a.message)==="Error_401"&&(l((0,m.gk)()),l((0,m.vC)({type:"Login",a:{}})),l((0,m.vC)({type:"Error",message:"Моля въведете данните си за вход, за да продължите!"})))}},b=()=>{let e=(0,d.I0)(),l=(0,d.v9)(f.Il),a=(0,d.v9)(f.eE),t=(0,d.v9)(f.$p),n=(0,d.v9)(f.HR),c=(0,d.v9)(f.SA),m=(0,d.v9)(f.aY),u=(0,d.v9)(f.P_),b=(0,d.v9)(f.pj),N=(0,d.v9)(f.xZ),y=(0,d.v9)(f.mn),w=(0,d.v9)(f.HP),_=(0,d.v9)(f.kK),C=(0,d.v9)(f.dq),k=(0,d.v9)(f.fm),[I,E]=(0,r.useState)(null),S=(0,i.useRouter)(),{locale:M}=S,P=(0,j.G3)(M),T=(0,d.v9)((0,o.XL)("General")),R=async l=>{let a=await e((0,f.Q0)({city:l,lang:P}));return E(a.payload.data.cities),a.payload.data.cities};(0,r.useEffect)(()=>{m&&R(m)},[m]),(0,r.useEffect)(()=>{e((0,f.x6)({})),e((0,f.hB)({}))},[e]);let q=async()=>{try{await e((0,f.BH)({workflowCorrelationId:l,eventType:n,eventTime:u,eventPlaceType:c,eventCityLocation:m,policeNotified:N,agencyNotified:b,notes:t})).unwrap();let s=[...a];s.push({PreviousStep:null,CurrentStep:"event-info",NextStep:null}),e((0,f._)(s))}catch(i){(null==i?void 0:i.message)==="Error_401"&&(e(closeDialog()),e(showDialog({type:"Login",a:{}})),e(showDialog({type:"Error",message:"Моля въведете данните си за вход, за да продължите!"})))}},G=n&&c&&u&&m&&""!==t&&(null==t?void 0:t.length)<2e3;return(0,s.jsxs)("div",{className:"w-full px-2 md:w-3/4 md:px-0",children:[(0,s.jsx)(x.$J,{children:T("insurance_event_data")}),(0,s.jsx)("span",{className:"mb-2 flex w-full justify-center text-gray-500",children:T("please_fill_insurance_event_data")}),(0,s.jsx)("span",{className:"mb-8 flex w-full justify-center text-sm text-error",children:T("armeec_instant_report_text")}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 py-5 md:flex-row md:gap-16",children:[(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:w&&(0,s.jsx)(v.Lt,{getCustomStyles:p.K,label:(0,s.jsxs)("span",{className:"mb-2 text-sm font-bold",children:[T("event_type"),":"]}),required:!0,options:(0,j.bC)(w),onChange:l=>e((0,f.fM)(parseInt(l.value))),defaultValue:(0,j.id)(n,w)})}),(0,s.jsxs)("div",{id:"picker",className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:[(0,s.jsx)(x.Mt,{value:u,onChange(l){let a=document.getElementById("errorText");if(h()(l).isAfter(h()())){if(a)a.innerHTML=T("invalid_hour"),a.className="error-message";else{let s=document.createElement("div");s.innerHTML=T("invalid_hour"),s.id="errorText",s.className="error-message",document.getElementsByClassName("rdtCounters")[0].parentNode.appendChild(s)}document.getElementById("picker").classList.add("error")}else e((0,f.US)(l)),a&&a.remove(),document.getElementById("picker").classList.remove("error")},minDate:C?h()(C).subtract(1,"days").utc():null,maxDate:h()(k).isAfter(h()())?h()():h()(k),required:!0,placeholder:T("select_date_time"),label:"".concat(T("datetime_of_event"),":"),hasTime:!0,dateFormat:"DD.MM.YYYY HH:mm"}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:T("date_shouldnt_greater")})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-16 md:py-5",children:[(0,s.jsx)("div",{className:"flex w-full flex-col md:mb-0 lg:mb-0",children:_&&(0,s.jsx)(v.Lt,{getCustomStyles:p.K,label:(0,s.jsxs)("span",{className:"mb-2 text-sm font-bold",children:[T("place_event_occured"),":"]}),required:!0,options:(0,j.bC)(_),onChange:l=>e((0,f.p7)(parseInt(l.value))),defaultValue:(0,j.id)(c,_)})}),(0,s.jsx)("div",{className:"mb-8 mt-8 flex w-full flex-col md:mt-0",children:m?(0,s.jsx)(x.xg,{required:!0,getCustomStyles:p.K,citiesOptions:y,fetchCities:R,onChange:l=>e((0,f.E1)(null==l?void 0:l.code)),value:I}):(0,s.jsx)(x.xg,{required:!0,getCustomStyles:p.K,citiesOptions:y,fetchCities:R,onChange:l=>e((0,f.E1)(l.code))})})]}),(0,s.jsx)("div",{className:"flex",children:(0,s.jsx)(x.oi,{title:T("damage_info"),invalidMessage:T("field_not_bigger_than_2000"),onChange:l=>e((0,f.Pn)(l.target.value)),required:!0,value:t,invalid:(null==t?void 0:t.length)>2e3})}),(0,s.jsxs)("div",{className:"mt-8 flex justify-between",children:[(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsxs)("span",{className:"font-bold",children:[T("is_police_notified"),"?"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"mr-3 flex",children:[(0,s.jsx)("div",{className:"mr-4 flex items-center",children:(0,s.jsx)(x.EU,{name:"interior-ministry",value:!1,onChange:l=>e((0,f.w1)(!1)),labelRight:(0,s.jsx)("span",{className:"text-base",children:T("no")}),id:"interior-ministry-no",defaultChecked:!0})}),(0,s.jsx)(x.EU,{name:"interior-ministry",value:!0,onChange:l=>e((0,f.w1)(!0)),labelRight:(0,s.jsx)("span",{className:"text-base",children:T("yes")}),id:"interior-ministry-yes",defaultChecked:N})]})]}),(0,s.jsxs)("div",{className:"mt-5 flex justify-between",children:[(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsxs)("span",{className:"font-bold",children:[T("is_armeec_notified"),"?"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"mr-3 flex",children:[(0,s.jsx)("div",{className:"mr-4 flex items-center",children:(0,s.jsx)(x.EU,{name:"armeets",value:!1,onChange:l=>e((0,f.tK)(!1)),labelRight:(0,s.jsx)("span",{className:"text-base",children:T("no")}),id:"armeets-no",defaultChecked:!0})}),(0,s.jsx)(x.EU,{name:"armeets",value:!0,onChange:l=>e((0,f.tK)(!0)),labelRight:(0,s.jsx)("span",{className:"text-base",children:T("yes")}),id:"armeets-yes",defaultChecked:b})]})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 w-fit -translate-x-1/2 -translate-y-1/2 transform rounded-lg border-2 border-solid border-secondary bg-lightGray py-1 px-3 text-center text-xs uppercase text-secondary",children:T("saved_as_draft")}),(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"})]}),(0,s.jsx)("div",{className:"my-12 flex justify-center",children:(0,s.jsx)(v.zx,{disabled:!G,className:"".concat(G?"bg-secondary hover:bg-primary":""," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:T("continue"),onClick:()=>g(q,e)})})]})},N=()=>{let e=(0,d.I0)(),l=(0,d.v9)(f.Il),a=(0,d.v9)(f.eE),t=(0,d.v9)(f.wW),n=(0,d.v9)(f.L2),i=(0,d.v9)((0,o.XL)("General")),{selectedParts:r,otherNotes:c}=n,m=()=>{let l=[...a];e((0,f.Bq)(l[l.length-1].CurrentStep)),l.pop(),e((0,f._)(l))},u=[{title:"".concat(i("front_side"),":"),section:"front",options:[{name:"windshield",label:i("windshield")},{name:"frontBumper",label:i("front_bumper")},{name:"grille",label:i("grille")},{name:"leftHeadlight",label:i("left_headlight")},{name:"rightHeadlight",label:i("right_headlight")},{name:"hood",label:i("hood")},{name:"frontPartOther",label:i("front_part_other")}]},{title:"".concat(i("rear_side"),":"),section:"rear",options:[{name:"rearWindow",label:i("rear_window")},{name:"rearBumper",label:i("rear_bumper")},{name:"leftBrakeLight",label:i("left_brake_light")},{name:"rightBrakeLight",label:i("right_brake_light")},{name:"tailgate",label:i("tailgate")},{name:"rearPartOther",label:i("rear_part_other")}]},{title:"".concat(i("left_side"),":"),section:"left",options:[{name:"leftFrontFender",label:i("front_fender")},{name:"leftFrontDoor",label:i("front_door")},{name:"leftSideMirror",label:i("side_mirror")},{name:"leftRearDoor",label:i("rear_door")},{name:"leftRearFender",label:i("rear_fender")},{name:"leftFrontWheel",label:i("front_wheel")},{name:"leftRearWheel",label:i("rear_wheel")},{name:"leftThreshold",label:i("threshold")},{name:"leftPartOther",label:i("part_other")}]},{title:"".concat(i("right_side"),":"),section:"right",options:[{name:"rightFrontFender",label:i("front_fender")},{name:"rightFrontDoor",label:i("front_door")},{name:"rightSideMirror",label:i("side_mirror")},{name:"rightRearDoor",label:i("rear_door")},{name:"rightRearFender",label:i("rear_fender")},{name:"rightFrontWheel",label:i("front_wheel")},{name:"rightRearWheel",label:i("rear_wheel")},{name:"rightThreshold",label:i("threshold")},{name:"rightPartOther",label:i("part_other")}]}],h=(l,a,s,t)=>{if(l)e((0,f.GT)([...r,{PartId:a,section:s,PartInfo:t}]));else{let n=r.filter(e=>e.PartId!==a);e((0,f.GT)(n))}},p=async()=>{await e((0,f.Vh)({workflowCorrelationId:l,otherNotes:c,selectedParts:r})).unwrap();let s=[...a];s.push({PreviousStep:null,CurrentStep:"damaged-parts",NextStep:null}),e((0,f._)(s))},j=e=>!!r.some(l=>l.PartId===e),b=r.length>0||""!==c;return(0,s.jsxs)("div",{className:"w-full px-2 md:w-3/4 md:px-0",children:[(0,s.jsx)(x.$J,{children:i("selection_of_damaged_parts")}),(0,s.jsx)("span",{className:"mb-2 flex w-full justify-center text-center text-gray-500",children:i("enter_information_damaged_details")}),(0,s.jsx)("span",{className:"mb-8 flex w-full justify-center text-gray-500",children:i("max_number_15")}),u.map(l=>(0,s.jsxs)("div",{className:"mt-5 flex flex-col justify-between",children:[(0,s.jsx)("div",{className:"mb-3 flex font-bold",children:l.title}),(0,s.jsx)("div",{className:"flex flex-wrap items-center",children:l.options.map((a,t)=>{var n;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"my-2 w-1/2 md:w-1/4 lg:md:w-1/4",children:(0,s.jsx)(v.XZ,{name:a.name,labelRight:(0,s.jsx)("p",{className:"text-sm",children:a.label}),onChange:e=>h(e.target.checked,e.target.id,l.section,a.label),checked:j(a.name)})},a.name),t===l.options.length-1&&(0,s.jsx)("div",{className:"my-2 w-1/2 md:w-1/4 lg:md:w-1/4",children:(0,s.jsx)(x.oi,{disabled:!j(a.name),value:(null===(n=r.filter(e=>e.PartId===a.name)[0])||void 0===n?void 0:n.otherInformation)||"",onChange(l){if(r.some(e=>e.PartId===a.name)){let s=r.map(e=>e.PartId===a.name?{...e,otherInformation:l.target.value}:e);e((0,f.GT)(s))}}})})]})})})]},l.title)),(0,s.jsxs)("div",{className:"mt-5 flex w-full flex-wrap",children:[(0,s.jsxs)("div",{className:"w-full md:w-1/4 lg:w-1/4",children:[(0,s.jsxs)("div",{className:"mb-3 flex font-bold",children:[i("up_side"),":"]}),(0,s.jsx)(v.XZ,{name:"roof",labelRight:(0,s.jsx)("p",{className:"text-sm",children:i("roof")}),onChange:e=>h(e.target.checked,e.target.id,"top","покрив"),checked:j("roof")})]}),(0,s.jsxs)("div",{className:"mt-8 flex w-full flex-col md:mt-0 md:w-3/4 lg:mt-0 lg:w-3/4",children:[(0,s.jsxs)("div",{className:"mb-3 flex font-bold",children:[i("other"),":"]}),(0,s.jsx)(x.oi,{value:c,onChange:l=>e((0,f.oI)(l.target.value))}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:i("damage_additional_information")})]})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 w-fit -translate-x-1/2 -translate-y-1/2 transform rounded-lg border-2 border-solid border-secondary bg-lightGray py-1 px-3 text-center text-xs text-secondary",children:i("saved_as_draft")}),(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"})]}),(0,s.jsxs)("div",{className:"my-12 flex items-center justify-center gap-8",children:[""!=t&&(0,s.jsx)("button",{className:"h-12 w-12 text-secondary underline",onClick:()=>m(),children:i("back")}),(0,s.jsx)(v.zx,{disabled:!b,className:"".concat(b?"bg-secondary hover:bg-primary":""," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:i("continue"),onClick:()=>g(p,e)})]})]})},y=()=>{let e=(0,d.I0)(),l=(0,d.v9)(f.wO),a=(0,d.v9)(f.lX),t=(0,d.v9)(f.eE),n=(0,d.v9)(f.Il),i=(0,d.v9)(f.YV),c=(0,d.v9)(f.xw),u=a.filter(e=>8===e.FileType)[0],[h,b]=(0,r.useState)(a.filter(e=>9===e.FileType)),N=(0,d.v9)((0,o.XL)("General")),y={1:N("protocol_snapshot"),2:"Снимка на протокол",3:"Снимка на ДКП",4:"Снимка на служебна бележка"};(0,r.useEffect)(()=>{e((0,f.N4)({}))},[]);let w=async()=>{await e((0,f.en)({workflowCorrelationId:n,eventDocument:i})).unwrap();let l=[...t];l.push({PreviousStep:null,CurrentStep:"documents-info",NextStep:null}),e((0,f._)(l))},_=()=>{let l=[...t];e((0,f.Bq)(l[l.length-1].CurrentStep)),l.pop(),e((0,f._)(l))},C=async(l,a)=>await e((0,f.iH)({fileId:l})).unwrap(),k=async(s,t,n)=>{if(s){let i=(0,j.RT)(s),r=(0,j.q_)(i);if(r){let d=await e((0,f.UZ)({claimId:l,fileType:t,file:s})).unwrap();if(d.ok){if(8==t){let c=[...a];c.push(d.data),e((0,f.No)(c))}if(9==t){let o=[...a],x=[...h];x[n]=d.data;let u=[...new Set([...o,...x])];e((0,f.No)(u)),b(x)}}}else e((0,m.vC)({type:"Error",message:"".concat(N("format_allowed"),": JPG, JPEG, HEIC, HEIF")}))}},I=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"mx-auto mt-10 mb-7 w-full border-secondary"}),(0,s.jsxs)("div",{className:"flex flex-col items-center justify-between py-5 md:flex-row",children:[(0,s.jsxs)("div",{className:"mb-7 flex flex-col items-center justify-center md:mb-0",children:[(null==u?void 0:u.FilePath)===void 0&&1!==i&&(0,s.jsxs)("div",{className:"flex w-32 flex-col items-center",children:[(0,s.jsx)(x.G1,{onChange(e){k(e,"8",0)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:y[i]})]}),u&&u.FilePath&&1!==i&&(0,s.jsx)("div",{className:"flex h-32 w-32 flex-col justify-start",children:(0,s.jsx)(x.eT,{fileData:u,onRemove(){C(u.Id).then(l=>{if(l.ok){let s=[...a].filter(e=>8!=e.FileType);e((0,f.No)(s))}})}})})]}),h.map((l,t)=>{var n,i;return(0,s.jsxs)("div",{className:"mb-7 flex w-32 flex-col items-center justify-center md:mb-0",children:[(null===(n=h[t])||void 0===n?void 0:n.FilePath)===void 0&&(0,s.jsxs)("div",{children:[(0,s.jsx)(x.G1,{onRemove(e){let l=[...h];l.pop(),b(l)},onChange(e){k(e,"9",t)}}),(0,s.jsxs)("span",{className:"mt-1 text-xs text-gray-500",children:[N("other_file")," (",t+1,")"]})]}),(null===(i=h[t])||void 0===i?void 0:i.FilePath)&&(0,s.jsx)("div",{className:"flex h-32 w-32 flex-col items-end justify-start",children:(0,s.jsx)(x.eT,{fileData:h[t],onRemove(s){let n=[...a].filter(e=>e.Id!==l.Id),i=[...h];C(h[t].Id,t).then(l=>{l.ok&&(i[t]={},b(i),e((0,f.No)(n)))})}})})]},t)}),h.length<5&&(0,s.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,s.jsx)(v.zx,{className:"m-2 rounded-md bg-secondary px-5 py-3 font-sans text-sm uppercase hover:bg-primary md:m-0",label:"+",onClick(){let e=[...h];e.push({}),b(e)}}),(0,s.jsx)("span",{className:"mt-2 text-sm",children:N("other_files")}),(0,s.jsx)("input",{type:"file",name:"file_upload",className:"hidden"})]})})]})]});return(0,s.jsxs)("div",{className:"w-full px-2 md:w-3/4 md:px-0",children:[(0,s.jsx)(x.$J,{children:N("event_documents")}),(0,s.jsxs)("div",{className:"mt-5 flex w-full flex-wrap",children:[(0,s.jsxs)("div",{className:"flex w-full items-center md:w-2/5 lg:w-2/5",children:[(0,s.jsxs)("span",{className:"font-bold",children:[N("event_documents"),"?"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("div",{className:"mt-2 w-full md:mt-0 md:w-3/5 lg:mt-0 lg:w-3/5",children:c&&(0,s.jsx)(v.Lt,{getCustomStyles:p.K,options:(0,j.bC)(c),onChange:l=>e((0,f.WQ)(parseInt(l.value))),defaultValue:(0,j.id)(i,c)})})]}),(0===i||i)&&I,(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 w-fit -translate-x-1/2 -translate-y-1/2 transform rounded-lg border-2 border-solid border-secondary bg-lightGray py-1 px-3 text-center text-xs text-secondary",children:N("saved_as_draft")}),(0,s.jsx)("hr",{className:"mb-12 mt-8 w-full border-secondary"})]}),(0,s.jsxs)("div",{className:"my-12 flex items-center justify-center gap-8",children:[(0,s.jsx)("button",{className:"h-12 w-12 text-secondary underline",onClick:()=>_(),children:N("back")}),(0,s.jsx)(v.zx,{disabled:!i,className:"".concat(i?"bg-secondary hover:bg-primary":""," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:N("continue"),onClick:()=>g(w,e)})]})]})},w=()=>{let e=(0,d.I0)(),l=(0,d.v9)(f.Il),a=(0,d.v9)(f.zk),t=(0,d.v9)(f.eE),n=(0,d.v9)(f.v9),c=(0,d.v9)(f.Pf),m=(0,d.v9)(f.Mw),u=(0,d.v9)(f.m5),h=(0,d.v9)(f.W),b=(0,d.v9)(f.XZ),N=(0,d.v9)(f.uD);(0,d.v9)(f.c1);let y=(0,d.v9)(f.Lq),w=(0,d.v9)(f.TG),_=(0,d.v9)(f.k_),C=(0,d.v9)(f.$),k=(0,d.v9)(f.Mv),I=(0,d.v9)(f.EL),E=(0,d.v9)(f.M6),S=(0,d.v9)(f.i1),M=(0,d.v9)(f.S8),P=(0,d.v9)(f.zK),T=(0,d.v9)(f.NZ),R=(0,d.v9)(f.Y4),q=(0,d.v9)(f.Mb),[G,F]=(0,r.useState)(null),D=(0,d.v9)(f.PU),L=(0,d.v9)(f.WS),[B,V]=(0,r.useState)(!1),[U,Y]=(0,r.useState)(!1),[H,K]=(0,r.useState)(!1),[X,z]=(0,r.useState)(null),J=(0,i.useRouter)(),{locale:O}=J,Q=(0,j.G3)(O),A=(0,d.v9)((0,o.XL)("General")),$=[{value:"1",label:"AM"},{value:"2",label:"A1"},{value:"3",label:"A2"},{value:"4",label:"A"},{value:"5",label:"B1"},{value:"6",label:"B"},{value:"7",label:"C1"},{value:"8",label:"C"},{value:"9",label:"D1"},{value:"10",label:"D"},{value:"11",label:"BE"},{value:"12",label:"C1E"},{value:"13",label:"CE"},{value:"14",label:"D1E"},{value:"15",label:"DE"},{value:"16",label:"TTM"},{value:"17",label:"TKT"}],Z=(0,r.useCallback)(e=>!!e&&!!e.match(j.mS),[]),W=(0,r.useMemo)(()=>Z(h),[Z,h]),ee=async()=>{await e((0,f.zG)({workflowCorrelationId:l,driverType:a,firstName:c,middleName:m,lastName:u,pid:h,cityBg:b,postCode:N,street:y,streetNo:w,district:_,building:C,entrance:k,floor:I,phoneNumber:q,apartment:E,driverLicenseNumber:S,driverLicenseCategory:M,driverLicenseCountry:P,driverLicenseExpireDate:T,driverLicenseControlCard:R})).unwrap();let s=[...t];s.push({PreviousStep:null,CurrentStep:"driver-info",NextStep:null}),e((0,f._)(s))},el=()=>{let l=[...t];e((0,f.Bq)(l[l.length-1].CurrentStep)),l.pop(),e((0,f._)(l))},ea=async l=>{let a=await e((0,f.uS)({city:l,lang:Q}));return e((0,f.hR)(a.payload.data.cities[0].post_code)),z(a.payload.data.cities),a.payload.data.cities},es=(0,r.useCallback)(e=>!!e&&!!e.match(j.yJ),[]),et=(0,r.useCallback)(e=>!!e&&!!e.match(j.Uo),[]),en=(0,r.useCallback)(e=>!!e&&!!e.match(j.fm),[]),ei=(0,r.useCallback)(e=>!!e&&!!e.match(j.$B),[]),er=(0,r.useMemo)(()=>es(c),[es,c]),ed=(0,r.useMemo)(()=>es(m),[es,m]),ec=(0,r.useMemo)(()=>es(u),[es,u]),em=(0,r.useMemo)(()=>et(q),[et,q]),eo=(0,r.useMemo)(()=>en(N),[en,N]),ex=(0,r.useMemo)(()=>ei(S),[ei,S]);(0,r.useEffect)(()=>{e((0,f.hf)({}))},[]),(0,r.useEffect)(()=>{b&&ea(b)},[b]),(0,r.useEffect)(()=>{Y(!1),V(!1),y||w&&"0"!==w||C&&"0"!==C||I&&"0"!==I||E&&"0"!==E||(Y(!0),V(!0)),!C&&!I&&!E||(C&&"0"!==C&&I&&"0"!==I&&E&&"0"!==E?Y(!1):(!C||_&&I&&"0"!==I&&E&&"0"!==E)&&(!I||_&&C&&"0"!==C&&E&&"0"!==E)&&(!E||_&&C&&"0"!==C&&I&&"0"!==I)||Y(!0)),(y||w)&&(y&&w?V(!1):V(!0))},[_,y,w,C,I,E]);let ef=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"mx-auto mt-10 mb-7 w-full border-secondary"}),(0,s.jsx)("span",{className:"mb-10 flex w-full justify-center text-gray-500",children:A("enter_driving_license_data")}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-16 md:py-5",children:[(0,s.jsxs)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:[(0,s.jsx)(x.oi,{title:A("driving_license_number"),invalidMessage:A("invalid_driving_license_number"),onChange:l=>e((0,f.Jx)(l.target.value.trimEnd())),required:!0,invalid:!!S&&!ex,defaultValue:S}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:A("it_consist_nine_letter")})]}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:$&&(0,s.jsx)(v.Lt,{getCustomStyles:p.K,label:(0,s.jsxs)("span",{className:"mb-2 text-sm font-bold",children:[A("category"),":"]}),required:!0,options:$,onChange:l=>e((0,f.PR)(l.label)),defaultValue:{label:M,value:$.filter(e=>e.label==M).value}})})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-16 md:py-5",children:[(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(v.Lt,{getCustomStyles:p.K,label:(0,s.jsxs)("span",{className:"mb-2 text-sm font-bold",children:[A("driving_license_country"),":"]}),required:!0,options:[{value:"BG",label:A("bulgaria")}],onChange:l=>e((0,f.RZ)(l.value)),defaultValue:{label:P,value:"BG"}})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col justify-end md:mb-0 lg:mb-0",children:(0,s.jsx)(x.Mt,{value:T,onChange:l=>e((0,f.Vb)(l.format("YYYY-MM-DD"))),required:!0,placeholder:A("fill"),label:"".concat(A("validity"),":"),hasTime:!1,dateFormat:"DD.MM.YYYY"})})]}),(0,s.jsxs)("div",{className:"mt-5 flex justify-between",children:[(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsxs)("span",{className:"font-bold",children:[A("control_card_available"),"?"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"mr-3 flex",children:[(0,s.jsx)("div",{className:"mr-4 flex items-center",children:(0,s.jsx)(x.EU,{name:"control-card",value:!1,onChange:l=>e((0,f.EQ)(!1)),labelRight:(0,s.jsx)("span",{className:"text-base",children:A("no")}),id:"control-card-no",defaultChecked:!R})}),(0,s.jsx)(x.EU,{name:"control-card",value:!0,onChange:l=>e((0,f.EQ)(!0)),labelRight:(0,s.jsx)("span",{className:"text-base",children:A("yes")}),id:"control-card-yes",defaultChecked:R})]})]})]}),eu=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"mx-auto mt-10 mb-7 w-full border-secondary"}),(0,s.jsx)("span",{className:"mb-10 flex w-full justify-center text-gray-500",children:A("fill_vehicle_driver_details_event")}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-16 md:py-5",children:[(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(x.oi,{title:A("name"),invalidMessage:"field_only_cyrilic",onChange:l=>e((0,f.lC)(l.target.value.trimEnd())),required:!0,defaultValue:c,invalid:!!c&&!er})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(x.oi,{title:A("surname"),invalidMessage:"field_only_cyrilic",onChange:l=>e((0,f.ab)(l.target.value.trimEnd())),required:!0,defaultValue:m,invalid:!!m&&!ed})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(x.oi,{title:A("lastname"),invalidMessage:"field_only_cyrilic",onChange:l=>e((0,f.ZQ)(l.target.value.trimEnd())),required:!0,defaultValue:u,invalid:!!u&&!ec})})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-16 md:py-5",children:[(0,s.jsxs)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:[(0,s.jsx)(x.oi,{title:A("egn"),invalidMessage:A("enter_valid_pin"),invalid:!W&&!!h,onChange:l=>e((0,f.Yv)(l.target.value.trimEnd())),required:!0,defaultValue:h}),""==h&&(0,s.jsx)("span",{className:"text-gray-500",children:A("should_contain_ten_digit")})]}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(x.oi,{title:A("phone"),invalidMessage:A("invalid_data"),onChange:l=>e((0,f.vB)(l.target.value.trimEnd())),required:!0,defaultValue:q,invalid:!!q&&!em})})]}),(0,s.jsx)("span",{className:"mb-5 flex w-full text-gray-500",children:A("address_info")}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-5 md:pt-5",children:[(0,s.jsx)("div",{className:"mb-8 flex flex-col md:mb-0 md:w-5/12",children:b?(0,s.jsx)(x.xg,{required:!0,getCustomStyles:p.K,citiesOptions:D,fetchCities:ea,onChange:l=>e((0,f.nc)(l.code)),value:X}):(0,s.jsx)(x.xg,{required:!0,getCustomStyles:p.K,citiesOptions:D,fetchCities:ea,onChange:l=>e((0,f.nc)(l.code))})}),(0,s.jsx)("div",{className:"mb-8 flex flex-col md:mb-0 md:w-3/12",children:(0,s.jsx)(x.oi,{title:A("post_code"),invalidMessage:A("invalid_post_code"),onChange:l=>e((0,f.hR)(l.target.value.trimEnd())),required:!0,invalid:!!N&&!eo,defaultValue:N,value:N})}),(0,s.jsx)("div",{className:"flex flex-col md:w-4/12",children:(0,s.jsx)(x.oi,{title:A("district"),onChange:l=>e((0,f.F1)(l.target.value.trimEnd())),invalidMessage:A("fill_district"),invalid:H&&(I||E||C||"0"===_||!I&&!E&&!C&&!y&&!w)&&(!_||"0"===_),defaultValue:_})})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 pt-5 md:flex-row md:gap-1",children:[(0,s.jsxs)("div",{className:"mb-5 flex flex-col md:mb-0 md:w-7/12",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col md:flex-row md:gap-1",children:[(0,s.jsx)("div",{className:"flex flex-col md:mb-0 md:w-10/12 lg:mb-0",children:(0,s.jsx)(x.oi,{title:"".concat(A("boulevard"),"/").concat(A("street")),onChange:l=>e((0,f.Xr)(l.target.value.trimEnd())),invalid:H&&B&&(!y||"0"===y),invalidMessage:" ",defaultValue:y})}),(0,s.jsx)("div",{className:"flex flex-col md:mb-0 md:w-2/12 lg:mb-0",children:(0,s.jsx)(x.oi,{title:"№",onChange:l=>e((0,f.cc)(l.target.value.trimEnd())),placeholder:" ",invalid:H&&B&&(!w||"0"===w),invalidMessage:" ",defaultValue:w})})]}),H&&B&&(0,s.jsx)("span",{className:"text-xs text-error",children:A("please_fill_street_boulevard")})]}),(0,s.jsxs)("div",{className:"mt-10 flex justify-center text-xs text-gray-500 md:w-1/12 lg:w-1/12",children:[A("and"),"/",A("or")]}),(0,s.jsxs)("div",{className:"flex flex-col md:w-6/12",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col md:flex-row md:gap-1",children:[(0,s.jsx)("div",{className:"mb-5 flex flex-col md:mb-0 md:w-3/12",children:(0,s.jsx)(x.oi,{title:A("building"),onChange:l=>e((0,f.Mk)(l.target.value.trimEnd())),placeholder:"",invalid:H&&U&&(!C||"0"===C),invalidMessage:" ",defaultValue:C})}),(0,s.jsx)("div",{className:"flex flex-col md:w-3/12",children:(0,s.jsx)(x.oi,{title:A("entrance"),onChange:l=>e((0,f.lb)(l.target.value.trimEnd())),placeholder:"",defaultValue:k,invalid:H&&U&&"0"===k,invalidMessage:" "})}),(0,s.jsx)("div",{className:"mb-5 flex flex-col md:mb-0 md:w-3/12 lg:mb-0",children:(0,s.jsx)(x.oi,{title:A("floor"),onChange:l=>e((0,f.O5)(l.target.value.trimEnd())),placeholder:"",invalid:H&&U&&(!I||"0"===I),invalidMessage:" ",defaultValue:I})}),(0,s.jsx)("div",{className:"mb-5 flex flex-col md:mb-0 md:w-3/12 lg:mb-0",children:(0,s.jsx)(x.oi,{title:A("apartment"),onChange:l=>e((0,f.jh)(l.target.value.trimEnd())),placeholder:"",invalid:H&&U&&(!E||"0"===E),invalidMessage:" ",defaultValue:E})})]}),H&&U&&(!C||!I||!E)&&(0,s.jsx)("span",{className:"text-xs text-error",children:A("please_enter_building")})]})]}),(0,s.jsx)("hr",{className:"mx-auto mt-10 mb-7 w-full border-secondary"}),(0,s.jsx)("span",{className:"mb-10 flex w-full justify-center text-gray-500",children:A("fill_driver_data_during_event")}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-16 md:py-5",children:[(0,s.jsxs)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:[(0,s.jsx)(x.oi,{title:A("driving_license_number"),invalidMessage:A("invalid_driving_license_number"),onChange:l=>e((0,f.Jx)(l.target.value.trimEnd())),required:!0,invalid:!!S&&!ex,defaultValue:S}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:A("it_consist_nine_letter")})]}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:$&&(0,s.jsx)(v.Lt,{getCustomStyles:p.K,label:(0,s.jsxs)("span",{className:"mb-2 text-sm font-bold",children:[A("category"),":"]}),required:!0,options:$,onChange:l=>e((0,f.PR)(l.label)),defaultValue:{label:M,value:$.filter(e=>e.label==M).value}})})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-16 md:py-5",children:[(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(v.Lt,{getCustomStyles:p.K,label:(0,s.jsxs)("span",{className:"mb-2 text-sm font-bold",children:[A("driving_license_country"),":"]}),required:!0,options:[{value:"BG",label:A("bulgaria")}],onChange:l=>e((0,f.RZ)(l.value)),defaultValue:{label:P,value:"BG"}})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.Mt,{value:T,onChange:l=>e((0,f.Vb)(l.format("YYYY-MM-DD"))),required:!0,placeholder:A("select"),label:"".concat(A("validity"),":"),hasTime:!1,dateFormat:"DD.MM.YYYY"})})]}),(0,s.jsxs)("div",{className:"mt-5 flex justify-between",children:[(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsxs)("span",{className:"font-bold",children:[A("control_card_available"),"?"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"mr-3 flex",children:[(0,s.jsx)("div",{className:"mr-4 flex items-center",children:(0,s.jsx)(x.EU,{name:"control-card",value:!1,onChange:l=>e((0,f.EQ)(!1)),labelRight:(0,s.jsx)("span",{className:"text-base",children:A("no")}),id:"control-card-no",defaultChecked:!R})}),(0,s.jsx)(x.EU,{name:"control-card",value:!0,onChange:l=>e((0,f.EQ)(!0)),labelRight:(0,s.jsx)("span",{className:"text-base",children:A("yes")}),id:"control-card-yes",defaultChecked:R})]})]})]}),eh=a&&("1"==a&&ex&&null!==M&&null!==P&&null!==T||"2"==a&&ex&&null!==M&&null!==P&&null!==T||"3"==a&&er&&ed&&ec&&W&&em&&eo&&ex&&null!==b&&null!==M&&null!==P&&null!==T||"4"==a),ev=()=>{if(K(!0),"3"!=a)g(ee,e);else{if("0"===_||"0"===y||"0"===w||"0"===C||"0"===k||"0"===I||"0"===E){if("0"===y||"0"===w)return V(!0);if("0"===C||"0"===k||"0"===I||"0"===E)return Y(!0);if("0"===_)return}(y&&"0"!==y&&w&&"0"!==w||_&&"0"!==_&&y&&"0"!==y&&w&&"0"!==w||_&&"0"!==_&&C&&"0"!==C&&I&&"0"!==I&&E&&0!=E)&&g(ee,e),(y&&!w||!y&&w)&&V(!0),(!_||C&&I&&E||y||w)&&(!C||_&&I&&"0"!==I&&E&&"0"!==E)&&(!I||_&&C&&"0"!==C&&E&&"0"!==E)&&(!E||_&&C&&"0"!==C&&I&&"0"!==I)||(Y(!0),V(!1))}};return(0,s.jsxs)("div",{className:"w-full px-2 md:w-3/4 md:px-0",children:[(0,s.jsx)(x.$J,{children:A("driver_data")}),(0,s.jsx)("span",{className:"mb-8 flex w-full justify-center text-gray-500",children:A("fill_vehicle_driver_details_event")}),(0,s.jsxs)("div",{className:"mt-5 flex w-full flex-wrap",children:[(0,s.jsxs)("div",{className:"flex w-full items-center md:w-2/5 lg:w-2/5",children:[(0,s.jsxs)("span",{className:"font-bold",children:[A("vehicle_drived_by"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("div",{className:"mt-2 w-full md:mt-0 md:w-3/5 lg:mt-0 lg:w-3/5",children:L&&(0,s.jsx)(v.Lt,{getCustomStyles:p.K,options:(e=>{let l=[];return(e&&e.forEach(e=>{let a={id:e.id,value:e.code,label:e.name};l.push(a)}),3==n)?l.filter(e=>"2"!=e.value):l})(L),onChange:l=>e((0,f.q1)(parseInt(l.value))),defaultValue:(0,j.id)(a,L)})})]}),"0"!=a&&"3"==a&&eu,("1"==a||"2"==a)&&ef,(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 w-fit -translate-x-1/2 -translate-y-1/2 transform rounded-lg border-2 border-solid border-secondary bg-lightGray py-1 px-3 text-center text-xs text-secondary",children:A("saved_as_draft")}),(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"})]}),(0,s.jsxs)("div",{className:"my-12 flex items-center justify-center gap-8",children:[(0,s.jsx)("button",{className:"h-12 w-12 text-secondary underline",onClick:()=>el(),children:A("back")}),(0,s.jsx)(v.zx,{disabled:!eh,className:"".concat(eh?"bg-secondary hover:bg-primary":""," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:A("continue"),onClick:ev})]})]})};var _=a(3733);let C=()=>{var e,l,a,t,n,i,c;let u=(0,d.I0)(),h=(0,d.v9)(f.eE),p=(0,d.v9)(f.Il),b=(0,d.v9)(f.wO),N=(0,d.v9)(f.L2),y=(0,d.v9)(f.lX),[w,C]=(0,r.useState)(y.filter(e=>7==e.FileType&&(2==e.ImageType||3==e.ImageType))),[k,I]=(0,r.useState)(y.filter(e=>10==e.FileType&&(0==e.ImageType||1==e.ImageType))),[E,S]=(0,r.useState)(y.filter(e=>10==e.FileType&&(2==e.ImageType||3==e.ImageType))),M=(0,d.v9)((0,o.XL)("General")),[P,T]=(0,r.useState)(y.find(e=>1==e.FileType)),[R,q]=(0,r.useState)(y.find(e=>2==e.FileType)),[G,F]=(0,r.useState)(y.find(e=>3==e.FileType)),[D,L]=(0,r.useState)(y.find(e=>4==e.FileType)),[B,V]=(0,r.useState)(y.filter(e=>5==e.FileType)),[U,Y]=(0,r.useState)(y.filter(e=>6==e.FileType)),[H,K]=(0,r.useState)(y.filter(e=>7==e.FileType)),X=e=>{let l=-1,a=[...w];for(let s=0;s<a.length;s++)if(a[s].PartInfo.PartId==e.PartId){l=s;break}return -1!==l&&a.splice(l,1),C(a)},{selectedParts:z,otherNotes:J}=N,O=[],Q=()=>{let e=[...h];u((0,f.Bq)(e[e.length-1].CurrentStep)),e.pop(),u((0,f._)(e))};(0,r.useEffect)(()=>{u((0,f.KO)({workflowCorrelationId:p})).unwrap()},[P,R,G,D,H,U,B,u]);let A=async(e,l)=>await u((0,f.iH)({fileId:e})).unwrap(),$=async(e,l,a)=>{if(e){let s=(0,j.RT)(e),t=(0,j.q_)(s);if(t){let n=await u((0,f.UZ)({claimId:b,fileType:l,file:e})).unwrap();if(n.ok){if(1==l&&T(n.data),2==l&&q(n.data),3==l&&F(n.data),4==l&&L(n.data),5==l){let i=[...B];i[a]=n.data,V(i)}if(6==l){let r=[...U];r[a]=n.data,Y(r)}}}else u((0,m.vC)({type:"Error",message:"".concat(M("format_allowed"),": JPG, JPEG, HEIC, HEIF")}))}},Z=async(e,l,a,s)=>{if(e){let t=(0,j.RT)(e),n=(0,j.q_)(t);if(n){let i=await u((0,f.Ut)({claimId:b,fileType:7,partId:l.PartId,section:l.Section,partName:l.PartInfo,otherInformation:l.OtherInformation,imageType:a,file:e})).unwrap(),r=[...H];r[s]=i.data,K(r)}else u((0,m.vC)({type:"Error",message:"".concat(M("format_allowed"),": JPG, JPEG, HEIC, HEIF")}))}},W=async(e,l,a,s)=>{if(e){let t=(0,j.RT)(e),n=(0,j.q_)(t);if(n){let i=await u((0,f.Ut)({claimId:b,fileType:10,imageType:l,file:e})).unwrap();if(s){let r=[...E];r[a]=i.data,S(r)}else{let d=[...k];d[a]=i.data,I(d)}}else u((0,m.vC)({type:"Error",message:"".concat(M("format_allowed"),": JPG, JPEG, HEIC, HEIF")}))}},ee=async()=>{await u((0,f.Yp)({workflowCorrelationId:p})).unwrap();let e=[...h];e.push({PreviousStep:null,CurrentStep:"check-images",NextStep:null}),u((0,f._)(e)),u((0,f.Bq)("compensations-info"))};z.forEach(e=>{let l=O.findIndex(l=>l.section===e.Section);-1===l?O.push({section:e.Section,items:[e]}):O[l].items.push(e)});let el=(e,l)=>{let a=H.filter(l=>{var a;return(null===(a=l.PartInfo)||void 0===a?void 0:a.PartId)===e.PartId});return a.filter(e=>e.ImageType==l)[0]},ea=e=>k[e],es=e=>E[e],et=e=>w.filter(l=>l.PartInfo.PartId===e.PartId),en={front:M("front_side"),rear:M("rear_side"),left:M("left_side"),right:M("right_side"),top:M("up_side")};return(0,s.jsxs)("div",{className:"w-full px-2 md:w-3/4 md:px-0",children:[(0,s.jsx)(x.$J,{children:M("add_images")}),(0,s.jsxs)("div",{className:"mb-8 flex flex-col flex-wrap justify-center text-center md:flex-row",children:[(0,s.jsxs)("span",{className:"flex text-gray-500",children:[M("add_diagonal_images"),"\xa0"]}),(0,s.jsx)("a",{href:"".concat(_.Xd.apiUrl,"/api/static-files/file/kasko-help"),download:!0,children:(0,s.jsx)("span",{className:"cursor-pointer text-secondary underline",children:M("directions")})})]}),(0,s.jsxs)("div",{className:"mt-5 flex w-full flex-col flex-wrap items-center",children:[(0,s.jsxs)("div",{className:"mr-7 mb-5 flex w-fit text-center lg:mb-0",children:[(0,s.jsxs)("span",{className:"font-bold",children:[M("four_diagonals"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"mt-5 flex w-fit flex-wrap items-center justify-center",children:[(0,s.jsxs)("div",{className:"mr-4 mb-5 flex flex-col items-center md:mb-0",children:[(null==P?void 0:P.FilePath)?(0,s.jsx)(x.eT,{fileData:P,onRemove(){A(P.Id).then(e=>{e.ok&&T(null)})}}):(0,s.jsx)(x.G1,{onChange(e){$(e,1,0)}}),(0,s.jsxs)("span",{className:"mt-1 text-xs text-gray-500",children:[M("diagonal")," ",1]})]},0),(0,s.jsxs)("div",{className:"mr-4 mb-5 flex flex-col items-center md:mb-0",children:[(null==R?void 0:R.FilePath)?(0,s.jsx)(x.eT,{fileData:R,onRemove(){A(R.Id).then(e=>{e.ok&&q(null)})}}):(0,s.jsx)(x.G1,{onChange(e){$(e,2,1)}}),(0,s.jsxs)("span",{className:"mt-1 text-xs text-gray-500",children:[M("diagonal")," ",2]})]},1),(0,s.jsxs)("div",{className:"mr-4 mb-5 flex flex-col items-center md:mb-0",children:[(null==G?void 0:G.FilePath)?(0,s.jsx)(x.eT,{fileData:G,onRemove(){A(G.Id).then(e=>{e.ok&&F(null)})}}):(0,s.jsx)(x.G1,{onChange(e){$(e,3,2)}}),(0,s.jsxs)("span",{className:"mt-1 text-xs text-gray-500",children:[M("diagonal")," ",3]})]},2),(0,s.jsxs)("div",{className:"mr-4 mb-5 flex flex-col items-center md:mb-0",children:[(null==D?void 0:D.FilePath)?(0,s.jsx)(x.eT,{fileData:D,onRemove(){A(D.Id).then(e=>{e.ok&&L(null)})}}):(0,s.jsx)(x.G1,{onChange(e){$(e,4,3)}}),(0,s.jsxs)("span",{className:"mt-1 text-xs text-gray-500",children:[M("diagonal")," ",4]})]},3)]})]}),(0,s.jsx)("hr",{className:"mx-auto mt-10 mb-7 w-full border-secondary"}),(0,s.jsxs)("div",{className:"mb-8 flex flex-col flex-wrap justify-center text-center md:flex-row",children:[(0,s.jsxs)("span",{className:"flex text-gray-500",children:[M("add_photos_damaged_area")," 3.\xa0"]}),(0,s.jsx)("a",{href:"".concat(_.Xd.apiUrl,"/api/static-files/file/kasko-help"),download:!0,children:(0,s.jsx)("span",{className:"cursor-pointer text-secondary underline",children:M("directions")})})]}),O.map((e,l)=>{var a;return(0,s.jsxs)("div",{className:"mt-10 flex w-full flex-col",children:[(0,s.jsx)("h4",{className:"mb-5 flex justify-center",children:null===(a=en[null==e?void 0:e.section])||void 0===a?void 0:a.toUpperCase()}),(0,s.jsx)("div",{className:"flex w-full flex-wrap justify-center",children:e.items.map((e,l)=>{var a,t,n,i;return(0,s.jsxs)("div",{className:"flex w-full flex-col gap-5 p-5",children:[(0,s.jsxs)("div",{className:"flex justify-center md:mb-0",children:[(0,s.jsx)("span",{className:"font-bold ",children:e.OtherInformation?"".concat(e.OtherInformation,":"):"".concat(e.PartInfo.charAt(0).toUpperCase()+e.PartInfo.slice(1),":")}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"mb-8 flex flex-wrap items-center justify-center gap-5 md:mb-0 ",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(null===(a=el(e,0))||void 0===a?void 0:a.FilePath)?(0,s.jsx)(x.eT,{fileData:el(e,0),async onRemove(){let l=await A(el(e,0).Id);if(l.ok){let a=[...H].filter(l=>l.Id!==el(e,0).Id);K(a)}}}):(0,s.jsx)(x.G1,{onChange(l){Z(l,e,0,H.length)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:M("panoramic_photo")})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(null===(t=el(e,1))||void 0===t?void 0:t.FilePath)?(0,s.jsx)(x.eT,{fileData:el(e,1),async onRemove(){let l=await A(el(e,1).Id);if(l.ok){let a=[...H].filter(l=>l.Id!==el(e,1).Id);K(a)}}}):(0,s.jsx)(x.G1,{onChange(l){Z(l,e,1,H.length)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:M("detailed_photo")})]}),et(e)[0]&&(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(null===(n=el(e,2))||void 0===n?void 0:n.FilePath)?(0,s.jsx)(x.eT,{fileData:el(e,2),async onRemove(){let l=await A(el(e,2).Id);if(l.ok){let a=[...H].filter(l=>l.Id!==el(e,2).Id);K(a)}}}):(0,s.jsx)(x.G1,{onChange(l){Z(l,e,2,H.length)},onRemove(){X(e)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:"Друга снимка (1)"})]}),et(e)[1]&&(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(null===(i=el(e,3))||void 0===i?void 0:i.FilePath)?(0,s.jsx)(x.eT,{fileData:el(e,3),async onRemove(){let l=await A(el(e,3).Id);if(l.ok){let a=[...H].filter(l=>l.Id!==el(e,3).Id);K(a)}}}):(0,s.jsx)(x.G1,{onChange(l){Z(l,e,3,H.length)},onRemove(){X(e)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:"Друга снимка (2)"})]}),et(e).length<2&&(0,s.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center text-center",children:[(0,s.jsx)(v.zx,{className:"m-2 rounded-md bg-secondary px-5 py-3 font-sans text-sm uppercase hover:bg-primary md:m-0",label:"+",onClick(){let l=[...w];l.push({PartInfo:e}),C(l)}}),(0,s.jsx)("span",{className:"mt-2 text-sm",children:"Други снимки"}),(0,s.jsx)("input",{type:"file",name:"file_upload",className:"hidden"})]})})]})]},"part-".concat(l))})})]},"parts-section-".concat(l))}),(null==N?void 0:N.otherNotes)&&(0,s.jsxs)("div",{className:"mt-10 flex w-full flex-col",children:[(0,s.jsx)("h4",{className:"mb-5 flex justify-center",children:null==N?void 0:null===(e=N.otherNotes)||void 0===e?void 0:e.toUpperCase()}),(0,s.jsxs)("div",{className:"mb-8 flex flex-wrap items-center justify-center gap-5 md:mb-0 ",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(null===(l=ea(0))||void 0===l?void 0:l.FilePath)?(0,s.jsx)(x.eT,{fileData:ea(0),async onRemove(){let e=await A(ea(0).Id);if(e.ok){let l=[...k].filter(e=>e.Id!==ea(0).Id);I(l)}}}):(0,s.jsx)(x.G1,{onChange(e){W(e,0,0,!1)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:M("panoramic_photo")})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(null===(a=ea(1))||void 0===a?void 0:a.FilePath)?(0,s.jsx)(x.eT,{fileData:ea(1),async onRemove(){let e=await A(ea(1).Id);if(e.ok){let l=[...k].filter(e=>e.Id!==ea(1).Id);I(l)}}}):(0,s.jsx)(x.G1,{onChange(e){W(e,1,1,!1)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:M("detailed_photo")})]}),E[0]&&(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(null===(t=es(0))||void 0===t?void 0:t.FilePath)?(0,s.jsx)(x.eT,{fileData:es(0),async onRemove(){let e=await A(es(0).Id);if(e.ok){let l=[...E].filter(e=>e.Id!==es(0).Id);S(l)}}}):(0,s.jsx)(x.G1,{onChange(e){W(e,2,0,!0)},onRemove(){let e=[...E];e.pop(),S(e)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:"Друга снимка (1)"})]}),E[1]&&(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(null===(n=es(1))||void 0===n?void 0:n.FilePath)?(0,s.jsx)(x.eT,{fileData:es(1),async onRemove(){let e=await A(es(1).Id);if(e.ok){let l=[...E].filter(e=>(null==e?void 0:e.Id)!==es(1).Id);S(l)}}}):(0,s.jsx)(x.G1,{onChange(e){W(e,3,1,!0)},onRemove(){let e=[...E];e.pop(),S(e)}}),(0,s.jsx)("span",{className:"mt-1 text-center text-xs text-gray-500",children:"Друга снимка (2)"})]}),E.length<2&&(0,s.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center text-center",children:[(0,s.jsx)(v.zx,{className:"m-2 rounded-md bg-secondary px-5 py-3 font-sans text-sm uppercase hover:bg-primary md:m-0",label:"+",onClick(){let e=[...E];e.push({}),S(e)}}),(0,s.jsx)("span",{className:"mt-2 text-sm",children:"Други снимки"}),(0,s.jsx)("input",{type:"file",name:"file_upload",className:"hidden"})]})})]})]}),(0,s.jsx)("hr",{className:"mx-auto mt-10 mb-7 w-full border-secondary"}),(0,s.jsxs)("div",{className:"mb-8 flex w-full flex-col flex-wrap justify-center text-center",children:[(0,s.jsx)("span",{className:"flex justify-center text-gray-500",children:M("add_vin_and_mileage")}),(0,s.jsx)("span",{className:"flex justify-center text-gray-500",children:"При възможност двигателят да бъде стартиран и да се вижда ясно пълният пробег – ‚километраж‘."}),(0,s.jsx)("a",{href:"".concat(_.Xd.apiUrl,"/api/static-files/file/kasko-help"),download:!0,children:(0,s.jsx)("span",{className:"cursor-pointer text-secondary underline",children:M("directions")})})]}),(0,s.jsxs)("div",{className:"mx-auto mt-5 flex w-full flex-col flex-wrap items-center justify-around md:flex-row",children:[(0,s.jsxs)("div",{className:"flex w-fit flex-col items-center justify-center md:mb-0 ",children:[(0,s.jsxs)("div",{className:"mb-5 flex min-w-[150px] justify-center",children:[(0,s.jsxs)("span",{className:"font-bold",children:[M("vin_number"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"mb-5 flex w-full flex-col items-center md:mb-0",children:[(null===(i=B[0])||void 0===i?void 0:i.FilePath)?(0,s.jsx)(x.eT,{fileData:B[0],onRemove(){A(B[0].Id).then(e=>{if(e.ok){let l=[...B];l.pop(),V(l)}})}}):(0,s.jsx)(x.G1,{onChange(e){$(e,5,0)}}),(0,s.jsx)("span",{className:"mt-1 flex w-2/3 justify-center text-center text-xs text-gray-500",children:M("detailed_photo")})]})]}),(0,s.jsxs)("div",{className:"flex w-fit flex-col items-center justify-center md:mb-0",children:[(0,s.jsxs)("div",{className:"mb-5 flex min-w-[150px] justify-center",children:[(0,s.jsxs)("span",{className:"font-bold",children:[M("dashboard"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col items-center",children:[(null===(c=U[0])||void 0===c?void 0:c.FilePath)?(0,s.jsx)(x.eT,{fileData:U[0],onRemove(){A(U[0].Id).then(e=>{if(e.ok){let l=[...U];l.pop(),Y(l)}})}}):(0,s.jsx)(x.G1,{onChange(e){$(e,6,0)}}),(0,s.jsx)("span",{className:"mt-1 flex w-2/3 justify-center text-center text-xs text-gray-500",children:M("detailed_photo")})]})]})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 w-fit -translate-x-1/2 -translate-y-1/2 transform rounded-lg border-2 border-solid border-secondary bg-lightGray py-1 px-3 text-center text-xs text-secondary",children:M("saved_as_draft")}),(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"})]}),(0,s.jsxs)("div",{className:"my-12 flex items-center justify-center gap-8",children:[(0,s.jsx)("button",{className:"h-12 w-12 text-secondary underline",onClick:()=>Q(),children:M("back")}),(0,s.jsx)(v.zx,{disabled:!1,className:"".concat("bg-secondary hover:bg-primary"," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:M("continue"),onClick:()=>g(ee,u)})]})]})},k=()=>{let e=(0,d.I0)(),l=(0,i.useRouter)(),a=(0,d.v9)(f.eE),t=(0,d.v9)(f.Il),n=(0,d.v9)(f.RC),c=(0,d.v9)(f.pc),m=(0,d.v9)(f.jK),u=(0,d.v9)(f.N6),h=(0,d.v9)(f.QU),b=(0,d.v9)(f.$Y),N=(0,d.v9)(f.my),y=(0,d.v9)(f.Ix),w=(0,d.v9)(f.dS),{locale:_}=l,C=(0,j.G3)(_),k=(0,d.v9)((0,o.XL)("General"));(0,r.useEffect)(()=>{let l=async()=>{await e((0,f.UK)({lang:C}))};l()},[C]);let I=async()=>{let s=await e((0,f.zy)({workflowCorrelationId:t,compensationType:n,serviceDetails:N,pendingBakAccount:m,bankAccountNumber:u,bankAccountHolder:h,otherCompensation:b,preferredClaimCenter:c})).unwrap();if(s.ok){l.push("/insurance-claim",void 0,{shallow:!0}),e((0,f.Bq)(s.data.NextStep));let i=[...a];i.push({PreviousStep:null,CurrentStep:"compensations-info",NextStep:null}),e((0,f._)(i))}},E=()=>{let l=[...a];e((0,f.Bq)(l[l.length-1].CurrentStep)),l.pop(),e((0,f._)(l))},S=(0,s.jsxs)("div",{className:"mt-8 flex w-full flex-wrap md:mt-5",children:[(0,s.jsx)("div",{className:"flex w-full items-center md:w-2/5",children:(0,s.jsxs)("span",{className:"font-bold",children:[k("official_service"),":"]})}),(0,s.jsx)("div",{className:"w-full md:w-3/5",children:(0,s.jsx)(x.oi,{onChange:l=>e((0,f.lw)(l.target.value)),value:N})})]}),M=(0,s.jsxs)("div",{className:"mt-8 flex w-full flex-wrap md:mt-5",children:[(0,s.jsx)("div",{className:"flex w-full items-center md:w-2/5",children:(0,s.jsxs)("span",{className:"font-bold",children:[k("trusted_service"),":"]})}),(0,s.jsx)("div",{className:"w-full md:w-3/5",children:(0,s.jsx)(x.oi,{onChange:l=>e((0,f.lw)(l.target.value)),value:N})})]}),P=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-8 flex w-full flex-wrap md:mt-5",children:[(0,s.jsxs)("div",{className:"flex w-full items-center md:w-2/5",children:[(0,s.jsx)("span",{className:"font-bold",children:"IBAN:"}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"w-full md:w-3/5",children:[(0,s.jsx)(x.oi,{onChange:l=>e((0,f.au)(l.target.value.trimEnd())),defaultValue:u,invalidMessage:k("invalid_data")}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:k("iban_info")})]})]}),(0,s.jsxs)("div",{className:"mt-8 flex w-full flex-wrap",children:[(0,s.jsxs)("div",{className:"flex w-full items-center md:w-2/5",children:[(0,s.jsxs)("span",{className:"font-bold",children:[k("holder"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("div",{className:"w-full md:w-3/5",children:(0,s.jsx)(x.oi,{onChange:l=>e((0,f.eR)(l.target.value.trimEnd())),defaultValue:h,invalidMessage:k("field_only_cyrilic")})})]})]}),T=()=>{F&&g(I,e)},R=(0,r.useCallback)(e=>!!e&&!!e.match(j.fy)||!!e&&!!e.match(j.ej),[]),q=(0,r.useMemo)(()=>R(u),[R,u]),G=(0,r.useCallback)(e=>!!e&&!!e.match(j.BI),[]);(0,r.useMemo)(()=>G(h),[G,h]),(0,r.useEffect)(()=>{e((0,f.Pz)({}))},[]);let F="0"!=n&&0!=c&&null!=n&&(("3"==n||"4"==n)&&(m||!m&&q&&""!==h)||"1"==n&&(m||!m&&N)||"2"==n&&(m||!m&&N));return(0,s.jsxs)("div",{className:"w-full px-2 md:w-3/4 md:px-0",children:[(0,s.jsx)(x.$J,{children:k("method_of_indemnification")}),(0,s.jsx)("span",{className:"mb-8 flex w-full justify-center text-gray-500",children:k("method_of_damage_removal")}),(0,s.jsxs)("div",{className:"mt-5 flex w-full flex-wrap",children:[(0,s.jsxs)("div",{className:"flex w-full items-center md:w-2/5",children:[(0,s.jsxs)("span",{className:"font-bold",children:[k("method_of_indemnification"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("div",{className:"w-full md:w-3/5",children:y&&(0,s.jsx)(v.Lt,{getCustomStyles:p.K,options:(0,j.bC)(y),onChange:l=>e((0,f.By)(l.value)),defaultValue:(0,j.id)(n,y)})})]}),(0,s.jsxs)("div",{className:"mt-5 flex w-full flex-wrap",children:[(0,s.jsxs)("div",{className:"flex w-full items-center md:w-2/5",children:[(0,s.jsxs)("span",{className:"font-bold",children:[k("preferred_claim_center"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("div",{className:"w-full md:w-3/5",children:w&&(0,s.jsx)(v.Lt,{getCustomStyles:p.K,options:(0,j.bC)(w),onChange:l=>e((0,f.sH)(l.value)),defaultValue:(0,j.id)(c,w)})})]}),(0,s.jsx)("hr",{className:"mx-auto mt-10 mb-7 w-full border-secondary"}),(0,s.jsx)("span",{className:"mb-10 flex w-full justify-center text-gray-500",children:k("please_add_compensation_data")}),(0,s.jsxs)("div",{className:"mt-8 flex justify-between",children:[(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsxs)("span",{className:"font-bold",children:[k("provide_later"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsxs)("div",{className:"flex",children:[(0,s.jsx)("div",{className:"mr-4 flex items-center",children:(0,s.jsx)(x.EU,{name:"provide-later",value:!1,onChange:l=>e((0,f.ks)(!1)),labelRight:(0,s.jsx)("span",{className:"text-base",children:k("no")}),id:"provide-later-no",defaultChecked:!m})}),(0,s.jsx)(x.EU,{name:"provide-later",value:!0,onChange:l=>e((0,f.ks)(!0)),labelRight:(0,s.jsx)("span",{className:"text-base",children:k("yes")}),id:"provide-later-yes",defaultChecked:m})]})]}),"0"!=n&&"1"==n&&!m&&S,"0"!=n&&"2"==n&&!m&&M,"0"!=n&&("3"==n||"4"==n)&&!m&&P,(0,s.jsxs)("div",{className:"mt-8 flex w-full justify-between",children:[(0,s.jsx)("div",{className:"flex w-4/6",children:(0,s.jsxs)("span",{className:"font-bold",children:[k("is_compensation_received"),":"]})}),(0,s.jsxs)("div",{className:"flex w-2/6 items-center justify-end",children:[(0,s.jsx)("div",{className:"mr-4 flex items-center",children:(0,s.jsx)(x.EU,{name:"receiving-compensation",value:!1,onChange:l=>e((0,f.Qb)(!1)),labelRight:(0,s.jsx)("span",{className:"text-base",children:k("no")}),id:"receiving-compensation-no",defaultChecked:!b})}),(0,s.jsx)(x.EU,{name:"receiving-compensation",value:!0,onChange:l=>e((0,f.Qb)(!0)),labelRight:(0,s.jsx)("span",{className:"text-base",children:k("yes")}),id:"receiving-compensation-yes",defaultChecked:b})]})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute top-1/2 left-1/2 w-fit -translate-x-1/2 -translate-y-1/2 transform rounded-lg border-2 border-solid border-secondary bg-lightGray py-1 px-3 text-center text-xs text-secondary",children:k("saved_as_draft")}),(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"})]}),(0,s.jsx)("span",{className:"mb-8 flex w-full justify-center text-xs text-gray-500",children:k("compensation_will_be_confirmed")}),(0,s.jsxs)("div",{className:"my-12 flex items-center justify-center gap-8",children:[(0,s.jsx)("button",{className:"h-12 w-12 text-secondary underline",onClick:()=>E(),children:k("back")}),(0,s.jsx)(v.zx,{disabled:!F,className:"".concat(F?"bg-secondary hover:bg-primary":""," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:k("continue"),onClick:T})]})]})};var I=a(1664),E=a.n(I);let S=()=>{let e=(0,d.I0)(),l=(0,d.v9)(f.cQ),[a,t]=(0,r.useState)(""),[n,i]=(0,r.useState)(""),[c,m]=(0,r.useState)(!1),u=(0,d.v9)((0,o.XL)("General")),h=(0,r.useCallback)(e=>!!e&&!!e.match(j.HN),[]),p=(0,r.useMemo)(()=>h(l),[l]),g=a&&n&&p&&c,b=async()=>{if(g){await e((0,f.ft)({policyNumber:a.trimEnd(),carRegistrationNumber:n.trimEnd(),email:l.trimEnd()})).unwrap();let s=[];s.push({PreviousStep:null,CurrentStep:"claim-as-guest",NextStep:"car-owner-info"}),e((0,f._)(s))}};return(0,s.jsxs)("div",{className:"w-3/4",children:[(0,s.jsx)(x.$J,{children:u("policy_data")}),(0,s.jsx)("span",{className:"mb-2 flex w-full justify-center text-gray-500",children:u("please_fill_insurance_event_data")}),(0,s.jsx)("span",{className:"mb-8 flex w-full text-sm justify-center text-error",children:u("armeec_instant_report_text")}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 py-5 md:flex-row md:gap-16",children:[(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.oi,{title:u("policy_number"),invalidMessage:u("invalid_number"),onChange:e=>t(e.target.value.trimEnd()),required:!0})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.oi,{title:u("vehicle_license_plate"),onChange(e){(0,j.lH)(e),i(e.target.value.trimEnd())},required:!0})})]}),(0,s.jsx)("div",{className:"flex w-full flex-col justify-center gap-0 py-5 md:flex-row md:gap-16",children:(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 md:w-1/2 lg:mb-0",children:(0,s.jsx)(x.oi,{title:u("email"),invalid:!!l&&!p,invalidMessage:u("invalid_email"),required:!0,onChange:l=>e((0,f.vV)(l.target.value.trimEnd()))})})}),(0,s.jsx)("hr",{className:"mb-12 mt-8 w-full border-secondary"}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(v.XZ,{onClick:()=>m(!c),labelRight:(0,s.jsxs)("p",{className:"inline-block",children:[u("i_agree_with"),"\xa0",(0,s.jsx)(E(),{target:"_blank",rel:"noopener noreferrer",passHref:!0,href:"/about-us/terms-and-conditions",children:(0,s.jsx)("span",{className:"cursor-pointer text-secondary",children:u("general_conditions")})}),"\xa0",u("for_using_the_service"),"."]})})}),(0,s.jsx)("div",{className:"my-12 flex justify-center",children:(0,s.jsx)(v.zx,{disabled:!g,className:"".concat(g?"bg-secondary hover:bg-primary":""," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:u("continue"),onClick:()=>b()})}),(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsx)("p",{className:"flex justify-center mt-5",children:(0,s.jsx)(E(),{target:"_blank",rel:"noopener noreferrer",passHref:!0,href:"/accident-insurance",children:(0,s.jsx)("span",{className:"cursor-pointer text-secondary",children:"Процедура за завеждане на щети по застраховки Злополука"})})}),(0,s.jsx)("p",{className:"flex justify-center mt-3",children:(0,s.jsx)(E(),{target:"_blank",rel:"noopener noreferrer",passHref:!0,href:"/property-insurance",children:(0,s.jsx)("span",{className:"cursor-pointer text-secondary",children:"Процедура за завеждане на щети по имуществени застраховки"})})})]})]})},M=()=>{let e=(0,d.I0)(),l=(0,d.v9)(f.Il),a=(0,d.v9)(f.v9);(0,d.v9)(f.it);let t=(0,d.v9)((0,o.XL)("General")),n=(0,d.v9)(f.eE),[i,c]=(0,r.useState)(""),[m,u]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[b,N]=(0,r.useState)(""),[y,w]=(0,r.useState)(""),[_,C]=(0,r.useState)(""),k=(0,r.useCallback)(e=>!!e&&!!e.match(j.mS),[]),I=(0,r.useMemo)(()=>k(i),[k,i]),E=(0,r.useCallback)(e=>!!e&&!!e.match(j.yJ),[]),S=(0,r.useMemo)(()=>E(h),[E,h]),M=(0,r.useMemo)(()=>E(b),[E,b]),P=(0,r.useMemo)(()=>E(y),[E,y]),T=e=>{1===a?c(e):u(e)},R=1==a&&I&&S&&M&&P||3==a&&_.length>0,q=async()=>{try{if(R){let s=await e((0,f.uO)({workflowCorrelationId:l,pid:1===a?i:m,pidType:a,firstName:h,middleName:b,lastName:y,fullName:_})).unwrap();if(s){let t=[...n];t.push({PreviousStep:null,CurrentStep:"car-owner-info",NextStep:null}),e((0,f._)(t))}}}catch(r){(null==r?void 0:r.message)==="Error_401"&&(e(closeDialog()),e(showDialog({type:"Login",a:{}})),e(showDialog({type:"Error",message:"Моля въведете данните си за вход, за да продължите!"})))}},G=()=>{let l=[...n];e((0,f.Bq)(l[0].CurrentStep)),l.pop(),e((0,f._)(l))};return(0,s.jsxs)("div",{className:"w-3/4",children:[(0,s.jsx)(x.$J,{children:t("vehicle_owner_data")}),(0,s.jsx)("span",{className:"mb-8 flex w-full justify-center text-gray-500",children:t("please_fill_insurance_event_data")}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 py-5 md:flex-row md:gap-16",children:[(0,s.jsxs)("div",{className:"mb-8 flex w-full flex-col items-center md:mb-0 lg:mb-0",children:[(0,s.jsxs)("div",{className:"mb-2 flex self-start",children:[(0,s.jsx)("div",{className:"mr-4 flex items-center",children:(0,s.jsx)(x.EU,{name:"interior-ministry",value:1,labelRight:(0,s.jsx)("p",{className:"text-sm font-bold",children:t("egn")}),id:"interior-ministry-no",onChange:()=>e((0,f.C6)(1)),defaultChecked:!0})}),(0,s.jsx)(x.EU,{name:"interior-ministry",value:3,labelRight:(0,s.jsx)("p",{className:"text-sm font-bold",children:t("eik")}),id:"interior-ministry-yes",onChange:()=>e((0,f.C6)(3))})]}),(0,s.jsx)(x.oi,{invalidMessage:1==a&&t("invalid_pin"),onChange:e=>T(e.target.value.trimEnd()),invalid:!!i&&!I&&1===a,value:1===a?i:m})]}),1==a?(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.oi,{title:t("name"),invalidMessage:t("field_only_cyrilic"),onChange:e=>p(e.target.value.trimEnd()),value:h,required:!0,invalid:!!h&&!S})}):(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.oi,{title:t("name"),onChange:e=>C(e.target.value),required:!0,value:_,invalid:!!_&&!(()=>_.length>0)})})]}),1==a?(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 py-5 md:flex-row md:gap-16",children:[(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.oi,{title:t("surname"),invalidMessage:t("field_only_cyrilic"),onChange:e=>N(e.target.value.trimEnd()),required:!0,value:b,invalid:!!b&&!M})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.oi,{title:t("lastname"),invalidMessage:t("field_only_cyrilic"),onChange:e=>w(e.target.value.trimEnd()),required:!0,value:y,invalid:!!y&&!P})})]}):null,(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"}),(0,s.jsxs)("div",{className:"my-12 flex items-center justify-center gap-8",children:[(0,s.jsx)("button",{className:"h-12 w-12 text-secondary underline",onClick:()=>G(),children:t("back")}),(0,s.jsx)(v.zx,{disabled:!R,className:"".concat(R?"bg-secondary hover:bg-primary":""," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:t("continue"),onClick:()=>g(q,e)})]})]})};var P=a(9800);let T=()=>{let e=(0,d.I0)(),l=(0,d.v9)(f.Il),a=(0,d.v9)(f.eE),t=(0,d.v9)(f.v9),[n,c]=(0,r.useState)(""),[m,u]=(0,r.useState)(null),[h,b]=(0,r.useState)(null),[N,y]=(0,r.useState)(null),[w,_]=(0,r.useState)(null),[C,k]=(0,r.useState)(null),[I,E]=(0,r.useState)(null),[S,M]=(0,r.useState)(null),[T,R]=(0,r.useState)(null),[q,G]=(0,r.useState)(null),[F,D]=(0,r.useState)(null),[L,B]=(0,r.useState)(null),[V,U]=(0,r.useState)(null),[Y,H]=(0,r.useState)(null),[K,X]=(0,r.useState)(null),[z,J]=(0,r.useState)(!1),[O,Q]=(0,r.useState)(!1),[A,$]=(0,r.useState)(!1),Z=(0,d.v9)(f.Ed),W=(0,d.v9)(f.LS),ee=(0,d.v9)(P.Qb),el=(0,i.useRouter)(),{locale:ea}=el,es=(0,j.G3)(ea),et=(0,d.v9)((0,o.XL)("General")),en=()=>{let l=[...a];e((0,f.Bq)(l[l.length-1].CurrentStep)),l.pop(),e((0,f._)(l))},ei=async l=>{let a=await e((0,f.wR)({city:l,lang:es}));return a.payload.data.cities},er=(0,r.useCallback)(e=>!!e&&!!e.match(j.Uo),[]),ed=(0,r.useMemo)(()=>er(m),[er,m]),ec=(0,r.useCallback)(e=>!!e&&!!e.match(j.yJ),[]),em=(0,r.useMemo)(()=>ec(h),[ec,h]),eo=(0,r.useMemo)(()=>ec(N),[ec,N]),ex=(0,r.useMemo)(()=>ec(w),[ec,w]),ef=(0,r.useCallback)(e=>!!e&&!!e.match(j.$B)||!!e&&!!e.match(j.mS),[]),eu=(0,r.useMemo)(()=>ef(C),[ef,C]),eh=(0,r.useCallback)(e=>!!e&&!!e.match(j.fm),[]),ev=(0,r.useMemo)(()=>eh(S),[eh,S]);(0,r.useEffect)(()=>{e((0,f.RX)({}))},[]),(0,r.useEffect)(()=>{I&&M(I.post_code)},[I]),(0,r.useEffect)(()=>{$(!1),Q(!1),q||F&&"0"!==F||L&&"0"!==L||Y&&"0"!==Y||K&&"0"!==K||($(!0),Q(!0)),!L&&!Y&&!K||(L&&"0"!==L&&Y&&"0"!==Y&&K&&"0"!==K?$(!1):(!L||T&&Y&&"0"!==Y&&K&&"0"!==K)&&(!Y||T&&L&&"0"!==L&&K&&"0"!==K)&&(!K||T&&L&&"0"!==L&&Y&&"0"!==Y)||$(!0)),(q||F)&&(q&&F?Q(!1):Q(!0))},[T,q,F,L,Y,K]);let ep=async()=>{let s=await e((0,f.P3)({workflowCorrelationId:l,claimPartnerType:n.value,pid:C,firstName:h,middleName:N,lastName:w,cityBg:null==I?void 0:I.code,postcode:S,street:q,streetNo:F,district:T,building:L,entrance:V,floor:Y,apartment:K,mobile:m})).unwrap();if(s){let t=[...a];t.push({PreviousStep:null,CurrentStep:"current-user-info",NextStep:null}),e((0,f._)(t)),e((0,f.Bq)("event-info"))}},ej=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"}),(0,s.jsx)("div",{className:"mt-8 flex w-full justify-center",children:(0,s.jsx)("div",{className:"flex w-full md:w-2/4",children:(0,s.jsx)(x.oi,{title:et("phone"),invalidMessage:et("phone_number_info"),onChange:e=>u(e.target.value.trimEnd()),required:!0,invalid:!!m&&!ed})})})]}),eg=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-16 md:py-5",children:[(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(x.oi,{title:et("name"),invalidMessage:et("field_only_cyrilic"),onChange:e=>b(e.target.value.trimEnd()),required:!0,invalid:!!h&&!em})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(x.oi,{title:et("surname"),invalidMessage:et("field_only_cyrilic"),onChange:e=>y(e.target.value.trimEnd()),required:!0,invalid:!!N&&!eo})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0",children:(0,s.jsx)(x.oi,{title:et("lastname"),invalidMessage:et("field_only_cyrilic"),onChange:e=>_(e.target.value.trimEnd()),required:!0,invalid:!!w&&!ex})})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 py-5 md:flex-row md:gap-16",children:[(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.oi,{title:et("egn"),invalidMessage:et("invalid_pin"),onChange:e=>k(e.target.value.trimEnd()),required:!0,invalid:!!C&&!eu})}),(0,s.jsx)("div",{className:"mb-8 flex w-full flex-col md:mb-0 lg:mb-0",children:(0,s.jsx)(x.oi,{title:et("phone"),invalidMessage:et("invalid_data"),onChange:e=>u(e.target.value.trimEnd()),required:!0,invalid:!!m&&!ed})})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 md:flex-row md:gap-5 md:pt-5",children:[(0,s.jsx)("div",{className:"mb-8 flex flex-col md:mb-0 md:w-5/12",children:(0,s.jsx)(x.xg,{required:!0,getCustomStyles:p.K,citiesOptions:W,fetchCities:ei,onChange:e=>E(e)})}),(0,s.jsx)("div",{className:"mb-8 flex flex-col md:mb-0 md:w-3/12",children:(0,s.jsx)(x.oi,{title:et("post_code"),invalidMessage:et("invalid_post_code"),onChange:e=>M(e.target.value.trimEnd()),required:!0,invalid:!!S&&!ev,value:S})}),(0,s.jsx)("div",{className:"flex flex-col md:w-4/12",children:(0,s.jsx)(x.oi,{title:et("district"),onChange:e=>R(e.target.value.trimEnd()),invalidMessage:et("fill_district"),invalid:z&&(Y||K||L||"0"===T||!Y&&!K&&!L&&!q&&!F)&&(!T||"0"===T)})})]}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-0 pt-5 md:flex-row md:gap-1",children:[(0,s.jsxs)("div",{className:"mb-5 flex flex-col md:mb-0 md:w-7/12",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col md:flex-row md:gap-1",children:[(0,s.jsx)("div",{className:"flex flex-col md:mb-0 md:w-10/12 lg:mb-0",children:(0,s.jsx)(x.oi,{title:"".concat(et("boulevard"),"/").concat(et("street")),onChange:e=>G(e.target.value.trimEnd()),invalid:z&&O&&(!q||"0"===q),invalidMessage:" "})}),(0,s.jsx)("div",{className:"flex flex-col md:mb-0 md:w-2/12 lg:mb-0",children:(0,s.jsx)(x.oi,{title:"№",onChange:e=>D(e.target.value.trimEnd()),placeholder:" ",invalid:z&&O&&(!F||"0"===F),invalidMessage:" "})})]}),z&&O&&(0,s.jsx)("span",{className:"text-xs text-error",children:et("please_fill_street_boulevard")})]}),(0,s.jsxs)("div",{className:"mt-10 flex justify-center text-xs text-gray-500 md:w-1/12 lg:w-1/12",children:[et("and"),"/",et("or")]}),(0,s.jsxs)("div",{className:"flex flex-col md:w-6/12",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col md:flex-row md:gap-1",children:[(0,s.jsx)("div",{className:"mb-5 flex flex-col md:mb-0 md:w-3/12",children:(0,s.jsx)(x.oi,{title:et("building"),onChange:e=>B(e.target.value.trimEnd()),placeholder:" ",invalid:z&&A&&(!L||"0"===L),invalidMessage:" "})}),(0,s.jsx)("div",{className:"flex flex-col md:w-3/12",children:(0,s.jsx)(x.oi,{title:et("entrance"),onChange:e=>U(e.target.value.trimEnd()),invalid:z&&A&&"0"===V,invalidMessage:" ",placeholder:" "})}),(0,s.jsx)("div",{className:"mb-5 flex flex-col md:mb-0 md:w-3/12 lg:mb-0",children:(0,s.jsx)(x.oi,{title:et("floor"),onChange:e=>H(e.target.value.trimEnd()),placeholder:" ",invalid:z&&A&&(!Y||"0"===Y),invalidMessage:" "})}),(0,s.jsx)("div",{className:"mb-5 flex flex-col md:mb-0 md:w-3/12 lg:mb-0",children:(0,s.jsx)(x.oi,{title:et("apartment"),onChange:e=>X(e.target.value.trimEnd()),placeholder:" ",invalid:z&&A&&(!K||"0"===K),invalidMessage:" "})})]}),z&&A&&(!L||"0"===L||!Y||"0"===Y||!K||"0"===K)&&(0,s.jsx)("span",{className:"text-xs text-error",children:et("please_enter_building")})]})]})]}),eb=n&&("1"===n.value&&!ee&&ed||("2"===n.value||"3"===n.value)&&!ee&&ed&&em&&eo&&ex&&eu&&I&&ev||("2"===n.value||"3"===n.value)&&ee),eN=()=>{if(ee||"2"!==n.value&&"3"!==n.value)g(ep,e);else{if(J(!0),"0"===T||"0"===q||"0"===F||"0"===L||"0"===V||"0"===Y||"0"===K){if("0"===q||"0"===F)return Q(!0);if("0"===L||"0"===V||"0"===Y||"0"===K)return $(!0);if("0"===T)return}(q&&"0"!==q&&F&&"0"!==F||T&&"0"!==T&&q&&"0"!==q&&F&&"0"!==F||T&&"0"!==T&&L&&"0"!==L&&Y&&"0"!==Y&&K&&0!=K)&&g(ep,e),(q&&!F||!q&&F)&&(Q(!0),$(!1)),(!T||L&&Y&&K||q||F)&&(!L||T&&Y&&"0"!==Y&&K&&"0"!==K)&&(!Y||T&&L&&"0"!==L&&K&&"0"!==K)&&(!K||T&&L&&"0"!==L&&Y&&"0"!==Y)||($(!0),Q(!1))}};return(0,s.jsxs)("div",{className:"w-3/4",children:[(0,s.jsx)(x.$J,{children:et("user_data")}),(0,s.jsx)("span",{className:"mb-8 flex w-full justify-center text-gray-500",children:et("please_fill_insurance_event_data")}),(0,s.jsxs)("div",{className:"mt-8 flex w-full flex-wrap md:mt-5",children:[(0,s.jsxs)("div",{className:"flex w-full items-center md:w-2/5",children:[(0,s.jsxs)("span",{className:"font-bold",children:[et("person_is"),":"]}),(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("div",{className:"w-full py-5 md:w-3/5",children:(0,s.jsx)(v.Lt,{getCustomStyles:p.K,options:(e=>{let l=[];return(e&&e.forEach(e=>{let a={id:e.id,value:e.code,label:e.name};l.push(a)}),ee||3==t)?l.filter(e=>"1"!==e.value):l})(Z),onChange:e=>c(e)})})]}),n&&"1"===n.value&&!ee&&ej,n&&(!ee&&"2"===n.value||!ee&&"3"===n.value)&&eg,(0,s.jsx)("hr",{className:"mb-12 mt-12 w-full border-secondary"}),(0,s.jsxs)("div",{className:"my-12 flex items-center justify-center gap-8",children:[(0,s.jsx)("button",{className:"h-12 w-12 text-secondary underline",onClick:()=>en(),children:et("back")}),(0,s.jsx)(v.zx,{disabled:!eb,className:"".concat(eb?"bg-secondary hover:bg-primary":""," m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0"),label:et("continue"),onClick:eN})]})]})},R=()=>{let e=(0,d.I0)(),l=(0,d.v9)(f.cQ);(0,d.v9)(f.it);let a=(0,d.v9)(f.Il),t=(0,d.v9)(P.Qb),n=(0,d.v9)(f.J9),i=(0,d.v9)((0,o.XL)("General")),c=async l=>await e((0,f.tl)({workflowCorrelationId:a,shouldLogIn:l})).unwrap(),x=async()=>{e((0,m.vC)({type:"Login",data:l}))},u=async()=>{let l=c(!1);l.ok&&e((0,f.Bq)(l.data.NextStep))};return(0,r.useEffect)(()=>{if(t&&a){let l=c(!0);l.ok&&e((0,f.Bq)(l.data.NextStep))}},[t]),(0,s.jsx)("div",{className:"pt-32 pb-48 text-center",children:"should-user-login"===n&&!t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"px-7 py-3",children:(0,s.jsxs)("p",{className:"text-sm text-gray-500",children:[i("want_to_login"),"?"]})}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-5 mx-auto px-4 py-3",children:[(0,s.jsx)(v.zx,{className:"bg-secondary hover:bg-primary m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0",label:i("yes"),onClick:()=>x()}),(0,s.jsx)(v.zx,{className:"bg-secondary hover:bg-primary m-2 rounded-md px-10 py-3 font-sans text-sm uppercase md:m-0",label:i("no"),onClick:()=>u()})]})]})})},q=()=>{let e=(0,i.useRouter)(),l=(0,d.I0)(),a=(0,d.v9)(f.oB),t=(0,d.v9)(f.J9),r=(0,d.v9)((0,o.XL)("General"));return(0,s.jsxs)("div",{className:"w-3/4",children:[(0,s.jsxs)("div",{className:"flex w-full flex-col pt-5",children:[a&&(0,s.jsxs)("div",{className:"mx-auto flex flex-col gap-10",children:[(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(n(),{src:c.nQ,alt:"check icon"})}),(0,s.jsxs)("div",{className:"flex text-center text-3xl font-bold",children:[r("casco_claim")," № ",a," ",r("created_successfully"),"!"]})]}),"finalize-with-create"===t&&(0,s.jsxs)("div",{className:"mt-5 flex text-center text-2xl",children:[r("follow_email_link"),"."]}),"finalize-with-create"!==t&&(0,s.jsx)("div",{className:"mt-3 flex justify-center",children:(0,s.jsx)(E(),{onClick:()=>l((0,f.oA)()),passHref:!0,href:"/my-profile",children:(0,s.jsx)("span",{className:"flex cursor-pointer items-center text-sm uppercase text-secondary underline",children:r("my_profile")})})}),(0,s.jsx)("div",{className:"mt-5 border-2 border-red-500 px-1 text-center text-xs font-bold text-red-500",children:r("insurance_claim_success_warning_message")})]}),(0,s.jsx)("div",{className:"mt-52 mb-12 flex justify-center gap-8",children:(0,s.jsx)(v.zx,{className:"m-2 rounded-md bg-secondary px-10 py-3 font-sans text-sm uppercase hover:bg-primary md:m-0",label:"OK",onClick(){e.push("/"),l((0,f.oA)())}})})]})},G={"claim-as-guest":S,"car-owner-info":M,"current-user-info":T,"event-info":b,"damaged-parts":N,"documents-info":y,"driver-info":w,"check-images":C,"should-user-login":R,"compensations-info":k,"finalize-without-create":q,"finalize-with-create":q},F=()=>{let e=(0,d.I0)(),l=(0,i.useRouter)(),a=(0,d.v9)(f.eE),t=(0,d.v9)(f.J9),u=(0,d.v9)(f.Il),h=(0,d.v9)(f.cV),v=(0,d.v9)(P.Qb),[p,j]=(0,r.useState)(null),g=l.query.draft,b=(0,d.v9)((0,o.XL)("General")),N=async()=>{let l=await e((0,f.KO)({workflowCorrelationId:g})).unwrap();if(l.ok)return null===p&&j(l.data.Data.CurrentUserInfo.IsGuest),await e((0,f.NX)({workflowCorrelationId:l.data.Data.WorkflowCorrelationId})).unwrap()};return(0,r.useEffect)(()=>{h&&e((0,m.vC)({type:"Info",message:"Вашето фамилно име е различно. Моля, променете името си в офис на Армеец.",onClick:()=>e((0,f.t4)(!1))}))},[h,e]),(0,r.useEffect)(()=>{if(a){var e;let l=[...a];(null===(e=l[l.length-1])||void 0===e?void 0:e.CurrentStep)===t&&N()}},[t]),(0,r.useEffect)(()=>{g&&N()},[g]),(0,r.useEffect)(()=>{u&&l.push("/insurance-claim?draft=".concat(u),void 0,{shallow:!0})},[u]),(0,r.useEffect)(()=>{!1===p&&!1===v&&"should-user-login"!==t&&e((0,m.vC)({type:"Login",a:{}}))},[p]),(0,s.jsxs)("div",{className:"mx-auto flex max-w-registrationForm flex-col justify-center bg-lightGray p-2",children:[(0,s.jsxs)("div",{className:"mx-auto grid w-full grid-cols-5 items-end p-5 md:w-3/4",children:[(0,s.jsx)("div",{className:"col-start-1",children:(0,s.jsx)("button",{className:"text-secondary underline",onClick(){e((0,f.oA)()),l.push("/"),e((0,f.Bq)("claim-as-guest"))},children:b("home")})}),(0,s.jsx)("div",{className:"col-start-3",children:(0,s.jsx)(n(),{src:c.SS,width:100,alt:"armeetz logo"})})]}),(0,s.jsx)("hr",{className:"mx-auto w-full border-secondary md:w-3/4"}),(0,s.jsxs)("div",{className:"mt-12 flex flex-col justify-center text-center",children:[(0,s.jsx)("h1",{className:"font-bold",children:b("casco_claim")}),(0,s.jsx)("h1",{className:"font-regular text-xl uppercase",children:b("vehicle_casco")})]}),"claim-as-guest"!==t&&"current-user-info"!==t&&"car-owner-info"!==t&&"should-user-login"!==t&&(0,s.jsx)("div",{className:"mt-12 flex flex-col items-center justify-center",children:(0,s.jsx)(x.ko,{activeStep:t,totalSteps:7,kasko:!0})}),(0,s.jsx)("div",{className:"mt-12 flex items-center justify-center",children:t&&(0,s.jsx)(x.YD,{currentStep:t,steps:G})})]})};var D=a(7849);function L(){return(0,s.jsxs)("div",{className:"bg-lightGray",children:[(0,s.jsx)(F,{}),(0,s.jsx)(D.Z,{})]})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=5748)}),_N_E=e.O()}]);