"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OriginGroup=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class OriginGroup{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_cloudfront_origins.OriginGroup",version:"2.256.1"};constructor(props){this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudfront_origins_OriginGroupProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,OriginGroup),error}}bind(scope,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudfront_OriginBindOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}const primaryOriginConfig=this.props.primaryOrigin.bind(scope,options);if(primaryOriginConfig.failoverConfig)throw new(core_1()).ValidationError((0,literal_string_1().lit)`OriginGroupCannotUseOriginWithFailover`,"An OriginGroup cannot use an Origin with its own failover configuration as its primary origin!",scope);return{originProperty:primaryOriginConfig.originProperty,failoverConfig:{failoverOrigin:this.props.fallbackOrigin,statusCodes:this.props.fallbackStatusCodes},selectionCriteria:this.props.selectionCriteria}}}exports.OriginGroup=OriginGroup;
