<div class="tab-pane fade show {{ $isFirstItem ? 'active' : '' }}" id="v-pills-{{ $attribute }}" role="tabpanel" aria-labelledby="v-pills-{{ $attribute }}-tab" tabindex="0">
    @if(is_array($keywords) || is_object($keywords))
        @foreach ($keywords as $menu => $submenus)
            {{-- Title --}}
            <div class="permission-title mb-3">
                <h4 class="text-primary fw-bold border-bottom pb-2">{{ userCaseFirstLetter($menu) }}</h4>
            </div>

            <div class="single-permission p-3 bg-white rounded shadow-sm">
                @if(is_array($submenus) || is_object($submenus))
                    @foreach ($submenus as $submenu => $permissions)
                        <div class="permission-items mt-3">
                            {{-- Parent Checkbox --}}
                            <div class="form-check mb-2">
                                <input
                                    class="form-check-input"
                                    type="checkbox"
                                    id="{{ $submenu }}"
                                    onchange="toggleCheckboxes('{{ $submenu }}')"
                                >
                                <label class="form-check-label fw-semibold" for="{{ $submenu }}">
                                    <i class="bi bi-folder-fill text-warning"></i> 
                                    {{ userCaseFirstLetter(_trans("permission.$submenu")) }}
                                </label>
                            </div>

                            {{-- Child Permissions --}}
                            <div class="ps-4">
                                @if(is_array($permissions) || is_object($permissions))
                                    @foreach ($permissions as $keyword => $permission)
                                        @if (is_array($permission))
                                            <div class="mb-2">
                                                <div class="form-check">
                                                    <input
                                                        class="form-check-input {{ $submenu }}-child"
                                                        type="checkbox"
                                                        id="{{ $keyword }}"
                                                        onchange="toggleCheckboxes('{{ $keyword }}')"
                                                    >
                                                    <label class="form-check-label fw-semibold" for="{{ $keyword }}">
                                                        <i class="bi bi-key-fill text-success"></i> 
                                                        {{ userCaseFirstLetter($keyword) }}
                                                    </label>
                                                </div>

                                                {{-- Sub-Permissions --}}
                                                <div class="ps-4 mt-2">
                                                    @foreach ($permission as $key => $item)
                                                        @if(is_string($item))
                                                            <div class="form-check mb-2">
                                                                <input
                                                                    class="form-check-input {{ $keyword }}-child"
                                                                    type="checkbox"
                                                                    name="permissions[]"
                                                                    value="{{ $item }}"
                                                                    id="{{ $item }}"
                                                                    {{ in_array($item, is_array($data['show']->permissions ?? []) ? $data['show']->permissions : json_decode($data['show']->permissions ?? []) ?? []) ? 'checked' : '' }}
                                                                >
                                                                <label class="form-check-label" for="{{ $item }}">
                                                                    <i class="bi bi-check2-square text-info"></i> 
                                                                    {{ userCaseFirstLetter($item) }}
                                                                </label>
                                                            </div>
                                                        @endif
                                                    @endforeach
                                                </div>
                                            </div>
                                        @else
                                            <div class="form-check mb-2">
                                                <input
                                                    class="form-check-input {{ $submenu }}-child"
                                                    type="checkbox"
                                                    name="permissions[]"
                                                    value="{{ $permission }}"
                                                    id="{{ $permission }}"
                                                    {{ in_array($permission, is_array($data['show']->permissions ?? []) ? $data['show']->permissions : json_decode($data['show']->permissions ?? []) ?? []) ? 'checked' : '' }}
                                                >
                                                <label class="form-check-label" for="{{ $permission }}">
                                                    <i class="bi bi-check2-square text-info"></i> 
                                                    {{ userCaseFirstLetter($keyword) }}
                                                </label>
                                            </div>
                                        @endif
                                    @endforeach
                                @endif
                            </div>
                        </div>
                    @endforeach
                @endif
            </div>
        @endforeach
    @endif
</div>
