<?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;

/* pages/admin/helpdesk_home_translation.html.twig */
class __TwigTemplate_949f38c2abcf20ecad2b7c975ede6282 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;
        // line 32
        yield "
";
        // line 87
        yield "
";
        // line 88
        $context["entries"] = [];
        // line 89
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "listTranslationsHandlers", [], "method", false, false, false, 89));
        foreach ($context['_seq'] as $context["_key"] => $context["handlers"]) {
            // line 90
            yield "    ";
            $context["entries"] = Twig\Extension\CoreExtension::merge(($context["entries"] ?? null), [["type" => (("<span data-glpi-helpdesk-translations-subtitle-row>" . CoreExtension::getAttribute($this->env, $this->source, Twig\Extension\CoreExtension::first($this->env->getCharset(),             // line 91
$context["handlers"]), "getCategory", [], "method", false, false, false, 91)) . "</span>"), "type_colspan" => 3, "type_aria_label" => _n("Category", "Categories", 1)]]);
            // line 95
            yield "    ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable($context["handlers"]);
            foreach ($context['_seq'] as $context["_key"] => $context["handler"]) {
                // line 96
                yield "        ";
                $context["entries"] = Twig\Extension\CoreExtension::merge(($context["entries"] ?? null), [["type" => (("<span class=\"fw-medium\">" . CoreExtension::getAttribute($this->env, $this->source,                 // line 97
$context["handler"], "getName", [], "method", false, false, false, 97)) . "</span>"), "default" => (((($tmp = CoreExtension::getAttribute($this->env, $this->source,                 // line 98
$context["handler"], "isRichText", [], "method", false, false, false, 98)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ($this->extensions['Glpi\Application\View\Extension\DataHelpersExtension']->getSafeHtml(CoreExtension::getAttribute($this->env, $this->source, $context["handler"], "getValue", [], "method", false, false, false, 98))) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["handler"], "getValue", [], "method", false, false, false, 98)))), "translation" => $this->getTemplateForMacro("macro_getTranslationInput", $context, 99, $this->getSourceContext())->macro_getTranslationInput(...[                // line 100
$context["handler"], CoreExtension::getAttribute($this->env, $this->source,                 // line 101
($context["helpdesk_translation"] ?? null), "getForItemKeyAndLanguage", [CoreExtension::getAttribute($this->env, $this->source,                 // line 102
$context["handler"], "getItem", [], "method", false, false, false, 102), CoreExtension::getAttribute($this->env, $this->source,                 // line 103
$context["handler"], "getKey", [], "method", false, false, false, 103), (($_v0 = CoreExtension::getAttribute($this->env, $this->source,                 // line 104
($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 104)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["language"] ?? null) : null)], "method", false, false, false, 101)]), "type_aria_label" => __("Translation name"), "default_aria_label" => __("Default value"), "translation_aria_label" => __("Translated value")]]);
                // line 111
                yield "    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['handler'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['handlers'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 113
        yield "
<button
    type=\"button\"
    class=\"btn btn-link\"
    data-bs-toggle=\"modal\"
    data-bs-target=\"#helpdesk-translation-modal-";
        // line 118
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v1 = CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 118)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["language"] ?? null) : null), "html", null, true);
        yield "\"
    aria-label=\"";
        // line 119
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Edit translation"), "html", null, true);
        yield "\"
>
    <strong>";
        // line 121
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\PhpExtension']->call("Dropdown::getLanguageName", [(($_v2 = CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 121)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["language"] ?? null) : null)]), "html", null, true);
        yield "</strong>
</button>

