"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViaServicePrincipal=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp};class ViaServicePrincipal extends iam().PrincipalBase{constructor(serviceName,basePrincipal){super(),this.serviceName=serviceName;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IPrincipal(basePrincipal)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ViaServicePrincipal),error}this.basePrincipal=basePrincipal||new(iam()).AnyPrincipal}get policyFragment(){const base=this.basePrincipal.policyFragment,conditions=Object.assign({},base.conditions);return conditions.StringEquals?conditions.StringEquals=Object.assign({"kms:ViaService":this.serviceName},conditions.StringEquals):conditions.StringEquals={"kms:ViaService":this.serviceName},{principalJson:base.principalJson,conditions}}dedupeString(){const base=iam().ComparablePrincipal.dedupeStringFor(this.basePrincipal);return base!==void 0?`ViaServicePrincipal:${this.serviceName}:${base}`:void 0}}exports.ViaServicePrincipal=ViaServicePrincipal,_a=JSII_RTTI_SYMBOL_1,ViaServicePrincipal[_a]={fqn:"aws-cdk-lib.aws_kms.ViaServicePrincipal",version:"2.148.1"};
