"use strict";(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[3382],{78773:function(e,n,t){t.d(n,{G:function(){return r}});var r="__subscription_add_another_card__"},47683:function(e,n,t){t.d(n,{L3:function(){return _},Lo:function(){return N},ze:function(){return C}});var r=t(40568),a=t(2445),i=t(73884),l=t(36814),o=t(84655),s=t(59850),c=t(84091),d=t(9934),u=t(63231),p=t(42280),f=t(73419),m=t(6442),h=t(39755),g="10_percent",x="100_percent",v="full_payment",y="subscription",b=["bind_card","subscription"];function C(e){var n=(0,r.A)(e.split("-"),4);return{provider:n[0],paymentVia:n[1],paymentType:n[2],providerTitle:n[3]}}var N=function(e){return!!e&&b.includes(C(e).paymentType)},_=function(e,n){return N(n)?1:e};n.Ay=function(e){var n=e.hospitalId,t=e.doctorId,r=(0,f.$)().locale,C=(0,m.A)().formatMessage,N=(0,i.useState)(!0),_=N[0],Y=N[1],k=(0,i.useState)(),A=k[0],w=k[1],M=(0,h.C)(),F=M.providers,D=M.setProviders,L=M.selectedPaymentValue,S=(0,p.Jf)();(0,i.useEffect)((function(){S.setProviders(F)}),[F]),(0,i.useEffect)((function(){S.setSelectedPaymentValue(L)}),[L]),(0,i.useEffect)((function(){return p.Jf.subscribe((function(e){var n,t=h.C.getState();(e.selectedPaymentValue!==t.selectedPaymentValue&&t.setSelectedPaymentValue(e.selectedPaymentValue),e.selectedSubPaymentValue!==t.selectedSubPaymentValue&&t.setSelectedSubPaymentValue(e.selectedSubPaymentValue),e.openOnlineBanking!==t.openOnlineBanking)&&t.setOpenOnlineBanking(null!==(n=e.openOnlineBanking)&&void 0!==n&&n)}))}),[]);var P=(0,i.useMemo)((function(){var e=F.filter((function(e){return e.payment_type===g})),n=F.filter((function(e){return e.payment_type===v})),t=F.filter((function(e){return e.payment_type===x})),r=F.filter((function(e){var n=e.payment_type;return b.includes(n)}));return{ten_percent:e,full_payment:n,one_hundred_percent:t,subscription:r}}),[F]),B=P.subscription.length>0,O=(0,i.useMemo)((function(){var e=[];return P.one_hundred_percent.length&&e.push({label:P.one_hundred_percent[0].display_label||C({id:"vaccination.payment.tabs.pay_100_percent",defaultMessage:"Pay 100%"}),value:x}),P.ten_percent.length&&e.push({label:P.ten_percent[0].display_label||C({id:"vaccination.payment.tabs.pay_10_percent",defaultMessage:"Pay 10% to Book"}),value:g}),P.full_payment.length&&e.push({label:P.full_payment[0].display_label||C({id:"vaccination.payment.tabs.buy_now_pay_later",defaultMessage:"Buy Now Pay Later"}),value:v}),e}),[P.ten_percent,P.full_payment,P.one_hundred_percent,P.subscription]);(0,i.useMemo)((function(){if(O.length){var e=O[0].value;L&&L.includes(v)&&(e=v),L&&L.includes(g)&&(e=g),L&&L.includes(x)&&(e=x),L&&L.includes(y)&&(e=y),w(e)}}),[O,L]);var j=(0,i.useMemo)((function(){return B?F:A===g?P.ten_percent:A===x?P.one_hundred_percent:A===v?P.full_payment:A===y?P.subscription:F}),[A,P,F,B]);return(0,i.useEffect)((function(){if(n){Y(!0);var e="teleconsult_payment_providers_".concat(n,"_").concat(t);o.W.withCached(e,(function(){return(0,c.px)((0,c.fK)(s.R.GET_VACCINATION_PAYMENT_PROVIDER,{locale:String(r),hospitalId:n,doctorId:"".concat(t||"")}),"GET")})).then((function(e){var n,t;(null===e||void 0===e||null===(n=e.data)||void 0===n||null===(t=n.items)||void 0===t?void 0:t.length)&&(D(e.data.items),Y(!1))}))}}),[n]),(0,a.FD)("div",{id:"payment-method-tele-step-1",className:"paymentMethod",children:[!B&&(0,a.Y)(u.A,{tabs:O,currentTab:A,onChangeTab:w}),(0,a.Y)(l.a,{className:"pt-[14px] bg-white",children:(0,a.FD)(l.a,{className:"px-4 pb-5 lg:pb-6",children:[B&&(0,a.Y)(l.a,{className:"flex justify-between items-center mb-3",children:(0,a.Y)("h2",{className:"text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold",children:C({id:"teleconsultation.payment.step2.payment_method",defaultMessage:"Payment Method"})})}),(0,a.Y)(d.A,{loading:_,options:B?F:j})]})})]})}},39755:function(e,n,t){t.d(n,{C:function(){return i},R:function(){return a}});var r=t(44745),a={RESULT:0,ONE:1,TWO:2},i=(0,r.vt)()((function(e){return{currentStep:a.ONE,setCurrentStep:function(n){return e((function(){return{currentStep:n}}))},providers:[],setProviders:function(n){return e((function(){return{providers:n}}))},setSelectedPaymentValue:function(n){return e((function(){return{selectedPaymentValue:n}}))},setSelectedSubPaymentValue:function(n){return e((function(){return{selectedSubPaymentValue:n}}))},setOpenOnlineBanking:function(n){return e((function(){return{openOnlineBanking:n}}))},setDoctorInfo:function(n){return e((function(){return{doctorInfo:n}}))},setSlotInfo:function(n){return e((function(){return{slotInfo:n}}))},setDate:function(n){return e((function(){return{date:n}}))},setScheduleId:function(n){return e((function(){return{scheduleId:n}}))},setPaymentResult:function(n){return e((function(){return{paymentResult:n}}))}}}))},85892:function(e,n,t){t.d(n,{A:function(){return A}});var r=t(2445),a=t(73884),i=t(36814),l=t(6442),o=t(84091),s=t(73419),c=t(8370),d=t(42280),u=t(95204),p=function(e){var n,t=e.product,a=e.currency,p=e.onSeeDetails,f=(0,l.A)().formatMessage,m=(0,s.$)().locale,h=(0,d.fQ)(),g=h.addAddon,x=h.selectedAddons,v=h.setAddonQuantity,y=x.find((function(e){return e.addon_product_id===t.id})),b=null!==(n=null===y||void 0===y?void 0:y.quantity)&&void 0!==n?n:0,C=(0,u.sq)(t),N=(0,o.nd)(f,(0,o.$g)(C,m),a),_=t.price>C?(0,o.nd)(f,(0,o.$g)(t.price,m),a):"";return(0,r.FD)(i.a,{className:"flex flex-col w-[150px] md:w-[160px] shrink-0 bg-white border-[0.5px] border-solid border-black/10 rounded-xl overflow-hidden",children:[(0,r.Y)(i.a,{className:"w-full h-[88px] md:h-[100px] overflow-hidden rounded-t-xl bg-neutral50",children:(0,r.Y)("img",{src:t.image||u.XS,alt:t.name,className:"w-full h-full object-cover"})}),(0,r.FD)(i.a,{className:"flex flex-col gap-0.5 px-2.5 pt-2 pb-2.5 flex-1",children:[(0,r.Y)("p",{className:"text-[12px] leading-[17px] tracking-[-0.2px] font-semibold text-[#111111] line-clamp-1",children:t.name}),(0,r.Y)("p",{className:"text-[11px] leading-4 tracking-[-0.2px] text-[#404040] line-clamp-1",children:t.short_description}),(0,r.Y)("button",{type:"button",onClick:function(){return p(t)},className:"text-[11px] leading-4 tracking-[-0.2px] font-medium text-[#2D87F3] text-left pt-px",children:f({id:"vaccination.payment.addon_see_details",defaultMessage:"See details"})}),(0,r.FD)(i.a,{className:"flex items-center gap-[5px] pt-[3px]",children:[(0,r.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] font-semibold text-[#111111]",children:N}),t.save_percentage>0&&(0,r.Y)("span",{className:"px-[5px] py-0.5 rounded bg-[#00B16A] text-[10px] leading-[14px] tracking-[-0.1px] font-medium text-white shrink-0",children:f({id:"vaccination.payment.addon_save_percent",defaultMessage:"Save {percent}%"},{percent:t.save_percentage})})]}),_&&(0,r.Y)("p",{className:"text-[11px] leading-4 tracking-[-0.2px] text-[#BFBFBF] line-through pt-px",children:_}),(0,r.Y)(i.a,{className:"pt-1.5 mt-auto",children:b>0?(0,r.Y)(i.a,{className:"h-[30px] flex items-center justify-center",children:(0,r.Y)(c.A,{quantity:b,minQuantity:0,maxQuantity:u.ZX,onDecrease:function(){return v(t.id,b-1)},onIncrease:function(){return v(t.id,b+1)}})}):(0,r.Y)("button",{type:"button",disabled:!t.in_stock,onClick:function(){return g(t.id)},className:"w-full h-[30px] flex items-center justify-center border-[0.5px] border-solid border-[#2D87F3] rounded-xl text-[13px] leading-5 tracking-[-0.3px] font-medium text-[#2D87F3] disabled:opacity-50 disabled:cursor-not-allowed",children:f({id:"vaccination.payment.addon_add",defaultMessage:"Add"})})})]})]})},f=t(24537),m=t(31252),h=t(47493),g=t(88411),x=t(88491),v=t(27317);function y(){var e=(0,f.A)(["\n .mantine-Modal-content {\n overflow: hidden;\n border-radius: 16px;\n padding: 0;\n }\n\n .mantine-Modal-header {\n display: none;\n }\n\n .mantine-Modal-body {\n padding: 0;\n }\n"]);return y=function(){return e},e}function b(){var e=(0,f.A)(["\n .drawer__handle {\n display: none;\n }\n\n &.drawer__content[data-vaul-drawer-direction='bottom'] {\n max-height: 90%;\n border-top-left-radius: 20px;\n border-top-right-radius: 20px;\n overflow: hidden;\n bottom: 0;\n top: auto;\n }\n"]);return b=function(){return e},e}var C=(0,v.Ay)(h.M).withConfig({componentId:"sc-2fd5f5bc-0"})(y()),N=(0,v.Ay)(m.D).withConfig({componentId:"sc-2fd5f5bc-1"})(b()),_=function(){return(0,r.Y)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.Y)("path",{d:"M2.5 2.5L9.5 9.5M9.5 2.5L2.5 9.5",stroke:"#404040",strokeWidth:"1.6",strokeLinecap:"round"})})},Y=function(e){var n=e.product,t=e.currency,a=e.onClose,c=e.isDesktop,p=(0,l.A)().formatMessage,f=(0,s.$)().locale,m=(0,d.fQ)().addAddon,h=(0,u.sq)(n),x=(0,o.nd)(p,(0,o.$g)(h,f),t),v=n.price>h?(0,o.nd)(p,(0,o.$g)(n.price,f),t):"",y=function(){m(n.id),a()};return c?(0,r.FD)(i.a,{className:"flex relative min-h-[420px]",children:[(0,r.Y)(i.a,{className:"w-[40%] shrink-0 overflow-hidden bg-neutral50",children:(0,r.Y)("img",{src:n.image||u.XS,alt:n.name,className:"w-full h-full object-cover min-h-[420px]"})}),(0,r.FD)(i.a,{className:"w-[60%] flex flex-col p-6 relative",children:[(0,r.Y)("button",{type:"button",onClick:a,className:"absolute top-4 right-4 w-8 h-8 rounded-full bg-neutral100 flex items-center justify-center","aria-label":"Close",children:(0,r.Y)(_,{})}),(0,r.Y)("h3",{className:"text-[17px] leading-6 tracking-[-0.4px] font-semibold text-[#111111] pr-10",children:n.name}),(0,r.FD)(i.a,{className:"flex items-center gap-2 pt-2.5",children:[n.save_percentage>0&&(0,r.Y)("span",{className:"px-2 py-[3px] rounded-[5px] bg-[#00B16A] text-[12px] leading-[17px] tracking-[-0.2px] font-medium text-white",children:p({id:"vaccination.payment.addon_save_percent",defaultMessage:"Save {percent}%"},{percent:n.save_percentage})}),(0,r.Y)("p",{className:"text-[20px] leading-[30px] tracking-[-0.4px] font-semibold text-[#111111]",children:x}),v&&(0,r.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-[#BFBFBF] line-through",children:v})]}),(0,r.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-[#595959] pt-2",children:n.short_description}),(0,r.Y)(i.a,{className:"border-t border-solid border-neutral100 mt-3 pt-3 flex-1",children:(0,r.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-[#404040]",children:n.description})}),(0,r.Y)(g.B,{size:"lg",fullWidth:!0,className:"mt-4",disabled:!n.in_stock,onClick:y,children:p({id:"vaccination.payment.addon_add_to_cart",defaultMessage:"Add to Cart"})})]})]}):(0,r.FD)(i.a,{className:"flex flex-col relative bg-white max-h-[90vh]",children:[(0,r.FD)(i.a,{className:"relative w-full h-[220px] shrink-0 bg-neutral50",children:[(0,r.Y)("img",{src:n.image||u.XS,alt:n.name,className:"w-full h-full object-cover"}),(0,r.Y)("button",{type:"button",onClick:a,className:"absolute top-3.5 right-3.5 w-8 h-8 rounded-full bg-white shadow-[0px_2px_8px_rgba(0,0,0,0.15)] flex items-center justify-center","aria-label":"Close",children:(0,r.Y)(_,{})})]}),(0,r.FD)(i.a,{className:"flex flex-col px-4 pt-5 pb-[100px] overflow-y-auto",children:[(0,r.Y)("h3",{className:"text-[17px] leading-6 tracking-[-0.4px] font-semibold text-[#111111]",children:n.name}),(0,r.FD)(i.a,{className:"flex flex-col gap-1.5 pt-2.5",children:[(0,r.FD)(i.a,{className:"flex items-center gap-2",children:[n.save_percentage>0&&(0,r.Y)("span",{className:"px-2 py-[3px] rounded-[5px] bg-[#00B16A] text-[12px] leading-[17px] tracking-[-0.2px] font-medium text-white",children:p({id:"vaccination.payment.addon_save_percent",defaultMessage:"Save {percent}%"},{percent:n.save_percentage})}),(0,r.Y)("p",{className:"text-[20px] leading-[30px] tracking-[-0.4px] font-semibold text-[#111111]",children:x}),v&&(0,r.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-[#BFBFBF] line-through",children:v})]}),(0,r.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-[#595959]",children:n.short_description})]}),(0,r.Y)(i.a,{className:"border-t border-solid border-neutral100 mt-3 pt-3",children:(0,r.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-[#404040]",children:n.description})})]}),(0,r.Y)(i.a,{className:"absolute bottom-0 left-0 right-0 px-4 pb-4 pt-6 bg-gradient-to-t from-white via-white to-transparent",children:(0,r.Y)(g.B,{size:"lg",fullWidth:!0,disabled:!n.in_stock,onClick:y,children:p({id:"vaccination.payment.addon_add_to_cart",defaultMessage:"Add to Cart"})})})]})},k=function(e){var n=e.product,t=e.currency,i=e.opened,l=e.onClose,o=(0,x.d)().isMobileOrTablet,s=(0,a.useCallback)((function(){l()}),[l]);return n?o?(0,r.Y)(N,{open:i,onClose:s,overlayClassName:"!bg-[rgba(0,0,0,0.4)]",children:(0,r.Y)(Y,{product:n,currency:t,onClose:s,isDesktop:!1})}):(0,r.Y)(C,{opened:i,onClose:s,size:720,styles:{header:{display:"none"},body:{padding:0}},children:(0,r.Y)(Y,{product:n,currency:t,onClose:s,isDesktop:!0})}):null},A=function(e){var n,t=e.currency,o=(0,l.A)().formatMessage,s=(0,d.fQ)().addonProducts,c=(0,d.Jf)().vaccinationDetail,u=(0,a.useState)(null),f=u[0],m=u[1],h=(0,a.useState)(!1),g=h[0],x=h[1],v=null!==(n=null!==t&&void 0!==t?t:null===c||void 0===c?void 0:c.price_unit)&&void 0!==n?n:"";if(!s.length)return null;var y=function(e){m(e),x(!0)};return(0,r.FD)(i.a,{className:"mt-4 rounded-lg overflow-hidden bg-white py-4",children:[(0,r.Y)("h2",{className:"text-[17px] leading-6 tracking-[-0.3px] text-dark font-semibold px-4 pb-3",children:o({id:"vaccination.payment.addon_section_title",defaultMessage:"Customers also bought"})}),(0,r.Y)(i.a,{className:"flex gap-3 overflow-x-auto px-4 pb-1 hide-scroll",children:s.map((function(e){return(0,r.Y)(p,{product:e,currency:v,onSeeDetails:y},e.id)}))}),(0,r.Y)(k,{product:f,currency:v,opened:g,onClose:function(){x(!1),m(null)}})]})}},88871:function(e,n,t){t.d(n,{E:function(){return c}});var r=t(73884),a=t(84091),i=t(73419),l=t(6442),o=t(42280),s=t(95204),c=function(e){var n,t,c=(0,l.A)().formatMessage,d=(0,i.$)().locale,u=(0,o.Jf)().vaccinationDetail,p=(0,o.fQ)(),f=p.addonProducts,m=p.selectedAddons,h=null!==(t=null!==(n=null===e||void 0===e?void 0:e.currency)&&void 0!==n?n:null===u||void 0===u?void 0:u.price_unit)&&void 0!==t?t:"";return(0,r.useMemo)((function(){return m.map((function(e){var n=f.find((function(n){return n.id===e.addon_product_id}));if(!n)return null;var t=(0,s.sq)(n),r=t*e.quantity,i=h?(0,a.nd)(c,(0,a.$g)(t,d),h):(0,a.UN)(t,d),l=h?(0,a.nd)(c,(0,a.$g)(r,d),h):(0,a.UN)(r,d);return{addon_product_id:e.addon_product_id,quantity:e.quantity,name:n.name,unitPrice:t,lineTotal:r,displayPriceWithQuantity:"".concat(i," X ").concat(e.quantity),displayLineTotal:l}})).filter(Boolean)}),[f,m,c,d,h])}},8370:function(e,n,t){t.d(n,{A:function(){return l}});var r=t(2445),a=function(e){var n=e.className;return(0,r.Y)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,children:(0,r.Y)("path",{d:"M3.125 6.37497C3.01875 6.37497 2.92969 6.33902 2.85781 6.26712C2.78594 6.19522 2.75 6.10612 2.75 5.99982C2.75 5.89352 2.78594 5.80448 2.85781 5.73269C2.92969 5.6609 3.01875 5.625 3.125 5.625H8.87498C8.98123 5.625 9.07029 5.66095 9.14216 5.73285C9.21404 5.80476 9.24998 5.89386 9.24998 6.00015C9.24998 6.10645 9.21404 6.1955 9.14216 6.26729C9.07029 6.33908 8.98123 6.37497 8.87498 6.37497H3.125Z",fill:"#595959"})})},i=function(e){var n=e.className;return(0,r.Y)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,children:(0,r.Y)("path",{d:"M5.625 6.37498H3.125C3.01875 6.37498 2.92969 6.33903 2.85781 6.26713C2.78594 6.19522 2.75 6.10612 2.75 5.99983C2.75 5.89353 2.78594 5.80448 2.85781 5.73269C2.92969 5.6609 3.01875 5.625 3.125 5.625H5.625V3.125C5.625 3.01875 5.66095 2.92969 5.73285 2.85781C5.80476 2.78594 5.89386 2.75 6.00015 2.75C6.10645 2.75 6.1955 2.78594 6.26729 2.85781C6.33908 2.92969 6.37497 3.01875 6.37497 3.125V5.625H8.87498C8.98123 5.625 9.07029 5.66095 9.14216 5.73285C9.21404 5.80476 9.24998 5.89386 9.24998 6.00015C9.24998 6.10645 9.21404 6.1955 9.14216 6.26729C9.07029 6.33908 8.98123 6.37498 8.87498 6.37498H6.37497V8.87498C6.37497 8.98123 6.33902 9.07029 6.26712 9.14216C6.19522 9.21404 6.10612 9.24998 5.99983 9.24998C5.89353 9.24998 5.80448 9.21404 5.73269 9.14216C5.6609 9.07029 5.625 8.98123 5.625 8.87498V6.37498Z",fill:"#595959"})})},l=function(e){var n=e.quantity,t=e.onDecrease,l=e.onIncrease,o=e.minQuantity,s=void 0===o?1:o,c=e.maxQuantity,d=e.decreaseDisabled,u=e.increaseDisabled,p=null!==d&&void 0!==d?d:n<=s,f=null!==u&&void 0!==u?u:"number"===typeof c&&n>=c;return(0,r.FD)("div",{className:"flex items-center gap-3",children:[(0,r.Y)("button",{type:"button",disabled:p,onClick:t,className:"w-6 h-6 border-solid border-neutral100 border rounded-lg p-[5px] hover:border-primaryBase transition-all disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:border-neutral100",children:(0,r.Y)(a,{className:"block"})}),(0,r.Y)("span",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark",children:n}),(0,r.Y)("button",{type:"button",disabled:f,onClick:l,className:"w-6 h-6 border-solid border-neutral100 border rounded-lg p-[5px] hover:border-primaryBase transition-all disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:border-neutral100",children:(0,r.Y)(i,{className:"block"})})]})}},24613:function(e,n,t){t.d(n,{h:function(){return ce},A:function(){return pe}});var r=t(858),a=t(38971),i=t(44898),l=t(53513),o=t(63538),s=t(83776),c=t(2445),d=t(73884),u=t(31898),p=t(35291),f=t(39450),m=t(6043),h=t(4174),g=t(92793),x=t(22615),v=t(1657),y=t(36814),b=t(72280),C=t(6596),N=t(84091),_=t(32485),Y=t.n(_),k=t(35652),A=t(78773),w=t(47683),M=t(88491),F=t(73419),D=t(96404),L=t(6442),S=t(67722),P=t(86706),B=t(88871),O=t(37680),j=t(88411),V=t(27773),Z=t(20396),E=t(41543),T=t(62481),I=t(99745),z=t(46270),H=t(57448),R=t(59850),q=t(40959),U=t(49188),$=["image/png","image/jpeg","image/jpg","application/pdf","image/heic","image/heif"],W=(0,d.forwardRef)((function(e,n){var t,i=e.prescriptionFiles,u=e.setPrescriptionFiles,f=e.formData,m=e.setFormData,h=e.onValidate,g=e.loadingPayment,x=e.isDisableUpload,v=(0,L.A)().formatMessage,b=(0,d.useRef)(null),C=(0,F.$)(),_=C.locale,Y=C.router;(0,d.useImperativeHandle)(n,(function(){return{handleFileSelect:function(e){k(e)}}}));var k=function(e){if(!g){var n=Array.from(e),t=Object.keys(i).filter((function(e){var n;return null===(n=i[e])||void 0===n?void 0:n.fileObject})).length;if(t+n.length>3)m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:v({id:"vaccination.payment.prescription.maxFilesExceeded",defaultMessage:"Maximum 3 files/images allowed"}),touched:!0})})}));else{var r=new Set;Object.keys(i).forEach((function(e){var n=i[e];if(null===n||void 0===n?void 0:n.fileObject){var t="".concat(n.fileObject.name,"_").concat(n.fileObject.size);r.add(t)}}));var a=new Set,s=[];if(n.forEach((function(e){var n="".concat(e.name,"_").concat(e.size);r.has(n)||a.has(n)?s.push(e):a.add(n)})),s.length>0)m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:v({id:"vaccination.payment.prescription.duplicateFile",defaultMessage:'File "{fileName}" has already been selected'},{fileName:s[0].name}),touched:!0})})}));else{var c=[];if(n.forEach((function(e){var n=function(e){return e.size>5242880?v({id:"vaccination.payment.prescription.fileTooLarge",defaultMessage:"File size must be less than 5MB"}):$.includes(e.type)||e.name.toLowerCase().endsWith(".heic")||e.name.toLowerCase().endsWith(".heif")?null:v({id:"vaccination.payment.prescription.invalidFileType",defaultMessage:"Invalid file type. Only PNG, JPG, JPEG, PDF, HEIC, HEIF are allowed"})}(e);n&&c.push({file:e,error:n})})),c.length>0)m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:c[0].error,touched:!0})})}));else{var d=["File1","File2","File3"],p=new Set(Object.keys(i).filter((function(e){var n;return null===(n=i[e])||void 0===n?void 0:n.fileObject}))),f=[],h=!0,x=!1,y=void 0;try{for(var b,C=n[Symbol.iterator]();!(h=(b=C.next()).done);h=!0){var N=b.value,_=d.find((function(e){return!p.has(e)}));if(!_)return void m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:"vaccination.payment.prescription.maxFilesExceeded",touched:!0})})}));p.add(_),f.push({file:N,key:_})}}catch(Y){x=!0,y=Y}finally{try{h||null==C.return||C.return()}finally{if(x)throw y}}m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:""})})})),u((function(e){var n=(0,l.A)({},e);f.forEach((function(e){var t=e.file,r=e.key;n[r]={fileObject:t,status:"pending"}}));var t=Object.keys(n).filter((function(e){var t;return null===(t=n[e])||void 0===t?void 0:t.fileObject}));return t.sort((function(e,n){var t={File1:1,File2:2,File3:3};return t[e]-t[n]})),m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{value:t.join("|"),touched:!0})})})),n}))}}}}},A=function(e){if(!g){u((function(n){var t=(0,l.A)({},n);return delete t[e],t}));var n=Object.keys(i).filter((function(n){return n!==e})).filter((function(e){var n;return null===(n=i[e])||void 0===n?void 0:n.fileObject}));m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{value:n.join("|"),touched:!0})})})),requestAnimationFrame((function(){h("prescription")}))}},w=function(){var e=(0,r.A)((function(e){var n,t,r,c,d,p,h,x,v;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:if(g)return[2];if(!(null===(n=i[e])||void 0===n?void 0:n.fileObject)||"failed"!==n.status)return[2];u((function(n){var t=n[e];return t?(0,o.A)((0,l.A)({},n),(0,a.A)({},e,(0,o.A)((0,l.A)({},t),{status:"loading"}))):n})),m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:""})})})),s.label=1;case 1:return s.trys.push([1,7,,8]),c=window.location.href.includes("localhost"),(d=new FormData).append("file",n.fileObject),(p=null===(t=f.name)||void 0===t||null===(r=t.value)||void 0===r?void 0:r.trim())&&d.append("file_name",(0,U._E)(p)),c?(x={URL:"https://cdn-hermes.hellohealthgroup.com/2026/01/c73bb9c0c77b33740c67833e5081c2b25b7e2f8b01b88c15e5c4743617476022.png",message:"Upload Successful",status:!0},[3,4]):[3,2];case 2:return[4,(0,N.px)((0,N.Gx)(R.R.POST_IMAGE_UPLOAD),"POST",{data:d,headers:{"Content-Type":"multipart/form-data"}})];case 3:x=s.sent(),s.label=4;case 4:return h=x,c?[4,new Promise((function(e){return setTimeout(e,1e3)}))]:[3,6];case 5:s.sent(),s.label=6;case 6:if(!(v=(null===h||void 0===h?void 0:h.URL)||""))throw new Error("No URL returned");return u((function(n){var t=n[e];return t?(0,o.A)((0,l.A)({},n),(0,a.A)({},e,(0,o.A)((0,l.A)({},t),{status:"success",url:v}))):n})),[3,8];case 7:return s.sent(),u((function(n){var t=n[e];return t?(0,o.A)((0,l.A)({},n),(0,a.A)({},e,(0,o.A)((0,l.A)({},t),{status:"failed"}))):n})),[3,8];case 8:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),M=Object.keys(i).filter((function(e){var n,t;return(null===(n=i[e])||void 0===n?void 0:n.fileObject)||(null===(t=i[e])||void 0===t?void 0:t.url)})),D=M.length>=3,S=g||D||x;return(0,c.FD)(y.a,{className:"pt-4 flex gap-3 flex-col",children:[(0,c.Y)("p",{className:"text-[15px] leading-6 tracking-[-0.3px] text-gray1000 font-semibold",children:v({id:"vaccination.payment.prescription_upload_description",defaultMessage:"Please upload a valid prescription for our medical expert to review"})}),M.length>0&&(0,c.Y)(y.a,{className:"flex gap-2 flex-col",children:M.map((function(e){var n=function(e){var n=i[e];if(!n)return{text:"",icon:null,bgColor:"",status:"pending"};switch(n.status){case"pending":return{text:"",icon:null,bgColor:"bg-neutral50",status:"pending"};case"loading":return{text:v({id:"vaccination.payment.prescription.uploading",defaultMessage:"Uploading"}),icon:(0,c.Y)(H.a,{size:20,color:p.w.colors.primaryBase}),bgColor:"bg-neutral50",status:"loading"};case"success":return{text:"",icon:(0,c.Y)(V.A,{color:p.w.colors.green600,size:20,className:"flex-shrink-0"}),bgColor:"bg-green50",status:"success"};case"failed":return{text:v({id:"vaccination.payment.prescription.resend",defaultMessage:"Resend"}),icon:(0,c.Y)(T.A,{color:p.w.colors.red600,size:20,className:"flex-shrink-0"}),bgColor:"bg-red50",status:"failed"};default:return{text:"",icon:null,bgColor:"",status:"pending"}}}(e),t=function(e){var n=i[e];if(null===n||void 0===n?void 0:n.fileObject)return n.fileObject.name;if(null===n||void 0===n?void 0:n.url){var t,r=n.url.match(/([^/?#]+\.(?:png|jpg|jpeg|pdf|heic|heif|webp))(?=$|[?#])/i);return null!==(t=null===r||void 0===r?void 0:r[1])&&void 0!==t?t:"prescription_01.jpeg"}return""}(e);return(0,c.FD)(y.a,{className:"".concat(n.bgColor," rounded-lg px-4 py-3 flex items-center gap-3"),children:[n.icon&&(0,c.Y)(y.a,{className:"flex-shrink-0",children:n.icon}),(0,c.Y)("p",{className:"flex-1 text-[13px] leading-5 tracking-[-0.3px] text-dark truncate",children:t}),n.text&&"loading"===n.status&&(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-primaryBase",children:n.text}),n.text&&"failed"===n.status&&(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-red600 cursor-pointer",onClick:function(){return w(e)},children:n.text}),!x&&(0,c.Y)(c.FK,{children:"success"===n.status?(0,c.Y)(I.A,{size:20,color:p.w.colors.gray700,className:"flex-shrink-0 cursor-pointer",onClick:function(){return A(e)}}):(0,c.Y)(Z.A,{size:20,color:p.w.colors.gray700,className:"flex-shrink-0 cursor-pointer",onClick:function(){return A(e)}})})]},e)}))}),(null===(t=f.prescription)||void 0===t?void 0:t.error)&&(0,c.Y)("p",{className:"text-[12px] leading-5 tracking-[-0.3px] text-red600",children:f.prescription.error}),(0,c.FD)(y.a,{className:"flex gap-2 flex-col lg:flex-row lg:gap-4 lg:items-center",children:[(0,c.Y)("input",{ref:b,type:"file",id:"prescription-upload-input",accept:".png,.jpg,.jpeg,.pdf,.heic,.heif",multiple:!0,onChange:function(e){e.target.files&&e.target.files.length>0&&(k(e.target.files),b.current&&(b.current.value=""))},className:"hidden",disabled:S}),(0,c.FD)(j.B,{variant:"tertiary",fullWidth:!0,size:"lg",onClick:function(){var e;return null===(e=b.current)||void 0===e?void 0:e.click()},disabled:S,className:S?"opacity-50 cursor-not-allowed !w-auto":"!w-auto",children:[(0,c.Y)(E.A,{color:p.w.colors.primaryBase,size:20,className:"mr-2"}),(0,c.Y)("span",{className:"text-[15px] leading-6 tracking-[-0.3px] font-medium ".concat(S?"text-gray400":"text-primaryBase"),children:v({id:"vaccination.payment.prescription_upload_button",defaultMessage:"Upload prescription"})})]}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray400",children:v({id:"vaccination.payment.prescription_upload_description_2",defaultMessage:"Max files upload size can be 5MB"})})]}),!x&&(0,c.FD)(y.a,{onClick:function(){var e,n;Y.push("/".concat(null===(e=q.y1A[_])||void 0===e?void 0:e.ALL,"/").concat(null===(n=q.y1A[_])||void 0===n?void 0:n.DOCTOR))},className:"bg-neutral50 rounded-xl p-4 flex items-center gap-3 cursor-pointer",children:[(0,c.Y)(Q,{className:"min-w-[24px]"}),(0,c.Y)("p",{className:"text-dark text-[13px] leading-5 tracking-[-0.3px]",children:v({id:"vaccination.payment.prescription_upload_description_3",defaultMessage:"Don't have a prescription? Book a tele-consultation with our partner doctors"},{a:function(e){return(0,c.Y)("span",{className:"text-blue900 font-semibold",children:e})}})}),(0,c.Y)(z.A,{className:"min-w-[24px]",color:"#8C8C8C"})]})]})})),Q=function(e){var n=e.className;return(0,c.FD)("svg",{width:"24",height:"24",className:n,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,c.FD)("g",{clipPath:"url(#clip0_14688_443)",children:[(0,c.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9813 12.3885C16.2548 12.3885 16.5056 12.5432 16.628 12.7878L17.7532 15.0404L20.008 16.1688C20.2525 16.2911 20.4071 16.541 20.4073 16.8145C20.4073 17.088 20.2527 17.3388 20.008 17.4612L17.7543 18.5875L16.628 20.8412C16.5056 21.0858 16.2548 21.2405 15.9813 21.2405C15.7079 21.2403 15.458 21.0857 15.3357 20.8412L14.2072 18.5864L11.9546 17.4612C11.71 17.3388 11.5553 17.088 11.5553 16.8145C11.5554 16.5412 11.7102 16.2912 11.9546 16.1688L14.2083 15.0415L15.3357 12.7878L15.3877 12.701C15.5212 12.5076 15.7421 12.3886 15.9813 12.3885ZM15.3932 15.903C15.3233 16.0428 15.2096 16.1565 15.0698 16.2264L13.8925 16.8145L15.0698 17.4037L15.1697 17.4633C15.2638 17.5312 15.3407 17.6212 15.3932 17.7259L15.9813 18.9032L16.5705 17.7259L16.6302 17.6272C16.698 17.533 16.788 17.4561 16.8927 17.4037L18.07 16.8145L16.8927 16.2264C16.7531 16.1565 16.6403 16.0427 16.5705 15.903L15.9813 14.7257L15.3932 15.903Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M17.0002 3.2218C18.6268 3.2218 19.945 4.54003 19.945 6.16668V12.5556C19.945 12.9544 19.6213 13.2782 19.2224 13.2782C18.8235 13.2782 18.4997 12.9544 18.4997 12.5556V6.16668C18.4997 5.33777 17.8291 4.66711 17.0002 4.66711H7.55572C6.72681 4.66711 6.05615 5.33777 6.05615 6.16668V17.8333C6.05615 18.6623 6.72681 19.3329 7.55572 19.3329H12.5557C12.9546 19.3329 13.2784 19.6567 13.2784 20.0556C13.2784 20.4544 12.9546 20.7782 12.5557 20.7782H7.55572C5.92907 20.7782 4.61084 19.46 4.61084 17.8333V6.16668C4.61084 4.54003 5.92907 3.2218 7.55572 3.2218H17.0002Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M9.22238 13.7774C9.62126 13.7774 9.94504 14.1011 9.94504 14.5C9.94504 14.8989 9.62126 15.2227 9.22238 15.2227H8.66683C8.26796 15.2227 7.94417 14.8989 7.94417 14.5C7.94417 14.1011 8.26796 13.7774 8.66683 13.7774H9.22238Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M9.22238 10.444C9.62126 10.444 9.94504 10.7678 9.94504 11.1667C9.94504 11.5656 9.62126 11.8893 9.22238 11.8893H8.66683C8.26796 11.8893 7.94417 11.5656 7.94417 11.1667C7.94417 10.7678 8.26796 10.444 8.66683 10.444H9.22238Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M13.9446 10.444C14.3435 10.444 14.6673 10.7678 14.6673 11.1667C14.6673 11.5656 14.3435 11.8893 13.9446 11.8893H12.0002C11.6013 11.8893 11.2775 11.5656 11.2775 11.1667C11.2775 10.7678 11.6013 10.444 12.0002 10.444H13.9446Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M9.22238 7.11069C9.62126 7.11069 9.94504 7.43447 9.94504 7.83335C9.94504 8.23222 9.62126 8.556 9.22238 8.556H8.66683C8.26796 8.556 7.94417 8.23222 7.94417 7.83335C7.94417 7.43447 8.26796 7.11069 8.66683 7.11069H9.22238Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M15.8891 7.11069C16.2879 7.11069 16.6117 7.43447 16.6117 7.83335C16.6117 8.23222 16.2879 8.556 15.8891 8.556H12.0002C11.6013 8.556 11.2775 8.23222 11.2775 7.83335C11.2775 7.43447 11.6013 7.11069 12.0002 7.11069H15.8891Z",fill:"#00B16A"})]}),(0,c.Y)("defs",{children:(0,c.Y)("clipPath",{id:"clip0_14688_443",children:(0,c.Y)("rect",{width:"20",height:"20",fill:"white",transform:"translate(2 2)"})})})]})};W.displayName="PrescriptionUpload";var G,J,X=W,K=t(42280),ee=t(9655),ne=t(96149),te=t(95204),re=u.i.TextField,ae=(0,d.lazy)((function(){return t.e(3299).then(t.bind(t,43299))})),ie={wrapper:{":has(input[data-disabled])":{backgroundColor:te.bm,borderColor:te.AF,color:te.Dp,opacity:1}},input:{fontSize:"15px",letterSpacing:"-0.3px",fontWeight:500,color:"#111111"}},le={name:{value:"",error:""},idNumber:{value:"",error:""},phone:{value:"",error:""},gender:{value:"male",error:"",touched:!0},age:{value:"",error:""},email:{value:"",error:""},shippingAddressLine:{value:"",error:""},shippingCity:{value:"",error:""},shippingZipCode:{value:"",error:""},shippingCountry:{value:"",error:""},userAddressLine:{value:"",error:""},userCity:{value:"",error:""},userZipCode:{value:"",error:""},userCountry:{value:"",error:""},prescription:{value:"",error:""},creditCardNumber:{value:"",error:""}},oe=["name","idNumber","phone","gender","age","email","userAddressLine","userCity","userZipCode","userCountry","creditCardNumber","shippingAddressLine","shippingCity","shippingZipCode","shippingCountry","prescription"],se=["name","idNumber","phone","gender","age","creditCardNumber","prescription"],ce=function(e){var n=e.action,t=(0,P.T)(),r=t.displayDiscountPrice,a=t.displayTotalPrice,i=t.displayTaxPrice,l=t.displayShippingFee,o=t.displayPricePayTenPercentage,s=t.displayPriceRemaining,u=t.displayPriceWithUnitAndQuantity,p=(0,K.Jf)(),f=p.vaccinationDetail,m=p.selectedPaymentValue,h=p.providers,x=(0,B.E)(),v=(0,L.A)().formatMessage,b=(0,F.$)().locale,C=(0,D.Y)().selectedExtraChargeList,_=(0,d.useMemo)((function(){var e=(0,O.ze)(m||""),n=e.provider,t=e.paymentVia,r=e.paymentType;return h.find((function(e){return e.provider===n&&e.payment_via===Number(t)&&e.payment_type===r}))}),[m,h]),Y=null===f||void 0===f?void 0:f.hospital_branch.name;return(0,c.FD)(y.a,{"data-testid":"payment-details",className:"bg-white pt-6 px-4 pb-0.5",children:[(0,c.Y)(d.Suspense,{fallback:null,children:(0,c.Y)(ae,{})}),(0,c.Y)("h2",{className:"flex-1 text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold pb-4",children:v({id:"vaccination.payment.details",defaultMessage:"Payment Details"})}),(0,c.FD)(y.a,{className:"flex justify-between pb-3",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:(null===ee.Y||void 0===ee.Y?void 0:ee.Y[b])||ee.Y[g.L.Vietnam],defaultMessage:"Package price"})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:u})]}),C.length>0&&C.map((function(e){return(0,c.FD)(y.a,{className:"flex justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:e.charge_type_name}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 lg:font-medium",children:(0,N.nd)(v,(0,N.$g)(e.amount,b),e.currency)})]},e.id)})),x.map((function(e){return(0,c.FD)(y.a,{className:"flex justify-between py-3 border-t border-solid border-neutral100 gap-2",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:e.name}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium shrink-0",children:e.displayPriceWithQuantity})]},e.addon_product_id)})),l&&(0,c.FD)(y.a,{className:"flex justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.shipping_fee",defaultMessage:"Shipping Fee"})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:l})]}),i&&(0,c.FD)(y.a,{className:"flex justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.tax",defaultMessage:"Tax"})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:i})]}),r&&(0,c.FD)(y.a,{className:"flex justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.discount",defaultMessage:"Discount"})}),(0,c.FD)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-green600 font-medium",children:["-",r]})]}),(null===_||void 0===_?void 0:_.payment_type)===O.Ai.ten_percent&&(0,c.FD)(c.FK,{children:[(0,c.FD)(y.a,{className:"flex gap-3 justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.pay_later",defaultMessage:"Pay later (at {hospital_name})"},{hospital_name:Y})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium whitespace-nowrap",children:s})]}),(0,c.FD)(y.a,{className:"flex gap-3 justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.pay_now_only",defaultMessage:"Pay now only"})}),(0,c.Y)("p",{className:"text-[15px] leading-5 lg:leading-6 tracking-[-0.3px] text-dark font-semibold whitespace-nowrap",children:o})]})]}),(null===_||void 0===_?void 0:_.payment_type)===O.Ai.full_payment&&(0,c.FD)(y.a,{className:"flex gap-3 justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.pay_later_via_installment",defaultMessage:"Pay Later Via Installment"})}),(0,c.Y)("p",{className:"text-[15px] leading-6 tracking-[-0.3px] text-dark font-semibold whitespace-nowrap",children:a})]}),(null===_||void 0===_?void 0:_.payment_type)===O.Ai.one_hundred_percent&&(0,c.FD)(y.a,{className:"flex gap-3 justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.pay_now_100",defaultMessage:"Pay now 100%"})}),(0,c.Y)("p",{className:"text-[15px] leading-6 tracking-[-0.3px] text-dark font-semibold whitespace-nowrap",children:a})]}),n]})},de=(G={},(0,a.A)(G,g.L.Vietnam,"VN"),(0,a.A)(G,g.L.Malaysia,"MY"),G),ue=(J={},(0,a.A)(J,g.L.Vietnam,"Vietnam"),(0,a.A)(J,g.L.Malaysia,"Malaysia"),J),pe=(0,d.forwardRef)((function(e,n){var t,u=e.loadingPayment,_=e.backToStepOne,D=e.subscriptionCustomerPrefill,P=e.lockPrefilledCustomerFields,B=e.isHidePaymentDetail,j=e.renderPaymentDetail,V=(0,L.A)().formatMessage,Z=(0,d.useState)(le),E=Z[0],T=Z[1],I=(0,d.useState)({}),z=I[0],H=I[1],R=(0,d.useState)(!0),q=R[0],U=R[1],$=(0,d.useState)({}),W=$[0],Q=$[1],G=(0,d.useRef)(null),J=(0,K.Jf)(),ee=J.selectedPaymentValue,ae=J.selectedSubPaymentValue,pe=J.providers,fe=J.computedPrice,me=(0,k.i)((function(e){return e.subscriptionSavedCards})),he=(0,d.useMemo)((function(){var e,n;if(!ee||!(0,w.Lo)(ee))return"";if(!ae||ae===A.G)return"";var t=me.find((function(e){return e.token_id===ae}));return(null===t||void 0===t?void 0:t.cc_no)?t.cc_no:(null===(e=E.creditCardNumber)||void 0===e||null===(n=e.value)||void 0===n?void 0:n.trim())||""}),[ee,ae,me,null===(t=E.creditCardNumber)||void 0===t?void 0:t.value]),ge=(0,M.d)().isMobileOrTablet,xe=(0,F.$)().locale,ve=(0,d.useMemo)((function(){var e=D;if(!e)return{};var n={},t=!0,r=!1,a=void 0;try{for(var i,l=oe[Symbol.iterator]();!(t=(i=l.next()).done);t=!0){var o=i.value,s=e[o];null!=s&&""!==String(s).trim()&&(n[o]=String(s))}}catch(c){r=!0,a=c}finally{try{t||null==l.return||l.return()}finally{if(r)throw a}}return n}),[D]),ye=(0,d.useMemo)((function(){var e=Boolean(P),n=ve,t={},r=!0,a=!1,i=void 0;try{for(var l,o=se[Symbol.iterator]();!(r=(l=o.next()).done);r=!0){var s=l.value,c=n[s];t[s]=e&&null!=c&&""!==String(c).trim()}}catch(d){a=!0,i=d}finally{try{r||null==o.return||o.return()}finally{if(a)throw i}}return t}),[ve,P]),be=function(e){var n;return Boolean(ye[e])&&!(null===(n=E[e])||void 0===n?void 0:n.error)&&!W[e]},Ce=function(e){ye[e]&&Q((function(n){return n[e]?n:(0,o.A)((0,l.A)({},n),(0,a.A)({},e,!0))}))};(0,d.useEffect)((function(){Q({})}),[ve]),(0,d.useEffect)((function(){var e=ve;0!==Object.keys(e).length&&(T((function(n){var t=(0,l.A)({},n),r=!0,a=!1,i=void 0;try{for(var s,c=oe[Symbol.iterator]();!(r=(s=c.next()).done);r=!0){var d=s.value,u=e[d];if(void 0!==u){var p=n[d];p&&(t[d]=(0,o.A)((0,l.A)({},p),{value:u,touched:!0}))}}}catch(f){a=!0,i=f}finally{try{r||null==c.return||c.return()}finally{if(a)throw i}}return t})),e.prescription&&H((function(n){return(0,o.A)((0,l.A)({},n),{File1:{fileObject:null,status:"success",url:e.prescription}})})))}),[ve]),(0,d.useImperativeHandle)(n,(function(){return{getFormData:function(){return(0,r.A)((function(){var e;return(0,s.__generator)(this,(function(n){return e=[],Object.keys(z).forEach((function(n){var t=z[n];"success"===(null===t||void 0===t?void 0:t.status)&&t.url&&e.push(t.url)})),[2,(0,o.A)((0,l.A)({},E),{prescriptionUrls:e})]}))}))()},startUploadPrescription:function(){return(0,r.A)((function(){var e,n,t;return(0,s.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,ne.RL)({prescriptionFiles:z,setPrescriptionFiles:H,formatMessage:V,fileName:null===(e=E.name)||void 0===e?void 0:e.value})];case 1:return n=r.sent(),T((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:""})})})),[2,n];case 2:throw t=r.sent(),(0,i.A)(t,ne._l)&&T((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:t.message,touched:!0})})})),t;case 3:return[2]}}))}))()},isFormValid:function(){var e=!1;return Object.keys(E).map((function(n){var t=Ne(n,E[n].value);console.log("\ud83d\ude80 ~ error:",t,n,E[n].value||"-x"),t&&(e=!0),T((function(e){return(0,o.A)((0,l.A)({},e),(0,a.A)({},n,(0,o.A)((0,l.A)({},e[n]),{value:E[n].value,error:t})))}))})),!e}}}));var Ne=function(e,n){return"phone"===e?window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(String(n),"vn")?"":"error.pleaseEnterAValidPhone":"idNumber"===e?(0,te.SE)(n,V):"age"===e?Number(n)>=18&&Number(n)===parseInt(n)?"":"error.pleaseEnterAValidAge":["shippingAddressLine","shippingCity","shippingCountry","userAddressLine","userCity","userCountry"].includes(e)?!fe.show_delivery_fee&&["shippingAddressLine","shippingCity","shippingCountry"].includes(e)?"":["shippingAddressLine","userAddressLine"].includes(e)?(0,te.tz)(n,V):["shippingCity","userCity"].includes(e)?(0,te.Y$)(n,V):"":"shippingZipCode"===e||"userZipCode"===e?fe.show_delivery_fee||"shippingZipCode"!==e?(0,te.b_)(n,V):"":"prescription"===e?fe.prescription_required?Object.keys(z).some((function(e){var n=z[e];return n&&(null!==n.fileObject||n.url)}))?"":V({id:"vaccination.payment.prescription.required",defaultMessage:"Please upload at least one prescription file"}):"":"creditCardNumber"===e?"":(0,N.tf)(e,n)},_e=function(e,n){if(!u&&!be(e)){Ce(e);var t=n;if("idNumber"===e){var r=n.trim(),i=r.replace(/\D/g,"").length,s=/^[\d-]*$/.test(r)&&i<=12;t=xe!==g.L.Vietnam&&s?function(e){var n=e.replace(/\D/g,"");return n.length<=6?n:n.length<=8?"".concat(n.slice(0,6),"-").concat(n.slice(6)):"".concat(n.slice(0,6),"-").concat(n.slice(6,8),"-").concat(n.slice(8,12))}(r):r}T((function(n){return(0,o.A)((0,l.A)({},n),(0,a.A)({},e,(0,o.A)((0,l.A)({},n[e]),{value:t,touched:!0})))}))}},Ye=function(e){u||T((function(n){return(0,o.A)((0,l.A)({},n),(0,a.A)({},e,(0,o.A)((0,l.A)({},n[e]),{error:Ne(e,n[e].value)})))}))},ke=function(e,n){if(fe.show_delivery_fee)return"all"===e?(_e("shippingAddressLine",E.userAddressLine.value),_e("shippingCity",E.userCity.value),_e("shippingZipCode",E.userZipCode.value),void requestAnimationFrame((function(){E.userAddressLine.value&&Ye("shippingAddressLine"),E.userCity.value&&Ye("shippingCity"),E.userZipCode.value&&Ye("shippingZipCode")}))):void(q&&(_e(e,n),requestAnimationFrame((function(){Ye(e)}))))};(0,d.useEffect)((function(){_e("userCountry",ue[xe]),fe.show_delivery_fee&&_e("shippingCountry",ue[xe]),requestAnimationFrame((function(){Ye("userCountry"),Ye("shippingCountry")}))}),[fe.show_delivery_fee,xe]);var Ae=(0,d.useMemo)((function(){var e=(0,O.ze)(ee||""),n=e.provider,t=e.paymentVia,r=e.paymentType;return pe.find((function(e){return e.provider===n&&e.payment_via===Number(t)&&e.payment_type===r}))}),[ee,pe]),we=(0,d.useMemo)((function(){var e;return null===Ae||void 0===Ae||null===(e=Ae.sub_payment_methods)||void 0===e?void 0:e.find((function(e){return e.code===ae}))}),[ae,null===Ae||void 0===Ae?void 0:Ae.sub_payment_methods]),Me=(0,d.useMemo)((function(){return[{value:"Vietnam",label:V({id:"vaccination.payment.field_country_vn",defaultMessage:"Vietnam"})},{value:"Malaysia",label:V({id:"vaccination.payment.field_country_my",defaultMessage:"Malaysia"})}]}),[V]);return(0,c.FD)(c.FK,{children:[(0,c.FD)(y.a,{"data-testid":"customer-info",className:"bg-white pt-6 px-4 pb-4 lg:pb-6",children:[(0,c.Y)("h2",{className:"flex-1 text-[17px] leading-6 tracking-[-0.3px] lg:tracking-[-0.4px] text-dark font-semibold",children:V({id:"vaccination.payment.customer_info",defaultMessage:"Customer's Info"})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray400 mt-1 mb-4",children:V({id:"vaccination.payment.customer_info.desc",defaultMessage:"We need your information to make a booking and contact you later."})}),(0,c.FD)(te.q,{className:"flex gap-3 flex-col",children:[(0,c.Y)(re,{shrink:!!E.name.touched||!!E.name.value,className:"w-full",children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"name",placeholder:"",value:E.name.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_name"})}),styles:ie,error:E.name.error?(0,c.Y)("p",{className:"text-[12px]",children:V({id:E.name.error})}):void 0,onChange:function(e){return _e("name",e.target.value)},onBlur:function(){return Ye("name")},disabled:u||be("name")})})}),(0,c.Y)(re,{shrink:!!E.idNumber.touched||!!E.idNumber.value,className:"w-full",children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"idNumber",placeholder:"",value:E.idNumber.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_id_number",defaultMessage:"ID/Passport number"})}),styles:ie,error:E.idNumber.error?(0,c.Y)("p",{className:"text-[12px]",children:V({id:E.idNumber.error})}):void 0,onChange:function(e){return _e("idNumber",e.target.value)},onBlur:function(){return Ye("idNumber")},disabled:u||be("idNumber")})})}),(0,c.Y)(re,{shrink:!!E.phone.touched||!!E.phone.value,children:(0,c.Y)(re.Control,{children:(0,c.Y)(C.p.Wrapper,{size:"md",className:"form--phone_field",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_phone"})}),error:E.phone.error?(0,c.Y)("p",{className:"text-[12px]",children:V({id:E.phone.error})}):void 0,children:(0,c.Y)(f.n,{id:"phone",name:"phone",className:"mantine-Input-input",value:E.phone.value,spellCheck:!1,type:"tel",placeholder:" ",defaultCountry:(null===de||void 0===de?void 0:de[xe])||"VN",countryCallingCodeEditable:!1,onChange:function(e){return _e("phone",e)},onBlur:function(){return Ye("phone")},disabled:u||be("phone")})})})}),(0,c.FD)(y.a,{className:"flex gap-3",children:[(0,c.Y)(re,{shrink:!!E.gender.touched||!!E.gender.value,className:"flex-1",children:(0,c.Y)(re.Control,{children:(0,c.Y)(f.S,{id:"gender",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_gender"})}),name:"gender",searchable:!0,onChange:function(e){return _e("gender",e)},onBlur:function(){return Ye("gender")},value:E.gender.value,data:[{value:"male",label:V({id:"vaccination.payment.field_gender_male"})},{value:"female",label:V({id:"vaccination.payment.field_gender_female"})}],rightSection:(0,c.Y)(x.A,{color:p.w.colors.gray600,size:24}),styles:ie,disabled:u||be("gender"),sx:{"&:has(input[disabled])":{".mantine-Select-wrapper":{backgroundColor:te.bm,borderColor:te.AF,color:te.Dp,opacity:1}}}})})}),(0,c.Y)(re,{shrink:!!E.age.touched||!!E.age.value,className:"flex-1",children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{id:"age",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_age"})}),onChange:function(e){return _e("age",e.target.value)},onBlur:function(){return Ye("age")},value:E.age.value,error:E.age.error?(0,c.Y)("p",{className:"text-[12px]",children:V({id:E.age.error})}):void 0,styles:ie,placeholder:"",type:"number",disabled:u||be("age")})})})]}),(0,c.Y)(re,{shrink:!!E.email.touched||!!E.email.value,className:"w-full",children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{id:"email",type:"text",placeholder:"",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:V({id:"vaccination.payment.field_email"})}),styles:ie,value:E.email.value,error:E.email.error?(0,c.Y)("p",{className:"text-[12px]",children:V({id:E.email.error})}):void 0,onChange:function(e){return _e("email",e.target.value)},onBlur:function(){return Ye("email")},disabled:u||be("email")})})}),(0,c.FD)(y.a,{className:"flex flex-col gap-2",children:[(0,c.Y)("p",{className:"text-dark font-semibold text-[15px] leading-6 tracking-[-0.3px] pt-4 md:pt-5",children:V({id:"vaccination.payment.your_address",defaultMessage:"Your address"})}),(0,c.Y)(re,{shrink:!!E.userAddressLine.touched||!!E.userAddressLine.value,className:"w-full",children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"userAddressLine",placeholder:"",value:E.userAddressLine.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_address_line",defaultMessage:"Address line"})}),styles:ie,error:E.userAddressLine.error?(0,c.Y)("p",{className:"text-[12px]",children:E.userAddressLine.error}):void 0,onChange:function(e){_e("userAddressLine",e.target.value),ke("shippingAddressLine",e.target.value)},onBlur:function(){return Ye("userAddressLine")},disabled:u||be("userAddressLine")})})}),(0,c.Y)(re,{shrink:!!E.userCity.touched||!!E.userCity.value,className:"w-full",children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"userCity",placeholder:"",value:E.userCity.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_city",defaultMessage:"City"})}),styles:ie,error:E.userCity.error?(0,c.Y)("p",{className:"text-[12px]",children:E.userCity.error}):void 0,onChange:function(e){_e("userCity",e.target.value),ke("shippingCity",e.target.value)},onBlur:function(){return Ye("userCity")},disabled:u||be("userCity")})})}),(0,c.FD)(y.a,{className:"flex gap-3",sx:{"& .mantine-Select-wrapper":{backgroundColor:"#f2f2f2"}},children:[(0,c.Y)(re,{shrink:!!E.userCountry.touched||!!E.userCountry.value,className:"flex-1 pointer-events-none",children:(0,c.Y)(re.Control,{children:(0,c.Y)(f.S,{id:"userCountry",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_country",defaultMessage:"Country"})}),name:"userCountry",disabled:!0,value:E.userCountry.value,data:Me,rightSection:(0,c.Y)(x.A,{color:p.w.colors.gray600,size:24}),styles:ie,className:"rounded-lg cursor-not-allowed"})})}),(0,c.Y)(re,{shrink:!!E.userZipCode.touched||!!E.userZipCode.value,className:"flex-1",children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"userZipCode",placeholder:"",value:E.userZipCode.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_zip_code",defaultMessage:"ZIP / Postal Code"})}),styles:ie,error:E.userZipCode.error?(0,c.Y)("p",{className:"text-[12px]",children:E.userZipCode.error}):void 0,onChange:function(e){_e("userZipCode",e.target.value),ke("shippingZipCode",e.target.value)},onBlur:function(){return Ye("userZipCode")},disabled:u||be("userZipCode")})})})]})]}),fe.show_delivery_fee&&(0,c.FD)(y.a,{className:"flex flex-col gap-2",children:[(0,c.Y)("p",{className:"text-dark font-semibold text-[15px] leading-6 tracking-[-0.3px] pt-4 md:pt-5",children:V({id:"vaccination.payment.shipping_address",defaultMessage:"Shipping address"})}),(0,c.Y)(m.S,{id:"shippingAddressSwitch",label:V({id:"vaccination.payment.field_same_as_your_address",defaultMessage:"Same as your address"}),checked:q,onChange:function(e){U(e.target.checked),e.target.checked&&ke("all","")},className:"py-[5px]",styles:{track:{width:"30px",minWidth:"30px"},label:{color:p.w.colors.gray700,fontSize:"13px",lineHeight:"20px",letterSpacing:"-0.3px",fontWeight:500}}}),(0,c.Y)(re,{shrink:!!E.shippingAddressLine.touched||!!E.shippingAddressLine.value,className:Y()("w-full",q&&"!hidden"),children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"shippingAddressLine",placeholder:"",value:E.shippingAddressLine.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_address_line",defaultMessage:"Address line"})}),styles:ie,error:E.shippingAddressLine.error?(0,c.Y)("p",{className:"text-[12px]",children:E.shippingAddressLine.error}):void 0,onChange:function(e){return _e("shippingAddressLine",e.target.value)},onBlur:function(){return Ye("shippingAddressLine")}})})}),(0,c.Y)(re,{shrink:!!E.shippingCity.touched||!!E.shippingCity.value,className:Y()("w-full",q&&"!hidden"),children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"shippingCity",placeholder:"",value:E.shippingCity.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_city",defaultMessage:"City"})}),styles:ie,error:E.shippingCity.error?(0,c.Y)("p",{className:"text-[12px]",children:E.shippingCity.error}):void 0,onChange:function(e){return _e("shippingCity",e.target.value)},onBlur:function(){return Ye("shippingCity")}})})}),(0,c.FD)(y.a,{className:Y()("flex gap-3",q&&"!hidden"),sx:{"& .mantine-Select-wrapper":{backgroundColor:"#f2f2f2"}},children:[(0,c.Y)(re,{shrink:!!E.shippingCountry.touched||!!E.shippingCountry.value,className:"flex-1 pointer-events-none",children:(0,c.Y)(re.Control,{children:(0,c.Y)(f.S,{id:"shippingCountry",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_country",defaultMessage:"Country"})}),name:"shippingCountry",disabled:!0,value:E.shippingCountry.value,data:[{value:"Vietnam",label:V({id:"vaccination.payment.field_country_vn",defaultMessage:"Vietnam"})},{value:"Malaysia",label:V({id:"vaccination.payment.field_country_my",defaultMessage:"Malaysia"})}],rightSection:(0,c.Y)(x.A,{color:p.w.colors.gray600,size:24}),styles:ie,className:"rounded-lg cursor-not-allowed"})})}),(0,c.Y)(re,{shrink:!!E.shippingZipCode.touched||!!E.shippingZipCode.value,className:"flex-1",children:(0,c.Y)(re.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"shippingZipCode",placeholder:"",value:E.shippingZipCode.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:V({id:"vaccination.payment.field_zip_code",defaultMessage:"ZIP / Postal Code"})}),styles:ie,error:E.shippingZipCode.error?(0,c.Y)("p",{className:"text-[12px]",children:E.shippingZipCode.error}):void 0,onChange:function(e){return _e("shippingZipCode",e.target.value)},onBlur:function(){return Ye("shippingZipCode")}})})})]})]}),fe.prescription_required&&(0,c.Y)(X,{ref:G,isDisableUpload:be("prescription"),prescriptionFiles:z,setPrescriptionFiles:function(e){Ce("prescription"),H(e)},formData:E,setFormData:T,onValidate:Ye,loadingPayment:u})]})]}),Ae&&(0,c.FD)(y.a,{"data-testid":"payment-method-step-2",className:"bg-white pb-5 lg:pb-6",children:[(0,c.FD)(y.a,{className:"flex gap-3 items-center justify-between px-4 pt-6 pb-4",children:[(0,c.Y)("h2",{className:"flex-1 text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold",children:V({id:"vaccination.payment.method",defaultMessage:"Payment Method"})}),(0,c.FD)("p",{onClick:function(){return _(!0)},className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium cursor-pointe flex items-center",children:[(0,c.Y)("span",{className:"align-middle",children:V({id:"vaccination.payment.change_method",defaultMessage:"Change method"})}),(0,c.Y)(v.A,{size:16,className:"align-middle"})]})]}),(0,c.Y)(y.a,{className:"px-4",children:(0,c.FD)(y.a,{className:"bg-neutral50 rounded-xl p-4 ",children:[(0,c.FD)("div",{className:"flex items-center gap-2",children:[(0,c.Y)("img",{src:(null===we||void 0===we?void 0:we.logo)||Ae.logo,alt:(null===we||void 0===we?void 0:we.title)||Ae.title,className:"w-6 h-6"}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:(null===we||void 0===we?void 0:we.title)?"".concat(V({id:"vaccination.payment.online_banking"})," - ").concat(null===we||void 0===we?void 0:we.title):Ae.title})]}),(0,w.Lo)(ee)&&he&&(0,c.Y)(y.a,{className:"flex items-center gap-2 pt-3",children:(0,c.Y)(h.T,{size:"title2",fw:700,color:"gray1000",children:(0,S.fQ)(he)})})]})})]}),ge&&(void 0!==j?j:!B&&(0,c.Y)(ce,{}))]})}))},96404:function(e,n,t){t.d(n,{Y:function(){return i}});var r=t(73884),a=t(42280),i=function(){var e=(0,a.Jf)().computedPrice,n=(0,a.re)(),t=n.selectedOptionalCharge,i=n.toggleOptionalCharge,l=n.setSelectedOptionalCharge,o=n.resetExtraChargeStore,s=e.extra_charges||[],c=(0,r.useMemo)((function(){return s.filter((function(e){return e.is_mandatory}))}),[s]),d=(0,r.useMemo)((function(){return s.filter((function(e){return!e.is_mandatory}))}),[s]),u=(0,r.useMemo)((function(){return s.filter((function(e){return e.selected}))}),[s]),p=(0,r.useCallback)((function(e){return t.includes(e.id)}),[t]),f=(0,r.useCallback)((function(e){i(e.id)}),[i]);return{extraChargeList:s,mandatoryExtraCharges:c,optionalExtraCharges:d,selectedExtraChargeList:u,selectedOptionalCharge:t,isOptionalSelected:p,toggleOptionalCharge:f,setSelectedOptionalCharge:l,resetExtraChargeStore:o}}}}]);