YUI.add("moodle-atto_emojipicker-button",function(e,t){var n="atto_emojipicker";e.namespace("M.atto_emojipicker").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_currentSelection:null,initializer:function(){if(this.get("disabled"))return;this.addButton({icon:"e/emoticons",callback:this._displayDialogue})},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection();if(this._currentSelection===!1)return;var e=this.getDialogue({headerContent:M.util.get_string("emojipicker",n),width:"auto",focusAfterHide:!0,additionalBaseClass:"emoji-picker-dialogue"},!0);e.set("bodyContent",this._getDialogueContent()).show()},_insertEmoji:function(e){var t=this.get("host");this.getDialogue({focusAfterHide:null}).hide(),t.setSelection(this._currentSelection),t.insertContentAtFocusPoint(e),this.markUpdated()},_getDialogueContent:function(){var t=e.Node.create("<div></div>");return require(["core/templates","core/emoji/picker"],function(e,n){e.render("core/emoji/picker",{}).then(function(e){var r=t.getDOMNode();r.innerHTML=e,n(r,this._insertEmoji.bind(this)),this.getDialogue().centerDialogue()}.bind(this))}.bind(this)),t}},{ATTRS:{disabled:{value:!0}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
