PageSourceSearch

https://brainstox-com.vercel.app/_next/static/chunks/pages/dashboard/orders/refund-35ce0273c6fe1560.js

js brainstox-com.vercel.app collected 2026-10-03 06:20:06 UTC 12,146 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9309,5885,3347,8214,8505,6494,2444,9010,922,6590],{96553:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});var s=n(87462),a=n(67294),l=n(82444),r=a.forwardRef(function(e,t){return a.createElement(l.r,(0,s.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 16 16"},e,{ref:t}),a.createElement("path",{d:"M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"}),a.createElement("path",{d:"M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"}))});r.displayName="Eye"},22538:function(e,t,n){"use strict";n.d(t,{y:function(){return r}});var s=n(87462),a=n(67294),l=n(82444),r=a.forwardRef(function(e,t){return a.createElement(l.r,(0,s.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 16 16"},e,{ref:t}),a.createElement("path",{d:"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"}))});r.displayName="XLg"},13404:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/orders/refund",function(){return n(4577)}])},59010:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ImageLoader}});var s=n(85893),a=n(25675),l=n.n(a),r=n(67294);function ImageLoader(e){let{src:t,alt:n,width:a,height:d,quality:o,className:i,style:c,id:u,mouseMove:m,mouseOut:h,click:v,priority:f}=e,[x,_]=(0,r.useState)(t),p="".concat("https://brainstox-com.vercel.app/","/images/placeholder.jpg");return(0,s.jsx)(l(),{src:x,alt:n||t||"",width:a||100,height:d||100,className:i||null,style:c||null,placeholder:a<40?"empty":"blur",blurDataURL:p,id:u||null,onMouseMove:m||null,onMouseOut:h||null,onClick:v||null,quality:o||null,priority:f||void 0,onLoadingComplete:e=>{0===e.naturalWidth&&_(p)},onError:()=>{_(p)}})}},16494:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Table}});var s=n(85893),a=n(5152),l=n.n(a),r=n(67294),d=n(18813),o=n.n(d),filter=e=>{let{filterText:t,onFilter:n,onClear:a,placeholder:l}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("input",{id:"search",type:"text",placeholder:"Filter By ".concat(l||"Name"),"aria-label":"Search Input",className:o().search_bar,value:t,onChange:n}),(0,s.jsx)("button",{type:"button",className:o().search_bar_button,onClick:a,children:"X"})]})};let i=l()(()=>n.e(44).then(n.bind(n,90044)),{loadableGenerated:{webpack:()=>[90044]}});function Table(e){let{data:t,columns:n,searchKey:a,searchPlaceholder:l,buttons:d}=e,[o,c]=(0,r.useState)(""),[u,m]=(0,r.useState)(!1),h=a?t.filter(e=>e[a]&&e[a].toString().toLowerCase().includes(o.toLowerCase())):t,v=(0,r.useMemo)(()=>a?(0,s.jsx)(filter,{onFilter:e=>c(e),onClear:()=>{o&&(m(!u),c(""))},filterText:o,placeholder:l,buttons:d}):null,[o,u]);return(0,s.jsx)("div",{className:"cs_table",children:(0,s.jsx)(i,{columns:n,data:h,pagination:!0,paginationResetDefaultPage:u,subHeader:!0,subHeaderComponent:v,persistTableHead:!0,customStyles:{rows:{style:{minHeight:"70px",fontSize:"14px",fontWeight:500}},headCells:{style:{fontSize:"15px",fontWeight:600}}}})})}},54116:function(e,t,n){"use strict";n.d(t,{Z:function(){return Card}});var s=n(85893);function Card(e){let{title:t,children:n}=e;return(0,s.jsxs)("div",{className:"card mb-5 border-0 shadow",children:[(0,s.jsx)("div",{className:"card-header bg-white py-3 text-center fw-bold",children:t}),(0,s.jsx)("div",{className:"card-body",children:n})]})}},3347:function(e,t,n){"use strict";n.r(t);var s=n(85893),a=n(67294),l=n(83253),r=n.n(l),d=n(47153),o=n.n(d),i=n(22538);r().setAppElement("#__next"),t.default=e=>((0,a.useEffect)(()=>{e.isOpen&&(document.body.style.overflow="hidden"),e.isOpen||(document.body.style.overflow="")},[e.isOpen]),(0,s.jsx)(r(),{isOpen:e.isOpen,onRequestClose:e.handleCloseModal,closeTimeoutMS:400,className:e.small?o().content_small:o().content,overlayClassName:o().overlay,children:(0,s.jsxs)("div",{className:o().body,children:[(0,s.jsx)("button",{className:o().close_button,onClick:e.handleCloseModal,children:(0,s.jsx)(i.y,{width:22,height:22})}),e.children]})}))},18214:function(e,t,n){"use strict";n.r(t);var s=n(85893);t.default=e=>{let{color:t}=e;return(0,s.jsx)(s.Fragment,{})}},42444:function(e,t,n){"use strict";n.r(t);var s=n(85893),a=n(67294),l=n(16976),r=n(75885),d=n(2022),o=n(18214);let i=(0,a.forwardRef)((e,t)=>{let{data:n,error:i,mutate:c}=(0,l.ZP)(e.url?e.url:null,d.gN);return((0,a.useImperativeHandle)(t,()=>({update:()=>{c()}})),(0,a.useEffect)(()=>{n&&n.success&&e.setData(n)},[n]),i)?(0,s.jsx)(r.default,{}):n?n&&!n.success?(0,s.jsx)(r.default,{}):(0,s.jsxs)(s.Fragment,{children:[" ",e.children," "]}):(0,s.jsx)("div",{style:{height:"100vh"},children:(0,s.jsx)(o.default,{})})});t.default=i},75885:function(e,t,n){"use strict";n.r(t);var s=n(85893),a=n(41664),l=n.n(a),r=n(69032),d=n.n(r);t.default=()=>(0,s.jsx)("div",{className:d().body,children:(0,s.jsx)("div",{className:d().body_container,children:(0,s.jsxs)("div",{className:d().ntfnd,children:[(0,s.jsx)("div",{className:d().error,children:(0,s.jsx)("h1",{children:"500"})}),(0,s.jsx)("h2",{children:"Oooops! Internal Server Error."}),(0,s.jsxs)("p",{children:["That is, something went terribly wrong. We suggest you to go back or visit here later",(0,s.jsx)("br",{}),(0,s.jsx)(l(),{href:"/",children:"Return to homepage"})]})]})})})},4577:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return RefundRequest}});var s=n(85893),a=n(67294),l=n(22120),r=n(25617),d=n(16494),o=n(42444),i=n(2022),c=n(59010),u=n(3347),m=n(91444),h=n(54116),v=n(96553);function RefundRequest(){var e,t,n,f,x,_,p,b,j,g,N,y,w,C,S,R;let[E,A]=(0,a.useState)({data:[]}),[k,L]=(0,a.useState)({}),[M,T]=(0,a.useState)({}),[q,O]=(0,a.useState)(null),{t:I,i18n:P}=(0,l.$G)();P.language;let F=(0,r.v9)(e=>e.settings),Z=F.settingsData.currency.symbol,{session:H}=(0,r.v9)(e=>e.localSession),W=(0,a.useRef)(null),z=(0,a.useRef)(null);(0,a.useEffect)(()=>{L((0,i.wn)(H,"order"))},[H]);let D=[{name:I("order id"),selector:e=>e.orderId},{name:I("date"),selector:e=>(0,i.vc)(e.date),sortable:!0,wrap:!0},{name:I("user"),selector:e=>{var t;return null===(t=e.userId)||void 0===t?void 0:t.name}},{name:I("name"),selector:e=>{var t;return null===(t=e.product)||void 0===t?void 0:t.name}},{name:I("amount"),selector:e=>"".concat(Z).concat(e.refundAmount),sortable:!0},{name:I("Status"),selector:e=>(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("span",{className:"badge rounded-pill fs-7 ".concat("Pending"===e.status?"bg-primary":"Approved"===e.status?"bg-success":"bg-danger"),children:e.status})}),sortable:!0},{name:I("action"),selector:e=>(0,s.jsxs)(s.Fragment,{children:["Pending"===e.status&&(0,s.jsx)("div",{className:"btn btn-primary",children:(0,s.jsx)(v.b,{title:"view",width:20,height:20,onClick:()=>T(e)})}),"Pending"!==e.status&&e.note&&(0,s.jsx)("div",{className:"btn btn-sm m-2 bt
1n-info rounded-pill",title:"Note",onClick:()=>O(e.note),children:(0,s.jsx)(v.b,{width:20,height:20})})]})}];async function handleStatusChange(e,t){try{let n=m.toast.loading("Please wait..."),s=await (0,i.VA)("/api/admin/refund",{id:t,status:e,note:z.current.value.trim()});m.toast.update(n,{render:s.success?"Status Updated successfully":"Something Went Wrong",type:s.success?"success":"error",isLoading:!1}),setTimeout(()=>{m.toast.dismiss(n)},1e3),s.success&&(W.current.update(),T({}))}catch(e){console.log(e.message)}}return(0,s.jsxs)(o.default,{url:"/api/admin/refund",setData:A,ref:W,children:[(0,s.jsx)(h.Z,{title:I("Refund request"),children:(0,s.jsx)(d.default,{data:E.data,columns:D,searchKey:""})}),(0,s.jsx)(u.default,{isOpen:!!M._id,handleCloseModal:()=>T({}),children:M._id&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"card mt-2",children:(0,s.jsx)("div",{className:"card-body",children:(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)("div",{className:"col-3 col-sm-2",children:(0,s.jsx)(c.default,{src:null===(n=M.product)||void 0===n?void 0:null===(t=n.id)||void 0===t?void 0:null===(e=t.image[0])||void 0===e?void 0:e.url})}),(0,s.jsxs)("div",{className:"col-9 col-sm-7 text-left",children:[(0,s.jsx)("p",{children:null===(f=M.product)||void 0===f?void 0:f.name}),(0,s.jsxs)("span",{children:[I("Variant"),":"]}),(null===(_=M.product)||void 0===_?void 0:null===(x=_.color)||void 0===x?void 0:x.name)&&(0,s.jsx)("span",{children:null===(b=M.product)||void 0===b?void 0:null===(p=b.color)||void 0===p?void 0:p.name}),(null===(g=M.product)||void 0===g?void 0:null===(j=g.attribute)||void 0===j?void 0:j.name)&&(0,s.jsx)("span",{children:null===(y=M.product)||void 0===y?void 0:null===(N=y.attribute)||void 0===N?void 0:N.name})]}),(0,s.jsxs)("div",{className:"col-4 col-sm-3 text-left d-flex flex-column pl-0 mt-2 mt-sm-0 pl-sm-5",children:[(0,s.jsxs)("span",{children:["QTY : ",M.product.qty]}),(0,s.jsxs)("span",{children:["Price : ",Z,M.product.price]}),(0,s.jsxs)("span",{children:["Tax : ",Z,M.product.tax]}),(0,s.jsxs)("span",{children:["Vat : ",Z,M.product.vat]})]})]})})}),(0,s.jsx)("div",{className:"card mt-3",children:(0,s.jsx)("div",{className:"card-body",children:(0,s.jsxs)("div",{className:"text-center",children:["Total refund amount : ",Z,M.refundAmount]})})}),(0,s.jsx)("div",{className:"card mt-3",children:(0,s.jsx)("div",{className:"card-body",children:(0,s.jsxs)("div",{className:"row",children:[(0,s.jsxs)("div",{className:"col-md-4",children:[I("name"),": ",null===(w=M.userId)||void 0===w?void 0:w.name]}),(0,s.jsxs)("div",{className:"col-md-4",children:[I("email"),": ",null===(C=M.userId)||void 0===C?void 0:C.email]}),(0,s.jsxs)("div",{className:"col-md-4",children:[I("phone"),": ",null===(S=M.userId)||void 0===S?void 0:S.phone]})]})})}),(0,s.jsxs)("div",{className:"my-3",children:[(0,s.jsx)("p",{className:"fw-bold",children:I("Refund reason")}),(0,s.jsx)("p",{children:M.refundReason})]}),(0,s.jsxs)("div",{className:"my-3",children:[(0,s.jsx)("p",{className:"fw-bold",children:I("Attachments")}),(0,s.jsx)("div",{className:"row",children:null===(R=M.attachments)||void 0===R?void 0:R.map((e,t)=>(0,s.jsx)("div",{className:"img-thumbnail",style:{maxWidth:"225px",margin:"5px"},children:(0,s.jsx)(c.default,{src:e.url,width:200,height:200})},t))})]}),(0,s.jsxs)("div",{className:"my-3",children:[(0,s.jsx)("label",{className:"form-label",children:I("note")}),(0,s.jsx)("textarea",{className:"form-control",required:!0,ref:z})]}),(0,s.jsx)("div",{className:"my-5",children:(0,s.jsxs)("div",{className:"btn-group w-100",children:[(0,s.jsx)("button",{className:"btn btn-success",onClick:()=>handleStatusChange("Approved",M._id),children:"Approve"}),(0,s.jsx)("button",{className:"btn btn-danger",onClick:()=>handleStatusChange("Rejected",M._id),children:"Reject"})]})})]})}),(0,s.jsx)(u.default,{isOpen:!!q,small:!0,handleCloseModal:()=>O(null),children:(0,s.jsx)("div",{className:"p-2",children:(0,s.jsx)("p",{children:q})})})]})}RefundRequest.requireAuthAdmin=!0,RefundRequest.dashboard=!0},18813:function(e){e.exports={container:"table_container__TP04p",button:"table_button__ZP8R5",modal_icon:"table_modal_icon__wZblj",danger_button:"table_danger_button__QN6jY",success_button:"table_success_button__G61zr",color_viewer:"table_color_viewer__IY131",search_bar:"table_search_bar__j9gvC",search_bar_button:"table_search_bar_button__domkf"}},47153:function(e){e.exports={overlay:"modal_overlay__6moOc",content:"modal_content__GDifL",content_small:"modal_content_small__HYUHJ",body:"modal_body__W9r94",close_button:"modal_close_button__h1Fqu"}},69032:function(e){e.exports={body:"__403_body__otBK_",body_container:"__403_body_container__ZHJj1",ntfnd:"__403_ntfnd__oD8dB",error:"__403_error__qSaCL"}}},function(e){e.O(0,[6976,503,1664,5675,3253,9774,2888,179],function(){return e(e.s=13404)}),_N_E=e.O()}]);

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.