@diplodoc/transform 4.48.0 → 4.48.2

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/js/yfm.js CHANGED
@@ -4,9 +4,22 @@
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
8
  var __getProtoOf = Object.getPrototypeOf;
8
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
11
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
10
23
  var __commonJS = (cb, mod) => function __require() {
11
24
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
25
  };
@@ -108,38 +121,39 @@
108
121
 
109
122
  // node_modules/@diplodoc/tabs-extension/build/runtime/index.js
110
123
  (() => {
111
- var W = "yfm-tabs", R = "yfm-tab", O = "yfm-tab-panel", L = "yfm-tab-list", r = "active";
112
- var T = "data-diplodoc-group", G = "data-diplodoc-key", x = "data-diplodoc-variant", v = "data-diplodoc-id", H = "defaultTabsGroup-";
113
- var h = "data-diplodoc-forced";
114
- var N = "yfm-tabs-dropdown-select";
115
- var U = "yfm-tabs-vertical";
116
- var F = Symbol.for("diplodocTabs");
117
- var y = (s) => {
118
- let t = s.composedPath();
119
- return Array.isArray(t) && t.length > 0 ? t[0] : s.target;
120
- }, Z = (s) => {
121
- let t = y(s);
124
+ var x = "yfm-tabs", H = "yfm-tab", F = "yfm-tab-panel", D = "yfm-tab-list", l = "active";
125
+ var B = "data-diplodoc-group", G = "data-diplodoc-key", y = "data-diplodoc-variant", w = "data-diplodoc-id", U = "defaultTabsGroup-";
126
+ var O = "data-diplodoc-forced";
127
+ var L = "yfm-tabs-dropdown-select";
128
+ var W = "yfm-tabs-vertical";
129
+ var R = ((g) => (g.Regular = "regular", g.Radio = "radio", g.Dropdown = "dropdown", g.Accordion = "accordion", g))(R || {}), X = Symbol.for("diplodocTabs");
130
+ var f = (C) => {
131
+ let t = C.composedPath();
132
+ return Array.isArray(t) && t.length > 0 ? t[0] : C.target;
133
+ }, Z = (C) => {
134
+ let t = f(C);
122
135
  return !t || !t.matches;
123
- }, Q = (s) => Math.abs(s.scrollHeight - s.clientHeight) > 1 ? s : s.parentElement ? Q(s.parentElement) : void 0, X = (s, t) => {
124
- let e = s.getBoundingClientRect(), g = t.getBoundingClientRect();
125
- return { top: e.top - g.top, left: e.left - g.left, scrollTop: t.scrollTop, scrollLeft: t.scrollLeft };
136
+ }, v = (C) => Math.abs(C.scrollHeight - C.clientHeight) > 1 ? C : C.parentElement ? v(C.parentElement) : void 0, Q = (C, t) => {
137
+ let e = C.getBoundingClientRect(), o = t.getBoundingClientRect();
138
+ return { top: e.top - o.top, left: e.left - o.left, scrollTop: t.scrollTop, scrollLeft: t.scrollLeft };
126
139
  };
127
- var n = { TABS: `.${W}`, TAB_LIST: `.${L}`, TAB: `.${R}`, TAB_PANEL: `.${O}`, VERTICAL_TABS: `.${U}` }, f = class {
128
- constructor(t) {
140
+ var n = { TABS: `.${x}`, TAB_LIST: `.${D}`, TAB: `.${H}`, TAB_PANEL: `.${F}`, VERTICAL_TABS: `.${W}` }, h = class {
141
+ constructor(t, e = {}) {
129
142
  this._onSelectTabHandlers = /* @__PURE__ */ new Set();
130
- this._document = t, this._document.addEventListener("click", (e) => {
131
- let g = y(e);
132
- if (e.target && this.hideAllDropdown(e.target), Z(e)) return;
143
+ this._currentPageTabGroups = [];
144
+ this._document = t, this._options = Object.assign({ saveTabsToLocalStorage: false, saveTabsToQueryStateMode: "none" }, e), this._document.addEventListener("click", (o) => {
145
+ let g = f(o);
146
+ if (o.target && this.hideAllDropdown(o.target), Z(o)) return;
133
147
  if (this.isElementDropdownSelect(g)) {
134
- g.classList.toggle(r);
148
+ g.classList.toggle(l);
135
149
  return;
136
150
  }
137
151
  if (!this.isValidTabElement(g)) return;
138
- let o = this.getTabDataFromHTMLElement(g);
139
- o && this._selectTab(o, g);
140
- }), this._document.addEventListener("keydown", (e) => {
152
+ let I = this.getTabDataFromHTMLElement(g);
153
+ I && this._selectTab(I, g);
154
+ }), this._document.addEventListener("keydown", (o) => {
141
155
  let g = null;
142
- switch (e.key) {
156
+ switch (o.key) {
143
157
  case "ArrowLeft": {
144
158
  g = "left";
145
159
  break;
@@ -158,36 +172,84 @@
158
172
  }
159
173
  }
160
174
  if (!g) return;
161
- let o = y(e);
162
- if (Z(e) || !this.isValidTabElement(o)) return;
163
- let { tabs: c, nodes: a } = this.getTabs(o), I = this.getTabDataFromHTMLElement(o), A = c.findIndex(({ key: C }) => (I == null ? void 0 : I.key) && C === I.key);
164
- if (!I || c.length <= 1 || A === -1) return;
165
- let i = (A + (g === "left" ? -1 : 1) + c.length) % c.length;
166
- this.selectTab(c[i]), a[i].focus();
175
+ let I = f(o);
176
+ if (Z(o) || !this.isValidTabElement(I)) return;
177
+ let { tabs: a, nodes: c } = this.getTabs(I), i = this.getTabDataFromHTMLElement(I), r = a.findIndex(({ key: s }) => (i == null ? void 0 : i.key) && s === i.key);
178
+ if (!i || a.length <= 1 || r === -1) return;
179
+ let A = (r + (g === "left" ? -1 : 1) + a.length) % a.length;
180
+ this.selectTab(a[A]), c[A].focus();
167
181
  });
168
182
  }
183
+ configure(t) {
184
+ this._options = Object.assign(this._options, t);
185
+ }
169
186
  onSelectTab(t) {
170
187
  return this._onSelectTabHandlers.add(t), () => {
171
188
  this._onSelectTabHandlers.delete(t);
172
189
  };
173
190
  }
174
191
  selectTabById(t, e) {
175
- let g = this._document.querySelector(`${n.TAB}[${v}="${t}"]`);
176
- if (!g || !this.isValidTabElement(g)) return;
177
- let o = this.getTabDataFromHTMLElement(g);
178
- o && this._selectTab(o, g), e != null && e.scrollToElement && g.scrollIntoView();
192
+ let o = this._document.querySelector(`${n.TAB}[${w}="${t}"]`);
193
+ if (!o || !this.isValidTabElement(o)) return;
194
+ let g = this.getTabDataFromHTMLElement(o);
195
+ g && this._selectTab(g, o), e != null && e.scrollToElement && o.scrollIntoView();
179
196
  }
180
197
  selectTab(t) {
181
198
  this._selectTab(t);
182
199
  }
183
- _selectTab(t, e) {
184
- let { group: g, key: o, variant: c } = t;
185
- if (!g) return;
186
- let a = e && Q(e), I = a && X(e, a);
187
- this.updateHTML({ group: g, key: o, variant: c }, e, c) > 0 && (this.fireSelectTabEvent({ group: g, key: o, variant: c }, e == null ? void 0 : e.dataset.diplodocId), I && this.resetScroll(e, a, I));
200
+ restoreTabs(t) {
201
+ for (let [e, o] of Object.entries(t)) if (e) {
202
+ let g = __spreadValues({ group: e }, o);
203
+ this.selectTab(g);
204
+ }
205
+ }
206
+ getTabsFromLocalStorage() {
207
+ return JSON.parse(localStorage.getItem("tabsHistory") || "{}");
208
+ }
209
+ getTabsFromSearchQuery() {
210
+ let t = {}, e = new URLSearchParams(window.location.search);
211
+ return e.has("tabs") && (e.get("tabs") || "").split(",").forEach((I) => {
212
+ let a = I.split("_"), [c, i] = a, r = "regular";
213
+ if (a.length === 3 && (r = a[2]), c && i && Object.values(R).includes(r)) {
214
+ let A = i;
215
+ t[c] = { key: A, variant: r };
216
+ }
217
+ }), t;
218
+ }
219
+ updateLocalStorageWithTabs(t) {
220
+ this._options.saveTabsToLocalStorage && localStorage.setItem("tabsHistory", JSON.stringify(t));
221
+ }
222
+ updateQueryParamWithTabs(t) {
223
+ let e = new URLSearchParams(window.location.search), o = Object.entries(t).map(([I, { key: a, variant: c }]) => c === "regular" ? `${I}_${a}` : `${I}_${a}_${c}`);
224
+ e.set("tabs", o.join(","));
225
+ let g = `${window.location.origin}${window.location.pathname}?${e.toString()}`;
226
+ window.history.replaceState({}, document.title, g);
188
227
  }
189
- updateHTML(t, e, g) {
190
- switch (g) {
228
+ getCurrentPageTabHistory(t) {
229
+ return Object.fromEntries(Object.entries(t).filter(([e]) => this._currentPageTabGroups.includes(e)));
230
+ }
231
+ onPageChanged() {
232
+ this._currentPageTabGroups = this.getCurrentPageTabGroups();
233
+ }
234
+ getCurrentPageTabGroups() {
235
+ let t = this._document.getElementsByClassName(x), e = /* @__PURE__ */ new Set();
236
+ return Array.from(t).forEach((o) => {
237
+ let g = o.getAttribute(B);
238
+ g && e.add(g);
239
+ }), Array.from(e);
240
+ }
241
+ clearTabsPreferred() {
242
+ localStorage.removeItem("tabsHistory"), this.updateQueryParamWithTabs({});
243
+ }
244
+ _selectTab(t, e) {
245
+ let { group: o, key: g, variant: I } = t;
246
+ if (!o) return;
247
+ this.saveTabPreferred({ group: o, key: g, variant: I });
248
+ let a = e && v(e), c = a && Q(e, a);
249
+ this.updateHTML({ group: o, key: g, variant: I }, e, I) > 0 && (this.fireSelectTabEvent({ group: o, key: g, variant: I }, e == null ? void 0 : e.dataset.diplodocId), c && this.resetScroll(e, a, c));
250
+ }
251
+ updateHTML(t, e, o) {
252
+ switch (o) {
191
253
  case "radio":
192
254
  return this.updateHTMLRadio(t, e);
193
255
  case "accordion":
@@ -196,131 +258,145 @@
196
258
  return this.updateHTMLRegular(t);
197
259
  case "dropdown":
198
260
  return this.updateHTMLDropdown(t);
261
+ default:
262
+ return 0;
263
+ }
264
+ }
265
+ saveTabPreferred(t) {
266
+ let e = {};
267
+ switch (this._options.saveTabsToLocalStorage && (e = JSON.parse(localStorage.getItem("tabsHistory") || "{}")), e[t.group] = { key: t.key, variant: t.variant }, this._options.saveTabsToLocalStorage && this.updateLocalStorageWithTabs(e), this._options.saveTabsToQueryStateMode) {
268
+ case "all": {
269
+ this.updateQueryParamWithTabs(e);
270
+ break;
271
+ }
272
+ case "page": {
273
+ this.updateQueryParamWithTabs(this.getCurrentPageTabHistory(e));
274
+ break;
275
+ }
199
276
  }
200
- return 0;
201
277
  }
202
278
  updateHTMLRadio(t, e) {
203
- let { group: g, key: o } = t, { isForced: c, root: a } = this.didTabOpenForce(e), I = c ? `.yfm-vertical-tab[${h}="true"]` : "", A = this._document.querySelectorAll(`${n.TABS}[${T}="${g}"] ${n.TAB}[${G}="${o}"]${I}`);
204
- c && (a == null || a.removeAttribute(h));
205
- let i = 0;
206
- return A.forEach((C) => {
207
- let m = C.parentNode.children;
279
+ let { group: o, key: g } = t, { isForced: I, root: a } = this.didTabOpenForce(e), c = I ? `.yfm-vertical-tab[${O}="true"]` : "", i = this._document.querySelectorAll(`${n.TABS}[${B}="${o}"] ${n.TAB}[${G}="${g}"]${c}`);
280
+ I && (a == null || a.removeAttribute(O));
281
+ let r = 0;
282
+ return i.forEach((A) => {
283
+ let m = A.parentNode.children;
208
284
  for (let p = 0; p < m.length; p += 2) {
209
285
  let [d, b] = [m.item(p), m.item(p + 1)], u = d.children.item(0);
210
- if (d === C) {
286
+ if (d === A) {
211
287
  u.checked ? (d.classList.remove("active"), b == null || b.classList.remove("active"), u.removeAttribute("checked")) : (d.classList.add("active"), b == null || b.classList.add("active"), u.setAttribute("checked", "true"));
212
288
  continue;
213
289
  }
214
- u.hasAttribute("checked") && (d.classList.remove("active"), b == null || b.classList.remove("active"), u.removeAttribute("checked")), i++;
290
+ u.hasAttribute("checked") && (d.classList.remove("active"), b == null || b.classList.remove("active"), u.removeAttribute("checked")), r++;
215
291
  }
216
- }), i;
292
+ }), r;
217
293
  }
218
294
  updateHTMLRegular(t) {
219
- let { group: e, key: g } = t, o = this._document.querySelectorAll(`${n.TABS}[${T}="${e}"] ${n.TAB}[${G}="${g}"]`), c = 0;
220
- return o.forEach((a) => {
221
- let I = a;
222
- if (!this.isValidTabElement(I) || I.dataset.diplodocIsActive === "true") return;
223
- c++;
224
- let A = a, i = A.parentNode, C = i == null ? void 0 : i.parentNode, l = Array.from((i == null ? void 0 : i.querySelectorAll(n.TAB)) || []), m = Array.from((C == null ? void 0 : C.children) || []).filter((d) => d.classList.contains(O)), p = l.indexOf(A);
225
- l.forEach((d, b) => {
226
- let u = m[b], B = b === p, D = d;
227
- D.dataset.diplodocIsActive = B ? "true" : "false", d.classList.toggle(r, B), d.setAttribute("aria-selected", B.toString()), d.setAttribute("tabindex", B ? "0" : "-1"), u.classList.toggle(r, B);
295
+ let { group: e, key: o } = t, g = this._document.querySelectorAll(`${n.TABS}[${B}="${e}"] ${n.TAB}[${G}="${o}"]`), I = 0;
296
+ return g.forEach((a) => {
297
+ let c = a;
298
+ if (!this.isValidTabElement(c) || c.dataset.diplodocIsActive === "true") return;
299
+ I++;
300
+ let i = a, r = i.parentNode, A = r == null ? void 0 : r.parentNode, s = Array.from((r == null ? void 0 : r.querySelectorAll(n.TAB)) || []), m = Array.from((A == null ? void 0 : A.children) || []).filter((d) => d.classList.contains(F)), p = s.indexOf(i);
301
+ s.forEach((d, b) => {
302
+ let u = m[b], T = b === p, S = d;
303
+ S.dataset.diplodocIsActive = T ? "true" : "false", d.classList.toggle(l, T), d.setAttribute("aria-selected", T.toString()), d.setAttribute("tabindex", T ? "0" : "-1"), u.classList.toggle(l, T);
228
304
  });
229
- }), c;
305
+ }), I;
230
306
  }
231
307
  updateHTMLDropdown(t) {
232
- let { group: e, key: g } = t, o = this._document.querySelectorAll(`${n.TABS}[${T}="${e}"] ${n.TAB}[${G}="${g}"]`), c = 0;
233
- return o.forEach((a) => {
234
- let I = a.closest(`[${x}=dropdown]`);
235
- if (!(I != null && I.children)) return;
236
- let A = I.children.item(0), i = I.children.item(1);
237
- A == null || A.classList.remove(r);
238
- let C = Array.from((i == null ? void 0 : i.children) || []).indexOf(a) + 2;
239
- for (let l = 2; l < I.children.length; l++) {
240
- let m = I.children.item(l), p = i == null ? void 0 : i.children.item(l - 2);
241
- if (c++, C === l) {
242
- m == null || m.classList.add(r), p.classList.add(r), A.innerHTML = a.innerHTML, A.classList.add("filled");
308
+ let { group: e, key: o } = t, g = this._document.querySelectorAll(`${n.TABS}[${B}="${e}"] ${n.TAB}[${G}="${o}"]`), I = 0;
309
+ return g.forEach((a) => {
310
+ let c = a.closest(`[${y}=dropdown]`);
311
+ if (!(c != null && c.children)) return;
312
+ let i = c.children.item(0), r = c.children.item(1);
313
+ i == null || i.classList.remove(l);
314
+ let A = Array.from((r == null ? void 0 : r.children) || []).indexOf(a) + 2;
315
+ for (let s = 2; s < c.children.length; s++) {
316
+ let m = c.children.item(s), p = r == null ? void 0 : r.children.item(s - 2);
317
+ if (I++, A === s) {
318
+ m == null || m.classList.add(l), p.classList.add(l), i.innerHTML = a.innerHTML, i.classList.add("filled");
243
319
  continue;
244
320
  }
245
- p.classList.remove(r), m.classList.remove(r);
321
+ p.classList.remove(l), m.classList.remove(l);
246
322
  }
247
- }), c;
323
+ }), I;
248
324
  }
249
325
  updateHTMLAccordion(t, e) {
250
- let { group: g, key: o } = t, c = this._document.querySelectorAll(`${n.TABS}[${T}="${g}"] ${n.TAB}[${G}="${o}"]`), a = 0;
251
- return c.forEach((I) => {
252
- let A = I.closest(`[${x}=accordion]`);
253
- if (A != null && A.children) for (let i = 0; i < A.children.length; i += 2) {
254
- let C = A.children.item(i), l = A.children.item(i + 1);
255
- if (a++, I === C) {
256
- C == null || C.classList.toggle(r), l == null || l.classList.toggle(r);
326
+ let { group: o, key: g } = t, I = this._document.querySelectorAll(`${n.TABS}[${B}="${o}"] ${n.TAB}[${G}="${g}"]`), a = 0;
327
+ return I.forEach((c) => {
328
+ let i = c.closest(`[${y}=accordion]`);
329
+ if (i != null && i.children) for (let r = 0; r < i.children.length; r += 2) {
330
+ let A = i.children.item(r), s = i.children.item(r + 1);
331
+ if (a++, c === A) {
332
+ A == null || A.classList.toggle(l), s == null || s.classList.toggle(l);
257
333
  continue;
258
334
  }
259
- C == null || C.classList.remove(r), l == null || l.classList.remove(r);
335
+ A == null || A.classList.remove(l), s == null || s.classList.remove(l);
260
336
  }
261
337
  }), e && !this.checkVisible(e) && setTimeout(() => {
262
338
  e.scrollIntoView({ block: "nearest" });
263
339
  }), a;
264
340
  }
265
341
  checkVisible(t) {
266
- let e = t.getBoundingClientRect(), g = Math.max(document.documentElement.clientHeight, window.innerHeight);
267
- return !(e.bottom < 0 || e.top - g >= 0);
342
+ let e = t.getBoundingClientRect(), o = Math.max(document.documentElement.clientHeight, window.innerHeight);
343
+ return !(e.bottom < 0 || e.top - o >= 0);
268
344
  }
269
345
  hideAllDropdown(t) {
270
- this._document.querySelectorAll(".yfm-tabs-dropdown-select.active").forEach((g) => {
271
- g.contains(t) || g.classList.remove(r);
346
+ this._document.querySelectorAll(".yfm-tabs-dropdown-select.active").forEach((o) => {
347
+ o.contains(t) || o.classList.remove(l);
272
348
  });
273
349
  }
274
- resetScroll(t, e, g) {
275
- let o = X(t, e), c = o.top - g.top, a = o.left - g.left, I = o.scrollTop - g.scrollTop, A = o.scrollLeft - g.scrollLeft;
276
- e.scrollTo(e.scrollLeft + a - A, e.scrollTop + c - I);
350
+ resetScroll(t, e, o) {
351
+ let g = Q(t, e), I = g.top - o.top, a = g.left - o.left, c = g.scrollTop - o.scrollTop, i = g.scrollLeft - o.scrollLeft;
352
+ e.scrollTo(e.scrollLeft + a - i, e.scrollTop + I - c);
277
353
  }
278
354
  didTabOpenForce(t) {
279
355
  if (!t) return {};
280
356
  if (t.dataset.diplodocForced) return { root: t, isForced: true };
281
- let e = t.dataset.diplodocVerticalTab ? t : t.parentElement, g = typeof (e == null ? void 0 : e.dataset.diplodocForced) != "undefined";
282
- return { root: e, isForced: g };
357
+ let e = t.dataset.diplodocVerticalTab ? t : t.parentElement, o = typeof (e == null ? void 0 : e.dataset.diplodocForced) != "undefined";
358
+ return { root: e, isForced: o };
283
359
  }
284
360
  fireSelectTabEvent(t, e) {
285
- let { group: g, key: o, variant: c } = t, a = g.startsWith(H) ? { key: o, variant: c } : t;
286
- this._onSelectTabHandlers.forEach((I) => {
287
- I({ tab: a, currentTabId: e });
361
+ let { group: o, key: g, variant: I } = t, a = o.startsWith(U) ? { key: g, variant: I } : t;
362
+ this._onSelectTabHandlers.forEach((c) => {
363
+ c({ tab: a, currentTabId: e });
288
364
  });
289
365
  }
290
366
  getTabsType(t) {
291
- let e = t.closest(`[${x}]`);
367
+ let e = t.closest(`[${y}]`);
292
368
  if (e) return e.dataset.diplodocVariant;
293
369
  }
294
370
  isValidTabElement(t) {
295
371
  return !!this.getTabsType(t);
296
372
  }
297
373
  isElementDropdownSelect(t) {
298
- return t.classList.contains(N);
374
+ return t.classList.contains(L);
299
375
  }
300
376
  getTabDataFromHTMLElement(t) {
301
- var c, a, I;
377
+ var I, a, c;
302
378
  let e = this.getTabsType(t);
303
379
  if (e === "radio") {
304
- let A = t.dataset.diplodocVerticalTab ? t : t.parentElement, i = A.dataset.diplodocKey, C = (c = A.closest(n.TABS)) == null ? void 0 : c.dataset.diplodocGroup;
305
- return i && C ? { group: C, key: i, variant: "radio" } : null;
380
+ let i = t.dataset.diplodocVerticalTab ? t : t.parentElement, r = i.dataset.diplodocKey, A = (I = i.closest(n.TABS)) == null ? void 0 : I.dataset.diplodocGroup;
381
+ return r && A ? { group: A, key: r, variant: "radio" } : null;
306
382
  }
307
383
  if (e === "dropdown" || e === "accordion") {
308
- let A = t.dataset.diplodocKey, i = (a = t.closest(n.TABS)) == null ? void 0 : a.dataset.diplodocGroup;
309
- return A && i ? { group: i, key: A, variant: e } : null;
384
+ let i = t.dataset.diplodocKey, r = (a = t.closest(n.TABS)) == null ? void 0 : a.dataset.diplodocGroup;
385
+ return i && r ? { group: r, key: i, variant: e } : null;
310
386
  }
311
- let g = t.dataset.diplodocKey, o = (I = t.closest(n.TABS)) == null ? void 0 : I.dataset.diplodocGroup;
312
- return g && o ? { group: o, key: g, variant: "regular" } : null;
387
+ let o = t.dataset.diplodocKey, g = (c = t.closest(n.TABS)) == null ? void 0 : c.dataset.diplodocGroup;
388
+ return o && g ? { group: g, key: o, variant: "regular" } : null;
313
389
  }
314
390
  getTabs(t) {
315
- var c, a;
316
- let e = (c = t.closest(n.TABS)) == null ? void 0 : c.dataset.diplodocGroup, g = (a = t.closest(n.TAB_LIST)) == null ? void 0 : a.querySelectorAll(n.TAB), o = [];
317
- return g.forEach((I) => {
318
- let A = I == null ? void 0 : I.dataset.diplodocKey;
319
- A && o.push({ group: e, key: A, variant: "regular" });
320
- }), { tabs: o, nodes: g };
391
+ var I, a;
392
+ let e = (I = t.closest(n.TABS)) == null ? void 0 : I.dataset.diplodocGroup, o = (a = t.closest(n.TAB_LIST)) == null ? void 0 : a.querySelectorAll(n.TAB), g = [];
393
+ return o.forEach((c) => {
394
+ let i = c == null ? void 0 : c.dataset.diplodocKey;
395
+ i && g.push({ group: e, key: i, variant: "regular" });
396
+ }), { tabs: g, nodes: o };
321
397
  }
322
398
  };
323
- typeof window != "undefined" && typeof document != "undefined" && !window[F] && (window[F] = new f(document));
399
+ typeof window != "undefined" && typeof document != "undefined" && !window[X] && (window[X] = new h(document));
324
400
  })();
325
401
 
326
402
  // src/js/polyfill.js