/*
 * 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 = ["m11.918 11.107.737.737.052-.051A1 1 0 0 1 14.2 13.12l-.078.087-1.414 1.414a1 1 0 0 1-1.492-1.327l.029-.033-.863-.863c-.426.231-.89.402-1.38.502L9 14l.117.007A1 1 0 0 1 9 16H7l-.117-.007A1 1 0 0 1 7 14v-1.1a5 5 0 0 1-1.447-.539l-.846.846.078.087a1 1 0 0 1-1.492 1.327l-1.414-1.414-.078-.087a1 1 0 0 1 1.492-1.327l.744-.744A5 5 0 0 1 3.23 9.5H2a1 1 0 0 1-1.993.117L0 9.5v-2a1 1 0 0 1 1.993-.117L2 7.5h1.025a5 5 0 0 1 .905-2.405l-.512-.513-.125.125A1 1 0 0 1 1.8 3.38l.078-.087 1.414-1.414a1 1 0 0 1 1.529 1.277l.573.575a5 5 0 0 1 1.604-.63V2l-.116-.007a1 1 0 0 1 0-1.986L7 0h2a1 1 0 0 1 .117 1.993L9 2l.001 1.1c.639.13 1.233.381 1.757.73l.535-.537-.078-.087a1 1 0 0 1 1.492-1.327l1.414 1.414.078.087a1 1 0 0 1-1.492 1.327l-.535.536a5 5 0 0 1 .803 2.257H14l.007-.117A1 1 0 0 1 16 7.5v2l-.007.117A1 1 0 0 1 14 9.5h-1.229a5 5 0 0 1-.853 1.607M10 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2M6.5 5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["m15.249 13.835 1.251 1.251.354-.354.087-.077a1 1 0 0 1 1.327 1.491l-2.122 2.122-.087.077a1 1 0 0 1-1.327-1.491l.354-.354-1.251-1.251A6.5 6.5 0 0 1 11 16.424L10.999 18h.501a1 1 0 0 1 .117 1.993L11.5 20h-3a1 1 0 0 1-.117-1.993L8.5 18h.499v-1.577a6.5 6.5 0 0 1-2.538-.97L5.414 16.5l.354.354a1 1 0 0 1-1.327 1.491l-.087-.077-2.122-2.122a1 1 0 0 1 1.327-1.491l.087.077.354.354.97-.97a6.5 6.5 0 0 1-1.384-3.057l-.025.002L2 11.06v.44a1 1 0 0 1-1.993.117L0 11.5v-3a1 1 0 0 1 1.993-.117L2 8.5v.56h1.567A6.47 6.47 0 0 1 4.97 5.883l-.971-.969-.353.354-.087.077a1 1 0 0 1-1.327-1.491l2.122-2.122.087-.077a1 1 0 0 1 1.327 1.491l-.354.353 1.047 1.048A6.5 6.5 0 0 1 9 3.577V2h-.5A1 1 0 0 1 8.383.007L8.5 0h3a1 1 0 0 1 .117 1.993L11.5 2H11v1.577a6.5 6.5 0 0 1 2.838 1.176l.04-.046L15.086 3.5l-.353-.353a1 1 0 0 1 1.327-1.491l.087.077 2.122 2.122a1 1 0 0 1-1.327 1.491l-.087-.077-.354-.354-1.207 1.207-.046.041a6.5 6.5 0 0 1 1.16 2.733H18V8.5a1 1 0 0 1 1.993-.117L20 8.5v3a1 1 0 0 1-1.993.117L18 11.5v-.605h-1.561a6.5 6.5 0 0 1-1.19 2.94M12.5 11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3M8 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4"] as readonly string[];

export const Virus: 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="virus" ref={ref} {...props}>
            {paths.map((d, i) => (
                <path key={i} d={d} fillRule="evenodd" />
            ))}
        </SVGIconContainer>
    );
});
Virus.displayName = `Blueprint6.Icon.Virus`;
export default Virus;
