import { Bush, Daylily, defineGroup, Flower, FlowerBed, Tree } from "../lib/yard-features.js";
import * as geo from "../lib/geometry.js";
import { lotCorner } from "./anchors.js";

export const juniperTreesGroup = defineGroup("group:juniper-trees", "Junipers", {
  categoryId: "plants",
  parentKind: "bush",
});

const flowerBeds = [
  new FlowerBed("Herbs").trace([
    [-100.89863446807426, 46.82677625460535],
    [-100.89862628077022, 46.82677780036216],
    [-100.89863677743469, 46.82681615158733],
    [-100.89864678466313, 46.826814966528865],
  ]),
  new FlowerBed("Garden").trace([
    [-100.89865910125202, 46.82684024777001],
    [-100.89865409763779, 46.82682773882406],
    [-100.89853785983037, 46.82684209119338],
    [-100.89854344078469, 46.82685618021274],
  ]),
  new FlowerBed("Back day lily").trace([
    [-100.89854344078469, 46.82685618021274],
    [-100.89852458100802, 46.82685815530862],
    [-100.89850764569832, 46.82680482769446],
    [-100.89851239198609, 46.82679937725647],
    [-100.89851803782018, 46.82680087749872],
    [-100.89852554324152, 46.826804564348095],
  ]),
  new FlowerBed("Coneflowers").trace([
    [-100.89852458100802, 46.82685815530862],
    [-100.89851482473702, 46.82685818966149],
    [-100.89850049853712, 46.82681602228328],
    [-100.89850764569832, 46.82680482769446],
  ]),
  new FlowerBed("Pathway border").trace([
    [-100.89881515684904, 46.82671629075389],
    [-100.89881830278543, 46.82671252471132],
    [-100.89882138193263, 46.82670673108083],
    [-100.89881445385141, 46.8266828981853],
    [-100.89877269291729, 46.82668908683872],
    [-100.89877211557717, 46.8266923786754],
    [-100.89876884398328, 46.82669501214458],
    [-100.89876326302891, 46.82669764561363],
    [-100.89875979898829, 46.82670304422476],
    [-100.89875979898829, 46.826708574508785],
    [-100.89876461015585, 46.826720556788906],
    [-100.8988050654378, 46.82671481119343],
  ]),
];

