import{T as v,i as w}from"./chunk-A544EUT2.js";import{Hb as b,J as d,M as p,b as n}from"./chunk-VEXJN5D7.js";var f=class{constructor(t,c,s,e,i,o,a){this.id="",this.type=x.Image,this.title="",this.id=t,this.source=c,this.source_Url=s,this.thumb=e,this.thumb_Url=i,this.type=o,this.title=a}},x=(function(r){return r.Image="Image",r.Video="Video",r.Url="Url",r.Pdf="Pdf",r})(x||{}),h=class{constructor(t,c){this.number=1,this.new=!1,this.active=!1,this.selected=!1,this.new=!0,this.content=new f(t.id,t.source,t.source_Url,t.thumb,t.thumb_Url,t.type,t.title),this.number=c,setTimeout(()=>{this.new=!1},250)}},m=class{constructor(t,c){this.id=w(),this.userId=c,this.name=t,this.created_Utc=new Date,this.lastUpdated_Utc=new Date,this.pageCollection=new g}},g=class{constructor(){this.pages=[]}};var j=(()=>{let t=class t{constructor(s,e){this.http=s,this.storageService=e}getAvailableCollections(){return this.http.get("{{api}}/presentations/collections")}getDefaultPresentation(s){return new n(e=>{this.getAvailableCollections().subscribe({next:i=>{let o=new m(s,"Default");for(var a=0,U=i.length;a<U;a++){let u=i[a];if(u.name=="Presentation Booklet"){for(var l=1,I=u.content.length+1;l<I;l++){let y=u.content[l-1],D=new h(y,l);o.pageCollection.pages.push(D)}break}}e.next(o),e.complete()},error:()=>{e.error(),e.complete()}})})}getPresentationByName(s,e){return new n(i=>{this.storageService.getPresentationByName(s,e).then(o=>{o!=null?(i.next(o),i.complete()):(i.next(null),i.complete())}).catch(()=>{i.error(),i.complete()})})}storePresentation(s){return new n(e=>{this.storageService.storePresentation(s).then(()=>{e.next(),e.complete()}).catch(()=>{e.error(),e.complete()})})}};t.\u0275fac=function(e){return new(e||t)(p(b),p(v))},t.\u0275prov=d({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();export{x as a,h as b,m as c,j as d};
