<?php
namespace Claromentis\Core\Ai\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] ?: array()) + array("_23923804e3" . "7345db9c93f" . "81a4a302b1b" => base64_decode("c2VhcmNoX2ljb24udmlzaWJsZQ=" . "="), "_81a63d58717" . "daa2360187cd" . "e2012676c" => base64_decode("b25Qcm" . "VSZW5k" . "ZXI="), "_7c78ef044de79e7986f197a5" . "34a47e29" => base64_decode("Y29tbW9uLmhlYWR" . "lci5hc2tfYW55dG" . "hpbmc="), "_990213a766fafdaf2a796c3c9d74b" . "872" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EucGxhY2Vob2xk" . "ZXI="), "_e2cd02b34604bb4da5" . "97fe440cfe476e" => base64_decode("c2Vh" . "cmNo"), "_28459e8c25ca" . "a388efa6e9ebf" . "1e6ab12" => base64_decode("c2VhcmNoX2Z" . "pZWxkX3dyYX" . "BwZXIuK2NsY" . "XNz"), "_0035617050144e4a29c311c203" . "fded3b" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EuYXJ" . "pYS1sYWJlbA=="), "_cf1147f375327c8e8e02a" . "cd085df1aa6" => base64_decode("b25Ud2lnU" . "HJlUmVuZG" . "Vy"), "_718df5d9d601e8104066f86c072" . "735f3" => base64_decode("YWktc2VhcmNoIGFpLXNlYXJjaC1uYXZiYX" . "I="), "_111eb07" . "d16a9103" . "c03fe50e" . "b53259a6" . "e" => base64_decode("YWlfc2Vhc" . "mNoX2ljb2" . "4udmlzaWJ" . "sZQ=="), "_6177aeb22c860fcf2344b3d9d788fd" . "0e" => base64_decode("c2VhcmNoX2" . "92ZXJ2aWV3"));
use Claromentis\Core\Ai\Ai;
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Core\Templater\Events\TemplaterPreRenderEvent;
use Claromentis\Core\Templater\TemplaterEvents;
use Claromentis\Core\Twig\Events\TwigPreRenderEvent;
use Claromentis\Core\Twig\TwigEvents;




class RenderSubscriber implements EventSubscriberInterface
{
    protected Ai $ai;
    protected Lmsg $lmsg;
    
    
    
    
    
    
    
    public function __construct(Ai $ai, Lmsg $lmsg)
    {
        $this->ai = $ai;
        $this->lmsg = $lmsg;
    }
    public static function getSubscribedEvents()
    {
        return [TemplaterEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_81a63d58717daa2360187cde20" . "12676c"], TwigEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_cf1147f375327c8e8e02acd085df1a" . "a6"]];
    }
    public function onPreRender(TemplaterPreRenderEvent $event)
    {
        $args = $this->applyTemplateArguments($event->GetArgs());
        $event->SetArgs($args);
    }
    public function onTwigPreRender(TwigPreRenderEvent $event)
    {
        $args = $this->applyTemplateArguments();
        $event->addArguments($args);
    }
    
    
    
    
    
    
    
    private function applyTemplateArguments(array $args = []) : array
    {
        if ($this->ai->isModuleEnabled($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_e2cd02b34604bb4da597fe440cfe" . "476e"])) {
            $args[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_990213a" . "766fafda" . "f2a796c3" . "c9d74b87" . "2"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_7c78ef044de79e7986f" . "197a534a47e29"]);
            $args[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_0035617050144e4a29c311c203fd" . "ed3b"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_7c78ef044de79e7986f1" . "97a534a47e29"]);
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_23923804e37345db9c93f81a4a3" . "02b1b"]] = 0;
            $args[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_111eb07d1" . "6a9103c03f" . "e50eb53259" . "a6e"]] = 1;
        }
        if ($this->ai->isModuleEnabled($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_6177aeb22c860fcf2344b3d9d" . "788fd0e"])) {
            $args[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_28459e8c25caa38" . "8efa6e9ebf1e6ab1" . "2"]] = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_718df5d9d601e810406" . "6f86c072735f3"];
        }
        return $args;
    }
}