1"use strict";(self.webpackChunkcqd_frontend=self.webpackChunkcqd_frontend||[]).push([[4038],{9803($,v,e){e.d(v,{R:()=>_});var a=e(77562),N=e(89417),t=e(70980),T=e(96354),f=e(25558),E=e(96697),s=e(88141),R=e(43697),A=e(54438),I=e(56588),L=e(90360),B=e(88701),b=e(19724),g=e(96935),D=e(11906);let _=(()=>{class d extends a.W{constructor(){super(...arguments),this.plantsControl=new N.MJ,this.plantGroupService=(0,A.WQX)(R.i),this.notificationService=(0,A.WQX)(B.J),this.categoryService=(0,A.WQX)(g.M)}getPlantGroupPlants(p){this.plantGroupService.getPlantGroupPlants(p.id,{pageSize:100}).pipe((0,E.s)(1),(0,T.T)(l=>(this.plantIdsBefore=l.items.map(h=>h.id),l.items.filter(h=>h.ownedBy.id===p.ownedBy.id))),(0,s.M)(l=>this.plantsControl.setValue(l)),(0,t.j)(()=>this.cdRef.markForCheck())).subscribe()}createForm(p){const l=super.createForm(p);return new N.gE({...l.controls,jurisdiction:new N.MJ(p?.jurisdiction?p.jurisdiction:[D.M_.m49Code],N.k0.required)})}onSubmit(){if(this.form.valid){const p=new I.E(this.form.value);p.categoryIds=p.categories.map(l=>l.id),this.submitPlantGroup(p)}else L.s.markAllDirty(this.form),this.notificationService.showInvalidDataError(),this.cdRef.markForCheck()}onSelectPlant(p){this.addPlantJurisdictionIfNeeded(p),this.addPlantCategories(p)}addPlantJurisdictionIfNeeded(p){const l=p.getJurisdiction();if(l){const h=this.form.controls.jurisdiction,n=h.value,i=(0,D.DK)(l);if(n?.length){const r=n.map(c=>(0,D.DK)(c));if(!r.find(c=>c.data.m49Code===i.data.m49Code)&&!i.ancestors().find(c=>r.includes(c))){const c=(0,D.Hi)(r.filter(M=>!M.ancestors().includes(i)));h.setValue([...c,l])}}else h.setValue([i.data.m49Code||i.data.alpha2])}}addPlantCategories(p){const l=this.form.get("categories");let h=l.value||[];const{categories:n}=p;h=[...h,...n];const i=new Set(h.map(c=>c.id));(0,b.H)(h).pipe((0,f.n)(c=>this.categoryService.getCategoriesHierarchyListById(c.id).pipe((0,T.T)(M=>({catId:c.id,catHierarchyIds:M.map(y=>y.id).filter(y=>y!==c.id)})))),(0,s.M)(({catId:c,catHierarchyIds:M})=>{M.forEach(y=>{i.has(y)&&i.delete(c)})})).subscribe();const r=[];i.forEach(c=>r.push(h.find(M=>M.id===c))),l.setValue(r),this.categoryService.updateCategorySelectOptions()}static{this.\u0275fac=(()=>{let p;return function(h){return(p||(p=A.xGo(d)))(h||d)}})()}static{this.\u0275dir=A.FsC({type:d,features:[A.Vt3]})}}return d})()},65467($,v,e){e.d(v,{C:()=>p});var a=e(54438),N=e(89417),t=e(96354),T=e(70980),f=e(66338),E=e(57574),s=e(94779),R=e(34003),A=e(46421),I=e(60177),L=e(38542),B=e(92619),b=e(69441),g=e(98489);let D=(()=>{class l{set initialName(n){n&&(this._initialName=n)}get initialName(){return this._initialName}constructor(){this.hide=new a.bkB,this.submitEvent=new a.bkB}onHide(){this.hide.emit()}onSubmit(n){this.submitEvent.emit(n),this.hide.emit()}static{this.\u0275fac=function(i){return new(i||l)}}static{this.\u0275cmp=a.VBU({type:l,selectors:[["cqd-add-plant-modal"]],inputs:{display:"display",ownedById:"ownedById",initialName:"initialName"},outputs:{hide:"hide",submitEvent:"submitEvent"},decls:2,vars:5,consts:()=>{let n;return n=$localize`:â36b9410da0695e8d5ccfbafe1b108d0cf95dd363â3517948421337500749:Add Plant`,[["header",n,"appendTo","body",3,"hide","dialogWidth","focusOnShow","visible"],[3,"submitEvent","initialName","ownedById"]]},template:function(i,r){1&i&&(a.j41(0,"cqd-modal",0),a.bIt("hide",function(){return r.onHide()}),a.j41(1,"cqd-plant-create-form",1),a.bIt("submitEvent",function(M){return r.onSubmit(M)}),a.k0s()()),2&i&&(a.Y8G("dialogWidth",900)("focusOnShow",!1)("visible",r.display),a.R7$(),a.Y8G("initialName",r.initialName)("ownedById",r.ownedById))},dependencies:[b.y,g.X],encapsulation:2})}}return l})();const _=l=>({newItem:l,matchKey:"id"});function d(l,h){if(1&l){const n=a.RV6();a.j41(0,"div")(1,"cqd-select",2),a.nI1(2,"async"),a.bIt("changeEvent",function(r){a.eBV(n);const c=a.XpG();return a.Njj(c.setSelectedItems(r))})("typeahead",function(r){a.eBV(n);const c=a.XpG();return a.Njj(c.requestNewOptions(r))})("openEvent",function(r){a.eBV(n);const c=a.XpG();return a.Njj(c.onOpen(r))})("addItemEvent",function(r){a.eBV(n);const c=a.XpG();return a.Njj(c.addItemEvent.emit(r))}),a.k0s()()}if(2&l){const n=a.XpG();a.R7$(),a.HbH(n.selectStyleClass),a.Y8G("bindValue",null)("control",n.validationControl)("pTooltip",n.tooltip)("inputId",n.inputId)("label",n.label)("multiple",!0)("maxSelectedItems",n.maxSelectedItems)("loading",n.isLoadingSignal())("selectedItem",n.selectedItems)("options",a.bMT(2,14,n.source$))("newOption",a.eq3(16,_,n.newPlant))("disabled",n.disabled)}}function u(l,h){if(1&l){const n=a.RV6();a.j41(0,"cqd-add-plant-modal",3),a.bIt("hide",function(){a.eBV(n);const r=a.XpG();return a.Njj(r.hidePlantModal())})("submitEvent",function(r){a.eBV(n);const c=a.XpG();return a.Njj(c.submitCreatedPlant(r))}),a.k0s()}if(2&l){const n=a.XpG();a.Y8G("display",n.shouldShowPlantModal)("ownedById",n.ownedById)("initialName",n.newPlantInitialName)}}let p=(()=>{class l extends f.L{constructor(n,i,r){super(),this.plantService=n,this.injector=i,this.sessionService=r,this.clearable=!0,this.queryParams={},this.queryMinLength=1,this.selectedItems=[],this.newPlantId=(0,A.A)(),this.prop
1agateChange=()=>{}}ngAfterViewInit(){const n=this.injector.get(N.vO,null);n&&(this.form=n.control,this.cdRef.detectChanges()),this.preInitOptions&&this.requestNewOptions("")}ngOnChanges(n){n.ownedById&&!n.ownedById.isFirstChange()&&n.ownedById.currentValue!==n.ownedById.previousValue&&this.requestNewOptions("")}onOpen(n){this._selectComponent=n}setSelectedItems(n){if(n){const i=n.filter(r=>r.id!==this.newPlantId);i.length!==n.length?(this.showPlantModal(),this.selectedItems=[...i],this.propagateChange(i)):(this.selectedItems=[...n],this.propagateChange(n))}}showPlantModal(){this._selectComponent.close(),this.shouldShowPlantModal=!0}hidePlantModal(){this.shouldShowPlantModal=!1}submitCreatedPlant(n){this.newPlant=n,this.setSelectedItems([...this.selectedItems,this.newPlant]),this.addItemEvent.emit(n)}writeValue(n){this.selectedItems=n,this.cdRef.markForCheck()}registerOnChange(n){this.propagateChange=n}registerOnTouched(n){}createForm(){return new N.MJ([])}getSource(n){this.newPlantInitialName=n,this.isLoadingSignal.set(!0);const i={...this.queryParams,q:n,pageSize:100};return this.plantService.getOrganizationPlants(this.ownedById,i).pipe((0,t.T)(r=>r.items),(0,t.T)(r=>{const c=this.selectedItems?this.selectedItems.map(M=>M.id):[];return r.filter(M=>!c.includes(M.id))}),(0,t.T)(r=>{const c=this.selectedItems||[];return this.sessionService.getSecurityPrincipal().canCreatePlants()?[...c,...r,new E.t({id:this.newPlantId,name:this.labels.createNew})]:[...c,...r]}),(0,T.j)(()=>this.isLoadingSignal.set(!1)))}static{this.\u0275fac=function(i){return new(i||l)(a.rXU(s.h),a.rXU(a.zZn),a.rXU(R.Q))}}static{this.\u0275cmp=a.VBU({type:l,selectors:[["cqd-plant-group-plants-multiple-autocomplete"]],inputs:{label:"label",inputId:"inputId",tooltip:"tooltip",clearable:"clearable",selectStyleClass:"selectStyleClass",validationControl:"validationControl",maxSelectedItems:"maxSelectedItems",queryParams:"queryParams",queryMinLength:"queryMinLength",ownedById:"ownedById"},features:[a.Jv_([{provide:N.kq,multi:!0,useExisting:(0,a.Rfq)(()=>l)}]),a.Vt3,a.OA$],decls:2,vars:2,consts:[[4,"ngIf"],[3,"display","ownedById","initialName","hide","submitEvent",4,"ngIf"],["bindLabel","name",3,"changeEvent","typeahead","openEvent","addItemEvent","bindValue","control","pTooltip","inputId","label","multiple","maxSelectedItems","loading","selectedItem","options","newOption","disabled"],[3,"hide","submitEvent","display","ownedById","initialName"]],template:function(i,r){1&i&&a.DNE(0,d,3,18,"div",0)(1,u,1,3,"cqd-add-plant-modal",1),2&i&&(a.Y8G("ngIf",r.form),a.R7$(),a.Y8G("ngIf",r.shouldShowPlantModal))},dependencies:[I.bT,L.m,B.w,D,I.Jj],styles:["[_nghost-%COMP%] .ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap!important}[_nghost-%COMP%] .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{display:inline-flex}[_nghost-%COMP%] .ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-label{max-width:150px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}"],changeDetection:0})}}return l})()},34038($,v,e){e.d(v,{PlantGroupsModule:()=>dt});var a=e(63905),N=e(51188),t=e(54438),T=e(56588),f=e(9803),E=e(89417),s=e(96697),R=e(25558),A=e(88141),I=e(99437),L=e(70980),B=e(73703),b=e(82902),g=e(18810),D=e(27468),_=e(7673),d=e(61120),u=e(11906),p=e(62704),l=e(68211),h=e(80989),n=e(60177),i=e(81141),r=e(5779),c=e(15473),M=e(71517),y=e(30218),F=e(21071),K=e(87314),Y=e(7433),J=e(86557),q=e(19354),Q=e(1377),Z=e(94641),k=e(80435),X=e(71184),tt=e(65467);function et(m,j){if(1&m){const o=t.RV6();t.j41(0,"cqd-sanitizer-errors-sidebar",3),t.bIt("hide",function(){t.eBV(o);const O=t.XpG();return t.Njj(O.shouldShowQaSidebar=!1)})("confirm",function(O){t.eBV(o);const S=t.XpG();return t.Njj(S.onConfirm(O))}),t.k0s()}if(2&m){const o=t.XpG();t.Y8G("visible",o.shouldShowQaSidebar)("model",o.plantGroup)("form",o.form)("canEdit",!o.disabled)}}function nt(m,j){if(1&m&&t.nrm(0,"cqd-raw-entity-button",25),2&m){const o=t.XpG(2);t.Y8G("entityId",o.plantGroup.id)}}function ot(m,j){if(1&m){const o=t.RV6();t.j41(0,"button",26),t.nI1(1,"async"),t.bIt("click",function(){t.eBV(o);const O=t.XpG(2);return t.Njj(O.onSubmit())}),t.k0s()}if(2&m){const o=t.XpG(2);t.Y8G("disabled",t.bMT(1,1,o.isLocked$))}}function at(m,j){if(1&m){const o=t.RV6();t.j41(0,"button",27),t.nI1(1,"async"),t.bIt("click",function(){t.eBV(o);const O=t.XpG(2);return t.Njj(O.onSubmit())}),t.k0s()}if(2&m){const o=t.XpG(2);t.Y8G("disabled",t.bMT(1,1,o.isLocked$))}}function st(m,j){if(1&m){const o=t.RV6();t.j41(0,"p-panel")(1,"p-header")(2,"div",4)(3,"div",5)(4,"span"),t.EFF(5),t.k0s()(),t.j41(6,"div",6),t.DNE(7,nt,1,1,"cqd-raw-entity-button",7),t.j41(8,"cqd-qa-button",8),t.bIt("clickEvent",function(){t.eBV(o);const O=t.XpG();return t.Njj(O.shouldShowQaSidebar=!0)}),t.k0s(),t.DNE(9,ot,2,3,"button",9),t.j41(10,"button",10),t.bIt("click",function(){t.eBV(o);const O=t.XpG();return t.Njj(O.onCancel())}),t.k0s()()()(),t.j41(11,"div",11)(12,"div",12)(13,"div",13),t.nrm(14,"cqd-form-input",14),t.k0s(),t.j41(15,"div",13),t.nrm(16,"cqd-form-tags",15),t.k0s(),t.j41(17,"div",13)(18,"cqd-org-autocomplete",16),t.bIt("changeOrganization",function(O){t.eBV(o);const S=t.XpG();return t.Njj(S.onManufacturerChanged(O))}),t.k0s()(),t.j41(19,"div",13),t.nrm(20,"cqd-geography-select",17),t.k0s(),t.j41(21,"div",13)(22,"cqd-plant-group-plants-multiple-autocomplete",18),t.bIt("addItemEvent",function(O){t.eBV(o);const S=t.XpG();return t.Njj(S.onSelectPlant(O))}),t.k0s()(),t.j41(23,"div",13),t.nrm(24,"cqd-categories-autocomplete",19),t.k0s()(),t.j41(25,"div",12)(26,"div",20),t.nrm(27,"cqd-form-textarea",21),t.k0s()(),t.j41(28,"div",12),t.nrm(29,"cqd-epds-table-container",22),t.k0s()(),t.j41(30,"p-footer")(31,"div",20),t.DNE(32,at,2,3,"button",23),t.j41(33,"button",24),t.bIt("click",function(){t.eBV(o);const O=t.XpG();return t.Njj(O.onCancel())}),t.k0s()()()()}if(2&m){const o=t.XpG();t.R7$(5),t.JRh(o.labels.plantGroup),t.R7$(2),t.Y8G("ngIf",o.isAdmin),t.R7$(),t.Y8G("model",o.plantGroup),t.R7$(),t.Y8G("ngIf",!o.disabled),t.R7$(2),t.Y8G("formGroup",o.form),t.R7$(3),t.Y8G("disabled",o.disabled),t.R7$(2),t.Y8G("addOn
1Blur",!0)("addOnTab",!0)("disabled",o.disabled),t.R7$(2),t.Y8G("disabled",o.disabled),t.R7$(2),t.Y8G("geographyItemsHierarchy",o.geographyItemsHierarchy)("disabled",o.disabled),t.R7$(2),t.Y8G("formControl",o.plantsControl)("ownedById",o.ownedById)("preInitOptions",!0)("disabled",o.disabled),t.R7$(2),t.Y8G("control",o.form.get("categories"))("multiple",!0)("disabled",o.disabled),t.R7$(3),t.Y8G("disabled",o.disabled),t.R7$(2),t.Y8G("header",o.labels.listEpds)("withActionButtons",!1)("withFooter",!1)("withSearchBox",!1)("excludeFieldsToFilter",o.excludeEpdFieldsToFilter)("baseQueryParams",o.baseEpdSearchParams)("backUrl",o.backUrl),t.R7$(3),t.Y8G("ngIf",!o.disabled)}}function it(m,j){1&m&&t.nrm(0,"cqd-spinner")}const lt=[{path:":id",pathMatch:"full",component:(()=>{class m extends f.R{constructor(){super(...arguments),this.geographyItemsHierarchy=u.lK,this.route=(0,t.WQX)(N.nX),this.qaService=(0,t.WQX)(p.Q),this.rawEntityService=(0,t.WQX)(l.l),this.permissionsService=(0,t.WQX)(h.K)}ngOnInit(){this.isAdmin=this.permissionsService.isAdmin(),this.backUrl=this.router.url,this.route.params.pipe((0,s.s)(1),(0,R.n)(o=>{if(o.id)return this.plantGroupService.getPlantGroupById(o.id)}),(0,A.M)(o=>{this.plantGroup=o,this.ownedById=o.ownedBy.id,this.disabled=!this.canWrite(o.myCapabilities),this.form=this.createForm(o),this.baseEpdSearchParams={plantOrGroupId:o.id},this.getPlantGroupPlants(o)}),(0,I.W)(o=>(404===o.status&&this.router.navigate([d.JZ.dashboard.notFound.url]),(0,g.$)(o))),(0,L.j)(()=>this.cdRef.markForCheck())).subscribe()}ngOnDestroy(){super.ngOnDestroy(),this.rawEntityService.clearRawEntity()}onManufacturerChanged(o){this.ownedById=o.id,this.getPlantGroupPlants(new T.E({...this.form.value,ownedBy:o}))}onConfirm(o){const P=this.qaService.confirmIgnoredFields(this.plantGroup,this.form,o);P.isOk&&(this.shouldShowQaSidebar=!1),this.plantGroup=new T.E({...P.toJSON()})}submitPlantGroup(o){this.lockComponent(),this.plantGroupService.patchPlantGroup(this.plantGroup.id,o).pipe((0,R.n)(P=>{this.plantIdsAfter=(0,b.I)(this.plantsControl.value)?[]:this.plantsControl.value.map(C=>C.id);const O=this.plantIdsAfter.filter(C=>!this.plantIdsBefore.includes(C)),S=this.plantIdsBefore.filter(C=>!this.plantIdsAfter.includes(C)),U=[];return O.forEach(C=>U.push(this.plantGroupService.includePlantToPlantGroup(C,P.id))),S.forEach(C=>U.push(this.plantGroupService.excludePlantFromPlantGroup(C,P.id))),(0,b.I)(U)?(0,_.of)(P):(0,D.p)(U).pipe((0,s.s)(1),(0,B.u)(P))}),(0,A.M)(P=>this.submitEvent.emit(this.convertToPlantOrGroupModel(P))),(0,A.M)(()=>this.goToManufacturer()),(0,A.M)(P=>{this.notificationService.show({severity:"info",summary:"Plant Group",detail:`The Plant Group "${P.name}" has been updated successfully`})}),(0,L.j)(()=>this.unlockComponent())).subscribe()}createForm(o){const P=super.createForm(o);return P.controls.ownedBy.setValidators(E.k0.required),P}static{this.\u0275fac=(()=>{let o;return function(O){return(o||(o=t.xGo(m)))(O||m)}})()}static{this.\u0275cmp=t.VBU({type:m,selectors:[["cqd-plant-group-edit-form"]],features:[t.Vt3],decls:4,vars:3,consts:()=>{let o,P,O,S,U,C,w,H,V,W,x,z;return o=$localize`:â047f50bc5b5d17b5bec0196355953e1a5c590ddbâ4021752662928002901:Update`,P=$localize`:âd7b35c384aecd25a516200d6921836374613dfe7â2159130950882492111:Cancel`,O=$localize`:â48c708ac96b8bd49b8e4aa0dccd2af13107d632aâ9040066725920927915:Plant Group Name *`,S=$localize`:â472b2c7b895386f668dd3b3365900ac9ecfb04f6â9134858089863428359:Alternative names`,U=$localize`:âcc1c9f96620e8e52b025ccc942895b6fb9f7ced1â5603587897186961588:Manufacturer *`,C=$localize`:â951d6fbb99fbc70cc1c4bfe6c44628c26bc4f2c9â3012231561587019282:Geography`,w=$localize`:â32c52455ed63cc538dc07722eceb1510392ac82câ59512516743773673:Jurisdiction(s) in which plant group is available. 'Global' is the default`,H=$localize`:âb4a54521a02bc2b263e10a8d08ec01438bb8e542â8877687816412324053:Plants`,V=$localize`:âc2693823f8e86c645cec61a0345de1c0bf848119â7138227034430362813:Categories that Plant Group produces`,W=$localize`:âfcde58253a4cfd52c228eebdae74e1be7a1ab714â8104421162933956065:Notes`,x=$localize`:â047f50bc5b5d17b5bec0196355953e1a5c590ddbâ4021752662928002901:Update`,z=$localize`:âd7b35c384aecd25a516200d6921836374613dfe7â2159130950882492111:Cancel`,[["loading",""],["entityName","Plant Group",3,"visible","model","form","canEdit","hide","confirm",4,"ngIf"],[4,"ngIf","ngIfElse"],["entityName","Plant Group",3,"hide","confirm","visible","model","form","canEdit"],[1,"header"],[1,"label"],[1,"text-right","action-btn","action-btn-right"],[3,"entityId",4,"ngIf"],[3,"clickEvent","model"],["class","button button--green button-text button-small","pButton","","type","button","label",o,3,"disabled","click",4,"ngIf"],["pButton","","type","button","label",P,1,"button","button--tertiary","button-right","button-text","button-small",3,"click"],[1,"panel-body",3,"formGroup"],[1,"p-g"],[1,"p-g-12","p-lg-6"],["label",O,"inputId","plantName","formControlName","name",3,"disabled"],["label",S,"formControlName","altNames",3,"addOnBlur","addOnTab","disabled"],["label",U,"inputId","manufacturer","formControlName","ownedBy",3,"changeOrganization","disabled"],["label",C,"tooltip",w,"formControlName","jurisdiction",3,"geographyItemsHierarchy","disabled"],["label",H,3,"addItemEvent","formControl","ownedById","preInitOptions","disabled"],["label",V,3,"control","multiple","disabled"],[1,"p-g-12"],["textareaId","notes","label",W,"formControlName","notes",1,"notes-textarea",3,"disabled"],[1,"epd-list",3,"header","withActionButtons","withFooter","withSearchBox","excludeFieldsToFilter","baseQueryParams","backUrl"],["class","button button--green button-text","pButton","","type","button","label",x,3,"disabled","click",4,"ngIf"],["pButton","","type","button","label",z,1,"button","button--tertiary","button-right","button-text",3,"click"],[3,"entityId"],["pButton","","type","button","label",o,1,"button","button--green","button-text","button-small",3,"click","disabled"],["pButton","","type","button","label",x,1,"button","button--green","button-text",3,"click","disabled"]]},template:function(P,O){if(1&P&&t.DNE(0,et,1,4,"cqd-sanitizer-errors-sidebar",1)(1,st,34,28,"p-panel",2)(2,it,1,0,"ng-template",null,0,t.C5r),2&P){const S=t.sdS(3);t.Y8G("ngIf",O.plantGroup),t.R7$(),t.Y8G("ngIf",O.form)("ngIfElse",S)}},dependencies:[n.bT,E.BC,E.cb,E.l_,E.j4,E.JD,i._f,r.Y9,r.wi,c.Z,M.t,y.S,F.O,K.L,Y.U,J.a,q.v,Q.o,Z.E,k.A,X.f,tt.C,n.Jj],styles:[".notes-textarea[_ngcontent-%COMP%] textarea{width:100%;min-height:100px;resize:vertical}.epd-list[_ngcontent-%COMP%]{width:100%}.header[_ngcontent-%COMP%]{display:flex;align-items:center}.header[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px}.header[_ngcontent-%COMP%] .action-btn-left[_ngcontent-%COMP%]{flex:1;justify-content:flex-start}.header[_ngcontent-%COMP%] .action-btn-right[_ngcontent-%COMP%]{flex:1;justify-content:flex-end}"],changeDetection:0})}}return m})()}];let rt=(()=>{class m{static{this.\u0275fac=function(P){return new(P||m)}}static{this.\u0275mod=t.$C({type:m})}static{this.\u0275inj=t.G2t({imports:[N.iI.forChild(lt),N.iI]})}}return m})();var _t=e(73805);let dt=(()=>{class m{static{this.\u0275fac=function(P){return new(P||m)}}static{this.\u0275mod=t.$C({type:m})}static{this.\u0275inj=t.G2t({imports:[a.G,rt,_t.PlantsModule,X.f]})}}return m})()},43697($,v,e){e.d(v,{i:()=>b});var a=e(54438),N=e(57574),t=e(48726),T=e(62471),f=e(50817),E=e(96354),s=e(88141),R=e(56588),A=e(54255),I=e(68211);let L=(()=>{class g extends t.v{constructor(){super(...arguments),this.rawEntityService=(0,a.WQX)(I.l)}getPlantGroups(_){let d;_&&(d={page_number:_.page||1,page_size:_.pageSize||25,q:_.q,category:_.categoryIds});const u=new T._g(this.apiBaseUrl).withMethod("GET").withParams(d).withUrl("/plant_groups").observe("response");return this.performRequest(u).pipe((0,E.T)(p=>({items:p.body.map(l=>new R.E(l)),pageSize:+p.headers.get(f.b.pageSize),totalCount:+p.headers.get(f.b.totalCount),totalPages:+p.headers.get(f.b.totalPages)})))}getPlantGroupById(_){const d=new T._g(this.apiBaseUrl).withMethod("GET").withUrl(`/plant_groups/${_}`);return this.performRequest(d).pipe((0,s.M)(u=>this.rawEntityService.setRawEntity(u)),(0,E.T)(u=>new R.E(u)))}createPlantGroup(_,d){const u=new T._g(this.apiBaseUrl).withMethod("POST").withBody(_).withUrl(`/orgs/${d}/plant_groups`);return this.performRequest(u).pipe((0,E.T)(p=>new R.E(p)))}updatePlantGroup(_,d){const u=new T._g(this.apiBaseUrl).withMethod("PUT").withBody(d).withUrl(`/plant_groups/${_}`);return this.performRequest(u).pipe((0,E.T)(p=>new R.E(p)))}patchPlantGroup(_,d){const u=new T._g(this.apiBaseUrl).withMethod("PATCH").withBody(d).withUrl(`/plant_groups/${_}`);return this.performRequest(u).pipe((0,E.T)(p=>new R.E(p)))}deletePlantGroup(_){const d=new T._g(this.apiBaseUrl).withMethod("DELETE").withUrl(`/plant_groups/${_}`);return this.performRequest(d)}getPlantGroupPlants(_,d){const u=A.L.getCorrectedParams(d),p=new T._g(this.apiBaseUrl).withMethod("GET").withParams(u).withUrl(`/plant_groups/${_}/plants`).observe("response");return this.performRequest(p).pipe((0,E.T)(l=>({items:l.body.map(h=>new N.t(h)),pageSize:+l.headers.get(f.b.pageSize),totalCount:+l.headers.get(f.b.totalCount),totalPages:+l.headers.get(f.b.totalPages)})))}includePlantToPlantGroup(_,d){const u=new T._g(this.apiBaseUrl).withMethod("PUT").withUrl(`/plant_groups/${d}/include/${_}`);return this.performRequest(u)}excludePlantFromPlantGroup(_,d){const u=new T._g(this.apiBaseUrl).withMethod("PUT").withUrl(`/plant_groups/${d}/exclude/${_}`);return this.performRequest(u)}static{this.\u0275fac=(()=>{let _;return function(u){return(_||(_=a.xGo(g)))(u||g)}})()}static{this.\u0275prov=a.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}}return g})();var B=e(62704);let b=(()=>{class g{constructor(_,d){this.qaService=_,this.plantGroupApiService=d,this.defaultSortingParams={sortBy:"+name"}}getPlantGroups(_){return this.plantGroupApiService.getPlantGroups({...this.defaultSortingParams,..._}).pipe((0,E.T)(d=>({...d,items:d.items.map(u=>(this.qaService.addQaStatusesToModel(u,!1),u))})))}getPlantGroupById(_){return this.plantGroupApiService.getPlantGroupById(_).pipe((0,s.M)(d=>{this.qaService.addQaStatusesToModel(d,!0)}))}createPlantGroup(_,d){return this.plantGroupApiService.createPlantGroup(_,d).pipe((0,s.M)(u=>{this.qaService.addQaStatusesToModel(u,!0)}))}updatePlantGroup(_,d){return this.plantGroupApiService.updatePlantGroup(_,d).pipe((0,s.M)(u=>{this.qaService.addQaStatusesToModel(u,!0)}))}patchPlantGroup(_,d){return this.plantGroupApiService.patchPlantGroup(_,d).pipe((0,s.M)(u=>{this.qaService.addQaStatusesToModel(u,!0)}))}deletePlantGroup(_){return this.plantGroupApiService.deletePlantGroup(_)}getPlantGroupPlants(_,d){return this.plantGroupApiService.getPlantGroupPlants(_,{...this.defaultSortingParams,...d})}includePlantToPlantGroup(_,d){return this.plantGroupApiService.includePlantToPlantGroup(_,d)}excludePlantFromPlantGroup(_,d){return this.plantGroupApiService.excludePlantFromPlantGroup(_,d)}static{this.\u0275fac=function(d){return new(d||g)(a.KVO(B.Q),a.KVO(L))}}static{this.\u0275prov=a.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}}return g})()},98489($,v,e){e.d(v,{X:()=>p});var a=e(94779),N=e(70980),t=e(88141),T=e(80348),f=e(74647),E=e(96890),s=e(54438),R=e(60177),A=e(89417),I=e(81141),L=e(30218),B=e(25573),b=e(86557),g=e(12633),D=e(66913),_=e(64539);const d=(l,h)=>({latitude:l,longitude:h});function u(l,h){if(1&l){const n=s.RV6();s.j41(0,"div",1)(1,"div",2),s.nrm(2,"cqd-form-input",3),s.k0s(),s.j41(3,"div",2),s.nrm(4,"cqd-categories-autocomplete",4),s.k0s(),s.j41(5,"div",2)(6,"cqd-google-address-autocomplete",5),s.bIt("selectAddress",function(r){s.eBV(n);const c=s.XpG();return s.Njj(c.setAddress(r))}),s.k0s()(),s.j41(7,"div",2),s.nrm(8,"cqd-no-longer-valid",6),s.k0s(),s.j41(9,"div",2)(10,"cqd-attachments",7),s.bIt("addAttachment",function(){s.eBV(n);const r=s.XpG();return s.Njj(r.addAttachment())})("removeAttachment",function(r){s.eBV(n);const c=s.XpG();return s.Njj(c.removeAttachment(r))}),s.k0s()(),s.j41(11,"div",8),s.nrm(12,"cqd-google-map",9),s.k0s(),s.j41(13,"div",2)(14,"button",10),s.n
1I1(15,"async"),s.bIt("click",function(){s.eBV(n);const r=s.XpG();return s.Njj(r.onSubmit())}),s.k0s()()()}if(2&l){let n;const i=s.XpG();s.Y8G("formGroup",i.form),s.R7$(4),s.Y8G("control",i.form.get("categories"))("multiple",!0),s.R7$(4),s.Y8G("control",i.form.get("invalidAfter"))("isInvalid",i.form.get("invalidAfter").invalid&&!i.form.get("invalidAfter").pristine),s.R7$(2),s.Y8G("disabled",i.disabled)("attachmentsControl",i.attachmentsForm)("attachmentTypes",i.attachmentTypes),s.R7$(2),s.Y8G("showSelectAddressPlaceholder",!0)("coords",s.l_i(13,d,null!==(n=i.form.value.latitude)&&void 0!==n?n:i.defaultCoords.lat,null!==(n=i.form.value.longitude)&&void 0!==n?n:i.defaultCoords.lng)),s.R7$(2),s.Y8G("disabled",s.bMT(15,11,i.isLocked$))}}let p=(()=>{class l extends T._{constructor(n){super(),this.plantService=n,this.attachmentTypes=E.Cj}submitPlant(n){this.lockComponent(),n.ownedById=this.ownedById,this.plantService.createPlant(n,this.ownedById).pipe((0,t.M)(i=>this.submitEvent.emit(this.convertToPlantOrGroupModel(i))),(0,N.j)(()=>this.unlockComponent())).subscribe()}static{this.\u0275fac=function(i){return new(i||l)(s.rXU(a.h))}}static{this.\u0275cmp=s.VBU({type:l,selectors:[["cqd-plant-create-form"]],features:[s.Jv_([{provide:f.L,useExisting:l}]),s.Vt3],decls:1,vars:1,consts:()=>{let n,i,r,c,M,y;return n=$localize`:âaf16ef11633456bc07fcfaea2aca84a3b209305dâ8531678034789756224:Plant Name *`,i=$localize`:â674f38548633a8a0a03058a3575639b3b7cd24caâ4171312998520693835:Categories that Plant produces`,r=$localize`:âd51c956f5bf90ffdad33402b25d9691f9f5eb579â102768126684297208:Plant Address`,c=$localize`:â2d037c4b490d597b54d7a0c663fa40be3b72744câ8381948470349176609:Plant Links`,M=$localize`:âe97ba61a7fc86b95268547f02b000125c1907aa7â4007961099920574899:Useful web links relevant to this plant, such as certifications, site contact info, and ordering pages. You can choose from the dropdown or type your own brief description.`,y=$localize`:â71c77bb8cecdf11ec3eead24dd1ba506573fa9cdâ935187492052582731:Submit`,[["class","p-g",3,"formGroup",4,"ngIf"],[1,"p-g",3,"formGroup"],[1,"p-g-12"],["label",n,"inputId","plantName","formControlName","name"],["label",i,3,"control","multiple"],["inputId","newPlantAdr","label",r,"formControlName","address",3,"selectAddress"],[3,"control","isInvalid"],["legend",c,"tooltip",M,3,"addAttachment","removeAttachment","disabled","attachmentsControl","attachmentTypes"],[1,"p-g-12","map"],[3,"showSelectAddressPlaceholder","coords"],["pButton","","label",y,1,"button","button--green",3,"click","disabled"]]},template:function(i,r){1&i&&s.DNE(0,u,16,16,"div",0),2&i&&s.Y8G("ngIf",r.form)},dependencies:[R.bT,A.BC,A.cb,A.j4,A.JD,I._f,L.S,B.h,b.a,g.c,D.W,_.D,R.Jj],styles:[".map[_ngcontent-%COMP%]{height:214px}"],changeDetection:0})}}return l})()},56588($,v,e){e.d(v,{E:()=>N});var a=e(20908);class N extends a.y{constructor(T){super(T),T&&(this.jurisdiction=T.jurisdiction,this.plantsCount=T.plantsCount)}getFormattedName(){return`${this.name} (${this.plantsCount||"?"} Plants)`}isSkippedField(T){return!!super.isSkippedField(T)||["plantsCount"].includes(T)}}}}]);
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.