/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

@use 'sass:map';
@use '@material/theme/theme';
@use '@material/theme/keys';
@use '@material/theme/map-ext';
@use 'third_party/javascript/material_web_components/tab/tab-theme';
@use 'third_party/javascript/material_web_components/tab_indicator/tab-indicator-theme';
@use '@material/tab-bar/tab-bar-theme' as mdc-tab-bar-theme;

@mixin primary-navigation-tab-theme($theme) {
  @include mdc-tab-bar-theme.primary-navigation-tab-theme($theme);
}
@mixin secondary-navigation-tab-theme($theme) {
  @include mdc-tab-bar-theme.secondary-navigation-tab-theme($theme);
}

@mixin primary-navigation-tab-theme-styles($theme) {
  @include theme.validate-theme(
    mdc-tab-bar-theme.$primary-navigation-tabs-light-theme,
    $theme
  );
  $theme: keys.create-theme-properties(
    $theme,
    mdc-tab-bar-theme.$custom-property-prefix
  );

  @include tab-theme.primary-navigation-tab-theme(
    map-ext.pick($theme, map.keys(tab-theme.$primary-light-theme)...)
  );
  @include tab-indicator-theme.theme(
    map-ext.pick($theme, map.keys(tab-indicator-theme.$light-theme)...)
  );
}

@mixin secondary-navigation-tab-theme-styles($theme) {
  @include theme.validate-theme(
    mdc-tab-bar-theme.$secondary-light-theme,
    $theme
  );
  $theme: keys.create-theme-properties(
    $theme,
    mdc-tab-bar-theme.$custom-property-prefix
  );

  @include tab-theme.secondary-navigation-tab-theme(
    map-ext.pick(
      $theme,
      map.keys(tab-theme.$secondary-navigation-tabs-light-theme)...
    )
  );
  @include tab-indicator-theme.theme(
    map-ext.pick($theme, map.keys(tab-indicator-theme.$light-theme)...)
  );
}
