@ai-ecoverse/slicc-spectrum 1.109.1 → 1.110.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/slicc-ui.js CHANGED
@@ -17944,14 +17944,14 @@ var resolver = {
17944
17944
  };
17945
17945
  var string = initializeFactory("string");
17946
17946
  var text = initializeFactory("text");
17947
- function initializeFactory(field) {
17947
+ function initializeFactory(field2) {
17948
17948
  return {
17949
- resolveAll: createResolver(field === "text" ? resolveAllLineSuffixes : void 0),
17949
+ resolveAll: createResolver(field2 === "text" ? resolveAllLineSuffixes : void 0),
17950
17950
  tokenize: initializeText
17951
17951
  };
17952
17952
  function initializeText(effects) {
17953
17953
  const self2 = this;
17954
- const constructs2 = this.parser.constructs[field];
17954
+ const constructs2 = this.parser.constructs[field2];
17955
17955
  const text4 = effects.attempt(constructs2, start2, notText);
17956
17956
  return start2;
17957
17957
  function start2(code3) {
@@ -33620,8 +33620,8 @@ function question(item2, handlers) {
33620
33620
  } else {
33621
33621
  const submit = (event2) => {
33622
33622
  event2.preventDefault();
33623
- const field = event2.currentTarget.querySelector("input");
33624
- if (field.value.trim()) answer(field.value.trim());
33623
+ const field2 = event2.currentTarget.querySelector("input");
33624
+ if (field2.value.trim()) answer(field2.value.trim());
33625
33625
  };
33626
33626
  body2 = b`<form class="options" @submit=${submit}>
33627
33627
  <input class="input" type=${item2.kind === "email" ? "email" : item2.kind === "number" ? "number" : item2.kind === "date" ? "date" : "text"} aria-label=${item2.question} ?disabled=${handlers.readOnly} />
@@ -34891,8 +34891,8 @@ function failureText(error) {
34891
34891
  const text4 = isVaultFailure(error) ? codeTexts[error.code] : void 0;
34892
34892
  return text4 ?? (error instanceof Error ? error.message : "The vault did not answer");
34893
34893
  }
34894
- function fieldOf(error, field) {
34895
- return isVaultFailure(error) && error.code === "EINVAL" ? field : null;
34894
+ function fieldOf(error, field2) {
34895
+ return isVaultFailure(error) && error.code === "EINVAL" ? field2 : null;
34896
34896
  }
34897
34897
  function away(vault) {
34898
34898
  const state2 = vault.availability?.() ?? (vault.status() ? "ready" : "waiting");
@@ -35814,12 +35814,12 @@ var SliccComposer = class extends ThemedElement {
35814
35814
  this.renderRoot.querySelector('.item[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
35815
35815
  }
35816
35816
  #wire() {
35817
- const field = this.#field;
35818
- void field.updateComplete.then(() => {
35817
+ const field2 = this.#field;
35818
+ void field2.updateComplete.then(() => {
35819
35819
  const popover = this.renderRoot.querySelector("swc-popover");
35820
35820
  if (popover) {
35821
35821
  popover.triggerElement = null;
35822
- popover.triggerElement = field.shadowRoot.querySelector(
35822
+ popover.triggerElement = field2.shadowRoot.querySelector(
35823
35823
  ".swc-PromptField-upload"
35824
35824
  );
35825
35825
  }
@@ -36030,16 +36030,16 @@ ${this.value}` : text4;
36030
36030
  text4 === null || text4 === void 0 ? { ...base, kind: "file", size: 0, error: "Could not read the file" } : { ...base, kind: "text", size: text4.length, text: text4 }
36031
36031
  ];
36032
36032
  }
36033
- async shareSecret(name, field = null) {
36033
+ async shareSecret(name, field2 = null) {
36034
36034
  const clean = name.trim().toUpperCase().replace(/[^A-Z0-9_]/g, "_");
36035
36035
  if (this.sharing) return;
36036
36036
  if (!clean) {
36037
- if (field) this.#refuse("Enter a name", "name", true);
36037
+ if (field2) this.#refuse("Enter a name", "name", true);
36038
36038
  return;
36039
36039
  }
36040
- const value = field ? take(field) : "";
36040
+ const value = field2 ? take(field2) : "";
36041
36041
  const vault = this.model?.vault;
36042
- if (field && vault?.put && !await this.#store(vault, clean, value)) return;
36042
+ if (field2 && vault?.put && !await this.#store(vault, clean, value)) return;
36043
36043
  this.#refuse(null);
36044
36044
  this.attachments = [
36045
36045
  ...this.attachments,
@@ -36053,12 +36053,12 @@ ${this.value}` : text4;
36053
36053
  ];
36054
36054
  this.popup = null;
36055
36055
  }
36056
- #refuse(text4, field = null, focus = false) {
36056
+ #refuse(text4, field2 = null, focus = false) {
36057
36057
  this.secretError = text4;
36058
- this.secretField = text4 ? field : null;
36059
- if (focus && text4 && field)
36058
+ this.secretField = text4 ? field2 : null;
36059
+ if (focus && text4 && field2)
36060
36060
  void this.updateComplete.then(
36061
- () => this.renderRoot.querySelector(`form.secret input[name=${field}]`)?.focus()
36061
+ () => this.renderRoot.querySelector(`form.secret input[name=${field2}]`)?.focus()
36062
36062
  );
36063
36063
  }
36064
36064
  async #store(vault, clean, value) {
@@ -36655,6 +36655,93 @@ function dipsOf(node2) {
36655
36655
  return null;
36656
36656
  }
36657
36657
 
36658
+ // src/app/model-picker.ts
36659
+ var searchable = 5;
36660
+ var field = "sp-search[data-action=filter-models]";
36661
+ var modelFilterCss = i`
36662
+ sp-search[data-action='filter-models'] {
36663
+ position: sticky;
36664
+ inset-block-start: 0;
36665
+ z-index: 1;
36666
+ box-sizing: border-box;
36667
+ width: 100%;
36668
+ padding: var(--swc-spacing-75) var(--swc-spacing-100);
36669
+ background: var(--mod-popover-background-color, var(--spectrum-popover-background-color));
36670
+ }
36671
+ `;
36672
+ function matchesModel(option, query) {
36673
+ const text4 = `${option.label} ${option.provider} ${option.id}`.toLowerCase();
36674
+ return query.toLowerCase().split(/\s+/).every((word2) => text4.includes(word2));
36675
+ }
36676
+ function visible(picker) {
36677
+ return [...picker.querySelectorAll("sp-menu-item[value]")].find(
36678
+ (item2) => !item2.hidden
36679
+ );
36680
+ }
36681
+ var ModelFilter = class {
36682
+ #host;
36683
+ #query = "";
36684
+ constructor(host4) {
36685
+ this.#host = host4;
36686
+ }
36687
+ #set(query) {
36688
+ if (query === this.#query) return;
36689
+ this.#query = query;
36690
+ this.#host.requestUpdate();
36691
+ }
36692
+ items(options2) {
36693
+ if (options2.length <= searchable)
36694
+ return b`${options2.map((option) => this.#item(option, false))}`;
36695
+ const shown4 = options2.filter((option) => matchesModel(option, this.#query));
36696
+ return b`<sp-search
36697
+ size="s"
36698
+ data-action="filter-models"
36699
+ label="Filter models"
36700
+ placeholder="Filter models"
36701
+ .value=${this.#query}
36702
+ @input=${(event2) => this.#set(event2.target.value)}
36703
+ @change=${(event2) => event2.stopPropagation()}
36704
+ @submit=${(event2) => event2.preventDefault()}
36705
+ @keydown=${this.#key}
36706
+ ></sp-search>
36707
+ ${options2.map((option) => this.#item(option, !shown4.includes(option)))}
36708
+ ${shown4.length ? A : b`<sp-menu-item disabled data-empty>No matching models</sp-menu-item>`}`;
36709
+ }
36710
+ #item(option, hidden) {
36711
+ return b`<sp-menu-item value=${option.id} ?hidden=${hidden}>${option.label}<span slot="description">${option.provider}</span></sp-menu-item>`;
36712
+ }
36713
+ opened = (event2) => {
36714
+ const search3 = event2.currentTarget.querySelector(field);
36715
+ if (search3) queueMicrotask(() => search3.focus());
36716
+ };
36717
+ closed = () => this.#set("");
36718
+ keys = {
36719
+ capture: true,
36720
+ handleEvent: (event2) => {
36721
+ const picker = event2.currentTarget;
36722
+ const search3 = picker.querySelector(field);
36723
+ if (!search3 || !picker.open) return;
36724
+ if (event2.target === search3) {
36725
+ if (event2.key === "Escape" && this.#query) event2.preventDefault();
36726
+ return;
36727
+ }
36728
+ if (event2.key.trim().length !== 1 || event2.ctrlKey || event2.metaKey || event2.altKey) return;
36729
+ search3.focus();
36730
+ const end = search3.focusElement.value.length;
36731
+ search3.focusElement.setSelectionRange(end, end);
36732
+ }
36733
+ };
36734
+ #key = (event2) => {
36735
+ if (event2.key === "Tab" || event2.key === "Escape" && !event2.defaultPrevented) return;
36736
+ event2.stopPropagation();
36737
+ if (event2.key !== "ArrowDown" && event2.key !== "Enter") return;
36738
+ event2.preventDefault();
36739
+ const first2 = visible(event2.currentTarget.parentElement);
36740
+ if (event2.key === "Enter") first2?.click();
36741
+ else first2?.focus();
36742
+ };
36743
+ };
36744
+
36658
36745
  // src/app/models.ts
36659
36746
  var asked = /* @__PURE__ */ new WeakMap();
36660
36747
  var switched = /* @__PURE__ */ new WeakMap();
@@ -37110,6 +37197,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
37110
37197
  };
37111
37198
  static styles = [
37112
37199
  shared,
37200
+ modelFilterCss,
37113
37201
  fade,
37114
37202
  markdownCss,
37115
37203
  messageCss,
@@ -37352,6 +37440,7 @@ var SliccChat = class _SliccChat extends ThemedElement {
37352
37440
  }
37353
37441
  `
37354
37442
  ];
37443
+ #modelFilter = new ModelFilter(this);
37355
37444
  #licks = new ViewSet(this, "chat:licks");
37356
37445
  #runs = new ViewSet(this, "chat:runs");
37357
37446
  #details = /* @__PURE__ */ new Set();
@@ -37885,8 +37974,8 @@ var SliccChat = class _SliccChat extends ThemedElement {
37885
37974
  }
37886
37975
  const offered = chatModels(model.settings.models());
37887
37976
  return b`${statusLight(agent.status)}
37888
- ${offered.length ? b`<sp-picker size="s" quiet label="Model" value=${agent.model} @change=${(event2) => model.agent.setModel(agent.id, event2.target.value)}>
37889
- ${offered.map((option) => b`<sp-menu-item value=${option.id}>${option.label}<span slot="description">${option.provider}</span></sp-menu-item>`)}
37977
+ ${offered.length ? b`<sp-picker size="s" quiet label="Model" value=${agent.model} @change=${(event2) => model.agent.setModel(agent.id, event2.target.value)} @sp-opened=${this.#modelFilter.opened} @sp-closed=${this.#modelFilter.closed} @keydown=${this.#modelFilter.keys}>
37978
+ ${this.#modelFilter.items(offered)}
37890
37979
  </sp-picker>` : b`<swc-action-button size="s" quiet data-action="set-up-model" @click=${() => this.#action("settings")}>Set up a model</swc-action-button>`}
37891
37980
  <sp-picker size="s" quiet label="Thinking" value=${model.settings.get().thinking} @change=${(event2) => model.settings.update({ thinking: event2.target.value })}>
37892
37981
  <sp-menu-item value="off">No thinking</sp-menu-item>
@@ -41015,9 +41104,9 @@ var defaultGates = {
41015
41104
  messages: ["user", "agent", "cone", "scoop:*", "off"],
41016
41105
  tools: ["user", "agent", "scoop:*"]
41017
41106
  };
41018
- function gateChoice(field, cone, gate) {
41107
+ function gateChoice(field2, cone, gate) {
41019
41108
  if (gate === "scoop:*")
41020
- return cone.scoops.flatMap((name) => gateChoice(field, cone, `scoop:${name}`));
41109
+ return cone.scoops.flatMap((name) => gateChoice(field2, cone, `scoop:${name}`));
41021
41110
  if (gate.startsWith("scoop:")) {
41022
41111
  const name = gate.slice(6);
41023
41112
  return cone.scoops.includes(name) ? [{ value: gate, label: `${name} decides`, description: `The scoop ${name} decides.` }] : [];
@@ -41037,14 +41126,14 @@ function gateChoice(field, cone, gate) {
41037
41126
  off: {
41038
41127
  value: "off",
41039
41128
  label: "No review",
41040
- description: field === "messages" ? "Messages go straight in as follow-ups." : "Tool calls run without review."
41129
+ description: field2 === "messages" ? "Messages go straight in as follow-ups." : "Tool calls run without review."
41041
41130
  }
41042
41131
  };
41043
41132
  return choices[gate] ? [choices[gate]] : [];
41044
41133
  }
41045
- function gateOptions(field, cone, allowed = defaultGates[field]) {
41046
- const options2 = allowed.flatMap((gate) => gateChoice(field, cone, gate)).filter((option, index2, all2) => all2.findIndex(({ value }) => value === option.value) === index2);
41047
- return options2.length ? options2 : gateChoice(field, cone, "user");
41134
+ function gateOptions(field2, cone, allowed = defaultGates[field2]) {
41135
+ const options2 = allowed.flatMap((gate) => gateChoice(field2, cone, gate)).filter((option, index2, all2) => all2.findIndex(({ value }) => value === option.value) === index2);
41136
+ return options2.length ? options2 : gateChoice(field2, cone, "user");
41048
41137
  }
41049
41138
  function defaultGate(options2) {
41050
41139
  return options2.some(({ value }) => value === "user") ? "user" : options2[0].value;
@@ -41189,11 +41278,11 @@ var SliccGuestInvite = class extends i2 {
41189
41278
  get #current() {
41190
41279
  return this.cones.find((cone) => cone.id === this.cone) ?? this.cones[0];
41191
41280
  }
41192
- #options(field, cone) {
41193
- return gateOptions(field, cone, this.port?.gates?.()[field]);
41281
+ #options(field2, cone) {
41282
+ return gateOptions(field2, cone, this.port?.gates?.()[field2]);
41194
41283
  }
41195
- #keep(gate, field, cone) {
41196
- const options2 = this.#options(field, cone);
41284
+ #keep(gate, field2, cone) {
41285
+ const options2 = this.#options(field2, cone);
41197
41286
  return options2.some((option) => option.value === gate) ? gate : defaultGate(options2);
41198
41287
  }
41199
41288
  #settle() {
@@ -41265,18 +41354,18 @@ var SliccGuestInvite = class extends i2 {
41265
41354
  this.remove();
41266
41355
  if (this.trigger?.isConnected) this.trigger.focus();
41267
41356
  }
41268
- #gate(field, title2, value) {
41269
- const options2 = this.#options(field, this.#current);
41357
+ #gate(field2, title2, value) {
41358
+ const options2 = this.#options(field2, this.#current);
41270
41359
  const chosen = options2.find((option) => option.value === value);
41271
- const id = `guest-${field}`;
41360
+ const id = `guest-${field2}`;
41272
41361
  return b`<div class="field">
41273
41362
  <sp-field-label for=${id} size="m">${title2}</sp-field-label>
41274
- <sp-picker id=${id} size="m" label=${title2} data-action=${`guest-${field}`} .value=${l(value)} ?disabled=${this.pending} @change=${(event2) => {
41275
- this[field] = this.#pick(event2);
41363
+ <sp-picker id=${id} size="m" label=${title2} data-action=${`guest-${field2}`} .value=${l(value)} ?disabled=${this.pending} @change=${(event2) => {
41364
+ this[field2] = this.#pick(event2);
41276
41365
  }}>
41277
41366
  ${options2.map((option) => b`<sp-menu-item value=${option.value}>${option.label}<span slot="description">${option.description}</span></sp-menu-item>`)}
41278
41367
  </sp-picker>
41279
- <sp-help-text size="m" data-help=${field}>${chosen.description}</sp-help-text>
41368
+ <sp-help-text size="m" data-help=${field2}>${chosen.description}</sp-help-text>
41280
41369
  </div>`;
41281
41370
  }
41282
41371
  #form() {
@@ -42862,11 +42951,11 @@ var SliccNetwork = class extends ModelElement {
42862
42951
  }
42863
42952
  async #submitPair(event2, port) {
42864
42953
  event2.preventDefault();
42865
- const field = this.renderRoot.querySelector("#pair-url");
42866
- const url = field.value.trim();
42954
+ const field2 = this.renderRoot.querySelector("#pair-url");
42955
+ const url = field2.value.trim();
42867
42956
  if (!url || this.pairBusy || !port.pairComputer) return;
42868
42957
  if (await this.#pairAct("pair", () => port.pairComputer?.(url))) {
42869
- field.value = "";
42958
+ field2.value = "";
42870
42959
  this.pairFilled = false;
42871
42960
  }
42872
42961
  }
@@ -42935,11 +43024,11 @@ var SliccNetwork = class extends ModelElement {
42935
43024
  #submitKey(event2, port) {
42936
43025
  event2.preventDefault();
42937
43026
  if (this.busy) return;
42938
- const field = event2.currentTarget.querySelector(
43027
+ const field2 = event2.currentTarget.querySelector(
42939
43028
  "sp-textfield"
42940
43029
  );
42941
- const key = field.value.trim();
42942
- field.value = "";
43030
+ const key = field2.value.trim();
43031
+ field2.value = "";
42943
43032
  if (key) void this.#tailnet("key", () => port.submitAuthKey?.(key));
42944
43033
  }
42945
43034
  #sendKey(event2) {
@@ -49363,9 +49452,9 @@ var SliccApp = class extends ThemedElement {
49363
49452
  #railButton(item2, side) {
49364
49453
  const changes2 = item2.id === "changes" ? this.#changes() : 0;
49365
49454
  const driven = item2.id === "browser" && !!this.model?.browser.list().some((tab) => tab.controlled);
49366
- const visible2 = shown2(this.dock, item2.id);
49367
- const label = `${visible2 ? `${item2.title}, shown` : `Open ${item2.title}`}${changes2 ? `, ${changeCount(changes2)}` : driven ? ", a tab is in use" : ""}`;
49368
- const button = u21`<swc-action-button id=${`rail-${item2.id}`} class=${visible2 ? "selected" : ""} quiet size="m" accessible-label=${label} data-surface=${item2.id} data-cone=${o2(item2.cone)} ?data-visible=${visible2} @click=${(event2) => this.#railClick(event2, item2.id)}>${railIcon(item2.icon)}</swc-action-button>`;
49455
+ const visible3 = shown2(this.dock, item2.id);
49456
+ const label = `${visible3 ? `${item2.title}, shown` : `Open ${item2.title}`}${changes2 ? `, ${changeCount(changes2)}` : driven ? ", a tab is in use" : ""}`;
49457
+ const button = u21`<swc-action-button id=${`rail-${item2.id}`} class=${visible3 ? "selected" : ""} quiet size="m" accessible-label=${label} data-surface=${item2.id} data-cone=${o2(item2.cone)} ?data-visible=${visible3} @click=${(event2) => this.#railClick(event2, item2.id)}>${railIcon(item2.icon)}</swc-action-button>`;
49369
49458
  const tooltip = b`<swc-tooltip for=${`rail-${item2.id}`} placement=${{ left: "end", right: "start", bottom: "top" }[side]}>${item2.title}</swc-tooltip>`;
49370
49459
  return changes2 ? b`<span class="badged">${button}<swc-badge size="s" variant="neutral" aria-hidden="true">${changes2}</swc-badge></span>${tooltip}` : driven ? b`<span class="badged">${button}<span class="dot" data-driven aria-hidden="true"></span></span>${tooltip}` : b`${button}${tooltip}`;
49371
49460
  }
@@ -51258,11 +51347,11 @@ var SliccBrowser = class extends ModelElement {
51258
51347
  }
51259
51348
  updated() {
51260
51349
  const tab = this.#focused();
51261
- const visible2 = this.#visible();
51262
- this.#settle(visible2 && tab?.controlled && this.model?.browser.watch ? tab.id : null);
51263
- if (visible2 && tab && !this.#ticker)
51350
+ const visible3 = this.#visible();
51351
+ this.#settle(visible3 && tab?.controlled && this.model?.browser.watch ? tab.id : null);
51352
+ if (visible3 && tab && !this.#ticker)
51264
51353
  this.#ticker = setInterval(() => this.requestUpdate(), 1e3);
51265
- if (!(visible2 && tab)) this.#still();
51354
+ if (!(visible3 && tab)) this.#still();
51266
51355
  const list6 = this.renderRoot.querySelector(".actions:not(.last)");
51267
51356
  const last = list6?.lastElementChild?.getAttribute("data-action-id") ?? null;
51268
51357
  if (list6 && this.#anchor !== null) list6.scrollTop = list6.scrollHeight - this.#anchor;
@@ -52277,7 +52366,7 @@ e26("swc-icon-user-settings", o90);
52277
52366
 
52278
52367
  // src/app/memory.ts
52279
52368
  var everyone = "*";
52280
- function visible(memories, scope, tag3, query) {
52369
+ function visible2(memories, scope, tag3, query) {
52281
52370
  const needle = query.trim().toLowerCase();
52282
52371
  return memories.filter(
52283
52372
  (memory) => (scope === everyone || memory.scope === scope) && (tag3 === "all" || (tag3 === "untagged" ? memory.tag === null : memory.tag === tag3)) && (!needle || `${memory.title} ${memory.body} ${memory.section}`.toLowerCase().includes(needle))
@@ -52594,15 +52683,15 @@ var SliccMemory = class extends ModelElement {
52594
52683
  }
52595
52684
  #save(memory) {
52596
52685
  const form = this.renderRoot.querySelector(".editor");
52597
- const field = (name) => form.querySelector(`[name=${name}]`).value.trim();
52598
- if (!field("title")) return;
52599
- const tag3 = field("tag");
52686
+ const field2 = (name) => form.querySelector(`[name=${name}]`).value.trim();
52687
+ if (!field2("title")) return;
52688
+ const tag3 = field2("tag");
52600
52689
  const saved = this.model?.memory.save({
52601
52690
  ...memory.id ? { id: memory.id } : {},
52602
52691
  scope: memory.scope,
52603
- section: field("section") || "Notes",
52604
- title: field("title"),
52605
- body: field("body"),
52692
+ section: field2("section") || "Notes",
52693
+ title: field2("title"),
52694
+ body: field2("body"),
52606
52695
  tag: tag3 !== "none" ? tag3 : null
52607
52696
  });
52608
52697
  this.editing = null;
@@ -52710,7 +52799,7 @@ var SliccMemory = class extends ModelElement {
52710
52799
  const scopes = this.#scopes;
52711
52800
  const scope = this.scope;
52712
52801
  const option = (item2) => b`<sp-menu-item value=${item2.id}>${item2.label}</sp-menu-item>`;
52713
- const shown4 = visible(all2, scope, this.tag, this.query);
52802
+ const shown4 = visible2(all2, scope, this.tag, this.query);
52714
52803
  const total = inScope(all2, scope);
52715
52804
  const filtered = this.tag !== "all" || this.query.trim() !== "";
52716
52805
  const current = scopes.find((item2) => item2.id === scope) ?? null;
@@ -53585,19 +53674,19 @@ var SliccSecrets = class extends ThemedElement {
53585
53674
  if (form?.kind === "import") this.importKind = "bundle";
53586
53675
  if (form) void this.updateComplete.then(() => this.#focus());
53587
53676
  }
53588
- #refuse(text4, field = null, focus = false) {
53677
+ #refuse(text4, field2 = null, focus = false) {
53589
53678
  this.problem = text4;
53590
- this.invalid = text4 ? field : null;
53591
- if (focus && text4 && field) void this.updateComplete.then(() => this.#field(field)?.focus());
53679
+ this.invalid = text4 ? field2 : null;
53680
+ if (focus && text4 && field2) void this.updateComplete.then(() => this.#field(field2)?.focus());
53592
53681
  }
53593
53682
  #typed() {
53594
53683
  this.invalid = null;
53595
53684
  }
53596
- #bad(field) {
53597
- return this.invalid === field ? "true" : A;
53685
+ #bad(field2) {
53686
+ return this.invalid === field2 ? "true" : A;
53598
53687
  }
53599
- #described(field) {
53600
- return this.invalid === field ? "error-form" : A;
53688
+ #described(field2) {
53689
+ return this.invalid === field2 ? "error-form" : A;
53601
53690
  }
53602
53691
  #focus() {
53603
53692
  this.renderRoot.querySelector("[data-form] input, [data-form] sp-picker")?.focus();
@@ -53835,8 +53924,8 @@ var SliccSecrets = class extends ThemedElement {
53835
53924
  event2.preventDefault();
53836
53925
  if (!locked && !this.busy) void run();
53837
53926
  }
53838
- #value(label, field = "value") {
53839
- return b`<label class="field"><span>${label}</span><input type="password" autocomplete="off" spellcheck="false" data-field=${field} aria-invalid=${this.#bad(field)} aria-describedby=${this.#described(field)} /></label>`;
53927
+ #value(label, field2 = "value") {
53928
+ return b`<label class="field"><span>${label}</span><input type="password" autocomplete="off" spellcheck="false" data-field=${field2} aria-invalid=${this.#bad(field2)} aria-describedby=${this.#described(field2)} /></label>`;
53840
53929
  }
53841
53930
  #actions(locked, label, action, run) {
53842
53931
  return b`<div class="buttons">
@@ -54325,6 +54414,7 @@ var SliccSettings = class extends ThemedElement {
54325
54414
  };
54326
54415
  #waits = new SignInWaits(() => this.requestUpdate());
54327
54416
  #copies = new SignInCopies(() => this.requestUpdate());
54417
+ #modelFilter = new ModelFilter(this);
54328
54418
  #landing = null;
54329
54419
  #away = false;
54330
54420
  #bases = /* @__PURE__ */ new Map();
@@ -54357,6 +54447,7 @@ var SliccSettings = class extends ThemedElement {
54357
54447
  fieldStyles,
54358
54448
  dialogFrame,
54359
54449
  searchCss,
54450
+ modelFilterCss,
54360
54451
  r(link_default),
54361
54452
  signInCss,
54362
54453
  i`
@@ -54888,13 +54979,13 @@ var SliccSettings = class extends ThemedElement {
54888
54979
  });
54889
54980
  }
54890
54981
  #settingsOf(account, fields) {
54891
- const settable = (account.fields ?? []).filter((field) => field.vaultSetting);
54982
+ const settable = (account.fields ?? []).filter((field2) => field2.vaultSetting);
54892
54983
  if (account.group === "mcp" || !settable.length) return void 0;
54893
54984
  return Object.fromEntries(
54894
- settable.flatMap((field) => {
54895
- const value = fields?.[field.name];
54896
- if (!value || field.customBase && this.#baseOf(value)) return [];
54897
- return [[field.vaultSetting, value]];
54985
+ settable.flatMap((field2) => {
54986
+ const value = fields?.[field2.name];
54987
+ if (!value || field2.customBase && this.#baseOf(value)) return [];
54988
+ return [[field2.vaultSetting, value]];
54898
54989
  })
54899
54990
  );
54900
54991
  }
@@ -54907,17 +54998,17 @@ var SliccSettings = class extends ThemedElement {
54907
54998
  #keyOptional(account) {
54908
54999
  const vault = this.#vault(account);
54909
55000
  const fields = account.fields ?? [];
54910
- if (!vault || !fields.some((field) => field.vaultSetting || field.customBase)) return false;
54911
- if (fields.some((field) => field.vaultSetting) && !vault.settings) return false;
55001
+ if (!vault || !fields.some((field2) => field2.vaultSetting || field2.customBase)) return false;
55002
+ if (fields.some((field2) => field2.vaultSetting) && !vault.settings) return false;
54912
55003
  return !!this.#record(account);
54913
55004
  }
54914
55005
  #refused(account, message, keyed2) {
54915
- const field = (account.fields ?? []).find(
55006
+ const field2 = (account.fields ?? []).find(
54916
55007
  (candidate) => [candidate.vaultSetting, candidate.name, candidate.label].some(
54917
55008
  (word2) => word2 && words(message, word2)
54918
55009
  )
54919
55010
  );
54920
- if (field) this.#refuse(account.id, field.name, message);
55011
+ if (field2) this.#refuse(account.id, field2.name, message);
54921
55012
  else if (keyed2) this.#refuse(account.id, "value", message);
54922
55013
  else this.failure = { id: account.id, message };
54923
55014
  }
@@ -54929,14 +55020,14 @@ var SliccSettings = class extends ThemedElement {
54929
55020
  return void 0;
54930
55021
  }
54931
55022
  }
54932
- #oldBase(account, field) {
54933
- return this.#baseOf(field.value) ?? this.#bases.get(`${account.id} ${field.name}`);
55023
+ #oldBase(account, field2) {
55024
+ return this.#baseOf(field2.value) ?? this.#bases.get(`${account.id} ${field2.name}`);
54934
55025
  }
54935
55026
  #baseChanges(account, fields) {
54936
- return (account.fields ?? []).filter((field) => field.customBase).map((field) => ({
54937
- field: field.name,
54938
- url: this.#baseOf(fields?.[field.name]),
54939
- old: this.#oldBase(account, field)
55027
+ return (account.fields ?? []).filter((field2) => field2.customBase).map((field2) => ({
55028
+ field: field2.name,
55029
+ url: this.#baseOf(fields?.[field2.name]),
55030
+ old: this.#oldBase(account, field2)
54940
55031
  })).filter((change) => change.url !== change.old);
54941
55032
  }
54942
55033
  #modelChange(name, changes2, from, to) {
@@ -54962,8 +55053,8 @@ var SliccSettings = class extends ThemedElement {
54962
55053
  await live?.endpoints?.(forward);
54963
55054
  } catch (error) {
54964
55055
  this.#busy(id, false);
54965
- const field = changes2.find((change) => change.url) ?? changes2[0];
54966
- if (this.model === model) this.#refuse(id, field.field, failureText(error));
55056
+ const field2 = changes2.find((change) => change.url) ?? changes2[0];
55057
+ if (this.model === model) this.#refuse(id, field2.field, failureText(error));
54967
55058
  return;
54968
55059
  }
54969
55060
  if (this.model !== model) {
@@ -54987,35 +55078,35 @@ var SliccSettings = class extends ThemedElement {
54987
55078
  }
54988
55079
  #placeFailure(account, fields) {
54989
55080
  const message = this.failure.message;
54990
- const field = (account.fields ?? []).find(
55081
+ const field2 = (account.fields ?? []).find(
54991
55082
  (candidate) => candidate.customBase && !!fields?.[candidate.name] && [candidate.name, candidate.label, "https", "url", "port", "userinfo"].some(
54992
55083
  (word2) => words(message, word2)
54993
55084
  )
54994
55085
  );
54995
- if (!field) return;
55086
+ if (!field2) return;
54996
55087
  this.failure = null;
54997
- this.#refuse(account.id, field.name, message);
55088
+ this.#refuse(account.id, field2.name, message);
54998
55089
  }
54999
- #refuse(id, field, message) {
55000
- this.problem = { id, field, message };
55090
+ #refuse(id, field2, message) {
55091
+ this.problem = { id, field: field2, message };
55001
55092
  void this.updateComplete.then(
55002
55093
  () => this.renderRoot.querySelector(
55003
- field === "value" ? ".key input[data-field=value]" : `.key [data-account-field="${field}"]`
55094
+ field2 === "value" ? ".key input[data-field=value]" : `.key [data-account-field="${field2}"]`
55004
55095
  )?.focus()
55005
55096
  );
55006
55097
  }
55007
55098
  #fields(form, account) {
55008
55099
  if (!account.fields?.length) return void 0;
55009
55100
  const values = {};
55010
- for (const field of account.fields) {
55011
- const input = form.querySelector(`[data-account-field="${field.name}"]`);
55101
+ for (const field2 of account.fields) {
55102
+ const input = form.querySelector(`[data-account-field="${field2.name}"]`);
55012
55103
  const value = input.value.trim();
55013
- if (value) values[field.name] = value;
55014
- else if (field.required && field.options?.length !== 0) {
55104
+ if (value) values[field2.name] = value;
55105
+ else if (field2.required && field2.options?.length !== 0) {
55015
55106
  this.#refuse(
55016
55107
  account.id,
55017
- field.name,
55018
- field.options ? `Select a ${field.label.toLowerCase()}.` : `${field.label} can\u2019t be empty`
55108
+ field2.name,
55109
+ field2.options ? `Select a ${field2.label.toLowerCase()}.` : `${field2.label} can\u2019t be empty`
55019
55110
  );
55020
55111
  return null;
55021
55112
  }
@@ -55058,7 +55149,7 @@ var SliccSettings = class extends ThemedElement {
55058
55149
  this.failure = null;
55059
55150
  this.problem = null;
55060
55151
  this.filled = new Set(
55061
- (account.fields ?? []).filter((field) => field.options || field.value?.trim()).map((field) => field.name)
55152
+ (account.fields ?? []).filter((field2) => field2.options || field2.value?.trim()).map((field2) => field2.name)
55062
55153
  );
55063
55154
  this.entering = account.id;
55064
55155
  void this.updateComplete.then(() => this.focusOn(".key sp-textfield", ".key input"));
@@ -55080,9 +55171,9 @@ var SliccSettings = class extends ThemedElement {
55080
55171
  if (fields2 !== null && !this.pending.has(account.id)) void this.keep(account, value, fields2);
55081
55172
  return;
55082
55173
  }
55083
- const field = form.querySelector("sp-textfield");
55084
- const secret = field.value.trim();
55085
- field.value = "";
55174
+ const field2 = form.querySelector("sp-textfield");
55175
+ const secret = field2.value.trim();
55176
+ field2.value = "";
55086
55177
  const fields = this.#fields(form, account);
55087
55178
  if (secret && fields !== null) void this.#connectBases(account, secret, fields);
55088
55179
  }
@@ -55165,67 +55256,67 @@ var SliccSettings = class extends ThemedElement {
55165
55256
  this.failure = null;
55166
55257
  this.problem = null;
55167
55258
  }
55168
- #problem(account, field, icon = true) {
55259
+ #problem(account, field2, icon = true) {
55169
55260
  const problem = this.problem;
55170
- if (problem?.id !== account.id || problem.field !== field) return A;
55261
+ if (problem?.id !== account.id || problem.field !== field2) return A;
55171
55262
  return b`<div class="problem" id="key-problem" role="alert">
55172
55263
  ${icon ? b`<swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>` : A}
55173
55264
  <span>${problem.message}</span>
55174
55265
  </div>`;
55175
55266
  }
55176
- #described(account, field) {
55177
- return this.problem?.id === account.id && this.problem.field === field ? "key-problem" : A;
55267
+ #described(account, field2) {
55268
+ return this.problem?.id === account.id && this.problem.field === field2 ? "key-problem" : A;
55178
55269
  }
55179
- #invalid(account, field) {
55180
- return this.#described(account, field) === A ? A : "true";
55270
+ #invalid(account, field2) {
55271
+ return this.#described(account, field2) === A ? A : "true";
55181
55272
  }
55182
55273
  #extra(account) {
55183
55274
  return (account.fields ?? []).map(
55184
- (field) => field.options ? b`<div class="field">
55185
- <sp-field-label for=${`field-${field.name}`} size="m">${field.label}</sp-field-label>${this.#control(account, field)}
55186
- ${field.options.length ? A : b`<p class="hint" data-empty=${field.name}>${nothingToChoose}</p>`}
55187
- ${field.help ? b`<p class="hint" id=${`help-${field.name}`}>${field.help}</p>` : A}
55188
- ${this.#problem(account, field.name, false)}
55275
+ (field2) => field2.options ? b`<div class="field">
55276
+ <sp-field-label for=${`field-${field2.name}`} size="m">${field2.label}</sp-field-label>${this.#control(account, field2)}
55277
+ ${field2.options.length ? A : b`<p class="hint" data-empty=${field2.name}>${nothingToChoose}</p>`}
55278
+ ${field2.help ? b`<p class="hint" id=${`help-${field2.name}`}>${field2.help}</p>` : A}
55279
+ ${this.#problem(account, field2.name, false)}
55189
55280
  </div>` : b`<label class="field">
55190
- <span>${field.label}</span>${this.#control(account, field)}
55281
+ <span>${field2.label}</span>${this.#control(account, field2)}
55191
55282
  </label>
55192
- ${field.help ? b`<p class="hint" id=${`help-${field.name}`}>${field.help}</p>` : A}
55193
- ${this.#problem(account, field.name)}`
55283
+ ${field2.help ? b`<p class="hint" id=${`help-${field2.name}`}>${field2.help}</p>` : A}
55284
+ ${this.#problem(account, field2.name)}`
55194
55285
  );
55195
55286
  }
55196
- #describedBy(account, field) {
55197
- const problem = this.#described(account, field.name);
55198
- const ids = [problem === A ? "" : problem, field.help ? `help-${field.name}` : ""];
55287
+ #describedBy(account, field2) {
55288
+ const problem = this.#described(account, field2.name);
55289
+ const ids = [problem === A ? "" : problem, field2.help ? `help-${field2.name}` : ""];
55199
55290
  return ids.filter(Boolean).join(" ") || A;
55200
55291
  }
55201
- #control(account, field) {
55202
- if (field.options) {
55203
- const empty4 = !field.options.length;
55204
- const described2 = this.problem?.id === account.id && this.problem.field === field.name;
55292
+ #control(account, field2) {
55293
+ if (field2.options) {
55294
+ const empty4 = !field2.options.length;
55295
+ const described2 = this.problem?.id === account.id && this.problem.field === field2.name;
55205
55296
  return b`<sp-picker
55206
55297
  size="m"
55207
- data-account-field=${field.name}
55208
- label=${empty4 ? "None available" : field.label}
55209
- id=${`field-${field.name}`}
55210
- value=${start(field.options, field.value)}
55298
+ data-account-field=${field2.name}
55299
+ label=${empty4 ? "None available" : field2.label}
55300
+ id=${`field-${field2.name}`}
55301
+ value=${start(field2.options, field2.value)}
55211
55302
  ?disabled=${empty4}
55212
55303
  ?invalid=${described2}
55213
- aria-required=${field.required ? "true" : A}
55304
+ aria-required=${field2.required ? "true" : A}
55214
55305
  >
55215
- ${field.options.map((option) => b`<sp-menu-item value=${option.value}>${option.label}</sp-menu-item>`)}
55216
- ${described2 || empty4 || field.help ? b`<span slot="description" class="sr">${described2 ? this.problem?.message : empty4 ? nothingToChoose : field.help}</span>` : A}
55306
+ ${field2.options.map((option) => b`<sp-menu-item value=${option.value}>${option.label}</sp-menu-item>`)}
55307
+ ${described2 || empty4 || field2.help ? b`<span slot="description" class="sr">${described2 ? this.problem?.message : empty4 ? nothingToChoose : field2.help}</span>` : A}
55217
55308
  </sp-picker>`;
55218
55309
  }
55219
55310
  return b`<input
55220
55311
  type="text"
55221
55312
  autocomplete="off"
55222
55313
  spellcheck="false"
55223
- data-account-field=${field.name}
55224
- value=${field.value ?? A}
55225
- placeholder=${field.placeholder ?? A}
55226
- aria-required=${field.required ? "true" : A}
55227
- aria-invalid=${this.#invalid(account, field.name)}
55228
- aria-describedby=${this.#describedBy(account, field)}
55314
+ data-account-field=${field2.name}
55315
+ value=${field2.value ?? A}
55316
+ placeholder=${field2.placeholder ?? A}
55317
+ aria-required=${field2.required ? "true" : A}
55318
+ aria-invalid=${this.#invalid(account, field2.name)}
55319
+ aria-describedby=${this.#describedBy(account, field2)}
55229
55320
  />`;
55230
55321
  }
55231
55322
  #getKey(account) {
@@ -55243,9 +55334,9 @@ var SliccSettings = class extends ThemedElement {
55243
55334
  #ready(account) {
55244
55335
  if (account.blocked) return false;
55245
55336
  if (!this.#offered()) return true;
55246
- const required = (account.fields ?? []).filter((field) => field.required && !field.options);
55337
+ const required = (account.fields ?? []).filter((field2) => field2.required && !field2.options);
55247
55338
  const key = this.#keyOptional(account) ? [] : ["value"];
55248
- return [...key, ...required.map((field) => field.name)].every((name) => this.filled.has(name));
55339
+ return [...key, ...required.map((field2) => field2.name)].every((name) => this.filled.has(name));
55249
55340
  }
55250
55341
  #fill(event2) {
55251
55342
  const input = event2.target;
@@ -55533,7 +55624,7 @@ var SliccSettings = class extends ThemedElement {
55533
55624
  this.#busy(account.id, false);
55534
55625
  }
55535
55626
  this.focusOn("[data-action=add-provider]");
55536
- for (const field of account.fields ?? []) this.#bases.delete(`${account.id} ${field.name}`);
55627
+ for (const field2 of account.fields ?? []) this.#bases.delete(`${account.id} ${field2.name}`);
55537
55628
  }
55538
55629
  #heldRecords(account, vault) {
55539
55630
  const server = serverOf(account);
@@ -55644,7 +55735,7 @@ var SliccSettings = class extends ThemedElement {
55644
55735
  event2.preventDefault();
55645
55736
  if (this.serverBusy) return;
55646
55737
  const form = event2.currentTarget;
55647
- const text4 = (field) => form.querySelector(`[data-server-field=${field}]`)?.value.trim();
55738
+ const text4 = (field2) => form.querySelector(`[data-server-field=${field2}]`)?.value.trim();
55648
55739
  const name = text4("name");
55649
55740
  const url = text4("url");
55650
55741
  const problem = this.#checkServer(name, url);
@@ -55673,21 +55764,21 @@ var SliccSettings = class extends ThemedElement {
55673
55764
  this.serverProblem = problem;
55674
55765
  if (problem.field !== "form") this.focusOn(`[data-server-field=${problem.field}]`);
55675
55766
  }
55676
- #serverNote(field) {
55677
- if (this.serverProblem?.field !== field) return A;
55678
- return b`<div class="problem" id=${`server-${field}-problem`} role="alert" data-problem=${field}>
55767
+ #serverNote(field2) {
55768
+ if (this.serverProblem?.field !== field2) return A;
55769
+ return b`<div class="problem" id=${`server-${field2}-problem`} role="alert" data-problem=${field2}>
55679
55770
  <swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle>
55680
55771
  <span>${this.serverProblem.message}</span>
55681
55772
  </div>`;
55682
55773
  }
55683
- #serverInput(field, type, help2) {
55684
- const invalid = this.serverProblem?.field === field;
55685
- const problem = invalid ? `server-${field}-problem ` : "";
55774
+ #serverInput(field2, type, help2) {
55775
+ const invalid = this.serverProblem?.field === field2;
55776
+ const problem = invalid ? `server-${field2}-problem ` : "";
55686
55777
  return b`<input
55687
55778
  type=${type}
55688
55779
  autocomplete="off"
55689
55780
  spellcheck="false"
55690
- data-server-field=${field}
55781
+ data-server-field=${field2}
55691
55782
  aria-required="true"
55692
55783
  aria-invalid=${invalid ? "true" : A}
55693
55784
  aria-describedby=${`${problem}${help2}`}
@@ -55784,8 +55875,8 @@ var SliccSettings = class extends ThemedElement {
55784
55875
  const dialog = this.#dialog;
55785
55876
  if (!changed2.has("picking") || !dialog || dialog.open) return;
55786
55877
  dialog.showModal();
55787
- const field = this.renderRoot.querySelector("sp-search");
55788
- void field.updateComplete.then(() => field.focus());
55878
+ const field2 = this.renderRoot.querySelector("sp-search");
55879
+ void field2.updateComplete.then(() => field2.focus());
55789
55880
  }
55790
55881
  get #dialog() {
55791
55882
  return this.renderRoot.querySelector("dialog.picker");
@@ -56001,8 +56092,8 @@ var SliccSettings = class extends ThemedElement {
56001
56092
  <div class="rows">
56002
56093
  <div class="row">
56003
56094
  <span class="label" id="model">Model for new cones</span>
56004
- <sp-picker size="m" label="Model" aria-labelledby="model" value=${value.model} @change=${(e128) => this.#pickModel(e128)}>
56005
- ${chatModels(settings.models()).map((option) => b`<sp-menu-item value=${option.id}>${option.label}<span slot="description">${option.provider}</span></sp-menu-item>`)}
56095
+ <sp-picker size="m" label="Model" aria-labelledby="model" value=${value.model} @change=${(e128) => this.#pickModel(e128)} @sp-opened=${this.#modelFilter.opened} @sp-closed=${this.#modelFilter.closed} @keydown=${this.#modelFilter.keys}>
56096
+ ${this.#modelFilter.items(chatModels(settings.models()))}
56006
56097
  </sp-picker>
56007
56098
  ${this.#switched(value.model)}
56008
56099
  </div>
@@ -56801,10 +56892,10 @@ var SliccValueRequest = class extends ThemedElement {
56801
56892
  const bad = nameProblem(name);
56802
56893
  const value = bad ? "" : take(this.#field("value"));
56803
56894
  const text4 = bad ?? valueProblem(value);
56804
- const field = bad ? "name" : "value";
56805
- this.problem = text4 ? { id: request2.id, text: text4, field } : null;
56895
+ const field2 = bad ? "name" : "value";
56896
+ this.problem = text4 ? { id: request2.id, text: text4, field: field2 } : null;
56806
56897
  if (text4) {
56807
- void this.updateComplete.then(() => this.#field(field)?.focus());
56898
+ void this.updateComplete.then(() => this.#field(field2)?.focus());
56808
56899
  return;
56809
56900
  }
56810
56901
  this.busy = true;
@@ -56814,8 +56905,8 @@ var SliccValueRequest = class extends ThemedElement {
56814
56905
  this.#done.add(request2.id);
56815
56906
  } catch (error) {
56816
56907
  if (this.#mine(vault)) {
56817
- const field2 = fieldOf(error, "value");
56818
- this.problem = { id: request2.id, text: failureText(error), ...field2 ? { field: field2 } : {} };
56908
+ const field3 = fieldOf(error, "value");
56909
+ this.problem = { id: request2.id, text: failureText(error), ...field3 ? { field: field3 } : {} };
56819
56910
  }
56820
56911
  } finally {
56821
56912
  if (this.model?.vault === vault) this.busy = false;
@@ -56824,8 +56915,8 @@ var SliccValueRequest = class extends ThemedElement {
56824
56915
  #typed() {
56825
56916
  if (this.problem?.field) this.problem = { id: this.problem.id, text: this.problem.text };
56826
56917
  }
56827
- #aria(field, problem) {
56828
- const bad = problem?.field === field;
56918
+ #aria(field2, problem) {
56919
+ const bad = problem?.field === field2;
56829
56920
  return { invalid: bad ? "true" : A, described: bad ? "error-request" : A };
56830
56921
  }
56831
56922
  async cancelRequest(request2) {
@@ -56896,7 +56987,7 @@ var SliccValueRequest = class extends ThemedElement {
56896
56987
  const shown4 = this.problem?.id === request2.id ? this.problem : null;
56897
56988
  const problem = shown4?.text ?? "";
56898
56989
  const name = this.#aria("name", shown4);
56899
- const field = this.#aria("value", shown4);
56990
+ const field2 = this.#aria("value", shown4);
56900
56991
  return i23(
56901
56992
  request2.id,
56902
56993
  b`<dialog role="alertdialog" aria-labelledby="title" aria-describedby="asked" data-request=${request2.id} @cancel=${(event2) => {
@@ -56912,7 +57003,7 @@ var SliccValueRequest = class extends ThemedElement {
56912
57003
  const input = event2.currentTarget;
56913
57004
  input.value = input.value.toUpperCase();
56914
57005
  }} /></label>`}
56915
- <label class="field"><span>Value</span><input type="password" autocomplete="off" spellcheck="false" data-field="value" aria-invalid=${field.invalid} aria-describedby=${field.described} /></label>
57006
+ <label class="field"><span>Value</span><input type="password" autocomplete="off" spellcheck="false" data-field="value" aria-invalid=${field2.invalid} aria-describedby=${field2.described} /></label>
56916
57007
  </div>` : A}
56917
57008
  ${locked ? this.#unlock(vault) : A}
56918
57009
  ${problem ? b`<p class="problem" role="alert" id="error-request" data-error><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><span>${problem}</span></p>` : A}
@@ -58015,9 +58106,9 @@ var ViewItem = class {
58015
58106
  this._cachedVisibleSize = size4.cachedVisibleSize;
58016
58107
  }
58017
58108
  }
58018
- setVisible(visible2, size4) {
58019
- if (visible2 === this.visible) return;
58020
- if (visible2) {
58109
+ setVisible(visible3, size4) {
58110
+ if (visible3 === this.visible) return;
58111
+ if (visible3) {
58021
58112
  var _this$_cachedVisibleS;
58022
58113
  const cachedVisibleSize = (_this$_cachedVisibleS = this._cachedVisibleSize) !== null && _this$_cachedVisibleS !== void 0 ? _this$_cachedVisibleS : 0;
58023
58114
  this._cachedVisibleSize = void 0;
@@ -58026,8 +58117,8 @@ var ViewItem = class {
58026
58117
  this._cachedVisibleSize = typeof size4 === "number" ? size4 : this.size;
58027
58118
  this.size = 0;
58028
58119
  }
58029
- this.container.classList.toggle("visible", visible2);
58030
- if (this.view.setVisible) this.view.setVisible(visible2);
58120
+ this.container.classList.toggle("visible", visible3);
58121
+ if (this.view.setVisible) this.view.setVisible(visible3);
58031
58122
  }
58032
58123
  dispose() {
58033
58124
  this.disposable.dispose();
@@ -58189,15 +58280,15 @@ var Splitview = class {
58189
58280
  let snapped = false;
58190
58281
  if (snapBefore) {
58191
58282
  const snapView = this.viewItems[snapBefore.index];
58192
- const visible2 = delta >= snapBefore.limitDelta;
58193
- snapped = visible2 !== snapView.visible;
58194
- snapView.setVisible(visible2, snapBefore.size);
58283
+ const visible3 = delta >= snapBefore.limitDelta;
58284
+ snapped = visible3 !== snapView.visible;
58285
+ snapView.setVisible(visible3, snapBefore.size);
58195
58286
  }
58196
58287
  if (!snapped && snapAfter) {
58197
58288
  const snapView = this.viewItems[snapAfter.index];
58198
- const visible2 = delta < snapAfter.limitDelta;
58199
- snapped = visible2 !== snapView.visible;
58200
- snapView.setVisible(visible2, snapAfter.size);
58289
+ const visible3 = delta < snapAfter.limitDelta;
58290
+ snapped = visible3 !== snapView.visible;
58291
+ snapView.setVisible(visible3, snapAfter.size);
58201
58292
  }
58202
58293
  if (snapped) return this.resize(index2, delta, sizes, lowPriorityIndexes, highPriorityIndexes, overloadMinDelta, overloadMaxDelta);
58203
58294
  const tentativeDelta = clamp(delta, minDelta, maxDelta);
@@ -58260,10 +58351,10 @@ var Splitview = class {
58260
58351
  if (index2 < 0 || index2 >= this.viewItems.length) throw new Error("Index out of bounds");
58261
58352
  return this.viewItems[index2].visible;
58262
58353
  }
58263
- setViewVisible(index2, visible2) {
58354
+ setViewVisible(index2, visible3) {
58264
58355
  if (index2 < 0 || index2 >= this.viewItems.length) throw new Error("Index out of bounds");
58265
58356
  const viewItem = this.viewItems[index2];
58266
- viewItem.setVisible(visible2, viewItem.size);
58357
+ viewItem.setVisible(visible3, viewItem.size);
58267
58358
  this.distributeEmptySpace(index2);
58268
58359
  this.layoutViews();
58269
58360
  this.saveProportions();
@@ -58706,8 +58797,8 @@ var LeafNode = class {
58706
58797
  else this._onDidChange.fire({});
58707
58798
  });
58708
58799
  }
58709
- setVisible(visible2) {
58710
- if (this.view.setVisible) this.view.setVisible(visible2);
58800
+ setVisible(visible3) {
58801
+ if (this.view.setVisible) this.view.setVisible(visible3);
58711
58802
  }
58712
58803
  layout(size4, orthogonalSize) {
58713
58804
  this._size = size4;
@@ -58869,14 +58960,14 @@ var BranchNode = class BranchNode2 extends CompositeDisposable {
58869
58960
  if (index2 < 0 || index2 >= this.children.length) throw new Error("Invalid index");
58870
58961
  return this.splitview.isViewVisible(index2);
58871
58962
  }
58872
- setChildVisible(index2, visible2) {
58963
+ setChildVisible(index2, visible3) {
58873
58964
  if (index2 < 0 || index2 >= this.children.length) throw new Error("Invalid index");
58874
- if (this.splitview.isViewVisible(index2) === visible2) return;
58965
+ if (this.splitview.isViewVisible(index2) === visible3) return;
58875
58966
  const wereAllChildrenHidden = this.splitview.contentSize === 0;
58876
- this.splitview.setViewVisible(index2, visible2);
58967
+ this.splitview.setViewVisible(index2, visible3);
58877
58968
  this.invalidateCachedSizes();
58878
58969
  const areAllChildrenHidden = this.splitview.contentSize === 0;
58879
- if (visible2 && wereAllChildrenHidden || !visible2 && areAllChildrenHidden) this._onDidVisibilityChange.fire({ visible: visible2 });
58970
+ if (visible3 && wereAllChildrenHidden || !visible3 && areAllChildrenHidden) this._onDidVisibilityChange.fire({ visible: visible3 });
58880
58971
  }
58881
58972
  moveChild(from, to) {
58882
58973
  if (from === to) return;
@@ -58929,8 +59020,8 @@ var BranchNode = class BranchNode2 extends CompositeDisposable {
58929
59020
  this.invalidateCachedSizes();
58930
59021
  this._onDidChange.fire({ size: e128.orthogonalSize });
58931
59022
  }), ...this.children.map((c29, i26) => {
58932
- if (c29 instanceof BranchNode2) return c29.onDidVisibilityChange(({ visible: visible2 }) => {
58933
- this.setChildVisible(i26, visible2);
59023
+ if (c29 instanceof BranchNode2) return c29.onDidVisibilityChange(({ visible: visible3 }) => {
59024
+ this.setChildVisible(i26, visible3);
58934
59025
  });
58935
59026
  return Disposable.NONE;
58936
59027
  }));
@@ -59356,13 +59447,13 @@ var Gridview = class {
59356
59447
  if (!(parent instanceof BranchNode)) throw new TypeError("Invalid from location");
59357
59448
  return parent.isChildVisible(index2);
59358
59449
  }
59359
- setViewVisible(location2, visible2) {
59450
+ setViewVisible(location2, visible3) {
59360
59451
  if (this.hasMaximizedView()) this.exitMaximizedView();
59361
59452
  const [rest, index2] = tail(location2);
59362
59453
  const [, parent] = this.getNode(rest);
59363
59454
  if (!(parent instanceof BranchNode)) throw new TypeError("Invalid from location");
59364
59455
  this._onDidViewVisibilityChange.fire();
59365
- parent.setChildVisible(index2, visible2);
59456
+ parent.setChildVisible(index2, visible3);
59366
59457
  }
59367
59458
  moveView(parentLocation, from, to) {
59368
59459
  if (this.hasMaximizedView()) this.exitMaximizedView();
@@ -59608,8 +59699,8 @@ var BaseGrid = class extends Resizable {
59608
59699
  this._bufferOnDidLayoutChange.fire();
59609
59700
  }), this._onDidMaximizedChange, this._onDidViewVisibilityChangeMicroTaskQueue, this._bufferOnDidLayoutChange);
59610
59701
  }
59611
- setVisible(panel, visible2) {
59612
- this.gridview.setViewVisible(getGridLocation(panel.element), visible2);
59702
+ setVisible(panel, visible3) {
59703
+ this.gridview.setViewVisible(getGridLocation(panel.element), visible3);
59613
59704
  this._bufferOnDidLayoutChange.fire();
59614
59705
  }
59615
59706
  isVisible(panel) {
@@ -60368,8 +60459,8 @@ var DockviewApi = class {
60368
60459
  /**
60369
60460
  * Set the visibility of an edge group.
60370
60461
  */
60371
- setEdgeGroupVisible(position2, visible2) {
60372
- this.component.setEdgeGroupVisible(position2, visible2);
60462
+ setEdgeGroupVisible(position2, visible3) {
60463
+ this.component.setEdgeGroupVisible(position2, visible3);
60373
60464
  }
60374
60465
  /**
60375
60466
  * Check whether an edge group is currently visible.
@@ -70493,8 +70584,8 @@ var EdgeGroupView = class {
70493
70584
  this._isCollapsed = collapsed;
70494
70585
  this._group.element.classList.toggle("dv-edge-collapsed", collapsed);
70495
70586
  }
70496
- setVisible(visible2) {
70497
- this._isVisible = visible2;
70587
+ setVisible(visible3) {
70588
+ this._isVisible = visible3;
70498
70589
  }
70499
70590
  /**
70500
70591
  * Set the expanded size without triggering a layout: from serialized
@@ -70588,9 +70679,9 @@ var MiddleColumnView = class {
70588
70679
  }
70589
70680
  setVisible(_visible) {
70590
70681
  }
70591
- setViewVisible(position2, visible2) {
70682
+ setViewVisible(position2, visible3) {
70592
70683
  const index2 = position2 === "top" ? this._topIndex : this._bottomIndex;
70593
- if (index2 !== void 0) this._splitview.setViewVisible(index2, visible2);
70684
+ if (index2 !== void 0) this._splitview.setViewVisible(index2, visible3);
70594
70685
  }
70595
70686
  isViewVisible(position2) {
70596
70687
  const index2 = position2 === "top" ? this._topIndex : this._bottomIndex;
@@ -70837,22 +70928,22 @@ var ShellManager = class {
70837
70928
  return this._rightView !== void 0;
70838
70929
  }
70839
70930
  }
70840
- setEdgeGroupVisible(position2, visible2) {
70841
- const changes2 = this._getView(position2) !== void 0 && visible2 !== this.isEdgeGroupVisible(position2);
70931
+ setEdgeGroupVisible(position2, visible3) {
70932
+ const changes2 = this._getView(position2) !== void 0 && visible3 !== this.isEdgeGroupVisible(position2);
70842
70933
  switch (position2) {
70843
70934
  case "left":
70844
- if (this._leftIndex !== void 0) this._outerSplitview.setViewVisible(this._leftIndex, visible2);
70935
+ if (this._leftIndex !== void 0) this._outerSplitview.setViewVisible(this._leftIndex, visible3);
70845
70936
  break;
70846
70937
  case "right":
70847
- if (this._rightIndex !== void 0) this._outerSplitview.setViewVisible(this._rightIndex, visible2);
70938
+ if (this._rightIndex !== void 0) this._outerSplitview.setViewVisible(this._rightIndex, visible3);
70848
70939
  break;
70849
70940
  case "top":
70850
70941
  case "bottom":
70851
- this._middleColumn.setViewVisible(position2, visible2);
70942
+ this._middleColumn.setViewVisible(position2, visible3);
70852
70943
  break;
70853
70944
  }
70854
70945
  if (changes2 && this._gap > 0 && this._hasSiblingOn(position2)) this._relayout();
70855
- if (visible2) this._flushPendingSizes();
70946
+ if (visible3) this._flushPendingSizes();
70856
70947
  }
70857
70948
  isEdgeGroupVisible(position2) {
70858
70949
  switch (position2) {
@@ -70954,10 +71045,10 @@ var ShellManager = class {
70954
71045
  for (const position2 of EDGE_POSITIONS) {
70955
71046
  const view = this._getView(position2);
70956
71047
  if (!view) continue;
70957
- const visible2 = this.isEdgeGroupVisible(position2);
71048
+ const visible3 = this.isEdgeGroupVisible(position2);
70958
71049
  edgeGroups[position2] = {
70959
- size: this._expandedSize(view, position2, visible2),
70960
- visible: visible2,
71050
+ size: this._expandedSize(view, position2, visible3),
71051
+ visible: visible3,
70961
71052
  collapsed: view.isCollapsed || void 0,
70962
71053
  minimumSize: view.configuredMinimumSize,
70963
71054
  maximumSize: Number.isFinite(view.configuredMaximumSize) ? view.configuredMaximumSize : void 0,
@@ -70969,11 +71060,11 @@ var ShellManager = class {
70969
71060
  /** The size to restore the group to. An expanded-but-hidden group has a
70970
71061
  * slot of 0, so fall back to its cached visible size (then
70971
71062
  * lastExpandedSize); otherwise re-showing snaps to minimumSize. */
70972
- _expandedSize(view, position2, visible2) {
71063
+ _expandedSize(view, position2, visible3) {
70973
71064
  if (view.isCollapsed) return view.lastExpandedSize;
70974
71065
  const pending = this._pendingSizes.get(position2);
70975
71066
  if (pending !== void 0) return pending;
70976
- if (!visible2) {
71067
+ if (!visible3) {
70977
71068
  var _this$_cachedVisibleS;
70978
71069
  return (_this$_cachedVisibleS = this._cachedVisibleSize(position2)) !== null && _this$_cachedVisibleS !== void 0 ? _this$_cachedVisibleS : view.lastExpandedSize;
70979
71070
  }
@@ -71747,16 +71838,16 @@ var DockviewComponent = class extends BaseGrid {
71747
71838
  this._moduleRegistry.postConstruct(this);
71748
71839
  this._shellManager.layoutFromElement();
71749
71840
  }
71750
- setVisible(panel, visible2) {
71841
+ setVisible(panel, visible3) {
71751
71842
  switch (panel.api.location.type) {
71752
71843
  case "grid":
71753
- super.setVisible(panel, visible2);
71844
+ super.setVisible(panel, visible3);
71754
71845
  break;
71755
71846
  case "floating": {
71756
71847
  const item2 = this.floatingGroups.find((floatingGroup) => floatingGroup.group === panel);
71757
71848
  if (item2) {
71758
- item2.overlay.setVisible(visible2);
71759
- panel.api._onDidVisibilityChange.fire({ isVisible: visible2 });
71849
+ item2.overlay.setVisible(visible3);
71850
+ panel.api._onDidVisibilityChange.fire({ isVisible: visible3 });
71760
71851
  }
71761
71852
  break;
71762
71853
  }
@@ -72563,8 +72654,8 @@ var DockviewComponent = class extends BaseGrid {
72563
72654
  repositionPanelOverlay(panel, forceVisible, clip) {
72564
72655
  this.overlayRenderContainer.repositionPanelOverlay(panel.api.id, forceVisible, clip);
72565
72656
  }
72566
- setEdgeGroupVisible(position2, visible2) {
72567
- this._shellManager.setEdgeGroupVisible(position2, visible2);
72657
+ setEdgeGroupVisible(position2, visible3) {
72658
+ this._shellManager.setEdgeGroupVisible(position2, visible3);
72568
72659
  }
72569
72660
  isEdgeGroupVisible(position2) {
72570
72661
  return this._shellManager.isEdgeGroupVisible(position2);
@@ -80781,9 +80872,9 @@ function computeFileTreeLayout(rows2, metrics) {
80781
80872
  const firstOccludedIndex = stickyHeight <= 0 || firstVisiblePhysicalIndex < 0 || firstVisiblePhysicalIndex >= totalRowCount ? -1 : firstVisiblePhysicalIndex;
80782
80873
  const lastOccludedIndex = firstOccludedIndex === -1 ? -1 : Math.min(totalRowCount - 1, firstProjectedIndex - 1);
80783
80874
  const occludedCount = firstOccludedIndex === -1 || lastOccludedIndex < firstOccludedIndex ? 0 : lastOccludedIndex - firstOccludedIndex + 1;
80784
- const visible2 = paneHeight <= 0 || firstProjectedIndex >= totalRowCount ? EMPTY_FILE_TREE_LAYOUT_RANGE : createRange(firstProjectedIndex, getLastIntersectingIndex(paneTop + paneHeight, totalRowCount, metrics.itemHeight));
80875
+ const visible3 = paneHeight <= 0 || firstProjectedIndex >= totalRowCount ? EMPTY_FILE_TREE_LAYOUT_RANGE : createRange(firstProjectedIndex, getLastIntersectingIndex(paneTop + paneHeight, totalRowCount, metrics.itemHeight));
80785
80876
  const minimumWindowStart = lastOccludedIndex + 1;
80786
- const windowRange = isEmptyRange(visible2) ? EMPTY_FILE_TREE_LAYOUT_RANGE : createRange(Math.max(minimumWindowStart, visible2.startIndex - overscan), Math.min(totalRowCount - 1, visible2.endIndex + overscan));
80877
+ const windowRange = isEmptyRange(visible3) ? EMPTY_FILE_TREE_LAYOUT_RANGE : createRange(Math.max(minimumWindowStart, visible3.startIndex - overscan), Math.min(totalRowCount - 1, visible3.endIndex + overscan));
80787
80878
  const windowHeight = getRangeHeight(windowRange, metrics.itemHeight);
80788
80879
  return {
80789
80880
  occlusion: {
@@ -80809,7 +80900,7 @@ function computeFileTreeLayout(rows2, metrics) {
80809
80900
  height: stickyHeight,
80810
80901
  rows: stickyRows
80811
80902
  },
80812
- visible: visible2,
80903
+ visible: visible3,
80813
80904
  window: {
80814
80905
  endIndex: windowRange.endIndex,
80815
80906
  height: windowHeight,