<div class=\"modal fade\" id=\"helpdesk-translation-modal-";
        // line 124
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v3 = CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 124)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["language"] ?? null) : null), "html", null, true);
        yield "\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"helpdesk-translation-modal-title-";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v4 = CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 124)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["language"] ?? null) : null), "html", null, true);
        yield "\">
    <div class=\"modal-dialog modal-xl modal-dialog-scrollable\" role=\"document\">
        <form class=\"modal-content\" method=\"POST\">
            <input type=\"hidden\" name=\"_glpi_csrf_token\" value=\"";
        // line 127
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Session::getNewCSRFToken(), "html", null, true);
        yield "\" />
            <input type=\"hidden\" name=\"helpdesk_translation_id\" value=\"";
        // line 128
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "getID", [], "method", false, false, false, 128), "html", null, true);
        yield "\" />

            <div class=\"modal-header border-bottom-0\">
                <h5 class=\"modal-title\" id=\"helpdesk-translation-modal-title-";
        // line 131
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v5 = CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 131)) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5["language"] ?? null) : null), "html", null, true);
        yield "\">
                    ";
        // line 132
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf(__("Helpdesk translations: %s"), $this->extensions['Glpi\Application\View\Extension\PhpExtension']->call("Dropdown::getLanguageName", [(($_v6 = CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 132)) && is_array($_v6) || $_v6 instanceof ArrayAccess ? ($_v6["language"] ?? null) : null)])), "html", null, true);
        yield "
                </h5>
                <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"";
        // line 134
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Close"), "html", null, true);
        yield "\"></button>
            </div>
            <div class=\"modal-body p-0\">
                ";
        // line 137
        yield from $this->load("components/datatable.html.twig", 137)->unwrap()->yield(CoreExtension::toArray(["datatable_id" => "glpi-helpdesk-translations-languages", "datatable_aria_label" => _n("Helpdesk translation", "Helpdesk translations", Session::getPluralNumber()), "columns" => ["type" => "", "default" => Twig\Extension\CoreExtension::sprintf(__("Default (%s)"), $this->extensions['Glpi\Application\View\Extension\PhpExtension']->call("Dropdown::getLanguageName", [$this->extensions['Glpi\Application\View\Extension\ConfigExtension']->config("language")])), "translation" => $this->extensions['Glpi\Application\View\Extension\PhpExtension']->call("Dropdown::getLanguageName", [(($_v7 = CoreExtension::getAttribute($this->env, $this->source,         // line 143
($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 143)) && is_array($_v7) || $_v7 instanceof ArrayAccess ? ($_v7["language"] ?? null) : null)])], "formatters" => ["type" => "raw_html", "default" => "raw_html", "translation" => "raw_html"], "entries" =>         // line 150
($context["entries"] ?? null), "total_number" => 1, "nofilter" => true, "nosort" => true]));
        // line 155
        yield "            </div>
            <div class=\"modal-footer border-top-0\">
                ";
        // line 157
        if ((($tmp = ($context["can_update"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 158
            yield "                    <div class=\"d-flex flex-row-reverse w-100\" role=\"group\" aria-label=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Form actions"), "html", null, true);
            yield "\">
                        <button
                            class=\"btn btn-primary ms-2\"
                            name=\"update\"
                            type=\"submit\"
                            formaction=\"";
            // line 163
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\RoutingExtension']->path(("Helpdesk/Translation/" . (($_v8 = CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 163)) && is_array($_v8) || $_v8 instanceof ArrayAccess ? ($_v8["language"] ?? null) : null))), "html", null, true);
            yield "\"
                            aria-label=\"";
            // line 164
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Save translation"), "html", null, true);
            yield "\"
                        >
                            <i class=\"ti ti-device-floppy me-2\" aria-hidden=\"true\"></i>
                            ";
            // line 167
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Save"), "html", null, true);
            yield "
                        </button>
                        <button
                            class=\"btn btn-ghost-danger\"
                            name=\"delete\"
                            type=\"submit\"
                            formaction=\"";
            // line 173
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\RoutingExtension']->path((("Helpdesk/Translation/" . (($_v9 = CoreExtension::getAttribute($this->env, $this->source, ($context["helpdesk_translation"] ?? null), "fields", [], "any", false, false, false, 173)) && is_array($_v9) || $_v9 instanceof ArrayAccess ? ($_v9["language"] ?? null) : null)) . "/Delete")), "html", null, true);
            yield "\"
                            aria-label=\"";
            // line 174
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Delete translation"), "html", null, true);
            yield "\"
                        >
                            <i class=\"ti ti-trash me-2\" aria-hidden=\"true\"></i>
                            ";
            // line 177
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Delete"), "html", null, true);
            yield "
                        </button>
                    </div>
                ";
        } else {
            // line 181
            yield "                    <button type=\"button\" class=\"btn btn-outline-secondary\" data-bs-dismiss=\"modal\">
                        <i class=\"ti ti-x me-2\" aria-hidden=\"true\"></i>
                        ";
            // line 183
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Close"), "html", null, true);
            yield "
                    </button>
                ";
        }
        // line 186
        yield "            </div>
        </form>
    </div>
</div>
";
        yield from [];
    }

    // line 33
    public function macro_getTranslationInput($handler = null, $translation = null, ...$varargs): string|Markup
    {
        $macros = $this->macros;
        $context = [
            "handler" => $handler,
            "translation" => $translation,
            "varargs" => $varargs,
        ] + $this->env->getGlobals();

        $blocks = [];

        return ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
            // line 34
            yield "    ";
            $macros["fields"] = $this->load("components/form/fields_macros.html.twig", 34)->unwrap();
            // line 35
            yield "
    ";
            // line 36
            $context["rand"] = Twig\Extension\CoreExtension::random($this->env->getCharset());
            // line 37
            yield "
    <input type=\"hidden\" name=\"translations[";
            // line 38
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
            yield "][itemtype]\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(get_class(CoreExtension::getAttribute($this->env, $this->source, ($context["handler"] ?? null), "getItem", [], "method", false, false, false, 38)), "html", null, true);
            yield "\" />
    <input type=\"hidden\" name=\"translations[";
            // line 39
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
            yield "][items_id]\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["handler"] ?? null), "getItem", [], "method", false, false, false, 39), "getID", [], "method", false, false, false, 39), "html", null, true);
            yield "\" />
    <input type=\"hidden\" name=\"translations[";
            // line 40
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
            yield "][key]\" value=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["handler"] ?? null), "getKey", [], "method", false, false, false, 40), "html", null, true);
            yield "\" />

    <div class=\"d-flex align-items-center\">
        ";
            // line 43
            if ((($context["translation"] ?? null) && CoreExtension::getAttribute($this->env, $this->source, ($context["translation"] ?? null), "isPossiblyObsolete", [], "method", false, false, false, 43))) {
                // line 44
                yield "            <i
                class=\"ti ti-alert-circle text-warning me-1\"
                aria-hidden=\"true\"
                data-bs-toggle=\"tooltip\"
                title=\"";
                // line 48
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("The default value has changed since the last translation"), "html", null, true);
                yield "\"
                aria-label=\"";
                // line 49
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Translation may be obsolete"), "html", null, true);
                yield "\"
            ></i>
        ";
            }
            // line 52
            yield "
        ";
            // line 53
            $context["current_translation"] = "";
            // line 54
            yield "        ";
            if ((($tmp = ($context["translation"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 55
                yield "            ";
                $context["current_translation"] = CoreExtension::getAttribute($this->env, $this->source, ($context["translation"] ?? null), "getTranslation", [], "method", false, false, false, 55);
                // line 56
                yield "        ";
            }
            // line 57
            yield "        ";
            if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, ($context["handler"] ?? null), "isRichText", [], "method", false, false, false, 57)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 58
                yield "            ";
                yield $macros["fields"]->getTemplateForMacro("macro_textareaField", $context, 58, $this->getSourceContext())->macro_textareaField(...[Twig\Extension\CoreExtension::sprintf("translations[%s][translations][one]",                 // line 59
($context["rand"] ?? null)),                 // line 60
($context["current_translation"] ?? null), "", ["no_label" => true, "full_width" => true, "mb" => "", "aria_label" => __("Enter translation"), "placeholder" => __("Enter translation"), "enable_richtext" => true, "statusbar" => false, "editor_height" => 0, "init" => false, "init_on_demand" => true]]);
                // line 74
                yield "
        ";
            } else {
                // line 76
                yield "            <input
                type=\"text\"
                name=\"translations[";
                // line 78
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
                yield "][translations][one]\"
                class=\"form-control\"
                placeholder=\"";
                // line 80
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Enter translation"), "html", null, true);
                yield "\"
                value=\"";
                // line 81
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["current_translation"] ?? null), "html", null, true);
                yield "\"
                aria-label=\"";
                // line 82
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Enter translation"), "html", null, true);
                yield "\"
            />
        ";
            }
            // line 85
            yield "    </div>
";
            yield from [];
        })())) ? '' : new Markup($tmp, $this->env->getCharset());
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "pages/admin/helpdesk_home_translation.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  323 => 85,  317 => 82,  313 => 81,  309 => 80,  304 => 78,  300 => 76,  296 => 74,  294 => 60,  293 => 59,  291 => 58,  288 => 57,  285 => 56,  282 => 55,  279 => 54,  277 => 53,  274 => 52,  268 => 49,  264 => 48,  258 => 44,  256 => 43,  248 => 40,  242 => 39,  236 => 38,  233 => 37,  231 => 36,  228 => 35,  225 => 34,  212 => 33,  203 => 186,  197 => 183,  193 => 181,  186 => 177,  180 => 174,  176 => 173,  167 => 167,  161 => 164,  157 => 163,  148 => 158,  146 => 157,  142 => 155,  140 => 150,  139 => 143,  138 => 137,  132 => 134,  127 => 132,  123 => 131,  117 => 128,  113 => 127,  105 => 124,  99 => 121,  94 => 119,  90 => 118,  83 => 113,  73 => 111,  71 => 104,  70 => 103,  69 => 102,  68 => 101,  67 => 100,  66 => 98,  65 => 97,  63 => 96,  58 => 95,  56 => 91,  54 => 90,  50 => 89,  48 => 88,  45 => 87,  42 => 32,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "pages/admin/helpdesk_home_translation.html.twig", "/home/tisoluci/public_html/crpamplona/templates/pages/admin/helpdesk_home_translation.html.twig");
    }
}
