var r=class extends Error{constructor(e,t){super(e,t),this.name="OTPError"}},o=class extends r{constructor(e){super(e),this.name="SecretError"}},g=class extends o{constructor(e,t){super(`Secret must be at least ${e} bytes (${e*8} bits), got ${t} bytes`),this.name="SecretTooShortError"}},h=class extends o{constructor(e,t){super(`Secret must not exceed ${e} bytes, got ${t} bytes`),this.name="SecretTooLongError"}},c=class extends r{constructor(e){super(e),this.name="CounterError"}},b=class extends c{constructor(){super("Counter must be non-negative"),this.name="CounterNegativeError"}},O=class extends c{constructor(){super("Counter exceeds maximum safe integer value"),this.name="CounterOverflowError"}},d=class extends r{constructor(e){super(e),this.name="TimeError"}},$=class extends d{constructor(){super("Time must be non-negative"),this.name="TimeNegativeError"}},a=class extends r{constructor(e){super(e),this.name="PeriodError"}},E=class extends a{constructor(e){super(`Period must be at least ${e} second(s)`),this.name="PeriodTooSmallError"}},T=class extends a{constructor(e){super(`Period must not exceed ${e} seconds`),this.name="PeriodTooLargeError"}},P=class extends r{constructor(e){super(e),this.name="DigitsError"}},f=class extends r{constructor(e){super(e),this.name="AlgorithmError"}},u=class extends r{constructor(e){super(e),this.name="TokenError"}},y=class extends u{constructor(e,t){super(`Token must be ${e} digits, got ${t}`),this.name="TokenLengthError"}},v=class extends u{constructor(){super("Token must contain only digits"),this.name="TokenFormatError"}},i=class extends r{constructor(e,t){super(e,t),this.name="CryptoError"}},C=class extends i{constructor(e,t){super(`HMAC computation failed: ${e}`,t),this.name="HMACError"}},S=class extends i{constructor(e,t){super(`Random byte generation failed: ${e}`,t),this.name="RandomBytesError"}},p=class extends r{constructor(e,t){super(e,t),this.name="Base32Error"}},q=class extends p{constructor(e,t){super(`Base32 encoding failed: ${e}`,t),this.name="Base32EncodeError"}},U=class extends p{constructor(e,t){super(`Base32 decoding failed: ${e}`,t),this.name="Base32DecodeError"}},l=class extends r{constructor(e){super(e),this.name="CounterToleranceError"}},A=class extends l{constructor(e,t){super(`Counter tolerance size must not exceed ${e}, got ${t}. Large tolerances can cause performance issues.`),this.name="CounterToleranceTooLargeError"}},x=class extends r{constructor(e){super(e),this.name="EpochToleranceError"}},B=class extends x{constructor(){super("Epoch tolerance cannot contain negative values"),this.name="EpochToleranceNegativeError"}},R=class extends x{constructor(e,t){super(`Epoch tolerance must not exceed ${e} seconds, got ${t}. Large tolerances can cause performance issues.`),this.name="EpochToleranceTooLargeError"}},m=class extends r{constructor(e){super(e),this.name="PluginError"}},I=class extends m{constructor(){super("Crypto plugin is required."),this.name="CryptoPluginMissingError"}},k=class extends m{constructor(){super("Base32 plugin is required."),this.name="Base32PluginMissingError"}},n=class extends r{constructor(e){super(e),this.name="ConfigurationError"}},L=class extends n{constructor(){super("Secret is required. Use generateSecret() to create one, or provide via { secret: 'YOUR_BASE32_SECRET' }"),this.name="SecretMissingError"}},M=class extends n{constructor(){super("Label is required for URI generation. Example: { label: 'user@example.com' }"),this.name="LabelMissingError"}},_=class extends n{constructor(){super("Issuer is required for URI generation. Example: { issuer: 'MyApp' }"),this.name="IssuerMissingError"}},w=class extends n{constructor(){super("Class API requires secret to be a Base32 string, not Uint8Array. Use generateSecret() or provide a Base32-encoded string."),this.name="SecretTypeError"}};export{f as AlgorithmError,U as Base32DecodeError,q as Base32EncodeError,p as Base32Error,k as Base32PluginMissingError,n as ConfigurationError,c as CounterError,b as CounterNegativeError,O as CounterOverflowError,l as CounterToleranceError,A as CounterToleranceTooLargeError,i as CryptoError,I as CryptoPluginMissingError,P as DigitsError,x as EpochToleranceError,B as EpochToleranceNegativeError,R as EpochToleranceTooLargeError,C as HMACError,_ as IssuerMissingError,M as LabelMissingError,r as OTPError,a as PeriodError,T as PeriodTooLargeError,E as PeriodTooSmallError,m as PluginError,S as RandomBytesError,o as SecretError,L as SecretMissingError,h as SecretTooLongError,g as SecretTooShortError,w as SecretTypeError,d as TimeError,$ as TimeNegativeError,u as TokenError,v as TokenFormatError,y as TokenLengthError};
//# sourceMappingURL=errors.js.map