<?php
namespace Claromentis\Pages\Category;

$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] ?: array()) + array("_bd71c3b5c201fc11db82ed14ce424" . "de5" => base64_decode("aW5fYXJyYXk" . "="), "_006a00786ba8fa" . "97908790a83741c" . "8d8" => base64_decode("Y2F0ZWdv" . "cmllcw=="), "_1c4283213c8fdd95100c" . "aa1d08301f12" => base64_decode("RmFpbGVkIHRvIEdldCBDb21wb25lbnRzIFByb3" . "BlcnR5ICdjYXRlZ29yaWVzJw=="), "_31767d7ad58e706dbf47b7a51a0fe6" . "c4" => base64_decode("Y291b" . "nQ="));
use Claromentis\Core\Component\Exception\MissingComponentException;
use Claromentis\Pages\Component\PagesComponentList;
use Claromentis\Pages\Exception\CategoryInvalidSortException;
use Claromentis\Pages\Exception\UnknownPropertyException;
use LogicException;
class PagesComponentsCategories
{
    private $pages_categories;
    private $pages_component_list;
    
    
    
    
    
    
    
    public function __construct(PagesComponentList $_7c5bdf613a4e4eeb538af291250fb41e, PagesCategories $_5680264026c132f27a79716f664f00db)
    {
        $this->pages_component_list = $_7c5bdf613a4e4eeb538af291250fb41e;
        $this->pages_categories = $_5680264026c132f27a79716f664f00db;
    }
    
    
    
    
    
    
    
    public function GetEmptyCategories(?array $_f6a16426f3b3f03ad6bacec912eec291 = null) : array
    {
        $_006a00786ba8fa97908790a83741c8d8 = $this->pages_categories->GetCategoriesProperties($_f6a16426f3b3f03ad6bacec912eec291);
        $_3041cca4670ae6c7f64a53daaf9d5586 = $this->pages_component_list->GetComponentsKeys();
        foreach ($_3041cca4670ae6c7f64a53daaf9d5586 as $_c7eb21f71d47bd5dfa5d6747cc71a652) {
            try {
                $_de10693cd170bb900b2c9aa2858e34a2 = $this->pages_component_list->GetProperty($_c7eb21f71d47bd5dfa5d6747cc71a652, $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_006a00786ba8fa97908790a83741c8" . "d8"]);
            } catch (MissingComponentException|UnknownPropertyException $_c35473364fa7a050299058f332ec29c1) {
                throw new LogicException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_1c4283213c8fd" . "d95100caa1d083" . "01f12"], null, $_c35473364fa7a050299058f332ec29c1);
            }
            foreach ($_006a00786ba8fa97908790a83741c8d8 as $_1cb0853fbfae1a857fd0ecf1f183e45a => $_c3492cfbadbaead5d2512469c3eb908e) {
                if ($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_bd71c3b5c201fc11db82ed14" . "ce424de5"]($_1cb0853fbfae1a857fd0ecf1f183e45a, $_de10693cd170bb900b2c9aa2858e34a2)) {
                    unset($_006a00786ba8fa97908790a83741c8d8[$_1cb0853fbfae1a857fd0ecf1f183e45a]);
                }
            }
            if ($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_31767d7ad58e706dbf47b" . "7a51a0fe6c4"]($_006a00786ba8fa97908790a83741c8d8) === 0) {
                break;
            }
        }
        return $_006a00786ba8fa97908790a83741c8d8;
    }
    
    
    
    
    
    
    
    public function GetPopulatedCategories(?array $_f6a16426f3b3f03ad6bacec912eec291 = null) : array
    {
        $_3041cca4670ae6c7f64a53daaf9d5586 = $this->pages_component_list->GetComponentsKeys();
        $_264ba4bcceb9eb13ac6b2eba2a4e6998 = $this->pages_categories->GetCategories();
        $_7fa8888aa3a3720d4823960be4ad9eff = [];
        foreach ($_3041cca4670ae6c7f64a53daaf9d5586 as $_c7eb21f71d47bd5dfa5d6747cc71a652) {
            try {
                $_d0552ffaf8b1bcbf8a082529ea6bda8a = $this->pages_component_list->GetProperty($_c7eb21f71d47bd5dfa5d6747cc71a652, $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_006a00786ba8fa97908790a837" . "41c8d8"]);
            } catch (MissingComponentException|UnknownPropertyException $_c35473364fa7a050299058f332ec29c1) {
                throw new LogicException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_1c4283213c" . "8fdd95100ca" . "a1d08301f12"], null, $_c35473364fa7a050299058f332ec29c1);
            }
            foreach ($_d0552ffaf8b1bcbf8a082529ea6bda8a as $_9183e44868fefd405e5d1d40f6585c97) {
                if (!isset($_7fa8888aa3a3720d4823960be4ad9eff[$_9183e44868fefd405e5d1d40f6585c97]) && isset($_264ba4bcceb9eb13ac6b2eba2a4e6998[$_9183e44868fefd405e5d1d40f6585c97])) {
                    $_7fa8888aa3a3720d4823960be4ad9eff[$_9183e44868fefd405e5d1d40f6585c97] = $_264ba4bcceb9eb13ac6b2eba2a4e6998[$_9183e44868fefd405e5d1d40f6585c97];
                }
            }
        }
        if (isset($_f6a16426f3b3f03ad6bacec912eec291)) {
            $_7fa8888aa3a3720d4823960be4ad9eff = $this->pages_categories->SortCategories($_7fa8888aa3a3720d4823960be4ad9eff, $_f6a16426f3b3f03ad6bacec912eec291);
        }
        $_a6454682dfd6760190b342863f742803 = [];
        foreach ($_7fa8888aa3a3720d4823960be4ad9eff as $_1cb0853fbfae1a857fd0ecf1f183e45a => $_ac2ef4a52e1f7832e3e4882d2233f1a3) {
            $_a6454682dfd6760190b342863f742803[$_1cb0853fbfae1a857fd0ecf1f183e45a] = $_ac2ef4a52e1f7832e3e4882d2233f1a3->GetProperties();
        }
        return $_a6454682dfd6760190b342863f742803;
    }
}