/*
 * 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 2c0 1.1-2.69 2-6 2-3.32 0-6-.9-6-2s2.68-2 6-2c3.31 0 6 .9 6 2M1 8V3.52C2.22 4.4 4.44 5 7 5s4.78-.6 6-1.48V6a5 5 0 0 0-7.999 3.886C2.671 9.61 1 8.867 1 8m0 1.52c.902.65 2.35 1.148 4.078 1.363a5 5 0 0 0 6.75 3.772l.352.353C11.137 15.6 9.206 16 7 16c-3.31 0-6-.9-6-2zm13.29 6.19-2.256-2.265A4.002 4.002 0 0 1 6 10v-.028a4 4 0 1 1 7.445 2.063l2.265 2.255a1.003 1.003 0 0 1-1.42 1.42M10 12a2 2 0 1 0-2-2.028V10a2 2 0 0 0 2 2"] as readonly string[];

/** Path data for the 20px grid; matches {@link generate-icon-paths.mjs} / `<Icon />` from core. */
const PATHS_20 = ["M2 9.5V4.1C3.5 5.23 6.52 6 10 6c3.49 0 6.51-.77 8-1.9v5.4a1 1 0 0 1-.016.159 6.002 6.002 0 0 0-10.87 2.173C4.12 11.47 2 10.562 2 9.5m5 3.406V13a6.005 6.005 0 0 0 5.017 5.92c-.644.052-1.32.08-2.017.08-4.42 0-8-1.12-8-2.5v-5.4c1.047.789 2.835 1.402 5.003 1.701zM18 2.5C18 3.88 14.42 5 10 5 5.59 5 2 3.88 2 2.5S5.58 0 10 0s8 1.12 8 2.5m-2.243 14.672A5.003 5.003 0 0 1 8 13v-.078a5.002 5.002 0 0 1 9.67-1.71 5 5 0 0 1-.498 4.545l2.534 2.534a1 1 0 1 1-1.415 1.415zM13 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6"] as readonly string[];

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