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

/* @UVDeskCoreFramework/Privileges/createSupportPrivelege.html.twig */
class __TwigTemplate_9bb7d101f845997219e8598f68f03b89 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->blocks = [
            'title' => [$this, 'block_title'],
            'pageContent' => [$this, 'block_pageContent'],
            'footer' => [$this, 'block_footer'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 1
        return "@UVDeskCoreFramework//Templates//layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->loadTemplate("@UVDeskCoreFramework//Templates//layout.html.twig", "@UVDeskCoreFramework/Privileges/createSupportPrivelege.html.twig", 1);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        yield "Add Privilege";
        yield from [];
    }

    // line 5
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_pageContent(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 6
        yield "\t<div class=\"uv-inner-section\">
        ";
        // line 8
        yield "\t\t";
        $context["asideTemplate"] = "Webkul\\UVDesk\\CoreFrameworkBundle\\Dashboard\\AsideTemplate";
        // line 9
        yield "\t\t";
        $context["asideSidebarReference"] = "Webkul\\UVDesk\\CoreFrameworkBundle\\UIComponents\\Dashboard\\Panel\\Sidebars\\Users";
        // line 10
        yield "
\t\t";
        // line 11
        yield CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["uvdesk_extensibles"] ?? null), "getRegisteredComponent", [($context["asideTemplate"] ?? null)], "method", false, false, false, 11), "renderSidebar", [($context["asideSidebarReference"] ?? null)], "method", false, false, false, 11);
        yield "

\t\t<div class=\"uv-view ";
        // line 13
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 13), "cookies", [], "any", false, false, false, 13) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, false, false, 13), "cookies", [], "any", false, false, false, 13), "get", ["uv-asideView"], "method", false, false, false, 13))) {
            yield "uv-aside-view";
        }
        yield "\">
\t\t\t<h1>";
        // line 14
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Add Privilege"), "html", null, true);
        yield "</h1>
\t\t\t
            ";
        // line 17
        yield "\t\t\t<form method=\"post\" action=\"\" id=\"privilege-form\">
                ";
        // line 19
        yield "\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t<label class=\"uv-field-label\">";
        // line 20
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Name"), "html", null, true);
        yield "</label>
\t\t\t\t\t<div class=\"uv-field-block\">
\t\t\t\t\t\t<input type=\"text\" name=\"privilege_form[name]\" class=\"uv-field\" value=\"";
        // line 22
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["supportPrivilege"] ?? null), "name", [], "any", false, false, false, 22), "html", null, true);
        yield "\" />
\t\t\t\t\t</div>
\t\t\t\t</div>

\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t<label class=\"uv-field-label\">";
        // line 27
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Description"), "html", null, true);
        yield "</label>
\t\t\t\t\t<div class=\"uv-field-block\">
\t\t\t\t\t\t<textarea name=\"privilege_form[description]\" class=\"uv-field\">";
        // line 29
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["supportPrivilege"] ?? null), "description", [], "any", false, false, false, 29), "html", null, true);
        yield "</textarea>
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t\t
                ";
        // line 34
        yield "\t\t\t\t<div class=\"uv-scroll-plank\">
\t\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t\t<label class=\"uv-field-label\">";
        // line 36
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Agent Privileges"), "html", null, true);
        yield "</label>
\t\t\t\t\t\t<span class=\"uv-field-info uv-margin-top-5\">";
        // line 37
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Choose set of privileges which will be available to the agent."), "html", null, true);
        yield "</span>
\t\t\t\t\t</div>
\t\t\t\t\t
\t\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t<span class=\"uv-checkbox-label uv-bold\">";
        // line 42
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Tickets"), "html", null, true);
        yield "</span>
\t\t\t\t\t\t</label>
\t\t\t\t\t</div>

\t\t\t\t\t<div>
\t\t\t\t\t\t<div class=\"uv-scroll-block\" id=\"beauty-scroll\">
\t\t\t\t\t\t\t";
        // line 48
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, ($context["supportPrivilegeResources"] ?? null), "ticket", [], "any", false, false, false, 48));
        foreach ($context['_seq'] as $context["privelegeCode"] => $context["privelegeDescription"]) {
            // line 49
            yield "\t\t\t\t\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t\t\t\t<div class=\"uv-checkbox\">
\t\t\t\t\t\t\t\t\t\t\t<input name=\"privilege_form[privileges][]\" type=\"checkbox\" value=\"";
            // line 52
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["privelegeCode"], "html", null, true);
            yield "\">
