/*
 * 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 = ["M1 2c-.56 0-1 .45-1 1v10c0 .54.45 1 1 1 .56 0 1-.45 1-1V9h4v4c0 .54.45 1 1 1 .56 0 1-.45 1-1V3c0-.54-.45-1-1-1-.56 0-1 .45-1 1v4H2V3c0-.54-.45-1-1-1m13.71 9.73c.41.08.72.3.95.651.23.35.34.772.34 1.273 0 .371-.07.702-.2.973-.14.29-.32.54-.55.741s-.5.361-.8.472-.62.16-.96.16c-.41 0-.77-.06-1.08-.19a2 2 0 0 1-.77-.542 2.4 2.4 0 0 1-.47-.852c-.11-.33-.16-.702-.17-1.103h1.14c-.01.471.09.862.32 1.173s.57.471 1.02.471c.39 0 .71-.12.97-.36q.39-.361.39-1.023c0-.3-.05-.531-.16-.712-.11-.17-.25-.31-.43-.4a1.6 1.6 0 0 0-.59-.171c-.22-.02-.44-.03-.67-.02v-.933c.19.01.38 0 .57-.04.19-.03.36-.1.51-.19.14-.09.26-.22.35-.381.09-.16.14-.361.14-.592 0-.33-.1-.591-.31-.792-.2-.2-.47-.3-.79-.3a1 1 0 0 0-.53.13c-.15.09-.27.21-.37.36-.1.151-.17.322-.22.512s-.07.381-.06.582h-1.15c.01-.381.08-.722.19-1.043s.27-.602.47-.832c.19-.23.44-.421.72-.552.28-.13.6-.2.96-.2.28 0 .55.04.82.13.27.08.51.21.72.381.21.17.38.381.51.642.13.26.19.561.19.902q0 .587-.24 1.023c-.16.29-.42.5-.76.631z"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M2 11v5a1 1 0 1 1-2 0V3a1 1 0 0 1 2 0v6h7V3a1 1 0 1 1 2 0v13a1 1 0 1 1-2 0v-5zm16.458 3.64c.487.11.865.38 1.134.82s.408.968.408 1.608q0 .69-.239 1.229-.239.542-.656.919c-.27.25-.588.44-.956.58s-.746.209-1.154.209c-.498 0-.925-.08-1.294-.24a2.54 2.54 0 0 1-.925-.68 3 3 0 0 1-.567-1.058q-.195-.63-.209-1.379h1.383c-.02.58.11 1.07.378 1.459.279.39.677.58 1.224.58q.702 0 1.164-.45c.309-.3.468-.72.468-1.27 0-.369-.07-.668-.2-.888a1.27 1.27 0 0 0-.507-.5 2 2 0 0 0-.706-.21 5.4 5.4 0 0 0-.806-.03v-1.168c.219.01.448 0 .677-.05s.428-.13.607-.24.318-.27.428-.47.159-.45.159-.739q.002-.614-.368-.989c-.25-.25-.568-.37-.956-.37-.239 0-.448.06-.627.17q-.268.165-.447.45c-.12.19-.2.4-.26.63-.049.23-.079.469-.069.719H14.16c.01-.47.09-.9.23-1.3.138-.399.327-.748.566-1.038q.359-.45.866-.69c.338-.17.726-.25 1.154-.25.328 0 .657.05.975.16q.478.165.866.48c.259.21.468.47.617.8.15.32.229.699.229 1.118 0 .48-.09.91-.289 1.27a1.7 1.7 0 0 1-.915.788z"] as readonly string[];

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