<?php
namespace Claromentis\Core\Notification;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] ?: array()) + array("_34d0ce2" . "2cfeec0c" . "c1f38c5f" . "70aab6c7" . "9" => base64_decode("bm90aWZ" . "pY2F0aW" . "9uLnR3a" . "Wc="), "_b4838ebe29c2e1fadc3e3337bec976" . "06" => base64_decode("bm90aWZpY2F0aW9uX3RlbXBsY" . "XRlci50d2ln"), "l" . "m" . "s" . "g" => base64_decode("bG1zZw" . "=="), "_e1ff5b38e589ed1435" . "6c31d60185070d" => base64_decode("bm90aWZpY2F0aW9uX3RlbXBs" . "YXRlci50eHQ="), "_04fc9b453bf84fd27" . "7a74b7b993bdb2c" => base64_decode("bm90aWZpY2F0aW" . "9uLm1hbmFnZXI="));
use Claromentis\Core\TextUtil\ClaText;
use Claromentis\Core\Twig\ClaromentisTextExtension;
use NotificationManager;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use Silex\Api\EventListenerProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\HttpKernel\KernelEvents;




class NotificationServiceProvider implements ServiceProviderInterface, EventListenerProviderInterface
{
    
    
    
    
    
    
    
    
    
    public function register(Container $app)
    {
        $app[Templater\TwigTemplater::class] = function ($app) {
            return new Templater\TwigTemplater($app[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_34d0ce22cfeec0cc1f38c5f70aab" . "6c79"]]);
        };
        $app[\NotificationManager::class] = function () {
            return \NotificationManager::GetInstance();
        };
        $app[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_34d0ce2" . "2cfeec0c" . "c1f38c5f" . "70aab6c7" . "9"]] = function () use($app) {
            $loader = new \Twig\Loader\ArrayLoader([]);
            $_6b67522fca36b32553cd09de29b97ff8 = new \Twig\Environment($loader);
            $_456068583374c520e302333f8181c960 = new \Twig\TwigFunction($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["l" . "m" . "s" . "g"], $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["lms" . "g"]);
            $_6b67522fca36b32553cd09de29b97ff8->addFunction($_456068583374c520e302333f8181c960);
            $_6b67522fca36b32553cd09de29b97ff8->addExtension(new ClaromentisTextExtension($app[ClaText::class]));
            return $_6b67522fca36b32553cd09de29b97ff8;
        };
        $app[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_04fc9b453bf84fd27" . "7a74b7b993bdb2c"]] = \NotificationManager::class;
        $app[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_e1ff5b38e589ed14356c31d6018507" . "0d"]] = Templater\SimpleTemplater::class;
        $app[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_b4838ebe29c2e1fadc3e333" . "7bec97606"]] = Templater\TwigTemplater::class;
    }
    public function subscribe(Container $app, EventDispatcherInterface $_b497ce6f2af10f67516aed0ecf34d8cf)
    {
        
        
        $_b497ce6f2af10f67516aed0ecf34d8cf->addListener(KernelEvents::TERMINATE, function (TerminateEvent $event) use($app) {
            $_fd5a3a643834299cbdadfc3540ba0bcb = $event->getResponse();
            if ($_fd5a3a643834299cbdadfc3540ba0bcb->getStatusCode() != 200) {
                return;
            }
            $_78f96256dee2054aa66d935e3d929b3f = $app[NotificationManager::class];
            $_78f96256dee2054aa66d935e3d929b3f->SendNotifications();
        });
    }
}