/*! For license information please see dll.LikertScale.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[77],{894:function(e,t,n){"use strict";n.r(t);var r=n(14),s=n.n(r),a=n(13),i=n.n(a),o=n(11),l=n.n(o),c=n(15),u=n.n(c),p=n(16),f=n.n(p),d=n(8),b=n.n(d),m=n(7),y=n.n(m),h=n(0),v=n.n(h),g=n(1),O=n.n(g),S=n(89),w=n(62),E=n(104),R=n(79),j=n(112),N=n.n(j),k=n(65),P=n(34),C=n(154),_=n(202);function D(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 I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){y()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b()(e);if(t){var s=b()(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return f()(this,n)}}var L=Object(k.default)("likert-scale"),x=function(e){u()(n,e);var t=M(n);function n(e){var r;return s()(this,n),r=t.call(this,e),y()(l()(r),"submitHandler",(function(){var e=r.context;r.props.disableSubmitNotification||e.addNotification({title:"Answer submitted.",message:"Your answer was successfully stored",level:"success"}),r.setState({submitted:!0}),e.log({id:r.id,type:_.LIKERT_SCALE_SUBMISSION,value:N()(r.props.options,r.state.value)})})),y()(l()(r),"handleChange",(function(e){var t=e.target.value;r.setState({value:t})})),r.id=e.id||L(e),r.state={value:null,submitted:!1},r}return i()(n,[{key:"render",value:function(){var e=this,t=this.props.noMultipleResponses&&this.state.submitted;return v.a.createElement(S.default,{className:"".concat(this.props.className," center"),style:I({width:"75%"},this.props.style)},v.a.createElement(S.default.Body,null,v.a.createElement(R.default,{className:"center"},v.a.createElement("label",null,this.props.question),v.a.createElement("br",null),this.props.options.map((function(n,r){return v.a.createElement(w.default.Check,{type:"radio",label:n,checked:e.state.value===n,value:n,key:r,disabled:t,inline:!0,onClick:e.handleChange})}))),v.a.createElement("br",null),v.a.createElement(E.default,{className:"submit-button",variant:"primary",size:"sm",disabled:!this.state.value||t,onClick:this.submitHandler,style:{marginRight:"5px"}},this.state.submitted&&!this.props.noMultipleResponses?"Resubmit":"Submit"),v.a.createElement(C.default,{buttonLabel:"Responses",id:this.id,data:{type:"factor",levels:this.props.options},info:_.LIKERT_SCALE_SUBMISSION})))}}]),n}(h.Component);x.propTypes={question:O.a.string,options:O.a.array,noMultipleResponses:O.a.bool,disableSubmitNotification:O.a.bool,className:O.a.string,style:O.a.object},x.defaultProps={question:"",options:["Strongly disagree","Disagree","Neither agree nor disagree","Agree","Strongly agree"],noMultipleResponses:!1,disableSubmitNotification:!1,className:"",style:{}},x.contextType=P.default,t.default=x}}]);