1import{o as oe,S as S$2,T as T$2,n as ne$2}from'./chunk-BNbUxUps.js';import{m as m$2}from'./chunk-CwwXKchK.js';import{c as c$2}from'./chunk-CdZzckfE.js';import{R,Z as Z$2,C as C$2}from'./chunk-KzuZr7hA.js';import{g as g$1,a as ae,L as Lr$1}from'./chunk-5PvUkeji.js';import{m as fd,R as Rm,n as w$1,o as h,q as T,$,s as C$1,S,B as Be,t as q,u as b,v as se$1,z,I,W,P,x as ne,O,D as te,_ as _$1,L,k,G as Gm,E as R$1,H as Se}from'./chunk-B6CkFnwP.js';import{u}from'./chunk-BTB0xjK1.js';import{x as x$1,H as He,O as Oe,Q as Qe}from'./chunk-nCwQrYEN.js';import{u as ub,g8 as yB,Z,j as jb,V as Vb,P as Pm,aN as VT,a0 as Om,dk as mm,dl as wa$1,cg as ar$1,ae as y,N,o as ee,dG as Xo,dH as wm,f as x,w,dI as Dr$1,dJ as Vt,cF as yn$1,bC as Ju,l as le,bU as Hs,bB as js,bT as ed,en as me,s as se,m as Z$1,a6 as Xu,fy as de,h as hd,cM as Ve,ez as bu,ey as n1,d as dd,jJ as Pe,i0 as Ys,fO as ev,hf as bo,fd as Au,c9 as U,fR as yo,fi as c1,g as Zy,aZ as Ce,gt as r1,cW as nt,n as nr$1,a5 as oe$1,a4 as l,dm as Yu,cG as ao,D as rs,G as tu,aB as bm,bw as jC,L as rg,b3 as zT,R as KI,bL as HC,e$ as NC,f0 as N$1,fa as ti$1,an as mg,ap as ag,aq as qT,ar as WT,eA as h$1,dZ as Ji,jK as Ly,iC as zy,cE as Ft,$ as $e,O as O$1,aT as at,ab as dt,a_ as jt,t as Nt,v as Vt$1,a8 as wt,ac as c,af as u$1,cH as ui$1,b1 as ou,I as PT,b2 as iu,gP as E,fY as _r,S as St,cI as zt,M,cJ as eg,cK as tg,cN as eu,aE as ng,aF as FT,aG as jT,gx as m,gy as P$1,jL as N$2,gu as w$2,gv as S$1,hx as ve,bA as H,aO as Zb,E as vC,aY as su,bR as P$2,b8 as q$1,fH as T$1,bS as ve$1,fG as o,gg as a,jM as g$2,jN as c$1,jO as s,er as EE,d6 as U$1,c1 as ne$1,B as Ue$1,d4 as _t$1,d5 as Oi,cx as Ct,cz as _o,cA as ts,bX as Zn$1,bY as Xe,fq as un,bd as Wn$1,bZ as qn$1,b_ as Cn,b$ as _n$1,q as P$3,r as p,K as Dw,je as Ng,az as $b,bz as Bb,a1 as bw,jg as Sg,bx as BC,aA as Ub,df as hb,_ as _$2,bF as Fr$1,a3 as m$1,gB as Ee,Y as Ye,x as xt,jP as xC,aP as tf,aQ as nf,dj as $C,dK as Cr$1,hP as ha$1,F,c2 as Mn,bG as Mt,e as ee$1,jf as IC,b as xt$1,aD as u$2,cs as Ut,ct as Q,T as Cg,bH as ah}from'./main-YGWG5KR2.js';function C(n,i){if(n&1&&Pm(0,"mat-spinner",0),n&2){let e=VT();Om("diameter",e.size);}}function g(n,i){if(n&1&&Pm(0,"mat-spinner",1),n&2){let e=VT();Om("diameter",e.size);}}var _=class n{constructor(){this.size=32;this.color="primary";}static{this.ɵfac=function(e){return new(e||n)();};}static{this.ɵcmp=ub({type:n,selectors:[["app-loading-icon"]],inputs:{size:[2,"size","size",yB],color:"color"},standalone:false,decls:2,vars:1,consts:()=>{let i;return i="Sis\xE4lt\xF6 latautuu",[["aria-label",i,1,"mat-spinner-white",3,"diameter"],["aria-label","Inhalt wird geladen",3,"diameter"]];},template:function(e,m){if(e&1&&jb(0,C,1,1,"mat-spinner",0)(1,g,1,1,"mat-spinner",1),e&2){Vb(m.color==="white"?0:1);}},dependencies:[Z],styles:["[_nghost-%COMP%]{display:inline-flex;margin:3px}.mat-spinner-white[_ngcontent-%COMP%] circle{stroke:#fff}"]});}};/**i18n:4fda6dc4d9e89a427172966e1cd5825eeda37f6450a56e1ba87bafd8afb35193*/var Nn=m("[MediaFileTracking] Track Gallery Opened",P$1()),wn=m("[MediaFileTracking] Track Downloaded",P$1()),xn=m("[MediaFileTracking] Track Details Opened",P$1()),lt={trackGalleryOpened:Nn,trackDownloaded:wn,trackDetailsOpened:xn};var kn=m("[Theme] Update PrimaryColor",i=>({color:i})),Un=m("[Theme] Update HighlightColor",i=>({color:i})),Gn=m("[Theme] Update Logo",i=>({logo:i})),Bn=m("[Theme] Save Theme",i=>({theme:i})),Hn=m("[Theme/Api] Save Theme Success"),zn=m("[Theme/Api] Save Theme Failed",i=>({error:i})),Vn=m("[Theme] Reset SaveStatus"),jn=m("[Theme] Reset Theme"),Wn=m("[Theme] Set To DefaultTheme"),Xn=m("[Theme] Reset User View Settings"),Jn=m("[Theme/Api] Reset User View Settings Success"),Qn=m("[Theme/Api] Reset User View Settings Failed",i=>({error:i})),Re={updatePrimaryColor:kn,updateHighlightColor:Un,updateLogo:Gn,saveTheme:Bn,saveThemeSuccess:Hn,saveThemeFailed:zn,resetSaveStatus:Vn,resetTheme:jn,setToDefaultTheme:Wn,resetUserViewSettings:Xn,resetUserViewSettingsSuccess:Jn,resetUserViewSettingsFailed:Qn};var Zn={saveStatus:"waiting",saveError:null,theme:{highlightColor:null,logo:null,primaryColor:null,defaultViewType:ve.MediaStream,defaultSearchMode:0,defaultGridHeight:220,hideOrganizationInternalId:false,transparencyBackgroun
1d:null,transparencyBackgroundColor:null}},Kn=w$2(Zn,S$1(U.loadOrganizationDataSuccess,(i,{payload:{theme:e}})=>e?x(w({},i),{savedTheme:e,theme:e}):i),S$1(Re.updatePrimaryColor,(i,{color:e})=>x(w({},i),{theme:x(w({},i.theme),{primaryColor:e})})),S$1(Re.updateHighlightColor,(i,{color:e})=>x(w({},i),{theme:x(w({},i.theme),{highlightColor:e})})),S$1(Re.updateLogo,(i,{logo:e})=>x(w({},i),{theme:x(w({},i.theme),{logo:e})})),S$1(Re.saveTheme,(i,{theme:e})=>x(w({},i),{theme:e,saveStatus:"loading"})),S$1(Re.saveThemeSuccess,i=>x(w({},i),{saveStatus:"completed"})),S$1(Re.saveThemeFailed,(i,{error:e})=>x(w({},i),{saveStatus:"failed",saveError:e})),S$1(Re.resetSaveStatus,i=>x(w({},i),{saveStatus:"waiting",saveError:null})),S$1(Re.setToDefaultTheme,i=>x(w({},i),{theme:{highlightColor:null,logo:null,primaryColor:null,defaultViewType:ve.MediaStream,defaultSearchMode:0,defaultGridHeight:220,hideOrganizationInternalId:false,transparencyBackground:null,transparencyBackgroundColor:null}})),S$1(He.deleteMediaFilesSuccess,(i,{ids:e})=>i.theme?.logo&&e.includes(i.theme.logo.id)?x(w({},i),{theme:x(w({},i.theme),{logo:null})}):w({},i)));function _n(i,e){return Kn(i,e);}var qn="theming",ol={theme:_n},fn=Ee(qn);var Ri=h$1(fn,i=>i.theme),gn=h$1(Ri,i=>i.theme),Yn=h$1(gn,i=>i.logo);h$1(Ri,i=>i.saveStatus);h$1(Ri,i=>i.saveError);var Sn={selectTheme:gn,selectLogo:Yn};var oa=(i,e)=>e.personId;function na(i,e){i&1&&(rs(0,"div",16),Pm(1,"mat-spinner",19),rs(2,"p",20),PT(3,4),tu()()),i&2&&(KI(),Om("diameter",30));}function aa(i,e){if(i&1&&(rs(0,"li"),vC(1),tu()),i&2){let t=e.$implicit;KI(),Cg(t.title);}}function ra(i,e){if(i&1&&(rs(0,"p"),PT(1,5),tu(),rs(2,"ul"),$b(3,aa,2,1,"li",null,Bb),tu()),i&2){let t=VT(2);KI(),ng(t.ids.length),FT(1),KI(2),Ub(t.albums);}}function la(i,e){if(i&1&&(rs(0,"li"),vC(1),tu()),i&2){let t=e.$implicit;KI(),Cg(t.name);}}function sa(i,e){if(i&1&&(rs(0,"p"),PT(1,6),tu(),rs(2,"ul"),$b(3,la,2,1,"li",null,Bb),tu()),i&2){let t=VT(2);KI(),ng(t.ids.length),FT(1),KI(2),Ub(t.watermarks);}}function ca(i,e){if(i&1&&(rs(0,"li"),vC(1),tu()),i&2){let t=e.$implicit;KI(),Cg(t.firstname+", "+t.lastname);}}function da(i,e){if(i&1&&(rs(0,"p"),PT(1,7),tu(),rs(2,"u"),$b(3,ca,2,1,"li",null,Bb),tu()),i&2){let t=VT(2);KI(),ng(t.ids.length)(t.persons.length),FT(1),KI(2),Ub(t.persons);}}function pa(i,e){if(i&1&&(rs(0,"li"),PT(1,9),tu()),i&2){let t=e.$implicit;KI(),ng(t.firstname)(t.lastname)(t.remainingSampleCount)(t.totalSampleCount)(t.totalSampleCount)(t.remainingSampleCount),FT(1);}}function ma(i,e){if(i&1&&(rs(0,"p"),PT(1,8),tu(),rs(2,"ul"),$b(3,pa,2,6,"li",null,oa),tu()),i&2){let t=VT(2);KI(),ng(t.ids.length)(t.trainingPersons.length),FT(1),KI(2),Ub(t.trainingPersons);}}function ua(i,e){if(i&1&&(rs(0,"li"),vC(1),tu()),i&2){let t=e.$implicit;KI(),Cg(t);}}function _a(i,e){if(i&1&&(rs(0,"p"),PT(1,10),tu(),rs(2,"ul"),$b(3,ua,2,1,"li",null,Bb),tu()),i&2){let t=VT(2);KI(),ng(t.ids.length)(t.licenses.length),FT(1),KI(2),Ub(t.licenses);}}function fa(i,e){if(i&1&&(rs(0,"p"),PT(1,11),tu(),rs(2,"ul")(3,"li"),vC(4),tu()()),i&2){let t=VT(2);KI(4),Cg(t.logo.fileName);}}function ga(i,e){if(i&1&&(rs(0,"div",15),jb(1,ra,5,1),jb(2,sa,5,1),jb(3,da,5,2),jb(4,ma,5,2),jb(5,_a,5,2),jb(6,fa,5,1),tu()),i&2){let t=VT();KI(),Vb(t.albums.length>0?1:-1),KI(),Vb(t.watermarks.length>0?2:-1),KI(),Vb(t.persons.length>0?3:-1),KI(),Vb(t.trainingPersons.length>0?4:-1),KI(),Vb(t.licenses.length>0?5:-1),KI(),Vb(t.logo?6:-1);}}var Wt=class i{constructor(e,t,o){this.ids=e;this.fileService=t;this.store=o;this.albums=[];this.watermarks=[];this.persons=[];this.licenses=[];this.logo=null;this.trainingPersons=[];this.destroy$=new oe$1();this.loadingStatus$=new nr$1("waiting");}ngOnInit(){this.loadingStatus$.next("loading"),this.fileService.getAssignedValuesForDelete(this.ids).pipe(Xu(this.destroy$),hd(this.store.select(Z$2.getDownloadSettings),this.store.select(Sn.selectLogo)),le(([e,t,o])=>{this.albums=e.mediaAlbums,this.watermarks=t.filter(n=>this.ids.includes(n.watermarkId)),this.persons=e.persons,this.licenses=e.licenses,this.trainingPersons=(e.trainingPersons??[]).map(n=>x(w({}
1,n),{remainingSampleCount:Math.max(0,n.totalSampleCount-n.affectedSampleCount)})),o&&this.ids.includes(o.id)&&(this.logo=o);})).subscribe(()=>{this.loadingStatus$.next("completed");},e=>{this.loadingStatus$.next("failed");});}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}static{this.ɵfac=function(t){return new(t||i)(ao($e),ao(R),ao(at));};}static{this.ɵcmp=ub({type:i,selectors:[["app-confirm-delete-files-dialog"]],standalone:false,decls:18,vars:9,consts:()=>{let e;e="Poista tiedostot";let t;t="{VAR_PLURAL, plural, =1 {tiedosto} other {tiedostoa}}",t=jT(t,{VAR_PLURAL:"\uFFFD1\uFFFD"});let o;o="Haluatko varmasti poistaa "+"\uFFFD#8\uFFFD"+" "+"\uFFFD0\uFFFD"+" "+t+" "+"\uFFFD/#8\uFFFD"+" pysyv\xE4sti? ";let n;n="Vahvista";let r;r="Peruuta";let _;_="Mahdollisia tiedostoliitoksia ladataan";let S;S="{VAR_PLURAL, plural, =0 {Tiedostoa k\xE4ytet\xE4\xE4n seuraavissa albumeissa} other {Tiedostoja k\xE4ytet\xE4\xE4n seuraavissa albumeissa}}",S=jT(S,{VAR_PLURAL:"\uFFFD0\uFFFD"});let h;h=" "+S+" seuraavissa albumeissa: ";let x;x="{VAR_PLURAL, plural, =0 {Tiedostoa k\xE4ytet\xE4\xE4n vesileimana seuraavissa latausmalleissa} other {Tiedostoja k\xE4ytet\xE4\xE4n vesileimoina seuraavissa latausmalleissa}}",x=jT(x,{VAR_PLURAL:"\uFFFD0\uFFFD"});let ve;ve=" "+x+" vesileimana seuraavissa latausmalleissa: ";let ie;ie="{VAR_PLURAL, plural, =0 {Tiedosto} other {Ainakin yksi tiedostoista}}",ie=jT(ie,{VAR_PLURAL:"\uFFFD0\uFFFD"});let be;be="{VAR_PLURAL, plural, =0 {henkil\xF6} other {henkil\xF6\xE4}}",be=jT(be,{VAR_PLURAL:"\uFFFD1\uFFFD"});let Be;Be=" "+ie+" suostumuksena seuraaville "+be+": ";let we;we="{VAR_PLURAL, plural, =1 {T\xE4m\xE4 tiedosto sis\xE4lt\xE4\xE4} other {N\xE4m\xE4 tiedostot sis\xE4lt\xE4v\xE4t}}",we=jT(we,{VAR_PLURAL:"\uFFFD0\uFFFD"});let gt;gt="{VAR_PLURAL, plural, =1 {seuraavalle henkil\xF6lle} other {seuraaville henkil\xF6ille}}",gt=jT(gt,{VAR_PLURAL:"\uFFFD1\uFFFD"});let Gi;Gi=" "+we+" kasvontunnistuksen harjoituskuvia. Poiston j\xE4lkeen "+gt+" j\xE4\xE4 v\xE4hemm\xE4n harjoituskuvia: ";let St;St="{VAR_PLURAL, plural, =1 {harjoituskuvasta} other {harjoituskuvasta}}",St=jT(St,{VAR_PLURAL:"\uFFFD4\uFFFD"});let Et;Et="{VAR_PLURAL, plural, =1 {j\xE4ljell\xE4} other {j\xE4ljell\xE4}}",Et=jT(Et,{VAR_PLURAL:"\uFFFD5\uFFFD"});let Bi;Bi=" "+"\uFFFD0\uFFFD"+" "+"\uFFFD1\uFFFD"+": "+"\uFFFD2\uFFFD"+"/"+"\uFFFD3\uFFFD"+" "+St+" "+Et+" ";let ht;ht="{VAR_PLURAL, plural, =0 {Tiedosto} other {Ainakin yksi tiedostoista}}",ht=jT(ht,{VAR_PLURAL:"\uFFFD0\uFFFD"});let Ft;Ft="{VAR_PLURAL, plural, =0 {lisenssi} other {lisenssi\xE4}}",Ft=jT(Ft,{VAR_PLURAL:"\uFFFD1\uFFFD"});let Hi;Hi=" "+ht+" k\xE4ytet\xE4\xE4n lisenssisopimuksena seuraaville "+Ft+": ";let zi;return zi="Teema-logona k\xE4ytet\xE4\xE4n seuraavaa tiedostoa:",[e,o,n,r,_,h,ve,Be,Gi,Bi,Hi,zi,["mat-dialog-title",""],["matIconButton","","mat-dialog-close",""],["svgIcon","close","size","small"],[1,"text"],[1,"spinner-container"],["matButton","filled",1,"error-button",3,"disabled","mat-dialog-close"],["matButton","outlined","mat-dialog-close",""],[1,"download-spinner",3,"diameter"],[1,"files-loading-text"]];},template:function(t,o){if(t&1&&(rs(0,"h4",12),ou(1),PT(2,0),iu(),rs(3,"button",13),Pm(4,"mat-icon",14),tu()(),rs(5,"mat-dialog-content")(6,"p",15),eg(7,1),Pm(8,"b"),tg(),tu(),jb(9,na,4,1,"div",16),jC(10,"async"),eu(11,ga,7,6,"div",15),tu(),rs(12,"mat-dialog-actions")(13,"button",17),jC(14,"async"),PT(15,2),tu(),rs(16,"button",18),PT(17,3),tu()()),t&2){KI(8),ng(o.ids.length)(o.ids.length),FT(7),KI(),Vb(HC(10,5,o.loadingStatus$)==="completed"?11:9),KI(4),Om("disabled",HC(14,7,o.loadingStatus$)!=="completed")("mat-dialog-close",true);}},dependencies:[St,dt,jt,Nt,zt,Vt$1,wt,Z,M,c,u$1,ui$1],styles:[".spinner-container[_ngcontent-%COMP%]{display:flex;flex-direction:row}.files-loading-text[_ngcontent-%COMP%]{padding-top:6px;padding-left:12px}.mat-mdc-dialog-actions[_ngcontent-%COMP%]{gap:10px;flex-flow:row-reverse;justify-content:end}"]});}};var Ue=class i{constructor(e){this.http=e;}loadFolders(e,t,o){let n=`api/MediaFolder/${e}`,r=localStorage.getItem("show_duplicates");typeof t=="number"&&(n+=`/${t}`);let _=new H({fromObject:{loadParents:o,showDuplicates:r||false}});return this.http.get(n,{params:_});}getSubFolders(e,t){let o=`api/MediaFolder/SubFolders/${e}`;return typeof t=="number"&&(o+=`/${t}`),this.http.get(o);}createFolder(e){return this.http.post("api/MediaFolder",e);}updateFolder(e,t){return this.http.put(`api/MediaFolder/${e}`,t);}moveFolder(e,t){return this.http.put(`api/MediaFolder/Move/${e}`,t);}setFolderFrontImage(e,t){return this.http.put(`api/MediaFolder/SetFrontImage/${e}`,t);}deleteFolder(e){return this.http.delete(`api/MediaFolder/${e}`);}getFolderStructure(){return this.http.get("api/MediaFolder/Structure");}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var Ea=["pickerOverlay"],ha=["pickerOrigin"],Fa=["uploadInput"],Dn=(i,e)=>
1e.id,Ca=(i,e)=>e.mediaFileApi.id;function Ma(i,e){if(i&1){let t=Zb();rs(0,"button",10),rg("click",function(){tf(t);let n=VT();return nf(n.isOpen$.next(!n.isOpen$.value));}),Pm(1,"mat-icon",11),tu();}}function Aa(i,e){if(i&1&&(rs(0,"div",13),Pm(1,"img",15),jC(2,"fileUrl"),rs(3,"a",16),jC(4,"fileUrl"),vC(5),tu()()),i&2){let t=e;KI(),Om("src",BC(2,4,t,300),ah)("alt",t.metaData?.altText??t.fileName),KI(2),Om("href",HC(4,7,t),ah),KI(2),su(" ",t.fileName," ");}}function Da(i,e){if(i&1&&(rs(0,"div",17),jC(1,"async"),PT(2,4),tu()),i&2){let t=VT(2);mg("disabled-text",HC(1,2,t.isDisabled$));}}function Ia(i,e){if(i&1){let t=Zb();rs(0,"button",12,2),jC(2,"async"),rg("click",function(){tf(t);let n=VT();return nf(n.isOpen$.next(!n.isOpen$.value));}),vC(3),tu(),jb(4,Aa,6,9,"div",13),jC(5,"async"),eu(6,Da,3,4,"div",14);}if(i&2){let t,o=VT();mg("grow",o.grow),Om("disabled",HC(2,6,o.isDisabled$))("matTooltip",o.buttonTooltip),KI(3),su(" ",o.buttonText," "),KI(),Vb((t=HC(5,8,o.chosenFile$))?4:6,t);}}function Ta(i,e){if(i&1){let t=Zb();rs(0,"button",22),rg("click",function(){tf(t);let n=VT(3);return nf(n.goBack());}),rs(1,"mat-icon"),vC(2,"keyboard_backspace"),tu()();}}function Oa(i,e){if(i&1&&(rs(0,"div"),Pm(1,"mat-divider",23),rs(2,"mat-error",32),vC(3),jC(4,"async"),tu()()),i&2){let t=VT(3);KI(3),Cg(HC(4,1,t.error$));}}function va(i,e){if(i&1){let t=Zb();rs(0,"div")(1,"button",33),rg("click",function(){tf(t);let n=VT(3);return nf(n.deleteChoosenFile());}),rs(2,"mat-icon"),vC(3,"delete_forever"),tu()()();}}function ba(i,e){if(i&1){let t=Zb();rs(0,"button",35),rg("click",function(){let n=tf(t).$implicit,r=VT(4);return nf(r.selectWorkspace(n));}),rs(1,"mat-icon"),vC(2,"folder"),tu(),vC(3),tu();}if(i&2){let t=e.$implicit;KI(3),su(" ",t.name," ");}}function Pa(i,e){if(i&1&&($b(0,ba,4,1,"button",34,Dn),jC(2,"async")),i&2){let t=VT(3);Ub(HC(2,0,t.workspaces$));}}function ya(i,e){if(i&1){let t=Zb();rs(0,"button",35),rg("click",function(){let n=tf(t).$implicit,r=VT(4);return nf(r.selectFolder(n));}),rs(1,"mat-icon"),vC(2,"folder"),tu(),vC(3),tu();}if(i&2){let t=e.$implicit;KI(3),su(" ",t.name," ");}}function La(i,e){if(i&1&&($b(0,ya,4,1,"button",34,Dn),jC(2,"async")),i&2){let t=VT(3);Ub(HC(2,0,t.folders$));}}function $a(i,e){if(i&1){let t=Zb();rs(0,"button",37),rg("click",function(){let n=tf(t).$implicit,r=VT(4);return nf(r.selectFile(n.mediaFileApi.id));}),Pm(1,"img",38),jC(2,"fileUrl"),rs(3,"div",39),vC(4),tu()();}if(i&2){let t=e.$implicit;Om("disabled",!t.isAccepted),KI(),Om("src",BC(2,4,t.mediaFileApi,300),ah)("alt",t.mediaFileApi.metaData?.altText??t.mediaFileApi.fileName),KI(3),su(" ",t.mediaFileApi.fileName," ");}}function Ra(i,e){if(i&1&&($b(0,$a,5,7,"button",36,Ca),jC(2,"async")),i&2){let t=VT(3);Ub(HC(2,0,t.fileChooserObjects$));}}function Na(i,e){i&1&&(rs(0,"div",30),PT(1,6),tu());}function wa(i,e){if(i&1){let t=Zb();rs(0,"div",31)(1,"mat-error"),vC(2),jC(3,"async"),tu(),rs(4,"button",40),rg("click",function(){tf(t);let n=VT(3);return nf(n.loadNextFiles());}),vC(5," Nochmal versuchen "),tu()();}if(i&2){let t=VT(3);KI(2),su("Fehler beim Laden der Dateien ",HC(3,1,t.fileError$));}}function xa(i,e){if(i&1){let t=Zb();rs(0,"div",19),jb(1,Ta,3,0,"button",20),jC(2,"async"),rs(3,"div",21),vC(4),jC(5,"async"),tu(),rs(6,"button",22),rg("click",function(){tf(t);let n=VT(2);return nf(n.close());}),rs(7,"mat-icon"),vC(8,"close"),tu()()(),jb(9,Oa,5,3,"div"),jC(10,"async"),Pm(11,"mat-divider",23),rs(12,"div",24)(13,"div",25)(14,"button",26),jC(15,"async"),jC(16,"async"),rg("click",function(){tf(t);let n=VT(2);return nf(n.openFileInput());}),rs(17,"mat-icon",27),vC(18,"cloud_upload"),tu(),ou(19),PT(20,5),iu(),tu(),rs(21,"input",28,3),rg("change",function(n){tf(t);let r=VT(2);return nf(r.uploadFile(n.target.files));}),tu()(),jb(23,va,4,0,"div"),jC(24,"async"),tu(),Pm(25,"mat-divider",23),rs(26,"div",29),rg("scroll",function(n){tf(t);let r=VT(2);return nf(r.handleScroll(n));}),jb(27,Pa,3,2),jC(28,"async"),eu(29,La,3,2),Pm(30,"mat-divider",23),jb(31,Ra,3,2),jC(32,"async"),eu(33,Na,2,0,"div",30),jb(34,wa,6,3,"div",31),jC(35,"async"),tu();}if(i&2){let t,o=VT(2);KI(),Vb(HC(2,10,o.workspaceId$)?1:-1),KI(3),Cg(HC(5,12,o.currentLocationName$)),KI(5),Vb(HC(10,14,o.uploadStatus$)==="failed"?9:-1),KI(5),Om("disabled",HC(15,16,o.isUploadDisabled$))("matTooltipDisabled",!HC(16,18,o.isUploadDisabled$)),KI(7),Om("accept",o.accept),KI(2),Vb((t=HC(24,20,o.chosenFile$))?23:-1,t),KI(4),Vb(HC(28,22,o.showWorkspaces$)?27:29),KI(4),Vb(HC(32,24,o.files$).length>0?31:33),KI(3),Vb(HC(35,26,o.fileStatus$)==="failed"?34:-1);}}function ka(i,e){if(i&1&&(rs(0,"div",41),Pm(1,"mat-progress-spinner",43),jC(2,"async"),tu()),i&2){let t=VT(3);KI(),Om("diameter",50)("mode","determinate")("value",HC(2,3,t.uploadProgress$));}}function Ua(i,e){i&1&&(rs(0,"div",42),Pm(1,"app-loading-icon",44),tu()),i&2&&(KI(),Om("size",50));}function Ga(i,e){if(i&1&&(jb(0,ka,3,5,"div",41),jC(1,"async"),eu(2,Ua,2,1,"div",42)),i&2){let t=VT(2);Vb(HC(1,1,t.uploadStatus$)==="loading"?0:2);}}function Ba(i,e){if(i&1&&(rs(0,"div",18),jb(1,xa,36,28),jC(2,"async"),jC(3,"async"),eu(4,Ga,3,3),tu()),i&2){let t=VT();KI(),Vb(HC(2,1,t.status$)==="completed"&&HC(3,3,t.uploadStatus$)!=="loading"?1:4);}}var Ha=20,Qt=class i{constructor(e,t,o){this.workspaceService=e;this.folderService=t;this.fileService=o;this.grow=false;this.icon=null;this.buttonText="Valitse tiedosto";this.useUploadedFile=false;this.canRemoveFile=true;this.accept="/*";this.buttonTooltip="";this.vertical=false;this.selectedFile=new nt();this.fileChooserClass=true;this.DEFAULT_TAKE=30;this.workspaces$=new nr$1([]);this.folders$=new nr$1([]);this.fileData$=new nr$1(null);this.workspaceId$=new nr$1(null);this.folderId$=new nr$1(null);this.workspaceStatus$=new nr$1("waiting");this.fileStatus$=new nr$1("waiting");this.fileError$=new nr$1(null);this.status$=new nr$1("waiting");this.chosenFile$=new nr$1(null);this.uploadStatus$=new nr$1("waiting");this.uploadProgress$=new nr$1(0);this.currentLocationName$=new nr$1("");this.fileTake$=new nr$1(this.DEFAULT_TAKE);this.isOpen$=new nr$1(false);this.isDisabled$=new nr$1(false);this.error$=new nr$1("");this.showWorkspaces$=this.workspaceId$.pipe(le(e=>!e));this.destroy$=new oe$1();this.loadingStatus=l;this.files$=this.fileData$.pipe(le(e=>e?e.files:[]));this.isUploadDisabled$=Zy([this.workspaceId$,this.folderId$]).pipe(le(([e,t])=>!e&&!t));this.currentWorkspace=null;this.currentFolders=new Array();this.onChange=()=>{};this.onTouched=()=>{};}ngOnInit(){this.loadWorkspaces(),this.initLoadingStatus(),this.clearLocation(),this.checkTypes(this.accept);}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}setDisabledState(e){this.isDisabled$.next(e);}writeValue(e){typeof e!="number"?this.chosenFile$.next(null):this.loadInitialFile(e);}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}selectWorkspace(e){this.currentLocationName$.next(e.name),this.currentWorkspace=e,this.selectLocation(e.id,null);}selectFolder(e){this.currentLocationName$.next(e.name),this.currentFolders.push(e),this.selectLocation(e.workspaceId,e.id);}selectLocation(e,t){this.fileTake$.next(this.DEFAULT_TAKE),this.workspaceId$.next(e),this.folderId$.next(t);}
1close(){this.uploadStatus$.next("waiting"),this.isOpen$.next(false);}goBack(){if(this.currentFolders.length===0)this.currentWorkspace=null,this.currentLocationName$.next(""),this.selectLocation(null,null);else{let e=this.currentFolders.pop();this.currentFolders.length===0?this.currentLocationName$.next(this.currentWorkspace.name):this.currentLocationName$.next(this.currentFolders[0].name),this.selectLocation(e.workspaceId,e.mainFolderId);}}selectFile(e){let t=this.fileData$.value.files.find(o=>o.id===e);t&&this.chosenFile$.next(t),this.selectedFile.emit(t),this.onChange(e),this.close();}uploadFile(e){if(e.length<=0)return;let t=e.item(0);this.fileService.uploadMediaFile(t,this.workspaceId$.value,this.folderId$.value).pipe(yn$1(o=>o.type===de.UploadProgress||o.type===de.Response)).subscribe(o=>{switch(o.type){case de.UploadProgress:{this.uploadStatus$.next("loading");let n=o.loaded/o.total*100;this.uploadProgress$.next(n);}break;case de.Response:{this.uploadStatus$.next("completed");let n=o.body;n&&(this.onChange(n.id),this.selectedFile.emit(n),this.chosenFile$.next(n)),this.close();}break;}},o=>{this.uploadStatus$.next("failed"),o==="not_enough_space"&&(o="Ei tarpeeksi tallennustilaa."),this.error$.next(o);});}handleScroll(e){let t=e.target;t.scrollTop+t.clientHeight+Ha>=t.scrollHeight&&this.fileTake$.value<this.fileData$.value.total&&this.fileStatus$.value==="completed"&&this.loadNextFiles();}loadNextFiles(){this.fileStatus$.next("loading"),this.fileTake$.next(this.fileTake$.value+this.DEFAULT_TAKE),this.fileService.getMediaFiles(this.workspaceId$.value,this.folderId$.value,0,this.fileTake$.value,2,true,false).subscribe({next:e=>{this.fileData$.next(e),this.fileStatus$.next("completed");},error:e=>{this.fileError$.next(e),this.fileStatus$.next("failed");}});}openFileInput(){this.isUploadDisabled$.pipe(dd()).subscribe(e=>{e||this.uploadInput.nativeElement.click();});}initLoadingStatus(){this.workspaceStatus$.pipe(Xu(this.destroy$),ed(e=>{e==="completed"&&this.status$.next("completed"),e==="failed"&&this.status$.next("failed"),e==="loading"&&this.status$.next("loading");})).subscribe();}clearLocation(){this.isOpen$.pipe(Xu(this.destroy$)).subscribe(e=>{e||(this.selectLocation(null,null),this.currentWorkspace=null,this.currentFolders=[],this.currentLocationName$.next(""));});}loadWorkspaces(){this.workspaceStatus$.next("loading"),Zy([this.workspaceId$,this.folderId$,this.isOpen$]).pipe(Xu(this.destroy$),Yu(10),yn$1(([,,e])=>e),ed(([e,t])=>{this.workspaces$.next([]),this.folders$.next([]),this.fileData$.next(null),this.workspaceStatus$.next("loading"),e?this.folderService.loadFolders(e,t,false).subscribe(({folders:o})=>{this.folders$.next(o),this.workspaceStatus$.next("completed");}):this.workspaceService.getWorkspaces(true).pipe(ed(o=>{this.workspaces$.next(o.workspaces.filter(n=>n.type===1)),this.workspaceStatus$.next("completed");})).subscribe(),this.fileStatus$.next("loading"),this.fileService.getMediaFiles(e,t,0,this.fileTake$.value,2,true,false).subscribe(o=>{this.fileData$.next(o),this.fileStatus$.next("completed");});})).subscribe();}loadInitialFile(e){this.useUploadedFile?this.fileService.getFromUploadedFileId(e).subscribe(t=>{this.chosenFile$.next(t);}):this.fileService.getSingleMediaFile(e).subscribe(t=>{this.chosenFile$.next(t);});}deleteChoosenFile(){this.onChange(null),this.chosenFile$.next(null),this.selectedFile.emit(null);}checkTypes(e){let t=e.split(",").map(n=>n.trim()).filter(n=>!n.startsWith(".")).map(n=>new RegExp(n)),o=e.split(",").map(n=>n.trim()).filter(n=>n.startsWith(".")).map(n=>n.toUpperCase());this.fileChooserObjects$=this.files$.pipe(Xu(this.destroy$),le(n=>n.map(_=>!t.some(S=>S.test(_.fileType))&&!o.some(S=>_.fileName.toUpperCase().endsWith(S))?{mediaFileApi:_,isAccepted:false}:{mediaFileApi:_,isAccepted:true})));}static{this.ɵfac=function(t){return new(t||i)(ao(Oe),ao(Ue),ao(R));};}static{this.ɵcmp=ub({type:i,selectors:[["app-file-chooser"]],viewQuery:function(t,o){if(t&1&&ag(Ea,5)(ha,5)(Fa,5),t&2){let n;qT(n=WT())&&(o.pickerOverlay=n.first),qT(n=WT())&&(o.pickerOrigin=n.first),qT(n=WT())&&
1(o.uploadInput=n.first);}},hostVars:4,hostBindings:function(t,o){t&2&&mg("file-chooser-vertical",o.vertical)("file-chooser",o.fileChooserClass);},inputs:{grow:"grow",icon:"icon",buttonText:"buttonText",useUploadedFile:"useUploadedFile",canRemoveFile:"canRemoveFile",accept:"accept",buttonTooltip:"buttonTooltip",vertical:"vertical"},outputs:{selectedFile:"selectedFile"},standalone:false,features:[NC([{provide:N$1,useExisting:ti$1(()=>i),multi:true}])],decls:7,vars:6,consts:()=>{let e;e="Tiedoston valinta";let t;t="Avaa tiedostovalinta";let o;o="Ei valittua tiedostoa";let n;n="Valitse kansio ennen tiedoston tuomista.";let r;r="Tuo tiedosto";let _;_="Peruuta tiedoston valinta";let S;return S="Ei tiedostoja.",[["trigger","cdkOverlayOrigin"],["pickerOverlay",""],["pickerOrigin",""],["uploadInput",""],o,r,S,["cdkOverlayOrigin","","aria-label",e,1,"file-chooser"],["type","button","mat-icon-button","","aria-label",t,1,"icon-button"],["cdkConnectedOverlay","","cdkConnectedOverlayHasBackdrop","",3,"backdropClick","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPush"],["type","button","mat-icon-button","","aria-label",t,1,"icon-button",3,"click"],["svgIcon","add-circle"],["type","button","mat-stroked-button","","matTooltipPosition","right",1,"chose-button",3,"click","disabled","matTooltip"],[1,"preview-file"],[1,"no-file-selected-text",3,"disabled-text"],[1,"preview-thumbnail",3,"src","alt"],["mat-button","","target","_blank",1,"preview-url",3,"href"],[1,"no-file-selected-text"],[1,"overlay"],[1,"header"],["mat-icon-button","","type","button"],[1,"current-folder"],["mat-icon-button","","type","button",3,"click"],[1,"element-divider"],[1,"flex-container"],[1,"upload"],["mat-stroked-button","","color","primary","type","button","disabledInteractive","","matTooltip",n,1,"upload-button",3,"click","disabled","matTooltipDisabled"],[1,"upload-icon"],["type","file",1,"upload-input",3,"change","accept"],[1,"scroll-container",3,"scroll"],[1,"no-files"],[1,"error-container"],[1,"upload-error"],["mat-icon-button","","matTooltip",_,"matTooltipPosition","right",1,"delete-button",3,"click"],["mat-button","",1,"workspace-item"],["mat-button","",1,"workspace-item",3,"click"],["mat-button","",1,"file-item",3,"disabled"],["mat-button","",1,"file-item",3,"click","disabled"],[1,"thumbnail",3,"src","alt"],[1,"filename"],["mat-flat-button","","color","primary",3,"click"],[1,"upload-spinner"],[1,"loading-container"],[3,"diameter","mode","value"],[3,"size"]];},template:function(t,o){if(t&1&&(rs(0,"div",7,0),jb(2,Ma,2,0,"button",8)(3,Ia,7,10),tu(),bm(4,Ba,5,5,"ng-template",9,1,$C),jC(6,"async"),rg("backdropClick",function(){return o.isOpen$.next(false);})),t&2){let n=zT(1);KI(2),Vb(o.icon?2:3),KI(2),Om("cdkConnectedOverlayOrigin",n)("cdkConnectedOverlayOpen",HC(6,4,o.isOpen$))("cdkConnectedOverlayPush",true);}},styles:['[_nghost-%COMP%]{display:block;min-width:0;overflow:hidden}.file-chooser-vertical[_nghost-%COMP%] .file-chooser[_ngcontent-%COMP%]{flex-direction:column}.file-chooser[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:nowrap;gap:0 5px}.chose-button[_ngcontent-%COMP%]{margin-top:0;flex-shrink:0}.chose-button.grow[_ngcontent-%COMP%]{width:100%;margin-bottom:10px}.preview-file[_ngcontent-%COMP%]{display:flex;align-items:center;flex:1 1 auto;overflow:hidden}.preview-file[_ngcontent-%COMP%] .preview-thumbnail[_ngcontent-%COMP%]{height:30px;max-width:40px;object-fit:contain;border:solid 1px currentColor;border-radius:5px}.preview-url[_ngcontent-%COMP%]{max-width:300px}.preview-url[_ngcontent-%COMP%] .mdc-button__label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overlay[_ngcontent-%COMP%]{width:300px;height:400px;padding-bottom:4px;border-radius:4px;background-color:var(--mat-sys-surface-container-lowest);box-shadow:var(--mat-sys-level2);max-height:100vh}.header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.header[_ngcontent-%COMP%] .current-folder[_ngcontent-%COMP%]{font-size:16;font-weight:700}.scroll-container[_ngcontent-%COMP%]{height:calc(100% - 100px);overflow:auto}.file-item[_ngcontent-%COMP%]{width:100%}.file-item[_ngcontent-%COMP%] .mdc-button__label{display:grid;align-items:center;width:100%;grid-template-columns:45px 1fr}.thumbnail[_ngcontent-%COMP%]{height:30px;max-width:40px;object-fit:contain;border:1px solid currentColor;border-radius:5px;justify-self:start;align-self:center}.filename[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start}.workspace-item[_ngcontent-%COMP%]{width:100%;justify-content:start;color:var(--mat-sys-on-surface)}.workspace-item[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-variation-settings:"FILL" 1}.no-files[_ngcontent-%COMP%]{display:flex;height:50px;align-items:center;font-style:italic;justify-content:space-around}.loading-container[_ngcontent-%COMP%]{display:grid;place-items:center center;height:100%}.upload-spinner[_ngcontent-%COMP%]{display:flex;height:100%}.upload-spinner[_ngcontent-%COMP%] .mat-mdc-progress-spinner[_ngcontent-%COMP%]{margin:auto}.upload[_ngcontent-%COMP%]{padding:5px}.upload-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{color:inherit}.upload-input[_ngcontent-%COMP%]{display:none}.upload-icon[_ngcontent-%COMP%]{margin-right:5px}.upload-error[_ngcontent-%COMP%]{padding-left:10px}.flex-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.error-container[_ngcontent-%COMP%]{display:flex;flex-flow:column;padding:10px}.no-file-selected-text[_ngcontent-%COMP%]{color:var(--mh-sys-text-light);font-size:12px;font-weight:400}']});}};function za(i,e){if(i&1){let t=Zb();rs(0,"button",7),rg("click",function(){tf(t);let n=VT();return nf(n.selectAll());}),PT(1,0),tu(),rs(2,"button",7),rg("click",function(){tf(t);let n=VT();return nf(n.clearAll());}),PT(3,1),tu();}if(i&2){let t=VT();Om("disabled",t.isDisabled()),KI(2),Om("disabled",t.isDisabled());}}function Va(i,e){if(i&1){let t=Zb();rs(0,"button",7),rg("click",function(){tf(t);let n=VT();return nf(n.addSelectedFiles());}),vC(1),tu();}if(i&2){let t=VT();Om("disabled",t.isDisabled()),KI(),su(" ",t.addSelectedFilesButtonText()," ");}}function ja(i,e){if(i&1&&(Pm(0,"img",10),jC(1,"fileUrl")),i&2){let t=VT().$implicit;Om("src",BC(1,2,t.file,300),ah)("alt",t.file.metaData?.altText??t.file.fileName);}}function Wa(i,e){if(i&1){let t=Zb();rs(0,"ui-grid-item")(1,"div",9),jb(2,ja,2,5,"img",10),rs(3,"div",11)(4,"button",12),rg("click",function(){let n=tf(t).$implicit,r=VT(2);
1return nf(r.toggleDisableFile(n));}),Pm(5,"mat-icon",13),tu()()()();}if(i&2){let t=e.$implicit,o=VT(2);KI(),mg("file-disabled",t.isDisabled),KI(),Vb(t.file?2:-1),KI(2),Om("disabled",o.isDisabled());}}function Xa(i,e){if(i&1&&(rs(0,"ui-grid",5),bm(1,Wa,6,4,"ui-grid-item",8),tu()),i&2){let t=VT();Om("rowMinHeight",t.rowMinHeight)("gap",t.gap)("scrollContainer",t.scrollContainer),KI(),Om("uiGridForOf",t.gridFiles())("uiGridForTrackBy",t.trackByFn)("uiGridForRatioFn",t.ratioFn);}}function Ja(i,e){i&1&&(rs(0,"div",6),PT(1,2),tu());}var Zt=class i{constructor(e){this.store=e;this.rowMinHeight=150;this.gap=10;this.gridFileIds=Ye([]);this.fileIds=Ye([]);this.onChange=()=>{};this.onTouched=()=>{};this.isDisabled=Ye(false);this.storedFiles=this.store.selectSignal(g$1.getEntities);this.selectedFileIds=this.store.selectSignal(g$1.getSelectedIds);this.selectedFilesToAddCount=xt(()=>{let e=this.gridFileIds();return this.selectedFileIds().filter(o=>!e.includes(o)).length;});this.showAddSelectedFilesButton=xt(()=>this.selectedFilesToAddCount()>0);this.addSelectedFilesButtonText=xt(()=>{let e=this.selectedFilesToAddCount();switch(e){case 1:return"Lis\xE4\xE4 valittu tiedosto";default:return"Lis\xE4\xE4 "+e+" valittua tiedostoa";}});this.gridFiles=xt(()=>{let e=this.storedFiles(),t=this.gridFileIds(),o=this.fileIds();return t.map(n=>({id:n,file:e[n]??null,isDisabled:!o.includes(n)}));});this.ratioFn=e=>e.file?e.file.width/(e.file.height??1):1;this.trackByFn=(e,t)=>t.id;this.showDisabledToggleButtons=xt(()=>this.gridFiles().length>0);this.showGrid=xt(()=>this.gridFileIds().length>0);}writeValue(e){this.fileIds.set(e),this.gridFileIds.update(t=>[...t,...e.filter(o=>!t.includes(o))]),this.loadMissingFiles();}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){this.isDisabled.set(e);}addSelectedFiles(){let e=this.selectedFileIds();this.gridFileIds.update(t=>[...t,...e.filter(o=>!t.includes(o))]),this.fileIds.update(t=>[...t,...e.filter(o=>!t.includes(o))]),this.onChange(this.fileIds()),this.onTouched();}toggleDisableFile(e){this.fileIds.update(t=>t.includes(e.id)?t.filter(o=>o!==e.id):[...t,e.id]),this.onChange(this.fileIds()),this.onTouched();}selectAll(){this.fileIds.set(this.gridFileIds()),this.onChange(this.fileIds()),this.onTouched();}clearAll(){this.fileIds.set([]),this.onChange(this.fileIds()),this.onTouched();}loadMissingFiles(){let e=this.store.selectSignal(g$1.getIds)(),o=this.gridFileIds().filter(n=>!e.includes(n));o.length&&this.store.dispatch(S.loadByIds({ids:o}));}static{this.ɵfac=function(t){return new(t||i)(ao(at));};}static{this.ɵcmp=ub({type:i,selectors:[["app-media-files-select"]],inputs:{scrollC
1ontainer:"scrollContainer",rowMinHeight:"rowMinHeight",gap:"gap"},standalone:false,features:[NC([{provide:N$1,useExisting:i,multi:true}])],decls:5,vars:3,consts:()=>{let e;e="Valitse kaikki";let t;t="Tyhjenn\xE4 valinta";let o;return o="Tiedostoja ei ole valittu.",[e,t,o,[1,"toolbar"],["type","button","mat-stroked-button","","color","primary",3,"disabled"],[1,"file-grid",3,"rowMinHeight","gap","scrollContainer"],[1,"empty-message"],["type","button","mat-stroked-button","","color","primary",3,"click","disabled"],[4,"uiGridFor","uiGridForOf","uiGridForTrackBy","uiGridForRatioFn"],[1,"file-grid-item"],[1,"file-image",3,"src","alt"],[1,"file-actions"],["type","button","mat-icon-button","",3,"click","disabled"],["svgIcon","delete-circle"]];},template:function(t,o){t&1&&(rs(0,"div",3),jb(1,za,4,2),jb(2,Va,2,2,"button",4),tu(),jb(3,Xa,2,6,"ui-grid",5)(4,Ja,2,0,"div",6)),t&2&&(KI(),Vb(o.showDisabledToggleButtons()?1:-1),KI(),Vb(o.showAddSelectedFilesButton()?2:-1),KI(),Vb(o.showGrid()?3:4));},styles:["[_nghost-%COMP%]{display:grid;gap:10px}.file-grid-item[_ngcontent-%COMP%]{position:relative;width:100%;height:100%}.file-grid-item[_ngcontent-%COMP%]:hover .file-actions[_ngcontent-%COMP%], .file-grid-item.file-disabled[_ngcontent-%COMP%] .file-actions[_ngcontent-%COMP%]{display:flex}.file-grid-item.file-disabled[_ngcontent-%COMP%] .file-image[_ngcontent-%COMP%]{opacity:.5}.file-image[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover}.file-actions[_ngcontent-%COMP%]{position:absolute;top:0;right:0;left:0;display:none;justify-content:end;background:linear-gradient(180deg,#00000080,#0000004d 66%,#0000);--mat-icon-button-icon-color: #fff}.toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.empty-message[_ngcontent-%COMP%]{font-style:italic}"]});}};var _t=class i{constructor(e){this.iconService=e;}transform(e,t,o=true){if(!e)return"";if(this.hasThumbnailsProp(e)){let _=e;if(typeof t=="number"){let S=o?this.normalizeSize(t):t;return _.thumbnails?.[S]??this.getFileExtIconUrl(_.fileName);}return t==="pdf"?_.pdfUrl??this.getFileExtIconUrl(_.fileName):_.url??this.getFileExtIconUrl(_.fileName);}let n=e;if(typeof t!="number")return"";let r=o?this.normalizeSize(t):t;return n[r]??"";}hasThumbnailsProp(e){return!!e&&typeof e=="object"&&"thumbnails"in e;}normalizeSize(e){return e<=300?300:e<=600?600:1700;}getFileExtIconUrl(e){let t=e.lastIndexOf("."),o=(t>=0?e.substring(t+1):e).toLowerCase();return o=this.iconService.checkSvgAvailable(o),`assets/icons/file/${o}.svg`;}static{this.ɵfac=function(t){return new(t||i)(ao(m$1,16));};}static{this.ɵpipe=hb({name:"fileUrl",type:i,pure:true,standalone:false});}};var Kt=class i{constructor(e){this.http=e;}getCropDownloadSettings(){return this.http.get("api/Crop");}getOrgCropDownloadSettings(){return this.http.get("api/Organization/Crop");}addCropDownloadSettings(e){return this.http.post("api/Organization/Crop",e);}updateCropDownloadSettings(e,t){return this.http.put(`api/Organization/Crop/${e}`,t);}deleteCropDownloadSettings(e){return this.http.delete(`api/Organization/Crop/${e}`);}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var qt=class i{constructor(e,t){this.actions$=e;this.cropImageSettingService=t;this.loadOrgSettings$=Dr$1(()=>this.actions$.pipe(Vt(L.loadOrgCropSettings),me(()=>this.cropImageSettingService.getOrgCropDownloadSettings().pipe(le(e=>L.loadOrgCropSettingsSuccess({payload:e})),Hs(e=>js(L.loadCropSettingsFailed({err:e})))))));this.loadSettings$=Dr$1(()=>this.actions$.pipe(Vt(L.loadCropSettings),me(()=>this.cropImageSettingService.getCropDownloadSettings().pipe(le(e=>L.loadCropSettingsSuccess({payload:e})),Hs(e=>js(L.createCropSettingFailed({err:e})))))));this.createSetting$=Dr$1(()=>this.actions$.pipe(Vt(L.createCropSetting),me(({payload:e})=>this.cropImageSettingService.addCropDownloadSettings(e).pipe(le(t=>L.createCropSettingSuccess({payload:t})),Hs(t=>js(L.createCropSettingFailed({err:t})))))));this.removeSetting$=Dr$1(()=>this.actions$.pipe(Vt(L.removeCropSetting),me(({id:e})=>this.cropImageSettingService.deleteCropDownloadSettings(e).pipe(le(()=>L.removeCropSettingSuccess()),Hs(t=>js(L.removeCropSettingFailed({err:t})))))));this.updateSetting$=Dr$1(()=>this.actions$.pipe(Vt(L.updateCropSetting),me(({id:e,payload:t})=>this.cropImageSettingService.updateCropDownloadSettings(e,t).pipe(le(()=>L.updateCropSettingSuccess({id:e,payload:t})),Hs(o=>js(L.updateCropSettingFailed({err:o})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(Kt));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var Yt=class i{constructor(e){this.http=e;}getDownloadSettings(){return this.http.get("api/Download");}createDownloadSetting(e){return this.http.post("api/Download",e);}removeDownloadSetting(e){return this.http.delete(`api/Download/${e}`);}updateDownloadSetting(e,t){return this.http.put(`api/Download/${e}`,t);}getFileWatermarks(e){return this.http.post("api/Download/GetFileWatermarks",e);}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var ei=class i{constructor(e,t){this.actions$=e;this.downloadSettingService=t;this.loadSettings$=Dr$1(()=>this.actions$.pipe(Vt(W.loadDownloadSettings),me(()=>this.downloadSettingService.getDownloadSettings().pipe(le(e=>W.loadDownloadSettingsSuccess({payload:e})),Hs(e=>js(W.createDownloadSettingFailed({err:e})))))));this.createSetting$=Dr$1(()=>this.actions$.pipe(Vt(W.createDownloadSetting),me(({payload:e})=>
1this.downloadSettingService.createDownloadSetting(e).pipe(le(t=>W.createDownloadSettingSuccess({payload:t})),Hs(t=>js(W.createDownloadSettingFailed({err:t})))))));this.removeSetting$=Dr$1(()=>this.actions$.pipe(Vt(W.removeDownloadSetting),me(({payload:e})=>this.downloadSettingService.removeDownloadSetting(e.id).pipe(le(()=>W.removeDownloadSettingSuccess()),Hs(t=>js(W.removeDownloadSettingFailed({err:t,payload:e})))))));this.updateSetting$=Dr$1(()=>this.actions$.pipe(Vt(W.updateDownloadSetting),me(({id:e,payload:t,modifiedBy:o,modifiedOn:n})=>this.downloadSettingService.updateDownloadSetting(e,t).pipe(le(r=>W.updateDownloadSettingSuccess({id:e,payload:r})),Hs(r=>js(W.updateDownloadSettingFailed({err:r,id:e,payload:t,modifiedBy:o,modifiedOn:n})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(Yt));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var ti=class i{constructor(e){this.http=e;}getGalleryInformationTemplates(){return this.http.get("api/Organization/GalleryInformation");}addGalleryInformationTemplate(e){return this.http.post("api/Organization/GalleryInformation",e);}updateGalleryInformationTemplate(e,t){return this.http.put(`api/Organization/GalleryInformation/${e}`,t);}deleteGalleryInformationTemplate(e){return this.http.delete(`api/Organization/GalleryInformation/${e}`);}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var ii=class i{constructor(e,t){this.actions$=e;this.galleryInformationTemplateService=t;this.loadGalleryInformationTemplates$=Dr$1(()=>this.actions$.pipe(Vt(k.loadGalleryInformationTemplate),me(()=>this.galleryInformationTemplateService.getGalleryInformationTemplates().pipe(le(e=>k.loadGalleryInformationTemplateSuccess({payload:e})),Hs(e=>js(k.loadGalleryInformationTemplateFailed({err:e})))))));this.createGalleryInformationTemplates$=Dr$1(()=>this.actions$.pipe(Vt(k.createGalleryInformationTemplate),me(({payload:e})=>this.galleryInformationTemplateService.addGalleryInformationTemplate(e).pipe(le(t=>k.createGalleryInformationTemplateSuccess({payload:t})),Hs(t=>js(k.createGalleryInformationTemplateFailed({err:t})))))));this.removeGalleryInformationTemplates$=Dr$1(()=>this.actions$.pipe(Vt(k.removeGalleryInformationTemplate),me(({id:e})=>this.galleryInformationTemplateService.deleteGalleryInformationTemplate(e).pipe(le(()=>k.removeGalleryInformationTemplateSuccess({id:e})),Hs(t=>js(k.removeGalleryInformationTemplateFailed({err:t})))))));this.updateGalleryInformationTemplates$=Dr$1(()=>this.actions$.pipe(Vt(k.updateGalleryInformationTemplate),me(({id:e,payload:t})=>this.galleryInformationTemplateService.updateGalleryInformationTemplate(e,t).pipe(le(o=>k.updateGalleryInformationTemplateSuccess({id:e,payload:o})),Hs(o=>js(k.updateGalleryInformationTemplateFailed({err:o})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(ti));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var oi=50,ni=class i{constructor(e,t,o){this.actions$=e;this.albumService=t;this.store=o;this.stopLoading$=this.actions$.pipe(Vt(te.stopLoadingFiles));this.params$=Zy([this.store.select(c1),this.store.select(g$1.getShowDuplicateFiles),this.store.select(g$1.getSortBy),this.store.select(g$1.getSortAsc)]).pipe(yn$1(([e])=>!!e));this.startLoading$=Dr$1(()=>this.actions$.pipe(Vt(te.startLoadingFiles),Ju(()=>this.params$.pipe(Xu(this.stopLoading$),le(([e,t,o,n])=>_$1.loadAlbumFiles({albumId:e,showDuplicates:t,sortBy:o,sortAsc:n,skip:0,take:oi}))))));this.load$=Dr$1(()=>this.actions$.pipe(Vt(_$1.loadAlbumFiles),Ju(({albumId:e,showDuplicates:t,sortBy:o,sortAsc:n,skip:r,take:_})=>this.albumService.getFiles(e,t,o,n,r,_).pipe(Xu(this.stopLoading$),le(({total:S,items:h})=>_$1.loadAlbumFilesSuccess({total:S,files:h})),Hs(S=>js(_$1.loadAlbumFilesFailed({error:S})))))));this.nextPage$=Dr$1(()=>this.actions$.pipe(Vt(te.loadNextPage),hd(this.params$),le(([{skip:e},[t,o,n,r]])=>_$1.loadAlbumFiles({albumId:t,showDuplicates:o,sortBy:n,sortAsc:r,skip:e,take:oi}))));this.selectAll$=Dr$1(()=>this.actions$.pipe(Vt(te.selectAllFiles),hd(this.store.select(ae.getAll),this.store.select(ae.getTotal)),Ju(([,e,t])=>e.length===t?js(S.selectFiles({ids:e.map(o=>o.fileId),selected:true})):this.params$.pipe(dd(),Ju(([o,n,r,_])=>this.albumService.getFiles(o,n,r,_,e.length,t-e.length).pipe(me(({items:S$1,total:h})=>[S.selectFiles({ids:[...e.map(x=>x.fileId),...S$1.map(x=>x.file.id)],selected:true}),_$1.loadAlbumFilesSuccess({total:h,files:S$1})]),Hs(()=>js())))))));this.checkTagAdded$=Dr$1(()=>this.actions$.pipe(Vt(te.checkAlbumFilesForTagAdded),hd(this.store.select(Lr$1.getCurrentAlbum),this.store.select(ae.getAll),this.store.select(ae.getTotal)),yn$1(([{tagId:e},t])=>t?.tagIds.includes(e)),Ju(([{tagId:e,fileIds:t},,o,n])=>{if(o.length!==n)return this.params$.pipe(dd(),le(([_,S,h,x])=>_$1.loadAlbumFiles({albumId:_,showDuplicates:S,sortBy:h,sortAsc:x,skip:0,take:oi})));let r=new Array();for(let _ of o)t.includes(_.fileId)&&!_.addedByTagIds.includes(e)&&r.push(x(w({},_),{addedByTagIds:[..._.addedByTagIds,e]}));for(let _ of t)o.some(S=>S.fileId===_)||r.push({fileId:_,addedByTagIds:[e],addedByPersonIds:[],addedByVisualSearch:false,addedToAlbum:false});
1return js(te.upsertManyFiles({files:r}));})));this.checkPersonAdded$=Dr$1(()=>this.actions$.pipe(Vt(te.checkAlbumFilesForPersonAdded),hd(this.store.select(Lr$1.getCurrentAlbum),this.store.select(ae.getAll),this.store.select(ae.getTotal)),yn$1(([{personId:e},t])=>t?.personIds.includes(e)),Ju(([{personId:e,fileIds:t},,o,n])=>{if(o.length!==n)return this.params$.pipe(dd(),le(([_,S,h,x])=>_$1.loadAlbumFiles({albumId:_,showDuplicates:S,sortBy:h,sortAsc:x,skip:0,take:oi})));let r=new Array();for(let _ of o)t.includes(_.fileId)&&!_.addedByPersonIds.includes(e)&&r.push(x(w({},_),{addedByPersonIds:[..._.addedByPersonIds,e]}));for(let _ of t)o.some(S=>S.fileId===_)||r.push({fileId:_,addedByTagIds:[],addedByPersonIds:[e],addedByVisualSearch:false,addedToAlbum:false});return js(te.upsertManyFiles({files:r}));})));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(ha$1),se(at));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var ai=class i{constructor(e){this.http=e;}getAllTags(){return this.http.get("api/Tags/All");}searchTags(e,t=false){return this.http.get("api/Tags",{params:{searchTerm:e}});}getAssignedTags(e,t){let o=new H();return t&&(o=o.append("generated","true")),this.http.get(`api/Tags/Assigned/${e}`,{params:o});}getSharedAssignedTags(e,t){let o=new H();return t&&(o=o.append("generated","true")),this.http.post("api/Tags/SharedAssigned",e,{params:o});}assignTag(e){return this.http.post("api/Tags/Assign",e);}assignManyTags(e){return this.http.put("api/Tags/AssignMany",e);}createTag(e){return this.http.post("api/Tags",e);}unassignTag(e,t){return this.http.delete(`api/Tags/Unassign/${e}/${t}`);}unassignManyTags(e){return this.http.put("api/Tags/UnassignedMany",e);}getTags(e){return this.http.post("api/Tags/Get",e);}getAlbumTagsPersonIds(e){return this.http.get(`api/Tags/TagsPersonFileId/${e}`);}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var ri=class i{constructor(e,t,o,n,r){this.actions$=e;this.albumService=t;this.tagService=o;this.router=n;this.store=r;this.dispatchMediaOverviewApi=bo(_r);this.stopLoad$=this.actions$.pipe(Vt(z.stopLoadAlbums));this.load$=Dr$1(()=>this.actions$.pipe(Vt(z.loadAlbums),me(({id:e,archive:t,parentAlbums:o,showDuplicates:n})=>this.albumService.getAlbums(e,t,o,n).pipe(Xu(this.stopLoad$),le(r=>yo.loadAlbumsSuccess({id:e,res:r})),Hs(r=>js(yo.loadAlbumsFailed({error:r})))))));this.create$=Dr$1(()=>this.actions$.pipe(Vt(z.createAlbum),Ju(({payload:e})=>this.albumService.createAlbum(e).pipe(ed(t=>{this.router.navigate(["/media/albums",t.id],{preserveFragment:true});}),le(t=>yo.createAlbumSuccess({album:t})),Hs(t=>js(yo.createAlbumFailed({error:t})))))));this.update$=Dr$1(()=>this.actions$.pipe(Vt(z.updateAlbum),Ju(({id:e,changes:t})=>this.albumService.updateAlbum(e,t).pipe(le(o=>yo.updateAlbumSuccess({album:o})),Hs(o=>js(yo.updateAlbumFailed({error:o})))))));this.addFiles$=Dr$1(()=>this.actions$.pipe(Vt(z.addFilesToAlbum),Ju(({albumId:e,fileIds:t,removeFromAlbum:o})=>this.albumService.addFilesToAlbum(e,t,o).pipe(le(({addedCount:n,ancestorIds:r})=>yo.addFilesToAlbumSuccess({id:e,fileIds:t,removeFromAlbum:o,addedCount:n,ancestorIds:r})),Hs(n=>js(yo.addFilesToAlbumFailed({error:n})))))));this.removeFiles$=Dr$1(()=>this.actions$.pipe(Vt(z.removeFilesFromAlbum),Ju(({albumId:e,fileIds:t,includeSubAlbums:o})=>this.albumService.removeFilesFromAlbum(e,t,o).pipe(ed(()=>this.dispatchMediaOverviewApi.changed({ids:t})),le(n=>yo.removeFilesFromAlbumSuccess({id:e,fileIds:t,removals:n})),Hs(n=>js(yo.removeFilesFromAlbumFailed({error:n})))))));this.delete$=Dr$1(()=>this.actions$.pipe(Vt(z.deleteAlbum),Ju(({id:e})=>this.albumService.deleteAlbum(e).pipe(hd(this.store.select(c1)),le(([t,o])=>(t.includes(o)&&this.router.navigate(["/media/albums"]),yo.deleteAlbumSuccess({ids:t}))),Hs(t=>js(yo.deleteAlbumFailed({error:t})))))));this.move$=Dr$1(()=>this.actions$.pipe(Vt(z.moveAlbum),Ju(({payload:e})=>this.albumService.moveAlbum(e).pipe(le(()=>yo.moveAlbumSuccess({payload:e})),Hs(t=>js(yo.moveAlbumFailed({error:t})))))));this.setFrontImage$=Dr$1(()=>this.actions$.pipe(Vt(z.setFrontImage),Ju(({albumId:e,fileId:t})=>this.albumService.setAlbumFrontImage({albumId:e,fileId:t}).pipe(le(()=>yo.setFrontImageSuccess({albumId:e,fileId:t})),Hs(o=>js(yo.setFrontImageFailed({error:o})))))));this.searchAndAddSimilarImages=Dr$1(()=>this.actions$.pipe(Vt(z.searchAndAddSimilarImages),Ju(({albumId:e})=>this.albumService.searchAndAddSimilarImages(e).pipe(le(()=>yo.searchAndAddSimilarImagesSuccess()),Hs(t=>js(yo.searchAndAddSimilarImagesFailed({error:t})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(ha$1),se(ai),se(F),se(at));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var Tn=(i,e)=>new N$2(t=>{let o=()=>{er(i,e),t.next(),t.complete();};if(!tr(e)){o();return;}nr(i,e).then(n=>{if(!n){o();return;}t.next(),t.complete();}).catch(n=>{if(rr(n)){t.next(),t.complete();return;}o();});}),er=(i,e)=>{let t=document.createElement("a");t.href=i,t.download=e,document.body.appendChild(t),t.click(),document.body.removeChild(t);},tr=i=>ir()&&or(i)&&typeof navigator.share=="function",ir=()=>/iPhone/i.test(window.navigator.userAgent),or=i=>{let e=i.split(".").pop()?.toLowerCase();return!!e&&lr.has(e);},nr=(i,e)=>E(null,null,function*(){let t=yield fetch(i,{credentials:"same-origin"});if(!t.ok)throw new Error(`Failed to fetch file for sharing: ${t.status}`);let o=yield t.blob(),r={files:[new File([o],e,{type:o.type||ar(e)})],title:e};return typeof navigator.canShare=="function"&&!navigator.canShare(r)?false:(yield navigator.share(r),true);}),ar=i=>{switch(i.split(".").pop()?.toLowerCase()){case"avif":return"image/avif";case"bmp":return"image/bmp";case"gif":return"image/gif";case"heic":return"image/heic";case"heif":return"image/heif";case"jpeg":case"jpg":return"image/jpeg";case"png":return"image/png";case"svg":return"image/svg+xml";case"tif":case"tiff":return"image/tiff";case"webp":return"image/webp";default:return"application/octet-stream";}},rr=i=>i instanceof DOMException&&i.name==="AbortError",lr=new Set(["avif","bmp","gif","heic","heif","jpeg","jpg","png","svg","tif","tiff","webp"]);var ft=(i,e)=>{let t=document.createElement("a");t.href=i,t.download=e,t.click(),t.remove();};var li=class i{constructor(){this.http=_$2(Fr$1);}getZip(e){return this.http.post("api/Media/Files/Zip",e);}getZipFromCustomDownload(e){return this.http.get(`api/Media/Files/Zip/CustomDownload/${e}`);}static{this.ɵfac=function(t){return new(t||i)();};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var si=class i{constructor(e,t,o){this.http=e;this.signalR=t;this.zipDownloadService=o;}downloadFiles(e,t,o){if(e.length===1){let n=e[0];return this.downloadFile(n.url,n.fileName),js(true);}return this.zipDownloadService.getZip({fileIds:e.map(n=>n.id),customDownloadSettings:null,purpose:o}).pipe(ed(({url:n})=>{ft(n,t);}),le(()=>true));}downloadCustomFiles(e,t,o,n){return this.zipDownloadService.getZip({fileIds:e,customDownloadSettings:t,purpose:n}).pipe(ed(({url:r})=>{ft(r,o);}),le(({url:r})=>r));}downloadFile(e,t){ft(e,t);}getDownloadFileProgressed(e){return this.signalR.getData("GetCustomDownloadFileProgressed",e);}getDownloadReady(e){return this.signalR.getData("GetDownloadReady",e);}getCustomDownload(e){return this.http.get(`api/File/InternalDownload/${e}`);}downloadCustomDownload(e,t){return this.zipDownloadService.getZipFromCustomDownload(e).pipe(ed(({url:o})=>{ft(o,t);}),le(()=>true));}startCustomDownload(e){return this.http.post("api/File/InternalDownload",e);}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1),se(Mn),se(li));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var ci=class i{constructor(e,t,o,n,r){this.actions$=e;this.downloadService=t;this.snackbar=o;this.signalR=n;this.store=r;this.downloadFiles$=Dr$1(()=>this.actions$.pipe(Vt(P.downloadFiles),me(({files:e,purpose:t})=>this.downloadService.downloadFiles(e,this.getArchiveName("download"),t).pipe(le(()=>(this.store.dispatch(lt.trackDownloaded({mediaFileIds:e.map(o=>o.id),purpose:t})),P.downloadFilesSuccess(e))),Hs(o=>(this.snackbar.open("Lataus ep\xE4onnistui: "+o.message+"","Yrit\xE4 uudelleen"),js(P.downloadFilesFailed(e,o.message))))))));this.createCustomDownload$=Dr$1(()=>this.actions$.pipe(Vt(P.createCustomDownload),me(({fileIds:e,settings:t,purpose:o})=>this.downloadService.downloadCustomFiles(e,t,this.getArchiveName("download"),o).pipe(le(n=>P.createCustomDownloadSuccess({id:t.id,url:n})),Hs(n=>js(P.createCustomDownloadFailed({id:t.id,err:n})))))));this.downloadFileProgressed$=Dr$1(()=>this.actions$.pipe(Vt(P.createCustomDownload),Ju(({settings:{id:e}})=>this.downloadService.getDownloadFileProgressed(e).pipe(Xu(Zy([this.actions$.pipe(Vt(P.customDownloadFilesReady),yn$1(t=>t.downloadId===e)),this.actions$.pipe(Vt(P.downloadCustomFilesFailed),yn$1(t=>t.downloadId===e)),this.actions$.pipe(Vt(P.closeDownload))])),le(t=>P.downloadFileProgressed(e,t))))));this.downloadCustomFiles$=Dr$1(()=>this.actions$.pipe(Vt(P.downloadCustomFiles),me(({downloadId:e})=>this.downloadService.downloadCustomDownload(e,this.getArchiveName("download")).pipe(le(()=>P.downloadCustomFilesSuccess(e)),Hs(t=>js(P.downloadCustomFilesFailed(e,t.message)))))));this.downloadCustomFile$=Dr$1(()=>this.actions$.pipe(Vt(P.downloadCustomFile),me(({model:e})=>this.downloadService.startCustomDownload(e))),{dispatch:false});this.downloadCustomFileCompleted$=Dr$1(()=>this.actions$.pipe(Vt(P.downloadCustomFile),me(({model:{id:e}})=>this.getCustomDownloadReady(e).pipe(ed(t=>{if(t.status===1){let o=t.files[0];o&&Tn(o.url,o.fileName).subscribe();}}),le(t=>t.status===2?P.downloadCustomFileFailed({downloadId:e,error:t.errorMessage}):P.downloadCustomFileSuccess({downloadId:e})),Hs(t=>js(P.downloadCustomFileFailed({downloadId:e,error:t.message})))))));}getArchiveName(e){let t=new Date(),o=t.getFullYear(),n=t.getMonth(),r=t.getDay(),_=t.getHours(),S=t.getMinutes(),h=t.getSeconds();return`${e} ${o}-${n}-${r} ${_}${S}${h}.zip`;}getCustomDownloadReady(e){return this.signalR.getIsConnected().pipe(Ju(t=>t?this.downloadService.getDownloadReady(e):Ce(500,5e3).pipe(Ju(()=>this.downloadService.getCustomDownload(e).pipe(yn$1(o=>o.status===2||o.status===1))))),dd());}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(si),se(Mt),se(Mn),se(at));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var di=class i{constructor(e){this.http=e;}getApprovals(){return this.http.get("api/Ai/Person/Approval");}createApproval(e){return this.http.post("api/Ai/Person/Approval",e);}updateApproval(e){return this.http.put("api/Ai/Person/Approval",e);}deleteApproval(e){return this.http.delete(`api/Ai/Person/Approval/${e}`);}getFileApproval(e){return this.http.get(`api/Ai/Person/Approval/${e}`);}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var pi=class i{constructor(e,t,o){this.actions$=e;this.approvalService=t;this.store=o;this.loadApprovals$=Dr$1(()=>this.actions$.pipe(Vt(ne.loadApprovals),hd(this.store.select(r1)),Ju(([e,t])=>this.approvalService.getFileApproval(t).pipe(le(o=>ne.loadApprovalsSuccess({payload:o})),Hs(o=>js(ne.loadApprovalsFailed({err:o})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(di),se(at));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var mi=class i{constructor(e,t,o){this.actions$=e;this.fileService=t;this.albumService=o;this.stopLoad$=this.actions$.pipe(Vt(q.stopLoadDetails));this.load$=Dr$1(()=>this.actions$.pipe(Vt(q.loadDetails),Ju(({id:e})=>this.fileService.getDetails(e).pipe(Xu(this.stopLoad$),le(t=>b.loadDetailsSuccess({details:t})),Hs(t=>js(b.loadDetailsFailed({id:e,error:t})))))));this.loadSuccess$=Dr$1(()=>this.actions$.pipe(Vt(b.loadDetailsSuccess),Ju(({details:e})=>js(se$1.loadCurrentTagsSuccess({payload:e.tags})))));this.processed$=Dr$1(()=>this.actions$.pipe(Vt(q.loadDetails),Ju(({id:e})=>this.fileService.getFileCreated(e).pipe(Xu(this.stopLoad$),le(t=>He.fileCreated({file:t,listType:"details"}))))),{useEffectsErrorHandler:false});this.metadataUpdated$=Dr$1(()=>this.actions$.pipe(Vt(q.loadDetails),Ju(({id:e})=>this.fileService.getMetadataUpdates(e).pipe(Xu(this.stopLoad$),le(t=>b.metadataUpdated(e,t))))),{useEffectsErrorHandler:false});this.locationUpdated$=Dr$1(()=>this.actions$.pipe(Vt(q.loadDetails),Ju(({id:e})=>this.fileService.getLocationUpdates(e).pipe(Xu(this.stopLoad$),le(t=>b.locationUpdated(e,t))))),{useEffectsErrorHandler:false});this.updateLocation$=Dr$1(()=>this.actions$.pipe(Vt(q.updateLocation),Ju(({mediaFileId:e,coordinate:t})=>this.fileService.updateLocation(e,t).pipe(le(()=>b.updateLocationSuccess()),Hs(o=>js(b.updateLocationFailed()))))));this.deleteLocation$=Dr$1(()=>this.actions$.pipe(Vt(q.deleteLocation),Ju(({mediaFileId:e})=>this.fileService.deleteLocation(e).pipe(le(()=>b.deleteLocationSuccess(e)),Hs(t=>js(b.deleteLocationFailed(e)))))));this.getFullMetadataUpdates$=Dr$1(()=>this.actions$.pipe(Vt(q.loadDetails),Ju(({id:e})=>this.fileService.getFullMetadataUpdates(e).pipe(Xu(this.stopLoad$),le(t=>b.fullMetadataUpdated(e,t))))),{useEffectsErrorHandler:false});this.removeFileFromAllAlbums$=Dr$1(()=>this.actions$.pipe(Vt(q.removeFileFromAllAlbums),Ju(({fileId:e})=>this.albumService.removeFileFromAllAlbums(e).pipe(le(()=>b.removeFileFromAllAlbumsSuccess({fileId:e})),Hs(t=>js(b.removeFileFromAllAlbumsFailed({fileId:e,error:t})))))));this.loadAlbums$=Dr$1(()=>this.actions$.pipe(Vt(q.loadAlbums),me(({mediaFileId:e})=>this.albumService.getAlbumToFile(e).pipe(Xu(this.actions$.pipe(Vt(q.stopLoadAlbums),yn$1(({mediaFileId:t})=>t===e))),le(({albums:t,frontImages:o})=>b.loadAlbumsSuccess({mediaFileId:e,albums:t,frontImages:o})),Hs(t=>js(b.loadAlbumsFailed({mediaFileId:e,error:t})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(R),se(ha$1));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var ui=class i{constructor(e,t){this.http=e;this.mediaHubSignalR=t;}trackGalleryOpened(e){return this.http.post("api/Tracking/MediaFile/GalleryOpened",e);}trackMediaFilesDownloaded(e){return this.http.post("api/Tracking/MediaFile/Downloaded",e);}trackMediaFileDetailsOpened(e){return this.http.post("api/Tracking/MediaFile/Detail
1sOpened",e);}getActivities(e){return this.http.get(`api/Tracking/MediaFile/${e}/Activities`);}getNewActivities(e){return this.mediaHubSignalR.getData("GetMediaFileActivities",e);}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1),se(Mn));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var _i=class i{constructor(e,t,o,n,r,_,S$1){this.actions$=e;this.fileService=t;this.store=o;this.router=n;this.dialog=r;this.mediaHubSignalR=_;this.mediaFileTrackingService=S$1;this.dispatchMediaOverviewApi=bo(_r);this.load$=Dr$1(()=>this.actions$.pipe(Vt(S.loadMediaFiles),Ju(({folderId:e,skip:t,take:o,workspaceId:n,sortBy:r,sortAsc:_,showDuplicate:S})=>this.fileService.getMediaFiles(n,e,t,o,r,_,S).pipe(le(({files:h,total:x})=>He.loadMediaFilesSuccess({files:h,total:x,skip:t})),Hs(h=>js(He.loadMediaFilesFailed({error:h})))))));this.loadAllFiles$=Dr$1(()=>this.actions$.pipe(Vt(S.selectAllMediaFiles),Ju(({folderId:e,skip:t,take:o,workspaceId:n,sortBy:r,sortAsc:_,showDuplicate:S})=>this.fileService.getMediaFiles(n,e,t,o,r,_,S).pipe(le(({files:h,total:x})=>He.selectAllMediaFilesSuccess({files:h,total:x,skip:t})),Hs(h=>js(He.selectAllMediaFilesFailed({error:h})))))));this.loadSingleFile$=Dr$1(()=>this.actions$.pipe(Vt(S.loadSingleMediaFile),me(({id:e,listType:t})=>this.fileService.getSingleMediaFile(e).pipe(le(o=>He.loadSingleMediaFileSuccess({file:o,listType:t}),ed(()=>this.store.select(g$1.getFileById,{id:e}))),Hs(o=>js(He.loadSingleMediaFileFailed({err:o})))))));this.loadStream$=Dr$1(()=>this.actions$.pipe(Vt(S.loadStreamFiles),Ju(({skip:e,take:t,showDuplicates:o})=>this.fileService.getMediaFiles(null,null,e,t,0,false,o).pipe(le(({files:n,total:r})=>He.loadStreamFilesSuccess({files:n,total:r})),Hs(n=>js(He.loadStreamFilesFailed({error:n})))))));this.folderFileProccessed$=Dr$1(()=>this.actions$.pipe(Vt(S.loadMediaFiles),Ju(({workspaceId:e,folderId:t})=>this.fileService.getFolderFileCreated(e,t).pipe(Xu(this.actions$.pipe(Vt(S.stopLoadMediaFiles))),le(o=>He.fileCreated({file:o,listType:"folder"}))))),{useEffectsErrorHandler:false});this.filesProcessed$=Dr$1(()=>this.actions$.pipe(Vt(S.loadStreamFiles),Ju(()=>this.fileService.getFilesCreated().pipe(Xu(this.actions$.pipe(Vt(S.stopLoadMediaFiles))),le(e=>He.fileCreated({file:e,listType:"stream"}))))),{useEffectsErrorHandler:false});this.delete$=Dr$1(()=>this.actions$.pipe(Vt(S.deleteMediaFiles),Ju(({ids:e})=>this.dialog.open(Wt,{data:e,panelClass:"mh-dialog"}).afterClosed().pipe(hd(this.store.select(Au)),Ju(([t,o])=>t?this.fileService.deleteFiles(e).pipe(le(()=>He.deleteMediaFilesSuccess({ids:e})),ed(()=>{let n=+o.file;e.includes(n)&&this.router.navigate([],{queryParams:{file:null},queryParamsHandling:"merge"}),this.store.dispatch(U.loadLicenseData());}),Hs(n=>js(He.deleteMediaFilesFailed({error:n,ids:e})))):js(S.deleteMediaFilesCanceled()))))));this.move$=Dr$1(()=>this.actions$.pipe(Vt(S.moveMediaFiles),Ju(({fileIds:e,folderId:t,workspaceId:o})=>this.fileService.moveFiles({fileIds:e,workspaceId:o,folderId:t}).pipe(hd(this.store.select(n1),this.store.select(bu)),ed(()=>this.dispatchMediaOverviewApi.changed({ids:e})),le(([,n,r])=>He.moveMediaFilesSuccess({ids:e,folderId:t,workspaceId:o,currentWorkspaceId:n,currentFolderId:r})),Hs(n=>js(He.moveMediaFilesFailed({error:n,ids:e,folderId:t,workspaceId:o})))))));this.selectFile$=Dr$1(()=>this.actions$.pipe(Vt(S.selectFiles),hd(this.store.select(g$1.getSelectedIds)),ed(([,e])=>{localStorage.setItem("selectedFiles",JSON.stringify(e));})),{dispatch:false});this.selectAllFiles$=Dr$1(()=>this.actions$.pipe(Vt(S.selectAllFiles),hd(this.store.select(g$1.getSelectedIds)),ed(([,e])=>{localStorage.setItem("selectedFiles",JSON.stringify(e));})),{dispatch:false});this.loadSelectedFiles$=Dr$1(()=>this.actions$.pipe(Vt(S.loadSelectedFiles),Ju(()=>this.fileService.loadSelectedFiles().pipe(le(e=>He.loadSelectedFilesSuccess({files:e})),Hs(e=>(localStorage.removeItem("selectedFiles"),js(He.loadSelectedFilesFailed({error:e}))))))));this.sort$=Dr$1(()=>this.actions$.pipe(Vt(S.updateSortBy),ed(({sortBy:e})=>{localStorage.setItem("mediaSortBy",e.toString());})),{dispatch:false});this.sortDirections$=Dr$1(()=>this.actions$.pipe(Vt(S.updateSortDirection),ed(({asc:e})=>{localStorage.setItem("mediaSortByDirection",e?"asc":"desc");})),{dispatch:false});this.toggleIsPublic$=Dr$1(()=>this.actions$.pipe(Vt(S.togglePublicStatus),me(({id:e,isPublic:t,currentValue:o})=>this.fileService.toggleIsPublic(e,t).pipe(le(()=>He.togglePublicStatusSuccess({id:e,isPublic:t})),Hs(()=>js(He.togglePublicStatusFailed({id:e,currentValue:o})))))));this.toggleFilesIsPublic$=Dr$1(()=>this.actions$.pipe(Vt(S.toggleFilesPublicStatus),me(({ids:e,isPublic:t})=>this.fileService.toggleFilesIsPublic(e,t).pipe(le(()=>He.toggleFilesPublicStatusSuccess({ids:e,isPublic:t})),Hs(o=>js(He.toggleFilesPublicStatusFailed({ids:e,isPublic:t,error:o})))))));this.editFileName$=Dr$1(()=>this.actions$.pipe(Vt(He.editFileName),me(({id:e,name:t})=>this.fileService.renameFile({id:e,name:t}).pipe(le(o=>He.editFileNameSuccess({id:e,name:t,originalUrl:o.originalUrl})),Hs(o=>js(He.editFileNameFailed({err:o})))))));this.editManyFileNames$=Dr$1(()=>this.actions$.pipe(Vt(He.renameManyFiles),me(({payload:e})=>this.fileService.renameManyFiles(e).pipe(le(t=>He.renameManyFilesSuccess({ids:e.ids,files:t})),Hs(t=>js(He.renameManyFilesFailed({err:t})))))));this.editFileMetadata$=Dr$1(()=>this.actions$.pipe(Vt(S.editFileMetaData),Ju(({payload:e})=>this.fileService.updateFileMetaData(e).pipe(le(()=>S.editFileMetaDataSuccess()),Hs(t=>js(S.editFileMetaDataFailed(t)))))));this.gridFilenames$=Dr$1(()=>this.actions$.pipe(Vt(S.updateMediaGridFilenameOption),ed(({option:e})=>{localStorage.setItem("show_grid_filenames",e);})),{dispatch:false});this.trimGridFilename$=Dr$1(()=>this.actions$.pipe(Vt(S.updateMediaGridTrimFilenameOption),ed(({option:e})=>{localStorage.setItem("trim_grid_filenames",e);})),{dispatch:false});this.trimGridFileExt$=Dr$1(()=>this.actions$.pipe(Vt(S.updateMediaGridTrimFileExt),ed(({value:e})=>{localStorage.setItem("trim_grid_file_ext",e.toString());})),{dispatch:false});this.showDuplicates$=Dr$1(()=>this.actions$.pipe(Vt(S.updateShowDuplicateFiles),ed(({value:e})=>{localStorage.setItem("show_duplicates",e.toString());})),{dispatch:false});this.mediaGridView$=Dr$1(()=>this.actions$.pipe(Vt(S.updateMediaGridView),ed(({gridView:e})=>{localStorage.setItem("grid_view",e.toString());})),{dispatch:false});this.updateLocations$=Dr$1(()=>this.actions$.pipe(Vt(S.updateLocations),Ju(({coordinate:e,fileIds:t})=>this.fileService.updateFilesLocation({coordinate:e,fileIds:t}).pipe(le(()=>He.updateLocationsSuccess(t,e)),Hs(o=>js(He.updateLocationsFailed(o)))))));this.signalRFallback$=Dr$1(()=>this.mediaHubSignalR.fallback().pipe(Ju(()=>this.store.select(g$1.getNotProcessedFiles).pipe(dd(),yn$1(t=>t.length>0),Ju(t=>{let o=t.map(n=>n.id);return this.fileService.loadNotProcessedFiles(o).pipe(le(n=>He.loadNotProcessedFilesSuccess({files:n}
1)),Hs(()=>js(null)),yn$1(n=>!!n));})))));this.trackGalleryOpened$=Dr$1(()=>this.actions$.pipe(Vt(lt.trackGalleryOpened),me(({mediaFileId:e})=>this.mediaFileTrackingService.trackGalleryOpened({mediaFileId:e}))),{dispatch:false});this.trackDownloaded$=Dr$1(()=>this.actions$.pipe(Vt(lt.trackDownloaded),me(({mediaFileIds:e,purpose:t})=>this.mediaFileTrackingService.trackMediaFilesDownloaded({mediaFileIds:e,purpose:t}))),{dispatch:false});this.trackDetailsOpened$=Dr$1(()=>this.actions$.pipe(Vt(lt.trackDetailsOpened),me(({mediaFileId:e})=>this.mediaFileTrackingService.trackMediaFileDetailsOpened({mediaFileId:e}))),{dispatch:false});this.loadByIds$=Dr$1(()=>this.actions$.pipe(Vt(S.loadByIds),me(({ids:e})=>this.fileService.getFilesByIds(e).pipe(le(t=>He.loadByIdsSuccess({files:t})),Hs(t=>js(He.loadByIdsFailed({error:t})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(R),se(at),se(F),se(ee$1),se(Mn),se(ui));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var fi=class i{constructor(e,t,o){this.actions$=e;this.folderService=t;this.folderPermissionService=o;this.toggleNavigation$=Dr$1(()=>this.actions$.pipe(Vt(w$1.toggleNavigation,u.toggleNavigation),yn$1(({opened:e})=>e),Ju(e=>{let t,o;return e.type===w$1.toggleNavigation.type?(t=e.workspaceId,o=e.id):(t=e.id,o=null),this.folderService.getSubFolders(t,o).pipe(le(n=>h.loadSubFoldersSuccess({folders:n})),Hs(n=>js(h.loadSubFoldersFailed({error:n}))));})));this.loadContent$=Dr$1(()=>this.actions$.pipe(Vt(w$1.loadFolders),Ju(({workspaceId:e,mainFolderId:t,loadParents:o})=>this.folderService.loadFolders(e,t,o).pipe(ed(n=>{typeof t=="number"&&this.folderPermissionService.setFolderPermissions(t,n.folderPermissions??[]);}),le(n=>h.loadFolderContentSuccess({params:{workspaceId:e,mainFolderId:t},data:n,loadParents:o})),Hs(n=>js(h.loadFolderContentFailed({error:n,params:{workspaceId:e,mainFolderId:t}})))))));this.createFolder$=Dr$1(()=>this.actions$.pipe(Vt(w$1.createFolder),me(({payload:e})=>this.folderService.createFolder(e).pipe(le(t=>h.createFolderSuccess({folder:t})),Hs(t=>js(h.createFolderFailed(t)))))));this.updateFolder$=Dr$1(()=>this.actions$.pipe(Vt(w$1.updateFolder),me(({id:e,payload:t})=>this.folderService.updateFolder(e,t).pipe(le(()=>h.updateFolderSuccess({id:e,changes:t})),Hs(o=>js(h.updateFolderFailed({id:e,error:o})))))));this.updateAiModules$=Dr$1(()=>this.actions$.pipe(Vt(w$1.updateAiModules),me(({id:e,changes:t})=>this.folderService.updateFolder(e,t).pipe(le(()=>h.updateAiModulesSuccess({id:e,changes:t})),Hs(o=>js(h.updateAiModulesFailed({error:o})))))));this.moveFolder$=Dr$1(()=>this.actions$.pipe(Vt(w$1.moveFolder),me(({id:e,payload:t})=>this.folderService.moveFolder(e,t).pipe(le(o=>h.moveFolderSuccess({id:e,changes:{workspaceId:t.workspaceId,mainFolderId:t.mainFolderId},workspace:o.workspace})),Hs(o=>js(h.moveFolderFailed({id:e,error:o})))))));this.setFolderFrontImage$=Dr$1(()=>this.actions$.pipe(Vt(w$1.setFolderFrontImage),me(({id:e,fileId:t})=>this.folderService.setFolderFrontImage(e,{fileId:t}).pipe(le(()=>h.setFolderFrontImageSuccess({id:e,changes:{frontImageId:t}})),Hs(o=>js(h.setFolderFrontImageFailed({id:e,error:o,fileId:t})))))));this.deleteFolder$=Dr$1(()=>this.actions$.pipe(Vt(w$1.deleteFolder),me(({id:e})=>this.folderService.deleteFolder(e).pipe(le(()=>h.deleteFolderSuccess({id:e})),Hs(t=>js(h.deleteFolderFailed({id:e,error:t})))))));this.sort$=Dr$1(()=>this.actions$.pipe(Vt(w$1.updateFolderSortBy),ed(({folderSortBy:e})=>{localStorage.setItem("folderSortBy",e.toString());})),{dispatch:false});this.sortDirection$=Dr$1(()=>this.actions$.pipe(Vt(w$1.updateFolderSortDirection),ed(({asc:e})=>{localStorage.setItem("folderSortByDirection",e?"asc":"desc");})),{dispatch:false});}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(Ue),se(Qe));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var gi=class i{constructor(e,t){this.actions$=e;this.mediaShareService=t;this.loadMediaShares$=Dr$1(()=>this.actions$.pipe(Vt(I.loadMediaShares),Ju(({payload:e})=>{switch(e.type){case 0:return this.mediaShareService.getAlbumShares(e.id).pipe(le(t=>I.loadMediaSharesSuccess({payload:t})),Hs(t=>js(I.loadMediaSharesFailed({error:t}))));case 1:return this.mediaShareService.getFolderShares(e.id).pipe(le(t=>I.loadMediaSharesSuccess({payload:t})),Hs(t=>js(I.loadMediaSharesFailed({error:t}))));case 2:return this.mediaShareService.getWorkspaceShares(e.id).pipe(le(t=>I.loadMediaSharesSuccess({payload:t})),Hs(t=>js(I.loadMediaSharesFailed({error:t}))));}})));this.create$=Dr$1(()=>this.actions$.pipe(Vt(I.createMediaShare),Ju(({payload:e})=>this.mediaShareService.createMediaShares(e).pipe(le(t=>I.createMediaShareSuccess({payload:t})),Hs(t=>js(I.createMediaShareFailed(t)))))));this.update$=Dr$1(()=>this.actions$.pipe(Vt(I.updateMediaShare),Ju(({payload:e})=>this.mediaShareService.updateAlbumShare(e.id,e.changes).pipe(le(t=>I.updateMediaShareSuccess({payload:e})),Hs(t=>js(I.updateMediaShareFailed(t)))))));this.deleteAlbum$=Dr$1(()=>this.actions$.pipe(Vt(I.deleteMediaShare),Ju(({payload:e})=>this.mediaShareService.deleteAlbumShare(e.id).pipe(le(()=>I.deleteMediaShareSuccess({payload:e})),Hs(t=>js(I.deleteMediaShareFailed(t)))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(C$2));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var Si=class i{static{this.formats={B:{max:1024},kB:{max:Math.pow(1024,2),prev:"B"},KB:{max:Math.pow(1024,2),prev:"B"},MB:{max:Math.pow(1024,3),prev:"kB"},GB:{max:Math.pow(1024,4),prev:"MB"},TB:{max:Number.MAX_SAFE_INTEGER,prev:"GB"}};}
1static formatResult(e,t){return`${e.toLocaleString().replace(".",",")} ${t}`;}static calculateResult(e,t){let o=e.prev?i.formats[e.prev]:void 0;return o?t/o.max:t;}transform(e,t=0,o="B",n){if(!(this.isNumberFinite(e)&&this.isNumberFinite(t)&&this.isInteger(t)&&this.isPositive(t)))return e;let r=e,_=o;for(;_!=="B";)r*=1024,_=i.formats[_].prev;if(n){let S=i.formats[n],h=this.toDecimal(i.calculateResult(S,r),t);return i.formatResult(h,n);}for(let S in i.formats)if(i.formats.hasOwnProperty(S)){let h=i.formats[S];if(r<h.max){let x=this.toDecimal(i.calculateResult(h,r),t);return i.formatResult(x,S);}}}isNumber(e){return typeof e=="number";}isNumberFinite(e){return this.isNumber(e)&&isFinite(e);}isInteger(e){return e%1===0;}toDecimal(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t);}isPositive(e){return e>=0;}static{this.ɵfac=function(t){return new(t||i)();};}static{this.ɵpipe=hb({name:"bytes",type:i,pure:true,standalone:false});}};function fr(i,e){i&1&&(rs(0,"h3"),PT(1,5),tu());}function gr(i,e){if(i&1&&(rs(0,"mat-option",14),vC(1),tu()),i&2){let t=e.$implicit;Om("value",t.value)("disabled",t.readonly),KI(),su(" ",t.name," ");}}var Ei=class i{constructor(){this.upgradeLicense=new nt();this.licenseForm=new P$2({storage:new q$1(0,this.validateStorageInput),userCount:new q$1(0),acceptedTerms:new q$1(false,ve$1.requiredTrue),aiModules:new q$1(T$1)});this.aiModuleTypeMap=o;this.aiModule=a;this.aiModuleTypes=new Array();}get storage(){return this.licenseForm.get("storage").value;}set storage(e){this.licenseForm.get("storage").setValue(e);}get userCount(){return this.licenseForm.get("userCount").value;}set userCount(e){this.licenseForm.get("userCount").setValue(e);}
1get saveButtonDisabled(){return this.licenseForm.invalid||this.licenseForm.get("userCount").value===0&&this.licenseForm.get("storage").value===0&&this.aiModulesLength===this.aiModulesCount;}ngOnChanges(e){e.organization?.currentValue&&(this.aiModuleTypes=[...(this.organization?.licenseData.aiModules.filter(t=>!c$1.includes(t)&&!s.has(t)).map(t=>({value:t,name:o[t],readonly:true}))??[]),...g$2]);}ngOnInit(){this.createForm();}get aiModulesLength(){return this.licenseForm.get("aiModules").value.length;}createForm(){if(this.organization?.licenseData){let e=Array.from(new Set([...T$1,...this.organization.licenseData.aiModules]));this.licenseForm.patchValue({aiModules:e});}this.aiModulesCount=this.licenseForm.get("aiModules").value.length,this.licenseForm.valueChanges.subscribe(console.log);}handleSubmit(){this.upgradeLicense.emit(this.licenseForm.getRawValue());}calculateDecimal(){return this.organization.licenseData.maxStorage>Math.pow(1024,4)?2:0;}validateStorageInput(e){return e.value%50===0?null:{validateStorageInput:{valid:false}};}static{this.ɵfac=function(t){return new(t||i)();};}static{this.ɵcmp=ub({type:i,selectors:[["app-upgrade-license-form"]],inputs:{organization:"organization",fromUpload:"fromUpload"},outputs:{upgradeLicense:"upgradeLicense"},standalone:false,features:[EE],decls:27,vars:17,consts:()=>{let e;e="Jotta tilausta voidaan laajentaa maksua vastaan, valintaruudussa on oltava rasti ja k\xE4ytt\xE4j\xE4lisenssien, tallennustilan tai teko\xE4lymoduulien arvoja on muutettava.";let t;t="K\xE4ytt\xE4j\xE4lisenssit (nykyinen "+"\uFFFD0\uFFFD"+" lisenssi\xE4)";let o;o="Tallennustila (nykyinen "+"\uFFFD0\uFFFD"+")";let n;n="AI-moduulit";let r;r="Haluan laajentaa tilaustani maksua vastaan.";let _;_="Tallenna";let S;return S="Ei riitt\xE4v\xE4sti tallennustilaa",[t,o,n,r,_,S,[1,"license-form",3,"submit","formGroup"],["formControlName","userCount","matInput","","type","number"],["discrete","",1,"slider",3,"step","min","max"],["matSliderThumb","",3,"valueChange","value"],["formControlName","storage","matInput","","type","number","step","50"],["matSuffix","",1,"storage-suffix"],[1,"full-width"],["multiple","","formControlName","aiModules"],[3,"value","disabled"],["formControlName","acceptedTerms",1,"full-width"],["type","submit","matButton","filled","matTooltip",e,"matTooltipPosition","below",1,"full-width",3,"disabled","matTooltipDisabled"]];},template:function(t,o){t&1&&(jb(0,fr,2,0,"h3"),rs(1,"form",6),rg("submit",function(){return o.handleSubmit();}),rs(2,"ui-form-field")(3,"ui-label"),PT(4,0),tu(),Pm(5,"input",7),Dw(),tu(),rs(6,"mat-slider",8)(7,"input",9),Ng("valueChange",function(r){return IC(o.userCount,r)||(o.userCount=r),r;}),tu()(),rs(8,"ui-form-field")(9,"ui-label"),PT(10,1),jC(11,"bytes"),tu(),Pm(12,"input",10),Dw(),rs(13,"div",11),vC(14,"GB"),tu()(),rs(15,"mat-slider",8)(16,"input",9),Ng("valueChange",function(r){return IC(o.storage,r)||(o.storage=r),r;}),tu()(),rs(17,"ui-form-field",12)(18,"ui-label"),PT(19,2),tu(),rs(20,"mat-select",13),$b(21,gr,2,3,"mat-option",14,Bb),tu(),Dw(),tu(),rs(23,"mat-checkbox",15),PT(24,3),tu(),Dw(),rs(25,"button",16),PT(26,4),tu()()),t&2&&(Vb(o.fromUpload?0:-1),KI(),Om("formGroup",o.licenseForm),KI(3),ng(o.organization.licenseData.maxUserCount),FT(4),KI(),bw(),KI(),Om("step",1)("min",0)("max",50),KI(),Sg("value",o.userCount),KI(4),ng(BC(11,14,o.organization.licenseData.maxStorage,o.calculateDecimal())),FT(10),KI(),bw(),KI(3),Om("step",50)("min",0)("max",1e3),KI(),Sg("value",o.storage),KI(4),bw(),KI(),Ub(o.aiModuleTypes),KI(2),bw(),KI(2),Om("disabled",o.saveButtonDisabled)("matTooltipDisabled",!o.saveButtonDisabled));},dependencies:[U$1,St,ne$1,Ue$1,_t$1,Oi,Ct,_o,ts,Zn$1,Xe,un,Wn$1,qn$1,Cn,_n$1,M,P$3,p,Si],styles:[".license-form[_ngcontent-%COMP%]{width:700px;display:grid;grid-template-columns:250px 1fr;gap:8px}.full-width[_ngcontent-%COMP%]{grid-column:1/-1}.storage-suffix[_ngcontent-%COMP%]{margin:0 5px}.slider[_ngcontent-%COMP%]{margin-top:22px}"]});}};function Er(i,e){if(i&1){let t=Zb();rs(0,"div")(1,"app-upgrade-license-form",6),jC(2,"async"),rg("upgradeLicense",function(n){tf(t);let r=VT();return nf(r.submitForm(n));}),tu()();}if(i&2){let t=VT();KI(),Om("organization",HC(2,2,t.organization$))("fromUpload",t.fromUpload);}}function hr(i,e){i&1&&(rs(0,"div",5),PT(1,1),tu());}var hi=class i{constructor(e,t,o){this.fromUpload=e;this.dialogRef=t;this.store=o;this.destroy$=new oe$1();}ngOnInit(){this.organization$=this.store.select(Ve),this.isOrgAdmin$=this.store.select(Ji),this.store.dispatch(U.resetOrganizationForm()),this.upgradeStatus$=this.store.select(Ly),this.status$=this.store.select(zy),this.closeAfterSave();}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}submitForm(e){this.store.dispatch(U.upgradeLicense({payload:{storage:e.storage,userCount:e.userCount,aiModules:e.aiModules,acceptedTerms:true}}));}closeAfterSave(){this.upgradeStatus$.pipe(Xu(this.destroy$),yn$1(e=>e==="completed"),Ft(1)).subscribe(()=>{this.dialogRef.close(true);});}static{this.ɵfac=function(t){return new(t||i)(ao($e),ao(O$1),ao(at));};}
1static{this.ɵcmp=ub({type:i,selectors:[["app-license-dialog"]],standalone:false,decls:10,vars:6,consts:()=>{let e;e="Laajenna tilausta";let t;return t="Varattu tallennustila ei riit\xE4, ilmoita asiasta yll\xE4pit\xE4j\xE4llesi.",[e,t,["mat-dialog-title","","id","extend-package-title"],["matIconButton","","mat-dialog-close",""],["svgIcon","close","size","small"],[1,"no-admin"],[3,"upgradeLicense","organization","fromUpload"]];},template:function(t,o){t&1&&(rs(0,"div",2),ou(1),PT(2,0),iu(),rs(3,"button",3),Pm(4,"mat-icon",4),tu()(),rs(5,"mat-dialog-content"),jb(6,Er,3,4,"div"),jC(7,"async"),jb(8,hr,2,0,"div",5),jC(9,"async"),tu()),t&2&&(KI(6),Vb(HC(7,2,o.isOrgAdmin$)?6:-1),KI(2),Vb(HC(9,4,o.isOrgAdmin$)?-1:8));},dependencies:[dt,jt,Nt,Vt$1,wt,c,u$1,Ei,ui$1],styles:[".no-admin[_ngcontent-%COMP%]{color:var(--mat-sys-error)}"]});}};var Fi=h$1(Gm,i=>i.uploads),Fr=h$1(Fi,i=>i.licenseMessageShown),{selectAll:Cr,selectTotal:Mr}=R$1.getSelectors(),Ui=h$1(Fi,Cr);h$1(Fi,Mr);var Dr=h$1(Fi,i=>i.folders),{selectAll:Ir}=Se.getSelectors(),Tr=h$1(Dr,Ir),On=(i,e,t,o,n)=>{let r=new Array();r.push(x(w({type:"folder"},i),{level:n}));for(let _ of t.filter(S=>S.folderUploadId===i.id).sort((S,h)=>S.startDate.valueOf()-h.startDate.valueOf()))r.push(x(w({type:"file"},_),{level:n+1,mediaFile:o[_.mediaId]||null}));for(let _ of e.filter(S=>S.mainFolderId===i.id).sort((S,h)=>S.name.localeCompare(h.name)))r.push(...On(_,e,t,o,n+1));return r;},vn=h$1(Tr,Ui,g$1.getEntities,(i,e,t)=>{let o=new Array();for(let n of e.filter(r=>!r.folderUploadId).sort((r,_)=>r.startDate.valueOf()-_.startDate.valueOf()))o.push(x(w({type:"file"},n),{level:0,mediaFile:t[n.mediaId]||null}));for(let n of i.filter(r=>!r.mainFolderId).sort((r,_)=>r.name.localeCompare(_.name)))o.push(...On(n,i,e,t,0));return o;});h$1(vn,i=>i.length);var vr=h$1(Ui,i=>i.filter(e=>e.status==="pending"||e.status==="uploading"));h$1(vr,i=>i.reduce((e,t)=>e+t.progress,0)/i.length);h$1(Ui,i=>i.map(e=>{if(e.error?.message==="file already exists")return e.id;}));var yr=h$1(Gm,i=>i.uploads.discardStatus),Lr=h$1(Gm,i=>i.uploads.decideDuplicateStatus),bn={getLicenseDialogDisplayed:Fr,getDiscardDuplicatesStatus:yr,getDecideDuplicatesStatus:Lr};var Ci=class i{constructor(e){this.http=e;}keepDuplicate(e){return this.http.post("api/Media/Duplicate/Keep",e);}discardDuplicate(e){return this.http.post("api/Media/Duplicate/Discard",e);}decideDuplicate(e){return this.http.post("api/Media/Duplicate/Decide",e);}keepAllDuplicates(){return this.http.post("api/Media/Duplicate/KeepAll",{});}discardAllDuplicates(){return this.http.post("api/Media/Duplicate/DiscardAll",{});}static{this.ɵfac=function(t){return new(t||i)(se(Fr$1));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac,providedIn:"root"});}};var Rr=1,Mi=class i{constructor(e,t,o,n,r,_){this.actions$=e;this.fileService=t;this.store=o;this.dialog=n;this.mediaDuplicateService=r;this.folderService=_;this.cancel$=this.actions$.pipe(Vt($.cancelUploadFile),le(({uploadId:e})=>e));this.clear$=this.actions$.pipe(Vt($.clearUploads));this.upload$=Dr$1(()=>this.actions$.pipe(Vt($.uploadFile),me(({file:e,id:t,folderId:o,workspaceId:n})=>this.fileService.uploadMediaFile(e,n,o).pipe(Xu(this.cancelUpload(t)),yn$1(r=>r.type===de.UploadProgress||r.type===de.Response),hd(this.store.select(n1),this.store.select(bu),this.store.select(Ve)),le(([r,_,S])=>{switch(r.type){case de.UploadProgress:{let h=r.loaded/r.total*100;return C$1.uploadFileProgressed({uploadId:t,progress:h});}case de.Response:{let h=r.body;return this.store.dispatch(U.loadLicenseData()),C$1.uploadFileSuccess({uploadId:t,file:h,isCurrentFolder:h.folderId===S&&h.workspaceId===_});}}}),Hs(r=>this.store.select(bn.getLicenseDialogDisplayed).pipe(dd(),Ju(_=>r==="not_enough_space"&&!_?(r="Ei tarpeeksi tallennustilaa.",this.store.dispatch($.licenseDialogDisplayed()),this.dialog.open(hi,{autoFocus:false,panelClass:"mh-dialog",disableClose:true,maxWidth:"97vw",restoreFocus:false,data:true}).afterClosed().pipe(le(S=>S?$.uploadFile(e,n,o,t):C$1.uploadFileFailed({uploadId:t,error:r})))):js(C$1.uploadFileFailed({uploadId:t,error:{fileId:null,message:r}})))))),Rr)));this.keepDuplicate$=Dr$1(()=>this.actions$.pipe(Vt($.keepDuplicateFile),me(({mediaFileIds:e})=>
1this.mediaDuplicateService.keepDuplicate(e).pipe(hd(this.store.select(n1),this.store.select(bu)),le(([t,o,n])=>C$1.keepDuplicateFileSuccess(t,t.filter(r=>r.workspaceId===o&&r.folderId===n).map(r=>r.id))),Hs(t=>js(C$1.keepDuplicateFileFailed(e,t)))))));this.discardDuplicate$=Dr$1(()=>this.actions$.pipe(Vt($.discardDuplicateFile),me(({mediaFileIds:e})=>this.mediaDuplicateService.discardDuplicate(e).pipe(le(()=>C$1.discardDuplicateFileSuccess(e)),Hs(t=>js(C$1.discardDuplicateFileFailed(e,t)))))));this.discardDuplicateSuccess$=Dr$1(()=>this.actions$.pipe(Vt(C$1.discardDuplicateFileSuccess),Ju(({mediaFileIds:e})=>js(S.removeFileFromState({ids:e})))));this.loadProcessedUploads$=Dr$1(()=>this.actions$.pipe(Vt($.loadProcessedUploads),Ju(()=>this.fileService.getProcessedUploads().pipe(Xu(this.actions$.pipe(Vt($.stopLoadProcessedUploads))),le(e=>C$1.uploadFileProcessed({file:e}))))),{useEffectsErrorHandler:false});this.decideDuplicates$=Dr$1(()=>this.actions$.pipe(Vt($.decideDuplicates),me(({payload:e})=>this.mediaDuplicateService.decideDuplicate(e).pipe(le(t=>C$1.decideDuplicatesSuccess(t,e.duplicateId)),Hs(t=>js(C$1.decideDuplicatesFailed(e.duplicateId,t)))))));this.uploadFolder$=Dr$1(()=>this.actions$.pipe(Vt(Be.uploadFolder),me(({folder:e,folderId:t,workspaceId:o})=>Pe(yn(e)).pipe(ed(n=>{this.uploadFolder(n,o,t,null);})))),{dispatch:false});this.keepAllDuplicates$=Dr$1(()=>this.actions$.pipe(Vt($.keepAllDuplicates),me(()=>this.mediaDuplicateService.keepAllDuplicates().pipe(le(()=>C$1.keepAllDuplicatesSuccess()),Hs(e=>js(C$1.keepAllDuplicatesFailed(e)))))));this.discardAllDuplicates$=Dr$1(()=>this.actions$.pipe(Vt($.discardAllDuplicates),Ys(()=>this.mediaDuplicateService.discardAllDuplicates().pipe(le(()=>C$1.discardAllDuplicatesSuccess()),Hs(e=>js(C$1.discardAllDuplicatesFailed(e)))))));}uploadFolder(e,t,o,n){let r=x$1();this.store.dispatch(Be.folderUploadAdded({id:r,mainFolderId:n,name:e.name,status:"loading",error:null})),this.folderService.createFolder({imageRightIds:[],mainFolderId:o,name:e.name,workspaceId:t,aiModules:[],description:null}).subscribe(_=>{this.store.dispatch(h.createFolderSuccess({folder:_,uploadId:r}));for(let S of e.files)this.store.dispatch($.uploadFile(S,t,_.id,void 0,r));for(let S of e.folders)this.uploadFolder(S,t,_.id,r);},_=>{this.store.dispatch(h.createFolderFailed({error:_,uploadId:r}));});}cancelUpload(e){return ev(this.clear$,this.cancel$.pipe(yn$1(t=>t===e)));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(R),se(at),se(ee$1),se(Ci),se(Ue));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}},Nr=[".DS_STORE"],yn=i=>E(null,null,function*(){let e={files:[],folders:[],name:i.name},t=i.createReader(),o=new Array(),n=yield Pn(t);for(;n.length>0;)o.push(...n),n=yield Pn(t);for(let r of o)if(r.isFile){if(Nr.includes(r.name.toUpperCase()))continue;e.files.push(yield wr(r));}else r.isDirectory&&e.folders.push(yield yn(r));return e;}),Pn=i=>new Promise(e=>{i.readEntries(t=>{e(t);});}),wr=i=>new Promise(e=>{i.file(t=>{e(t);});});var Ai=class i{constructor(e,t,o,n){this.actions$=e;this.workspaceService=t;this.aiService=o;this.store=n;this.loadWorkspaces$=Dr$1(()=>this.actions$.pipe(Vt(u.loadWorkspaces),Ju(()=>this.workspaceService.getWorkspaces(false).pipe(le(({workspaces:e,frontImages:t})=>T.loadWorkspacesSuccess({workspaces:e,files:t})),Hs(e=>js(T.loadWorkspacesFailed({error:e})))))));this.createWorkspace$=Dr$1(()=>this.actions$.pipe(Vt(u.createWorkspace),Ju(({payload:e})=>this.workspaceService.createWorkspace(e).pipe(le(t=>T.createWorkspaceSuccess({workspace:t})),Hs(t=>js(T.createWorkspaceFailed({error:t})))))));this.updateWorkspace$=Dr$1(()=>this.actions$.pipe(Vt(u.updateWorkspace),Ju(({id:e,payload:t})=>this.workspaceService.updateWorkspace(e,t).pipe(le(()=>T.updateWorkspaceSuccess({id:e,changes:{name:t.name,description:t.description,aiModules:t.aiModules}})),Hs(o=>js(T.updateWorkspaceFailed({id:e,error:o})))))));this.updateAiModules$=Dr$1(()=>this.actions$.pipe(Vt(u.updateAiModules),Ju(({id:e,payload:t})=>this.workspaceService.updateWorkspace(e,t).pipe(le(()=>T.updateAiModulesSuccess({id:e,changes:{name:t.name,description:t.description,aiModules:t.aiModules}})),Hs(o=>js(T.updateAiModulesFailed({err:o})))))));this.deleteWorkspace$=Dr$1(()=>this.actions$.pipe(Vt(u.deleteWorkspace),Ju(({id:e})=>this.workspaceService.deleteWorkspace(e).pipe(le(()=>T.deleteWorkspaceSuccess({id:e})),Hs(t=>js(T.deleteWorkspaceFailed({id:e,error:t})))))));this.moveWorkspace$=Dr$1(()=>this.actions$.pipe(Vt(u.moveWorkspace),Ju(({workspaceId:e,payload:t})=>this.workspaceService.moveWorkspace(e,t).pipe(le(o=>T.moveWorkspaceSuccess({id:e,folder:o})),Hs(o=>js(T.moveWorkspaceFailed({id:e,error:o})))))));this.setFrontImage$=Dr$1(()=>this.actions$.pipe(Vt(u.setFrontImage),Ju(({workspaceId:e,fileId:t})=>this.workspaceService.setFrontImage({workspaceId:e,fileId:t}).pipe(le(()=>T.setFrontImageSuccess({workspaceId:e,fileId:t})),Hs(o=>js(T.setFrontImageFailed({error:o})))))));this.refreshAiData$=Dr$1(()=>this.actions$.pipe(Vt(u.refreshAiData),Ju(({workspaceId:e})=>this.aiService.startBulkProcess({workspaceId:e}).pipe(le(()=>T.refreshAiDataSuccess({workspaceId:e})),Hs(t=>js(T.refreshAiDataFailed({err:t})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(Oe),se(c$2),se(at));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var Di=class i{constructor(e,t){this.actions$=e;this.metadataTemplateService=t;this.loadSettings$=Dr$1(()=>this.actions$.pipe(Vt(O.loadMetadataTemplates),me(()=>this.metadataTemplateService.loadMetadataTemplates().pipe(le(e=>O.loadMetadataTemplatesSuccess({payload:e})),Hs(e=>js(O.loadMetadataTemplatesFailed({err:e})))))));this.createSetting$=Dr$1(()=>this.actions$.pipe(Vt(O.createMetadataTemplates),me(({payload:e})=>this.metadataTemplateService.createMetadataTemplates(e).pipe(le(t=>O.createMetadataTemplatesSuccess({res:t})),Hs(t=>js(O.createMetadataTemplatesFailed({err:t})))))));this.removeSetting$=Dr$1(()=>this.actions$.pipe(Vt(O.removeMetadataTemplates),Ju(({id:e})=>this.metadataTemplateService.deleteMetadataTemplates(e).pipe(le(()=>O.removeMetadataTemplatesSuccess({id:e})),Hs(t=>js(O.removeMetadataTemplatesFailed({err:t})))))));this.updateSetting$=Dr$1(()=>this.actions$.pipe(Vt(O.updateMetadataTemplates),me(({id:e,payload:t})=>this.metadataTemplateService.updateMetadataTemplates(e,t).pipe(le(o=>O.updateMetadataTemplatesSuccess({id:e,result:o})),Hs(o=>js(O.updateMetadataTemplatesFailed({err:o})))))));}static{this.ɵfac=function(t){return new(t||i)(se(Cr$1),se(m$2));};}static{this.ɵprov=Z$1({token:i,factory:i.ɵfac});}};var Ln=[fi,Ai,Mi,_i,mi,ri,gi,ei,ci,pi,Di,ni,qt,ii];function xr(i){let e=true;return function(t,o){if(t&&e){let n=localStorage.getItem("mediaSortByDirection"),r=localStorage.getItem("mediaSortBy"),_=n==="asc",S;switch(r){case"0":{S=0;break;}case"1":{S=1;break;}case"2":{S=2;break;}default:{S=t.files.sortBy;break;}}let h=localStorage.getItem("folderSortByDirection"),x$1=localStorage.getItem("folderSortBy"),ve=h==="asc",ie;switch(x$1){case"0":{ie=0;break;}case"1":{ie=1;break;}case"2":{ie=2;break;}default:{ie=t.folders.sortFolderBy;break;}}t=x(w({},t),{files:x(w({},t.files),{sortAsc:_,sortBy:S}),folders:x(w({},t.folders),{sortFolderAsc:ve,sortFolderBy:ie})}),e=false;}return i(t,o);};}function kr(i){let e=true;return function(t,o){if(t&&e){let n=localStorage.getItem("show_grid_filenames"),r=localStorage.getItem("trim_grid_filenames"),_=localStorage.getItem("trim_grid_file_ext"),S=localStorage.getItem("grid_view"),h=localStorage.getItem("show_duplicates"),x$1=Number.parseInt(S),ve;switch(n){case"hover":ve="hover";break;case"always":ve="always";break;case"none":default:ve="none";break;}let ie;switch(r){case"none":ie="none";break;case"left":ie="left";break;case"right":ie="right";break;default:ie="none";break;}let be;switch(_){case"true":be=true;break;case"false":be=false;break;default:be=false;break;}let Be;switch(h){case"true":Be=true;break;case"false":Be=false;break;default:Be=false;break;}let we;switch(x$1){case 1:{we=x$1;break;}default:{we=0;break;}}t=x(w({},t),{files:x(w({},t.files),{showGridFilenameOption:ve,trimGridFilenameOption:ie,trimGridFileExtension:be,gridView:we,showDuplicateFiles:Be})}),e=false;}return i(t,o);};}var $n=[xr,kr];var Rn=class i{static{this.ɵfac=function(t){return new(t||i)();};}static{this.ɵmod=mm({type:i});}
1static{this.ɵinj=wa$1({imports:[ar$1,Xo.forFeature(fd,Rm,{metaReducers:$n}),wm.forFeature(Ln),oe,y,N,ee]});}};xC(Qt,function(){return[St,dt,wt,xt$1,u$2,Z,Ct,Ut,Q,_,u$1,M,c];},function(){return[ui$1,_t];});xC(Zt,function(){return[St,dt,wt,S$2,T$2,ne$2,u$1,M,c];},function(){return[_t];});/**i18n:4fda6dc4d9e89a427172966e1cd5825eeda37f6450a56e1ba87bafd8afb35193*/export{Qt as Q,Rn as R,Sn as S,Tn as T,Ue as U,Wt as W,Zt as Z,_,_t as a,bn as b,Re as c,Si as d,ai as e,ft as f,di as g,hi as h,li as i,lt as l,ol as o,qn as q,ui as u};
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.