@eveshipfit/ui-ingame 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import './style.css';
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { useEffect, useId, useRef, useState } from "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- import { formatClock, formatDuration, formatNumber, useAttribute, useAttributeTooltip, useBayUsage, useCanFit, useChargeTree, useChargedModules, useCharges, useDrag, useFit, useFitHistory, useFitStore, useHardpoints, useHullTree, useImages, useLocalFits, useMissingSkills, useModuleTree, usePlacement, usePreview, useRackUsage, useSde, useSlots, useType, useViolations } from "@eveshipfit/react-hooks";
5
+ import { formatClock, formatDuration, formatNumber, useAttribute, useAttributeTooltip, useBayContents, useBayUsage, useCanFit, useChargeSearch, useChargeTree, useChargedModules, useCharges, useDrag, useDroneRoom, useFit, useFitHistory, useFitStore, useHardpoints, useHullTree, useImages, useLocalFits, useMissingSkills, useModuleSearch, useModuleTree, usePlacement, usePreview, useRackUsage, useSde, useSlots, useSnapshot, useType, useViolations } from "@eveshipfit/react-hooks";
6
6
  //#region src/primitives/Dialog/Dialog.module.css
7
7
  var Dialog_module_default = {
8
8
  "close": "kwi1cG_close",
@@ -465,6 +465,7 @@ const textures = {
465
465
  collapse: "eveicon/system_icons/collapse_16px",
466
466
  checkmark: "eveicon/system_icons/checkmark_16px",
467
467
  close: "eveicon/system_icons/close_16px",
468
+ folder: "eveicon/system_icons/folder_16px",
468
469
  "fits-browser": "windowicons/browser",
469
470
  "fits-personal": "windowicons/member",
470
471
  "fits-corporation": "windowicons/corporation",
@@ -615,7 +616,10 @@ function Tooltip(t0) {
615
616
  if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
616
617
  t8 = () => show(true);
617
618
  t9 = () => show(false);
618
- t10 = (event) => show(event.target.matches(":focus-visible"));
619
+ t10 = (event) => {
620
+ const target = event.target;
621
+ setTimeout(() => show(target.matches(":focus-visible")));
622
+ };
619
623
  t11 = () => show(false);
620
624
  t12 = (event_0) => {
621
625
  if (event_0.key === "Escape") show(false);
@@ -1272,7 +1276,7 @@ function WheelSlot(t0) {
1272
1276
  })
1273
1277
  });
1274
1278
  }
1275
- t7 = row.findLastIndex(_temp$5);
1279
+ t7 = row.findLastIndex(_temp$6);
1276
1280
  $[23] = chargeTypeId;
1277
1281
  $[24] = fitted;
1278
1282
  $[25] = onRemoveCharge;
@@ -1457,7 +1461,7 @@ function _temp2$2(event) {
1457
1461
  shiftKey: event.shiftKey
1458
1462
  }));
1459
1463
  }
