import{r as t,h as s}from"./p-1a7a8b00.js";import{a6 as o,a2 as e}from"./p-a44cd541.js";import{s as i}from"./p-b4467cc2.js";const r=class{constructor(s){t(this,s),this.logoUrl=void 0,this.name=void 0,this.showLogo=void 0,this.useExternal=!1}resetState(){}componentWillLoad(){this.useExternal=!!customElements.get("bp-sdk-external-quote-request-logo"),customElements.whenDefined("bp-sdk-external-quote-request-logo").then((()=>{this.useExternal=!0}))}render(){return[this.useExternal&&this.renderExternal(),!this.useExternal&&this.renderInternal()]}renderExternal(){return s("bp-sdk-external-quote-request-logo",{logoUrl:this.logoUrl,name:this.name,showLogo:this.showLogo})}renderInternal(){return s("div",{class:"bp-sdk-quote-request-logo__container"},this.showLogo&&s("img",{class:"bp-sdk-online-quote__carrier-logo bp-sdk-quote__carrier-logo",src:this.logoUrl,alt:this.name}))}};r.style="";const h=class{constructor(s){t(this,s),this.mapStateToProps=t=>({shouldRenderSupplierLogo:o(t),quote:e(t,this.quoteId)}),this.handleSubscriptions=()=>{this.storeUnsubscribe&&this.storeUnsubscribe(),this.storeUnsubscribe=i.mapStateToProps(this,this.mapStateToProps)},this.carrier=void 0,this.customLogoBaseUrl=void 0,this.showLogo=void 0,this.showCustomLogo=void 0,this.quoteId=void 0,this.shouldRenderSupplierLogo=void 0,this.configOptions=void 0,this.quote=void 0,this.useExternal=!1,this.name=void 0,this.logoUrl=void 0}resetState(){this.quote=void 0}componentWillLoad(){this.useExternal=!!customElements.get("bp-sdk-external-quote-request-logo-container"),customElements.whenDefined("bp-sdk-external-quote-request-logo-container").then((()=>{this.useExternal=!0})),this.onCarrierChange(this.carrier),this.onCustomLogoBaseUrlChange(this.customLogoBaseUrl),this.onShowCustomLogoChange(this.showCustomLogo)}connectedCallback(){this.resetState(),this.handleSubscriptions()}onCarrierChange(t){this.name=null==t?void 0:t.name,this.updateLogoUrl(t,this.customLogoBaseUrl,this.showCustomLogo)}onCustomLogoBaseUrlChange(t){this.updateLogoUrl(this.carrier,t,this.showCustomLogo)}onShowCustomLogoChange(t){this.updateLogoUrl(this.carrier,this.customLogoBaseUrl,t)}onShouldRenderSupplierLogoChange(t){this.updateLogoUrl(this.carrier,this.customLogoBaseUrl,this.showCustomLogo,t)}updateLogoUrl(t,s,o,e=!1){var i,r,h;this.logoUrl=o?this.shouldRenderSupplierLogo&&(null===(i=this.quote)||void 0===i?void 0:i.supplier_name)?`${s}${this.quote.supplier_name.toLowerCase()}.png`:`${s}${null===(r=null==t?void 0:t.name)||void 0===r?void 0:r.toLowerCase()}.png`:this.shouldRenderSupplierLogo&&(null===(h=this.quote)||void 0===h?void 0:h.supplier_logo_url)?this.quote.supplier_logo_url:null==t?void 0:t.logo_url}render(){return[this.useExternal&&this.renderExternal(),!this.useExternal&&this.renderInternal()]}renderExternal(){return s("bp-sdk-external-quote-request-logo-container",{carrier:this.carrier,customLogoBaseUrl:this.customLogoBaseUrl,showLogo:this.showLogo,showCustomLogo:this.showCustomLogo,shouldRenderSupplierLogo:this.shouldRenderSupplierLogo})}renderInternal(){return s("bp-sdk-quote-request-logo",{logoUrl:this.logoUrl,name:this.name,showLogo:this.showLogo})}static get watchers(){return{carrier:["onCarrierChange"],customLogoBaseUrl:["onCustomLogoBaseUrlChange"],showCustomLogo:["onShowCustomLogoChange"],shouldRenderSupplierLogo:["onShouldRenderSupplierLogoChange"]}}};h.style="";export{r as bp_sdk_quote_request_logo,h as bp_sdk_quote_request_logo_container}