const daylilies = [
  new Daylily("Trahlyta", {
    gardenOrgId: "18613",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(1))),
  new Daylily("Wayside King Royale", {
    gardenOrgId: "5090",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(3))),
  new Daylily("Night Stalker", {
    gardenOrgId: "58861",
    plantedDate: "2023-05-01",
    pricePaid: 16,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(5))),
  new Daylily("Lemon Fringed Lemons", {
    gardenOrgId: "185536",
    plantedDate: "2023-05-01",
    pricePaid: 15,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(7))),
  new Daylily("Joan Derifield", {
    gardenOrgId: "4765",
    plantedDate: "2023-05-01",
    pricePaid: 15,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(9))),
  new Daylily("Predatory Flamingo", {
    gardenOrgId: "61201",
    plantedDate: "2023-05-01",
    pricePaid: 6,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112)), geo.south(geo.ft(11))),
  new Daylily("Double Me", {
    gardenOrgId: "7872",
    plantedDate: "2022-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(109)), geo.south(geo.ft(7))),
  new Daylily("Lipstick Spitfire", {
    gardenOrgId: "708897",
    plantedDate: "2022-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(109)), geo.south(geo.ft(9))),
  new Daylily("Jerry Hyatt", {
    gardenOrgId: "32921",
    plantedDate: "2022-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(107)), geo.south(geo.ft(8))),
  new Daylily("Take Me Home", {
    gardenOrgId: "791256",
    plantedDate: "2022-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(107)), geo.south(geo.ft(10))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(24))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(26))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(28))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(30))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(32))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(34))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(36))),
  new Daylily("Orange Daylily", {
    gardenOrgId: "48484",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(38))),
  new Daylily("Extra daylily", {
    gardenOrgId: "",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(0.8)), geo.south(geo.ft(3.2))),
  new Daylily("Extra daylily", {
    gardenOrgId: "",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(0.8)), geo.south(geo.ft(3.9))),
  new Daylily("Extra daylily", {
    gardenOrgId: "",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(1.3)), geo.south(geo.ft(3.6))),
  new Daylily("Extra daylily", {
    gardenOrgId: "",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(1)), geo.south(geo.ft(9))),
  new Daylily("Extra daylily", {
    gardenOrgId: "",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(1)), geo.south(geo.ft(17))),
  new Daylily("Can't read", {
    gardenOrgId: "",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(1)), geo.south(geo.ft(25))),
  new Daylily("J.T. Davis", {
    gardenOrgId: "29649",
    plantedDate: "2023-05-01",
    pricePaid: 21,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(1)), geo.south(geo.ft(31))),
  new Daylily("Tea for Teagan", {
    gardenOrgId: "787574",
    plantedDate: "2023-05-01",
    pricePaid: 15,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(1)), geo.south(geo.ft(34))),
  new Daylily("Burning So Brightly", {
    gardenOrgId: "610042",
    plantedDate: "2023-05-01",
    pricePaid: 17,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(2)), geo.south(geo.ft(32.5))),
  new Daylily("You Had Me at Hello", {
    gardenOrgId: "235117",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(28)), geo.south(geo.ft(45))),
  new Daylily("Mapping North Dakota", {
    gardenOrgId: "56003",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(28)), geo.south(geo.ft(47))),
  new Daylily("Monster", {
    gardenOrgId: "15661",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(31)), geo.south(geo.ft(47))),
];

const flowers = [
  new Flower("Purple Coneflower", {
    gardenOrgId: "71445",
    plantedDate: "2024-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(111.5)), geo.south(geo.ft(15))),
  new Flower("Purple Coneflower", {
    gardenOrgId: "71445",
    plantedDate: "2024-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(111.5)), geo.south(geo.ft(17))),
  new Flower("Purple Coneflower", {
    gardenOrgId: "71445",
    plantedDate: "2024-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112.5)), geo.south(geo.ft(16))),
  new Flower("Purple Coneflower", {
    gardenOrgId: "71445",
    plantedDate: "2024-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(112.5)), geo.south(geo.ft(14))),
  new Flower("Tiny Tortuga Turtlehead", {
    gardenOrgId: "697986",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(2.2)), geo.south(geo.ft(8.2))),
  new Flower("Tiny Tortuga Turtlehead", {
    gardenOrgId: "697986",
    plantedDate: "2021-09-21",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3)), geo.south(geo.ft(17))),
  new Flower("Peony", {
    gardenOrgId: "697986",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(18.7)), geo.south(geo.ft(1.6))),
  new Flower("Peony", {
    gardenOrgId: "697986",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(75)), geo.south(geo.ft(2))),
];

const houseplants = [
    new Flower("Variegata", {
        gardenOrgId: "126796",
    }).add(geo.offset(lotCorner), geo.east(geo.ft(60)), geo.south(geo.ft(28))),
]

const cutDownTrees = [
  new Tree("Maybe elm", {
    measurements: [{ canopyDiameter: geo.ft(49.21), height: geo.ft(49.21) }],
    removedDate: "2021-05-05",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(65)), geo.south(geo.ft(-2))),
  new Tree("Big pine tree", {
    measurements: [{ canopyDiameter: geo.ft(26.25), height: geo.ft(49.21) }],
    removedDate: "2021-05-06",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(98)), geo.south(geo.ft(-15))),
  new Tree("Walnut by house", {
    measurements: [{ canopyDiameter: geo.ft(19.69), height: geo.ft(22.97) }],
    removedDate: "2021-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(32)), geo.south(geo.ft(40))),
  new Tree("Walnut by shed", {
    measurements: [{ canopyDiameter: geo.ft(22.97), height: geo.ft(22.97) }],
    removedDate: "2021-05-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(100)), geo.south(geo.ft(40))),
];

const trees = [
  new Tree("Northern Empress Japanese Elm", {
    species: "Northern Empress Japanese Elm",
    measurements: [{ canopyDiameter: geo.ft(19.69), height: geo.ft(22.97) }],
    plantedDate: "2021-09-21",
    pricePaid: 312,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(9)), geo.south(geo.ft(16))),
  new Tree("Hot Wings Maple", {
    species: "Hot Wings Maple",
    measurements: [{ canopyDiameter: geo.ft(16.4), height: geo.ft(16.4) }],
    gardenOrgId: "536120",
    plantedDate: "2021-09-21",
    pricePaid: 186,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(60)), geo.south(geo.ft(40))),
  new Tree("Prairie Expedition American Elm", {
    species: "Prairie Expedition American Elm",
    measurements: [{ canopyDiameter: geo.ft(16.4), height: geo.ft(16.4) }],
    gardenOrgId: "736267",
    plantedDate: "2021-09-21",
    pricePaid: 280,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(95)), geo.south(geo.ft(15))),

  new Tree("Dwarf Korean Lilac", {
    species: "Dwarf Korean Lilac",
    measurements: [
      { measuredDate: "2026-07-08", canopyDiameter: geo.ft(5.5), height: geo.ft(6.7) },
    ],
    gardenOrgId: "79137",
    plantedDate: "2021-09-21",
    pricePaid: 218,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3.5)), geo.south(geo.ft(4.8))),

  new Tree("Dwarf Korean Lilac", {
    species: "Dwarf Korean Lilac",
    measurements: [
      { measuredDate: "2026-07-08", canopyDiameter: geo.ft(5.0), height: geo.ft(6.8) },
    ],
    gardenOrgId: "79137",
    plantedDate: "2021-09-21",
    pricePaid: 218,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3.7)), geo.south(geo.ft(21.4))),

  new Tree("Dwarf Korean Lilac", {
    species: "Dwarf Korean Lilac",
    measurements: [
      { measuredDate: "2026-07-08", canopyDiameter: geo.ft(5.5), height: geo.ft(7.5) },
    ],
    gardenOrgId: "79137",
    plantedDate: "2021-09-21",
    pricePaid: 218,
  }).add(geo.offset(lotCorner), geo.east(geo.ft(3.8)), geo.south(geo.ft(33.1))),

  new Tree("Boulevard Linden", {
    species: "Boulevard Linden",
    measurements: [{ canopyDiameter: geo.ft(9.84), height: geo.ft(19.69) }],
    plantedDate: "2021-09-21",
    pricePaid: 327,
  }).add(geo.lngLat(-100.8990003556445, 46.826776648309774)),
  new Tree("Boulevard Linden 2", {
    species: "Boulevard Linden",
    measurements: [{ canopyDiameter: geo.ft(9.84), height: geo.ft(19.69) }],
    plantedDate: "2021-09-21",
    pricePaid: 327,
  }).add(geo.lngLat(-100.89898269567485, 46.826709328342595)),
  new Tree("Evergreen", {
    species: "Evergreen",
    measurements: [{ canopyDiameter: geo.ft(26.25), height: geo.ft(49.21) }],
  }).add(geo.lngLat(-100.89888268258135, 46.826680107011924)),

  new Tree("Black Walnut from Jean", {
    species: "Black Walnut",
    measurements: [
      { measuredDate: "2026-07-08", canopyDiameter: geo.ft(2.7), height: geo.ft(2.9) }
    ],
    plantedDate: "2024-10-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(2.8)), geo.south(geo.ft(9.2))),

  new Tree("Black Walnut from Jean", {
    species: "Black Walnut",
    measurements: [
      { measuredDate: "2026-07-08", canopyDiameter: geo.ft(2.5), height: geo.ft(3.5) }
    ],
    plantedDate: "2024-10-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(2.6)), geo.south(geo.ft(11.3))),

  new Tree("Black Walnut from Jean", {
    species: "Black Walnut",
    measurements: [
      { measuredDate: "2026-07-08", canopyDiameter: geo.ft(4), height: geo.ft(4.5) }
    ],
    plantedDate: "2024-10-01",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(1.6)), geo.south(geo.ft(12.7))),
];

const bushes = [
  new Bush("Medora Juniper 1", {
    species: "Medora Juniper",
    measurements: [{ canopyDiameter: geo.ft(4.92), height: geo.ft(8.2) }],
    plantedDate: "2021-09-21",
    pricePaid: 96.50,
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89880933964611, 46.826705259550664)),
  new Bush("Medora Juniper 2", {
    species: "Medora Juniper",
    measurements: [{ canopyDiameter: geo.ft(4.92), height: geo.ft(8.2) }],
    plantedDate: "2021-09-21",
    pricePaid: 96.50,
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89877004677517, 46.82670396593881)),
  new Bush("Medora Juniper 3", {
    species: "Medora Juniper",
    measurements: [{ canopyDiameter: geo.ft(4.92), height: geo.ft(8.2) }],
    plantedDate: "2021-09-21",
    pricePaid: 96.50,
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.898799106227, 46.82669830398086)),
  new Bush("Medora Juniper 4", {
    species: "Medora Juniper",
    measurements: [{ canopyDiameter: geo.ft(4.92), height: geo.ft(8.2) }],
    plantedDate: "2021-09-21",
    pricePaid: 96.50,
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.89878871410515, 46.82669251034885)),
  new Bush("Medora Juniper 5", {
    species: "Medora Juniper",
    measurements: [{ canopyDiameter: geo.ft(4.92), height: geo.ft(8.2) }],
    plantedDate: "2021-09-21",
    pricePaid: 96.50,
  }).inGroup(juniperTreesGroup).add(geo.lngLat(-100.8987812086838, 46.82671120797719)),
  new Bush("Black Currant", {
    species: "Black Currant",
    measurements: [{ canopyDiameter: geo.ft(6.56), height: geo.ft(6.56) }],
    gardenOrgId: "87767",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(107)), geo.south(geo.ft(3))),
  new Bush("Elderberry", {
    species: "Elderberry",
    measurements: [{ canopyDiameter: geo.ft(9.84), height: geo.ft(9.84) }],
    gardenOrgId: "78882",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(142)), geo.south(geo.ft(52))),
  new Bush("Spirea", {
    species: "Spirea",
    measurements: [{ canopyDiameter: geo.ft(4.92), height: geo.ft(3.28) }],
    gardenOrgId: "79059",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(70)), geo.south(geo.ft(31))),
  new Bush("Spirea", {
    species: "Spirea",
    measurements: [{ canopyDiameter: geo.ft(4.92), height: geo.ft(3.28) }],
    gardenOrgId: "79059",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(74)), geo.south(geo.ft(31))),
  new Bush("Spirea", {
    species: "Spirea",
    measurements: [{ canopyDiameter: geo.ft(4.92), height: geo.ft(3.28) }],
    gardenOrgId: "79068",
  }).add(geo.offset(lotCorner), geo.east(geo.ft(78)), geo.south(geo.ft(31))),
];

export const plantFeatures = [...flowerBeds, ...daylilies, ...flowers, ...houseplants, ...trees, ...bushes, ...cutDownTrees];
export const plantGroups = [juniperTreesGroup];
