File manager - Edit - /home/webapp69.cm.in.th/u69319090023/Shop23/_next/static/chunks/3ezrm6b2f55gd.js
Back
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59544,e=>{"use strict";var s=e.i(43476);e.s(["default",0,({children:e,variant:t="primary",size:r="md",isLoading:a=!1,className:l="",disabled:o,...c})=>(0,s.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"}[t]} ${{sm:"text-sm px-4 py-2",md:"text-base px-6 py-3",lg:"text-lg px-8 py-4"}[r]} ${l}`,disabled:o||a,...c,children:[a&&(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.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]})])},6537,e=>{"use strict";let s=(0,e.i(56420).default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["Lock",0,s],6537)},73474,e=>{"use strict";let s=(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,s],73474)},99847,e=>{"use strict";let s=(0,e.i(56420).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,s],99847)},48161,e=>{"use strict";let s=(0,e.i(56420).default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);e.s(["CheckCircle",0,s],48161)},61621,e=>{"use strict";e.s(["LocalStorageAdapter",0,class{async getItem(e){try{let s=localStorage.getItem(e);return s?JSON.parse(s):null}catch(s){return console.error(`Error reading key "${e}" from LocalStorage:`,s),null}}async setItem(e,s){try{localStorage.setItem(e,JSON.stringify(s))}catch(s){console.error(`Error writing key "${e}" to LocalStorage:`,s)}}async removeItem(e){try{localStorage.removeItem(e)}catch(s){console.error(`Error removing key "${e}" from LocalStorage:`,s)}}}])},58214,e=>{"use strict";let s=new(e.i(61621)).LocalStorageAdapter,t=new class{storage;constructor(e){this.storage=e}getKey(e){return`ctc_profile_${e}`}async getProfile(e){let s=await this.storage.getItem(this.getKey(e));if(s)return s;let t=await this.storage.getItem("ctc_accounts"),r=t?.find(s=>s.id===e);if(r){let s=r.email.toLowerCase().includes("student")||r.email.toLowerCase().includes("user3"),t={id:r.id,email:r.email,fullName:r.fullName,phone:r.phone||"053-211-048",studentId:r.studentId||("admin"===r.role?"ADM-2819":s?"632012800"+r.id.replace(/\D/g,""):"STF-5481"),role:r.role,isVerified:"approved"===r.status,memberSince:r.date||"01/07/2569"};return await this.saveProfile(e,t),t}return null}async saveProfile(e,s){await this.storage.setItem(this.getKey(e),s)}async deleteProfile(e){await this.storage.removeItem(this.getKey(e))}}(s),r=new class{repository;constructor(e=t){this.repository=e}async getProfile(e){try{let s=await this.repository.getProfile(e);if(!s)return{success:!1,error:{code:"NOT_FOUND",message:"ไม่พบข้อมูลโปรไฟล์ผู้ใช้งาน"}};return{success:!0,data:s}}catch(e){return{success:!1,error:{code:"DATABASE_ERROR",message:e?.message||"ข้อผิดพลาดในระบบฐานข้อมูล"}}}}async updateProfile(e,s){try{if(void 0!==s.fullName&&""===s.fullName.trim())return{success:!1,error:{code:"VALIDATION_ERROR",message:"ชื่อ-นามสกุลไม่สามารถปล่อยว่างได้"}};if(void 0!==s.phone&&!/^(0\d{8,9}|0\d{1,2}-\d{3,4}-\d{3,4})$/.test(s.phone.trim())&&""!==s.phone.trim())return{success:!1,error:{code:"VALIDATION_ERROR",message:"รูปแบบเบอร์โทรศัพท์ไม่ถูกต้อง (เช่น 0812345678 หรือ 081-234-5678)"}};let t=await this.repository.getProfile(e);if(!t)return{success:!1,error:{code:"NOT_FOUND",message:"ไม่พบข้อมูลโปรไฟล์ที่ต้องการแก้ไข"}};let r={...t,...s,id:t.id,email:t.email};await this.repository.saveProfile(e,r);{let s=localStorage.getItem("ctc_user");if(s){let e=JSON.parse(s);e.fullName=r.fullName,e.avatarUrl=r.avatarUrl,localStorage.setItem("ctc_user",JSON.stringify(e)),window.dispatchEvent(new Event("storage"))}let t=localStorage.getItem("ctc_accounts");if(t)try{let s=JSON.parse(t).map(s=>s.id===e?{...s,fullName:r.fullName}:s);localStorage.setItem("ctc_accounts",JSON.stringify(s))}catch(e){console.error("Error updating ctc_accounts:",e)}}return{success:!0,data:r}}catch(e){return{success:!1,error:{code:"DATABASE_ERROR",message:e?.message||"ไม่สามารถอัปเดตข้อมูลโปรไฟล์ได้"}}}}async deleteAccount(e){try{return await this.repository.deleteProfile(e),{success:!0,data:void 0}}catch(e){return{success:!1,error:{code:"DATABASE_ERROR",message:e?.message||"ไม่สามารถลบบัญชีผู้ใช้งานจากระบบได้"}}}}};e.s(["default",0,r],58214)},70812,e=>{"use strict";let s=(0,e.i(56420).default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);e.s(["Bell",0,s],70812)},53138,e=>{"use strict";let s=(0,e.i(56420).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,s],53138)},41626,e=>{"use strict";var s=e.i(43476),t=e.i(71645),r=e.i(6537),a=e.i(70812),l=e.i(73474),o=e.i(67784),c=e.i(53138),n=e.i(63676),i=e.i(48161),d=e.i(99847);let x=(0,e.i(56420).default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var u=e.i(44779),h=e.i(58214),m=e.i(59544);e.s(["default",0,function(){let[e,g]=(0,t.useState)(null),[f,p]=(0,t.useState)(""),[y,b]=(0,t.useState)(""),[w,N]=(0,t.useState)(""),[v,j]=(0,t.useState)(!1),[k,P]=(0,t.useState)(!0),[S,A]=(0,t.useState)(!1),[C,D]=(0,t.useState)(!0),[E,T]=(0,t.useState)("th"),[L,I]=(0,t.useState)(null),[R,O]=(0,t.useState)(!1),[M,_]=(0,t.useState)(""),[B,z]=(0,t.useState)(!1),[$,V]=(0,t.useState)(""),[U,Z]=(0,t.useState)(!1),[q,F]=(0,t.useState)(!1);(0,t.useEffect)(()=>{let e=u.default.getCurrentUser();e&&g(e),T(localStorage.getItem("preferred_language")||"th")},[]);let J=async e=>{(e.preventDefault(),I(null),y&&f&&w)?y!==w?I({message:"รหัสผ่านใหม่และการยืนยันรหัสผ่านไม่ตรงกัน",type:"error"}):y.length<6?I({message:"รหัสผ่านใหม่ต้องมีความยาวอย่างน้อย 6 ตัวอักษร",type:"error"}):(j(!0),setTimeout(()=>{I({message:"เปลี่ยนรหัสผ่านสำเร็จเรียบร้อยแล้ว",type:"success"}),p(""),b(""),N(""),j(!1)},800)):I({message:"กรุณากรอกรหัสผ่านให้ครบถ้วนทุกช่อง",type:"error"})},K=async()=>{if(!e)return;if(V(""),"DELETE"!==M.trim())return void V('กรุณาพิมพ์ข้อความว่า "DELETE" ให้ถูกต้อง');z(!0);let s=await h.default.deleteAccount(e.id);s.success?(u.default.logout(),O(!1),window.location.href="/login?msg=account_deleted"):V(s.error.message),z(!1)},H={th:{title:"ตั้งค่าบัญชี",subtitle:"ปรับเปลี่ยนรหัสผ่านความปลอดภัย สิทธิ์การเข้าถึง และการแจ้งเตือนต่าง ๆ",changePassword:"เปลี่ยนรหัสผ่านความปลอดภัย",currentPassword:"รหัสผ่านปัจจุบัน",currentPasswordPlaceholder:"กรอกรหัสผ่านปัจจุบัน...",newPassword:"รหัสผ่านใหม่",newPasswordPlaceholder:"ป้อนรหัสผ่านใหม่ (6 ตัวอักษรขึ้นไป)...",confirmPassword:"ยืนยันรหัสผ่านใหม่",confirmPasswordPlaceholder:"ป้อนรหัสผ่านใหม่อีกครั้งเพื่อยืนยัน...",changePasswordBtn:"เปลี่ยนรหัสผ่าน",notifications:"การรับการแจ้งเตือน",emailNotif:"รับข้อมูลข่าวสารทางอีเมล",emailNotifDesc:"รับข้อมูลแคมเปญ สินค้า และสิทธิพิเศษทางอีเมลส่วนตัว",smsNotif:"รับรหัสส่งเสริมการขายทาง SMS",smsNotifDesc:"ส่งคูปองและรหัสโปรโมชันความเร็วสูงตรงเข้าเบอร์โทรศัพท์ของคุณ",orderNotif:"รับข้อมูลอัปเดตคำสั่งซื้อ",orderNotifDesc:"ส่งการแจ้งเตือนพัสดุหรือสถานะจัดส่งเมื่อมีการเปลี่ยนแปลง",langTitle:"ภาษา / Language",langDesc:"เลือกภาษาหลักสำหรับแสดงผลข้อมูลของระบบ",dangerZone:"พื้นที่ความปลอดภัยสูง (Danger Zone)",logoutAll:"ออกจากระบบทุกอุปกรณ์",logoutAllDesc:"ล้างสิทธิ์และยกเลิกรหัสเซสชันความปลอดภัยทั้งหมดเพื่อความปลอดภัยสูงสุด",deleteAccount:"ขอยุติการใช้งานและลบบัญชีผู้ใช้",deleteAccountDesc:"การขอลบบัญชีจะทำการลบประวัติ คูปอง และที่อยู่จัดส่งทั้งหมดของคุณออกจากวิทยาลัยโดยถาวร",deleteAccountBtn:"ลบบัญชีผู้ใช้งานถาวร"},en:{title:"Account Settings",subtitle:"Adjust security passwords, access permissions, and notifications.",changePassword:"Change Security Password",currentPassword:"Current Password",currentPasswordPlaceholder:"Enter current password...",newPassword:"New Password",newPasswordPlaceholder:"Enter new password (6 characters or more)...",confirmPassword:"Confirm New Password",confirmPasswordPlaceholder:"Enter new password again to confirm...",changePasswordBtn:"Change Password",notifications:"Notification Preferences",emailNotif:"Receive email updates",emailNotifDesc:"Receive marketing emails, campaigns, and privileges.",smsNotif:"Receive SMS promotion codes",smsNotifDesc:"Send coupons and promo codes directly to your mobile phone.",orderNotif:"Receive order updates",orderNotifDesc:"Send notifications about shipping or status changes.",langTitle:"Language Preferences",langDesc:"Choose display language of the system",dangerZone:"Danger Zone (High Security)",logoutAll:"Log out from all devices",logoutAllDesc:"Revoke all active logins and active security sessions.",deleteAccount:"Terminate use & delete account",deleteAccountDesc:"This will permanently delete your orders history, coupons, and addresses.",deleteAccountBtn:"Delete Account Permanently"}}[E]||{title:"ตั้งค่าบัญชี",subtitle:"ปรับเปลี่ยนรหัสผ่านความปลอดภัย สิทธิ์การเข้าถึง และการแจ้งเตือนต่าง ๆ",changePassword:"เปลี่ยนรหัสผ่านความปลอดภัย",currentPassword:"รหัสผ่านปัจจุบัน",currentPasswordPlaceholder:"กรอกรหัสผ่านปัจจุบัน...",newPassword:"รหัสผ่านใหม่",newPasswordPlaceholder:"ป้อนรหัสผ่านใหม่ (6 ตัวอักษรขึ้นไป)...",confirmPassword:"ยืนยันรหัสผ่านใหม่",confirmPasswordPlaceholder:"ป้อนรหัสผ่านใหม่อีกครั้งเพื่อยืนยัน...",changePasswordBtn:"เปลี่ยนรหัสผ่าน",notifications:"การรับการแจ้งเตือน",emailNotif:"รับข้อมูลข่าวสารทางอีเมล",emailNotifDesc:"รับข้อมูลแคมเปญ สินค้า และสิทธิพิเศษทางอีเมลส่วนตัว",smsNotif:"รับรหัสส่งเสริมการขายทาง SMS",smsNotifDesc:"ส่งคูปองและรหัสโปรโมชันความเร็วสูงตรงเข้าเบอร์โทรศัพท์ของคุณ",orderNotif:"รับข้อมูลอัปเดตคำสั่งซื้อ",orderNotifDesc:"ส่งการแจ้งเตือนพัสดุหรือสถานะจัดส่งเมื่อมีการเปลี่ยนแปลง",langTitle:"ภาษา / Language",langDesc:"เลือกภาษาหลักสำหรับแสดงผลข้อมูลของระบบ",dangerZone:"พื้นที่ความปลอดภัยสูง (Danger Zone)",logoutAll:"ออกจากระบบทุกอุปกรณ์",logoutAllDesc:"ล้างสิทธิ์และยกเลิกรหัสเซสชันความปลอดภัยทั้งหมดเพื่อความปลอดภัยสูงสุด",deleteAccount:"ขอยุติการใช้งานและลบบัญชีผู้ใช้",deleteAccountDesc:"การขอลบบัญชีจะทำการลบประวัติ คูปอง และที่อยู่จัดส่งทั้งหมดของคุณออกจากวิทยาลัยโดยถาวร",deleteAccountBtn:"ลบบัญชีผู้ใช้งานถาวร"};return(0,s.jsxs)("div",{className:"space-y-8 text-left font-prompt",children:[(0,s.jsxs)("div",{className:"border-b border-gray-100 pb-4 select-none",children:[(0,s.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:H.title}),(0,s.jsx)("p",{className:"text-xs text-gray-500 font-light mt-1",children:H.subtitle})]}),L&&(0,s.jsxs)("div",{className:`p-4 rounded-2xl border flex items-start space-x-2.5 text-xs ${"success"===L.type?"bg-emerald-50 text-emerald-700 border-emerald-100":"bg-red-50 text-red-700 border-red-150/40"}`,children:["success"===L.type?(0,s.jsx)(i.CheckCircle,{className:"w-5 h-5 flex-shrink-0 text-emerald-500"}):(0,s.jsx)(d.AlertCircle,{className:"w-5 h-5 flex-shrink-0 text-red-500"}),(0,s.jsx)("span",{className:"font-semibold pt-0.5 leading-normal",children:L.message})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 items-start",children:[(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsxs)("h3",{className:"text-sm font-bold text-gray-800 flex items-center space-x-2 select-none",children:[(0,s.jsx)(r.Lock,{className:"w-4 h-4 text-accent"}),(0,s.jsx)("span",{children:H.changePassword})]}),(0,s.jsxs)("form",{onSubmit:J,className:"bg-white border border-gray-150 p-5 rounded-2xl space-y-4 shadow-3xs",children:[(0,s.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[(0,s.jsx)("label",{htmlFor:"old-password",className:"text-xs font-bold text-gray-700",children:H.currentPassword}),(0,s.jsx)("input",{id:"old-password",type:"password",required:!0,placeholder:H.currentPasswordPlaceholder,value:f,onChange:e=>p(e.target.value),className:"w-full border border-gray-200 rounded-xl py-2 px-3 text-sm focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent text-gray-800"})]}),(0,s.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[(0,s.jsx)("label",{htmlFor:"new-password",className:"text-xs font-bold text-gray-700",children:H.newPassword}),(0,s.jsx)("input",{id:"new-password",type:"password",required:!0,placeholder:H.newPasswordPlaceholder,value:y,onChange:e=>b(e.target.value),className:"w-full border border-gray-200 rounded-xl py-2 px-3 text-sm focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent text-gray-800"})]}),(0,s.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[(0,s.jsx)("label",{htmlFor:"confirm-password",className:"text-xs font-bold text-gray-700",children:H.confirmPassword}),(0,s.jsx)("input",{id:"confirm-password",type:"password",required:!0,placeholder:H.confirmPasswordPlaceholder,value:w,onChange:e=>N(e.target.value),className:"w-full border border-gray-200 rounded-xl py-2 px-3 text-sm focus:outline-none focus:ring-1 focus:ring-accent focus:border-accent text-gray-800"})]}),(0,s.jsx)("div",{className:"pt-2 text-right",children:(0,s.jsx)(m.default,{type:"submit",variant:"primary",isLoading:v,className:"w-full sm:w-auto px-6 py-2.5 text-xs font-bold shadow-md",children:(0,s.jsx)("span",{children:H.changePasswordBtn})})})]})]}),(0,s.jsxs)("section",{className:"space-y-4",children:[(0,s.jsxs)("h3",{className:"text-sm font-bold text-gray-800 flex items-center space-x-2 select-none",children:[(0,s.jsx)("span",{className:"p-1.5 bg-gray-50 rounded-lg text-gray-600",children:(0,s.jsx)(a.Bell,{className:"w-4 h-4 text-accent"})}),(0,s.jsx)("span",{children:H.notifications})]}),(0,s.jsx)("div",{className:"bg-white border border-gray-150 p-5 rounded-2xl space-y-4 shadow-3xs text-left",children:[{id:"email-updates",label:H.emailNotif,desc:H.emailNotifDesc,checked:k,onChange:P},{id:"sms-alerts",label:H.smsNotif,desc:H.smsNotifDesc,checked:S,onChange:A},{id:"order-notifs",label:H.orderNotif,desc:H.orderNotifDesc,checked:C,onChange:D}].map(e=>(0,s.jsxs)("div",{className:"flex items-start justify-between space-x-4 border-b border-gray-50 pb-3 last:border-b-0 last:pb-0",children:[(0,s.jsxs)("div",{className:"space-y-0.5 max-w-[80%]",children:[(0,s.jsx)("span",{className:"text-xs font-bold text-gray-850 block",children:e.label}),(0,s.jsx)("span",{className:"text-[10px] text-gray-400 font-light block leading-normal",children:e.desc})]}),(0,s.jsx)("input",{type:"checkbox",checked:e.checked,onChange:s=>e.onChange(s.target.checked),className:"w-4.5 h-4.5 rounded border-gray-305 text-accent focus:ring-accent cursor-pointer self-center"})]},e.id))}),(0,s.jsxs)("div",{className:"bg-white border border-gray-150 p-5 rounded-2xl shadow-3xs text-left flex items-center justify-between space-x-4",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)("span",{className:"text-xs font-bold text-gray-850 block",children:H.langTitle}),(0,s.jsx)("span",{className:"text-[10px] text-gray-400 font-light block leading-normal",children:H.langDesc})]}),(0,s.jsxs)("select",{value:E,onChange:e=>{let s=e.target.value;T(s),localStorage.setItem("preferred_language",s),window.dispatchEvent(new Event("languageChange")),I({message:"th"===s?"เปลี่ยนการแสดงผลเป็นภาษาไทยสำเร็จ":"Successfully changed display language to English",type:"success"})},className:"bg-gray-50 border border-gray-250 rounded-xl px-3 py-1.5 text-xs font-bold focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer h-9 text-gray-800",children:[(0,s.jsx)("option",{value:"th",children:"🇹🇭 ภาษาไทย (Thai)"}),(0,s.jsx)("option",{value:"en",children:"🇺🇸 English (English)"})]})]})]})]}),(0,s.jsxs)("section",{className:"border border-red-150/40 bg-red-50/10 rounded-2xl p-5 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 border-b border-red-100 pb-3 select-none",children:[(0,s.jsx)(x,{className:"w-5 h-5 text-red-500 flex-shrink-0"}),(0,s.jsx)("h3",{className:"text-sm font-bold text-red-700",children:H.dangerZone})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 py-1.5",children:[(0,s.jsxs)("div",{className:"text-left",children:[(0,s.jsx)("span",{className:"text-xs font-bold text-gray-800 block",children:H.logoutAll}),(0,s.jsx)("span",{className:"text-[10px] text-gray-400 font-light block mt-0.5 leading-normal",children:H.logoutAllDesc})]}),(0,s.jsxs)(m.default,{onClick:()=>Z(!0),variant:"outline",size:"sm",className:"border-red-200 hover:border-red-400 text-red-650 hover:bg-red-50/20 text-xs font-bold rounded-full px-5 py-2.5 flex-shrink-0 self-start sm:self-center",children:[(0,s.jsx)(o.LogOut,{className:"w-3.5 h-3.5 mr-1"}),(0,s.jsx)("span",{children:H.logoutAll})]})]}),(0,s.jsx)("div",{className:"h-[1px] bg-red-100/50"}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 py-1.5",children:[(0,s.jsxs)("div",{className:"text-left",children:[(0,s.jsx)("span",{className:"text-xs font-bold text-gray-800 block",children:H.deleteAccount}),(0,s.jsx)("span",{className:"text-[10px] text-gray-400 font-light block mt-0.5 leading-normal",children:H.deleteAccountDesc})]}),(0,s.jsxs)(m.default,{onClick:()=>O(!0),variant:"danger",size:"sm",className:"bg-red-500 hover:bg-red-650 text-xs font-bold rounded-full px-6 py-2.5 flex-shrink-0 self-start sm:self-center",children:[(0,s.jsx)(l.Trash2,{className:"w-3.5 h-3.5 mr-1"}),(0,s.jsx)("span",{children:H.deleteAccountBtn})]})]})]}),R&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-xs select-none",children:(0,s.jsxs)("div",{className:"bg-white rounded-3xl w-full max-w-md overflow-hidden shadow-2xl flex flex-col border border-gray-100 text-left animate-in fade-in zoom-in-95 duration-200",children:[(0,s.jsxs)("div",{className:"p-5 border-b border-gray-100 flex justify-between items-center bg-red-50/30",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 text-red-650",children:[(0,s.jsx)(c.AlertTriangle,{className:"w-5 h-5 flex-shrink-0 animate-bounce"}),(0,s.jsx)("h3",{className:"text-base font-bold",children:"ยืนยันการลบบัญชีถาวร"})]}),(0,s.jsx)("button",{onClick:()=>O(!1),className:"p-1.5 hover:bg-red-50 text-gray-400 hover:text-gray-700 rounded-full transition-colors cursor-pointer",children:(0,s.jsx)(n.X,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"p-6 space-y-4",children:[$&&(0,s.jsxs)("div",{className:"p-3 bg-red-50 text-red-600 text-xs font-semibold rounded-xl border border-red-100 flex items-center space-x-2",children:[(0,s.jsx)(d.AlertCircle,{className:"w-4.5 h-4.5 flex-shrink-0"}),(0,s.jsx)("span",{children:$})]}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 font-light leading-relaxed",children:["การดำเนินการนี้จะยุติสิทธิ์การใช้งานบัญชีร้านค้า ตารางกิจกรรม และล้างข้อมูลในส่วนการจัดส่งถาวร หากต้องการดำเนินการต่อ กรุณาพิมพ์ข้อความว่า ",(0,s.jsx)("span",{className:"font-bold text-red-600 select-all",children:"DELETE"})," ในช่องด้านล่างเพื่อยืนยัน:"]}),(0,s.jsx)("input",{type:"text",required:!0,placeholder:'กรุณาพิมพ์ "DELETE" เพื่ออนุมัติ...',value:M,onChange:e=>_(e.target.value),className:"w-full border border-gray-200 rounded-xl py-2.5 px-4 text-sm focus:outline-none focus:ring-1 focus:ring-red-500 focus:border-red-500 text-gray-800 font-bold tracking-widest text-center"}),(0,s.jsxs)("div",{className:"pt-2 flex justify-end space-x-3 border-t border-gray-50",children:[(0,s.jsx)(m.default,{onClick:()=>O(!1),variant:"secondary",className:"rounded-full px-5 py-2 text-xs font-bold",children:(0,s.jsx)("span",{children:"ยกเลิก"})}),(0,s.jsx)(m.default,{onClick:K,variant:"danger",isLoading:B,className:"bg-red-500 hover:bg-red-650 rounded-full px-6 py-2 text-xs font-bold shadow-md",children:(0,s.jsx)("span",{children:"ยืนยันการลบถาวร"})})]})]})]})}),U&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-xs select-none",children:(0,s.jsxs)("div",{className:"bg-white rounded-3xl w-full max-w-md overflow-hidden shadow-2xl flex flex-col border border-gray-100 text-left animate-in fade-in zoom-in-95 duration-200",children:[(0,s.jsxs)("div",{className:"p-5 border-b border-gray-100 flex justify-between items-center bg-gray-50/50",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 text-gray-800",children:[(0,s.jsx)(o.LogOut,{className:"w-5 h-5 flex-shrink-0"}),(0,s.jsx)("h3",{className:"text-base font-bold",children:"ออกจากระบบทุกอุปกรณ์"})]}),(0,s.jsx)("button",{onClick:()=>Z(!1),className:"p-1.5 hover:bg-gray-100 text-gray-400 hover:text-gray-700 rounded-full transition-colors cursor-pointer",children:(0,s.jsx)(n.X,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"p-6 space-y-4",children:[(0,s.jsx)("p",{className:"text-xs text-gray-500 font-light leading-relaxed",children:"การดำเนินการนี้จะรีเซ็ตรหัสผ่านความปลอดภัยและล้างข้อมูลเซสชันล็อกอินทั้งหมดที่เชื่อมต่อบัญชีนี้อยู่ (รวมถึงอุปกรณ์นี้) คุณต้องการดำเนินการต่อหรือไม่?"}),(0,s.jsxs)("div",{className:"pt-2 flex justify-end space-x-3 border-t border-gray-50",children:[(0,s.jsx)(m.default,{onClick:()=>Z(!1),variant:"secondary",className:"rounded-full px-5 py-2 text-xs font-bold",children:(0,s.jsx)("span",{children:"ยกเลิก"})}),(0,s.jsx)(m.default,{onClick:()=>{F(!0),setTimeout(()=>{Z(!1),F(!1),alert("ออกจากระบบทุกอุปกรณ์เรียบร้อยแล้ว"),u.default.logout(),window.location.href="/login"},1e3)},variant:"primary",isLoading:q,className:"rounded-full px-6 py-2 text-xs font-bold shadow-md",children:(0,s.jsx)("span",{children:"ยืนยันออกจากระบบ"})})]})]})]})})]})}],41626)}]);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings