public function mapCollections(array $data): array
    {
        $collections = [];

        foreach ($data as $dataItem) {
            $collectionId = (int) $dataItem['id'];
            $locale = $dataItem['locale'];

            if (!isset($collections[$collectionId])) {
                $collections[$collectionId] = [
                    'id' => $collectionId,
                    'status' => (int) $dataItem['status'],
                    'offset' => (int) $dataItem['start'],
                    'limit' => $dataItem['length'] !== null ? (int) $dataItem['length'] : null,
                    'isTranslatable' => (bool) $dataItem['translatable'],
                    'mainLocale' => $dataItem['main_locale'],
                    'alwaysAvailable' => (bool) $dataItem['always_available'],
                ];
            }

            $collections[$collectionId]['availableLocales'][] = $locale;
        }

        return array_values(
            array_map(
                static function (array $collectionData): Collection {
                    sort($collectionData['availableLocales']);

                    return Collection::fromArray($collectionData);
                },
                $collections
            )
        );
    }