/*
 * 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 = ["M0 7.02.05 7H0zm2-2.03h9.57l-1.29 1.29A1.003 1.003 0 0 0 11.7 7.7l2.99-3c.18-.18.29-.43.29-.71s-.11-.53-.29-.71l-2.99-3a1.07 1.07 0 0 0-.71-.28 1.003 1.003 0 0 0-.71 1.71L11.57 3H2c-.55 0-1 .45-1 1a1 1 0 0 0 1 .99M15.96 9H16v-.02zM14 11.01H4.43l1.29-1.29A1.003 1.003 0 0 0 4.3 8.3l-2.99 3a1 1 0 0 0-.29.7c0 .28.11.53.29.71l2.99 3a1.003 1.003 0 0 0 1.42-1.42L4.43 13H14c.55 0 1-.45 1-1s-.45-.99-1-.99"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M16.02 10q-.015 0 0 0H16zM2 6h13.58l-2.29 2.29a1 1 0 0 0-.3.71 1.003 1.003 0 0 0 1.71.71l4-4c.18-.18.29-.43.29-.71s-.11-.53-.29-.71l-4-4a1.003 1.003 0 0 0-1.42 1.42L15.58 4H2c-.55 0-1 .45-1 1s.45 1 1 1m2 4h-.02zm14 4H4.42l2.29-2.29a1 1 0 0 0 .3-.71 1.003 1.003 0 0 0-1.71-.71l-4 4c-.18.18-.29.43-.29.71s.11.53.29.71l4 4a1.003 1.003 0 0 0 1.42-1.42L4.42 16H18c.55 0 1-.45 1-1s-.45-1-1-1"] as readonly string[];

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