import{__awaiter,__generator}from"tslib";import{r as registerInstance,h,H as Host,g as getElement}from"./index-4d3658f6.js";import{i as inheritAttributes}from"./attributes-f95bca13.js";import{B as BEM}from"./bem-8c7d2eb0.js";import{i as i18nBalClose}from"./bal-close.i18n-f2daa707.js";import{d as defaultConfig}from"./config.default-7d48bb87.js";import{L as ListenToConfig}from"./config.decorator-82894e30.js";import"./log-cf8e52ef.js";import"./browser-a623d3a0.js";import"./icons.constant-47b0ca12.js";import"./config.utils-8fe5be10.js";var balCloseCss="@media (hover: hover)and (pointer: fine){.bal-close__button--inverted:focus-visible:not(:active),.bal-close__button:focus-visible:not(:active){-webkit-box-shadow:var(--bal-focus-shadow) !important;box-shadow:var(--bal-focus-shadow) !important}}:root{--bal-close-background:var(--bal-color-transparent);--bal-close-background-focus-visible:var(--bal-form-field-control-background);--bal-close-background-focus-inverted-focus-visible:var(--bal-form-field-control-background);--bal-close-border-radius:var(--bal-radius-rounded)}.bal-close{position:static;display:inline-block}.bal-close__button{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:var(--bal-close-background);border:none;border-radius:var(--bal-close-border-radius);cursor:pointer;pointer-events:auto;display:inline-block;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:0;outline:none;position:relative;vertical-align:top;padding:.313rem}@media (hover: hover)and (pointer: fine){.bal-close__button:hover{background:rgba(0,7,57,.1)}}@media (hover: hover)and (pointer: fine){.bal-close__button:focus-visible:not(:active){background:var(--bal-close-background-focus-visible)}}.bal-close__button:active{background:rgba(0,7,57,.3)}@media (hover: hover)and (pointer: fine){.bal-close__button--inverted:hover{background:rgba(255,255,255,.3)}}@media (hover: hover)and (pointer: fine){.bal-close__button--inverted:focus-visible:not(:active){background:var(--bal-close-background-focus-inverted-focus-visible)}}.bal-close__button--inverted:active{background:rgba(255,255,255,.5)}.bal-close__button--size-small{padding:.25rem}.bal-close__button--size-medium{padding:.531rem}";var BalCloseStyle0=balCloseCss;var __decorate=undefined&&undefined.__decorate||function(e,o,t,i){var a=arguments.length,n=a<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,t):i,r;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,o,t,i);else for(var s=e.length-1;s>=0;s--)if(r=e[s])n=(a<3?r(n):a>3?r(o,t,n):r(o,t))||n;return a>3&&n&&Object.defineProperty(o,t,n),n};var Close=function(){function e(e){registerInstance(this,e);this.inheritedAttributes={};this.language=defaultConfig.language;this.region=defaultConfig.region;this.size="";this.inverted=false}e.prototype.componentWillRender=function(){this.inheritedAttributes=inheritAttributes(this.el,["tabindex"])};e.prototype.configChanged=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.language=e.language;this.region=e.region;return[2]}))}))};e.prototype.render=function(){var e=BEM.block("close");var o=e.element("button");var t=o.element("icon");var i=i18nBalClose[this.language].close;return h(Host,{class:Object.assign({},e.class())},h("button",Object.assign({type:"button","aria-label":i,title:i,class:Object.assign(Object.assign(Object.assign({},o.class()),o.modifier("inverted").class(this.inverted)),o.modifier("size-".concat(this.size)).class(this.size!=="")),"data-testid":"bal-close"},this.inheritedAttributes),h("bal-icon",{name:"close",size:this.size==="small"?"x-small":this.size==="medium"?"medium":"small",inverted:this.inverted,class:Object.assign({},t.class())})))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();__decorate([ListenToConfig()],Close.prototype,"configChanged",null);Close.style=BalCloseStyle0;export{Close as bal_close};