/**
 * @copyright   (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */if(!window.Joomla)throw new Error("Joomla API was not properly initialised!");const copyToClipboardFallback=o=>{o.focus(),o.select();try{document.execCommand("copy")?Joomla.renderMessages({message:[Joomla.Text._("COM_SCHEDULER_CONFIG_WEBCRON_LINK_COPY_SUCCESS")]}):Joomla.renderMessages({error:[Joomla.Text._("COM_SCHEDULER_CONFIG_WEBCRON_LINK_COPY_FAIL")]})}catch(e){Joomla.renderMessages({error:[e]})}},copyToClipboard=()=>{document.getElementById("link-copy").addEventListener("click",({currentTarget:e})=>{const t=e.previousElementSibling;if(!navigator.clipboard){copyToClipboardFallback(t);return}navigator.clipboard.writeText(t.value).then(()=>{Joomla.renderMessages({message:[Joomla.Text._("COM_SCHEDULER_CONFIG_WEBCRON_LINK_COPY_SUCCESS")]})},()=>{Joomla.renderMessages({error:[Joomla.Text._("COM_SCHEDULER_CONFIG_WEBCRON_LINK_COPY_FAIL")]})})})},onBoot=()=>{copyToClipboard(),document.removeEventListener("DOMContentLoaded",onBoot)};document.addEventListener("DOMContentLoaded",onBoot);
