/*
 * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
 * 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.
 */

import * as React from "react";
import type { SVGIconProps } from "../../svgIconProps";
import { IconSize } from "../../iconTypes";
import { SVGIconContainer } from "../../svgIconContainer";

/** Path data for the 16px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_16 = ["M9.405 11.746C8.968 11.91 8.495 12 8 12c-.494 0-.968-.09-1.405-.254l-.702 1.873C6.548 13.865 7.258 14 8 14s1.452-.135 2.107-.38zm2.341-2.341 1.873.702C13.865 9.452 14 8.742 14 8s-.135-1.452-.38-2.107l-1.874.702c.164.437.254.91.254 1.405 0 .494-.09.968-.254 1.405M9.405 4.254l.702-1.873A6 6 0 0 0 8 2c-.742 0-1.452.135-2.107.38l.702 1.874C7.032 4.09 7.505 4 8 4c.494 0 .968.09 1.405.254M4.254 6.595 2.38 5.893A6 6 0 0 0 2 8c0 .742.135 1.452.38 2.107l1.874-.702A4 4 0 0 1 4 8c0-.494.09-.968.254-1.405M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16m0-6a2 2 0 1 0 0-4 2 2 0 0 0 0 4"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M8.143 14.644 7.028 17.43c.919.368 1.922.57 2.972.57s2.053-.202 2.972-.57l-1.115-2.786A5 5 0 0 1 10 15a5 5 0 0 1-1.857-.356m-2.787-2.787A5 5 0 0 1 5 10c0-.656.126-1.283.356-1.857L2.57 7.028A8 8 0 0 0 2 10c0 1.05.202 2.053.57 2.972zm2.787-6.5A5 5 0 0 1 10 5c.656 0 1.283.126 1.857.356l1.115-2.786A8 8 0 0 0 10 2c-1.05 0-2.053.202-2.972.57zm6.5 2.786c.23.574.357 1.2.357 1.857 0 .656-.126 1.283-.356 1.857l2.786 1.115c.368-.919.57-1.922.57-2.972s-.202-2.053-.57-2.972zM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6m0 7C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10"] as readonly string[];

export const Lifesaver: React.FC<SVGIconProps> = React.forwardRef<any, SVGIconProps>((props, ref) => {
    const isLarge = (props.size ?? IconSize.STANDARD) >= IconSize.LARGE;
    const paths = isLarge ? PATHS_20 : PATHS_16;
    return (
        <SVGIconContainer iconName="lifesaver" ref={ref} {...props}>
            {paths.map((d, i) => (
                <path key={i} d={d} fillRule="evenodd" />
            ))}
        </SVGIconContainer>
    );
});
Lifesaver.displayName = `Blueprint6.Icon.Lifesaver`;
export default Lifesaver;
