<?php
namespace Claromentis\Pages\Category;

$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] ?: array()) + array("_bd71c3b5c" . "201fc11db8" . "2ed14ce424" . "de5" => base64_decode("aW5fYXJyYXk" . "="), "_006a00786ba8fa9790879" . "0a83741c8d8" => base64_decode("Y2F0Z" . "Wdvcm" . "llcw=" . "="), "_31767d7ad58e706dbf47b7a51a0fe6" . "c4" => base64_decode("Y291" . "bnQ="), "_1c4283213c8fdd95100caa" . "1d08301f12" => base64_decode("RmFpbGVkIHRvIEdldCBDb21wb25lbnRzIFByb3BlcnR5ICdjYXRlZ29y" . "aWVzJw=="));
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["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_006a00786ba8fa97908790a83" . "741c8d8"]);
            } catch (MissingComponentException|UnknownPropertyException $_c35473364fa7a050299058f332ec29c1) {
                throw new LogicException($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_1c4283213c8fdd95100caa1d08301" . "f12"], null, $_c35473364fa7a050299058f332ec29c1);
            }
            foreach ($_006a00786ba8fa97908790a83741c8d8 as $_1cb0853fbfae1a857fd0ecf1f183e45a => $_c3492cfbadbaead5d2512469c3eb908e) {
                if ($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_bd71c3b5c201f" . "c11db82ed14ce4" . "24de5"]($_1cb0853fbfae1a857fd0ecf1f183e45a, $_de10693cd170bb900b2c9aa2858e34a2)) {
                    unset($_006a00786ba8fa97908790a83741c8d8[$_1cb0853fbfae1a857fd0ecf1f183e45a]);
                }
            }
            if ($GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_31767d7" . "ad58e706" . "dbf47b7a" . "51a0fe6c" . "4"]($_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["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_006a00786ba8fa97908790a83" . "741c8d8"]);
            } catch (MissingComponentException|UnknownPropertyException $_c35473364fa7a050299058f332ec29c1) {
                throw new LogicException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_1c4283213c8fdd95100caa1d0" . "8301f12"], 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;
    }
}