"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../common/emoji/index.cjs"),a=require("../icon/icon-constants.cjs"),c=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),o=require("../emoji/emoji.cjs"),l={name:"DtEmojiTextWrapper",components:{DtEmoji:o.default},props:{elementType:{type:String,default:"div"},size:{type:String,default:"500",validator:e=>Object.keys(a.ICON_SIZE_MODIFIERS).includes(e)}},data(){return{loadingEmojiJson:!0}},async created(){this.loadingEmojiJson=!1},methods:{replaceDtEmojis(e,t){if(!e.length)return t;const s=e.map(r=>r.replace(/\*/g,"\\*")),n=new RegExp(`(${s.join("|")})`,"g");return t.split(n).filter(r=>r.trim()!=="").map(r=>e.includes(r)?this.$createElement(o.default,{props:{code:r,size:this.size}}):this.$createElement("span",{class:"d-emoji-text-wrapper__text"},r))},searchVNodes(e){if(!e.tag&&e.text)return this.searchCodes(e.text);const t=e.children?e.children.map(s=>this.searchVNodes(s)):[];return this.$createElement(e.tag,e.data,t)},replaceVueComponentVNodeContent(){},searchCodes(e){const t=i.findShortCodes(e),s=i.findEmojis(e),n=[...t,...s];return this.replaceDtEmojis(n,e)}},render(e){const t=this.$slots.default||[];return e(this.elementType,{"data-qa":"emoji-text-wrapper",class:"d-emoji-text-wrapper"},this.loadingEmojiJson?t:t.map(s=>this.searchVNodes(s)))}},d=null,p=null;var m=c.n(l,d,p);const u=m.exports;exports.default=u;
//# sourceMappingURL=emoji-text-wrapper.cjs.map
