<?php
namespace Claromentis\People\Subscriber;

$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] ?: array()) + array("_27437e92c02eea1d74a8cccd49f" . "1ffcb" => base64_decode("aXNfY2xhcm9t" . "ZW50aXNfYWRt" . "aW5pc3RyYXRv" . "ci52YWx1ZQ=="), "_d89898567" . "b597940ae7" . "31780036e8" . "fee" => base64_decode("YXV0aF9" . "1c2Vy"), "_304b42489dc33e48cde58533279c631" . "7" => base64_decode("Y3VycmVudF9" . "leHRyYW5ldA" . "=="), "_cf1147f37532" . "7c8e8e02acd08" . "5df1aa6" => base64_decode("b25Ud2lnUHJl" . "UmVuZGVy"), "_78851a4cf7a81b9280c56a5b34e41d" . "a8" => base64_decode("aXNf" . "bG9n" . "Z2Vk" . "X2lu"), "_7db9191962f05ee" . "8bd69fd4272a96ab" . "7" => base64_decode("aXNfY2xhcm9tZW50aXNfYWRtaW5" . "pc3RyYXRvcg=="), "_81a63d58" . "717daa236" . "0187cde20" . "12676c" => base64_decode("b25Qc" . "mVSZW" . "5kZXI" . "="));
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Core\Templater\Events\TemplaterPreRenderEvent;
use Claromentis\Core\Templater\TemplaterEvents;
use Claromentis\Core\Twig\Events\TwigPreRenderEvent;
use Claromentis\Core\Twig\TwigEvents;
use Claromentis\People\Repository\ExtranetRepository;
use Claromentis\People\Repository\UserRepository;




class RenderSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $context;
    
    
    
    
    protected $user_repository;
    
    
    
    
    protected $extranet_repository;
    
    
    
    
    
    public function __construct(SecurityContext $context, UserRepository $_eeeeb0d673b7b0fd0bdca58b5541c3e0, ExtranetRepository $_4af3095f20a1f91b94a8762557924437)
    {
        $this->context = $context;
        $this->user_repository = $_eeeeb0d673b7b0fd0bdca58b5541c3e0;
        $this->extranet_repository = $_4af3095f20a1f91b94a8762557924437;
    }
    public static function getSubscribedEvents()
    {
        return [TemplaterEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_81a63d58717daa2" . "360187cde2012676" . "c"], TwigEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_cf1147f375327c8e8e" . "02acd085df1aa6"]];
    }
    public function onPreRender(TemplaterPreRenderEvent $event)
    {
        $args = $event->GetArgs();
        $user_id = $this->context->GetUserId();
        $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_78851a4cf7a81b" . "9280c56a5b34e41" . "da8"]] = $user_id > 0 ? 1 : 0;
        $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_27437e92c02eea1d" . "74a8cccd49f1ffcb"]] = $user_id === 1 ? 1 : 0;
        $event->SetArgs($args);
    }
    public function onTwigPreRender(TwigPreRenderEvent $event)
    {
        $user_id = $this->context->GetUserId();
        $extranet_id = $this->context->GetExtranetAreaId();
        $_24e0e36600d6af77406a44bb618a6253 = $this->user_repository->findWithMetadata($user_id);
        $_9a2ef4ae6a5745ffe5fac33c88a222fa = $this->extranet_repository->find($extranet_id);
        $event->addArguments([$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_d89898567b597940" . "ae731780036e8fee"] => $_24e0e36600d6af77406a44bb618a6253, $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_304b42489dc33e48cd" . "e58533279c6317"] => $_9a2ef4ae6a5745ffe5fac33c88a222fa, $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_78851a4cf7a81b9280c56a5b3" . "4e41da8"] => $_24e0e36600d6af77406a44bb618a6253 && $_24e0e36600d6af77406a44bb618a6253->id > 0, $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_7db9191962f05ee8bd69fd" . "4272a96ab7"] => $user_id === 1]);
    }
}