1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8935],{78935:function(e,t,s){s.d(t,{Z:function(){return F}});var l=s(85893),i=s(67294);let n=i.forwardRef(function({title:e,titleId:t,...s},l){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:l,"aria-labelledby":t},s),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"}))});var d=s(87782),r=s(45785),a=s(63665),o=s(39073),c=s(6250);let x=()=>(0,l.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsxs)("g",{"clip-path":"url(#clip0_18_2310)",children:[(0,l.jsx)("mask",{id:"mask0_18_2310",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:(0,l.jsx)("path",{d:"M0 1.90735e-06H24V24H0V1.90735e-06Z",fill:"white"})}),(0,l.jsxs)("g",{mask:"url(#mask0_18_2310)",children:[(0,l.jsx)("path",{d:"M10.6406 5.85936V8.76561C10.6406 11.0955 12.5294 12.9843 14.8594 12.9843C17.1893 12.9843 19.0781 11.0955 19.0781 8.76561V5.85936H10.6406Z",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"}),(0,l.jsx)("path",{d:"M23.2969 5.85938H10.1719",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"}),(0,l.jsx)("path",{d:"M14.8594 0.703125C12.2705 0.703125 10.1719 2.80177 10.1719 5.39063V5.85938H19.5469V5.39063C19.5469 2.80177 17.4482 0.703125 14.8594 0.703125Z",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"}),(0,l.jsx)("path",{d:"M12.75 12.4199V15C12.75 16.165 13.6944 17.1094 14.8594 17.1094C16.0244 17.1094 16.9688 16.165 16.9688 15V12.4199",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"}),(0,l.jsx)("path",{d:"M10.1719 23.2969H0.703125V18.6094H10.1719V23.2969Z",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"}),(0,l.jsx)("path",{d:"M10.1719 18.6094H0.703125L2.10937 15.7969H8.76562L10.1719 18.6094Z",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"}),(0,l.jsx)("path",{d:"M8.17627 15.7969C8.97933 15.1518 9.99919 14.7656 11.1093 14.7656H12.75",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"}),(0,l.jsx)("path",{d:"M16.9687 14.7656H18.6094C21.1982 14.7656 23.2969 16.8643 23.2969 19.4531V23.2969H10.1719",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"}),(0,l.jsx)("path",{d:"M18.2812 19.6875H20.1562",stroke:"#324D9F","stroke-width":"1.40625",strokeMiterlimit:"10","stroke-linecap":"round","stroke-linejoin":"round"})]})]}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0_18_2310",children:(0,l.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]});var h=s(14416),u=s(97894),m=s(94920),p=s(57851);let j=()=>(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("g",{"clip-path":"url(#clip0_18_1754)",children:(0,l.jsx)("path",{d:"M13.3333 1.33333H2.66659C1.93325 1.33333 1.33325 1.93333 1.33325 2.66667V14.6667L3.99992 12H13.3333C14.0666 12 14.6666 11.4 14.6666 10.6667V2.66667C14.6666 1.93333 14.0666 1.33333 13.3333 1.33333Z",fill:"#B7C2E4"})}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0_18_1754",children:(0,l.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]});var f=s(63919),b=s(67707);let v=e=>{let{value:t,isChecked:s,isSubmitted:i,onSubmitEdit:n,onCheckboxChange:d,onInputChange:r,boxLabel:a,boxLabelStyles:o="",boxStyles:c="",labelStyles:x="",inputTextStyles:h="",inputbackground:u="bg-[#F4F6F9]",inputLabel:m="Enter",placeholder:v="",boxPrefixIcon:g=null,maxInput
1Length:k=256}=e;return(0,l.jsxs)("div",{className:"w-full p-4 rounded ".concat(c),children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsxs)("div",{className:"flex gap-4 items-center",children:[(0,l.jsx)(f.Z,{checked:s,onChange:d}),(0,l.jsx)("p",{className:(0,p.m)("text-[#444] font-600 text-base",o),children:a})]}),(0,l.jsx)("div",{children:g})]}),s&&(0,l.jsx)(l.Fragment,{children:i?(0,l.jsxs)("div",{className:"flex justify-between items-center py-1 mt-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(j,{}),(0,l.jsx)("p",{className:"text-xs lg:text-sm text-[#444]",children:t})]}),(0,l.jsx)("button",{className:"text-xs text-[#243868] underline",onClick:()=>n(!1),children:"Edit"})]}):(0,l.jsxs)("div",{className:"mt-4 relative",children:[(0,l.jsx)(b.default,{value:t,onChange:e=>{r(e.target.value)},placeholder:v,inputBg:u,label:m,labelStyle:(0,p.m)("text-xs text-[#444] mb-2 font-500",x),extraInputStyle:"py-4 pl-4 pr-12 h-[42px] mt-2",inputTextStyle:(0,p.m)("text-sm text-[#444] font-400",h),maxLength:k}),(0,l.jsx)("button",{onClick:()=>n(!0),className:"absolute end-3 bottom-[10px] text-sm font-600 text-[#182A54]",children:"Save"})]})})]})};var g=s(79586),k=s(65478),C=function(e){let{id:t,title:s,subtitles:i,selected:n,onSelect:d,children:r,borderColor:a="#324d9f"}=e;return(0,l.jsxs)("div",{onClick:e=>{d&&d(t),e.preventDefault()},className:"p-4 flex items-start gap-3 rounded w-full relative ".concat(n?"border-2":"border"),style:{cursor:"pointer",borderColor:n?a:"#D8D8D8"},children:[(0,l.jsx)("input",{type:"radio",checked:n,style:{accentColor:a}}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-xs font-700",children:s}),i?(0,l.jsx)("div",{className:"text-xs font-normal mt-2",children:i.map((e,t)=>(0,l.jsx)("div",{children:e},t))}):null]}),r]})},w=s(97563),y=s(74855),N=s(90444),_=s(96205);let S=e=>{let{checkoutId:t,fetchCheckoutData:s,handleRedirectToPayment:p,defaultDeliveryAddress:j,defaultBillingAddress:f,style:b,noAddStyle:S,title:F,titleStyle:E,total:M=0}=e,A=(0,a.i)(e=>e.profileReducer.addresses),D=(0,a.i)(e=>e.profileReducer.shippingInstructions),L=(0,h.I0)(),{isDesktop:H}=(0,c.Z)(),[I,Z]=(0,i.useState)(j),[V,B]=(0,i.useState)(f),[P,T]=(0,o.k)((null==I?void 0:I.id)===(null==V?void 0:V.id)),[R,U]=(0,i.useState)(null),[O,Q]=(0,i.useState)(null),[q,W]=(0,i.useState)(null),X=(0,h.v9)(e=>e.profileReducer),[Y,z]=(0,i.useState)(!1);(0,i.useEffect)(()=>{Z(j),B(f),T.redirectTo((null==f?void 0:f.id)===(null==j?void 0:j.id))},[f,j,A]),(0,i.useEffect)(()=>{if(L((0,u.qy)()),X.previousCheckoutId!==t){var e;L((0,u.Q4)("")),L((0,u.bR)(!1)),L((0,u.wS)(null!==(e=Array.isArray(t)?t[0]:t)&&void 0!==e?e:""))}},[]);let G=()=>{L((0,u.NP)(O,s))},J=e=>{L((0,u.Q4)(e))},K=e=>{""!==D&&L((0,u.bR)(e))};function $(e,l){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"refetch_checkout";L((0,u.Uw)(t,e,l,()=>{"refetch_checkout"===i?s():"redirect_to_payment"===i&&p()}))}async function ee(e){if("add-delivery-address"===q){0===A.length?$(e,e):"add-delivery-address"===q?$(e,P?e:V||e):$(I||e,e);return}if("delivery-address-edit"===q){$(e,P?e:V||e);return}"billing-address-edit"===q&&$(I||e,e)}async function et(){I&&V?$(I,P?I:V,"redirect_to_payment"):(0,d.O)(m.XU,"Please select delivery & billing address",L)}return(0,l.jsxs)("div",{className:"bg-[#EFF3FB] mb-32 ".concat(A.length>0?b:"".concat(S||b)),children:[!H&&(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsx)(_.Z,{current:"Address",paymentOnClick:et})}),A.length>0?(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"px-4 bg-[#fff] md:mx-6",children:(0,l.jsxs)("div",{className:"py-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[A.length>0&&(0,l.jsx)("div",{className:"font-[600] text-sm leading-[150%] text-[#444] ".concat(E||""),children:F||"Delivery Address"}),!H&&(0,l.jsx)("button",{"aria-label":"Add new address",onClick:()=>W("add-delivery-address"),className:"border border-[#EC6303] p-2 text-[#EC6303] text-[0.625rem] rounded font-[500] ".concat(0===A.length&&"w-full"),children:"+ Add new address"})]}),A.map((e,t)=>(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsx)(C,{selected:(null==I?void 0:I.id)==e.id,onSelect:()=>Z(e),id:e.id,title:(null==e?void 0:e.name)?null==e?void 0:e.name:(null==e?void 0:e.first_name)+" "+((null==e?void 0:e.last_name)||""),subtitles:[e.address_line_1,"".concat(e.address_line_2||""),"".concat(null==e?void 0:e.city,", ").concat((null==e?void 0:e.state)||""),e.phone],children:(0,l.jsxs)("div",{children:[(0,l.jsx)("button",{"aria-label":"Edit address",onClick:()=>{U(e.id),W("delivery-address-edit")},className:"absolute right-6 top-4 text-[#EC6303] font-medium text-xs",children:"Edit"}),(0,l.jsx)("button",{"aria-label":"Delete address",onClick:()=>Q(e.id),className:"absolute right-6 bottom-4 text-[#EC6303] font-medium text-xs",children:(0,l.jsx)(n,{className:"h-5 w-5 text-[#EC6303]"})})]})})},e.id)),A.length>0&&(0,l.jsx)("div",{className:"flex flex-col",children:(0,l.jsxs)("div",{className:"flex my-4",children:[(0,l.jsx)("input",{type:"checkbox",id:"billingSameAsDeliveryAddress",checked:P,onChange:e=>{var t;return t=e.target.checked,void(T.redirectTo(t),t?B(I):B(null))}}),(0,l.jsx)("label",{htmlFor:"billingSameAsDeliveryAddress",className:"pl-3 inline-block text-xs font-normal leading-[130%] text-[#243868]",children:"Billing address is same as delivery address"})]})}),P?null:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"flex items-center justify-between mt-4 mb-4",children:A.length>0&&(0,l.jsx)("div",{className:"font-[600] text-sm leading-[150%] text-[#444]",children:"Billing Address"})}),A.map(e=>(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsx)(C,{selected:(null==V?void 0:V.id)==e.id,onSelect:()=>B(e),id:e.id,title:(null==e?void 0:e.name)?null==e?void 0:e.name:(null==e?void 0:e.first_name)+" "+((null==e?void 0:e.last_name)||""),subtitles:[e.address_line_1,"".concat(e.address_line_2||""),"".concat(null==e?void 0:e.city,", ").concat((null==e?void 0:e.state)||""),e.phone],children:(0,l.jsxs)("div",{children:[(0,l.jsx)("button",{"aria-label":"Edit address",onClick:()=>{U(e.id),W("billing-address-edit")},className:"absolute right-6 top-4 text-[#EC6303] font-medium text-xs",children:"Edit"}),(0,l.jsx)("button",{"aria-label":"Delete address",onClick:()=>Q(e.id),className:"absolute right-6 bottom-4 text-[#EC6303] font-medium text-xs",children:(0,l.jsx)(n,{className:"h-5 w-5 text-[#EC6303]"})})]})})},e.id))]}),H&&(0,l.jsx)("div",{className:"w-full mt-2 mb-6",children:(0,l.jsx)(v,{value:X.shippingInstructions,isChecked:Y,isSubmitted:X.isShippingInstructionSubmitted,onSubmitEdit:K,onCheckboxChange:z,onInputChange:J,boxLabel:"Add Shipping Instructions",boxLabelStyles:"leading-[22px]",placeholder:"eg. please send all products together",inputbackground:"bg-[#EBF0FC]",boxStyles:"bg-[#fff] lg:bg-[#F4F7FF]",input
1Label:"Enter Instructions*",boxPrefixIcon:(0,l.jsx)(x,{})})}),H&&(0,l.jsxs)("div",{className:"flex items-center justify-between mb-[.8rem] font-[600] text-[.7rem] ",children:[(0,l.jsx)("div",{children:(0,l.jsx)(g.Z,{secondary:!0,outline:!0,rounded:!0,paddingClasses:"py-[.65rem] px-[.8rem]",onClick:()=>W("add-delivery-address"),textClasses:"text-[.7rem] font-[600]",children:"+ Add new address"})}),(0,l.jsx)("div",{children:(0,l.jsx)(g.Z,{rounded:!0,paddingClasses:"py-[.8rem] px-[2rem]",onClick:et,textClasses:"text-[.7rem] font-[600]",children:"Proceed"})})]})]})})}):(0,l.jsxs)("div",{className:"px-4 py-6 bg-[#fff] mt-5 text-sm font-semibold text-[#444]",children:[(0,l.jsx)("p",{className:"mb-6",children:"Delivery Address"}),(0,l.jsxs)("div",{onClick:()=>W("add-delivery-address"),className:"cursor-pointer grid place-content-center place-items-center border border-[#F1F1F1] pb-5 pt-6",children:[(0,l.jsx)(k.hU,{src:"/static/images/address.svg",alt:"address"}),(0,l.jsx)("p",{className:"mt-1 text-[#2A4689]",children:"+ Add new address"})]})]}),!H&&(0,l.jsx)("div",{className:"w-full my-4",children:(0,l.jsx)(v,{value:X.shippingInstructions,isSubmitted:X.isShippingInstructionSubmitted,onSubmitEdit:K,isChecked:Y,onCheckboxChange:z,onInputChange:J,boxLabel:"Add Shipping Instructions",boxLabelStyles:"text-sm leading-[19px]",placeholder:"eg. please send all products together",boxStyles:"bg-[#fff] lg:bg-[#F4F7FF]",inputLabel:"Enter Instructions*",inputTextStyles:"text-xs placeholder:text-[#C7C7C7]",boxPrefixIcon:(0,l.jsx)(x,{})})}),!H&&(0,l.jsx)(w.Z,{ariaLabel:"Pay now",children:(0,l.jsxs)("button",{onClick:et,className:"bg-[#fff] flex items-center justify-between w-full text-sm font-600 text-[#444] h-[56px]",children:[M>0&&(0,l.jsxs)("div",{className:"px-3 text-left mr-7",children:[(0,r.x6)(M),(0,l.jsx)("p",{className:"text-2xs font-500",children:"Total"})]}),(0,l.jsx)("div",{className:"bg-[#EC6303] text-[#fff] w-full h-full flex items-center justify-center",children:"Deliver To This Address"})]})}),q&&(0,l.jsx)(y.Z,{showModal:!0,closeModal:()=>{W(null),U(null)},modifyAddress:null!==R,selectedAddress:null===R?null:A.find(e=>e.id===R),onAddressChange:ee}),(0,l.jsx)(N.default,{showModal:null!==O,closeModal:()=>Q(null),onConfirm:G,onCancel:()=>Q(null),title:"Are you sure you want to delete the address?",confirmLabel:"Yes",cancelLabel:"Cancel",color:"#B82626"})]})};var F=S}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.