@teselagen/ove 0.8.40 → 0.8.41

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/index.es.js CHANGED
@@ -95492,14 +95492,34 @@ function addHighlightedDifferences(alignmentTracks) {
95492
95492
  track.alignmentData.sequence
95493
95493
  );
95494
95494
  const mismatches = matchHighlightRanges.filter(({ isMatch }) => !isMatch);
95495
+ const alignedSeq = track.alignmentData.sequence;
95496
+ const seqLen = alignedSeq.length;
95497
+ const startIndex = seqLen - alignedSeq.replace(/^-+/, "").length;
95498
+ const endIndex = alignedSeq.replace(/-+$/, "").length;
95499
+ const gapRanges = [
95500
+ startIndex > 0 && {
95501
+ start: 0,
95502
+ end: startIndex - 1,
95503
+ differenceType: "gap"
95504
+ },
95505
+ endIndex < seqLen && {
95506
+ start: endIndex,
95507
+ end: seqLen - 1,
95508
+ differenceType: "gap"
95509
+ }
95510
+ ].filter(Boolean);
95495
95511
  return __spreadProps(__spreadValues({}, track), {
95496
95512
  sequenceData: sequenceData2,
95497
95513
  matchHighlightRanges,
95498
- additionalSelectionLayers: matchHighlightRanges.filter(({ isMatch }) => !isMatch).map((range2) => {
95499
- return __spreadProps(__spreadValues(__spreadValues({}, range2), highlightRangeProps), {
95514
+ additionalSelectionLayers: [
95515
+ ...matchHighlightRanges.filter(({ isMatch }) => !isMatch).map((range2) => __spreadProps(__spreadValues(__spreadValues({}, range2), highlightRangeProps), {
95500
95516
  className: "veAlignmentMismatch"
95501
- });
95502
- }),
95517
+ })),
95518
+ ...gapRanges.map((range2) => __spreadProps(__spreadValues(__spreadValues({}, range2), highlightRangeProps), {
95519
+ className: "veAlignmentMismatch"
95520
+ }))
95521
+ ],
95522
+ gapRanges,
95503
95523
  mismatches
95504
95524
  });
95505
95525
  });
