"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Bitrate=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var errors_1=()=>{var tmp=require("./errors");return errors_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("./private/literal-string");return literal_string_1=()=>tmp,tmp},token_1=()=>{var tmp=require("./token");return token_1=()=>tmp,tmp};class Bitrate{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.Bitrate",version:"2.256.1"};static bps(amount){return new Bitrate(amount,BitrateUnit.Bps)}static kbps(amount){return new Bitrate(amount,BitrateUnit.Kbps)}static mbps(amount){return new Bitrate(amount,BitrateUnit.Mbps)}static gbps(amount){return new Bitrate(amount,BitrateUnit.Gbps)}amount;unit;constructor(amount,unit){if(!token_1().Token.isUnresolved(amount)&&amount<0)throw new(errors_1()).UnscopedValidationError((0,literal_string_1().lit)`BitrateAmountsCannotBeNegative`,`Bitrate amounts cannot be negative. Received: ${amount}`);this.amount=amount,this.unit=unit}toBps(){return convert(this.amount,this.unit,BitrateUnit.Bps)}toKbps(){return convert(this.amount,this.unit,BitrateUnit.Kbps)}toMbps(){return convert(this.amount,this.unit,BitrateUnit.Mbps)}toGbps(){return convert(this.amount,this.unit,BitrateUnit.Gbps)}isUnresolved(){return token_1().Token.isUnresolved(this.amount)}}exports.Bitrate=Bitrate;class BitrateUnit{label;inBps;static Bps=new BitrateUnit("bps",1);static Kbps=new BitrateUnit("kbps",1e3);static Mbps=new BitrateUnit("mbps",1e6);static Gbps=new BitrateUnit("gbps",1e9);constructor(label,inBps){this.label=label,this.inBps=inBps}toString(){return this.label}}function convert(amount,fromUnit,toUnit){if(fromUnit.inBps===toUnit.inBps)return amount;if(token_1().Token.isUnresolved(amount))throw new(errors_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBeBitrateSpecifiedBitrate`,`Bitrate must be specified as 'Bitrate.${toUnit}()' here since its value comes from a token and cannot be converted (got Bitrate.${fromUnit})`);return amount*fromUnit.inBps/toUnit.inBps}
