/**
 * 拓扑设备图标集合：统一 viewBox=`0 0 80 56`（横向 ~ 1.43:1），
 * 风格白底 + #98A2B3 描边 + 局部彩色小亮点，参考交换机/AP 立体外观。
 *
 * 通过 {@link TOPOLOGY_KIND_ICONS} 注入 `TopologyDeviceCard`：
 * key 为 elementKind value（含 `topologyDevice:<type_code>` 形式）。
 */
import React from 'react';
var VIEW_BOX = '0 0 80 56';
var STROKE = '#98A2B3';
var STROKE_DARK = '#475467';
var FILL_BODY = '#FFFFFF';
var FILL_BODY_SOFT = '#F2F4F7';
var ACCENT_GREEN = '#12B76A';
var ACCENT_AMBER = '#F79009';
var ACCENT_BLUE = '#1570EF';
var ACCENT_VIOLET = '#6938EF';
var ACCENT_RED = '#F04438';
var svgProps = {
  viewBox: VIEW_BOX,
  xmlns: 'http://www.w3.org/2000/svg',
  'aria-hidden': true
};

/** POS 一体机（pos）：竖立的平板 + 底座 */
export function TopologyIntegratedPosIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "26",
    y: "6",
    width: "28",
    height: "38",
    rx: "3",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "29",
    y: "9",
    width: "22",
    height: "28",
    rx: "1.5",
    fill: "#EAECF0"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "40",
    cy: "41",
    r: "1.4",
    fill: STROKE_DARK
  }), /*#__PURE__*/React.createElement("rect", {
    x: "20",
    y: "46",
    width: "40",
    height: "5",
    rx: "1.5",
    fill: FILL_BODY_SOFT,
    stroke: STROKE_DARK,
    strokeWidth: "1.2"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M30 12h16M30 16h12M30 20h14",
    stroke: "#CFD4DC",
    strokeWidth: "1.2",
    strokeLinecap: "round"
  }));
}

/** 小票打印机（receipt_printer）：方形机身 + 上方吐出的卷纸 */
export function TopologyPrinterIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("path", {
    d: "M22 14h36c0-3.5-2-5-5-5H27c-3 0-5 1.5-5 5z",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.4"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M24 12c2-3 6-3 10-2s10 2 14 1",
    fill: "none",
    stroke: STROKE,
    strokeWidth: "1.2",
    strokeLinecap: "round"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "18",
    y: "14",
    width: "44",
    height: "32",
    rx: "3",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "22",
    y: "20",
    width: "36",
    height: "4",
    rx: "1",
    fill: FILL_BODY_SOFT,
    stroke: STROKE,
    strokeWidth: "1"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "24",
    y: "30",
    width: "32",
    height: "10",
    rx: "1.5",
    fill: FILL_BODY_SOFT,
    stroke: STROKE,
    strokeWidth: "1"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "52",
    cy: "35",
    r: "1.3",
    fill: ACCENT_GREEN
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "48",
    cy: "35",
    r: "1.3",
    fill: ACCENT_AMBER
  }));
}

/** 标签打印机（label_printer）：方机身 + 前侧出标签 */
export function TopologyLabelPrinterIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "14",
    y: "14",
    width: "44",
    height: "28",
    rx: "3",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "20",
    y: "20",
    width: "32",
    height: "6",
    rx: "1",
    fill: FILL_BODY_SOFT,
    stroke: STROKE,
    strokeWidth: "1"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "50",
    cy: "36",
    r: "1.4",
    fill: ACCENT_GREEN
  }), /*#__PURE__*/React.createElement("rect", {
    x: "58",
    y: "22",
    width: "14",
    height: "20",
    rx: "1.5",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.4"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M62 26h6M62 30h6M62 34h6M62 38h6",
    stroke: STROKE,
    strokeWidth: "0.9",
    strokeLinecap: "round"
  }));
}

