import{r as registerInstance,h}from"./index-2bf16536.js";var CounterTextState;(function(t){t["Default"]="default";t["Warning"]="warning";t["Delete"]="delete"})(CounterTextState||(CounterTextState={}));var counterTextCss=".counter-text{background:var(--color-surface-2, #E0E0E0);color:var(--color-content-disable, #636363);-webkit-box-sizing:content-box;box-sizing:content-box;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-radius:11px;padding:0 8px;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;-ms-user-select:none;user-select:none}.counter-text--active{background:var(--color-system, #B2DFFD);color:var(--color-content-din, #000000)}.counter-text--warning{background:var(--color-warning, #fde99b);color:var(--color-content-din, #000000)}.counter-text--delete{background:var(--color-delete, #e60f0f);color:var(--color-content-bright, #ffffff)}";var BdsCounterTextStyle0=counterTextCss;var CounterText=function(){function t(t){registerInstance(this,t);this.length=undefined;this.max=undefined;this.active=false;this.warning={max:20,min:2};this.delete={max:1,min:0}}t.prototype.getState=function(){var t=this.getActualLength();if(t>=this.warning.min&&t<=this.warning.max){return CounterTextState.Warning}if(t<=this.delete.max){return CounterTextState.Delete}return CounterTextState.Default};t.prototype.getActualLength=function(){return this.max-this.length};t.prototype.render=function(){var t;var e=this.getState();var n=this.getActualLength();return h("div",{key:"b96b82654bcc78804ba9395ea9385985eb28cfc3",class:(t={"counter-text":true,"counter-text--active":this.active},t["counter-text--".concat(e)]=true,t)},h("bds-typo",{key:"ab8e617869e6e43510a1de607c70bbc5954b3f64",variant:"fs-10"},n))};return t}();CounterText.style=BdsCounterTextStyle0;export{CounterText as bds_counter_text};
//# sourceMappingURL=bds-counter-text.entry.js.map