/*
 * 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 = ["M6.341 2A6 6 0 0 0 6 4H3.66L1.95 8H4c.55 0 1 .45 1 1v1h7a5.98 5.98 0 0 0 4-1.528V13c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1V7.46l2.08-4.85C2.23 2.25 2.59 2 3 2zm3.679 2.145c0-.125.075-.23.205-.225h.345l.79.8c.005 0 0 .005 0 .005v.295c0 .13-.085.23-.215.23h-.07v.15c0 .13-.09.2-.215.2v.535c0 .125-.12.225-.245.225s-.245-.1-.245-.225V5.25h-.145c-.125 0-.205-.1-.205-.23zm2.235-2.195c-.03 0-.055-.005-.06-.035 0-.03.03-.035.06-.035h.11c.035 0 .06.005.06.035s-.03.035-.06.035zm-1.165-.025a.094.094 0 0 1-.13 0l-.25-.25a.094.094 0 0 1 0-.13.094.094 0 0 1 .13 0l.25.25a.094.094 0 0 1 0 .13m1.53.445c-.035 0-.07-.025-.07-.06v-.155c0-.03.035-.06.07-.06s.07.025.07.06v.155c0 .03-.035.06-.07.06M12 0c2.21 0 4 1.79 4 4s-1.79 4-4 4-4-1.79-4-4 1.79-4 4-4m0 7c1.655 0 3-1.345 3-3 0-.195-.02-.39-.06-.575h-.21c-.125 0-.225-.07-.23-.21h-.215c.075.07.155.14.155.23V3.9c0 .06-.04.115-.075.155h-.015l-.01.005-.015.01-.445.43v.815c0 .13-.07.22-.2.22h-.36c-.125 0-.21-.09-.21-.22v-.84a.63.63 0 0 0-.36-.345h-.45c-.13 0-.245-.095-.245-.225v-.46c0-.125.115-.23.245-.23l.13-.005.21-.215c.09-.09.24-.09.33 0l.22.225h.47c.105 0 .155-.105.225-.21v-.075h-.205a.106.106 0 0 1-.105-.105.11.11 0 0 1 .105-.105h.18l.025.005v-.12s-.03-.025-.04-.025h-.2l-.045.05a.235.235 0 0 1-.33.005l-.045-.06h-.115l.16.175c.015.015.015.06 0 .075-.02.015-.045.02-.06.005l-.195-.185h-.085l-.245.23-.02-.005c-.025.07-.06.055-.095.055-.085 0-.15-.045-.15-.13s.065-.14.15-.14h.115v-.125c0-.06.04-.09.1-.09h.05V2.36c0-.095.095-.2.19-.2h.19c.105 0 .18-.075.18-.185V1.94c0-.015.035.01.035-.06h-.125l-.005.01-.21.22a.085.085 0 0 1-.115 0 .085.085 0 0 1 0-.115l.255-.255c.02-.015.045-.015.065-.015.005 0 .005.015.005.015h.64a2.3 2.3 0 0 0-.355-.275 2.5 2.5 0 0 0-.355-.195q-.044-.024-.08-.04a3.03 3.03 0 0 0-1.735-.175c-.09.02-.175.055-.265.08-.09.03-.18.05-.265.085-.075.03-.145.07-.22.105-.115.06-.235.115-.34.185l-.005.005c-.1.065-.18.145-.27.22h.455c.06 0 .11.045.11.105s-.05.105-.11.105h-.32c0 .07-.025.04-.025.045v.24h.285l.15-.17c.09-.09.235-.105.325-.015s.09.23 0 .32l-.795.79-.01.01c-.005 0-.005 0-.01.005l-.025.015h-.01a.24.24 0 0 1-.12.025h-.23c-.08.07-.125.1-.125.18v.06c0 .01-.02.02-.02.03l.375.39c.04.04.04.1 0 .14s-.1.04-.14 0l-.39-.385a.2.2 0 0 1-.055.01c-.105 0-.195-.085-.195-.185v-.235h-.055A3 3 0 0 0 9 4c0 1.655 1.345 3 3 3m2.27-2.135c.05 0 .105.04.105.09v.285c0 .05-.055.09-.105.09s-.105-.04-.105-.09v-.285c0-.05.055-.09.105-.09m-2.085-3.27c0 .13-.105.21-.225.21h-.25v.07c0 .075-.03.135-.105.135s-.105-.06-.105-.135V1.64c-.075-.02-.025-.025-.025-.04 0-.125.085-.215.21-.215h.27c.13 0 .23.085.23.21"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M7.427 3a7.5 7.5 0 0 0-.411 2.009H4.65l-2.67 5.996H5c.55 0 1 .45 1 .999v1h8V13c.165.01.332 0 .5 0a7.48 7.48 0 0 0 5.5-2.4V17c0 .55-.45 1-1 1H1c-.55 0-1-.45-1-1v-6.455L3.08 3.62l.01-.02c.15-.35.5-.6.91-.6zm5.715-.596a.133.133 0 0 1-.193 0l-.374-.374a.133.133 0 0 1 0-.193.133.133 0 0 1 .193 0l.373.374a.133.133 0 0 1 0 .193m1.743.033c-.05 0-.088-.006-.088-.055 0-.05.038-.056.088-.056h.165c.05 0 .088.006.088.055 0 .05-.038.056-.088.056zm.539.632c-.05 0-.104-.044-.104-.094v-.23c0-.05.054-.094.104-.094s.104.044.104.094v.23c0 .05-.055.094-.104.094m-3.575 2.305h.506l1.182 1.199c.006.005 0 .005 0 .01v.446c0 .187-.126.341-.319.341h-.098v.226c0 .192-.138.297-.33.297h.01v.792c0 .186-.181.335-.368.335s-.369-.149-.369-.335v-1.32h-.214c-.193 0-.308-.149-.308-.341V5.72c0-.192.115-.346.308-.346M14.5 0C17.536 0 20 2.464 20 5.5S17.536 11 14.5 11A5.5 5.5 0 0 1 9 5.5C9 2.464 11.464 0 14.5 0m0 9.9c2.431 0 4.4-1.969 4.4-4.4a3.5 3.5 0 0 0-.099-.864h-.236c-.187 0-.336-.104-.347-.313h-.319c.11.104.231.209.231.346v.705c0 .088-.055.17-.11.23h-.022l-.011.006-.022.011-.666.643v1.21c0 .193-.104.33-.296.33h-.54c-.192 0-.319-.137-.319-.33V6.222a.92.92 0 0 0-.533-.518h-.671c-.192 0-.368-.143-.368-.335v-.687c0-.193.176-.347.368-.347l.193-.005.319-.32a.34.34 0 0 1 .489 0l.319.32c.005 0 .005.005.005.005h.704c.16 0 .237-.16.341-.313v-.11l-.038.005h-.27a.16.16 0 0 1-.153-.16c0-.087.066-.159.154-.159h.269l.039.006V3.42s-.05-.038-.061-.038h-.302l-.067.076a.34.34 0 0 1-.489.011l-.066-.088h-.176l.248.259c.021.022.021.088 0 .11-.028.022-.067.028-.088.006l-.292-.276h-.127l-.363.325-.033-.006c-.038.11-.087.089-.143.089-.126 0-.225-.072-.225-.193 0-.127.099-.209.225-.209h.176v-.182c0-.088.061-.131.149-.131h.066v-.127c0-.143.149-.297.286-.297h.28c.16 0 .27-.115.27-.275V2.42c0-.016.055.017.055-.088h-.187l-.005.017-.308.33a.123.123 0 0 1-.177 0c-.049-.044-.049-.121 0-.171l.391-.385c.027-.022.06-.022.094-.022l.005.022h.869A4.38 4.38 0 0 0 14.5 1.1a4.4 4.4 0 0 0-2.816 1.018h.583c.094 0 .165.066.165.159s-.072.16-.165.16h-.478c0 .104-.039.06-.039.066v.351h.429l.226-.252c.132-.127.346-.155.473-.022a.33.33 0 0 1 0 .473l-1.183 1.182-.011.011c-.005.005-.011.005-.016.011a.1.1 0 0 0-.034.022c-.005.006-.01 0-.016.006a.3.3 0 0 1-.176.038h-.347c-.12.104-.187.148-.187.27v.088c0 .016-.027.027-.027.043l.561.589c.06.06.055.154 0 .209a.143.143 0 0 1-.209 0l-.578-.578a.4.4 0 0 1-.082.011c-.154 0-.292-.12-.292-.274v-.358h-.016c-.104.374-.165.77-.165 1.177 0 2.431 1.969 4.4 4.4 4.4m3.388-3.107c.077 0 .16.06.16.137v.424c0 .077-.083.137-.16.137s-.16-.06-.16-.137V6.93c0-.077.083-.137.16-.137m-3.113-4.879c0 .187-.154.314-.335.314h-.374v.104c0 .11-.05.198-.16.198s-.16-.088-.16-.198V1.98c-.104-.022-.033-.028-.033-.055 0-.187.127-.324.314-.324h.407c.187 0 .341.126.341.313"] as readonly string[];

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