var __decorate=this&&this.__decorate||function(t,e,i,r){var o,a=arguments.length,l=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(l=(a<3?o(l):a>3?o(e,i,l):o(e,i))||l);return a>3&&l&&Object.defineProperty(e,i,l),l};import{css as t,html as e}from"lit";import{AttributesPanel as i}from"./attributes-panel";import{customElement as r}from"lit/decorators.js";import{i18next as o}from"@openremote/or-translate";import{when as a}from"lit/directives/when.js";let AttributesChartPanel=class extends i{static get styles(){return[...super.styles,t`
            .attribute-list-item:hover {
                padding-bottom: 8px;
            }
        `]}_getAttributeActionsTemplate(t,i){return e`
            <div class="attribute-list-item-actions">
                <!-- Remove attribute button -->
                <button class="button-action" title="${o.t("delete")}" @click="${()=>this.removeWidgetAttribute(i)}">
                    <or-icon icon="close-circle"></or-icon>
                </button>
            </div>
            ${a(!!this.attributeActionCallback,()=>e`
                <div class="attribute-list-item-actions" style="margin-left: 18px; justify-content: start;">
                    <!-- Custom actions defined by callback -->
                    ${this.attributeActionCallback(i).map(e=>this._getAttributeActionTemplate(e,t,i))}
                </div>
            `)}
        `}_getAttributeActionTemplate(t,i,r){return"palette"===t.icon?e`
                <div style="position: relative;">
                    <input id="chart-color-${r.id}-${r.name}" type="color" value="${t.color}" style="position: absolute; visibility: hidden; height: 24px; width: 24px; padding: 0;" />
                    ${super._getAttributeActionTemplate(t,i,r)}
                </div>
            `:super._getAttributeActionTemplate(t,i,r)}};AttributesChartPanel=__decorate([r("attributes-chart-panel")],AttributesChartPanel);export{AttributesChartPanel};