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

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] ?: array()) + array("_6177aeb22c8" . "60fcf2344b3d" . "9d788fd0e" => base64_decode("c2VhcmNoX292ZXJ2aW" . "V3"), "_cf1147f375327c8" . "e8e02acd085df1aa" . "6" => base64_decode("b25Ud2lnUHJlU" . "mVuZGVy"), "_23923804e37345d" . "b9c93f81a4a302b1" . "b" => base64_decode("c2VhcmNoX2ljb24udmlzaWJsZ" . "Q=="), "_28459e8c25caa388efa6e9e" . "bf1e6ab12" => base64_decode("c2VhcmNoX2ZpZWxkX3" . "dyYXBwZXIuK2NsYXNz"), "_718df5d9d601e8104066f86c072735f" . "3" => base64_decode("YWktc2VhcmNoIGFpLXNlYXJjaC1uYXZ" . "iYXI="), "_111eb07d16a9103c03f" . "e50eb53259a6e" => base64_decode("YWlfc2VhcmNoX2ljb24ud" . "mlzaWJsZQ=="), "_7c78ef044de79e7" . "986f197a534a47e2" . "9" => base64_decode("Y29tbW9uLmhlYWRlci5hc2tfY" . "W55dGhpbmc="), "_0035617050144e4a29c311c203fde" . "d3b" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EuYXJpYS1sYWJ" . "lbA=="), "_81a63d58717daa2360187c" . "de2012676c" => base64_decode("b25QcmVSZ" . "W5kZXI="), "_e2cd02b34604bb" . "4da597fe440cfe4" . "76e" => base64_decode("c2V" . "hcm" . "No"), "_990213a7" . "66fafdaf2" . "a796c3c9d" . "74b872" => base64_decode("cGFnZV90b3Bfc2VhcmNoX3EucG" . "xhY2Vob2xkZXI="));
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["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_81a63d58717daa2360187cde201267" . "6c"], TwigEvents::PRE_RENDER => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_cf1147f375327c8e8e02a" . "cd085df1aa6"]];
    }
    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["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_e2cd02b34604bb4da59" . "7fe440cfe476e"])) {
            $args[$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_990213a766fafdaf2a796c3c9d74b87" . "2"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_7c78ef044de79e7986f197a" . "534a47e29"]);
            $args[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_0035617050144e4a29" . "c311c203fded3b"]] = ($this->lmsg)($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_7c78ef0" . "44de79e7" . "986f197a" . "534a47e2" . "9"]);
            $args[$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_23923804e37345db9c93f81a" . "4a302b1b"]] = 0;
            $args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_111eb07d16" . "a9103c03fe5" . "0eb53259a6e"]] = 1;
        }
        if ($this->ai->isModuleEnabled($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_6177aeb22c860" . "fcf2344b3d9d78" . "8fd0e"])) {
            $args[$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_28459e8c25caa388efa6e" . "9ebf1e6ab12"]] = $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_718df5d9d601e8104066f86c07" . "2735f3"];
        }
        return $args;
    }
}