PageSourceSearch

http://pes-empire.emergent.host/static/js/813.1c8a9934.chunk.js

js pes-empire.emergent.host collected 2026-10-03 03:21:46 UTC 6,824 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[813],{813(e,s,t){t.r(s),t.d(s,{default:()=>h});var a=t(2555),l=t(5544),n=t(5043),r=t(6104),d=t(2024),i=t(6405),c=t(8829),o=t(614),x=t(6328),u=t(579);const m=[{v:"pending",l:"\u0642\u064a\u062f \u0627\u0644\u0627\u0646\u062a\u0638\u0627\u0631"},{v:"processing",l:"\u0642\u064a\u062f \u0627\u0644\u0645\u0639\u0627\u0644\u062c\u0629"},{v:"completed",l:"\u0645\u0643\u062a\u0645\u0644"},{v:"rejected",l:"\u0645\u0631\u0641\u0648\u0636"},{v:"cancelled",l:"\u0645\u0644\u063a\u064a"}],p={pending:"bg-yellow-500/15 text-yellow-300",processing:"bg-blue-500/15 text-blue-300",completed:"bg-green-500/15 text-green-300",rejected:"bg-red-500/15 text-red-300",cancelled:"bg-slate-500/15 text-slate-300"};function h(){const e=(0,n.useState)([]),s=(0,l.A)(e,2),t=s[0],h=s[1],f=(0,n.useState)(!0),j=(0,l.A)(f,2),v=j[0],b=j[1],g=(0,n.useState)(null),y=(0,l.A)(g,2),N=y[0],w=y[1],_=(0,n.useState)(!1),A=(0,l.A)(_,2),k=A[0],C=A[1],R=()=>r.Ay.get("/admin/shop/orders").then(e=>h(e.data)).catch(()=>{}).finally(()=>b(!1));(0,n.useEffect)(()=>{R()},[]);return v?(0,u.jsx)("div",{className:"flex justify-center py-16",children:(0,u.jsx)(d.A,{className:"w-7 h-7 animate-spin",style:{color:"var(--pes-primary)"}})}):(0,u.jsxs)("div",{children:[(0,u.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,u.jsx)(i.A,{className:"w-6 h-6",style:{color:"var(--pes-primary)"}}),(0,u.jsxs)("h1",{className:"text-lg font-extrabold",children:["\u0637\u0644\u0628\u0627\u062a \u0627\u0644\u0645\u062a\u062c\u0631 (",t.length,")"]})]}),0===t.length?(0,u.jsx)("div",{className:"text-center py-16 text-slate-500 text-sm",children:"\u0644\u0627 \u062a\u0648\u062c\u062f \u0637\u0644\u0628\u0627\u062a"}):(0,u.jsx)("div",{className:"space-y-2",children:t.map(e=>{var s;return(0,u.jsxs)("button",{onClick:()=>w((0,a.A)({},e)),className:"w-full glass rounded-xl p-3 flex items-center gap-3 text-right tile-press","data-testid":"admin-order-".concat(e.id),children:[(0,u.jsx)("div",{className:"w-12 h-12 rounded-lg bg-black/30 overflow-hidden flex items-center justify-center shrink-0",children:e.product_image?(0,u.jsx)("img",{src:(0,r.iw)(e.product_image),alt:"",className:"w-full h-full object-contain"}):(0,u.jsx)(i.A,{className:"w-5 h-5 text-slate-600"})}),(0,u.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,u.jsx)("div",{className:"text-sm font-bold truncate",children:e.product_name}),(0,u.jsxs)("div",{className:"text-[11px] text-slate-500 truncate",children:[e.user_name||e.user_email," \xb7 #",e.order_no]})]}),(0,u.jsxs)("div",{className:"text-left shrink-0",children:[(0,u.jsxs)("div",{className:"font-num font-black gold-text text-sm",children:[e.points_paid," \u2b50"]}),(0,u.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full font-bold ".concat(p[e.status]),children:null===(s=m.find(s=>s.v===e.status))||void 0===s?void 0:s.l}),e.refunded&&(0,u.jsx)("span",{className:"block text-[9px] text-slate-500 mt-0.5",children:"\u0645\u064f\u0633\u062a\u0631\u062c\u0639"})]})]},e.id)})}),N&&(0,u.jsx)("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/60 p-3 overflow-y-auto","data-testid":"order-modal",onClick:()=>w(null),children:(0,u.jsxs)("div",{className:"glass rounded-2xl p-4 w-full max-w-md 
1space-y-3 my-4",onClick:e=>e.stopPropagation(),children:[(0,u.jsxs)("div",{className:"flex items-center justify-between",children:[(0,u.jsx)("h2",{className:"font-extrabold truncate",children:N.product_name}),(0,u.jsx)("button",{onClick:()=>w(null),className:"p-1.5 rounded-lg glass",children:(0,u.jsx)(o.A,{className:"w-4 h-4"})})]}),(0,u.jsxs)("div",{className:"text-xs text-slate-400",children:["\u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645: ",N.user_name," \u2014 ",N.user_email]}),(0,u.jsxs)("div",{className:"text-xs text-slate-400",children:["\u0631\u0642\u0645 \u0627\u0644\u0637\u0644\u0628: ",(0,u.jsxs)("span",{className:"font-num",children:["#",N.order_no]})," \xb7 \u0627\u0644\u0646\u0642\u0627\u0637: ",(0,u.jsx)("span",{className:"font-num gold-text",children:N.points_paid})]}),(0,u.jsxs)("div",{children:[(0,u.jsx)("label",{className:"text-[11px] text-slate-400",children:"\u0627\u0644\u062d\u0627\u0644\u0629"}),(0,u.jsx)("select",{value:N.status,onChange:e=>w((0,a.A)((0,a.A)({},N),{},{status:e.target.value})),className:"w-full bg-slate-800/60 rounded-xl px-3 py-2.5 text-sm border border-white/10 outline-none","data-testid":"order-status",children:m.map(e=>(0,u.jsx)("option",{value:e.v,children:e.l},e.v))})]}),(0,u.jsx)("textarea",{value:N.delivery_info||"",onChange:e=>w((0,a.A)((0,a.A)({},N),{},{delivery_info:e.target.value})),placeholder:"\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0627\u0644\u062a\u0633\u0644\u064a\u0645 (\u062a\u0638\u0647\u0631 \u0644\u0644\u0645\u0633\u062a\u062e\u062f\u0645)",rows:2,className:"w-full glass rounded-xl px-3 py-2.5 text-sm outline-none border border-white/10","data-testid":"order-delivery"}),(0,u.jsx)("textarea",{value:N.admin_notes||"",onChange:e=>w((0,a.A)((0,a.A)({},N),{},{admin_notes:e.target.value})),placeholder:"\u0645\u0644\u0627\u062d\u0638\u0627\u062a \u062f\u0627\u062e\u0644\u064a\u0629",rows:2,className:"w-full glass rounded-xl px-3 py-2.5 text-sm outline-none border border-white/10"}),(0,u.jsxs)("button",{onClick:async()=>{C(!0);try{await r.Ay.put("/admin/shop/orders/".concat(N.id),{status:N.status,delivery_info:N.delivery_info||"",admin_notes:N.admin_notes||""}),x.oR.success("\u062a\u0645 \u062a\u062d\u062f\u064a\u062b \u0627\u0644\u0637\u0644\u0628"),w(null),R()}catch(e){x.oR.error((0,r.pb)(e))}finally{C(!1)}},disabled:k,className:"w-full py-3 rounded-xl font-bold text-black flex items-center justify-center gap-2 tile-press",style:{background:"var(--pes-primary)"},"data-testid":"save-order-btn",children:[k&&(0,u.jsx)(d.A,{className:"w-4 h-4 animate-spin"})," \u062d\u0641\u0638"]}),!N.refunded&&(0,u.jsxs)("button",{onClick:()=>(async e=>{if(window.confirm("\u0627\u0633\u062a\u0631\u062c\u0627\u0639 ".concat(e.points_paid," \u0646\u0642\u0637\u0629 \u0644\u0644\u0645\u0633\u062a\u062e\u062f\u0645\u061f")))try{const s=await r.Ay.post("/admin/shop/orders/".concat(e.id,"/refund"));x.oR.success("\u062a\u0645 \u0627\u0644\u0627\u0633\u062a\u0631\u062c\u0627\u0639. \u0631\u0635\u064a\u062f \u0627\u0644\u0645\u0633\u062a\u062e\u062f\u0645: ".concat(s.data.points," \u2b50")),w(null),R()}catch(s){x.oR.error((0,r.pb)(s))}})(N),className:"w-full py-2.5 rounded-xl font-bold text-white bg-red-500/80 flex items-center justify-center gap-2 tile-press","data-testid":"refund-order-btn",children:[(0,u.jsx)(c.A,{className:"w-4 h-4"})," \u0627\u0633\u062a\u0631\u062c\u0627\u0639 \u0627\u0644\u0646\u0642\u0627\u0637 (",N.points_paid," \u2b50)"]})]})})]})}}}]);
2//# sourceMappingURL=813.1c8a9934.chunk.js.map

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.