import{getAddon as e}from"@clevercloud/client/esm/api/v2/providers.js";import{ONE_SECOND as n}from"@clevercloud/client/esm/with-cache.js";import{getDocUrl as o}from"./lib/dev-hub-url.js";import{formatAddonFeatures as t}from"./lib/product.js";import{sendToApi as a}from"./lib/send-to-api.js";import{defineSmartComponent as d}from"./lib/smart/define-smart-component.js";import{i18n as i}from"./translation.js";import"./cc-smart-container.js";import{CcAddonInfoClient as r}from"./cc-addon-info.client.js";import"./cc-addon-info.js";d({selector:'cc-addon-info[smart-mode="jenkins"]',params:{apiConfig:{type:Object},ownerId:{type:String},addonId:{type:String}},onContextUpdate({context:e,updateComponent:n,signal:a}){const{apiConfig:d,ownerId:r,addonId:p}=e,c=new s({apiConfig:d,ownerId:r,addonId:p,signal:a});n("state",{type:"loading",type:"loading",version:{stateType:"up-to-date",installed:"0.0.0",latest:"0.0.0"},creationDate:"2025-08-06 15:03:00",plan:"XS",features:[{code:"cpu",type:"number",value:2},{code:"memory",type:"bytes",value:4},{code:"disk-size",type:"bytes",value:40},{code:"encryption-at-rest",type:"boolean",value:"false"}]}),n("docLink",{text:i("cc-addon-info.doc-link.jenkins"),href:o("/addons/jenkins")}),c.getJenkinsAddonInfo().then((({rawAddon:e,addonProvider:o})=>{const a=t(e.plan.features,["cpu","memory","disk-size"]);o.features.find((e=>"encryption"===e.name))&&a.push({code:"encryption-at-rest",type:"boolean",value:"encryptionFeature.enabled"}),n("state",{type:"loaded",version:{stateType:"up-to-date",installed:o.version,latest:o.version},creationDate:e.creationDate,plan:e.plan.name,features:a})})).catch((e=>{console.error(e),n("state",{type:"error"})}))}});class s extends r{constructor({apiConfig:e,ownerId:n,addonId:o,signal:t}){super({apiConfig:e,ownerId:n,addonId:o,providerId:"jenkins",signal:t})}_getAddonProvider(o){return e({providerId:o,addonId:this._addonId}).then(a({apiConfig:this._apiConfig,signal:this._signal,cacheDelay:n}))}async getJenkinsAddonInfo(){const e=await this._getAddon();return{rawAddon:e,addonProvider:await this._getAddonProvider(e.provider.id)}}}
//# sourceMappingURL=cc-addon-info.smart-jenkins.js.map
