/*
 * 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 = ["M.594 15.394q.594.606 1.56.606.653 0 1.202-.295c.377-.197.61-.33.936-.62v.729H6v-4.52q0-1.601-.683-2.44Q4.648 8 3.282 8a4.5 4.5 0 0 0-1.633.295q-.757.295-1.367.7l.624 1.195q.49-.31.995-.528a2.7 2.7 0 0 1 1.054-.217q.372 0 .624.124a.9.9 0 0 1 .401.326q.164.202.223.482.075.264.09.559a12 12 0 0 0-1.946.357q-.802.233-1.337.575a2.2 2.2 0 0 0-.772.823Q0 13.157 0 13.763q0 1.01.594 1.631m2.911-1.01a1.5 1.5 0 0 1-.802.218q-.461 0-.757-.233-.297-.233-.297-.746 0-.279.133-.528.134-.248.446-.435.312-.202.817-.357a7.5 7.5 0 0 1 1.247-.249v1.71q-.416.403-.787.62m6.135 1.371q.548.245 1.079.245.64 0 1.234-.276T13 14.928q.453-.522.719-1.272.28-.766.281-1.731 0-.873-.203-1.578a3.4 3.4 0 0 0-.594-1.195 2.54 2.54 0 0 0-.953-.766 2.9 2.9 0 0 0-1.281-.276q-.594 0-1.172.26c-.375.174-.677.399-1 .675V5H7v10.816h1.797v-.62c.3.294.465.374.772.524zm1.985-1.854q-.515.644-1.281.643-.345 0-.75-.137c-.184-.065-.37-.246-.559-.43q-.118-.116-.238-.223V10.5c.583-.562 1.146-.935 1.687-.935q.876 0 1.266.629.39.628.39 1.761 0 1.287-.515 1.946m2.082-12.644a3.6 3.6 0 0 1-.707.069v1.028h1.737V8H16V0h-.94q-.06.366-.262.617a1.55 1.55 0 0 1-.475.412 2 2 0 0 1-.616.228"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M16.943 1.571q-.459.087-.943.086v1.286h2.317V10H20V0h-1.253q-.08.458-.35.771-.255.315-.633.515a2.7 2.7 0 0 1-.821.285M12.833 20q-.612 0-1.242-.29l-.168-.083c-.3-.146-.487-.238-.804-.556v.712H8.55V7h2.07v3.295l-.054 1.485a5.2 5.2 0 0 1 1.206-.797 3.2 3.2 0 0 1 1.35-.308q.828.001 1.476.326.648.308 1.098.906.45.58.684 1.412.234.833.234 1.865 0 1.14-.324 2.046a4.6 4.6 0 0 1-.828 1.503q-.522.615-1.206.941T12.833 20m-.432-1.72q.882 0 1.476-.76.594-.78.594-2.3 0-1.34-.45-2.082t-1.458-.742q-.936 0-1.944.995v4.147q.468.416.918.579.468.163.864.163M2.61 20q-1.17 0-1.89-.706Q0 18.569 0 17.393q0-.707.288-1.25.306-.561.936-.96.648-.397 1.62-.67.99-.271 2.358-.416a3 3 0 0 0-.108-.652 1.3 1.3 0 0 0-.27-.56 1.1 1.1 0 0 0-.486-.381 1.8 1.8 0 0 0-.756-.145q-.648 0-1.278.254a9 9 0 0 0-1.206.615l-.756-1.394a9 9 0 0 1 1.656-.815 5.6 5.6 0 0 1 1.98-.344q1.656 0 2.466.996.828.978.828 2.843v5.268h-2.07v-.87a5 5 0 0 1-1.134.744A3.1 3.1 0 0 1 2.61 20m.666-1.63q.54 0 .972-.253.45-.254.954-.724V15.4q-.9.108-1.512.29-.612.181-.99.416-.378.218-.54.507a1.24 1.24 0 0 0-.162.616q0 .597.36.869.36.27.918.271"] as readonly string[];

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