@if(hasPermission('office_work_menu'))
    <li class="sidebar-menu-item {{ set_menu([route('client.index'), route('project.index'), route('task.index')]) }}">
        @php

            if (env('TRAVEL')) {
                $menu_active_by_route = ['client.*','project.*','task.*','travel_type.*','visit.index','invoice.index', 'models.index', 'brands.index', 'machines.index', 'packages.index', 'institutions.index', 'services.index', 'supportTicket.index', 'supportTicket.create', 'supportTicket.reply', 'contact.*'];
                $set_active = ['admin/client*','admin/project*','admin/task*','hrm/visit', 'services/models*', 'services/brands*', 'services/machines*', 'services/packages*', 'services/institutions*', 'services/module-services', 'hrm/support/*', 'admin/contact', 'admin/contact/create', 'invoice'];
            } else {
                $menu_active_by_route = ['client.*','project.*','task.*','travel.*','travel_type.*','visit.index','invoice.index', 'models.index', 'brands.index', 'machines.index', 'packages.index', 'institutions.index', 'services.index', 'supportTicket.index', 'supportTicket.create', 'supportTicket.reply', 'contact.*'];
                $set_active = ['admin/client*','admin/project*','admin/task*','travel*','hrm/visit', 'services/models*', 'services/brands*', 'services/machines*', 'services/packages*', 'services/institutions*', 'services/module-services', 'hrm/support/*', 'admin/contact', 'admin/contact/create', 'invoice'];
            }

        @endphp
        <a href="javascript:void(0)"
           class="parent-item-content has-arrow {{ menu_active_by_route($menu_active_by_route) }}">
            <i class="las la-file"></i>
            <span class="on-half-expanded">{{ _trans('comunication.Office Works') }}</span>
        </a>
        <ul class="child-menu-list {{ set_active($set_active) }}">
            @if (hasPermission('client_read') && hasFeature('clients'))
                <li class="sidebar-menu-item {{ menu_active_by_route(['client.index','client.create','client.edit']) }}">
                    <a href="{{ route('client.index') }}">
                        <span> {{ _trans('common.Clients') }}</span>
                    </a>
                </li>
            @endif

            @if (hasPermission('project_read') && hasFeature('projects'))
                <li class="sidebar-menu-item {{ menu_active_by_route(['project.index','project.view','project.edit','project.create']) }}">
                    <a href="{{ route('project.index') }}">
                        <span> {{ _trans('project.Projects') }}</span>
                    </a>
                </li>
            @endif

            @if (hasPermission('task_read') && hasFeature('tasks'))
                <li class="sidebar-menu-item {{ menu_active_by_route(['task.index','task.view','task.edit','task.create']) }}">
                    <a href="{{ route('task.index') }}">
                        <span> {{ _trans('task.Tasks') }}</span>
                    </a>
                </li>
            @endif

            @if(isModuleActive('Invoice'))
                <li class="sidebar-menu-item {{ menu_active_by_route(['invoice.index']) }}">
                    <a href="{{ route('invoice.index') }}">
                        <span> {{ _trans('common.Invoice') }} 
                            @if (Str::lower(config('app.style')) == 'demo')
                                <span class="badge text-bg-warning">{{ _trans('common.Pro') }}</span>    
                            @endif
                        </span>
                    </a>
                </li>
            @endif

            @if(isModuleActive('Travel') && hasPermission('travel_menu') && hasFeature('travels') && !env('TRAVEL'))
                @include('travel::sidebar.travel_sidebar')
            @endif

            @if (hasPermission('visit_read') && hasFeature('visit'))
                <li class="nav-item {{ menu_active_by_route(['visit.index']) }}">
                    <a href="{{ route('visit.index') }}" class="">
                        <span>{{ _trans('common.Visit') }}</span>
                    </a>
                </li>
            @endif

            @if (isModuleActive('Services') && hasFeature('services') && hasPermission('service_menu'))
                @include('services::sidebar.service_sidebar')
            @endif

            @if (hasPermission('support_ticket_read') && hasFeature('support'))
                <li class="nav-item {{ menu_active_by_route(['supportTicket.index', 'supportTicket.create', 'supportTicket.reply']) }}">
                    <a href="{{ route('supportTicket.index') }}" class="">
                        <span>{{ _trans('common.Support Ticket') }}</span>
                    </a>
                </li>
            @endif

            @if (hasPermission('contact_read') && hasFeature('contacts'))
                <li class="nav-item {{ menu_active_by_route(['contact.index', 'contact.create']) }}">
                    <a href="{{ route('contact.index') }}" class="">
                        <span>{{ _trans('common.Contacts') }}</span>
                    </a>
                </li>
            @endif
        </ul>
    </li>
@endif