PageSourceSearch

https://campuslush.com/_next/static/chunks/pages/admin/events/requests-1eb0a66b3d9e8ee0.js

js campuslush.com collected 2026-10-02 00:16:31 UTC 27,842 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9154],{25188:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/events/requests",function(){return t(97366)}])},97366:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Ce}});var i=t(85893),o=t(31533),r=t(67294),a=t(82132),s=t(28520),l=t.n(s),p=t(51260),d=t(87357),x=t(15861),c=t(2734),u=t(98396),h=t(10315),f=t(96397),g=t(23599),v=t(94932),b=t(8100),m=t(83744),y=t(96486),j=t(11163),F=t(47452),w=t(90896),E=t(86093),S=t(69368),Z=t(47739),C=t(48915),k=t(99981),P=t(23855),D=t(75313),z=t(62864),R=t(98919),W="ready-for-review",O="event-tracker",I="Pending Approval",T="Pending",A={EVENT_LIVE:"Event Live",YOU_APPROVED:"You Approved",EXPIRED:R.Wo.EXPIRED,DENIED:"Denied"},M="No events waiting on your review",L="No events in tracker",B="Review",H="View",_="Ready for review",N="Event tracker",V="Ready for review",U="Event Tracker",q={barBg:"#F1F1F3",text:"#383838",dialogBody:"#5F6375",border:"#E4E6EB",gold:"#FFE733",white:"#FFFFFF",navy:"#23305F"},Y="Clear",G="Cancel",X=function(e){return"".concat(e," selected")},J=function(e){return"Approve ".concat(e)},Q=function(e){return 1===e?"Approve 1 event?":"Approve ".concat(e," events?")},K=function(e){return 1===e?"Approval will be recorded for this event. The organization will be notified as appropriate, and the event will move independently to its next approver. If no approvers remain, it may become published.":"Approval will be recorded for all ".concat(e," selected events. Each organization will be notified as appropriate, and each event will move independently to its next approver. Events with no remaining approvers may become published.")},$=function(e){return(null!==e&&void 0!==e?e:"").trim().toLowerCase()};function ee(e,n){if(n===W)return e.waitingOn||I;var t,i,o=String(null!==(t=e.waitingOn)&&void 0!==t?t:""),r=String(null!==(i=e.eventStatusLabel)&&void 0!==i?i:"");return r===R.Wo.LIVE_SHORT?A.EVENT_LIVE:"EXPIRED"===e.status||"expired"===$(e.eventStatusLabel)||"expired"===$(e.waitingOn)?A.EXPIRED:"REJECTED"===e.status?A.DENIED:e.userEventStatus===z.oT.APPROVED_BY_YOU?A.YOU_APPROVED:e.userEventStatus===z.oT.AWAITING_PREVIOUS_STEP?(0,R.el)(e):o||r||T}function ne(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},i=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),i.forEach((function(n){ne(e,n,t[n])}))}return e}var ie=function(e){try{var n=(0,P.Z)(e);return(0,D.Z)(n,"EEEE, MMMM d, yyyy")}catch(t){return e}},oe=function(e){if(!e)return"-";try{var n=(0,P.Z)(e);return(0,D.Z)(n,"MMM d, yyyy")}catch(t){return e}},re=function(e){var n,t,o=e.event,r=e.variant,a=e.onClick,s=(e.isFirst,e.isLast),l=void 0!==s&&s,p=e.selectable,c=void 0!==p&&p,u=e.selected,h=void 0!==u&&u,f=e.selectionDisabled,g=void 0!==f&&f,v=e.onToggleSelect,b=(null===(n=o.hostOrganizations)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.name)||"-",m=ee(o,r),y=o.createdAt,j=r===W,F=r===O;return(0,i.jsxs)(d.Z,{sx:te({display:"flex",alignItems:"center",justifyContent:"space-between",borderTop:"1px solid #DEDEDE",borderLeft:"1px solid #DEDEDE",borderRight:"1px solid #DEDEDE",padding:"17px",cursor:"pointer",transition:"background-color 0.15s ease","&:hover":{backgroundColor:"#F9F9F9"}},l&&{borderBottom:"1px solid #DEDEDE"}),onClick:a,children:[(0,i.jsxs)(d.Z,{sx:{width:"400px",display:"flex",gap:"16px",alignItems:"center"},children:[c&&(0,i.jsx)(d.Z,{sx:{width:"18px",flexShrink:0,display:"flex",alignItems:"center"},onClick:function(e){return e.stopPropagation()},children:(0,i.jsx)(S.Z,{checked:h,disabled:g,onChange:function(e,n){return null===v||void 0===v?void 0:v(n)},inputProps:{"aria-label":"Select ".concat(o.name)},sx:{p:0,width:18,height:18,color:"#A7A7A7","&.Mui-checked":{color:"#23305F"},"& .MuiSvgIcon-root":{fontSize:"18px"}}})}),(0,i.jsx)(d.Z,{sx:{width:"60px",height:"80px",flexShrink:0,borderRadius:"4px",overflow:"hidden"},children:(0,i.jsx)(C.E,{src:o.flyerImageUrl||"/images/default-event.png",alt:o.name,style:{width:"100%",height:"100%",objectFit:"cover"}})}),(0,i.jsxs)(d.Z,{sx:{flex:1,minWidth:0},children:[(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"16px",fontWeight:500,lineHeight:"24px",color:"#383838",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",whiteSpace:"normal"},children:o.name}),(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"12px",fontWeight:500,lineHeight:"18px",color:"#383838"},children:ie(o.date)})]})]}),(0,i.jsx)(d.Z,{sx:{width:"250px"},children:(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:400,lineHeight:"20px",color:"#383838"},children:b})}),(0,i.jsx)(d.Z,{sx:{width:"150px"},children:(0,i.jsx)(k.O,{label:m,variant:F&&(0,k.D)(o)?"expired":void 0})}),(0,i.jsx)(d.Z,{sx:{width:"129px"},children:(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:400,lineHeight:"21px",color:"#383838"},children:oe(y)})}),(0,i.jsx)(d.Z,{sx:{width:"150px"},children:(0,i.jsx)(Z.Z,{onClick:function(e){e.stopPropagation(),a()}
1,sx:te({width:"150px",height:"47px",borderRadius:"6px",fontFamily:"Poppins",fontSize:"14px",fontWeight:400},j?{backgroundColor:"#FFE733",color:"#23305F","&:hover":{backgroundColor:"#E6CF2E"}}:{backgroundColor:"#FFFFFF",color:"#23305F",border:"1px solid #23305F","&:hover":{backgroundColor:"#F5F5F5"}}),children:j?B:H})})]})},ae=function(){return(0,i.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px"},children:[(0,i.jsx)(d.Z,{sx:{width:"400px",display:"flex",alignItems:"center"},children:(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:600,lineHeight:"16.5px",letterSpacing:"0.275px",textTransform:"uppercase",color:"#383838"},children:"Event"})}),(0,i.jsx)(d.Z,{sx:{width:"250px",display:"flex",alignItems:"center"},children:(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:600,lineHeight:"16.5px",letterSpacing:"0.275px",textTransform:"uppercase",color:"#383838"},children:"Organization"})}),(0,i.jsx)(d.Z,{sx:{width:"150px",display:"flex",alignItems:"center"},children:(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:600,lineHeight:"16.5px",letterSpacing:"0.275px",textTransform:"uppercase",color:"#383838"},children:"Waiting On"})}),(0,i.jsx)(d.Z,{sx:{width:"129px",display:"flex",alignItems:"center"},children:(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:600,lineHeight:"16.5px",letterSpacing:"0.275px",textTransform:"uppercase",color:"#383838"},children:"Created"})}),(0,i.jsx)(d.Z,{sx:{width:"150px",height:"47px"}})]})},se=function(e){var n,t=e.events,o=e.variant,r=e.onRowClick,a=e.isLoading,s=void 0!==a&&a,l=e.selectable,p=void 0!==l&&l,c=e.selectedIds,u=e.selectionDisabled,h=void 0!==u&&u,f=e.onToggleSelect;return s?(0,i.jsxs)(d.Z,{sx:{display:"flex",flexDirection:"column",width:"100%"},children:[(0,i.jsx)(ae,{}),Array.from({length:3}).map((function(e,n){return(0,i.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",borderTop:"1px solid #DEDEDE",borderLeft:"1px solid #DEDEDE",borderRight:"1px solid #DEDEDE",padding:"17px","&:last-child":{borderBottom:"1px solid #DEDEDE"}},children:[(0,i.jsxs)(d.Z,{sx:{width:"400px",display:"flex",gap:"16px",alignItems:"center"},children:[(0,i.jsx)(d.Z,{sx:{width:"60px",height:"80px",backgroundColor:"#F0F0F0",borderRadius:"4px"}}),(0,i.jsxs)(d.Z,{sx:{flex:1},children:[(0,i.jsx)(d.Z,{sx:{width:"200px",height:"24px",backgroundColor:"#F0F0F0",borderRadius:"4px",mb:1}}),(0,i.jsx)(d.Z,{sx:{width:"150px",height:"18px",backgroundColor:"#F0F0F0",borderRadius:"4px"}})]})]}),(0,i.jsx)(d.Z,{sx:{width:"250px"},children:(0,i.jsx)(d.Z,{sx:{width:"150px",height:"20px",backgroundColor:"#F0F0F0",borderRadius:"4px"}})}),(0,i.jsx)(d.Z,{sx:{width:"150px"},children:(0,i.jsx)(d.Z,{sx:{width:"80px",height:"20px",backgroundColor:"#F0F0F0",borderRadius:"4px"}})}),(0,i.jsx)(d.Z,{sx:{width:"129px"},children:(0,i.jsx)(d.Z,{sx:{width:"90px",height:"20px",backgroundColor:"#F0F0F0",borderRadius:"4px"}})}),(0,i.jsx)(d.Z,{sx:{width:"150px"},children:(0,i.jsx)(d.Z,{sx:{width:"150px",height:"47px",backgroundColor:"#F0F0F0",borderRadius:"6px"}})})]},n)}))]}):0===t.length?(0,i.jsxs)(d.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px",border:"1px solid #DEDEDE"},children:[(0,i.jsx)(E.Ee,{src:"/icons/menu/no-events.svg",alt:"No events",width:80,height:80}),(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"16px",fontWeight:500,color:"#383838",marginTop:"16px"},children:o===W?M:L})]}):(0,i.jsxs)(d.Z,{sx:{display:"flex",flexDirection:"column",width:"100%"},children:[(0,i.jsx)(ae,{}),t.map((function(e,a){return(0,i.jsx)(re,{event:e,variant:o,onClick:function(){return r(e)},isFirst:0===a,isLast:a===t.length-1,selectable:p,selected:null!==(n=null===c||void 0===c?void 0:c.has(e.id))&&void 0!==n&&n,selectionDisabled:h,onToggleSelect:function(n){return null===f||void 0===f?void 0:f(e.id,n)}},e.id)}))]})};function le(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},i=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}
1)))),i.forEach((function(n){le(e,n,t[n])}))}return e}var de=function(e){try{var n=(0,P.Z)(e);return(0,D.Z)(n,"EEEE, MMMM d, yyyy")}catch(t){return e}},xe=function(e){var n,t=e.event,o=e.variant,r=e.onClick,a=e.selectable,s=void 0!==a&&a,l=e.selected,p=void 0!==l&&l,c=e.selectionDisabled,u=void 0!==c&&c,h=e.onToggleSelect,f=(null===(n=(0,z.DS)(t.hostOrganizations))||void 0===n?void 0:n.name)||"-",g=ee(t,o),v=o===W,b=o===O;return(0,i.jsxs)(d.Z,{sx:{display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",border:"1px solid #DEDEDE",borderRadius:"8px",padding:"16px",cursor:"pointer",transition:"box-shadow 0.15s ease","&:hover":{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)"}},onClick:r,children:[(0,i.jsxs)(d.Z,{sx:{display:"flex",gap:"16px",marginBottom:"16px"},children:[s&&(0,i.jsx)(d.Z,{sx:{width:"18px",flexShrink:0,display:"flex",alignItems:"center"},onClick:function(e){return e.stopPropagation()},children:(0,i.jsx)(S.Z,{checked:p,disabled:u,onChange:function(e,n){return null===h||void 0===h?void 0:h(n)},inputProps:{"aria-label":"Select ".concat(t.name)},sx:{p:0,width:18,height:18,color:"#A7A7A7","&.Mui-checked":{color:"#23305F"},"& .MuiSvgIcon-root":{fontSize:"18px"}}})}),(0,i.jsx)(d.Z,{sx:{width:"80px",height:"100px",flexShrink:0,borderRadius:"4px",overflow:"hidden"},children:(0,i.jsx)(C.E,{src:t.flyerImageUrl||"/images/default-event.png",alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}})}),(0,i.jsxs)(d.Z,{sx:{flex:1,minWidth:0},children:[(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"16px",fontWeight:500,lineHeight:"24px",color:"#383838",marginBottom:"4px",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:t.name}),(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"12px",fontWeight:500,lineHeight:"18px",color:"#383838"},children:de(t.date)})]})]}),(0,i.jsxs)(d.Z,{sx:{marginBottom:"12px"},children:[(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"12px",fontWeight:600,lineHeight:"16.5px",letterSpacing:"0.275px",textTransform:"uppercase",color:"#383838",marginBottom:"4px"},children:"Organization"}),(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:400,lineHeight:"20px",color:"#383838"},children:f})]}),(0,i.jsxs)(d.Z,{sx:{marginBottom:"16px"},children:[(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"12px",fontWeight:600,lineHeight:"16.5px",letterSpacing:"0.275px",textTransform:"uppercase",color:"#383838",marginBottom:"4px"},children:"Waiting On"}),(0,i.jsx)(k.O,{label:g,variant:b&&(0,k.D)(t)?"expired":void 0})]}),(0,i.jsx)(Z.Z,{onClick:function(e){e.stopPropagation(),r()},sx:pe({width:"100%",height:"47px",borderRadius:"6px",fontFamily:"Poppins",fontSize:"14px",fontWeight:400},v?{backgroundColor:"#FFE733",color:"#23305F","&:hover":{backgroundColor:"#E6CF2E"}}:{backgroundColor:"#FFFFFF",color:"#23305F",border:"1px solid #23305F","&:hover":{backgroundColor:"#F5F5F5"}}),children:v?B:H})]})},ce=q,ue=function(e){var n=e.selectedCount,t=e.disabled,o=void 0!==t&&t,r=e.onClear,a=e.onApprove,s=J(n);return(0,i.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",gap:"12px",pl:"20px",pr:"16px",backgroundColor:ce.barBg,flexWrap:"wrap",rowGap:"8px",minHeight:"56px",height:{xs:"auto",md:"56px"},py:{xs:"8px",md:0}},children:[(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins, sans-serif",fontSize:"14px",fontWeight:500,lineHeight:"22px",color:ce.text,whiteSpace:"nowrap"},children:X(n)}),(0,i.jsx)(d.Z,{sx:{flex:"1 0 0",minWidth:"1px"}}),(0,i.jsx)(Z.Z,{disabled:o,onClick:r,sx:{backgroundColor:ce.white,border:"1px solid ".concat(ce.border),borderRadius:"8px",px:"24px",py:"10px",fontFamily:"Poppins, sans-serif",fontSize:"14px",fontWeight:500,lineHeight:"22px",color:ce.text,whiteSpace:"nowrap"},children:Y}),(0,i.jsx)(Z.Z,{disabled:o,onClick:a,"aria-label":s,sx:{backgroundColor:ce.gold,borderRadius:"8px",px:"24px",py:"10px",fontFamily:"Poppins, sans-serif",fontSize:"14px",fontWeight:500,lineHeight:"22px",color:ce.text,whiteSpace:"nowrap"},children:s})]})},he=t(50657),fe=t(98456),ge=q,ve=function(e){var n=e.open,t=e.selectedCount,o=e.isSubmitting,r=void 0!==o&&o,a=e.onCancel,s=e.onConfirm,l=J(t);return(0,i.jsxs)(he.Z,{open:n,onClose:r?void 0:a,maxWidth:!1,PaperProps:{sx:{width:{xs:"320px",md:"400px"},maxWidth:"calc(100% - 40px)",borderRadius:"12px",p:"24px",display:"flex",flexDirection:"column",gap:"8px",boxShadow:"0px 12px 16px rgba(36, 45, 86, 0.18)",m:"20px"}},children:[(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins, sans-serif",fontSize:"18px",fontWeight:600,lineHeight:"26px",color:ge.text,width:"100%"},children:Q(t)}),(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins, sans-serif",fontSize:"14px",fontWeight:400,lineHeight:"22px",color:ge.dialogBody,width:"100%"},children:K(t)}),(0,i.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",pt:"16px",width:"100%",flexWrap:"wrap"},children:[(0,i.jsx)(Z.Z,{disabled:r,onClick:a,sx:{backgroundColor:ge.white,border:"1px solid ".concat(ge.border),borderRadius:"8px",px:"24px",py:"10px",fontFamily:"Poppins, sans-serif",fontSize:"14px",fontWeight:500,lineHeight:"22px",color:ge.text,whiteSpace:"nowrap"},children:G}),(0,i.jsxs)(Z.Z,{disabled:r,onClick:s,"aria-label":l,"aria-busy":r,sx:{backgroundColor:ge.gold,borderRadius:"8px",px:"24px",py:"10px",fontFamily:"Poppins, sans-serif",fontSize:"14px",fontWeight:500,lineHeight:"22px",color:ge.text,whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"8px",minWidth:r?"146px":void 0},children:[r&&(0,i.jsx)(fe.Z,{size:16,sx:{color:ge.navy}}),l]})]})]})};function be(e,n){return e.map((function(e){var t=n.get(e.eventId)||e.eventId;return"".concat(t,": ").concat(e.reason)})).join("\n")}function me(e,n,t,i,o,r,a){try{var s=e[r](a),l=s.value}catch(p){return void t(p)}s.done?n(l):Promise.resolve(l).then(i,o)}function ye(e){return function(){var n=this,t=arguments;return new Promise((function(i,o){var r=e.apply(n,t);function a(e){me(r,i,o,a,s,"next",e)}function s(e){me(r,i,o,a,s,"throw",e)}a(void 0)}))}}var je=function(e){var n=e.label,t=e.isActive,o=e.onClick;return(0,i.jsx)(d.Z,{component:"button",onClick:o,sx:{padding:"12px 24px",borderRadius:"8px",backgroundColor:t?"#23305F":"transparent",border:t?"none":"1px solid #23305F",color:t?"#FFFFFF":"#23305F",cursor:"pointer",fontFamily:"Poppins",fontSize:"14px",fontWeight:500,transition:"all 0.2s ease","&:hover":{backgroundColor:t?"#1a2447":"#f0f0f0"}},children:n})},Fe=function(e){var n=e.activeTab,t=e.onTabChange;return(0,i.jsxs)(d.Z,{sx:{display:"flex",gap:"8px",marginBottom:"24px"},children:[(0,i.jsx)(je,{label:V,isActive:n===W,onClick:function(){return t(W)}}),(0,i.jsx)(je,{label:U,isActive:n===O,onClick:function(){return t(O)}})]})},we=function(e){var n,t=e.events,o=e.variant,r=e.isLoading,a=e.emptyMessage,s=e.onEventClick,l=e.selectable,p=void 0!==l&&l,c=e.selectedIds,u=e.selectionDisabled,h=void 0!==u&&u,f=e.onToggleSelect;return r?(0,i.jsx)(d.Z,{sx:{display:"flex",flexDirection:"column",gap:"16px"},children:Array.from({length:3}).map((function(e,n){return(0,i.jsx)(d.Z,{sx:{backgroundColor:"#F0F0F0",borderRadius:"8px",height:"200px",animation:"pulse 1.5s ease-in-out infinite","@keyframes pulse":{"0%, 100%":{opacity:1},"50%":{opacity:.5}}}},n)}))}):0===t.length?(0,i.jsx)(d.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 24px",backgroundColor:"#FFFFFF",border:"1px solid #DEDEDE",borderRadius:"8px"},children:(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"16px",fontWeight:500,color:"#383838",textAlign:"center"},children:a})}):(0,i.jsx)(d.Z,{sx:{display:"flex",flexDirection:"column",gap:"16px"},children:t.map((function(e){return(0,i.jsx)(xe,{event:e,variant:o,onClick:function(){return s(e)},selectable:p,selected:null!==(n=null===c||void 0===c?void 0:c.has(e.id))&&void 0!==n&&n,selectionDisabled:h,onToggleSelect:function(n){return null===f||void 0===f?void 0:f(e.id,n)}},e.id)}))})},Ee=function(e){var n=e.title,t=e.subtitle,o=e.rightElement;return(0,i.jsxs)(d.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"16
1px"},children:[(0,i.jsxs)(d.Z,{children:[(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"24px",fontWeight:600,color:"#101828",lineHeight:"31px"},children:n}),t&&(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:400,color:"#101828",lineHeight:"21px"},children:t})]}),o]})},Se=function(e){var n=e.page,t=e.total,o=e.pageSize,r=e.onChangePage;return t<=o?null:(0,i.jsx)(d.Z,{sx:{marginTop:"16px",display:"flex",justifyContent:"flex-end"},children:(0,i.jsx)(v.oL,{page:n,pageSize:o,total:t,onChangePage:r})})},Ze=function(){var e,n,t,a,s;(0,o.QL)();var E=(0,j.useRouter)(),S=(0,c.Z)(),Z=(0,u.Z)(S.breakpoints.down("md")),C=(0,w.Ds)().enqueueSnackbar,k=(0,m.zI)(),P=(0,r.useState)(1),D=P[0],z=P[1],R=(0,r.useState)(new Set),I=R[0],T=R[1],A=(0,r.useState)(!1),B=A[0],H=A[1],V=(0,r.useState)(!1),U=V[0],q=V[1],Y=(0,r.useState)(1),G=Y[0],X=Y[1],J=(0,r.useState)(null),Q=J[0],K=J[1],$=(0,r.useState)("UPCOMING"),ee=$[0],ne=$[1],te=(0,r.useState)(W),ie=te[0],oe=te[1],re=(0,b.ZP)(["/events/event-requests",W,D],ye(l().mark((function e(){var n,t;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,k.listEventsRequests({page:D,pageSize:6,search:null,displayFilter:"NEEDS_APPROVAL"});case 3:if(!(t=e.sent).success){e.next=6;break}return e.abrupt("return",t.value);case 6:if(401!==(null===(n=t.error.response)||void 0===n?void 0:n.status)){e.next=8;break}return e.abrupt("return");case 8:throw new Error;case 9:case"end":return e.stop()}}),e)})))),ae=(0,b.ZP)(["/events/event-requests",O,G,Q,ee],ye(l().mark((function e(){var n,t;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,k.listEventsRequests({page:G,pageSize:6,search:Q,displayFilter:"TRACKER",dateFilter:ee});case 3:if(!(t=e.sent).success){e.next=6;break}return e.abrupt("return",t.value);case 6:if(401!==(null===(n=t.error.response)||void 0===n?void 0:n.status)){e.next=8;break}return e.abrupt("return");case 8:throw new Error;case 9:case"end":return e.stop()}}),e)})))),le=(null===(e=re.data)||void 0===e?void 0:e.events)||[],pe=function(e){return e.size}(I);(0,r.useEffect)((function(){T(new Set),H(!1)}),[D,ie]),(0,r.useEffect)((function(){var e;if(null===(e=re.data)||void 0===e?void 0:e.events){var n=re.data.events.map((function(e){return e.id}));T((function(e){var t=function(e,n){var t=new Set(n),i=new Set,o=!0,r=!1,a=void 0;try{for(var s,l=e[Symbol.iterator]();!(o=(s=l.next()).done);o=!0){var p=s.value;t.has(p)&&i.add(p)}}catch(d){r=!0,a=d}finally{try{o||null==l.return||l.return()}finally{if(r)throw a}}return i}(e,n);if(t.size===e.size){var i=!0,o=!1,r=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done);i=!0){var l=a.value;if(!t.has(l))return t}}catch(p){o=!0,r=p}finally{try{i||null==s.return||s.return()}finally{if(o)throw r}}return e}return t}))}}),[null===(n=re.data)||void 0===n?void 0:n.events]);var de,xe,ce,he=function(e,n){U||T((function(t){return function(e,n,t){var i=new Set(e);return t?i.add(n):i.delete(n),i}(t,e,n)}))},fe=function(){U||(T(new Set),H(!1))},ge=ye(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([re.mutate(),ae.mutate(),(0,b.JG)("/events/event-requests/count")]);case 2:case"end":return e.stop()}}),e)}))),me=ye(l().mark((function e(){var n,t,i,o,r,a,s,p,d,x,c;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!U&&0!==pe){e.next=2;break}return e.abrupt("return");case 2:return n=Array.from(I),t=new Map(le.map((function(e){return[e.id,e.name]}))),q(!0),e.prev=5,e.next=8,k.bulkApproverApproveEvents(n);case 8:if((i=e.sent).success){e.next=13;break}return C(Array.isArray(null===(o=i.error.response)||void 0===o||null===(r=o.data)||void 0===r?void 0:r.message)?i.error.response.data.message.join(", "):(null===(a=i.error.response)||void 0===a||null===(s=a.data)||void 0===s?void 0:s.message)||"Error approving events",{variant:"error"}),e.abrupt("return");case 13:return p=i.value,d=p.succeeded,x=p.failed,c=new Set(d.map((function(e){return e.eventId}))),0===x.length?(H(!1),T(new Set),C(1===d.length?"Event approved successfully":"".concat(d.length," events approved successfully"),{variant:"success"})):0===d.length?(H(!1),C(be(x,t)||"Could not approve the selected events",{variant:"error"})):(H(!1),T((function(e){var n=new Set(e),t=!0,i=!1,o=void 0;try{for(var r,a=c[Symbol.iterator]();!(t=(r=a.next()).done);t=!0){var s=r.value;n.delete(s)}}catch(l){i=!0,o=l}finally{try{t||null==a.return||a.return()}finally{if(i)throw o}}return n})),C("".concat(d.length," approved. ").concat(x.length," could not be approved.\n").concat(be(x,t)),{variant:"error"})),e.next=18,ge();case 18:return e.prev=18,q(!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[5,,18,21]])}))),je=(0,r.useCallback)((0,y.debounce)((function(e){K(e||null),X(1)}),200),[]),Ze=function(e){E.push(F.Z.admin.eventRequest(e.id))};return Z?(0,i.jsxs)(d.Z,{sx:{padding:"16px"},children:[(0,i.jsx)(Fe,{activeTab:ie,onTabChange:oe}),(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"20px",fontWeight:600,color:"#101828",marginBottom:"16
1px"},children:ie===W?_:N}),ie===O&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.Z,{sx:{fontFamily:"Poppins",fontSize:"14px",fontWeight:400,color:"#101828",marginBottom:"16px"},children:"Events where you're part of the approval process"}),(0,i.jsx)(d.Z,{sx:{marginBottom:"12px"},children:(0,i.jsxs)(h.Z,{value:ee,input:(0,i.jsx)(f.ZP,{}),onChange:function(e){ne(e.target.value),X(1)},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{sx:{marginTop:"4px",border:"1px solid #DEDEDE",boxShadow:"none",borderRadius:"8px"}}},sx:{height:"50px",borderRadius:"8px","& .MuiSelect-select":{paddingY:"10px !important",paddingLeft:"12px",border:"1px solid #DEDEDE",height:"50px !important",minWidth:"130px",fontSize:(0,p.b)(13),fontWeight:400,color:"#000000",borderRadius:"8px !important",display:"flex",alignItems:"center",boxSizing:"border-box",backgroundColor:"#F0F0F0"},"& .MuiOutlinedInput-notchedOutline":{border:"none"},"&.Mui-focused .MuiSelect-select":{borderRadius:"8px !important"}},children:[(0,i.jsx)(g.Z,{value:"UPCOMING",sx:{fontSize:(0,p.b)(14),fontWeight:400,color:"#000000",padding:"10px 20px"},children:"Upcoming"}),(0,i.jsx)(g.Z,{value:"PAST",sx:{fontSize:(0,p.b)(14),fontWeight:400,color:"#000000",padding:"10px 20px"},children:"Past"})]})}),(0,i.jsx)(d.Z,{sx:{marginBottom:"16px"},children:(0,i.jsx)(v.oi,{placeholder:"Search by event name",onChange:function(e){return je(e.target.value)},style:{width:"100%",height:"50px",backgroundColor:"#F0F0F0",border:"1px solid #DEDEDE"}})})]}),ie===W?(0,i.jsxs)(i.Fragment,{children:[pe>0&&(0,i.jsx)(d.Z,{sx:{marginBottom:"16px"},children:(0,i.jsx)(ue,{selectedCount:pe,disabled:U,onClear:fe,onApprove:function(){return H(!0)}})}),(0,i.jsx)(we,{events:le,variant:W,isLoading:re.isValidating,emptyMessage:M,onEventClick:Ze,selectable:!0,selectedIds:I,selectionDisabled:U,onToggleSelect:he}),(0,i.jsx)(Se,{page:D,total:(null===(de=re.data)||void 0===de?void 0:de.count)||0,pageSize:6,onChangePage:z}),(0,i.jsx)(ve,{open:B,selectedCount:pe,isSubmitting:U,onCancel:function(){return H(!1)},onConfirm:me})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(we,{events:(null===(xe=ae.data)||void 0===xe?void 0:xe.events)||[],variant:O,isLoading:ae.isValidating,emptyMessage:L,onEventClick:Ze}),(0,i.jsx)(Se,{page:G,total:(null===(ce=ae.data)||void 0===ce?void 0:ce.count)||0,pageSize:6,onChangePage:X})]})]}):(0,i.jsxs)(d.Z,{children:[(0,i.jsxs)(d.Z,{sx:{marginTop:"32px"},children:[(0,i.jsx)(Ee,{title:"Ready for review"}),pe>0&&(0,i.jsx)(d.Z,{sx:{marginBottom:"16px"},children:(0,i.jsx)(ue,{selectedCount:pe,disabled:U,onClear:fe,onApprove:function(){return H(!0)}})}),(0,i.jsx)(se,{events:le,variant:W,onRowClick:Ze,isLoading:re.isValidating,selectable:!0,selectedIds:I,selectionDisabled:U,onToggleSelect:he}),(0,i.jsx)(Se,{page:D,total:(null===(t=re.data)||void 0===t?void 0:t.count)||0,pageSize:6,onChangePage:z}),(0,i.jsx)(ve,{open:B,selectedCount:pe,isSubmitting:U,onCancel:function(){return H(!1)},onConfirm:me})]}),(0,i.jsxs)(d.Z,{sx:{marginTop:"48px"},children:[(0,i.jsx)(Ee,{title:"Event tracker",subtitle:"Events where you're part of the approval process",rightElement:(0,i.jsxs)(d.Z,{display:"flex",alignItems:"center",gap:"8px",children:[(0,i.jsxs)(h.Z,{value:ee,input:(0,i.jsx)(f.ZP,{}),onChange:function(e){ne(e.target.value),X(1)},MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{sx:{marginTop:"4px",border:"1px solid #DEDEDE",boxShadow:"none",borderRadius:"8px"}}},sx:{height:"50px",borderRadius:"8px","& .MuiSelect-select":{paddingY:"10px !important",paddingLeft:"12px",border:"1px solid #DEDEDE",height:"50px !important",minWidth:"130px",fontSize:(0,p.b)(13),fontWeight:400,color:"#000000",borderRadius:"8px !important",display:"flex",alignItems:"center",boxSizing:"border-box",backgroundColor:"#F0F0F0"},"& .MuiOutlinedInput-notchedOutline":{border:"none"},"&.Mui-focused .MuiSelect-select":{borderRadius:"8px !important"}},children:[(0,i.jsx)(g.Z,{value:"UPCOMING",sx:{fontSize:(0,p.b)(14),fontWeight:400,color:"#000000",padding:"10px 20px"},children:"Upcoming"}),(0,i.jsx)(g.Z,{value:"PAST",sx:{fontSize:(0,p.b)(14),fontWeight:400,color:"#000000",padding:"10px 20px"},children:"Past"})]}),(0,i.jsx)(v.oi,{placeholder:"Search by event name",onChange:function(e){return je(e.target.value)},style:{width:"280px",height:"50px",backgroundColor:"#F0F0F0",border:"1px solid #DEDEDE"}})]})}),(0,i.jsx)(se,{events:(null===(a=ae.data)||void 0===a?void 0:a.events)||[],variant:O,onRowClick:Ze,isLoading:ae.isValidating}),(0,i.jsx)(Se,{page:G,total:(null===(s=ae.data)||void 0===s?void 0:s.count)||0,pageSize:6,onChangePage:X})]})]})};function Ce(){return(0,o.QL)(),(0,i.jsx)(a.M0,{title:"Event Requests",active:"event-requests",children:(0,i.jsx)(Ze,{})})}}},function(e){e.O(0,[5675,5573,2896,6872,2132,9774,2888,179],(function(){return n=25188,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
2//# sourceMappingURL=requests-1eb0a66b3d9e8ee0.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.