(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{705:function(e,t,a){"use strict";a.r(t),a.d(t,"default",function(){return f});var s=a(3),n=a.n(s),i=a(0),c=a.n(i),r=a(11),u=a(21),o=a(14),l=a(13),m=a(117),d=a(16),p=a(2),b=a(10);function f(e){var t=Object(i.useState)(!1),a=t[0],s=t[1],f=Object(i.useContext)(o.a).routeState,v=f.activeSection,g=f.isSectionValid,S=f.appRouteSectionsSequence,h=Object(i.useContext)(u.c).createCaseState,O=h.summary,j=h.issue,E=h.environment,y=h.periodicityOfIssue,C=h.timeFramesAndUrgency,I=Object(i.useContext)(r.c).appMetadataState,k=I.nextButtonRef,w=I.allCaseTypes,x=I.allCaseSeverities,N=I.allCaseEntitlements,U=I.caseLanguages,D=I.caseGroups,q=I.loggedInUsersAccount,F=I.loggedInUserJwtToken,J=Object(i.useContext)(u.b),Q=Object(i.useContext)(o.c),T=Object(i.useContext)(r.b),V=function(e){Object(d.g)(J,e)};Object(i.useEffect)(function(){if(!n()(q.data)){var e=[];n()(w.data)&&e.push(Object(l.e)(T)),n()(x.data)&&e.push(Object(l.d)(T)),n()(N.data)&&e.push(Object(l.b)(T,F)),n()(D.data)&&e.push(Object(l.c)(T,F)),n()(U.data)&&e.push(Object(l.f)(T)),Promise.all(e)}},[q]);var A=function(t){v!==p.a.ISSUE&&b.a.navigateToSection(e.routeProps,p.a.ISSUE,S)},B=function(e){V({summary:e.target.value}),s(n()(e.target.value))},M=function(e){V({issue:e.target.value});var t=Object(m.e)(e.target.value,E,y,C);V({description:t})};Object(i.useEffect)(function(){if(v===p.a.ISSUE){var e=!n()(O);g!==e&&Q({type:p.b.setIsSectionValid,payload:{isSectionValid:e}})}},[O,v]);var P=function(e){s(n()(e.target.value))},R=function(e){e.preventDefault(),k.current.click()};return Object(i.useMemo)(function(){return c.a.createElement(c.a.Fragment,null,c.a.createElement("form",{onSubmit:R},c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"issue-summary"},"Summarize the issue in a few words ",c.a.createElement("span",{className:"form-required"},"*")),c.a.createElement("input",{required:!0,type:"text",id:"issue-summary",className:"form-control"+(a?" form-invalid":""),"aria-invalid":a,"aria-required":!0,"aria-describedby":"issueSummaryDesc",name:"issue-summary",value:O,onClick:A,onChange:B,onBlur:P}),c.a.createElement("p",{className:"form-instructions",id:"issueSummaryDesc"},"1-2 sentences")),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"issue-section-ktQ1-issue"},"If you can, describe the issue in more detail to help improve results"),c.a.createElement("textarea",{id:"issue-section-ktQ1-issue",name:"issue-section-ktQ1-issue","aria-describedby":"describeIssueDesc",className:"form-control",value:j,onClick:A,onChange:M}),c.a.createElement("p",{className:"form-instructions",id:"describeIssueDesc"},"e.g. What should be happening? What is happening instead?"))))},[e,O,j,a])}}}]);
//# sourceMappingURL=Suggestions.228809a3.chunk.js.map