@sourcegraph/code-host-integration 0.0.92 → 0.0.93

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.
@@ -38942,9 +38942,9 @@ var require_graphql = __commonJS({
38942
38942
  }
38943
38943
  });
38944
38944
 
38945
- // ../../node_modules/.pnpm/ts-key-enum@2.0.8/node_modules/ts-key-enum/dist/js/Key.enum.js
38945
+ // ../../node_modules/.pnpm/ts-key-enum@2.0.12/node_modules/ts-key-enum/dist/js/Key.enum.js
38946
38946
  var require_Key_enum = __commonJS({
38947
- "../../node_modules/.pnpm/ts-key-enum@2.0.8/node_modules/ts-key-enum/dist/js/Key.enum.js"(exports) {
38947
+ "../../node_modules/.pnpm/ts-key-enum@2.0.12/node_modules/ts-key-enum/dist/js/Key.enum.js"(exports) {
38948
38948
  "use strict";
38949
38949
  Object.defineProperty(exports, "__esModule", { value: true });
38950
38950
  var Key3;
@@ -44703,7 +44703,7 @@ if (false) {
44703
44703
  throw new Error("No Link component set. You must call setLinkComponent to set the Link component to use.");
44704
44704
  });
44705
44705
  }
44706
- if (typeof globalThis.process !== "undefined" && process.env.JEST_WORKER_ID !== void 0) {
44706
+ if (globalThis.process !== void 0 && process.env.JEST_WORKER_ID !== void 0) {
44707
44707
  setLinkComponent(AnchorLink);
44708
44708
  }
44709
44709
  function setLinkComponent(component) {
@@ -46807,12 +46807,15 @@ var getAlignmentStyle = ({ alignment }) => (0, import_classnames8.default)(Typog
46807
46807
  var getFontWeightStyle = ({ weight }) => (0, import_classnames8.default)(Typography_module_default[`fontWeight${(0, import_lodash5.upperFirst)(weight)}`]);
46808
46808
  var getModeStyle = ({ mode }) => {
46809
46809
  switch (mode) {
46810
- case "single-line":
46810
+ case "single-line": {
46811
46811
  return Typography_module_default.singleLine;
46812
- case "break-word":
46812
+ }
46813
+ case "break-word": {
46813
46814
  return Typography_module_default.breakWord;
46814
- default:
46815
+ }
46816
+ default: {
46815
46817
  return "";
46818
+ }
46816
46819
  }
46817
46820
  };
46818
46821
 
@@ -46874,6 +46877,7 @@ var Alert = import_react23.default.forwardRef(function Alert2({ children, withIc
46874
46877
 
46875
46878
  // ../common/src/types/utils.ts
46876
46879
  var isDefined2 = (value) => value !== void 0 && value !== null;
46880
+ var defined = (values) => values.filter(isDefined2);
46877
46881
 
46878
46882
  // ../common/src/errors/utils.ts
46879
46883
  function tryCatch(function_) {
@@ -51614,7 +51618,7 @@ function memoizeObservable(func, resolver) {
51614
51618
 
51615
51619
  // ../common/src/util/strings.ts
51616
51620
  function sanitizeClass(value) {
51617
- return value.replace(/[^A-Za-z]/g, "-").toLowerCase();
51621
+ return value.replaceAll(/[^A-Za-z]/g, "-").toLowerCase();
51618
51622
  }
51619
51623
 
51620
51624
  // ../common/src/util/types.ts
@@ -51682,9 +51686,9 @@ function escapeRevspecForURL(revision) {
51682
51686
  function toViewStateHash(viewState) {
51683
51687
  return viewState ? `#tab=${viewState}` : "";
51684
51688
  }
51685
- var encodeURIPathComponent = (component) => component.split("/").map(encodeURIComponent).join("/").replace(/%2B/g, "+");
51689
+ var encodeURIPathComponent = (component) => component.split("/").map(encodeURIComponent).join("/").replaceAll("%2B", "+");
51686
51690
  var isExternalLink = (url) => !!tryCatch(() => new URL(url, window.location.href).origin !== window.location.origin);
51687
- var formatSearchParameters = (searchParameters) => searchParameters.toString().replace(/%2F/g, "/").replace(/%3A/g, ":").replace(/=&/g, "&").replace(/=$/, "");
51691
+ var formatSearchParameters = (searchParameters) => searchParameters.toString().replaceAll("%2F", "/").replaceAll("%3A", ":").replaceAll("=&", "&").replace(/=$/, "");
51688
51692
  var addLineRangeQueryParameter = (searchParameters, range) => {
51689
51693
  const existingLineRangeKey = findLineKeyInSearchParameters(searchParameters);
51690
51694
  if (existingLineRangeKey) {
@@ -52991,7 +52995,7 @@ function createHoverifier({
52991
52995
  }
52992
52996
  if (codeElements.length > 0) {
52993
52997
  const topRectangle = codeElements[0].element.getBoundingClientRect();
52994
- const bottomRectangle = codeElements[codeElements.length - 1].element.getBoundingClientRect();
52998
+ const bottomRectangle = codeElements.at(-1).element.getBoundingClientRect();
52995
52999
  const rectangle = {
52996
53000
  top: topRectangle.top,
52997
53001
  bottom: bottomRectangle.bottom,
@@ -55834,7 +55838,7 @@ function validateOperation(operation) {
55834
55838
  // ../../node_modules/.pnpm/@apollo+client@3.8.0-alpha.7_graphql-ws@5.14.1_graphql@15.4.0_react-dom@18.1.0_react@18.1.0/node_modules/@apollo/client/link/utils/createOperation.js
55835
55839
  function createOperation(starting, operation) {
55836
55840
  var context2 = __assign({}, starting);
55837
- var setContext2 = function(next) {
55841
+ var setContext3 = function(next) {
55838
55842
  if (typeof next === "function") {
55839
55843
  context2 = __assign(__assign({}, context2), next(context2));
55840
55844
  } else {
@@ -55846,7 +55850,7 @@ function createOperation(starting, operation) {
55846
55850
  };
55847
55851
  Object.defineProperty(operation, "setContext", {
55848
55852
  enumerable: false,
55849
- value: setContext2
55853
+ value: setContext3
55850
55854
  });
55851
55855
  Object.defineProperty(operation, "getContext", {
55852
55856
  enumerable: false,
@@ -61874,6 +61878,33 @@ var ApolloClient = function() {
61874
61878
  // ../../node_modules/.pnpm/@apollo+client@3.8.0-alpha.7_graphql-ws@5.14.1_graphql@15.4.0_react-dom@18.1.0_react@18.1.0/node_modules/@apollo/client/core/index.js
61875
61879
  setVerbosity(__DEV__ ? "log" : "silent");
61876
61880
 
61881
+ // ../../node_modules/.pnpm/@apollo+client@3.8.0-alpha.7_graphql-ws@5.14.1_graphql@15.4.0_react-dom@18.1.0_react@18.1.0/node_modules/@apollo/client/link/context/index.js
61882
+ function setContext(setter) {
61883
+ return new ApolloLink(function(operation, forward) {
61884
+ var request = __rest(operation, []);
61885
+ return new Observable2(function(observer) {
61886
+ var handle;
61887
+ var closed = false;
61888
+ Promise.resolve(request).then(function(req) {
61889
+ return setter(req, operation.getContext());
61890
+ }).then(operation.setContext).then(function() {
61891
+ if (closed)
61892
+ return;
61893
+ handle = forward(operation).subscribe({
61894
+ next: observer.next.bind(observer),
61895
+ error: observer.error.bind(observer),
61896
+ complete: observer.complete.bind(observer)
61897
+ });
61898
+ }).catch(observer.error.bind(observer));
61899
+ return function() {
61900
+ closed = true;
61901
+ if (handle)
61902
+ handle.unsubscribe();
61903
+ };
61904
+ });
61905
+ });
61906
+ }
61907
+
61877
61908
  // ../http-client/src/graphql/apollo/client.ts
61878
61909
  var import_lodash12 = __toESM(require_lodash());
61879
61910
 
@@ -61969,7 +62000,7 @@ var ConcurrentRequestsLink = class extends ApolloLink {
61969
62000
 
61970
62001
  // ../http-client/src/graphql/apollo/client.ts
61971
62002
  var getGraphQLClient = (0, import_lodash12.once)(async (options2) => {
61972
- const { headers, baseUrl, credentials, cache: cache3 } = options2;
62003
+ const { getHeaders: getHeaders2, baseUrl, credentials, cache: cache3 } = options2;
61973
62004
  const uri = buildGraphQLUrl({ baseUrl });
61974
62005
  const apolloClient = new ApolloClient({
61975
62006
  uri,
@@ -61996,15 +62027,23 @@ var getGraphQLClient = (0, import_lodash12.once)(async (options2) => {
61996
62027
  fetchPolicy: "network-only"
61997
62028
  }
61998
62029
  },
61999
- link: from2([
62000
- new ConcurrentRequestsLink(),
62001
- createHttpLink({
62002
- uri: ({ operationName }) => `${uri}?${operationName}`,
62003
- headers,
62004
- credentials,
62005
- fetch: customFetch
62006
- })
62007
- ])
62030
+ link: from2(
62031
+ defined([
62032
+ new ConcurrentRequestsLink(),
62033
+ getHeaders2 ? setContext((_request, previousContext) => ({
62034
+ ...previousContext,
62035
+ headers: {
62036
+ ...previousContext.headers,
62037
+ ...getHeaders2()
62038
+ }
62039
+ })) : null,
62040
+ createHttpLink({
62041
+ uri: ({ operationName }) => `${uri}?${operationName}`,
62042
+ credentials,
62043
+ fetch: customFetch
62044
+ })
62045
+ ])
62046
+ )
62008
62047
  });
62009
62048
  return Promise.resolve(apolloClient);
62010
62049
  });
@@ -62316,7 +62355,6 @@ function registerComlinkTransferHandlers() {
62316
62355
  }
62317
62356
  var syncRemoteSubscription = (subscriptionPromise) => (
62318
62357
  // We cannot pass the proxy subscription directly to Rx because it is a Proxy that looks like a function
62319
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
62320
62358
  new Subscription(async () => {
62321
62359
  const subscriptionProxy = await subscriptionPromise;
62322
62360
  await subscriptionProxy.unsubscribe();
@@ -63506,11 +63544,11 @@ function parseLineOrPositionOrRange(lineChar) {
63506
63544
  }
63507
63545
  }
63508
63546
  let lpr = { line, character, endLine, endCharacter };
63509
- if (typeof line === "undefined" || typeof endLine !== "undefined" && typeof character !== typeof endCharacter) {
63547
+ if (line === void 0 || endLine !== void 0 && typeof character !== typeof endCharacter) {
63510
63548
  lpr = {};
63511
- } else if (typeof character === "undefined") {
63512
- lpr = typeof endLine === "undefined" ? { line } : { line, endLine };
63513
- } else if (typeof endLine === "undefined" || typeof endCharacter === "undefined") {
63549
+ } else if (character === void 0) {
63550
+ lpr = endLine === void 0 ? { line } : { line, endLine };
63551
+ } else if (endLine === void 0 || endCharacter === void 0) {
63514
63552
  lpr = { line, character };
63515
63553
  } else {
63516
63554
  lpr = { line, character, endLine, endCharacter };
@@ -63542,7 +63580,7 @@ function parseLineOrPosition(string) {
63542
63580
  }
63543
63581
  line = typeof line === "number" && isNaN(line) ? void 0 : line;
63544
63582
  character = typeof character === "number" && isNaN(character) ? void 0 : character;
63545
- if (typeof line === "undefined") {
63583
+ if (line === void 0) {
63546
63584
  return { line: void 0, character: void 0 };
63547
63585
  }
63548
63586
  return { line, character };
@@ -63740,10 +63778,10 @@ function removeExtension(filePath) {
63740
63778
  return filePath.replace(/\.[^./]+$/, "");
63741
63779
  }
63742
63780
  function slashToDot(value) {
63743
- return value.replace(/\//g, ".");
63781
+ return value.replaceAll("/", ".");
63744
63782
  }
63745
63783
  function dotToSlash(value) {
63746
- return value.replace(/\./g, "/");
63784
+ return value.replaceAll(".", "/");
63747
63785
  }
63748
63786
 
63749
63787
  // ../shared/src/codeintel/legacy-extensions/language-specs/cpp.ts
@@ -63875,7 +63913,7 @@ function filterDefinitions4(results, { filePath, fileContent }) {
63875
63913
  });
63876
63914
  }
63877
63915
  function absoluteImportPath(importPath2) {
63878
- return importPath2.replace(/\./g, "/");
63916
+ return importPath2.replaceAll(".", "/");
63879
63917
  }
63880
63918
  function relativeImportPath(sourcePath, importPath2) {
63881
63919
  const match = /^\.(\.*)(.*)/.exec(importPath2);
@@ -63883,7 +63921,7 @@ function relativeImportPath(sourcePath, importPath2) {
63883
63921
  return void 0;
63884
63922
  }
63885
63923
  const [, parentDots, rest] = match;
63886
- return path3.join(path3.dirname(sourcePath), "../".repeat(parentDots.length), rest.replace(/\./g, "/"));
63924
+ return path3.join(path3.dirname(sourcePath), "../".repeat(parentDots.length), rest.replaceAll(".", "/"));
63887
63925
  }
63888
63926
  var pythonSpec = {
63889
63927
  languageID: "python",
@@ -64704,7 +64742,7 @@ async function updateSettings(platformContext, edit2) {
64704
64742
  if (!isSettingsValid(settings)) {
64705
64743
  throw new Error("invalid settings (internal error)");
64706
64744
  }
64707
- const subject = settings.subjects[settings.subjects.length - 1];
64745
+ const subject = settings.subjects.at(-1);
64708
64746
  await update(subject.subject.id, edit2);
64709
64747
  }
64710
64748
 
@@ -65386,55 +65424,69 @@ function getModeFromPath(path6) {
65386
65424
  }
65387
65425
  function getModeFromExactFilename(fileName) {
65388
65426
  switch (fileName.toLowerCase()) {
65389
- case "dockerfile":
65427
+ case "dockerfile": {
65390
65428
  return "dockerfile";
65429
+ }
65391
65430
  case "build":
65392
- case "workspace":
65431
+ case "workspace": {
65393
65432
  return "starlark";
65394
- default:
65433
+ }
65434
+ default: {
65395
65435
  return void 0;
65436
+ }
65396
65437
  }
65397
65438
  }
65398
65439
  function getModeFromExtension(extension) {
65399
65440
  switch (extension.toLowerCase()) {
65400
65441
  case "adb":
65401
65442
  case "ada":
65402
- case "ads":
65443
+ case "ads": {
65403
65444
  return "ada";
65445
+ }
65404
65446
  case "cls":
65405
65447
  case "apex":
65406
- case "trigger":
65448
+ case "trigger": {
65407
65449
  return "apex";
65408
- case "as":
65450
+ }
65451
+ case "as": {
65409
65452
  return "actionscript";
65410
- case "apacheconf":
65453
+ }
65454
+ case "apacheconf": {
65411
65455
  return "apache";
65456
+ }
65412
65457
  case "applescript":
65413
- case "scpt":
65458
+ case "scpt": {
65414
65459
  return "applescript";
65460
+ }
65415
65461
  case "sh":
65416
65462
  case "bash":
65417
- case "zsh":
65463
+ case "zsh": {
65418
65464
  return "shell";
65465
+ }
65419
65466
  case "clj":
65420
65467
  case "cljs":
65421
- case "cljx":
65468
+ case "cljx": {
65422
65469
  return "clojure";
65423
- case "css":
65470
+ }
65471
+ case "css": {
65424
65472
  return "css";
65473
+ }
65425
65474
  case "cmake":
65426
65475
  case "cmake.in":
65427
- case "in":
65476
+ case "in": {
65428
65477
  return "cmake";
65478
+ }
65429
65479
  case "coffee":
65430
65480
  case "cake":
65431
65481
  case "cson":
65432
65482
  case "cjsx":
65433
- case "iced":
65483
+ case "iced": {
65434
65484
  return "coffescript";
65485
+ }
65435
65486
  case "cs":
65436
- case "csx":
65487
+ case "csx": {
65437
65488
  return "csharp";
65489
+ }
65438
65490
  case "c":
65439
65491
  case "cc":
65440
65492
  case "cpp":
@@ -65445,72 +65497,93 @@ function getModeFromExtension(extension) {
65445
65497
  case "h":
65446
65498
  case "hpp":
65447
65499
  case "pc":
65448
- case "pcc":
65500
+ case "pcc": {
65449
65501
  return "cpp";
65502
+ }
65450
65503
  case "cu":
65451
- case "cuh":
65504
+ case "cuh": {
65452
65505
  return "cuda";
65453
- case "dart":
65506
+ }
65507
+ case "dart": {
65454
65508
  return "dart";
65509
+ }
65455
65510
  case "diff":
65456
- case "patch":
65511
+ case "patch": {
65457
65512
  return "diff";
65458
- case "jinja":
65513
+ }
65514
+ case "jinja": {
65459
65515
  return "django";
65516
+ }
65460
65517
  case "bat":
65461
- case "cmd":
65518
+ case "cmd": {
65462
65519
  return "dos";
65520
+ }
65463
65521
  case "ex":
65464
- case "exs":
65522
+ case "exs": {
65465
65523
  return "elixir";
65466
- case "elm":
65524
+ }
65525
+ case "elm": {
65467
65526
  return "elm";
65468
- case "erl":
65527
+ }
65528
+ case "erl": {
65469
65529
  return "erlang";
65530
+ }
65470
65531
  case "f":
65471
65532
  case "for":
65472
65533
  case "frt":
65473
65534
  case "fr":
65474
65535
  case "forth":
65475
65536
  case "4th":
65476
- case "fth":
65537
+ case "fth": {
65477
65538
  return "fortran";
65478
- case "fs":
65539
+ }
65540
+ case "fs": {
65479
65541
  return "fsharp";
65480
- case "go":
65542
+ }
65543
+ case "go": {
65481
65544
  return "go";
65482
- case "graphql":
65545
+ }
65546
+ case "graphql": {
65483
65547
  return "graphql";
65484
- case "groovy":
65548
+ }
65549
+ case "groovy": {
65485
65550
  return "groovy";
65486
- case "haml":
65551
+ }
65552
+ case "haml": {
65487
65553
  return "haml";
65554
+ }
65488
65555
  case "hbs":
65489
- case "handlebars":
65556
+ case "handlebars": {
65490
65557
  return "handlebars";
65558
+ }
65491
65559
  case "hs":
65492
- case "hsc":
65560
+ case "hsc": {
65493
65561
  return "haskell";
65562
+ }
65494
65563
  case "htm":
65495
65564
  case "html":
65496
- case "xhtml":
65565
+ case "xhtml": {
65497
65566
  return "html";
65567
+ }
65498
65568
  case "ini":
65499
65569
  case "cfg":
65500
65570
  case "prefs":
65501
65571
  case "pro":
65502
- case "properties":
65572
+ case "properties": {
65503
65573
  return "ini";
65504
- case "java":
65574
+ }
65575
+ case "java": {
65505
65576
  return "java";
65577
+ }
65506
65578
  case "js":
65507
65579
  case "jsx":
65508
65580
  case "es":
65509
65581
  case "es6":
65510
65582
  case "mjs":
65511
65583
  case "jss":
65512
- case "jsm":
65584
+ case "jsm": {
65513
65585
  return "javascript";
65586
+ }
65514
65587
  case "json":
65515
65588
  case "sublime_metrics":
65516
65589
  case "sublime_session":
@@ -65518,19 +65591,24 @@ function getModeFromExtension(extension) {
65518
65591
  case "sublime-mousemap":
65519
65592
  case "sublime-project":
65520
65593
  case "sublime-settings":
65521
- case "sublime-workspace":
65594
+ case "sublime-workspace": {
65522
65595
  return "json";
65596
+ }
65523
65597
  case "jsonnet":
65524
- case "libsonnet":
65598
+ case "libsonnet": {
65525
65599
  return "jsonnet";
65526
- case "jl":
65600
+ }
65601
+ case "jl": {
65527
65602
  return "julia";
65603
+ }
65528
65604
  case "kt":
65529
65605
  case "ktm":
65530
- case "kts":
65606
+ case "kts": {
65531
65607
  return "kotlin";
65532
- case "less":
65608
+ }
65609
+ case "less": {
65533
65610
  return "less";
65611
+ }
65534
65612
  case "lisp":
65535
65613
  case "asd":
65536
65614
  case "cl":
@@ -65539,27 +65617,33 @@ function getModeFromExtension(extension) {
65539
65617
  case "ny":
65540
65618
  case "podsl":
65541
65619
  case "sexp":
65542
- case "el":
65620
+ case "el": {
65543
65621
  return "lisp";
65622
+ }
65544
65623
  case "lua":
65545
65624
  case "fcgi":
65546
65625
  case "nse":
65547
65626
  case "pd_lua":
65548
65627
  case "rbxs":
65549
- case "wlua":
65628
+ case "wlua": {
65550
65629
  return "lua";
65630
+ }
65551
65631
  case "mk":
65552
- case "mak":
65632
+ case "mak": {
65553
65633
  return "makefile";
65634
+ }
65554
65635
  case "md":
65555
65636
  case "mkdown":
65556
- case "mkd":
65637
+ case "mkd": {
65557
65638
  return "markdown";
65558
- case "nginxconf":
65639
+ }
65640
+ case "nginxconf": {
65559
65641
  return "nginx";
65642
+ }
65560
65643
  case "m":
65561
- case "mm":
65644
+ case "mm": {
65562
65645
  return "objectivec";
65646
+ }
65563
65647
  case "ml":
65564
65648
  case "eliom":
65565
65649
  case "eliomi":
@@ -65567,12 +65651,14 @@ function getModeFromExtension(extension) {
65567
65651
  case "mli":
65568
65652
  case "mll":
65569
65653
  case "mly":
65570
- case "re":
65654
+ case "re": {
65571
65655
  return "ocaml";
65656
+ }
65572
65657
  case "p":
65573
65658
  case "pas":
65574
- case "pp":
65659
+ case "pp": {
65575
65660
  return "pascal";
65661
+ }
65576
65662
  case "pl":
65577
65663
  case "al":
65578
65664
  case "cgi":
@@ -65582,8 +65668,9 @@ function getModeFromExtension(extension) {
65582
65668
  case "pm":
65583
65669
  case "pod":
65584
65670
  case "psgi":
65585
- case "t":
65671
+ case "t": {
65586
65672
  return "perl";
65673
+ }
65587
65674
  case "php":
65588
65675
  case "phtml":
65589
65676
  case "php3":
@@ -65591,27 +65678,33 @@ function getModeFromExtension(extension) {
65591
65678
  case "php5":
65592
65679
  case "php6":
65593
65680
  case "php7":
65594
- case "phps":
65681
+ case "phps": {
65595
65682
  return "php";
65683
+ }
65596
65684
  case "ps1":
65597
65685
  case "psd1":
65598
- case "psm1":
65686
+ case "psm1": {
65599
65687
  return "powershell";
65600
- case "proto":
65688
+ }
65689
+ case "proto": {
65601
65690
  return "protobuf";
65691
+ }
65602
65692
  case "py":
65603
65693
  case "pyc":
65604
65694
  case "pyd":
65605
65695
  case "pyo":
65606
65696
  case "pyw":
65607
- case "pyz":
65697
+ case "pyz": {
65608
65698
  return "python";
65699
+ }
65609
65700
  case "r":
65610
65701
  case "rd":
65611
- case "rsx":
65702
+ case "rsx": {
65612
65703
  return "r";
65613
- case "repro":
65704
+ }
65705
+ case "repro": {
65614
65706
  return "reprolang";
65707
+ }
65615
65708
  case "rb":
65616
65709
  case "builder":
65617
65710
  case "eye":
@@ -65630,61 +65723,81 @@ function getModeFromExtension(extension) {
65630
65723
  case "ruby":
65631
65724
  case "spec":
65632
65725
  case "thor":
65633
- case "watchr":
65726
+ case "watchr": {
65634
65727
  return "ruby";
65728
+ }
65635
65729
  case "rs":
65636
- case "rs.in":
65730
+ case "rs.in": {
65637
65731
  return "rust";
65732
+ }
65638
65733
  case "sass":
65639
- case "scss":
65734
+ case "scss": {
65640
65735
  return "scss";
65736
+ }
65641
65737
  case "sbt":
65642
65738
  case "sc":
65643
- case "scala":
65739
+ case "scala": {
65644
65740
  return "scala";
65741
+ }
65645
65742
  case "bzl":
65646
- case "bazel":
65743
+ case "bazel": {
65647
65744
  return "starlark";
65648
- case "strato":
65745
+ }
65746
+ case "strato": {
65649
65747
  return "strato";
65748
+ }
65650
65749
  case "scm":
65651
65750
  case "sch":
65652
65751
  case "sls":
65653
65752
  case "sps":
65654
- case "ss":
65753
+ case "ss": {
65655
65754
  return "scheme";
65656
- case "st":
65755
+ }
65756
+ case "st": {
65657
65757
  return "smalltalk";
65658
- case "sql":
65758
+ }
65759
+ case "sql": {
65659
65760
  return "sql";
65660
- case "styl":
65761
+ }
65762
+ case "styl": {
65661
65763
  return "stylus";
65662
- case "swift":
65764
+ }
65765
+ case "swift": {
65663
65766
  return "swift";
65664
- case "thrift":
65767
+ }
65768
+ case "thrift": {
65665
65769
  return "thrift";
65770
+ }
65666
65771
  case "ts":
65667
- case "tsx":
65772
+ case "tsx": {
65668
65773
  return "typescript";
65669
- case "twig":
65774
+ }
65775
+ case "twig": {
65670
65776
  return "twig";
65671
- case "vb":
65777
+ }
65778
+ case "vb": {
65672
65779
  return "vbnet";
65673
- case "vbs":
65780
+ }
65781
+ case "vbs": {
65674
65782
  return "vbscrip";
65783
+ }
65675
65784
  case "v":
65676
65785
  case "veo":
65677
65786
  case "sv":
65678
65787
  case "svh":
65679
- case "svi":
65788
+ case "svi": {
65680
65789
  return "verilog";
65790
+ }
65681
65791
  case "vhd":
65682
- case "vhdl":
65792
+ case "vhdl": {
65683
65793
  return "vhdl";
65684
- case "vim":
65794
+ }
65795
+ case "vim": {
65685
65796
  return "vim";
65686
- case "xlsg":
65797
+ }
65798
+ case "xlsg": {
65687
65799
  return "xlsg";
65800
+ }
65688
65801
  case "xml":
65689
65802
  case "adml":
65690
65803
  case "admx":
@@ -65771,15 +65884,19 @@ function getModeFromExtension(extension) {
65771
65884
  case "xsd":
65772
65885
  case "xspec":
65773
65886
  case "xul":
65774
- case "zcml":
65887
+ case "zcml": {
65775
65888
  return "xml";
65776
- case "zig":
65889
+ }
65890
+ case "zig": {
65777
65891
  return "zig";
65892
+ }
65778
65893
  case "yml":
65779
- case "yaml":
65894
+ case "yaml": {
65780
65895
  return "yaml";
65781
- default:
65896
+ }
65897
+ default: {
65782
65898
  return void 0;
65899
+ }
65783
65900
  }
65784
65901
  }
65785
65902
  function getPathExtension(path6) {
@@ -65790,7 +65907,7 @@ function getPathExtension(path6) {
65790
65907
  if (pathSplit.length === 2 && pathSplit[0] === "") {
65791
65908
  return "";
65792
65909
  }
65793
- return pathSplit[pathSplit.length - 1].toLowerCase();
65910
+ return pathSplit.at(-1).toLowerCase();
65794
65911
  }
65795
65912
 
65796
65913
  // ../shared/src/tracking/utm.ts
@@ -68543,7 +68660,7 @@ function querySelectorAcrossShadowRoots(element, selectors) {
68543
68660
  }
68544
68661
  let currentElement = element;
68545
68662
  const selectorsExceptLast = selectors.slice(0, -1);
68546
- const lastSelector = selectors[selectors.length - 1];
68663
+ const lastSelector = selectors.at(-1);
68547
68664
  for (const selector of selectorsExceptLast) {
68548
68665
  if (!currentElement) {
68549
68666
  return null;
@@ -68770,7 +68887,7 @@ function getDiffResolvedRevision(codeView) {
68770
68887
  if (shaContainers && shaContainers.length === 2) {
68771
68888
  const baseShaElement = shaContainers[0].querySelector("a");
68772
68889
  if (baseShaElement) {
68773
- baseCommitID = baseShaElement.href.split("/").slice(-1)[0];
68890
+ baseCommitID = baseShaElement.href.split("/").at(-1);
68774
68891
  }
68775
68892
  const headShaElement = shaContainers[1].querySelector("span.sha");
68776
68893
  if (headShaElement) {
@@ -68865,10 +68982,12 @@ function isDiffPageType(pageType) {
68865
68982
  switch (pageType) {
68866
68983
  case "commit":
68867
68984
  case "pull":
68868
- case "compare":
68985
+ case "compare": {
68869
68986
  return true;
68870
- default:
68987
+ }
68988
+ default: {
68871
68989
  return false;
68990
+ }
68872
68991
  }
68873
68992
  }
68874
68993
  function parseURL(location2 = window.location) {
@@ -68881,19 +69000,22 @@ function parseURL(location2 = window.location) {
68881
69000
  const rawRepoName = `${host3}/${repoName}`;
68882
69001
  switch (pageType) {
68883
69002
  case "blob":
68884
- case "tree":
69003
+ case "tree": {
68885
69004
  return {
68886
69005
  pageType,
68887
69006
  rawRepoName,
68888
69007
  revisionAndFilePath: decodeURIComponent(rest.join("/")),
68889
69008
  repoName
68890
69009
  };
69010
+ }
68891
69011
  case "pull":
68892
69012
  case "commit":
68893
- case "compare":
69013
+ case "compare": {
68894
69014
  return { pageType, rawRepoName, repoName };
68895
- default:
69015
+ }
69016
+ default: {
68896
69017
  return { pageType: "other", rawRepoName, repoName };
69018
+ }
68897
69019
  }
68898
69020
  }
68899
69021
  var oldUISelectors = {
@@ -69258,7 +69380,7 @@ var createFileLineContainerToolbarMount = (codeViewElement) => {
69258
69380
  mountElement.style.verticalAlign = "middle";
69259
69381
  mountElement.style.alignItems = "center";
69260
69382
  mountElement.className = className2;
69261
- const container = codeViewElement.querySelector("#repos-sticky-header")?.childNodes[0]?.childNodes[0]?.childNodes[1]?.childNodes[2];
69383
+ const container = codeViewElement.querySelector("#repos-sticky-header .react-blob-header-edit-and-raw-actions");
69262
69384
  if (container instanceof HTMLElement) {
69263
69385
  container.prepend(mountElement);
69264
69386
  return mountElement;
@@ -69431,14 +69553,18 @@ var getGithubResultType = () => {
69431
69553
  var getSourcegraphResultType = () => {
69432
69554
  const githubResultType = getGithubResultType();
69433
69555
  switch (githubResultType) {
69434
- case "repositories":
69556
+ case "repositories": {
69435
69557
  return "repo";
69436
- case "commits":
69558
+ }
69559
+ case "commits": {
69437
69560
  return "commit";
69438
- case "code":
69561
+ }
69562
+ case "code": {
69439
69563
  return "";
69440
- default:
69564
+ }
69565
+ default: {
69441
69566
  return isSimpleSearchPage() || isAdvancedSearchPage() ? "repo" : "";
69567
+ }
69442
69568
  }
69443
69569
  };
69444
69570
  var getSourcegraphResultLanguage = () => new URLSearchParams(window.location.search).get("l");
@@ -73287,14 +73413,18 @@ var getPageKindFromPathName = (owner, projectName, pathname) => {
73287
73413
  return 3 /* Other */;
73288
73414
  }
73289
73415
  switch (pageKindMatch[2]) {
73290
- case "commit":
73416
+ case "commit": {
73291
73417
  return 1 /* Commit */;
73292
- case "merge_requests":
73418
+ }
73419
+ case "merge_requests": {
73293
73420
  return 2 /* MergeRequest */;
73294
- case "blob":
73421
+ }
73422
+ case "blob": {
73295
73423
  return 0 /* File */;
73296
- default:
73424
+ }
73425
+ default: {
73297
73426
  return 3 /* Other */;
73427
+ }
73298
73428
  }
73299
73429
  };
73300
73430
  var getGitlabRepoURL = () => {
@@ -74901,7 +75031,6 @@ function createMainThreadExtensionGraphQLHelpers() {
74901
75031
  const graphqlClient = {
74902
75032
  watchQuery: ({ variables, query }) => (
74903
75033
  // Temporary implementation till Apollo-Client is configured in the background script.
74904
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
74905
75034
  requestGraphQLInBackground({
74906
75035
  request: print(query),
74907
75036
  variables,
@@ -74938,7 +75067,7 @@ function createGraphQLHelpers(sourcegraphURL, isExtension2) {
74938
75067
  const getBrowserGraphQLClient = (0, import_lodash30.once)(
74939
75068
  () => getGraphQLClient({
74940
75069
  cache: cache2,
74941
- headers: getHeaders(),
75070
+ getHeaders,
74942
75071
  baseUrl: sourcegraphURL,
74943
75072
  credentials: "include"
74944
75073
  })
@@ -75034,7 +75163,7 @@ function browserPortToMessagePort(browserPort, prefix, connect) {
75034
75163
  };
75035
75164
  }
75036
75165
  function replaceValueAtPath(value, path6, newValue) {
75037
- const lastProperty = path6[path6.length - 1];
75166
+ const lastProperty = path6.at(-1);
75038
75167
  for (const property2 of path6.slice(0, -1)) {
75039
75168
  value = value[property2];
75040
75169
  }
@@ -75128,7 +75257,7 @@ function getURLsForInlineExtension(extensionID, assetsURL) {
75128
75257
  const kebabCaseExtensionID = extensionID.replace(/^sourcegraph\//, "sourcegraph-");
75129
75258
  const manifestPath = `extensions/${kebabCaseExtensionID}/package.json`;
75130
75259
  const scriptPath = `extensions/${kebabCaseExtensionID}/extension.js`;
75131
- if (typeof window.browser !== "undefined") {
75260
+ if (window.browser !== void 0) {
75132
75261
  return {
75133
75262
  manifestURL: browser.runtime.getURL(manifestPath),
75134
75263
  scriptURL: browser.runtime.getURL(scriptPath)