/*
 * 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 = ["M13 3h2a1 1 0 1 1 0 2h-2v2a1 1 0 1 1-2 0V5H9a1 1 0 1 1 0-2h2V1a1 1 0 1 1 2 0zm-3-1.983V2H9a2 2 0 1 0 0 4h1v1c0 .279.057.544.16.785l-1.71.855c-.14.07-.29.11-.45.11s-.31-.04-.45-.11l-7-3.5a.992.992 0 0 1 .07-1.81l6.99-3a1 1 0 0 1 .79 0zm.91 7.66a2 2 0 0 0 3.085-1.54l.555-.277c.14-.07.29-.11.45-.11.55 0 1 .45 1 1 0 .39-.23.73-.55.89l-7 3.5c-.14.07-.29.11-.45.11s-.31-.04-.45-.11l-7-3.5C.23 8.48 0 8.14 0 7.75c0-.55.45-1 1-1 .16 0 .31.04.45.11L8 10.13zM15 10.25c.55 0 1 .45 1 1 0 .39-.23.73-.55.89l-7 3.5c-.14.07-.29.11-.45.11s-.31-.04-.45-.11l-7-3.5c-.32-.16-.55-.5-.55-.89 0-.55.45-1 1-1 .16 0 .31.04.45.1L8 13.63l6.55-3.27c.14-.07.29-.11.45-.11"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M17 3h2a1 1 0 1 1 0 2h-2v2a1 1 0 1 1-2 0V5h-2a1 1 0 1 1 0-2h2V1a1 1 0 1 1 2 0zm-1.252 5.984L10.5 11.9c-.2.1-.3.1-.5.1s-.3 0-.5-.1l-9-5C.2 6.7 0 6.4 0 6s.2-.7.5-.9l9-5c.2-.1.3-.1.5-.1s.3 0 .5.1L13.92 2H13a2 2 0 1 0 0 4h1v1a2 2 0 0 0 1.748 1.984m2.07-1.15C17.935 7.58 18 7.298 18 7V6h1c.353 0 .684-.091.972-.251q.027.117.028.251c0 .4-.2.7-.5.9zM19 9c.6 0 1 .4 1 1 0 .4-.2.7-.5.9l-9 5c-.2.1-.3.1-.5.1s-.3 0-.5-.1l-9-5c-.3-.2-.5-.5-.5-.9 0-.6.4-1 1-1 .2 0 .3 0 .5.1l8.5 4.8 8.5-4.8c.2-.1.3-.1.5-.1m0 4c.6 0 1 .4 1 1 0 .4-.2.7-.5.9l-9 5c-.2.1-.3.1-.5.1s-.3 0-.5-.1l-9-5c-.3-.2-.5-.5-.5-.9 0-.6.4-1 1-1 .2 0 .3 0 .5.2l8.5 4.7 8.5-4.8c.2-.1.3-.1.5-.1"] as readonly string[];

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