/** 交换机（switch）：横长机身 + 端口阵列 + SW 标识（参考图风格） */
export function TopologySwitchIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "3",
    y: "18",
    width: "74",
    height: "22",
    rx: "3",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("text", {
    x: "11",
    y: "33",
    fontFamily: "ui-sans-serif, -apple-system, Helvetica, Arial",
    fontWeight: "700",
    fontSize: "9",
    fill: STROKE_DARK
  }, "SW"), Array.from({
    length: 12
  }).map(function (_, i) {
    return /*#__PURE__*/React.createElement("rect", {
      key: i,
      x: 26 + i * 4,
      y: "23",
      width: "2.4",
      height: "12",
      rx: "0.5",
      fill: i % 3 === 0 ? ACCENT_GREEN : i % 3 === 1 ? ACCENT_AMBER : '#D0D5DD'
    });
  }), /*#__PURE__*/React.createElement("path", {
    d: "M65 24l3 4-3 4M68 24l3 4-3 4",
    fill: "none",
    stroke: STROKE_DARK,
    strokeWidth: "1.2",
    strokeLinecap: "round"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "3",
    y: "40",
    width: "74",
    height: "3",
    rx: "1",
    fill: "#EAECF0"
  }));
}

/** 信息展示屏（info_display）：大屏 + 支架 */
export function TopologyInfoDisplayIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "6",
    y: "4",
    width: "68",
    height: "40",
    rx: "3",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "10",
    y: "8",
    width: "60",
    height: "32",
    rx: "1.5",
    fill: "#EAECF0"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M14 36l8-12 6 7 8-15 12 18 8-9",
    stroke: ACCENT_BLUE,
    strokeWidth: "1.4",
    fill: "none",
    strokeLinejoin: "round"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "34",
    y: "44",
    width: "12",
    height: "4",
    fill: FILL_BODY_SOFT,
    stroke: STROKE_DARK,
    strokeWidth: "1.2"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "22",
    y: "48",
    width: "36",
    height: "3",
    rx: "1",
    fill: FILL_BODY_SOFT,
    stroke: STROKE_DARK,
    strokeWidth: "1.2"
  }));
}

/** 终端（terminal）：手持式 POS 终端，带屏幕和键盘 */
export function TopologyTerminalIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "26",
    y: "4",
    width: "28",
    height: "48",
    rx: "3",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "29",
    y: "8",
    width: "22",
    height: "18",
    rx: "1.5",
    fill: "#EAECF0"
  }), Array.from({
    length: 12
  }).map(function (_, i) {
    var col = i % 3;
    var row = Math.floor(i / 3);
    return /*#__PURE__*/React.createElement("rect", {
      key: i,
      x: 30 + col * 7,
      y: 29 + row * 5,
      width: "5",
      height: "3.4",
      rx: "0.6",
      fill: FILL_BODY_SOFT,
      stroke: STROKE,
      strokeWidth: "0.7"
    });
  }));
}

/** AP（test1 / Wireless AP）：方形机身 + 中心 wifi 波纹（参考图） */
export function TopologyApIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "22",
    y: "8",
    width: "36",
    height: "36",
    rx: "4",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "40",
    cy: "26",
    r: "1.6",
    fill: STROKE_DARK
  }), /*#__PURE__*/React.createElement("path", {
    d: "M34 28a8 8 0 0 1 12 0M31 32a12 12 0 0 1 18 0",
    fill: "none",
    stroke: STROKE_DARK,
    strokeWidth: "1.4",
    strokeLinecap: "round"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "26",
    cy: "40",
    r: "1",
    fill: STROKE
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "54",
    cy: "40",
    r: "1",
    fill: ACCENT_GREEN
  }));
}

/** 通用占位图标：黑盒带问号（chenlei / 测试设备等） */
export function TopologyAmusementIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "14",
    y: "10",
    width: "52",
    height: "36",
    rx: "3",
    fill: FILL_BODY_SOFT,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M34 22c0-3 2.5-5 6-5s6 2 6 5c0 2.5-2 3.5-3.5 4.5-1.5 1-2.5 1.7-2.5 3.5",
    fill: "none",
    stroke: STROKE_DARK,
    strokeWidth: "1.6",
    strokeLinecap: "round"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "40",
    cy: "36",
    r: "1.3",
    fill: STROKE_DARK
  }));
}

/** 路由器（unknown 兜底）：横长机身 + 端口指示灯 + 天线 */
export function TopologyRouterIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("path", {
    d: "M20 16l-3-7M40 16l0-9M60 16l3-7",
    stroke: STROKE_DARK,
    strokeWidth: "1.4",
    strokeLinecap: "round"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "17",
    cy: "9",
    r: "1.4",
    fill: STROKE_DARK
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "40",
    cy: "7",
    r: "1.4",
    fill: STROKE_DARK
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "63",
    cy: "9",
    r: "1.4",
    fill: STROKE_DARK
  }), /*#__PURE__*/React.createElement("rect", {
    x: "8",
    y: "18",
    width: "64",
    height: "22",
    rx: "3",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), Array.from({
    length: 6
  }).map(function (_, i) {
    return /*#__PURE__*/React.createElement("circle", {
      key: i,
      cx: 18 + i * 9,
      cy: "29",
      r: "1.6",
      fill: i === 0 ? ACCENT_GREEN : i === 5 ? ACCENT_AMBER : ACCENT_BLUE,
      opacity: i === 1 ? 0.4 : 1
    });
  }), /*#__PURE__*/React.createElement("rect", {
    x: "8",
    y: "38",
    width: "64",
    height: "3",
    rx: "1",
    fill: "#EAECF0"
  }));
}

