File manager - Edit - /home/webapp69.cm.in.th/u69319090023/Shop23/_next/static/chunks/0s2cyc1yg8n9u.js
Back
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59544,e=>{"use strict";var t=e.i(43476);e.s(["default",0,({children:e,variant:s="primary",size:r="md",isLoading:a=!1,className:i="",disabled:l,...n})=>(0,t.jsxs)("button",{className:`inline-flex items-center justify-center font-semibold rounded-full transition-all duration-300 active:scale-95 focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none disabled:active:scale-100 ${{primary:"bg-gradient-to-r from-primary to-secondary text-text-primary hover:from-accent hover:to-highlight shadow-luxury hover:shadow-luxury-glow hover:-translate-y-[2px]",secondary:"bg-white text-primary border border-gray-100 hover:bg-gray-50 shadow-card-soft",outline:"bg-transparent text-white border-2 border-white/20 hover:border-white hover:bg-white/10",glass:"glassmorphism text-white hover:bg-white/15 border border-white/10",danger:"bg-red-600 text-white hover:bg-red-700 shadow-sm"}[s]} ${{sm:"text-sm px-4 py-2",md:"text-base px-6 py-3",lg:"text-lg px-8 py-4"}[r]} ${i}`,disabled:l||a,...n,children:[a&&(0,t.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",fill:"none",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e]})])},39964,e=>{"use strict";var t=e.i(43476);e.s(["default",0,({variant:e="white",children:s,className:r="",...a})=>(0,t.jsx)("div",{className:`${(()=>{switch(e){case"white":return"bg-white rounded-2xl shadow-sm border border-gray-100";case"glass":return"bg-white/80 backdrop-blur-md rounded-2xl shadow-sm border border-white/20";case"glass-dark":return"bg-gray-900/80 backdrop-blur-md rounded-2xl shadow-lg border border-gray-800 text-white";case"outline":return"bg-transparent rounded-2xl border border-gray-200";default:return"bg-white rounded-2xl shadow-sm"}})()} ${r}`,...a,children:s})])},73474,e=>{"use strict";let t=(0,e.i(56420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],73474)},49817,e=>{"use strict";let t=(0,e.i(56420).default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",0,t],49817)},77071,e=>{"use strict";let t=(0,e.i(56420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],77071)},35829,e=>{"use strict";let t=(0,e.i(56420).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,t],35829)},68877,e=>{"use strict";let t=(0,e.i(56420).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",0,t],68877)},99738,e=>{"use strict";let t=(0,e.i(56420).default)("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);e.s(["ShoppingCart",0,t],99738)},16933,e=>{"use strict";let t=(0,e.i(56420).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",0,t])},72328,e=>{"use strict";var t=e.i(71164),s=e.i(38544),r=e.i(71645);e.s(["useReducedMotion",0,function(){t.hasReducedMotionListener.current||(0,s.initPrefersReducedMotion)();let[e]=(0,r.useState)(t.prefersReducedMotion.current);return e}])},5470,e=>{"use strict";var t=e.i(43476),s=e.i(99738),r=e.i(20865),a=e.i(16933),a=a,i=e.i(22016),l=e.i(46932),n=e.i(72328);e.s(["default",0,function({currentStep:e,className:c=""}){let o=(0,n.useReducedMotion)(),d=[{id:1,name:"ตะกร้าสินค้า",icon:s.ShoppingCart,href:"/cart",isClickable:e>1},{id:2,name:"ที่อยู่และการชำระเงิน",icon:r.MapPin,href:"/checkout",isClickable:3===e},{id:3,name:"สั่งซื้อสำเร็จ",icon:a.default,href:"#",isClickable:!1}],x=1===e?0:2===e?.5:1;return(0,t.jsx)("nav",{role:"navigation","aria-label":"Checkout Progress",className:`w-full max-w-xl mx-auto py-2 select-none ${c}`,children:(0,t.jsxs)("div",{className:"relative flex justify-between items-start w-full",children:[(0,t.jsx)("div",{className:"absolute top-7 left-[16.66%] right-[16.66%] h-[3px] bg-gray-200 -translate-y-1/2 z-0 rounded-full","aria-hidden":"true"}),(0,t.jsx)("div",{className:"absolute top-7 left-[16.66%] w-[66.68%] h-[3px] -translate-y-1/2 z-0 rounded-full overflow-hidden","aria-hidden":"true",children:(0,t.jsx)(l.motion.div,{className:"h-full bg-accent origin-left w-full",initial:{scaleX:o?x:0},animate:{scaleX:x},transition:{duration:.3*!o,ease:"easeOut"}})}),d.map(s=>{let r=s.icon,a=e>s.id,n=e===s.id,c=e<s.id,d=(0,t.jsx)(l.motion.div,{className:`rounded-full flex items-center justify-center border-2 transition-all duration-300 shadow-sm ${a?"bg-accent border-accent text-white cursor-pointer":n?"bg-white border-[2.5px] border-accent text-accent ring-4 ring-red-50/80 shadow-lg shadow-accent/10":"bg-white border-2 border-gray-200 text-gray-300"} ${n?"w-14 h-14":"w-12 h-12"} ${a?"hover:bg-highlight hover:border-highlight":""} `,initial:n&&!o?{scale:.9}:{scale:1},animate:{scale:1},whileHover:a&&!o?{scale:1.05}:{},whileTap:a&&!o?{scale:.95}:{},transition:{duration:.25,ease:"easeOut"},children:(0,t.jsx)(r,{className:`${n?"w-6 h-6":"w-5.5 h-5.5"} flex-shrink-0`})}),x=(0,t.jsx)("span",{className:`mt-3 text-sm tracking-wide leading-relaxed font-semibold transition-colors duration-300 block text-center max-w-[120px] sm:max-w-none break-words ${n?"text-gray-900 font-bold":a?"text-accent hover:text-highlight font-medium":"text-gray-400 font-medium"}`,children:s.name}),h="flex-1 flex flex-col items-center z-10 text-center";return s.isClickable?(0,t.jsxs)(i.default,{href:s.href,className:`${h} group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 rounded-lg`,tabIndex:0,"aria-current":n?"step":void 0,children:[(0,t.jsx)("div",{className:"h-14 flex items-center justify-center",children:d}),x]},s.id):(0,t.jsxs)("div",{className:`${h} ${c?"pointer-events-none":""}`,"aria-current":n?"step":void 0,"aria-disabled":!!c||void 0,children:[(0,t.jsx)("div",{className:"h-14 flex items-center justify-center",children:d}),x]},s.id)})]})})}],5470)},15332,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(22016),a=e.i(57688),i=e.i(73474),l=e.i(63448),n=e.i(77071),c=e.i(35829),o=e.i(68877),d=e.i(49817),x=e.i(93123),h=e.i(59544),u=e.i(39964),m=e.i(5470),f=e.i(46932);e.s(["default",0,function(){let{cartItems:e,updateQuantity:p,removeItem:g,cartTotal:b,clearCart:y}=(0,x.default)(),[j,v]=(0,s.useState)(null),[w,N]=(0,s.useState)(!1),k=b>1e3||0===b?0:50,C=b+k;return(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-4 sm:px-6 lg:px-8 pt-[120px] pb-10",children:[e.length>0&&(0,t.jsx)(m.default,{currentStep:1,className:"mb-7"}),(0,t.jsxs)("div",{className:"text-center mb-12",children:[(0,t.jsx)("h1",{className:"text-3xl font-extrabold text-gray-900 tracking-tight",children:"ตะกร้าสินค้า"}),(0,t.jsx)("p",{className:"mt-3 text-sm text-gray-500 font-light max-w-lg mx-auto",children:"ตรวจสอบรายการสินค้าและจำนวนที่คุณประสงค์จะดำเนินการสั่งซื้อ"})]}),e.length>0?(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[(0,t.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,t.jsx)("div",{className:"space-y-3.5",children:e.map(e=>{let s,l;return(0,t.jsx)(u.default,{variant:"white",className:"group p-5 bg-white border border-gray-100 hover:-translate-y-[2px] hover:shadow-md hover:border-accent/10 transition-all duration-300",children:(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4 text-left",children:[(0,t.jsx)("div",{className:"relative w-20 h-20 rounded-xl overflow-hidden bg-gray-50 border border-gray-100 p-2 flex-shrink-0 select-none",children:(0,t.jsx)(a.default,{src:e.product.images[0],alt:e.product.name,fill:!0,className:"object-contain transition-transform duration-300 group-hover:scale-[1.03]"})}),(0,t.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,t.jsx)(r.default,{href:`/products/${e.product.id}`,className:"font-semibold text-sm text-gray-800 hover:text-accent transition-colors duration-250 line-clamp-2",children:e.product.name}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 text-xs text-gray-400",children:[(0,t.jsxs)("span",{children:["ไซส์: ",(0,t.jsx)("span",{className:"font-bold text-gray-600",children:e.selectedSize})]}),(0,t.jsx)("span",{children:"•"}),(0,t.jsxs)("span",{children:["ราคาต่อชิ้น: ",(0,t.jsxs)("span",{className:"font-bold text-accent",children:["฿",e.product.price]})]})]}),0===(l=((s=localStorage.getItem("ctc_products"))?JSON.parse(s):[]).filter(t=>e.product.relatedProductIds?.includes(t.id))).length?null:(0,t.jsxs)("div",{className:"mt-2.5 p-2 bg-emerald-50/50 border border-emerald-100/50 rounded-xl space-y-1.5",children:[(0,t.jsx)("span",{className:"text-[9px] font-bold text-emerald-700 block uppercase tracking-wider flex items-center gap-1",children:"🎁 ของแถมฟรีที่ได้รับ (Free Gift Included)"}),l.map(s=>(0,t.jsxs)("div",{className:"flex items-center space-x-2 text-[10px]",children:[(0,t.jsx)("div",{className:"relative w-5 h-5 rounded border border-emerald-100 bg-white overflow-hidden flex-shrink-0",children:(0,t.jsx)(a.default,{src:s.images[0]||"/u69319090023/Shop23/images/products/placeholder.jpg",alt:s.name,fill:!0,className:"object-contain p-0.5"})}),(0,t.jsx)("span",{className:"font-bold text-gray-600 flex-1 truncate",children:s.name}),(0,t.jsxs)("span",{className:"text-emerald-600 font-extrabold flex-shrink-0",children:["ฟรี (Free) × ",e.quantity]})]},s.id))]})]}),(0,t.jsxs)("div",{className:"flex items-center border border-gray-200 rounded-full p-0.5 bg-gray-50 flex-shrink-0",children:[(0,t.jsx)(f.motion.button,{whileTap:{scale:.95},onClick:()=>p(e.product.id,e.selectedSize,e.quantity-1),className:"p-2 hover:bg-gray-200/80 hover:text-accent rounded-full text-gray-500 transition-all duration-250 ease-out focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 cursor-pointer","aria-label":"Decrease quantity",children:(0,t.jsx)(c.Minus,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("span",{className:"w-8 text-center text-xs font-bold text-gray-800 select-none",children:e.quantity}),(0,t.jsx)(f.motion.button,{whileTap:{scale:.95},onClick:()=>p(e.product.id,e.selectedSize,e.quantity+1),className:"p-2 hover:bg-gray-200/80 hover:text-accent rounded-full text-gray-500 transition-all duration-250 ease-out focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 cursor-pointer","aria-label":"Increase quantity",children:(0,t.jsx)(n.Plus,{className:"w-3.5 h-3.5"})})]}),(0,t.jsxs)("div",{className:"w-24 text-right flex-shrink-0 font-bold text-accent",children:["฿",(e.product.price*e.quantity).toLocaleString()]}),(0,t.jsx)(f.motion.button,{whileHover:{scale:1.05,rotate:2},whileTap:{scale:.95},onClick:()=>v({productId:e.product.id,size:e.selectedSize,productName:e.product.name}),className:"p-2.5 hover:bg-red-50 text-gray-400 hover:text-accent rounded-full transition-colors duration-250 ease-out flex-shrink-0 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",title:"ลบออกจากตะกร้า","aria-label":"Remove item",children:(0,t.jsx)(i.Trash2,{className:"w-4.5 h-4.5"})})]})},`${e.product.id}-${e.selectedSize}`)})}),(0,t.jsxs)("div",{className:"flex justify-between items-center px-2",children:[(0,t.jsx)("button",{onClick:()=>N(!0),className:"text-xs font-semibold text-gray-400 hover:text-red-500 transition-colors duration-250 ease-out cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-1 rounded px-1.5 py-0.5",children:"ล้างรายการทั้งหมดในตะกร้า"}),(0,t.jsxs)(r.default,{href:"/products",className:"text-xs font-semibold text-accent hover:text-highlight transition-all duration-250 ease-out hover:translate-x-0.5 inline-flex items-center gap-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 rounded px-1.5 py-0.5",children:[(0,t.jsx)("span",{children:"ช้อปปิ้งสินค้าต่อ"}),(0,t.jsx)("span",{children:"→"})]})]})]}),(0,t.jsx)("div",{className:"lg:sticky lg:top-28 space-y-6",children:(0,t.jsxs)(u.default,{variant:"white",className:"p-6 bg-white border border-gray-100 flex flex-col text-left space-y-5",children:[(0,t.jsx)("h2",{className:"font-bold text-gray-900 border-b border-gray-150 pb-3",children:"สรุปคำสั่งซื้อ"}),(0,t.jsxs)("div",{className:"space-y-3.5 text-sm text-gray-600 font-light",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center py-1",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"ยอดรวมสินค้า"}),(0,t.jsxs)("span",{className:"font-semibold text-gray-800",children:["฿",b.toLocaleString()]})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center py-1 border-t border-gray-100/80",children:[(0,t.jsx)("span",{className:"text-gray-500",children:"ค่าบริการจัดส่ง"}),0===k?(0,t.jsx)("span",{className:"font-semibold text-emerald-600 text-xs bg-emerald-50 px-2 py-0.5 rounded-md",children:"จัดส่งฟรี"}):(0,t.jsxs)("span",{className:"font-semibold text-gray-800",children:["฿",k]})]}),k>0&&(0,t.jsxs)("p",{className:"text-[10px] text-gray-400 font-light mt-0.5 text-right",children:["* ซื้อสินค้าเพิ่มอีก ฿",(1e3-b).toLocaleString()," เพื่อรับสิทธิ์จัดส่งฟรี!"]})]}),(0,t.jsxs)("div",{className:"border-t border-gray-100 pt-4 flex justify-between font-bold text-gray-900 text-lg",children:[(0,t.jsx)("span",{children:"ยอดชำระสุทธิ"}),(0,t.jsxs)("span",{className:"text-accent",children:["฿",C.toLocaleString()]})]}),(0,t.jsx)(r.default,{href:"/checkout",passHref:!0,className:"w-full pt-4",children:(0,t.jsxs)(h.default,{variant:"primary",className:"w-full py-3.5 flex items-center justify-center space-x-2",children:[(0,t.jsx)("span",{children:"ดำเนินการสั่งซื้อ"}),(0,t.jsx)(o.ArrowRight,{className:"w-4 h-4"})]})})]})})]}):(0,t.jsxs)("div",{className:"bg-white border border-gray-100 p-16 rounded-premium text-center shadow-card-soft max-w-xl mx-auto flex flex-col items-center",children:[(0,t.jsx)("div",{className:"w-16 h-16 rounded-full bg-red-50 flex items-center justify-center text-accent mb-6",children:(0,t.jsx)(l.ShoppingBag,{className:"w-8 h-8"})}),(0,t.jsx)("h2",{className:"text-xl font-bold text-gray-800 mb-1",children:"ยังไม่มีสินค้าในตะกร้าช้อปปิ้งของคุณ"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 font-light mb-8",children:"เลือกสรรเสื้อผ้านักศึกษา เสื้อกิจกรรม และชุดวอร์ดงานจากร้านค้าของเราเพื่อดำเนินการช้อปสินค้า"}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 w-full justify-center",children:[(0,t.jsx)(r.default,{href:"/products",passHref:!0,className:"w-full sm:w-auto",children:(0,t.jsx)(h.default,{variant:"primary",className:"w-full px-8 py-3",children:"ไปหน้าร้านค้า"})}),(0,t.jsx)(r.default,{href:"/",passHref:!0,className:"w-full sm:w-auto",children:(0,t.jsxs)(h.default,{variant:"secondary",className:"w-full px-8 py-3 flex items-center justify-center space-x-2",children:[(0,t.jsx)(d.Home,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"กลับหน้าหลัก"})]})})]})]}),j&&(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60 transition-opacity animate-fade-in",onClick:()=>v(null)}),(0,t.jsxs)("div",{className:"bg-white border border-gray-100 rounded-premium p-6 w-full max-w-sm relative z-10 shadow-luxury text-center space-y-4 animate-scale-up",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-50 text-red-500 flex items-center justify-center mx-auto",children:(0,t.jsx)(i.Trash2,{className:"w-6 h-6"})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-base font-bold text-gray-900",children:"ยืนยันการลบสินค้า?"}),(0,t.jsxs)("p",{className:"text-xs text-gray-500 font-light leading-relaxed",children:["คุณแน่ใจหรือไม่ว่าต้องการลบ ",(0,t.jsxs)("span",{className:"font-semibold text-gray-800",children:['"',j.productName,'" (ไซส์ ',j.size,")"]})," ออกจากตะกร้าสินค้าของคุณ?"]})]}),(0,t.jsxs)("div",{className:"flex space-x-3 pt-2",children:[(0,t.jsx)("button",{onClick:()=>v(null),className:"flex-1 py-2.5 text-xs font-semibold text-gray-500 bg-gray-50 hover:bg-gray-100 border border-gray-200 rounded-full transition-colors cursor-pointer",children:"ยกเลิก"}),(0,t.jsx)("button",{onClick:()=>{g(j.productId,j.size),v(null)},className:"flex-1 py-2.5 text-xs font-semibold text-white bg-red-600 hover:bg-red-700 rounded-full shadow-sm hover:shadow transition-colors cursor-pointer",children:"ยืนยันการลบ"})]})]})]}),w&&(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/60 transition-opacity animate-fade-in",onClick:()=>N(!1)}),(0,t.jsxs)("div",{className:"bg-white border border-gray-100 rounded-premium p-6 w-full max-w-sm relative z-10 shadow-luxury text-center space-y-4 animate-scale-up",children:[(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-50 text-red-500 flex items-center justify-center mx-auto",children:(0,t.jsx)(i.Trash2,{className:"w-6 h-6"})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-base font-bold text-gray-900",children:"ยืนยันการล้างตะกร้า?"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 font-light leading-relaxed",children:"คุณแน่ใจหรือไม่ว่าต้องการลบสินค้าทั้งหมดออกจากตะกร้าของคุณ? การดำเนินการนี้ไม่สามารถยกเลิกได้"})]}),(0,t.jsxs)("div",{className:"flex space-x-3 pt-2",children:[(0,t.jsx)("button",{onClick:()=>N(!1),className:"flex-1 py-2.5 text-xs font-semibold text-gray-500 bg-gray-50 hover:bg-gray-100 border border-gray-200 rounded-full transition-colors cursor-pointer",children:"ยกเลิก"}),(0,t.jsx)("button",{onClick:()=>{y(),N(!1)},className:"flex-1 py-2.5 text-xs font-semibold text-white bg-red-600 hover:bg-red-700 rounded-full shadow-sm hover:shadow transition-colors cursor-pointer",children:"ยืนยันล้างตะกร้า"})]})]})]})]})}])}]);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.29 |
proxy
|
phpinfo
|
Settings