var/cache/dev/twig/a9/a9ef6a628b9e00f233f8eed9923a042859de98dcdbb530b6aa219b9d5679bb00.php line 72

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* @Twig/base_js.html.twig */
  14. class __TwigTemplate_1b144a8124fed74f6d6106fa46154c23747a3625d66a95b8c1662009e2d8b4ef extends \Twig\Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.         $this->sandbox $this->env->getExtension('\Twig\Extension\SandboxExtension');
  26.         $tags = array("deprecated" => 1"if" => 4);
  27.         $filters = array("escape" => 4);
  28.         $functions = array();
  29.         try {
  30.             $this->sandbox->checkSecurity(
  31.                 ['deprecated''if'],
  32.                 ['escape'],
  33.                 []
  34.             );
  35.         } catch (SecurityError $e) {
  36.             $e->setSourceContext($this->source);
  37.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  38.                 $e->setTemplateLine($tags[$e->getTagName()]);
  39.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  40.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  41.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  42.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  43.             }
  44.             throw $e;
  45.         }
  46.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  47.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@Twig/base_js.html.twig"));
  48.     }
  49.     protected function doDisplay(array $context, array $blocks = [])
  50.     {
  51.         $macros $this->macros;
  52.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  53.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@Twig/base_js.html.twig"));
  54.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  55.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@Twig/base_js.html.twig"));
  56.         // line 1
  57.         $__internal_f607aeef2c31a95a7bf963452dff024ffaeb6aafbe4603f9ca3bec57be8633f4 = (("The template \"" $this->getTemplateName()) . "\" is deprecated since Symfony 4.4, will be removed in 5.0.");
  58.         @trigger_error($__internal_f607aeef2c31a95a7bf963452dff024ffaeb6aafbe4603f9ca3bec57be8633f4." (\"@Twig/base_js.html.twig\" at line 1)."E_USER_DEPRECATED);
  59.         // line 4
  60.         echo "<script";
  61.         if ((array_key_exists("csp_script_nonce"$context) && (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.'4$this->source); })()))) {
  62.             echo " nonce=\"";
  63.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((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.'4$this->source); })()), 4$this->source), "html"nulltrue);
  64.             echo "\"";
  65.         }
  66.         echo ">/*<![CDATA[*/
  67.     ";
  68.         // line 8
  69.         echo "
  70.     Sfjs = (function() {
  71.         \"use strict\";
  72.         if ('classList' in document.documentElement) {
  73.             var hasClass = function (el, cssClass) { return el.classList.contains(cssClass); };
  74.             var removeClass = function(el, cssClass) { el.classList.remove(cssClass); };
  75.             var addClass = function(el, cssClass) { el.classList.add(cssClass); };
  76.             var toggleClass = function(el, cssClass) { el.classList.toggle(cssClass); };
  77.         } else {
  78.             var hasClass = function (el, cssClass) { return el.className.match(new RegExp('\\\\b' + cssClass + '\\\\b')); };
  79.             var removeClass = function(el, cssClass) { el.className = el.className.replace(new RegExp('\\\\b' + cssClass + '\\\\b'), ' '); };
  80.             var addClass = function(el, cssClass) { if (!hasClass(el, cssClass)) { el.className += \" \" + cssClass; } };
  81.             var toggleClass = function(el, cssClass) { hasClass(el, cssClass) ? removeClass(el, cssClass) : addClass(el, cssClass); };
  82.         }
  83.         var addEventListener;
  84.         var el = document.createElement('div');
  85.         if (!('addEventListener' in el)) {
  86.             addEventListener = function (element, eventName, callback) {
  87.                 element.attachEvent('on' + eventName, callback);
  88.             };
  89.         } else {
  90.             addEventListener = function (element, eventName, callback) {
  91.                 element.addEventListener(eventName, callback, false);
  92.             };
  93.         }
  94.         return {
  95.             addEventListener: addEventListener,
  96.             createTabs: function() {
  97.                 var tabGroups = document.querySelectorAll('.sf-tabs:not([data-processed=true])');
  98.                 /* create the tab navigation for each group of tabs */
  99.                 for (var i = 0; i < tabGroups.length; i++) {
  100.                     var tabs = tabGroups[i].querySelectorAll(':scope > .tab');
  101.                     var tabNavigation = document.createElement('ul');
  102.                     tabNavigation.className = 'tab-navigation';
  103.                     var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
  104.                     for (var j = 0; j < tabs.length; j++) {
  105.                         var tabId = 'tab-' + i + '-' + j;
  106.                         var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;
  107.                         var tabNavigationItem = document.createElement('li');
  108.                         tabNavigationItem.setAttribute('data-tab-id', tabId);
  109.                         if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; }
  110.                         if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); }
  111.                         tabNavigationItem.innerHTML = tabTitle;
  112.                         tabNavigation.appendChild(tabNavigationItem);
  113.                         var tabContent = tabs[j].querySelector('.tab-content');
  114.                         tabContent.parentElement.setAttribute('id', tabId);
  115.                     }
  116.                     tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);
  117.                     addClass(document.querySelector('[data-tab-id=\"' + selectedTabId + '\"]'), 'active');
  118.                 }
  119.                 /* display the active tab and add the 'click' event listeners */
  120.                 for (i = 0; i < tabGroups.length; i++) {
  121.                     tabNavigation = tabGroups[i].querySelectorAll(':scope >.tab-navigation li');
  122.                     for (j = 0; j < tabNavigation.length; j++) {
  123.                         tabId = tabNavigation[j].getAttribute('data-tab-id');
  124.                         document.getElementById(tabId).querySelector('.tab-title').className = 'hidden';
  125.                         if (hasClass(tabNavigation[j], 'active')) {
  126.                             document.getElementById(tabId).className = 'block';
  127.                         } else {
  128.                             document.getElementById(tabId).className = 'hidden';
  129.                         }
  130.                         tabNavigation[j].addEventListener('click', function(e) {
  131.                             var activeTab = e.target || e.srcElement;
  132.                             /* needed because when the tab contains HTML contents, user can click */
  133.                             /* on any of those elements instead of their parent '<li>' element */
  134.                             while (activeTab.tagName.toLowerCase() !== 'li') {
  135.                                 activeTab = activeTab.parentNode;
  136.                             }
  137.                             /* get the full list of tabs through the parent of the active tab element */
  138.                             var tabNavigation = activeTab.parentNode.children;
  139.                             for (var k = 0; k < tabNavigation.length; k++) {
  140.                                 var tabId = tabNavigation[k].getAttribute('data-tab-id');
  141.                                 document.getElementById(tabId).className = 'hidden';
  142.                                 removeClass(tabNavigation[k], 'active');
  143.                             }
  144.                             addClass(activeTab, 'active');
  145.                             var activeTabId = activeTab.getAttribute('data-tab-id');
  146.                             document.getElementById(activeTabId).className = 'block';
  147.                         });
  148.                     }
  149.                     tabGroups[i].setAttribute('data-processed', 'true');
  150.                 }
  151.             },
  152.             createToggles: function() {
  153.                 var toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])');
  154.                 for (var i = 0; i < toggles.length; i++) {
  155.                     var elementSelector = toggles[i].getAttribute('data-toggle-selector');
  156.                     var element = document.querySelector(elementSelector);
  157.                     addClass(element, 'sf-toggle-content');
  158.                     if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') {
  159.                         addClass(toggles[i], 'sf-toggle-on');
  160.                         addClass(element, 'sf-toggle-visible');
  161.                     } else {
  162.                         addClass(toggles[i], 'sf-toggle-off');
  163.                         addClass(element, 'sf-toggle-hidden');
  164.                     }
  165.                     addEventListener(toggles[i], 'click', function(e) {
  166.                         e.preventDefault();
  167.                         if ('' !== window.getSelection().toString()) {
  168.                             /* Don't do anything on text selection */
  169.                             return;
  170.                         }
  171.                         var toggle = e.target || e.srcElement;
  172.                         /* needed because when the toggle contains HTML contents, user can click */
  173.                         /* on any of those elements instead of their parent '.sf-toggle' element */
  174.                         while (!hasClass(toggle, 'sf-toggle')) {
  175.                             toggle = toggle.parentNode;
  176.                         }
  177.                         var element = document.querySelector(toggle.getAttribute('data-toggle-selector'));
  178.                         toggleClass(toggle, 'sf-toggle-on');
  179.                         toggleClass(toggle, 'sf-toggle-off');
  180.                         toggleClass(element, 'sf-toggle-hidden');
  181.                         toggleClass(element, 'sf-toggle-visible');
  182.                         /* the toggle doesn't change its contents when clicking on it */
  183.                         if (!toggle.hasAttribute('data-toggle-alt-content')) {
  184.                             return;
  185.                         }
  186.                         if (!toggle.hasAttribute('data-toggle-original-content')) {
  187.                             toggle.setAttribute('data-toggle-original-content', toggle.innerHTML);
  188.                         }
  189.                         var currentContent = toggle.innerHTML;
  190.                         var originalContent = toggle.getAttribute('data-toggle-original-content');
  191.                         var altContent = toggle.getAttribute('data-toggle-alt-content');
  192.                         toggle.innerHTML = currentContent !== altContent ? altContent : originalContent;
  193.                     });
  194.                     /* Prevents from disallowing clicks on links inside toggles */
  195.                     var toggleLinks = toggles[i].querySelectorAll('a');
  196.                     for (var j = 0; j < toggleLinks.length; j++) {
  197.                         addEventListener(toggleLinks[j], 'click', function(e) {
  198.                             e.stopPropagation();
  199.                         });
  200.                     }
  201.                     toggles[i].setAttribute('data-processed', 'true');
  202.                 }
  203.             },
  204.             createFilters: function() {
  205.                 document.querySelectorAll('[data-filters] [data-filter]').forEach(function (filter) {
  206.                     var filters = filter.closest('[data-filters]'),
  207.                         type = 'choice',
  208.                         name = filter.dataset.filter,
  209.                         ucName = name.charAt(0).toUpperCase()+name.slice(1),
  210.                         list = document.createElement('ul'),
  211.                         values = filters.dataset['filter'+ucName] || filters.querySelectorAll('[data-filter-'+name+']'),
  212.                         labels = {},
  213.                         defaults = null,
  214.                         indexed = {},
  215.                         processed = {};
  216.                     if (typeof values === 'string') {
  217.                         type = 'level';
  218.                         labels = values.split(',');
  219.                         values = values.toLowerCase().split(',');
  220.                         defaults = values.length - 1;
  221.                     }
  222.                     addClass(list, 'filter-list');
  223.                     addClass(list, 'filter-list-'+type);
  224.                     values.forEach(function (value, i) {
  225.                         if (value instanceof HTMLElement) {
  226.                             value = value.dataset['filter'+ucName];
  227.                         }
  228.                         if (value in processed) {
  229.                             return;
  230.                         }
  231.                         var option = document.createElement('li'),
  232.                             label = i in labels ? labels[i] : value,
  233.                             active = false,
  234.                             matches;
  235.                         if ('' === label) {
  236.                             option.innerHTML = '<em>(none)</em>';
  237.                         } else {
  238.                             option.innerText = label;
  239.                         }
  240.                         option.dataset.filter = value;
  241.                         option.setAttribute('title', 1 === (matches = filters.querySelectorAll('[data-filter-'+name+'=\"'+value+'\"]').length) ? 'Matches 1 row' : 'Matches '+matches+' rows');
  242.                         indexed[value] = i;
  243.                         list.appendChild(option);
  244.                         addEventListener(option, 'click', function () {
  245.                             if ('choice' === type) {
  246.                                 filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) {
  247.                                     if (option.dataset.filter === row.dataset['filter'+ucName]) {
  248.                                         toggleClass(row, 'filter-hidden-'+name);
  249.                                     }
  250.                                 });
  251.                                 toggleClass(option, 'active');
  252.                             } else if ('level' === type) {
  253.                                 if (i === this.parentNode.querySelectorAll('.active').length - 1) {
  254.                                     return;
  255.                                 }
  256.                                 this.parentNode.querySelectorAll('li').forEach(function (currentOption, j) {
  257.                                     if (j <= i) {
  258.                                         addClass(currentOption, 'active');
  259.                                         if (i === j) {
  260.                                             addClass(currentOption, 'last-active');
  261.                                         } else {
  262.                                             removeClass(currentOption, 'last-active');
  263.                                         }
  264.                                     } else {
  265.                                         removeClass(currentOption, 'active');
  266.                                         removeClass(currentOption, 'last-active');
  267.                                     }
  268.                                 });
  269.                                 filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) {
  270.                                     if (i < indexed[row.dataset['filter'+ucName]]) {
  271.                                         addClass(row, 'filter-hidden-'+name);
  272.                                     } else {
  273.                                         removeClass(row, 'filter-hidden-'+name);
  274.                                     }
  275.                                 });
  276.                             }
  277.                         });
  278.                         if ('choice' === type) {
  279.                             active = null === defaults || 0 <= defaults.indexOf(value);
  280.                         } else if ('level' === type) {
  281.                             active = i <= defaults;
  282.                             if (active && i === defaults) {
  283.                                 addClass(option, 'last-active');
  284.                             }
  285.                         }
  286.                         if (active) {
  287.                             addClass(option, 'active');
  288.                         } else {
  289.                             filters.querySelectorAll('[data-filter-'+name+'=\"'+value+'\"]').forEach(function (row) {
  290.                                 toggleClass(row, 'filter-hidden-'+name);
  291.                             });
  292.                         }
  293.                         processed[value] = true;
  294.                     });
  295.                     if (1 < list.childNodes.length) {
  296.                         filter.appendChild(list);
  297.                         filter.dataset.filtered = '';
  298.                     }
  299.                 });
  300.             }
  301.         };
  302.     })();
  303.     Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
  304.         Sfjs.createTabs();
  305.         Sfjs.createToggles();
  306.         Sfjs.createFilters();
  307.     });
  308. /*]]>*/</script>
  309. ";
  310.         
  311.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  312.         
  313.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  314.     }
  315.     public function getTemplateName()
  316.     {
  317.         return "@Twig/base_js.html.twig";
  318.     }
  319.     public function isTraitable()
  320.     {
  321.         return false;
  322.     }
  323.     public function getDebugInfo()
  324.     {
  325.         return array (  83 => 8,  74 => 4,  71 => 1,);
  326.     }
  327.     public function getSourceContext()
  328.     {
  329.         return new Source("{% deprecated 'The template \"' ~ _self ~'\" is deprecated since Symfony 4.4, will be removed in 5.0.' %}
  330. {# This file is based on WebProfilerBundle/Resources/views/Profiler/base_js.html.twig.
  331.    If you make any change in this file, verify the same change is needed in the other file. #}
  332. <script{% if csp_script_nonce is defined and csp_script_nonce %} nonce=\"{{ csp_script_nonce }}\"{% endif %}>/*<![CDATA[*/
  333.     {# Caution: the contents of this file are processed by Twig before loading
  334.                 them as JavaScript source code. Always use '/*' comments instead
  335.                 of '//' comments to avoid impossible-to-debug side-effects #}
  336.     Sfjs = (function() {
  337.         \"use strict\";
  338.         if ('classList' in document.documentElement) {
  339.             var hasClass = function (el, cssClass) { return el.classList.contains(cssClass); };
  340.             var removeClass = function(el, cssClass) { el.classList.remove(cssClass); };
  341.             var addClass = function(el, cssClass) { el.classList.add(cssClass); };
  342.             var toggleClass = function(el, cssClass) { el.classList.toggle(cssClass); };
  343.         } else {
  344.             var hasClass = function (el, cssClass) { return el.className.match(new RegExp('\\\\b' + cssClass + '\\\\b')); };
  345.             var removeClass = function(el, cssClass) { el.className = el.className.replace(new RegExp('\\\\b' + cssClass + '\\\\b'), ' '); };
  346.             var addClass = function(el, cssClass) { if (!hasClass(el, cssClass)) { el.className += \" \" + cssClass; } };
  347.             var toggleClass = function(el, cssClass) { hasClass(el, cssClass) ? removeClass(el, cssClass) : addClass(el, cssClass); };
  348.         }
  349.         var addEventListener;
  350.         var el = document.createElement('div');
  351.         if (!('addEventListener' in el)) {
  352.             addEventListener = function (element, eventName, callback) {
  353.                 element.attachEvent('on' + eventName, callback);
  354.             };
  355.         } else {
  356.             addEventListener = function (element, eventName, callback) {
  357.                 element.addEventListener(eventName, callback, false);
  358.             };
  359.         }
  360.         return {
  361.             addEventListener: addEventListener,
  362.             createTabs: function() {
  363.                 var tabGroups = document.querySelectorAll('.sf-tabs:not([data-processed=true])');
  364.                 /* create the tab navigation for each group of tabs */
  365.                 for (var i = 0; i < tabGroups.length; i++) {
  366.                     var tabs = tabGroups[i].querySelectorAll(':scope > .tab');
  367.                     var tabNavigation = document.createElement('ul');
  368.                     tabNavigation.className = 'tab-navigation';
  369.                     var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
  370.                     for (var j = 0; j < tabs.length; j++) {
  371.                         var tabId = 'tab-' + i + '-' + j;
  372.                         var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;
  373.                         var tabNavigationItem = document.createElement('li');
  374.                         tabNavigationItem.setAttribute('data-tab-id', tabId);
  375.                         if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; }
  376.                         if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); }
  377.                         tabNavigationItem.innerHTML = tabTitle;
  378.                         tabNavigation.appendChild(tabNavigationItem);
  379.                         var tabContent = tabs[j].querySelector('.tab-content');
  380.                         tabContent.parentElement.setAttribute('id', tabId);
  381.                     }
  382.                     tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);
  383.                     addClass(document.querySelector('[data-tab-id=\"' + selectedTabId + '\"]'), 'active');
  384.                 }
  385.                 /* display the active tab and add the 'click' event listeners */
  386.                 for (i = 0; i < tabGroups.length; i++) {
  387.                     tabNavigation = tabGroups[i].querySelectorAll(':scope >.tab-navigation li');
  388.                     for (j = 0; j < tabNavigation.length; j++) {
  389.                         tabId = tabNavigation[j].getAttribute('data-tab-id');
  390.                         document.getElementById(tabId).querySelector('.tab-title').className = 'hidden';
  391.                         if (hasClass(tabNavigation[j], 'active')) {
  392.                             document.getElementById(tabId).className = 'block';
  393.                         } else {
  394.                             document.getElementById(tabId).className = 'hidden';
  395.                         }
  396.                         tabNavigation[j].addEventListener('click', function(e) {
  397.                             var activeTab = e.target || e.srcElement;
  398.                             /* needed because when the tab contains HTML contents, user can click */
  399.                             /* on any of those elements instead of their parent '<li>' element */
  400.                             while (activeTab.tagName.toLowerCase() !== 'li') {
  401.                                 activeTab = activeTab.parentNode;
  402.                             }
  403.                             /* get the full list of tabs through the parent of the active tab element */
  404.                             var tabNavigation = activeTab.parentNode.children;
  405.                             for (var k = 0; k < tabNavigation.length; k++) {
  406.                                 var tabId = tabNavigation[k].getAttribute('data-tab-id');
  407.                                 document.getElementById(tabId).className = 'hidden';
  408.                                 removeClass(tabNavigation[k], 'active');
  409.                             }
  410.                             addClass(activeTab, 'active');
  411.                             var activeTabId = activeTab.getAttribute('data-tab-id');
  412.                             document.getElementById(activeTabId).className = 'block';
  413.                         });
  414.                     }
  415.                     tabGroups[i].setAttribute('data-processed', 'true');
  416.                 }
  417.             },
  418.             createToggles: function() {
  419.                 var toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])');
  420.                 for (var i = 0; i < toggles.length; i++) {
  421.                     var elementSelector = toggles[i].getAttribute('data-toggle-selector');
  422.                     var element = document.querySelector(elementSelector);
  423.                     addClass(element, 'sf-toggle-content');
  424.                     if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') {
  425.                         addClass(toggles[i], 'sf-toggle-on');
  426.                         addClass(element, 'sf-toggle-visible');
  427.                     } else {
  428.                         addClass(toggles[i], 'sf-toggle-off');
  429.                         addClass(element, 'sf-toggle-hidden');
  430.                     }
  431.                     addEventListener(toggles[i], 'click', function(e) {
  432.                         e.preventDefault();
  433.                         if ('' !== window.getSelection().toString()) {
  434.                             /* Don't do anything on text selection */
  435.                             return;
  436.                         }
  437.                         var toggle = e.target || e.srcElement;
  438.                         /* needed because when the toggle contains HTML contents, user can click */
  439.                         /* on any of those elements instead of their parent '.sf-toggle' element */
  440.                         while (!hasClass(toggle, 'sf-toggle')) {
  441.                             toggle = toggle.parentNode;
  442.                         }
  443.                         var element = document.querySelector(toggle.getAttribute('data-toggle-selector'));
  444.                         toggleClass(toggle, 'sf-toggle-on');
  445.                         toggleClass(toggle, 'sf-toggle-off');
  446.                         toggleClass(element, 'sf-toggle-hidden');
  447.                         toggleClass(element, 'sf-toggle-visible');
  448.                         /* the toggle doesn't change its contents when clicking on it */
  449.                         if (!toggle.hasAttribute('data-toggle-alt-content')) {
  450.                             return;
  451.                         }
  452.                         if (!toggle.hasAttribute('data-toggle-original-content')) {
  453.                             toggle.setAttribute('data-toggle-original-content', toggle.innerHTML);
  454.                         }
  455.                         var currentContent = toggle.innerHTML;
  456.                         var originalContent = toggle.getAttribute('data-toggle-original-content');
  457.                         var altContent = toggle.getAttribute('data-toggle-alt-content');
  458.                         toggle.innerHTML = currentContent !== altContent ? altContent : originalContent;
  459.                     });
  460.                     /* Prevents from disallowing clicks on links inside toggles */
  461.                     var toggleLinks = toggles[i].querySelectorAll('a');
  462.                     for (var j = 0; j < toggleLinks.length; j++) {
  463.                         addEventListener(toggleLinks[j], 'click', function(e) {
  464.                             e.stopPropagation();
  465.                         });
  466.                     }
  467.                     toggles[i].setAttribute('data-processed', 'true');
  468.                 }
  469.             },
  470.             createFilters: function() {
  471.                 document.querySelectorAll('[data-filters] [data-filter]').forEach(function (filter) {
  472.                     var filters = filter.closest('[data-filters]'),
  473.                         type = 'choice',
  474.                         name = filter.dataset.filter,
  475.                         ucName = name.charAt(0).toUpperCase()+name.slice(1),
  476.                         list = document.createElement('ul'),
  477.                         values = filters.dataset['filter'+ucName] || filters.querySelectorAll('[data-filter-'+name+']'),
  478.                         labels = {},
  479.                         defaults = null,
  480.                         indexed = {},
  481.                         processed = {};
  482.                     if (typeof values === 'string') {
  483.                         type = 'level';
  484.                         labels = values.split(',');
  485.                         values = values.toLowerCase().split(',');
  486.                         defaults = values.length - 1;
  487.                     }
  488.                     addClass(list, 'filter-list');
  489.                     addClass(list, 'filter-list-'+type);
  490.                     values.forEach(function (value, i) {
  491.                         if (value instanceof HTMLElement) {
  492.                             value = value.dataset['filter'+ucName];
  493.                         }
  494.                         if (value in processed) {
  495.                             return;
  496.                         }
  497.                         var option = document.createElement('li'),
  498.                             label = i in labels ? labels[i] : value,
  499.                             active = false,
  500.                             matches;
  501.                         if ('' === label) {
  502.                             option.innerHTML = '<em>(none)</em>';
  503.                         } else {
  504.                             option.innerText = label;
  505.                         }
  506.                         option.dataset.filter = value;
  507.                         option.setAttribute('title', 1 === (matches = filters.querySelectorAll('[data-filter-'+name+'=\"'+value+'\"]').length) ? 'Matches 1 row' : 'Matches '+matches+' rows');
  508.                         indexed[value] = i;
  509.                         list.appendChild(option);
  510.                         addEventListener(option, 'click', function () {
  511.                             if ('choice' === type) {
  512.                                 filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) {
  513.                                     if (option.dataset.filter === row.dataset['filter'+ucName]) {
  514.                                         toggleClass(row, 'filter-hidden-'+name);
  515.                                     }
  516.                                 });
  517.                                 toggleClass(option, 'active');
  518.                             } else if ('level' === type) {
  519.                                 if (i === this.parentNode.querySelectorAll('.active').length - 1) {
  520.                                     return;
  521.                                 }
  522.                                 this.parentNode.querySelectorAll('li').forEach(function (currentOption, j) {
  523.                                     if (j <= i) {
  524.                                         addClass(currentOption, 'active');
  525.                                         if (i === j) {
  526.                                             addClass(currentOption, 'last-active');
  527.                                         } else {
  528.                                             removeClass(currentOption, 'last-active');
  529.                                         }
  530.                                     } else {
  531.                                         removeClass(currentOption, 'active');
  532.                                         removeClass(currentOption, 'last-active');
  533.                                     }
  534.                                 });
  535.                                 filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) {
  536.                                     if (i < indexed[row.dataset['filter'+ucName]]) {
  537.                                         addClass(row, 'filter-hidden-'+name);
  538.                                     } else {
  539.                                         removeClass(row, 'filter-hidden-'+name);
  540.                                     }
  541.                                 });
  542.                             }
  543.                         });
  544.                         if ('choice' === type) {
  545.                             active = null === defaults || 0 <= defaults.indexOf(value);
  546.                         } else if ('level' === type) {
  547.                             active = i <= defaults;
  548.                             if (active && i === defaults) {
  549.                                 addClass(option, 'last-active');
  550.                             }
  551.                         }
  552.                         if (active) {
  553.                             addClass(option, 'active');
  554.                         } else {
  555.                             filters.querySelectorAll('[data-filter-'+name+'=\"'+value+'\"]').forEach(function (row) {
  556.                                 toggleClass(row, 'filter-hidden-'+name);
  557.                             });
  558.                         }
  559.                         processed[value] = true;
  560.                     });
  561.                     if (1 < list.childNodes.length) {
  562.                         filter.appendChild(list);
  563.                         filter.dataset.filtered = '';
  564.                     }
  565.                 });
  566.             }
  567.         };
  568.     })();
  569.     Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
  570.         Sfjs.createTabs();
  571.         Sfjs.createToggles();
  572.         Sfjs.createFilters();
  573.     });
  574. /*]]>*/</script>
  575. ""@Twig/base_js.html.twig""/var/www/projects/simplymeet-test/vendor/symfony/twig-bundle/Resources/views/base_js.html.twig");
  576.     }
  577. }