/**
 *
 * @ai-apps/angular v2.152.0 | _deprecate.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


/// Generic `deprecate` mixin that is being used to indicate that a component is
/// no longer going to be present in the next major release of Carbon.
/// @access public
/// @param {String} $reason - The message
/// @param {Bool} $condition [true] - `true` to emit the given deprecation messsage
/// @param {Bool} $remove-deprecated [false] - `true` to omit the content if $condition is `true`
/// @group global-deprecate
@mixin deprecate($reason, $condition: true, $remove-deprecated: false) {
  $deprecations--entry: false !default;

  @if not $condition {
    @content;
  } @else {
    @if ($deprecations--entry == true) {
      $deprecations--reasons: append($deprecations--reasons, $reason) !global;
    } @else {
      @warn 'Deprecated code was found, this code will be removed before the next release of Carbon. REASON: #{$reason}';
    }
    @if not $remove-deprecated {
      @content;
    }
  }
}