1460
- function _temp$5(action) {
1464
+ function _temp$6(action) {
1461
1465
  return action !== void 0;
1462
1466
  }
1463
1467
  function Action(t0) {
@@ -1918,11 +1922,14 @@ function StatsSection(t0) {
1918
1922
  }
1919
1923
  //#endregion
1920
1924
  //#region src/primitives/ResistanceBar/ResistanceBar.module.css
1921
- var ResistanceBar_module_default = { "bar": "QyA-_q_bar" };
1925
+ var ResistanceBar_module_default = {
1926
+ "bar": "QyA-_q_bar",
1927
+ "text": "QyA-_q_text"
1928
+ };
1922
1929
  //#endregion
1923
1930
  //#region src/primitives/ResistanceBar/ResistanceBar.tsx
1924
1931
  function ResistanceBar(t0) {
1925
- const $ = c(11);
1932
+ const $ = c(13);
1926
1933
  const { damage, label, resistance, children } = t0;
1927
1934
  let t1;
1928
1935
  if ($[0] !== resistance) {
@@ -1932,8 +1939,17 @@ function ResistanceBar(t0) {
1932
1939
  } else t1 = $[1];
1933
1940
  const t2 = t1;
1934
1941
  let t3;
1935
- if ($[2] !== children || $[3] !== damage || $[4] !== label || $[5] !== resistance || $[6] !== t2) {
1936
- t3 = /* @__PURE__ */ jsx("div", {
1942
+ if ($[2] !== children) {
1943
+ t3 = /* @__PURE__ */ jsx("span", {
1944
+ className: ResistanceBar_module_default.text,
1945
+ children
1946
+ });
1947
+ $[2] = children;
1948
+ $[3] = t3;
1949
+ } else t3 = $[3];
1950
+ let t4;
1951
+ if ($[4] !== damage || $[5] !== label || $[6] !== resistance || $[7] !== t2 || $[8] !== t3) {
1952
+ t4 = /* @__PURE__ */ jsx("div", {
1937
1953
  className: ResistanceBar_module_default.bar,
1938
1954
  role: "meter",
1939
1955
  "aria-label": label,
@@ -1942,26 +1958,26 @@ function ResistanceBar(t0) {
1942
1958
  "aria-valuenow": resistance,
1943
1959
  "data-damage": damage,
1944
1960
  style: t2,
1945
- children
1961
+ children: t3
1946
1962
  });
1947
- $[2] = children;
1948
- $[3] = damage;
1949
- $[4] = label;
1950
- $[5] = resistance;
1951
- $[6] = t2;
1952
- $[7] = t3;
1953
- } else t3 = $[7];
1954
- let t4;
1955
- if ($[8] !== label || $[9] !== t3) {
1956
- t4 = /* @__PURE__ */ jsx(Tooltip, {
1963
+ $[4] = damage;
1964
+ $[5] = label;
1965
+ $[6] = resistance;
1966
+ $[7] = t2;
1967
+ $[8] = t3;
1968
+ $[9] = t4;
1969
+ } else t4 = $[9];
1970
+ let t5;
1971
+ if ($[10] !== label || $[11] !== t4) {
1972
+ t5 = /* @__PURE__ */ jsx(Tooltip, {
1957
1973
  label,
1958
- children: t3
1974
+ children: t4
1959
1975
  });
1960
- $[8] = label;
1961
- $[9] = t3;
1962
- $[10] = t4;
1963
- } else t4 = $[10];
1964
- return t4;
1976
+ $[10] = label;
1977
+ $[11] = t4;
1978
+ $[12] = t5;
1979
+ } else t5 = $[12];
1980
+ return t5;
1965
1981
  }
1966
1982
  //#endregion
1967
1983
  //#region src/primitives/CapacitorRing/CapacitorRing.module.css
@@ -2092,23 +2108,15 @@ function FittingWheel(t0) {
2092
2108
  const ship = useFit().ship.type_id;
2093
2109
  const { turret, launcher } = useHardpoints();
2094
2110
  const { show, clear } = usePreview();
2095
- const previewing = useRef(void 0);
2096
2111
  let t2;
2097
2112
  if ($[0] !== show) {
2098
- t2 = (target, edit) => {
2099
- previewing.current = target;
2100
- show(edit);
2101
- };
2113
+ t2 = (target, edit) => show(edit, target);
2102
2114
  $[0] = show;
2103
2115
  $[1] = t2;
2104
2116
  } else t2 = $[1];
2105
2117
  let t3;
2106
2118
  if ($[2] !== clear) {
2107
- t3 = (target_0) => {
2108
- if (previewing.current !== target_0) return;
2109
- previewing.current = void 0;
2110
- clear();
2111
- };
2119
+ t3 = (target_0) => clear(target_0);
2112
2120
  $[2] = clear;
2113
2121
  $[3] = t3;
2114
2122
  } else t3 = $[3];
@@ -2137,7 +2145,7 @@ function FittingWheel(t0) {
2137
2145
  } else t6 = $[10];
2138
2146
  let t7;
2139
2147
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
2140
- t7 = markedRacks.map(_temp$4);
2148
+ t7 = markedRacks.map(_temp$5);
2141
2149
  $[11] = t7;
2142
2150
  } else t7 = $[11];
2143
2151
  let t8;
@@ -2211,7 +2219,7 @@ function FittingWheel(t0) {
2211
2219
  return t13;
2212
2220
  }
2213
2221
  /** What a drop would do, shown while dragging over a target. */
2214
- function _temp$4(rack) {
2222
+ function _temp$5(rack) {
2215
2223
  return /* @__PURE__ */ jsx(WheelRackMarker, { rack }, rack);
2216
2224
  }
2217
2225
  function FittingRack(t0) {
@@ -2239,47 +2247,56 @@ function FittingRack(t0) {
2239
2247
  }
2240
2248
  /** Fits a type dropped in the middle of the wheel, and unfits a fitted item. */
2241
2249
  function FittingCentre(t0) {
2242
- const $ = c(21);
2250
+ const $ = c(25);
2243
2251
  const { dropPreview } = t0;
2244
2252
  const store = useFitStore();
2245
2253
  const fit = useFit();
2246
2254
  const { dragging, end } = useDrag();
2247
2255
  let t1;
2248
- if ($[0] !== fit) {
2249
- t1 = (item) => item !== void 0 && (item.type === "type" || fit.items[item.ref] !== void 0);
2250
- $[0] = fit;
2251
- $[1] = t1;
2252
- } else t1 = $[1];
2253
- const takes = t1;
2256
+ if ($[0] !== dragging || $[1] !== store) {
2257
+ t1 = dragging?.type === "type" && placesSomewhere(store, dragging.typeId);
2258
+ $[0] = dragging;
2259
+ $[1] = store;
2260
+ $[2] = t1;
2261
+ } else t1 = $[2];
2262
+ const fits = t1;
2254
2263
  let t2;
2255
- if ($[2] !== dragging || $[3] !== dropPreview) {
2256
- t2 = () => {
2264
+ if ($[3] !== fit || $[4] !== fits) {
2265
+ t2 = (item) => item !== void 0 && (item.type === "type" ? fits : fit.items[item.ref] !== void 0);
2266
+ $[3] = fit;
2267
+ $[4] = fits;
2268
+ $[5] = t2;
2269
+ } else t2 = $[5];
2270
+ const takes = t2;
2271
+ let t3;
2272
+ if ($[6] !== dragging || $[7] !== dropPreview) {
2273
+ t3 = () => {
2257
2274
  if (dragging?.type !== "type") return;
2258
2275
  const { typeId } = dragging;
2259
2276
  dropPreview.show("centre", (draft) => void draft.fit(typeId));
2260
2277
  };
2261
- $[2] = dragging;
2262
- $[3] = dropPreview;
2263
- $[4] = t2;
2264
- } else t2 = $[4];
2265
- let t3;
2266
- if ($[5] !== dropPreview) {
2267
- t3 = () => dropPreview.hide("centre");
2268
- $[5] = dropPreview;
2269
- $[6] = t3;
2270
- } else t3 = $[6];
2278
+ $[6] = dragging;
2279
+ $[7] = dropPreview;
2280
+ $[8] = t3;
2281
+ } else t3 = $[8];
2271
2282
  let t4;
2272
- if ($[7] !== dragging || $[8] !== takes) {
2273
- t4 = (event) => {
2283
+ if ($[9] !== dropPreview) {
2284
+ t4 = () => dropPreview.hide("centre");
2285
+ $[9] = dropPreview;
2286
+ $[10] = t4;
2287
+ } else t4 = $[10];
2288
+ let t5;
2289
+ if ($[11] !== dragging || $[12] !== takes) {
2290
+ t5 = (event) => {
2274
2291
  if (takes(dragging)) allowDrop(event, dragging);
2275
2292
  };
2276
- $[7] = dragging;
2277
- $[8] = takes;
2278
- $[9] = t4;
2279
- } else t4 = $[9];
2280
- let t5;
2281
- if ($[10] !== dragging || $[11] !== dropPreview || $[12] !== end || $[13] !== store || $[14] !== takes) {
2282
- t5 = (event_0) => {
2293
+ $[11] = dragging;
2294
+ $[12] = takes;
2295
+ $[13] = t5;
2296
+ } else t5 = $[13];
2297
+ let t6;
2298
+ if ($[14] !== dragging || $[15] !== dropPreview || $[16] !== end || $[17] !== store || $[18] !== takes) {
2299
+ t6 = (event_0) => {
2283
2300
  if (!takes(dragging)) return;
2284
2301
  event_0.preventDefault();
2285
2302
  dropPreview.hide("centre");
@@ -2287,30 +2304,30 @@ function FittingCentre(t0) {
2287
2304
  else store.remove(dragging.ref);
2288
2305
  end();
2289
2306
  };
2290
- $[10] = dragging;
2291
- $[11] = dropPreview;
2292
- $[12] = end;
2293
- $[13] = store;
2294
- $[14] = takes;
2295
- $[15] = t5;
2296
- } else t5 = $[15];
2297
- let t6;
2298
- if ($[16] !== t2 || $[17] !== t3 || $[18] !== t4 || $[19] !== t5) {
2299
- t6 = /* @__PURE__ */ jsx("div", {
2307
+ $[14] = dragging;
2308
+ $[15] = dropPreview;
2309
+ $[16] = end;
2310
+ $[17] = store;
2311
+ $[18] = takes;
2312
+ $[19] = t6;
2313
+ } else t6 = $[19];
2314
+ let t7;
2315
+ if ($[20] !== t3 || $[21] !== t4 || $[22] !== t5 || $[23] !== t6) {
2316
+ t7 = /* @__PURE__ */ jsx("div", {
2300
2317
  className: FittingWheel_module_default.centre,
2301
2318
  "data-centre": true,
2302
- onDragEnter: t2,
2303
- onDragLeave: t3,
2304
- onDragOver: t4,
2305
- onDrop: t5
2319
+ onDragEnter: t3,
2320
+ onDragLeave: t4,
2321
+ onDragOver: t5,
2322
+ onDrop: t6
2306
2323
  });
2307
- $[16] = t2;
2308
- $[17] = t3;
2309
- $[18] = t4;
2310
- $[19] = t5;
2311
- $[20] = t6;
2312
- } else t6 = $[20];
2313
- return t6;
2324
+ $[20] = t3;
2325
+ $[21] = t4;
2326
+ $[22] = t5;
2327
+ $[23] = t6;
2328
+ $[24] = t7;
2329
+ } else t7 = $[24];
2330
+ return t7;
2314
2331
  }
2315
2332
  function FittingSlot(t0) {
2316
2333
  const $ = c(80);
@@ -2545,6 +2562,13 @@ function movesTo(fit, ref, rack, index) {
2545
2562
  if (item === void 0 || rack === "subsystem" || item.slot.type !== rack) return false;
2546
2563
  return "index" in item.slot && item.slot.index !== index;
2547
2564
  }
2565
+ function placesSomewhere(store, typeId) {
2566
+ let placed = false;
2567
+ store.preview((draft) => {
2568
+ placed = draft.fit(typeId) !== void 0;
2569
+ });
2570
+ return placed;
2571
+ }
2548
2572
  function allowDrop(event, dragging) {
2549
2573
  event.preventDefault();
2550
2574
  event.dataTransfer.dropEffect = dragging.type === "type" ? "copy" : "move";
@@ -2579,9 +2603,449 @@ function FittingGauge(t0) {
2579
2603
  return t4;
2580
2604
  }
2581
2605
  //#endregion
2606
+ //#region src/components/ShipStatistics/AttributeTooltip.tsx
2607
+ /** What EVE shows when hovering the attribute; its name, for one without. */
2608
+ function AttributeTooltip(t0) {
2609
+ const $ = c(7);
2610
+ const { attribute } = t0;
2611
+ const sde = useSde();
2612
+ const tooltip = useAttributeTooltip(attribute);
2613
+ let t1;
2614
+ if ($[0] !== attribute || $[1] !== sde || $[2] !== tooltip?.title) {
2615
+ t1 = tooltip?.title ?? sde.attribute(sde.attributeId(attribute) ?? 0)?.displayName ?? attribute;
2616
+ $[0] = attribute;
2617
+ $[1] = sde;
2618
+ $[2] = tooltip?.title;
2619
+ $[3] = t1;
2620
+ } else t1 = $[3];
2621
+ const title = t1;
2622
+ const t2 = tooltip?.description;
2623
+ let t3;
2624
+ if ($[4] !== t2 || $[5] !== title) {
2625
+ t3 = /* @__PURE__ */ jsx(TooltipText, {
2626
+ title,
2627
+ description: t2
2628
+ });
2629
+ $[4] = t2;
2630
+ $[5] = title;
2631
+ $[6] = t3;
2632
+ } else t3 = $[6];
2633
+ return t3;
2634
+ }
2635
+ //#endregion
2636
+ //#region src/components/FittingWindow/BayContents.module.css
2637
+ var BayContents_module_default = {
2638
+ "activeDrones": "gVdevq_activeDrones",
2639
+ "box": "gVdevq_box",
2640
+ "count": "gVdevq_count",
2641
+ "icon": "gVdevq_icon",
2642
+ "list": "gVdevq_list",
2643
+ "middle": "gVdevq_middle",
2644
+ "name": "gVdevq_name",
2645
+ "panel": "gVdevq_panel",
2646
+ "quantity": "gVdevq_quantity",
2647
+ "remove": "gVdevq_remove",
2648
+ "removeAll": "gVdevq_removeAll",
2649
+ "row": "gVdevq_row",
2650
+ "selection": "gVdevq_selection",
2651
+ "steps": "gVdevq_steps",
2652
+ "times": "gVdevq_times"
2653
+ };
2654
+ //#endregion
2655
+ //#region src/components/FittingWindow/BayContents.tsx
2656
+ const emptyText = {
2657
+ cargo: "No Cargo Items Simulated",
2658
+ droneBay: "No Drones Simulated"
2659
+ };
2660
+ /** EVE's list of what is in a bay, as a popover anchored to `--bay-anchor`. */
2661
+ function BayContents(t0) {
2662
+ const $ = c(26);
2663
+ const { id, bay, label } = t0;
2664
+ const store = useFitStore();
2665
+ const contents = useBayContents(bay);
2666
+ const panel = useRef(null);
2667
+ const drones = bay === "droneBay";
2668
+ const { stats } = useSnapshot();
2669
+ let t1;
2670
+ if ($[0] !== stats.character) {
2671
+ t1 = stats.character.get("maxActiveDrones") ?? 0;
2672
+ $[0] = stats.character;
2673
+ $[1] = t1;
2674
+ } else t1 = $[1];
2675
+ const maxActive = t1;
2676
+ if (contents.length === 0) {
2677
+ const t2 = emptyText[bay];
2678
+ let t3;
2679
+ if ($[2] !== id || $[3] !== t2) {
2680
+ t3 = /* @__PURE__ */ jsx("div", {
2681
+ id,
2682
+ className: BayContents_module_default.panel,
2683
+ popover: "auto",
2684
+ "data-empty": true,
2685
+ children: t2
2686
+ });
2687
+ $[2] = id;
2688
+ $[3] = t2;
2689
+ $[4] = t3;
2690
+ } else t3 = $[4];
2691
+ return t3;
2692
+ }
2693
+ const t2 = drones || void 0;
2694
+ let t3;
2695
+ if ($[5] !== drones || $[6] !== maxActive || $[7] !== stats.ship) {
2696
+ t3 = drones && /* @__PURE__ */ jsxs("div", {
2697
+ className: BayContents_module_default.activeDrones,
2698
+ children: [
2699
+ "Active drones: ",
2700
+ stats.ship.get("droneActive") ?? 0,
2701
+ " / ",
2702
+ maxActive
2703
+ ]
2704
+ });
2705
+ $[5] = drones;
2706
+ $[6] = maxActive;
2707
+ $[7] = stats.ship;
2708
+ $[8] = t3;
2709
+ } else t3 = $[8];
2710
+ let t4;
2711
+ if ($[9] !== contents || $[10] !== drones || $[11] !== maxActive || $[12] !== store) {
2712
+ t4 = contents.map((content) => {
2713
+ const { type, quantity, refs } = content;
2714
+ return /* @__PURE__ */ jsxs("li", {
2715
+ className: BayContents_module_default.row,
2716
+ children: [
2717
+ /* @__PURE__ */ jsx(Quantity, {
2718
+ name: type.name,
2719
+ value: quantity,
2720
+ onChange: (value) => drones ? store.setDroneQuantity(type.id, value) : store.setCargoQuantity(type.id, value)
2721
+ }),
2722
+ /* @__PURE__ */ jsx("span", {
2723
+ className: BayContents_module_default.icon,
2724
+ children: /* @__PURE__ */ jsx(TypeIcon, { typeId: type.id })
2725
+ }),
2726
+ /* @__PURE__ */ jsxs("span", {
2727
+ className: BayContents_module_default.middle,
2728
+ children: [/* @__PURE__ */ jsx("span", {
2729
+ className: BayContents_module_default.name,
2730
+ children: type.name
2731
+ }), drones && /* @__PURE__ */ jsx(DroneSelection, {
2732
+ content,
2733
+ max: maxActive
2734
+ })]
2735
+ }),
2736
+ /* @__PURE__ */ jsx("button", {
2737
+ type: "button",
2738
+ className: BayContents_module_default.remove,
2739
+ "aria-label": `Remove ${type.name}`,
2740
+ onClick: (event) => {
2741
+ const row = event.currentTarget.closest("li");
2742
+ const next = row.nextElementSibling ?? row.previousElementSibling;
2743
+ store.remove(...refs);
2744
+ if (next === null) panel.current?.hidePopover();
2745
+ else next.querySelector(`.${BayContents_module_default.remove}`)?.focus();
2746
+ },
2747
+ children: /* @__PURE__ */ jsx(Icon, { name: "close" })
2748
+ })
2749
+ ]
2750
+ }, type.id);
2751
+ });
2752
+ $[9] = contents;
2753
+ $[10] = drones;
2754
+ $[11] = maxActive;
2755
+ $[12] = store;
2756
+ $[13] = t4;
2757
+ } else t4 = $[13];
2758
+ let t5;
2759
+ if ($[14] !== label || $[15] !== t4) {
2760
+ t5 = /* @__PURE__ */ jsx("ul", {
2761
+ className: BayContents_module_default.list,
2762
+ "aria-label": label,
2763
+ children: t4
2764
+ });
2765
+ $[14] = label;
2766
+ $[15] = t4;
2767
+ $[16] = t5;
2768
+ } else t5 = $[16];
2769
+ let t6;
2770
+ if ($[17] !== contents || $[18] !== store) {
2771
+ t6 = /* @__PURE__ */ jsx("button", {
2772
+ type: "button",
2773
+ className: BayContents_module_default.removeAll,
2774
+ onClick: () => {
2775
+ store.remove(...contents.flatMap(_temp$4));
2776
+ panel.current?.hidePopover();
2777
+ },
2778
+ children: "Remove All"
2779
+ });
2780
+ $[17] = contents;
2781
+ $[18] = store;
2782
+ $[19] = t6;
2783
+ } else t6 = $[19];
2784
+ let t7;
2785
+ if ($[20] !== id || $[21] !== t2 || $[22] !== t3 || $[23] !== t5 || $[24] !== t6) {
2786
+ t7 = /* @__PURE__ */ jsxs("div", {
2787
+ ref: panel,
2788
+ id,
2789
+ className: BayContents_module_default.panel,
2790
+ popover: "auto",
2791
+ "data-drones": t2,
2792
+ children: [
2793
+ t3,
2794
+ t5,
2795
+ t6
2796
+ ]
2797
+ });
2798
+ $[20] = id;
2799
+ $[21] = t2;
2800
+ $[22] = t3;
2801
+ $[23] = t5;
2802
+ $[24] = t6;
2803
+ $[25] = t7;
2804
+ } else t7 = $[25];
2805
+ return t7;
2806
+ }
2807
+ /** One box per drone the character can launch. */
2808
+ function _temp$4(t0) {
2809
+ const { refs: refs_0 } = t0;
2810
+ return refs_0;
2811
+ }
2812
+ function DroneSelection(t0) {
2813
+ const $ = c(16);
2814
+ const { content: t1, max } = t0;
2815
+ const { type, quantity, active } = t1;
2816
+ const store = useFitStore();
2817
+ const room = useDroneRoom(type);
2818
+ const t2 = `Active ${type.name}`;
2819
+ let t3;
2820
+ if ($[0] !== active || $[1] !== max || $[2] !== quantity || $[3] !== room || $[4] !== store || $[5] !== type.id) {
2821
+ let t4;
2822
+ if ($[7] !== active || $[8] !== quantity || $[9] !== room || $[10] !== store || $[11] !== type.id) {
2823
+ t4 = (_, index) => {
2824
+ const count = index + 1;
2825
+ const state = count <= active ? "active" : count > quantity ? "none" : count <= active + room ? "open" : "over";
2826
+ return /* @__PURE__ */ jsx("button", {
2827
+ type: "button",
2828
+ className: BayContents_module_default.box,
2829
+ "aria-label": `${count} active`,
2830
+ "aria-pressed": count === active,
2831
+ "data-state": state,
2832
+ disabled: state === "over" || state === "none",
2833
+ onClick: () => store.setActiveDrones(type.id, count === active ? count - 1 : count),
2834
+ children: count <= active && "×"
2835
+ }, count);
2836
+ };
2837
+ $[7] = active;
2838
+ $[8] = quantity;
2839
+ $[9] = room;
2840
+ $[10] = store;
2841
+ $[11] = type.id;
2842
+ $[12] = t4;
2843
+ } else t4 = $[12];
2844
+ t3 = Array.from({ length: Math.max(max, active) }, t4);
2845
+ $[0] = active;
2846
+ $[1] = max;
2847
+ $[2] = quantity;
2848
+ $[3] = room;
2849
+ $[4] = store;
2850
+ $[5] = type.id;
2851
+ $[6] = t3;
2852
+ } else t3 = $[6];
2853
+ let t4;
2854
+ if ($[13] !== t2 || $[14] !== t3) {
2855
+ t4 = /* @__PURE__ */ jsxs("span", {
2856
+ className: BayContents_module_default.selection,
2857
+ role: "group",
2858
+ "aria-label": t2,
2859
+ children: ["Selected:", t3]
2860
+ });
2861
+ $[13] = t2;
2862
+ $[14] = t3;
2863
+ $[15] = t4;
2864
+ } else t4 = $[15];
2865
+ return t4;
2866
+ }
2867
+ /** EVE's count of a row, which turns into a spinner on hover and focus. */
2868
+ function Quantity(t0) {
2869
+ const $ = c(43);
2870
+ const { name, value, onChange } = t0;
2871
+ const [draft, setDraft] = useState();
2872
+ const cancelled = useRef(false);
2873
+ let t1;
2874
+ if ($[0] !== draft || $[1] !== value) {
2875
+ t1 = draft !== void 0 && /^\d+$/.test(draft) ? Number(draft) : value;
2876
+ $[0] = draft;
2877
+ $[1] = value;
2878
+ $[2] = t1;
2879
+ } else t1 = $[2];
2880
+ const current = t1;
2881
+ const shown = draft ?? String(value);
2882
+ let t2;
2883
+ if ($[3] !== onChange || $[4] !== value) {
2884
+ t2 = (next) => {
2885
+ setDraft(void 0);
2886
+ if (Number.isSafeInteger(next) && next >= 1 && next !== value) onChange(next);
2887
+ };
2888
+ $[3] = onChange;
2889
+ $[4] = value;
2890
+ $[5] = t2;
2891
+ } else t2 = $[5];
2892
+ const set = t2;
2893
+ let t3;
2894
+ if ($[6] !== current || $[7] !== set) {
2895
+ t3 = (event) => {
2896
+ if (event.key === "Enter") set(current);
2897
+ if (event.key === "Escape") {
2898
+ cancelled.current = true;
2899
+ setDraft(void 0);
2900
+ }
2901
+ if (event.key === "ArrowUp" || event.key === "ArrowDown") {
2902
+ event.preventDefault();
2903
+ set(current + (event.key === "ArrowUp" ? 1 : -1));
2904
+ }
2905
+ };
2906
+ $[6] = current;
2907
+ $[7] = set;
2908
+ $[8] = t3;
2909
+ } else t3 = $[8];
2910
+ const onKeyDown = t3;
2911
+ const t4 = `${Math.max(1, shown.length)}ch`;
2912
+ let t5;
2913
+ if ($[9] !== t4) {
2914
+ t5 = { width: t4 };
2915
+ $[9] = t4;
2916
+ $[10] = t5;
2917
+ } else t5 = $[10];
2918
+ const t6 = `Number of ${name}`;
2919
+ let t7;
2920
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
2921
+ t7 = (event_0) => {
2922
+ cancelled.current = false;
2923
+ setDraft(event_0.target.value);
2924
+ };
2925
+ $[11] = t7;
2926
+ } else t7 = $[11];
2927
+ let t8;
2928
+ if ($[12] !== current || $[13] !== draft || $[14] !== set) {
2929
+ t8 = () => {
2930
+ if (draft !== void 0 && !cancelled.current) set(current);
2931
+ else setDraft(void 0);
2932
+ };
2933
+ $[12] = current;
2934
+ $[13] = draft;
2935
+ $[14] = set;
2936
+ $[15] = t8;
2937
+ } else t8 = $[15];
2938
+ let t9;
2939
+ if ($[16] !== onKeyDown || $[17] !== shown || $[18] !== t5 || $[19] !== t6 || $[20] !== t8) {
2940
+ t9 = /* @__PURE__ */ jsx("input", {
2941
+ type: "number",
2942
+ className: BayContents_module_default.count,
2943
+ style: t5,
2944
+ "aria-label": t6,
2945
+ min: 1,
2946
+ value: shown,
2947
+ onChange: t7,
2948
+ onKeyDown,
2949
+ onBlur: t8
2950
+ });
2951
+ $[16] = onKeyDown;
2952
+ $[17] = shown;
2953
+ $[18] = t5;
2954
+ $[19] = t6;
2955
+ $[20] = t8;
2956
+ $[21] = t9;
2957
+ } else t9 = $[21];
2958
+ let t10;
2959
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
2960
+ t10 = /* @__PURE__ */ jsx("span", {
2961
+ className: BayContents_module_default.times,
2962
+ children: "x"
2963
+ });
2964
+ $[22] = t10;
2965
+ } else t10 = $[22];
2966
+ const t11 = `One more ${name}`;
2967
+ let t12;
2968
+ if ($[23] !== current || $[24] !== set) {
2969
+ t12 = () => set(current + 1);
2970
+ $[23] = current;
2971
+ $[24] = set;
2972
+ $[25] = t12;
2973
+ } else t12 = $[25];
2974
+ let t13;
2975
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
2976
+ t13 = /* @__PURE__ */ jsx(Icon, { name: "arrow-up" });
2977
+ $[26] = t13;
2978
+ } else t13 = $[26];
2979
+ let t14;
2980
+ if ($[27] !== t11 || $[28] !== t12) {
2981
+ t14 = /* @__PURE__ */ jsx("button", {
2982
+ type: "button",
2983
+ tabIndex: -1,
2984
+ "aria-label": t11,
2985
+ onClick: t12,
2986
+ children: t13
2987
+ });
2988
+ $[27] = t11;
2989
+ $[28] = t12;
2990
+ $[29] = t14;
2991
+ } else t14 = $[29];
2992
+ const t15 = `One fewer ${name}`;
2993
+ let t16;
2994
+ if ($[30] !== current || $[31] !== set) {
2995
+ t16 = () => set(current - 1);
2996
+ $[30] = current;
2997
+ $[31] = set;
2998
+ $[32] = t16;
2999
+ } else t16 = $[32];
3000
+ let t17;
3001
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
3002
+ t17 = /* @__PURE__ */ jsx(Icon, { name: "arrow-down" });
3003
+ $[33] = t17;
3004
+ } else t17 = $[33];
3005
+ let t18;
3006
+ if ($[34] !== t15 || $[35] !== t16) {
3007
+ t18 = /* @__PURE__ */ jsx("button", {
3008
+ type: "button",
3009
+ tabIndex: -1,
3010
+ "aria-label": t15,
3011
+ onClick: t16,
3012
+ children: t17
3013
+ });
3014
+ $[34] = t15;
3015
+ $[35] = t16;
3016
+ $[36] = t18;
3017
+ } else t18 = $[36];
3018
+ let t19;
3019
+ if ($[37] !== t14 || $[38] !== t18) {
3020
+ t19 = /* @__PURE__ */ jsxs("span", {
3021
+ className: BayContents_module_default.steps,
3022
+ children: [t14, t18]
3023
+ });
3024
+ $[37] = t14;
3025
+ $[38] = t18;
3026
+ $[39] = t19;
3027
+ } else t19 = $[39];
3028
+ let t20;
3029
+ if ($[40] !== t19 || $[41] !== t9) {
3030
+ t20 = /* @__PURE__ */ jsxs("span", {
3031
+ className: BayContents_module_default.quantity,
3032
+ children: [
3033
+ t9,
3034
+ t10,
3035
+ t19
3036
+ ]
3037
+ });
3038
+ $[40] = t19;
3039
+ $[41] = t9;
3040
+ $[42] = t20;
3041
+ } else t20 = $[42];
3042
+ return t20;
3043
+ }
3044
+ //#endregion
2582
3045
  //#region src/components/FittingWindow/FittingWindow.module.css
2583
3046
  var FittingWindow_module_default = {
2584
3047
  "bay": "L9t91q_bay",
3048
+ "bayAnchor": "L9t91q_bayAnchor",
2585
3049
  "bays": "L9t91q_bays",
2586
3050
  "browser": "L9t91q_browser",
2587
3051
  "count": "L9t91q_count",
@@ -2994,160 +3458,318 @@ function NotImplementedButton(t0) {
2994
3458
  return t4;
2995
3459
  }
2996
3460
  function Bay(t0) {
2997
- const $ = c(21);
3461
+ const $ = c(36);
2998
3462
  const { bay, icon, label } = t0;
2999
3463
  const { used, total } = useBayUsage(bay);
3000
- const t1 = used > total || void 0;
3001
- let t2;
3002
- if ($[0] !== icon) {
3003
- t2 = /* @__PURE__ */ jsx(Icon, { name: icon });
3004
- $[0] = icon;
3005
- $[1] = t2;
3006
- } else t2 = $[1];
3007
- let t3;
3008
- if ($[2] !== used) {
3009
- t3 = oneDecimal.format(used);
3010
- $[2] = used;
3011
- $[3] = t3;
3012
- } else t3 = $[3];
3013
- let t4;
3014
- if ($[4] !== t3) {
3015
- t4 = /* @__PURE__ */ jsx("span", {
3464
+ const id = useId();
3465
+ const drop = useBayDrop(bay);
3466
+ let t1;
3467
+ if ($[0] !== id) {
3468
+ let t2;
3469
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
3470
+ t2 = /[^\w-]/g;
3471
+ $[2] = t2;
3472
+ } else t2 = $[2];
3473
+ t1 = id.replace(t2, "");
3474
+ $[0] = id;
3475
+ $[1] = t1;
3476
+ } else t1 = $[1];
3477
+ const t2 = `--bay-${t1}`;
3478
+ let t3;
3479
+ if ($[3] !== t2) {
3480
+ t3 = { "--bay-anchor": t2 };
3481
+ $[3] = t2;
3482
+ $[4] = t3;
3483
+ } else t3 = $[4];
3484
+ const t4 = t3;
3485
+ const t5 = used > total || void 0;
3486
+ let t6;
3487
+ if ($[5] !== icon) {
3488
+ t6 = /* @__PURE__ */ jsx(Icon, { name: icon });
3489
+ $[5] = icon;
3490
+ $[6] = t6;
3491
+ } else t6 = $[6];
3492
+ let t7;
3493
+ if ($[7] !== used) {
3494
+ t7 = oneDecimal.format(used);
3495
+ $[7] = used;
3496
+ $[8] = t7;
3497
+ } else t7 = $[8];
3498
+ let t8;
3499
+ if ($[9] !== t7) {
3500
+ t8 = /* @__PURE__ */ jsx("span", {
3016
3501
  className: FittingWindow_module_default.used,
3017
- children: t3
3502
+ children: t7
3018
3503
  });
3019
- $[4] = t3;
3020
- $[5] = t4;
3021
- } else t4 = $[5];
3022
- let t5;
3023
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
3024
- t5 = /* @__PURE__ */ jsx("span", {
3504
+ $[9] = t7;
3505
+ $[10] = t8;
3506
+ } else t8 = $[10];
3507
+ let t9;
3508
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
3509
+ t9 = /* @__PURE__ */ jsx("span", {
3025
3510
  className: FittingWindow_module_default.slash,
3026
3511
  children: "/"
3027
3512
  });
3028
- $[6] = t5;
3029
- } else t5 = $[6];
3030
- let t6;
3031
- if ($[7] !== total) {
3032
- t6 = oneDecimal.format(total);
3033
- $[7] = total;
3034
- $[8] = t6;
3035
- } else t6 = $[8];
3036
- let t7;
3037
- if ($[9] !== t6) {
3038
- t7 = /* @__PURE__ */ jsx("span", {
3513
+ $[11] = t9;
3514
+ } else t9 = $[11];
3515
+ let t10;
3516
+ if ($[12] !== total) {
3517
+ t10 = oneDecimal.format(total);
3518
+ $[12] = total;
3519
+ $[13] = t10;
3520
+ } else t10 = $[13];
3521
+ let t11;
3522
+ if ($[14] !== t10) {
3523
+ t11 = /* @__PURE__ */ jsx("span", {
3039
3524
  className: FittingWindow_module_default.total,
3040
- children: t6
3525
+ children: t10
3041
3526
  });
3042
- $[9] = t6;
3043
- $[10] = t7;
3044
- } else t7 = $[10];
3045
- let t8;
3046
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
3047
- t8 = /* @__PURE__ */ jsx("span", {
3527
+ $[14] = t10;
3528
+ $[15] = t11;
3529
+ } else t11 = $[15];
3530
+ let t12;
3531
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
3532
+ t12 = /* @__PURE__ */ jsx("span", {
3048
3533
  className: FittingWindow_module_default.unit,
3049
3534
  children: "m3"
3050
3535
  });
3051
- $[11] = t8;
3052
- } else t8 = $[11];
3053
- let t9;
3054
- if ($[12] !== label || $[13] !== t1 || $[14] !== t2 || $[15] !== t4 || $[16] !== t7) {
3055
- t9 = /* @__PURE__ */ jsxs("div", {
3536
+ $[16] = t12;
3537
+ } else t12 = $[16];
3538
+ let t13;
3539
+ if ($[17] !== drop || $[18] !== id || $[19] !== label || $[20] !== t11 || $[21] !== t5 || $[22] !== t6 || $[23] !== t8) {
3540
+ t13 = /* @__PURE__ */ jsxs("button", {
3541
+ type: "button",
3056
3542
  className: FittingWindow_module_default.bay,
3057
- role: "group",
3058
3543
  "aria-label": label,
3059
- "data-over": t1,
3544
+ popoverTarget: id,
3545
+ "data-over": t5,
3546
+ ...drop,
3060
3547
  children: [
3061
- t2,
3062
- t4,
3063
- t5,
3064
- t7,
3065
- t8
3548
+ t6,
3549
+ t8,
3550
+ t9,
3551
+ t11,
3552
+ t12
3066
3553
  ]
3067
3554
  });
3068
- $[12] = label;
3069
- $[13] = t1;
3070
- $[14] = t2;
3071
- $[15] = t4;
3072
- $[16] = t7;
3073
- $[17] = t9;
3074
- } else t9 = $[17];
3075
- let t10;
3076
- if ($[18] !== label || $[19] !== t9) {
3077
- t10 = /* @__PURE__ */ jsx(Tooltip, {
3555
+ $[17] = drop;
3556
+ $[18] = id;
3557
+ $[19] = label;
3558
+ $[20] = t11;
3559
+ $[21] = t5;
3560
+ $[22] = t6;
3561
+ $[23] = t8;
3562
+ $[24] = t13;
3563
+ } else t13 = $[24];
3564
+ let t14;
3565
+ if ($[25] !== label || $[26] !== t13) {
3566
+ t14 = /* @__PURE__ */ jsx(Tooltip, {
3078
3567
  label,
3079
- children: t9
3568
+ children: t13
3080
3569
  });
3081
- $[18] = label;
3082
- $[19] = t9;
3083
- $[20] = t10;
3084
- } else t10 = $[20];
3085
- return t10;
3570
+ $[25] = label;
3571
+ $[26] = t13;
3572
+ $[27] = t14;
3573
+ } else t14 = $[27];
3574
+ let t15;
3575
+ if ($[28] !== bay || $[29] !== id || $[30] !== label) {
3576
+ t15 = /* @__PURE__ */ jsx(BayContents, {
3577
+ id,
3578
+ bay,
3579
+ label
3580
+ });
3581
+ $[28] = bay;
3582
+ $[29] = id;
3583
+ $[30] = label;
3584
+ $[31] = t15;
3585
+ } else t15 = $[31];
3586
+ let t16;
3587
+ if ($[32] !== t14 || $[33] !== t15 || $[34] !== t4) {
3588
+ t16 = /* @__PURE__ */ jsxs("div", {
3589
+ className: FittingWindow_module_default.bayAnchor,
3590
+ style: t4,
3591
+ children: [t14, t15]
3592
+ });
3593
+ $[32] = t14;
3594
+ $[33] = t15;
3595
+ $[34] = t4;
3596
+ $[35] = t16;
3597
+ } else t16 = $[35];
3598
+ return t16;
3599
+ }
3600
+ const baySlots = {
3601
+ cargo: { type: "cargo" },
3602
+ droneBay: { type: "drone_bay" }
3603
+ };
3604
+ /** Puts a type dragged onto a bay in it: anything in the cargo, drones in the drone bay. */
3605
+ function useBayDrop(bay) {
3606
+ const $ = c(29);
3607
+ const store = useFitStore();
3608
+ const sde = useSde();
3609
+ const placement = usePlacement();
3610
+ const canFit = useCanFit();
3611
+ const { dragging, end } = useDrag();
3612
+ const { show, clear } = usePreview();
3613
+ const slot = baySlots[bay];
3614
+ let t0;
3615
+ let type;
3616
+ if ($[0] !== bay || $[1] !== canFit || $[2] !== dragging || $[3] !== placement || $[4] !== sde) {
3617
+ type = dragging?.type === "type" ? sde.type(dragging.typeId) : void 0;
3618
+ t0 = type !== void 0 && (bay === "cargo" ? placement(type) !== void 0 : placement(type)?.type === "drone_bay" && canFit(type));
3619
+ $[0] = bay;
3620
+ $[1] = canFit;
3621
+ $[2] = dragging;
3622
+ $[3] = placement;
3623
+ $[4] = sde;
3624
+ $[5] = t0;
3625
+ $[6] = type;
3626
+ } else {
3627
+ t0 = $[5];
3628
+ type = $[6];
3629
+ }
3630
+ const taken = t0 ? type : void 0;
3631
+ const target = `bay-${bay}`;
3632
+ let t1;
3633
+ if ($[7] !== show || $[8] !== slot || $[9] !== taken || $[10] !== target) {
3634
+ t1 = () => {
3635
+ if (taken) show((draft) => void draft.fit(taken.id, slot), target);
3636
+ };
3637
+ $[7] = show;
3638
+ $[8] = slot;
3639
+ $[9] = taken;
3640
+ $[10] = target;
3641
+ $[11] = t1;
3642
+ } else t1 = $[11];
3643
+ let t2;
3644
+ if ($[12] !== clear || $[13] !== target) {
3645
+ t2 = () => clear(target);
3646
+ $[12] = clear;
3647
+ $[13] = target;
3648
+ $[14] = t2;
3649
+ } else t2 = $[14];
3650
+ let t3;
3651
+ if ($[15] !== taken) {
3652
+ t3 = (event) => {
3653
+ if (!taken) return;
3654
+ event.preventDefault();
3655
+ event.dataTransfer.dropEffect = "copy";
3656
+ };
3657
+ $[15] = taken;
3658
+ $[16] = t3;
3659
+ } else t3 = $[16];
3660
+ let t4;
3661
+ if ($[17] !== clear || $[18] !== end || $[19] !== slot || $[20] !== store || $[21] !== taken || $[22] !== target) {
3662
+ t4 = (event_0) => {
3663
+ if (!taken) return;
3664
+ event_0.preventDefault();
3665
+ clear(target);
3666
+ store.fit(taken.id, slot);
3667
+ end();
3668
+ };
3669
+ $[17] = clear;
3670
+ $[18] = end;
3671
+ $[19] = slot;
3672
+ $[20] = store;
3673
+ $[21] = taken;
3674
+ $[22] = target;
3675
+ $[23] = t4;
3676
+ } else t4 = $[23];
3677
+ let t5;
3678
+ if ($[24] !== t1 || $[25] !== t2 || $[26] !== t3 || $[27] !== t4) {
3679
+ t5 = {
3680
+ onDragEnter: t1,
3681
+ onDragLeave: t2,
3682
+ onDragOver: t3,
3683
+ onDrop: t4
3684
+ };
3685
+ $[24] = t1;
3686
+ $[25] = t2;
3687
+ $[26] = t3;
3688
+ $[27] = t4;
3689
+ $[28] = t5;
3690
+ } else t5 = $[28];
3691
+ return t5;
3086
3692
  }
3087
3693
  function Resource(t0) {
3088
- const $ = c(16);
3694
+ const $ = c(21);
3089
3695
  const { title, free, output } = t0;
3090
3696
  const left = useAttribute(free);
3091
3697
  const total = useAttribute(output).value ?? 0;
3092
3698
  const value = left.value ?? 0;
3093
- const t1 = value < 0 || void 0;
3094
- const t2 = left.change;
3095
- let t3;
3096
- if ($[0] !== title) {
3097
- t3 = /* @__PURE__ */ jsx("span", {
3699
+ let t1;
3700
+ if ($[0] !== output) {
3701
+ t1 = /* @__PURE__ */ jsx(AttributeTooltip, { attribute: output });
3702
+ $[0] = output;
3703
+ $[1] = t1;
3704
+ } else t1 = $[1];
3705
+ const t2 = value < 0 || void 0;
3706
+ const t3 = left.change;
3707
+ let t4;
3708
+ if ($[2] !== title) {
3709
+ t4 = /* @__PURE__ */ jsx("span", {
3098
3710
  className: FittingWindow_module_default.title,
3099
3711
  children: title
3100
3712
  });
3101
- $[0] = title;
3102
- $[1] = t3;
3103
- } else t3 = $[1];
3104
- let t4;
3105
- if ($[2] !== value) {
3106
- t4 = oneDecimal.format(value);
3107
- $[2] = value;
3713
+ $[2] = title;
3108
3714
  $[3] = t4;
3109
3715
  } else t4 = $[3];
3110
3716
  let t5;
3111
- if ($[4] !== t4) {
3112
- t5 = /* @__PURE__ */ jsx("span", {
3113
- className: FittingWindow_module_default.free,
3114
- children: t4
3115
- });
3116
- $[4] = t4;
3717
+ if ($[4] !== value) {
3718
+ t5 = oneDecimal.format(value);
3719
+ $[4] = value;
3117
3720
  $[5] = t5;
3118
3721
  } else t5 = $[5];
3119
3722
  let t6;
3120
- if ($[6] !== total) {
3121
- t6 = oneDecimal.format(total);
3122
- $[6] = total;
3723
+ if ($[6] !== t5) {
3724
+ t6 = /* @__PURE__ */ jsx("span", {
3725
+ className: FittingWindow_module_default.free,
3726
+ children: t5
3727
+ });
3728
+ $[6] = t5;
3123
3729
  $[7] = t6;
3124
3730
  } else t6 = $[7];
3125
3731
  let t7;
3126
- if ($[8] !== t5 || $[9] !== t6) {
3127
- t7 = /* @__PURE__ */ jsxs("span", { children: [
3128
- t5,
3732
+ if ($[8] !== total) {
3733
+ t7 = oneDecimal.format(total);
3734
+ $[8] = total;
3735
+ $[9] = t7;
3736
+ } else t7 = $[9];
3737
+ let t8;
3738
+ if ($[10] !== t6 || $[11] !== t7) {
3739
+ t8 = /* @__PURE__ */ jsxs("span", { children: [
3740
+ t6,
3129
3741
  "/",
3130
- t6
3742
+ t7
3131
3743
  ] });
3132
- $[8] = t5;
3133
- $[9] = t6;
3134
- $[10] = t7;
3135
- } else t7 = $[10];
3136
- let t8;
3137
- if ($[11] !== left.change || $[12] !== t1 || $[13] !== t3 || $[14] !== t7) {
3138
- t8 = /* @__PURE__ */ jsxs("div", {
3744
+ $[10] = t6;
3745
+ $[11] = t7;
3746
+ $[12] = t8;
3747
+ } else t8 = $[12];
3748
+ let t9;
3749
+ if ($[13] !== left.change || $[14] !== t2 || $[15] !== t4 || $[16] !== t8) {
3750
+ t9 = /* @__PURE__ */ jsxs("div", {
3139
3751
  className: FittingWindow_module_default.resource,
3140
- "data-over": t1,
3141
- "data-change": t2,
3142
- children: [t3, t7]
3752
+ "data-over": t2,
3753
+ "data-change": t3,
3754
+ children: [t4, t8]
3143
3755
  });
3144
- $[11] = left.change;
3145
- $[12] = t1;
3146
- $[13] = t3;
3147
- $[14] = t7;
3148
- $[15] = t8;
3149
- } else t8 = $[15];
3150
- return t8;
3756
+ $[13] = left.change;
3757
+ $[14] = t2;
3758
+ $[15] = t4;
3759
+ $[16] = t8;
3760
+ $[17] = t9;
3761
+ } else t9 = $[17];
3762
+ let t10;
3763
+ if ($[18] !== t1 || $[19] !== t9) {
3764
+ t10 = /* @__PURE__ */ jsx(Tooltip, {
3765
+ label: t1,
3766
+ children: t9
3767
+ });
3768
+ $[18] = t1;
3769
+ $[19] = t9;
3770
+ $[20] = t10;
3771
+ } else t10 = $[20];
3772
+ return t10;
3151
3773
  }
3152
3774
  function SimulationHistory() {
3153
3775
  const $ = c(4);
@@ -3175,6 +3797,7 @@ var ItemBrowser_module_default = {
3175
3797
  "count": "xFSZwa_count",
3176
3798
  "counts": "xFSZwa_counts",
3177
3799
  "dragImage": "xFSZwa_dragImage",
3800
+ "empty": "xFSZwa_empty",
3178
3801
  "field": "xFSZwa_field",
3179
3802
  "filters": "xFSZwa_filters",
3180
3803
  "flyable": "xFSZwa_flyable",
@@ -3438,8 +4061,8 @@ function TypeLeaf(t0) {
3438
4061
  }
3439
4062
  /** The types, then their faction, officer and deadspace folders. */
3440
4063
  function TypeLeaves(t0) {
3441
- const $ = c(21);
3442
- const { sorted, open, actions, icon } = t0;
4064
+ const $ = c(19);
4065
+ const { sorted, actions, icon } = t0;
3443
4066
  const images = useImages();
3444
4067
  let t1;
3445
4068
  if ($[0] !== actions || $[1] !== icon || $[2] !== sorted.types) {
@@ -3461,15 +4084,14 @@ function TypeLeaves(t0) {
3461
4084
  $[3] = t1;
3462
4085
  } else t1 = $[3];
3463
4086
  let t2;
3464
- if ($[7] !== actions || $[8] !== icon || $[9] !== images || $[10] !== open || $[11] !== sorted.folders) {
4087
+ if ($[7] !== actions || $[8] !== icon || $[9] !== images || $[10] !== sorted.folders) {
3465
4088
  let t3;
3466
- if ($[13] !== actions || $[14] !== icon || $[15] !== images || $[16] !== open) {
4089
+ if ($[12] !== actions || $[13] !== icon || $[14] !== images) {
3467
4090
  t3 = (t4) => {
3468
4091
  const { folder, types } = t4;
3469
4092
  return /* @__PURE__ */ jsx(TreeGroup, {
3470
4093
  label: folders[folder].label,
3471
4094
  icon: images.metaGroupIcon(folders[folder].metaGroupId),
3472
- defaultOpen: open,
3473
4095
  children: () => types.map((type_0) => /* @__PURE__ */ jsx(TypeLeaf, {
3474
4096
  type: type_0,
3475
4097
  actions,
@@ -3477,222 +4099,301 @@ function TypeLeaves(t0) {
3477
4099
  }, type_0.id))
3478
4100
  }, folder);
3479
4101
  };
3480
- $[13] = actions;
3481
- $[14] = icon;
3482
- $[15] = images;
3483
- $[16] = open;
3484
- $[17] = t3;
3485
- } else t3 = $[17];
4102
+ $[12] = actions;
4103
+ $[13] = icon;
4104
+ $[14] = images;
4105
+ $[15] = t3;
4106
+ } else t3 = $[15];
3486
4107
  t2 = sorted.folders.map(t3);
3487
4108
  $[7] = actions;
3488
4109
  $[8] = icon;
3489
4110
  $[9] = images;
3490
- $[10] = open;
3491
- $[11] = sorted.folders;
3492
- $[12] = t2;
3493
- } else t2 = $[12];
4111
+ $[10] = sorted.folders;
4112
+ $[11] = t2;
4113
+ } else t2 = $[11];
3494
4114
  let t3;
3495
- if ($[18] !== t1 || $[19] !== t2) {
4115
+ if ($[16] !== t1 || $[17] !== t2) {
3496
4116
  t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
3497
- $[18] = t1;
3498
- $[19] = t2;
3499
- $[20] = t3;
3500
- } else t3 = $[20];
4117
+ $[16] = t1;
4118
+ $[17] = t2;
4119
+ $[18] = t3;
4120
+ } else t3 = $[18];
3501
4121
  return t3;
3502
4122
  }
3503
4123
  function countLeaves(sorted) {
3504
4124
  return sorted.folders.reduce((count, folder) => count + folder.types.length, sorted.types.length);
3505
4125
  }
4126
+ /** A market group's icon, or a folder for one without. */
4127
+ function useMarketGroupIcon() {
4128
+ const $ = c(3);
4129
+ const images = useImages();
4130
+ const folder = useIconUrl("folder");
4131
+ let t0;
4132
+ if ($[0] !== folder || $[1] !== images) {
4133
+ t0 = (marketGroupId) => images.marketGroupIcon(marketGroupId) ?? folder;
4134
+ $[0] = folder;
4135
+ $[1] = images;
4136
+ $[2] = t0;
4137
+ } else t0 = $[2];
4138
+ return t0;
4139
+ }
4140
+ /** A market group: its groups, then its types. */
4141
+ function TypeGroup(t0) {
4142
+ const $ = c(10);
4143
+ const { node, actions } = t0;
4144
+ const marketGroupIcon = useMarketGroupIcon();
4145
+ const t1 = node.group.name;
4146
+ let t2;
4147
+ if ($[0] !== marketGroupIcon || $[1] !== node.group.id) {
4148
+ t2 = marketGroupIcon(node.group.id);
4149
+ $[0] = marketGroupIcon;
4150
+ $[1] = node.group.id;
4151
+ $[2] = t2;
4152
+ } else t2 = $[2];
4153
+ let t3;
4154
+ if ($[3] !== actions || $[4] !== node) {
4155
+ t3 = () => /* @__PURE__ */ jsxs(Fragment, { children: [node.children.map((child) => /* @__PURE__ */ jsx(TypeGroup, {
4156
+ node: child,
4157
+ actions
4158
+ }, child.group.id)), /* @__PURE__ */ jsx(TypeLeaves, {
4159
+ sorted: node,
4160
+ actions
4161
+ })] });
4162
+ $[3] = actions;
4163
+ $[4] = node;
4164
+ $[5] = t3;
4165
+ } else t3 = $[5];
4166
+ let t4;
4167
+ if ($[6] !== node.group.name || $[7] !== t2 || $[8] !== t3) {
4168
+ t4 = /* @__PURE__ */ jsx(TreeGroup, {
4169
+ label: t1,
4170
+ icon: t2,
4171
+ children: t3
4172
+ });
4173
+ $[6] = node.group.name;
4174
+ $[7] = t2;
4175
+ $[8] = t3;
4176
+ $[9] = t4;
4177
+ } else t4 = $[9];
4178
+ return t4;
4179
+ }
4180
+ /** Search results by root market group; a lone root shows only its types. */
4181
+ function SearchResults(t0) {
4182
+ const $ = c(8);
4183
+ const { roots, actions } = t0;
4184
+ const [only] = roots;
4185
+ if (roots.length === 1 && only !== void 0) {
4186
+ let t1;
4187
+ if ($[0] !== actions || $[1] !== only) {
4188
+ t1 = /* @__PURE__ */ jsx(TypeLeaves, {
4189
+ sorted: only,
4190
+ actions
4191
+ });
4192
+ $[0] = actions;
4193
+ $[1] = only;
4194
+ $[2] = t1;
4195
+ } else t1 = $[2];
4196
+ return t1;
4197
+ }
4198
+ let t1;
4199
+ if ($[3] !== actions || $[4] !== roots) {
4200
+ let t2;
4201
+ if ($[6] !== actions) {
4202
+ t2 = (node) => /* @__PURE__ */ jsx(TypeGroup, {
4203
+ node,
4204
+ actions
4205
+ }, node.group.id);
4206
+ $[6] = actions;
4207
+ $[7] = t2;
4208
+ } else t2 = $[7];
4209
+ t1 = roots.map(t2);
4210
+ $[3] = actions;
4211
+ $[4] = roots;
4212
+ $[5] = t1;
4213
+ } else t1 = $[5];
4214
+ return t1;
4215
+ }
3506
4216
  //#endregion
3507
4217
  //#region src/components/ItemBrowser/Charges.tsx
3508
4218
  /** The Charges tab of the `ItemBrowser`: every charge by market group, or only those a fitted module loads. */
3509
4219
  function Charges() {
3510
- const $ = c(49);
4220
+ const $ = c(48);
3511
4221
  const sde = useSde();
3512
4222
  const { actions, clear, dragImage } = useTypeActions();
3513
4223
  const modules = useChargedModules();
3514
4224
  const [picked, setPicked] = useState();
3515
4225
  const [search, setSearch] = useState("");
4226
+ const [collapses, setCollapses] = useState(0);
3516
4227
  let t0;
3517
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
3518
- t0 = { times: 0 };
3519
- $[0] = t0;
3520
- } else t0 = $[0];
3521
- const [collapsed, setCollapsed] = useState(t0);
4228
+ if ($[0] !== modules || $[1] !== picked) {
4229
+ t0 = modules.some((module) => module.id === picked) ? picked : void 0;
4230
+ $[0] = modules;
4231
+ $[1] = picked;
4232
+ $[2] = t0;
4233
+ } else t0 = $[2];
4234
+ const selected = t0;
3522
4235
  let t1;
3523
- if ($[1] !== modules || $[2] !== picked) {
3524
- t1 = modules.some((module) => module.id === picked) ? picked : void 0;
3525
- $[1] = modules;
3526
- $[2] = picked;
3527
- $[3] = t1;
3528
- } else t1 = $[3];
3529
- const selected = t1;
4236
+ if ($[3] !== search) {
4237
+ t1 = search.trim().toLowerCase();
4238
+ $[3] = search;
4239
+ $[4] = t1;
4240
+ } else t1 = $[4];
4241
+ const query = t1;
3530
4242
  let t2;
3531
- if ($[4] !== search) {
3532
- t2 = search.trim().toLowerCase();
3533
- $[4] = search;
3534
- $[5] = t2;
3535
- } else t2 = $[5];
3536
- const query = t2;
3537
- let t3;
3538
- if ($[6] !== query || $[7] !== selected) {
3539
- t3 = selected === void 0 && query !== "" ? (type) => type.name.toLowerCase().includes(query) : void 0;
3540
- $[6] = query;
3541
- $[7] = selected;
3542
- $[8] = t3;
3543
- } else t3 = $[8];
3544
- const groups = useChargeTree(t3);
4243
+ if ($[5] !== query || $[6] !== selected) {
4244
+ t2 = selected === void 0 && query !== "" ? (type) => type.name.toLowerCase().includes(query) : void 0;
4245
+ $[5] = query;
4246
+ $[6] = selected;
4247
+ $[7] = t2;
4248
+ } else t2 = $[7];
4249
+ const matches = t2;
4250
+ const groups = useChargeTree();
4251
+ const found = useChargeSearch(matches);
3545
4252
  const charges = useCharges(selected);
4253
+ let t3;
4254
+ if ($[8] !== charges || $[9] !== query || $[10] !== sde) {
4255
+ let t4;
4256
+ if ($[12] !== query) {
4257
+ t4 = (type_0) => type_0.name.toLowerCase().includes(query);
4258
+ $[12] = query;
4259
+ $[13] = t4;
4260
+ } else t4 = $[13];
4261
+ t3 = sde.sortByMeta(charges.filter(t4));
4262
+ $[8] = charges;
4263
+ $[9] = query;
4264
+ $[10] = sde;
4265
+ $[11] = t3;
4266
+ } else t3 = $[11];
4267
+ const loadable = t3;
3546
4268
  let t4;
3547
- if ($[9] !== charges || $[10] !== query || $[11] !== sde) {
3548
- let t5;
3549
- if ($[13] !== query) {
3550
- t5 = (type_0) => type_0.name.toLowerCase().includes(query);
3551
- $[13] = query;
3552
- $[14] = t5;
3553
- } else t5 = $[14];
3554
- t4 = sde.sortByMeta(charges.filter(t5));
3555
- $[9] = charges;
3556
- $[10] = query;
3557
- $[11] = sde;
3558
- $[12] = t4;
3559
- } else t4 = $[12];
3560
- const loadable = t4;
3561
- let t5;
3562
- if ($[15] !== groups || $[16] !== loadable || $[17] !== selected) {
3563
- t5 = selected === void 0 ? countTypes$1(groups) : countLeaves(loadable);
3564
- $[15] = groups;
3565
- $[16] = loadable;
4269
+ if ($[14] !== found || $[15] !== loadable || $[16] !== matches || $[17] !== selected) {
4270
+ t4 = selected === void 0 ? matches !== void 0 && found.length === 0 : countLeaves(loadable) === 0;
4271
+ $[14] = found;
4272
+ $[15] = loadable;
4273
+ $[16] = matches;
3566
4274
  $[17] = selected;
3567
- $[18] = t5;
3568
- } else t5 = $[18];
3569
- const count = t5;
3570
- const open = query !== "" && query !== collapsed.query && count <= 200;
3571
- let t6;
4275
+ $[18] = t4;
4276
+ } else t4 = $[18];
4277
+ const empty = t4;
4278
+ let t5;
3572
4279
  if ($[19] !== clear) {
3573
- t6 = (value) => {
4280
+ t5 = (value) => {
3574
4281
  clear();
3575
4282
  setSearch(value);
3576
4283
  };
3577
4284
  $[19] = clear;
3578
- $[20] = t6;
3579
- } else t6 = $[20];
4285
+ $[20] = t5;
4286
+ } else t5 = $[20];
4287
+ let t6;
4288
+ if ($[21] !== collapses) {
4289
+ t6 = () => setCollapses(collapses + 1);
4290
+ $[21] = collapses;
4291
+ $[22] = t6;
4292
+ } else t6 = $[22];
3580
4293
  let t7;
3581
- if ($[21] !== collapsed.times || $[22] !== query) {
3582
- t7 = () => setCollapsed({
3583
- times: collapsed.times + 1,
3584
- query
3585
- });
3586
- $[21] = collapsed.times;
3587
- $[22] = query;
3588
- $[23] = t7;
3589
- } else t7 = $[23];
3590
- let t8;
3591
- if ($[24] !== search || $[25] !== t6 || $[26] !== t7) {
3592
- t8 = /* @__PURE__ */ jsx(Search, {
4294
+ if ($[23] !== search || $[24] !== t5 || $[25] !== t6) {
4295
+ t7 = /* @__PURE__ */ jsx(Search, {
3593
4296
  value: search,
3594
- onChange: t6,
3595
- onCollapse: t7
4297
+ onChange: t5,
4298
+ onCollapse: t6
3596
4299
  });
3597
- $[24] = search;
4300
+ $[23] = search;
4301
+ $[24] = t5;
3598
4302
  $[25] = t6;
3599
4303
  $[26] = t7;
3600
- $[27] = t8;
3601
- } else t8 = $[27];
3602
- let t9;
3603
- if ($[28] !== modules || $[29] !== selected) {
3604
- let t10;
3605
- if ($[31] !== selected) {
3606
- t10 = (module_0) => /* @__PURE__ */ jsx(FilterToggle, {
4304
+ } else t7 = $[26];
4305
+ let t8;
4306
+ if ($[27] !== modules || $[28] !== selected) {
4307
+ let t9;
4308
+ if ($[30] !== selected) {
4309
+ t9 = (module_0) => /* @__PURE__ */ jsx(FilterToggle, {
3607
4310
  typeId: module_0.id,
3608
4311
  label: module_0.name,
3609
4312
  pressed: selected === module_0.id,
3610
4313
  onPressedChange: (pressed) => setPicked(pressed ? module_0.id : void 0)
3611
4314
  }, module_0.id);
3612
- $[31] = selected;
3613
- $[32] = t10;
3614
- } else t10 = $[32];
3615
- t9 = modules.map(t10);
3616
- $[28] = modules;
3617
- $[29] = selected;
3618
- $[30] = t9;
3619
- } else t9 = $[30];
3620
- let t10;
3621
- if ($[33] !== t9) {
3622
- t10 = /* @__PURE__ */ jsx("fieldset", {
4315
+ $[30] = selected;
4316
+ $[31] = t9;
4317
+ } else t9 = $[31];
4318
+ t8 = modules.map(t9);
4319
+ $[27] = modules;
4320
+ $[28] = selected;
4321
+ $[29] = t8;
4322
+ } else t8 = $[29];
4323
+ let t9;
4324
+ if ($[32] !== t8) {
4325
+ t9 = /* @__PURE__ */ jsx("fieldset", {
3623
4326
  className: ItemBrowser_module_default.filters,
3624
4327
  "aria-label": "Filters",
3625
- children: t9
4328
+ children: t8
3626
4329
  });
4330
+ $[32] = t8;
3627
4331
  $[33] = t9;
3628
- $[34] = t10;
3629
- } else t10 = $[34];
3630
- const t11 = `${collapsed.times}-${open}-${selected}`;
3631
- let t12;
3632
- if ($[35] !== actions || $[36] !== groups || $[37] !== loadable || $[38] !== open || $[39] !== selected) {
3633
- t12 = selected === void 0 ? groups.map((node) => /* @__PURE__ */ jsx(ChargeGroup, {
3634
- node,
3635
- open,
3636
- actions
3637
- }, node.group.id)) : /* @__PURE__ */ jsx(TypeLeaves, {
3638
- sorted: loadable,
3639
- open,
3640
- actions,
3641
- icon: true
3642
- });
3643
- $[35] = actions;
3644
- $[36] = groups;
3645
- $[37] = loadable;
3646
- $[38] = open;
3647
- $[39] = selected;
3648
- $[40] = t12;
3649
- } else t12 = $[40];
3650
- let t13;
3651
- if ($[41] !== t11 || $[42] !== t12) {
3652
- t13 = /* @__PURE__ */ jsx("div", {
4332
+ } else t9 = $[33];
4333
+ let t10;
4334
+ if ($[34] !== actions || $[35] !== collapses || $[36] !== empty || $[37] !== found || $[38] !== groups || $[39] !== loadable || $[40] !== matches || $[41] !== selected) {
4335
+ t10 = /* @__PURE__ */ jsx("div", {
3653
4336
  className: ItemBrowser_module_default.tree,
3654
- children: /* @__PURE__ */ jsx(TreeList, {
4337
+ children: empty ? /* @__PURE__ */ jsx("p", {
4338
+ className: ItemBrowser_module_default.empty,
4339
+ children: "No charges found"
4340
+ }) : /* @__PURE__ */ jsx(TreeList, {
3655
4341
  label: "Charges",
3656
- children: t12
3657
- }, t11)
3658
- });
3659
- $[41] = t11;
3660
- $[42] = t12;
3661
- $[43] = t13;
3662
- } else t13 = $[43];
3663
- let t14;
3664
- if ($[44] !== dragImage || $[45] !== t10 || $[46] !== t13 || $[47] !== t8) {
3665
- t14 = /* @__PURE__ */ jsxs(Fragment, { children: [
3666
- t8,
4342
+ children: selected !== void 0 ? /* @__PURE__ */ jsx(TypeLeaves, {
4343
+ sorted: loadable,
4344
+ actions,
4345
+ icon: true
4346
+ }) : matches !== void 0 ? /* @__PURE__ */ jsx(SearchResults, {
4347
+ roots: found,
4348
+ actions
4349
+ }) : groups.map((node) => /* @__PURE__ */ jsx(ChargeGroup, {
4350
+ node,
4351
+ actions
4352
+ }, node.group.id))
4353
+ }, `${collapses}-${selected}`)
4354
+ });
4355
+ $[34] = actions;
4356
+ $[35] = collapses;
4357
+ $[36] = empty;
4358
+ $[37] = found;
4359
+ $[38] = groups;
4360
+ $[39] = loadable;
4361
+ $[40] = matches;
4362
+ $[41] = selected;
4363
+ $[42] = t10;
4364
+ } else t10 = $[42];
4365
+ let t11;
4366
+ if ($[43] !== dragImage || $[44] !== t10 || $[45] !== t7 || $[46] !== t9) {
4367
+ t11 = /* @__PURE__ */ jsxs(Fragment, { children: [
4368
+ t7,
4369
+ t9,
3667
4370
  t10,
3668
- t13,
3669
4371
  dragImage
3670
4372
  ] });
3671
- $[44] = dragImage;
3672
- $[45] = t10;
3673
- $[46] = t13;
3674
- $[47] = t8;
3675
- $[48] = t14;
3676
- } else t14 = $[48];
3677
- return t14;
4373
+ $[43] = dragImage;
4374
+ $[44] = t10;
4375
+ $[45] = t7;
4376
+ $[46] = t9;
4377
+ $[47] = t11;
4378
+ } else t11 = $[47];
4379
+ return t11;
3678
4380
  }
3679
4381
  function ChargeGroup(t0) {
3680
- const $ = c(13);
3681
- const { node, open, actions } = t0;
3682
- const images = useImages();
4382
+ const $ = c(11);
4383
+ const { node, actions } = t0;
4384
+ const marketGroupIcon = useMarketGroupIcon();
3683
4385
  const t1 = node.group.name;
3684
4386
  let t2;
3685
- if ($[0] !== images || $[1] !== node.group.id) {
3686
- t2 = images.marketGroupIcon(node.group.id);
3687
- $[0] = images;
4387
+ if ($[0] !== marketGroupIcon || $[1] !== node.group.id) {
4388
+ t2 = marketGroupIcon(node.group.id);
4389
+ $[0] = marketGroupIcon;
3688
4390
  $[1] = node.group.id;
3689
4391
  $[2] = t2;
3690
4392
  } else t2 = $[2];
3691
4393
  let t3;
3692
- if ($[3] !== actions || $[4] !== node.children || $[5] !== node.types || $[6] !== open) {
4394
+ if ($[3] !== actions || $[4] !== node.children || $[5] !== node.types) {
3693
4395
  t3 = () => /* @__PURE__ */ jsxs(Fragment, { children: [node.children.map((child) => /* @__PURE__ */ jsx(ChargeGroup, {
3694
4396
  node: child,
3695
- open,
3696
4397
  actions
3697
4398
  }, child.group.id)), node.types.map((type) => /* @__PURE__ */ jsx(TypeLeaf, {
3698
4399
  type,
@@ -3701,34 +4402,29 @@ function ChargeGroup(t0) {
3701
4402
  $[3] = actions;
3702
4403
  $[4] = node.children;
3703
4404
  $[5] = node.types;
3704
- $[6] = open;
3705
- $[7] = t3;
3706
- } else t3 = $[7];
4405
+ $[6] = t3;
4406
+ } else t3 = $[6];
3707
4407
  let t4;
3708
- if ($[8] !== node.group.name || $[9] !== open || $[10] !== t2 || $[11] !== t3) {
4408
+ if ($[7] !== node.group.name || $[8] !== t2 || $[9] !== t3) {
3709
4409
  t4 = /* @__PURE__ */ jsx(TreeGroup, {
3710
4410
  label: t1,
3711
4411
  icon: t2,
3712
- defaultOpen: open,
3713
4412
  children: t3
3714
4413
  });
3715
- $[8] = node.group.name;
3716
- $[9] = open;
3717
- $[10] = t2;
3718
- $[11] = t3;
3719
- $[12] = t4;
3720
- } else t4 = $[12];
4414
+ $[7] = node.group.name;
4415
+ $[8] = t2;
4416
+ $[9] = t3;
4417
+ $[10] = t4;
4418
+ } else t4 = $[10];
3721
4419
  return t4;
3722
4420
  }
3723
- function countTypes$1(nodes) {
3724
- return nodes.reduce((count, node) => count + countTypes$1(node.children) + node.types.length, 0);
3725
- }
3726
4421
  //#endregion
3727
4422
  //#region src/components/ItemBrowser/HullsAndFits.tsx
3728
4423
  const noFits = [];
4424
+ const SHIPS_MARKET_GROUP_ID = 4;
3729
4425
  /** The Hulls & Fits tab of the `ItemBrowser`: EVE's hulls by group and race, with the fits saved for each. */
3730
4426
  function HullsAndFits() {
3731
- const $ = c(75);
4427
+ const $ = c(61);
3732
4428
  const currentShipId = useFit().ship.type_id;
3733
4429
  const images = useImages();
3734
4430
  const store = useFitStore();
@@ -3738,233 +4434,186 @@ function HullsAndFits() {
3738
4434
  const [browserFits, setBrowserFits] = useState(false);
3739
4435
  const [currentHull, setCurrentHull] = useState(false);
3740
4436
  const [flyable, setFlyable] = useState(false);
4437
+ const [collapses, setCollapses] = useState(0);
3741
4438
  let t0;
3742
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
3743
- t0 = {
3744
- key: 0,
3745
- open: false
3746
- };
3747
- $[0] = t0;
3748
- } else t0 = $[0];
3749
- const [tree, setTree] = useState(t0);
4439
+ if ($[0] !== search) {
4440
+ t0 = search.trim().toLowerCase();
4441
+ $[0] = search;
4442
+ $[1] = t0;
4443
+ } else t0 = $[1];
4444
+ const query = t0;
3750
4445
  let t1;
3751
- if ($[1] !== search) {
3752
- t1 = search.trim().toLowerCase();
3753
- $[1] = search;
3754
- $[2] = t1;
3755
- } else t1 = $[2];
3756
- const query = t1;
3757
- const narrowed = query !== "" || currentHull;
3758
- let t2;
3759
- if ($[3] !== query) {
3760
- t2 = (name) => (name ?? "").toLowerCase().includes(query);
3761
- $[3] = query;
3762
- $[4] = t2;
3763
- } else t2 = $[4];
3764
- const matches = t2;
4446
+ if ($[2] !== query) {
4447
+ t1 = (name) => (name ?? "").toLowerCase().includes(query);
4448
+ $[2] = query;
4449
+ $[3] = t1;
4450
+ } else t1 = $[3];
4451
+ const matches = t1;
4452
+ let t2;
4453
+ if ($[4] !== fits) {
4454
+ t2 = Map.groupBy(fits, _temp$3);
4455
+ $[4] = fits;
4456
+ $[5] = t2;
4457
+ } else t2 = $[5];
4458
+ const fitsByHull = t2;
3765
4459
  let t3;
3766
- if ($[5] !== fits) {
3767
- t3 = Map.groupBy(fits, _temp$3);
3768
- $[5] = fits;
3769
- $[6] = t3;
3770
- } else t3 = $[6];
3771
- const fitsByHull = t3;
3772
- let t4;
3773
- if ($[7] !== fitsByHull || $[8] !== flyable || $[9] !== matches || $[10] !== missingSkills) {
3774
- t4 = (ship) => {
4460
+ if ($[6] !== fitsByHull || $[7] !== flyable || $[8] !== matches || $[9] !== missingSkills) {
4461
+ t3 = (ship) => {
3775
4462
  const saved_0 = fitsByHull.get(ship.id) ?? noFits;
3776
4463
  const kept = flyable ? saved_0.filter((one) => missingSkills(one).length === 0) : saved_0;
3777
4464
  return matches(ship.name) ? kept : kept.filter((one_0) => matches(one_0.name));
3778
4465
  };
3779
- $[7] = fitsByHull;
3780
- $[8] = flyable;
3781
- $[9] = matches;
3782
- $[10] = missingSkills;
3783
- $[11] = t4;
3784
- } else t4 = $[11];
3785
- const shownFits = t4;
3786
- let t5;
3787
- if ($[12] !== browserFits || $[13] !== currentHull || $[14] !== currentShipId || $[15] !== flyable || $[16] !== matches || $[17] !== missingSkills || $[18] !== narrowed || $[19] !== shownFits) {
3788
- t5 = narrowed || browserFits || flyable ? (ship_0) => {
4466
+ $[6] = fitsByHull;
4467
+ $[7] = flyable;
4468
+ $[8] = matches;
4469
+ $[9] = missingSkills;
4470
+ $[10] = t3;
4471
+ } else t3 = $[10];
4472
+ const shownFits = t3;
4473
+ let t4;
4474
+ if ($[11] !== browserFits || $[12] !== currentHull || $[13] !== currentShipId || $[14] !== flyable || $[15] !== matches || $[16] !== missingSkills || $[17] !== query || $[18] !== shownFits) {
4475
+ t4 = query !== "" || currentHull || browserFits || flyable ? (ship_0) => {
3789
4476
  if (currentHull && ship_0.id !== currentShipId) return false;
3790
4477
  if (flyable && missingSkills([ship_0.id]).length > 0) return false;
3791
4478
  const shown = shownFits(ship_0);
3792
4479
  if (browserFits && shown.length === 0) return false;
3793
4480
  return matches(ship_0.name) || shown.length > 0;
3794
4481
  } : void 0;
3795
- $[12] = browserFits;
3796
- $[13] = currentHull;
3797
- $[14] = currentShipId;
3798
- $[15] = flyable;
3799
- $[16] = matches;
3800
- $[17] = missingSkills;
3801
- $[18] = narrowed;
3802
- $[19] = shownFits;
3803
- $[20] = t5;
3804
- } else t5 = $[20];
3805
- const groups = useHullTree(t5);
4482
+ $[11] = browserFits;
4483
+ $[12] = currentHull;
4484
+ $[13] = currentShipId;
4485
+ $[14] = flyable;
4486
+ $[15] = matches;
4487
+ $[16] = missingSkills;
4488
+ $[17] = query;
4489
+ $[18] = shownFits;
4490
+ $[19] = t4;
4491
+ } else t4 = $[19];
4492
+ const groups = useHullTree(t4);
4493
+ let t5;
4494
+ if ($[20] !== store) {
4495
+ t5 = (shipTypeId) => store.replace({
4496
+ ship: { type_id: shipTypeId },
4497
+ items: []
4498
+ });
4499
+ $[20] = store;
4500
+ $[21] = t5;
4501
+ } else t5 = $[21];
4502
+ const simulate = t5;
3806
4503
  let t6;
3807
- if ($[21] !== narrowed || $[22] !== tree.key) {
3808
- t6 = (nextSearch, nextCurrentHull) => {
3809
- const nextNarrowed = nextSearch.trim() !== "" || nextCurrentHull;
3810
- if (nextNarrowed !== narrowed) setTree({
3811
- key: tree.key + 1,
3812
- open: nextNarrowed
3813
- });
3814
- setSearch(nextSearch);
3815
- setCurrentHull(nextCurrentHull);
3816
- };
3817
- $[21] = narrowed;
3818
- $[22] = tree.key;
4504
+ if ($[22] !== collapses) {
4505
+ t6 = () => setCollapses(collapses + 1);
4506
+ $[22] = collapses;
3819
4507
  $[23] = t6;
3820
4508
  } else t6 = $[23];
3821
- const narrow = t6;
3822
4509
  let t7;
3823
- if ($[24] !== store) {
3824
- t7 = (shipTypeId) => store.replace({
3825
- ship: { type_id: shipTypeId },
3826
- items: []
3827
- });
3828
- $[24] = store;
3829
- $[25] = t7;
3830
- } else t7 = $[25];
3831
- const simulate = t7;
3832
- let t8;
3833
- if ($[26] !== currentHull || $[27] !== narrow) {
3834
- t8 = (value) => narrow(value, currentHull);
3835
- $[26] = currentHull;
3836
- $[27] = narrow;
3837
- $[28] = t8;
3838
- } else t8 = $[28];
3839
- let t9;
3840
- if ($[29] !== tree.key) {
3841
- t9 = () => setTree({
3842
- key: tree.key + 1,
3843
- open: false
3844
- });
3845
- $[29] = tree.key;
3846
- $[30] = t9;
3847
- } else t9 = $[30];
3848
- let t10;
3849
- if ($[31] !== search || $[32] !== t8 || $[33] !== t9) {
3850
- t10 = /* @__PURE__ */ jsx(Search, {
4510
+ if ($[24] !== search || $[25] !== t6) {
4511
+ t7 = /* @__PURE__ */ jsx(Search, {
3851
4512
  value: search,
3852
- onChange: t8,
3853
- onCollapse: t9
4513
+ onChange: setSearch,
4514
+ onCollapse: t6
3854
4515
  });
3855
- $[31] = search;
3856
- $[32] = t8;
3857
- $[33] = t9;
3858
- $[34] = t10;
3859
- } else t10 = $[34];
3860
- let t11;
3861
- if ($[35] !== browserFits) {
3862
- t11 = /* @__PURE__ */ jsx(FilterToggle, {
4516
+ $[24] = search;
4517
+ $[25] = t6;
4518
+ $[26] = t7;
4519
+ } else t7 = $[26];
4520
+ let t8;
4521
+ if ($[27] !== browserFits) {
4522
+ t8 = /* @__PURE__ */ jsx(FilterToggle, {
3863
4523
  icon: "fits-browser",
3864
4524
  label: "Browser Fittings",
3865
4525
  pressed: browserFits,
3866
4526
  onPressedChange: setBrowserFits
3867
4527
  });
3868
- $[35] = browserFits;
3869
- $[36] = t11;
3870
- } else t11 = $[36];
4528
+ $[27] = browserFits;
4529
+ $[28] = t8;
4530
+ } else t8 = $[28];
4531
+ let t10;
4532
+ let t11;
3871
4533
  let t12;
3872
- let t13;
3873
- let t14;
3874
- let t15;
3875
- if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
3876
- t12 = /* @__PURE__ */ jsx(FilterToggle, {
4534
+ let t9;
4535
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
4536
+ t9 = /* @__PURE__ */ jsx(FilterToggle, {
3877
4537
  icon: "fits-personal",
3878
4538
  label: "Personal Fittings"
3879
4539
  });
3880
- t13 = /* @__PURE__ */ jsx(FilterToggle, {
4540
+ t10 = /* @__PURE__ */ jsx(FilterToggle, {
3881
4541
  icon: "fits-corporation",
3882
4542
  label: "Corporation Fittings"
3883
4543
  });
3884
- t14 = /* @__PURE__ */ jsx(FilterToggle, {
4544
+ t11 = /* @__PURE__ */ jsx(FilterToggle, {
3885
4545
  icon: "fits-alliance",
3886
4546
  label: "Alliance Fittings"
3887
4547
  });
3888
- t15 = /* @__PURE__ */ jsx(FilterToggle, {
4548
+ t12 = /* @__PURE__ */ jsx(FilterToggle, {
3889
4549
  icon: "fits-community",
3890
4550
  label: "Community Fittings"
3891
4551
  });
3892
- $[37] = t12;
3893
- $[38] = t13;
3894
- $[39] = t14;
3895
- $[40] = t15;
4552
+ $[29] = t10;
4553
+ $[30] = t11;
4554
+ $[31] = t12;
4555
+ $[32] = t9;
3896
4556
  } else {
3897
- t12 = $[37];
3898
- t13 = $[38];
3899
- t14 = $[39];
3900
- t15 = $[40];
4557
+ t10 = $[29];
4558
+ t11 = $[30];
4559
+ t12 = $[31];
4560
+ t9 = $[32];
3901
4561
  }
3902
- let t16;
3903
- if ($[41] !== narrow || $[42] !== search) {
3904
- t16 = (pressed) => narrow(search, pressed);
3905
- $[41] = narrow;
3906
- $[42] = search;
3907
- $[43] = t16;
3908
- } else t16 = $[43];
3909
- let t17;
3910
- if ($[44] !== currentHull || $[45] !== t16) {
3911
- t17 = /* @__PURE__ */ jsx(FilterToggle, {
4562
+ let t13;
4563
+ if ($[33] !== currentHull) {
4564
+ t13 = /* @__PURE__ */ jsx(FilterToggle, {
3912
4565
  icon: "current-hull",
3913
4566
  label: "Current Hull",
3914
4567
  pressed: currentHull,
3915
- onPressedChange: t16
4568
+ onPressedChange: setCurrentHull
3916
4569
  });
3917
- $[44] = currentHull;
3918
- $[45] = t16;
3919
- $[46] = t17;
3920
- } else t17 = $[46];
3921
- let t18;
3922
- if ($[47] !== flyable) {
3923
- t18 = /* @__PURE__ */ jsx(FilterToggle, {
4570
+ $[33] = currentHull;
4571
+ $[34] = t13;
4572
+ } else t13 = $[34];
4573
+ let t14;
4574
+ if ($[35] !== flyable) {
4575
+ t14 = /* @__PURE__ */ jsx(FilterToggle, {
3924
4576
  icon: "skills",
3925
4577
  label: "Skills",
3926
4578
  pressed: flyable,
3927
4579
  onPressedChange: setFlyable
3928
4580
  });
3929
- $[47] = flyable;
3930
- $[48] = t18;
3931
- } else t18 = $[48];
3932
- let t19;
3933
- if ($[49] !== t11 || $[50] !== t17 || $[51] !== t18) {
3934
- t19 = /* @__PURE__ */ jsxs("fieldset", {
4581
+ $[35] = flyable;
4582
+ $[36] = t14;
4583
+ } else t14 = $[36];
4584
+ let t15;
4585
+ if ($[37] !== t13 || $[38] !== t14 || $[39] !== t8) {
4586
+ t15 = /* @__PURE__ */ jsxs("fieldset", {
3935
4587
  className: ItemBrowser_module_default.filters,
3936
4588
  "aria-label": "Filters",
3937
4589
  children: [
4590
+ t8,
4591
+ t9,
4592
+ t10,
3938
4593
  t11,
3939
4594
  t12,
3940
4595
  t13,
3941
- t14,
3942
- t15,
3943
- t17,
3944
- t18
4596
+ t14
3945
4597
  ]
3946
4598
  });
3947
- $[49] = t11;
3948
- $[50] = t17;
3949
- $[51] = t18;
3950
- $[52] = t19;
3951
- } else t19 = $[52];
3952
- const t20 = tree.key;
3953
- let t21;
3954
- if ($[53] !== fitsByHull || $[54] !== groups || $[55] !== images || $[56] !== shownFits || $[57] !== simulate || $[58] !== store || $[59] !== tree.open) {
3955
- let t22;
3956
- if ($[61] !== fitsByHull || $[62] !== images || $[63] !== shownFits || $[64] !== simulate || $[65] !== store || $[66] !== tree.open) {
3957
- t22 = (t23) => {
3958
- const { group, races } = t23;
4599
+ $[37] = t13;
4600
+ $[38] = t14;
4601
+ $[39] = t8;
4602
+ $[40] = t15;
4603
+ } else t15 = $[40];
4604
+ let t16;
4605
+ if ($[41] !== fitsByHull || $[42] !== groups || $[43] !== images || $[44] !== shownFits || $[45] !== simulate || $[46] !== store) {
4606
+ let t17;
4607
+ if ($[48] !== fitsByHull || $[49] !== images || $[50] !== shownFits || $[51] !== simulate || $[52] !== store) {
4608
+ t17 = (t18) => {
4609
+ const { group, races } = t18;
3959
4610
  return /* @__PURE__ */ jsx(TreeGroup, {
3960
4611
  label: group.name,
3961
- defaultOpen: tree.open,
3962
- children: () => races.map((t24) => {
3963
- const { race, factionId, ships } = t24;
4612
+ children: () => races.map((t19) => {
4613
+ const { race, factionId, ships } = t19;
3964
4614
  return /* @__PURE__ */ jsx(TreeGroup, {
3965
4615
  label: `${raceName(race)} [${ships.length}]`,
3966
- icon: factionId === void 0 ? void 0 : images.factionIcon(factionId),
3967
- defaultOpen: tree.open,
4616
+ icon: factionId === void 0 ? images.marketGroupIcon(SHIPS_MARKET_GROUP_ID) : images.factionIcon(factionId),
3968
4617
  children: () => ships.map((ship_1) => {
3969
4618
  const shown_0 = shownFits(ship_1);
3970
4619
  const simulateShip = /* @__PURE__ */ jsx(Tooltip, {
@@ -3977,24 +4626,15 @@ function HullsAndFits() {
3977
4626
  children: /* @__PURE__ */ jsx(Icon, { name: "simulate" })
3978
4627
  })
3979
4628
  });
3980
- if (shown_0.length === 0) return /* @__PURE__ */ jsx(TreeLeaf, {
3981
- label: /* @__PURE__ */ jsx("span", {
3982
- className: ItemBrowser_module_default.hull,
3983
- children: ship_1.name
3984
- }),
3985
- typeId: ship_1.id,
3986
- after: simulateShip
3987
- }, ship_1.id);
3988
4629
  return /* @__PURE__ */ jsx(TreeGroup, {
3989
4630
  label: /* @__PURE__ */ jsx("span", {
3990
4631
  className: ItemBrowser_module_default.hull,
3991
4632
  children: ship_1.name
3992
4633
  }),
3993
- description: /* @__PURE__ */ jsx(Counts, { browserFits: fitsByHull.get(ship_1.id)?.length ?? 0 }),
4634
+ description: shown_0.length > 0 ? /* @__PURE__ */ jsx(Counts, { browserFits: fitsByHull.get(ship_1.id)?.length ?? 0 }) : void 0,
3994
4635
  typeId: ship_1.id,
3995
- defaultOpen: tree.open,
3996
4636
  after: simulateShip,
3997
- children: () => shown_0.map((saved_1) => /* @__PURE__ */ jsx(TreeLeaf, {
4637
+ children: () => shown_0.length === 0 ? /* @__PURE__ */ jsx(TreeLeaf, { label: "No Item" }) : shown_0.map((saved_1) => /* @__PURE__ */ jsx(TreeLeaf, {
3998
4638
  label: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
3999
4639
  className: ItemBrowser_module_default.kind,
4000
4640
  children: /* @__PURE__ */ jsx(Icon, { name: "fits-browser" })
@@ -4008,50 +4648,48 @@ function HullsAndFits() {
4008
4648
  })
4009
4649
  }, group.id);
4010
4650
  };
4011
- $[61] = fitsByHull;
4012
- $[62] = images;
4013
- $[63] = shownFits;
4014
- $[64] = simulate;
4015
- $[65] = store;
4016
- $[66] = tree.open;
4017
- $[67] = t22;
4018
- } else t22 = $[67];
4019
- t21 = groups.map(t22);
4020
- $[53] = fitsByHull;
4021
- $[54] = groups;
4022
- $[55] = images;
4023
- $[56] = shownFits;
4024
- $[57] = simulate;
4025
- $[58] = store;
4026
- $[59] = tree.open;
4027
- $[60] = t21;
4028
- } else t21 = $[60];
4029
- let t22;
4030
- if ($[68] !== t21 || $[69] !== tree.key) {
4031
- t22 = /* @__PURE__ */ jsx("div", {
4651
+ $[48] = fitsByHull;
4652
+ $[49] = images;
4653
+ $[50] = shownFits;
4654
+ $[51] = simulate;
4655
+ $[52] = store;
4656
+ $[53] = t17;
4657
+ } else t17 = $[53];
4658
+ t16 = groups.map(t17);
4659
+ $[41] = fitsByHull;
4660
+ $[42] = groups;
4661
+ $[43] = images;
4662
+ $[44] = shownFits;
4663
+ $[45] = simulate;
4664
+ $[46] = store;
4665
+ $[47] = t16;
4666
+ } else t16 = $[47];
4667
+ let t17;
4668
+ if ($[54] !== collapses || $[55] !== t16) {
4669
+ t17 = /* @__PURE__ */ jsx("div", {
4032
4670
  className: ItemBrowser_module_default.tree,
4033
4671
  children: /* @__PURE__ */ jsx(TreeList, {
4034
4672
  label: "Hulls",
4035
- children: t21
4036
- }, t20)
4673
+ children: t16
4674
+ }, collapses)
4037
4675
  });
4038
- $[68] = t21;
4039
- $[69] = tree.key;
4040
- $[70] = t22;
4041
- } else t22 = $[70];
4042
- let t23;
4043
- if ($[71] !== t10 || $[72] !== t19 || $[73] !== t22) {
4044
- t23 = /* @__PURE__ */ jsxs(Fragment, { children: [
4045
- t10,
4046
- t19,
4047
- t22
4676
+ $[54] = collapses;
4677
+ $[55] = t16;
4678
+ $[56] = t17;
4679
+ } else t17 = $[56];
4680
+ let t18;
4681
+ if ($[57] !== t15 || $[58] !== t17 || $[59] !== t7) {
4682
+ t18 = /* @__PURE__ */ jsxs(Fragment, { children: [
4683
+ t7,
4684
+ t15,
4685
+ t17
4048
4686
  ] });
4049
- $[71] = t10;
4050
- $[72] = t19;
4051
- $[73] = t22;
4052
- $[74] = t23;
4053
- } else t23 = $[74];
4054
- return t23;
4687
+ $[57] = t15;
4688
+ $[58] = t17;
4689
+ $[59] = t7;
4690
+ $[60] = t18;
4691
+ } else t18 = $[60];
4692
+ return t18;
4055
4693
  }
4056
4694
  function _temp$3(saved) {
4057
4695
  return saved.ship.type_id;
@@ -4235,7 +4873,7 @@ const slotFilters = [
4235
4873
  ];
4236
4874
  /** The Modules tab of the `ItemBrowser`: what goes on a ship, by market group. */
4237
4875
  function Modules() {
4238
- const $ = c(51);
4876
+ const $ = c(44);
4239
4877
  const { actions, clear, dragImage } = useTypeActions();
4240
4878
  const placement = usePlacement();
4241
4879
  const canFit = useCanFit();
@@ -4244,32 +4882,27 @@ function Modules() {
4244
4882
  const [slots, setSlots] = useState(_temp$2);
4245
4883
  const [hullRestrictions, setHullRestrictions] = useState(false);
4246
4884
  const [flyable, setFlyable] = useState(false);
4885
+ const [collapses, setCollapses] = useState(0);
4247
4886
  let t0;
4248
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
4249
- t0 = { times: 0 };
4250
- $[0] = t0;
4251
- } else t0 = $[0];
4252
- const [collapsed, setCollapsed] = useState(t0);
4887
+ if ($[0] !== search) {
4888
+ t0 = search.trim().toLowerCase();
4889
+ $[0] = search;
4890
+ $[1] = t0;
4891
+ } else t0 = $[1];
4892
+ const query = t0;
4253
4893
  let t1;
4254
- if ($[1] !== search) {
4255
- t1 = search.trim().toLowerCase();
4256
- $[1] = search;
4257
- $[2] = t1;
4258
- } else t1 = $[2];
4259
- const query = t1;
4260
- let t2;
4261
- if ($[3] !== slots) {
4262
- t2 = new Set(slotFilters.filter((t3) => {
4263
- const { filter } = t3;
4894
+ if ($[2] !== slots) {
4895
+ t1 = new Set(slotFilters.filter((t2) => {
4896
+ const { filter } = t2;
4264
4897
  return slots.has(filter);
4265
4898
  }).flatMap(_temp2$1));
4266
- $[3] = slots;
4267
- $[4] = t2;
4268
- } else t2 = $[4];
4269
- const places = t2;
4270
- let t3;
4271
- if ($[5] !== canFit || $[6] !== flyable || $[7] !== hullRestrictions || $[8] !== missingSkills || $[9] !== placement || $[10] !== places || $[11] !== query) {
4272
- t3 = query !== "" || places.size > 0 || hullRestrictions || flyable ? (type) => {
4899
+ $[2] = slots;
4900
+ $[3] = t1;
4901
+ } else t1 = $[3];
4902
+ const places = t1;
4903
+ let t2;
4904
+ if ($[4] !== canFit || $[5] !== flyable || $[6] !== hullRestrictions || $[7] !== missingSkills || $[8] !== placement || $[9] !== places || $[10] !== query) {
4905
+ t2 = query !== "" || places.size > 0 || hullRestrictions || flyable ? (type) => {
4273
4906
  if (places.size > 0) {
4274
4907
  const place = placement(type)?.type;
4275
4908
  if (place === void 0 || !places.has(place)) return false;
@@ -4278,64 +4911,62 @@ function Modules() {
4278
4911
  if (flyable && missingSkills([type.id]).length > 0) return false;
4279
4912
  return type.name.toLowerCase().includes(query);
4280
4913
  } : void 0;
4281
- $[5] = canFit;
4282
- $[6] = flyable;
4283
- $[7] = hullRestrictions;
4284
- $[8] = missingSkills;
4285
- $[9] = placement;
4286
- $[10] = places;
4287
- $[11] = query;
4288
- $[12] = t3;
4289
- } else t3 = $[12];
4290
- const groups = useModuleTree(t3);
4291
- const open = query !== "" && query !== collapsed.query && countTypes(groups) <= 200;
4292
- let t4;
4293
- if ($[13] !== slots) {
4294
- t4 = (filter_0, pressed) => {
4914
+ $[4] = canFit;
4915
+ $[5] = flyable;
4916
+ $[6] = hullRestrictions;
4917
+ $[7] = missingSkills;
4918
+ $[8] = placement;
4919
+ $[9] = places;
4920
+ $[10] = query;
4921
+ $[11] = t2;
4922
+ } else t2 = $[11];
4923
+ const keep = t2;
4924
+ const tree = useModuleTree(query === "" ? keep : void 0);
4925
+ const found = useModuleSearch(query === "" ? void 0 : keep);
4926
+ const groups = query === "" ? tree : found;
4927
+ let t3;
4928
+ if ($[12] !== slots) {
4929
+ t3 = (filter_0, pressed) => {
4295
4930
  const next = new Set(slots);
4296
4931
  if (pressed) next.add(filter_0);
4297
4932
  else next.delete(filter_0);
4298
4933
  setSlots(next);
4299
4934
  };
4300
- $[13] = slots;
4301
- $[14] = t4;
4302
- } else t4 = $[14];
4303
- const toggleSlot = t4;
4304
- let t5;
4305
- if ($[15] !== clear) {
4306
- t5 = (value) => {
4935
+ $[12] = slots;
4936
+ $[13] = t3;
4937
+ } else t3 = $[13];
4938
+ const toggleSlot = t3;
4939
+ let t4;
4940
+ if ($[14] !== clear) {
4941
+ t4 = (value) => {
4307
4942
  clear();
4308
4943
  setSearch(value);
4309
4944
  };
4310
- $[15] = clear;
4311
- $[16] = t5;
4312
- } else t5 = $[16];
4945
+ $[14] = clear;
4946
+ $[15] = t4;
4947
+ } else t4 = $[15];
4948
+ let t5;
4949
+ if ($[16] !== collapses) {
4950
+ t5 = () => setCollapses(collapses + 1);
4951
+ $[16] = collapses;
4952
+ $[17] = t5;
4953
+ } else t5 = $[17];
4313
4954
  let t6;
4314
- if ($[17] !== collapsed.times || $[18] !== query) {
4315
- t6 = () => setCollapsed({
4316
- times: collapsed.times + 1,
4317
- query
4318
- });
4319
- $[17] = collapsed.times;
4320
- $[18] = query;
4321
- $[19] = t6;
4322
- } else t6 = $[19];
4323
- let t7;
4324
- if ($[20] !== search || $[21] !== t5 || $[22] !== t6) {
4325
- t7 = /* @__PURE__ */ jsx(Search, {
4955
+ if ($[18] !== search || $[19] !== t4 || $[20] !== t5) {
4956
+ t6 = /* @__PURE__ */ jsx(Search, {
4326
4957
  value: search,
4327
- onChange: t5,
4328
- onCollapse: t6
4958
+ onChange: t4,
4959
+ onCollapse: t5
4329
4960
  });
4330
- $[20] = search;
4331
- $[21] = t5;
4332
- $[22] = t6;
4333
- $[23] = t7;
4334
- } else t7 = $[23];
4335
- let t8;
4336
- if ($[24] !== slots || $[25] !== toggleSlot) {
4337
- t8 = slotFilters.map((t9) => {
4338
- const { filter: filter_1, icon, label } = t9;
4961
+ $[18] = search;
4962
+ $[19] = t4;
4963
+ $[20] = t5;
4964
+ $[21] = t6;
4965
+ } else t6 = $[21];
4966
+ let t7;
4967
+ if ($[22] !== slots || $[23] !== toggleSlot) {
4968
+ t7 = slotFilters.map((t8) => {
4969
+ const { filter: filter_1, icon, label } = t8;
4339
4970
  return /* @__PURE__ */ jsx(FilterToggle, {
4340
4971
  icon,
4341
4972
  label,
@@ -4343,105 +4974,96 @@ function Modules() {
4343
4974
  onPressedChange: (pressed_0) => toggleSlot(filter_1, pressed_0)
4344
4975
  }, filter_1);
4345
4976
  });
4346
- $[24] = slots;
4347
- $[25] = toggleSlot;
4348
- $[26] = t8;
4349
- } else t8 = $[26];
4350
- let t9;
4351
- if ($[27] !== hullRestrictions) {
4352
- t9 = /* @__PURE__ */ jsx(FilterToggle, {
4977
+ $[22] = slots;
4978
+ $[23] = toggleSlot;
4979
+ $[24] = t7;
4980
+ } else t7 = $[24];
4981
+ let t8;
4982
+ if ($[25] !== hullRestrictions) {
4983
+ t8 = /* @__PURE__ */ jsx(FilterToggle, {
4353
4984
  icon: "filter-hull-restrictions",
4354
4985
  label: "Hull Restrictions",
4355
4986
  pressed: hullRestrictions,
4356
4987
  onPressedChange: setHullRestrictions
4357
4988
  });
4358
- $[27] = hullRestrictions;
4359
- $[28] = t9;
4360
- } else t9 = $[28];
4361
- let t10;
4362
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
4363
- t10 = /* @__PURE__ */ jsx(FilterToggle, {
4989
+ $[25] = hullRestrictions;
4990
+ $[26] = t8;
4991
+ } else t8 = $[26];
4992
+ let t9;
4993
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
4994
+ t9 = /* @__PURE__ */ jsx(FilterToggle, {
4364
4995
  icon: "filter-resources",
4365
4996
  label: "Resources"
4366
4997
  });
4367
- $[29] = t10;
4368
- } else t10 = $[29];
4369
- let t11;
4370
- if ($[30] !== flyable) {
4371
- t11 = /* @__PURE__ */ jsx(FilterToggle, {
4998
+ $[27] = t9;
4999
+ } else t9 = $[27];
5000
+ let t10;
5001
+ if ($[28] !== flyable) {
5002
+ t10 = /* @__PURE__ */ jsx(FilterToggle, {
4372
5003
  icon: "skills",
4373
5004
  label: "Skills",
4374
5005
  pressed: flyable,
4375
5006
  onPressedChange: setFlyable
4376
5007
  });
4377
- $[30] = flyable;
4378
- $[31] = t11;
4379
- } else t11 = $[31];
4380
- let t12;
4381
- if ($[32] !== t11 || $[33] !== t8 || $[34] !== t9) {
4382
- t12 = /* @__PURE__ */ jsxs("fieldset", {
5008
+ $[28] = flyable;
5009
+ $[29] = t10;
5010
+ } else t10 = $[29];
5011
+ let t11;
5012
+ if ($[30] !== t10 || $[31] !== t7 || $[32] !== t8) {
5013
+ t11 = /* @__PURE__ */ jsxs("fieldset", {
4383
5014
  className: ItemBrowser_module_default.filters,
4384
5015
  "aria-label": "Filters",
4385
5016
  children: [
5017
+ t7,
4386
5018
  t8,
4387
5019
  t9,
4388
- t10,
4389
- t11
5020
+ t10
4390
5021
  ]
4391
5022
  });
4392
- $[32] = t11;
4393
- $[33] = t8;
4394
- $[34] = t9;
4395
- $[35] = t12;
4396
- } else t12 = $[35];
4397
- const t13 = `${collapsed.times}-${open}`;
4398
- let t14;
4399
- if ($[36] !== actions || $[37] !== groups || $[38] !== open) {
4400
- let t15;
4401
- if ($[40] !== actions || $[41] !== open) {
4402
- t15 = (node) => /* @__PURE__ */ jsx(ModuleGroup, {
4403
- node,
4404
- open,
4405
- actions
4406
- }, node.group.id);
4407
- $[40] = actions;
4408
- $[41] = open;
4409
- $[42] = t15;
4410
- } else t15 = $[42];
4411
- t14 = groups.map(t15);
4412
- $[36] = actions;
4413
- $[37] = groups;
4414
- $[38] = open;
4415
- $[39] = t14;
4416
- } else t14 = $[39];
4417
- let t15;
4418
- if ($[43] !== t13 || $[44] !== t14) {
4419
- t15 = /* @__PURE__ */ jsx("div", {
5023
+ $[30] = t10;
5024
+ $[31] = t7;
5025
+ $[32] = t8;
5026
+ $[33] = t11;
5027
+ } else t11 = $[33];
5028
+ let t12;
5029
+ if ($[34] !== actions || $[35] !== collapses || $[36] !== groups || $[37] !== query) {
5030
+ t12 = /* @__PURE__ */ jsx("div", {
4420
5031
  className: ItemBrowser_module_default.tree,
4421
- children: /* @__PURE__ */ jsx(TreeList, {
5032
+ children: groups.length === 0 ? /* @__PURE__ */ jsx("p", {
5033
+ className: ItemBrowser_module_default.empty,
5034
+ children: "No modules found"
5035
+ }) : /* @__PURE__ */ jsx(TreeList, {
4422
5036
  label: "Modules",
4423
- children: t14
4424
- }, t13)
5037
+ children: query === "" ? groups.map((node) => /* @__PURE__ */ jsx(TypeGroup, {
5038
+ node,
5039
+ actions
5040
+ }, node.group.id)) : /* @__PURE__ */ jsx(SearchResults, {
5041
+ roots: groups,
5042
+ actions
5043
+ })
5044
+ }, collapses)
4425
5045
  });
4426
- $[43] = t13;
4427
- $[44] = t14;
4428
- $[45] = t15;
4429
- } else t15 = $[45];
4430
- let t16;
4431
- if ($[46] !== dragImage || $[47] !== t12 || $[48] !== t15 || $[49] !== t7) {
4432
- t16 = /* @__PURE__ */ jsxs(Fragment, { children: [
4433
- t7,
5046
+ $[34] = actions;
5047
+ $[35] = collapses;
5048
+ $[36] = groups;
5049
+ $[37] = query;
5050
+ $[38] = t12;
5051
+ } else t12 = $[38];
5052
+ let t13;
5053
+ if ($[39] !== dragImage || $[40] !== t11 || $[41] !== t12 || $[42] !== t6) {
5054
+ t13 = /* @__PURE__ */ jsxs(Fragment, { children: [
5055
+ t6,
5056
+ t11,
4434
5057
  t12,
4435
- t15,
4436
5058
  dragImage
4437
5059
  ] });
4438
- $[46] = dragImage;
4439
- $[47] = t12;
4440
- $[48] = t15;
4441
- $[49] = t7;
4442
- $[50] = t16;
4443
- } else t16 = $[50];
4444
- return t16;
5060
+ $[39] = dragImage;
5061
+ $[40] = t11;
5062
+ $[41] = t12;
5063
+ $[42] = t6;
5064
+ $[43] = t13;
5065
+ } else t13 = $[43];
5066
+ return t13;
4445
5067
  }
4446
5068
  function _temp2$1(slot) {
4447
5069
  return slot.places;
@@ -4449,53 +5071,6 @@ function _temp2$1(slot) {
4449
5071
  function _temp$2() {
4450
5072
  return /* @__PURE__ */ new Set();
4451
5073
  }
4452
- function ModuleGroup(t0) {
4453
- const $ = c(12);
4454
- const { node, open, actions } = t0;
4455
- const images = useImages();
4456
- const t1 = node.group.name;
4457
- let t2;
4458
- if ($[0] !== images || $[1] !== node.group.id) {
4459
- t2 = images.marketGroupIcon(node.group.id);
4460
- $[0] = images;
4461
- $[1] = node.group.id;
4462
- $[2] = t2;
4463
- } else t2 = $[2];
4464
- let t3;
4465
- if ($[3] !== actions || $[4] !== node || $[5] !== open) {
4466
- t3 = () => /* @__PURE__ */ jsxs(Fragment, { children: [node.children.map((child) => /* @__PURE__ */ jsx(ModuleGroup, {
4467
- node: child,
4468
- open,
4469
- actions
4470
- }, child.group.id)), /* @__PURE__ */ jsx(TypeLeaves, {
4471
- sorted: node,
4472
- open,
4473
- actions
4474
- })] });
4475
- $[3] = actions;
4476
- $[4] = node;
4477
- $[5] = open;
4478
- $[6] = t3;
4479
- } else t3 = $[6];
4480
- let t4;
4481
- if ($[7] !== node.group.name || $[8] !== open || $[9] !== t2 || $[10] !== t3) {
4482
- t4 = /* @__PURE__ */ jsx(TreeGroup, {
4483
- label: t1,
4484
- icon: t2,
4485
- defaultOpen: open,
4486
- children: t3
4487
- });
4488
- $[7] = node.group.name;
4489
- $[8] = open;
4490
- $[9] = t2;
4491
- $[10] = t3;
4492
- $[11] = t4;
4493
- } else t4 = $[11];
4494
- return t4;
4495
- }
4496
- function countTypes(nodes) {
4497
- return nodes.reduce((count, node) => count + countTypes(node.children) + countLeaves(node), 0);
4498
- }
4499
5074
  //#endregion
4500
5075
  //#region src/components/ItemBrowser/ItemBrowser.tsx
4501
5076
  /** EVE's browser of hulls and fits, modules and charges, left of the fitting wheel. */
@@ -4619,36 +5194,6 @@ function AttributeText(t0) {
4619
5194
  return t1;
4620
5195
  }
4621
5196
  //#endregion
4622
- //#region src/components/ShipStatistics/AttributeTooltip.tsx
4623
- /** What EVE shows when hovering the attribute; its name, for one without. */
4624
- function AttributeTooltip(t0) {
4625
- const $ = c(7);
4626
- const { attribute } = t0;
4627
- const sde = useSde();
4628
- const tooltip = useAttributeTooltip(attribute);
4629
- let t1;
4630
- if ($[0] !== attribute || $[1] !== sde || $[2] !== tooltip?.title) {
4631
- t1 = tooltip?.title ?? sde.attribute(sde.attributeId(attribute) ?? 0)?.displayName ?? attribute;
4632
- $[0] = attribute;
4633
- $[1] = sde;
4634
- $[2] = tooltip?.title;
4635
- $[3] = t1;
4636
- } else t1 = $[3];
4637
- const title = t1;
4638
- const t2 = tooltip?.description;
4639
- let t3;
4640
- if ($[4] !== t2 || $[5] !== title) {
4641
- t3 = /* @__PURE__ */ jsx(TooltipText, {
4642
- title,
4643
- description: t2
4644
- });
4645
- $[4] = t2;
4646
- $[5] = title;
4647
- $[6] = t3;
4648
- } else t3 = $[6];
4649
- return t3;
4650
- }
4651
- //#endregion
4652
5197
  //#region src/components/ShipStatistics/units.ts
4653
5198
  /** For the `format` of `useAttribute`. */
4654
5199
  function unit(suffix, divisor = 1) {