1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5031],{46474:function(e,n,t){t.d(n,{q:function(){return $}});var i=t(30865),s=t(81367),r=t(33209),o=t(87451),a=t(64820),l=t(5972),c=t(20264),u=t(99737),d=t(33503),f=t(75362),m=t(73277),x=t(49231),h=t(85344),g=t(5224),v=t(49071),p=t(16649),C=t(19841),j=t(21324),y=t(52634),_=t(89214),L=t(37861),b=t(91660),w=t(29161),R=t(38722),M=function(e){return(0,c.jsxs)(R.l,(0,r._)((0,s._)({},e),{variant:"stroke",children:[(0,c.jsx)("path",{d:"M3 4.87958V10.2067H8.32711",strokeWidth:"1.7757",strokeLinecap:"round",strokeLinejoin:"round"}),(0,c.jsx)("path",{d:"M5.22851 14.6459C5.80418 16.2799 6.8953 17.6825 8.33746 18.6425C9.77961 19.6024 11.4947 20.0677 13.2242 19.9681C14.9538 19.8686 16.6042 19.2096 17.9267 18.0906C19.2492 16.9715 20.1722 15.453 20.5566 13.7637C20.941 12.0745 20.766 10.3061 20.058 8.72494C19.3499 7.14381 18.1472 5.8356 16.631 4.99744C15.1149 4.15929 13.3674 3.83658 11.6518 4.07794C9.9363 4.31931 8.34568 5.11167 7.11963 6.33565L3 10.2067",strokeWidth:"1.7757",strokeLinecap:"round",strokeLinejoin:"round"})]}))},N=t(58050);function S(e){var n=e.message,t=e.onEditClick,i=(0,o._)((0,h.$G)(),1)[0];return(0,c.jsxs)("div",{className:"group flex max-w-[80%] flex-col gap-ant-xxs self-end",children:[(0,c.jsx)("div",{className:"rounded-ant-lg bg-ant-primary p-ant",children:(0,c.jsx)(b.ix,{markdown:n})}),(0,c.jsx)("div",{className:"flex h-ant-control-sm flex-row justify-end gap-ant-xxs opacity-0 group-hover:opacity-100 focus-within:opacity-100",children:t?(0,c.jsx)(N.u,{title:i("component.ChatSession.edit"),children:(0,c.jsx)(L.z,{type:"text",size:"small",icon:(0,c.jsx)(w.f,{variant:"antd",className:"size-[1em]"}),onClick:t})}):null})]})}function k(e){var n=e.message,t=e.onRetryClick,i=(0,o._)((0,h.$G)(),1)[0];return(0,c.jsxs)("div",{className:"group flex flex-col gap-ant-xxs ",children:[(0,c.jsx)("div",{className:"rounded-ant-lg p-ant group-hover:bg-ant-fill-tertiary",children:(0,c.jsx)(b.ix,{markdown:n})}),(0,c.jsx)("div",{className:"flex h-ant-control-sm flex-row gap-ant-xxs px-ant-xs opacity-0 group-hover:opacity-100 focus-within:opacity-100",children:t?(0,c.jsx)(N.u,{title:i("component.ChatSession.retry"),children:(0,c.jsx)(L.z,{type:"text",size:"small",icon:(0,c.jsx)(M,{variant:"antd",className:"size-[1em]"}),onClick:t})}):null})]})}function E(e){var n=e.history,t=e.isLoading,i=e.onEditMessage,s=e.onRetryMessage,r=e.error,a=e.welcomeMessage,l=e.isReadOnly,u=n.findLastIndex((function(e){return e.role===j.tl.User})),d=(0,o._)((0,h.$G)(),1)[0],f=!n.length&&!t&&!r,m=l||!!r||t;return(0,c.jsxs)("div",{className:(0,C.Z)("flex flex-col gap-ant-xxs",f&&"h-full justify-center"),children:[n.map((function(e,n){return(null===e||void 0===e?void 0:e.role)===j.tl.User?(0,c.jsx)(S,{message:e.message,onEditClick:i&&!m?function(){return i(n)}:void 0},n):(0,c.jsx)(k,{message:e.message,onRetryClick:s&&!m?function(){return s(n-1)}:void 0},n)})),r&&!t?(0,c.jsx)(_.b,{showIcon:!0,type:"error",description:r,className:"p-ant-sm!",action:s&&u>-1?(0,c.jsx)(L.z,{size:"small",danger:!0,autoFocus:!0,onClick:function(){return s(u)},children:d("component.ChatSession.retry")}):void 0}):null,t?(0,c.jsx)(k,{message:"\u2026"}):null,n.length||t||r?null:(0,c.jsx)(y.H,{image:y.H.PRESENTED_IMAGE_SIMPLE,description:null!==a&&void 0!==a?a:d("component.ChatSession.empty")})]})}var Z=t(28819),A=t(20175),U=t.n(A),I=t(80855),V=t(25913),P=t(74409),T=t(11447),B=function(e){return(0,c.jsx)(R.l,(0,r._)((0,s._)({},e),{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,c.jsx)("g",{id:"loader-01",children:(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C12.5523 2 13 2.44772 13 3V7.11429C13 7.66657 12.5523 8.11429 12 8.11429C11.4477 8.11429 11 7.66657 11 7.11429V3C11 2.44772 11.4477 2 12 2ZM4.9283 4.9288C5.31882 4.53827 5.95199 4.53827 6.34251 4.9288L9.25175 7.83804C9.64227 8.22856 9.64227 8.86173 9.25175 9.25225C8.86123 9.64278 8.22806 9.64278 7.83754 9.25225L4.9283 6.34301C4.53777 5.95249 4.53777 5.31932 4.9283 4.9288ZM19.0714 4.92911C19.4619 5.31963 19.4619 5.9528 19.0714 6.34332L16.1622 9.25256C15.7716 9.64309 15.1385 9.64309 14.7479 9.25256C14.3574 8.86204 14.3574 8.22887 14.7479 7.83835L17.6572 4.92911C18.0477 4.53859 18.6809 4.53859 19.0714 4.92911ZM2 12C2 11.4477 2.44772 11 3 11H7.11429C7.66657 11 8.11429 11.4477 8.11429 12C8.11429 12.5523 7.66657 13 7.11429 13H3C2.44772 13 2 12.5523 2 12ZM15.8857 12C15.8857 11.4477 16.3334 11 16.8857 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H16.8857C16.3334 13 15.8857 12.5523 15.8857 12ZM14.7479 14.7474C15.1385 14.3569 15.7716 14.3569 16.1622 14.7474L19.0714 17.6567C19.4619 18.0472 19.4619 18.6804 19.0714 19.0709C18.6809 19.4614 18.0477 19.4614 17.6572 19.0709L14.7479 16.1617C14.3574 15.7711 14.3574 15.138 14.7479 14.7474ZM9.25175 14.7477C9.64227 15.1383 9.64227 15.7714 9.25175 16.162L6.34251 19.0712C5.95199 19.4617 5.31882 19.4617 4.9283 19.0712C4.53777 18.6807 4.53777 18.0475 4.9283 17.657L7.83754 14.7477C8.22806 14.3572 8.86123 14.3572 9.25175 14.7477ZM12 15.8857C12.5523 15.8857 13 16.3334 13 16.8857V21C13 21.5523 12.5523 22 12 22C11.4477 22 11 21.5523 11 21V16.8857C11 16.3334 11.4477 15.8857 12 15.8857Z",className:"fill-current"})})}))},z=t(42784),H=V.Ry().shape({message:V.Z_().transform((function(e){return e.trim()})).required().default("")});function O(e){var n=e.defaultValues,t=e.onSubmit,i=e.mode,a=e.onModeChange,l=e.disabled,u=(0,x.useMemo)((function(){return H.getDefault()}),[]),d=null!==n&&void 0!==n?n:u,f=(0,o._)((0,h.$G)(),1)[0],g=(0,I.cI)({resolver:(0,Z.X)(H),defaultValues:d}),v=g.reset,p=g.handleSubmit,j=g.control,y=g.formState,_=y.isSubmitting,L=y.isValid,b=(0,g.watch)("message"),w=b.split("\n").length<=1,R=p((function(e){return v(),t(e)}));(0,x.useEffect)((function(){v(d)}),[d]);var M="edit"===i;return(0,c.jsxs)("form",{className:(0,C.Z)("sol ant-input-css-var","flex flex-col gap-ant-xs rounded-ant-lg p-ant-xs","border-ant border-ant-color bg-ant-container","focus-within:bg-ant-input-active focus-within:border-ant-input-active"),onSubmit:R,children:[M?(0,c.jsxs)("div",{className:"flex flex-row items-center justify-between rounded-ant border-ant border-ant-secondary p-ant-xxs",children:[(0,c.jsx)("p",{className:"pl-ant-xs",children:(0,c.jsx)(m.Z.Text,{children:f("component.ChatSession.editing")})}),(0,c.jsx)(N.u,{title:f("component.ChatSession.cancelEdit"),children:(0,c.jsx)(U(),{onClick:function(){null===a||void 0===a||a("send")},iconPosition:"end",icon:(0,c.jsx)(T.X,{variant:"antd"}),type:"text",htmlType:"button"})})]}):null,(0,c.jsxs)("div",{className:(0,C.Z)("flex gap-ant-xs",w?"flex-row":"flex-col"),children:[(0,c.jsx)(I.Qr,{control:j,name:"message",render:function(e){var n=e.field,t=e.formState;return(0,c.jsx)(z.I.TextArea,(0,r._)((0,s._)({},n),{placeholder:f("component.ChatSession.placeholder"),variant:"borderless",className:"flex-1",autoSize:{minRows:1,maxRows:4},onPressEnter:function(e){e.shiftKey||(e.preventDefault(),R())},disabled:t.isSubmitting||l}))}}),(0,c.jsx)(U(),{loading:_,disabled:!L||l,htmlType:"submit",className:"self-end",type:"primary",icon:_?(0,c.jsx)(B,{}):(0,c.jsx)(P.y,{variant:"antd"})})]})]})}var G=t(13926);function W(e){var n=e.onHistoryChange,t=e.onEditMessage,o=e.onRegenerateResponse,u=e.history,d=void 0===u?[]:u,f=e.isLoading,m=e.error,h=e.className,g=e.welcomeMessage,v=(0,x.useRef)(null),p=function(e){var n=e.history,t=e.onHistoryChange,s=e.onEditMessage,r=e.onRegenerateResponse,o=(0,x.useState)(null),c=o[0],u=o[1],d=(0,G.isNull)(c)?n:n.slice(0,c);return{feed:{history:d,onEditMessage:function(e){u(e)},onRetryMessage:function(e){r?r(e):null===t||void 0===t||t(n.slice(0,e+1))}},onSubmit:function(){var e=(0,i._)((function(e){var n,i;return(0,l.__generator)(this,(function(r){switch(r.label){case 0:return n=e.message,(0,G.isNull)(c)||!s?[3,2]:[4,s(c,n)];case 1:return r.sent(),u(null),[2];case 2:return i=(0,a._)(d).concat([{role:j.tl.User,message:n}]),t&&t(i),u(null),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),mode:(0,G.isNull)(c)?"send":"edit",onModeChange:function(e){"edit"!==e&&u(null)},defaultMessageValues:(0,G.isNull)(c)?void 0:{message:n[c].message}}}({history:d,onHistoryChange:n,onEditMessage:t,onRegenerateResponse:o}),y=p.defaultMessageValues,_=p.feed,L=p.onSubmit,b=p.mode,w=p.onModeChange;return(0,x.useEffect)((function(){var e=v.current;e&&e.scrollTo(0,e.scrollHeight)}),[d]),(0,c.jsxs)("div",{className:(0,C.Z)("flex flex-col bg-ant-container",h),children:[(0,c.jsx)("div",{className:"flex flex-1 flex-col items-stretch overflow-y-auto p-ant-lg",ref:v,children:(0,c.jsx)(E,(0,r._)((0,s._)({},_),{isLoading:f,error:m,isReadOnly:"edit"===b,welcomeMessage:g}))}),(0,c.jsx)("div",{className:"flex flex-col gap-ant-xs border-t-ant border-t-ant-color p-ant-xs",children:(0,c.jsx)(O,{defaultValues:y,onSubmit:L,mode:b,onModeChange:w,disabled:f||!!m})})]})}
1function $(e){var n=e.classroom,t=e.brief,C=(0,x.useState)(!1),j=C[0],y=C[1],_=(0,x.useState)([]),L=_[0],b=_[1],w=(0,v.kmx)(),R=w.mutateAsync,M=w.isPending,N=w.error,S=(0,v.gux)(),k=S.mutateAsync,E=S.isPending,Z=S.error,A=(0,v.$oV)(),U=A.mutateAsync,I=A.isPending,V=A.error,P=(0,v.ZXK)({brief:t}),T=P.data,B=P.isLoading,z=(0,o._)((0,h.$G)(),1)[0],H=M||E||I||B,O=N||Z||V;(0,x.useEffect)((function(){j&&(null===T||void 0===T?void 0:T.history)&&0===L.length&&b(T.history)}),[j,T,L.length]);var G=function(){var e=(0,i._)((function(e,n){var t,i,s;return(0,l.__generator)(this,(function(r){switch(r.label){case 0:return(null===(t=L[e])||void 0===t?void 0:t.interactionUuid)?[4,k({interactionUuid:t.interactionUuid,message:n})]:(console.error("Cannot edit message: missing interactionUuid"),[2]);case 1:return(i=r.sent())&&(s=L.slice(0,e),b((0,a._)(s).concat([{role:v.tl5.User,message:n,timestamp:i.timestamp,interactionUuid:i.interactionUuid},i]))),[2]}}))}));return function(n,t){return e.apply(this,arguments)}}(),$=function(){var e=(0,i._)((function(e){var n,t,i;return(0,l.__generator)(this,(function(s){switch(s.label){case 0:return(null===(n=L[e])||void 0===n?void 0:n.interactionUuid)?[4,U({interactionUuid:n.interactionUuid})]:(console.error("Cannot regenerate message: missing interactionUuid"),[2]);case 1:return(t=s.sent())&&(i=L.slice(0,e+1),b((0,a._)(i).concat([t]))),[2]}}))}));return function(n){return e.apply(this,arguments)}}();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(u.Z,{title:z("component.ReflectiveAssistant.title"),closable:{"aria-label":z("component.ReflectiveAssistant.close")},onClose:function(){return y(!1)},open:j,width:450,children:(0,c.jsx)("div",{className:"relative size-full",children:(0,c.jsx)(W,{welcomeMessage:(0,c.jsxs)("div",{children:[(0,c.jsx)(m.Z.Paragraph,{strong:!0,className:"mt-ant mb-ant-xs! text-ant-h4",children:z("component.ReflectiveAssistant.welcome.title")}),(0,c.jsx)(m.Z.Paragraph,{type:"secondary",className:"whitespace-pre-wrap",children:z("component.ReflectiveAssistant.welcome.body")})]}),isLoading:H,error:O?(0,g.Z)(O):void 0,className:"absolute -inset-ant-lg",history:L,onHistoryChange:function(){var e=(0,i._)((function(e){var i;return(0,l.__generator)(this,(function(o){switch(o.label){case 0:return b(e),[4,R({brief:t,interactions:e,classroom:n})];case 1:return(i=o.sent())&&b((function(e){var n=(0,a._)(e),t=n.length-1;return t>=0&&(n[t]=(0,r._)((0,s._)({},n[t]),{interactionUuid:i.interactionUuid,timestamp:i.timestamp})),(0,a._)(n).concat([i])})),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),onEditMessage:G,onRegenerateResponse:$})})}),j?null:(0,c.jsx)(f.default,{title:z("component.ReflectiveAssistant.open"),children:(0,c.jsx)(d.Z,{className:"fixed! right-4 bottom-4",type:"primary",onClick:function(){return y(!0)},icon:(0,c.jsx)(p.Z,{variant:"antd"})})})]})}},16649:function(e,n,t){t.d(n,{Z:function(){return a}});var i=t(81367),s=t(33209),r=t(20264),o=t(38722),a=function(e){return(0,r.jsx)(o.l,(0,s._)((0,i._)({},e),{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,r.jsx)("g",{id:"message-circle",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9991 4C7.58143 4 4 7.58163 4 12C4 16.4184 7.58143 20 11.9991 20C13.4232 20 14.7575 19.6287 15.9137 18.9784C16.1364 18.8532 16.3986 18.8179 16.6465 18.8799L19.7997 19.6683L19.2439 15.777C19.2174 15.5916 19.2435 15.4025 19.3192 15.2313C19.7555 14.2444 19.9983 13.1519 19.9983 12C19.9983 7.58163 16.4169 4 11.9991 4ZM2 12C2 6.47724 6.47668 2 11.9991 2C17.5216 2 21.9983 6.47724 21.9983 12C21.9983 13.3319 21.7374 14.6052 21.2632 15.7697L21.99 20.8577C22.037 21.1873 21.917 21.5188 21.6697 21.7418C21.4225 21.9647 21.0805 22.05 20.7574 21.9693L16.5357 20.9137C15.1732 21.6085 13.6306 22 11.9991 22C6.47668 22 2 17.5228 2 12Z",className:"fill-current"})})}))}},74409:function(e,n,t){t.d(n,{y:function(){return a}});var i=t(81367),s=t(33209),r=t(20264),o=t(38722),a=function(e){return(0,r.jsx)(o.l,(0,s._)((0,i._)({},e),{width:"24",height:"24",viewBox:"0 0 24 24",children:(0,r.jsx)("g",{id:"send-01",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.0298 5.38416L11.6598 13.7542L14.2649 20.4118C14.3651 20.6678 14.7298 20.6607 14.8
1199 20.401L20.0298 5.38416ZM10.2456 12.34L18.6156 3.96995L3.59878 9.17986C3.33907 9.26996 3.33196 9.63465 3.58794 9.73482L10.2456 12.34ZM19.5491 1.52912C21.3609 0.900535 23.0992 2.63881 22.4706 4.45062L16.7094 21.0565C16.0101 23.072 13.1798 23.1273 12.4024 21.1406L9.76555 14.4019C9.73549 14.3251 9.6747 14.2643 9.59787 14.2342L2.85914 11.5973C0.87245 10.8199 0.927711 7.98961 2.94323 7.29035L19.5491 1.52912Z",className:"fill-current"})})}))}},29161:function(e,n,t){t.d(n,{f:function(){return a}});var i=t(81367),s=t(33209),r=t(20264),o=t(38722),a=function(e){return(0,r.jsx)(o.l,(0,s._)((0,i._)({},e),{width:"25",height:"24",viewBox:"0 0 25 24",children:(0,r.jsx)("g",{id:"pencil-01",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.494 4.05742L6.67857 15.2506L9.72085 17.8583L20.693 7.25641C21.5709 6.3726 21.5691 4.94447 20.6875 4.06292C19.806 3.18139 18.3779 3.17955 17.494 4.05742ZM8.07255 19.0796L4.64152 20.1089L5.58895 16.9508L8.07255 19.0796ZM16.0743 2.64871C17.7387 0.984287 20.4373 0.984282 22.1017 2.64871C23.7661 4.31313 23.7661 7.0117 22.1017 8.67612L22.0895 8.68815L9.84492 20.5195C9.73008 20.6305 9.59035 20.7123 9.4374 20.7582L3.4374 22.5582C3.08503 22.6639 2.70307 22.5676 2.44294 22.3075C2.18281 22.0474 2.08651 21.6654 2.19222 21.313L3.99222 15.313C4.03811 15.1601 4.11995 15.0204 4.23091 14.9055L16.0623 2.66095L16.0743 2.64871Z",className:"fill-current"})})}))}},69799:function(e,n,t){t.d(n,{VB:function(){return r}});var i=t(81367),s=t(33209),r=function(e){return e.map((function(e){return function(e){return(0,s._)((0,i._)({},e),{"@context":"",mimetype:"",size:0,createdAt:"",updatedAt:""})}(e)}))}},85031:function(e,n,t){t.d(n,{u:function(){return b}});var i=t(81367),s=t(33209),r=t(87451),o=t(20264),a=t(56578),l=t.n(a),c=t(85344),u=t(69799),d=t(76075),f=t(50227),m=t(42393),x=t(23088),h=t(49071),g=t(6151),v=t(89788),p=t(37861),C=t(98430),j=t(16525),y=t(48245),_=t(24457),L=t(46474),b=function(e){var n,t=e.briefId,a=e.isPrimaryView,b=void 0===a||a,w=(0,r._)((0,c.$G)(),1)[0],R=(0,x.tv)(),M=(0,f.OT)().activeClassroom,N=(0,d.Jx)(),S=(0,m.o_)(),k=S([m.L0.TOPICS_WORK_SUBMIT,m.L0.WORKSPACE_GROUP_SUBMIT]),E=M&&(0,h.sRO)(M),Z=(0,g.A)({brief:t,classroom:M}),A=Z.data,U=Z.isLoading,I=(0,C.fP)(A),V=l()(null===A||void 0===A||null===(n=A.skillLevels)||void 0===n?void 0:n.map((function(e){return(0,h.sRO)(e.skill)}))),P=(0,h.q0$)({filters:{skills:V}}),T=P.data,B=P.isLoading,z=U||B||!A,H=!!A&&S(m.L0.BRIEFS_EDIT,{scope:N(A)}),O=!z&&M&&t;return(0,o.jsxs)(o.Fragment,{children:[b&&(0,o.jsx)("div",{className:"my-6 ml-auto flex w-full items-center justify-end",children:(0,o.jsx)(_.YT,{brief:A,onAction:function(e){e===_.VA.DELETE&&R.push(E?{route:x.AW.CLASSROOM_BRIEFS,query:{classroomId:E}}:{route:x.AW.TRAINER_WORKSPACE_BRIEFS})},button:(0,o.jsx)(p.z,{icon:(0,o.jsx)(v._,{}),iconPosition:"end",loading:z,disabled:z,children:w("component.BriefItemView.options")})})}),(0,o.jsx)(C.bI,(0,s._)((0,i._)({},A),{frameworks:null===T||void 0===T?void 0:T["hydra:member"],skills:(null===A||void 0===A?void 0:A.skillLevels)&&(0,C.wL)(A.skillLevels),renderSkillLevels:function(e){return(0,o.jsx)(j.y5,{title:e.title,levels:e.levels})},renderAuthor:function(e,n){return(0,o.jsx)(y.qZ,{user:e,date:n,type:"createdAt"})},media:(null===A||void 0===A?void 0:A.media)&&(0,u.VB)(A.media),isLoading:z,assignmentTag:(0,C.W_)(null===A||void 0===A?void 0:A.status,I),showAssignment:(0,C.fA)({isLearner:k,isPrimaryView:b}),canEditBrief:H})),O&&(0,o.jsx)(L.q,{classroom:M,brief:t})]})}}}]); 2//# sourceMappingURL=5031-0801c1763457ad5f.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.