/*! For license information please see dll.242.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[242],{3359:function(e,t,a){"use strict";a.r(t);var n=a(14),r=a.n(n),l=a(13),i=a.n(l),o=a(15),s=a.n(o),u=a(16),c=a.n(u),d=a(8),f=a.n(d),p=a(0),g=a.n(p),v=a(1),m=a.n(v),b=a(36),h=a.n(b),y=a(77),V=a(88),C=a(209),E=a(204),w=a(206),R=a(1799),q=a(200),P=a(966);function T(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 a,n=f()(e);if(t){var r=f()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return c()(this,a)}}var D=h()("isle:data-explorer:contingency-table"),S=function(e){s()(a,e);var t=T(a);function a(e){var n;return r()(this,a),(n=t.call(this,e)).state={relativeFreqs:!1,rowVar:e.defaultRowVar||e.variables[0],colVar:e.defaultColVar||e.variables[1],group:null,nDecimalPlaces:3,variables:e.variables,display:[]},n}return i()(a,[{key:"generateContingencyTable",value:function(){var e=this.state,t=e.rowVar,a=e.colVar,n=e.group,r=e.relativeFreqs,l=e.nDecimalPlaces,i=e.display;if(!t||!a)return this.props.session.addNotification({title:"Select Variables",message:"You need to select a row and column variable for the contingency table",level:"warning",position:"tr"});var o=g.a.createElement(R.default,{rowVar:t,colVar:a,group:n,relativeFreqs:r,nDecimalPlaces:l,display:i,data:this.props.data});this.props.logAction(q.DATA_EXPLORER_CONTINGENCY_TABLE,{rowVar:t,colVar:a,group:n,relativeFreqs:r,display:i}),this.props.onCreated(o)}},{key:"render",value:function(){var e=this,t=this.props,a=t.variables,n=t.groupingVariables,r=t.t;return g.a.createElement(V.default,null,g.a.createElement(V.default.Header,{as:"h4"},r("Contingency Table"),g.a.createElement(P.default,{title:r("Contingency Table"),content:r("Contingency Table-description")})),g.a.createElement(V.default.Body,null,g.a.createElement(E.default,{legend:r("row-variable"),defaultValue:this.state.rowVar,options:a,onChange:function(t){e.setState({rowVar:t})}}),g.a.createElement(E.default,{legend:r("column-variable"),defaultValue:this.state.colVar,options:a,onChange:function(t){e.setState({colVar:t})}}),g.a.createElement(E.default,{legend:r("group-by"),options:n,clearable:!0,menuPlacement:"top",onChange:function(t){e.setState({group:t})},tooltip:r("contingency-table-group-tooltip")}),g.a.createElement(C.default,{legend:r("relative-frequency"),defaultValue:!1,onChange:function(){e.setState({relativeFreqs:!e.state.relativeFreqs})}}),g.a.createElement(E.default,{legend:r("display"),options:["Row Percent","Column Percent"],multi:!0,onChange:function(t){e.setState({display:t||[]})}}),this.state.relativeFreqs||this.state.display.length>0?g.a.createElement("p",null,r("report-relative-frequencies"),g.a.createElement(w.default,{inline:!0,width:50,max:16,min:0,defaultValue:this.state.nDecimalPlaces,onChange:function(t){e.setState({nDecimalPlaces:t})}}),r("decimal-places")):null,g.a.createElement(y.default,{variant:"primary",block:!0,onClick:this.generateContingencyTable.bind(this)},r("generate"))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.variables.length!==t.variables.length?(D("Available variables have changed..."),{rowVar:e.defaultRowVar||e.variables[0],colVar:e.defaultColVar||e.variables[1],variables:e.variables}):null}}]),a}(p.Component);S.defaultProps={defaultRowVar:null,defaultColVar:null,groupingVariables:null,logAction:function(){}},S.propTypes={data:m.a.object.isRequired,defaultColVar:m.a.string,defaultRowVar:m.a.string,groupingVariables:m.a.array,logAction:m.a.func,onCreated:m.a.func.isRequired,session:m.a.object.isRequired,variables:m.a.array.isRequired},t.default=S},966:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(1),i=a.n(l),o=a(77),s=a(974),u=a(971),c=a(970),d=a(998),f=function(e){var t=r.a.createElement(s.default,{id:"popover-positioned-right"},r.a.createElement(u.default,null,e.title),r.a.createElement(c.default,null,e.content));return r.a.createElement(d.default,{trigger:["hover","focus"],placement:"left",rootClose:!0,overlay:t},r.a.createElement(o.default,{size:"sm",variant:"outline-secondary",className:"question-button"},r.a.createElement("div",{className:"fa fa-question"})))};f.propTypes={content:i.a.oneOfType([i.a.string,i.a.node]).isRequired,title:i.a.string.isRequired},t.default=f}}]);