1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fa524f01-538e-4b68-b99c-8b6826f2fff5",e._sentryDebugIdIdentifier="sentry-dbid-fa524f01-538e-4b68-b99c-8b6826f2fff5")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6686],{26976:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/platform-admin/feedback",function(){return n(56998)}])},53645:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},50039:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},88030:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]])},15452:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]])},44976:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},36127:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},23603:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},70088:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(31134).Z)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},56998:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return j}});var i=n(85893),a=n(67294),s=n(33299),l=n(11163),r=n(9008),d=n.n(r),o=n(88689);let c=(0,n(31134).Z)("bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);var p=n(88030),h=n(15452),u=n(36127),f=n(44976),x=n(53645),y=n(50039),g=n(23603),b=n(70088);function j(){let{status:e}=(0,s.useSession)(),t=(0,l.useRouter)(),[n,r]=(0,a.useState)(!1),[j,I]=(0,a.useState)("outreach"),[_,T]=(0,a.useState)([]),[L,E]=(0,a.useState)(0),[N,W]=(0,a.useState)(1),[P,B]=(0,a.useState)(""),[H,O]=(0,a.useState)("ALL"),[q,U]=(0,a.useState)(!1),[X,J]=(0,a.useState)(null),[K,V]=(0,a.useState)({}),[G,Q]=(0,a.useState)([]),[Y,$]=(0,a.useState)(null),[ee,et]=(0,a.useState)(0),[en,ei]=(0,a.useState)(!1);(0,a.useEffect)(()=>
1{if("loading"!==e){if("unauthenticated"===e){t.push("/auth");return}ea()}},[e]);let ea=async()=>{try{let e=await fetch("/api/platform-admin/check-access");if(!(await e.json()).isAdmin){t.push("/roadmap");return}r(!0)}catch(e){t.push("/roadmap")}},es=(0,a.useCallback)(async()=>{U(!0);try{let e=new URLSearchParams({page:String(N),role:H});P.trim()&&e.set("search",P.trim());let t=await fetch("/api/platform-admin/feedback-users?".concat(e.toString())),n=await t.json();T(n.users||[]),E(n.total||0)}catch(e){}finally{U(!1)}},[N,H,P]),el=(0,a.useCallback)(async()=>{ei(!0);try{var e;let t=await fetch("/api/platform-admin/feedback"),n=await t.json();Q(n.feedback||[]),et(n.total||0),$(null!==(e=n.averageRating)&&void 0!==e?e:null)}catch(e){}finally{ei(!1)}},[]);(0,a.useEffect)(()=>{n&&("outreach"===j?es():el())},[n,j,es,el]);let er=async(e,t)=>{J(e.id),V(t=>({...t,[e.id]:""}));try{let n=await fetch("/api/platform-admin/feedback/invite-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e.id,followup:t})}),i=await n.json();n.ok?(T(t=>t.map(t=>t.id===e.id?{...t,invitedAt:i.invitedAt,inviteCount:i.inviteCount}:t)),V(n=>({...n,[e.id]:t?"Follow-up sent â":"Invite sent â"}))):V(t=>({...t,[e.id]:i.error||"Failed"}))}catch(t){V(t=>({...t,[e.id]:"Failed"}))}finally{J(null)}},ed=e=>e?new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):"",eo=e=>"bug"===e?(0,i.jsx)(c,{size:14}):"idea"===e?(0,i.jsx)(p.Z,{size:14}):(0,i.jsx)(h.Z,{size:14});if(!n)return null;let ec=Math.max(1,Math.ceil(L/25));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d(),{children:(0,i.jsx)("title",{children:"Feedback - Platform Admin"})}),(0,i.jsxs)("div",{style:{display:"flex",minHeight:"100vh",background:"#0a0a0a"},children:[(0,i.jsx)(o.Z,{}),(0,i.jsxs)("main",{style:{flex:1,marginLeft:"280px",padding:"32px",color:"#fff"},children:[(0,i.jsx)("h1",{style:{fontSize:26,fontWeight:800,margin:"0 0 4px"},children:"User Feedback"}),(0,i.jsx)("p",{style:{color:"rgba(255,255,255,0.55)",margin:"0 0 20px"},children:"Reach out to users personally and read their responses."}),(0,i.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:24,borderBottom:"1px solid #262626"},children:[(0,i.jsx)("button",{onClick:()=>I("outreach"),style:{...m,..."outreach"===j?k:{}},children:"Outreach"}),(0,i.jsxs)("button",{onClick:()=>I("responses"),style:{...m,..."responses"===j?k:{}},children:["Responses",ee?" (".concat(ee,")"):""]})]}),"outreach"===j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{style:{display:"flex",gap:12,flexWrap:"wrap",marginBottom:16},children:[(0,i.jsxs)("div",{style:{position:"relative",flex:1,minWidth:220},children:[(0,i.jsx)(u.Z,{size:16,style:{position:"absolute",left:12,top:11,color:"rgba(255,255,255,0.4)"}}),(0,i.jsx)("input",{value:P,onChange:e=>B(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(W(1),es())},placeholder:"Search name or email...",style:{...C,paddingLeft:36,width:"100%"}})]}),(0,i.jsxs)("select",{value:H,onChange:e=>{O(e.target.value),W(1)},style:C,children:[(0,i.jsx)("option",{value:"ALL",children:"All roles"}),(0,i.jsx)("option",{value:"STUDENT",children:"Students"}),(0,i.jsx)("option",{value:"PARENT",children:"Parents"}),(0,i.jsx)("option",{value:"TEACHER",children:"Teachers"})]}),(0,i.jsxs)("button",{onClick:()=>{W(1),es()},style:D,children:[(0,i.jsx)(f.Z,{size:14})," Refresh"]})]}),(0,i.jsx)("div",{style:v,children:(0,i.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{style:S,children:"User"}),(0,i.jsx)("th",{style:S,children:"Role"}),(0,i.jsx)("th",{style:S,children:"Status"}),(0,i.jsx)("th",{style:{...S,textAlign:"right"},children:"Action"})]})}),(0,i.jsx)("tbody",{children:q?(0,i.jsx)("tr",{children:(0,i.jsx)("td",{colSpan:4,style:{...w,color:"rgba(255,255,255,0.5)"},children:"Loading..."})}):0===_.length?(0,i.jsx)("tr",{children:(0,i.jsx)("td",{colSpan:4,style:{...w,color:"rgba(255,255,255,0.5)"},children:"No users found."})}):_.map(e=>(0,i.jsxs)("tr",{style:{borderTop:"1px solid #1f1f1f"},children:[(0,i.jsxs)("td",{style:w,children:[(0,i.jsx)("div",{style:{fontWeight:600},children:e.name||"â"}),(0,i.jsx)("div",{style:{color:"rgba(255,255,255,0.5)",fontSize:13},children:e.email})]}),(0,i.jsx)("td",{style:w,children:(0,i.jsx)("span",{style:R,children:e.role})}),(0,i.jsx)("td",{style:w,children:e.hasResponded?(0,i.jsxs)("span",{style:{...A,color:"#4ade80"},children:[(0,i.jsx)(x.Z,{size:14})," Responded"]}):e.invitedAt?(0,i.jsxs)("span",{style:{...A,color:"#FFD93D"},children:[(0,i.jsx)(y.Z,{size:14}
1)," Invited ",ed(e.invitedAt),e.inviteCount>1?" \xb7".concat(e.inviteCount,"x"):""]}):(0,i.jsx)("span",{style:{color:"rgba(255,255,255,0.4)"},children:"Not contacted"})}),(0,i.jsx)("td",{style:{...w,textAlign:"right"},children:(0,i.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",alignItems:"center"},children:[K[e.id]&&(0,i.jsx)("span",{style:{fontSize:12,color:K[e.id].includes("â")?"#4ade80":"#f87171"},children:K[e.id]}),e.invitedAt?(0,i.jsx)("button",{style:M,disabled:X===e.id,onClick:()=>er(e,!0),title:"Send a gentle follow-up",children:X===e.id?"...":"Send follow-up"}):(0,i.jsxs)("button",{style:Z,disabled:X===e.id,onClick:()=>er(e,!1),children:[(0,i.jsx)(g.Z,{size:14})," ",X===e.id?"...":"Send invite"]})]})})]},e.id))})]})}),(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:16},children:[(0,i.jsxs)("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:13},children:[L," users"]}),(0,i.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,i.jsx)("button",{style:D,disabled:N<=1,onClick:()=>W(e=>Math.max(1,e-1)),children:"Prev"}),(0,i.jsxs)("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:13},children:[N," / ",ec]}),(0,i.jsx)("button",{style:D,disabled:N>=ec,onClick:()=>W(e=>e+1),children:"Next"})]})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{style:{color:"rgba(255,255,255,0.55)",margin:"0 0 16px"},children:[ee," responses",null!=Y?" \xb7 avg ".concat(Y.toFixed(1),"â
"):""]}),en?(0,i.jsx)("p",{style:{color:"rgba(255,255,255,0.5)"},children:"Loading..."}):0===G.length?(0,i.jsx)("p",{style:{color:"rgba(255,255,255,0.5)"},children:"No feedback yet."}):(0,i.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:G.map(e=>(0,i.jsxs)("div",{style:z,children:[(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,marginBottom:8},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[null!=e.rating&&(0,i.jsxs)("span",{style:{color:"#FFD93D",display:"inline-flex",alignItems:"center",gap:2},children:[(0,i.jsx)(b.Z,{size:14,fill:"#FFD93D"})," ",e.rating]}),e.category&&(0,i.jsxs)("span",{style:F,children:[eo(e.category)," ",e.category]}),(0,i.jsx)("span",{style:{color:"rgba(255,255,255,0.55)",fontSize:13},children:e.email||"anonymous"})]}),(0,i.jsx)("span",{style:{color:"rgba(255,255,255,0.4)",fontSize:12,whiteSpace:"nowrap"},children:new Date(e.created_at).toLocaleString()})]}),(0,i.jsx)("p",{style:{margin:0,whiteSpace:"pre-wrap",lineHeight:1.5},children:e.message}),e.email&&(0,i.jsxs)("a",{href:"mailto:".concat(e.email),style:{color:"#4ECDC4",fontSize:13,display:"inline-block",marginTop:8},children:["Reply to ",e.email]})]},e.id))})]})]})]})]})}let m={background:"none",border:"none",color:"rgba(255,255,255,0.55)",padding:"10px 4px",marginRight:20,fontSize:15,fontWeight:600,cursor:"pointer",borderBottom:"2px solid transparent"},k={color:"#fff",borderBottom:"2px solid #FFD93D"},v={background:"#141414",border:"1px solid #262626",borderRadius:14,overflow:"hidden"},S={textAlign:"left",padding:"14px 16px",fontSize:12,textTransform:"uppercase",letterSpacing:"0.05em",color:"rgba(255,255,255,0.45)",background:"#1a1a1a"},w={padding:"14px 16px",fontSize:14,verticalAlign:"middle"},z={background:"#141414",border:"1px solid #262626",borderRadius:12,padding:16},C={background:"#1a1a1a",border:"1px solid #2f2f2f",color:"#fff",borderRadius:8,padding:"9px 12px",fontSize:14},Z={background:"#FFD93D",color:"#000",border:"none",borderRadius:8,padding:"8px 14px",fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6,whiteSpace:"nowrap"},M={background:"transparent",color:"#fff",border:"1px solid #3a3a3a",borderRadius:8,padding:"8px 14px",fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},D={background:"transparent",color:"#fff",border:"1px solid #2f2f2f",borderRadius:8,padding:"9px 14px",fontWeight:600,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},R={fontSize:11,fontWeight:700,letterSpacing:"0.03em",color:"rgba(255,255,255,0.7)",background:"#1f1f1f",border:"1px solid #333",borderRadius:6,padding:"3px 8px"},A={display:"inline-flex",alignItems:"center",gap:5,fontSize:13,fontWeight:600},F={display:"inline-flex",alignItems:"center",gap:4,background:"#1f1f1f",border:"1px solid #333",borderRadius:6,padding:"2px 8px",fontSize:12,textTransform:"capitalize"}},9008:function(e,t,n){e.exports=n(23867)}},function(e){e.O(0,[6295,8689,2888,9774,179],function(){return e(e.s=26976)}),_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.