<?php
namespace Claromentis\Comments\Notification;

$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] ?: array()) + array("_2dfec55458830b50acfaec145" . "ec041da" => base64_decode("Y29tbWVudHMub" . "mV3X2NvbW1lbn" . "Q="), "_f73dab606630b388645c" . "4f7d3fbb13bb" => base64_decode("YXJyYXlfbWVyZ" . "2U="), "_e06da3ffba2e84b8e6f94" . "bd2d6ca3c52" => base64_decode("Y3JlYXRlX2ludGVyb" . "mFsX2xpbms="), "_7f628626dd1" . "d55c71b1fc09" . "32ffd1d2c" => base64_decode("aXNfY" . "XJyYX" . "k="), "_2732158fa75b66cb533cea88bb64bc" . "5b" => base64_decode("dHlwZV" . "9uYW1l"), "_e161130afed71af" . "06c79f2228aeeae1" . "f" => base64_decode("dH" . "h0"), "_8e9463b7f0" . "41a84acd38d" . "e632adb12d8" => base64_decode("bGlua1" . "90b19k" . "aXNjdX" . "Nz"), "_6fd29f1ce82d5e2d09a2d8" . "06c2e2b1d5" => base64_decode("aXNfY2FsbGFibGU" . "="), "commen" . "t" => base64_decode("Y29tbWV" . "udA=="), "_4d707fab" . "93bebb00b" . "be69e8159" . "697c90" => base64_decode(""), "_f784524629d9404cd62ba" . "9e1475d3bc3" => base64_decode("b2JqZWN0X2" . "5hbWU="), "_92eafb51f6087d0de" . "09c0b39978f26dc" => base64_decode("dXNlcl93aG9fcG9" . "zdGVk"), "_a591754a8ddcdbda9c80f1d" . "b4d911e14" => base64_decode("aXNfbnVsbA=" . "="), "_31767d7ad58" . "e706dbf47b7a" . "51a0fe6c4" => base64_decode("Y291bnQ" . "="));
use Claromentis\Comments\CommentableInterface;
use Claromentis\Comments\Model\Comment;
class Notification
{
    public $template;
    public $type;
    public $object;
    protected $tmpl_values = [];
    protected $add_tmpl_values = [];
    protected $recipients = [];
    protected $add_recipients = [];
    protected $launch_url = null;
    
    
    
    
    
    
    
    
    
