import{a as f,b}from"./chunk-DJLFA677.js";import{a as v,b as T}from"./chunk-NEKDTWKR.js";import{a as u,c as C}from"./chunk-YVVVIZWY.js";import{$a as g,_a as h,ca as l,da as A}from"./chunk-THQOQSZV.js";import{D as o,E as I}from"./chunk-I7GW4F3B.js";import{O as n,Sa as O,be as P,na as d,r as p,ta as c,x as i,xa as s}from"./chunk-WL5U2YIT.js";import{e as S}from"./chunk-ADEKKGI2.js";var B,j=S(()=>{d();O();b();A();C();P();T();g();I();B=(()=>{let r=class r extends f{constructor(e,t,m){super(),this.errorService=e,this.pamAssetServices=t,this.cachingItem=new u(m)}create(e){return new l(e)}get(e){return this.pamAssetServices.PamOtp_GetPamOtpTemplate(e)}save(e){return e.id?this.update(e).pipe(i(t=>t?.id)):this.createTemplate(e).pipe(i(t=>t?.id))}delete(e){return this.cachingItem.invalidateCache(),this.pamAssetServices.PamOtp_DeleteOtpTemplate(e).pipe(i(()=>!0))}getCredentialOtpCombineInfo(e){return this.pamAssetServices.PamOtp_GetCredentialOtpCombineInfo(e)}getList(e=!1,t=!0){return this.pamAssetServices.PamOtp_GetPamOtpTemplates(e,t)}getListAsSelectItems(e=!1){return this.cachingItem.getCache(e,this.getListAsSelectItemsInternal())}resolvePamCredentialOtp(e,t=!0){return t?this.handleError(this.pamAssetServices.PamOtp_ResolveCredentialOtp(e,!1)):this.pamAssetServices.PamOtp_ResolveCredentialOtp(e,!1)}resolvePamOtpTemplate(e){return this.pamAssetServices.PamOtp_ResolveOtp(e)}getListAsSelectItemsInternal(){return this.getList(!0,!1).pipe(i(e=>this.toSelectItems(e)))}toSelectItems(e){return e?e.map(t=>this.toSelectItem(t)):null}toSelectItem(e){return{label:e.name,value:e.id,otpTemplate:e}}createTemplate(e){return this.cachingItem.invalidateCache(),this.pamAssetServices.PamOtp_PostPamOtpTemplate(e)}update(e){return this.cachingItem.invalidateCache(),this.pamAssetServices.PamOtp_PutPamOtpTemplates(e.id,e)}handleError(e,t=null){return e.pipe(n(m=>(this.errorService.handleError(m),p(t))))}};r.\u0275fac=function(t){return new(t||r)(s(v),s(h),s(o))},r.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"});let a=r;return a})()});export{B as a,j as b};
