OwlCyberSecurity - MANAGER
Edit File: 8474-9ef93598017114b5.js
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8474],{68474:function(e,t,s){s.d(t,{Z:function(){return L}});var l=s(57437),a=s(55731),n=s(50400),i=s(2265),r=s(14438),c=s(69064),d=s(32603),o=s(59964),x=s(99891),h=s(82714),p=s(27648),m=function(e){let{amazonCart:t,calculateCount:s,removeItemFromBasket:n}=e,i=(0,d.I0)();(0,d.v9)(a.u0);let r=(0,o.Z)();return(0,l.jsxs)("div",{className:"checkout-content-right-section",children:[(0,l.jsx)("div",{className:"flex items-center justify-between border-b pb-3",children:(0,l.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 text-[18px]",children:[(0,l.jsxs)("svg",{width:"28",height:"25",viewBox:"0 0 28 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M16.432 6.59054C15.7945 6.64112 15.0581 6.6917 14.3217 6.79063C13.194 6.93568 12.0664 7.13354 11.1351 7.57389C9.32086 8.31327 8.09427 9.88352 8.09427 12.1924C8.09427 15.0919 9.95833 16.5625 12.3111 16.5625C13.0973 16.5625 13.7341 16.4665 14.3217 16.3185C15.2552 16.0239 16.04 15.4831 16.9713 14.5028C17.512 15.2392 17.6578 15.5836 18.5906 16.3691C18.8353 16.468 19.08 16.468 19.2764 16.32C19.8648 15.8298 20.8935 14.9453 21.4343 14.4544C21.6783 14.2558 21.6299 13.9635 21.4834 13.7165C20.9426 13.0292 20.4048 12.4386 20.4048 11.1146V6.69393C20.4048 4.82466 20.5499 3.10713 19.1797 1.83145C18.0506 0.796766 16.2854 0.40625 14.9138 0.40625C14.7174 0.40625 14.5218 0.40625 14.3247 0.40625C11.8239 0.552786 9.17656 1.63135 8.58669 4.7287C8.48999 5.11922 8.7853 5.26873 8.98093 5.31857L11.7264 5.66371C12.021 5.61164 12.1675 5.36766 12.2159 5.12071C12.4636 4.04288 13.345 3.50211 14.3254 3.40318C14.3753 3.40318 14.4243 3.40318 14.5225 3.40318C15.1102 3.40318 15.7469 3.65014 16.0913 4.13735C16.4803 4.7287 16.4342 5.51569 16.4342 6.20151L16.432 6.59054ZM15.8927 12.4356C15.5498 13.1237 14.9607 13.5655 14.3232 13.7135C14.2257 13.7135 14.0799 13.7641 13.9319 13.7641C12.8534 13.7641 12.2137 12.9288 12.2137 11.7C12.2137 10.1305 13.1464 9.39109 14.3232 9.04818C14.9607 8.90165 15.6971 8.85107 16.4327 8.85107V9.44093C16.432 10.5716 16.4781 11.4545 15.8927 12.4356Z",fill:"black"}),(0,l.jsx)("path",{d:"M27.1953 19.4156V19.2557C27.1953 19.0407 27.1433 18.8808 27.0912 18.8049C26.8509 18.5104 25.0903 18.2441 23.5736 18.6963C23.1481 18.8325 22.7739 19.0184 22.4273 19.2587C22.1595 19.4446 22.2146 19.6827 22.4801 19.6581C22.7732 19.6001 23.1473 19.5755 23.5728 19.522C24.5049 19.4417 25.599 19.4156 25.8631 19.7615C26.2358 20.2145 25.4384 22.1916 25.0895 23.0433C24.9839 23.3119 25.2241 23.4182 25.4637 23.2323C26.6627 22.2184 27.1693 20.3759 27.1953 19.4156Z",fill:"#FB961B"}),(0,l.jsx)("path",{d:"M23.5728 21.8465C23.947 21.63 24.3182 21.3883 24.6648 21.1227C25.1446 20.7783 24.7176 20.2405 24.2378 20.457C24.0243 20.5344 23.7841 20.6444 23.5721 20.7218C20.5067 21.9246 17.2866 22.4855 14.3016 22.4855C9.55962 22.4855 4.97757 21.1763 1.27473 19.0147C0.928102 18.8287 0.687842 19.1746 0.982402 19.4156C4.4182 22.5375 8.9467 24.406 14.01 24.406C17.1527 24.406 20.7752 23.5283 23.5728 21.8465Z",fill:"#FB961B"})]}),(0,l.jsx)("h3",{className:"font-IRANSansBold",children:"فاکتور خرید از آمازون"})]}),(0,l.jsx)(p.default,{className:"text-[var(--base-blue)] text-[14px] underline cursor-pointer font-IRANSansBold",href:"/",children:"ثبت سفارش جدید"})]})}),(0,l.jsx)("div",{className:"checkout-contents-container",children:(0,l.jsx)("div",{className:"checkout-contents",children:t.map(e=>(0,l.jsxs)("div",{className:"flex flex-col gap-2 border-b border-[var(--very-light-border)] py-5 last:border-none",children:[(0,l.jsxs)("div",{className:"flex gap-2 md:gap-4 lg:gap-7",children:[(0,l.jsxs)("div",{className:"checkout-content-single-img",children:[(0,l.jsx)(p.default,{href:"/product/".concat(e.asin,"/").concat((0,h.l)(e.name)),children:(0,l.jsx)("img",{src:e.image,onError:e=>{e.target.src="/assets/images/home/default-img.png"},alt:""})}),r?(0,l.jsxs)("div",{className:"set-count-basket-border",children:[(0,l.jsx)("button",{onClick:()=>{i((0,a.dP)(e.id)),s(e.id,e.cost,e.weight_unit,e.exchange_id,e.region_id,e.firstweight,Number(e.count)+1,"increment")},children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-5 h-5 text-[var(--light-blue)]",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v12m6-6H6"})})}),(0,l.jsx)("span",{children:e.count}),(0,l.jsx)("button",{disabled:e.count<2,onClick:()=>{i((0,a.XF)(e.id)),s(e.id,e.cost,e.weight_unit,e.exchange_id,e.region_id,e.firstweight,Number(e.count)-1,"decrement")},children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-5 h-5 ".concat(e.count>1&&"text-[var(--light-blue)]"),children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 12H6"})})})]}):null]}),(0,l.jsxs)("div",{className:"checkout-content-single-detail",children:[(0,l.jsx)(p.default,{href:"/product/".concat(e.asin,"/").concat((0,h.l)(e.name)),children:(0,l.jsx)("p",{className:"font-IRANSansBold line-clamp-4 md:line-clamp-none ".concat((0,x.d)(e.name)?"rtl":"ltr"),children:e.name})}),(0,l.jsxs)("div",{className:"flex items-center text-[var(--text-gray)] text-[14px]",children:[(0,l.jsx)("span",{children:"قیمت واحد به دلار:"}),(0,l.jsxs)("span",{children:[e.cost,"$"]})]}),(0,l.jsxs)("div",{className:"flex items-center text-[var(--text-gray)] text-[14px]",children:[(0,l.jsxs)("span",{children:["قیمت کل به ","تومان",":"]}),(0,l.jsxs)("span",{children:[e.singleitemfullprice.toLocaleString(),(0,l.jsxs)("span",{children:[" ","تومان"]})]})]}),(0,l.jsxs)("div",{className:"flex items-center text-[var(--text-gray)] text-[14px]",children:[(0,l.jsx)("span",{children:"وزن کل:"}),(0,l.jsxs)("span",{children:[(e.firstweight*e.count).toFixed(2)," ",e.weight_unit]})]}),(0,l.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-3 justify-between w-full",children:[(0,l.jsxs)("div",{className:"set-count-basket-border desktop",children:[(0,l.jsx)("button",{onClick:()=>{i((0,a.dP)(e.id)),s(e.id,e.cost,e.weight_unit,e.exchange_id,e.region_id,e.firstweight,Number(e.count)+1,"increment")},children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-5 h-5 text-[var(--light-blue)]",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v12m6-6H6"})})}),(0,l.jsx)("span",{children:e.count}),(0,l.jsx)("button",{disabled:e.count<2,onClick:()=>{i((0,a.XF)(e.id)),s(e.id,e.cost,e.weight_unit,e.exchange_id,e.region_id,e.firstweight,Number(e.count)-1,"decrement")},children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-5 h-5 ".concat(e.count>1&&"text-[var(--light-blue)]"),children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 12H6"})})})]}),(0,l.jsx)("div",{className:"w-full flex justify-end",children:(0,l.jsxs)("button",{onClick:()=>n(e.id),className:"checkout-remove-button",children:[(0,l.jsx)("svg",{width:"17",height:"20",viewBox:"0 0 17 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9486 3.33333H13.3652C13.1718 2.39284 12.6601 1.54779 11.9163 0.940598C11.1725 0.333408 10.2421 0.0012121 9.2819 0H7.61523C6.65506 0.0012121 5.72467 0.333408 4.98086 0.940598C4.23705 1.54779 3.72531 2.39284 3.5319 3.33333H0.948568C0.727554 3.33333 0.515592 3.42113 0.359312 3.57741C0.203032 3.73369 0.115234 3.94565 0.115234 4.16667C0.115234 4.38768 0.203032 4.59964 0.359312 4.75592C0.515592 4.9122 0.727554 5 0.948568 5H1.7819V15.8333C1.78322 16.938 2.22264 17.997 3.00375 18.7782C3.78487 19.5593 4.84391 19.9987 5.94857 20H10.9486C12.0532 19.9987 13.1123 19.5593 13.8934 18.7782C14.6745 17.997 15.1139 16.938 15.1152 15.8333V5H15.9486C16.1696 5 16.3815 4.9122 16.5378 4.75592C16.6941 4.59964 16.7819 4.38768 16.7819 4.16667C16.7819 3.94565 16.6941 3.73369 16.5378 3.57741C16.3815 3.42113 16.1696 3.33333 15.9486 3.33333ZM7.61523 1.66667H9.2819C9.7988 1.6673 10.3028 1.82781 10.7249 2.1262C11.147 2.42459 11.4664 2.84624 11.6394 3.33333H5.25773C5.43072 2.84624 5.75015 2.42459 6.17222 2.1262C6.5943 1.82781 7.09834 1.6673 7.61523 1.66667ZM13.4486 15.8333C13.4486 16.4964 13.1852 17.1323 12.7163 17.6011C12.2475 18.0699 11.6116 18.3333 10.9486 18.3333H5.94857C5.28553 18.3333 4.64964 18.0699 4.1808 17.6011C3.71196 17.1323 3.44857 16.4964 3.44857 15.8333V5H13.4486V15.8333ZM6.7819 14.9996C7.00291 14.9996 7.21487 14.9118 7.37115 14.7555C7.52743 14.5992 7.61523 14.3873 7.61523 14.1662V9.16626C7.61523 8.94524 7.52743 8.73328 7.37115 8.577C7.21487 8.42072 7.00291 8.33293 6.7819 8.33293C6.56089 8.33293 6.34892 8.42072 6.19264 8.577C6.03636 8.73328 5.94857 8.94524 5.94857 9.16626V14.1662C5.94857 14.3873 6.03636 14.5992 6.19264 14.7555C6.34892 14.9118 6.56089 14.9996 6.7819 14.9996ZM10.7045 14.7555C10.5482 14.9118 10.3363 14.9996 10.1152 14.9996C9.89422 14.9996 9.68226 14.9118 9.52598 14.7555C9.3697 14.5992 9.2819 14.3873 9.2819 14.1662V9.16626C9.2819 8.94524 9.3697 8.73328 9.52598 8.577C9.68226 8.42072 9.89422 8.33293 10.1152 8.33293C10.3363 8.33293 10.5482 8.42072 10.7045 8.577C10.8608 8.73328 10.9486 8.94524 10.9486 9.16626V14.1662C10.9486 14.3873 10.8608 14.5992 10.7045 14.7555Z",fill:"#F44336"})}),(0,l.jsxs)("p",{className:"font-IRANSansBold whitespace-nowrap",children:[" ","حذف از سبد خرید"]})]})})]})]})]}),e.description?(0,l.jsx)("div",{className:"flex items-start text-[var(--text-gray)] text-[14px]",children:(0,l.jsxs)("span",{className:"whitespace-pre-line text-black",children:[" ",(0,l.jsx)("span",{className:"font-IRANSansBold",children:"توضیحات شما:"})," ",e.description]})}):null]},e.asin))})})]})},u=s(67066),f=s(99376),j=s(33145),C=s(14922),g=s(12429),v=s(26110),w=s(71931),b=s(19378),N=s(29114),L=function(){let e=(0,i.useRef)(),t=(0,i.useRef)(),s=(0,i.useRef)(null),x=(0,d.I0)(),h=(0,f.useRouter)(),L=(0,o.Z)(),y=(0,d.v9)(a.vn),S=(0,d.v9)(a.y4),k=(0,d.v9)(a.fz),M=(0,d.v9)(a.ce),F=(0,d.v9)(a.ml),Z=(0,d.v9)(a.wi),B=(0,d.v9)(n.lw),_=(0,d.v9)(n.v6),V=(0,d.v9)(n.p5),[A,H]=(0,i.useTransition)(),[I,R]=(0,i.useState)(!1),[E,P]=(0,i.useState)(!1),[z,D]=(0,i.useState)(!1),[O,T]=(0,i.useState)(1),[W,q]=(0,i.useState)(!1),[G,X]=(0,i.useState)(""),[J,$]=(0,i.useState)(!1),[K,Q]=(0,i.useState)(!1),[U,Y]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[es,el]=(0,i.useState)(),[ea,en]=(0,i.useState)(),[ei,er]=(0,i.useState)(),[ec,ed]=(0,i.useState)(),[eo,ex]=(0,i.useState)(!1),[eh,ep]=(0,i.useState)(""),[em,eu]=(0,i.useState)([]),[ef,ej]=(0,i.useState)(),[eC,eg]=(0,i.useState)(!1),[ev,ew]=(0,i.useState)(!1),[eb,eN]=(0,i.useState)([]),[eL,ey]=(0,i.useState)(""),[eS,ek]=(0,i.useState)(""),[eM,eF]=(0,i.useState)(!1),[eZ,eB]=(0,i.useState)("");(0,i.useEffect)(()=>{let e=e=>{(null==s?void 0:s.current)&&!s.current.contains(e.target)&&q(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[s,W]),(0,i.useEffect)(()=>{let t=t=>{(null==e?void 0:e.current)&&!e.current.contains(t.target)&&eg(!1)};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[e,eC]),(0,i.useEffect)(()=>{let e=e=>{(null==t?void 0:t.current)&&!t.current.contains(e.target)&&eF(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t,eM]);let e_=(0,w.y1)(async e=>{if(e.length>6){eN([]);try{let e=new Headers,t=await fetch("".concat("https://app.charsooq.com/api/v1/","search-user?phone_number=").concat(eh),{method:"GET",headers:e}),s=await t.json();200===s.status&&eN(s.data.map(e=>({cell_number:e.cell_number,id:e.id,name:e.name,address:e.address})))}catch(e){eN([]),eg(!1),ek(""),eu([]),ey("")}finally{ew(!1)}}else eN([]),eg(!1),ek(""),eu([]),ey("")},1500);function eV(e){R(!0);let t=localStorage.getItem("token");var s=new Headers;s.append("Accept","application/json"),s.append("Authorization","Bearer ".concat(t));var n=new FormData;n.append("address_id",e?eL:O),n.append("description",eZ),n.append("discount_code",G),n.append("cart_name","amazon"),e&&(n.append("phone_number",eh),n.append("user_id",ef));for(let e=0;e<y.length;e++)n.append("cart[".concat(e,"][link]"),y[e].link),n.append("cart[".concat(e,"][count]"),y[e].count),n.append("cart[".concat(e,"][weight_unit]"),y[e].weight_unit),n.append("cart[".concat(e,"][firstweight]"),y[e].firstweight),n.append("cart[".concat(e,"][singleitemfullprice]"),y[e].singleitemfullprice),n.append("cart[".concat(e,"][exchange_id]"),y[e].exchange_id),n.append("cart[".concat(e,"][region_id]"),y[e].region_id),n.append("cart[".concat(e,"][image]"),y[e].image),n.append("cart[".concat(e,"][name]"),y[e].name),n.append("cart[".concat(e,"][cost]"),y[e].cost),n.append("cart[".concat(e,"][description]"),y[e].description);fetch("".concat("https://app.charsooq.com/api/v1/","cart-store"),{method:"POST",headers:s,body:n}).then(e=>e.json()).then(t=>{200===t.status&&(x((0,a.Bz)([])),e||h.push("/checkout/".concat(t.data.code)),e&&r.Am.success("سفارش مشتری با شماره سفارش ".concat(t.data.code," ثبت شد."))),401===t.status&&c.Am.custom(e=>(0,l.jsxs)("div",{className:"".concat(e.visible?"animate-enter":"animate-leave"," max-w-md w-full bg-white shadow-lg rounded-lg pointer-events-auto flex ring-1 ring-black ring-opacity-5"),children:[(0,l.jsx)("div",{className:"flex-1 w-0 p-4",children:(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:(0,l.jsx)("img",{className:"h-10 w-10 rounded-full",src:"/assets/images/icons/logo2.png",alt:""})}),(0,l.jsxs)("div",{className:"ml-3 flex-1",children:[(0,l.jsx)("p",{className:"text-sm font-IRANSansBold",children:"کاربر گرامی!"}),(0,l.jsx)("p",{className:"mt-1 text-sm",children:t.message})]})]})}),(0,l.jsx)("div",{className:"flex border-l border-gray-200",children:(0,l.jsx)(p.default,{href:"/dashboard/profile?callbackRoute=checkout",onClick:()=>{r.Am.dismiss(e.id)},className:"text-sm text-[var(--base-blue)] font-IRANSansBold underline ml-4 flex items-center justify-center",children:"برو به پروفایل"})})]})),422===t.status&&r.Am.error(t.message)}).catch(e=>console.log("error",e)).finally(()=>R(!1))}function eA(){if(B){var e;let t=null===(e=JSON)||void 0===e?void 0:e.parse(JSON.parse(localStorage.getItem("persist:root")).amazonBasket).cart;setTimeout(()=>{x((0,a.Lj)(t))},500),setTimeout(()=>{D(!0)},1e3)}else q(!0),r.Am.error("ابتدا وارد شوید")}function eH(){B?(null==_?void 0:_.is_admin)?ex(!0):O?eV(!1):r.Am.error("یک آدرس انتخاب کنید"):r.Am.error("ابتدا وارد شوید")}function eI(e){e.preventDefault();let t=localStorage.getItem("token"),s=new Headers;s.append("Accept","application/json"),s.append("Authorization","Bearer ".concat(t));let l=new FormData;l.append("cart_name","amazon");for(let e=0;e<y.length;e++)l.append("cart[".concat(e,"][count]"),y[e].count),l.append("cart[".concat(e,"][weight_unit]"),y[e].weight_unit),l.append("cart[".concat(e,"][firstweight]"),y[e].firstweight),l.append("cart[".concat(e,"][exchange_id]"),y[e].exchange_id),l.append("cart[".concat(e,"][region_id]"),y[e].region_id),l.append("cart[".concat(e,"][cost]"),y[e].cost),l.append("discount_code",G);fetch("".concat("https://app.charsooq.com/api/v1/","discount"),{method:"POST",headers:s,body:l}).then(e=>e.json()).then(e=>{200===e.status?("discount_code"===e.data.state_discount&&(et(!1),Y(!0),Q(!1),el(e.data.finalRialPrice),en(e.data.buyProfit),er(e.data.discount_percent)),"gift_code"===e.data.state_discount&&(Y(!1),et(!0),Q(!1),el(e.data.finalRialPrice),ed(e.data.gift_amount))):(r.Am.error(e.message),Q(!0))}).catch(e=>console.error(e))}return((0,i.useEffect)(()=>{window.scrollTo({top:0,left:0,behavior:"smooth"})},[z]),0===y.length)?(0,l.jsxs)("div",{className:"flex flex-col gap-[20px] items-center justify-center m-auto",children:[(0,l.jsx)(j.default,{src:"/assets/images/icons/ghost-404.png",alt:"سبد خالی",width:280,height:280,loading:"eager"}),(0,l.jsx)("p",{children:" سبد آمازون شما خالی می باشد."})]}):(0,l.jsxs)("div",{className:"flex flex-col md:flex-row bg-white rounded-2xl shadow-lg",children:[(0,l.jsx)(v.Vq,{open:eo,onOpenChange:ex,children:(0,l.jsxs)(v.cZ,{children:[(0,l.jsx)(v.fK,{children:(0,l.jsx)("p",{className:"text-start font-IRANSansBold text-lg",children:"ثبت سفارش مشتری"})}),(0,l.jsxs)("form",{onSubmit:()=>eV(!0),className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)("p",{className:"text-[var(--text-gray)]",children:"اطلاعات مشتری را کامل کنید:"}),(0,l.jsx)("div",{className:"w-full flex ltr justify-center items-center"})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("label",{className:"text-[15px] text-[var(--text-gray)]",htmlFor:"user-mobile",children:"شماره موبایل کاربر را وارد و انتخاب کنید:"}),(0,l.jsx)("span",{className:"text-sm",children:"(کاربر حتما باید در سایت ثبت شده باشد.)"}),(0,l.jsxs)("div",{ref:e,className:"relative flex-1 z-10",children:[(0,l.jsx)("input",{onClick:()=>{eh.trim()&&eg(!0)},className:"w-full p-2 placeholder:text-sm rounded-md border border-[var(--light-border)] outline-none",type:"text",id:"user-mobile",name:"user-mobile",placeholder:"حداقل 7 شماره را وارد کنید تا نمایش داده شود",onChange:e=>{ep(e.target.value),eg(!0),ew(!0),e_(e.target.value)},value:eh}),eC&&(ev?eh.length>6?(0,l.jsx)("div",{className:"absolute min-w-fit bg-white w-full p-2 left-0 right-0 top-8 shadow-lg border border-[var(--very-light-border)] rounded-b-md text-sm",children:(0,l.jsx)("p",{children:"در حال جستجو..."})}):(0,l.jsx)("div",{className:"absolute min-w-fit bg-white w-full p-2 left-0 right-0 top-8 shadow-lg border border-[var(--very-light-border)] rounded-b-md text-sm",children:(0,l.jsx)("p",{children:"حداقل 7 کاراکتر اجباری است."})}):(0,l.jsx)("div",{className:"mega-menu-content absolute min-w-fit bg-white w-full p-0 left-0 right-0 top-8 shadow-lg border border-[var(--very-light-border)] rounded-b-md max-h-[calc(var(--radix-navigation-menu-viewport-height)-4rem)] overflow-y-auto",children:(0,l.jsx)("div",{className:"w-full flex flex-col px-2 py-1",children:eb.length>0?(0,l.jsx)("div",{className:"flex flex-col gap-1 w-full",children:(0,l.jsx)("div",{className:"flex flex-col gap-1 pb-1",children:(0,l.jsx)(N._9,{dir:"rtl",children:(0,l.jsx)(b.x,{className:"h-48 w-full",children:(0,l.jsx)("div",{className:"flex flex-col gap-1",children:0===eb.length?(0,l.jsx)("div",{children:(0,l.jsx)("p",{children:"کاربری یافت نشد."})}):eb.map(e=>(0,l.jsxs)("div",{onClick:()=>{ep(e.cell_number),ej(e.id),eg(!1),eu(e.address)},className:"flex gap-2 items-start border-b hover:text-[var(--base-blue)] hover:bg-gray-100 cursor-pointer last:border-none py-2",children:[(0,l.jsx)("div",{className:"w-4",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 text-[var(--base-blue)]",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})})}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,l.jsx)("p",{className:"line-clamp-1 font-IRANSansBold",children:e.name?e.name:"بدون نام کاربری"}),(0,l.jsxs)("p",{className:"text-sm",children:["با شماره موبایل"," ",(0,l.jsx)("span",{className:"font-IRANSansBold text-[var(--base-blue)]",children:e.cell_number})]})]})]},e.id))})})})})}):(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)("p",{className:"font-IRANSansBold",children:"کاربری یافت نشد."})})})}))]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("label",{className:"text-[15px] text-[var(--text-gray)]",htmlFor:"address",children:"آدرس:"}),(0,l.jsxs)("div",{ref:t,className:"relative flex-1",children:[(0,l.jsx)("textarea",{onClick:()=>{eh.trim()&&eF(!0)},className:"p-2 rounded-md border border-[var(--light-border)] outline-none",id:"address",name:"address",rows:4,placeholder:"آدرس کاربر را وارد کنید.",value:eS,readOnly:!0}),0!==eb.length&&eM&&(0,l.jsx)("div",{className:"mega-menu-content absolute min-w-fit bg-white w-full p-0 left-0 right-0 top-20 shadow-lg border border-[var(--very-light-border)] rounded-b-md max-h-[calc(var(--radix-navigation-menu-viewport-height)-4rem)] overflow-y-auto",children:(0,l.jsx)("div",{className:"w-full flex flex-col px-2 py-1",children:em.length>0?(0,l.jsx)("div",{className:"flex flex-col gap-1 w-full",children:(0,l.jsx)("div",{className:"flex flex-col gap-1 pb-1",children:(0,l.jsx)(N._9,{dir:"rtl",children:(0,l.jsx)(b.x,{className:"h-40 w-full",children:(0,l.jsx)("div",{className:"flex flex-col gap-1",children:0===eb.length?(0,l.jsx)("div",{children:(0,l.jsx)("p",{children:"آدرسی برای این کاربر یافت نشد."})}):em.map(e=>(0,l.jsxs)("div",{onClick:()=>{ey(e.id),ek(e.name),eF(!1)},className:"flex gap-2 items-start border-b hover:text-[var(--base-blue)] hover:bg-gray-100 cursor-pointer last:border-none py-2",children:[(0,l.jsx)("div",{className:"w-4",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 text-[var(--base-blue)]",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})})}),(0,l.jsx)("div",{className:"flex flex-col gap-1 w-full",children:(0,l.jsx)("p",{className:"font-IRANSansBold",children:e.name?e.name:"بدون آدرس"})})]},e.id))})})})})}):ef?(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)("p",{className:"font-IRANSansBold",children:"آدرسی برای این کاربر یافت نشد."})}):(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)("p",{className:"font-IRANSansBold",children:"کاربری انتخاب نشده."})})})})]})]}),(0,l.jsxs)("div",{className:"w-full flex flex-col gap-2",children:[(0,l.jsx)("button",{"aria-disabled":A,disabled:A||!eL||!eh,className:"w-full bg-[var(--base-blue)] text-white",type:"submit",children:A?(0,l.jsxs)("div",{className:"mr-4",role:"status",children:[(0,l.jsxs)("svg",{"aria-hidden":"true",className:"w-5 h-5 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),(0,l.jsx)("span",{className:"sr-only",children:"Loading..."})]}):"ثبت و نهایی کردن سفارش"}),(0,l.jsx)("button",{onClick:()=>{ex(!1)},className:"w-full border border-[var(--light-border)] text-[var(--text-gray)]",type:"reset",children:"انصراف"})]})]})]})}),(0,l.jsx)(C.default,{mounted:W,setMounted:q,children:(0,l.jsxs)("div",{ref:s,className:"flex flex-col bg-white shadow-lg max-w-[95vw] md:max-w-[420px] rounded-md",children:[(0,l.jsx)("span",{onClick:()=>q(!1),className:"text-[var(--text-gray)] text-[30px] font-light text-end pl-3 cursor-pointer h-[27px]",children:"\xd7"}),(0,l.jsx)("div",{className:"flex flex-col",children:(0,l.jsx)("div",{className:"login-page-content",children:(0,l.jsx)(g.default,{setShowPopup:q})})})]})}),z?(0,l.jsx)(u.Z,{setChooseAddress:T,setShowAddress:D,chooseAddress:O,amazonCart:y,descInput:eZ,setDescInput:eB,userAddress:V,checkout:"amazon",setDiscountInput:X,setShowDiscountInput:$,setDiscountCodeError:Q,setDiscountCheck:Y,setGiftCheck:et}):(0,l.jsx)(m,{amazonCart:y,calculateCount:function(e,t,s,l,n,i,c,d){P(!0);var o=new Headers;o.append("Accept","application/json");var h=new FormData;h.append("price",t),h.append("weight_unit",s),h.append("exchange_id",l),h.append("region_id",n),h.append("weight",i),h.append("count",c),fetch("".concat("https://app.charsooq.com/api/v1/","calculator-show"),{method:"POST",headers:o,body:h}).then(e=>e.json()).then(t=>{200===t.status&&x((0,a.BO)({id:e,...t.data.priceRial})),404===t.status&&(r.Am.error(t.message),"increment"===d&&x((0,a.XF)(e)),"decrement"===d&&x((0,a.dP)(e)))}).catch(e=>console.log("error",e)).finally(()=>P(!1))},removeItemFromBasket:function(e){x((0,a.z)({id:e}))}}),(0,l.jsx)("div",{className:"checkout-content-single-payments",children:(0,l.jsxs)("div",{className:"product-invoice-container sticky top-[140px]",children:[(0,l.jsx)("div",{className:"product-invoice-content-top",children:(0,l.jsxs)("div",{className:"flex flex-col gap-[10px] px-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("p",{className:"font-IRANSansBold",children:["قیمت کالا ها",(0,l.jsxs)("span",{className:"font-IRANSansBold",children:[" ","(",y.length,")"]})]}),(0,l.jsxs)("span",{className:"flex items-center gap-7 font-IRANSansBold",children:[E?(0,l.jsx)("span",{className:"dot-loader active"}):es&&(U||ee)?null==es?void 0:es.toLocaleString():k.toLocaleString()," ","تومان"]})]}),ee?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-center justify-between text-[14px] text-[var(--text-gray)]",children:[(0,l.jsx)("p",{className:"font-IRANSansBold whitespace-nowrap",children:"قبل از اعمال کارت هدیه"}),(0,l.jsx)("div",{className:"w-full flex justify-end gap-1 items-center",children:(0,l.jsxs)("p",{className:"flex justify-end text-[var(--base-red)] font-IRANSansBold line-through text-[12px]",children:[k.toLocaleString()," ","تومان"]})})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-[14px] text-[var(--text-gray)]",children:[(0,l.jsx)("p",{children:"مبلغ کارت هدیه"}),(0,l.jsxs)("span",{className:"flex items-center gap-7",children:[E?(0,l.jsx)("span",{className:"dot-loader active"}):null==ec?void 0:ec.toLocaleString()," ","تومان"]})]})]}):null,(0,l.jsxs)("div",{className:"flex items-center justify-between text-[14px] text-[var(--text-gray)]",children:[(0,l.jsx)("p",{children:"هزینه حمل"}),(0,l.jsxs)("span",{className:"flex items-center gap-7",children:[E?(0,l.jsx)("span",{className:"dot-loader active"}):M.toLocaleString()," ","تومان"]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-[14px] text-[var(--text-gray)]",children:[(0,l.jsx)("p",{children:"هزینه خرید"}),(0,l.jsxs)("span",{className:"flex items-center gap-7",children:[E?(0,l.jsx)("span",{className:"dot-loader active"}):F.toLocaleString()," ","تومان"]})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between text-[14px] text-[var(--text-gray)]",children:[(0,l.jsx)("p",{children:"هزینه کارمزد"}),(0,l.jsxs)("span",{className:"flex items-center gap-7",children:[E?(0,l.jsx)("span",{className:"dot-loader active"}):ea&&U?ea.toLocaleString():Z.toLocaleString()," ","تومان"]})]}),ei&&U?(0,l.jsxs)("div",{className:"w-full flex justify-between gap-2 items-center text-[12px]",children:[(0,l.jsx)("p",{className:"text-[var(--text-gray)] whitespace-nowrap",children:"کارمزد قبل از تخفیف"}),(0,l.jsxs)("div",{className:"w-full flex justify-end gap-1 items-center",children:[(0,l.jsxs)("span",{className:"py-0.5 px-2 bg-[var(--base-red)] text-white rounded-3xl",children:["%",ei]}),(0,l.jsxs)("p",{className:"flex justify-end text-[var(--base-red)] font-IRANSansBold line-through text-[12px]",children:[Z.toLocaleString()," ","تومان"]})]})]}):null,U&&ea?(0,l.jsxs)("div",{className:"flex items-center justify-between text-[14px] text-[var(--text-gray)]",children:[(0,l.jsx)("p",{children:"تخفیف شما"}),(0,l.jsxs)("span",{className:"flex items-center gap-7",children:[(Z-ea).toLocaleString()," ","تومان"]})]}):null]})}),(0,l.jsx)("div",{className:"product-invoice-content-bottom",children:(0,l.jsxs)("div",{className:"flex flex-col gap-[10px] px-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"text-[var(--text-gray)] text-sm",children:"قیمت کل به دلار"}),(0,l.jsxs)("span",{className:"font-IRANSansBold",children:[S.toFixed(2)," ",(0,l.jsx)("span",{className:"text-[13px] font-IRANSansBold",children:"$"})]})]}),L?z?(0,l.jsxs)("div",{className:"flex flex-col bg-white border-t border-[var(--light-border)] fixed bottom-0 w-full right-0 ".concat(J?"h-52":"h-32"," z-20"),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 pt-3",children:[(0,l.jsxs)("p",{className:"font-IRANSansBold",children:["قیمت کالا ها",(0,l.jsxs)("span",{className:"font-IRANSansBold text-sm md:text-base",children:[" ","(",y.length,")"]})]}),(0,l.jsxs)("span",{className:"flex items-center gap-7 font-IRANSansBold pl-14 text-sm md:text-base",children:[E?(0,l.jsx)("span",{className:"dot-loader active"}):es&&(U||ee)?es.toLocaleString():k.toLocaleString()," ","تومان"]})]}),(0,l.jsxs)("div",{className:"w-full flex items-center justify-between px-6",children:[(0,l.jsxs)("button",{onClick:()=>$(!J),type:"button",className:"text-sm p-0 m-0 ml-auto text-[var(--text-gray)] gap-2",children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"h-5 w-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})}),(0,l.jsx)("p",{children:" کد تخفیف یا کارت هدیه دارید؟"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(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.jsx)("path",{d:"M12 0C5.37256 0 0 5.37256 0 12C0 17.7019 3.9768 22.475 9.30809 23.6969L23.6969 9.30809C22.475 3.9768 17.7019 0 12 0Z",fill:"#FFEDB5"}),(0,l.jsx)("path",{d:"M23.9999 11.9989C23.9999 11.0734 23.895 10.1724 23.6966 9.30709L19.1942 4.80469L4.80566 19.1932L9.30806 23.6956C10.1734 23.894 11.0744 23.9989 11.9999 23.9989C18.6274 23.9989 23.9999 18.6263 23.9999 11.9989Z",fill:"#FFAD9E"}),(0,l.jsx)("path",{d:"M22.174 11.9981L20.4491 13.6787L21.3997 15.8913L19.163 16.784L19.1943 19.1924L16.786 19.1611L15.8933 21.3978L13.6806 20.4472L12 22.172L9.91309 11.9981L12 1.82422L13.6806 3.54909L15.8933 2.59848L16.786 4.83518L19.1943 4.80387L19.163 7.21222L21.3997 8.10491L20.4491 10.3176L22.174 11.9981Z",fill:"#C2001B"}),(0,l.jsx)("path",{d:"M12.0001 1.82422V22.172L10.3196 20.4472L8.10687 21.3978L7.21417 19.1611L4.80582 19.1924L4.83713 16.784L2.60043 15.8913L3.55104 13.6787L1.82617 11.9981L3.55104 10.3176L2.60043 8.10491L4.83713 7.21222L4.80582 4.80387L7.21417 4.83518L8.10687 2.59848L10.3196 3.54909L12.0001 1.82422Z",fill:"#FF0F27"}),(0,l.jsx)("path",{d:"M20.6784 11.9989L19.2076 13.4327L20.0179 15.3203L18.1099 16.0815L18.1365 18.1356L16.0824 18.109L15.3212 20.017L13.4335 19.2067L11.9998 20.6775L10.4346 11.9989L11.9998 3.32031L13.4335 4.7911L15.3212 3.98083L16.0824 5.88883L18.1365 5.86223L18.1099 7.91631L20.0179 8.67753L19.2076 10.5652L20.6784 11.9989Z",fill:"#FF0F27"}),(0,l.jsx)("path",{d:"M11.9999 3.32031V20.6775L10.5662 19.2067L8.67851 20.017L7.91729 18.109L5.8632 18.1356L5.88981 16.0815L3.98181 15.3203L4.79207 13.4327L3.32129 11.9989L4.79207 10.5652L3.98181 8.67753L5.88981 7.91631L5.8632 5.86223L7.91729 5.88883L8.67851 3.98083L10.5662 4.7911L11.9999 3.32031Z",fill:"#FF6161"}),(0,l.jsx)("path",{d:"M9.35761 11.6002C8.26441 11.6002 7.375 10.7108 7.375 9.61763V9.09589C7.375 8.00269 8.26441 7.11328 9.35761 7.11328C10.4508 7.11328 11.3402 8.00269 11.3402 9.09589V9.61763C11.3402 10.7108 10.4508 11.6002 9.35761 11.6002ZM9.35761 8.15676C8.83978 8.15676 8.41848 8.57806 8.41848 9.09589V9.61763C8.41848 10.1355 8.83978 10.5568 9.35761 10.5568C9.87543 10.5568 10.2967 10.1355 10.2967 9.61763V9.09589C10.2967 8.57801 9.87538 8.15676 9.35761 8.15676Z",fill:"white"}),(0,l.jsx)("path",{d:"M14.6428 16.8854C13.5496 16.8854 12.6602 15.996 12.6602 14.9028V14.381C12.6602 13.2878 13.5496 12.3984 14.6428 12.3984C15.736 12.3984 16.6254 13.2878 16.6254 14.381V14.9028C16.6254 15.996 15.736 16.8854 14.6428 16.8854ZM14.6428 13.4419C14.1249 13.4419 13.7036 13.8632 13.7036 14.381V14.9028C13.7036 15.4206 14.1249 15.8419 14.6428 15.8419C15.1606 15.8419 15.5819 15.4206 15.5819 14.9028V14.381C15.5819 13.8632 15.1606 13.4419 14.6428 13.4419Z",fill:"white"}),(0,l.jsx)("path",{d:"M8.63419 14.6293L9.37207 15.3672L15.3652 9.37406L14.6273 8.63617L8.63419 14.6293Z",fill:"white"})]}),(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",{clipPath:"url(#clip0_4401_15692)",children:[(0,l.jsx)("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"#FEE187"}),(0,l.jsx)("path",{d:"M23.9928 12.3962L18.5146 6.91797L9.44674 13.9606L11.5099 16.0238L4.13379 18.0246L9.93321 23.824C10.6046 23.9406 11.2951 24.0018 11.9999 24.0018C18.4953 24.0019 23.7846 18.841 23.9928 12.3962Z",fill:"#FFC61B"}),(0,l.jsx)("path",{d:"M17.8788 14.4847H6.72717C6.20911 14.4847 5.78906 14.0647 5.78906 13.5466V7.60608C5.78906 7.08802 6.20911 6.66797 6.72717 6.66797H17.8788C18.3968 6.66797 18.8169 7.08802 18.8169 7.60608V13.5466C18.8169 14.0647 18.3969 14.4847 17.8788 14.4847Z",fill:"#8BC180"}),(0,l.jsx)("path",{d:"M17.8795 6.66797H12.2158V14.4847H17.8796C18.3976 14.4847 18.8177 14.0647 18.8177 13.5466V7.60608C18.8176 7.08802 18.3976 6.66797 17.8795 6.66797Z",fill:"#6CAF5F"}),(0,l.jsx)("path",{d:"M18.8169 8.00391H5.78906V9.93661H18.8169V8.00391Z",fill:"#3F3B3B"}),(0,l.jsx)("path",{d:"M18.8178 8.00391H12.2158V9.93661H18.8178V8.00391Z",fill:"#272525"}),(0,l.jsx)("path",{d:"M16.0897 18.4769H4.93811C4.42005 18.4769 4 18.0568 4 17.5388V11.5983C4 11.0802 4.42005 10.6602 4.93811 10.6602H16.0897C16.6078 10.6602 17.0278 11.0802 17.0278 11.5983V17.5388C17.0278 18.0569 16.6079 18.4769 16.0897 18.4769Z",fill:"#477F3C"}),(0,l.jsx)("path",{d:"M16.0896 10.6602H10.5791V18.4769H16.0896C16.6077 18.4769 17.0277 18.0568 17.0277 17.5388V11.5983C17.0277 11.0801 16.6078 10.6602 16.0896 10.6602Z",fill:"#2E5E24"}),(0,l.jsx)("path",{d:"M7.12516 13.9492C7.12516 13.9492 6.98017 15.6885 5.80469 16.4131C5.80469 16.4131 6.92566 16.0286 7.12516 17.025C7.12516 17.025 8.20412 16.2843 7.93033 14.078",fill:"#E09112"}),(0,l.jsx)("path",{d:"M9.46491 13.9492C9.46491 13.9492 9.6099 15.6885 10.7854 16.4131C10.7854 16.4131 9.66441 16.0286 9.46491 17.025C9.46491 17.025 8.38594 16.2843 8.65974 14.078",fill:"#FF5419"}),(0,l.jsx)("path",{d:"M4.97559 12.168C4.97559 12.168 5.41954 13.0974 5.03305 14.1925C5.03305 14.1925 5.54835 15.0137 8.0767 14.1925L8.04932 12.7402L4.97559 12.168Z",fill:"#FFC61B"}),(0,l.jsx)("path",{d:"M8.14114 12.8386C8.14114 12.8386 6.46629 10.9061 5.19415 11.7757C3.92201 12.6452 8.14114 12.8386 8.14114 12.8386Z",fill:"#E09112"}),(0,l.jsx)("path",{d:"M11.6215 12.1523C11.6215 12.1523 11.1709 13.0963 11.5573 14.1913C11.5573 14.1913 11.042 15.0126 8.51367 14.1913L8.54105 12.739L11.6215 12.1523Z",fill:"#EAA22F"}),(0,l.jsx)("path",{d:"M8.44922 12.8386C8.44922 12.8386 10.1241 10.9061 11.3962 11.7757C12.6683 12.6452 8.44922 12.8386 8.44922 12.8386Z",fill:"#FF5419"}),(0,l.jsx)("path",{d:"M8.29538 14.4013C8.79345 14.4013 9.19721 13.9976 9.19721 13.4995C9.19721 13.0014 8.79345 12.5977 8.29538 12.5977C7.79732 12.5977 7.39355 13.0014 7.39355 13.4995C7.39355 13.9976 7.79732 14.4013 8.29538 14.4013Z",fill:"#C92F00"}),(0,l.jsx)("path",{d:"M8.29492 12.5977C8.79292 12.5977 9.19675 13.0014 9.19675 13.4995C9.19675 13.9975 8.79302 14.4013 8.29492 14.4013V12.5977Z",fill:"#930000"})]}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0_4401_15692",children:(0,l.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]})]})]}),J?(0,l.jsxs)("div",{className:"flex flex-col gap-1 px-6 py-1 w-full",children:[(0,l.jsxs)("form",{onSubmit:eI,className:"w-full border rounded-md flex flex-row ".concat(K?"border-[var(--base-red)]":"border-[var(--light-border)]"),children:[(0,l.jsx)("input",{className:"px-2 py-3 w-full border-none flex-1 outline-none rounded-md",type:"text",disabled:U||ee,placeholder:"کد تخفیف یا کارت هدیه خود را وارد کنید",onChange:e=>X(e.target.value)}),(0,l.jsx)("button",{disabled:!G||U||ee,type:"submit",className:"text-sm px-2 font-IRANSansBold text-[var(--light-blue)] disabled:text-gray-400 disabled:bg-[#fafafa] rounded-r-none m-0",children:"ثبت"})]}),K?(0,l.jsx)("p",{className:"text-xs text-[var(--base-red)] font-IRANSansBold",children:"کد تخفیف یا کارت هدیه وارد شده صحیح نیست یا قبلا استفاده شده است."}):U&&(0,l.jsxs)("p",{className:"text-xs font-IRANSansBold text-[var(--base-blue)]",children:["%",ei," تخفیف از کارمزد برای شما اعمال شد."]})]}):null,(0,l.jsxs)("button",{type:"button",onClick:eH,className:"add-checkout-button",disabled:!O||I,children:[I?(0,l.jsx)("span",{className:I?"button-loader-white active":"button-loader-white"}):null,(0,l.jsxs)("p",{children:[" ",(null==_?void 0:_.is_admin)?"ثبت سفارش برای مشتری":" ثبت و نهایی کردن سفارش"]})]})]}):(0,l.jsxs)("div",{className:"flex flex-col bg-white border-t border-[var(--light-border)] fixed bottom-0 w-full right-0 h-28 z-20",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 pt-3",children:[(0,l.jsxs)("p",{className:"font-IRANSansBold",children:["قیمت کالا ها",(0,l.jsxs)("span",{className:"font-IRANSansBold text-sm md:text-base",children:[" ","(",y.length,")"]})]}),(0,l.jsxs)("span",{className:"flex items-center gap-7 font-IRANSansBold pl-14 text-sm md:text-base",children:[E?(0,l.jsx)("span",{className:"dot-loader active"}):k.toLocaleString()," ","تومان"]})]}),(0,l.jsx)("button",{type:"button",onClick:eA,className:"add-checkout-button",children:(0,l.jsx)("p",{children:"ادامه ثبت سفارش"})})]}):z?(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)("div",{className:"w-full text-[var(--text-gray)] text-sm flex items-center justify-between",children:[(0,l.jsx)("button",{type:"button",className:" ml-auto p-0 m-0",children:"کد تخفیف یا کارت هدیه دارید؟"}),(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(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.jsx)("path",{d:"M12 0C5.37256 0 0 5.37256 0 12C0 17.7019 3.9768 22.475 9.30809 23.6969L23.6969 9.30809C22.475 3.9768 17.7019 0 12 0Z",fill:"#FFEDB5"}),(0,l.jsx)("path",{d:"M23.9999 11.9989C23.9999 11.0734 23.895 10.1724 23.6966 9.30709L19.1942 4.80469L4.80566 19.1932L9.30806 23.6956C10.1734 23.894 11.0744 23.9989 11.9999 23.9989C18.6274 23.9989 23.9999 18.6263 23.9999 11.9989Z",fill:"#FFAD9E"}),(0,l.jsx)("path",{d:"M22.174 11.9981L20.4491 13.6787L21.3997 15.8913L19.163 16.784L19.1943 19.1924L16.786 19.1611L15.8933 21.3978L13.6806 20.4472L12 22.172L9.91309 11.9981L12 1.82422L13.6806 3.54909L15.8933 2.59848L16.786 4.83518L19.1943 4.80387L19.163 7.21222L21.3997 8.10491L20.4491 10.3176L22.174 11.9981Z",fill:"#C2001B"}),(0,l.jsx)("path",{d:"M12.0001 1.82422V22.172L10.3196 20.4472L8.10687 21.3978L7.21417 19.1611L4.80582 19.1924L4.83713 16.784L2.60043 15.8913L3.55104 13.6787L1.82617 11.9981L3.55104 10.3176L2.60043 8.10491L4.83713 7.21222L4.80582 4.80387L7.21417 4.83518L8.10687 2.59848L10.3196 3.54909L12.0001 1.82422Z",fill:"#FF0F27"}),(0,l.jsx)("path",{d:"M20.6784 11.9989L19.2076 13.4327L20.0179 15.3203L18.1099 16.0815L18.1365 18.1356L16.0824 18.109L15.3212 20.017L13.4335 19.2067L11.9998 20.6775L10.4346 11.9989L11.9998 3.32031L13.4335 4.7911L15.3212 3.98083L16.0824 5.88883L18.1365 5.86223L18.1099 7.91631L20.0179 8.67753L19.2076 10.5652L20.6784 11.9989Z",fill:"#FF0F27"}),(0,l.jsx)("path",{d:"M11.9999 3.32031V20.6775L10.5662 19.2067L8.67851 20.017L7.91729 18.109L5.8632 18.1356L5.88981 16.0815L3.98181 15.3203L4.79207 13.4327L3.32129 11.9989L4.79207 10.5652L3.98181 8.67753L5.88981 7.91631L5.8632 5.86223L7.91729 5.88883L8.67851 3.98083L10.5662 4.7911L11.9999 3.32031Z",fill:"#FF6161"}),(0,l.jsx)("path",{d:"M9.35761 11.6002C8.26441 11.6002 7.375 10.7108 7.375 9.61763V9.09589C7.375 8.00269 8.26441 7.11328 9.35761 7.11328C10.4508 7.11328 11.3402 8.00269 11.3402 9.09589V9.61763C11.3402 10.7108 10.4508 11.6002 9.35761 11.6002ZM9.35761 8.15676C8.83978 8.15676 8.41848 8.57806 8.41848 9.09589V9.61763C8.41848 10.1355 8.83978 10.5568 9.35761 10.5568C9.87543 10.5568 10.2967 10.1355 10.2967 9.61763V9.09589C10.2967 8.57801 9.87538 8.15676 9.35761 8.15676Z",fill:"white"}),(0,l.jsx)("path",{d:"M14.6428 16.8854C13.5496 16.8854 12.6602 15.996 12.6602 14.9028V14.381C12.6602 13.2878 13.5496 12.3984 14.6428 12.3984C15.736 12.3984 16.6254 13.2878 16.6254 14.381V14.9028C16.6254 15.996 15.736 16.8854 14.6428 16.8854ZM14.6428 13.4419C14.1249 13.4419 13.7036 13.8632 13.7036 14.381V14.9028C13.7036 15.4206 14.1249 15.8419 14.6428 15.8419C15.1606 15.8419 15.5819 15.4206 15.5819 14.9028V14.381C15.5819 13.8632 15.1606 13.4419 14.6428 13.4419Z",fill:"white"}),(0,l.jsx)("path",{d:"M8.63419 14.6293L9.37207 15.3672L15.3652 9.37406L14.6273 8.63617L8.63419 14.6293Z",fill:"white"})]}),(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",{clipPath:"url(#clip0_4401_15692)",children:[(0,l.jsx)("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"#FEE187"}),(0,l.jsx)("path",{d:"M23.9928 12.3962L18.5146 6.91797L9.44674 13.9606L11.5099 16.0238L4.13379 18.0246L9.93321 23.824C10.6046 23.9406 11.2951 24.0018 11.9999 24.0018C18.4953 24.0019 23.7846 18.841 23.9928 12.3962Z",fill:"#FFC61B"}),(0,l.jsx)("path",{d:"M17.8788 14.4847H6.72717C6.20911 14.4847 5.78906 14.0647 5.78906 13.5466V7.60608C5.78906 7.08802 6.20911 6.66797 6.72717 6.66797H17.8788C18.3968 6.66797 18.8169 7.08802 18.8169 7.60608V13.5466C18.8169 14.0647 18.3969 14.4847 17.8788 14.4847Z",fill:"#8BC180"}),(0,l.jsx)("path",{d:"M17.8795 6.66797H12.2158V14.4847H17.8796C18.3976 14.4847 18.8177 14.0647 18.8177 13.5466V7.60608C18.8176 7.08802 18.3976 6.66797 17.8795 6.66797Z",fill:"#6CAF5F"}),(0,l.jsx)("path",{d:"M18.8169 8.00391H5.78906V9.93661H18.8169V8.00391Z",fill:"#3F3B3B"}),(0,l.jsx)("path",{d:"M18.8178 8.00391H12.2158V9.93661H18.8178V8.00391Z",fill:"#272525"}),(0,l.jsx)("path",{d:"M16.0897 18.4769H4.93811C4.42005 18.4769 4 18.0568 4 17.5388V11.5983C4 11.0802 4.42005 10.6602 4.93811 10.6602H16.0897C16.6078 10.6602 17.0278 11.0802 17.0278 11.5983V17.5388C17.0278 18.0569 16.6079 18.4769 16.0897 18.4769Z",fill:"#477F3C"}),(0,l.jsx)("path",{d:"M16.0896 10.6602H10.5791V18.4769H16.0896C16.6077 18.4769 17.0277 18.0568 17.0277 17.5388V11.5983C17.0277 11.0801 16.6078 10.6602 16.0896 10.6602Z",fill:"#2E5E24"}),(0,l.jsx)("path",{d:"M7.12516 13.9492C7.12516 13.9492 6.98017 15.6885 5.80469 16.4131C5.80469 16.4131 6.92566 16.0286 7.12516 17.025C7.12516 17.025 8.20412 16.2843 7.93033 14.078",fill:"#E09112"}),(0,l.jsx)("path",{d:"M9.46491 13.9492C9.46491 13.9492 9.6099 15.6885 10.7854 16.4131C10.7854 16.4131 9.66441 16.0286 9.46491 17.025C9.46491 17.025 8.38594 16.2843 8.65974 14.078",fill:"#FF5419"}),(0,l.jsx)("path",{d:"M4.97559 12.168C4.97559 12.168 5.41954 13.0974 5.03305 14.1925C5.03305 14.1925 5.54835 15.0137 8.0767 14.1925L8.04932 12.7402L4.97559 12.168Z",fill:"#FFC61B"}),(0,l.jsx)("path",{d:"M8.14114 12.8386C8.14114 12.8386 6.46629 10.9061 5.19415 11.7757C3.92201 12.6452 8.14114 12.8386 8.14114 12.8386Z",fill:"#E09112"}),(0,l.jsx)("path",{d:"M11.6215 12.1523C11.6215 12.1523 11.1709 13.0963 11.5573 14.1913C11.5573 14.1913 11.042 15.0126 8.51367 14.1913L8.54105 12.739L11.6215 12.1523Z",fill:"#EAA22F"}),(0,l.jsx)("path",{d:"M8.44922 12.8386C8.44922 12.8386 10.1241 10.9061 11.3962 11.7757C12.6683 12.6452 8.44922 12.8386 8.44922 12.8386Z",fill:"#FF5419"}),(0,l.jsx)("path",{d:"M8.29538 14.4013C8.79345 14.4013 9.19721 13.9976 9.19721 13.4995C9.19721 13.0014 8.79345 12.5977 8.29538 12.5977C7.79732 12.5977 7.39355 13.0014 7.39355 13.4995C7.39355 13.9976 7.79732 14.4013 8.29538 14.4013Z",fill:"#C92F00"}),(0,l.jsx)("path",{d:"M8.29492 12.5977C8.79292 12.5977 9.19675 13.0014 9.19675 13.4995C9.19675 13.9975 8.79302 14.4013 8.29492 14.4013V12.5977Z",fill:"#930000"})]}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0_4401_15692",children:(0,l.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]})]})]}),(0,l.jsxs)("form",{onSubmit:eI,className:"w-full border rounded-md flex flex-row ".concat(K?"border-[var(--base-red)]":"border-[var(--light-border)]"),children:[(0,l.jsx)("input",{disabled:U||ee,className:"px-2 py-3 w-full border-none flex-1 outline-none placeholder:text-sm rounded-md",type:"text",placeholder:"کد تخفیف یا کارت هدیه خود را وارد کنید",onChange:e=>X(e.target.value)}),(0,l.jsx)("button",{disabled:!G||U||ee,type:"submit",className:"text-sm px-2 font-IRANSansBold text-[var(--light-blue)] disabled:text-gray-400 disabled:bg-[#fafafa] rounded-r-none m-0",children:"ثبت"})]}),K?(0,l.jsx)("p",{className:"text-xs text-[var(--base-red)] font-IRANSansBold",children:"کد تخفیف یا کارت هدیه وارد شده صحیح نیست یا قبلا استفاده شده است."}):U&&(0,l.jsxs)("p",{className:"text-xs font-IRANSansBold text-[var(--base-blue)]",children:["%",ei," تخفیف از کارمزد برای شما اعمال شد."]})]}),(0,l.jsxs)("button",{type:"button",onClick:eH,className:"add-checkout-button",disabled:!O||I,children:[I?(0,l.jsx)("span",{className:I?"button-loader-white active":"button-loader-white"}):null,(0,l.jsxs)("p",{children:[" ",(null==_?void 0:_.is_admin)?"ثبت سفارش برای مشتری":" ثبت و نهایی کردن سفارش"]})]})]}):(0,l.jsx)("button",{type:"button",onClick:eA,className:"add-checkout-button",children:(0,l.jsx)("p",{children:"ادامه ثبت سفارش"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-2 border border-[var(--light-blue)] p-3 rounded-[8px] bg-[#EFF9FF]",children:[(0,l.jsxs)("div",{className:"flex items-center gap-[5px] text-[14px]",children:[(0,l.jsxs)("svg",{width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("g",{clipPath:"url(#clip0_1129_22009)",children:(0,l.jsx)("path",{d:"M16.3333 4.16634H14.5833C14.3899 3.22585 13.8782 2.3808 13.1344 1.77361C12.3906 1.16642 11.4602 0.83422 10.5 0.833008H4.66667C3.562 0.834331 2.50296 1.27374 1.72185 2.05486C0.940735 2.83597 0.501323 3.89501 0.5 4.99967L0.5 12.4997C0.502095 13.246 0.754615 13.9701 1.21711 14.5559C1.67961 15.1417 2.32533 15.5553 3.05083 15.7305C2.9723 16.1476 2.98572 16.5767 3.09016 16.988C3.19459 17.3993 3.38753 17.7829 3.6555 18.112C3.92347 18.441 4.26001 18.7077 4.64166 18.8932C5.0233 19.0788 5.44084 19.1789 5.86514 19.1864C6.28944 19.194 6.71029 19.1089 7.0983 18.937C7.48631 18.7652 7.83215 18.5107 8.11168 18.1914C8.3912 17.8721 8.59768 17.4957 8.71671 17.0883C8.83574 16.681 8.86445 16.2526 8.80083 15.833H12.2025C12.1811 15.9709 12.1696 16.1101 12.1683 16.2497C12.1683 17.0232 12.4756 17.7651 13.0226 18.3121C13.5696 18.8591 14.3115 19.1663 15.085 19.1663C15.8585 19.1663 16.6004 18.8591 17.1474 18.3121C17.6944 17.7651 18.0017 17.0232 18.0017 16.2497C18.0007 16.0754 17.9837 15.9016 17.9508 15.7305C18.676 15.555 19.3214 15.1412 19.7835 14.5555C20.2457 13.9697 20.498 13.2458 20.5 12.4997V8.33301C20.4987 7.22835 20.0593 6.16931 19.2782 5.38819C18.497 4.60708 17.438 4.16766 16.3333 4.16634ZM18.8333 8.33301V9.16634H14.6667V5.83301H16.3333C16.9964 5.83301 17.6323 6.0964 18.1011 6.56524C18.5699 7.03408 18.8333 7.66997 18.8333 8.33301ZM2.16667 12.4997V4.99967C2.16667 4.33663 2.43006 3.70075 2.8989 3.23191C3.36774 2.76307 4.00363 2.49967 4.66667 2.49967H10.5C11.163 2.49967 11.7989 2.76307 12.2678 3.23191C12.7366 3.70075 13 4.33663 13 4.99967V14.1663H3.83333C3.39131 14.1663 2.96738 13.9907 2.65482 13.6782C2.34226 13.3656 2.16667 12.9417 2.16667 12.4997ZM7.16667 16.2497C7.16667 16.5812 7.03497 16.8991 6.80055 17.1336C6.56613 17.368 6.24819 17.4997 5.91667 17.4997C5.58515 17.4997 5.2672 17.368 5.03278 17.1336C4.79836 16.8991 4.66667 16.5812 4.66667 16.2497C4.66718 16.1073 4.69343 15.9661 4.74417 15.833H7.08917C7.1399 15.9661 7.16615 16.1073 7.16667 16.2497ZM15.0833 17.4997C14.7518 17.4997 14.4339 17.368 14.1995 17.1336C13.965 16.8991 13.8333 16.5812 13.8333 16.2497C13.8337 16.1072 13.86 15.9661 13.9108 15.833H16.2558C16.3067 15.9661 16.333 16.1072 16.3333 16.2497C16.3333 16.5812 16.2016 16.8991 15.9672 17.1336C15.7328 17.368 15.4149 17.4997 15.0833 17.4997ZM17.1667 14.1663H14.6667V10.833H18.8333V12.4997C18.8333 12.9417 18.6577 13.3656 18.3452 13.6782C18.0326 13.9907 17.6087 14.1663 17.1667 14.1663Z",fill:"#2FA9FF"})}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0_1129_22009",children:(0,l.jsx)("rect",{width:"20",height:"20",fill:"white",transform:"translate(0.5)"})})})]}),(0,l.jsx)("p",{className:"font-IRANSansBold",children:"ارسال رایگان"})]}),(0,l.jsx)("p",{className:"text-[14px]",children:"هزینه ارسال داخل ایران در چارسوق رایگان میباشد"})]})]})})]})})]})}},33145:function(e,t,s){s.d(t,{default:function(){return a.a}});var l=s(48461),a=s.n(l)},48461:function(e,t,s){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{default:function(){return c},getImageProps:function(){return r}});let l=s(47043),a=s(55346),n=s(65878),i=l._(s(5084));function r(e){let{props:t}=(0,a.getImgProps)(e,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,s]of Object.entries(t))void 0===s&&delete t[e];return{props:t}}let c=n.Image}}]);