<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* madeshop/template/extension/module/madeshop_category.twig */
class __TwigTemplate_de0c77a4b412adde5ddbff0102098138ba4edf2225fa3b9cb4fd8ded3e693579 extends \Twig\Template
{
    private $source;
    private $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 = [])
    {
        $macros = $this->macros;
        // line 1
        echo "<ul class=\"cat-module list-unstyled\">
  ";
        // line 2
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["categories"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
            // line 3
            echo "  ";
            if ((twig_get_attribute($this->env, $this->source, $context["category"], "category_id", [], "any", false, false, false, 3) == ($context["category_id"] ?? null))) {
                // line 4
                echo "  <li><a href=\"";
                echo twig_get_attribute($this->env, $this->source, $context["category"], "href", [], "any", false, false, false, 4);
                echo "\" class=\"head active\">";
                echo twig_get_attribute($this->env, $this->source, $context["category"], "name", [], "any", false, false, false, 4);
                echo "</a></li>
  ";
                // line 5
                if (twig_get_attribute($this->env, $this->source, $context["category"], "children", [], "any", false, false, false, 5)) {
                    // line 6
                    echo "  ";
                    $context['_parent'] = $context;
                    $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["category"], "children", [], "any", false, false, false, 6));
                    foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
                        // line 7
                        echo "  <li><a href=\"";
                        echo twig_get_attribute($this->env, $this->source, $context["child"], "href", [], "any", false, false, false, 7);
                        echo "\" class=\"mright ";
                        echo (((twig_get_attribute($this->env, $this->source, $context["child"], "category_id", [], "any", false, false, false, 7) == ($context["child_id"] ?? null))) ? ("active") : (""));
                        echo " ";
                        echo (((twig_get_attribute($this->env, $this->source, $context["child"], "category_id", [], "any", false, false, false, 7) == ($context["last"] ?? null))) ? ("open") : (""));
                        echo " ";
                        echo ($context["last"] ?? null);
                        echo "\">";
                        echo twig_get_attribute($this->env, $this->source, $context["child"], "name", [], "any", false, false, false, 7);
                        echo "</a></li>
  ";
                        // line 8
                        $context['_parent'] = $context;
                        $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["child"], "children2", [], "any", false, false, false, 8));
                        foreach ($context['_seq'] as $context["_key"] => $context["child2"]) {
                            // line 9
                            echo "  <li><a href=\"";
                            echo twig_get_attribute($this->env, $this->source, $context["child2"], "href", [], "any", false, false, false, 9);
                            echo "\" class=\"mright mright2 ";
                            echo (((twig_get_attribute($this->env, $this->source, $context["child2"], "category_id", [], "any", false, false, false, 9) == ($context["child2_id"] ?? null))) ? ("active") : (""));
                            echo " ";
                            echo (((twig_get_attribute($this->env, $this->source, $context["child2"], "category_id", [], "any", false, false, false, 9) == ($context["last"] ?? null))) ? ("open") : (""));
                            echo " ";
                            echo ($context["last"] ?? null);
                            echo "\">";
                            echo twig_get_attribute($this->env, $this->source, $context["child2"], "name", [], "any", false, false, false, 9);
                            echo "</a></li>
  ";
                        }
                        $_parent = $context['_parent'];
                        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child2'], $context['_parent'], $context['loop']);
                        $context = array_intersect_key($context, $_parent) + $_parent;
                        // line 11
                        echo "  ";
                    }
                    $_parent = $context['_parent'];
                    unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
                    $context = array_intersect_key($context, $_parent) + $_parent;
                    // line 12
                    echo "  ";
                }
                // line 13
                echo "  ";
            } else {
                // line 14
                echo "  <li><a href=\"";
                echo twig_get_attribute($this->env, $this->source, $context["category"], "href", [], "any", false, false, false, 14);
                echo "\" class=\"head\">";
                echo twig_get_attribute($this->env, $this->source, $context["category"], "name", [], "any", false, false, false, 14);
                echo "</a></li>
  ";
            }
            // line 16
            echo "  ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['category'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 17
        echo "</ul>";
    }

    public function getTemplateName()
    {
        return "madeshop/template/extension/module/madeshop_category.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  121 => 17,  115 => 16,  107 => 14,  104 => 13,  101 => 12,  95 => 11,  78 => 9,  74 => 8,  61 => 7,  56 => 6,  54 => 5,  47 => 4,  44 => 3,  40 => 2,  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "madeshop/template/extension/module/madeshop_category.twig", "");
    }
}
