import{getAddon as n,getJenkinsUpdates as i}from"@clevercloud/client/esm/api/v4/addon-providers.js";import{defineSmartComponent as e}from"./lib/define-smart-component.js";import{sendToApi as o}from"./lib/send-to-api.js";import"./cc-smart-container.js";import"./cc-jenkins-info.js";e({selector:"cc-jenkins-info",params:{apiConfig:{type:Object},addonId:{type:String}},onContextUpdate({component:e,context:t,updateComponent:a,signal:s}){const{apiConfig:r,addonId:d}=t;a("state",{type:"loading"}),function({apiConfig:e,signal:t,addonId:a}){return Promise.all([n({providerId:"jenkins",addonId:a}).then(o({apiConfig:e,signal:t})),i({addonId:a}).then(o({apiConfig:e,signal:t}))]).then((([n,i])=>({jenkinsLink:`https://${n.host}`,jenkinsManageLink:i.manageLink,versions:i.versions})))}({apiConfig:r,signal:s,addonId:d}).then((n=>{a("state",{type:"loaded",jenkinsLink:n.jenkinsLink,jenkinsManageLink:n.jenkinsManageLink,versions:n.versions})})).catch((n=>{console.error(n),a("state",{type:"error"})}))}});
//# sourceMappingURL=cc-jenkins-info.smart.js.map
