(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[42],{"+t3Z":function(t,e,a){"use strict";var r=a("ynWa"),n=a("OwcS"),i=a("B6RA"),s=a("PRyg");class o extends r.a{static createEvent(t,e,r,o,c,l=null){let m=i.default.getState(),h=m.location.farm,u=m.user.user.LocalUserID,D=Object(s.getKillTime)(s.KILL_TIME.THREE_YEARS);"CypressFarm1"===h&&"CypressLocal"===u&&(D=Object(s.getKillTime)(s.KILL_TIME.ONE_DAY));let d=Object(s.getGrIDByAnmID)(t,o),f={AnmID:t,EvCode:e,AnmCnt:r,EvTime:o,FarmID:h,OperID:u,EvData:c,EvID:Object(n.a)(),DtaModTime:+new Date,KillTime:D,GrID:d};if(l&&(f.Comment=l),!f.EvData)throw new Error("Brak EvData");return a("PRyg").getClass(f)}deleteEvent(t=+new Date){this.DtaDelTime=t,this.setDtaModTime()}unDeleteEvent(){delete this.DtaDelTime,this.setDtaModTime()}}e.a=o},"2UNB":function(t,e,a){"use strict";var r=a("ynWa"),n=a("OwcS"),i=a("B6RA"),s=a("P0Qa");class o extends r.a{static createSetting(t,e,r=null){let o,c=i.default.getState(),l=c.location.farm,m=c.user.user.ClientID;switch(t){case s.a.GENERAL:o=m;break;case s.a.FARM_MAP:o="farm_map_".concat(l);break;default:o=Object(n.a)()}let h={ClientID:m,SetID:o,SetType:t,SetData:e,DtaModTime:+new Date};if(t!==s.a.GENERAL&&t!==s.a.NOTIFICATIONS&&(h.FarmID=l),r&&(h.LocalUserID=r),!h.SetData)throw new Error("Brak SetData");return a("q17X").getSettingClass(h)}deleteSetting(t=+new Date){this.DtaDelTime=t,this.setDtaModTime()}unDeleteSetting(){delete this.DtaDelTime,this.setDtaModTime()}}e.a=o},"7TV9":function(t,e,a){"use strict";var r=a("b3Ly"),n=a("OwcS"),i=a("ba6h"),s=a("B6RA");class o extends r.a{static createIngredient(t){const e=s.default.getState(),{user:{user:{ClientID:a}}}=e;return new o({WordID:Object(n.a)(),DtaModTime:(new Date).getTime(),Type:i.a.forageIngredient,ClientID:a,WData:{Name:t}})}}e.a=o},CX8Q:function(t,e,a){"use strict";var r=a("ynWa"),n=a("OwcS"),i=a("i8MS"),s=a("aIXM");function o(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function c(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class l extends r.a{static createAnimal(t,e,a,r,i,s={}){let m=function(t){for(var e=1;ee.PlcmntID===t);a||(a={PlcmntID:t,AnmCnt:0},this.PlcmntID.push(a)),this.AnmCnt+=e,a.AnmCnt+=e,this.setDtaModTime()}addAnimals(t,e=null){if(e&&Array.isArray(this.PlcmntID)){this.PlcmntID.find(t=>t.PlcmntID===e).AnmCnt+=t}this.AnmCnt+=t,this.convertPlcmntID()}removeAnimals(t,e){if(console.log(e,this),Array.isArray(this.PlcmntID)){let a;if(a=e?this.PlcmntID.find(t=>t.PlcmntID===e):this.PlcmntID[0],!a)throw new Error("Nie odnaleziono miejsca w zwierz\u0119ciu o ID ".concat(e));if(a.AnmCntt.PlcmntID!==a.PlcmntID))}this.AnmCnt-=t,this.convertPlcmntID(),this.setDtaModTime()}transferAnimal(t,e=1,a,r){if(e>0)if(this.setDtaModTime(),this.AnmCnt>1){if(Array.isArray(this.PlcmntID)){if(this.PlcmntID.length>1){console.log(this.PlcmntID);let t=a?this.PlcmntID.find(t=>t.PlcmntID===a):this.PlcmntID[0];if(!t)throw new Error("Nie odnaleziono miejsca w zwierz\u0119ciu o ID ".concat(a));t.AnmCnt-=e,0===t.AnmCnt&&(this.PlcmntID=this.PlcmntID.filter(e=>e.PlcmntID!==t.PlcmntID))}this.convertPlcmntID()}if(this.AnmCnt!==e){this.AnmCnt-=e;let a=i.a.getAllAnimalsByPlcmntID(t);if(a.length>0){let r=s.a.getGroupWithAnimal(this.AnmID,this.FarmID),n=[];for(let t of r)for(let e of a)t.AnmIDs.includes(e.AnmID)&&n.push(e);let i=n.find(t=>!t.RFID);if(i){if(i.AnmCnt+=e,Array.isArray(i.PlcmntID)){i.PlcmntID.find(e=>e.PlcmntID===t).AnmCnt+=e,this.convertPlcmntID()}return i.setDtaModTime(),{animal:i.prepareBeanToSave(),created:!1}}}let o=this.clone();return o.AnmID=Object(n.a)(),o.AnmCnt=e,o.PlcmntID=t,o.OldAnmID=this.AnmID,r&&(o.AnmNo1=r),o.setDtaModTime(),console.log(o),{animal:o,created:!0}}this.PlcmntID=t}else this.PlcmntID=t;return this.setDtaModTime(),null}}e.a=l},Hk1H:function(t,e,a){"use strict";var r=a("JFfd"),n=a("wd/R"),i=a.n(n),s=a("b3Ly");class o extends s.a{markAsFavorite(t){Array.isArray(this.WData.Favorite)||(this.WData.Favorite=[]),this.WData.Favorite.includes(t)?this.WData.Favorite=this.WData.Favorite.filter(e=>e!==t):this.WData.Favorite.push(t),this.setDtaModTime()}getDatesForList(){const{WData:{Period:t,Day:e,MonthDay:a,StartDay:n,EndDay:s}}=this;let o={start:i()().startOf("day").subtract(2,"weeks")};if(t===r.b.X_DAYS)return o.end=i()().startOf("day").add(e,"days"),o;if(t===r.b.END_OF_MONTH)return o.end=i()().endOf("month"),o;if(t===r.b.TO_DAY_IN_MONTH){let t=i()().startOf("day").date(a);return t.toDate().getTime()<(new Date).getTime()&&t.add(1,"month"),o.end=t,o.start=i()().startOf("month"),o}return t===r.b.RANGE?{start:i.a.utc(n).startOf("day"),end:i.a.utc(s).endOf("day")}:null}}e.a=o},OKc2:function(t,e,a){"use strict";var r=a("b3Ly"),n=a("OwcS"),i=a("ba6h"),s=a("B6RA");class o extends r.a{static createGraftingProgram(t,e,a){const r=s.default.getState(),{user:{user:{ClientID:c}}}=r;let l=new o({WordID:Object(n.a)(),DtaModTime:(new Date).getTime(),Type:i.a.graftingProgram,ClientID:c,WData:{Name:t,AnimalKind:e,MedicineList:a}});return l.sortMedicines(),l}sortMedicines(){this.WData.MedicineList.sort((t,e)=>t.Age-e.Age)}}e.a=o},OahN:function(t,e,a){"use strict";var r=a("b3Ly"),n=a("OwcS"),i=a("ba6h"),s=a("B6RA");class o extends r.a{static createMedicine(t,e,a,r,c,l,m){const h=s.default.getState(),{user:{user:{ClientID:u}}}=h;return new o({WordID:Object(n.a)(),DtaModTime:(new Date).getTime(),Type:i.a.medicine,ClientID:u,WData:{Name:t,Dose:e,Type:a,Unit:r,GracePeriod:c,Price:l,Color:m}})}}e.a=o},Ogml:function(t,e,a){"use strict";var r=a("4qC0"),n=a.n(r),i=a("Z0cm"),s=a.n(i),o=a("J2iB"),c=a.n(o),l=a("ynWa"),m=a("B6RA"),h=a("zDJl"),u=a("OwcS"),D=a("n7pt"),d=a("i8MS"),f=a("BvFm");function I(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function g(t){for(var e=1;e({Adr:e,Active:!1})));break;case h.d.DISPENSER:d.Dispensers||(d.Dispensers=new Array(20).fill(1).map((t,e)=>({Adr:e,Connected:!1})));break;default:console.warn("Nie rozpoznano")}return d}getLocation(t=null){try{if(!this.PlcmntID)throw new Error("Brak PlcmntID");if(null!==t){return this.PlcmntID.filter(e=>e.Adr===t).map(t=>D.a.getLocationByID(t.PlcmntID)).filter(t=>t)}return this.PlcmntID.map(t=>D.a.getLocationByID(t.PlcmntID)).filter(t=>t)}catch(e){return console.error(e),[]}}removeDevice(t=(new Date).getTime()){this.DtaDltTime=t,this.setDtaModTime()}addLocation(t,e=null){"string"===typeof this.PlcmntID&&(this.PlcmntID=[]),this.PlcmntID&&![h.d.DISPENSER_NRF].includes(this.DevType)||(this.PlcmntID=[]),null!==e?(this.PlcmntID=this.PlcmntID.filter(a=>!(a.PlcmntID===t&&a.Adr===e)),[h.d.DISPENSER].includes(this.DevType)&&(this.PlcmntID=this.PlcmntID.filter(t=>t.Adr!==e))):this.PlcmntID=this.PlcmntID.filter(e=>!(e.PlcmntID===t));let a={PlcmntID:t};null!==e&&(a.Adr=e),this.PlcmntID.push(a),this.setDtaModTime()}removeLocation(t,e=null){if(console.log(e,this.PlcmntID),!this.PlcmntID)throw new Error("Brak tablicy PlcmntID");null!==e?(console.log("is address"),this.PlcmntID=this.PlcmntID.filter(a=>a.PlcmntID!==t||a.Adr!==e)):this.PlcmntID=this.PlcmntID.filter(e=>e.PlcmntID!==t),this.setDtaModTime()}getAddressForLocation(t){if(!this.PlcmntID)throw new Error("Brak tablicy PlcmntID");let e=this.PlcmntID.find(e=>e.PlcmntID===t);return e&&void 0!==e.Adr?e.Adr:null}getSelectName(t=null,e=!0,a=!1){let r=this.getLocation(t);return Object(f.i)()?"".concat(this.Name).concat(null!==t?" {".concat(t,"}"):"").concat(e&&this.Alias?" A: ".concat(this.Alias):""," [").concat(this.Address,"/0x").concat(this.Address.toString(16).toUpperCase(),"] (").concat(r.map(t=>{if(a){return d.a.getAnimalLocationsByPlcmntID(t.FarmID||t.BgID||t.SID||t.CID||t.BID).map(t=>t.name).filter(t=>t).join(", ")}return t?t.CName||t.BName||t.SName||t.FarmName||t.BoxesName:void 0}).filter(t=>t).join(", "),") S/N: ").concat(this.DevID):"".concat(this.Name).concat(null!==t?" {".concat(t,"}"):"").concat(e&&this.Alias?" A: ".concat(this.Alias):""," (").concat(r.map(t=>{if(a){return d.a.getAnimalLocationsByPlcmntID(t.FarmID||t.BgID||t.SID||t.CID||t.BID).map(t=>t.name).filter(t=>t).join(", ")}return t?t.CName||t.BName||t.SName||t.FarmName||t.BoxesName:void 0}).filter(t=>t).join(", "),")")}getDebugName(t=null){return"".concat(this.Name," ").concat(null!==t?" {".concat(t,"}"):""," [").concat(this.Address,"/0x").concat(this.Address.toString(16).toUpperCase(),"]")}setAnmIDInLocation(t,e){this.PlcmntID||(this.PlcmntID=[]);let a=this.PlcmntID.find(e=>e.PlcmntID===t);a&&(a.AnmIDs||(a.AnmIDs=[]),a.AnmIDs.push(e)),this.setDtaModTime()}removeAnmIDInLocation(t,e){this.PlcmntID||(this.PlcmntID=[]);let a=this.PlcmntID.find(e=>e.PlcmntID===t);a&&(a.AnmIDs||(a.AnmIDs=[]),a.AnmIDs=a.AnmIDs.filter(t=>t!==e))}setConfiguration(t,e=!0){this.Settings||(this.Settings={}),this.Settings.Configuration||(this.Settings.Configuration={});for(let a in t)t[a].isSet=e,t[a].SetTime=(new Date).getTime();this.Settings.Configuration=g({},this.Settings.Configuration,{},t),this.setDtaModTime()}prepareBeanToSave(){let t=super.prepareBeanToSave();return delete t.location,delete t.GatewayID,t}getPlacementArray(t=null){return(n()(this.PlcmntID)?[{PlcmntID:this.PlcmntID}]:s()(this.PlcmntID)?this.PlcmntID:[]).filter(e=>c()(t)||e.Adr===t).map(t=>t.PlcmntID)}getAddressString(t=null){return c()(this.Address)?"":"".concat(this.Address,"/0x").concat(this.Address.toString(16).toUpperCase())}}e.a=y},XiQt:function(t,e,a){"use strict";var r=a("BkRI"),n=a.n(r),i=a("ynWa"),s=a("pZsI"),o=a("B6RA"),c=a("q17X"),l=a("wd/R"),m=a.n(l),h=a("OwcS"),u=a("A8dC");class D extends i.a{static createTechnologyGroup(t){let e=Object(c.getTechnologyGroupWeeks)(),a=o.default.getState().location.farm,r=0,i=n()(s.a.getTechnologyGroups(a));if(i.length>0){i.sort((t,e)=>e.StartTime-t.StartTime);let a=i.find(e=>e.StartTimet.toDate().getTime()&&(r=a.toDate().getTime()),a=a.add(e,"week")}0===r&&(r=t.toDate().getTime())}let l=m()(r).add(Object(u.a)());console.log(l);let d={AnmList:[],DtaModTime:(new Date).getTime(),FarmID:a,Rmvd:[],RmvdCnt:0,StartTime:+l,TGID:Object(h.a)(),Ver:"1.01"};return new D(d)}static findTechnologyGroup(t){let e=o.default.getState().location.farm,a=s.a.getTechnologyGroups(e),r=7*Object(c.getTechnologyGroupWeeks)();t.startOf("day");for(let n of a){let e=m()(n.StartTime);console.log(+e);let a=t.diff(e,"days");if(console.log(a),a=0)return n}}addAnimal(t){if(this.AnmList||(this.AnmList=[]),!this.AnmList.includes(t))return this.AnmList.push(t),void this.setDtaModTime();this.Rmvd.includes(t)&&(this.Rmvd=this.Rmvd.filter(e=>e!==t),this.setDtaModTime())}addAnimals(t){for(let e of t)this.addAnimal(e)}removeAnimal(t,e=!1){if(!this.AnmList.includes(t))throw new Error("Zwierz\u0119 o ID ".concat(t," nie jest dodane do tej grupy technologicznej"));this.Rmvd||(this.Rmvd=[]),this.Rmvd.includes(t)||(e||this.Rmvd.push(t),e&&(this.AnmList=this.AnmList.filter(e=>e!==t)),this.setDtaModTime())}includesDate(t){const e=Object(c.getTechnologyGroupWeeks)();return m()(t).isBetween(this.StartTime,m()(this.StartTime).add(e,"weeks"),"day","[]")}}e.a=D},b3Ly:function(t,e,a){"use strict";var r=a("ynWa"),n=a("B6RA");class i extends r.a{prepareBeanToSave(){const t=n.default.getState(),{user:{user:{ClientID:e}}}=t;let a=super.prepareBeanToSave();return a.ClientID=e,this.setDtaModTime(),a}remove(){this.DtaDelTime=(new Date).getTime(),this.setDtaModTime()}}e.a=i},hot2:function(t,e,a){"use strict";a.d(e,"a",(function(){return h}));var r=a("mwIZ"),n=a.n(r),i=a("EUZL"),s=a.n(i);class o{constructor(t){Object.assign(this,s.a.utils.aoa_to_sheet(t))}addData(t,e){s.a.utils.sheet_add_aoa(this,t,{origin:e})}}class c{constructor(){Object.assign(this,s.a.utils.book_new()),this.Props={}}setTitle(t){this.Props.Title=t}setSubject(t){this.Props.Subject=t}setAuthor(t){this.Props.Author=t}setManager(t){this.Props.Manager=t}setCompany(t){this.Props.Company=t}setCategory(t){this.Props.Category=t}setKeywords(t){this.Props.Keywords=t}setComments(t){this.Props.Comments=t}setLastAuthor(t){this.Props.LastAuthor=t}setCreatedDate(t){this.Props.CreatedDate=t}setProps(t){this.Props=t}addSheet(t,e){let a=new o(e);return s.a.utils.book_append_sheet(this,a,t),a}}var l=a("wd/R"),m=a.n(l);class h{constructor(t,e={headers:null,sheetName:null}){let a;if(this.workbook=new c,e.headers){let t=e.headers.map(t=>t.name);a=this.workbook.addSheet(e.sheetName,[t])}a?a.addData(t,"A2"):this.workbook.addSheet(e.sheetName,t)}save(t){s.a.writeFile(this.workbook,"".concat(t,"_").concat(m()().format("YYYY_MM_DD_HH_mm_ss"),".xlsx"))}static formatData(t,e){return e.map(e=>t.map(t=>e.isFullWidth?n()(e,t.field)||"":t.excelFormatter?t.excelFormatter(n()(e,t.field)):n()(e,t.field)))}}},jpwK:function(t,e,a){"use strict";var r=a("ynWa"),n=a("B6RA"),i=a("OwcS"),s=a("i8MS");class o extends r.a{static createGroup(t){let e=n.default.getState().location.farm;return new o({FarmID:e,AnmGrp:Object(i.a)(),AnmIDs:[],DtaModTime:(new Date).getTime(),Rmvd:[],GrNo1:t})}hasAnimalInGroup(t){return this.AnmIDs.includes(t)}addAnimalToGroup(t){this.hasAnimalInGroup(t)||(this.AnmIDs.push(t),this.Rmvd.includes(t)&&(this.Rmvd=this.Rmvd.filter(e=>e!==t))),this.setDtaModTime()}removeAnimalFromGroup(t){this.hasAnimalInGroup(t)&&(this.AnmIDs=this.AnmIDs.filter(e=>e!==t),this.Rmvd.push(t)),this.setDtaModTime()}getAnimalsNumber(){let t=0;if(!this.AnmIDs.length)return t;for(let e of this.AnmIDs){let a=s.a.getAnimalById(e);a&&(t+=a.AnmCnt)}return t}getLocations(){let t=new Set;for(let e of this.AnmIDs){let a=s.a.getAnimalById(e);if(a){let e=s.a.getAnimalLocationsByPlcmntID(a.PlcmntID);for(let a of e)t.add(a.location)}}return[...t.values()]}}e.a=o},kDzr:function(t,e,a){"use strict";var r=a("ynWa"),n=a("OwcS"),i=a("B6RA");function s(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function o(t){for(var e=1;e(n()(e)?[e]:m()(e)?e:[]).map((e,r)=>{const n=u()(this.log,e),i=(m()(a)?a[r]:a)||"$t(none)";return c()(n)||c()(t[n])?i:s()(t[n])?JSON.stringify(t[n]):t[n]}).join(", "),this.dateFormatter=({path:t,defaultValue:e})=>{const a=u()(this.log,t);return a&&isFinite(a)?f()(a).format("DD.MM.YY"):e},this.timeFormatter=({path:t,defaultValue:e})=>{const a=u()(this.log,t);return a&&isFinite(a)?f()(a).format("HH:mm"):e},this.animalFormatter=({path:t,defaultValue:e})=>{const{animals:a}=this.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.efficiencyTimeFormatter=({path:t,defaultValue:e})=>P.a.t("newSettings.dispenserNRF.efficiency.timeEfficiencyFormatter",{value:Object(I.j)(2*u()(this.log,t,e),{unit:g.a.SMALL,fixed:1,showUnit:!0,acceptNil:!0,rawValue:!1})}),this.efficiencyImpulseFormatter=({path:t,defaultValue:e})=>P.a.t("newSettings.dispenserNRF.efficiency.impulseEfficiencyFormatter",{value:u()(this.log,t,e),unit:Object(I.l)("volume",g.a.MEDIUM,{overrideUnitSystem:"metric"})}),this.settingFormatter=({path:t,defaultValue:e})=>{const{settings:a}=this.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.deviceFormatter=({path:t,defaultValue:e})=>{const{devices:a}=this.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.employeeFormatter=({path:t,defaultValue:e})=>{const{employees:a}=this.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.locationFormatter=({path:t,defaultValue:e})=>{const{placements:a}=this.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.fallReasonFormatter=({path:t,defaultValue:e})=>{const{F:a}=this.dictionaries.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.medicineFormatter=({path:t,defaultValue:e})=>{const{MD:a}=this.dictionaries.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.graftingReasonFormatter=({path:t,defaultValue:e})=>{const{G:a}=this.dictionaries.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.noPregnancyFormatter=({path:t,defaultValue:e})=>{const{N:a}=this.dictionaries.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.selectionReasonFormatter=({path:t,defaultValue:e})=>{const{S:a}=this.dictionaries.dictionaries;return this._getDictionaryItemByID(a,t,e)},this.dictionaryFormatter=({path:t,defaultValue:e})=>{const a=Object.values(this.dictionaries.dictionaries).reduce((t,e)=>O({},t,{},e),{});return this._getDictionaryItemByID(a,t,e)},this.booleanFormatter=({path:t,defaultValue:e})=>this._getDictionaryItemByID({true:"\u2713",1:"\u2713",false:"\u2717",0:"\u2717"},t,e),this.skipDosesFormatter=({path:t,defaultValue:e})=>{const a={true:"$t(skipped)",1:"$t(skipped)",false:"$t(ok)",0:"$t(ok)"};return u()(this.log,t,[]).map((t,e)=>"".concat(e+1,": ").concat(a[t]||"$t(none)")).join(", ")},this.weightFormatter=({path:t,defaultValue:e})=>Object(I.j)(u()(this.log,t,e),{unit:g.a.MEDIUM,showUnit:!0,fixed:1,acceptNil:!0,rawValue:!1}),this.volumeFormatter=({path:t,defaultValue:e})=>Object(I.h)(u()(this.log,t,e),{unit:g.a.MEDIUM,showUnit:!0,fixed:1,acceptNil:!0,rawValue:!1}),this.animalKindFormatter=({path:t,defaultValue:e})=>{const a=u()(this.log,t,e);return"$t(animalKind.".concat(a,")")},this.pregnantFormatter=({path:t,defaultValue:e})=>{const a=u()(this.log,t,e);return"$t(events.usgEvent.".concat(["negative","positive","toRepeat"][a],")")},this.dictionaryTypeFormatter=({path:t,defaultValue:e})=>{const a={};return Object.values(p.a).forEach(t=>{const e=Object(y.getTranslationPath)(t);null!==e&&(a[t]="$t(".concat(e,")"))}),this._getDictionaryItemByID(a,t,e)},this.getFormatter=t=>{switch(t){case"animalFormatter":return this.animalFormatter;case"efficiencyTimeFormatter":return this.efficiencyTimeFormatter;case"efficiencyImpulseFormatter":return this.efficiencyImpulseFormatter;case"settingFormatter":return this.settingFormatter;case"employeeFormatter":return this.employeeFormatter;case"locationFormatter":return this.locationFormatter;case"fallReasonFormatter":return this.fallReasonFormatter;case"dateFormatter":return this.dateFormatter;case"timeFormatter":return this.timeFormatter;case"medicineFormatter":return this.medicineFormatter;case"graftingReasonFormatter":return this.graftingReasonFormatter;case"noPregnancyFormatter":return this.noPregnancyFormatter;case"weightFormatter":return this.weightFormatter;case"selectionReasonFormatter":return this.selectionReasonFormatter;case"animalKindFormatter":return this.animalKindFormatter;case"pregnantFormatter":return this.pregnantFormatter;case"deviceFormatter":return this.deviceFormatter;case"dictionaryFormatter":return this.dictionaryFormatter;case"dictionaryTypeFormatter":return this.dictionaryTypeFormatter;case"skipDosesFormatter":return this.skipDosesFormatter;case"booleanFormatter":return this.booleanFormatter;case"volumeFormatter":return this.volumeFormatter;default:return({path:t,defaultValue:e})=>c()(u()(this.log,t,e))?"$t(none)":u()(this.log,t,e)}},this.getIconAndName=()=>{if([D.a.DICTIONARY,D.b.DICTIONARY].includes(this.log.TableName)){const{NAMES:{DICTIONARY:t,CONTROLLIST:e,MEDICINE:a}}=this.dictionaries.dictionaries;let r=Object(A.a)(D.a.DICTIONARY);return e[this.log.ObjID]&&(r=Object(A.a)("ControlList")),a[this.log.ObjID]&&(r=Object(A.a)("Medicine")),{name:O({},t,{},e,{},a)[this.log.ObjID]||"$t(none)",icon:r}}{const t=[D.a.ANIMALS,D.a.SETTINGS,D.a.DEVICES,D.a.BUILDINGS],e=[D.b.ANIMALS,D.b.SETTINGS,D.b.DEVICES,D.b.BUILDINGS],a=t.findIndex((t,a)=>t===this.log.TableName||e[a]&&e[a]===this.log.TableName),r=this.getFormatter(["animalFormatter","settingFormatter","deviceFormatter","locationFormatter"][a]);return{icon:Object(A.a)(this.log.TableName),name:r({path:"ObjID"})}}},this.getData=()=>{const{log:t}=this,e=t.Codes||[],a=[],r=[];e.forEach((e,n)=>{const i=(t.Params||[])[n]||{},s={};for(let[t,{path:a,formatter:r,defaultValue:o=null}]of Object.entries(i)){const e=this.getFormatter(r);s[t]=e({path:a,defaultValue:o})}r.push("logsView.codes.".concat(e)),a.push(s)});const n={value:t.UserID,name:this.dictionaries.employees[t.UserID]||t.UserID,type:"user",isEmployee:!!this.dictionaries.employees[t.UserID]},{icon:i,name:s}=this.getIconAndName();return{params:a,user:n,iconClassName:i,translation:r,type:t.TableName,name:s}},this.log=t||{},this.dictionaries=e||{}}static createLogParser(t,e={}){return new w(t,e)}}},ynWa:function(t,e,a){"use strict";var r=a("Y+p1"),n=a.n(r),i=a("BkRI"),s=a.n(i);e.a=class{constructor(t){if(!t)throw new Error("Passed empty element to Bean constructor");Object.assign(this,t)}clone(){return s()(this)}equals(t){return n()(this,t)}setDtaModTime(){this.DtaModTime=+new Date}prepareBeanToSave(){let t=this.clone();return delete t.$loki,t}}},yuUd:function(t,e,a){"use strict";var r=a("ynWa"),n=a("fz7+"),i=a("wd/R"),s=a.n(i);class o extends r.a{static createLocalReport(t,e,{startDate:a=0,endDate:r=s()().utc().endOf("day"),day:i=s()().utc().endOf("day")}={},c=n.a.LOADING){let l={farmsArray:[t],startDate:a,endDate:r};return e===n.b.STRUCTURE&&(l={farmsArray:[t],startDate:s()(i).utc().startOf("day"),endDate:s()(i).utc().startOf("day")}),new o({FeturaQuery:{QueryParams:l,FeturaQTime:(new Date).getTime(),QueryCode:e},QueryExecution:{Status:{State:c}},isLocal:!0,data:[]})}updateStatus(t,e=n.a.READY){this.QueryExecution.Status.State=e,this.data=t}isOnFarm(t){return 1===this.FeturaQuery.QueryParams.farmsArray.length&&this.FeturaQuery.QueryParams.farmsArray.includes(t)}}e.a=o}}]); //# sourceMappingURL=main~6ce57865.6726ec18.chunk.js.map