<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
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;
use Twig\TemplateWrapper;

/* @SuluForm/mails/notify.html.twig */
class __TwigTemplate_c311aca90456581e4a79ed808b0b5649 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    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", "@SuluForm/mails/notify.html.twig"));

        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@SuluForm/mails/notify.html.twig"));

        // line 1
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(((CoreExtension::getAttribute($this->env, $this->source, ($context["formEntity"] ?? null), "fields", [], "any", true, true, false, 1)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, (isset($context["formEntity"]) || array_key_exists("formEntity", $context) ? $context["formEntity"] : (function () { throw new RuntimeError('Variable "formEntity" does not exist.', 1, $this->source); })()), "fields", [], "any", false, false, false, 1), [])) : ([])));
        foreach ($context['_seq'] as $context["_key"] => $context["field"]) {
            // line 2
            $context["value"] = CoreExtension::getAttribute($this->env, $this->source, $context["field"], "value", [], "any", false, false, false, 2);
            // line 5
            if (is_iterable((isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 5, $this->source); })()))) {
                // line 6
                if ((CoreExtension::getAttribute($this->env, $this->source, $context["field"], "type", [], "any", false, false, false, 6) == "attachment")) {
                    // line 7
                    $context["mediaUrls"] = [];
                    // line 8
                    $context['_parent'] = $context;
                    $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["field"], "value", [], "any", false, false, false, 8));
                    foreach ($context['_seq'] as $context["_key"] => $context["mediaId"]) {
                        // line 9
                        $context["media"] = $this->extensions['Sulu\Bundle\MediaBundle\Twig\MediaTwigExtension']->resolveMediaFunction($context["mediaId"], CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 9, $this->source); })()), "request", [], "any", false, false, false, 9), "locale", [], "any", false, false, false, 9));
                        // line 10
                        $context["mediaUrls"] = Twig\Extension\CoreExtension::merge((isset($context["mediaUrls"]) || array_key_exists("mediaUrls", $context) ? $context["mediaUrls"] : (function () { throw new RuntimeError('Variable "mediaUrls" does not exist.', 10, $this->source); })()), [(((("<a href=\"" . $this->extensions['Symfony\Bridge\Twig\Extension\HttpFoundationExtension']->generateAbsoluteUrl(CoreExtension::getAttribute($this->env, $this->source, (isset($context["media"]) || array_key_exists("media", $context) ? $context["media"] : (function () { throw new RuntimeError('Variable "media" does not exist.', 10, $this->source); })()), "url", [], "any", false, false, false, 10))) . "\">") . CoreExtension::getAttribute($this->env, $this->source, (isset($context["media"]) || array_key_exists("media", $context) ? $context["media"] : (function () { throw new RuntimeError('Variable "media" does not exist.', 10, $this->source); })()), "title", [], "any", false, false, false, 10)) . "</a>")]);
                    }
                    $_parent = $context['_parent'];
                    unset($context['_seq'], $context['_key'], $context['mediaId'], $context['_parent']);
                    $context = array_intersect_key($context, $_parent) + $_parent;
                    // line 12
                    $context["value"] = ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
                        // line 13
                        yield Twig\Extension\CoreExtension::join((isset($context["mediaUrls"]) || array_key_exists("mediaUrls", $context) ? $context["mediaUrls"] : (function () { throw new RuntimeError('Variable "mediaUrls" does not exist.', 13, $this->source); })()), ", ");
                        yield from [];
                    })())) ? '' : new Markup($tmp, $this->env->getCharset());
                } else {
                    // line 16
                    $context["value"] = json_encode((isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 16, $this->source); })()));
                }
            } elseif (CoreExtension::getAttribute($this->env, $this->source,             // line 18
($context["value"] ?? null), "timestamp", [], "any", true, true, false, 18)) {
                // line 19
                $context["value"] = $this->extensions['Twig\Extension\CoreExtension']->formatDate((isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 19, $this->source); })()), "d.m.Y");
            } else {
                // line 21
                $context["value"] = ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
                    // line 22
                    yield Twig\Extension\CoreExtension::nl2br($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 22, $this->source); })()), "html", null, true));
                    yield from [];
                })())) ? '' : new Markup($tmp, $this->env->getCharset());
            }
            // line 26
            if (( !Twig\Extension\CoreExtension::testEmpty((isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 26, $this->source); })())) &&  !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, $context["field"], "value", [], "any", false, false, false, 26)))) {
                // line 28
                yield "        <strong>";
                yield ((CoreExtension::getAttribute($this->env, $this->source, $context["field"], "shortTitle", [], "any", true, true, false, 28)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, $context["field"], "shortTitle", [], "any", false, false, false, 28), CoreExtension::getAttribute($this->env, $this->source, $context["field"], "title", [], "any", false, false, false, 28))) : (CoreExtension::getAttribute($this->env, $this->source, $context["field"], "title", [], "any", false, false, false, 28)));
                yield "</strong>: ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["value"]) || array_key_exists("value", $context) ? $context["value"] : (function () { throw new RuntimeError('Variable "value" does not exist.', 28, $this->source); })()), "html", null, true);
                yield "<br>
    ";
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['field'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        
        $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);

        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "@SuluForm/mails/notify.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  96 => 28,  94 => 26,  89 => 22,  87 => 21,  84 => 19,  82 => 18,  79 => 16,  74 => 13,  72 => 12,  66 => 10,  64 => 9,  60 => 8,  58 => 7,  56 => 6,  54 => 5,  52 => 2,  48 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% for field in formEntity.fields|default([]) -%}
    {%- set value = field.value -%}

    {# get formatted value. #}
    {%- if value is iterable -%}
        {%- if field.type == 'attachment' -%}
            {%- set mediaUrls = [] -%}
            {%- for mediaId in field.value -%}
                {%- set media = sulu_resolve_media(mediaId, app.request.locale) -%}
                {%- set mediaUrls = mediaUrls|merge(['<a href=\"' ~ absolute_url(media.url) ~ '\">' ~ media.title ~ '</a>']) -%}
            {%- endfor -%}
            {%- set value -%}
                {{- mediaUrls|join(', ')|raw -}}
            {%- endset -%}
        {%- else -%}
            {%- set value = value|json_encode -%}
        {%- endif -%}
    {%- elseif value.timestamp is defined -%}
        {% set value = value|date('d.m.Y') -%}
    {%- else -%}
        {%- set value -%}
            {{- value|nl2br -}}
        {%- endset -%}
    {%- endif -%}

    {%- if value is not empty and field.value is not empty -%}
        {#- fix breaks #}
        <strong>{{ field.shortTitle|default(field.title)|raw }}</strong>: {{ value }}<br>
    {% endif %}
{% endfor %}
", "@SuluForm/mails/notify.html.twig", "C:\\xampp\\htdocs\\taiafropressapi\\vendor\\sulu\\form-bundle\\Resources\\views\\mails\\notify.html.twig");
    }
}
