import{a as o,b as f}from"./chunk-4LOWPSEP.js";import{$a as q,Wa as s,Wj as u,Xa as A,Xj as I,_a as a,yf as l,zf as D}from"./chunk-2GUKPKKM.js";import{a as S,b as R}from"./chunk-CUIDVWNH.js";import{b as M,c as w}from"./chunk-IBUDDWQO.js";import{Sd as v,d as m,na as b,oa as p,ta as P,x as h,ya as d}from"./chunk-XJKQ67XR.js";import{a as r,b as i,e as g}from"./chunk-SZAW6ZBW.js";var F,j=g(()=>{p();b();f();A();q();R();D();v();I();w();F=(()=>{class n{constructor(e,t){this.assetServices=e,this.translatorService=t,this.generationModes=new Map,this.generationModes.set(s.Default,this.generateSpecifiedPasswords.bind(this)),this.generationModes.set(s.SpecifiedSettings,this.generateSpecifiedPasswords.bind(this)),this.generationModes.set(s.HumanReadable,this.generateReadablePasswords.bind(this)),this.generationModes.set(s.Pattern,this.generatePatternPasswords.bind(this)),this.generationModes.set(s.Pronounceable,this.generatePronounceablePasswords.bind(this)),this.generationModes.set(s.Strong,this.generateStrongPasswords.bind(this)),this.generationModes.set(s.Passphrase,this.generatePassphrase.bind(this))}generatePasswords(e){return this.generationModes.get(e?.mode??s.Default)(e)}generatePassword(e){return this.assetServices.GenerateSpecifiedPasswordsWithValidationSettings(e).pipe(h(t=>new l(t.data)))}generateOnePassword(e){return this.generatePasswords(e).pipe(h(t=>t.data&&t.data.length>0?new l(t.data[0]):null))}isRequiredLengthMatchesConfiguration(e){let t=0;return t+=e.bracketsMin=e.includeBrackets?e.bracketsMin:0,t+=e.customCharactersMin=e.customCharacters?e.customCharactersMin:0,t+=e.digitsMin=e.includeDigits?e.digitsMin:0,t+=e.lowerCaseMin=e.includeLowerCase?e.lowerCaseMin:0,t+=e.highAnsiMin=e.includeHighAnsi?e.highAnsiMin:0,t+=e.minusMin=e.includeMinus?e.minusMin:0,t+=e.spaceMin=e.includeSpace?e.spaceMin:0,t+=e.specialCharMin=e.includeSpecialChar?e.specialCharMin:0,t+=e.underlineMin=e.includeUnderline?e.underlineMin:0,t+=e.upperCaseMin=e.includeUpperCase?e.upperCaseMin:0,t<=e.length}generateSpecifiedPasswords(e){return this.isRequiredLengthMatchesConfiguration(e)?this.assetServices.GenerateSpecifiedPasswords(e):m.create(t=>{let c=new o;c.result=S.InvalidData,c.errorMessage=this.translatorService.translate("PasswordLengthMustBeEqualOrGreaterThanTheAmountOfRequiredCharacters"),t.next(c),t.complete()})}generateReadablePasswords(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.HumanReadable})))}generatePatternPasswords(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.Pattern})))}generatePronounceablePasswords(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.Pronounceable})))}generateStrongPasswords(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.Strong})))}generatePassphrase(e){return this.generateSpecifiedPasswords(new a(i(r({},e),{mode:s.Passphrase})))}static{this.\u0275fac=function(t){return new(t||n)(d(u),d(M))}}static{this.\u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})()});export{F as a,j as b};
