import{fakeString as o}from"./lib/fake-strings.js";import{defineSmartComponent as t}from"./lib/smart/define-smart-component.js";import"./cc-smart-container.js";import{CcAddonHeaderClient as e}from"./cc-addon-header.client.js";import"./cc-addon-header.js";t({selector:'cc-addon-header[smart-mode="pulsar"]',params:{apiConfig:{type:Object},ownerId:{type:String},addonId:{type:String},productStatus:{type:String,optional:!0}},onContextUpdate({context:t,updateComponent:e,signal:n}){const{apiConfig:d,ownerId:a,addonId:i,productStatus:s}=t,p=new r({apiConfig:d,ownerId:a,addonId:i,signal:n});e("state",{type:"loading",productStatus:o(4)}),p.getProviderWithZone().then((({rawAddon:o,zone:t})=>{e("state",{type:"loaded",providerId:o.provider.name,providerLogoUrl:o.provider.logoUrl,name:o.name,id:o.realId,zone:t,productStatus:s})})).catch((o=>{console.error(o),e("state",{type:"error"})}))}});class r extends e{constructor({apiConfig:o,ownerId:t,addonId:e,signal:r}){super({apiConfig:o,ownerId:t,addonId:e,providerId:"addon-pulsar",signal:r})}async getProviderWithZone(){const o=await this.getAddon();return{rawAddon:o,zone:await this.getZone(o.region)}}}
//# sourceMappingURL=cc-addon-header.smart-pulsar.js.map
