class t{constructor(t){this._defaultButtons=t}process(t,s,i,n=[],e=[]){var o;this.customButtons=new Map,this.buttons="",this.disabledButtons=[].concat(n),null===(o=this.getButtonsArray(t,s,i))||void 0===o||o.forEach((o=>{let r;if("string"==typeof o)r=o;else{const t=o;this.customButtons.set(t.name,t),r=t.name}e.includes(r)||(this.isEnabled(t,s,r,i,n)||this.disabledButtons.push(r),this.buttons.length>0&&(this.buttons+=","),this.buttons+=r)}))}getButtonsArray(t,s,i){const n=this.getButtonsFromKey(t);return s?s.getButtons(t,i,[...n]):n}getButtonsFromKey(t){const s=this._defaultButtons[t];return"function"==typeof s?s():s}isEnabled(t,s,i,n,e){const o=!e.includes(i);return s&&s.isEnabled?s.isEnabled(t,n,i,o):o}}export{t as T}