PageSourceSearch

https://app.feldkalender.ch/chunk-U4ERD5UW.js

js feldkalender.ch collected 2026-10-02 00:27:48 UTC 90,772 bytes, 4 lines download raw bytes

1import{a as go}from"./chunk-ZWWSZIU5.js";import{a as Oo}from"./chunk-5VAPIAFX.js";import{b as Ao,c as No,d as fo,e as Co}from"./chunk-DPDSYHSX.js";import{c as Lo,d as Fo}from"./chunk-T5F6UQUO.js";import{a as D}from"./chunk-6A2UQSYA.js";import{a as So}from"./chunk-N2NCFFJ4.js";import{a as To}from"./chunk-3IT37AD4.js";import"./chunk-VJAYEAW7.js";import{a as Se}from"./chunk-TCKVAVCD.js";import{b as mo}from"./chunk-CDEI7P3P.js";import"./chunk-W6L422LU.js";import"./chunk-Z6POV4RB.js";import"./chunk-SMVNK6NI.js";import"./chunk-PERTG2G6.js";import"./chunk-MAMB2ZJT.js";import{b as Ro}from"./chunk-TCJ75MBN.js";import"./chunk-LS54SFL5.js";import"./chunk-ZBX6TD43.js";import"./chunk-XQHDPSBN.js";import"./chunk-S6AG3RC7.js";import"./chunk-JO2KR3SO.js";import"./chunk-FBXQNXHD.js";import"./chunk-5STAPCLV.js";import{a as u_}from"./chunk-ILE5JGXP.js";import{a as e_}from"./chunk-MLFXW2RR.js";import"./chunk-EYSDCAZF.js";import{a as po}from"./chunk-EOFVTSEO.js";import{a as io,c as ro,j as Ze,k as je,l as Qe,m as ao,n as Eo,o as lo,p as co,r as so,s as uo,w as Ee}from"./chunk-CGD3VEES.js";import"./chunk-ZDRFJW6I.js";import"./chunk-66VNXTOQ.js";import{e as no}from"./chunk-JJSD4VIZ.js";import{a as wt}from"./chunk-NQ3K6FVF.js";import"./chunk-4H2KM3H3.js";import{a as Go}from"./chunk-73GYI2PP.js";import{r as _o,s as oo}from"./chunk-4CJNMMMJ.js";import"./chunk-HPBOIPP3.js";import{a as Qt}from"./chunk-RWU5XIN3.js";import{a as Zt,c as jt,d as Te}from"./chunk-F3LQA6NL.js";import"./chunk-ZEFUY6C4.js";import"./chunk-VLKK7TJC.js";import"./chunk-JPCHKWLC.js";import{a as eo}from"./chunk-OH5SEFTF.js";import{a as R_}from"./chunk-B6PAT63C.js";import"./chunk-YTQZX6HS.js";import"./chunk-R3Q6KFAP.js";import"./chunk-XOFNTNFE.js";import"./chunk-OSLGVXXJ.js";import{f as to}from"./chunk-JZJMDGDL.js";import{a as qe}from"./chunk-DSBFHMMS.js";import{d as We}from"./chunk-JNTMPGQV.js";import"./chunk-DTEUMAI3.js";import"./chunk-OYTT2CBA.js";import{a as ae}from"./chunk-PLDW5CEE.js";import{c as Je,e as Xe,f as Be,j as Ve}from"./chunk-JXMBLUNF.js";import{b as __,c as q}from"./chunk-W5DF3KS5.js";import"./chunk-5TKXEJ5G.js";import{B as xt,D as Kt,b as Ge,d as H,g as $e,h as ve,o as xe,p as Ke,r as we,s as ze}from"./chunk-ACHMRYWW.js";import"./chunk-GMIA3PRP.js";import"./chunk-3GMZO3KQ.js";import"./chunk-MK5DGCBM.js";import{Aa as Ot,Ia as gt,Ta as Dt,Wa as Mt,ca as Ct,ib as ht,oa as Lt,rb as Pt,s as De,ta as Ft}from"./chunk-3D7D5LSA.js";import{b as oe}from"./chunk-ESYAAPPU.js";import{b as Wt,d as ke}from"./chunk-SSQEHCMA.js";import{e as ie,f as re,g as Ye,h as Vt,i as Z,j as qt}from"./chunk-ZCIIZFHM.js";import{d as Yt,e as kt,h as Jt}from"./chunk-HUZN4RSW.js";import"./chunk-H43UVXGV.js";import{a as zt}from"./chunk-K6QPKPAI.js";import"./chunk-UTMOJPG2.js";import{a as $t,c as vt,d as Ue,e as be,f as Ie,g as He}from"./chunk-6Z7UQHAR.js";import{g as ne,i as Xt,j as Bt}from"./chunk-5TO6ROS2.js";import"./chunk-4JQL3XCG.js";import"./chunk-OQVJARV4.js";import"./chunk-TMW66I47.js";import{Aa as Gt,Ba as ye,D as bt,Fa as pe,J as It,e as Me,f as yt,fa as Pe,g as Ut,na as Ht,s as he}from"./chunk-IAV7BOYR.js";import{e as Oe,g as ge,h as ft}from"./chunk-I752EWNM.js";import{L as Nt,b as At}from"./chunk-4WVXB3NU.js";import{$c as G,Bb as E,E as _e,Ea as Rt,Fa as F,Ga as O,Gc as U,Hc as b,Ic as A,Kb as a_,Kc as Le,Lc as Fe,Md as Tt,Nc as L,Nd as St,Ob as me,Oc as T,Qa as mt,S as r_,Sb as W,Va as y,Ya as te,Yb as C,Zc as E_,_c as pt,ad as I,bd as de,cd as j,dd as l_,h as st,hc as R,ma as Ne,oc as f,qc as X,rc as B,sc as V,ta as N,tc as a,uc as i,ud as c_,v as i_,vc as p,wc as fe,wd as s_,x as ut,xb as dt,xc as Ce,zc as g}from"./chunk-3I2TV7F7.js";import"./chunk-QC6TVOHN.js";import{a as v,b as x,g as ee,l as z}from"./chunk-UQHZSD32.js";var k=ee(Go());var m_=ee(u_());function wo(n,l){if(n&1&&(a(0,"li"),I(1),i()),n&2){let t=l.$implicit;E(),de(t.name)}}function zo(n,l){if(n&1&&p(0,"fa-icon",29),n&2){let t=T(2);R("icon",t.faWarning)}}function Yo(n,l){if(n&1&&(a(0,"span",36),I(1),i()),n&2){let t=T().$implicit;E(),de(t.unit)}}function ko(n,l){if(n&1&&(a(0,"ef-form-group")(1,"mat-form-field")(2,"mat-label"),A(3,15),i(),p(4,"input",40),a(5,"span",38),A(6,16),i()()()),n&2){let t=T().$implicit;E(4),R("value",t.price==null?null:t.price.toString())}}function Jo(n,l){if(n&1&&(a(0,"mat-accordion",23)(1,"mat-expansion-panel",21)(2,"mat-expansion-panel-header")(3,"b",28),A(4,9),i(),I(5),C(6,zo,1,1,"fa-icon",29),i(),a(7,"form",30)(8,"div",31)(9,"ef-form-group")(10,"mat-form-field")(11,"mat-label"),A(12,10),i(),p(13,"input",32)(14,"mat-datepicker",33,0)(16,"mat-datepicker-toggle",34),i()(),a(17,"ef
1-form-group")(18,"mat-form-field")(19,"mat-label"),A(20,11),i(),p(21,"input",35),C(22,Yo,2,1,"span",36),i()(),a(23,"ef-form-group")(24,"mat-form-field")(25,"mat-label"),A(26,12),i(),p(27,"input",37),i()(),C(28,ko,7,1,"ef-form-group"),a(29,"ef-form-group")(30,"mat-form-field")(31,"mat-label"),A(32,13),i(),a(33,"span",38),A(34,14),i(),p(35,"input",39),i()()()()()()),n&2){let t=l.$implicit,_=l.$index,e=G(15),o=T();R("multi",!0),E(),R("expanded",!0),E(4),j(" ",t.name," "),E(),f(o.formArray.controls[_].submitted&&o.formArray.controls[_].invalid?6:-1),E(),R("formGroup",o.formArray.controls[_]),E(6),R("matDatepicker",e),E(),R("calendarHeaderComponent",o.todayHeader),E(2),R("for",e),E(6),f(t.unit?22:-1),E(6),f(t.price?28:-1)}}var Po=(()=>{let l=class l{constructor(){this.fb=N(Kt),this.matDialogRef=N($t),this.userConfigService=N(ye),this.date=te(void 0),this.areaTotal=te(void 0),this.rentedMachines=te(void 0),this.todayHeader=e_,this.formArray=new xt([]),this.faWarning=Pt}ngOnInit(){this.rentedMachines().forEach(_=>{let e=this.fb.group({date:[{value:this.date(),disabled:!0}],amount:[this.areaTotal(),H.required],cost:[0],note:[$localize`:@@rentalThroughApplicationAutoCreatedNote:Automatisch erstellt`],done:!0,client:[_.client],machine:[_.id],rent:[1]});e.patchValue(x(v({},_.applicationRental),{date:this.date(),cost:(this.areaTotal()*(_.price||0)).toFixed(2)})),this.formArray.push(e),e.get("amount").valueChanges.subscribe(o=>{o?e.get("cost").patchValue(_.price*o):e.get("cost").patchValue(0)})})}submit(){this.formArray.controls.forEach(_=>_.submitted=!0),this.formArray.controls.forEach(_=>_.markAllAsTouched()),this.formArray.valid&&(this.formArray.controls.forEach(_=>_.get("cost").patchValue(Math.abs(_.get("cost").value)*-1)),this.matDialogRef.close(this.formArray.getRawValue()))}skip(){m_.default.fire({title:$localize`:@@rentalThroughApplicationSkipFutureTitle:Zukünftig überspringen`,text:$localize`:@@rentalThroughApplicationDisableFutureQuestion:Möchten Sie die Erfassung von Vermietungen über Anwendung zukünftig deaktivieren?`,cancelButtonText:$localize`:@@rentalThroughApplicationDeactivateButton:Deaktivieren`,showCancelButton:!0,confirmButtonText:$localize`:@@rentalThroughApplicationKeepActiveButton:Aktiviert lassen`,icon:"question"}).then(_=>{_.isConfirmed?this.matDialogRef.close([]):this.userConfigService.addConfigOrUpdate({value:"off",key:pe.KeyEnum.RentMachinesInApplication}).subscribe(e=>{m_.default.fire({title:$localize`:@@rentalThroughApplicationReactivateInfoTitle:Unter Miete/Vermietung reaktivieren`,html:$localize`:@@rentalThroughApplicationReactivateInfoHtml:Die automatische Vermietung über Anwendungen wurde deaktiviert. <br> Sie können die Option jederzeit unter Maschinen -> Miete/Vermietung reaktivieren.`,icon:"info"}).then(o=>{this.matDialogRef.close([])})})})}};l.\u0275fac=function(e){return new(e||l)},l.\u0275cmp=W({type:l,selectors:[["ef-rental-through-application"]],decls:35,vars:2,consts:()=>{let _;_=$localize`:@@rental-through-application-component-title␟12114c4f1f547dae36a4ca2859c28011bce48482␟6829071084007372844: Gemietete Maschinen verarbeiten
2`;let e;e=$localize`:@@rental-through-application-component-information-header␟2e67fc090d375da7512f7b185bdf4fbdf6427f7b␟3001324792806693181: Informationen `;let o;o=$localize`:@@rental-through-application-component-rented-machines-info␟b8198229bb2cdb2cbe9f4922afa8e250b7823cf8␟6487998464159807297:Folgende verwendete Maschinen sind gemietet:`;let c;c=$localize`:@@rental-through-application-component-instructions␟9fd0f6e27d8b382251aed545384bf8bad4c7ff2c␟2198844684889070550:Für diese Maschinen wird automatisch ein Eintrag im Miet/Vermietjournal erfasst. ${"\uFFFD#16\uFFFD\uFFFD/#16\uFFFD"}:LINE_BREAK: Geben Sie bitte die ${"\uFFFD#17\uFFFD"}:START_BOLD_TEXT: Fläche / Menge ${"\uFFFD/#17\uFFFD"}:CLOSE_BOLD_TEXT: pro Maschine an, um die Erfassung abzuschliessen. `;let u;u=$localize`:@@rental-through-application-component-total-area␟b136471bb329f825103851a7b2a75fe5c1d4ed75␟3551608886295421195:Fläche Total: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ha`;let S;S=$localize`:@@rental-through-application-component-skip-button␟ba5201a0525a5989bb673a5ace23d37aa2055f27␟9043568911254373924: Vermietung überspringen `;let r;r=$localize`:@@rental-through-application-component-cancel-button␟1b24932d0f2269e4b41d0f936fdb5de1b94da401␟7624133960269641605:Abbrechen`;let s;s=$localize`:@@rental-through-application-component-save-button␟ddb8c6906de04e2a30ab3f815e405f3b60108de2␟5768359601462561537:Anwendung speichern`;let d;d=$localize`:@@rental-through-application-component-form-error-tooltip␟ecfb5b8091a49c2ef277b0f553d4ab9dcd008a79␟3654256668191223301:Fehler im Formular`;let h;h=$localize`:@@rental-through-application-component-date-placeholder␟1470eabded471793a7ef2271e2a1dc30a1a3265f␟935267939147271845:Datum`;let K;K=$localize`:@@rental-through-application-component-total-cost-placeholder␟311852ff88d6858837132fd21baf748cb34c34a7␟7659304001005425067:Kosten Total`;let w;w=$localize`:@@rental-through-application-component-machine-label␟2e002bff021e08986e6393341fc2f3115f99537e␟4660618664764422719:Maschine:`;let J;J=$localize`:@@rental-through-application-component-date-label␟1470eabded471793a7ef2271e2a1dc30a1a3265f␟935267939147271845:Datum`;let Q;Q=$localize`:@@rental-through-application-component-amount-label␟77134c293828bbe
26d663d26f75252663f46c7ca4␟6137964906830522076:Menge`;let le;le=$localize`:@@rental-through-application-component-notes-label␟912864a3efead1d92dabe32077587178c065224d␟7033601559051453200:Bemerkungen`;let ce;ce=$localize`:@@rental-through-application-component-total-cost-label␟311852ff88d6858837132fd21baf748cb34c34a7␟7659304001005425067:Kosten Total`;let se;se=$localize`:@@rental-through-application-component-currency-prefix␟35b032da74b4a07a574b03f49f30d20ed55494cf␟3519253194435603202:Fr.`;let ue;ue=$localize`:@@rental-through-application-component-price-per-unit-label␟9e753cca0b1fae0c9383e375154543d003e09ccc␟5381764684056187823:Preis pro Einheit`;let Re;return Re=$localize`:@@rental-through-application-component-currency-prefix␟35b032da74b4a07a574b03f49f30d20ed55494cf␟3519253194435603202:Fr.`,[["date",""],_,e,o,c,u,S,r,s,w,J,Q,le,ce,se,ue,Re,["mat-dialog-title",""],["mat-dialog-content",""],["fxLayout","row","fxLayout.lt-md","column","fxLayoutAlign","center"],["fxFlex","600px","fxFlex.lt-md","95%",1,"accordion-primary"],[3,"expanded"],["fxLayout","row wrap","fxLayoutAlign","center","fxLayoutGap","10px"],["fxFlex","500px",1,"accordion-primary","mt-7",3,"multi"],["mat-dialog-actions","","fxLayoutAlign","space-between","fxLayoutGap","5px"],["mat-button","","mat-raised-button","","color","accent","data-cy","rental-through-application-skip-button",3,"click"],["mat-button","","mat-raised-button","","mat-dialog-close",""],["mat-button","","mat-raised-button","","color","primary",3,"click"],[1,"m-r-5"],["matTooltip",d,1,"ml-5",3,"icon"],[3,"formGroup"],[1,"mt-5"],["formControlName","date","matInput","","placeholder",h,"disabled","",3,"matDatepicker"],["disabled","true",3,"calendarHeaderComponent"],["matSuffix","",3,"for"],["type","number","formControlName","amount","matInput",""],["matSuffix",""],["type","text","formControlName","note","matInput",""],["matPrefix",""],["formControlName","cost","matInput","","placeholder",K,"type","number"],["disabled","","matInput","",3,"value"]]},template:function(e,o){e&1&&(a(0,"div",17),A(1,1),i(),a(2,"div",18)(3,"div",19)(4,"mat-accordion",20)(5,"mat-expansion-panel",21)(6,"mat-expansion-panel-header"),A(7,2),i(),p(8,"p"),a(9,"p"),A(10,3),i(),a(11,"ul"),B(12,wo,2,1,"li",null,X),i(),a(14,"p"),U(15,4),p(16,"br")(17,"b"),b(),i(),p(18,"br")(19,"br")(20,"br"),a(21,"b"),A(22,5),i()()()(),a(23,"div",22),B(24,Jo,36,10,"mat-accordion",23,X),i()(),a(26,"div",24)(27,"div")(28,"button",25),L("click",function(){return o.skip()}),A(29,6),i()(),a(30,"div")(31,"button",26),A(32,7),i(),a(33,"button",27),L("click",function(){return o.submit()}),A(34,8),i()()()),e&2&&(E(5),R("expanded",!0),E(7),V(o.rentedMachines()),E(10),Le(o.areaTotal()),Fe(22),E(2),V(o.rentedMachines()))},dependencies:[Ee,Ue,be,He,Ie,Jt,Yt,kt,ie,re,Z,Ye,ne,oe,ae,qe,xe,Ge,Ke,$e,ve,we,ze,We,Ve,Je,Xe,Be,Ze,je,Qe],encapsulation:2});let n=l;return n})();function Xo(n,l){if(n&1&&p(0,"iframe",4),n&2){let t=T();R("src",t.safeUrl,dt)}}var yo=(()=>{let l=class l{constructor(){this.domSanitizer=N(Nt),this.src=te(void 0)}ngOnInit(){this.safeUrl=this.domSanitizer.bypassSecurityTrustResourceUrl(this.src())}};l.\u0275fac=function(e){return new(e||l)},l.\u0275cmp=W({type:l,selectors:[["ef-iframe-modal"]],decls:7,vars:1,consts:()=>{let _;_=$localize`:@@iframe-modal-component-title␟b46a58aa67a38b879c0c9291a3f665c05e293ba5␟1208552805954399732: PSM - Details vom Bundesamt für Lebensmittelsicherheit
3`;let e;return e=$localize`:@@iframe-modal-component-close-button␟3c6d4a2efc21c1227aba9ad8e320c84bd824d65a␟2590295681509395485:Schliessen`,[_,e,["mat-dialog-title",""],["mat-dialog-content",""],["height","500px",3,"src"],["mat-dialog-actions","","fxLayoutAlign","flex-end","fxLayoutGap","5px"],["mat-button","","mat-raised-button","","mat-dialog-close",""]]},template:function(e,o){e&1&&(a(0,"div",2),A(1,0),i(),a(2,"div",3),C(3,Xo,1,1,"iframe",4),i(),a(4,"div",5)(5,"button",6),A(6,1),i()()),e&2&&(E(3),f(o.safeUrl?3:-1))},dependencies:[be,Ie,He,qt,re,Z,Ue,ne],styles:["iframe[_ngcontent-%COMP%]{width:100%;border:none}"]});let n=l;return n})();var $=function(n){return n.BODENBEARBEITUNG="Bodenbearbeitung",n.DUENGUNG="D\xFCngung",n.ERNTE="Ernte",n.PFLANZENSCHUTZ="Pflanzenschutz",n.PFLEGE="Pflege",n.SAAT="Saat",n}($||{});var P=ee(Wt());var p_=ee(u_());var t_=ee(u_()),Y=ee(Wt());var Uo=(()=>{let l=class l{constructor(){this.cultureService=N(he)}checkIfUpdateNeeded(_,e,o){return z(this,null,function*(){try{let c=yield this.cultureService.getCultureById(_).toProm
3ise(),u=(0,Y.default)(e).format("YYYY-MM-DD");return(o==="startDate"?c.startDate:c.endDate)!==u}catch(c){return console.error("Error fetching culture:",c),!1}})}showUpdateDialog(_,e,o,c){return z(this,null,function*(){let u=(0,Y.default)(_).format("DD.MM.YYYY"),S=(0,Y.default)(e).format("DD.MM.YYYY"),r=o==="startDate",s=r?$localize`:@@entryFormHelperUpdateStartDateTextBefore:Möchten Sie das Kulturstartdatum der Kultur`:$localize`:@@entryFormHelperUpdateEndDateTextBefore:Möchten Sie das Kulturenddatum der Kultur`,d=$localize`:@@entryFormHelperUpdateDateTextMiddle:von`,h=$localize`:@@entryFormHelperUpdateDateTextMiddle2:auf`,K=$localize`:@@entryFormHelperUpdateDateTextAfter:ändern?`,w=r?$localize`:@@entryFormHelperUpdateStartDateTitle:Kulturstart aktualisieren`:$localize`:@@entryFormHelperUpdateEndDateTitle:Kulturende aktualisieren`,J=r?"":'<br><br><small style="color: #856404;"><b>Hinweis:</b> Bitte passen Sie das Datum nur an, wenn es sich um die letzte Ernte der Kultur handelt.</small>';return(yield t_.default.fire({icon:"question",title:w,html:`${s} <b>${c}</b> ${d} <b>${u}</b> ${h} <b>${S}</b> ${K}${J}`,showCancelButton:!0,confirmButtonText:$localize`:@@entryFormHelperUpdateDateConfirmBtn:Ja, aktualisieren`,cancelButtonText:$localize`:@@entryFormHelperUpdateDateCancelBtn:Nein, beibehalten`})).isConfirmed})}showDateRangeWarning(_,e,o,c){return z(this,null,function*(){let u=(0,Y.default)(_).format("DD.MM.YYYY"),S=(0,Y.default)(e).format("DD.MM.YYYY"),r=c?$localize`:@@entryFormHelperDateAfterEndWarningTitle:Datum nach Kulturende`:$localize`:@@entryFormHelperDateBeforeStartWarningTitle:Datum vor Kulturstart`,s=c?$localize`:@@entryFormHelperDateAfterEndWarningMsg1:Das Enddatum der Kultur`:$localize`:@@entryFormHelperDateBeforeStartWarningMsg1:Das Startdatum der Kultur`,d=$localize`:@@entryFormHelperDateRangeWarningMsg2:ist auf`,h=c?$localize`:@@entryFormHelperDateAfterEndWarningMsg3:gesetzt. Wir empfehlen das Datum nicht nach`:$localize`:@@entryFormHelperDateBeforeStartWarningMsg3:gesetzt. Wir empfehlen das Datum nicht vor`,K=$localize`:@@entryFormHelperDateRangeWarningMsg4:zu setzen.`;yield t_.default.fire({icon:"warning",title:r,html:`${s} <b>${o}</b> ${d} <b>${S}</b> ${h} <b>${S}</b> ${K}`,confirmButtonText:$localize`:@@entryFormHelperDateRangeWarningBtn:Verstanden`})})}checkMultipleCulturesForUpdate(_,e,o){return z(this,null,function*(){let c=[];for(let u of _)try{let S=yield i_(this.cultureService.getCultureById(u)),r=(0,Y.default)(e).format("YYYY-MM-DD"),s=o==="startDate"?S.startDate:S.endDate,d=s!==r;c.push({cultureId:u,needsUpdate:d,currentDate:s,cultureName:S.listedCulture?.name||"Unbekannt"})}catch(S){console.error(`Error fetching culture ${u}:`,S)}return c})}showMultipleCulturesUpdateDialog(_,e,o){return z(this,null,function*(){let c=(0,Y.default)(e).format("DD.MM.YYYY"),u=o==="startDate",S=u?$localize`:@@entryFormHelperUpdateMultipleStartDateTitle:Kulturstartdaten aktualisieren?`:$localize`:@@entryFormHelperUpdateMultipleEndDateTitle:Kulturenddaten aktualisieren?`,r=u?$localize`:@@entryFormHelperUpdateMultipleStartDateIntro:Die folgenden Kulturen haben ein älteres Startdatum:`:$localize`:@@entryFormHelperUpdateMultipleEndDateIntro:Die folgenden Kulturen haben ein älteres Enddatum:`,s=u?$localize`:@@entryFormHelperUpdateMultipleStartDateQuestion:Möchten Sie die Startdaten aktualisieren?`:$localize`:@@entryFormHelperUpdateMultipleEndDateQuestion:Möchten Sie die Enddaten aktualisieren?`,d=_.map(w=>{let J=(0,Y.default)(w.currentDate).format("DD.MM.YYYY");return`\u2022 <b>${w.cultureName}</b>: ${J} \u2192 ${c}`}).join("<br>"),h=u?"":'<br><br><small style="color: #856404;"><b>Hinweis:</b> Bitte passen Sie das Datum nur an, wenn es sich um die letzte Ernte der Kultur handelt.</small>';return(yield t_.default.fire({icon:"question",title:S,html:`${r}<br><br>${d}<br><br>${s}${h}`,showCancelButton:!0,confirmButtonText:$localize`:@@entryFormHelperUpdateDateConfirmBtn:Ja, aktualisieren`,cancelButtonText:$localize`:@@entryFormHelperUpdateDateCancelBtn:Nein, beibehalten`})).isConfirmed})}updateMultipleCultureDates(_,e,o){return z(this,null,function*(){try{let c=(0,Y.default)(e).format("YYYY-MM-DD"),u={cultureIds:_,date:c,dateField:o};return yield i_(this.cultureService.updateMultipleCultureDates(u)),{successes:_,failures:[]}}catch(c){return console.error("Error updating multiple culture dates:",c),{successes:[],failures:_.map(u=>({cultureId:u,error:c}))}}})}};l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=Ne({token:l,factory:l.\u0275fac,providedIn:"root"});let n=l;return n})();var bo=pe.KeyEnum;function Bo(n,l){if(n&1){let t=g();a(0,"ef-form-group")(1,"mat-form-field")(2,"mat-label"),A(3,17),i(),a(4,"mat-date-range-input",78),L("click",function(){F(t);let e=G(9);return O(e.open())}),p(5,"input",79)(6,"input",80),i(),p(7,"mat-datepicker-toggle",81)(8,"mat-date-range-picker",82,3),i()()}if(n&2){let t=G(9);E(4),R("rangePicker",t),E(),R("disabled",!0),E(),R("disabled",!0),E(),R("for",t)}}function Vo(n,l){if(n&1){let t=g();a(0,"ef-form-group")(1,"mat-form-field",83),L("click",function(){F(t);let e=G(7);return O(e.open())}),a(2,"mat-label"),A(3,18),i(),p(4,"input",84)(5,"mat-datepicker-toggle",81)(6,"mat-datepicker",85,4),i()()}if(n&2){let t=G(7),_=T();E(4),R("matDatepicker",t),E(),R("for",t),E(),R("calendarHeaderComponent",_.todayHeader)}}function qo(n,l){if(n&1&&(a(0,"ef-form-group"),p(1,"ef-mat-select-typeahead",86),i()),n&2){let t=T();E(),R("labelValue",t.employeeLabel)}}function Wo(n,l){n&1&&(a(0,"ef-form-group")(1,"mat-form-field")(2,"mat-label"),A(3,19),i(),p(4,"input",87),i()())}function Zo(n,l){if(n&1&&(a(0,"ef-form-group")(1,"mat-form-field")(2,"mat-label"),I(3),i(),p(4,"input",88),i()()),n&2){let t=T(),_=G(75);E(3),de(t.commentLabel()),E(),R("matAutocomplete",_)}}function jo(n,l){if(n&1){let t=g();a(0,"ef-form-group")(1,"mat-form-field",83),L("click",function(){F(t);let e=G(7);return O(e.open())}),a(2,"mat-label"),A(3,20),i(),p(4,"input",89)(5,"mat-datepicker-toggle",81)(6,"mat-datepicker",85,5),i()()}if(n&2){let t=G(7),_=T();E(4),R("matDatepicker",t),E(),R("for",t),E(),R("calendarHeaderComponent",_.todayHeader)}}function Qo(n,l){if(n&1&&(a(0,"ef-form-group"),p(1,"ef-typeahead",90),i()),n&2){let t=T();E(),R("multiple",!0)("zeroAsNull",!0)("labelValue",t.machineLabels)}}function en(n,l){if(n&1&&(a(0,"ef-form-group")(1,"mat-form-field")(2,"mat-label"),A(3,21),i(),p(4,"input",91),i()()),n&2){T();let t=G(71);E(4),R("matAutocomplete",t)}}function _n(n,l){n&1&&(a(0,"ef-form-group")(1,"mat-form-field")(2,"mat-label"),A(3,22),i(),p(4,"input",92),i()())}function tn(n,l){n&1&&p(0,"input",93)}function on(n,l){n&1&&p(0,"input",94)(1,"ef-unit-selection",95)}function nn(n,l){if(n&1&&(a(0,"ef-form-group")(1,"mat-form-field")(2,"mat-label"),A(3,23),i(),C(4,tn,1,0,"input",93)(5,on,2,0),i()()),n&2){let t=T();E(4),f(t.type()!==t.ApplicationTypeEnum.ERNTE?4:-1),E(),f(t.type()===t.ApplicationTypeEnum.ERNTE?5:-1)}}function rn(n,l){if(n&1){let t=g();a(0,"button",96),L("click",function(){F(t);let e=T();return O(e.addMachine())}),A(1,24),i()}}function an(n,l){if(n&1){let t=g();a(0,"mat-slide-toggle",99),L("click",function(){F(t);let e=T(2);return O(e.toggleApplicationProgress())}),A(1,26),i()}n&2&&R("checked",!0)}function En(n,l){if(n&1){let t=g();a(0,"mat-slide-toggle",99),L("click",function(){F(t);let e=T(2);return O(e.toggleApplicationProgress())}),A(1,27),i()}n&2&&R("checked",!1)}function ln(n,l){if(n&1&&(a(0,"div",64),C(1,an,2,1,"mat-slide-toggle",97)(2,En,2,1,"mat-slide-toggle",97),a(3,"ef-form-group")(4,"mat-form-field")(5,"mat-label"),A(6,25),i(),p(7,"textarea",98),i()()()),n&2){let t=T();E(),f(t.applicationFormGroup.value.progress==="done"?1:-1),E(),f(t.applicationFormGroup.value.progress==="pending"?2:-1)}}function cn(n,l){if(n&1){let t=g();a(0,"div",69),fe(1,100),a(2,"div",54)(3,"ef-form-group"),p(4,"ef-choose-pre-culture-crop-rotation-control",101),i()(),a(5,"div",54)(6,"ef-form-group")(7,"mat-form-field")(8,"mat-label"),A(9,28),i(),p(10,"input",102),i()()(),a(11,"div",54)(12,"ef-form-group")(13,"mat-form-field")(14,"mat-label"),A(15,29),i(),p(16,"input",103),a(17,"span",104),A(18,30),i()()()(),a(19,"div",105)(20,"button",106),L("click",function(){let e=F(t).$index,o=T();return O(o.removeCultureFormGroupAtPosition(e))}),p(21,"fa-icon",52),i()(),Ce(),i()}if(n&2){let t=l.$implicit,_=T();E(),R("formGroup",t),E(19),R("disabled",_.applicationFormGroup.get("cultures").controls.length===1),E(),R("icon",_.faTrash)}}function sn(n,l){if(n&1){let t=g();a(0,"button",71),L("click",function(){F(t);let e=T();return O(e.openCultureFormModal())}),A(1,31),i()}}function un(n,l){if(n&1){let t=g();a(0,"mat-slide-toggle",83),L("click",function(){F(t);let e=T(2);return O(e.showFertilizer()?e.disableFertilizerForm():e.enableFertilizerForm())}),A(1,32),i()}}function Rn(n,l){if(n&1){let t=g();a(0,"mat-slide-toggle",83),L("click",function(){F(t);let e=T(2);return O(e.showHerbicides()?e.disableHerbicideForm():e.enableHerbicideForm())}),A(1,33),i()}}function mn(n,l){if(n&1&&(a(0,"div",73),C(1,un,2,0,"mat-slide-toggle")(2,Rn,2,0,"mat-slide-toggle"),i()),n&2){let t=T();E(),f(t.allowAddFertilizer()&&t.type()!==t.ApplicationTypeEnum.DUENGUNG?1:-1),E(),f(t.allowAddHerbicide()&&t.type()!==t.ApplicationTypeEnum.PFLANZENSCHUTZ?2:-1)}}function dn(n,l){n&1&&(a(0,"div",108)(1,"mat-button-toggle-group",112)(2,"mat-button-toggle",77),A(3,35),i(),a(4,"mat-button-toggle",77),A(5,36),i()()()),n&2&&(E(2),R("value",1),E(2),R("value",0))}function pn(n,l){if(n&1){let t=g();a(0,"ef-form-group")(1,"ef-mat-select-typeahead",120),L("emptyItemsClick",function(){F(t);let e=T(3);return O(e.handleEmptyFertilizers())}),i()()}if(n&2){let t=T(3);E(),R("labelValue",t.fertilizerLabelValue)}}function Tn(n,l){n&1&&(a(0,"ef-form-group")(1,"mat-slide-toggle",121),A(2,38),i()())}function Sn(n,l){if(n&1){let t=g();a(0,"ef-form-group")(1,"mat-form-field")(2,"span",114),I(3,"Fr."),i(),a(4,"mat-label"),A(5,39),i(),a(6,"input",122),L("keydown",function(e){F(t);let o=T(3);return O(o.onlyNumbers(e))}),i()()()}}function An(n,l){if(n&1){let t=g();a(0,"button",71),L("click",function(){F(t);let e=T(3);return O(e.addFertilizerFormGroup())}),p(1,"fa-icon",52),i()}if(n&2){let t=T(3);E(),R("icon",t.faAdd)}}function Nn(n,l){n&1&&p(0,"hr")}function fn(n,l){if(n&1){let t=g();a(0,"div",109)(1,"div",113),fe(2,100),a(3,"div",54),C(4,pn,2,1,"ef-form-group")(5,Tn,3,0,"ef-form-group"),i(),a(6,"div",54)(7,"ef
3-form-group")(8,"mat-form-field")(9,"span",114),I(10),c_(11,"efNumber"),i(),a(12,"mat-label"),A(13,37),i(),a(14,"input",115),L("keydown",function(e){F(t);let o=T(2);return O(o.onlyNumbers(e))}),i(),a(15,"span",104),I(16),i()()(),C(17,Sn,7,0,"ef-form-group",116),i(),Ce(),a(18,"button",117),L("click",function(){let e=F(t).$index,o=T(2);return O(o.removeFertilizerFormGroupAtPosition(e))}),p(19,"fa-icon",52),i()(),a(20,"div",118),C(21,An,2,1,"button",119),i(),C(22,Nn,1,0,"hr"),i()}if(n&2){let t=l.$implicit,_=l.$index,e=T(2);E(2),R("formGroup",t),E(2),f(e.fertilizerLabelValue?4:-1),E(),f(e.checkIsHofduenger(t.get("myProductId").value)?5:-1),E(5),l_("Saldo: ",s_(11,10,+((t.value==null?null:t.value.fertilizerSaldo)||0)+ +(e.groupId()?+(t.value==null?null:t.value.initialAmount):0),!1)," ",t.value==null?null:t.value.fertilizerUnit,""),E(6),j(" ",(t.value==null?null:t.value.fertilizerUnit)||"kg",""),E(2),R("disabled",e.getFertilizersFormArray().length===1),E(),R("icon",e.faTrash),E(2),f(e.getFertilizersFormArray().controls.length-1===_?21:-1),E(),f(e.getFertilizersFormArray().controls.length-1!==_?22:-1)}}function Cn(n,l){if(n&1){let t=g();a(0,"button",123),L("click",function(){F(t);let e=T(2);return O(e.openAddProductModalForm(e.ApplicationTypeStringEnum.DUENGUNG))}),U(1,40),p(2,"fa-icon",52),b(),i()}if(n&2){let t=T(2);E(2),R("icon",t.faAdd)}}function Ln(n,l){if(n&1){let t=g();a(0,"button",123),L("click",function(){F(t);let e=T(2);return O(e.openImportProductModal(e.ApplicationTypeStringEnum.DUENGUNG))}),U(1,41),p(2,"fa-icon",52),b(),i()}if(n&2){let t=T(2);E(2),R("icon",t.faAdd)}}function Fn(n,l){if(n&1&&(a(0,"div",107)(1,"h2"),U(2,34),p(3,"fa-icon",52),b(),i()(),a(4,"div",68),C(5,dn,6,2,"div",108),B(6,fn,23,13,"div",109,X),p(8,"hr"),a(9,"div",110),C(10,Cn,3,1,"button",111)(11,Ln,3,1,"button",111),i()()),n&2){let t=T();E(3),R("icon",t.faPin),E(2),f(t.showAmountPerHaOrTotal()?5:-1),E(),V(t.applicationFormGroup.get("fertilizers").controls)}}function On(n,l){n&1&&(a(0,"div",124)(1,"mat-button-toggle-group",112)(2,"mat-button-toggle",77),A(3,43),i(),a(4,"mat-button-toggle",77),A(5,44),i()()()),n&2&&(E(2),R("value",1),E(2),R("value",0))}function gn(n,l){if(n&1){let t=g();a(0,"ef-form-group",54)(1,"ef-mat-select-typeahead",131),L("emptyItemsClick",function(){F(t);let e=T(3);return O(e.handleEmptyHerbicides())}),i()()}if(n&2){let t=T(3);E(),R("labelValue",t.herbicideLabelValues)}}function Dn(n,l){if(n&1){let t=g();a(0,"button",132),L("click",function(){F(t);let e=T().$implicit,o=T(2);return O(o.openPSMIframe(o.getPSMURL(e)))}),p(1,"fa-icon",52),i()}if(n&2){let t=T(3);E(),R("icon",t.faInfo)}}function Mn(n,l){if(n&1){let t=g();a(0,"ef-form-group")(1,"mat-form-field")(2,"span",114),I(3,"Fr."),i(),a(4,"mat-label"),A(5,47),i(),a(6,"input",133),L("keydown",function(e){F(t);let o=T(3);return O(o.onlyNumbers(e))}),i()()()}}function hn(n,l){if(n&1){let t=g();a(0,"button",71),L("click",function(){F(t);let e=T(3);return O(e.addHerbicidesFormGroup())}),p(1,"fa-icon",52),i()}if(n&2){let t=T(3);E(),R("icon",t.faAdd)}}function Pn(n,l){n&1&&p(0,"hr")}function yn(n,l){if(n&1){let t=g();a(0,"div",109)(1,"div",125),fe(2,100),a(3,"div",54)(4,"div",126),C(5,gn,2,1,"ef-form-group",54)(6,Dn,2,1,"button",127),i(),a(7,"ef-form-group")(8,"mat-form-field")(9,"mat-label"),A(10,45),i(),p(11,"input",128),i()()(),a(12,"div",54)(13,"ef-form-group")(14,"mat-form-field")(15,"span",114),I(16),c_(17,"efNumber"),i(),a(18,"mat-label"),A(19,46),i(),a(20,"input",129),L("keydown",function(e){F(t);let o=T(2);return O(o.onlyNumbers(e))}),i(),a(21,"span",104),I(22),i()()(),C(23,Mn,7,0,"ef-form-group",116),i(),Ce(),i(),a(24,"div",118)(25,"button",130),L("click",function(){let e=F(t).$index,o=T(2);return O(o.removeHerbicideFormGroupAtPosition(e))}),p(26,"fa-icon",52),i(),C(27,hn,2,1,"button",119),i(),C(28,Pn,1,0,"hr"),i()}if(n&2){let t=l.$implicit,_=l.$index,e=T(2),o=G(75);E(2),R("formGroup",t),E(3),f(e.herbicideLabelValues?5:-1),E(),f(e.isListedHerbicide(t)?6:-1),E(5),R("matAutocomplete",o),E(5),l_("Saldo: ",s_(17,11,(t.value==null?null:t.value.fertilizerSaldo)||0,!0)," ",t.value==null?null:t.value.fertilizerUnit,""),E(6),j(" ",(t.value==null?null:t.value.fertilizerUnit)||"kg",""),E(3),R("disabled",e.getHerbicidesFormArray().length===1),E(),R("icon",e.faTrash),E(),f(e.getHerbicidesFormArray().controls.length-1===_?27:-1),E(),f(e.getFertilizersFormArray().controls.length-1!==_?28:-1)}}function Un(n,l){if(n&1){let t=g();a(0,"button",123),L("click",function(){F(t);let e=T(2);return O(e.openAddProductModalForm(e.ApplicationTypeStringEnum.PFLANZENSCHUTZ))}),U(1,48),p(2,"fa-icon",52),b(),i()}if(n&2){let t=T(2);E(2),R("icon",t.faAdd)}}function bn(n,l){if(n&1){let t=g();a(0,"button",123),L("click",function(){F(t);let e=T(2);return O(e.openImportProductModal(e.ApplicationTypeStringEnum.PFLANZENSCHUTZ))}),U(1,49),p(2,"fa-icon",52),b(),i()}if(n&2){let t=T(2);E(2),R("icon",t.faAdd)}}function In(n,l){if(n&1&&(a(0,"div",107)(1,"h2"),U(2,42),p(3,"fa-icon",52),b(),i()(),a(4,"div",68),C(5,On,6,2,"div",124),B(6,yn,29,14,"div",109,X),a(8,"div",110),C(9,Un,3,1,"button",111)(10,bn,3,1,"button",111),i()()),n&2){let t=T();E(3),R("icon",t.faPin),E(2),f(t.showAmountPerHaOrTotal()&&t.showFertilizer()===!1?5:-1),E(),V(t.applicationFormGroup.get("herbicides").controls)}}function Hn(n,l){if(n&1){let t=g();a(0,"button",134),L("click",function(){F(t);let e=T();return O(e.submit())}),A(1,50),i()}}function Gn(n,l){if(n&1&&(a(0,"mat-option",77),I(1),i()),n&2){let t=l.$implicit;R("value",t.name),E(),j(" ",t.name," ")}}function $n(n,l){if(n&1&&(a(0,"mat-option",77),I(1),i()),n&2){let t=l.$implicit;R("value",t.name),E(),j("",t.name," ")}}var o_=(()=>{let l=class l{constructor(){if(this.cultureEntryComponent=N(Io,{host:!0}),this.fb=N(po),this.cultureService=N(he),this.parcelService=N(Ht),this.machineService=N(Pe),this.userService=N(Gt),this.modalHelper=N(__),this.fertilizerService=N(bt),this.herbicideService=N(It),this.router=N(ge),this.applicationNoteService=N(yt),this.userStateService=N(ke),this.applicationService=N(Me),this.route=N(Oe),this.userConfigService=N(ye),this.matDialog=N(vt),this.swallAdvancedService=N(Ro),this.entryFormHelper=N(Uo),this.todayHeader=e_,this.cultureId=y(void 0),this.commentLabel=y($localize`:@@entryFormCommentLabel:Bemerkung`),this.lastUsedMachine=y(void 0),this.onSaveGoTo=me(void 0),this.showComment=y(!0),this.allowAddFertilizer
3=y(!1),this.allowAddHerbicide=y(!1),this.showAmount=y(!1),this.showAmountPerHaOrTotal=me(!1),this.showWork=y(!0),this.showState=y(!1),this.copy=y(!1),this.showFertilizer=me(!1),this.showDateTill=y(!1),this.groupId=y(void 0),this.showHerbicides=me(!1),this.type=y(),this.computedTypeName=Tt(()=>{let _=this.type();if(!_)return"";switch(_){case D.ERNTE:return $localize`:@@entryFormComputedHarvestName:Ernte`;case D.BODENBEARBEITUNG:return $localize`:@@entryFormComputedCropName:Bodenbearbeitung`;case D.PFLANZENSCHUTZ:return $localize`:@@entryFormComputedHerbicideName:Pflanzenschutz`;case D.DUENGUNG:return $localize`:@@entryFormComputedFertilizerName:Düngung`;case D.PFLEGE:return $localize`:@@entryFormComputedCareName:Pflege`;case D.SAAT:return $localize`:@@entryFormComputedSeedName:Saat`;default:break}}),this.applicationTypeService=N(Ut),this.applicationTypeEnum=D,this.typeRequest=R_(()=>{let _=this.type();if(_)return this.applicationTypeService.getApplicationTypeById(_)}),this.typeRequestEffect=St(()=>{let _=this.typeRequest().data;if(!_)return;let e=_.name;this.applicationFormGroup.getSafe(o=>o.calendarTitle).patchValue(e)}),this.meadowJournalDate=y(void 0),this.saved=new mt,this.faEntry=Ct,this.faEdit=De,this.users=[],this.machines=[],this.faCalendar=ht,this.faPin=Ot,this.parcels=[],this.cultures=[],this.faTrash=Lt,this.fertilizers=[],this.faAdd=Mt,this.herbicides=[],this.textTemplates=[],this.filteredTextTemplatesForWork=[],this.filteredTextTemplatesForComment=[],this.culturesIndex=[],this.faTask=Dt,this.fertilizerLabelValue=[],this.herbicideLabelValues=[],this.allCultures=new st([]),this.faInfo=Ft,this.cultureResponseBag=R_(()=>{let _=this.cultureId();if(_)return this.cultureService.getCultureById(_)}),this.ApplicationTypeStringEnum=$,this.ApplicationTypeEnum=D,this.applicationFormGroup=this.fb.group({rentedMachines:[null],date:[new Date,H.required],user:[null,H.required],machines:[[]],note:[null,H.maxLength(100)],state:[null],calendarOn:[!0],perHa:[{disabled:!0,value:1},[H.required]],fertilizers:this.fb.array([]),herbicides:this.fb.array([]),work:[null,H.maxLength(100)],dateTo:[new Date],cropAmount:[null],taskDetails:[null],progress:["done"],isPlanned:[!1],calendarTitle:[null,H.required],cultures:this.fb.array([]),cropUnit:[null]}),this.userConfigService.getConfigByKey(bo.RentMachinesInApplication).subscribe(_=>{this.rentMachinesInApplication=_}),this.applicationFormGroup.getSafe(_=>_.isPlanned).valueChanges.subscribe(_=>{this.applicationFormGroup.getSafe(e=>e.progress).untouched&&(_?(this.applicationFormGroup.getSafe(e=>e.progress).patchValue("pending"),this.applicationFormGroup.getSafe(e=>e.progress).markAsUntouched()):(this.applicationFormGroup.getSafe(e=>e.progress).patchValue("done"),this.applicationFormGroup.getSafe(e=>e.progress).markAsUntouched())),_||(this.applicationFormGroup.getSafe(e=>e.progress).patchValue("done"),this.applicationFormGroup.getSafe(e=>e.progress).markAsUntouched())}),this.applicationFormGroup.getSafe(_=>_.date).valueChanges.subscribe(_=>{_&&this.applicationFormGroup.getSafe(e=>e.isPlanned).untouched&&((0,P.default)().endOf("day").isBefore(_)?(this.applicationFormGroup.getSafe(e=>e.isPlanned).patchValue(!0),this.applicationFormGroup.getSafe(e=>e.isPlanned).markAsUntouched()):(this.applicationFormGroup.getSafe(e=>e.isPlanned).patchValue(!1),this.applicationFormGroup.getSafe(e=>e.isPlanned).markAsUntouched()))}),localStorage.getItem("lastEntry")&&localStorage.getItem("lastEntrySet")&&(0,P.default)(localStorage.getItem("lastEntrySet")).add(3,"hours").isBefore((0,P.default)())&&(localStorage.removeItem("lastEntrySet"),localStorage.removeItem("lastEntry")),localStorage.getItem("lastEntry")&&!this.route.snapshot.queryParams.date)this.applicationFormGroup.getSafe(_=>_.date).patchValue((0,P.default)(localStorage.getItem("lastEntry"),"YYYYMMDD")),this.applicationFormGroup.getSafe(_=>_.dateTo).patchValue((0,P.default)(localStorage.getItem("lastEntry"),"YYYYMMDD"));else if(this.route.snapshot.queryParams.date){let _=(0,P.default)(this.route.snapshot.queryParams.date).format();_&&(this.applicationFormGroup.getSafe(e=>e.date).patchValue(_),this.applicationFormGroup.getSafe(e=>e.dateTo).patchValue(_))}this.userStateService.getUserAsync().then(_=>{this.applicationFormGroup.getSafe(e=>e.user).patchValue(_.id)}),this.applicationFormGroup.getSafe(_=>_.work).valueChanges.subscribe(_=>{_?this.filteredTextTemplatesForWork=this.textTemplates.filter(e=>e.name.toLowerCase().indexOf(_.toLowerCase())>-1):this.filteredTextTemplatesForWork=[]}),this.applicationFormGroup.getSafe(_=>_.note).valueChanges.subscribe(_=>{_?this.filteredTextTemplatesForComment=this.textTemplates.filter(e=>e.name.toLowerCase().indexOf(_.toLowerCase())>-1):this.filteredTextTemplatesForComment=[]})}
3handleCulturesToAdd(){this.route.snapshot.queryParams.culturesToAdd instanceof Array&&this.route.snapshot.queryParams.culturesToAdd?.filter(_=>_!==this.route.snapshot.params.cultureId).forEach(_=>{this.addCultureFormGroup(),this.getLastCultureFromFormGroup().patchValue({cultureId:+_})})}getLastCultureFromFormGroup(){return this.getCulturesFormArray().at(this.getCulturesFormArray().length-1)}getFertilizersFormArray(){return this.applicationFormGroup.getSafe(_=>_.fertilizers)}addCultureFormGroup(){this.applicationFormGroup.getSafe(e=>e.cultures).push(this.fb.group({cultureId:[null,H.required],parcelName:[{disabled:!0,value:null},H.required],area:[null,H.required]}));let _=this.applicationFormGroup.getSafe(e=>e.cultures).controls[this.getCulturesFormArray().controls.length-1];_.get("cultureId").valueChanges.subscribe(e=>{this.cultureService.getCultureWithParcelTemplateName(e).subscribe(o=>{_.get("area").value===null&&_.get("area").patchValue(o.cultureArea),_.get("parcelName").patchValue(o.parcelTemplateName)})})}ngOnInit(){this.onSaveGoTo.set(this.route.snapshot.queryParams.afterSafe||this.onSaveGoTo()),this.addCultureFormGroup();let _=this.type();_!==this.applicationTypeEnum.ERNTE&&this.applicationFormGroup.getSafe(c=>c.date).valueChanges.subscribe(c=>{this.applicationFormGroup.getSafe(u=>u.dateTo).patchValue(c)}),_===D.SAAT&&this.applicationFormGroup.getSafe(c=>c.date).valueChanges.pipe(r_((c,u)=>(0,P.default)(c).isSame((0,P.default)(u)))).subscribe(c=>{if(!c)return;let u=this.cultureResponseBag().data;if(!u)return;let S=(0,P.default)(u.endDate);(0,P.default)(c).isAfter(S,"day")&&this.entryFormHelper.showDateRangeWarning(c,u.endDate,u.listedCulture.name,!0)}),_===D.ERNTE&&this.applicationFormGroup.getSafe(c=>c.dateTo).valueChanges.pipe(r_((c,u)=>(0,P.default)(c).isSame((0,P.default)(u)))).subscribe(c=>{if(!c)return;let u=this.cultureResponseBag().data;if(!u)return;let S=(0,P.default)(u.startDate);(0,P.default)(c).isBefore(S,"day")&&this.entryFormHelper.showDateRangeWarning(c,u.startDate,u.listedCulture.name,!1)}),_===this.applicationTypeEnum.BODENBEARBEITUNG&&this.applicationFormGroup.getSafe(c=>c.perHa).disable(),_===this.applicationTypeEnum.PFLANZENSCHUTZ&&(this.addHerbicidesFormGroup(),this.enablePerHa()),_===this.applicationTypeEnum.DUENGUNG&&(this.addFertilizerFormGroup(),this.enablePerHa());let e=this.groupId();e||(this.userConfigService.getConfigByKey(bo.ApplicationAmountPreference).subscribe(c=>{c&&this.applicationFormGroup.getSafe(u=>u.perHa).patchValue(+c.value,{emitEvent:!1})}),this.applicationFormGroup.getSafe(c=>c.perHa).valueChanges.subscribe(c=>{this.userConfigService.addConfigOrUpdate({value:c.toString(),key:pe.KeyEnum.ApplicationAmountPreference}).subscribe(u=>{})})),this.loadAll();let o=this.cultureId();!e&&o&&this.cultureService.getCultureWithApplications(o).subscribe(c=>{this.getCultureFormGroupByIndex(0)}),this.applicationFormGroup.getSafe(c=>c.calendarOn).valueChanges.subscribe(c=>{c?this.applicationFormGroup.getSafe(u=>u.calendarTitle).enable():this.applicationFormGroup.getSafe(u=>u.calendarTitle).disable()}),this.handleEdit()}handleEdit(){let _=this.groupId();_&&this.applicationService.getApplicationsAsGroup(_).subscribe(e=>{this.initialApplications=e,this.applicationFormGroup.patchValue(e[0],{emitEvent:!1}),this.applicationFormGroup.getSafe(r=>r.machines).patchValue(e[0].applicationMachines.map(r=>r.machine?.id)),this.addDeletedUser(),e[0].perHa===null&&this.applicationFormGroup.getSafe(r=>r.perHa).patchValue(1),this.applicationFormGroup.getSafe(r=>r.progress).markAsUntouched();let o=k.default.uniqBy(e,r=>r.culture.id).filter(r=>!!r.culture);this.applicationFormGroup.getSafe(r=>r.cultures).removeAt(0),o.forEach((r,s)=>{this.addCultureFormGroup(),this.getCultureFormGroupByIndex(s).patchValue({cultureId:r.culture.id,parcelId:r.culture.parcelTemplate,area:r.subarea||r.culture.area})});let c=k.default.uniqBy(e,r=>r.myProduct.listedFertilizer).filter(r=>!!r.myProduct?.listedFertilizer).map(r=>r.myProduct.listedFertilizer),u=this.type(),S=[];if(u===this.applicationTypeEnum.DUENGUNG?e.some(r=>r.myProduct)&&k.default.uniqBy(e,r=>
3r.myProduct?.id).forEach((r,s)=>{s===0&&this.applicationFormGroup.getSafe(d=>d.fertilizers).removeAt(0),this.addFertilizerFormGroup(),r.myProduct&&!this.isFertilizerMyProduct(r.myProduct)&&S.push({name:r.myProduct?.herbicide?.product||`#${r.myProduct?.id}`,index:s}),this.getFertilizerFormGroupByIndex(s).patchValue({myProductId:r.myProduct.id,amount:(r.perHa?r.amount/(r.subarea||r.culture.area):k.default.sumBy(e.filter(d=>d.myProduct.id===r.myProduct.id),"amount")).toFixed(2),initialAmount:(r.perHa?r.amount/(r.subarea||r.culture.area):k.default.sumBy(e.filter(d=>d.myProduct.id===r.myProduct.id),"amount")).toFixed(2),fertilizerSaldo:r.myProduct?.currentStock,fertilizerUnit:r.myProduct?.listedFertilizer?.unit||r.myProduct?.customFertilizer?.unit||"kg",input:r.input,price:r.amount?((r.price||0)/r.amount).toFixed(2):0},{emitEvent:!1})}):u===this.applicationTypeEnum.PFLANZENSCHUTZ&&k.default.uniqBy(e,r=>r.myProduct?.id).forEach((r,s)=>{s===0&&this.applicationFormGroup.getSafe(d=>d.herbicides).removeAt(0),this.addHerbicidesFormGroup(),r.myProduct&&!this.isHerbicideMyProduct(r.myProduct)&&S.push({name:r.myProduct?.listedFertilizer?.name||r.myProduct?.customFertilizer?.name||`#${r.myProduct?.id}`,index:s}),this.getHerbicidesFormArray().controls[s].patchValue({myProductId:r.myProduct.id,amount:(r.perHa?r.amount/(r.subarea||r.culture.area):k.default.sumBy(e.filter(d=>d.myProduct.id===r.myProduct.id),"amount")).toFixed(2),initialAmount:(r.perHa?r.amount/(r.subarea||r.culture.area):k.default.sumBy(e.filter(d=>d.myProduct.id===r.myProduct.id),"amount")).toFixed(2),note:r.note,fertilizerUnit:r.myProduct.herbicide?.unit,fertilizerSaldo:r.myProduct.currentStock,price:r.amount?((r.price||0)/r.amount).toFixed(2):0},{emitEvent:!1})}),S.length>0){let r=u===this.applicationTypeEnum.DUENGUNG?$localize`:@@entryFormProductKindFertilizer:Düngemittel`:$localize`:@@entryFormProductKindHerbicide:Pflanzenschutzmittel`;p_.default.fire({icon:"warning",title:$localize`:@@entryFormEditMismatchTitle:Inkonsistenter Eintrag erkannt`,html:$localize`:@@entryFormEditMismatchText:Dieser Eintrag ist als <b>${this.computedTypeName()}:type:</b> erfasst, aber das verknüpfte Produkt ist kein ${r}:expected::<br><br>${S.map(s=>"\u2022 "+s.name).join("<br>")}:list:<br><br>Möchten Sie das falsche Produkt aus diesem Eintrag entfernen?`,showCancelButton:!0,confirmButtonText:$localize`:@@entryFormEditMismatchRemoveBtn:Produkt entfernen`,cancelButtonText:$localize`:@@entryFormEditMismatchKeepBtn:Behalten`}).then(s=>{s.isConfirmed&&this.removeMismatchedProducts(u,S.map(d=>d.index))})}})}addMachine(){this.modalHelper.openModal(q.addMachine).then(_=>{_.afterClosed().subscribe(e=>{this.loadEssentials()})})}removeCultureFormGroupAtPosition(_){this.applicationFormGroup.getSafe(o=>o.cultures).removeAt(_);let e=this.applicationFormGroup.getSafe(o=>o.cultures).controls.map(o=>o.get("cultureId").value)}openCultureFormModal(){this.modalHelper.openModal(q.addCulture).then(_=>{_.afterClosed().subscribe(e=>{this.loadEssentials()})})}addFertilizerFormGroup(){this.getFertilizersFormArray().push(this.fb.group({myProductId:[null,H.required],amount:[null,Se.decimalNumbersValidator],input:[!1],price:[null,Se.decimalNumbersValidator],fertilizerSaldo:[],fertilizerUnit:[],isHofduenger:[],initialAmount:[]}));let _=this.getFertilizersFormArray().controls.length-1;this.getFertilizersFormArray().controls[_].get("myProductId").valueChanges.subscribe(e=>{if(e){let o=this.fertilizers.find(c=>c.id===e);o&&(this.getFertilizersFormArray().controls[_].get("fertilizerSaldo").patchValue(o.currentStock.toFixed(0)),this.getFertilizersFormArray().controls[_].get("fertilizerUnit").patchValue(o.fertilizer.unit),this.getFertilizersFormArray().controls[_].get("price").patchValue(o.price),this.getFertilizersFormArray().controls[_].get("input").patchValue(!1))}})}removeFertilizerFormGroupAtPosition(_){this.getFertilizersFormArray().removeAt(_)}openAddProductModalForm(_){_===$.DUENGUNG?this.modalHelper.openModal(q.fertilizerForm).then(e=>{e.afterClosed().subscribe(o=>this.loadEssentials())}):this.modalHelper.openModal(q.addHerbicide).then(e=>{e.afterClosed().subscribe(o=>this.loadEssentials())})}openImportProductModal(_){_===$.DUENGUNG?this.modalHelper.openModal(q.importFertilizerTable).then(e=>{e.afterClosed().subscribe(o=>this.loadEssentials())}):this.modalHelper.openModal(q.importHerbicide).then(e=>{e.afterClosed().subscribe(o=>this.loadEssentials())})}submit(){if(this.applicationFormGroup.valid){let _=this.getProductKindMismatches();if(_.length>0){p_.default.fire({icon:"error",title:$localize`:@@entryFormProductKindMismatchTitle:Produkttyp passt nicht zum Eintragstyp`,html:_.map(e=>`\u2022 ${e}`).join("<br>"),confirmButtonText:$localize`:@@entryFormProductKindMismatchConfirmBtn:Verstanden`});return}this.processRentedMachines().then(e=>{if(e instanceof Array){this.applicationFormGroup.getSafe(r=>r.rentedMachines).patchValue(e),!this.textTemplates.find(r=>r.name===this.applicationFormGroup.value.note)&&this.applicationFormGroup.value.note&&this.applicationNoteService.saveApplicationNote({name:this.applicationFormGroup.value.note}).subscribe(r=>{this.applicationNoteService.getApplicationNotes().subscribe(s=>this.textTemplates=s)}),!this.textTemplates.find(r=>r.name===this.applicationFormGroup.value.work)&&this.applicationFormGroup.value.work&&this.applicationNoteService.saveApplicationNote({name:this.applicationFormGroup.value.work}).subscribe(r=>{this.applicationNoteService.getApplicationNotes().subscribe(s=>this.textTemplates=s)});let u=this.textTemplates.map(r=>r.name),S=this.type();if(S===this.applicationTypeEnum.PFLANZENSCHUTZ&&k.default.uniq(this.applicationFormGroup.getSafe(s=>s.herbicides).controls.filter(s=>u.indexOf(s.value.note)===-1).map(s=>s.value.note)).filter(s=>
3!!s).forEach(s=>{this.applicationNoteService.saveApplicationNote({name:s}).subscribe(d=>{this.applicationNoteService.getApplicationNotes().subscribe(h=>this.textTemplates=h)})}),localStorage.setItem("lastEntry",(0,P.default)(this.applicationFormGroup.value.date).format("YYYYMMDD")),localStorage.setItem("lastEntrySet",(0,P.default)().toDate().toISOString()),S===this.applicationTypeEnum.BODENBEARBEITUNG){let r=this.groupId();r&&this.copy()===!1?this.applicationService.deleteApplicationsByGroupId(r).subscribe(s=>{this.cultureService.addSoilPreparation(x(v({},this.applicationFormGroup.value),{groupId:this.groupId()})).subscribe(d=>{this.afterSave(d)})}):this.cultureService.addSoilPreparation(this.applicationFormGroup.value).subscribe(s=>{this.afterSave(s)})}else if(S===this.applicationTypeEnum.SAAT){let r=this.cultureId(),s=this.applicationFormGroup.value.date;if(r&&this.cultureResponseBag().data)this.handleSaatSubmission(r,s);else{let d=this.groupId();d&&this.copy()===!1?this.applicationService.deleteApplicationsByGroupId(d).subscribe(h=>{this.addSeed(!0)}):this.addSeed(!1)}}else if(S===this.applicationTypeEnum.PFLEGE){let r=this.groupId();r&&this.copy()===!1?this.applicationService.deleteApplicationsByGroupId(r).subscribe(s=>{this.cultureService.addMaintenance(x(v({},this.applicationFormGroup.value),{groupId:this.groupId()})).subscribe(d=>{this.afterSave(d)})}):this.cultureService.addMaintenance(this.applicationFormGroup.value).subscribe(s=>{this.afterSave(s)})}else if(S===this.applicationTypeEnum.ERNTE){let r=this.cultureId(),s=this.applicationFormGroup.value.dateTo;if(r&&this.cultureResponseBag().data)this.handleErnteSubmission(r,s);else{let d=this.groupId();d&&this.copy()===!1?this.applicationService.deleteApplicationsByGroupId(d).subscribe(h=>{this.addHarvest(!0)}):this.addHarvest(!1)}}else if(S===this.applicationTypeEnum.PFLANZENSCHUTZ){let r=this.groupId();if(r&&this.copy()===!1)this.applicationService.deleteApplicationsByGroupId(r).subscribe(s=>{let d=[];d.push(this.cultureService.addPlantProtection(x(v({},this.applicationFormGroup.value),{groupId:this.groupId()}))),this.showFertilizer()&&d.push(this.cultureService.addFertilizer(x(v({},this.applicationFormGroup.value),{groupId:this.groupId()}))),_e(...d).subscribe(h=>{this.afterSave(h[0])})});else{let s=[];s.push(this.cultureService.addPlantProtection(this.applicationFormGroup.value)),this.showFertilizer()&&s.push(this.cultureService.addFertilizer(this.applicationFormGroup.value)),_e(...s).subscribe(d=>{this.afterSave(d[0])})}}else if(S===this.applicationTypeEnum.DUENGUNG){let r=this.groupId();if(r&&this.copy()===!1)this.applicationService.deleteApplicationsByGroupId(r).subscribe(s=>{let d=[];d.push(this.cultureService.addFertilizer(x(v({},this.applicationFormGroup.value),{groupId:this.groupId()}))),this.showHerbicides()&&d.push(this.cultureService.addPlantProtection(x(v({},this.applicationFormGroup.value),{groupId:this.groupId()}))),_e(...d).subscribe(h=>{this.afterSave(h[0])})});else{let s=[];s.push(this.cultureService.addFertilizer(this.applicationFormGroup.value)),this.showHerbicides()&&s.push(this.cultureService.addPlantProtection(this.applicationFormGroup.value)),_e(...s).subscribe(d=>{this.afterSave(d[0])})}}}})}}addSeed(_){let e=[];_?e.push(this.cultureService.addSeed(x(v({},this.applicationFormGroup.value),{groupId:this.groupId()}))):e.push(this.cultureService.addSeed(v({},this.applicationFormGroup.value))),this.showFertilizer()&&e.push(this.cultureService.addFertilizer(this.applicationFormGroup.value)),this.showHerbicides()&&e.push(this.cultureService.addPlantProtection(this.applicationFormGroup.value)),_e(...e).subscribe(o=>{this.afterSave(o[0])})}addHarvest(_){_?this.cultureService.addHarvest(x(v({},this.applicationFormGroup.value),{groupId:this.groupId()})).subscribe(e=>{this.afterSave(e)}):this.cultureService.addHarvest(this.applicationFormGroup.value).subscribe(e=>{this.afterSave(e)})}handleSaatSubmission(_,e){return z(this,null,function*(){let o=this.getAllCultureIdsFromForm();if(o.length>0){let S=(yield this.entryFormHelper.checkMultipleCulturesForUpdate(o,e,"startDate")).filter(r=>r.needsUpdate);if(S.length>0&&(yield this.entryFormHelper.showMultipleCulturesUpdateDialog(S.map(s=>({cultureId:s.cultureId,currentDate:s.currentDate,cultureName:s.cultureName})),e,"startDate"))){let s=yield this.entryFormHelper.updateMultipleCultureDates(S.map(d=>d.cultureId),e,"startDate");s.failures.length>0&&console.error("Failed to update some culture start dates:",s.failures)}}let c=this.groupId();c&&this.copy()===!1?this.applicationService.deleteApplicationsByGroupId(c).subscribe(u=>{this.addSeed(!0)}):this.addSeed(!1)})}handleErnteSubmission(_,e){return z(this,null,function*(){let o=this.getAllCultureIdsFromForm();if(o.length>0){let S=(yield this.entryFormHelper.checkMultipleCulturesForUpdate(o,e,"endD
3ate")).filter(r=>r.needsUpdate);if(S.length>0&&(yield this.entryFormHelper.showMultipleCulturesUpdateDialog(S.map(s=>({cultureId:s.cultureId,currentDate:s.currentDate,cultureName:s.cultureName})),e,"endDate"))){let s=yield this.entryFormHelper.updateMultipleCultureDates(S.map(d=>d.cultureId),e,"endDate");s.failures.length>0&&console.error("Failed to update some culture end dates:",s.failures)}}let c=this.groupId();c&&this.copy()===!1?this.applicationService.deleteApplicationsByGroupId(c).subscribe(u=>{this.addHarvest(!0)}):this.addHarvest(!1)})}afterSave(_){let e=Promise.resolve(!0);this.cultureEntryComponent.saveFunction&&(e=this.cultureEntryComponent.saveFunction(_.applications[0].groupId)),e.then(o=>{this.saved.emit(_);let c=this.onSaveGoTo();if(c){try{let u=+c.split("/")[3];u>0&&!this.applicationFormGroup.getSafe(S=>S.cultures)?.value.find(S=>S.cultureId===u)?this.onSaveGoTo.set([...c.split("/").slice(0,3),this.applicationFormGroup.value.cultures[0].cultureId].join("/")):u===0&&!this.cultureId()&&this.onSaveGoTo.set(`/kultur/details/${this.applicationFormGroup.value.cultures[0].cultureId}`)}catch{}this.router.navigate([this.onSaveGoTo()])}})}processRentedMachines(){if(this.rentMachinesInApplication?.value==="on"){let _=this.machines.filter(e=>e.kind==="rental").filter(e=>this.applicationFormGroup.getSafe(o=>o.machines).value.indexOf(e.id)>-1).map(e=>(this.initialApplications&&(e.applicationRental=this.initialApplications[0].rental.machine===e.id),e));if(_.length>0){let e=this.matDialog.open(Po);return e.componentInstance.rentedMachines.set(_),e.componentInstance.areaTotal.set(this.getArea()),e.componentInstance.date.set((0,P.default)(this.applicationFormGroup.getSafe(o=>o.date).value).toDate()),e.afterClosed().toPromise()}return Promise.all([])}else return Promise.all([])}getArea(){return this.applicationFormGroup.getSafe(_=>_.cultures).value.reduce((_,e)=>+_+ +e.area,0)}removeHerbicideFormGroupAtPosition(_){this.getHerbicidesFormArray().removeAt(_)}getCultureFormGroupByIndex(_){return this.applicationFormGroup.getSafe(e=>e.cultures).at(_)}getFertilizerFormGroupByIndex(_){return this.applicationFormGroup.getSafe(e=>e.fertilizers).at(_)}getCulturesFormArray(){return this.applicationFormGroup.getSafe(_=>_.cultures)}getAllCultureIdsFromForm(){let _=this.getCulturesFormArray(),e=[];for(let o=0;o<_.length;o++){let c=_.at(o).get("cultureId")?.value;c&&typeof c=="number"&&!isNaN(c)&&e.push(c)}return e}getHerbicidesFormArray(){return this.applicationFormGroup.getSafe(_=>_.herbicides)}loadAll(){this.loadEssentials(),this.cultureService.getAllCultures().subscribe(_=>{this.allCultures.next(_)}),this.applicationNoteService.getApplicationNotes().subscribe(_=>{this.textTemplates=_,this.filteredTextTemplatesForComment=[],this.filteredTextTemplatesForWork=[]}),this.loadCultures().then(_=>{let e=this.cultureId();!this.groupId()&&e&&this.getCulturesFormArray().controls[0].get("cultureId").patchValue(e),this.handleCulturesToAdd()})}loadCultures(){return this.parcelService.getParcelsWithCultures().pipe(ut(_=>Fo(_))).toPromise().then(_=>(this.cultures=_,this.culturesIndex=Lo(_),_))}loadEssentials(){this.loadCultures(),this.userService.getList().subscribe(e=>{this.users=e,this.employeeLabel=this.users.filter(o=>o.userrole!=="deleted").map(o=>({value:o.id,label:o.firstName+" "+o.lastName})),this.addDeletedUser()}),this.machineService.getAllMachines().subscribe(e=>{this.machines=e,this.machineLabels=[{label:$localize`:@@entryFormNoMachineSpecifiedLabel:Keine Angabe`,value:0},...this.machines.filter(o=>o.active||this.groupId()).map(o=>({label:o.name,value:o.id}))],setTimeout(()=>{this.initialApplications&&this.initialApplications[0]?.applicationMachines?.length&&this.applicationFormGroup.getSafe(o=>o.machines).patchValue(this.initialApplications[0].applicationMachines.map(o=>o.machine?.id))},0)});let _=this.type();_===this.applicationTypeEnum.DUENGUNG&&this.loadFertilizers(),_===this.applicationTypeEnum.PFLANZENSCHUTZ&&this.loadHerbicides()}loadHerbicides(){this.herbicideService.getAllHerbicides().subscribe(_=>{this.herbicides=_,this.herbicideLabelValues=this.herbicides.map(e=>({value:e.id,label:e.herbicide.product}))})}loadFertilizers(){this.fertilizerService.getAllFertilizers(!0).subscribe(_=>{this.fertilizers=_,this.fertilizerLabelValue=this.fertilizers.map(e=>
3({value:e.id,label:e.fertilizer.name}))})}addDeletedUser(){if(this.groupId()){let _=+this.applicationFormGroup.getSafe(e=>e.user).value;if(_&&this.employeeLabel&&!this.employeeLabel.find(e=>+e.value==+_)){let e=this.users.find(o=>o.id===_);e&&this.employeeLabel.push({value:e.id,label:e.firstName+" "+e.lastName})}}}isListedHerbicide(_){return!!this.herbicides?.find(o=>o.id===_.value.myProductId)?.herbicide?.listedherbicideWNbr?.id}getPSMURL(_){let e=this.herbicides.find(o=>o.id===_.value.myProductId);if(e.herbicide?.listedherbicideWNbr?.id){let o=e.herbicide?.listedherbicideWNbr;return`https://www.psm.admin.ch/de/produkte/${o.wNbr.indexOf("W-")>-1?o.wNbr.split("W-")[1]:o.wNbr}`}}addHerbicidesFormGroup(){let _=this.fb.group({myProductId:[null,[H.required]],amount:[null,Se.decimalNumbersValidator],initialAmount:[null],note:[null],price:[null,Se.decimalNumbersValidator],fertilizerSaldo:[],fertilizerUnit:[]});this.getHerbicidesFormArray().push(_);let e=this.getHerbicidesFormArray().controls.length-1;this.getHerbicidesFormArray().controls[e].get("myProductId").valueChanges.subscribe(o=>{if(o){let c=this.herbicides.find(u=>u.id===o);c&&(this.getHerbicidesFormArray().controls[e].get("fertilizerSaldo").patchValue(c.currentStock.toFixed(2)),this.getHerbicidesFormArray().controls[e].get("fertilizerUnit").patchValue(c.herbicide.unit),this.getHerbicidesFormArray().controls[e].get("price").patchValue(c.price),this.getHerbicidesFormArray().controls[e].get("amount").patchValue(c.herbicide.amountStandardusage))}}),this.getHerbicidesFormArray().controls[e].get("note").valueChanges.subscribe(o=>{o?this.filteredTextTemplatesForComment=this.textTemplates.filter(c=>c.name.toLowerCase().indexOf(o.toLowerCase())>-1):this.filteredTextTemplatesForComment=[]})}ngOnChanges(_){_.lastUsedMachine&&(this.groupId()||this.applicationFormGroup.getSafe(e=>e.machines).patchValue(_.lastUsedMachine.currentValue))}toggleApplicationProgress(){this.applicationFormGroup.getSafe(_=>_.progress).value==="done"?this.applicationFormGroup.getSafe(_=>_.progress).patchValue("pending"):(this.applicationFormGroup.getSafe(_=>_.progress).patchValue("done"),setTimeout(()=>{this.applicationFormGroup.updateValueAndValidity()},50))}enablePerHa(){this.applicationFormGroup.getSafe(_=>_.perHa).enable()}checkIsHofduenger(_){return this.fertilizers.find(e=>e.id===_)?.fertilizer?.customFertilizerType?.name==="Hofd\xFCnger"}isFertilizerMyProduct(_){return!!(_?.listedFertilizer||_?.customFertilizer)}isHerbicideMyProduct(_){return!!_?.herbicide&&!_?.listedFertilizer&&!_?.customFertilizer}removeMismatchedProducts(_,e){let o=_===this.applicationTypeEnum.DUENGUNG?this.getFertilizersFormArray():this.getHerbicidesFormArray();[...e].sort((c,u)=>u-c).forEach(c=>o.removeAt(c)),o.length===0&&(_===this.applicationTypeEnum.DUENGUNG?this.addFertilizerFormGroup():this.addHerbicidesFormGroup())}getProductKindMismatches(){let _=[],e=$localize`:@@entryFormProductKindFertilizer:Düngemittel`,o=$localize`:@@entryFormProductKindHerbicide:Pflanzenschutzmittel`;return this.getFertilizersFormArray().controls.forEach((c,u)=>{let S=c.get("myProductId")?.value;if(!S)return;this.fertilizers.find(s=>s.id===S)||_.push($localize`:@@entryFormFertilizerKindMismatch:Position ${u+1}:pos: Ausgewähltes Produkt ist kein ${e}:expected:.`)}),this.getHerbicidesFormArray().controls.forEach((c,u)=>{let S=c.get("myProductId")?.value;if(!S)return;this.herbicides.find(s=>s.id===S)||_.push($localize`:@@entryFormHerbicideKindMismatch:Position ${u+1}:pos: Ausgewähltes Produkt ist kein ${o}:expected:.`)}),_}ngAfterViewInit(){}onlyNumbers(_){try{/[A-z]/.test(_.key)&&_.key.length===1&&_.ctrlKey===!1&&_.preventDefault()}catch{}}disableFertilizerForm(){for(this.showFertilizer.set(!1);this.getFertilizersFormArray().controls.length;)this.getFertilizersFormArray().removeAt(0)}disableHerbicideForm(){for(this.showHerbicides.set(!1);this.getHerbicidesFormArray().controls.length;)this.getHerbicidesFormArray().removeAt(0)}enableFertilizerForm(){this.showFertilizer.set(!0),this.showAmountPerHaOrTotal.set(!0),this.addFertilizerFormGroup(),this.enablePerHa(),this.loadFertilizers()}enableHerbicideForm(){this.showHerbicides.set(!0),this.showAmountPerHaOrTotal.set(!0),this.addHerb
3icidesFormGroup(),this.enablePerHa(),this.loadHerbicides()}openPSMIframe(_){this.matDialog.open(yo).componentInstance.src.set(_)}handleEmptyFertilizers(){this.swallAdvancedService.openSelection({title:$localize`:@@entryFormNoFertilizerAvailableTitle:Kein Düngemittel verfügbar`,text:$localize`:@@entryFormNoFertilizerAvailableText:Bitte erstellen oder importieren Sie ein Düngemittel.`,icon:"add",defaultButtons:!0,selectionConfiguration:[{displayValue:$localize`:@@entryFormCreateFertilizerProductButton:Produkt erfassen`,value:{id:"create",type:$.DUENGUNG}},{displayValue:$localize`:@@entryFormImportFertilizerProductButton:Produkt importieren`,value:{id:"import",type:$.DUENGUNG}}]}).then(_=>{_.type==="success"&&(_.value.id==="create"?this.openAddProductModalForm($.DUENGUNG):_.value.id==="import"&&this.openImportProductModal($.DUENGUNG))})}handleEmptyHerbicides(){this.swallAdvancedService.openSelection({title:$localize`:@@entryFormNoPlantProtectionAvailableTitle:Kein Pflanzenschutzmittel verfügbar`,text:$localize`:@@entryFormNoPlantProtectionAvailableText:Bitte erstellen oder importieren Sie ein Pflanzenschutzmittel.`,icon:"add",defaultButtons:!0,selectionConfiguration:[{displayValue:$localize`:@@entryFormCreateHerbicideProductButton:Produkt erfassen`,value:{id:"create",type:$.PFLANZENSCHUTZ}},{displayValue:$localize`:@@entryFormImportHerbicideProductButton:Produkt importieren`,value:{id:"import",type:$.PFLANZENSCHUTZ}}]}).then(_=>{_.type==="success"&&(_.value.id==="create"?this.openAddProductModalForm($.PFLANZENSCHUTZ):_.value.id==="import"&&this.openImportProductModal($.PFLANZENSCHUTZ))})}};l.\u0275fac=function(e){return new(e||l)},l.\u0275cmp=W({type:l,selectors:[["ef-entry-form"]],inputs:{cultureId:[1,"cultureId"],commentLabel:[1,"commentLabel"],lastUsedMachine:[1,"lastUsedMachine"],onSaveGoTo:[1,"onSaveGoTo"],showComment:[1,"showComment"],allowAddFertilizer:[1,"allowAddFertilizer"],allowAddHerbicide:[1,"allowAddHerbicide"],showAmount:[1,"showAmount"],showAmountPerHaOrTotal:[1,"showAmountPerHaOrTotal"],showWork:[1,"showWork"],showState:[1,"showState"],copy:[1,"copy"],showFertilizer:[1,"showFertilizer"],showDateTill:[1,"showDateTill"],groupId:[1,"groupId"],showHerbicides:[1,"showHerbicides"],type:[1,"type"],meadowJournalDate:[1,"meadowJournalDate"]},outputs:{onSaveGoTo:"onSaveGoToChange",showAmountPerHaOrTotal:"showAmountPerHaOrTotalChange",showFertilizer:"showFertilizerChange",showHerbicides:"showHerbicidesChange",saved:"saved"},features:[Rt],decls:78,vars:24,consts:()=>{let _;_=$localize`:@@entry-form-component-calendar-entry-placeholder␟a0144580f35b1a3b8c15b66cdd61ee9eb72214af␟3825575047670037141:Kalendereintrag`;let e;e=$localize`:@@entry-form-component-general-information␟b4aad6f697c3a47ab94cb1bdcbe900d185a80cd3␟3331451502671959577:${"\uFFFD#3\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_FA_ICON: Allgemeine Informationen `;let o;o=$localize`:@@entry-form-component-planned-work␟19ed1670822e995d4890c2b6c019820e443a13a0␟7990753497783483875:${"\uFFFD#21\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_FA_ICON: Geplante Arbeit `;let c;c=$localize`:@@entry-form-component-plan-type␟147752f2dfb1f49794e8c47d3ea5fa0041b7a148␟8050545012020603798: ${"\uFFFD0\uFFFD"}:INTERPOLATION: planen `;let u;u=$localize`:@@entry-form-component-information␟c43dc1967a603fefb886149ac35863a06d5b4ce5␟5037437391296624618:Information`;let S;S=$localize`:@@entry-form-component-popover-activate-info␟fb22cd224c610ba004189d10f47e9650ba77be0c␟4667930399226320878:${"\uFFFD#34\uFFFD"}:START_BOLD_TEXT:Aktiveren${"\uFFFD/#34\uFFFD"}:CLOSE_BOLD_TEXT: um eine Massnahme für die Zukunft zu planen und als Aufgabe einem Mitarbeiter zu übergeben.`;let r;r=$localize`:@@entry-form-component-popover-deactivate-info␟fa2ed6842355a0e78236e09e73968f767cd71c8c␟8133013175034606876:${"\uFFFD#37\uFFFD"}:START_BOLD_TEXT:Deaktivieren${"\uFFFD/#37\uFFFD"}:CLOSE_BOLD_TEXT: um eine Anwendung sofort zu erfassen.`;let s;s=$localize`:@@entry-form-component-calendar-entry-heading␟0d7d8b301e862f57713d8e69b7b81b76c60d1e17␟8049451958417223431:${"\uFFFD#42\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#42\uFFFD"}:CLOSE_TAG_FA_ICON: Kalendereintrag `;let d;d=$localize`:@@entry-form-component-generate-calendar-entry␟40280cdefddce453ed9e4934717fd684f94097cd␟5528384759944331038:Kalendereintrag generieren `;let h;h=$localize`:@@entry-form-component-calendar-entry-label␟a0144580f35b1a3b8c15b66cdd61ee9eb72214af␟3825575047670037141:Kalendereintrag`;let K;K=$localize`:@@entry-form-component-cultures␟809a190dd27874bd565bc6e0f5934fef43ae4732␟7620208206065649763:${"\uFFFD#55\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#55\uFFFD"}
3:CLOSE_TAG_FA_ICON: Kultur/en `;let w;w=$localize`:@@entry-form-component-back␟c47252d6cffe14a672e7ef04b2cc30e761f240ae␟8930526198656004715:Zurück`;let J;J=$localize`:@@entry-form-component-start-date␟77bbe324b08f6636fb50f673cea05313b86fb692␟888341446683346521:Start date`;let Q;Q=$localize`:@@entry-form-component-end-date␟f60960faa2cd3e0db11e48688774d05dfa9d715b␟126074860850048964:End date`;let le;le=$localize`:@@entry-form-component-date-to␟acf2257cd54484e47f05dad07d702bc96cbefb03␟7709419812724263270: Datum / bis `;let ce;ce=$localize`:@@entry-form-component-date␟1470eabded471793a7ef2271e2a1dc30a1a3265f␟935267939147271845:Datum`;let se;se=$localize`:@@entry-form-component-date␟1470eabded471793a7ef2271e2a1dc30a1a3265f␟935267939147271845:Datum`;let ue;ue=$localize`:@@entry-form-component-employee␟394b74f86b3f573a9bfb0dabf67a3a3578492837␟3867605560596531339:Mitarbeiter`;let Re;Re=$localize`:@@entry-form-component-stadium␟63d712fc70245aaa73e60dcd25b86ba54235be9e␟218274669893720597:Stadium`;let M;M=$localize`:@@entry-form-component-stadium␟63d712fc70245aaa73e60dcd25b86ba54235be9e␟218274669893720597:Stadium`;let T_;T_=$localize`:@@entry-form-component-comment␟548f9212c76c87feda3601349622b8a40a55fe8e␟6066631435099755443:Bemerkung`;let S_;S_=$localize`:@@entry-form-component-date␟1470eabded471793a7ef2271e2a1dc30a1a3265f␟935267939147271845:Datum`;let A_;A_=$localize`:@@entry-form-component-date-until␟3e5933c34e7a24ca3d6bd35f707e26ad22000544␟8873681616172560477:Datum bis`;let N_;N_=$localize`:@@entry-form-component-machine␟bfa80785d816df8df6d5c36bf2c6b32073eacf70␟1678192944160180622:Maschine`;let f_;f_=$localize`:@@entry-form-component-work␟4ba16177bbfd5bb49c171c8851ab43a21903448f␟1036410821456001484:Arbeit`;let C_;C_=$localize`:@@entry-form-component-work␟4ba16177bbfd5bb49c171c8851ab43a21903448f␟1036410821456001484:Arbeit`;let L_;L_=$localize`:@@entry-form-component-stadium␟63d712fc70245aaa73e60dcd25b86ba54235be9e␟218274669893720597:Stadium`;let F_;F_=$localize`:@@entry-form-component-stadium␟63d712fc70245aaa73e60dcd25b86ba54235be9e␟218274669893720597:Stadium`;let O_;O_=$localize`:@@entry-form-component-amount␟77134c293828bbe6d663d26f75252663f46c7ca4␟6137964906830522076:Menge`;let g_;g_=$localize`:@@entry-form-component-amount␟77134c293828bbe6d663d26f75252663f46c7ca4␟6137964906830522076:Menge`;let D_;D_=$localize`:@@entry-form-component-amount␟77134c293828bbe6d663d26f75252663f46c7ca4␟6137964906830522076:Menge`;let M_;M_=$localize`:@@entry-form-component-add-machine␟591a7cad17fbaece5cfad0666cb68103c2700654␟3608682508307607458:+ Maschine erfassen `;let h_;h_=$localize`:@@entry-form-component-description␟f09ad66c1ebf16217ba1a1072be7a98de2d95eac␟3282235563480269560:Beschreibung`;let P_;P_=$localize`:@@entry-form-component-further-details␟635f0f80930a84e2df7a64cf93b8faf947c13e32␟8679215724649984001:Weitere Details:`;let y_;y_=$localize`:@@entry-form-component-mark-as-completed␟af0dcb066e5b9d9b53d09f2e8a5126bd52c7eb2a␟353407930203002249:Als abgeschlossen markieren `;let U_;U_=$localize`:@@entry-form-component-mark-as-completed␟af0dcb066e5b9d9b53d09f2e8a5126bd52c7eb2a␟353407930203002249:Als abgeschlossen markieren `;let b_;b_=$localize`:@@entry-form-component-culture␟0506f67492c777aec98ebc496e03b3e731ec11f8␟3443021995799691682:Kultur`;let I_;I_=$localize`:@@entry-form-component-area␟f93c6c986df333c16daccd0323ef22437cf254ee␟4878734560688767082:Fläche`;let H_;H_=$localize`:@@entry-form-component-parcel␟446a3409e4f66117693caa96de59a63987e21498␟1424670126482317381:Parzelle`;let G_;G_=$localize`:@@entry-form-component-area␟f93c6c986df333c16daccd0323ef22437cf254ee␟4878734560688767082:Fläche`;let $_;$_=$localize`:@@entry-form-component-hectare-unit␟86845eaecf3192364e4df1b7c603d793ea7a2905␟5642985232588036880:ha`;let v_;v_=$localize`:@@entry-form-component-add-culture␟d3a46e4cf8415632443097258400f52e88d42937␟5670467366675592878: Kultur erfassen `;let x_;x_=$localize`:@@entry-form-component-add-fertilizer-application␟0bffe9818467d087ff31adf4f45c25803f3159f3␟2506536642247625201: Düngemittelanwendung hinzufügen `;let K_;K_=$localize`:@@entry-form-component-add-pesticide-application␟4037aa3eddbb2d6151bca7e5f7350469fb63a73b␟4468990600044334078: Pflanzenschutzmittel hinzufügen `;let w_;
3w_=$localize`:@@entry-form-component-products␟52c7ba84115af8bce6f57c9e406c93fd2d2ffadf␟8012364112996093261:${"\uFFFD#3\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_FA_ICON: Produkt/e `;let z_;z_=$localize`:@@entry-form-component-amount-per-ha␟cc3a1123ec797b1fa5e355dc25f56b80501679ca␟871278655858131127: Menge pro ha `;let Y_;Y_=$localize`:@@entry-form-component-amount-total␟bb7b1fe0032b09b0fa6f9c2219d461be5c038397␟4700747269167552751: Menge Total `;let k_;k_=$localize`:@@entry-form-component-amount␟77134c293828bbe6d663d26f75252663f46c7ca4␟6137964906830522076:Menge`;let J_;J_=$localize`:@@entry-form-component-amount␟77134c293828bbe6d663d26f75252663f46c7ca4␟6137964906830522076:Menge`;let X_;X_=$localize`:@@entry-form-component-fertilizer␟2d6dd5090de444794993c5aff70573c056118f53␟4567162843536723933:Düngemittel`;let B_;B_=$localize`:@@entry-form-component-added-farm-manure␟74ea421d2338127bc3c70eff9cebadd4108fd208␟8421945828512427499: Zugeführter Hofdünger `;let V_;V_=$localize`:@@entry-form-component-amount-per-unit␟5a0bb4b9fde55edbd727e7f86761e0b285a9df28␟1622741225661426409:Betrag pro Einheit`;let q_;q_=$localize`:@@entry-form-component-amount-per-unit␟5a0bb4b9fde55edbd727e7f86761e0b285a9df28␟1622741225661426409:Betrag pro Einheit`;let W_;W_=$localize`:@@entry-form-component-add-product␟45cbe6144dc164a0cb726a389dc3e15401b97cca␟6343628941860969491:${"\uFFFD#2\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_FA_ICON: Produkt erfassen `;let Z_;Z_=$localize`:@@entry-form-component-import-product␟158d92415ac6e6614118c4ed31b6a0151cad3de2␟7393214122284509299:${"\uFFFD#2\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_FA_ICON: Produkt importieren `;let j_;j_=$localize`:@@entry-form-component-products␟52c7ba84115af8bce6f57c9e406c93fd2d2ffadf␟8012364112996093261:${"\uFFFD#3\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_FA_ICON: Produkt/e `;let Q_;Q_=$localize`:@@entry-form-component-amount-per-ha␟cc3a1123ec797b1fa5e355dc25f56b80501679ca␟871278655858131127: Menge pro ha `;let et;et=$localize`:@@entry-form-component-amount-total␟bb7b1fe0032b09b0fa6f9c2219d461be5c038397␟4700747269167552751: Menge Total `;let n_;n_=$localize`:@@entry-form-component-view-pesticide-on-blv␟1de4280494ae092b2a372983cdfb547093ca5aa9␟5970974160513729772:Pflanzenschutzmittel auf Bundesamt für Lebensmittelsicherheit anschauen`;let _t;_t=$localize`:@@entry-form-component-remarks␟912864a3efead1d92dabe32077587178c065224d␟7033601559051453200:Bemerkungen`;let tt;tt=$localize`:@@entry-form-component-amount␟77134c293828bbe6d663d26f75252663f46c7ca4␟6137964906830522076:Menge`;let ot;ot=$localize`:@@entry-form-component-remarks␟912864a3efead1d92dabe32077587178c065224d␟7033601559051453200:Bemerkungen`;let nt;nt=$localize`:@@entry-form-component-amount␟77134c293828bbe6d663d26f75252663f46c7ca4␟6137964906830522076:Menge`;let it;it=$localize`:@@entry-form-component-pesticide␟4920e9890a04d774d27e6a9a9ab33f7664ea0969␟62489550160340211:Pflanzenschutzmittel`;let rt;rt=$localize`:@@entry-form-component-amount-per-unit␟5a0bb4b9fde55edbd727e7f86761e0b285a9df28␟1622741225661426409:Betrag pro Einheit`;let at;at=$localize`:@@entry-form-component-amount-per-unit␟5a0bb4b9fde55edbd727e7f86761e0b285a9df28␟1622741225661426409:Betrag pro Einheit`;let Et;Et=$localize`:@@entry-form-component-add-product␟45cbe6144dc164a0cb726a389dc3e15401b97cca␟6343628941860969491:${"\uFFFD#2\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_FA_ICON: Produkt erfassen `;let lt;lt=$localize`:@@entry-form-component-import-product␟158d92415ac6e6614118c4ed31b6a0151cad3de2␟7393214122284509299:${"\uFFFD#2\uFFFD"}:START_TAG_FA_ICON:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_FA_ICON: Produkt importieren `;let ct;return ct=$localize`:@@entry-form-component-save␟418901d3d203d260815ba3dd552e1743aed7393b␟8709555516365647537: Speichern `,[["planApplication",""],["textWorkTemplate",""],["textCommentTemplate",""],["picker",""],["date",""],["dateTo",""],e,o,c,u,S,r,s,d,h,K,w,le,se,M,A_,C_,F_,g_,M_,P_,y_,U_,H_,G_,$_,v_,x_,K_,w_,z_,Y_,J_,B_,q_,W_,Z_,j_,Q_,et,ot,nt,at,Et,lt,ct,[1,"flex","flex-col","gap-2",3,"formGroup"],[3,"icon"],["fxLayout","row","fxLayout.lt-sm","column","fxLayoutGap.lt-sm","0","fxLayoutGap","15px",1,"fieldset"],["fxFlex","grow"],["fxLayoutAlign","flex-end flex-end"],["color","primary","mat-button","","mat-raised-button","",3,"click",4,"efIsAdmin"],["fxLayout","row","fxLayout.lt-sm","column","fxLayoutGap.lt-sm","15px","fxLayoutGap","15px",1,"fieldset"],["fxFlex","grow","fxLayoutAlign","center center"],["formControlName","isPlanned",3,"satPopoverAnchor","satPopoverHover"],["data-cy","entry-form-application-is-planned-toggle-text"],["verticalAlign","above","horizontalAlign","start"],[1,"title"],[1,"content"],["fxLayout","column","fxLayoutGap","5px"],["fxLayout.lt-sm","column","fxLayoutGap.lt-sm","15px","fxLayout","row","fxLayoutGap","15px",1,"fieldset"],["formControlName","calendarOn"],["formControlName","calendarTitle","matInput","","placeholder",_],[1,"fieldset"],["fxLayout","row","fxLayout.lt-lg","column","fxLayoutGap.lt-lg","5px","fxLayoutGap","15px"],["fxLayoutGap","15px","fxLayout.lt-sm","column",1,"mt-2.5"],["color","primary","mat-button","","mat-raised-button","","type","button",3,"click"],["color","primary","mat-button","","mat-raised-button","","type","button",3,"click",4,"efIsAdmin"],["fxLayout","row","fxLayout.lt-lg","column","fxLayoutAlign","center","fxLayoutGap","10px",1,"mt-2.5"],[1,"flex","flex-row","justify-end","gap-3","mt-2.5"],["color","primary","mat-button","","mat-raised-button","","data-cy","entry-form-save-button",3,"click",4,"efHideOnReadOnly"],["mat-button","","mat-raised-button","","type","button",3,"routerLink"],[3,"value"],[3,"click","rangePicker"],["matStartDate","","placeholder",J,"formControlName","date",3,"disabled"],["matEndDate","","placeholder",Q,"formControlName","dateTo",3,"disabled"],["matSuffix","",3,"for"],["disabled","false"],[3,"click"],["formControlName","date","matInput","","placeholder",ce,"disabled","","data-cy","ef-entry-form-date-input",3,"matDatepicker"],["disabled","false",3,"calendarHeaderComponent"],["formControlName","user","placeholder",ue,3,"labelValue"],["formControlName","state","matInput","","placeholder",Re],["formControlName","note","matInput","","data-cy","entry-form-remark-input","placeholder",T_,3,"matAutocomplete"],["disabled","","formControlName","dateTo","matInput","","placeholder",S_,3,"matDatepicker"],["data-cy","entry-form-machine-mat-select","formControlName","machines","placeholder",N_,3,"multiple","zeroAsNull","labelValue"],["formControlName","work","matInput","","placeholder",f_,"data-cy","input-work-fieldoperation",3,"matAutocomplete"],["formControlName","state","matInput","","placeholder",L_],["type","text","formControlName","cropAmount","matInput","","placeholder",O_],["type","number","formControlName","cropAmount","matInput","","placeholder",D_],["formControlName","cropUnit"],["color","primary","mat-button","","mat-raised-button","",3,"click"],[3,"checked"],["
3id","details","data-cy","entry-form-additional-detail-textarea","matInput","","formControlName","taskDetails","placeholder",h_],[3,"click","checked"],[3,"formGroup"],["placeholder",b_,"formControlName","cultureId",1,"w-full"],["matInput","","type","text","formControlName","parcelName"],["formControlName","area","matInput","","placeholder",I_],["matSuffix",""],["fxLayoutGap.lt-sm","5px","fxLayoutAlign.lt-sm","flex-start","fxLayoutAlign.lt-lg","flex-end","fxLayoutAlign","center center"],["color","primary","mat-button","","mat-raised-button","",3,"click","disabled"],["fxLayoutAlign","flex-start","fxLayoutGap","10px"],["fxLayoutAlign","left",1,"mb-5"],["fxLayout","column"],[1,"flex","flex-row","justify-end","gap-3"],["color","primary","mat-raised-button","","type","button",3,"click",4,"efIsAdmin"],["formControlName","perHa"],["fxLayout","row","fxLayout.lt-sm","column","fxLayoutGap.lt-sm","0px","fxLayoutGap","15px",1,"mb-2.5"],["matPrefix",""],["formControlName","amount","type","number","inputmode","decimal","matInput","","placeholder",k_,"data-cy","entry-form-fertilizer-amount",3,"keydown"],[4,"efShowOnFinance"],["fxFlexAlign","center","fxFlexAlign.lt-sm","flex-start","color","primary","mat-button","","mat-raised-button","","type","button",3,"click","disabled"],["fxLayoutGap","15px",1,"mb-2.5"],["color","primary","mat-button","","mat-raised-button","","type","button"],["placeholder",X_,"formControlName","myProductId","data-cy","ef-entry-form-select-fertilizer-typeahead",3,"emptyItemsClick","labelValue"],["formControlName","input","data-cy","entry-form-farm-fertilizer-added-toggle"],["formControlName","price","matInput","","placeholder",V_,"inputmode","decimal","type","number","data-cy","entry-form-fertilizer-amount-per-unit",3,"keydown"],["color","primary","mat-raised-button","","type","button",3,"click"],["fxLayoutAlign","flex-start",1,"mb-5"],["fxLayout","row","fxLayout.lt-sm","column","fxLayoutGap.lt-sm","0px","fxLayoutGap","15px"],["fxLayout","","fxLayoutAlign","flex-start flex-start","fxLayoutGap","20px"],["type","button","matTooltip",n_,"mat-mini-fab","",1,"mt-1"],["formControlName","note","matInput","","placeholder",_t,3,"matAutocomplete"],["formControlName","amount","type","number","inputmode","decimal","matInput","","placeholder",tt,3,"keydown"],["color","primary","mat-button","","mat-raised-button","","type","button",3,"click","disabled"],["placeholder",it,"formControlName","myProductId","data-cy","ef-entry-form-herbicide-mat-select-typeahead",3,"emptyItemsClick","labelValue"],["type","button","matTooltip",n_,"mat-mini-fab","",1,"mt-1",3,"click"],["formControlName","price","matInput","","placeholder",rt,"inputmode","decimal","type","number",3,"keydown"],["color","primary","mat-button","","mat-raised-button","","data-cy","entry-form-save-button",3,"click"]]},template:function(e,o){if(e&1){let c=g();a(0,"form",51)(1,"h2"),U(2,6),p(3,"fa-icon",52),b(),i(),a(4,"div",53)(5,"div",54),C(6,Bo,10,4,"ef-form-group")(7,Vo,8,3,"ef-form-group")(8,qo,2,1,"ef-form-group")(9,Wo,5,0,"ef-form-group")(10,Zo,5,2,"ef-form-group"),i(),a(11,"div",54),C(12,jo,8,3,"ef-form-group")(13,Qo,2,3,"ef-form-group")(14,en,5,1,"ef-form-group")(15,_n,5,0,"ef-form-group")(16,nn,6,2,"ef-form-group"),a(17,"div",55),C(18,rn,2,0,"button",56),i()()(),a(19,"h2"),U(20,7),p(21,"fa-icon",52),b(),i(),a(22,"div",57)(23,"div",58)(24,"mat-slide-toggle",59)(25,"span",60),A(26,8),i()(),a(27,"sat-popover",61,0)(29,"div",62),A(30,9),i(),a(31,"div",63)(32,"p"),U(33,10),p(34,"b"),b(),i(),a(35,"p"),U(36,11),p(37,"b"),b(),i()()()(),a(38,"div",54),C(39,ln,8,2,"div",64),i()(),a(40,"h2"),U(41,12),p(42,"fa-icon",52),b(),i(),a(43,"div",65)(44,"div",58)(45,"mat-slide-toggle",66),A(46,13),i()(),a(47,"div",54)(48,"ef-form-group")(49,"mat-form-field")(50,"mat-label"),A(51,14),i(),p(52,"input",67),i()()()(),a(53,"h2"),U(54,15),p(55,"fa-icon",52),b(),i(),a(56,"div",68),B(57,cn,22,3,"div",69,X),a(59,"div",70)(60,"button",71),L("click",function(){return F(c),O(o.addCultureFormGroup())}),p(61,"fa-icon",52),i(),C(62,sn,2,0,"button",72),i()(),C(63,mn,3,2,"div",73)(64,Fn,12,2)(65,In,11,2),a(66,"div",74),C(67,Hn,2,0,"button",75),a(68,"button",76),A(69,16),i()()(),a(70,"mat-autocomplete",null,1),B(72,Gn,2,2,"mat-option",77,X),i(),a(74,"mat-autocomplete",null,2),B(76,$n,2,2,"mat-option",77,X),i()}if(e&2){let c=G(28);R("formGroup",o.applicationFormGroup),E(3),R("icon",o.faEdit),E(3),f(o.type()===o.ApplicationTypeEnum.ERNTE?6:-1),E(),f(o.type()!==o.ApplicationTypeEnum.ERNTE?7:-1),E(),f(o.employeeLabel?8:-1),E(),f(o.showState()&&o.type()===o.ApplicationTypeEnum.ERNTE?9:-1),E(),f(o.showComment()?10:-1),E(2),f(o.showDateTill()&&o.type()!==o.ApplicationTypeEnum.ERNTE?12:-1),E(),f(o.machineLabels?13:-1),E(),f(o.showWork()?14:-1),E(),f(o.showState()&&o.type()!==o.ApplicationTypeEnum.ERNTE?15:-1),E(),f(o.showAmount()?16:-1),E(5),R("icon",o.faTask),E(3),R("satPopoverAnchor",c)("satPopoverHover",200),E(2),Le(o.computedTypeName()),Fe(26),E(13),f(o.applicationFormGroup.value!=null&&o.applicationFormGroup.value.isPlanned?39:-1),E(3),R("icon",o.faCalendar),E(13),R("icon",o.faPin),E(2),V(o.applicationFormGroup.get("cultures").controls),E(4),R("icon",o.faAdd),E(2),f(o.allowAddHerbicide()||o.allowAddFertilizer()?63:-1),E(),f(o.showFertilizer()?64:-1),E(),f(o.showHerbicides()?65:-1),E(3),R("routerLink",o.onSaveGoTo()),E(4),V(o.filteredTextTemplatesForWork),E(4),V(o.filteredTextTemplatesForComment)}},dependencies:[Ee,ie,re,Z,Vt,Ye,ne,Bt,ft,oe,ae,Qt,_o,oo,qe,xe,Ge,Ke,$e,ve,we,ze,We,Ve,Je,Xe,Be,to,wt,no,io,ro,Ze,je,Qe,ao,Eo,lo,co,so,uo,Co,No,Ao,fo,So,To,Oo,mo,go],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}"]});let n=l;return n})();var Ho=(()=>{let l=class l{constructor(){this.document=N(At)}scrollToTop(_=".overflow-y-auto"){setTimeout(()=>{let e=this.document.querySelector(_);e&&(e.scrollTop=0)})}scrollIntoView(_,e){_&&_.scrollIntoView(e||{behavior:"smooth",block:"start"})}};l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=Ne({token:l,factory:l.\u0275fac,providedIn:"root"});let n=l;return n})();function vn(n,l){if(n&1&&p(0,"ef-entry-form",14),n&2){let t=T();R("lastUsedMachine",t.lastUsedMachinesDto==null?null:t.lastUsedMachinesDto.saat)("cultureId",+t.route.snapshot.params.cultureId)("showAmount",!0)("groupId",t.groupId)("allowAddFertilizer",!0)("allowAddHerbicide",!0)("copy",t.route.snapshot.queryParams.copy==="true")("onSaveGoTo",t.route.snapshot.queryParams.meadowjournal==="true"?"/meadow-journal":"/kultur/detail
3s/"+t.route.snapshot.params.cultureId)("type",t.ApplicationTypeEnum.SAAT)}}function xn(n,l){if(n&1&&p(0,"ef-entry-form",15),n&2){let t=T();R("lastUsedMachine",t.lastUsedMachinesDto==null?null:t.lastUsedMachinesDto.duengung)("cultureId",+t.route.snapshot.params.cultureId)("showAmountPerHaOrTotal",!0)("showAmount",!1)("showComment",!1)("showFertilizer",!0)("showState",!0)("showWork",!1)("groupId",t.groupId)("allowAddHerbicide",!0)("copy",t.route.snapshot.queryParams.copy==="true")("onSaveGoTo",t.route.snapshot.queryParams.meadowjournal==="true"?"/meadow-journal":"/kultur/details/"+t.route.snapshot.params.cultureId)("type",t.ApplicationTypeEnum.DUENGUNG)}}function Kn(n,l){if(n&1&&p(0,"ef-entry-form",16),n&2){let t=T();R("lastUsedMachine",t.lastUsedMachinesDto==null?null:t.lastUsedMachinesDto.pflanzenschutz)("cultureId",+t.route.snapshot.params.cultureId)("showAmountPerHaOrTotal",!0)("showAmount",!1)("showComment",!1)("showHerbicides",!0)("showState",!0)("showWork",!1)("allowAddFertilizer",!0)("groupId",t.groupId)("copy",t.route.snapshot.queryParams.copy==="true")("onSaveGoTo",t.route.snapshot.queryParams.meadowjournal==="true"?"/meadow-journal":"/kultur/details/"+t.route.snapshot.params.cultureId)("type",t.ApplicationTypeEnum.PFLANZENSCHUTZ)}}function wn(n,l){if(n&1&&p(0,"ef-entry-form",17),n&2){let t=T();R("lastUsedMachine",t.lastUsedMachinesDto==null?null:t.lastUsedMachinesDto.pflege)("cultureId",+t.route.snapshot.params.cultureId)("showAmountPerHaOrTotal",!1)("showAmount",!1)("showComment",!0)("showHerbicides",!1)("showState",!0)("showWork",!0)("groupId",t.groupId)("copy",t.route.snapshot.queryParams.copy==="true")("onSaveGoTo",t.route.snapshot.queryParams.meadowjournal==="true"?"/meadow-journal":"/kultur/details/"+t.route.snapshot.params.cultureId)("type",t.ApplicationTypeEnum.PFLEGE)}}function zn(n,l){if(n&1&&p(0,"ef-entry-form",18),n&2){let t=T();R("lastUsedMachine",t.lastUsedMachinesDto==null?null:t.lastUsedMachinesDto.ernte)("cultureId",+t.route.snapshot.params.cultureId)("showAmountPerHaOrTotal",!1)("showAmount",!0)("showComment",!0)("showDateTill",!0)("showHerbicides",!1)("showState",!0)("showWork",!0)("groupId",t.groupId)("copy",t.route.snapshot.queryParams.copy==="true")("onSaveGoTo",t.route.snapshot.queryParams.meadowjournal==="true"?"/meadow-journal":"/kultur/details/"+t.route.snapshot.params.cultureId)("type",t.ApplicationTypeEnum.ERNTE)}}var Io=(()=>{let l=class l{constructor(){this.router=N(ge),this.route=N(Oe),this.machineService=N(Pe),this.applicationService=N(Me),this.userStateService=N(ke),this.toastrService=N(zt),this.modalHelper=N(__),this.scrollService=N(Ho),this.entryFormComponent=a_(o_),this.matTabGroup=a_(Te),this.faEntry=De,this.faUpload=gt,this.navigateBackToMeadowJournal=!1,this.ApplicationTypeEnum=D,this.userStateService.isTestaccount()&&this.applicationService.getApplicationsCount().subscribe(_=>{_.applicationCount>=10&&!this.route.snapshot.params.groupId&&(this.toastrService.info($localize`:@@cultureEntryTestLimitReachedMessage:Besten Dank, dass Sie den eFeldkalender verwenden. Sie haben das Limit der Testversion erreicht. Um weitere Anwendungen erfassen zu können, bitten wir Sie eine Lizenz zu lösen`,$localize`:@@cultureEntryTestLimitReachedTitle:Testaccount Limite erreicht`,{timeOut:3e4}),this.router.navigateByUrl("/unternehmen/lizenz/erwerben"))}),this.machineService.getLastUsedMachines().subscribe(_=>{this.lastUsedMachinesDto={ernte:_.ernte?_.ernte.map(e=>e.id):[],bodenbearbeitung:_.bodenbearbeitung?_.bodenbearbeitung.map(e=>e.id):[],saat:_.saat?_.saat.map(e=>e.id):[],pflege:_.pflege?_.pflege.map(e=>e.id):[],duengung:_.duengung?_.duengung.map(e=>e.id):[],pflanzenschutz:_.pflanzenschutz?_.pflanzenschutz.map(e=>e.id):[]}}),this.groupId=this.route.snapshot.params.groupId}ngOnInit(){this.scrollService.scrollToTop()}ngAfterViewInit(){let _=this.route.snapshot.queryParams.type,e=0;if(_)switch(Number(_)){case D.BODENBEARBEITUNG:e=0;break;case D.SAAT:e=1;break;case D.DUENGUNG:e=2;break;case D.PFLANZENSCHUTZ:e=3;break;case D.PFLEGE:e=4;break;case D.ERNTE:e=5;break;default:e=0}
3this.matTabGroup().selectedIndex=e,this.route.snapshot.queryParams.meadowjournal&&(this.navigateBackToMeadowJournal=!0)}onTabChange(_){let e;switch(_){case 0:e=D.BODENBEARBEITUNG;break;case 1:e=D.SAAT;break;case 2:e=D.DUENGUNG;break;case 3:e=D.PFLANZENSCHUTZ;break;case 4:e=D.PFLEGE;break;case 5:e=D.ERNTE;break;default:e=D.BODENBEARBEITUNG}this.router.navigate([],{relativeTo:this.route,queryParamsHandling:"merge",queryParams:{type:e}})}ngAfterViewChecked(){this.entryFormComponent().saved.subscribe(_=>{this.router.navigate([`/kultur/details/${this.route.snapshot.params.cultureId}`])})}openUploadFileModal(){let _=this.modalHelper.open(q.openUploadFileModal,{width:"1280px",maxWidth:"95vw"},{groupId:this.groupId}).then(e=>{e.componentInstance.saveAndLoadForApplication(this.groupId,!1),e.beforeClosed().subscribe(o=>{this.saveFunction=e.componentInstance.fileUploaderComponent().getSaveFunction(!0)})})}};l.\u0275fac=function(e){return new(e||l)},l.\u0275cmp=W({type:l,selectors:[["ef-culture-entry"]],viewQuery:function(e,o){e&1&&(E_(o.entryFormComponent,o_,5),E_(o.matTabGroup,Te,5)),e&2&&pt(2)},decls:19,vars:8,consts:()=>{let _;_=$localize`:@@culture-entry-component-tooltip-file-management␟3916ad4df0cd15de50ba4cabaff7fdddb43684f0␟233978551682273341:Dateiverwaltung`;let e;e=$localize`:@@culture-entry-component-tab-tillage␟348cfc12a02a6c6729bb33ea311b4c3c8d0e200d␟7734057964466510758:Bodenbearbeitung`;let o;o=$localize`:@@culture-entry-component-tab-seeding␟0879fbbde8a9a2176cff81c7202090367598d8b8␟6305131031263812051:Saat`;let c;c=$localize`:@@culture-entry-component-tab-fertilization␟3f083178a6e2c772ac9ad12b0170e663ff1d2b74␟5231397425484228703:Düngung`;let u;u=$localize`:@@culture-entry-component-tab-crop-protection␟045c09b55549acb4b137efda67521ea91f0d16f7␟1187231945625643840:Pflanzenschutz`;let S;S=$localize`:@@culture-entry-component-tab-maintenance␟f51a8a0aadebca1aad7d86ca20c7d67805fa6ccc␟2433433545919134610:Pflege`;let r;r=$localize`:@@culture-entry-component-tab-harvest␟60c6e27200f2028791e94d2e2ea30a826e1c467b␟6862249004611098026:Ernte`;let s;return s=$localize`:@@culture-entry-component-header-record-entry␟e46330e4fe47835dc0f2ec7a1b05115b8d7b142c␟7177925016260702091: Eintrag erfassen
4`,[s,[3,"icon"],["fxLayout","column",1,"content-padding"],["fxLayoutAlign","flex-end"],["mat-fab","","matTooltip",_,3,"click"],["mat-stretch-tabs","",3,"selectedIndexChange"],["label",e],[3,"lastUsedMachine","cultureId","copy","groupId","onSaveGoTo","type"],["label",o],["matTabContent",""],["label",c],["label",u],["label",S],["label",r],["commentLabel","Bemerkung/Sorte",3,"lastUsedMachine","cultureId","showAmount","groupId","allowAddFertilizer","allowAddHerbicide","copy","onSaveGoTo","type"],[3,"lastUsedMachine","cultureId","showAmountPerHaOrTotal","showAmount","showComment","showFertilizer","showState","showWork","groupId","allowAddHerbicide","copy","onSaveGoTo","type"],[3,"lastUsedMachine","cultureId","showAmountPerHaOrTotal","showAmount","showComment","showHerbicides","showState","showWork","allowAddFertilizer","groupId","copy","onSaveGoTo","type"],[3,"lastUsedMachine","cultureId","showAmountPerHaOrTotal","showAmount","showComment","showHerbicides","showState","showWork","groupId","copy","onSaveGoTo","type"],[3,"lastUsedMachine","cultureId","showAmountPerHaOrTotal","showAmount","showComment","showDateTill","showHerbicides","showState","showWork","groupId","copy","onSaveGoTo","type"]]},template:function(e,o){e&1&&(a(0,"ef-page-header",1),A(1,0),i(),a(2,"div",2)(3,"div",3)(4,"button",4),L("click",function(){return o.openUploadFileModal()}),p(5,"fa-icon",1),i()(),a(6,"mat-tab-group",5),L("selectedIndexChange",function(u){return o.onTabChange(u)}),a(7,"mat-tab",6),p(8,"ef-entry-form",7),i(),a(9,"mat-tab",8),C(10,vn,1,9,"ng-template",9),i(),a(11,"mat-tab",10),C(12,xn,1,13,"ng-template",9),i(),a(13,"mat-tab",11),C(14,Kn,1,13,"ng-template",9),i(),a(15,"mat-tab",12),C(16,wn,1,12,"ng-template",9),i(),a(17,"mat-tab",13),C(18,zn,1,13,"ng-template",9),i()()()),e&2&&(R("icon",o.faEntry),E(5),R("icon",o.faUpload),E(3),R("lastUsedMachine",o.lastUsedMachinesDto==null?null:o.lastUsedMachinesDto.bodenbearbeitung)("cultureId",+o.route.snapshot.params.cultureId)("copy",o.route.
4snapshot.queryParams.copy==="true")("groupId",o.groupId)("onSaveGoTo",o.route.snapshot.queryParams.meadowjournal==="true"?"/meadow-journal":"/kultur/details/"+o.route.snapshot.params.cultureId)("type",o.ApplicationTypeEnum.BODENBEARBEITUNG))},dependencies:[eo,Ee,ie,Z,Xt,oe,Zt,jt,Te,ae,o_],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}"]});let n=l;return n})();export{Io as CultureEntryComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.