(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1891],{34417:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/shopping-cart",function(){return l(4820)}])},4820:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return L}});var s=l(85893),a=l(94184),c=l.n(a),r=l(81905),n=l(91787),i=l(83481),d=l(31489),o=l(41664),x=l.n(o),m=l(92077),p=l.n(m);let h=function(e,t,l){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return arguments.length>4&&arguments[4],e.preventDefault(),t(l,s)};var u=(0,i.Z)(function(e){let{items:t=[],removeFromCart:l,setShoppingCart:a,currentShop:c,theTotalPrice:r,totalPrice:n,setSelectedDeliveryZone:i,selectedDeliveryZone:o}=e,m=(e,l)=>{let s=[...t],c=parseInt(e.target.value);c>0&&s[l]&&(s[l].quantity=parseInt(e.target.value),a(s))};return(0,s.jsx)("div",{className:"flex",children:(0,s.jsx)("div",{className:"flex flex-col bg-white  rounded-md shadow lg:rounded-md w-full  text-gray-800 lg:w-full",children:(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("table",{className:"dark__mode__background w-full text-12 lg:text-base",cellSpacing:0,children:[(0,s.jsx)("thead",{className:"dark__mode__top__botton__border border-b",children:(0,s.jsxs)("tr",{className:"h-12",children:[(0,s.jsx)("th",{className:"dark__mode__text text-left text-black md:text-[14px] text-[12px] font-medium  small:p-[16px] p-[8px]",children:(0,d.translate)(c.locales,"product_name"," Бүтээгдэхүүн")}),(0,s.jsxs)("th",{className:"dark__mode__text text-center text-black md:text-[14px] text-[12px] leading-3 font-medium  small:p-[16px] p-[8px]",children:[(0,s.jsx)("span",{className:"lg:hidden",title:"Quantity",children:(0,d.translate)(c.locales,"quantity"," Тоо ширхэг")}),(0,s.jsx)("span",{className:"hidden lg:inline ",children:(0,d.translate)(c.locales,"quantity"," Тоо ширхэг")})]}),(0,s.jsx)("th",{className:"dark__mode__text text-black md:text-[14px] text-[12px] leading-3 font-medium  small:p-[14px] p-[8px] table-cell",children:(0,d.translate)(c.locales,"unit_price"," Нэгж үнэ")}),(0,s.jsx)("th",{className:"dark__mode__text text-black md:text-[14px] text-[12px] leading-3 font-medium small:p-[16px] p-[8px] table-cell",children:(0,d.translate)(c.locales,"total_price"," Нийт үнэ")})]})}),(0,s.jsx)("tbody",{children:t.map((e,a)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"table-cell p-3",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("img",{alt:"",src:function(e){try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length>0){let e=t[0].url;return e}}catch(e){console.error("Error parsing JSON array:",e)}return null}(e.images),className:"object-cover w-[40px] h-[40px] rounded-[8px] lg:w-[57px] lg:h-[57px] lg:rounded-[16px]"}),(0,s.jsx)(x(),{as:"/products/".concat(e.category_id,"/").concat(e.id),href:"/product-detail?category_id=".concat(e.category_id,"&id=").concat(e.id),legacyBehavior:!0,children:(0,s.jsxs)("a",{className:"text-[black] pl-3 font-medium text-[12px] lg:text-[16px] flex-col flex  hover:underline",children:[(0,s.jsx)("p",{className:"2xl:max-w-[480px] xl:max-w-[320px] lg:max-w-[240px] md:max-w-[320px] sm:max-w-[160px] max-w-[65px] truncate text-dark",children:e.name}),(0,s.jsxs)("span",{className:"text-[black] font-[400] lg:text-[14px] text-[12px] ",children:[" ",!!(e.options&&e.options.length)&&"\n                              ".concat((e.options||[]).map(e=>"".concat(e.title,": ").concat("string"==typeof e.value?e.value:e.value.title)).join(", "),"\n                           ")]})]})})]})}),(0,s.jsx)("td",{className:"flex justify-center py-3 px-1 text-sx md:text-base",children:(0,s.jsx)("div",{className:"lg:w-20 lg:h-10 w-[50px] h-[25px]",children:(0,s.jsx)("div",{className:"relative flex flex-row w-full h-8",children:(0,s.jsx)("input",{type:"number",defaultValue:e.quantity,min:1,minLength:1,onChange:e=>e.target.value>=1&&m(e,a),className:"dark__mode__input w-full text-[14px] text-center dark-text-black rounded-[4px] bg-[#F5F5F5] dark:bg-gray-600 text-dark outline-none focus:outline-none hover:text-black focus:text-black"})})})}),(0,s.jsx)("td",{className:"text-center  text-sx align-top py-3 px-1 md:text-base ",children:(0,s.jsxs)("span",{className:"text-[14px] font-[400] lg:text-base text-[black] text-dark",children:[p()(e.price).format("0,0"),c.currency_symbol]})}),(0,s.jsx)("td",{className:"text-center  text-sx align-top py-3 px-1 md:text-base ",children:(0,s.jsxs)("span",{className:"text-[14px] font-[400] lg:text-base text-[black] text-dark",children:[p()(e.price*e.quantity).format("0,0"),c.currency_symbol]})}),(0,s.jsx)("td",{className:"align-top py-3 px-1",children:(0,s.jsx)("a",{href:"#",onClick:s=>h(s,l,e,t,c.miniapp),children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",style:{color:"red"},className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})})})]},"sci_".concat(e.id)))})]}),(0,s.jsxs)("div",{className:"flex w-full mobile-header-wrapper",children:[(0,s.jsxs)("div",{className:"flex flex-col justify-between w-full list-none text-dark",children:[!!(c.delivery_price&&r>n)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"bg-[#FCFCFC] border-t border-[#DFDFDF] font-[400] text-[14px] p-2 flex w-full justify-between",children:["Захиалгын үнэ:"," ",(0,s.jsxs)("span",{className:"count",children:[p()(n).format("0,0"),c.currency_symbol]})]}),(0,s.jsxs)("div",{className:"bg-[#FCFCFC] border-t border-[#DFDFDF] font-[400] text-[14px] p-2 flex w-full justify-between",children:[" ",(0,d.translate)(c.locales,"checkout_delivery_price"," Хүргэлтийн төлбөр"),":",(0,s.jsxs)("span",{className:"count",children:[o&&parseInt(null==o?void 0:o.delivery_price_limit)>0?r>(null==o?void 0:o.delivery_price_limit)?"0":p()((null==o?void 0:o.delivery_price)||(null==c?void 0:c.delivery_price)).format("0,0"):p()((null==o?void 0:o.delivery_price)||c.delivery_price).format("0,0"),c.currency_symbol]})]})]}),(0,s.jsxs)("div",{className:"font-bold text-[14px] mb-2 text-black flex w-full justify-center items-center ",children:[(0,s.jsxs)("span",{className:"font-normal",children:[(0,d.translate)(c.locales,"checkout_delivery_price"," Хүргэлтийн төлбөр"),": \xa0"]}),(0,s.jsxs)("span",{className:"count",children:[o&&parseInt(null==o?void 0:o.delivery_price_limit)>0?r>(null==o?void 0:o.delivery_price_limit)?"0":p()((null==o?void 0:o.delivery_price)||(null==c?void 0:c.delivery_price)).format("0,0"):p()((null==o?void 0:o.delivery_price)||c.delivery_price).format("0,0"),c.currency_symbol]})]}),(0,s.jsxs)("div",{className:"font-bold text-[14px]  text-black justify-center flex w-full items-center ",children:[(0,s.jsxs)("span",{className:"font-normal",children:[(0,d.translate)(c.locales,"total_price"," Нийт үнэ"),": \xa0"]}),(0,s.jsxs)("span",{className:"count",children:[p()(r).format("0,0"),c.currency_symbol]})]})]}),o&&(0,s.jsx)("div",{className:"bg-yellow-100 text-black text-sm p-2 m-2",children:"Хүргэлтийн бүсээс хамаарч хүргэлтийн төлбөрт өөрчлөлт орохыг анхаараарай."})]})]})})})}),_=l(23274),f=l(78995),v=l(13077),j=l(82078),y=l(179),g=l(9008),b=l.n(g),N=l(11163),w=l(67294),k=l(1818),z=l(36456);let C=(0,f.Z)((0,i.Z)(function(e){let{currentShop:t,shoppingCart:l,removeFromCart:a,setShoppingCart:i,currentUser:o,makeOrder:x,isMakingOrder:m,createdOrderID:h,orderRedirectUri:_,error_message:f,clearOrderId:j,rules:g,accounts:C,methods:M}=e,[S,L]=(0,w.useState)({}),[F,I]=(0,w.useState)("bank"),[O,D]=(0,w.useState)(!t.terms_of_service),[Z,B]=(0,w.useState)(""),[E,H]=(0,w.useState)(),[P,q]=(0,w.useState)(!0),[T,U]=(0,w.useState)(""),[A,J]=(0,w.useState)(0),[R,W]=(0,w.useState)(t&&t.delivery_options&&t.delivery_options[0]);(0,w.useEffect)(()=>{},[R]);let X=(0,z.I0)(),Q=l.reduce((e,t)=>e+t.price*t.quantity,0),V=l.map(e=>e.id).join(","),G=(0,N.useRouter)();(0,w.useEffect)(()=>{try{!o&&t.miniapp&&X((0,r.miniAppInit)({shop_id:t.id,authcode:t.miniapp_code,provider:t.miniapp_provider}))}catch(e){}},[]),(0,w.useEffect)(()=>{o&&(0,y.U)("/user/accounts/profile-detail",!0).then(e=>{e&&e.data&&L(e.data)})},[o]),(0,w.useEffect)(()=>{Z&&(0,y.U)("/storefront/coupons/by-code?shop_id=".concat(t.id,"&code=").concat(Z,"&product_ids=").concat(V),!0).then(e=>{e&&e.data&&(0===Object.keys(e.data).length&&e.data.constructor===Object?q(!0):(H(e.data),q(!1),k.store.addNotification({message:e.data.name+" амжилттай идэвхжилээ ❤️",type:"success",container:"top-right",animationIn:["animated","fadeIn"],animationOut:["animated","fadeOut"],dismiss:{duration:3e3}})))}).catch(e=>{try{let t=JSON.parse(e.message);k.store.addNotification({message:t.message,type:"warning",container:"top-right",animationIn:["animated","fadeIn"],animationOut:["animated","fadeOut"],dismiss:{duration:3e3}})}catch(e){console.log(e)}})},[Z]);let K=Q,Y=l.reduce((e,t)=>e+t.price,!1);(t.delivery_price&&Y&&t.delivery_price_limit&&Q<parseInt(t.delivery_price_limit)||t.delivery_price&&!t.delivery_price_limit)&&(K+=parseInt(t.delivery_price));let $=()=>{B(T)},ee=K;return ee=R&&R.delivery_price&&R.delivery_price_limit?parseInt(R.delivery_price_limit)>0&&R.delivery_price_limit<K?K:K+parseInt(R.delivery_price):K,(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b(),{children:(0,s.jsxs)("title",{children:["Сагс - ",t.name]})}),(0,s.jsx)("section",{className:" md:container cart-section section-b-space min-h-[573px]",children:(0,s.jsxs)("div",{className:" pt-2 mb-20 lg:mb-0 ",children:[(0,s.jsx)("p",{className:"dark__mode__text px-5 py-2  text-[16px] lg:text-[24px] font-bold text-black no-underline hover:no-underline md:px-0",children:(0,d.translate)(t.locales,"shopping_cart","Миний сагс")}),0===(l||[]).length&&(0,s.jsx)("div",{className:"flex",children:(0,s.jsx)("div",{className:"grid place-items-center lg:h-[500px] h-[700px] w-full",children:(0,s.jsxs)("div",{className:"mb-8 text-center",children:[(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",enableBackground:"new 0 0 24 24",viewBox:"0 0 24 24",id:"cart",className:"dark__mode__image__filter",children:(0,s.jsx)("path",{d:"M9,18c-1.1045532,0-2,0.8954468-2,2s0.8954468,2,2,2c1.1040039-0.0014038,1.9985962-0.8959961,2-2C11,18.8954468,10.1045532,18,9,18z M9,21c-0.5523071,0-1-0.4476929-1-1s0.4476929-1,1-1c0.552124,0.0003662,0.9996338,0.447876,1,1C10,20.5523071,9.5523071,21,9,21z M17,18c-1.1045532,0-2,0.8954468-2,2s0.8954468,2,2,2c1.1040039-0.0014038,1.9985962-0.8959961,2-2C19,18.8954468,18.1045532,18,17,18z M17,21c-0.5523071,0-1-0.4476929-1-1s0.4476929-1,1-1c0.552124,0.0003662,0.9996338,0.447876,1,1C18,20.5523071,17.5523071,21,17,21z M19.4985352,12.0502319l1.9848633-7.4213257c0.0111694-0.0419312,0.0167847-0.085083,0.0167847-0.128479C21.5002441,4.2241211,21.2763062,4.000061,21,4H5.9198608L5.4835205,2.371582C5.4249268,2.1530151,5.2268677,2.0009766,5.0005493,2.0009766H3.5048218C3.5031128,2.0009766,3.501709,2,3.5,2C3.223877,2,3,2.223877,3,2.5S3.223877,3,3.5,3v0.0009766L4.6162109,3l2.579834,9.6288452C7.2546387,12.8477783,7.453064,13,7.6796875,13H11h6.8603516H19c0.8284302,0,1.5,0.6715698,1.5,1.5S19.8284302,16,19,16H5c-0.276123,0-0.5,0.223877-0.5,0.5S4.723877,17,5,17h14c1.3807373,0,2.5-1.1192627,2.5-2.5C21.5,13.2900391,20.6403809,12.2813721,19.4985352,12.0502319z M18.4761963,12h-0.6158447H11H8.0634766L6.1878052,5h14.1608276L18.4761963,12z"})}),(0,s.jsx)("h4",{className:"dark__mode__text mt-2",children:(0,d.translate)(t.locales,"shopping_cart_empty","Сагс хоосон байна.")})]})})}),(l||[]).length>0&&(0,s.jsxs)("div",{className:"flex flex-wrap gap-5",children:[(0,s.jsxs)("div",{className:c()("flex-1 px-2 md:px-0 md:w-3/5 w-full",{"mb-4":!o}),children:[(0,s.jsx)(u,{items:l||[],removeFromCart:a,setShoppingCart:i,currentShop:t,theTotalPrice:ee,totalPrice:Q,setSelectedDeliveryZone:W,selectedDeliveryZone:R}),(0,s.jsxs)("div",{className:"mobile-header-wrapper",children:[t.coupon_disabled?null:(0,s.jsx)("div",{className:"flex flex-wrap py-2 rounded-[6px] mt-2  bg-white",style:{boxShadow:"0px 0px 20px 5px rgba(0, 0, 0, 0.05)"},children:(0,s.jsxs)("div",{className:"flex items-center justify-between w-full pr-3",children:[(0,s.jsx)("input",{type:"text",placeholder:(0,d.translate)(t.locales,"coupon_code","Купон код"),onChange:e=>U(e.target.value),name:"coupon",className:"block w-full text-[14px] px-5 py-1 mx-2 leading-tight text-gray-700 bg-[#F4F4F4] rounded-md focus:outline-none focus:bg-white focus:border-gray-500"}),(0,s.jsx)("button",{onClick:$,children:(0,s.jsx)("span",{className:"flex items-center",children:(0,s.jsx)("h3",{className:"dark__mode__ant__button p-1  bg-black rounded-md dark:text-gray-400 text-white font-[400] text-[14px] px-8",children:E?(0,s.jsx)("p",{className:"flex items-center justify-center truncate",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5 mr-1 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}):(0,d.translate)(t.locales,"check","Шалгах")})})})]})}),(0,s.jsx)("div",{className:"flex flex-wrap w-full ",children:(0,s.jsx)("div",{className:"w-full mt-5",children:(0,s.jsx)("button",{className:"dark__mode__ant__button bg-black hover:bg-gray-900 text-white font-[500] py-2 px-4 rounded-[8px] w-full",onClick:e=>{e.preventDefault(),G.push({pathname:"/mobile-checkout",query:Z?{couponCode:Z}:{}})},children:(0,d.translate)(t.locales,"pay_now"," Төлбөр төлөх")})})})]}),(0,s.jsxs)("div",{className:"dark__mode__top__botton__border desktop-header-wrapper",children:[(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)("div",{className:"w-full my-5",children:(0,s.jsxs)("div",{className:"flex justify-between list-none text-dark",children:[!!R&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"",children:[(0,d.translate)(t.locales,"order_price","Захиалгын үнэ"),":",(0,s.jsxs)("span",{className:"count ml-2",children:[p()(Q).format("0,0"),t.currency_symbol]})]}),(0,s.jsxs)("div",{className:"",children:[(0,d.translate)(t.locales,"checkout_delivery_price","  Хүргэлтийн төлбөр"),":",(0,s.jsxs)("span",{className:"count ml-2",children:[R&&parseInt(null==R?void 0:R.delivery_price_limit)>0&&K>(null==R?void 0:R.delivery_price_limit)?"0":p()((null==R?void 0:R.delivery_price)||t.delivery_price).format("0,0"),t.currency_symbol]})]})]}),(0,s.jsxs)("div",{className:"font-semibold text-dark",children:[(0,d.translate)(t.locales,"total_price","Нийт үнэ"),":",(0,s.jsxs)("span",{className:"count ml-2",children:[p()(ee).format("0,0"),t.currency_symbol]})]})]})})}),t.coupon_disabled?null:(0,s.jsxs)("div",{className:"grid flex-wrap -mx-3",children:[(0,s.jsx)("label",{className:" block dark__mode__text text-[14px] text-center tracking-wide text-black",children:(0,d.translate)(t.locales,"checkout_enter_coupon","Купон код оруулах")}),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)("div",{className:"flex w-full px-3 justify-center place-items-end",children:[(0,s.jsx)("input",{type:"text",placeholder:(0,d.translate)(t.locales,"coupon_code","Купон код"),onChange:e=>U(e.target.value),name:"coupon",className:"dark__mode__coupon__code border border-r-0 text-[14px] block mt-2 px-4 h-9 leading-tight text-gray-700 bg-white rounded-l-md focus:outline-none focus:bg-white focus:border-gray-500"}),(0,s.jsx)("span",{className:" flex items-center",children:(0,s.jsx)("button",{onClick:$,className:"dark__mode__button__coupon px-4 h-9 bg-black rounded-r-md text-xs font-bold tracking-wide text-white uppercase",children:E?(0,s.jsx)("p",{className:" flex items-center justify-center truncate",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5 mr-1 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}):(0,d.translate)(t.locales,"check","Шалгах")})})]})})]}),!t.delivery_disabled&&(0,s.jsx)("div",{className:"items-center rounded lg:hidden",children:(0,s.jsxs)("div",{className:"my-5",children:[(0,s.jsxs)("div",{className:"flex justify-center my-2 shopinfo-icon",children:[(0,s.jsx)("svg",{className:"w-10 h-10",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -117 679.99892 679",style:{color:"#eee"},children:(0,s.jsx)("path",{d:"m12.347656 378.382812h37.390625c4.371094 37.714844 36.316407 66.164063 74.277344 66.164063 37.96875 0 69.90625-28.449219 74.28125-66.164063h241.789063c4.382812 37.714844 36.316406 66.164063 74.277343 66.164063 37.96875 0 69.902344-28.449219 74.285157-66.164063h78.890624c6.882813 0 12.460938-5.578124 12.460938-12.460937v-352.957031c0-6.882813-5.578125-12.464844-12.460938-12.464844h-432.476562c-6.875 0-12.457031 5.582031-12.457031 12.464844v69.914062h-105.570313c-4.074218.011719-7.890625 2.007813-10.21875 5.363282l-68.171875 97.582031-26.667969 37.390625-9.722656 13.835937c-1.457031 2.082031-2.2421872 4.558594-2.24999975 7.101563v121.398437c-.09765625 3.34375 1.15624975 6.589844 3.47656275 9.003907 2.320312 2.417968 5.519531 3.796874 8.867187 3.828124zm111.417969 37.386719c-27.527344 0-49.851563-22.320312-49.851563-49.847656 0-27.535156 22.324219-49.855469 49.851563-49.855469 27.535156 0 49.855469 22.320313 49.855469 49.855469 0 27.632813-22.21875 50.132813-49.855469 50.472656zm390.347656 0c-27.53125 0-49.855469-22.320312-49.855469-49.847656 0-27.535156 22.324219-49.855469 49.855469-49.855469 27.539063 0 49.855469 22.320313 49.855469 49.855469.003906 27.632813-22.21875 50.132813-49.855469 50.472656zm140.710938-390.34375v223.34375h-338.375c-6.882813 0-12.464844 5.578125-12.464844 12.460938 0 6.882812 5.582031 12.464843 12.464844 12.464843h338.375v79.761719h-66.421875c-4.382813-37.710937-36.320313-66.15625-74.289063-66.15625-37.960937 0-69.898437 28.445313-74.277343 66.15625h-192.308594v-271.324219h89.980468c6.882813 0 12.464844-5.582031 12.464844-12.464843 0-6.882813-5.582031-12.464844-12.464844-12.464844h-89.980468v-31.777344zm-531.304688 82.382813h99.703125v245.648437h-24.925781c-4.375-37.710937-36.3125-66.15625-74.28125-66.15625-37.960937 0-69.90625 28.445313-74.277344 66.15625h-24.929687v-105.316406l3.738281-5.359375h152.054687c6.882813 0 12.460938-5.574219 12.460938-12.457031v-92.226563c0-6.882812-5.578125-12.464844-12.460938-12.464844h-69.796874zm-30.160156 43h74.777344v67.296875h-122.265625zm0 0",fill:"#ff4c3b"})})," ",(0,s.jsx)("div",{className:"ml-4 font-medium leading-8 text-gray-900 uppercase text-md",children:(0,d.translate)(t.locales,"delivery_rule"," ХҮРГЭЛТИЙН НӨХЦӨЛ")})]}),(0,s.jsx)("div",{className:"text-sm text-gray-700 text-center",children:t.delivery_rule})]})}),(0,s.jsx)("div",{className:"flex items-center justify-center px-5 pb-3 my-5 rounded lg:hidden",children:(0,s.jsxs)("div",{className:"",children:[(0,s.jsxs)("div",{className:"flex justify-center my-2 shopinfo-icon",children:[(0,s.jsx)("svg",{viewBox:"0 0 512 512",className:"w-10 h-10",children:(0,s.jsxs)("g",{fill:"#ff4c3b",children:[(0,s.jsx)("path",{d:"M498.409 175.706L336.283 13.582C327.531 4.831 315.86.011 303.418.011c-12.441 0-24.113 4.818-32.865 13.569L13.571 270.563C4.82 279.315 0 290.985 0 303.427c0 12.442 4.82 24.114 13.571 32.864l19.992 19.992.005.005.006.006 134.36 134.36H149.33c-5.89 0-10.666 4.775-10.666 10.666 0 5.89 4.776 10.666 10.666 10.666h59.189l.041.001.041-.001 154.053.002c5.89 0 10.666-4.776 10.666-10.666 0-5.891-4.776-10.666-10.666-10.666l-113.464-.002 249.22-249.22c18.12-18.122 18.12-47.608-.001-65.728zm-15.084 50.644L226.341 483.334c-4.713 4.712-11.013 7.31-17.742 7.32h-.081c-6.727-.011-13.025-2.608-17.736-7.32L56.195 348.746 302.99 101.949c4.165-4.165 4.165-10.919 0-15.084-4.166-4.165-10.918-4.165-15.085.001L41.11 333.663l-12.456-12.456c-4.721-4.721-7.321-11.035-7.321-17.779s2.6-13.059 7.322-17.781L285.637 28.665c4.722-4.721 11.037-7.321 17.781-7.321 6.744 0 13.059 2.6 17.781 7.322l57.703 57.702-246.798 246.8c-4.165 4.164-4.165 10.918 0 15.085a10.636 10.636 0 007.542 3.123c2.729 0 5.459-1.042 7.542-3.124l246.798-246.799 89.339 89.336c9.803 9.804 9.802 25.757 0 35.561z"}),(0,s.jsx)("path",{d:"M262.801 308.064c-4.165-4.165-10.917-4.164-15.085 0l-83.934 83.933c-4.165 4.165-4.165 10.918 0 15.085a10.633 10.633 0 007.542 3.124c2.729 0 5.459-1.042 7.542-3.124l83.934-83.933c4.166-4.167 4.166-10.92.001-15.085zM228.375 387.741l-34.425 34.425c-4.165 4.165-4.165 10.919 0 15.085a10.637 10.637 0 007.542 3.124c2.731 0 5.459-1.042 7.542-3.124l34.425-34.425c4.165-4.165 4.165-10.919 0-15.085s-10.916-4.166-15.084 0zM260.054 356.065l-4.525 4.524c-4.166 4.165-4.166 10.918-.001 15.085a10.632 10.632 0 007.542 3.125 10.63 10.63 0 007.541-3.125l4.525-4.524c4.166-4.165 4.166-10.918.001-15.084-4.163-4.165-10.918-4.166-15.083-.001zM407.073 163.793a10.666 10.666 0 00-15.084 0l-45.255 45.254a10.668 10.668 0 000 15.084l30.17 30.167a10.633 10.633 0 007.542 3.124c2.731 0 5.459-1.042 7.542-3.124l45.253-45.252c4.165-4.165 4.165-10.919 0-15.084l-30.168-30.169zm-22.628 67.88l-15.085-15.084 30.17-30.169 15.084 15.085-30.169 30.168zM320.339 80.186c2.731 0 5.461-1.042 7.543-3.126l4.525-4.527c4.164-4.166 4.163-10.92-.003-15.084-4.165-4.164-10.92-4.163-15.084.003l-4.525 4.527c-4.164 4.166-4.163 10.92.003 15.084a10.628 10.628 0 007.541 3.123zM107.215 358.057l-4.525 4.525c-4.165 4.164-4.165 10.918 0 15.085 2.083 2.082 4.813 3.123 7.542 3.123s5.459-1.041 7.542-3.123l4.525-4.525c4.165-4.166 4.165-10.92 0-15.085-4.166-4.166-10.918-4.166-15.084 0z"})]})}),(0,s.jsxs)("div",{className:"ml-4 font-medium leading-8 text-gray-900 text-md uppercase",children:[" ",(0,d.translate)(t.locales,"payment_rule","ТӨЛБӨРИЙН МЭДЭЭЛЭЛ")]})]}),(0,s.jsx)("div",{className:"text-sm text-gray-700 ",children:t.payment_rule})]})})]})]}),(0,s.jsx)("div",{className:c()("w-full md:w-2/5 hidden lg:block",{"mb-4":!o}),children:(0,s.jsxs)("div",{className:"flex flex-wrap  rounded-[16px]",children:[(0,s.jsx)(n.Z,{children:(0,s.jsx)(v.Z,{rules:g,items:l,makeOrder:x,profile:S||{},couponCode:Z,currentShop:t,currentUser:o,clearOrderId:j,paymentMethod:F,isMakingOrder:m,createdOrderID:h,setShoppingCart:i,error_message:f,orderRedirectUri:_,accounts:C,theTotalPrice:ee,totalPrice:Q,methods:M,agreeTerms:O,setCouponCode:B,couponLoading:P,couponTrue:E,setAgreeTerms:D,setPaymentMethod:I,setSelectedDeliveryZone:W,selectedDeliveryZone:R})}),(0,s.jsxs)("div",{className:"mobile-header-wrapper",children:[!t.delivery_disabled&&(0,s.jsx)("div",{className:"flex items-center px-5 my-2 rounded",children:(0,s.jsxs)("div",{className:"",children:[(0,s.jsxs)("div",{className:"flex justify-center my-2 shopinfo-icon",children:[(0,s.jsx)("svg",{className:"w-10 h-10",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -117 679.99892 679",style:{color:"#eee"},children:(0,s.jsx)("path",{d:"m12.347656 378.382812h37.390625c4.371094 37.714844 36.316407 66.164063 74.277344 66.164063 37.96875 0 69.90625-28.449219 74.28125-66.164063h241.789063c4.382812 37.714844 36.316406 66.164063 74.277343 66.164063 37.96875 0 69.902344-28.449219 74.285157-66.164063h78.890624c6.882813 0 12.460938-5.578124 12.460938-12.460937v-352.957031c0-6.882813-5.578125-12.464844-12.460938-12.464844h-432.476562c-6.875 0-12.457031 5.582031-12.457031 12.464844v69.914062h-105.570313c-4.074218.011719-7.890625 2.007813-10.21875 5.363282l-68.171875 97.582031-26.667969 37.390625-9.722656 13.835937c-1.457031 2.082031-2.2421872 4.558594-2.24999975 7.101563v121.398437c-.09765625 3.34375 1.15624975 6.589844 3.47656275 9.003907 2.320312 2.417968 5.519531 3.796874 8.867187 3.828124zm111.417969 37.386719c-27.527344 0-49.851563-22.320312-49.851563-49.847656 0-27.535156 22.324219-49.855469 49.851563-49.855469 27.535156 0 49.855469 22.320313 49.855469 49.855469 0 27.632813-22.21875 50.132813-49.855469 50.472656zm390.347656 0c-27.53125 0-49.855469-22.320312-49.855469-49.847656 0-27.535156 22.324219-49.855469 49.855469-49.855469 27.539063 0 49.855469 22.320313 49.855469 49.855469.003906 27.632813-22.21875 50.132813-49.855469 50.472656zm140.710938-390.34375v223.34375h-338.375c-6.882813 0-12.464844 5.578125-12.464844 12.460938 0 6.882812 5.582031 12.464843 12.464844 12.464843h338.375v79.761719h-66.421875c-4.382813-37.710937-36.320313-66.15625-74.289063-66.15625-37.960937 0-69.898437 28.445313-74.277343 66.15625h-192.308594v-271.324219h89.980468c6.882813 0 12.464844-5.582031 12.464844-12.464843 0-6.882813-5.582031-12.464844-12.464844-12.464844h-89.980468v-31.777344zm-531.304688 82.382813h99.703125v245.648437h-24.925781c-4.375-37.710937-36.3125-66.15625-74.28125-66.15625-37.960937 0-69.90625 28.445313-74.277344 66.15625h-24.929687v-105.316406l3.738281-5.359375h152.054687c6.882813 0 12.460938-5.574219 12.460938-12.457031v-92.226563c0-6.882812-5.578125-12.464844-12.460938-12.464844h-69.796874zm-30.160156 43h74.777344v67.296875h-122.265625zm0 0",fill:"#ff4c3b"})})," ",(0,s.jsx)("div",{className:"ml-4 font-medium leading-8 text-gray-900 uppercase text-md",children:(0,d.translate)(t.locales,"delivery_rule"," ХҮРГЭЛТИЙН НӨХЦӨЛ")})]}),(0,s.jsx)("div",{className:"text-sm text-gray-700 ",children:t.delivery_rule})]})}),(0,s.jsx)("div",{className:"flex items-center px-5 pb-3 my-2 rounded",children:(0,s.jsxs)("div",{className:"",children:[(0,s.jsxs)("div",{className:"flex justify-center my-2 shopinfo-icon",children:[(0,s.jsx)("svg",{viewBox:"0 0 512 512",className:"w-10 h-10",children:(0,s.jsxs)("g",{fill:"#ff4c3b",children:[(0,s.jsx)("path",{d:"M498.409 175.706L336.283 13.582C327.531 4.831 315.86.011 303.418.011c-12.441 0-24.113 4.818-32.865 13.569L13.571 270.563C4.82 279.315 0 290.985 0 303.427c0 12.442 4.82 24.114 13.571 32.864l19.992 19.992.005.005.006.006 134.36 134.36H149.33c-5.89 0-10.666 4.775-10.666 10.666 0 5.89 4.776 10.666 10.666 10.666h59.189l.041.001.041-.001 154.053.002c5.89 0 10.666-4.776 10.666-10.666 0-5.891-4.776-10.666-10.666-10.666l-113.464-.002 249.22-249.22c18.12-18.122 18.12-47.608-.001-65.728zm-15.084 50.644L226.341 483.334c-4.713 4.712-11.013 7.31-17.742 7.32h-.081c-6.727-.011-13.025-2.608-17.736-7.32L56.195 348.746 302.99 101.949c4.165-4.165 4.165-10.919 0-15.084-4.166-4.165-10.918-4.165-15.085.001L41.11 333.663l-12.456-12.456c-4.721-4.721-7.321-11.035-7.321-17.779s2.6-13.059 7.322-17.781L285.637 28.665c4.722-4.721 11.037-7.321 17.781-7.321 6.744 0 13.059 2.6 17.781 7.322l57.703 57.702-246.798 246.8c-4.165 4.164-4.165 10.918 0 15.085a10.636 10.636 0 007.542 3.123c2.729 0 5.459-1.042 7.542-3.124l246.798-246.799 89.339 89.336c9.803 9.804 9.802 25.757 0 35.561z"}),(0,s.jsx)("path",{d:"M262.801 308.064c-4.165-4.165-10.917-4.164-15.085 0l-83.934 83.933c-4.165 4.165-4.165 10.918 0 15.085a10.633 10.633 0 007.542 3.124c2.729 0 5.459-1.042 7.542-3.124l83.934-83.933c4.166-4.167 4.166-10.92.001-15.085zM228.375 387.741l-34.425 34.425c-4.165 4.165-4.165 10.919 0 15.085a10.637 10.637 0 007.542 3.124c2.731 0 5.459-1.042 7.542-3.124l34.425-34.425c4.165-4.165 4.165-10.919 0-15.085s-10.916-4.166-15.084 0zM260.054 356.065l-4.525 4.524c-4.166 4.165-4.166 10.918-.001 15.085a10.632 10.632 0 007.542 3.125 10.63 10.63 0 007.541-3.125l4.525-4.524c4.166-4.165 4.166-10.918.001-15.084-4.163-4.165-10.918-4.166-15.083-.001zM407.073 163.793a10.666 10.666 0 00-15.084 0l-45.255 45.254a10.668 10.668 0 000 15.084l30.17 30.167a10.633 10.633 0 007.542 3.124c2.731 0 5.459-1.042 7.542-3.124l45.253-45.252c4.165-4.165 4.165-10.919 0-15.084l-30.168-30.169zm-22.628 67.88l-15.085-15.084 30.17-30.169 15.084 15.085-30.169 30.168zM320.339 80.186c2.731 0 5.461-1.042 7.543-3.126l4.525-4.527c4.164-4.166 4.163-10.92-.003-15.084-4.165-4.164-10.92-4.163-15.084.003l-4.525 4.527c-4.164 4.166-4.163 10.92.003 15.084a10.628 10.628 0 007.541 3.123zM107.215 358.057l-4.525 4.525c-4.165 4.164-4.165 10.918 0 15.085 2.083 2.082 4.813 3.123 7.542 3.123s5.459-1.041 7.542-3.123l4.525-4.525c4.165-4.166 4.165-10.92 0-15.085-4.166-4.166-10.918-4.166-15.084 0z"})]})}),(0,s.jsxs)("div",{className:"ml-4 font-medium leading-8 text-gray-900 uppercase text-md",children:[" ",(0,d.translate)(t.locales,"payment_rule","ТӨЛБӨРИЙН МЭДЭЭЛЭЛ")]})]}),(0,s.jsx)("div",{className:"text-sm text-gray-700 ",children:t.payment_rule})]})})]})]})})]})]})})]})})),M=(0,_.Z)(C),S=(0,f.Z)((0,j.Z)(M));S.getInitialProps=async e=>{let{reduxStore:t,query:l}=e;try{let e=(0,d.getShopFromState)(t.getState()),{data:s}=await (0,y.U)("/storefront/bank-accounts/".concat(e.id),!1),{data:a}=await (0,y.U)("/storefront/payment-methods/".concat(e.id),!1,!1);return{accounts:s,methods:a,autologin:!!l.autologin}}catch(e){console.error(e)}return{methods:[],accounts:[]}};var L=(0,N.withRouter)(S)}},function(e){e.O(0,[1589,2159,6831,9774,2888,179],function(){return e(e.s=34417)}),_N_E=e.O()}]);