/**
  * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
  * @license    GNU General Public License version 2 or later; see LICENSE.txt
  */document.addEventListener("DOMContentLoaded",()=>{const a=[].slice.call(document.querySelectorAll(".js-module-insert")),i=[].slice.call(document.querySelectorAll(".js-position-insert"));a.forEach(e=>{e.addEventListener("click",o=>{o.preventDefault();const n=o.target.getAttribute("data-module"),t=o.target.getAttribute("data-editor");window.parent.Joomla&&window.parent.Joomla.editors&&window.parent.Joomla.editors.instances&&Object.prototype.hasOwnProperty.call(window.parent.Joomla.editors.instances,t)&&window.parent.Joomla.editors.instances[t].replaceSelection(`{loadmoduleid ${n}}`),window.parent.Joomla.Modal&&window.parent.Joomla.Modal.getCurrent().close()})}),i.forEach(e=>{e.addEventListener("click",o=>{o.preventDefault();const n=o.target.getAttribute("data-position"),t=o.target.getAttribute("data-editor");window.Joomla&&window.Joomla.editors&&Joomla.editors.instances&&Object.prototype.hasOwnProperty.call(window.parent.Joomla.editors.instances,t)&&window.parent.Joomla.editors.instances[t].replaceSelection(`{loadposition ${n}}`),window.parent.Joomla.Modal&&window.parent.Joomla.Modal.getCurrent().close()})})});
