import{LitElement as i,html as e,css as n}from"lit";import{classMap as t}from"lit/directives/class-map.js";import{iconRemixInformationFill as c}from"./assets/cc-remix.icons.js";import{skeletonStyles as s}from"./styles/skeleton.js";import{ccLink as o,linkStyles as l}from"./templates/cc-link/cc-link.js";import{i18n as a}from"./translation.js";import"./cc-block-section.js";import"./cc-block.js";import"./cc-icon.js";import"./cc-img.js";import"./cc-notice.js";class r extends i{static get properties(){return{state:{type:Object}}}constructor(){super(),this.state={type:"loading"}}render(){if("error"===this.state.type)return e`<cc-notice intent=warning message=${a("cc-jenkins-info.error")}></cc-notice>`;const i="loading"===this.state.type,n="loaded"===this.state.type?this.state.jenkinsLink:null,s="loaded"===this.state.type?this.state.jenkinsManageLink:null,l="loaded"===this.state.type?this.state.versions:{current:null,available:null},r=l.current!==l.available;return e`<cc-block ribbon=${a("cc-jenkins-info.info")} no-head><div class=info-text>${a("cc-jenkins-info.text")}</div><cc-block-section><div slot=title>${a("cc-jenkins-info.open-jenkins.title")}</div><div slot=info>${a("cc-jenkins-info.open-jenkins.text")}</div><div class=one-line-form>${o(n,e`<cc-img src=${"https://assets.clever-cloud.com/logos/jenkins.svg"}></cc-img><span class=${t({skeleton:i})}>${a("cc-jenkins-info.open-jenkins.link")}</span>`)}</div></cc-block-section><cc-block-section><div slot=title>${a("cc-jenkins-info.documentation.title")}</div><div slot=info>${a("cc-jenkins-info.documentation.text")}</div><div class=one-line-form>${o("https://www.clever-cloud.com/doc/deploy/addon/jenkins/",e`<cc-icon size=lg .icon=${c}></cc-icon><span>${a("cc-jenkins-info.documentation.link")}</span>`)}</div></cc-block-section><cc-block-section><div slot=title>${a("cc-jenkins-info.update.title")}</div><div slot=info>${a("cc-jenkins-info.update.text")}</div><div class=one-line-form>${o(s,e`<cc-icon size=lg .icon=${c}></cc-icon><span class=${t({skeleton:i})}>${r?a("cc-jenkins-info.update.new-version",{version:l.available}):a("cc-jenkins-info.update.up-to-date")}</span>`)}</div></cc-block-section></cc-block>`}static get styles(){return[l,s,n`:host{--cc-gap:1em;display:block}.cc-link{align-items:center;display:flex}cc-img{border-radius:var(--cc-border-radius-default,.25em);flex:0 0 auto;height:1.5em;margin-right:.5em;width:1.5em}cc-icon{flex:0 0 auto;margin-right:.5em}.skeleton{background-color:#bbb}`]}}window.customElements.define("cc-jenkins-info",r);export{r as CcJenkinsInfo};
//# sourceMappingURL=cc-jenkins-info.js.map
