PageSourceSearch

https://id.movevn.com/assets/index-CyEPZbc-.js

js movevn.com collected 2026-10-02 00:33:24 UTC 3,512 bytes, 1 lines download raw bytes

1import{j as e,B as f,z as L,a0 as _,a3 as b,T as k}from"./vendor-mui-1Pi3BFuh.js";import{a as B,u as E,P as F,n as u,a3 as R,a4 as q,a5 as M}from"./index-BxBYWNob.js";import{a as c,L as N}from"./vendor-react-CrXZvyk_.js";import{u as z,d as H}from"./vendor-redux-Bi3kFs4E.js";import{N as O}from"./NavHeader-D3CJrNLB.js";import{A as W}from"./AddShoppingCart-CyfdNo2b.js";import{D as G}from"./DeleteOutline-BNBWEv9m.js";import"./vendor-utils-Bdq6QFHX.js";import"./vendor-form-Df9-JY-v.js";import"./Home-CMDHSwXo.js";const te=()=>{const A=z(),{cart:n}=H(t=>t.cart),[v,C]=c.useState(!1),{showMessage:p,startProgress:I,completeProgress:S}=B(),[D,j]=c.useState(null),[P,w]=c.useState(!1),{t:r}=E();async function g(){try{I();const t=await R();if(t&&!t.error){const{data:s}=t;A(q(s))}else p("error",r("An error occurred, please try later"))}catch{p("error",r("An error occurred, please try later"))}finally{S(),w(!0)}}async function T(t){try{j(t);const s=await M(t);if(s&&!s.error){const{id:d}=s;d&&await g()}else p("error",r("An error occurred, please try later"))}catch{p("error",r("An error occurred, please try later"))}finally{j(null)}}return c.useEffect(()=>{if(Array.isArray(n)&&n?.length){let t=n.reduce((s,d)=>{const{memberships:x,quantity:h}=d,{regular_price:m,loyalties:l}=x;let a=0,o=m*h,i=null;if(Array.isArray(l)&&l?.length&&(i=l[0]),i){const y=i?.pivot?.discount_percent;a=o*parseInt(y)/100,o-=a}return s+o},0);C(t)}},[n]),c.useEffect(()=>{g()},[]),P?e.jsx("div",{children:Array.isArray(n)&&n?.length?e.jsxs(c.Fragment,{children:[e.jsxs(f,{children:[e.jsx(O,{title:r("Cart"),breadcrumb:[{title:r("Cart")}]}),e.jsx("div",{className:"",children:n.map(t=>{const{memberships:s,quantity:d}=t,{id:x,title:h,regular_price:m,loyalties:l}=s;let a=null;Array.isArray(l)&&l?.length&&(a=l[0]);let o=0,i=m*d;if(a){const y=a?.pivot?.discount_percent;o=i*parseInt(y)/100,i-=o}return e.jsxs(L,{className:"p-6 space-y-2 border mb-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:[r(h)," ",e.jsxs("span",{className:"text-gray-600",children:["x ",d]})]})}),e.jsx(_,{loading:D==x,onClick:()=>T(x),children:e.jsx(G,{})})]}),e.jsx("div",{className:"text-xl font-semibold text-gray-800",children:m?u(m)+"₫":"-"}),a?e.jsx(c.Fragment,{children:e.jsxs("div",{className:"text-sm text-red-500",children:["-",u(o)+"₫"," ",e.jsxs("span",{className:"text-gray-600",children:["(",a?.title,")"]})]})}):"",e.jsx("hr",{className:"border-gray-300"}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-xl font-semibold",children:[r("Subtotal"),":"]}),e.jsxs("span",{className:"text-xl font-bold",children:[u(i),"₫"]})]})]},x)})})]}),e.jsx(f,{className:"flex justify-end text-center py-3",children:e.jsxs("div",{children:[e.jsxs("div",{className:"text-xl mb-5",children:[e.jsxs("strong",{className:"mr-2",children:[r("Total"),":"]}),u(v),"₫"]}),e.jsx(b,{as:N,to:"/checkout",color:"secondary",sx:{padding:"10px 8px",borderRadius:0,textAlign:"center",letterSpacing:2},variant:"contained",children:r("Proceed to checkout")})]})})]}):e.jsxs(f,{sx:{textAlign:"center",py:3},children:[e.jsx(W,{sx:{width:80,height:80,mb:1}}),e.jsx(k,{sx:{mb:3},children:r("Cart empty")}),e.jsx(N,{to:"/memberships/",children:e.jsx(b,{variant:"contained",color:"secondary",children:r("Return to memberships")})})]})}):e.jsx(F,{height:500})};export{te as default};

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.