1"use strict";(self.webpackChunkvadimecum=self.webpackChunkvadimecum||[]).push([[7929],{7929:(j,f,c)=>{c.r(f),c.d(f,{default:()=>z});var d=c(4755),a=c(2142),u=c(1728),g=c(9114),p=c(6924),x=c(9609),h=c(7081),m=c(2611),b=c(3844),I=c(7579),v=c(2722),T=c(8372),Z=c(3900),U=c(4004),C=c(1292),_=c(3617),e=c(2223),Q=c(2263),k=c(9776);function J(t,s){1&t&&(e.TgZ(0,"div",16),e._UZ(1,"mat-progress-bar",17),e.qZA()),2&t&&(e.xp6(1),e.Q6J("mode","indeterminate"))}function A(t,s){if(1&t&&(e.ynx(0),e._uU(1),e.BQk()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hij(" ",o.name_es," ")}}function w(t,s){if(1&t&&(e.ynx(0),e._uU(1),e.BQk()),2&t){const o=e.oxw().$implicit;e.xp6(1),e.hij(" ",o.name_en," ")}}function N(t,s){1&t&&(e.ynx(0),e._UZ(1,"mat-icon",30),e.BQk()),2&t&&(e.xp6(1),e.Q6J("svgIcon","heroicons_solid:check"))}function F(t,s){1&t&&(e.ynx(0),e._UZ(1,"mat-icon",31),e.BQk()),2&t&&(e.xp6(1),e.Q6J("svgIcon","heroicons_solid:x-mark"))}function L(t,s){1&t&&e.GkF(0)}const Y=function(t){return{$implicit:t}};function D(t,s){if(1&t&&(e.ynx(0),e.YNc(1,L,1,0,"ng-container",32),e.BQk()),2&t){const o=e.oxw().$implicit;e.oxw(4);const n=e.MAs(17);e.xp6(1),e.Q6J("ngTemplateOutlet",n)("ngTemplateOutletContext",e.VKq(2,Y,o))}}function B(t,s){if(1&t){const o=e.EpF();e.ynx(0),e.TgZ(1,"div",25)(2,"div",26),e.YNc(3,A,2,1,"ng-container",13),e.YNc(4,w,2,1,"ng-container",13),e.qZA(),e.TgZ(5,"div",27),e.YNc(6,N,2,1,"ng-container",13),e.YNc(7,F,2,1,"ng-container",13),e.qZA(),e.TgZ(8,"div")(9,"button",28),e.NdJ("click",function(){const r=e.CHM(o).$implicit,l=e.oxw(4);return e.KtG(l.toggleDetails(r.id))}),e._UZ(10,"mat-icon",29),e.qZA()()(),e.TgZ(11,"div",19),e.YNc(12,D,2,4,"ng-container",13),e.qZA(),e.BQk()}if(2&t){const o=s.$implicit,n=e.oxw(4);e.xp6(3),e.Q6J("ngIf","es"===n.lang),e.xp6(1),e.Q6J("ngIf","en"===n.lang),e.xp6(2),e.Q6J("ngIf",o.active),e.xp6(1),e.Q6J("ngIf",!o.active),e.xp6(3),e.Q6J("svgIcon",(null==n.selectedCategory?null:n.selectedCategory.id)===o.id?"heroicons_solid:chevron-up":"heroicons_solid:chevron-down"),e.xp6(2),e.Q6J("ngIf",(null==n.selectedCategory?null:n.selectedCategory.id)===o.id)}}function M(t,s){if(1&t&&(e.ynx(0),e.YNc(1,B,13,6,"ng-container",24),e.BQk()),2&t){const o=e.oxw(3);e.xp6(1),e.Q6J("ngForOf",o.categories)("ngForTrackBy",o.trackByFn)}}function S(t,s){if(1&t&&(e.ynx(0),e.TgZ(1,"div",19)(2,"div",20)(3,"div",21),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",22),e._uU(6," Active "),e.qZA(),e.TgZ(7,"div",23),e._uU(8,"Details"),e.qZA()(),e.YNc(9,M,2,2,"ng-container",13),e.qZA(),e.BQk()),2&t){const o=e.oxw(2);e.xp6(3),e.Q6J("mat-sort-header","name"),e.xp6(2),e.Q6J("mat-sort-header","active"),e.xp6(4),e.Q6J("ngIf",o.categories)}}function R(t,s){if(1&t&&(e.ynx(0),e.YNc(1,S,10,3,"ng-container",18),e.BQk()),2&t){const o=e.oxw(),n=e.MAs(19);e.xp6(1),e.Q6J("ngIf",o.categories.length>0)("ngIfElse",n)}}function O(t,s){1&t&&(e.ynx(0),e._UZ(1,"mat-icon",53),e.TgZ(2,"span",54),e._uU(3,"category updated"),e.qZA(),e.BQk()),2&t&&(e.xp6(1),e.Q6J("svgIcon","heroicons_outline:check"))}function G(t,s){1&t&&(e.ynx(0),e._UZ(1,"mat-icon",55),e.TgZ(2,"span",54),e._uU(3,"An error occurred, try again!"),e.qZA(),e.BQk()),2&t&&(e.xp6(1),e.Q6J("svgIcon","heroicons_outline:x-mark"))}function q(t,s){if(1&t&&(e.TgZ(0,"div",52),e.YNc(1,O,4,1,"ng-container",13),e.YNc(2,G,4,1,"ng-container",13),e.qZA()),2&t){const o=e.oxw(2);e.xp6(1),e.Q6J("ngIf","success"===o.flashMessage),e.xp6(1),e.Q6J("ngIf","error"===o.flashMessage)}}function E(t,s){if(1&t){const o=e.EpF();e.TgZ(0,"div",33)(1,"div",34)(2,"form",35)(3,"div",36)(4,"div",37)(5,"div",38)(6,"div",39)(7,"mat-tab-group",40),e.NdJ("selectedTabChange",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.updateForm())}),e.TgZ(8,"mat-tab",41)(9,"div",42)(10,"mat-form-field",43)(11,"mat-label"),e._uU(12,"Nombre"),e.qZA(),e._UZ(13,"input",44),e.qZA()()(),e.TgZ(14,"mat-tab",45)(15,"div",42)(16,"mat-form-field",43)(17,"mat-label"),e._uU(18,"Nombre"),e.qZA(),e._UZ(19,"input",44),e.qZA()()()()(),e.TgZ(20,"mat-checkbox",46),e._uU(21," Activa "),e.qZA()()()(),e.TgZ(22,"div",47)(23,"button",48),e.NdJ("click",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.deleteselectedCategory())}),e._uU(24," Delete "),e.qZA(),e.TgZ(25,"div",49),e.YNc(26,q,3,2,"div",50),e.TgZ(27,"button",51),e.NdJ("click",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.updateselectedHierarchy())}),e._uU(28," Update "),e.qZA()()()()()()}if(2&t){const o=e.oxw();e.xp6(2),e.Q6J("formGroup",o.selectedCategoryForm),e.xp6(11),e.Q6J("formControlName","name_es"),e.xp6(6),e.Q6J("formControlName","name_en"),e.xp6(1),e.Q6J("formControlName","active")("color","primary")("disableRipple",!0),e.xp6(3),e.Q6J("color","warn"),e.xp6(3),e.Q6J("ngIf",o.flashMessage),e.xp6(1),e.Q6J("color","primary")}}function H(t,s){1&t&&(e.TgZ(0,"div",56),e._uU(1,"No hay categorias "),e.qZA())}let y=(()=>{const s=class{constructor(n,i,r,l){this._changeDetectorRef=n,this._fuseConfirmationService=i,this._formBuilder=r,this._categoriesService=l,this.flashMessage=null,this.isLoading=!1,this.searchInputControl=new a.p4,this.selectedCategory=null,this._unsubscribeAll=new I.x,this.lang="es"}ngOnInit(){this.selectedCategoryForm=this._formBuilder.group({id:[""],name_es:["",[a.kI.required]],name_en:["",[a.kI.required]],active:[!0]}),this._categoriesService.intendedUses$.pipe((0,v.R)(this._unsubscribeAll)).subscribe(n=>{this.categories=n,this._changeDetectorRef.markForCheck()}),this.searchInputControl.valueChanges.pipe((0,v.R)(this._unsubscribeAll),(0,T.b)(300),(0,Z.w)(n=>(this.closeDetails(),this.isLoading=!0,null)),(0,U.U)(()=>{this.isLoading=!1})).subscribe()}ngOnDestroy(){this._unsubscribeAll.next(null),this._unsubscribeAll.complete()}toggleDetails(n){this.selectedCategory&&this.selectedCategory.id===n?this.closeDetails():this._categoriesService.getCategoryById(n).subscribe(i=>{console.log(i),this.selectedCategory=i,this.selectedCategoryForm.patchValue(i),this._changeDetectorRef.markForCheck()})}closeDetails(){this.selectedCategory=null}createCategory(){this._categoriesService.createEmptyCategory().subscribe(n=>{this.selectedCategory=n,this.selectedCategoryForm.patchValue(n),this._changeDetectorRef.markForCheck()})}updateselectedHierarchy(){const n=this.selectedCategoryForm.getRawValue();this._categoriesService.setCategory(n).subscribe(()=>
1{this.showFlashMessage("success")})}deleteselectedCategory(){this._fuseConfirmationService.open({title:"Delete product",message:"Are you sure you want to remove this product? This action cannot be undone!",actions:{confirm:{label:"Delete"}}}).afterClosed().subscribe(i=>{if("confirmed"===i){const r=this.selectedCategoryForm.getRawValue();this._categoriesService.deleteCategory(r.id).subscribe(()=>{this.closeDetails()})}})}showFlashMessage(n){this.flashMessage=n,this._changeDetectorRef.markForCheck(),setTimeout(()=>{this.flashMessage=null,this._changeDetectorRef.markForCheck()},3e3)}trackByFn(n,i){return i.id||n}updateForm(){this.selectedCategoryForm.setValue(this.selectedCategoryForm.getRawValue())}};let t=s;return s.\u0275fac=function(i){return new(i||s)(e.Y36(e.sBO),e.Y36(Q.R),e.Y36(a.QS),e.Y36(k.X))},s.\u0275cmp=e.Xpm({type:s,selectors:[["intended-use-list"]],viewQuery:function(i,r){if(1&i&&e.Gf(m.YE,5),2&i){let l;e.iGM(l=e.CRH())&&(r._sort=l.first)}},standalone:!0,features:[e.jDz],decls:20,vars:9,consts:[[1,"sm:absolute","sm:inset-0","flex","flex-col","flex-auto","min-w-0","sm:overflow-hidden","bg-card","dark:bg-transparent"],[1,"relative","flex","flex-col","sm:flex-row","flex-0","sm:items-center","sm:justify-between","py-8","px-6","md:px-8","border-b"],["class","absolute inset-x-0 bottom-0",4,"ngIf"],[1,"text-4xl","font-extrabold","tracking-tight"],[1,"flex","shrink-0","items-center","mt-6","sm:mt-0","sm:ml-4"],[1,"fuse-mat-dense","fuse-mat-rounded","min-w-64",3,"subscriptSizing"],["matPrefix","",1,"icon-size-5",3,"svgIcon"],["matInput","",3,"formControl","autocomplete","placeholder"],["mat-flat-button","",1,"ml-4",3,"color","click"],[3,"svgIcon"],[1,"ml-2","mr-1"],[1,"flex","flex-auto","overflow-hidden"],[1,"flex","flex-col","flex-auto","sm:mb-18","overflow-hidden","sm:overflow-y-auto"],[4,"ngIf"],["rowDetailsTemplate",""],["nocategories",""],[1,"absolute","inset-x-0","bottom-0"],[3,"mode"],[4,"ngIf","ngIfElse"],[1,"grid"],["matSort","","matSortDisableClear","",1,"inventory-grid","z-10","sticky","top-0","grid","gap-4","py-4","px-6","md:px-8","shadow","text-md","font-semibold","text-secondary","bg-gray-50","dark:bg-black","dark:bg-opacity-5"],[3,"mat-sort-header"],[1,"hidden","lg:block",3,"mat-sort-header"],[1,"hidden","sm:block"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"inventory-grid","grid","items-center","gap-4","py-3","px-6","md:px-8","border-b"],[1,"flex-grow"],[1,"hidden","lg:block"],["mat-stroked-button","",1,"min-w-10","min-h-7","h-7","px-2","leading-6",3,"click"],[1,"icon-size-5",3,"svgIcon"],[1,"text-green-400","icon-size-5",3,"svgIcon"],[1,"text-gray-400","icon-size-5",3,"svgIcon"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"shadow-lg","overflow-hidden"],[1,"flex","border-b"],[1,"flex","flex-col","w-full",3,"formGroup"],[1,"flex","flex-col","sm:flex-row","p-4"],[1,"flex","flex-auto","flex-wrap"],[1,"flex","flex-col","w-full"],[1,"flex","w-full"],[1,"w-full",3,"selectedTabChange"],["label","Espa\xf1ol"],[1,"flex","flex-col","md:flex-row"],[1,"w-full"],["matInput","",3,"formControlName"],["label","Ingles"],[3,"formControlName","color","disableRipple"],[1,"flex","items-center","justify-between","w-full","border-t","px-8","py-4"],["mat-button","",1,"-ml-4",3,"color","click"],[1,"flex","items-center"],["class","flex items-center mr-4",4,"ngIf"],["mat-flat-button","",3,"color","click"],[1,"flex","items-center","mr-4"],[1,"text-green-500",3,"svgIcon"],[1,"ml-2"],[1,"text-red-500",3,"svgIcon"],[1,"p-8","sm:p-16","border-t","text-4xl","font-semibold","tracking-tight","text-center"]],template:function(i,r){1&i&&(e.TgZ(0,"div",0)(1,"div",1),e.YNc(2,J,2,1,"div",2),e.TgZ(3,"div",3),e._uU(4,"Uso previsto"),e.qZA(),e.TgZ(5,"div",4)(6,"mat-form-field",5),e._UZ(7,"mat-icon",6)(8,"input",7),e.qZA(),e.TgZ(9,"button",8),e.NdJ("click",function(){return r.createCategory()}),e._UZ(10,"mat-icon",9),e.TgZ(11,"span",10),e._uU(12,"A\xf1adir"),e.qZA()()()(),e.TgZ(13,"div",11)(14,"div",12),e.YNc(15,R,2,2,"ng-container",13),e.YNc(16,E,29,9,"ng-template",null,14,e.W1O),e.YNc(18,H,2,0,"ng-template",null,15,e.W1O),e.qZA()()()),2&i&&(e.xp6(2),e.Q6J("ngIf",r.isLoading),e.xp6(4),e.Q6J("subscriptSizing","dynamic"),e.xp6(1),e.Q6J("svgIcon","heroicons_solid:magnifying-glass"),e.xp6(1),e.Q6J("formControl",r.searchInputControl)("autocomplete","off")("placeholder","Search categories"),e.xp6(1),e.Q6J("color","primary"),e.xp6(1),e.Q6J("svgIcon","heroicons_outline:plus"),e.xp6(5),e.Q6J("ngIf",r.categories))},dependencies:[d.O5,h.Cv,h.pW,g.lN,g.KE,g.hX,g.qo,p.Ps,p.Hw,x.c,x.Nt,a.u5,a._Y,a.Fj,a.JJ,a.JL,a.UX,a.oH,a.sg,a.u,u.ot,u.lW,m.JX,m.YE,m.nU,d.ax,d.tP,C.p9,C.oG,_.Nh,_.uX,_.SP],encapsulation:2,data:{animation:b.L},changeDetection:0}),t})();const z=[{path:"",component:y,children:[{path:"",component:y,resolve:{}}]}]}}]);
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.