1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7445],{12322:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage/organization/customers",function(){return s(4629)}])},63860:function(e,t,s){"use strict";var a=s(85893);t.Z=e=>{let{className:t="h-6 w-6"}=e;return(0,a.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M9.75 20.7501L11.223 21.5684C11.5066 21.726 11.6484 21.8047 11.7986 21.8356C11.9315 21.863 12.0685 21.863 12.2015 21.8356C12.3516 21.8047 12.4934 21.726 12.777 21.5684L14.25 20.7501M5.25 18.2501L3.82297 17.4573C3.52346 17.2909 3.37368 17.2077 3.26463 17.0893C3.16816 16.9847 3.09515 16.8606 3.05048 16.7254C3 16.5726 3 16.4013 3 16.0586V14.5001M3 9.50009V7.94153C3 7.59889 3 7.42757 3.05048 7.27477C3.09515 7.13959 3.16816 7.01551 3.26463 6.91082C3.37368 6.79248 3.52345 6.70928 3.82297 6.54288L5.25 5.75009M9.75 3.25008L11.223 2.43177C11.5066 2.27421 11.6484 2.19543 11.7986 2.16454C11.9315 2.13721 12.0685 2.13721 12.2015 2.16454C12.3516 2.19543 12.4934 2.27421 12.777 2.43177L14.25 3.25008M18.75 5.75008L20.177 6.54288C20.4766 6.70928 20.6263 6.79248 20.7354 6.91082C20.8318 7.01551 20.9049 7.13959 20.9495 7.27477C21 7.42757 21 7.59889 21 7.94153V9.50008M21 14.5001V16.0586C21 16.4013 21 16.5726 20.9495 16.7254C20.9049 16.8606 20.8318 16.9847 20.7354 17.0893C20.6263 17.2077 20.4766 17.2909 20.177 17.4573L18.75 18.2501M9.75 10.7501L12 12.0001M12 12.0001L14.25 10.7501M12 12.0001V14.5001M3 7.00008L5.25 8.25008M18.75 8.25008L21 7.00008M12 19.5001V22.0001",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}},29160:function(e,t,s){"use strict";var a=s(85893);t.Z=e=>{let{className:t="h-3 w-3"}=e;return(0,a.jsx)("svg",{className:t,width:"12",height:12,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}},94070:function(e,t,s){"use strict";var a=s(85893);t.Z=e=>{let{className:t="h-5 w-5"}=e;return(0,a.jsx)("svg",{className:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M17.5 17.5L14.5834 14.5833M16.6667 9.58333C16.6667 13.4954 13.4954 16.6667 9.58333 16.6667C5.67132 16.6667 2.5 13.4954 2.5 9.58333C2.5 5.67132 5.67132 2.5 9.58333 2.5C13.4954 2.5 16.6667 5.67132 16.6667 9.58333Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}},59774:function(e,t,s){"use strict";var a=s(85893),r=s(41664),n=s.n(r),i=s(91354),l=s(9473),d=s(46014),o=s(25675),c=s.n(o);t.Z=e=>{const t=(0,l.I0)();return(0,a.jsx)("div",{className:"sticky top-0 z-[9] border-b border-white-light bg-white",children:(0,a.jsxs)("div",{className:"flex min-h-[50px] items-center justify-between p-4 lg:py-[5px] lg:px-10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 shrink-0",children:[(0,a.jsx)("div",{className:"block lg:hidden",children:(0,a.jsx)(n(),{href:"/manage",className:"inline-flex",children:(0,a.jsx)(c(),{src:"/assets/images/books-cloud-logo.webp",unoptimized:!0,height:35,width:133,alt:"logo"})})}),(0,a.jsx)("ul",{className:"hidden items-center gap-1 lg:flex",children:e.title})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:pl-0 pl-3",children:[e.action,(0,a.jsx)("button",{type:"button",className:"btn block h-10 w-10 p-2 duration-300 lg:hidden",onClick:()=>{t((0,d.GB)())},children:(0,a.jsx)(i.Z,{})})]})]})})}},17510:function(e,t,s){"use strict";var a=s(85893),r=s(81811),n=s(67294);t.Z=e=>{let{meta:t,prevNextPage:s,page:i,goToPage:l,prevNextPage1:d,isDataThere:o=null}=e;
1const[c,u]=(0,n.useState)(100),[m,x]=(0,n.useState)((null===t||void 0===t?void 0:t.current_page)||1);return(0,n.useEffect)((()=>{x(m&&m<1?1:m>(null===t||void 0===t?void 0:t.last_page)?null===t||void 0===t?void 0:t.last_page:m)}),[m,null===t||void 0===t?void 0:t.last_page]),(0,n.useEffect)((()=>{x((null===t||void 0===t?void 0:t.current_page)||1),u((null===t||void 0===t?void 0:t.per_page)||100)}),[t]),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex gap-2 pb-5 sm:items-center",children:[(null===t||void 0===t?void 0:t.last_page)>1&&(0,a.jsxs)("div",{className:"space-x-2",children:[(0,a.jsx)("button",{type:"button",className:"btn",disabled:Number(null===t||void 0===t?void 0:t.current_page)===Number(null===t||void 0===t?void 0:t.first_page),onClick:()=>{d?d(m>1?m-1:1):s(null===t||void 0===t?void 0:t.previous_page_url)},children:"Previous"}),(0,a.jsx)("button",{type:"button",className:"btn",disabled:!1===o||Number(null===t||void 0===t?void 0:t.current_page)===Number(null===t||void 0===t?void 0:t.last_page),onClick:()=>{d?d(m<t.last_page?m+1:t.last_page):s(null===t||void 0===t?void 0:t.next_page_url)},children:"Next"})]}),(0,a.jsxs)("div",{className:"ml-auto flex flex-col items-end gap-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("select",{value:c,className:"form-select ml-auto w-auto",onChange:e=>{u(e.target.value),i(e.target.value)},children:r.Z.perPageOption.map((e=>(0,a.jsx)("option",{value:e,children:e},e)))}),(null===t||void 0===t?void 0:t.last_page)>1&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("input",{type:"number",className:"form-input max-w-[60px] rounded-r-none",value:m,onChange:e=>{"0"!==e.target.value&&x(parseInt(e.target.value))},onKeyDown:e=>{"Enter"===e.key&&l(m)}}),(0,a.jsx)("button",{type:"button",className:"btn rounded-l-none",onClick:()=>l(m),children:"Go"})]})})]})]})})}},4629:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return w}});var a=s(85893),r=s(63860),n=s(29160),i=s(94070),l=s(67294),d=s(59774),o=s(81811),c=s(44104),u=s(17510),m=s(11163),x=s(9008),h=s.n(x),p=s(9473),g=(s(94184),s(4307)),j=s(41664),v=s.n(j);const f=(e,t)=>{const s=(0,l.useRef)(),[r,n]=(0,l.useState)([]),[i,d]=(0,l.useState)([]),[u,m]=(0,l.useState)(!1);(0,l.useImperativeHandle)(t,(()=>({open(){var e;null===s||void 0===s||null===(e=s.current)||void 0===e||e.open(),x(),h()},close(){var e;null===s||void 0===s||null===(e=s.current)||void 0===e||e.close()}})));const x=async()=>{try{m(!0);const{data:t}=await c.Z.get("/organization/orders",{params:{user_id:e.id}});n(t.data)}catch(t){}m(!1)},h=async()=>{try{m(!0);const{data:t}=await c.Z.get("/organization/donation",{params:{user_id:e.id}});d(t.data)}catch(t){}m(!1)};return(0,a.jsx)(g.Z,{ref:s,children:(0,a.jsxs)("div",{className:"flex flex-col gap-y-11 md:h-full",children:[(0,a.jsx)("div",{className:"overflow-x-auto shadow-[0_4px_4px_rgba(0,0,0,0.05)]",children:(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{className:"bg-[#F7F7F7]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Order ID"}),(0,a.jsx)("th",{children:"Organization"}),(0,a.jsx)("th",{children:"Status"})]})}),(0,a.jsx)("tbody",{children:u?(0,a.jsx)("tr",{className:"text-center",children:(0,a.jsx)("td",{colSpan:3,className:"pt-10",children:(0,a.jsx)("span",{className:"dark:border-l-dark m-auto mb-10 inline-block h-10 w-10 animate-spin rounded-full border-4 border-transparent border-l-black-dark"})})}):(0,a.jsx)(a.Fragment,{children:(null===r||void 0===r?void 0:r.length)?null===r||void 0===r?void 0:r.map((e=>{var t;return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"font-semibold",children:(0,a.jsxs)(v(),{href:"/manage/organization/orders/".concat(e.id),className:"text-primary hover:text-black",children:["#",e.unique_id]})}),(0,a.jsx)("td",{children:null===e||void 0===e||null===(t=e.organization)||void 0===t?void 0:t.name}),(0,a.jsx)("td",{children:(0,a.jsx)("span",{className:"status capitalize status-".concat(o.Z.getStatus(e.order_status)),children:o.Z.getStatus(e.order_status)})})]},e.id)})):(0,a.jsx)("tr",{className:"text-center",children:(0,a.jsx)("td",{colSpan:3,className:"py-4",children:"No data found."})})})})]})}),(0,a.jsx)("div",{className:"overflow-x-auto shadow-[0_4px_4px_rgba(0,0,0,0.05)]",children:(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{className:"bg-[#F7F7F7]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Donation ID"}),(0,a.jsx)("th",{children:"Organization"}),(0,a.jsx)("th",{children:"Status"})]})}),(0,a.jsx)("tbody",{children:u?(0,a.jsx)("tr",{className:"text-center",children:(0,a.jsx)("td",{colSpan:3,className:"pt-10",children:(0,a.jsx)("span",{className:"dark:border-l-dark m-auto mb-10 inline-block h-10 w-10 animate-spin rounded-full border-4 border-transparent border-l-black-dark"})})}):(0,a.jsx)(a.Fragment,{children:(null===i||void 0===i?void 0:i.length)?null===i||void 0===i?void 0:i.map((e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"font-semibold",children:(0,a.jsxs)(v(),{href:"/manage/organization/donations?id=".concat(e.id),className:"text-primary hover:text-black",children:["#",e.unique_id]})}),(0,a.jsx)("td",{children:e.organization.name}),(0,a.jsx)("td",{children:(0,a.jsx)("span",{className:"status capitalize status-payment".concat(o.Z.getPaymentStatus(e.payment_status)),children:"Accordingtodonor"===o.Z.getPaymentStatus(e.payment_status)?"According to Donor":o.Z.getPaymentStatus(e.payment_status)})})]},e.id))):(0,a.jsx)("tr",{className:"text-center",children:(0,a.jsx)("td",{colSpan:3,className:"py-4",children:"No data found."})})})})]})})]})})};var N=(0,l.forwardRef)(f),_=s(97712);const b={order_field:"id",order:"desc",order_status:"",per_page:"100",filter:"",page:"1"},y=()=>{const e=(0,l.useRef)(),t=(0,l.useRef)(),s=(0,m.useRouter)(),{user:x}=(0,p.v9)((e=>e.auth)),{id:g}=s.query,[j,v]=(0,l.useState)(g),[f,y]=(0,l.useState)(null),[w,k]=(0,l.useState)([]),[C,Z]=(0,l.useState)(b),[S,L]=(0,l.useState)(!1),[z,F]=(0,l.useState)(""),E=(0,l.useCallback)((async e=>{try{L(!0);const{data:t}=await c.Z.get("/organization/customers",{params:{...C,page:e}});y(t.data),k(t.meta)}catch(t){y([]),k({})}L(!1)}),[C]),M=e=>{C.order_field===e&&"asc"===C.order?Z({...C,order:"desc",order_field:e}):Z({...C,order:"asc",order_field:e})};return(0,l.useEffect)((()=>{E("1")}),[E]),(0,l.useEffect)((()=>{g&&(e.current.open(),s.replace("/manage/organization/customers",void 0,{shallow:!0}))}),[g,s]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h(),{children:(0,a.jsx)("meta",{name:"robots",content:"noindex"})}),(0,a.jsx)(d.Z,{title:(0,a.jsx)("li",{className:"font-semibold text-primary",children:"Customers"}),action:(0,a.jsx)(_.Z,{})}),(0,a.jsxs)("div",{className:"w-screen p-4 md:w-auto lg:p-10 lg:pt-[45px]",children:[(0,a.jsx)("div",{className:"mb-5 text-right",children:(0,a.jsx)("div",{className:"ml-auto md:max-w-[240px]",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",className:"form-input pr-10",placeholder:"Search...",onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Z({...C,filter:e.target.value})}}),(0,a.jsx)("button",{type:"button",className:"absolute top-0 right-0 my-auto inline-flex h-10 w-10 items-center justify-center text-black-dark hover:opacity-70",onClick:()=>Z({...C,filter:z}),children:(0,a.jsx)(i.Z,{})})]})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-5 overflow-x-auto shadow-[0_4px_4px_rgba(0,0,0,0.05)]",children:(0,a.jsxs)("table",{className:S?"opacity-50":"",children:[(0,a.jsx)("thead",{className:"bg-[#F7F7F7]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:(0,a.jsxs)("div",{className:"inline-flex cursor-pointer items-center gap-1 ".concat("first_name"===C.order_field?"text-primary":""),onClick:()=>M("first_name"),children:["Customer Name",(0,a.jsx)(n.Z,{className:"first_name"===C.order_field&&"asc"===C.order?"rotate-180":""})]})}),(0,a.jsx)("th",{children:(0,a.jsxs)("div",{className:"inline-flex cursor-pointer items-center gap-1 ".concat("email"===C.order_field?"text-primary":""),onClick:()=>M("email"),children:["Customer Email",(0,a.jsx)(n.Z,{className:"email"===C.order_field&&"asc"===C.order?"rotate-180":""})]})}),(0,a.jsx)("th",{children:(0,a.jsxs)("div",{className:"inline-flex cursor-pointer items-center gap-1 ".concat("shipping_address_city"===C.order_field?"text-primary":""),onClick:()=>M("shipping_address_city"),children:["Shipping City",(0,a.jsx)(n.Z,{className:"shipping_address_city"===C.order_field&&"asc"===C.order?"rotate-180":""})]})}),(0,a.jsx)("th",{children:(0,a.jsxs)("div",{className:"inline-flex cursor-pointer items-center gap-1 ".concat("shipping_address_state"===C.order_field?"text-primary":""),onClick:()=>M("shipping_address_state"),children:["Shipping State",(0,a.jsx)(n.Z,{className:"shipping_address_state"===C.order_field&&"asc"===C.order?"rotate-180":""})]})}),(0,a.jsx)("th",{children:(0,a.jsxs)("div",{className:"inline-flex cursor-pointer items-center gap-1 ".concat("created_at"===C.order_field?"text-primary":""),onClick:()=>M("created_at"),children:["Date",(0,a.jsx)(n.Z,{className:"created_at"===C.order_field&&"asc"===C.order?"rotate-180":""})]})}),(0,a.jsx)("th",{className:"w-[100px]"})]})}),(0,a.jsx)("tbody",{children:f?(0,a.jsx)(a.Fragment,{children:0!==f.length?f.map((e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"font-semibold",children:e.name?e.name:"-"}),(0,a.jsx)("td",{children:o.Z.isEmpty(e.email)}),(0,a.jsx)("td",{children:o.Z.isEmpty(e.shipping_address_city)}),(0,a.jsx)("td",{children:o.Z.isEmpty(e.shipping_address_state)}),(0,a.jsx)("td",{children:o.Z.getFormattedDate(e.created_at)}),(0,a.jsx)("td",{children:(0,a.jsx)("button",{type:"button",className:"text-black hover:text-primary",onClick:()=>{v(e.id),setTimeout((()=>{t.current.open()}))},children:(0,a.jsx)(r.Z,{})})})]},e.id))):(0,a.jsx)("tr",{className:"text-center",children:(0,a.jsx)("td",{colSpan:6,className:"py-4",children:"No data found."})})}):(0,a.jsx)("tr",{className:"text-center",children:(0,a.jsx)("td",{colSpan:6,className:"pt-10",children:(0,a.jsx)("span",{className:"dark:border-l-dark m-auto mb-10 inline-block h-10 w-10 animate-spin rounded-full border-4 border-transparent border-l-black-dark"})})})})]})}),(0,a.jsx)(u.Z,{meta:w,prevNextPage:async e=>{try{if(L(!0),e){const{data:t}=await c.Z.get("/organization/customers?".concat(e));y(t.data),k(t.meta)}}catch(t){y([]),k({})}L(!1)},page:e=>Z({...C,per_page:e}),goToPage:e=>{E(e)}})]}),(0,a.jsx)(N,{ref:t,id:j})]})]})};var w=y;y.middleware={auth:!0,verify:!0}}},function(e){e.O(0,[9774,2888,179],(function(){return t=12322,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.