PageSourceSearch

https://mindthegraph.com/_next/static/chunks/pages/admin/feedbacks-089fd6cbad084f64.js

js mindthegraph.com collected 2026-10-02 02:49:56 UTC 26,785 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[330],{46901:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(63366),o=n(87462),i=n(67294),a=n(63961),s=n(94780),l=n(51025),c=n(90948),u=n(28628),d=n(80560),p=n(98216),f=n(90629),h=n(1588),m=n(34867);function v(e){return(0,m.ZP)("MuiAlert",e)}var g=(0,h.Z)("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),x=n(93946),Z=n(82066),b=n(85893),j=(0,Z.Z)((0,b.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),y=(0,Z.Z)((0,b.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),C=(0,Z.Z)((0,b.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),w=(0,Z.Z)((0,b.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),k=n(34484);const P=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],O=(0,c.ZP)(f.Z,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,p.Z)(n.color||n.severity)}`]]}})((({theme:e})=>{const t="light"===e.palette.mode?l._j:l.$n,n="light"===e.palette.mode?l.$n:l._j;return(0,o.Z)({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter((([,e])=>e.main&&e.light)).map((([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${g.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}}))),...Object.entries(e.palette).filter((([,e])=>e.main&&e.light)).map((([n])=>({props:{colorSeverity:n,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${g.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}}))),...Object.entries(e.palette).filter((([,e])=>e.main&&e.dark)).map((([t])=>({props:{colorSeverity:t,variant:"filled"},style:(0,o.Z)({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${t}FilledColor`],backgroundColor:e.vars.palette.Alert[`${t}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[t].dark:e.palette[t].main,color:e.palette.getContrastText(e.palette[t].main)})})))]})})),S=(0,c.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),A=(0,c.ZP)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),N=(0,c.ZP)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),z={success:(0,b.jsx)(j,{fontSize:"inherit"}),warning:(0,b.jsx)(y,{fontSize:"inherit"}),error:(0,b.jsx)(C,{fontSize:"inherit"}),info:(0,b.jsx)(w,{fontSize:"inherit"})};var E=i.forwardRef((function(e,t){const n=(0,u.i)({props:e,name:"MuiAlert"}),{action:i,children:l,className:c,closeText:f="Close",color:h,components:m={},componentsProps:g={},icon:Z,iconMapping:j=z,onClose:y,role:C="alert",severity:w="success",slotProps:E={},slots:M={},variant:T="standard"}=n,B=(0,r.Z)(n,P),F=(0,o.Z)({},n,{color:h,severity:w,variant:T,colorSeverity:h||w}),D=(e=>{const{variant:t,color:n,severity:r,classes:o}=e,i={root:["root",`color${(0,p.Z)(n||r)}`,`${t}${(0,p.Z)(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return(0,s.Z)(i,v,o)})(F),W={slots:(0,o.Z)({closeButton:m.CloseButton,closeIcon:m.CloseIcon},M),slotProps:(0,o.Z)({},g,E)},[I,L]=(0,d.Z)("closeButton",{elementType:x.Z,externalForwardedProps:W,ownerState:F}),[R,$]=(0,d.Z)("closeIcon",{elementType:k.Z,externalForwardedProps:W,ownerState:F});return(0,b.jsxs)(O,(0,o.Z)({role:C,elevation:0,ownerState:F,className:(0,a.Z)(D.root,c),ref:t},B,{children:[!1!==Z?(0,b.jsx)(S,{ownerState:F,className:D.icon,children:Z||j[w]||z[w]}):null,(0,b.jsx)(A,{ownerState:F,className:D.message,children:l}),null!=i?(0,b.jsx)(N,{ownerState:F,className:D.action,children:i}):null,null==i&&y?(0,b.jsx)(N,{ownerState:F,className:D.action,children:(0,b.jsx)(I,(0,o.Z)({size:"small","aria-label":f,title:f,color:"inherit",onClick:y},L,{children:(0,b.jsx)(R,(0,o.Z)({fontSize:"small"},$))}))}):null]}))}))},80560:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});
1var r=n(87462),o=n(63366),i=n(33703),a=n(86542),s=n(65610),l=n(65220);const c=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],u=["component","slots","slotProps"],d=["component"];function p(e,t){const{className:n,elementType:p,ownerState:f,externalForwardedProps:h,getSlotOwnerState:m,internalForwardedProps:v}=t,g=(0,o.Z)(t,c),{component:x,slots:Z={[e]:void 0},slotProps:b={[e]:void 0}}=h,j=(0,o.Z)(h,u),y=Z[e]||p,C=(0,s.Z)(b[e],f),w=(0,l.Z)((0,r.Z)({className:n},g,{externalForwardedProps:"root"===e?j:void 0,externalSlotProps:C})),{props:{component:k},internalRef:P}=w,O=(0,o.Z)(w.props,d),S=(0,i.Z)(P,null==C?void 0:C.ref,t.ref),A=m?m(O):{},N=(0,r.Z)({},f,A),z="root"===e?k||x:k,E=(0,a.Z)(y,(0,r.Z)({},"root"===e&&!x&&!Z[e]&&v,"root"!==e&&!Z[e]&&v,O,z&&{as:z},{ref:S}),N);return Object.keys(A).forEach((e=>{delete E[e]})),[y,E]}},49041:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(86010),o=(n(67294),n(64666)),i=n(93946),a=n(37645),s=n(15861),l=n(6514),c=n(98456),u=n(95537),d=n(26925),p=(0,n(45522).Z)((function(e){return{paper:{padding:e.spacing(2,0),paddingTop:e.spacing(6),textAlign:"center","&.MuiDialog-paperWidthMd":{maxWidth:"960px"}},height:{padding:e.spacing(2,0),height:"100%",maxHeight:611,borderRadius:17},icon:{display:"block",height:100,maxWidth:"100%",margin:"0 auto"},title:{color:"#D6246E",fontSize:24},content:{paddingTop:e.spacing(2),paddingBottom:e.spacing(2)},actions:{padding:e.spacing(2,3),"& button":{margin:e.spacing(0,1)}},closeButton:{position:"absolute",top:e.spacing(1),right:e.spacing(1)}}})),f=n(85893);function h(e){var t=e.classes,n=e.open,h=e.size,m=e.fullWidth,v=e.icon,g=e.iconPlacement,x=e.fill,Z=e.title,b=e.subtitle,j=e.content,y=e.actionText,C=e.cancelText,w=e.actionButton,k=e.cancelButton,P=e.disableActionButton,O=e.disableCancelButton,S=e.onActionClick,A=e.onClose,N=e.isLoading,z=e.variant,E=e.header,M=p();return(0,f.jsxs)(o.Z,{classes:{paper:(0,r.default)(M.paper,t.paper,"height"===z&&M.height)},maxWidth:h,fullWidth:m||!0,open:n,onClose:A,children:[(0,f.jsx)("div",{className:(0,r.default)(M.closeButton,t.closeButton),children:(0,f.jsx)(i.Z,{onClick:A,size:"large","aria-label":"Close",children:(0,f.jsx)(u.Z,{fontSize:"small"})})}),v&&"top"===g&&(0,f.jsx)("img",{className:(0,r.default)(M.icon,t.icon),src:v,alt:"Icon"}),E&&(0,f.jsx)(a.Z,{children:E}),Z&&(0,f.jsxs)(a.Z,{className:M.title,children:[(0,f.jsx)(s.Z,{variant:"h5",component:"p",gutterBottom:!!b,children:Z}),b&&(0,f.jsx)(s.Z,{variant:"h6",component:"p",children:b})," "]}),v&&"middle"===g&&(0,f.jsx)("img",{className:(0,r.default)(M.icon,t.icon),src:v,alt:"Icon"}),j&&(0,f.jsx)(l.Z,{className:(0,r.default)(M.content,t.content,x&&M.contentFill),children:j}),!x&&(0,f.jsxs)("div",{className:M.actions,children:[k&&(0,f.jsx)(d.Z,{variant:"outlined",disabled:O,onClick:A,children:C}),w&&(0,f.jsx)(d.Z,{disabled:P,onClick:S,children:N?(0,f.jsx)(c.Z,{size:24,color:"inherit"}):y})]})]})}h.defaultProps={classes:{},size:"xs",iconPlacement:"top",cancelText:"Cancel",actionButton:!0,cancelButton:!0}},95854:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});n(67294);var r=n(94253),o=(0,n(45522).Z)((function(e){return{image:{display:"block",position:"relative",width:function(e){switch(e.size){case"big":return 40;case"medium":return 22.5;default:return 20}},cursor:function(e){return e.interactive?"pointer":"auto"},"&:not(:last-child)":{marginRight:function(t){switch(t.size){case"big":return e.spacing(1.5);case"medium":return e.spacing(.75);default:return e.spacing(.5)}}}}}})),i=n(85893);function a(e){var t=e.size,n=e.value,a=e.onChange,s=o({size:t,interactive:!!a});function l(e){return 0===n||e>n?"/images/outlined-star-icon.svg":"/images/star-icon.svg"}return(0,i.jsx)(r.Z,{display:"inline-flex",alignItems:"center",children:[1,2,3,4,5].map((function(e,t){return(0,i.jsx)("img",{className:s.image,src:l(e),alt:"Star icon",onClick:function(){return function(e){a&&a(e===n?0:e)}(e)}},t)}))})}a.defaultProps={size:"small"}},72389:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});n(67294);var r=n(14354),o=n(93946),i=n(46901),a=n(95537),s=n(85893);function l(e){var t=e.open,n=e.message,l=e.severity,c=e.onClose;function u(e,t){"clickaway"!==t&&c()}return(0,s.jsx)(r.Z,{open:void 0!==t?t:!!n,autoHideDuration:6e3,onClose:u,message:n,action:(0,s.jsx)(o.Z,{size:"small",color:"inherit",onClick:u,children:(0,s.jsx)(a.Z,{fontSize:"small"})}),children:!!l&&(0,s.jsx)(i.Z,{severity:l,elevation:6,variant:"filled",icon:!1,onClose:u,children:n})})}},39302:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return G}});var r=n(9008),o=n.n(r),i=n(67294),a=n(94253),s=n(21214),l=n(27831),c=n(50029),u=n(59499),d=n(87794),p=n.n(d),f=n(86010),h=n(15861),m=n(11057),v=n(10633),g=n(8865),x=n(96486),Z=n(50135),b=n(76295),j=n(10910),y=n(49041),C=n(95854),w=n(847),k=n(72389),P=n(45522),O=n(85893);function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?S(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=(0,P.Z)((function(e){return{formHelperText:{textAlign:"right"}}})),z={user:null,score:0,reason:"",institution:""};function E(e){var t=e.open,n=e.onClose,r=N(),o=(0,i.useState)(!1),s=o[0],l=o[1],u=(0,i.useState)([]),d=u[0],f=u[1],m=(0,i.useState)(A({},z)),v=m[0],P=m[1],S=(0,i.useState)([]),E=S[0],M=S[1],T=new g.Z,B=new w.Z,F=new j.Z;function D(){return(D=(0,c.Z)(p().mark((function e(t){var n,r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=14;break}return e.prev=1,e.next=4,F.findAll({email:t});case 4:n=e.sent,r=n.data,f(r.data),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),console.error(e.t0);case 12:e.next=15;break;case 14:f([]);case 15:case"end":return e.stop()}}),e,null,[[1,9]])})))).apply(this,arguments)}function W(e,t){t[e]&&E.includes(e)&&M(E.filter((function(t){return t!==e}))),P(t)}function I(){var e=function(){var e=[];return v.user||e.push("user"),(v.reason.length<2||v.reason.length>255)&&e.push("reason"),e}();return!e.length||(M(e),!1)}function L(){return(L=(0,c.Z)(p().mark((function e(){var t,r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(I()){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,T.create({userId:v.user.id,score:2*v.score,reason:v.reason});case 5:if(v.institution===(null===(t=v.user)||void 0===t||null===(r=t.profile)||void 0===r?void 0:r.institution)){e.
1next=8;break}return e.next=8,B.update(v.user.id,{institution:v.institution});case 8:l(!0),M([]),n(),P(A({},z)),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),console.error(e.t0);case 17:case"end":return e.stop()}}),e,null,[[2,14]])})))).apply(this,arguments)}return(0,i.useEffect)((function(){v.user&&P(A(A({},v),{},{institution:v.user.profile.institution}))}),[v.user]),(0,i.useEffect)((function(){t||(M([]),P(A({},z)))}),[t]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(k.Z,{open:s,message:"Feedback added succesfully!",severity:"success",onClose:function(){return l(!1)},anchorOrigin:{vertical:"bottom",horizontal:"center"}}),(0,O.jsx)(y.Z,{size:"sm",open:t,title:(0,O.jsx)("b",{children:"Add a customer review"}),content:(0,O.jsxs)(a.Z,{px:2,children:[(0,O.jsxs)(a.Z,{mb:3,children:[(0,O.jsx)(h.Z,{align:"left",children:"Email"}),(0,O.jsx)(b.Z,{options:d,getOptionLabel:function(e){return e.profile.name?"".concat(e.profile.name," | ").concat(e.email):e.email},isOptionEqualToValue:function(e,t){return e.id===t.id},filterOptions:function(e){return e},value:v.user,onChange:function(e,t){return W("user",A(A({},v),{},{user:t}))},onInputChange:(0,x.debounce)((function(e,t){!function(e){D.apply(this,arguments)}(t)}),500),renderInput:function(e){return(0,O.jsx)(Z.Z,A(A({},e),{},{fullWidth:!0,variant:"outlined",margin:"dense",error:E.includes("user"),helperText:E.includes("user")?"Please fill this field correctly":void 0}))}}),(0,O.jsxs)(a.Z,{py:1,children:[(0,O.jsx)(h.Z,{align:"left",children:"Institution"}),(0,O.jsx)(Z.Z,{fullWidth:!0,size:"small",variant:"outlined",value:v.institution||"",onChange:function(e){return P(A(A({},v),{},{institution:e.target.value}))}})]}),(0,O.jsxs)(a.Z,{children:[(0,O.jsx)(h.Z,{align:"left",children:"Message"}),(0,O.jsx)(Z.Z,{fullWidth:!0,multiline:!0,variant:"outlined",margin:"dense",error:E.includes("reason"),FormHelperTextProps:{className:E.includes("reason")?void 0:r.formHelperText},inputProps:{minRows:6},value:v.reason,onChange:function(e){var t=e.target.value;return W("reason",A(A({},v),{},{reason:t.slice(0,255)}))}})]})]}),(0,O.jsx)(h.Z,{gutterBottom:!0,children:"Evaluation score"}),(0,O.jsx)(C.Z,{size:"big",value:v.score,onChange:function(e){return W("score",A(A({},v),{},{score:e}))}})]}),actionText:"Add",cancelButton:!1,onActionClick:function(){return L.apply(this,arguments)},onClose:n})]})}var M=n(30381),T=n.n(M),B=n(90629),F=n(86886),D=n(34386),W=n(67720),I=(0,P.Z)((function(e){return{primaryColor:{color:"#7833FF"},root:{marginBottom:e.spacing(2),padding:e.spacing(2),backgroundColor:e.palette.grey[100]},tooltip:{backgroundColor:e.palette.common.black},overflowText:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:18},buttonsColumn:(0,u.Z)({},e.breakpoints.up("md"),{textAlign:"right"}),button:{padding:e.spacing(1.5,3),textTransform:"none",fontWeight:e.typography.fontWeightBold,borderRadius:40},divider:{margin:e.spacing(2,0)}}})),L=n(19852);function R(e){var t,n=e.feedback,r=e.onChange,o=e.onEditClick,i=I(),s=new g.Z,l=null!==(t=n.user)&&void 0!==t&&t.countryCode?(0,L.r3)(n.user.countryCode):null;function d(){return(d=(0,c.Z)(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,s.update(n.id,{approved:t.approved===n.approved?null:t.approved});case 3:r(),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error(e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}return(0,O.jsxs)(B.Z,{className:i.root,elevation:0,variant:"outlined",children:[(0,O.jsxs)(F.ZP,{container:!0,alignItems:"center",children:[(0,O.jsx)(F.ZP,{item:!0,xs:6,md:4,children:(0,O.jsxs)(a.Z,{pr:1,children:[n.user.name&&(0,O.jsx)(D.Z,{classes:{tooltip:i.tooltip},title:n.user.name,placement:"bottom-start",children:(0,O.jsx)(h.Z,{className:i.overflowText,children:(0,O.jsx)("b",{children:n.user.name})})}),(0,O.jsx)(D.Z,{classes:{tooltip:i.tooltip},title:n.user.institution||"",placement:"bottom-start",children:(0,O.jsx)(h.Z,{className:i.overflowText,children:n.user.institution})}),(0,O.jsx)(D.Z,{classes:{tooltip:i.tooltip},title:(null===l||void 0===l?void 0:l.country)||"",placement:"bottom-start",children:(0,O.jsx)(h.Z,{className:i.overflowText,children:null===l||void 0===l?void 0:l.country})})]})}),(0,O.jsxs)(F.ZP,{item:!0,xs:6,md:2,children:[(0,O.jsx)(D.Z,{classes:{tooltip:i.tooltip},title:n.user.email,placement:"bottom-start",children:(0,O.jsx)(h.Z,{children:(0,O.jsx)("b",{children:n.user.email})})}),(0,O.jsx)(h.Z,{variant:"body2",children:T()(n.date).format("DD/MM/YYYY")})]}),(0,O.jsx)(F.ZP,{className:i.buttonsColumn,item:!0,xs:6,md:6,children:(null===n.approved?[{label:"Approve",value:!0},{label:"Disapprove",value:!1}]:n.approved?[{label:"Approved",value:!0},{label:"Disapprove",value:!1}]:[{label:"Approve",value:!0},{label:"Disapproved",value:!1}]).map((function(e,t){return(0,O.jsx)(m.Z,{className:(0,f.default)(i.button,(0,u.Z)({},i.primaryColor,n.approved===e.value)),onClick:function(){return function(e){return d.apply(this,arguments)}({approved:e.value})},children:e.label},t)}))})]}),!!n.reason&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(W.Z,{className:i.divider}),(0,O.jsxs)(h.Z,{children:['"',n.reason,'"']}
1)]}),(0,O.jsx)(W.Z,{className:i.divider}),(0,O.jsxs)(a.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,O.jsx)(a.Z,{children:(0,O.jsx)(C.Z,{size:"medium",value:Math.ceil(Number(n.score)/2)})}),(0,O.jsx)(m.Z,{className:i.button,onClick:o,children:"Edit comment"})]})]})}var $=(0,P.Z)((function(e){return{primaryColor:{color:"#7833FF"},title:{color:"#D6246E"},backButton:{marginTop:e.spacing(1),padding:e.spacing(1.5,3),textTransform:"none",borderRadius:40,backgroundColor:e.palette.common.white,color:"#DC187F"},button:{padding:e.spacing(1.5,3),textTransform:"none",fontWeight:e.typography.fontWeightBold,borderRadius:40,fontSize:18},pagination:{display:"flex",justifyContent:"flex-end",marginTop:e.spacing(4),"& li:not(:first-child, :last-child) button":{color:"#5F29CC"},"& li button.Mui-selected, & li button.Mui-selected:hover":{color:"".concat(e.palette.common.white," !important"),backgroundColor:"#5F29CC"}}}}));function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U={name:"",id:null,score:"",reason:0,institution:""};function V(e){var t=e.open,n=e.onClose,r=e.feedback,o=(0,i.useState)(!1),s=o[0],l=o[1],d=new g.Z,f=new w.Z,m=(0,i.useState)(H({},U)),v=m[0],x=m[1];function b(e){x(H(H({},v),{},(0,u.Z)({},e.target.name,e.target.value)))}function j(){return(j=(0,c.Z)(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,r.score===v.score&&r.reason===v.reason){e.next=4;break}return e.next=4,d.update(t,{score:v.score,reason:v.reason});case 4:if(r.user.institution===v.institution&&r.user.name===v.name){e.next=7;break}return e.next=7,f.update(v.id,{institution:v.institution,name:v.name});case 7:l(!0),n(),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)}return(0,i.useEffect)((function(){x(r?{name:r.user.name,id:r.user.id,score:r.score,reason:r.reason,institution:r.user.institution}:H({},U))}),[r]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(k.Z,{open:s,message:"Feedback updated succesfully!",severity:"success",onClose:function(){return l(!1)},anchorOrigin:{vertical:"bottom",horizontal:"center"}}),(0,O.jsx)(y.Z,{size:"sm",open:t,title:(0,O.jsx)("b",{children:"Edit comment"}),content:(0,O.jsxs)(a.Z,{px:2,children:[(0,O.jsxs)(a.Z,{mb:3,children:[(0,O.jsxs)(a.Z,{children:[(0,O.jsx)(h.Z,{align:"left",children:"Name"}),(0,O.jsx)(Z.Z,{name:"name",fullWidth:!0,size:"small",variant:"outlined",inputProps:{maxLength:255},value:v.name||"",onChange:b})]}),(0,O.jsxs)(a.Z,{py:1,children:[(0,O.jsx)(h.Z,{align:"left",children:"Institution"}),(0,O.jsx)(Z.Z,{name:"institution",fullWidth:!0,size:"small",variant:"outlined",inputProps:{maxLength:255},value:v.institution||"",onChange:b})]}),(0,O.jsxs)(a.Z,{children:[(0,O.jsx)(a.Z,{mb:-1,children:(0,O.jsx)(h.Z,{align:"left",children:"Message"})}),(0,O.jsx)(Z.Z,{name:"reason",fullWidth:!0,multiline:!0,variant:"outlined",margin:"dense",inputProps:{minRows:6,maxLength:255},value:v.reason||"",onChange:b})]})]}),(0,O.jsx)(h.Z,{gutterBottom:!0,children:"Evaluation score"}),(0,O.jsx)(C.Z,{size:"big",value:Math.ceil(Number(v.score)/2),onChange:function(e){return b({target:{name:"score",value:2*e}})}})]}),actionText:"Save",cancelButton:!1,onActionClick:function(){return function(e){return j.apply(this,arguments)}(r.id)},onClose:n})]})}function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var X={page:1,perPage:10,total:0,data:[]};
1function q(){var e=$(),t=(0,i.useState)({approved:void 0}),n=t[0],r=t[1],o=(0,i.useState)(1),s=o[0],l=o[1],d=(0,i.useState)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},X)),x=d[0],Z=d[1],b=(0,i.useState)(!1),j=b[0],y=b[1],C=(0,i.useState)(),w=C[0],k=C[1],P=[{label:"Feedbacks",value:void 0},{label:"Approved",value:!0},{label:"Disapproved",value:!1}],S=new g.Z;function A(e){return N.apply(this,arguments)}function N(){return(N=(0,c.Z)(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,S.findAll({approved:n.approved,orderDirection:"DESC",page:t,perPage:X.perPage});case 3:r=e.sent,Z(r.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function z(){return(z=(0,c.Z)(p().mark((function e(t,n){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n===s){e.next=4;break}return l(n),e.next=4,A(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,i.useEffect)((function(){l(1),A(1)}),[n]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(V,{open:!!w,onClose:function(){k(),A(s)},feedback:w}),(0,O.jsx)(E,{open:j,onClose:function(){A(s),y(!1)}}),(0,O.jsxs)(a.Z,{mb:4,textAlign:"center",children:[(0,O.jsx)(h.Z,{className:e.title,variant:"h4",gutterBottom:!0,children:"Feedback and NPS"}),(0,O.jsx)(m.Z,{className:e.backButton,onClick:function(){return y(!0)},children:"Add a review"})]}),(0,O.jsx)(a.Z,{mb:2,children:P.map((function(t,o){return(0,O.jsx)(m.Z,{className:(0,f.default)(e.button,(0,u.Z)({},e.primaryColor,n.approved===t.value)),onClick:function(){return r({approved:t.value})},children:t.label},o)}))}),x.data.map((function(e,t){return(0,O.jsx)(R,{feedback:e,onEditClick:function(){return k(e)},onChange:function(){return A(s)}},t)})),x.total>X.perPage&&(0,O.jsx)(a.Z,{mt:4,children:(0,O.jsx)(v.Z,{className:e.pagination,page:s,count:Math.ceil(x.total/X.perPage),onChange:function(e,t){return z.apply(this,arguments)}})})]})}var G=(0,n(42403).r)((function(){return(0,O.jsxs)(l.default,{hasPadding:!1,children:[(0,O.jsx)(o(),{children:(0,O.jsx)("title",{children:"Feedbacks - Admin"})}),(0,O.jsx)(a.Z,{bgcolor:"grey.200",children:(0,O.jsx)(s.Z,{maxWidth:"md",children:(0,O.jsx)(a.Z,{pt:8,pb:4,children:(0,O.jsx)(q,{})})})})]})}))},8865:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(92777),o=n(82262),i=n(24128),a=n(17563),s=function(){function e(){(0,r.Z)(this,e)}return(0,o.Z)(e,[{key:"getPlatformStats",value:function(){return i.Z.get("/feedbacks/platform-stats")}},{key:"findAllPublic",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i.Z.get("/feedbacks/public?".concat(a.stringify(e)),{withCredentials:!0})}},{key:"findAll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i.Z.get("/feedbacks?".concat(a.stringify(e)),{withCredentials:!0})}},{key:"create",value:function(e){return i.Z.post("/feedbacks",e,{withCredentials:!0})}},{key:"update",value:function(e,t){return i.Z.put("/feedbacks/".concat(e),t,{withCredentials:!0})}}]),e}()},10910:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(92777),o=n(82262),i=n(24128),a=n(17563),s=function(){function e(){(0,r.Z)(this,e)}return(0,o.Z)(e,[{key:"findAll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i.Z.get("/users?".concat(a.stringify(e)))}},{key:"getExpiredUsersCount",value:function(){return i.Z.get("/users/expired")}},{key:"getCurrentUsersCount",value:function(){return i.Z.get("/users/current")}},{key:"getMonthlyActiveUsersCount",value:function(e,t){return i.Z.get("/users/monthly-active-users/".concat(e,"/").concat(t))}},{key:"getMonthlyNewUsersCount",value:function(e,t){return i.Z.get("/users/monthly-new-users/".concat(e,"/").concat(t))}},{key:"infoById",value:function(e){return i.Z.get("/users/info/".concat(e))}},{key:"generatePassword",value:function(e,t){var n=new URLSearchParams(t).toString();return i.Z.get("/users/generate-password/".concat(e,"?").concat(n))}},{key:"changePlan",value:function(e,t){return i.Z.post("/users/set-subscription-type/".concat(e),{tp_user:t})}},{key:"update",value:function(e,t){return i.Z.patch("/users/".concat(e),t)}},{key:"changeExpirationTimePlan",value:function(e,t){return i.Z.patch("/users/expiration-plan/".concat(e),t)}}]),e}()},3956:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/feedbacks",function(){return n(39302)}])}},function(e){e.O(0,[4885,3662,4789,9043,5464,5675,5522,6269,5928,2395,8760,6886,4030,2893,6502,7918,6295,4354,7381,6015,7911,9249,8299,9774,2888,179],(function(){return t=3956,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
2//# sourceMappingURL=feedbacks-089fd6cbad084f64.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.