\t\t\t\t\t\t\t\t\t\t\t<span class=\"uv-checkbox-view\"></span>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t<span class=\"uv-checkbox-label\">";
            // line 55
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["privelegeDescription"], "html", null, true);
            yield "</span>
\t\t\t\t\t\t\t\t\t</label>
\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['privelegeCode'], $context['privelegeDescription'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 59
        yield "\t\t\t\t\t\t</div>
\t\t\t\t\t</div>

                    ";
        // line 63
        yield "\t\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t\t<a href=\"#\" class=\"select\">";
        // line 64
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Select All"), "html", null, true);
        yield "</a>
\t\t\t\t\t\t<a href=\"#\" class=\"deselect\">";
        // line 65
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Remove All"), "html", null, true);
        yield "</a>
\t\t\t\t\t</div>
\t\t\t\t</div>
                ";
        // line 69
        yield "\t\t\t\t<div class=\"uv-scroll-plank\">
\t\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t<span class=\"uv-checkbox-label uv-bold\">";
        // line 72
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Advanced"), "html", null, true);
        yield "</span>
\t\t\t\t\t\t</label>
\t\t\t\t\t</div>

\t\t\t\t\t<div>
\t\t\t\t\t\t<div class=\"uv-scroll-block\" id=\"beauty-scroll\">
\t\t\t\t\t\t\t";
        // line 78
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, ($context["supportPrivilegeResources"] ?? null), "advanced", [], "any", false, false, false, 78));
        foreach ($context['_seq'] as $context["privelegeCode"] => $context["privelegeDescription"]) {
            // line 79
            yield "\t\t\t\t\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t\t\t\t\t<label>
\t\t\t\t\t\t\t\t\t\t<div class=\"uv-checkbox\">
\t\t\t\t\t\t\t\t\t\t\t<input name=\"privilege_form[privileges][]\" type=\"checkbox\" value=\"";
            // line 82
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["privelegeCode"], "html", null, true);
            yield "\" ";
            if ((($context["supportPrivilege"] ?? null) && CoreExtension::inFilter($context["privelegeCode"], CoreExtension::getAttribute($this->env, $this->source, ($context["supportPrivilege"] ?? null), "privileges", [], "any", false, false, false, 82)))) {
                yield "checked";
            }
            yield ">
\t\t\t\t\t\t\t\t\t\t\t<span class=\"uv-checkbox-view\"></span>
\t\t\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t\t\t\t<span class=\"uv-checkbox-label\">";
            // line 85
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["privelegeDescription"], "html", null, true);
            yield "</span>
