(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[60],{"1H/7":function(e,t,a){},"42xM":function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n);a("xN95");class o extends s.a.Component{render(){const{children:e,error:t}=this.props;return s.a.createElement("div",{className:"input-alike-container ".concat(t?"error":"")},e)}}t.a=o},"5PAS":function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("/MKj"),r=a("10H7"),i=a("VyNe"),l=a("AAik"),c=a("wd/R"),m=a.n(c),d=a("LCzB"),p=a("yjtO"),h=a("BvFm");class u extends n.Component{constructor(...e){super(...e),this.dateValueFormatter=e=>{if(e)return m()(e).format("DD.MM.YYYY HH:mm")},this.employeesValueFormatter=e=>{if("System"===e)return"Fetura Cloud";const{employees:t}=this.props;let a=t.find(t=>t.LocalUserID===e);return a?a.userName:e||""}}render(){const{t:e,heats:t}=this.props,a=[{name:e("date"),field:"EvTime",valueFormatter:this.dateValueFormatter,_mobileDate:!0,_mobileHeader:!0},{name:e("comment"),field:"Comment"},{name:e("eventGrid.operator"),field:"OperID",valueFormatter:this.employeesValueFormatter,shouldShow:()=>Object(h.c)()}];return s.a.createElement(i.a,null,s.a.createElement("div",{className:"d-flex justify-content-between"},s.a.createElement("h5",null,e("eventGrid.heatList"),"\xa0")),s.a.createElement("div",null,s.a.createElement(l.a,{data:t.sort((e,t)=>t.EvTime-e.EvTime),headers:a,mobileRow:s.a.createElement(p.a,null),showPagination:!0,paginationItems:10,scrollOnPageChange:!1})))}}u=Object(o.connect)((function(e){return{animal:e.animalDocuments.selectedItem,heats:e.animalDocuments.events.filter(e=>e.EvCode===r.b.HEAT),lang:e.language.lang.lang,employees:e.user.employees}}))(u),t.a=Object(d.a)()(u)},"8O+7":function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a("q1tI"),s=a.n(n),o=a("9jj8"),r=a("JI6e");class i extends n.PureComponent{render(){const{text:e}=this.props;return s.a.createElement(o.a,{className:"pt-2 pb-2 opacity-50"},s.a.createElement(r.a,{xs:12},s.a.createElement("h5",{className:"justify-content-start align-items-center"},e)))}}},Dbij:function(e,t,a){},EO8k:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("oX1l"),r=a("fncI"),i=a("vYJ8"),l=a("3Z9Z"),c=a("JI6e"),m=a("gNnm"),d=a("uSQv"),p=a("zTlQ"),h=a("vzZS"),u=a("LCzB"),g=a("XzT5");class E extends o.h{constructor(...e){super(...e),this.onRadioChange=(e,t,a)=>{console.log(a.target.value),this.handleInputChange(a)},this.onSubmitVerify=e=>{this.verify(),e.preventDefault()},this.onSubmitVerificationCode=e=>{this.submit(),e.preventDefault()}}showComponent(e){const{onStateChange:t,t:a,error:n}=this.props,{verifyAttr:o}=this.state;return console.log(this),s.a.createElement(r.a,{onStateChange:t},s.a.createElement("h6",{className:"flex-wrap"},a("login.contactConfirmRequired")),s.a.createElement(i.a,{in:!!n},s.a.createElement("div",null,s.a.createElement(h.a,{boxColor:"error"},n))),!o&&s.a.createElement("form",{onSubmit:this.onSubmitVerify},s.a.createElement(l.a,null,s.a.createElement(c.a,{xl:6,className:"d-flex justify-content-center align-items-center"},s.a.createElement(m.a,{label:a("email"),name:"contact",onChange:this.onRadioChange,value:"email"})),s.a.createElement(c.a,{xl:6,className:"d-flex justify-content-center align-items-center"},s.a.createElement(m.a,{label:a("phoneNumber"),name:"contact",onChange:this.onRadioChange,value:"phone_number"}))),s.a.createElement("div",{className:"d-flex justify-content-between align-items-center"},s.a.createElement("small",null,s.a.createElement("a",{className:"pointer",onClick:()=>t("signedIn")},"Pomi\u0144")),s.a.createElement(d.a,{buttonColor:"primary"},a("send")))),o&&s.a.createElement("form",{onSubmit:this.onSubmitVerificationCode},s.a.createElement(h.a,null,g.a.t("login.verifyCode",{type:a("email"===o?"login.email":"phoneNumber")})),s.a.createElement(p.a,{id:"code",key:"code",name:"code",type:"text",label:a("login.verificationCode"),onChange:this.handleInputChange,onChangeWithEvent:!0}),s.a.createElement(d.a,{buttonColor:"primary"},a("send"))))}}t.a=Object(u.a)()(E)},Grx6:function(e,t,a){},OSpX:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("oX1l"),r=a("uSQv"),i=a("zTlQ"),l=a("fncI"),c=a("vzZS"),m=a("vYJ8"),d=a("LCzB");class p extends o.g{constructor(e){super(e),this.onSubmit=e=>{const{clear:t}=this.props;t(),this.signIn(e),e.preventDefault()},this.getInitialValues=()=>{const{log:e,pass:t}=this.props;return!(!e||!t)&&(this.handleInputChange({target:{name:"username",value:e,type:"text",checked:!1}}),this.handleInputChange({target:{name:"password",value:t,type:"password",checked:!1}}),!0)},this.state={loading:!1}}showComponent(e){const{t:t,onStateChange:a,error:n,log:o,pass:d}=this.props,{loading:p}=this.state,h=this.getInitialValues();return s.a.createElement(l.a,{onStateChange:a,showSignIn:!1,showSendVerificationCode:!1},s.a.createElement("form",{onSubmit:this.onSubmit},s.a.createElement(m.a,{in:!!n},s.a.createElement("div",null,s.a.createElement(c.a,{boxColor:"error"},n))),s.a.createElement(i.a,{id:"username",key:"username",value:h?o:void 0,name:"username",type:"text",label:t("login.login"),onChange:this.handleInputChange,onChangeWithEvent:!0}),s.a.createElement(i.a,{id:"password",key:"password",value:h?d:void 0,name:"password",type:"password",label:t("login.password"),onChange:this.handleInputChange,onChangeWithEvent:!0}),s.a.createElement(r.a,{buttonColor:"primary",isLoading:p},t(p?"login.loggingIn":"login.signIn"))))}}t.a=Object(d.a)()(p)},SqKH:function(e,t,a){},"Vj+B":function(e,t,a){"use strict";var n=a("Y+p1"),s=a.n(n),o=a("q1tI"),r=a.n(o),i=a("oX1l"),l=a("fncI"),c=a("uSQv"),m=a("vzZS"),d=a("vYJ8"),p=a("LCzB"),h=a("zTlQ"),u=a("XzT5"),g=a("Ty5D");class E extends i.f{constructor(e){super(e),this.onSubmitSendNewPassword=e=>{const t=this.submit.password.value,a=this.submit.confirm_password.value;s()(t,a)&&/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/.test(t||"")?(this.change(),this.props.history.push("/")):/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/.test(t||"")?this.setState({error:u.a.t("errors.samePasswords")}):this.setState({error:u.a.t("signUpView.passwordShouldContain")}),e.preventDefault()},this.state={error:""}}componentDidUpdate(e,t,a){const{error:n}=this.props;t.error!==n&&this.setState({error:n})}showComponent(e){const{error:t}=this.state,{onStateChange:a,t:n}=this.props;return r.a.createElement(l.a,{onStateChange:a,showForgotPassword:!1,showSendVerificationCode:!1},r.a.createElement(d.a,{in:!!t},r.a.createElement("div",null,r.a.createElement(m.a,{boxColor:"error"},t))),r.a.createElement("form",{onSubmit:this.onSubmitSendNewPassword,ref:e=>this.submit=e},r.a.createElement(h.a,{id:"password",key:"password",name:"password",type:"password",autocomplete:"off",label:n("newPassword"),onChange:this.handleInputChange,onChangeWithEvent:!0}),r.a.createElement(h.a,{id:"confirm_password",key:"confirm_password",name:"confirmPassword",type:"password",autocomplete:"off",label:n("login.repeatPassword"),onChangeWithEvent:!0}),r.a.createElement(c.a,{buttonColor:"primary"},n("send"))))}}E=Object(g.o)(E),t.a=Object(p.a)()(E)},ZGSZ:function(e,t,a){"use strict";var n=a("J2iB"),s=a.n(n),o=a("mwIZ"),r=a.n(o),i=a("BkRI"),l=a.n(i),c=a("q1tI"),m=a.n(c),d=a("/MKj"),p=a("Ty5D"),h=a("ANjH"),u=a("f0zD"),g=a("wd/R"),E=a.n(g),v=a("AAik"),f=(a("hQsW"),a("LCzB")),y=a("r8wt"),b=a("CuyV");class C extends m.a.Component{getMedicines(e){const{medicines:t,value:a}=e;return a.map(e=>{let a=t.filter(t=>t.WordID===e&&t.WData.Type===y.b.VACCINE)[0];if(a&&a.WData.Color){const t=r()(a,"WData.Name","");return m.a.createElement(b.a,{tooltipContent:t},m.a.createElement("span",{className:"color-square",style:{background:a.WData.Color},key:e}))}}).filter(e=>e)}render(){const{t:e}=this.props,t=this.getMedicines(this.props);return m.a.createElement("div",{className:"medicines"},0===t.length&&e("grid.noMedicine"),t)}}C=Object(d.connect)(e=>({medicines:e.dictionary.medicine,lang:e.language.lang.lang}))(C);var w=Object(f.a)()(C),D=a("i7k/"),O=a("q17X"),S=a("i8MS"),I=a("10H7"),N=a("VyNe"),T=a("Dn3e");class x extends m.a.Component{constructor(...e){super(...e),this.getClassNameBasedOnResult=e=>e?!0===e||T.USG_STATE.POSITIVE?"fa-check":"fa-redo-alt":"fa-times"}render(){const{value:e}=this.props,t=r()(e,"EvData.Pregnant"),a=this.getClassNameBasedOnResult(t);return m.a.createElement("div",{className:"usgs"},e&&E()(e.EvTime).format("DD.MM.YYYY HH:mm"),e&&m.a.createElement("i",{className:"fas fa-fw ".concat(a)}))}}var P,j=Object(h.d)(Object(f.a)())(x);let R=Object(d.connect)(e=>({selectedGroup:e.animalDocuments.selectedItem,lang:e.language.lang.lang,events:e.animalDocuments.events,medicines:e.dictionary.currentMedicine,noPregnancyReasons:e.dictionary.noPreganancy,technologyGroups:e.technologyGroup.technologyGroups,fallReasons:e.dictionary.fallReasons}))(P=class extends c.Component{constructor(...e){super(...e),this.getRemovalReason=(e,t,a,n,o)=>{const{AnmID:i}=e,{StartTime:l}=t,{t:c,lang:m,noPregnancyReasons:d,fallReasons:p,events:h,technologyGroups:u}=this.props,g=(e,t)=>h.filter(a=>a.AnmID===e&&a.EvCode===t),v=(e,t,a)=>{const n=r()(e,"WData[".concat(m,"]"),[]).filter(e=>e.ID===t)[0];return n?n.Value:a};if(n&&!n.EvData.Pregnant)return c("animalDocuments.removeReason.negativeUSG");const f=u.filter(e=>s()(e.DtaDelTime)&&e.StartTime>l&&e.AnmList.includes(i)).sort((e,t)=>e.StartTime-t.StartTime)[0];let y=0;y=f?f.StartTime:E()(a.EvTime).add(o,"days").toDate().getTime();const b=g(i,I.b.NO_PREGNANCY).filter(e=>e.EvTimee.EvTime-t.EvTime)[0];if(b)return v(d,b.EvData.Reason,c("animalDocuments.removeReason.unknownNoPregnancy"));const C=g(i,I.b.FALL).filter(e=>e.EvTimee.EvTime-t.EvTime)[0];return C?v(p,C.EvData.Reasn,c("animalDocuments.removeReason.unknownFall")):g(i,I.b.SELL).filter(e=>e.EvTimee.EvTime-t.EvTime)[0]?c("sale"):g(i,I.b.INSEMINATION).filter(e=>e.EvTimee.EvTime-t.EvTime).length>1?c("animalDocuments.removeReason.repetition"):c(f?"animalDocuments.removeReason.assignedToOtherTechnoGroup":"animalDocuments.removeReason.unknownRemove")},this.handleRowClick=e=>{const{location:{pathname:t,search:a},history:n}=this.props;let s=new URLSearchParams(a);s.set("documentsAnimal",e.animal.AnmID),s.delete("documentsGroup"),s.delete("documentsRFID"),s.delete("documentsTechnoGroup"),n.replace({pathname:t,search:s.toString()})}}getTechnologyGroupData(e,t,a){const n=Object(O.getTechnologyGroupWeeks)(),o=Object(O.getTimeFromInseminationToPartuition)(),i=[];a?(r()(t,"Rmvd",[]).forEach(e=>{const t=S.a.getAnimalById(e);t&&i.push(t)}),r()(t,"AnmList",[]).forEach(e=>{const t=S.a.getAnimalById(e);t&&t.DtaDthTime&&-1===i.findIndex(t=>t.AnmID===e)&&i.push(t)})):r()(t,"AnmList",[]).forEach(e=>{const a=S.a.getAnimalById(e);a&&s()(a.DtaDthTime)&&-1===i.findIndex(t=>t.AnmID===e)&&-1===r()(t,"Rmvd",[]).findIndex(t=>t===e)&&i.push(a)});const c=(t,a)=>e.filter(e=>e.AnmID===t&&e.EvCode===a),m=(e,t,a)=>e.filter(e=>e.EvTime>t&&e.EvTimee.EvTime>t.EvTime),p.lastInsemination=h[0],p.lastInsemination){let n=c(e.AnmID,I.b.USG),s=Math.ceil(o/7);n=m(n,p.lastInsemination.EvTime,s),p.lastUSG=n.sort((e,t)=>e.EvTime{i.add(e.EvData.Medicine)}),c(e.AnmID,I.b.TREATMENT).forEach(e=>{r()(e,"EvData.Treatment",[]).forEach(e=>{i.add(e.Medicine)})}),p.medicines=[...i.values()]}d.push(p)}return d}eventsValueFormatter(e){if(e)return E()(e).format("DD.MM.YYYY HH:mm")}expectedDateOfBirthValueFormatter(e){if(e)return e.format("DD.MM.YYYY")}render(){const{t:e,showRemoved:t,events:a,selectedGroup:n}=this.props,s=this.getTechnologyGroupData(a,n,t),o=[{name:e("number"),field:"animal.AnmNo1",customSort:D.a},{name:e("grid.inseminationDate"),field:"lastInsemination.EvTime",valueFormatter:e=>this.eventsValueFormatter(e),disableValueFormatterSort:!0},{name:e("grid.usg"),field:"lastUSG",component:e=>m.a.createElement(j,e)}];return t?o.push({name:e("grid.removeReason"),field:"removeReason"}):o.push({name:e("grid.expectedDateOfBirth"),field:"expectedDateOfBirth",valueFormatter:e=>this.expectedDateOfBirthValueFormatter(e)}),o.push({name:e("grid.grafting"),field:"medicines",component:e=>m.a.createElement(w,e)}),m.a.createElement(N.a,null,m.a.createElement("div",{className:"d-flex justify-content-between"},m.a.createElement("h5",null,e(t?"animalDocuments.animalsRemovedFromTechnoGroup":"animalDocuments.animalsInTechnoGroup"),"\xa0")),m.a.createElement("div",null,m.a.createElement(v.a,{swipePagination:!0,data:s,onRowClick:this.handleRowClick,headers:o,shouldIndex:!0,paginationItems:10,showPagination:!0})))}})||P;R=Object(d.connect)(null,e=>Object(h.b)({show:u.d},e))(Object(p.o)(R));t.a=Object(f.a)()(R)},ZJuw:function(e,t,a){},bKmF:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("oX1l"),r=a("fncI"),i=a("zTlQ"),l=a("vzZS"),c=a("uSQv"),m=a("vYJ8"),d=a("LCzB");class p extends o.b{constructor(e){super(e),this.onSubmit=e=>{this.confirm(),e.preventDefault()},this.onResendClick=()=>{this.resend(),this.setState({resend:!0})},this.state={resend:!1}}showComponent(e){const{t:t,onStateChange:a,authData:{username:n},error:o}=this.props,{resend:d}=this.state;return s.a.createElement(r.a,{onStateChange:a,showForgotPassword:!1,onSendVerificationCodeClick:this.onResendClick},d&&s.a.createElement(l.a,null,t("login.resendConfirmationCode")),s.a.createElement(m.a,{in:!!o},s.a.createElement("div",null,s.a.createElement(l.a,{boxColor:"error"},o))),s.a.createElement("form",{onSubmit:this.onSubmit},s.a.createElement(i.a,{id:"username",key:"username",name:"username",type:"text",label:t("login.login"),onChange:this.handleInputChange,onChangeWithEvent:!0,disabled:!0,value:n}),s.a.createElement(i.a,{id:"code",key:"code",name:"code",type:"text",label:t("login.verificationCode"),onChange:this.handleInputChange,onChangeWithEvent:!0}),s.a.createElement(c.a,{buttonColor:"primary"},t("send"))))}}t.a=Object(d.a)()(p)},fncI:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("3Z9Z"),r=a("JI6e"),i=a("39gQ"),l=a("VyNe"),c=a("9D2Z"),m=a("55Ip"),d=a("OomU"),p=a("NbQE"),h=a("/MKj"),u=a("uqr+"),g=a.n(u),E=a("kG49"),v=a("17x9"),f=a.n(v),y=(a("SqKH"),a("f0zD")),b=a("ANjH"),C=a("pBTy"),w=a("uSQv"),D=a("LCzB"),O=a("fAk8");function S(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 I(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class N extends s.a.Component{constructor(e){super(e),this.switchLanguage=async e=>{const{dispatch:t,i18n:a}=this.props;await a.changeLanguage(e),await t(Object(O.b)(e))},this.getLanguages=()=>{let e=[];return g.a.getLanguage().map(t=>{t.lang!==this.props.selectedLang&&e.push(s.a.createElement(E.a,{key:t.lang,onClick:()=>this.switchLanguage(t.lang)},t.lang.toUpperCase()))}),e},this.state={ev:null}}onListItemClick(e){this.props.onStateChange(e,{})}render(){const{t:e,selectedLang:t,children:a,showForgotPassword:n,showSignIn:h,showSendVerificationCode:u,onSendVerificationCodeClick:g}=this.props,{ev:E}=this.state;return s.a.createElement("div",{className:"login-box"},s.a.createElement(o.a,{bsPrefix:"row h-100 justify-content-center align-items-center w-100 mx-auto"},s.a.createElement(r.a,{xl:4,lg:6,md:8,sm:10,xs:12},s.a.createElement("img",{src:i.a,className:"fetura-logo w-75",alt:"fetura-logo"}),s.a.createElement(l.a,null,a),s.a.createElement("ul",{className:"mb-1"},n&&s.a.createElement(s.a.Fragment,null,s.a.createElement("li",null,s.a.createElement("a",{className:"pointer",onClick:()=>this.onListItemClick("forgotPassword")},s.a.createElement("i",{className:"fa fa-chevron-right"}),e("errors.doNotRememberPassword"))),s.a.createElement("li",null,s.a.createElement(m.Link,{to:"/signup"},s.a.createElement("i",{className:"fa fa-chevron-right"}),e("login.signUp")))),h&&s.a.createElement("li",null,s.a.createElement("a",{className:"pointer",onClick:()=>this.onListItemClick("signIn")},s.a.createElement("i",{className:"fa fa-chevron-right"}),e("login.signIn"))),u&&s.a.createElement("li",null,s.a.createElement("a",{className:"pointer",onClick:g},s.a.createElement("i",{className:"fa fa-chevron-right"}),e("login.resendVerificationCode"))),s.a.createElement("li",null,s.a.createElement(w.a,{onClick:e=>this.setState({ev:e}),buttonStyle:"text",icon:s.a.createElement("i",{className:"fas fa-language"})},t.toUpperCase()),s.a.createElement(c.a,{event:E},this.getLanguages()))),s.a.createElement(o.a,{className:"opacity-75 w-100 mb-4 text-left text-md-center"},s.a.createElement(r.a,{xs:6,md:3},s.a.createElement(m.Link,{to:"/eula"},e("license"))),s.a.createElement(r.a,{xs:6,md:3},s.a.createElement(m.Link,{to:"/pricing"},e("login.pricing"))),s.a.createElement(r.a,{xs:6,md:3},s.a.createElement("a",{className:"pointer",onClick:()=>{this.props.show(d.a,{})}},e("contact"))),s.a.createElement(r.a,{xs:6,md:3},s.a.createElement("a",{className:"pointer",onClick:()=>{this.props.show(p.a,{})}},e("requirements.requirements")))),s.a.createElement(d.b,null),s.a.createElement(p.b,null))),s.a.createElement(C.a,null))}}N.propTypes={onStateChange:f.a.func.isRequired,showForgotPassword:f.a.bool,showSignIn:f.a.bool,showSendVerificationCode:f.a.bool,onSendVerificationCodeClick:f.a.func},N.defaultProps={showForgotPassword:!0,showSignIn:!0,showSendVerificationCode:!0},N=Object(h.connect)(e=>({selectedLang:e.language.locale}),e=>function(e){for(var t=1;tthis.onButtonClick(),className:"help-settings-card-container"},s.a.createElement("div",{className:"svg-container"},s.a.createElement(l.a,{src:t,loading:()=>s.a.createElement("svg",{viewBox:"0 0 270.93334 270.93334"})})),s.a.createElement("h3",null,e)))}}h.propTypes={title:i.a.string.isRequired,icon:i.a.string.isRequired},h=Object(p.connect)(null,e=>Object(m.b)({show:d.d},e))(h),t.a=h},hQsW:function(e,t,a){},lCyo:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("JI6e"),r=a("3Z9Z"),i=a("2dKy"),l=a("/MKj"),c=a("cr+I"),m=a.n(c),d=a("Ty5D"),p=a("S5VY"),h=a("LCzB");class u extends s.a.Component{constructor(...e){super(...e),this.state={text:u.getQueryText(this.props)||""},this.timer=null,this.handleOnChange=e=>{const{location:{pathname:t,search:a},history:n}=this.props;let s=new URLSearchParams(a);e?s.set("search",e):s.delete("search"),n.replace({pathname:t,search:s.toString()})},this.setText=e=>{this.setState({text:e||""},()=>{this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(()=>{this.handleOnChange(e),this.timer=null},200)})}}componentDidMount(){this.props.dispatch(Object(p.a)(this.state.text))}componentDidUpdate(e,t,a){const n=u.getQueryText(e),s=u.getQueryText(this.props);n!==s&&(this.props.dispatch(Object(p.a)(s)),this.setState({text:s}))}componentWillUnmount(){clearTimeout(this.timer)}render(){const{text:e}=this.state,{t:t}=this.props;return s.a.createElement("div",null,s.a.createElement(i.a,{placeholder:t("farms.tabs.inventoryTab.filterBy"),onChange:this.setText,value:e}))}}u.getQueryText=e=>{try{return m.a.parse(e.location.search).search||""}catch(t){return""}},u=Object(l.connect)(e=>({}))(u),u=Object(h.a)()(u);var g=u=Object(d.o)(u),E=a("mwIZ"),v=a.n(E),f=a("17x9"),y=a.n(f),b=a("kG49"),C=a("9D2Z"),w=a("WV92"),D=a("2HEh"),O=a("wd/R"),S=a.n(O),I=a("uSQv");class N extends s.a.Component{constructor(e){super(e),this.setEvent=e=>{this.setState({event:e})},this.getItems=()=>[{name:this.props.t("number"),value:w.a.BY_ANIMAL_NUMBER_ASC},{name:this.props.t("animalType"),value:w.a.BY_ANIMAL_TYPE_ASC},{name:this.props.t("location"),value:w.a.BY_LOCATION_ASC}].filter(e=>e),this.handleChange=(e,t=!0)=>{let a=e;const{inventorySort:n,cookies:s,dispatch:o}=this.props;if(t&&this.chopEnd(a)===this.chopEnd(n)&&(a="".concat(this.chopEnd(a)).concat(n.endsWith("_ASC")?"_DESC":"_ASC")),Object.values(w.a).includes(a)&&n!==a){o(Object(p.f)(a));const e=s.get("inventoryView")||{};e.sortBy=a,s.set("inventoryView",e,{path:"/",expires:S()().add(1,"year").toDate()})}},this.chopEnd=e=>e.split("_").slice(0,-1).join("_");const{cookies:t}=this.props;this.state={event:null};const a=(t.get("inventoryView")||{}).sortBy||w.a.BY_ANIMAL_NUMBER_ASC;this.handleChange(a,!1)}render(){const{inventorySort:e="",t:t}=this.props,{event:a}=this.state;let n=this.getItems();const o=v()(n.find(t=>this.chopEnd(t.value)===this.chopEnd(e)),"name",t("farms.tabs.inventoryTab.sortBy"));return s.a.createElement(s.a.Fragment,null,s.a.createElement(I.a,{title:o,type:"button",className:"w-100",onClick:this.setEvent},s.a.createElement("i",{className:"fas fa-flip-vertical fa-sort-amount-".concat(e.endsWith("_ASC")?"up":"down")}),s.a.createElement("span",{className:"d-none d-lg-inline ml-1"},o)),s.a.createElement(C.a,{event:a},n.map(t=>s.a.createElement(b.a,{stopPropagation:!0,onClick:()=>this.handleChange(t.value),icon:this.chopEnd(t.value)===this.chopEnd(e)?e.endsWith("_ASC")?s.a.createElement("i",{className:"fas fa-sort-amount-up fa-flip-vertical"}):s.a.createElement("i",{className:"fas fa-sort-amount-down fa-flip-vertical"}):null},t.name))))}}N.propTypes={chamber:y.a.object.isRequired},N=Object(l.connect)((e,t)=>({inventorySort:e.inventory.inventorySort||w.a.BY_ANIMAL_NUMBER_ASC}))(N),N=Object(h.a)()(N);var T=Object(D.a)(N),x=a("Y+p1"),P=a.n(x),j=a("txkB"),R=a("n7pt"),A=a("olHg"),M=a("kCVf"),k=a("kiXb");function L(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 V(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Y extends n.Component{constructor(e){super(e),this.state=function(e){for(var t=1;t{const{location:{pathname:t,search:a},history:n}=this.props;let s=new URLSearchParams(a);e?s.set("location",e.object[e.key]):s.delete("location"),n.replace({pathname:t,search:s.toString()})},this.state={t:e=>k.a.t(e)}}static getDerivedStateFromProps(e,t){if(!P()(e.buildings,t.buildings))return Y.getValueFromProps(e);const a=Object(M.j)(v()(t.value,"object"));return P()(a,Y.getQueryLocation(e))?null:{value:Object(A.a)(t.treeOptions,Y.getQueryLocation(e))}}componentDidMount(){this.props.dispatch(Object(p.c)(Object(M.j)(v()(this.state.value,"object"))))}componentDidUpdate(e,t,a){const n=Object(M.j)(v()(this.state.value,"object"));n!==Object(M.j)(v()(t.value,"object"))&&this.props.dispatch(Object(p.c)(n))}render(){const{t:e}=this.state,{treeOptions:t=[],value:a}=this.state;return s.a.createElement("div",null,s.a.createElement(j.a,{clearButton:!0,placeholder:e("location"),options:t,expanded:!0,onChange:this.handleOnChange,value:a}))}}Y.getQueryLocation=e=>{const t=m.a.parse(e.location.search);try{return t.location||null}catch(a){return null}},Y.getValueFromProps=e=>{const t=R.a.getObjectForTreeSelect(e.farm,!1);return{treeOptions:R.a.getObjectForTreeSelect(e.farm,!1),buildings:e.buildings,value:Object(A.a)(t,Y.getQueryLocation(e))}},Y=Object(l.connect)(e=>({buildings:e.farms.buildings,farm:e.location.farm}))(Y);var F=Y=Object(d.o)(Y),_=a("wQVC"),B=a("B/gD");class G extends n.Component{constructor(e){super(e),this.handleOnChange=(e,t)=>{console.log(e,t);const{location:{pathname:a,search:n},history:s}=this.props;let o=new URLSearchParams(n);e?o.set("".concat(t),"true"):o.delete("".concat(t)),s.replace({pathname:a,search:o.toString()})},this.handleDead=e=>{this.handleOnChange(e,"showDead")},this.handleCollapse=e=>{this.handleOnChange(e,"showCollapsed")};const{cookies:t,dispatch:a,location:{pathname:n,search:s},history:o}=this.props;let{showDead:r,showCollapsed:i}=G.getQueryValue(this.props);null===r&&(r=!!(t.get("inventoryView")||{}).showDead),null===i&&(i=!!(t.get("inventoryView")||{}).showCollapsed);let l=new URLSearchParams(s);r?l.set("showDead","true"):l.delete("showDead"),i?l.set("showCollapsed","true"):l.delete("showCollapsed"),o.replace({pathname:n,search:l.toString()}),a(Object(p.e)(!!r)),a(Object(p.d)(!!i))}componentDidUpdate(e,t,a){const n=G.getQueryValue(this.props),s=G.getQueryValue(e);n.showDead!==s.showDead&&this.props.dispatch(Object(p.e)(!!n.showDead)),n.showCollapsed!==s.showCollapsed&&this.props.dispatch(Object(p.d)(!!n.showCollapsed))}componentWillUnmount(){const{cookies:e,showDead:t,showCollapsed:a}=this.props,n=e.get("inventoryView")||{};n.showDead=!!t,n.showCollapsed=!!a,e.set("inventoryView",n,{path:"/",expires:S()().add(1,"year").toDate()})}render(){const{showDead:e,showCollapsed:t,t:a}=this.props;return s.a.createElement(s.a.Fragment,null,s.a.createElement(r.a,null,s.a.createElement(o.a,{className:"col-auto mr-1"},s.a.createElement(B.a,{id:"show-dead-switch",reverseOrder:!0,label:a("farms.tabs.inventoryTab.showDeadSold"),onChange:this.handleDead,value:!!e})),s.a.createElement(o.a,{className:"col-auto"},s.a.createElement(B.a,{id:"show-collapsed-switch",reverseOrder:!0,label:a("farms.tabs.inventoryTab.showCollapsed"),onChange:this.handleCollapse,value:!!t}))))}}G.getQueryValue=e=>{const t=m.a.parse(e.location.search);return Object.keys(t).length?{showDead:"true"===t.showDead||!1,showCollapsed:"true"===t.showCollapsed||!1}:{showDead:null,showCollapsed:null}},G=Object(l.connect)(e=>({showDead:e.inventory.showDead,showCollapsed:e.inventory.showCollapsed}))(G),G=Object(h.a)()(G);var U=G=Object(d.o)(Object(D.a)(G)),z=a("v9qu");class W extends n.Component{render(){const e=Object(_.e)(),t=Object(z.a)();return s.a.createElement(o.a,{md:12,className:"pt-1rem ".concat(t?"":"sticky-item"),style:{top:e}},s.a.createElement(r.a,{className:"align-items-center justify-content-end"},s.a.createElement(o.a,{xs:12,lg:12,xl:6},s.a.createElement(g,null)),s.a.createElement(o.a,{xs:4,lg:4,xl:2},s.a.createElement(T,null)),s.a.createElement(o.a,{xs:8,lg:8,xl:4},s.a.createElement(F,null)),s.a.createElement(o.a,{className:"col-auto"},s.a.createElement(U,null))))}}t.a=W},lU8S:function(e,t,a){"use strict";var n=a("Y+p1"),s=a.n(n),o=a("E+oP"),r=a.n(o),i=a("q1tI"),l=a.n(i),c=a("VyNe"),m=a("vzZS"),d=a("hw2D"),p=a("pxzG"),h=a("eASP"),u=a("/MKj"),g=a("i8MS"),E=a("wd/R"),v=a.n(E),f=a("uUZO"),y=a("LCzB"),b=a("7VIw"),C=a.n(b);function w(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 D(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class O extends i.Component{constructor(e){super(e),this.onSelectChange=e=>{this.setState({index:e})},this.cycleRenderer=({key:e,cycle:t})=>l.a.createElement("div",{key:e,className:"mh-5rem"},t&&l.a.createElement(l.a.Fragment,null,t.I.length>0&&l.a.createElement("div",{onClick:this.onStateChange},l.a.createElement("h5",null,this.props.t("animalDocuments.insemination")),t.I.map((e,t)=>l.a.createElement("div",{key:t},this.getDate(e),": ",this.getBoarName(e))),l.a.createElement("hr",null)),t.U.length>0&&l.a.createElement(l.a.Fragment,null,l.a.createElement("h5",null,this.props.t("usg")),t.U.map((e,t)=>l.a.createElement("div",{key:t,className:"position-relative"},this.getDate(e),": ",l.a.createElement("i",{className:"fas ".concat(e.EvData.Pregnant?"fa-check":"fa-times")}))),l.a.createElement("hr",null)),t.P.length>0&&l.a.createElement(l.a.Fragment,null,l.a.createElement("h5",null,this.props.t("animalDocuments.birth")),t.P.map((e,t)=>l.a.createElement("div",{key:t},this.getDate(e),l.a.createElement("div",null,this.props.t("alive"),": ",e.EvData.HealthyCnt),l.a.createElement("div",null,this.props.t("dead"),": ",e.EvData.DeadCnt),l.a.createElement("div",null,this.props.t("mummies"),": ",e.EvData.MummyCnt))),l.a.createElement("hr",null)),t.AN.length>0&&l.a.createElement(l.a.Fragment,null,l.a.createElement("h5",null,this.props.t("animalDocuments.activeNipples")),t.AN.map((e,t)=>l.a.createElement("div",{key:t},this.props.t("amount"),": ",e.EvData.Nipples)),l.a.createElement("hr",null)),t.S.length>0&&l.a.createElement(l.a.Fragment,null,l.a.createElement("h5",null,this.props.t("separation")),t.S.map((e,t)=>l.a.createElement("div",{key:t},this.getDate(e)," - ",e.EvData.PiCnt," / ",Object(p.j)(e.EvData.PiWeight,{unit:h.a.MEDIUM,showUnit:!0}))),l.a.createElement("hr",null)),t.V.length>0&&l.a.createElement(l.a.Fragment,null,l.a.createElement("h5",null,this.props.t("fallPiglets")),t.V.map((e,t)=>l.a.createElement("div",{key:t},this.getDate(e)," - ",e.EvData.Piglets," / ",Object(p.j)(e.EvData.Weight,{unit:h.a.MEDIUM,showUnit:!0}))),l.a.createElement("hr",null)),t.W.length>0&&l.a.createElement(l.a.Fragment,null,l.a.createElement("h5",null,this.props.t("mommy")),t.W.map((e,t)=>l.a.createElement("div",{key:t},this.getDate(e)," - ",e.EvData.PiCnt)),l.a.createElement("hr",null)),t.M.length>0&&l.a.createElement(l.a.Fragment,null,l.a.createElement("h5",null,this.props.t("animalDocuments.mommySeparation")),t.M.map((e,t)=>l.a.createElement("div",{key:t},this.getDate(e)," - ",e.EvData.PiCnt," / ",Object(p.j)(e.EvData.PiWeight,{unit:h.a.MEDIUM,showUnit:!0}))),l.a.createElement("hr",null)),t.N.length>0&&l.a.createElement(l.a.Fragment,null,l.a.createElement("h5",null,this.props.t("noPregnancy")),t.N.map((e,t)=>l.a.createElement("div",{key:t},this.getDate(e)," - ",this.getFallReason(e.EvData.Reason))),l.a.createElement("hr",null)))),this.state=function(e){for(var t=1;tt.ID===e);if(n)return n.Value}getDate(e){return v()(e.EvTime).format("DD.MM.YYYY")}render(){const{cycles:e=[],index:t}=this.state;return l.a.createElement(c.a,null,0===e.length&&l.a.createElement(m.a,{boxColor:"warning"},this.props.t("animalDocuments.noDataForAnimal")),l.a.createElement(d.a,{value:t,options:e.map((e,t)=>({name:"".concat(this.props.t("animalDocuments.cycleNumber")," ").concat(e.cycle),value:t})),clearButton:!1,onChange:this.onSelectChange}),l.a.createElement(C.a,{animateHeight:!0,index:t,onChangeIndex:this.onSelectChange},e.map((e,t)=>this.cycleRenderer({key:t,cycle:e}))))}}O.getValues=e=>{const{cycleTable:t}=e,a=r()(t)?[]:Object(f.a)(t);return{cycles:a,cycle:a[a.length-1]||null}},O=Object(u.connect)(e=>({rows:e.animalDocuments.rows,fallReasons:e.dictionary.fallReasons,lang:e.language.lang.lang,cycleTable:e.animalDocuments.cycleTable}))(O),t.a=Object(y.a)()(O)},lo2F:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("WV92"),r=a("/MKj"),i=a("JI6e"),l=a("3Z9Z"),c=a("tkTQ");class m extends n.Component{constructor(...e){super(...e),this.renderRow=e=>{const{total:t,animalTypeMap:a=new Map}=this.props;return s.a.createElement(i.a,{xs:4,sm:4,md:2},s.a.createElement("h4",{className:"justify-content-center"},t[e].total),a.get(e))}}render(){return s.a.createElement(l.a,{className:"text-center",style:{"justify-content":"center"}},this.renderRow(c.a.RENOVATION_SOW),this.renderRow(c.a.SOW),this.renderRow(c.a.PORKER),this.renderRow(c.a.BOAR),this.renderRow(c.a.PIGLET))}}m=Object(r.connect)(e=>({total:Object(o.c)(e),animalTypeMap:e.inventory.animalTypeMap}))(m),t.a=m},mqUJ:function(e,t,a){"use strict";var n=a("qPyV"),s=a.n(n),o=a("Y+p1"),r=a.n(o),i=a("E+oP"),l=a.n(i),c=a("mwIZ"),m=a.n(c),d=a("q1tI"),p=a.n(d),h=a("uSQv"),u=a("/MKj"),g=a("39gQ"),E=a("EooJ"),v=(a("Dbij"),a("VyNe")),f=a("/S4a"),y=a("ANjH"),b=a("f0zD"),C=a("LCzB"),w=a("w4rF"),D=a("wd/R"),O=a.n(D),S=a("PrG/"),I=a("i8MS"),N=a("pxzG"),T=a("eASP"),x=a("Awgz"),P=a("IKic"),j=a("L3U4"),R=a("++5R"),A=a("7tZq"),M=a("jIxK"),k=a("PYU+"),L=a("l9rj"),V=a("W2wK"),Y=a("vXTL"),F=a("wjq+"),_=a("EfYk"),B=a("uUZO"),G=a("gJrJ");function U(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 z(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class W extends d.Component{constructor(e){super(e),this.showEditModal=()=>{const{show:e}=this.props;e(E.a,{animal:this.props.animal,cycles:this.props.cycleTable})},this.onExpandedRowClick=(e,t)=>{const{expanded:{rows:a}}=this.state;let n=a.slice(0),s=n.filter(t=>t===e).length;s&&!t?n=n.filter(t=>t!==e):!s&&t&&n.push(e),this.setState({expanded:{rows:n}})},this.getSwitchOptions=e=>{const{t:t}=e;return[{name:t("basic"),value:1},{name:t("advanced"),value:2}]},this.onSwitchView=e=>{this.setState({view:e})},this.onPrintClick=()=>{const{t:e}=this.props;let t=this.table.current.outerHTML;t=t.replace(new RegExp('',"g"),"\u2713"),t=t.replace(new RegExp('',"g"),"\u2715"),t=t.replace(new RegExp('',"g"),"?");let a=document.getElementById("info-box"),n="\n \n \n ".concat(e("animalDocuments.sowCard"),'\n \n \n \n
\n \n

").concat(e("animalDocuments.sowCard")," ").concat(this.props.animal.AnmNo1,"

\n
\n
\n ").concat(a.outerHTML,"\n
\n ").concat(t,"\n \n \n "),s=window.open("");s.document.write(n),s.document.close(),setTimeout(()=>{s.focus(),s.print(),s.close()},1e3)},this.getGridHeaders=()=>{const{view:e}=this.state,{t:t}=this.props;return p.a.createElement(p.a.Fragment,null,2===e&&p.a.createElement(w.a,{className:"non-print-first-record",title:t("animalDocuments.expand")}),p.a.createElement(w.a,{title:t("animalDocuments.cycleNumber")}),p.a.createElement(w.a,{title:t("animalDocuments.insemination"),columns:[{name:t("date")},{name:t("boar")}]}),p.a.createElement(w.a,{title:t("usg"),columns:[...1!==e?[{name:t("date")}]:[],{name:t("result")}]}),p.a.createElement(w.a,{title:t("animalDocuments.birth"),columns:[...1!==e?[{name:t("date")}]:[],{name:t("alive")},{name:t("dead")},{name:t("mummies")},{name:t("animalDocuments.averageWeight")}]}),p.a.createElement(w.a,{title:t("fallPiglets"),columns:[...1!==e?[{name:t("date")}]:[],{name:t("amount")},{name:t("animalDocuments.weight")}]}),p.a.createElement(w.a,{title:t("animalDocuments.mommySeparation"),columns:[...1!==e?[{name:t("date")}]:[],{name:t("amount")},{name:t("animalDocuments.weight")}]}),p.a.createElement(w.a,{title:t("mommy"),columns:[...1!==e?[{name:t("date")}]:[],{name:t("amount")}]}),p.a.createElement(w.a,{title:t("separation"),columns:[...1!==e?[{name:t("date")}]:[],{name:t("amount")},{name:t("animalDocuments.weight")}]}),p.a.createElement(w.a,{title:t("animalDocuments.activeNipples"),columns:[{name:t("amount")}]}),p.a.createElement(w.a,{title:t("weighting"),columns:[...1!==e?[{name:t("date")}]:[],{name:t("weight"),className:"print-last-record"}],className:"print-last"}),p.a.createElement(w.a,{title:t("noPregnancy"),columns:[...1!==e?[{name:t("date")}]:[],{name:t("reason"),className:"last-header"}],className:"print-display-none last-main-header"}))},this.getEmptyRows=e=>{const{cycleData:t}=this.state,a=[];for(let n=1;n<=e;n++)a.push({shouldExpand:!1,cycle:t[t.length-1]?t[t.length-1].cycle+n:t.length-1+n,inseminations:[],usgs:[],parturitions:[],separations:[],falls:[],weightings:[],separationsMommy:[],mommys:[],noPregnancy:[],activeNipples:[]});return a},this.state={view:1,cycleData:[],expanded:{rows:[],opened:!1}},this.table=p.a.createRef()}static getBoarName(e){const t=I.a.getAnimalById(e);return m()(t,"AnmNo1","-")}static weightValueFormatter(e){return e?Object(N.j)(e,{unit:T.a.MEDIUM,showUnit:!0,fixed:1}):""}static getCycleData(e){const{cycleTable:t,animal:a}=e;return Object(B.c)(t,a).map((e,t)=>({cycle:e.cycle,key:t,invalidEvents:m()(e,"invalidEvents",[]),inseminations:m()(e,S.INSEMINATION,[]).map(t=>({boar:W.getBoarName(m()(t,"EvData.BoarID")),date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.INSEMINATION),operators:m()(e,S.INSEMINATION,[]).map(e=>e.EvData.OperID)})),usgs:m()(e,S.USG,[]).map(t=>({result:m()(t,"EvData.Pregnant"),date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.USG),operators:m()(e,S.USG,[]).map(e=>e.EvData.OperID)})),parturitions:m()(e,S.PARTURITION,[]).map(t=>({alive:m()(t,"EvData.HealthyCnt",0),dead:m()(t,"EvData.DeadCnt",0),mummies:m()(t,"EvData.MummyCnt",0),avgWeight:m()(t,"EvData.HealthyCnt",0)>0?W.weightValueFormatter(m()(t,"EvData.Weight")/m()(t,"EvData.HealthyCnt")):0,date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.PARTURITION),operators:m()(e,S.PARTURITION,[]).map(e=>e.EvData.OperID)})),separations:m()(e,S.SEPARATION,[]).map(t=>({amount:m()(t,"EvData.PiCnt"),weight:W.weightValueFormatter(m()(t,"EvData.PiWeight")),date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.SEPARATION_TO_MOMMY),operators:m()(e,S.SEPARATION,[]).map(e=>e.EvData.OperID)})),falls:m()(e,S.FALL_PIGLETS,[]).map(t=>({amount:m()(t,"EvData.Piglets"),weight:m()(t,"EvData.Weight")||0,date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.FALL_PIGLETS),operators:m()(e,S.FALL_PIGLETS,[]).map(e=>e.EvData.OperID)})),weightings:m()(e,S.WEIGHTING,[]).map(t=>({reason:m()(t,"EvData.Reasn"),weight:m()(t,"EvData.Weight")/m()(t,"EvData.AnmCnt"),date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.WEIGHTING),operators:m()(e,S.WEIGHTING,[]).map(e=>e.EvData.OperID)})),separationsMommy:m()(e,S.SEPARATION_TO_MOMMY,[]).map(t=>({amount:m()(t,"EvData.PiCnt",0),weight:m()(t,"EvData.PiWeight")||0,date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.SEPARATION_TO_MOMMY),operators:m()(e,S.SEPARATION_TO_MOMMY,[]).map(e=>e.EvData.OperID)})),mommys:m()(e,S.MOMMY,[]).map(t=>({amount:m()(t,"EvData.PiCnt",0),date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.MOMMY),operators:m()(e,S.MOMMY,[]).map(e=>e.EvData.OperID)})),noPregnancy:m()(e,S.NO_PREGNANCY,[]).map(t=>({reason:m()(t,"EvData.Reason"),date:O()(m()(t,"EvTime")).format("DD.MM.YY"),comment:m()(t,"Comment","-"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.NO_PREGNANCY),operators:m()(e,S.NO_PREGNANCY,[]).map(e=>e.EvData.OperID)})),activeNipples:m()(e,S.ACTIVE_NIPPLES,[]).map(t=>({nipples:m()(t,"EvData.Nipples"),invalidEvents:m()(e,"invalidEvents",[]).filter(e=>e.EvCode===S.ACTIVE_NIPPLES),operators:m()(e,S.ACTIVE_NIPPLES,[]).map(e=>e.EvData.OperID)}))}))}getCycleRenderClass(e,t){const a=this.getInvalidEventsInRow(e,t).find(t=>t.EvCode===e);if(a)return"invalid-event ".concat(a.type||"error")}getInvalidEventsInRow(e,t){const{cycleData:a}=this.state;return l()(a)?[]:s()(a.find(e=>e.key===t).invalidEvents,e=>e.EvCode)}getTooltipContent(e,t,a){try{const n=this.getInvalidEventsInRow(e,t).filter(t=>t.EvCode===e);return l()(n)?null:p.a.createElement("div",null,p.a.createElement("b",null,a),n.map(e=>p.a.createElement("li",null,Object(G.a)(e.Reason,e.AdditionalData))))}catch(n){return null}}componentDidUpdate(e,t,a){const{cycleTable:n}=this.props;r()(e.cycleTable,n)||this.setState({cycleData:W.getCycleData(this.props)})}render(){const{view:e,cycleData:t,expanded:a}=this.state,{t:n}=this.props,s=this.getSwitchOptions(this.props),o=this.getGridHeaders(),r=2===e,i=t.length<6?6-t.length:0;return p.a.createElement(v.a,null,p.a.createElement("div",{className:"sow-card-header"},p.a.createElement("h5",null,n("animalDocuments.cyclesHistory"),"\xa0"),p.a.createElement(f.a,{onChange:this.onSwitchView,value:e,options:s}),p.a.createElement(h.a,{buttonStyle:"round",icon:p.a.createElement("i",{className:"fas fa-pencil-alt"}),onClick:this.showEditModal})),p.a.createElement("div",{className:"sow-card"},p.a.createElement(h.a,{icon:p.a.createElement("i",{className:"far fa-print"}),id:"print-button",buttonColor:"success",onClick:this.onPrintClick},n("grid.print1")),p.a.createElement("div",{className:"cycle-grid-container",ref:this.table},p.a.createElement("div",{className:"cycle-grid"},o,t.map((e,t)=>p.a.createElement(p.a.Fragment,{key:t},r&&p.a.createElement(_.a,{expanded:a,cycle:e,onPress:this.onExpandedRowClick}),p.a.createElement(x.a,{cycle:e}),p.a.createElement(P.a,{cycleRenderClass:this.getCycleRenderClass(S.INSEMINATION,t),expanded:a,isAdvanced:r,cycle:e,tooltipContent:this.getTooltipContent(S.INSEMINATION,t,n("animalDocuments.insemination"))}),p.a.createElement(j.a,{expanded:a,isAdvanced:r,cycle:e,cycleRenderClass:this.getCycleRenderClass(S.USG,t),tooltipContent:this.getTooltipContent(S.USG,t,"USG")}),p.a.createElement(R.a,{isAdvanced:r,cycle:e,tooltipContent:this.getTooltipContent(S.PARTURITION,t,n("animalDocuments.birth")),cycleRenderClass:this.getCycleRenderClass(S.PARTURITION,t)}),p.a.createElement(A.a,{expanded:a,isAdvanced:r,cycle:e,tooltipContent:this.getTooltipContent(S.FALL_PIGLETS,t,n("fallPiglets")),cycleRenderClass:this.getCycleRenderClass(S.FALL_PIGLETS,t)}),p.a.createElement(M.a,{expanded:a,isAdvanced:r,cycle:e,tooltipContent:this.getTooltipContent(S.SEPARATION_TO_MOMMY,t,n("animalDocuments.mommySeparation")),cycleRenderClass:this.getCycleRenderClass(S.SEPARATION_TO_MOMMY,t)}),p.a.createElement(F.a,{expanded:a,isAdvanced:r,cycle:e,tooltipContent:this.getTooltipContent(S.MOMMY,t,n("mommy")),cycleRenderClass:this.getCycleRenderClass(S.MOMMY,t)}),p.a.createElement(k.a,{isAdvanced:r,cycle:e,tooltipContent:this.getTooltipContent(S.SEPARATION,t,n("separation")),cycleRenderClass:this.getCycleRenderClass(S.SEPARATION,t)}),p.a.createElement(L.a,{cycle:e,tooltipContent:this.getTooltipContent(S.ACTIVE_NIPPLES,t,n("animalDocuments.activeNipples")),cycleRenderClass:this.getCycleRenderClass(S.ACTIVE_NIPPLES,t)}),p.a.createElement(V.a,{expanded:a,isAdvanced:r,cycle:e}),p.a.createElement(Y.a,{isAdvanced:r,cycle:e}))),this.getEmptyRows(i).map((e,t)=>p.a.createElement(p.a.Fragment,{key:t},r&&p.a.createElement(_.a,{expanded:a,cycle:e,onPress:this.onExpandedRowClick}),p.a.createElement(x.a,{cycle:e}),p.a.createElement(P.a,{expanded:a,isAdvanced:r,cycle:e}),p.a.createElement(j.a,{expanded:a,isAdvanced:r,cycle:e}),p.a.createElement(R.a,{isAdvanced:r,cycle:e}),p.a.createElement(A.a,{expanded:a,isAdvanced:r,cycle:e}),p.a.createElement(M.a,{expanded:a,isAdvanced:r,cycle:e}),p.a.createElement(F.a,{expanded:a,isAdvanced:r,cycle:e}),p.a.createElement(k.a,{isAdvanced:r,cycle:e}),p.a.createElement(L.a,{cycle:e}),p.a.createElement(V.a,{expanded:a,isAdvanced:r,cycle:e}),p.a.createElement(Y.a,{isAdvanced:r,cycle:e})))))))}}t.a=Object(y.d)(Object(C.a)(),Object(u.connect)((function(e){return{animal:e.animalDocuments.selectedItem,cycleTable:e.animalDocuments.cycleTable}}),(function(e){return function(e){for(var t=1;tr.a.createElement(c.a,{xs:12,md:4},r.a.createElement("h3",{className:"opacity-75"},!!e&&r.a.createElement("span",{className:"mr-1 opacity-25"},r.a.createElement("i",{title:e,className:t})),a),r.a.createElement("div",{className:"opacity-75"},n,1!==s&&r.a.createElement("small",{className:"ml-1"},r.a.createElement(p.a,{highlightColor:"secondary"},s,o)),!!i&&r.a.createElement("small",{className:"ml-1 opacity-75"},"RFID: ",i)))),f=r.a.memo(({locationName:e,contentLocation:t})=>r.a.createElement(c.a,{xs:12,md:6,className:"text-right text-md-left"},e,r.a.createElement("div",{className:"opacity-50 d-none d-sm-block"},t))),y=r.a.memo(({age:e,contentAge:t})=>r.a.createElement(c.a,{xs:12,md:2,className:"d-none d-md-block"},e,r.a.createElement("div",{className:"opacity-50 d-none d-sm-block"},t)));class b extends r.a.Component{constructor(...e){super(...e),this.getAge=()=>{const{data:{animal:e,isGroup:t=!1}}=this.props;if(!t&&e){const t=e.DtaBrthTime,a=e.DtaDthTime||+new Date;if(t&&a)return r.a.createElement(g.a,{start:t,stop:a})}return"-"},this.handleRowClick=()=>{const{handleRowClick:e,data:t}=this.props;e(t)}}componentDidUpdate(e,t,a){const{measure:n,data:o}=this.props;n&&(o.id===e.data.id&&s()(o,"animals.length",0)===s()(e.data,"animals.length",0)||n())}render(){const{t:e,index:t,style:a,handleRowClick:n,data:{animal:o,locationName:i,animalCount:d,name:p="",typeName:h="",animals:g=[],isGroup:E=!1}}=this.props,b=s()(o,"RFID",!1),w=o&&o.DtaDthTime?u()(o.DtaDthTime).format("DD.MM.YY"):"",D=o&&1===o.DthRsn?"fas fa-dollar-sign":"fas fa-cross";return r.a.createElement(l.a,{index:t,style:a,className:"col"},!!E&&r.a.createElement(r.a.Fragment,null,r.a.createElement(m.a,{onClick:this.handleRowClick,className:"pointer"},r.a.createElement(c.a,{xs:12},r.a.createElement("h3",{className:"opacity-75"},h," ",p))),r.a.createElement("div",{className:"pl-1 pl-sm-3 pl-md-4 pl-lg-5 mb-2"},g.map((e,a)=>r.a.createElement(C,{handleRowClick:n,index:"".concat(t+1,".").concat(a+1),data:e})))),!E&&r.a.createElement(m.a,{onClick:this.handleRowClick,className:"pointer"},r.a.createElement(v,{name:p,rfid:b,deathTime:w,animalCount:d,typeName:h,deathIcon:D,contentPcs:e("pcs")}),r.a.createElement(f,{locationName:i,contentLocation:e("location")}),r.a.createElement(y,{age:this.getAge(),contentAge:e("age")})))}}let C=Object(i.connect)(e=>({}))(b);C=Object(E.a)()(C),t.a=Object(d.o)(C)},pxb3:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("0b+E"),r=a("17x9"),i=a.n(r);o.a.initialize("UA-149528907-1");class l extends s.a.Component{constructor(...e){super(...e),this.sendPageView=e=>{let t=e.pathname;o.a.set({page:t}),o.a.pageview(t)}}componentDidMount(){}render(){return this.props.children}}l.contextTypes={router:i.a.object},t.a=l},qxeP:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("17x9"),r=a.n(o);class i extends n.Component{render(){const{isLoading:e,className:t,icon:a,useTransition:n}=this.props,o=["loading-list-item",t,n?"animate":""].filter(e=>!!e).join(" ");return e?s.a.createElement("div",{className:o},s.a.createElement("i",{className:a})):null}}i.propTypes={isLoading:r.a.bool.isRequired,useTransition:r.a.bool,className:r.a.string,icon:r.a.string},i.defaultProps={useTransition:!1,className:"",icon:"fas fa-circle-notch fa-spin"},t.a=i},"t/ex":function(e,t,a){"use strict";var n=a("lSCD"),s=a.n(n),o=a("q1tI"),r=a.n(o),i=a("17x9"),l=a.n(i),c=a("lFKM"),m=a.n(c),d=a("wd/R"),p=a.n(d),h=a("JI6e"),u=a("3Z9Z");class g extends o.Component{constructor(...e){super(...e),this.handleOnClick=()=>{const{onExpand:e}=this.props;s()(e)&&e(this.props)},this.optionsToProps=({rtl:e=!1,bold:t=!1,renderer:a=(e=>e)}={})=>({className:["text-truncate",e?"rtl":"",t?"font-weight-bold":""].join(" "),renderer:a}),this.colRenderer=({type:e,value:t,options:a})=>{const{sizing:n,onExpand:o}=this.props,i=s()(o),{className:l,renderer:c}=this.optionsToProps(a||g.defaultProps.options[e]);return r.a.createElement(h.a,{className:l,xs:i?11:12,md:["time","title"].includes(e)?n[0]:i?n[1]-1:n[1]},c(t,this.props))}}render(){const{style:e,title:t,timestamp:a,text:n,subtitle:o,onExpand:i,options:l={}}=this.props,c=s()(i),m=!(!a||!l.highlightAfter)&&a>l.highlightAfter,d=this.colRenderer;return r.a.createElement("div",{style:e},r.a.createElement(u.a,{xs:12,onClick:this.handleOnClick,className:"list-row pb-2 pt-2 text-truncate position-relative".concat(c?" pointer":"").concat(m?" highlight-new":"")},r.a.createElement(d,{type:"time",value:a,options:l.time}),r.a.createElement(d,{type:"subtitle",value:o,options:l.subtitle}),r.a.createElement(d,{type:"title",value:t,options:l.title}),r.a.createElement(d,{type:"text",value:n,options:l.text}),c&&r.a.createElement("div",{className:"expand-item"},r.a.createElement("i",{className:"fas fa-chevron-right"}))))}}g.propTypes={timestamp:l.a.number,title:l.a.string,text:l.a.string,sizing:l.a.arrayOf(l.a.number),options:l.a.shape({highlightAfter:l.a.number,title:l.a.shape({rtl:l.a.bool,renderer:l.a.func,bold:l.a.bool,useTranslation:l.a.bool}),time:l.a.shape({rtl:l.a.bool,renderer:l.a.func,bold:l.a.bool,useTranslation:l.a.bool}),text:l.a.shape({rtl:l.a.bool,renderer:l.a.func,bold:l.a.bool,useTranslation:l.a.bool}),subtitle:l.a.shape({rtl:l.a.bool,renderer:l.a.func,bold:l.a.bool,useTranslation:l.a.bool})})},g.defaultProps={sizing:[5,7],options:{highlightAfter:0,title:{rtl:!1,renderer:e=>e},time:{rtl:!1,renderer:e=>m()(e)?p()(e).format("DD.MM.YY HH:mm"):"-"},text:{rtl:!1,renderer:e=>e,bold:!0},subtitle:{rtl:!1,renderer:e=>e}}};var E=g,v=a("uSQv");class f extends o.Component{constructor(e){super(e),this.rowRenderer=({title:e,text:t,timestamp:a,subtitle:n,_id:s,_passThrough:o}={})=>{const{onExpand:i,options:l,sizing:c}=this.props;return r.a.createElement(E,{sizing:c,_id:s,_passThrough:o,options:l,title:e,text:t,timestamp:a,subtitle:n,onExpand:i})},this.cutPage=(e,t,a)=>(console.log(e,a,t),a.slice(e*t,(e+1)*t)),this.pageNext=()=>{const{page:e}=this.state,{maxPages:t}=this.props;this.setState({page:Math.min(e+1,t-1)})},this.pagePrev=()=>{const{page:e}=this.state;this.setState({page:Math.max(e-1,0)})},this.state={page:0}}static getDerivedStateFromProps(e,t){const{maxPages:a}=e;return athis.rowRenderer(e)),a>0&&r.a.createElement("div",{className:"d-flex mt-1 align-items-center justify-content-center"},r.a.createElement(v.a,{disabled:0===n,className:"mb-0",onClick:this.pagePrev,type:"button",buttonStyle:"round",icon:r.a.createElement("i",{className:"fas fa-backward mr-1"})}),r.a.createElement(v.a,{disabled:n>=a-1,className:"mb-0",onClick:this.pageNext,type:"button",buttonStyle:"round",icon:r.a.createElement("i",{className:"fas fa-forward ml-1"})})))}}f.propTypes={};var y=f,b=a("mwIZ"),C=a.n(b),w=a("sEfC"),D=a.n(w),O=a("c7k8"),S=a("b9ZJ"),I=a("wQVC");class N extends o.Component{constructor(e){super(e),this.onRowsRendered=D()(({stopIndex:e})=>{const{loadMoreCallback:t,data:a=[],pageSize:n}=this.props;if(s()(t)&&this.lastStopIndex!==e&&(this.lastStopIndex=e,a.length-1===e)){const e=Math.floor(a.length/n);t({currentPage:e,nextPage:e+1,length:a.length,pageSize:n,lastItem:a.length?a[a.length-1]:null})}},125),this.rowRenderer=({index:e,style:t,key:a,parent:n})=>{const{data:s,onExpand:o,options:i}=this.props,{title:l,text:c,timestamp:m,subtitle:d,_id:p,_passThrough:h}=s[e]||{};return r.a.createElement(O.b,{cache:this.cache,columnIndex:0,key:a,parent:n,rowIndex:e},({measure:e})=>r.a.createElement(E,{_id:p,_passThrough:h,options:i,style:t,title:l,text:c,timestamp:m,subtitle:d,onExpand:o}))},this.lastStopIndex=0,this.cache=new O.c({defaultHeight:Object(I.f)(7),fixedWidth:!0,keyMapper:e=>{const t=this.props.data[e]||{},a=C()(t,"_id")||e;return"".concat(a)}})}render(){const{data:e,loading:t}=this.props;return r.a.createElement("div",null,r.a.createElement(O.f,{onResize:this.clearCache},({height:t,isScrolling:a,scrollTop:n,onChildScroll:s})=>r.a.createElement(S.List,{rowCount:e.length,width:window.innerWidth,rowRenderer:this.rowRenderer,scrollTop:n,autoHeight:!0,height:t,onRowsRendered:this.onRowsRendered,deferredMeasurementCache:this.cache,rowHeight:this.cache.rowHeight,isScrolling:a,onScroll:s,overscanRowCount:3,className:"w-100 overflow-auto"})),t&&r.a.createElement("div",{className:"w-100 d-flex justify-content-center align-items-center"},r.a.createElement("i",{className:"fas fa-circle-notch fa-spin"})))}}N.propTypes={};var T=N;a("Grx6");class x extends o.Component{render(){const{sizing:e,options:t,pageSize:a,maxPages:n,data:o,onExpand:i,loadMoreCallback:l,mobile:c,loading:m}=this.props,d="fetura-list-full-width".concat(s()(i)?" selectable":"");return r.a.createElement("div",{className:d},!c&&r.a.createElement(y,{sizing:e,options:t,loading:m,loadMoreCallback:l,onExpand:i,data:o,pageSize:a,maxPages:n}),c&&r.a.createElement(T,{options:t,loading:m,loadMoreCallback:l,onExpand:i,data:o,pageSize:a,maxPages:n}))}}x.propTypes={data:l.a.array.isRequired,loadMoreCallback:l.a.func,loading:l.a.bool,pageSize:l.a.number.isRequired,page:l.a.number,mobile:l.a.bool,options:l.a.object,maxPages:l.a.number.isRequired,sizing:l.a.array},x.defaultProps={mobile:!1};t.a=x},"udB/":function(e,t,a){"use strict";a.d(t,"a",(function(){return m}));var n=a("lSCD"),s=a.n(n),o=a("q1tI"),r=a.n(o),i=a("7xGa"),l=(a("1H/7"),a("17x9")),c=a.n(l);class m extends r.a.Component{constructor(e){super(e),this.setupTimer=(e=this.props)=>{const{isLoading:t,timeout:a,onTimeout:n}=e,{timeoutCalled:s}=this.state;clearTimeout(this.timer),t&&a&&(s||(this.timer=setTimeout(()=>{n()},1e3*a)))},this.state={timeoutCalled:!1},this.setupTimer()}UNSAFE_componentWillReceiveProps(e,t){const{isLoading:a}=this.props;a!==e.isLoading&&this.setupTimer(e)}componentWillUnmount(){clearTimeout(this.timer)}render(){const{error:e,isLoading:t,fallBackComponent:a,style:n,loadingComponent:o,bgInherit:l,type:c}=this.props;if(e)return console.error(e),s()(a)?a(e):a;const m=["loading",l?"bg-inherit":"","type-".concat(c)].filter(e=>e).join(" ");return r.a.createElement(i.a,{in:t,timeout:{appear:25,enter:25,exit:500},unmountOnExit:!0},r.a.createElement("div",{style:n,className:m},o))}}m.propTypes={isLoading:c.a.bool.isRequired,error:c.a.object,timeout:c.a.number,fallBackComponent:c.a.oneOfType([c.a.node,c.a.element,c.a.func]),loadingComponent:c.a.node,onTimeout:c.a.func,bgInherit:c.a.bool,style:c.a.object,type:c.a.oneOf(["component","container"])},m.defaultProps={timeout:0,bgInherit:!1,type:"component",onTimeout:()=>{},fallBackComponent:r.a.createElement("div",null,"Sorry, there was a problem loading the page."),style:{},loadingComponent:r.a.createElement("i",{className:"fas fa-circle-notch fa-spin"})}},xBvN:function(e,t,a){"use strict";var n=a("q1tI"),s=a.n(n),o=a("oX1l"),r=a("fncI"),i=a("zTlQ"),l=a("uSQv"),c=a("vzZS"),m=a("vYJ8"),d=a("LCzB"),p=a("XzT5");class h extends o.c{constructor(e){super(e),this.onSubmitSendVerificationCode=e=>{this.send(),e.preventDefault()},this.onSubmitSendNewPassword=e=>{this.submit(),e.preventDefault()},this.onResendVerificationCodeClick=()=>{this.send(),this.setState({resendedCode:!0})},this.state={delivery:null,resendedCode:!1}}showComponent(e){console.log(this);const{onStateChange:t,t:a,error:n}=this.props,{delivery:o,resendedCode:d}=this.state;return console.log(this.state),s.a.createElement(r.a,{onStateChange:t,showForgotPassword:!1,showSendVerificationCode:!!o,onSendVerificationCodeClick:this.onResendVerificationCodeClick},o&&!d&&s.a.createElement(c.a,null,p.a.t("forgottenPassword.infoSend",{type:o.Destination})),d&&s.a.createElement(c.a,null,p.a.t("forgottenPassword.resendedCode",{type:o.Destination})),s.a.createElement(m.a,{in:!!n},s.a.createElement("div",null,s.a.createElement(c.a,{boxColor:"error"},n))),o&&s.a.createElement("form",{onSubmit:this.onSubmitSendNewPassword},s.a.createElement(i.a,{id:"code",key:"code",name:"code",type:"text",label:a("forgottenPassword.verifyCode"),onChange:this.handleInputChange,onChangeWithEvent:!0}),s.a.createElement(i.a,{id:"password",key:"password",name:"password",type:"password",autocomplete:"off",label:a("newPassword"),onChange:this.handleInputChange,onChangeWithEvent:!0}),s.a.createElement(l.a,{buttonColor:"primary"},a("forgottenPassword.submit"))),!o&&s.a.createElement("form",{onSubmit:this.onSubmitSendVerificationCode},s.a.createElement(i.a,{id:"username",key:"username",name:"username",type:"text",label:a("login.login"),onChange:this.handleInputChange,onChangeWithEvent:!0}),s.a.createElement(l.a,{buttonColor:"primary"},a("login.rememberPassword"))))}}t.a=Object(d.a)()(h)},xN95:function(e,t,a){}}]); //# sourceMappingURL=main~8fece612.5a1f9b2a.chunk.js.map