(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[97],{"2wYh":function(e,t,a){"use strict";a.r(t),a.d(t,"AcceptCertView",(function(){return w}));var n=a("q1tI"),r=a.n(n),s=a("VyNe"),i=a("uSQv"),o=a("9nK9"),c=a("VTF0"),l=a("K7Uc"),m=a("zWLE"),d=a("CYnS"),u=a("25HA"),p=a("UF3x"),h=a("UROv"),f=a("qXLe"),O=a("jekD"),E=a("Ty5D"),b=(a("X9Z5"),a("SjWX")),N=a("3Z9Z"),v=a("JI6e"),D=a("v9qu"),R=a("/MKj"),g=a("LCzB");class w extends r.a.Component{constructor(e){super(e),this.onButtonClick=()=>{let e=window.open("https://FeturaOfflineGW:9001");this.checkIfClosedWindow(e)},this.state={interval:null}}checkIfClosedWindow(e){let t=setInterval(()=>{e.closed&&(this.props.user.ClientID?this.props.history.goBack():this.props.history.push("/login"))},100);this.setState({interval:t})}componentWillUnmount(){clearInterval(this.state.interval)}getScreenshots(){switch(Object(b.detect)().name){default:case"chrome":return Object(D.a)()?r.a.createElement(r.a.Fragment,null,r.a.createElement("img",{src:d.a,alt:"chrome1"}),r.a.createElement("img",{src:u.a,alt:"chrome2"})):r.a.createElement(r.a.Fragment,null,r.a.createElement("img",{src:o.a,alt:"chrome1"}),r.a.createElement("img",{src:c.a,alt:"chrome2"}));case"firefox":return Object(D.a)()?r.a.createElement(r.a.Fragment,null,r.a.createElement("img",{src:p.a,alt:"firefox1"}),r.a.createElement("img",{src:h.a,alt:"firefox2"})):r.a.createElement(r.a.Fragment,null,r.a.createElement("img",{src:l.a,alt:"firefox1"}),r.a.createElement("img",{src:m.a,alt:"firefox2"}));case"ios":return r.a.createElement(r.a.Fragment,null,r.a.createElement("img",{src:f.a,alt:"safari1"}),r.a.createElement("img",{src:O.a,alt:"safari1"}))}}render(){const{t:e}=this.props;return r.a.createElement("div",{className:"accept-cert"},r.a.createElement(s.a,null,r.a.createElement("h2",null,e("acceptCert.title")),r.a.createElement("ol",null,r.a.createElement("li",null,r.a.createElement("div",null,e("acceptCert.first")),r.a.createElement(i.a,{onClick:this.onButtonClick},e("clickHere"))),r.a.createElement("li",null,e("acceptCert.second"))),r.a.createElement(N.a,{className:"justify-content-center"},r.a.createElement(v.a,{md:6},this.getScreenshots()))))}}w=Object(E.o)(w),w=Object(R.connect)(e=>({user:e.user.user}))(w),t.default=Object(g.a)()(w)},"3dCX":function(e,t,a){},"8Psb":function(e,t,a){},"Ey+N":function(e,t,a){},FaT7:function(e,t,a){"use strict";a.r(t),a.d(t,"ControlListView",(function(){return Ge}));var n=a("UfWW"),r=a.n(n),s=a("BkRI"),i=a.n(s),o=a("Y+p1"),c=a.n(o),l=a("q1tI"),m=a.n(l),d=a("XSU/"),u=a("2tEe"),p=a("AAik"),h=(a("IP7v"),a("lM7y")),f=a("/MKj"),O=a("CuyV"),E=a("LCzB");class b extends m.a.Component{constructor(...e){super(...e),this.markAsFavorite=e=>{const{value:t,user:a}=this.props;t.markAsFavorite(a.LocalUserID),this.props.dispatch(Object(h.d)(t.prepareBeanToSave(),a.ClientID,a.LocalUserID)),e.stopPropagation()}}render(){const{value:{WData:{Favorite:e}},user:t,t:a}=this.props;let n=Array.isArray(e)&&e.includes(t.LocalUserID);return m.a.createElement(O.a,{tooltipContent:a(n?"controlLists.mainView.removeFromFavorites":"controlLists.mainView.addToFavorites"),type:"info"},m.a.createElement("div",{className:n?"star-control-list selected":"star-control-list",onClick:this.markAsFavorite},m.a.createElement("i",{className:"fas fa-star"})))}}b=Object(f.connect)(e=>({user:e.user.user}))(b);var N=Object(E.a)()(b),v=a("VyNe"),D=a("ANjH"),R=a("f0zD"),g=a("qhCA");class w extends m.a.Component{constructor(...e){super(...e),this.onOptionsClick=e=>{this.props.show(g.a,{list:this.props.value}),e.stopPropagation()}}render(){return m.a.createElement(O.a,{tooltipContent:"Ustawienia",type:"info"},m.a.createElement("div",{onClick:this.onOptionsClick},m.a.createElement("i",{className:"fas fa-cog pointer"})))}}var S=w=Object(f.connect)(null,e=>Object(D.b)({show:R.d},e))(w);a("LzsE");class T extends m.a.Component{constructor(...e){super(...e),this.onClick=e=>{this.props.onClick(this.props.value),e.stopPropagation()}}render(){return m.a.createElement(O.a,{tooltipContent:"Wydrukuj",type:"info"},m.a.createElement("div",{onClick:this.onClick},m.a.createElement("i",{className:"fas fa-print pointer"})))}}var C=T;class I extends m.a.Component{constructor(...e){super(...e),this.onClickDiv=()=>{this.props.onRowClick(this.props.object)}}render(){const{object:e,getName:t,getDescription:a,onPrintClick:n}=this.props;return m.a.createElement("div",{className:"mobile-control-list-row",onClick:this.onClickDiv},m.a.createElement("div",{className:"mobile-control-list-row-info"},m.a.createElement("div",{className:"font-weight-bold"},t(e)),m.a.createElement("div",null,a(e))),m.a.createElement(N,{value:e}),m.a.createElement(S,{value:e}),m.a.createElement(C,{value:e,onClick:n}))}}var A=I,j=a("gfib"),y=a("Ry3h"),P=a("JFfd"),k=a("17x9"),_=a.n(k),F=a("Hk1H"),G=a("3Srn"),Y=a("IXwn"),x=a("uSQv"),L=a("NAMD");class W extends m.a.Component{constructor(e){super(e),this.onPrintClick=()=>{this.setState({printing:!0,edit:!1})},this.onOptionsClick=()=>{console.log(this.props.list),this.props.show(g.a,{list:this.props.list})},this.onPrintEnd=()=>{this.setState({printing:!1})},this.onEditClick=()=>{this.setState(e=>({edit:!e.edit}))};const{list:t}=this.props;this.state={printing:!1,dates:t.getDatesForList(),edit:!1}}static getDerivedStateFromProps(e,t){return{dates:e.list.getDatesForList()}}shouldComponentUpdate(e,t){return!c()(this.props,e)||!c()(this.state,t)}componentWillUnmount(){this.setState({printing:!1})}render(){const{showPrintButton:e,name:t,description:a,t:n,headers:r,data:s,mobileRow:i,rowClassName:o,showEditButton:c,onEditClick:l,onRemoveClick:d,showEditAndRemoveOnRow:u}=this.props;console.log(this.props.list);const{printing:h,dates:f,edit:O}=this.state;let E=r.slice(0);return h&&(E.push(G.k),E.push(G.j)),O&&E.push({name:"",component:e=>u(e)?m.a.createElement("i",{className:"fas fa-edit pointer",onClick:()=>l(e)}):null,headerClassName:"index",itemClassName:"index"},{name:"",component:e=>u(e)?m.a.createElement("i",{className:"fas fa-trash pointer",onClick:()=>d(e)}):null,headerClassName:"index",itemClassName:"index"}),m.a.createElement(v.a,null,m.a.createElement(L.a,{printing:h,name:t,additionalText:m.a.createElement("div",null,a,m.a.createElement("div",null,n("controlLists.mainView.rangeOfDates"),": ",f.start.format("DD.MM.YYYY")," - ",f.end.format("DD.MM.YYYY"))),onPrintEnd:this.onPrintEnd},m.a.createElement(p.a,{data:s,headers:E,shouldIndex:!0,mobileRow:i,rowClassName:o,showPagination:s.length>100,paginationItems:100})),e&&m.a.createElement(Y.a,{fixed:!0},c&&m.a.createElement(x.a,{buttonStyle:"round",buttonColor:"secondary",icon:m.a.createElement("i",{className:"fas fa-pencil-alt fa-fw"}),onClick:this.onEditClick}),m.a.createElement(x.a,{buttonStyle:"round",buttonColor:"info",icon:m.a.createElement("i",{className:"fas fa-cog fa-fw"}),onClick:this.onOptionsClick}),m.a.createElement(x.a,{buttonStyle:"round",buttonColor:"success",icon:m.a.createElement("i",{className:"fas fa-print fa-fw"}),onClick:this.onPrintClick})))}}W.propTypes={list:_.a.instanceOf(F.a).isRequired,showPrintButton:_.a.bool,name:_.a.string.isRequired,description:_.a.string.isRequired,headers:_.a.array.isRequired,data:_.a.array.isRequired,mobileRow:_.a.element.isRequired,rowClassName:_.a.func,showEditButton:_.a.bool,onEditClick:_.a.func,onRemoveClick:_.a.func,showEditAndRemoveOnRow:_.a.func},W.defaultProps={showPrintButton:!0,onEditClick:()=>{},onRemoveClick:()=>{},showEditAndRemoveOnRow:()=>!0},W=Object(f.connect)(null,e=>Object(D.b)({show:R.d},e))(W);var M=Object(E.a)()(W),B=a("wd/R"),U=a.n(B);a("p8r+");class K extends m.a.Component{isError(e){return e.isBefore(U()().startOf("day"))}render(){const{t:e,object:{animal:{AnmNo1:t,PlcmntID:a},insemination:{EvTime:n},date:r}}=this.props;let s=this.isError(r);return m.a.createElement("div",{className:"mobile-control-list-data-row".concat(s?" error":"")},m.a.createElement("div",{className:"mobile-control-list-data-row-container"},m.a.createElement("div",null,e("animalNumber"),": ",m.a.createElement("span",{className:"font-weight-bold"},t)),m.a.createElement("div",null,e("location"),": ",Object(G.a)(a)),m.a.createElement("div",null,e("inseminationDate"),": ",U()(n).format("DD.MM.YYYY")),m.a.createElement("div",null,e("examinationDate"),": ",m.a.createElement("span",{className:"font-weight-bold"},r.start?"".concat(r.start.format("DD.MM.YYYY")," - ").concat(r.end.format("DD.MM.YYYY")):r.format("DD.MM.YYYY")))),s&&m.a.createElement("div",{className:"mobile-control-list-data-row-error"},m.a.createElement("i",{className:"fas fa-exclamation-circle"})))}}var V=Object(E.a)()(K);class q extends m.a.Component{constructor(e){super(e),this.rowClassName=e=>{if(e.date.start){if(e.date.start.isBefore(U()().startOf("day")))return"error"}else if(e.date.isBefore(U()().startOf("day")))return"error"};const{list:t,farm:a}=e;this.state={data:Object(G.c)(t,a)}}UNSAFE_componentWillReceiveProps(e,t){c()(this.props.list,e.list)||this.setState({data:Object(G.c)(e.list,e.farm)})}shouldComponentUpdate(e,t,a){return!c()(this.state,t)}render(){const{name:e,description:t,list:a}=this.props,{data:n}=this.state,r=Object(G.r)();return m.a.createElement(M,{headers:r,description:t,list:a,data:n,name:e,mobileRow:m.a.createElement(V,null),rowClassName:this.rowClassName})}}(q=Object(f.connect)(e=>({farm:e.location.farm}))(q)).propTypes={list:_.a.instanceOf(F.a).isRequired,showPrintButton:_.a.bool,name:_.a.string.isRequired,description:_.a.string.isRequired},q.defaultProps={showPrintButton:!0};var z=q,H=a("pQ8y"),X=a("sgBY");class J extends m.a.Component{isError(e){return e.isBefore(U()().startOf("day"))}render(){const{t:e,object:{animal:{AnmNo1:t,PlcmntID:a},insemination:{EvTime:n},date:r,pregnancyDay:s,parturitionDate:i}}=this.props;let o=this.isError(r);return m.a.createElement("div",{className:"mobile-control-list-data-row".concat(o?" error":"")},m.a.createElement("div",{className:"mobile-control-list-data-row-container"},m.a.createElement("div",null,e("animalNumber"),": ",m.a.createElement("span",{className:"font-weight-bold"},t)),m.a.createElement("div",null,e("location"),": ",Object(G.a)(a)),m.a.createElement("div",null,e("inseminationDate"),": ",U()(n).format("DD.MM.YYYY")),m.a.createElement("div",null,e("pregnancyDay"),": ",s),m.a.createElement("div",null,e("parturitionDate"),": ",i.format("DD.MM.YYYY")),m.a.createElement("div",null,e("examinationDate"),": ",m.a.createElement("span",{className:"font-weight-bold"},r.start?"".concat(r.start.format("DD.MM.YYYY")," - ").concat(r.end.format("DD.MM.YYYY")):r.format("DD.MM.YYYY")))),o&&m.a.createElement("div",{className:"mobile-control-list-data-row-error"},m.a.createElement("i",{className:"fas fa-exclamation-circle"})))}}var Z=Object(E.a)()(J);class Q extends m.a.Component{constructor(e){super(e),this.rowClassName=e=>{if(e.date.isBefore(U()().startOf("day")))return"error"};const{list:t,farm:a}=e;this.state={data:Object(G.b)(t,a)}}UNSAFE_componentWillReceiveProps(e,t){c()(this.props.list,e.list)||this.setState({data:Object(G.b)(e.list,e.farm)})}shouldComponentUpdate(e,t,a){return!c()(this.state,t)}render(){const{name:e,list:t,description:a}=this.props,{data:n}=this.state;let r=Object(G.p)();return m.a.createElement(M,{name:e,list:t,data:n,description:a,headers:r,mobileRow:m.a.createElement(Z,null),rowClassName:this.rowClassName})}}(Q=Object(f.connect)(e=>({farm:e.location.farm}))(Q)).propTypes={list:_.a.instanceOf(F.a).isRequired,showPrintButton:_.a.bool,name:_.a.string.isRequired,description:_.a.string.isRequired},Q.defaultProps={showPrintButton:!0};var $=Q;class ee extends m.a.Component{isError(e){return e.isBefore(U()().startOf("day"))}render(){const{t:e,object:{animal:{AnmNo1:t,PlcmntID:a},insemination:{EvTime:n},date:r,pregnancyDay:s,parturitionDate:i}}=this.props;let o=this.isError(r);return m.a.createElement("div",{className:"mobile-control-list-data-row".concat(o?" error":"")},m.a.createElement("div",{className:"mobile-control-list-data-row-container"},m.a.createElement("div",null,e("animalNumber"),": ",m.a.createElement("span",{className:"font-weight-bold"},t)),m.a.createElement("div",null,e("location"),": ",Object(G.a)(a)),m.a.createElement("div",null,e("inseminationDate"),": ",U()(n).format("DD.MM.YYYY")),m.a.createElement("div",null,e("pregnancyDay"),": ",s),m.a.createElement("div",null,e("parturitionDate"),": ",i.format("DD.MM.YYYY")),m.a.createElement("div",null,e("examinationDate"),": ",m.a.createElement("span",{className:"font-weight-bold"},r.start?"".concat(r.start.format("DD.MM.YYYY")," - ").concat(r.end.format("DD.MM.YYYY")):r.format("DD.MM.YYYY")))),o&&m.a.createElement("div",{className:"mobile-control-list-data-row-error"},m.a.createElement("i",{className:"fas fa-exclamation-circle"})))}}var te=Object(E.a)()(ee);class ae extends m.a.Component{constructor(e){super(e),this.rowClassName=e=>{if(e.date.isBefore(U()().startOf("day")))return"error"};const{list:t,farm:a}=e;this.state={data:Object(G.i)(t,a)}}UNSAFE_componentWillReceiveProps(e,t){c()(this.props.list,e.list)||this.setState({data:Object(G.i)(e.list,e.farm)})}shouldComponentUpdate(e,t,a){return!c()(this.state,t)}render(){const{name:e,list:t,description:a}=this.props,{data:n}=this.state;let r=Object(G.x)();return m.a.createElement(M,{name:e,list:t,data:n,description:a,headers:r,mobileRow:m.a.createElement(te,null),rowClassName:this.rowClassName})}}var ne=ae=Object(f.connect)(e=>({farm:e.location.farm}))(ae);class re extends m.a.Component{render(){const{t:e,object:{animal:{AnmNo1:t,PlcmntID:a}}}=this.props;return m.a.createElement("div",{className:"mobile-control-list-data-row"},m.a.createElement("div",{className:"mobile-control-list-data-row-container"},m.a.createElement("div",null,e("animalNumber"),": ",m.a.createElement("span",{className:"font-weight-bold"},t)),m.a.createElement("div",null,e("location"),": ",Object(G.a)(a))))}}var se=Object(E.a)()(re);class ie extends m.a.Component{constructor(e){super(e);const{list:t,farm:a}=e;this.state={data:Object(G.f)(t,a)}}UNSAFE_componentWillReceiveProps(e,t){c()(this.props.list,e.list)||this.setState({data:Object(G.f)(e.list,e.farm)})}shouldComponentUpdate(e,t,a){return!c()(this.state,t)}render(){const{name:e,list:t,description:a}=this.props,{data:n}=this.state;let r=Object(G.u)();return m.a.createElement(M,{name:e,list:t,data:n,description:a,headers:r,mobileRow:m.a.createElement(se,null)})}}var oe=ie=Object(f.connect)(e=>({farm:e.location.farm}))(ie);class ce extends m.a.Component{isError(e){return e.isBefore(U()().startOf("day"))}render(){const{t:e,object:{animal:{AnmNo1:t,PlcmntID:a},transferDate:n,currentSector:r,nextSector:s}}=this.props;let i=this.isError(n);return m.a.createElement("div",{className:"mobile-control-list-data-row".concat(i?" error":"")},m.a.createElement("div",{className:"mobile-control-list-data-row-container"},m.a.createElement("div",null,e("animalNumber"),": ",m.a.createElement("span",{className:"font-weight-bold"},t)),m.a.createElement("div",null,e("location"),": ",Object(G.a)(a)),m.a.createElement("div",null,e("currentSector"),": ",Object(G.o)(r)),m.a.createElement("div",null,e("nextSector"),": ",Object(G.o)(s)),m.a.createElement("div",null,e("transferDate"),": ",m.a.createElement("span",{className:"font-weight-bold"},n.format("DD.MM.YYYY")))),i&&m.a.createElement("div",{className:"mobile-control-list-data-row-error"},m.a.createElement("i",{className:"fas fa-exclamation-circle"})))}}var le=Object(E.a)()(ce);class me extends m.a.Component{constructor(e){super(e),this.rowClassName=e=>{if(e.transferDate.isBefore(U()().startOf("day")))return"error"};const{list:t,farm:a}=e;this.state={data:Object(G.g)(t,a)}}UNSAFE_componentWillReceiveProps(e,t){c()(this.props.list,e.list)||this.setState({data:Object(G.g)(e.list,e.farm)})}shouldComponentUpdate(e,t,a){return!c()(this.state,t)}render(){const{name:e,list:t,description:a}=this.props,{data:n}=this.state;let r=Object(G.v)();return m.a.createElement(M,{name:e,list:t,data:n,description:a,headers:r,mobileRow:m.a.createElement(le,null),rowClassName:this.rowClassName})}}me=Object(f.connect)(e=>({farm:e.location.farm}))(me);var de=me=Object(E.a)()(me);class ue extends m.a.Component{isError(e){return e.isBefore(U()().startOf("day"))}render(){const{t:e,object:{animal:{AnmNo1:t,PlcmntID:a},parturitionDate:n,pregnancyDay:r},object:s}=this.props;let i=this.isError(n);return m.a.createElement("div",{className:"mobile-control-list-data-row".concat(i?" error":"")},m.a.createElement("div",{className:"mobile-control-list-data-row-container"},m.a.createElement("div",null,e("animalNumber"),": ",m.a.createElement("span",{className:"font-weight-bold"},t)),m.a.createElement("div",null,e("location"),": ",Object(G.a)(a)),m.a.createElement("div",null,e("inseminationDate"),": ",Object(G.m)(s)),m.a.createElement("div",null,e("pregnancyDay"),": ",r),m.a.createElement("div",null,e("parturitionDate"),": ",m.a.createElement("span",{className:"font-weight-bold"},n.format("DD.MM.YYYY")))),i&&m.a.createElement("div",{className:"mobile-control-list-data-row-error"},m.a.createElement("i",{className:"fas fa-exclamation-circle"})))}}var pe=Object(E.a)()(ue);class he extends m.a.Component{constructor(e){super(e),this.rowClassName=e=>{if(e.parturitionDate.isBefore(U()().startOf("day")))return"error"};const{list:t,farm:a}=e;this.state={data:Object(G.d)(t,a)}}UNSAFE_componentWillReceiveProps(e,t){c()(this.props.list,e.list)||this.setState({data:Object(G.d)(e.list,e.farm)})}shouldComponentUpdate(e,t,a){return!c()(this.state,t)}render(){const{name:e,list:t,description:a}=this.props,{data:n}=this.state;let r=Object(G.s)();return m.a.createElement(M,{name:e,list:t,data:n,description:a,headers:r,mobileRow:m.a.createElement(pe,null),rowClassName:this.rowClassName})}}var fe=he=Object(f.connect)(e=>({farm:e.location.farm}))(he),Oe=a("pxzG"),Ee=a("eASP");class be extends m.a.Component{isError(e){return e.isBefore(U()().startOf("day"))}render(){const{t:e,object:{animal:{AnmNo1:t,PlcmntID:a},date:n,weight:r,lastWeighting:s,medicine:i}}=this.props;let o=this.isError(n);return m.a.createElement("div",{className:"mobile-control-list-data-row".concat(o?" error":"")},m.a.createElement("div",{className:"mobile-control-list-data-row-container"},m.a.createElement("div",null,e("animalNumber"),": ",m.a.createElement("span",{className:"font-weight-bold"},t)),m.a.createElement("div",null,e("location"),": ",Object(G.a)(a)),m.a.createElement("div",null,e("weight"),": ",r?Object(Oe.j)(r,{unit:Ee.a.MEDIUM,showUnit:!0}):"-"),m.a.createElement("div",null,e("lastWeighting"),": ",s?U()(s.EvTime).format("DD.MM.YYYY"):"-"),m.a.createElement("div",null,e("medicine"),": ",Object(G.n)(i)),m.a.createElement("div",null,e("dosage"),": ",Object(G.l)(i)),m.a.createElement("div",null,e("date"),": ",m.a.createElement("span",{className:"font-weight-bold"},n.format("DD.MM.YYYY")))),o&&m.a.createElement("div",{className:"mobile-control-list-data-row-error"},m.a.createElement("i",{className:"fas fa-exclamation-circle"})))}}var Ne=Object(E.a)()(be),ve=a("42VQ"),De=a("5Z9N"),Re=a("dAwh"),ge=a("XzT5");class we extends m.a.Component{constructor(e){super(e),this.rowClassName=e=>{if(e.date.isBefore(U()().startOf("day")))return"error"},this.onRemoveTreatmentClick=e=>{const{t:t}=this.props,{value:{event:a,date:n,treatmentIndex:r}}=e;this.props.show(ve.a,{title:t("dateTreatmentRemoveTitle"),text:ge.a.t("dateRemoveText",{date:n.format("DD.MM.YYYY")}),confirmText:t("yes"),onConfirmed:e=>{const{user:t}=this.props;let s=a.clone();s.removeDate(n.toDate().getTime(),r),this.props.updateEvent(s.prepareBeanToSave(),t.ClientID,t.LocalUserID),e.handleHide()}})},this.onEditClick=e=>{this.props.show(Re.a,{treatment:e.value.event})},this.showEditAndRemoveOnRow=e=>!!e.value.event;const{list:t,farm:a,animalKind:n,medicineType:r}=e;this.state={data:Object(G.h)(t,a,n,r)}}UNSAFE_componentWillReceiveProps(e,t){c()(this.props.list,e.list)&&c()(this.props.events,e.events)||this.setState({data:Object(G.h)(e.list,e.farm,e.animalKind,e.medicineType)})}shouldComponentUpdate(e,t,a){return!c()(this.props.list,e.list)||!c()(this.state,t)}render(){const{name:e,list:t,description:a}=this.props,{data:n}=this.state;let r=Object(G.w)();return m.a.createElement(m.a.Fragment,null,m.a.createElement(M,{name:e,list:t,data:n,description:a,headers:r,mobileRow:m.a.createElement(Ne,null),rowClassName:this.rowClassName,showEditButton:!0,onRemoveClick:this.onRemoveTreatmentClick,onEditClick:this.onEditClick,showEditAndRemoveOnRow:this.showEditAndRemoveOnRow}),m.a.createElement(Re.b,null))}}we=Object(f.connect)(e=>({farm:e.location.farm,user:e.user.user,events:e.events.events}),e=>Object(D.b)({show:R.d,updateEvent:De.e},e))(we);var Se=Object(E.a)()(we),Te=a("tkTQ"),Ce=a("r8wt");class Ie extends m.a.Component{isError(e){return e{if(e.parturition&&e.parturition.EvTime({farm:e.location.farm}))(je)).propTypes={list:_.a.instanceOf(F.a).isRequired,showPrintButton:_.a.bool,name:_.a.string.isRequired,description:_.a.string.isRequired},je.defaultProps={showPrintButton:!0};var ye=je;a("Ey+N");class Pe extends l.Component{constructor(e){super(e),this.state={animalKinds:ge.a.t("animalKind",{returnObjects:!0})}}componentDidUpdate(e,t,a){e!==this.props&&this.setState({animalKinds:ge.a.t("animalKind",{returnObjects:!0})})}render(){console.log(this.props);const{object:{animalKind:e}}=this.props,{animalKinds:t}=this.state;return m.a.createElement("h6",{className:"control-list-full-width"},t[e])}}var ke=Object(f.connect)()(Pe);function _e(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Fe(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Ge extends m.a.Component{constructor(e){super(e),this.getName=e=>Object(G.q)(e.WordID),this.getDescription=e=>{const{t:t}=this.props;switch(e.WordID){case P.a.INSEMINATIONS:let a=e.WData.InseminationTime;return ge.a.t("controlLists.mainView.inseminationDescription",{count:Array.isArray(a)?"".concat(a[0]," - ").concat(a[1]):a});case P.a.CONDITION:let n=e.WData.ConditionDays;return ge.a.t("controlLists.mainView.conditionsDescription",{amount:n.join(", ")});case P.a.USG:let r=e.WData.USGDays;return ge.a.t("controlLists.mainView.usgDescription",{amount:r.join(", ")});case P.a.SOWS_TO_INSEMINATION:return t("controlLists.mainView.sowsToInseminationDescription");case P.a.SOWS_TO_TRANSFER:return t("controlLists.mainView.sowsToTransferDescription");case P.a.PLANNED_PARTURITIONS:return t("controlLists.mainView.plannedParturitionsDescriptions");case P.a.SOWS_TO_GRAFTING:return t("controlLists.mainView.sowsToGraftingDescription");case P.a.BOARS_TO_GRAFRING:return t("controlLists.mainView.boarsToGraftingDescription");case P.a.PORKER_TO_GRAFTING:return t("controlLists.mainView.porkerToGraftingDescription");case P.a.PIGLET_TO_GRAFTING:return t("controlLists.mainView.pigletToGraftingDescription");case P.a.SOWS_FORAGE:return t("controlLists.mainView.sowsForageDescription");case P.a.BOARS_FORAGE:return t("controlLists.mainView.boarsForageDescription");case P.a.PORKER_FORAGE:return t("controlLists.mainView.porkerForageDescription");case P.a.PIGLET_FORAGE:return t("controlLists.mainView.pigletForageDescription");case P.a.SOWS_DOSATRON:return t("controlLists.mainView.sowsDosatronDescription");case P.a.BOARS_DOSATRON:return t("controlLists.mainView.boarsDosatronDescription");case P.a.PORKER_DOSATRON:return t("controlLists.mainView.porkerDosatronDescription");case P.a.PIGLET_DOSATRON:return t("controlLists.mainView.pigletDosatronDescription");case P.a.SOWS_STIMULATOR:return t("controlLists.mainView.sowsStimulatorDescription");case P.a.REMANENT:return t("controlLists.mainView.remanentDescription");default:return""}},this.onTabChange=e=>{const{tabs:t}=this.state,{match:{params:{FarmID:a}}}=this.props;this.props.history.push("/".concat(a,"/controlLists/").concat(t[e].key))},this.onRowClick=e=>{const{match:{params:{FarmID:t}}}=this.props;this.props.history.push("/".concat(t,"/controlLists/").concat(e.WordID))},this.onPrintClick=e=>{this.setState({printing:!0,name:this.getName(e),description:this.getDescription(e),data:this.getDataForPrint(e),headers:this.getHeadersForPrint(e),dates:e.getDatesForList()})},this.onPrintEnd=()=>{this.setState({printing:!1})},this.state=function(e){for(var t=1;t{let a=ge.a.t("animalKind",{returnObjects:!0})[this.getAnimalKind(e)],n=ge.a.t("animalKind",{returnObjects:!0})[this.getAnimalKind(t)];return a||n?a?n?a.localeCompare(n):-1:1:0}),tabs:n};return t&&(r.active=this.getTabIndexFromPathParams(n,e.match.params.active)),r}getTabIndexFromPathParams(e,t){let a=r()(e,e=>e.key===t);return a>=0?a:null}getTabs(e,t){const{t:a,user:{LocalUserID:n}}=t;let r=[{name:a("all"),key:"all"}];for(let s of e)Array.isArray(s.WData.Favorite)&&s.WData.Favorite.includes(n)&&r.push({name:this.getName(s),key:s.WordID});return r}getComponentClass(e){switch(e.WordID){case P.a.INSEMINATIONS:return z;case P.a.CONDITION:return $;case P.a.USG:return ne;case P.a.SOWS_TO_INSEMINATION:return oe;case P.a.SOWS_TO_TRANSFER:return de;case P.a.PLANNED_PARTURITIONS:return fe;case P.a.SOWS_TO_GRAFTING:case P.a.BOARS_TO_GRAFRING:case P.a.PORKER_TO_GRAFTING:case P.a.PIGLET_TO_GRAFTING:case P.a.SOWS_FORAGE:case P.a.BOARS_FORAGE:case P.a.PORKER_FORAGE:case P.a.PIGLET_FORAGE:case P.a.SOWS_DOSATRON:case P.a.BOARS_DOSATRON:case P.a.PORKER_DOSATRON:case P.a.PIGLET_DOSATRON:case P.a.SOWS_STIMULATOR:return Se;case P.a.REMANENT:return ye;default:return"div"}}getAnimalKind(e){switch(e.WordID){case P.a.SOWS_TO_GRAFTING:case P.a.SOWS_FORAGE:case P.a.SOWS_DOSATRON:case P.a.SOWS_STIMULATOR:case P.a.SOWS_TO_TRANSFER:case P.a.REMANENT:case P.a.INSEMINATIONS:case P.a.USG:case P.a.CONDITION:case P.a.PLANNED_PARTURITIONS:case P.a.SOWS_TO_INSEMINATION:return Te.a.SOW;case P.a.BOARS_TO_GRAFRING:case P.a.BOARS_FORAGE:case P.a.BOARS_DOSATRON:return Te.a.BOAR;case P.a.PORKER_TO_GRAFTING:case P.a.PORKER_FORAGE:case P.a.PORKER_DOSATRON:return Te.a.PORKER;case P.a.PIGLET_TO_GRAFTING:case P.a.PIGLET_FORAGE:case P.a.PIGLET_DOSATRON:return Te.a.PIGLET;default:return null}}getMedicineType(e){switch(e.WordID){case P.a.SOWS_TO_GRAFTING:case P.a.BOARS_TO_GRAFRING:case P.a.PORKER_TO_GRAFTING:case P.a.PIGLET_TO_GRAFTING:return Ce.b.VACCINE;case P.a.SOWS_FORAGE:case P.a.BOARS_FORAGE:case P.a.PORKER_FORAGE:case P.a.PIGLET_FORAGE:return Ce.b.FORAGE;case P.a.SOWS_DOSATRON:case P.a.BOARS_DOSATRON:case P.a.PORKER_DOSATRON:case P.a.PIGLET_DOSATRON:return Ce.b.DOSATRON;case P.a.SOWS_STIMULATOR:return Ce.b.STIMULATOR;default:return null}}getComponent(e,t){try{return m.a.createElement(this.getComponentClass(e),{list:e,key:t,name:this.getName(e),description:this.getDescription(e),animalKind:this.getAnimalKind(e),medicineType:this.getMedicineType(e)},null)}catch(a){return console.error(a),m.a.createElement("div",{key:t})}}getComponentByTab(e,t){const{controlLists:a}=this.props;let n=a.find(t=>t.WordID===e.key);return this.getComponent(n,t)}getDataForPrint(e){const{farm:t}=this.props;switch(e.WordID){case P.a.INSEMINATIONS:return Object(G.c)(e,t);case P.a.CONDITION:return Object(G.b)(e,t);case P.a.USG:return Object(G.i)(e,t);case P.a.SOWS_TO_INSEMINATION:return Object(G.f)(e,t);case P.a.SOWS_TO_TRANSFER:return Object(G.g)(e,t);case P.a.PLANNED_PARTURITIONS:return Object(G.d)(e,t);case P.a.SOWS_TO_GRAFTING:return Object(G.h)(e,t,Te.a.SOW,Ce.b.VACCINE);case P.a.BOARS_TO_GRAFRING:return Object(G.h)(e,t,Te.a.BOAR,Ce.b.VACCINE);case P.a.PORKER_TO_GRAFTING:return Object(G.h)(e,t,Te.a.PORKER,Ce.b.VACCINE);case P.a.PIGLET_TO_GRAFTING:return Object(G.h)(e,t,Te.a.PIGLET,Ce.b.VACCINE);case P.a.SOWS_FORAGE:return Object(G.h)(e,t,Te.a.SOW,Ce.b.FORAGE);case P.a.BOARS_FORAGE:return Object(G.h)(e,t,Te.a.BOAR,Ce.b.FORAGE);case P.a.PORKER_FORAGE:return Object(G.h)(e,t,Te.a.PORKER,Ce.b.FORAGE);case P.a.PIGLET_FORAGE:return Object(G.h)(e,t,Te.a.PIGLET,Ce.b.FORAGE);case P.a.SOWS_DOSATRON:return Object(G.h)(e,t,Te.a.SOW,Ce.b.DOSATRON);case P.a.BOARS_DOSATRON:return Object(G.h)(e,t,Te.a.BOAR,Ce.b.DOSATRON);case P.a.PORKER_DOSATRON:return Object(G.h)(e,t,Te.a.PORKER,Ce.b.DOSATRON);case P.a.PIGLET_DOSATRON:return Object(G.h)(e,t,Te.a.PIGLET,Ce.b.DOSATRON);case P.a.SOWS_STIMULATOR:return Object(G.h)(e,t,Te.a.SOW,Ce.b.STIMULATOR);default:return[]}}getHeadersForPrint(e){let t;switch(e.WordID){case P.a.INSEMINATIONS:t=Object(G.r)();break;case P.a.CONDITION:t=Object(G.p)();break;case P.a.USG:t=Object(G.x)();break;case P.a.SOWS_TO_INSEMINATION:t=Object(G.u)();break;case P.a.SOWS_TO_TRANSFER:t=Object(G.v)();break;case P.a.PLANNED_PARTURITIONS:t=Object(G.s)();break;case P.a.SOWS_TO_GRAFTING:case P.a.BOARS_TO_GRAFRING:case P.a.PORKER_TO_GRAFTING:case P.a.PIGLET_TO_GRAFTING:case P.a.SOWS_FORAGE:case P.a.PORKER_FORAGE:case P.a.BOARS_FORAGE:case P.a.PIGLET_FORAGE:case P.a.SOWS_DOSATRON:case P.a.BOARS_DOSATRON:case P.a.PORKER_DOSATRON:case P.a.PIGLET_DOSATRON:case P.a.SOWS_STIMULATOR:t=Object(G.w)();break;default:t=[]}return[...t,G.j]}getHeader(){const{t:e,controlLists:t,match:{params:{active:a}}}=this.props;let n=e("controlLists.mainView.header"),r=t.find(e=>e.WordID===a);return r&&(n+=" - ".concat(this.getName(r))),n}render(){const{t:e,user:{LocalUserID:t}}=this.props,{lists:a,active:n,tabs:r,printing:s,data:i,name:o,description:c,dates:l}=this.state;let h=[];for(let[m,d]of a.entries())if(this.getName(d)){let e=this.getAnimalKind(d),t=a[m-1];if(t){e!==this.getAnimalKind(t)&&h.push({fullWidthRow:!0,animalKind:e})}else h.push({fullWidthRow:!0,animalKind:e});h.push(d)}const f=[{name:e("designation"),valueFormatter:this.getName,headerClassName:"grid-name",itemClassName:"grid-name"},{name:e("controlLists.mainView.description"),valueFormatter:this.getDescription},{name:"",component:m.a.createElement(N,null),headerClassName:"index",itemClassName:"index"},{name:"",headerClassName:"index",itemClassName:"index",component:m.a.createElement(S,null)},{name:"",headerClassName:"index",itemClassName:"index",component:m.a.createElement(C,{onClick:this.onPrintClick})}];return m.a.createElement("div",{className:"control-list-view"},m.a.createElement(d.a,{text:this.getHeader(),tabs:r,active:n,onTabChange:this.onTabChange}),m.a.createElement(u.a,{addPaddingForButtons:!0},m.a.createElement("div",{className:"position-relative w-100"},m.a.createElement(j.a,{activeKey:n,onSlide:this.onTabChange},r.map((e,t)=>"all"===e.key?m.a.createElement(y.a,{key:t},m.a.createElement(v.a,null,m.a.createElement(p.a,{data:h,headers:f,shouldIndex:!0,mobileRow:m.a.createElement(A,{getName:this.getName,getDescription:this.getDescription,onRowClick:this.onRowClick,onPrintClick:this.onPrintClick}),onRowClick:this.onRowClick,isFullWidthRow:e=>e.fullWidthRow,fullWidthRow:m.a.createElement(ke,null),fullWidthRowGroups:!0}))):m.a.createElement(y.a,{key:t},this.getComponentByTab(e,t)))),m.a.createElement("div",{style:{marginTop:15}},a.filter(e=>!Array.isArray(e.WData.Favorite)||!e.WData.Favorite.includes(t)).map((e,t)=>m.a.createElement(H.a,{in:this.props.match.params.active===e.WordID,timeout:300,classNames:"slide-in",mountOnEnter:!0,unmountOnExit:!0,appear:!0},this.getComponent(e,t))))),s&&m.a.createElement("div",{className:"d-none"},m.a.createElement(L.a,{printing:s,name:o,additionalText:m.a.createElement("div",null,c,m.a.createElement("div",null,e("controlLists.mainView.rangeOfDates"),": ",l.start.format("DD.MM.YYYY")," - ",l.end.format("DD.MM.YYYY"))),onPrintEnd:this.onPrintEnd},m.a.createElement(X.a,{headers:this.state.headers,data:i,shouldIndex:!0})))),m.a.createElement(g.b,null))}}Ge=Object(f.connect)(e=>({controlLists:e.dictionary.controlLists,farm:e.location.farm,user:e.user.user}))(Ge),Ge=Object(E.a)()(Ge);t.default=Ge},IP7v:function(e,t,a){},J14G:function(e,t,a){"use strict";a.r(t),a.d(t,"DebugDispenserView",(function(){return E})),a.d(t,"_DebugDispenserView",(function(){return b}));var n,r=a("q1tI"),s=a.n(r),i=a("/MKj"),o=a("zDJl"),c=a("wd/R"),l=a.n(c),m=a("/kok"),d=a("r3a2"),u=a("qx5e"),p=a("s506"),h=a("mr+a");function f(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function O(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}let E=Object(i.connect)(e=>({devices:e.farmDevices.devices,shadows:e.shadows.shadows,curves:Object(h.c)(e)}))(n=class extends r.Component{constructor(e){super(e),this.state={selectedDevice:"",gridData:[]}}onChange(e){if(e.target.value){let t=JSON.parse(e.target.value);this.setState({selectedDevice:t,gridData:[]}),m.a.startSendingDeviceState(t),Object(d.b)(t)}}UNSAFE_componentWillReceiveProps(e){if(console.log(e),this.state.selectedDevice){let t=e.shadows.get(this.state.selectedDevice.DevID);if(t&&t.dispensers){console.log(this.state.selectedDevice);let a=this.state.selectedDevice.Dispensers.map((a,n)=>{let r=t.dispensers[n];console.log(r);let s=function(e){for(var t=1;te.SetData.Index===r.curveNumber-1)[0];if(console.log("curve",i),i){let e=l()(r.curveStart);console.log(e);let t=l()().startOf("day").diff(e,"days");console.log("diffInDays",t),t>=i.SetData.Days.length&&(t=i.SetData.Days.length-1),console.log("diffInDays",t);let a=i.SetData.Days[t];console.log("currentDay",a),s.curveIndex=t+1,s.scheduleIndex=a.DailyPlan+1}return t.debugDispensers&&(s.frame=t.debugDispensers[n],s.hex=t.hexString),s});this.setState({gridData:a}),console.log(a)}}}checkIfRowHasDifference(e){if(e.frame){if(e.curveNumber!==e.frame.curveNumber)return!0;if(void 0!==e.curveIndex&&e.curveIndex!==e.frame.curveIndex)return!0;if(void 0!==e.scheduleIndex&&e.scheduleIndex!==e.frame.scheduleIndex)return!0;if(void 0!==e.curveShift&&e.curveShift!==e.frame.curveShift)return!0;if(void 0!==e.doseCorrection&&e.doseCorrection!==e.frame.doseCorrection)return!0;if(void 0!==e.denseFoodMaxYield&&e.denseFoodMaxYield!==e.frame.denseEfficiency)return!0;if(void 0!==e.looseFoodMaxYield&&e.looseFoodMaxYield!==e.frame.looseEfficiency)return!0}return!1}checkIfCellHasDifference(e,t,a){return!(!e.frame||(console.log(e[t]),void 0===e[t]||e[t]===e.frame[a]))}render(){let e=this.props.devices.filter(e=>e.DevType===o.d.DISPENSER).sort((e,t)=>e.Address-t.Address);return s.a.createElement("div",null,s.a.createElement("select",{onChange:e=>this.onChange(e),value:JSON.stringify(this.state.selectedDevice)},s.a.createElement("option",{value:""}),e.map(e=>s.a.createElement("option",{key:e.DevID,value:JSON.stringify(e)},"".concat(e.Name,"/").concat(e.DevID,"/").concat(e.Address)))),this.state.gridData.length>0&&s.a.createElement("table",{style:{width:"100%",marginTop:10},className:"grid"},s.a.createElement("thead",null,s.a.createElement("tr",null,s.a.createElement("th",null,"Numer dozownika"),s.a.createElement("th",null,"Numer krzywej"),s.a.createElement("th",null,"Indeks krzywej"),s.a.createElement("th",null,"Indeks harmonogramu"),s.a.createElement("th",null,"Indeks dawki"),s.a.createElement("th",null,"Przusni\u0119cie dnia"),s.a.createElement("th",null,"Przesuni\u0119cie dawki"),s.a.createElement("th",null,"Wydajno\u015b\u0107 g\u0119sta"),s.a.createElement("th",null,"Wydajno\u015b\u0107 rzadka"),s.a.createElement("th",null,"Ostatni dzie\u0144 krzywej"),s.a.createElement("th",null,"Opcje dozownika"),s.a.createElement("th",null,"Dawka zadana"),s.a.createElement("th",null,"Dawka pozosta\u0142a"),s.a.createElement("th",null,"Dawka dzienna"),s.a.createElement("th",null,"Dawka procentowa"),s.a.createElement("th",null,"Ramka diagnostyczna"))),s.a.createElement("tbody",null,this.state.gridData.map((e,t)=>s.a.createElement("tr",{key:t,className:this.checkIfRowHasDifference(e)?"debug-errors":""},s.a.createElement("td",null,e.dispenserNumber),s.a.createElement("td",{style:this.checkIfCellHasDifference(e,"curveNumber","curveNumber")?{background:"#f44b4b",color:"#fff"}:{}},"".concat(e.curveNumber,"/").concat(e.frame?e.frame.curveNumber:"")),s.a.createElement("td",{style:this.checkIfCellHasDifference(e,"curveIndex","curveIndex")?{background:"#f44b4b",color:"#fff"}:{}},"".concat(e.curveIndex,"/").concat(e.frame?e.frame.curveIndex:"")),s.a.createElement("td",{style:this.checkIfCellHasDifference(e,"scheduleIndex","scheduleNumber")?{background:"#f44b4b",color:"#fff"}:{}},"".concat(e.scheduleIndex,"/").concat(e.frame?e.frame.scheduleNumber:"")),s.a.createElement("td",null,e.frame?e.frame.scheduleIndex:""),s.a.createElement("td",{style:this.checkIfCellHasDifference(e,"curveShift","curveShift")?{background:"#f44b4b",color:"#fff"}:{}},"".concat(e.curveShift,"/").concat(e.frame?e.frame.curveShift:"")),s.a.createElement("td",{style:this.checkIfCellHasDifference(e,"doseCorrection","doseCorrection")?{background:"#f44b4b",color:"#fff"}:{}},"".concat(e.doseCorrection,"/").concat(e.frame?e.frame.doseCorrection:"")),s.a.createElement("td",{style:this.checkIfCellHasDifference(e,"foodType1Yield","denseEfficiency")?{background:"#f44b4b",color:"#fff"}:{}},"".concat(e.foodType1Yield,"/").concat(e.frame?e.frame.yield0:"")),s.a.createElement("td",{style:this.checkIfCellHasDifference(e,"foodType2Yield","looseEfficiency")?{background:"#f44b4b",color:"#fff"}:{}},"".concat(e.foodType2Yield,"/").concat(e.frame?e.frame.yield1:"")),s.a.createElement("td",null,e.frame?e.frame.lastCurveDay:""),s.a.createElement("td",null,e.frame?e.frame.status:""),s.a.createElement("td",null,e.frame?e.frame.doseGiven:""),s.a.createElement("td",null,e.frame?e.frame.doseLeft:""),s.a.createElement("td",null,e.frame?e.frame.doseDaily:""),s.a.createElement("td",null,e.frame?e.frame.dosePercent:""),s.a.createElement("td",null,e.hex))))))}})||n;const b=E;E=Object(u.a)({roles:[p.c._SERVICE],showComponent:!0})(E),t.default=E},LzsE:function(e,t,a){},R6ck:function(e,t,a){"use strict";a.r(t),a.d(t,"_AcceptDocumentView",(function(){return _}));var n,r=a("Z0cm"),s=a.n(r),i=a("mwIZ"),o=a.n(i),c=a("UfWW"),l=a.n(c),m=a("4qC0"),d=a.n(m),u=a("q1tI"),p=a.n(u),h=a("XSU/"),f=a("2tEe"),O=a("/MKj"),E=a("udB/"),b=a("5WSC"),N=a("S8cm"),v=a("VyNe"),D=a("IXwn"),R=a("uSQv"),g=a("2wEF"),w=a("17x9"),S=a.n(w),T=a("Ty5D"),C=a("CwRS"),I=a("LCzB");function A(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function j(e){for(var t=1;t({locale:e.language.locale,documents:e.documents.documents,user:e.user.user}))(n=class extends p.a.Component{constructor(e){super(e),this.checkIfDocRead=(e=this.props)=>{const{user:t,history:a,match:{params:{documentId:n}}}=e;(t.DocRead||[]).includes(n)&&a.push("/")},this.fetchDocument=e=>{this.setState({initialValue:P},()=>{fetch(e).then(e=>200!==e.status?Promise.reject(e):e.text()).then(e=>{this.setState(j({},P,{fetched:!0,loaded:!0,data:e}))}).catch(e=>{this.setState(j({},P,{fetched:!0,loaded:!1}))})})},this.onReadClick=()=>{const{dispatch:e,history:t}=this.props,{documentToRead:{DocID:a}}=this.state;e(Object(C.b)(a)),t.push("/")},this.state=P;const{history:t,match:{params:{documentId:a}},documents:n=[]}=this.props;let r=n.find(e=>e.DocID===a);r||t.push("/"),this.checkIfDocRead(),this.state=j({},this.state,{documentToRead:r})}UNSAFE_componentWillReceiveProps(e,t){this.checkIfDocRead(e)}UNSAFE_componentWillMount(){const{documentToRead:e}=this.state;if(e)if(d()(e.Link))this.fetchDocument(e.Link);else{const{locale:t}=this.props;let a=l()(e.Lang,e=>e===t);this.fetchDocument(e.Link[a>-1?a:0])}}render(){const{read:e,loaded:t,fetched:a,time:n,data:r,documentToRead:i}=this.state,{locale:c,t:m}=this.props;let d=o()(i,"Name"),u=l()(o()(i,"Lang",[]),e=>e===c);return d=s()(d)?d[u>-1?u:0]:d,p.a.createElement("div",{className:"accept-document-view"},p.a.createElement(h.a,{text:d}),p.a.createElement(f.a,null,p.a.createElement(v.a,{style:{minHeight:"10rem"}},p.a.createElement(E.a,{isLoading:!a}),a&&t&&p.a.createElement(p.a.Fragment,null,p.a.createElement(b.a,{style:{maxHeight:"calc(90vh - 10rem"},onTriggered:e=>this.setState({time:e})},p.a.createElement("div",{className:"document-content",dangerouslySetInnerHTML:{__html:r}})),p.a.createElement(N.a,{label:m("readAndAccept"),disabled:!n,checked:e,onChange:()=>this.setState({read:!e})})),a&&!t&&p.a.createElement(g.a,null)),p.a.createElement(D.a,{fixed:!0},p.a.createElement(R.a,{onClick:()=>this.onReadClick(),buttonStyle:"round",buttonColor:e?"success":"info",disabled:!e,icon:p.a.createElement("i",{className:"fas fa-check"})}))))}})||n;k.propTypes={documentToRead:S.a.string.isRequired};const _=k;k=Object(T.o)(k),t.default=Object(I.a)()(k)},X9Z5:function(e,t,a){},ZrQL:function(e,t,a){"use strict";a.r(t);var n=a("q1tI"),r=a.n(n),s=a("/MKj"),i=a("LCzB"),o=a("ANjH"),c=a("XSU/"),l=a("qMm6"),m=a("2tEe");class d extends n.Component{render(){const{t:e}=this.props;return r.a.createElement("div",null,r.a.createElement(c.a,{text:e("alarms")}),r.a.createElement(m.a,null,r.a.createElement(l.a,null)))}}t.default=Object(o.d)(Object(i.a)(),Object(s.connect)((function(e){return{farm:e.location.farm}})))(d)},fSq7:function(e,t,a){"use strict";a.r(t);var n,r=a("BkRI"),s=a.n(r),i=a("q1tI"),o=a.n(i),c=a("17x9"),l=a.n(c),m=a("XSU/"),d=a("2tEe"),u=a("/MKj"),p=a("tQsb"),h=a("r9cP"),f=a("LCzB"),O=a("VyNe"),E=(a("8Psb"),a("VfnB")),b=a("wd/R"),N=a.n(b);let v=Object(u.connect)(e=>({documents:e.documents.documents}))(n=class extends o.a.Component{constructor(e){super(e),this.onArrowClick=()=>{this.props.history.goBack()},this.checkGatewaysCompilationData=e=>{const{status:t}=e,a=[...t.values()];return a.length>0?a:[]},this.state={items:10}}render(){const{documents:e,t:t}=this.props;let a=s()(e);a=a.filter(e=>"CHANGELOG"===e.Type),a.sort((e,t)=>t.DtaModTime-e.DtaModTime);const n=this.checkGatewaysCompilationData(this.props);return o.a.createElement("div",{className:"change-log"},o.a.createElement(m.a,{text:o.a.createElement(o.a.Fragment,null,o.a.createElement("span",null,o.a.createElement("i",{className:"fas fa-fw fa-arrow-left pointer",onClick:this.onArrowClick})),t("changeLogView.header"))}),o.a.createElement(d.a,null,a.map((e,t)=>o.a.createElement(p.a,{key:t,header:Object(h.a)(e),path:Object(h.b)(e),time:e.DtaCrtTime}))),n.length>1&&o.a.createElement(d.a,null,o.a.createElement(O.a,{className:"gateway-viewer",style:{minHeight:"10rem"}},o.a.createElement("h4",{className:"align-content-center justify-content-between"},"Gateways"),n.map(e=>o.a.createElement("div",null,o.a.createElement("p",null,"".concat(Object(E.l)(e.GatewayID),": ").concat(e.version)," - ",N()(e.compilation).format("DD.MM.YYYY")),o.a.createElement("hr",null))))))}})||n;v.propTypes={path:l.a.string.isRequired},v=Object(u.connect)(e=>({status:e.mqtt.status}))(v),t.default=Object(f.a)()(v)},mb31:function(e,t,a){"use strict";a.r(t),a.d(t,"ConfirmUserView",(function(){return u}));var n,r=a("q1tI"),s=a.n(r),i=a("3Z9Z"),o=a("JI6e"),c=(a("3dCX"),a("39gQ")),l=a("Akpi"),m=a("LCzB"),d=a("/MKj");let u=Object(d.connect)()(n=class extends s.a.Component{componentDidMount(){const{match:{params:e},dispatch:t,history:a}=this.props;t(Object(l.b)(e.username,e.code)),a.push("/login")}render(){const{t:e}=this.props;return s.a.createElement("div",{className:"confirm-wrapper"},s.a.createElement(i.a,{bsPrefix:"row h-100 justify-content-center align-items-center w-100 mx-auto"},s.a.createElement(o.a,{lg:4},s.a.createElement("img",{src:c.a,alt:"fetura-logo"}),s.a.createElement("div",{className:"login-info"},s.a.createElement("p",null,e("confirmUserView.authorization")),s.a.createElement("div",{id:"wave"},s.a.createElement("span",{className:"dot"}),s.a.createElement("span",{className:"dot"}),s.a.createElement("span",{className:"dot"}))))))}})||n;t.default=Object(m.a)()(u)},"p8r+":function(e,t,a){}}]); //# sourceMappingURL=main~defe45ab.dbad2197.chunk.js.map