\t\t\t\t\t\t\t\t\t</label>
\t\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['privelegeCode'], $context['privelegeDescription'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 89
        yield "\t\t\t\t\t\t</div>
\t\t\t\t\t</div>

                    ";
        // line 93
        yield "\t\t\t\t\t<div class=\"uv-element-block\">
\t\t\t\t\t\t<a href=\"#\" class=\"select\">";
        // line 94
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Select All"), "html", null, true);
        yield "</a>
\t\t\t\t\t\t<a href=\"#\" class=\"deselect\">";
        // line 95
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Remove All"), "html", null, true);
        yield "</a>
\t\t\t\t\t</div>
\t\t\t\t</div>

\t\t\t\t<!-- CSRF token Field -->
                ";
        // line 101
        yield "                <!-- //CSRF token Field -->

\t\t\t\t<input class=\"uv-btn\" href=\"#\" value=\"Save Changes\" type=\"submit\">
\t\t\t</form>
\t\t</div>
\t</div>
";
        yield from [];
    }

    // line 109
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_footer(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 110
        yield "\t";
        yield from $this->yieldParentBlock("footer", $context, $blocks);
        yield "

\t<script type=\"text/javascript\">
\t\t\$(function () {
\t\t\tvar SupportPrivilegeModel = Backbone.Model.extend({
\t\t\t\tvalidation: {
\t\t\t\t\t'privilege_form[name]': [{
\t\t\t\t\t\trequired: true,
\t\t\t\t\t\tmsg: \"";
        // line 118
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html", null, true);
        yield "\"
\t\t\t\t\t}, {
\t\t\t\t\t\tpattern: '^((?![!@#\$%^&*()<>]).)*\$',
\t\t\t\t\t\tmsg: \"";
        // line 121
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Privilege Name must have characters only"), "html", null, true);
        yield "\"
\t\t\t\t\t},{
\t\t\t\t\t\tmaxLength:50,
                        msg: \"";
        // line 124
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Maximum character length is 50"), "html", null, true);
        yield "\"
\t\t\t\t\t}],
\t\t\t\t\t'privilege_form[description]': {
\t\t\t\t\t\trequired: true,
\t\t\t\t\t\tmsg: \"";
        // line 128
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html", null, true);
        yield "\"
\t\t\t\t\t},
\t\t\t\t\t'privilege_form[privileges][]': {
                        fn: function() {
                            return !\$(\"input[name='privilege_form[privileges][]']:checked\").length ? true : false;
                        },
                        msg: \"";
        // line 134
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html", null, true);
        yield "\"
                    },
\t\t\t\t}
\t\t\t});

\t\t\tvar CreateSupportPrivilegeForm = Backbone.View.extend({
\t\t\t\tevents: {
\t\t\t\t\t'click .uv-btn' : \"savePrivilege\",
\t\t\t\t\t'blur input, textarea': 'formChanegd',
\t\t\t\t\t'click a.select': 'selectAll',
\t\t            'click a.deselect': 'deselectAll',
\t\t\t\t},
\t\t\t\tinitialize: function() {
\t\t\t\t\tBackbone.Validation.bind(this);
\t\t\t\t\tvar jsonContext = JSON.parse('";
        // line 148
        yield ($context["errors"] ?? null);
        yield "');

\t\t    \t\tfor (var field in jsonContext) {
\t\t\t\t\t\tif (field == 'privileges') {
\t\t\t\t\t\t\tBackbone.Validation.callbacks.invalid(this, \"privilege_form[privileges][]\", jsonContext[field], 'input');
\t\t\t\t\t\t} else {
\t\t\t\t\t\t\tBackbone.Validation.callbacks.invalid(this, \"privilege_form[\" + field + \"]\", jsonContext[field], 'input');
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t},
\t\t\t\tformChanegd: function(e) {
\t\t\t    \tthis.model.set(Backbone.\$(e.currentTarget).attr('name'), Backbone.\$(e.currentTarget).val())
\t\t\t    \tthis.model.isValid([Backbone.\$(e.currentTarget).attr('name')])
\t\t\t    },
\t\t\t\tsavePrivilege: function (e) {
\t\t\t\t\te.preventDefault();
\t\t\t        this.model.set(this.\$el.serializeObject());

\t\t\t        if (this.model.isValid(true)) {
\t\t\t\t\t\tthis.\$el.find('.uv-btn').attr('disabled', 'disabled');
\t\t\t            this.\$el.submit();
\t\t\t        }
\t\t\t\t},
                selectAll: function (e) {
                    e.preventDefault();
                    this.\$(e.currentTarget).parents('.uv-scroll-plank').find('input').prop('checked', true)
                },
                deselectAll: function (e) {
                    e.preventDefault();
                    this.\$(e.currentTarget).parents('.uv-scroll-plank').find('input').prop('checked', false);
\t\t        },
\t\t\t});

\t\t\tvar createSupportPrivilegeForm = new CreateSupportPrivilegeForm({
\t\t\t\tel: \$(\"#privilege-form\"),
\t\t\t\tmodel: new SupportPrivilegeModel()
\t\t\t});\t
\t\t});
\t</script>
";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "@UVDeskCoreFramework/Privileges/createSupportPrivelege.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  336 => 148,  319 => 134,  310 => 128,  303 => 124,  297 => 121,  291 => 118,  279 => 110,  272 => 109,  261 => 101,  253 => 95,  249 => 94,  246 => 93,  241 => 89,  231 => 85,  221 => 82,  216 => 79,  212 => 78,  203 => 72,  198 => 69,  192 => 65,  188 => 64,  185 => 63,  180 => 59,  170 => 55,  164 => 52,  159 => 49,  155 => 48,  146 => 42,  138 => 37,  134 => 36,  130 => 34,  123 => 29,  118 => 27,  110 => 22,  105 => 20,  102 => 19,  99 => 17,  94 => 14,  88 => 13,  83 => 11,  80 => 10,  77 => 9,  74 => 8,  71 => 6,  64 => 5,  53 => 3,  42 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "@UVDeskCoreFramework/Privileges/createSupportPrivelege.html.twig", "/home/bmdranzo/public_html/vendor/uvdesk/core-framework/Resources/views/Privileges/createSupportPrivelege.html.twig");
    }
}
