import React from 'react';
import styled from 'styled-components';

import type { IconProps } from '@redocly/theme/icons/types';

import { getCssColorVariable } from '@redocly/theme/core/utils';

const Icon = (props: IconProps) => (
  <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
    <path d="M13.35 12.5141C13.3531 12.5094 13.3578 12.5047 13.3609 12.5C14.3844 11.2828 15 9.71406 15 8C15 6.28594 14.3844 4.71719 13.3625 3.5C13.3594 3.49531 13.3547 3.49219 13.3516 3.4875C13.3344 3.46719 13.3187 3.44844 13.3016 3.42969C13.2953 3.42188 13.2891 3.41563 13.2828 3.40781L13.2188 3.33437L13.2172 3.33281C13.1938 3.30625 13.1687 3.27969 13.1453 3.25312L13.1438 3.25156C13.0938 3.19844 13.0437 3.14531 12.9922 3.09375L12.9906 3.09219L12.9156 3.01719L12.9109 3.0125C12.8875 2.98906 12.8641 2.96719 12.8406 2.94531C12.8328 2.9375 12.825 2.92969 12.8156 2.92188C12.8 2.90625 12.7844 2.89219 12.7688 2.87812C12.7641 2.87344 12.7578 2.86875 12.7531 2.8625C11.5063 1.70625 9.83594 1 8 1C6.16406 1 4.49375 1.70625 3.24531 2.8625C3.24062 2.86719 3.23438 2.87187 3.22969 2.87812C3.21406 2.89219 3.19844 2.90781 3.18281 2.92344C3.175 2.93125 3.16719 2.93906 3.15781 2.94688C3.13438 2.96875 3.11094 2.99219 3.0875 3.01406L3.08281 3.01875L3.00781 3.09375L3.00625 3.09531C2.95469 3.14688 2.90469 3.2 2.85469 3.25312L2.85313 3.25469C2.82813 3.28125 2.80469 3.30781 2.78125 3.33437L2.77969 3.33594C2.75781 3.35938 2.73594 3.38437 2.71563 3.40937C2.70938 3.41719 2.70313 3.42344 2.69688 3.43125C2.67969 3.45 2.66406 3.47031 2.64687 3.48906C2.64375 3.49375 2.63906 3.49688 2.63594 3.50156C1.61562 4.71719 1 6.28594 1 8C1 9.71406 1.61563 11.2828 2.6375 12.5C2.64062 12.5047 2.64531 12.5094 2.64844 12.5141L2.69688 12.5719C2.70313 12.5797 2.70938 12.5859 2.71563 12.5938L2.77969 12.6672C2.77969 12.6687 2.78125 12.6688 2.78125 12.6703C2.80469 12.6969 2.82813 12.7234 2.85313 12.7484L2.85469 12.75C2.90469 12.8031 2.95469 12.8562 3.00469 12.9078L3.00625 12.9094C3.03125 12.9344 3.05469 12.9594 3.07969 12.9828L3.08437 12.9875C3.13594 13.0391 3.18906 13.0891 3.24219 13.1375C4.49375 14.2937 6.16406 15 8 15C9.83594 15 11.5062 14.2937 12.7547 13.1375C12.8079 13.0887 12.86 13.0387 12.9109 12.9875L12.9156 12.9828C12.9406 12.9578 12.9656 12.9344 12.9891 12.9094L12.9906 12.9078C13.0422 12.8562 13.0922 12.8031 13.1406 12.75L13.1422 12.7484C13.1656 12.7219 13.1906 12.6969 13.2141 12.6703C13.2141 12.6688 13.2156 12.6687 13.2156 12.6672C13.2375 12.6438 13.2594 12.6187 13.2797 12.5938C13.2859 12.5859 13.2922 12.5797 13.2984 12.5719C13.3161 12.553 13.3333 12.5338 13.35 12.5141ZM13.4141 10.2859C13.1984 10.7953 12.9141 11.2672 12.5672 11.6953C12.1765 11.3577 11.7494 11.0647 11.2937 10.8219C11.475 10.0891 11.5875 9.28438 11.6172 8.4375H13.8594C13.8125 9.07656 13.6625 9.69687 13.4141 10.2859ZM13.8594 7.5625H11.6172C11.5875 6.71562 11.475 5.91094 11.2937 5.17812C11.7516 4.93437 12.1781 4.64062 12.5672 4.30469C13.3212 5.23277 13.7722 6.3699 13.8594 7.5625ZM10.2859 2.58594C10.9062 2.84844 11.4703 3.21094 11.9672 3.66719C11.6785 3.91296 11.3679 4.13159 11.0391 4.32031C10.7937 3.61719 10.4797 3.00625 10.1141 2.51719C10.1719 2.53906 10.2297 2.5625 10.2859 2.58594ZM8.87031 13.5328C8.72656 13.6453 8.58281 13.7312 8.4375 13.7891V10.8906C9.05749 10.9339 9.66717 11.0719 10.2453 11.3C10.1156 11.6844 9.96562 12.0391 9.79219 12.3594C9.52031 12.8656 9.20156 13.2703 8.87031 13.5328ZM9.79219 3.64062C9.96406 3.9625 10.1156 4.31719 10.2453 4.7C9.66717 4.92806 9.05749 5.06612 8.4375 5.10938V2.2125C8.58125 2.27031 8.72656 2.35469 8.87031 2.46875C9.20156 2.72969 9.52031 3.13438 9.79219 3.64062ZM8.4375 10.0141V8.4375H10.7422C10.7172 9.12813 10.6313 9.79844 10.4875 10.4344L10.4828 10.4531C9.82708 10.2045 9.13751 10.0564 8.4375 10.0141ZM8.4375 7.5625V5.98594C9.15312 5.94219 9.84063 5.79063 10.4828 5.54688L10.4875 5.56563C10.6313 6.20156 10.7172 6.87031 10.7422 7.5625H8.4375ZM7.5625 8.4375V10.0141C6.84688 10.0578 6.15938 10.2094 5.51719 10.4531L5.5125 10.4344C5.36875 9.79844 5.28281 9.12969 5.25781 8.4375H7.5625ZM5.25781 7.5625C5.28281 6.87187 5.36875 6.20156 5.5125 5.56563L5.51719 5.54688C6.15938 5.79063 6.84531 5.94219 7.5625 5.98594V7.5625H5.25781ZM7.5625 10.8906V13.7875C7.41875 13.7297 7.27344 13.6453 7.12969 13.5312C6.79844 13.2703 6.47813 12.8641 6.20625 12.3578C6.03438 12.0359 5.88281 11.6812 5.75313 11.2984C6.33438 11.0703 6.93906 10.9344 7.5625 10.8906ZM7.5625 5.10938C6.94251 5.06612 6.33283 4.92806 5.75469 4.7C5.88437 4.31562 6.03437 3.96094 6.20781 3.64062C6.47969 3.13438 6.79844 2.72812 7.13125 2.46719C7.275 2.35469 7.41875 2.26875 7.56406 2.21094V5.10938H7.5625ZM5.71406 2.58594C5.77188 2.5625 5.82812 2.53906 5.88594 2.51719C5.52031 3.00625 5.20625 3.61719 4.96094 4.32031C4.63281 4.13281 4.32188 3.91406 4.03281 3.66719C4.52969 3.21094 5.09375 2.84844 5.71406 2.58594ZM2.58594 5.71406C2.80156 5.20469 3.08594 4.73281 3.43281 4.30469C3.82187 4.64062 4.24844 4.93437 4.70625 5.17812C4.525 5.91094 4.4125 6.71562 4.38281 7.5625H2.14062C2.1875 6.92344 2.3375 6.30313 2.58594 5.71406ZM2.14062 8.4375H4.38281C4.4125 9.28438 4.525 10.0891 4.70625 10.8219C4.25059 11.0647 3.82347 11.3577 3.43281 11.6953C2.6788 10.7672 2.22776 9.6301 2.14062 8.4375ZM5.71406 13.4141C5.09375 13.1516 4.52969 12.7891 4.03281 12.3328C4.32188 12.0859 4.63281 11.8687 4.96094 11.6797C5.20625 12.3828 5.52031 12.9938 5.88594 13.4828C5.82812 13.4609 5.77031 13.4375 5.71406 13.4141ZM10.2859 13.4141C10.2281 13.4375 10.1719 13.4609 10.1141 13.4828C10.4797 12.9938 10.7937 12.3828 11.0391 11.6797C11.3672 11.8672 11.6781 12.0859 11.9672 12.3328C11.4731 12.7872 10.9043 13.1529 10.2859 13.4141Z" />
  </svg>
);

export const GlobalOutlinedIcon = styled(Icon).attrs({
  'data-component-name': 'icons/GlobalOutlinedIcon/GlobalOutlinedIcon',
})`
  path {
    fill: ${({ color }) => getCssColorVariable(color)};
  }

  height: ${({ size }) => size || '16px'};
  width: ${({ size }) => size || '16px'};
`;
