// HTML 시안 기반 레이어 트리 구조

export interface LayerNode {
  code: string;
  parentCode: string | null;
  fullName: string;
  name: string;
  level: number;
  layerName: string | null;
  dataTblNm?: string | null;
  icon?: string;
  count?: number;
  defaultOn?: boolean;
  children?: LayerNode[];
}

export const layerData: LayerNode[] = [
  // ─── 1. 해양생물자원 ───
  {
    code: 'BIO',
    parentCode: null,
    fullName: '해양생물자원',
    name: '해양생물자원',
    level: 1,
    layerName: null,
    icon: '🐟',
    count: 17129,
    defaultOn: true,
    children: [
      {
        code: 'BIO_FARM',
        parentCode: 'BIO',
        fullName: '양식장',
        name: '양식장',
        level: 2,
        layerName: null,
        icon: '🦪',
        count: 3947,
        defaultOn: true,
        children: [
          {
            code: 'BIO_FARM_FISH',
            parentCode: 'BIO_FARM',
            fullName: '어류양식장',
            name: '어류양식장',
            level: 3,
            layerName: 'mpc:600',
            icon: '🐟',
            count: 87,
            defaultOn: true,
          },
          {
            code: 'BIO_FARM_SHELL',
            parentCode: 'BIO_FARM',
            fullName: '패류양식장',
            name: '패류양식장 (굴·전복·홍합)',
            level: 3,
            layerName: 'mpc:506',
            icon: '🦪',
            count: 720,
            defaultOn: true,
          },
          {
            code: 'BIO_FARM_SEAWEED',
            parentCode: 'BIO_FARM',
            fullName: '해조류양식장',
            name: '해조류양식장 (김·미역·다시마)',
            level: 3,
            layerName: 'mpc:503',
            icon: '🌿',
            count: 1438,
            defaultOn: true,
          },
          {
            code: 'BIO_FARM_CAGE',
            parentCode: 'BIO_FARM',
            fullName: '가두리양식장',
            name: '가두리양식장',
            level: 3,
            layerName: 'mpc:472',
            icon: '🔲',
            count: 59,
          },
          {
            code: 'BIO_FARM_CRUST',
            parentCode: 'BIO_FARM',
            fullName: '갑각류양식장',
            name: '갑각류양식장',
            level: 3,
            layerName: 'mpc:473',
            icon: '🦐',
            count: 470,
          },
          {
            code: 'BIO_FARM_ETC',
            parentCode: 'BIO_FARM',
            fullName: '기타양식장',
            name: '기타양식장',
            level: 3,
            layerName: 'mpc:486',
            icon: '📦',
            count: 1173,
          },
        ],
      },
      {
        code: 'BIO_REEF',
        parentCode: 'BIO',
        fullName: '어초·암초',
        name: '어초·암초',
        level: 2,
        layerName: null,
        icon: '🪸',
        count: 13182,
        defaultOn: true,
        children: [
          {
            code: 'BIO_REEF_ART',
            parentCode: 'BIO_REEF',
            fullName: '인공어초',
            name: '인공어초',
            level: 3,
            layerName: 'mpc:495',
            icon: '🪸',
            count: 6683,
            defaultOn: true,
          },
          {
            code: 'BIO_REEF_NAT',
            parentCode: 'BIO_REEF',
            fullName: '암초 (자연)',
            name: '암초 (자연)',
            level: 3,
            layerName: 'mpc:497',
            icon: '🪨',
            count: 6331,
          },
          {
            code: 'BIO_REEF_WRECK',
            parentCode: 'BIO_REEF',
            fullName: '침선',
            name: '침선',
            level: 3,
            layerName: 'mpc:488',
            icon: '🚢',
            count: 88,
          },
          {
            code: 'BIO_REEF_OBS',
            parentCode: 'BIO_REEF',
            fullName: '기타 장애물',
            name: '기타 장애물',
            level: 3,
            layerName: 'mpc:470',
            icon: '⚠',
            count: 80,
          },
        ],
      },
    ],
  },

  // ─── 2. 환경·보호구역 ───
  {
    code: 'ENV',
    parentCode: null,
    fullName: '환경·보호구역',
    name: '환경·보호구역',
    level: 1,
    layerName: null,
    icon: '🏛',
    children: [
      {
        code: 'ENV_ECO',
        parentCode: 'ENV',
        fullName: '생태보호구역',
        name: '생태보호구역',
        level: 2,
        layerName: null,
        icon: '🦅',
        children: [
          {
            code: 'ENV_ECO_MARINE',
            parentCode: 'ENV_ECO',
            fullName: '해양보호구역',
            name: '해양보호구역',
            level: 3,
            layerName: 'mpc:505',
            icon: '🌿',
          },
          {
            code: 'ENV_ECO_BIRD',
            parentCode: 'ENV_ECO',
            fullName: '철새도래지',
            name: '철새도래지',
            level: 3,
            layerName: 'mpc:254',
            icon: '🐦',
          },
          {
            code: 'ENV_ECO_WETLAND',
            parentCode: 'ENV_ECO',
            fullName: '습지보호구역',
            name: '습지보호구역',
            level: 3,
            layerName: 'mpc:468',
            icon: '🏖',
          },
          {
            code: 'ENV_ECO_ENDANG',
            parentCode: 'ENV_ECO',
            fullName: '보호종 서식지',
            name: '보호종 서식지',
            level: 3,
            layerName: 'mpc:255',
            icon: '🐢',
          },
        ],
      },
      {
        code: 'ENV_COAST',
        parentCode: 'ENV',
        fullName: '해안·연안',
        name: '해안·연안',
        level: 2,
        layerName: null,
        icon: '🏖',
        children: [
          {
            code: 'ENV_COAST_BEACH',
            parentCode: 'ENV_COAST',
            fullName: '해수욕장',
            name: '해수욕장',
            level: 3,
            layerName: 'mpc:501',
            icon: '🏖',
          },
          {
            code: 'ENV_COAST_MUD',
            parentCode: 'ENV_COAST',
            fullName: '갯벌',
            name: '갯벌',
            level: 3,
            layerName: 'mpc:363',
            icon: '🪨',
          },
          {
            code: 'ENV_COAST_INTAKE',
            parentCode: 'ENV_COAST',
            fullName: '취수구·배수구',
            name: '취수구·배수구',
            level: 3,
            layerName: 'mpc:466',
            icon: '🚰',
          },
        ],
      },
    ],
  },

  // ─── 3. 해양시설·인프라 ───
  {
    code: 'INF',
    parentCode: null,
    fullName: '해양시설·인프라',
    name: '해양시설·인프라',
    level: 1,
    layerName: null,
    icon: '⚓',
    children: [
      {
        code: 'INF_PORT',
        parentCode: 'INF',
        fullName: '항만·항로',
        name: '항만·항로',
        level: 2,
        layerName: null,
        icon: '🚢',
        children: [
          {
            code: 'INF_PORT_AREA',
            parentCode: 'INF_PORT',
            fullName: '항만 구역',
            name: '항만 구역',
            level: 3,
            layerName: 'mpc:469',
            icon: '⚓',
          },
          {
            code: 'INF_PORT_ROUTE',
            parentCode: 'INF_PORT',
            fullName: '항로',
            name: '항로',
            level: 3,
            layerName: 'mpc:601',
            icon: '🚢',
          },
          {
            code: 'INF_PORT_ANCHOR',
            parentCode: 'INF_PORT',
            fullName: '정박지',
            name: '정박지',
            level: 3,
            layerName: 'mpc:471',
            icon: '⛵',
          },
          {
            code: 'INF_PORT_BUOY',
            parentCode: 'INF_PORT',
            fullName: '항로표지',
            name: '항로표지',
            level: 3,
            layerName: 'mpc:492',
            icon: '🔴',
          },
        ],
      },
      {
        code: 'INF_IND',
        parentCode: 'INF',
        fullName: '산업시설',
        name: '산업시설',
        level: 2,
        layerName: null,
        icon: '🏭',
        children: [
          {
            code: 'INF_IND_POWER',
            parentCode: 'INF_IND',
            fullName: '발전소·산단',
            name: '발전소·산단',
            level: 3,
            layerName: 'mpc:474',
            icon: '🏭',
          },
          {
            code: 'INF_IND_OIL',
            parentCode: 'INF_IND',
            fullName: '저유시설',
            name: '저유시설',
            level: 3,
            layerName: 'mpc:496',
            icon: '🛢',
          },
          {
            code: 'INF_IND_CABLE',
            parentCode: 'INF_IND',
            fullName: '해저케이블·배관',
            name: '해저케이블·배관',
            level: 3,
            layerName: 'mpc:499',
            icon: '🔌',
          },
        ],
      },
    ],
  },

  // ─── 4. 방제자원 ───
  {
    code: 'DEF',
    parentCode: null,
    fullName: '방제자원',
    name: '방제자원',
    level: 1,
    layerName: null,
    icon: '🛡',
    defaultOn: true,
    children: [
      {
        code: 'DEF_DEPLOY',
        parentCode: 'DEF',
        fullName: '방제 배치',
        name: '방제 배치',
        level: 2,
        layerName: null,
        icon: '🛡',
        defaultOn: true,
        children: [
          {
            code: 'DEF_DEPLOY_BOOM',
            parentCode: 'DEF_DEPLOY',
            fullName: '오일펜스 배치선',
            name: '오일펜스 배치선',
            level: 3,
            layerName: 'defense:boom_lines',
            icon: '🛡',
            defaultOn: true,
          },
          {
            code: 'DEF_DEPLOY_WARE',
            parentCode: 'DEF_DEPLOY',
            fullName: '방제창고',
            name: '방제창고',
            level: 3,
            layerName: 'defense:warehouse',
            icon: '🏗',
          },
          {
            code: 'DEF_DEPLOY_SHIP',
            parentCode: 'DEF_DEPLOY',
            fullName: '방제선 위치',
            name: '방제선 위치',
            level: 3,
            layerName: 'defense:vessels',
            icon: '🚢',
          },
        ],
      },
    ],
  },

  // ─── 5. Pre-SCAT 데이터 ───
  {
    code: 'SCAT',
    parentCode: null,
    fullName: 'Pre-SCAT 데이터',
    name: 'Pre-SCAT 데이터',
    level: 1,
    layerName: null,
    icon: '📊',
    children: [
      {
        code: 'SCAT_ESI',
        parentCode: 'SCAT',
        fullName: '해안분류 (ESI)',
        name: '해안분류 (ESI)',
        level: 2,
        layerName: null,
        icon: '🏖',
        children: [
          {
            code: 'SCAT_ESI_ROCK',
            parentCode: 'SCAT_ESI',
            fullName: '암반 해안 (ESI 1)',
            name: '암반 해안 (ESI 1)',
            level: 3,
            layerName: 'prescat:esi_rock',
            icon: '🪨',
          },
          {
            code: 'SCAT_ESI_SAND',
            parentCode: 'SCAT_ESI',
            fullName: '사빈 해안 (ESI 3)',
            name: '사빈 해안 (ESI 3)',
            level: 3,
            layerName: 'prescat:esi_sand',
            icon: '🏖',
          },
          {
            code: 'SCAT_ESI_GRAVEL',
            parentCode: 'SCAT_ESI',
            fullName: '자갈 해안 (ESI 5)',
            name: '자갈 해안 (ESI 5)',
            level: 3,
            layerName: 'prescat:esi_gravel',
            icon: '🪹',
          },
          {
            code: 'SCAT_ESI_MUD',
            parentCode: 'SCAT_ESI',
            fullName: '갯벌·습지 (ESI 9)',
            name: '갯벌·습지 (ESI 9)',
            level: 3,
            layerName: 'prescat:esi_mudflat',
            icon: '🌿',
          },
          {
            code: 'SCAT_ESI_MANG',
            parentCode: 'SCAT_ESI',
            fullName: '맹그로브·염습지 (ESI 10)',
            name: '맹그로브·염습지 (ESI 10)',
            level: 3,
            layerName: 'prescat:esi_mangrove',
            icon: '🌾',
          },
        ],
      },
      {
        code: 'SCAT_SENS',
        parentCode: 'SCAT',
        fullName: '해안 민감도',
        name: '해안 민감도',
        level: 2,
        layerName: null,
        icon: '🎯',
        children: [
          {
            code: 'SCAT_SENS_MAX',
            parentCode: 'SCAT_SENS',
            fullName: '최고 민감 구간',
            name: '최고 민감 구간',
            level: 3,
            layerName: 'prescat:sens_max',
            icon: '🔴',
          },
          {
            code: 'SCAT_SENS_HIGH',
            parentCode: 'SCAT_SENS',
            fullName: '고민감 구간',
            name: '고민감 구간',
            level: 3,
            layerName: 'prescat:sens_high',
            icon: '🟠',
          },
          {
            code: 'SCAT_SENS_MID',
            parentCode: 'SCAT_SENS',
            fullName: '중민감 구간',
            name: '중민감 구간',
            level: 3,
            layerName: 'prescat:sens_mid',
            icon: '🟡',
          },
          {
            code: 'SCAT_SENS_LOW',
            parentCode: 'SCAT_SENS',
            fullName: '저민감 구간',
            name: '저민감 구간',
            level: 3,
            layerName: 'prescat:sens_low',
            icon: '🟢',
          },
        ],
      },
      {
        code: 'SCAT_VULN',
        parentCode: 'SCAT',
        fullName: '오염 취약성',
        name: '오염 취약성',
        level: 2,
        layerName: null,
        icon: '🛢',
        children: [
          {
            code: 'SCAT_VULN_RESI',
            parentCode: 'SCAT_VULN',
            fullName: '잔류시간 예측',
            name: '잔류시간 예측',
            level: 3,
            layerName: 'prescat:vuln_residency',
            icon: '⏱',
          },
          {
            code: 'SCAT_VULN_DIFF',
            parentCode: 'SCAT_VULN',
            fullName: '방제 난이도',
            name: '방제 난이도',
            level: 3,
            layerName: 'prescat:vuln_difficulty',
            icon: '🧹',
          },
          {
            code: 'SCAT_VULN_SELF',
            parentCode: 'SCAT_VULN',
            fullName: '자연정화 기대수준',
            name: '자연정화 기대수준',
            level: 3,
            layerName: 'prescat:vuln_selfclean',
            icon: '🔄',
          },
        ],
      },
      {
        code: 'SCAT_STRAT',
        parentCode: 'SCAT',
        fullName: '방제전략 권고',
        name: '방제전략 권고',
        level: 2,
        layerName: null,
        icon: '📋',
        children: [
          {
            code: 'SCAT_STRAT_PRI',
            parentCode: 'SCAT_STRAT',
            fullName: '1순위 방어구간',
            name: '1순위 방어구간',
            level: 3,
            layerName: 'prescat:strat_priority',
            icon: '🛡',
          },
          {
            code: 'SCAT_STRAT_METHOD',
            parentCode: 'SCAT_STRAT',
            fullName: '권고 방제공법',
            name: '권고 방제공법',
            level: 3,
            layerName: 'prescat:strat_method',
            icon: '🧹',
          },
          {
            code: 'SCAT_STRAT_BASE',
            parentCode: 'SCAT_STRAT',
            fullName: '거점 방제장소',
            name: '거점 방제장소',
            level: 3,
            layerName: 'prescat:strat_base',
            icon: '📍',
          },
          {
            code: 'SCAT_STRAT_ACCESS',
            parentCode: 'SCAT_STRAT',
            fullName: '접근경로·진입로',
            name: '접근경로·진입로',
            level: 3,
            layerName: 'prescat:strat_access',
            icon: '🚧',
          },
        ],
      },
    ],
  },

  // ─── 6. 해양관측·기상 ───
  {
    code: 'OBS',
    parentCode: null,
    fullName: '해양관측·기상',
    name: '해양관측·기상',
    level: 1,
    layerName: null,
    icon: '🌊',
    defaultOn: true,
    children: [
      {
        code: 'OBS_CURRENT',
        parentCode: 'OBS',
        fullName: '해류 벡터',
        name: '해류 벡터',
        level: 2,
        layerName: 'obs:current_vector',
        icon: '🌊',
        defaultOn: true,
      },
      {
        code: 'OBS_TEMP',
        parentCode: 'OBS',
        fullName: '수온 분포',
        name: '수온 분포',
        level: 2,
        layerName: 'obs:sst',
        icon: '🌡',
      },
      {
        code: 'OBS_BUOY',
        parentCode: 'OBS',
        fullName: '해양관측 부이',
        name: '해양관측 부이',
        level: 2,
        layerName: 'obs:buoy',
        icon: '📡',
      },
      {
        code: 'OBS_WEATHER',
        parentCode: 'OBS',
        fullName: '기상 관측소',
        name: '기상 관측소',
        level: 2,
        layerName: 'obs:weather_station',
        icon: '🌬',
      },
      {
        code: 'OBS_SAT',
        parentCode: 'OBS',
        fullName: '위성 영상',
        name: '위성 영상',
        level: 2,
        layerName: 'obs:satellite',
        icon: '🛰',
      },
    ],
  },

  // ─── 7. 선박·교통 ───
  {
    code: 'SHIP',
    parentCode: null,
    fullName: '선박·교통',
    name: '선박·교통',
    level: 1,
    layerName: null,
    icon: '🚢',
    children: [
      {
        code: 'SHIP_AIS',
        parentCode: 'SHIP',
        fullName: 'AIS 실시간 선박',
        name: 'AIS 실시간 선박',
        level: 2,
        layerName: 'ship:ais_realtime',
        icon: '🚢',
      },
      {
        code: 'SHIP_PATROL',
        parentCode: 'SHIP',
        fullName: '경비함정',
        name: '경비함정',
        level: 2,
        layerName: 'ship:patrol',
        icon: '🛥',
      },
      {
        code: 'SHIP_AIR',
        parentCode: 'SHIP',
        fullName: '항공기·드론',
        name: '항공기·드론',
        level: 2,
        layerName: 'ship:aircraft',
        icon: '🚁',
      },
    ],
  },
];
