1"use strict";(self.webpackChunkecopp=self.webpackChunkecopp||[]).push([[878],{2878:(ot,w,n)=>{n.r(w),n.d(w,{LibraryModule:()=>et});var g=n(6895),m=n(4364),t=n(4650),I=n(9145),l=n(4006),d=n(5938),Z=n(3841),M=n(5349),S=n(7463),E=n(690),D=n(9576),u=n(3848),f=n(7392),C=n(2673),p=n(811),h=n(8255),x=n(6709),A=n(9906),y=n(4859),_=n(9549),F=n(284),T=n(4385),N=n(3238);const L=["menuTrigger"];function k(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"li",11)(1,"span",12),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.getFiles(i.softwareId,i.upPath[i.softwareId],null))}),t._uU(2,"Library"),t.qZA()()}}function J(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"li",11)(1,"button",13),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.getFiles(i.softwareId,i.upPath[i.softwareId],null))}),t.TgZ(2,"span"),t._uU(3,"Prev level"),t.qZA()()()}}function U(a,r){if(1&a&&(t.TgZ(0,"li")(1,"span",14),t._uU(2),t.qZA()()),2&a){const e=t.oxw(2);t.xp6(2),t.Oqu(e.path[e.softwareId])}}function O(a,r){if(1&a&&(t.TgZ(0,"div",6)(1,"div",7)(2,"ol",8),t.YNc(3,k,3,0,"li",9),t.YNc(4,J,4,0,"li",9),t.YNc(5,U,3,1,"li",10),t.qZA()()()),2&a){const e=t.oxw();
1t.xp6(3),t.Q6J("ngIf",e.isRoot),t.xp6(1),t.Q6J("ngIf",e.path[e.softwareId]&&!e.isRoot),t.xp6(1),t.Q6J("ngIf",e.path[e.softwareId]&&!e.isRoot)}}function Y(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"div",32)(1,"mat-checkbox",33),t.NdJ("ngModelChange",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.viewDraft=i)})("change",function(i){t.CHM(e);const s=t.oxw(2);return t.KtG(s.reloadFiles(i))}),t._uU(2,"View draft"),t.qZA()()}if(2&a){const e=t.oxw(2);t.xp6(1),t.Q6J("ngModel",e.viewDraft)}}function H(a,r){if(1&a&&(t.TgZ(0,"button",34)(1,"span",14),t._uU(2,"Add"),t.qZA(),t._UZ(3,"mat-icon",35),t.qZA()),2&a){t.oxw();const e=t.MAs(28);t.Q6J("matMenuTriggerFor",e)}}function R(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"div",36),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.getFiles(i.softwareId,i.upPath[i.softwareId],null))}),t.TgZ(1,"div",37)(2,"mat-icon",38),t._uU(3,"drive_folder_upload"),t.qZA(),t.TgZ(4,"div",39)(5,"div",40),t._uU(6," .. one level up "),t.qZA()()()()}}const P=function(a){return[a]},G=function(a,r,e,o){return{software_id:a,parent_id:r,software_name:e,folder_name:o}};function Q(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"mat-tab",15)(1,"div",16)(2,"div",17)(3,"mat-button-toggle-group",18)(4,"ul",19)(5,"li",20)(6,"mat-button-toggle",21),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.orderBy("NAME"))}),t._uU(7," Name "),t.TgZ(8,"mat-icon"),t._uU(9,"import_export"),t.qZA()()(),t.TgZ(10,"li",20)(11,"mat-button-toggle",21),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.orderBy("CREATED_AT"))}),t._uU(12," Creation date "),t.TgZ(13,"mat-icon"),t._uU(14,"import_export"),t.qZA()()(),t.TgZ(15,"li",20)(16,"mat-button-toggle",21),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.orderBy("TYPE_ID"))}),t._uU(17," File type "),t.TgZ(18,"mat-icon"),t._uU(19,"import_export"),t.qZA()()(),t.TgZ(20,"li",20)(21,"mat-button-toggle",21),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.orderBy("STATUS_ID"))}),t._uU(22," Status "),t.TgZ(23,"mat-icon"),t._uU(24,"import_export"),t.qZA()()()()(),t.YNc(25,Y,3,1,"div",22),t.YNc(26,H,4,1,"button",23),t.TgZ(27,"mat-menu",null,24)(29,"button",25),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.openDialog())}),t.TgZ(30,"mat-icon",26),t._uU(31,"create_new_folder"),t.qZA(),t.TgZ(32,"span"),t._uU(33,"New folder"),t.qZA()(),t.TgZ(34,"button",27)(35,"mat-icon",26),t._uU(36,"file_upload"),t.qZA(),t.TgZ(37,"span"),t._uU(38,"File upload"),t.qZA()()(),t.TgZ(39,"button",28)(40,"span",14),t._uU(41,"Send ecoPack"),t.qZA(),t._UZ(42,"mat-icon",29),t.qZA()(),t.YNc(43,R,7,0,"div",30),t.TgZ(44,"app-container-cards",31),t.NdJ("openFolderEvent",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.openFolder(i))})("reloadEvent",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.reloadEvent(i))})("scrolled",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onScroll())})("getFilesEvent",function(i){t.CHM(e);const s=t.oxw();return t.KtG(s.getFilesEvent(i))}),t.qZA()()()}if(2&a){const e=r.$implicit,o=t.oxw();t.s9C("label",e.name),t.s9C("aria-label",e.id),t.xp6(25),t.Q6J("ngIf",o.isAdmin),t.xp6(1),t.Q6J("ngIf",o.isAdmin&&e.id),t.xp6(8),t.Q6J("queryParams",t.l5B(19,G,t.VKq(15,P,e.id),o.pathId[e.id],t.VKq(17,P,e.name),o.path[e.id])),t.xp6(5),t.s9C("matBadge",o.ecopackService.currentEcopackFilesNumber),t.xp6(4),t.Q6J("ngIf",!o.isRoot[o.softwareId]),t.xp6(1),t.Q6J("softwareId",e.id)("dataFiles",o.dataFiles[e.id])("isDirectory",o.isDirectory[e.id])("path",o.path[e.id])("upPath",o.upPath[e.id])("currentEcopack",o.currentEcopack)("hasData",o.hasData)("isLoading",o.isLoading)}}function B(a,r){if(1&a&&(t.TgZ(0,"mat-option",15),t._uU(1),t.qZA()),2&a){const e=r.$implicit;t.Q6J("value",e.id),t.xp6(1),t.Oqu(e.name)}}function K(a,r){1&a&&(t.TgZ(0,"mat-error"),t._uU(1," Category is "),t.TgZ(2,"strong"),t._uU(3,"required"),t.qZA()())}let q=(()=>{class a{constructor(e,o,i,s,b,v){this.softwareService=e,this.fileService=o,this.ecopackService=i,this.dialog=s,this.commonService=b,this.usersService=v,this.dataFiles=[],this.softwares=[],this.isDirectory=[],this.pathId=[],this.path=[],this.upPath=[],this.isLoading=!0,this.isRoot=[],this.emptyFolder=!1,this.isAdmin=!0,this.viewDraft=!1,this.orderCol="id",this.orderSort="DESC",this.finishPage=[],this.actualPage=[],this.currentEcopack=null,this.hasData=!1,this.defIsAdmin()}defIsAdmin(){this.isAdmin=this.usersService.getProfileId()<=3}openDialog(){console.log("openDialog parent_id"+this.pathId[this.softwareId]),this.dialog.open(z,{width:"50%",maxWidth:"400px",restoreFocus:!1,data:{software_id:this.softwareId}}).componentInstance.addEvent.subscribe(o=>{console.log("crear carpeta llamada:"+o.folderName+" parent:"+this.pathId[this.softwareId]),this.fileService.createFolder(o.folderName,o.index_id,this.pathId[this.softwareId]).subscribe(i=>{this.commonService.msgSuccess("Folder created successfully"),this.dataFiles[this.softwareId]=[],this.getFiles(this.softwareId,this.pathId[this.softwareId],null,this.orderCol,this.orderSort,this.viewDraft)},i=>{this.commonService.msgError("Error when creating the folder")})})}ngOnInit(){console.log("get software list on init"),this.softwareService.get().subscribe(e=>
1{console.log("softwareService.get()"),console.log(e),this.softwares.push({id:0,name:"All",state_id:1,created_at:"",updated_at:"",icon:""}),this.softwares.push(...e.data),this.softwares.forEach(i=>{this.dataFiles[i.id]=[],this.actualPage[i.id]=1,this.finishPage[i.id]=3,this.isRoot[i.id]=!1,this.isDirectory[i.id]=!1,this.path[i.id]="",this.pathId[i.id]=null,this.upPath[i.id]=null}),console.log(this.softwares)},e=>{this.commonService.msgError("Error: Your account is not associated with a partner. Please contact your system administrator")})}tabClick(e){null!=e&&null!=e.tab.ariaLabel?(console.log("softwareId :"+e.tab.ariaLabel),this.softwareId=e.tab.ariaLabel):this.softwareId=0,this.browsers.forEach(i=>i.setScrollDisabled(!0)),this.browsers.find(i=>i.softwareId==this.softwareId).setScrollDisabled(!1),0==this.dataFiles[this.softwareId].length?(console.log("sin archivos en la lista => call getFiles"),this.getFiles(this.softwareId,null,null,this.orderCol,this.orderSort,this.viewDraft)):console.log("archivos en la lista => no cargo de nuevo"),1==this.actualPage[this.softwareId]&&null==this.currentEcopack&&this.getCurrentEcopack()}getFilesEvent(e){console.log("getFilesEvent"),console.log(e),this.getFiles(e.software_id,e.parent_id,e.page,this.orderCol,this.orderSort,this.viewDraft)}reloadEvent(e){this.reloadFiles(null)}reloadFiles(e){this.getFiles(this.softwareId,this.fileId,0,this.orderCol,this.orderSort,this.viewDraft),this.dataFiles[0]=[]}getFiles(e,o,i,s=null,b=null,v=!1){this.softwareId=e,this.fileId=o,0==e&&(e=null),this.isLoading=!0,i>1||(this.dataFiles[this.softwareId]=[]),this.fileService.getFiles(e,o,i,s,b,null,null,v).subscribe(c=>{console.log("fileService.getFiles()"),console.log(c),c.data&&c.data[0]&&("0"==c.data[0].id||1!=i&&null!=i?(console.log("Not is a Directory"),1==this.isDirectory[this.softwareId]&&(this.dataFiles[this.softwareId]=[]),console.log("Root"),this.isRoot[this.softwareId]=!0,this.pathId[this.softwareId]=null,this.isDirectory[this.softwareId]=!1,this.upPath[this.softwareId]=null,this.path[this.softwareId]=""):(console.log("Directory"),this.isRoot[this.softwareId]=!1,this.isDirectory[this.softwareId]=!0,this.pathId[this.softwareId]=c.data[0].id,this.upPath[this.softwareId]=c.data[0].parent_file_id,this.path[this.softwareId]=c.data[0].name,this.dataFiles[this.softwareId]=[]),null!=o&&(console.log("parent_id is null => is NOT Root directory"),this.isRoot[this.softwareId]=!1)),console.log("Data GET FILES"),console.log(c.data),i>1?(console.log("Agrego al array de archivos"),this.dataFiles[this.softwareId].push(...c.data)):(console.log("cargando pagina en blanco"),console.log(this.softwareId),console.log(this.dataFiles[this.softwareId]),this.dataFiles[this.softwareId]=[],this.dataFiles[this.softwareId].push(...c.data.slice(1)),this.actualPage[this.softwareId]=1),this.hasData=this.dataFiles[this.softwareId].length<1,this.finishPage[this.softwareId]=c.meta.last_page,console.log("this.finishPage"+this.finishPage[this.softwareId]),c
1onsole.log("this.actualPage"+this.actualPage[this.softwareId])},c=>{},()=>{console.log("getFiles complete"),this.isLoading=!1})}orderBy(e){this.orderCol==e&&"DESC"==this.orderSort?this.orderSort="ASC":this.orderCol==e&&"ASC"==this.orderSort?this.orderSort="DESC":(this.orderSort="DESC",this.orderCol=e),this.dataFiles[this.softwareId]=[],this.getFiles(this.softwareId,this.fileId,null,this.orderCol,this.orderSort,this.viewDraft)}openFolder(e){console.log("ContainerCardsComponent.open"),console.log(e),console.log("softwareId"),console.log(this.softwareId),this.fileId=e.id,this.getFiles(this.softwareId,this.fileId,null,this.orderCol,this.orderSort,this.viewDraft)}onScroll(){this.actualPage[this.softwareId]<this.finishPage[this.softwareId]?(this.actualPage[this.softwareId]++,this.getFiles(this.softwareId,this.fileId,this.actualPage[this.softwareId],this.orderCol,this.orderSort,this.viewDraft)):console.log("No more lines. Finish page!")}getCurrentEcopack(){this.ecopackService.getCurrentEcopack().subscribe(e=>{console.log("Current ecopack"),console.log(e),this.currentEcopack=e.data.id},e=>{console.log("Error, current ecopack not found !!!!!")})}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(Z.Y),t.Y36(M.I),t.Y36(S.D),t.Y36(d.uw),t.Y36(E.v),t.Y36(D.f))},a.\u0275cmp=t.Xpm({type:a,selectors:[["app-library-page"]],viewQuery:function(e,o){if(1&e&&(t.Gf(L,5),t.Gf(I.C,5)),2&e){let i;t.iGM(i=t.CRH())&&(o.menuTrigger=i.first),t.iGM(i=t.CRH())&&(o.browsers=i)}},inputs:{hasData:"hasData"},decls:6,vars:3,consts:[["class","headline library",4,"ngIf"],["mat-align-tabs","start",3,"selectedTabChange"],[3,"label","aria-label",4,"ngFor","ngForOf"],[1,"md:hidden","simple-float-button","simple-float-button__lg","bg-white","fixed","right-9","bottom-20","z-10"],["routerLink","/ecofolder/create-ecopack","matBadgeColor","warn","matBadgeSize","large",1,"h-full","w-full","relative",3,"matBadge"],["svgIcon","package-send",1,"xl2-icon","my-1"],[1,"headline","library"],[1,"lib-breadcrumbs"],[1,"breadcrumbs__container"],["class","breadcrumbs__item breadcrumbs__item--active",4,"ngIf"],[4,"ngIf"],[1,"breadcrumbs__item","breadcrumbs__item--active"],[1,"",3,"click"],[3,"click"],[1,""],[3,"label","aria-label"],[1,"container-fluid","p-2","py-6","lg:p-6"],[1,"flex","mb-4"],["name","order","aria-label","Recent activity",1,"flex","w-full"],[1,"flex","w-full"],[1,"flex"],["value","name",1,"transparent",3,"click"],["class","hidden md:flex items-center mr-2 ml-2",4,"ngIf"],["class","hidden md:flex btn-outline btn-outline-accent mr-4",3,"matMenuTriggerFor",4,"ngIf"],["menu","matMenu"],["mat-menu-item","",3,"click"],["color","accent",1,"material-icons-outlined"],["mat-menu-item","","routerLink","/files/upload",3,"queryParams"],["routerLink","/ecofolder/create-ecopack","matBadgeColor","warn","matBadgeSize","medium",1,"hidden","md:flex","btn-outline","btn-outline-accent","relative",3,"matBadge"],["svgIcon","package-send",1,"xl-icon","ml-1"],["class","card flex justify-between text-xl mb-2",3,"click",4,"ngIf"],[3,"softwareId","dataFiles","isDirectory","path","upPath","currentEcopack","hasData","isLoading","openFolderEvent","reloadEvent","scrolled","getFilesEvent"],[1,"hidden","md:flex","items-center","mr-2","ml-2"],[3,"ngModel","ngModelChange","change"],[1,"hidden","md:flex","btn-outline","btn-outline-accent","mr-4",3,"matMenuTriggerFor"],["svgIcon","plus",1,"md-icon","ml-1"],[1,"card","flex","justify-between","text-xl","mb-2",3,"click"],[1,"flex","items-center","cursor-pointer"],["color","primary",1,"xl-icon"],[1,"flex-1","px-2","lg:px-3"],[1,"text-sm","font-normal"]],template:function(e,o){1&e&&(t.YNc(0,O,6,3,"div",0),t.TgZ(1,"mat-tab-group",1),t.NdJ("selectedTabChange",function(s){return o.tabClick(s)}),t.YNc(2,Q,45,24,"mat-tab",2),t.qZA(),t.TgZ(3,"div",3)(4,"button",4),t._UZ(5,"mat-icon",5),t.qZA()()),2&e&&(t.Q6J("ngIf",o.isDirectory),t.xp6(2),t.Q6J("ngForOf",o.softwares),t.xp6(2),t.s9C("matBadge",o.ecopackService.currentEcopackFilesNumber))},dependencies:[g.sg,g.O5,m.rH,I.C,u.SP,u.uX,f.Hw,C.k,p.A9,p.Yi,h.VK,h.OP,h.p6,l.JJ,l.On,x.oG],styles:['.sticky[_ngcontent-%COMP%]{position:fixed;top:0;left:0;z-index:9999;width:100%;background:#f2f2f2;border:blue solid}
1.headline.library[_ngcontent-%COMP%] .breadcrumbs__container[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:first-child .mat-icon[_ngcontent-%COMP%]{vertical-align:middle}.headline.library[_ngcontent-%COMP%] .breadcrumbs__container[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:first-child):before{content:"\\e2ea";font-family:Material Icons;font-size:1;pointer-events:none;padding-left:.5rem;padding-right:.5rem}@media (min-width: 1024px){.headline.library[_ngcontent-%COMP%] .breadcrumbs__container[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:not(:first-child):before{padding-left:.75rem;padding-right:.75rem}}']}),a})(),z=(()=>{class a{constructor(e,o){this.indexService=e,this.software_id=0,this.folderName="",this.addEvent=new t.vpe,this.indices=[],this.selectCategory=new l.NI("valid",[l.kI.required,l.kI.pattern("valid")]),this.matcher=new j,this.software_id=o.software_id,this.getIndex(this.software_id)}getIndex(e){console.log("software_id:"+e),this.indexService.get(e).subscribe(o=>{console.log("indexService.get"),console.log(o),this.indices=o.data},o=>{console.log(o)})}submit(e,o){this.addEvent.emit({folderName:e,index_id:o})}}return a.\u0275fac=function(e){return new(e||a)(t.Y36(A.x),t.Y36(d.WI))},a.\u0275cmp=t.Xpm({type:a,selectors:[["dialog-new-folder"]],inputs:{software_id:"software_id"},outputs:{addEvent:"addEvent"},decls:23,vars:7,consts:[["mat-dialog-title",""],[1,"flex","items-center","justify-between"],[1,"flex","align-middle"],[1,"ml-1","lg:inline-block"],["mat-icon-button","",1,"close-button","self-end",3,"mat-dialog-close"],["color","accent",1,"close-icon"],["action",""],["mat-dialog-content",""],["appearance","standard",1,"w-full"],["name","selectIndex",3,"ngModel","formControl","errorStateMatcher","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["type","text","matInput","","placeholder","New folder","name","folderName",3,"ngModel","ngModelChange"],["mat-dialog-actions","","align","center"],["mat-raised-button","","mat-dialog-close","","color","primary",1,"w-full","md:max-w-lg",3,"click"],[3,"value"]],template:function(e,o){1&e&&(t.TgZ(0,"header",0)(1,"div",1)(2,"div",2)(3,"p",3),t._uU(4,"New folder"),t.qZA()(),t.TgZ(5,"button",4)(6,"mat-icon",5),t._uU(7,"close"),t.qZA()()()(),t.TgZ(8,"form",6)(9,"div",7)(10,"mat-form-field",8)(11,"mat-label"),t._uU(12,"Category"),t.qZA(),t.TgZ(13,"mat-select",9),t.NdJ("ngModelChange",function(s){return o.selectIndex=s}),t.YNc(14,B,2,2,"mat-option",10),t.qZA(),t.YNc(15,K,4,0,"mat-error",11),t.qZA()(),t.TgZ(16,"div",7)(17,"mat-form-field",8),t._UZ(18,"mat-label"),t.TgZ(19,"input",12),t.NdJ("ngModelChange",function(s){return o.folderName=s}),t.qZA()()(),t.TgZ(20,"div",13)(21,"button",14),t.NdJ("click",function(){return o.submit(o.folderName,o.selectIndex)}),t._uU(22,"Add"),t.qZA()()()),2&e&&(t.xp6(5),t.Q6J("mat-dialog-close",!0),t.xp6(8),t.Q6J("ngModel",o.selectIndex)("formControl",o.selectCategory)("errorStateMatcher",o.matcher),t.xp6(1),t.Q6J("ngForOf",o.indices),t.xp6(1),t.Q6J("ngIf",o.selectCategory.hasError("required")),t.xp6(4),t.Q6J("ngModel",o.folderName))},dependencies:[g.sg,g.O5,f.Hw,d.ZT,d.uh,d.xY,d.H8,y.lW,_.TO,_.KE,_.hX,F.Nt,l._Y,l.Fj,l.JJ,l.JL,l.On,l.F,l.oH,T.gD,N.ey],encapsulation:2}),a})();class j{isErrorState(r,e){return!!(r&&r.invalid&&(r.dirty||r.touched||e&&e.submitted))}}const V=[{path:"",component:q}];let X=(()=>{class a{}return a.\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({imports:[m.Bz.forChild(V),m.Bz]}),a})();var W=n(4466),$=n(7296),tt=n(1572);let et=(()=>{class a{}return a.\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({imports:[g.ez,X,W.m,u.Nh,f.Ps,C.g,p.vV,tt.Cq,h.Tx,d.Is,y.ot,F.c,l.u5,l.UX,$.Rq,T.LD,x.p9]}),a})()}}]);
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.