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

$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"] ?: array()) + array("_e258c5dc522b65a06457" . "11c5089a8e9c" => base64_decode("aXR" . "lbX" . "M="), "_294579c234bf40023d4525f0f3" . "2b7cca" => base64_decode("VGhlIGVuZCBvZiB0aGUgZGF0ZSByYW5nZSAoVW5" . "peCB0aW1lc3RhbXAsIFVUQyku"), "_da0554e7f66942" . "dcfb6ce9b56131f" . "140" => base64_decode("Y2FsZW5" . "kYXI="), "_0c519e721cc3079fb" . "b252fbd60fd7904" => base64_decode("dG" . "lt" . "ZQ" . "=="), "_f53ea64d23c54c316bfd" . "8fc86a6635c7" => base64_decode("CgoJVXNlIHRoaXMgd2hlbmV2ZXIgYSB1c2VyIGFza3MgYWJvdXQgdGhlaXIgc2NoZWR1bGUsIHVwY29taW5nIG1lZXRpbmdzLCBvciBjb21wYW55IGhvbGlkYXlzLgoJSWYgYSB1c2VyIGFza3MgZm9yICJ0b2Rh" . "eSIsIHVzZSB0aGUgcmFuZ2UgZnJvbSB0aGUgc3RhcnQgdG8gdGhlIGVuZCBvZiA="), "_600b2f640f54132db59" . "5bb60f15e0676" => base64_decode("WS" . "1t" . "LW" . "Q="), "_9e0a9446602a728eddf" . "64b23af901ea0" => base64_decode("ZW5kRGF0Z" . "Q=="), "_7292a62b64774bfaa76" . "bdb9c5f6026ff" => base64_decode("LgoJSWYgYSB1c2VyIGRvZXNuJ3Q" . "gcHJvdmlkZSBhIHN0YXJ0IGRhdG" . "Ugb3IgZW5kIGRhdGUsIGdyYWIgZ" . "XZlbnRzIGZvciB0aGlzIHdlZWsu"), "_a92c6398f0b00deb3ab06f71" . "879f7545" => base64_decode("c3RhcnREY" . "XRl"), "_730c8fb144637eb321e79f0" . "605f79b4a" => base64_decode("CgktIEN1cn" . "JlbnQgVW5p" . "eCBUaW1lc3" . "RhbXA6IA=="), "_8baf6ac4dc0b89cfa6a5abea49db1f5" . "6" => base64_decode("VGhlIGJlZ2lubmluZyB" . "vZiB0aGUgZGF0ZSByYW" . "5nZSAoVW5peCB0aW1lc" . "3RhbXAsIFVUQyku"), "_688e8aa058a03eb9e9" . "769da719316557" => base64_decode("WS1tLWQgSDp" . "pOnM="), "_f26a578" . "35a79e37" . "dde9c180" . "d23863a6" . "1" => base64_decode("CVVzZSB0aGlzIHRvb2wgdG8gcmV0cmlldmUgZXZlbnRzIGZyb20gdGhlIHVzZXIncyBwZXJzb25hbCBhbmQgY29tcGFueS13aWRlIGNhbGVuZGFycy4KCUl0IHJldHVybnMgYWxsIGV2ZW50cyB0aGUgdXNlciBoYXMgcGVybWlzc2lvbiB0byB2aWV3IHdpdGhpbiBhIHNwZWNpZmljIGRhdGUgcmFuZ2UuCgoJQ1JJVElDQUwgQ09OVEVYVDoKCS0gVG9kYXkncyBEYX" . "RlOiA="), "_aaabebe7ea4dcd24a8e6b36" . "cfe511422" => base64_decode("VV" . "RD"));
use Claromentis\Calendar\Format\EventFormatter;
use Claromentis\Core\Ai\AiParameterType;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Core\Services;
use Date;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
class AiCalendarTool implements AiToolInterface
{
    private EventFormatter $eventFormatter;
    private SecurityContext $context;
    private SessionInterface $session;
    public function __construct(EventFormatter $_d972de905a99bbc1a92c54b3669721fd, SecurityContext $context, SessionInterface $session)
    {
        $this->eventFormatter = $_d972de905a99bbc1a92c54b3669721fd;
        $this->context = $context;
        $this->session = $session;
    }
    public function getName() : string
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_da0554e7f66942dcfb6ce9b56131f14" . "0"];
    }
    public function getDescription() : string
    {
        $_d230962d9a57dc6ba2b774d9ba3bb81e = $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_0c519e721cc3079fbb252fbd6" . "0fd7904"]();
        $_5109895e3895ae9217ef168ea501d540 = (new Date())->format($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_600b2f640f54132db595bb60f15e067" . "6"]);
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_f26a57835a79e37dde9c180d2" . "3863a61"] . $_5109895e3895ae9217ef168ea501d540 . $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_730c8fb144637eb321e79f06" . "05f79b4a"] . $_d230962d9a57dc6ba2b774d9ba3bb81e . $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_f53ea64d23c54c31" . "6bfd8fc86a6635c7"] . $_5109895e3895ae9217ef168ea501d540 . $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_7292a62b64774bfaa76bd" . "b9c5f6026ff"];
    }
    public function execute(array $args) : array
    {
        $_a92c6398f0b00deb3ab06f71879f7545 = $args[$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_a92c6398f0b00deb3ab0" . "6f71879f7545"]] ?? null;
        $_9e0a9446602a728eddf64b23af901ea0 = $args[$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_9e0a9446602a728edd" . "f64b23af901ea0"]] ?? null;
        if (!$_a92c6398f0b00deb3ab06f71879f7545 || !$_9e0a9446602a728eddf64b23af901ea0) {
            return [];
        }
        $_8db463fd8f9544f55010b1bff82e94e0 = new Date($_a92c6398f0b00deb3ab06f71879f7545, new \DateTimeZone($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_aaabebe7ea4dcd24a8e6b36cfe5" . "11422"]));
        $_ae6873e9422266b5de41a2f3ce905828 = new Date($_9e0a9446602a728eddf64b23af901ea0, new \DateTimeZone($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_aaabebe7ea4d" . "cd24a8e6b36cf" . "e511422"]));
        $_ccd9e402149a4aff4a20de187781aa41 = new Date($_8db463fd8f9544f55010b1bff82e94e0->format($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_688e8aa058a03eb9e9769da7193165" . "57"]));
        $_ef3a72fcbe857b2afe45cb9d8cafb253 = new Date($_ae6873e9422266b5de41a2f3ce905828->format($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_688e8aa" . "058a03eb" . "9e9769da" . "71931655" . "7"]));
        
        
        $_00ab16f2e73c61c756f79df3d6248d77 = Services::I()->{$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_da0554e7f6694" . "2dcfb6ce9b5613" . "1f140"]};
        $_6a1345c96c7a9979e3216247935fd6b5 = $_00ab16f2e73c61c756f79df3d6248d77->GetEventsInSessionCalendars($_ccd9e402149a4aff4a20de187781aa41, $_ef3a72fcbe857b2afe45cb9d8cafb253, $this->session);
        $_cf2fc9dc06b97e9dba337d5a2c54fe58 = $_00ab16f2e73c61c756f79df3d6248d77->GetCalendars();
        $_e258c5dc522b65a0645711c5089a8e9c = $this->eventFormatter->FormatEvents($_6a1345c96c7a9979e3216247935fd6b5, $_cf2fc9dc06b97e9dba337d5a2c54fe58, $this->context->GetUserId());
        return [$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_e258c5dc522b65a0645711c5089a" . "8e9c"] => $_e258c5dc522b65a0645711c5089a8e9c];
    }
    public function getSchema() : AiToolSchemaBuilder
    {
        return AiToolSchemaBuilder::create()->add($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_a92c6398f0b00deb3ab06f7" . "1879f7545"], AiParameterType::INTEGER, function (AiParameterDefinition $_c0c7604e8f38a81e52a6dff0e7e70d31) {
            $_c0c7604e8f38a81e52a6dff0e7e70d31->description($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_8baf6ac4dc0b89cfa6a5abea49db1f" . "56"]);
            $_c0c7604e8f38a81e52a6dff0e7e70d31->required(true);
        })->add($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_9e0a9446" . "602a728ed" . "df64b23af" . "901ea0"], AiParameterType::INTEGER, function (AiParameterDefinition $_c0c7604e8f38a81e52a6dff0e7e70d31) {
            $_c0c7604e8f38a81e52a6dff0e7e70d31->description($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_294579c23" . "4bf40023d4" . "525f0f32b7" . "cca"]);
            $_c0c7604e8f38a81e52a6dff0e7e70d31->required(true);
        });
    }
}