import{__decorate}from"tslib";import{SuperComponent,wxComponent}from"../common/src/index";import config from"../common/config";import props from"./props";import{uniqueFactory,getRect}from"../common/utils";const{prefix:prefix}=config,name=`${prefix}-badge`,getUniqueID=uniqueFactory("badge");let Badge=class extends SuperComponent{constructor(){super(...arguments),this.options={multipleSlots:!0},this.externalClasses=[`${prefix}-class`,`${prefix}-class-count`,`${prefix}-class-content`],this.properties=props,this.data={prefix:prefix,classPrefix:name,value:"",labelID:"",descriptionID:"",useOuterClass:!1},this.lifetimes={ready(){const e=getUniqueID();this.setData({labelID:`${e}_label`,descriptionID:`${e}_description`}),this.checkForActualContent()}},this.methods={checkForActualContent(){if(!this.properties.content&&["ribbon","ribbon-right","ribbon-left","triangle-right","triangle-left"].includes(this.properties.shape))return getRect(this,`.${name}__content`).then(e=>{const t=e.width>0||e.height>0;this.setData({useOuterClass:!t})});this.setData({useOuterClass:!1})}}}};Badge=__decorate([wxComponent()],Badge);export default Badge;