/**
 * 旧 kind（router/switch/cashier/...）保留以兼容旧 floor-plan 配置；
 * 主流程通过 `topologyDevice:<type_code>` 命中。
 */

/** 收银机（保留兼容） */
export function TopologyCashierIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "14",
    y: "10",
    width: "52",
    height: "32",
    rx: "3",
    fill: FILL_BODY,
    stroke: STROKE_DARK,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "18",
    y: "14",
    width: "32",
    height: "14",
    rx: "1.5",
    fill: "#FFF6ED",
    stroke: ACCENT_AMBER,
    strokeWidth: "1.2"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "18",
    y: "32",
    width: "44",
    height: "8",
    rx: "1",
    fill: FILL_BODY_SOFT,
    stroke: STROKE,
    strokeWidth: "1"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "56",
    cy: "20",
    r: "2",
    fill: ACCENT_AMBER
  }));
}

/** 闸机（保留兼容） */
export function TopologyGateIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "14",
    y: "10",
    width: "14",
    height: "36",
    rx: "2",
    fill: FILL_BODY,
    stroke: ACCENT_GREEN,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "52",
    y: "10",
    width: "14",
    height: "36",
    rx: "2",
    fill: FILL_BODY,
    stroke: ACCENT_GREEN,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M28 28h24",
    stroke: ACCENT_GREEN,
    strokeWidth: "2",
    strokeLinecap: "round"
  }));
}

/** 自助机（保留兼容） */
export function TopologyKioskIcon() {
  return /*#__PURE__*/React.createElement("svg", svgProps, /*#__PURE__*/React.createElement("rect", {
    x: "22",
    y: "4",
    width: "36",
    height: "40",
    rx: "3",
    fill: FILL_BODY,
    stroke: ACCENT_VIOLET,
    strokeWidth: "1.5"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "26",
    y: "8",
    width: "28",
    height: "22",
    rx: "1.5",
    fill: "#F4F3FF",
    stroke: ACCENT_VIOLET,
    strokeWidth: "1.2"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "28",
    y: "34",
    width: "24",
    height: "4",
    rx: "1",
    fill: "#F4F3FF"
  }), /*#__PURE__*/React.createElement("rect", {
    x: "14",
    y: "44",
    width: "52",
    height: "6",
    rx: "1.5",
    fill: FILL_BODY_SOFT,
    stroke: STROKE_DARK,
    strokeWidth: "1.2"
  }));
}
export var TOPOLOGY_KIND_ICONS = {
  topologyRouter: TopologyRouterIcon,
  topologySwitch: TopologySwitchIcon,
  topologyAp: TopologyApIcon,
  topologyCashier: TopologyCashierIcon,
  topologyGate: TopologyGateIcon,
  topologyKiosk: TopologyKioskIcon,
  topologyIntegratedPos: TopologyIntegratedPosIcon,
  topologyPrinter: TopologyPrinterIcon,
  topologyAmusement: TopologyAmusementIcon,
  /**
   * 设备列表（按 type_code）使用的 kind value，复用上面图标做形状区分。
   * 后端新增 type_code 时 `TopologyDeviceCard` 会回退到 `topologyRouter` 图标。
   */
  'topologyDevice:pos': TopologyIntegratedPosIcon,
  'topologyDevice:receipt_printer': TopologyPrinterIcon,
  'topologyDevice:label_printer': TopologyLabelPrinterIcon,
  'topologyDevice:switch': TopologySwitchIcon,
  'topologyDevice:info_display': TopologyInfoDisplayIcon,
  'topologyDevice:terminal': TopologyTerminalIcon,
  'topologyDevice:chenlei': TopologyAmusementIcon,
  'topologyDevice:test1': TopologyApIcon,
  'topologyDevice:unknown': TopologyRouterIcon
};