    public static function CreateDefault(Comment $comment, CommentableInterface $_b15aac3aa29c10ea6d1228f58cb9a7e8)
    {
        $_99aaa03a11622e16e59bff0771ea8ef3 = new static();
        $_99aaa03a11622e16e59bff0771ea8ef3->template = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_2dfec554" . "58830b50a" . "cfaec145e" . "c041da"];
        $_99aaa03a11622e16e59bff0771ea8ef3->type = \IMessage::TYPE_DISCUSSION;
        $_da21c58b24cc90c6337ebabe933d5374 = $_b15aac3aa29c10ea6d1228f58cb9a7e8->GetAggregationObject();
        $_99aaa03a11622e16e59bff0771ea8ef3->object = $_da21c58b24cc90c6337ebabe933d5374;
        $_99aaa03a11622e16e59bff0771ea8ef3->recipients = function () {
        };
        $_99aaa03a11622e16e59bff0771ea8ef3->tmpl_values = function () use($comment, $_da21c58b24cc90c6337ebabe933d5374) {
            return array(
                $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_2732158fa75b66cb533cea8" . "8bb64bc5b"] => \ClaAggregations::GetNameSingular($_da21c58b24cc90c6337ebabe933d5374->GetAggregation()),
                $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_f784524629d9404cd62ba9e1475d3" . "bc3"] => $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_4d707fab93beb" . "b00bbe69e81596" . "97c90"],
                
                
                $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_92eafb51" . "f6087d0de" . "09c0b3997" . "8f26dc"] => \User::GetNameById($comment->user_id),
                $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["comm" . "ent"] => Comment::GetParsedText($comment->GetProperty($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_e161130afed71af06c" . "79f2228aeeae1f"])),
                $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_8e9463b7f0" . "41a84acd38d" . "e632adb12d8"] => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_e06da3ffba2e84" . "b8e6f94bd2d6ca3" . "c52"]($comment->GetPermalink()),
            );
        };
        return $_99aaa03a11622e16e59bff0771ea8ef3;
    }
    
    
    
    
    public function AddRecipients($_5882c836e9757b405d08e77f1fd2a18b)
    {
        if (empty($this->add_recipients)) {
            $this->add_recipients = $_5882c836e9757b405d08e77f1fd2a18b;
        } else {
            $this->add_recipients = $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_f73dab606630b388645c4f7d3fbb1" . "3bb"]($this->add_recipients, $_5882c836e9757b405d08e77f1fd2a18b);
        }
    }
    
    
    
    
    public function GetRecipients()
    {
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_6fd29f1ce82d5e" . "2d09a2d806c2e2b" . "1d5"]($this->recipients)) {
            $_521de5aa083f952083355c24539ed23a = $this->recipients;
            $this->recipients = $_521de5aa083f952083355c24539ed23a();
        }
        if (!$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_7f628626dd1d55c71b1fc0932ff" . "d1d2c"]($this->recipients)) {
            $this->recipients = [];
        }
        return $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_f73dab60663" . "0b388645c4f7" . "d3fbb13bb"]($this->recipients, $this->add_recipients);
    }
    
    
    
    
    public function SetRecipients($_5882c836e9757b405d08e77f1fd2a18b)
    {
        $this->recipients = $_5882c836e9757b405d08e77f1fd2a18b;
        $this->add_recipients = [];
    }
    
    
    
    
    public function AddTemplateValues($_853c3819a2a75122205cffbbeb4076fa)
    {
        if (empty($this->add_tmpl_values)) {
            $this->add_tmpl_values = $_853c3819a2a75122205cffbbeb4076fa;
        } else {
            $this->add_tmpl_values = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_f73dab606630b388645c4f7d3fb" . "b13bb"]($this->add_tmpl_values, $_853c3819a2a75122205cffbbeb4076fa);
        }
    }
    
    
    
    
    public function GetTemplateValues()
    {
        if ($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_6fd29f1ce82" . "d5e2d09a2d80" . "6c2e2b1d5"]($this->tmpl_values)) {
            $_521de5aa083f952083355c24539ed23a = $this->tmpl_values;
            $this->tmpl_values = $_521de5aa083f952083355c24539ed23a();
        }
        if (!$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_7f628626dd1d55c71b1fc093" . "2ffd1d2c"]($this->tmpl_values)) {
            $this->tmpl_values = [];
        }
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_f73dab606630b388" . "645c4f7d3fbb13bb"]($this->tmpl_values, $this->add_tmpl_values);
    }
    
    
    
    
    public function SetTemplateValues($_853c3819a2a75122205cffbbeb4076fa)
    {
        $this->tmpl_values = $_853c3819a2a75122205cffbbeb4076fa;
        $this->add_tmpl_values = [];
    }
    
    
    
    
    public function SetLaunchUrl(string $_aaa5c303d68b56e51664da889c8f730c)
    {
        $this->launch_url = $_aaa5c303d68b56e51664da889c8f730c;
    }
    
    
    
    
    public function Send()
    {
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_a591754a8ddcdbda9" . "c80f1db4d911e14"]($this->template)) {
            return;
        }
        $_fa7526ba4ccc308fe61186445986ceaa = $this->GetRecipients();
        if ($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_31767d7ad58e706dbf47b7a51a0f" . "e6c4"]($_fa7526ba4ccc308fe61186445986ceaa) > 0) {
            \NotificationMessage::Send($this->template, $this->GetTemplateValues(), $_fa7526ba4ccc308fe61186445986ceaa, $this->type, $this->object, null, false, $this->launch_url);
        }
    }
}