*/ private array $macros = []; public function __construct(Environment $env) { parent::__construct($env); $this->source = $this->getSourceContext(); $this->parent = false; $this->blocks = [ ]; } protected function doDisplay(array $context, array $blocks = []): iterable { $macros = $this->macros; $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"]; $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@WebProfiler/Profiler/base_js.html.twig")); $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"]; $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@WebProfiler/Profiler/base_js.html.twig")); // line 3 yield " "; // line 7 yield "source); })()))) { yield " nonce=\""; yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["csp_script_nonce"]) || array_key_exists("csp_script_nonce", $context) ? $context["csp_script_nonce"] : (function () { throw new RuntimeError('Variable "csp_script_nonce" does not exist.', 7, $this->source); })()), "html", null, true); yield "\""; } yield "> window.addEventListener('DOMContentLoaded', () => { new SymfonyProfiler(); }); class SymfonyProfiler { constructor() { this.#createTabs(); this.#createTableSearchFields(); this.#createToggles(); this.#createCopyToClipboard(); this.#convertDateTimesToUserTimezone(); } #createTabs() { /* the accessibility options of this component have been defined according to: */ /* www.w3.org/WAI/ARIA/apg/example-index/tabs/tabs-manual.html */ const tabGroups = document.querySelectorAll('.sf-tabs:not([data-processed=true])'); /* create the tab navigation for each group of tabs */ tabGroups.forEach((tabGroup, i) => { const tabs = tabGroup.querySelectorAll(':scope > .tab'); const tabNavigation = document.createElement('div'); tabNavigation.classList.add('tab-navigation'); tabNavigation.setAttribute('role', 'tablist'); let selectedTabId = `tab-\${i}-0`; /* select the first tab by default */ tabs.forEach((tab, j) => { const tabId = `tab-\${i}-\${j}`; const tabTitle = tab.querySelector('.tab-title').innerHTML; const tabNavigationItem = document.createElement('button'); tabNavigationItem.classList.add('tab-control'); tabNavigationItem.setAttribute('data-tab-id', tabId); tabNavigationItem.setAttribute('role', 'tab'); tabNavigationItem.setAttribute('aria-controls', tabId); if (tab.classList.contains('active')) { selectedTabId = tabId; } if (tab.classList.contains('disabled')) { tabNavigationItem.classList.add('disabled'); } tabNavigationItem.innerHTML = tabTitle; tabNavigation.appendChild(tabNavigationItem); const tabContent = tab.querySelector('.tab-content'); tabContent.parentElement.setAttribute('id', tabId); }); tabGroup.insertBefore(tabNavigation, tabGroup.firstChild); document.querySelector('[data-tab-id=\"' + selectedTabId + '\"]').classList.add('active'); }); /* display the active tab and add the 'click' event listeners */ tabGroups.forEach((tabGroup) => { const tabs = tabGroup.querySelectorAll(':scope > .tab-navigation .tab-control'); tabs.forEach((tab) => { const tabId = tab.getAttribute('data-tab-id'); const tabPanel = document.getElementById(tabId); tabPanel.setAttribute('role', 'tabpanel'); tabPanel.setAttribute('aria-labelledby', tabId); tabPanel.querySelector('.tab-title').className = 'hidden'; if (tab.classList.contains('active')) { tabPanel.className = 'block'; tab.setAttribute('aria-selected', 'true'); tab.removeAttribute('tabindex'); } else { tabPanel.className = 'hidden'; tab.removeAttribute('aria-selected'); tab.setAttribute('tabindex', '-1'); } tab.addEventListener('click', function(e) { let activeTab = e.target || e.srcElement; /* needed because when the tab contains HTML contents, user can click */ /* on any of those elements instead of their parent '