import{d as l}from"./chunk-MANB3PJC.js";import{F as m,uc as p}from"./chunk-CBXQYRPM.js";import{ca as i,fa as o}from"./chunk-LVXYIJUI.js";var f=(()=>{class t{constructor(e){this.restService=e}getScreenTemplateForScreenFunction(e){return this.restService.get(`${m.SCREEN_TEMPLATES}/${e}`,null)}static{this.\u0275fac=function(r){return new(r||t)(o(l))}}static{this.\u0275prov=i({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var u=(()=>{class t{constructor(e){this.screenTemplatesService=e}getScreenTemplateForScreenFunction(e){return this.screenTemplatesService.getScreenTemplateForScreenFunction(e)}static{this.\u0275fac=function(r){return new(r||t)(o(f))}}static{this.\u0275prov=i({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var s=(()=>{class t{constructor(e){this.screenTemplateFacade=e,this.screenTemplates=[]}loadScreenTemplate(e){return p.isNullOrUndefined(this.getScreenTemplate(e))?new Promise((r,c)=>{this.screenTemplateFacade.getScreenTemplateForScreenFunction(e).subscribe({next:n=>{n&&this.screenTemplates.push(n),r(n)},error:n=>{c(n)}})}):this.getScreenTemplate(e)}getScreenTemplate(e){return this.screenTemplates.find(r=>r.screenFunctionID===e)}getScreenComponentByType(e,r){let c=this.getScreenTemplate(e);return c?c.screenTemplateLines.filter(n=>n.screenComponentType===r).sort((n,S)=>n.sequenceNumber-S.sequenceNumber):[]}static{this.\u0275fac=function(r){return new(r||t)(o(u))}}static{this.\u0275prov=i({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var v=(()=>{class t{constructor(e){this.screenTemplatesManager=e}resolve(e){return this.screenTemplatesManager.loadScreenTemplate(e)}static{this.\u0275fac=function(r){return new(r||t)(o(s))}}static{this.\u0275prov=i({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{s as a,v as b};