@@ -95633,23 +95653,30 @@ function getRangeMatchesBetweenTemplateAndNonTemplate(tempSeq, nonTempSeq) {
95633
95653
  const startIndex = seqLength - nonTempSeqWithoutLeadingDashes.length;
95634
95654
  const endIndex = seqLength - (seqLength - nonTempSeqWithoutTrailingDashes.length);
95635
95655
  for (let index2 = startIndex; index2 < endIndex; index2++) {
95636
- const isMatch = tempSeq[index2].toLowerCase() === nonTempSeq[index2].toLowerCase();
95637
- const previousRange = ranges[ranges.length - 1];
95638
- if (previousRange) {
95639
- if (previousRange.isMatch === isMatch) {
95640
- previousRange.end++;
95656
+ const tempBase = tempSeq[index2].toLowerCase();
95657
+ const nonTempBase = nonTempSeq[index2].toLowerCase();
95658
+ const isMatch = tempBase === nonTempBase;
95659
+ let differenceType = null;
95660
+ if (!isMatch) {
95661
+ if (tempBase === "-") {
95662
+ differenceType = "insertion";
95663
+ } else if (nonTempBase === "-") {
95664
+ differenceType = "deletion";
95641
95665
  } else {
95642
- ranges.push({
95643
- start: index2,
95644
- end: index2,
95645
- isMatch
95646
- });
95666
+ differenceType = "mismatch";
95647
95667
  }
95668
+ }
95669
+ const previousRange = ranges[ranges.length - 1];
95670
+ if (previousRange && previousRange.isMatch === isMatch && previousRange.differenceType === differenceType) {
95671
+ previousRange.end++;
95672
+ } else if (previousRange) {
95673
+ ranges.push({ start: index2, end: index2, isMatch, differenceType });
95648
95674
  } else {
95649
95675
  ranges.push({
95650
95676
  start: startIndex,
95651
95677
  end: startIndex,
95652
- isMatch
95678
+ isMatch,
95679
+ differenceType
95653
95680
  });
95654
95681
  }
95655
95682
  }
@@ -117227,7 +117254,7 @@ function showFileDialog({ multiple = false, onSelect }) {
117227
117254
  input.click();
117228
117255
  }
117229
117256
  __name(showFileDialog, "showFileDialog");
117230
- const version = "0.8.40";
117257
+ const version = "0.8.41";
117231
117258
  const packageJson = {
117232
117259
  version
117233
117260
  };
@@ -125096,11 +125123,13 @@ const _Minimap = class _Minimap extends React__default.Component {
125096
125123
  dimensions: { width = 200 },
125097
125124
  laneHeight,
125098
125125
  laneSpacing = 1,
125099
- isTrackSelected = []
125126
+ isTrackSelected = [],
125127
+ activeFilterType = "all"
125100
125128
  } = this.props;
125101
125129
  const charWidth2 = this.getCharWidth();
125102
125130
  const {
125103
125131
  matchHighlightRanges: _matchHighlightRanges,
125132
+ gapRanges = [],
125104
125133
  alignmentData: { trimmedRange } = {}
125105
125134
  } = alignmentTracks[i];
125106
125135
  const matchHighlightRanges = !trimmedRange ? _matchHighlightRanges : flatMap(_matchHighlightRanges, (r2) => {
@@ -125127,10 +125156,19 @@ const _Minimap = class _Minimap extends React__default.Component {
125127
125156
  charWidth2
125128
125157
  );
125129
125158
  const toAdd = `M${xStart},${y2} L${xStart + width2},${y2} L${xStart + width2},${y2 + height} L${xStart},${y2 + height}`;
125130
- if (!range2.isMatch) {
125159
+ if (!range2.isMatch && (activeFilterType === "all" || range2.differenceType === activeFilterType)) {
125131
125160
  redPath += toAdd;
125132
125161
  }
125133
125162
  });
125163
+ if (activeFilterType === "gap") {
125164
+ gapRanges.forEach((range2) => {
125165
+ const { xStart, width: width2 } = getXStartAndWidthFromNonCircularRange(
125166
+ range2,
125167
+ charWidth2
125168
+ );
125169
+ redPath += `M${xStart},${y2} L${xStart + width2},${y2} L${xStart + width2},${y2 + height} L${xStart},${y2 + height}`;
125170
+ });
125171
+ }
125134
125172
  return /* @__PURE__ */ React__default.createElement(
125135
125173
  "div",
125136
125174
  {
@@ -125160,7 +125198,8 @@ const _Minimap = class _Minimap extends React__default.Component {
125160
125198
  "scrollAlignmentView",
125161
125199
  "laneHeight",
125162
125200
  "laneSpacing",
125163
- "isTrackSelected"
125201
+ "isTrackSelected",
125202
+ "activeFilterType"
125164
125203
  ].some((key) => props[key] !== newProps[key]))
125165
125204
  return true;
125166
125205
  return false;
@@ -125438,6 +125477,66 @@ function getTrimmedRangesToDisplay({ trimmedRange, seqLen }) {
125438
125477
  return splitRangeIntoTwoPartsIfItIsCircular(inverted, seqLen);
125439
125478
  }
125440
125479
  __name(getTrimmedRangesToDisplay, "getTrimmedRangesToDisplay");
125480
+ function groupConsecutiveDifferences(differences) {
125481
+ const grouped = [];
125482
+ for (const diff of differences) {
125483
+ if (diff.type === "mismatch") {
125484
+ grouped.push(__spreadProps(__spreadValues({}, diff), { start: diff.position, end: diff.position }));
125485
+ continue;
125486
+ }
125487
+ const last2 = grouped[grouped.length - 1];
125488
+ if (last2 && last2.type === diff.type && last2.end === diff.position - 1) {
125489
+ grouped[grouped.length - 1] = __spreadProps(__spreadValues({}, last2), { end: diff.position });
125490
+ } else {
125491
+ grouped.push(__spreadProps(__spreadValues({}, diff), { start: diff.position, end: diff.position }));
125492
+ }
125493
+ }
125494
+ return grouped;
125495
+ }
125496
+ __name(groupConsecutiveDifferences, "groupConsecutiveDifferences");
125497
+ function findAlignmentDifferences(alignedSeqs) {
125498
+ var _a2;
125499
+ if (alignedSeqs.length < 2 || !((_a2 = alignedSeqs[0]) == null ? void 0 : _a2.length)) return [];
125500
+ const template = alignedSeqs[0].toLowerCase();
125501
+ const nonTemplates = alignedSeqs.slice(1).map((s2) => s2.toLowerCase());
125502
+ const trackBounds = nonTemplates.map((seq) => {
125503
+ const withoutLeading = seq.replace(/^-+/, "");
125504
+ const withoutTrailing = seq.replace(/-+$/, "");
125505
+ const start2 = seq.length - withoutLeading.length;
125506
+ const end2 = seq.length - (seq.length - withoutTrailing.length);
125507
+ return { start: start2, end: end2 };
125508
+ });
125509
+ const differences = [];
125510
+ for (let i = 0; i < template.length; i++) {
125511
+ const templateBase = template[i];
125512
+ const allNonTemplateBases = nonTemplates.map((seq) => seq[i]);
125513
+ const bases = [templateBase, ...allNonTemplateBases];
125514
+ const alignedIndices = trackBounds.reduce((acc, { start: start2, end: end2 }, idx) => {
125515
+ if (i >= start2 && i < end2) acc.push(idx);
125516
+ return acc;
125517
+ }, []);
125518
+ if (alignedIndices.length === 0) {
125519
+ differences.push({ position: i, type: "gap", bases });
125520
+ continue;
125521
+ }
125522
+ const alignedBases = alignedIndices.map((idx) => allNonTemplateBases[idx]);
125523
+ const templateIsGap = templateBase === "-";
125524
+ const nonTemplateHasBase = alignedBases.some((b3) => b3 !== "-");
125525
+ const nonTemplateHasGap = alignedBases.some((b3) => b3 === "-");
125526
+ if (templateIsGap && nonTemplateHasBase) {
125527
+ differences.push({ position: i, type: "insertion", bases });
125528
+ } else if (!templateIsGap && nonTemplateHasGap) {
125529
+ differences.push({ position: i, type: "deletion", bases });
125530
+ } else if (!templateIsGap) {
125531
+ const uniqueBases = /* @__PURE__ */ new Set([templateBase, ...alignedBases]);
125532
+ if (uniqueBases.size > 1) {
125533
+ differences.push({ position: i, type: "mismatch", bases });
125534
+ }
125535
+ }
125536
+ }
125537
+ return differences;
125538
+ }
125539
+ __name(findAlignmentDifferences, "findAlignmentDifferences");
125441
125540
  function scrollToAlignmentSelection() {
125442
125541
  const el = document.querySelector(".veCaret");
125443
125542
  if (el) {
@@ -125451,159 +125550,145 @@ function updateCaretPosition({ start: start2, end: end2 }) {
125451
125550
  }
125452
125551
  }
125453
125552
  __name(updateCaretPosition, "updateCaretPosition");
125553
+ const FILTER_OPTIONS = [
125554
+ { value: "all", label: "All" },
125555
+ { value: "mismatch", label: "Mismatches" },
125556
+ { value: "insertion", label: "Insertions" },
125557
+ { value: "deletion", label: "Deletions" },
125558
+ { value: "gap", label: "Gaps" }
125559
+ ];
125454
125560
  function FindMismatches(props) {
125455
- const { alignmentJson, id: id2 } = props;
125561
+ var _a2;
125562
+ const { alignmentJson, id: id2, onFilterChange } = props;
125456
125563
  const alignedSeqs = useMemo$1(
125457
125564
  () => alignmentJson.map((t2) => {
125458
- var _a2;
125459
- return ((_a2 = t2.alignmentData) == null ? void 0 : _a2.sequence) || "";
125565
+ var _a3;
125566
+ return ((_a3 = t2.alignmentData) == null ? void 0 : _a3.sequence) || "";
125460
125567
  }),
125461
125568
  [alignmentJson]
125462
125569
  );
125463
- const mismatches = useMemo$1(() => {
125464
- const result = [{ position: 0, bases: [""] }];
125465
- if (alignedSeqs.length > 1 && alignedSeqs[0].length) {
125466
- for (let i = 0; i < alignedSeqs[0].length; i++) {
125467
- const bases = alignedSeqs.map((seq) => seq[i]);
125468
- const uniqueBases = new Set(bases);
125469
- if (uniqueBases.size > 1 && !uniqueBases.has("-")) {
125470
- result.push({ position: i, bases });
125471
- }
125472
- }
125473
- }
125474
- return result;
125475
- }, [alignedSeqs]);
125570
+ const [activeFilter, setActiveFilter] = React__default.useState("all");
125571
+ const allDifferences = useMemo$1(
125572
+ () => groupConsecutiveDifferences(findAlignmentDifferences(alignedSeqs)),
125573
+ [alignedSeqs]
125574
+ );
125575
+ const countsByType = useMemo$1(() => {
125576
+ const counts = { all: 0, mismatch: 0, insertion: 0, deletion: 0, gap: 0 };
125577
+ allDifferences.forEach((d2) => {
125578
+ counts[d2.type] = (counts[d2.type] || 0) + 1;
125579
+ counts.all++;
125580
+ });
125581
+ return counts;
125582
+ }, [allDifferences]);
125583
+ const differences = useMemo$1(() => {
125584
+ const filtered = activeFilter === "all" ? allDifferences : allDifferences.filter((d2) => d2.type === activeFilter);
125585
+ return [{ position: -1, start: -1, end: -1, bases: [""] }, ...filtered];
125586
+ }, [allDifferences, activeFilter]);
125476
125587
  const currentCaretPosition = useSelector(
125477
125588
  (state2) => {
125478
- var _a2;
125479
- return (_a2 = state2.VectorEditor.__allEditorsOptions.alignments[id2]) == null ? void 0 : _a2.caretPosition;
125589
+ var _a3;
125590
+ return (_a3 = state2.VectorEditor.__allEditorsOptions.alignments[id2]) == null ? void 0 : _a3.caretPosition;
125480
125591
  }
125481
125592
  );
125482
125593
  const [currentIdx, setCurrentIdx] = React__default.useState(0);
125483
- const [disablePrev, setDisablePrev] = React__default.useState(true);
125484
- const [disableNext, setDisableNext] = React__default.useState(false);
125485
- const currentMismatch = mismatches[currentIdx];
125486
- const handleButtonsState = useCallback$1(
125487
- (caret) => {
125488
- if (mismatches.length <= 1) {
125489
- setDisablePrev(true);
125490
- setDisableNext(true);
125491
- return;
125492
- }
125493
- const firstMismatchPos = mismatches[1].position;
125494
- const lastMismatchPos = mismatches[mismatches.length - 1].position;
125495
- setDisablePrev(caret <= firstMismatchPos);
125496
- setDisableNext(caret >= lastMismatchPos);
125497
- },
125498
- [mismatches]
125499
- );
125594
+ const currentDiff = differences[currentIdx];
125595
+ const disablePrev = currentIdx <= 1;
125596
+ const disableNext = currentIdx >= differences.length - 1;
125597
+ useEffect(() => {
125598
+ setCurrentIdx(0);
125599
+ }, [activeFilter]);
125600
+ useEffect(() => {
125601
+ onFilterChange == null ? void 0 : onFilterChange({ activeFilter });
125602
+ }, [activeFilter, onFilterChange]);
125500
125603
  useEffect(() => {
125501
125604
  if (currentCaretPosition !== -1) {
125502
- const mismatchIdx = mismatches.findIndex(
125503
- (m2) => m2.position === currentCaretPosition || m2.position === currentCaretPosition - 1
125605
+ const diffIdx = differences.findIndex(
125606
+ (d2, i) => i > 0 && currentCaretPosition >= d2.start && currentCaretPosition <= d2.end + 1
125504
125607
  );
125505
- if (mismatchIdx !== -1 && mismatchIdx !== currentIdx) {
125506
- handleButtonsState(currentCaretPosition);
125507
- setCurrentIdx(mismatchIdx);
125608
+ if (diffIdx !== -1 && diffIdx !== currentIdx) {
125609
+ setCurrentIdx(diffIdx);
125508
125610
  }
125509
125611
  }
125510
- }, [currentCaretPosition, mismatches, currentIdx, handleButtonsState]);
125511
- const updateView = /* @__PURE__ */ __name((mismatch) => {
125512
- const idx = mismatches.indexOf(mismatch);
125513
- const position2 = mismatch.position;
125514
- handleButtonsState(position2);
125612
+ }, [currentCaretPosition, differences, currentIdx]);
125613
+ const updateView = /* @__PURE__ */ __name((diff) => {
125614
+ const idx = differences.indexOf(diff);
125615
+ const { start: start2, end: end2 } = diff;
125515
125616
  setCurrentIdx(idx);
125516
- updateCaretPosition({ start: position2, end: position2 });
125617
+ updateCaretPosition({ start: start2, end: end2 });
125517
125618
  setTimeout(() => {
125518
125619
  scrollToAlignmentSelection();
125519
125620
  }, 0);
125520
125621
  }, "updateView");
125521
- const prevMismatch = /* @__PURE__ */ __name(() => {
125522
- if (currentIdx > 1) {
125523
- const newIdx = Math.max(0, currentIdx - 1);
125524
- let prev = mismatches[newIdx];
125525
- if (currentCaretPosition > 0) {
125526
- prev = [...mismatches].reverse().find((m2) => m2.position < currentCaretPosition);
125527
- }
125528
- if (prev) {
125529
- updateView(prev);
125530
- }
125531
- }
125532
- }, "prevMismatch");
125533
- const nextMismatch = /* @__PURE__ */ __name(() => {
125534
- if (currentIdx < mismatches.length - 1) {
125535
- const newIdx = Math.min(mismatches.length - 1, currentIdx + 1);
125536
- let next = mismatches[newIdx];
125537
- if (currentCaretPosition > 0) {
125538
- next = mismatches.find(
125539
- (m2) => m2.position > currentCaretPosition && m2.position > 1
125540
- );
125541
- }
125542
- if (next) {
125543
- updateView(next);
125622
+ const prevDifference = /* @__PURE__ */ __name(() => {
125623
+ var _a3, _b2;
125624
+ const pivot = currentCaretPosition >= 0 ? currentCaretPosition : (_b2 = (_a3 = differences[currentIdx]) == null ? void 0 : _a3.start) != null ? _b2 : 0;
125625
+ const prev = [...differences].reverse().find((d2) => d2.start >= 0 && d2.start < pivot);
125626
+ if (prev) updateView(prev);
125627
+ }, "prevDifference");
125628
+ const nextDifference = /* @__PURE__ */ __name(() => {
125629
+ var _a3, _b2;
125630
+ const pivot = currentCaretPosition >= 0 ? currentCaretPosition : (_b2 = (_a3 = differences[currentIdx]) == null ? void 0 : _a3.start) != null ? _b2 : -1;
125631
+ const next = differences.find((d2) => d2.start > pivot && d2.start >= 0);
125632
+ if (next) updateView(next);
125633
+ }, "nextDifference");
125634
+ const noDifferences = differences.length <= 1;
125635
+ const activeOption = FILTER_OPTIONS.find((o2) => o2.value === activeFilter);
125636
+ const activeLabel = (_a2 = activeOption == null ? void 0 : activeOption.label) != null ? _a2 : "Differences";
125637
+ const filterMenu = /* @__PURE__ */ React__default.createElement(Menu, null, FILTER_OPTIONS.map(({ value, label }) => {
125638
+ var _a3;
125639
+ const count2 = (_a3 = countsByType[value]) != null ? _a3 : 0;
125640
+ const isActive2 = activeFilter === value;
125641
+ return /* @__PURE__ */ React__default.createElement(
125642
+ MenuItem,
125643
+ {
125644
+ key: value,
125645
+ active: isActive2,
125646
+ onClick: /* @__PURE__ */ __name(() => setActiveFilter(value), "onClick"),
125647
+ text: /* @__PURE__ */ React__default.createElement("span", { className: "veDiffMenuItem-inner" }, label, /* @__PURE__ */ React__default.createElement(Tag, { round: true, minimal: true, style: { marginLeft: 6 } }, count2))
125544
125648
  }
125545
- }
125546
- }, "nextMismatch");
125547
- return /* @__PURE__ */ React__default.createElement(
125548
- "div",
125649
+ );
125650
+ }));
125651
+ return /* @__PURE__ */ React__default.createElement("div", { className: "veDiffNavigator" }, /* @__PURE__ */ React__default.createElement(
125652
+ Popover,
125549
125653
  {
125550
- style: {
125551
- display: "flex",
125552
- flexDirection: "row",
125553
- justifyContent: "center",
125554
- alignItems: "center",
125555
- gap: 10
125556
- }
125557
- },
125558
- mismatches.length === 1 ? /* @__PURE__ */ React__default.createElement("span", { style: { fontStyle: "italic", color: "grey" } }, "no mismatches") : /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", flexDirection: "column" } }, /* @__PURE__ */ React__default.createElement(
125559
- "div",
125560
- {
125561
- style: {
125562
- display: "flex",
125563
- alignItems: "center"
125564
- }
125565
- },
125566
- /* @__PURE__ */ React__default.createElement("strong", null, "Mismatches"),
125567
- /* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", gap: 2 } }, /* @__PURE__ */ React__default.createElement(
125568
- Button,
125569
- {
125570
- intent: "primary",
125571
- icon: "arrow-left",
125572
- "data-tip": "Previous Mismatch",
125573
- onClick: prevMismatch,
125574
- disabled: disablePrev,
125575
- small: true,
125576
- minimal: true
125577
- }
125578
- ), /* @__PURE__ */ React__default.createElement(
125654
+ minimal: true,
125655
+ position: Position.BOTTOM_LEFT,
125656
+ content: filterMenu,
125657
+ target: /* @__PURE__ */ React__default.createElement(
125579
125658
  Button,
125580
125659
  {
125581
- intent: "primary",
125582
- icon: "arrow-right",
125583
- "data-tip": "Next Mismatch",
125584
- onClick: nextMismatch,
125585
- disabled: disableNext,
125660
+ minimal: true,
125661
+ "data-tip": "Filter Difference Type",
125586
125662
  small: true,
125587
- minimal: true
125588
- }
125589
- ))
125590
- ), /* @__PURE__ */ React__default.createElement(
125591
- "span",
125592
- {
125593
- style: {
125594
- fontSize: "0.8em",
125595
- color: "grey",
125596
- lineHeight: "0.8em"
125597
- }
125598
- },
125599
- currentMismatch.position > 1 && /* @__PURE__ */ React__default.createElement("span", null, "Position: ", currentMismatch.position + 1, " | "),
125600
- "(",
125601
- currentIdx,
125602
- " of ",
125603
- mismatches.length - 1,
125604
- ")"
125605
- ))
125606
- );
125663
+ rightIcon: "caret-down",
125664
+ className: "veDiffFilter-trigger"
125665
+ },
125666
+ activeLabel
125667
+ )
125668
+ }
125669
+ ), noDifferences ? /* @__PURE__ */ React__default.createElement("span", { className: "veDiffNav-empty" }, "no", " ", activeFilter === "all" ? "differences" : activeLabel.toLowerCase()) : /* @__PURE__ */ React__default.createElement("div", { className: "veDiffNav" }, /* @__PURE__ */ React__default.createElement(
125670
+ Button,
125671
+ {
125672
+ minimal: true,
125673
+ small: true,
125674
+ "data-tip": "Previous Difference",
125675
+ icon: "arrow-left",
125676
+ intent: Intent.PRIMARY,
125677
+ onClick: prevDifference,
125678
+ disabled: disablePrev
125679
+ }
125680
+ ), /* @__PURE__ */ React__default.createElement("div", { className: "veDiffNav-center" }, /* @__PURE__ */ React__default.createElement("span", { className: "veDiffNav-fraction" }, currentIdx, /* @__PURE__ */ React__default.createElement("span", { className: "veDiffNav-sep" }, "/"), differences.length - 1), (currentDiff == null ? void 0 : currentDiff.start) > -1 && /* @__PURE__ */ React__default.createElement("span", { className: "veDiffNav-pos" }, ":", currentDiff.start + 1)), /* @__PURE__ */ React__default.createElement(
125681
+ Button,
125682
+ {
125683
+ minimal: true,
125684
+ small: true,
125685
+ "data-tip": "Next Difference",
125686
+ icon: "arrow-right",
125687
+ intent: Intent.PRIMARY,
125688
+ onClick: nextDifference,
125689
+ disabled: disableNext
125690
+ }
125691
+ )));
125607
125692
  }
125608
125693
  __name(FindMismatches, "FindMismatches");
125609
125694
  function getGapMap(sequence2) {
@@ -126292,17 +126377,18 @@ const AlignmentVisibilityTool = pure(/* @__PURE__ */ __name(function AlignmentVi
126292
126377
  minimal: true,
126293
126378
  position: "bottom",
126294
126379
  content: /* @__PURE__ */ React__default.createElement(VisibilityOptions$2, __spreadValues({}, props)),
126295
- target: /* @__PURE__ */ React__default.createElement(Tooltip, { content: "Visibility Options" }, /* @__PURE__ */ React__default.createElement(
126380
+ target: /* @__PURE__ */ React__default.createElement(
126296
126381
  Button,
126297
126382
  {
126298
126383
  className: "tg-alignment-visibility-toggle",
126299
126384
  small: true,
126385
+ "data-tip": "Visibility Options",
126300
126386
  rightIcon: "caret-down",
126301
126387
  intent: Intent.PRIMARY,
126302
126388
  minimal: true,
126303
126389
  icon: "eye-open"
126304
126390
  }
126305
- ))
126391
+ )
126306
126392
  }
126307
126393
  );
126308
126394
  }, "AlignmentVisibilityTool"));
@@ -140090,6 +140176,10 @@ const AlignmentView = /* @__PURE__ */ __name((props) => {
140090
140176
  const [tempTrimAfter, setTempTrimAfter] = useState({});
140091
140177
  const [tempTrimmingCaret, setTempTrimmingCaret] = useState({});
140092
140178
  const [searchMatchLayers, setSearchMatchLayers] = React__default.useState([]);
140179
+ const [activeFilterType, setActiveFilterType] = useState("all");
140180
+ const handleFilterChange = useCallback$1(({ activeFilter }) => {
140181
+ setActiveFilterType(activeFilter);
140182
+ }, []);
140093
140183
  const bindOutsideChangeHelper = useRef({});
140094
140184
  const alignmentHolder = useRef(null);
140095
140185
  const alignmentHolderTop = useRef(null);
@@ -140815,7 +140905,9 @@ ${seqDataToCopy}\r
140815
140905
  chromatogramData
140816
140906
  }) : linearViewOptions)), {
140817
140907
  additionalSelectionLayers: [
140818
- ...additionalSelectionLayers || [],
140908
+ ...i !== 0 ? (additionalSelectionLayers || []).filter(
140909
+ (layer) => activeFilterType === "all" ? layer.differenceType !== "gap" : layer.differenceType === activeFilterType
140910
+ ) : additionalSelectionLayers || [],
140819
140911
  ...searchMatchLayers || []
140820
140912
  ],
140821
140913
  dimensions: {
@@ -141474,7 +141566,14 @@ ${seqDataToCopy}\r
141474
141566
  setSearchMatchLayers
141475
141567
  }
141476
141568
  ),
141477
- /* @__PURE__ */ React__default.createElement(FindMismatches, { alignmentJson: alignmentTracks, id: id2 }),
141569
+ /* @__PURE__ */ React__default.createElement(
141570
+ FindMismatches,
141571
+ {
141572
+ alignmentJson: alignmentTracks,
141573
+ id: id2,
141574
+ onFilterChange: handleFilterChange
141575
+ }
141576
+ ),
141478
141577
  additionalTopEl,
141479
141578
  saveMessage && /* @__PURE__ */ React__default.createElement(
141480
141579
  "div",
@@ -141575,6 +141674,7 @@ ${seqDataToCopy}\r
141575
141674
  }
141576
141675
  )),
141577
141676
  alignmentTracks,
141677
+ activeFilterType,
141578
141678
  dimensions: {
141579
141679
  width: Math.max(width, 10) || 10
141580
141680
  },