1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2222],{57250:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout",function(){return s(13023)}])},13023:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return G}});var a=s(85893),l=s(28646),r=s(11876),i=s(67294),n=s(88446);s(9330);var c=s(44080),d=s(91479),o=s(99603),u=s(59417),h=s(34288),m=s(41664),x=s.n(m),p=s(83868),y=s.n(p),v=s(86501),g=s(61839),f=s(34994),j=s(977),b=s(54464),_=s(48583),N=s(94543),w=s(93729),S=e=>{var t;let{onChildStateChange:s,selectedAddress:l,onAddressSelection:r,setAddressErrors:m}=e,p=(0,_.Dv)(N.ZP),[S,C]=(0,i.useState)(!1),[D,F]=(0,i.useState)(!1),A=(0,i.useRef)(null),[E,T]=(0,i.useState)(!1),[k,Z]=(0,i.useState)([]),[q,P]=(0,i.useState)([]),[I,G]=(0,i.useState)(-1),[z,R]=(0,i.useState)([]),[L,O]=(0,i.useState)({loading:!1,success:"",error:""}),[M,U]=(0,i.useState)({loading:!1,success:"",error:""}),[K,V]=(0,i.useState)(!1),[$,Q]=(0,i.useState)({id:-1,name:"",email:"",mobile:"",address:"",country:-1,country_name:"",state:-1,state_name:"",city:-1,city_name:"",zipcode:-1,gst_number:"",status:1}),[Y,H]=(0,i.useState)({name:"",email:"",mobile:"",address:"",country:"",country_name:"",state:"",state_name:"",city:"",city_name:"",zipcode:"",gst_number:"",status:""}),W=async()=>{try{var e;let t=await n.Z.post("/shipping_address/getshipping_address_user",{sortDetails:{sortKey:"id",sortType:1},searchDetails:[]}),s=[],a=null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.data;for(let e=0;e<a.length;e++)s.push(a[e]);R(s),O({loading:!1,success:"success",error:""})}catch(e){console.error(e),O({loading:!1,success:"error",error:""})}};(0,i.useEffect)(()=>{W()},[null==p?void 0:null===(t=p.userDetails)||void 0===t?void 0:t.user_id,K]);let B=async()=>{try{let e=!1,t={name:"",email:"",mobile:"",address:"",country:"",state:"",city:"",gst_number:"",zipcode:""};if(t.name="",0===$.name.length?(t.name="required",e=!0):$.name.length>=50&&(t.name="Only 50 characture are allowed",e=!0),t.email="",0===$.email.length?(t.email="required",e=!0):$.email.length>=50?(t.email="Only allow 50 digits.",e=!0):y()($.email)||(t.email="Enter a valid Email Id",e=!0),t.mobile="",0===$.mobile.length?(t.mobile="required",e=!0):10!==$.mobile.length&&(t.mobile="Enter a Valid Mobile",e=!0),t.address="",0===$.address.length?t.address="required":$.address.length>=100&&(t.address="Only 100 characture are allowed"),t.country="",-1===$.country&&(t.country="required",e=!0),t.state="",-1===$.state&&(t.state="required",e=!0),t.city="",-1===$.city&&(t.city="required",e=!0),t.zipcode="",1===$.zipcode.toString().length?(t.zipcode="required",e=!0):$.zipcode.toString().length>9&&(t.zipcode="Enter a valid Zip Code",e=!0),H({...Y,...t}),e)return!0;return!1}catch(e){console.error(e)}},X=async()=>{try{var e;let t=await B();if(t){U({loading:!1,success:"",error:"Enter all the required fields"});return}U({loading:!0,success:"",error:""});let s={userid:null==p?void 0:null===(e=p.userDetails)||void 0===e?void 0:e.user_id,name:$.name,email:$.email,mobile:$.mobile,address:$.address,country:$.country,country_name:$.country_name,state:$.state,state_name:$.state_name,city:$.city,city_name:$.city_name,status:$.status,zipcode:$.zipcode,gst_number:$.gst_number,datetime:""};if(s.datetime=(0,g.Z)(Date.now(),""),3===s.status)for(let e=0;e<z.length;e++)3===z[e].status&&await n.Z.post("/shipping_address/editshipping_address",{id:z[e].id,status:1});let a=await n.Z.post("/shipping_address/insertshipping_address",{...s});200===a.status&&(v.ZP.success("Address Updated successfully"),C(!1),V(e=>!e),Q({id:-1,name:"",email:"",mobile:"",address:"",country:-1,country_name:"",state:-1,state_name:"",city:-1,city_name:"",zipcode:-1,gst_number:"",status:1})),U({loading:!1,success:"Address updated successfully",error:""})}catch(e){console.error(e),v.ZP.error("something went wrong"),U({loading:!1,success:"",error:"Unexpected error occured"})}},J=async e=>{try{for(let e=0;e<z.length;e++)3===z[e].status&&await n.Z.post("/shipping_address/editshipping_address",{id:z[e].id,status:1});await n.Z.post("/shipping_address/editshipping_address",{id:e,status:3}),V(e=>!e)}catch(e){console.error(e)}},ee=async e=>{try{await n.Z.post("/shipping_address/deleteshipping_address",{id:e}),V(e=>!e)}catch(e){console.error(e)}},et=async e=>{try{var t;let s=await n.Z.post("/shipping_address/getshipping_address_user",{sortDetails:{sort
1Key:"id",sortType:1},searchDetails:[{basicSearchKey:"id",basicSearchValue:e,basicSearchType:"number"}]});Q(null==s?void 0:null===(t=s.data)||void 0===t?void 0:t.data[0]),F(!0)}catch(e){console.error(e)}},es=async()=>{try{var e;let t=await B();if(t){U({loading:!1,success:"",error:"Enter all the required fields"});return}U({loading:!0,success:"",error:""});let s={id:$.id,userid:null==p?void 0:null===(e=p.userDetails)||void 0===e?void 0:e.user_id,name:$.name,email:$.email,mobile:$.mobile,address:$.address,country:$.country,country_name:$.country_name,state:$.state,state_name:$.state_name,city:$.city,city_name:$.city_name,status:$.status,zipcode:$.zipcode,gst_number:$.gst_number,datetime:""};if(s.datetime=(0,g.Z)(Date.now(),""),3===s.status)for(let e=0;e<z.length;e++)3===z[e].status&&await n.Z.post("/shipping_address/editshipping_address",{id:z[e].id,status:1});let a=await n.Z.post("/shipping_address/editshipping_address",{...s});200===a.status&&(v.ZP.success("Address Edited successfully"),F(!1),V(e=>!e),Q({id:-1,name:"",email:"",mobile:"",address:"",country:-1,country_name:"",state:-1,state_name:"",city:-1,city_name:"",zipcode:-1,gst_number:"",status:1})),U({loading:!1,success:"Address Edited successfully",error:""})}catch(e){console.error(e)}},ea=async()=>{try{let e=[];
1if(z.filter(t=>{if(2===t.status){let s={};t.country<=0&&(s.country="Country is required"),t.state<=0&&(s.state="State is required"),(null==t?void 0:t.city)<=0&&(s.city="City is required"),Object.keys(s).length>0&&e.push({billing:s})}else if(t.id===l){G(t.id);let s={};t.country<=0&&(s.country="Country is required"),t.state<=0&&(s.state="State is required"),(null==t?void 0:t.city)<=0&&(s.city="City is required"),Object.keys(s).length>0&&e.push({selectedAddress:s})}(0,w.Z)({msg:e[0],type:"error"})}),e.length)return{status:!0,error:e};return!1}catch(e){}},el=async()=>{let e=z.some(e=>e.id===l),t=z.find(e=>2===e.status);e||t||v.ZP.error("Select any Address");let a=await ea();if(a&&!0===a.status){let e=[],t=[];a.error.forEach(s=>{s.billing&&(e=e.concat(Object.values(s.billing))),s.selectedAddress&&(t=t.concat(Object.values(s.selectedAddress)))}),Z(e),P(t),T(!0),m(!0)}else T(!1),m(!1);!a&&(t||e)&&s()},er=z.some(e=>2===e.status);return(0,a.jsxs)("div",{className:"",children:[(0,a.jsxs)("div",{className:"container mx-auto",children:[(0,a.jsxs)("div",{className:"grid lg:grid-cols-3 ",children:[0===z.length?null:(()=>{let e=z.some(e=>e.id===l),t=z.find(e=>2===e.status);return!e&&t&&r(t.id,t.country),z.map((e,t)=>(0,a.jsxs)("div",{className:" max-h-[200px] m-3 flex flex-col justify-center rounded-md",children:[(0,a.jsxs)("div",{className:(e.status,"border p-2 ".concat(l===e.id?"bg-green-500":"")),children:[(0,a.jsx)("input",{type:"radio",name:"addressSelection",checked:l===e.id,onChange:()=>r(e.id,e.country)}),(0,a.jsx)("h1",{})]}),(0,a.jsxs)("div",{className:"h-full p-2 border-l border-r space-y-3",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.G,{icon:u.wJh}),(0,a.jsxs)("h1",{children:[e.name," ",(0,a.jsx)("br",{}),e.address," "]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.G,{icon:u.j1w}),(0,a.jsx)("h1",{children:e.mobile})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(o.G,{icon:h.FU$}),(0,a.jsx)("h1",{children:e.email})]})]}),(0,a.jsx)("div",{className:"border p-2 space-x-4",children:2===e.status?(0,a.jsx)(x(),{href:{pathname:"/customers/buyer-address",query:{page:"checkoutPage"}},children:(0,a.jsx)("button",{className:"rounded-md bg-update-button p-1 bg-green-600 flex justify-center items-center",children:"Update Billing Address"})}):(0,a.jsxs)(a.Fragment,{children:[1===e.status&&(0,a.jsx)("button",{onClick:t=>{J(e.id)},className:"rounded-md bg-green-100 p-1",children:"Make this default"}),(0,a.jsx)("button",{onClick:t=>{et(e.id)},className:"rounded-md bg-blue-100 p-1",children:"Edit Address"}),(null==e?void 0:e.status)!==3?(0,a.jsx)("button",{onClick:()=>ee(null==e?void 0:e.id),className:"rounded-md bg-red-100 p-1",children:"Delete"}):null]})})]}))})(),(0,a.jsx)("div",{onClick:()=>{C(!0)},className:" h-[200px] border m-3 flex items-center justify-center",children:(0,a.jsx)(o.G,{className:"text-9xl hover:text-blue-700",icon:u.r8p})})]}),S||D?(0,a.jsx)(c.u.Root,{show:S||D,children:(0,a.jsxs)(d.V,{as:"div",className:"relative z-10",initialFocus:A,onClose:C||F,children:[(0,a.jsx)(c.u.Child,{enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),(0,a.jsx)("div",{className:"fixed inset-0 z-10 w-full overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:(0,a.jsx)(c.u.Child,{enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,a.jsxs)(d.V.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full ",children:[(0,a.jsxs)("div",{className:"bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4",children:[(0,a.jsxs)("div",{className:"mx-auto flex p-3 justify-between border rounded-md rounded-b-none ",children:[(0,a.jsx)("h1",{children:"Add new Address"}),S?(0,a.jsx)("button",{onClick:()=>{C(!1)},children:(0,a.jsx)(o.G,{icon:u.YIN})}):(0,a.jsx)("button",{onClick:()=>{F(!1),Q({})},children:(0,a.jsx)(o.G,{icon:u.YIN})})]}),(0,a.jsx)("div",{className:"sm:flex ",children:(0,a.jsxs)("div",{className:" text-center border rounded-md rounded-t-none ",children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-5 p-5",children:[(0,a.jsxs)("div",{className:"flex flex-col md:w-1/3 ",children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-sm",children:[(0,a.jsxs)("label",{htmlFor:"primaryMobile",children:["Your Name ",(0,a.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==Y?void 0:Y.name.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.name})]})]}),(0,a.jsx)("input",{className:"bg-gray-300 p-1.5 border outline-none rounded-md focus:border-blue-500 focus:outline-none focus:ring-1",type:"text",name:"name",value:$.name,placeholder:"Your name",onChange:e=>{let t=e.target.value;Q({...$,name:t})}})]}),(0,a.jsxs)("div",{className:"flex flex-col md:w-1/3",children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-sm",children:[(0,a.jsxs)("label",{htmlFor:"email",children:["Email",(0,a.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==Y?void 0:Y.email.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500 ",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.email})]})]}),(0,a.jsx)("input",{className:"bg-gray-300 p-1.5 outline-none border rounded-md focus:border-blue-500 focus:outline-none focus:ring-1",type:"text",name:"email",value:$.email,onChange:e=>{let t=e.target.value;Q({...$,email:t})},maxLength:50,placeholder:"your email"})]}),(0,a.jsxs)("div",{className:"flex flex-col md:w-1/3",children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-sm",children:[(0,a.jsxs)("label",{htmlFor:"primaryMobile",children:["Mobile",(0,a.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==Y?void 0:Y.mobile.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500 ",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.mobile})]})]}),(0,a.jsx)("input",{className:"bg-gray-300 p-1.5 outline-none border rounded-md focus:border-blue-500 focus:outline-none focus:ring-1 ",type:"tel",name:"mobile",value:-1===parseInt($.mobile)?"":$.mobile,placeholder:"Your Mobile",onChange:e=>{let t=e.target.value;Q({...$,mobile:t.length>0?t:""})}})]})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row",children:[(0,a.jsxs)("div",{className:"flex flex-col lg:w-2/3",children:[(0,a.jsxs)("div",{className:"p-5 ",children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-sm",children:[(0,a.jsxs)("label",{htmlFor:"full_address",children:["Full Address",(0,a.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==Y?void 0:Y.address.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.address})]})]}),(0,a.jsx)("textarea",{className:"p-2 w-full border outline-none focus:border-blue-500 focus:outline-none focus:ring-1",name:"full_address",id:"",rows:3,value:$.address,onChange:e=>{let t=e.target.value;Q({...$,address:t})}})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-5 p-5",children:[(0,a.jsxs)("div",{className:"flex flex-col md:w-1/2 ",children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-xs",children:[(0,a.jsxs)("label",{htmlFor:"zipCode",children:["Zip Code",(0,a.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==Y?void 0:Y.zipcode.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.zipcode})]})]}),(0,a.jsx)("input",{className:"bg-gray-300 p-1.5 border rounded-md focus:border-blue-500 focus:outline-none focus:ring-1",type:"tel",name:"zipCode",value:(null==$?void 0:$.zipcode)===-1?0:$.zipcode,onChange:e=>{let t=e.target.value;Q({...$,zipcode:t.length>0?parseInt(t):0})},placeholder:"Enter zip code"})]}),(0,a.jsxs)("div",{className:"flex flex-col md:w-1/2 ",children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-xs",children:[(0,a.jsx)("label",{htmlFor:"gstin ",children:"GSTIN"}),(null==Y?void 0:Y.gst_number.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.gst_number})]})]}),(0,a.jsx)("input",{className:"bg-gray-300 p-1.5 border rounded-md focus:border-blue-500 focus:outline-none focus:ring-1",type:"text",name:"gstin",value:null==$?void 0:$.gst_number,onChange:e=>{let t=e.target.value;Q({...$,gst_number:t.toUpperCase()})},placeholder:"Enter your GSTIN"})]})]})]}),(0,a.jsxs)("div",{className:"lg:w-1/3 px-4 py-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-sm",children:[(0,a.jsxs)("label",{htmlFor:"country",children:["Country",(0,a.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==Y?void 0:Y.country.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.country})]})]}),(0,a.jsx)(f.Z,{name:$.country_name,onChange:e=>{let t=e.target.value,s=e.target.options[e.target.selectedIndex].getAttribute("data-name"),a=parseInt(t);s&&Q({...$,country:a,country_name:s,state:-1,state_name:"",city:-1,city_name:""})},value:null==$?void 0:$.country})]}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-sm",children:[(0,a.jsxs)("label",{htmlFor:"state",children:["State",(0,a.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==Y?void 0:Y.state.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.state})]})]}),(0,a.jsx)(j.Z,{country_id:null==$?void 0:$.country,name:"state_id",onChange:e=>{let t=e.target.value,s=e.target.options[e.target.selectedIndex].getAttribute("data-name"),a=parseInt(t);s&&Q({...$,state:a,state_name:s,city:-1,city_name:""})},value:null==$?void 0:$.state})]}),(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex justify-center space-x-5 text-sm",children:[(0,a.jsxs)("label",{htmlFor:"city",children:["City",(0,a.jsx)("strong",{className:"text-red-500",children:"*"})]}),(null==Y?void 0:Y.city.length)!==0&&(0,a.jsxs)("div",{className:"text-red-500",children:[(0,a.jsx)(o.G,{icon:u.RLE}),(0,a.jsx)("span",{className:"px-1",children:null==Y?void 0:Y.city})]})]}),(0,a.jsx)(b.Z,{country_id:null==$?void 0:$.country,state_id:null==$?void 0:$.state,name:"city",onChange:e=>{let t=e.target.value,s=e.target.options[e.target.selectedIndex].getAttribute("data-name"),a=parseInt(t);s&&Q({...$,city:a,city_name:s})},value:null==$?void 0:$.city})]})]})]})]})})]}),(0,a.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:flex sm:flex-row sm:justify-between sm:px-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{onChange:e=>{let t=e.target.checked;t&&Q({...$,status:3})},type:"checkbox",id:"saveAsDefault"}),"\xa0",(0,a.jsx)("label",{htmlFor:"saveAsDefault",children:"Save As Default"})]}),S?(0,a.jsx)("button",{type:"button",className:"inline-flex w-full justify-center rounded-md bg-blue-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-700 sm:ml-3 sm:w-auto",onClick:()=>{X()},children:"Save Address"}):(0,a.jsx)("button",{type:"button",className:"inline-flex w-full justify-center rounded-md bg-blue-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-700 sm:ml-3 sm:w-auto",onClick:()=>{es()},children:"Save Edited Address"})]})]})})})})]})}):null,er?(0,a.jsx)("div",{className:"flex justify-end py-3",children:(0,a.jsxs)("button",{onClick:el,className:"border p-3 rounded-md bg-blue-500 text-white",children:["Continue"," ",(0,a.jsx)(o.G,{icon:u.eFW})]})}):(0,a.jsxs)("div",{className:"flex justify-center items-center py-3",children:["Billing Address is Required for checkout\xa0 \xa0 ",(0,a.jsxs)(x(),{href:{pathname:"/customers/buyer-address",query:{page:"checkoutPage"}},children:[" ",(0,a.jsx)("button",{children:(0,a.jsx)("strong",{children:"Click here"})})]})]})]}),E&&(0,a.jsx)(e=>{let{billingErrors:t,shippingErrors:s,onClose:l}=e;return(0,a.jsx)(c.u.Root,{show:E,children:(0,a.jsxs)(d.V,{as:"div",className:"relative z-10",initialFocus:A,onClose:T,children:[(0,a.jsx)(c.u.Child,{enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),(0,a.jsx)("div",{className:"fixed inset-0 z-10 w-full h-full overflow-y-auto",children:(0,a.jsx)("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:(0,a.jsx)(c.u.Child,{enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,a.jsx)(d.V.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full ",children:(0,a.jsxs)("div",{className:"bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4 flex flex-col w-96 h-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center mb-2",children:[" ",(0,a.jsx)("strong",{children:"Update Your Address Information"})]}),(0,a.jsx)("div",{className:"flex items-start flex-col",children:t.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("b",{className:"underline",children:"Billing Address Required"}),t.map((e,t)=>(0,a.jsx)("div",{className:"py-2",children:(0,a.jsxs)("p",{className:"text-red-600",children:['"',e,'"']})},t)),(0,a.jsxs)("div",{children:["Please ",(0,a.jsxs)(x(),{href:{pathname:"/customers/buyer-address",query:{page:"checkoutPage"}},children:[" ",(0,a.jsx)("span",{className:"text-blue-600",children:"click here"})," "]})," to enter all the required fields"]})]})}),(0,a.jsx)("div",{className:"flex items-start flex-col",children:s.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("b",{className:"underline",children:"Shipping Address Required"}),s.map((e,t)=>(0,a.jsx)("ol",{className:"py-2",children:(0,a.jsxs)("li",{className:"text-red-600",children:['"',e,'"']})},t)),(0,a.jsxs)("div",{children:["Please ",(0,a.jsx)("a",{className:"text-blue-600",onClick:()=>{T(!1),et(I)},children:"click here"})," to enter all the required fields"]})]})})]})})})})})]})})},{billingErrors:k,shippingErrors:q,onClose:()=>T(!1)})]})},C=s(29552),D=s(22632),F=s(6881),A=s(88754),E=e=>{var t,s,l;let{Comment:r,CountryId:c,AddressId:d}=e,h=(0,_.Dv)(N.ZP),m=null==h?void 0:null===(t=h.userDetails)||void 0===t?void 0:t.user_id,[p,y]=(0,i.useState)([]),[v,g]=(0,i.useState)([]),[f,j]=(0,i.useState)({GrandTotal:0,ShippingTax:0,ShippingCharge:0,Shipping:0,taxTotal:0,subTotal:0}),[b,S]=(0,i.useState)({loading:!1,success:"",error:""}),E=async()=>{try{var e;let t=await n.Z.post("/shipping_address/getshipping_address_user",{sortDetails:{sort
1Key:"id",sortType:1},searchDetails:[]}),s=[],a=null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.data;for(let e=0;e<a.length;e++)s.push(a[e]);g(s),S({loading:!1,success:"success",error:""})}catch(e){console.error(e),S({loading:!1,success:"error",error:""})}};(0,i.useEffect)(()=>{E()},[null==h?void 0:null===(s=h.userDetails)||void 0===s?void 0:s.user_id]),(0,i.useEffect)(()=>{k()},[null==h?void 0:null===(l=h.userDetails)||void 0===l?void 0:l.user_id]),(0,i.useEffect)(()=>{T()},[c]);let T=async()=>{try{if(c){let t=await n.Z.post("/product-checkout/CalculatedShippingCharges",{countryid:c});if(t.data.data){var e;j(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.data)}}else j({GrandTotal:0,ShippingTax:0,ShippingCharge:0,Shipping:0,taxTotal:0,subTotal:0})}catch(e){}},k=async()=>{try{var e,t,s;let a=await n.Z.post("/product-cart/getCartDetails",{page_enabled:"y",page:1,limit:100,sortDetails:{sortKey:"id",sortType:1},searchDetails:[],searchDetailsAnd:[{basicSearchKey:"userid",basicSearchValue:null==h?void 0:null===(e=h.userDetails)||void 0===e?void 0:e.user_id,basicSearchType:"number"},{basicSearchKey:"status",basicSearchValue:0,basicSearchType:"number"}],searchQuery:"",product3Status:1});Array.isArray(null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.data)&&y(null==a?void 0:null===(s=a.data)||void 0===s?void 0:s.data)}catch(e){}},Z=async()=>{try{var e,t;let s=[],a=await n.Z.post("/product-cart/getCartDetails",{page_enabled:"y",page:1,limit:100,sortDetails:{sortKey:"id",sortType:1},searchDetails:[],searchDetailsAnd:[{basicSearchKey:"userid",basicSearchValue:m,basicSearchType:"number"},{basicSearchKey:"status",basicSearchValue:0,basicSearchType:"number"}],searchQuery:"",...!1});Array.isArray(null==a?void 0:null===(e=a.data)||void 0===e?void 0:e.data)&&(s=null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.data);let l=s.map(e=>{var t,s,a,l;let r=e.quantity<=(null===(t=e.productDetails[0])||void 0===t?void 0:t.quantity);return{code:e.code,quantity:null===(s=null==e?void 0:e.productDetails[0])||void 0===s?void 0:s.quantity,isValid:r,message:r?null:"Product with code ".concat(e.code," is not available. ").concat((null===(a=e.productDetails[0])||void 0===a?void 0:a.quantity)===0?"Out of stock":"Please reduce the quantity to ".concat(null===(l=e.productDetails[0])||void 0===l?void 0:l.quantity),".")}}),i=l.some(e=>!1===e.isValid);if(!i)return(0,F.Z)({type:3,CountryID:c,AddressID:d,payment_type:"original",Comment:r,payment_details:{order_id:-1}});l.filter(e=>!e.isValid).map((e,t)=>(0,w.Z)({type:"error",msg:"".concat(e.message)}))}catch(e){}},q=e=>{var t;let{Quantity:s,ProductURL:l,Images:r,TaxAmount:i,Amount:n,Code:c,ProductID:d,EshopPrice:h,Title:m}=e,p={border:"0.5px solid",borderColor:"#ccc"};return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("tr",{className:"text-center border odd:bg-gray-100",children:[(0,a.jsx)("td",{style:p,className:"flex justify-center items-center p-2",children:(0,a.jsx)(x(),{href:l,children:null===(t=null==r?void 0:r.slice(0,2))||void 0===t?void 0:t.map((e,t)=>(0,a.jsx)("img",{height:100,width:100,src:"".concat(C.Z.CDN_URL_PUBLIC,"/uploads/t/3000/").concat(c).concat(t+1,"0.jpg"),alt:"",className:"w-50 h-30"},t))})}),(0,a.jsx)("td",{className:"w-32",style:p,children:(0,a.jsx)(x(),{href:l,children:m})}),(0,a.jsx)("td",{style:p,children:s}),(0,a.jsx)("td",{style:p,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.G,{icon:u.H0g}),(0,A.b)(h)]})}),(0,a.jsxs)("td",{style:p,children:[(0,a.jsx)(o.G,{icon:u.H0g}),(0,A.b)(n)]}),(0,a.jsx)("td",{style:p,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.G,{icon:u.H0g}),(0,A.b)(i)]})})]},d)})},P=v.some(e=>2===e.status);return(0,a.jsxs)("div",{className:"",children:[(0,a.jsxs)("table",{className:"w-full border rounded-md mt-5",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Image"}),(0,a.jsx)("th",{children:"Lot Title"}),(0,a.jsx)("th",{children:"Quantity"}),(0,a.jsx)("th",{children:"Unit Price"}),(0,a.jsx)("th",{children:"Amount"}),(0,a.jsx)("th",{children:"Tax Amount"})]})}),(0,a.jsx)("tbody",{children:p.map(e=>{var t,s,l,r,i,n,c,d;let o=(0,D.Z)({category:[null===(t=e.productDetails[0])||void 0===t?void 0:t.category_2,null===(s=e.productDetails[0])||void 0===s?void 0:s.category_1,null===(l=e.productDetails[0])||void 0===l?void 0:l.category_3,null===(r=e.productDetails[0])||void 0===r?void 0:r.category_4,null===(i=e.productDetails[0])||void 0===i?void 0:i.category_5],title:null===(n=e.productDetails[0])||void 0===n?void 0:n.title,auction:0,code:e.code,auctiontype:"e-shop",type:1,isLive:0});return(0,a.jsx)(q,{ProductID:null==e?void 0:e.id,EshopPrice:null==e?void 0:e.eshop_price,Code:null==e?void 0:e.code,Amount:null==e?void 0:e.amount,TaxAmount:null==e?void 0:e.tax_amount,Images:null===(c=null==e?void 0:e.productDetails[0])||void 0===c?void 0:c.imagesArr,ProductURL:o,Quantity:null==e?void 0:e.quantity,Title:null===(d=null==e?void 0:e.productDetails[0])||void 0===d?void 0:d.title})})})]}),(0,a.jsx)("div",{className:"flex justify-end py-3",children:(0,a.jsxs)("table",{className:"table-auto",children:[(0,a.jsxs)("tbody",{children:[(0,a.jsx)("tr",{className:" bg-gray-100 text-gray-900 text-xs",children:(0,a.jsxs)("td",{className:"p-3 w-[16rem] flex justify-between items-center ",children:[(0,a.jsx)("h1",{className:"font-bold",children:"Sub Total"}),(0,a.jsxs)("h2",{className:"p-3 font-bold text-red-500",children:[(0,a.jsx)(o.G,{icon:u.H0g})," ","".concat((0,A.b)(null==f?void 0:f.subTotal),"/-")]})]})}),(0,a.jsx)("tr",{className:" bg-gray-200 text-gray-900 text-xs",children:(0,a.jsxs)("td",{className:"p-3 w-[16rem] flex justify-between items-center",children:[(0,a.jsx)("h1",{className:"font-bold",children:"Tax Total"}),(0,a.jsxs)("h2",{className:"p-3 font-bold text-red-500",children:[(0,a.jsx)(o.G,{icon:u.H0g})," ","".concat((0,A.b)(null==f?void 0:f.taxTotal),"/-")]})]})}),(0,a.jsx)("tr",{className:" bg-gray-100 text-gray-900 text-xs",children:(0,a.jsxs)("td",{className:"p-3 w-[16rem] flex justify-between items-center",children:[(0,a.jsx)("h1",{className:"font-bold",children:"Shipping Charge"}),(0,a.jsxs)("h1",{className:"p-3 font-bold text-red-500",children:[(0,a.jsx)(o.G,{icon:u.H0g})," ","".concat((0,A.b)(null==f?void 0:f.Shipping),"/-")]})]})}),(0,a.jsx)("tr",{className:" bg-gray-200 text-gray-900 text-xs",children:(0,a.jsxs)("td",{className:"p-3 w-[16rem] flex justify-between items-center",children:[(0,a.jsx)("h1",{className:"font-bold",children:"Grand Total"}),(0,a.jsxs)("h2",{className:"p-3 font-bold text-red-500",children:[(0,a.jsx)(o.G,{icon:u.H0g})," ","".concat((0,A.b)(null==f?void 0:f.GrandTotal),"/-")]})]})})]}),96===c&&(0,a.jsx)("button",{className:"bg-green-600 rounded h-7 w-[16rem] mt-2 text-white",onClick:Z,children:"Pay Now"})]})}),!P&&(0,a.jsxs)("div",{className:"w-full flex items-center justify-center",children:["Billing Address is Required for Payment\xa0 \xa0 ",(0,a.jsxs)(x(),{href:{pathname:"/customers/buyer-address",query:{page:"checkoutPage"}},children:[" ",(0,a.jsx)("button",{children:(0,a.jsx)("strong",{children:"Click here"})})]})]}),96!==c&&c>0&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"w-full",children:["At the moment, international Delivery services are unavailable, therefore, kindly reach out to MarudharArts for placing your order,for further information ",(0,a.jsx)(x(),{href:"/contact",children:(0,a.jsx)("strong",{children:"Click here"})})]})})]})},T=e=>{let{onChildStateChange:t,onCommentChange:s}=e,[l,r]=(0,i.useState)("");return(0,a.jsxs)("div",{className:"",children:[(0,a.jsx)("h1",{children:"Enter any comments for product(**if necessary) "}
1),(0,a.jsx)("textarea",{name:"",value:l,onChange:e=>{let t=e.target.value;r(t),s(l)},className:"w-full border h-36",id:""}),(0,a.jsx)("div",{className:"flex justify-end py-3",children:(0,a.jsxs)("button",{onClick:()=>{t()},className:"border p-3 rounded-md bg-blue-500 text-white",children:["Continue"," ",(0,a.jsx)(o.G,{icon:u.eFW})]})})]})},k=e=>{let{onChildStateChange:t}=e,[s,l]=(0,i.useState)([]),[r,c]=(0,i.useState)(0),[d,h]=(0,i.useState)({loading:!1,success:"",error:""}),m=async()=>{try{var e;let t=await n.Z.get("/user/viewuser");c(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.id),h({loading:!1,success:"success",error:""})}catch(e){console.error(e),h({loading:!1,success:"error",error:""})}};(0,i.useEffect)(()=>{m()},[r]),(0,i.useEffect)(()=>{p()},[r]);let p=async()=>{try{var e,t;let s=await n.Z.post("/product-cart/getCartDetails",{page_enabled:"y",page:1,limit:100,sortDetails:{sortKey:"id",sortType:1},searchDetails:[],searchDetailsAnd:[{basicSearchKey:"status",basicSearchValue:0,basicSearchType:"number"}],searchQuery:"",product3Status:1});Array.isArray(null==s?void 0:null===(e=s.data)||void 0===e?void 0:e.data)&&l(null==s?void 0:null===(t=s.data)||void 0===t?void 0:t.data)}catch(e){}},y=e=>{var t;let{Quantity:s,ProductURL:l,Images:r,TaxAmount:i,Amount:n,Code:c,ProductID:d,EshopPrice:h,Title:m}=e,p={border:"0.5px solid",borderColor:"#ccc"};return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("tr",{className:"text-center border odd:bg-gray-100",children:[(0,a.jsx)("td",{style:p,className:"flex justify-center items-center p-2",children:(0,a.jsx)(x(),{href:l,children:null===(t=null==r?void 0:r.slice(0,2))||void 0===t?void 0:t.map((e,t)=>(0,a.jsx)("img",{height:100,width:100,src:"".concat(C.Z.CDN_URL_PUBLIC,"/uploads/t/3000/").concat(c).concat(t+1,"0.jpg"),alt:"",className:"w-50 h-30"},t))})}),(0,a.jsx)("td",{className:"w-32",style:p,children:(0,a.jsx)(x(),{href:l,children:m})}),(0,a.jsx)("td",{style:p,children:s}),(0,a.jsx)("td",{style:p,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.G,{icon:u.H0g}),(0,A.b)(h)]})}),(0,a.jsxs)("td",{style:p,children:[(0,a.jsx)(o.G,{icon:u.H0g}),(0,A.b)(n)]}),(0,a.jsx)("td",{style:p,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.G,{icon:u.H0g}),(0,A.b)(i)]})})]},d)})};return(0,a.jsxs)("div",{className:"",children:[(0,a.jsxs)("table",{className:"w-full border rounded-md mt-5",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Image"}),(0,a.jsx)("th",{children:"Lot Title"}),(0,a.jsx)("th",{children:"Quantity"}),(0,a.jsx)("th",{children:"Unit Price"}),(0,a.jsx)("th",{children:"Amount"}),(0,a.jsx)("th",{children:"Tax Amount"})]})}),(0,a.jsx)("tbody",{children:s.map(e=>{var t,s,l,r,i,n,c,d;let o=(0,D.Z)({category:[null===(t=e.productDetails[0])||void 0===t?void 0:t.category_2,null===(s=e.productDetails[0])||void 0===s?void 0:s.category_1,null===(l=e.productDetails[0])||void 0===l?void 0:l.category_3,null===(r=e.productDetails[0])||void 0===r?void 0:r.category_4,null===(i=e.productDetails[0])||void 0===i?void 0:i.category_5],title:null===(n=e.productDetails[0])||void 0===n?void 0:n.title,auction:0,code:e.code,auctiontype:"e-shop",type:1,isLive:0});return(0,a.jsx)(y,{ProductID:null==e?void 0:e.id,EshopPrice:null==e?void 0:e.eshop_price,Code:null==e?void 0:e.code,Amount:null==e?void 0:e.amount,TaxAmount:null==e?void 0:e.tax_amount,Images:null===(c=null==e?void 0:e.productDetails[0])||void 0===c?void 0:c.imagesArr,ProductURL:o,Quantity:null==e?void 0:e.quantity,Title:null===(d=null==e?void 0:e.productDetails[0])||void 0===d?void 0:d.title})})})]}),(0,a.jsx)("div",{className:"flex justify-end py-3",children:(0,a.jsxs)("button",{className:"border p-3 rounded-md bg-blue-500 text-white",onClick:()=>{t()},children:["Continue"," ",(0,a.jsx)(o.G,{icon:u.eFW})]})})]})},Z=s(9008),q=s.n(Z),P=s(11163),I=function(){var e;let t=(0,_.Dv)(N.ZP),s=null==t?void 0:null===(e=t.userDetails)||void 0===e?void 0:e.user_id,[l,c]=(0,i.useState)(!1),[d,o]=(0,i.useState)(!1),[u,h]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),[p,y]=(0,i.useState)(0),[v,g]=(0,i.useState)(0),[f,j]=(0,i.useState)(""),[b,C]=(0,i.useState)(!1),[D,F]=(0,i.useState)([]),A=(0,P.useRouter)();(0,i.useEffect)(()=>{try{Z(-1),Z(0)}catch(e){}},[s]);let Z=async e=>{try{var t,a;let l=await n.Z.post("/product-cart/getCartDetails",{page_enabled:"y",page:1,limit:100,sortDetails:{sort
1Key:"id",sortType:1},searchDetails:[],searchDetailsAnd:[{basicSearchKey:"userid",basicSearchValue:s,basicSearchType:"number"},{basicSearchKey:"status",basicSearchValue:e,basicSearchType:"number"}],searchQuery:"",...-1===e&&{product3Status:1}});Array.isArray(null==l?void 0:null===(t=l.data)||void 0===t?void 0:t.data)&&0===e&&F(null==l?void 0:null===(a=l.data)||void 0===a?void 0:a.data)}catch(e){}};(0,i.useEffect)(()=>{let e=D.map(e=>{var t,s,a,l;let r=e.quantity<=(null===(t=e.productDetails[0])||void 0===t?void 0:t.quantity);return{code:e.code,quantity:null===(s=null==e?void 0:e.productDetails[0])||void 0===s?void 0:s.quantity,isValid:r,message:r?null:"Product with code ".concat(e.code," is not available. ").concat((null===(a=e.productDetails[0])||void 0===a?void 0:a.quantity)===0?"Out of stock":"Please reduce the quantity to ".concat(null===(l=e.productDetails[0])||void 0===l?void 0:l.quantity),".")}}),t=e.some(e=>!1===e.isValid);t&&(e.filter(e=>!e.isValid).map((e,t)=>(0,w.Z)({type:"error",msg:"".concat(e.message)})),A.push("/cart"))},[D]);let[I,G]=(0,i.useState)({loading:!1,success:"",error:""});return(0,i.useEffect)(()=>{c(!0)},[]),(0,a.jsxs)("div",{children:[(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(q(),{children:(0,a.jsx)("title",{children:"Checkout"})})}),(0,a.jsx)("div",{className:"lg:mx-28 "}),(0,a.jsxs)(r.UQ,{allowZeroExpanded:!0,preExpanded:[""],children:[(0,a.jsxs)(r.Qd,{uuid:"cartReview",dangerouslySetExpanded:l,children:[(0,a.jsx)(r.Ol,{children:(0,a.jsx)(r.on,{children:(0,a.jsx)("div",{className:" lg:mx-28 ",children:(0,a.jsxs)("div",{className:"container mx-auto bg-gray-50 flex border select-none items-center shadow-md justify-between mt-3 p-3",children:[(0,a.jsx)("h1",{className:"text-lg",children:"Step 1:Cart Review"}),(0,a.jsx)("h2",{onClick:()=>{h(!1),c(!0),o(!1),x(!1)},children:"[edit]"})]})})})}),(0,a.jsx)(r.Mt,{children:(0,a.jsx)("div",{className:" lg:mx-28 ",children:(0,a.jsx)("div",{className:"container mx-auto border p-3",children:(0,a.jsx)("div",{className:"mt-5 py-5 overflow-x-auto ",children:(0,a.jsx)(k,{onChildStateChange:()=>{h(!1),c(!1),o(!0),x(!1)}})})})})})]}),(0,a.jsxs)(r.Qd,{uuid:"deliveryInformation",dangerouslySetExpanded:d,children:[(0,a.jsx)(r.Ol,{children:(0,a.jsx)(r.on,{children:(0,a.jsx)("div",{className:" lg:mx-28 ",children:(0,a.jsxs)("div",{className:"container mx-auto bg-gray-50 flex border select-none items-center shadow-md justify-between mt-3 p-3",children:[(0,a.jsx)("h1",{className:"text-lg",children:"Step 2:Delivery Information"}),(0,a.jsx)("h2",{onClick:()=>{try{h(!1),c(!1),o(!0),x(!1)}catch(e){console.error(e)}},children:"[edit]"})]})})})}),(0,a.jsx)(r.Mt,{children:(0,a.jsx)("div",{className:" lg:mx-28 ",children:(0,a.jsx)("div",{className:"container mx-auto border p-3",children:(0,a.jsx)("div",{className:"mt-5 py-5 ",children:(0,a.jsx)(S,{selectedAddress:p,onAddressSelection:(e,t)=>{y(e),g(t)},onChildStateChange:()=>{b||(h(!0),c(!1),o(!1),x(!1))},setAddressErrors:C})})})})})]}),(0,a.jsxs)(r.Qd,{uuid:"comments",dangerouslySetExpanded:u,children:[(0,a.jsx)(r.Ol,{children:(0,a.jsx)(r.on,{children:(0,a.jsx)("div",{className:" lg:mx-28 ",children:(0,a.jsxs)("div",{className:"container mx-auto bg-gray-50 flex border select-none items-center shadow-md justify-between mt-3 p-3",children:[(0,a.jsx)("h1",{className:"text-lg",children:"Step 3:Comments"}),(0,a.jsx)("h2",{onClick:()=>{try{b||(h(!0),c(!1),o(!1),x(!1))}catch(e){}},children:"[edit]"})]})})})}),(0,a.jsx)(r.Mt,{children:(0,a.jsx)("div",{className:" lg:mx-28 ",children:(0,a.jsx)("div",{className:"container mx-auto border p-3",children:(0,a.jsx)("div",{className:"mt-5 py-5 ",children:(0,a.jsx)(T,{onCommentChange:e=>{j(e)},onChildStateChange:()=>{b||(h(!1),c(!1),o(!1),x(!0))}})})})})})]}),(0,a.jsxs)(r.Qd,{uuid:"finalPayment",dangerouslySetExpanded:m,children:[(0,a.jsx)(r.Ol,{children:(0,a.jsx)(r.on,{children:(0,a.jsx)("div",{className:" lg:mx-28 ",children:(0,a.jsx)("div",{className:"container mx-auto bg-gray-50 flex border select-none items-center shadow-md justify-between mt-3 p-3",children:(0,a.jsx)("h1",{className:"text-lg",children:"Step 4:Final Payment"})})})})}),(0,a.jsx)(r.Mt,{children:(0,a.jsx)("div",{className:" lg:mx-28 ",children:(0,a.jsx)("div",{className:"container mx-auto border p-3",children:(0,a.jsx)("div",{className:"mt-5 py-5 ",children:(0,a.jsx)(E,{AddressId:p,CountryId:v,Comment:f})})})})})]})]}),(0,a.jsxs)("div",{className:" w-screen flex justify-center py-7",children:[I.loading&&(0,a.jsx)("div",{className:"pt-3 pb-3",children:(0,a.jsx)("p",{className:"text-blue-400 text-sm bg-blue-100 p-2 rounded",children:"Loading..."})}),(0,a.jsxs)("div",{className:"felx flex-col text-center ",children:[!I.loading&&""!==I.success&&(0,a.jsx)("div",{className:"pt-3 pb-3 text-center",children:(0,a.jsx)("p",{className:"text-green-500 text-sm bg-green-100 p-2 rounded",children:I.success})}),!I.loading&&""!==I.error&&(0,a.jsx)("div",{className:"pt-3 pb-3 text-center",children:(0,a.jsx)("p",{className:"text-red-500 text-sm bg-red-100 p-2 rounded",children:I.error})})]})]})]})},G=()=>{let e=(0,_.Dv)(N.ZP);return e.isLoggedIn?(0,a.jsx)(I,{}):(0,a.jsx)(l.Z,{})}},6881:function(e,t,s){"use strict";var a=s(85893);s(67294);var l=s(88446),r=s(29552);let i=async e=>{try{var t;let s=e.type,a=e.payment_type,i=e.CountryID,n=e.AddressID,c=e.Comment,d=null==e?void 0:null===(t=e.payment_details)||void 0===t?void 0:t.order_id,o=async e=>{try{let t=await l.Z.post("/payment/initiate",{orderId:e,type:3});return null==t?void 0:t.data.payload}catch(e){return console.error(e),""}},u=async(e,t,s)=>{try{let i=await l.Z.post("/product-checkout/eshop_checkout",{selectedAddress:e,selectedCountry:t,comment:s});if(200===i.status){var a,r;let e=null==i?void 0:null===(a=i.data)||void 0===a?void 0:null===(r=a.data)||void 0===r?void 0:r.orderId;return{orderID:e,status:"success"}}}catch(e){return console.error(e),{}}},h=0;
1if("number"==typeof s&&3===s&&"number"==typeof n&&"number"==typeof i){let e="";if("string"==typeof a&&"original"===a){let e=await u(n,i,c);"object"==typeof e&&Object.keys(e).length>0&&"string"==typeof e.status&&"success"===e.status&&(h=e.orderID)}"string"==typeof a&&"try-again"===a&&(h=d);let t=await o(h);if(t.length>0){e=t;let s=document.createElement("form");s.method="POST",s.action="".concat(r.Z.PAYMENT_GATEWAY_URL);let a=document.createElement("input");a.type="hidden",a.name="encRequest",a.value=e,s.appendChild(a);let l=document.createElement("input");l.type="hidden",l.name="access_code",l.value="".concat(r.Z.PAYMENT_GATEWAY_ACCESS_CODE),s.appendChild(l),document.body.appendChild(s),s.submit()}}}catch(e){console.error(e)}return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"text-center",children:(0,a.jsx)("h4",{children:"please do not refresh the page........"})})})};t.Z=i},28646:function(e,t,s){"use strict";var a=s(85893),l=s(41664),r=s.n(l),i=s(11163);s(67294),t.Z=()=>{let e=(0,i.useRouter)(),t=e.asPath;return(0,a.jsxs)("div",{className:"md:mx-28 text-center text-red-500 p-10 bg-gray-100 text-xl",children:["Your are not Logged in to use this functionality .......! ",(0,a.jsx)("br",{}),(0,a.jsx)(r(),{className:"text-blue-500",href:"/login?re_url=".concat(t),children:"Click here to Login"})]})}},22632:function(e,t){"use strict";let s=e=>{var t,s,a;let l=null==e?void 0:e.replace(/[^\w\s]/g," "),r=null===(t=null==l?void 0:l.toLowerCase())||void 0===t?void 0:t.replace(/\s+/g,"-");return null===(s=null===(a=null==r?void 0:r.replace(/[^a-zA-Z0-9-]/g,""))||void 0===a?void 0:a.replace(/-{2,}/g,"-"))||void 0===s?void 0:s.replace(/^-+|-+$/g,"")};t.Z=e=>{try{var t,a,l;let r="",i="",n=e.code,c=e.isLive,d=null==n?void 0:n.toString().slice(-4),o=null==d?void 0:d.toString(),u=parseInt(null===(t=parseInt(o,10))||void 0===t?void 0:t.toString()),h=parseInt(null==n?void 0:n.toString().substring(0,2)),m=e.auctiontype;if("all"===m)switch(h){case 10:m=1==c?"live-e-auction":"e-auction-archive";break;case 20:m=1==c?"live-p-auction":"p-auction-archive";break;case 30:m="e-shop"}if(1===e.type){for(let t of e.category)if(Array.isArray(t)&&(null==t?void 0:t.length)>0){let e=t[0];if("number"==typeof(null==e?void 0:e.id)&&"string"==typeof(null==e?void 0:e.category)&&(null===(a=e.cat_url)||void 0===a?void 0:a.length)>0){let t=s(null==e?void 0:e.cat_url);i+="".concat(t,"/")}}}else if(2===e.type){for(let t of e.category)if(Array.isArray(t)&&(null==t?void 0:t.length)>0){let e=t[0];if("number"==typeof(null==e?void 0:e.id)&&"string"==typeof(null==e?void 0:e.category)&&(null===(l=e.cat_url)||void 0===l?void 0:l.length)>0){let t=s(null==e?void 0:e.cat_url);i+="".concat(t,"/")}}}let x=s(e.title),p=i.substring(0,(null==i?void 0:i.length)-1);switch(m){case"p-auction-archive":r="/printed-auction/auction-no-".concat(e.auction,"/lot-no-").concat(u,"/").concat(p,"/").concat(x);break;case"e-auction-archive":r="/e-auction/auction-no-".concat(e.auction,"/lot-no-").concat(u,"/").concat(p,"/").concat(x);break;case"live-p-auction":r="/live-printed-auction/auction-no-".concat(e.auction,"/lot-no-").concat(u,"/").concat(p,"/").concat(x);break;case"live-e-auction":r="/live-e-auction/auction-no-".concat(e.auction,"/lot-no-").concat(u,"/").concat(p,"/").concat(x);break;case"e-shop":r="/e-shop/pid-no-".concat(u,"/").concat(p,"/").concat(x)}return r}catch(e){console.error(e)}return""}},54464:function(e,t,s){"use strict";var a=s(85893),l=s(88446),r=s(67294);let i=(e,t)=>{let[s,a]=(0,r.useState)([]),[i,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{n(!0);let t=async()=>{try{e&&await l.Z.post("/world_city/getworld_city",{page_enabled:"n",page:1,limit:100,sortDetails:{sortKey:"id",sortType:1},searchDetails:[{basicSearchKey:"state_id",basicSearchValue:e,basicSearchType:"number"}],searchDetailsAnd:[],searchQuery:""}).then(e=>{var t;a(null===(t=e.data)||void 0===t?void 0:t.data)}).catch(()=>{a([])}).finally(()=>{n(!1)})}catch(e){console.error(e)}};t()},[t,e,a,n]),{data:s,loading:i}};t.Z=e=>{let{country_id:t,state_id:s,value:l,...r}=e,{data:n,loading:c}=i(s,t);return(0,a.jsxs)("select",{value:l,...r,className:"shadow appearance-none text-sm border-gray-200 rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline",disabled:c,
1children:[(0,a.jsxs)("option",{value:-1,children:[" ",c?"loading...":"Select city"]}),n.map(e=>(0,a.jsx)("option",{value:e.id,"data-name":e.name,children:[e.name]},e.id))]})}},34994:function(e,t,s){"use strict";var a=s(85893),l=s(88446),r=s(67294);t.Z=e=>{let[t,s]=(0,r.useState)([]);return(0,r.useEffect)(()=>{let e=async()=>{try{var e;let t=await l.Z.post("/world_country/getworld_country",{page_enabled:"n",page:1,limit:10,sortDetails:{sortKey:"name",sortType:1},searchDetails:[]});s(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.data)}catch(e){console.error("Error",e)}};e()},[]),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("select",{...e,className:"shadow appearance-none text-sm border-gray-200 rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline ",children:[(0,a.jsx)("option",{value:"-1",children:"Select Country"}),t.map((e,t)=>(0,a.jsx)("option",{value:e.id,"data-name":e.name,children:[e.name]},e.id))]})})}},977:function(e,t,s){"use strict";var a=s(85893),l=s(88446),r=s(67294);let i=e=>{let[t,s]=(0,r.useState)([]),[a,i]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{i(!0),e&&l.Z.post("world_state/getworld_state",{page_enabled:"n",page:1,limit:25,sortDetails:{sortKey:"123",sortType:-1},searchDetails:[{basicSearchKey:"country_id",basicSearchValue:e,basicSearchType:"number"}]}).then(e=>{let{data:t}=e;s(null==t?void 0:t.data)}).catch(()=>{s([])}).finally(()=>{i(!1)})},[e,s,i]),{data:t,loading:a}};t.Z=e=>{let{country_id:t,value:s,...l}=e,{data:r,loading:n}=i(t);return(0,a.jsxs)("select",{value:s,...l,disabled:n,className:"shadow appearance-none text-sm border-gray-200 rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline",children:[(0,a.jsx)("option",{value:-1,children:n?"loading...":"Select State"}),r.map(e=>(0,a.jsx)("option",{value:e.id,"data-name":e.name,children:[e.name]},e.id))]})}},88754:function(e,t,s){"use strict";s.d(t,{b:function(){return a}});let a=e=>{try{let t="";if("number"==typeof e?t=e.toString():"string"==typeof e&&(t=e),t.includes("-")){let[e,s]=t.split("-");return l(e)+"-"+l(s)}return l(t)}catch(e){return console.error("Error formatting number:",e),"-"}},l=e=>{try{let t="",s=0,[a,l]=e.split(".");for(let e=a.length-1;e>=0;e--)t=a[e]+t,s++,3===s&&e>0?t=","+t:s>3&&(s-3)%2==0&&e>0&&(t=","+t);return l&&(t+="."+l),t}catch(e){return console.error("Error formatting part of the number:",e),"-"}}},61839:function(e,t,s){"use strict";var a=s(30120);t.Z=(e,t)=>{try{if(!e)return"Date does not exist";let s=new Date(e),l=s.valueOf();if("number"!=typeof l||isNaN(l))return"Invalid Date";let r={year:s.getUTCFullYear(),month:s.getUTCMonth(),date:s.getUTCDate(),hours:s.getUTCHours(),minutes:s.getUTCMinutes(),seconds:s.getUTCSeconds()},i=a.ou.fromObject({year:r.year,month:r.month+1,day:r.date,hour:r.hours,minute:r.minutes,second:r.seconds});if(t.length>0)return i.setZone("Asia/Kolkata").toFormat(t).toString();return i.setZone("Asia/Kolkata").toString()}catch(e){return console.error(e),"Invalid Date"}}},9330:function(){},93235:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,l.default)(e),"object"===r(t)?(s=t.min||0,a=t.max):(s=arguments[1],a=arguments[2]);var s,a,i=encodeURI(e).split(/%..|./).length-1;return i>=s&&(void 0===a||i<=a)};var a,l=(a=s(65571))&&a.__esModule?a:{default:a};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=t.default,e.exports.default=t.default},83868:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,a.default)(e),(t=(0,n.default)(t,d)).require_display_name||t.allow_display_name){var s=e.match(o);if(s){var c,y,v=s[1];if(e=e.replace(v,"").replace(/(^<|>$)/g,""),v.endsWith(" ")&&(v=v.slice(0,-1)),!(y=(c=v).replace(/^"(.+)"$/,"$1")).trim()||/[\.";<>]/.test(y)&&(y===c||y.split('"').length!==y.split('\\"').length))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>254)return!1;var g=e.split("@"),f=g.pop(),j=f.toLowerCase();if(t.host_blacklist.includes(j)||t.host_whitelist.length>0&&!t.host_whitelist.includes(j))return!1;var b=g.join("@");if(t.domain_specific_validation&&("gmail.com"===j||"googlemail.com"===j)){var _=(b=b.toLowerCase()).split("+")[0];if(!(0,l.default)(_.replace(/\./g,""),{min:6,max:30}))return!1;for(var N=_.split("."),w=0;w<N.length;w++)if(!h.test(N[w]))return!1}if(!1===t.ignore_max_length&&(!(0,l.default)(b,{max:64})||!(0,l.default)(f,{max:254})))return!1;if(!(0,r.default)(f,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length,allow_underscores:t.allow_underscores})){if(!t.allow_ip_domain)return!1;if(!(0,i.default)(f)){if(!f.startsWith("[")||!f.endsWith("]"))return!1;var S=f.slice(1,-1);if(0===S.length||!(0,i.default)(S))return!1}}if('"'===b[0])return b=b.slice(1,b.length-1),t.allow_utf8_local_part?p.test(b):m.test(b);for(var C=t.allow_utf8_local_part?x:u,D=b.split("."),F=0;F<D.length;F++)if(!C.test(D[F]))return!1;return!t.blacklisted_chars||-1===b.search(RegExp("[".concat(t.blacklisted_chars,"]+"),"g"))};var a=c(s(65571)),l=c(s(93235)),r=c(s(10221)),i=c(s(61028)),n=c(s(84808));
1function c(e){return e&&e.__esModule?e:{default:e}}var d={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},o=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,u=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,h=/^[a-z\d]+$/,m=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,x=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;e.exports=t.default,e.exports.default=t.default},10221:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,a.default)(e),(t=(0,l.default)(t,i)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1)),!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var s=e.split("."),r=s[s.length-1];return!(t.require_tld&&(s.length<2||!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(r)||/\s/.test(r))||!t.allow_numeric_tld&&/^\d+$/.test(r))&&s.every(function(e){return!(e.length>63&&!t.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)||/[\uff01-\uff5e]/.test(e)||/^-|-$/.test(e)||!t.allow_underscores&&/_/.test(e))})};var a=r(s(65571)),l=r(s(84808));function r(e){return e&&e.__esModule?e:{default:e}}var i={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default},61028:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return((0,l.default)(t),s=String(s))?"4"===s?n.test(t):"6"===s&&d.test(t):e(t,4)||e(t,6)};var a,l=(a=s(65571))&&a.__esModule?a:{default:a},r="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",i="(".concat(r,"[.]){3}").concat(r),n=new RegExp("^".concat(i,"$")),c="(?:[0-9a-fA-F]{1,4})",d=RegExp("^("+"(?:".concat(c,":){7}(?:").concat(c,"|:)|")+"(?:".concat(c,":){6}(?:").concat(i,"|:").concat(c,"|:)|")+"(?:".concat(c,":){5}(?::").concat(i,"|(:").concat(c,"){1,2}|:)|")+"(?:".concat(c,":){4}(?:(:").concat(c,"){0,1}:").concat(i,"|(:").concat(c,"){1,3}|:)|")+"(?:".concat(c,":){3}(?:(:").concat(c,"){0,2}:").concat(i,"|(:").concat(c,"){1,4}|:)|")+"(?:".concat(c,":){2}(?:(:").concat(c,"){0,3}:").concat(i,"|(:").concat(c,"){1,5}|:)|")+"(?:".concat(c,":){1}(?:(:").concat(c,"){0,4}:").concat(i,"|(:").concat(c,"){1,6}|:)|")+"(?::((?::".concat(c,"){0,5}:").concat(i,"|(?::").concat(c,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default},65571:function(e,t){"use strict";function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t=s(e);throw null===e?t="null":"object"===t&&(t=e.constructor.name),TypeError("Expected a string but received a ".concat(t))}},e.exports=t.default,e.exports.default=t.default},84808:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var s in t)void 0===e[s]&&(e[s]=t[s]);return e},e.exports=t.default,e.exports.default=t.default}},function(e){e.O(0,[120,1303,4288,1477,484,9774,2888,179],function(){return e(e.s=57250)}),_N_E=e.O()}]);
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.