@scalar/api-reference 1.24.75 → 1.24.77

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/browser/standalone.js +7450 -7448
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  6. package/dist/components/ApiReferenceLayout.vue2.js +71 -71
  7. package/dist/components/Content/Lazy/Loading.vue.js +1 -1
  8. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.d.ts.map +1 -1
  9. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue.js +1 -1
  10. package/dist/components/Content/Operation/PathResponses/ExampleResponse.vue2.js +28 -22
  11. package/dist/components/Content/Tag/Endpoints.vue.d.ts +2 -6
  12. package/dist/components/Content/Tag/Endpoints.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
  14. package/dist/components/Content/Tag/Endpoints.vue2.js +57 -60
  15. package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Tag/Tag.vue.js +2 -2
  17. package/dist/components/Content/Tag/Tag.vue2.js +21 -33
  18. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  19. package/dist/features/ExampleRequest/ExampleRequest.vue.js +4 -4
  20. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +11 -10
  21. package/dist/hooks/useSidebar.d.ts +9 -0
  22. package/dist/hooks/useSidebar.d.ts.map +1 -1
  23. package/dist/hooks/useSidebar.js +123 -108
  24. package/dist/index.js +20 -19
  25. package/dist/style.css +1 -1
  26. package/package.json +6 -6
  27. package/dist/components/Content/Tag/mutationObserver.d.ts +0 -3
  28. package/dist/components/Content/Tag/mutationObserver.d.ts.map +0 -1
  29. package/dist/components/Content/Tag/mutationObserver.js +0 -7
@@ -1,7 +1,7 @@
1
1
  import o from "./Tag.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8ef9660c"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-33927e3b"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,52 +1,40 @@
1
- import { defineComponent as b, ref as h, computed as S, openBlock as r, createBlock as a, unref as i, withCtx as k, createCommentVNode as y, renderSlot as C } from "vue";
2
- import T from "../../ShowMoreButton.vue.js";
3
- import A from "./Endpoints.vue.js";
4
- import { observeMutations as N } from "./mutationObserver.js";
5
- import w from "../../Section/SectionContainer.vue.js";
6
- import { useSidebar as B } from "../../../hooks/useSidebar.js";
7
- import { useNavState as E } from "../../../hooks/useNavState.js";
8
- const H = /* @__PURE__ */ b({
1
+ import { defineComponent as c, ref as f, computed as u, openBlock as r, createBlock as a, unref as i, withCtx as g, createCommentVNode as h, renderSlot as k } from "vue";
2
+ import C from "../../ShowMoreButton.vue.js";
3
+ import S from "./Endpoints.vue.js";
4
+ import y from "../../Section/SectionContainer.vue.js";
5
+ import { useSidebar as T } from "../../../hooks/useSidebar.js";
6
+ import { useNavState as v } from "../../../hooks/useNavState.js";
7
+ const _ = /* @__PURE__ */ c({
9
8
  __name: "Tag",
10
9
  props: {
11
10
  id: {},
12
11
  tag: {},
13
12
  spec: {}
14
13
  },
15
- setup(m) {
16
- const n = m, s = h(null), { collapsedSidebarItems: l } = B(), { getTagId: f } = E(), p = S(
14
+ setup(s) {
15
+ const o = s, d = f(null), { collapsedSidebarItems: l } = T(), { getTagId: m } = v(), p = u(
17
16
  () => {
18
- var e, o, t;
19
- return ((e = n.spec.tags) == null ? void 0 : e.length) !== 1 || ((o = n.tag) == null ? void 0 : o.name) !== "default" || ((t = n.tag) == null ? void 0 : t.description) !== "";
17
+ var e, n, t;
18
+ return ((e = o.spec.tags) == null ? void 0 : e.length) !== 1 || ((n = o.tag) == null ? void 0 : n.name) !== "default" || ((t = o.tag) == null ? void 0 : t.description) !== "";
20
19
  }
21
- ), d = (e) => {
22
- window.location.href = `#${e}`;
23
- }, u = (e) => {
24
- N(s, (o, t) => {
25
- o.forEach((v) => {
26
- Array.from(v.addedNodes).some((c) => c instanceof HTMLElement && c.id === e) && (d(e), t.disconnect());
27
- });
28
- });
29
- }, g = (e) => {
30
- document.getElementById(e) ? d(e) : u(e);
31
- };
32
- return (e, o) => (r(), a(i(w), {
20
+ );
21
+ return (e, n) => (r(), a(i(y), {
33
22
  ref_key: "sectionContainerRef",
34
- ref: s,
23
+ ref: d,
35
24
  class: "tag-section-container"
36
25
  }, {
37
- default: k(() => {
26
+ default: g(() => {
38
27
  var t;
39
28
  return [
40
- p.value ? (r(), a(A, {
29
+ p.value ? (r(), a(S, {
41
30
  key: 0,
42
31
  id: e.id,
43
- tag: e.tag,
44
- onObserveAndNavigate: g
45
- }, null, 8, ["id", "tag"])) : y("", !0),
46
- !i(l)[i(f)(e.tag)] && ((t = e.tag.operations) == null ? void 0 : t.length) > 1 ? (r(), a(T, {
32
+ tag: e.tag
33
+ }, null, 8, ["id", "tag"])) : h("", !0),
34
+ !i(l)[i(m)(e.tag)] && ((t = e.tag.operations) == null ? void 0 : t.length) > 1 ? (r(), a(C, {
47
35
  key: 1,
48
36
  id: e.id ?? ""
49
- }, null, 8, ["id"])) : C(e.$slots, "default", { key: 2 }, void 0, !0)
37
+ }, null, 8, ["id"])) : k(e.$slots, "default", { key: 2 }, void 0, !0)
50
38
  ];
51
39
  }),
52
40
  _: 3
@@ -54,5 +42,5 @@ const H = /* @__PURE__ */ b({
54
42
  }
55
43
  });
56
44
  export {
57
- H as default
45
+ _ as default
58
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AAmXA,OAAO,KAAK,EACV,oBAAoB,E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AoB;;qBADd,oBAAoB,EAAE,GAAG,IAAI;eACnC,oBAAoB;aAgd/B,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
- import e from "./ExampleRequest.vue2.js";
1
+ import o from "./ExampleRequest.vue2.js";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ o(e, [["__scopeId", "data-v-eedd3e3e"]]);
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b5a8fcbc"]]);
5
5
  export {
6
- r as default
6
+ p as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as U, ref as _, watch as L, computed as y, inject as I, onServerPrefetch as M, useSSRContext as Y, openBlock as d, createBlock as b, unref as s, withCtx as c, createVNode as p, createElementBlock as g, Fragment as V, createTextVNode as H, toDisplayString as v, createElementVNode as O, renderSlot as j, createCommentVNode as N } from "vue";
1
+ import { defineComponent as U, ref as _, watch as L, computed as y, inject as I, onServerPrefetch as M, useSSRContext as Y, openBlock as d, createBlock as b, unref as s, withCtx as c, createVNode as p, createElementBlock as h, Fragment as V, createTextVNode as H, toDisplayString as v, createElementVNode as O, renderSlot as j, createCommentVNode as N } from "vue";
2
2
  import { ScalarCodeBlock as z } from "@scalar/components";
3
3
  import { createHash as D, ssrState as Q } from "@scalar/oas-utils/helpers";
4
4
  import { getRequestFromOperation as W } from "@scalar/oas-utils/spec-getters";
@@ -21,7 +21,7 @@ import { useServerStore as me } from "../../legacy/stores/useServerStore.js";
21
21
  import { useAuthenticationStore as ue } from "../../legacy/stores/useAuthenticationStore.js";
22
22
  import { getHarRequest as de } from "../../helpers/getHarRequest.js";
23
23
  import { getUrlFromServerState as fe } from "../../legacy/helpers/getUrlFromServerState.js";
24
- const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
24
+ const ye = { class: "request-header" }, ge = { class: "code-snippet" }, he = {
25
25
  key: 0,
26
26
  class: "request-card-footer-addon"
27
27
  }, Ue = /* @__PURE__ */ U({
@@ -40,7 +40,7 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
40
40
  availableTargets: $,
41
41
  httpTargetTitle: w,
42
42
  httpClientTitle: F
43
- } = ce(), { server: E } = me(), { authentication: h } = ue(), l = _(
43
+ } = ce(), { server: E } = me(), { authentication: g } = ue(), l = _(
44
44
  // Default to first custom example
45
45
  (k = a.customExamples) != null && k.length ? {
46
46
  targetKey: "customExamples",
@@ -83,7 +83,7 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
83
83
  x.value
84
84
  ),
85
85
  le(
86
- h,
86
+ g,
87
87
  ((u = a.operation.information) == null ? void 0 : u.security) ?? (i == null ? void 0 : i())
88
88
  )
89
89
  ), o = n.clientKey === "undici" || n.clientKey === "fetch" || n.clientKey === "ofetch" ? n.clientKey : null, t = n.targetKey.replace("javascript", "js");
@@ -110,7 +110,7 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
110
110
  e.payload.data[K] = await S();
111
111
  }), y(() => pe({
112
112
  serverState: E,
113
- authenticationState: h,
113
+ authenticationState: g,
114
114
  operation: a.operation,
115
115
  globalSecurity: i == null ? void 0 : i()
116
116
  }));
@@ -166,9 +166,9 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
166
166
  default: c(() => {
167
167
  var t;
168
168
  return [
169
- l.value.targetKey === "customExamples" ? (d(), g(V, { key: 0 }, [
169
+ l.value.targetKey === "customExamples" ? (d(), h(V, { key: 0 }, [
170
170
  H(v(((t = a.customExamples) == null ? void 0 : t[l.value.clientKey].label) ?? "Example"), 1)
171
- ], 64)) : (d(), g(V, { key: 1 }, [
171
+ ], 64)) : (d(), h(V, { key: 1 }, [
172
172
  H(v(s(w)) + " " + v(s(F)), 1)
173
173
  ], 64))
174
174
  ];
@@ -194,10 +194,11 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
194
194
  frameless: ""
195
195
  }, {
196
196
  default: c(() => [
197
- O("div", he, [
197
+ O("div", ge, [
198
198
  p(s(z), {
199
+ class: "bg-b-2",
199
200
  content: s(q),
200
- hideCredentials: s(se)(s(h)),
201
+ hideCredentials: s(se)(s(g)),
201
202
  lang: A.value,
202
203
  lineNumbers: ""
203
204
  }, null, 8, ["content", "hideCredentials", "lang"])
@@ -213,7 +214,7 @@ const ye = { class: "request-header" }, he = { class: "code-snippet" }, ge = {
213
214
  default: c(() => {
214
215
  var t, r, m, u;
215
216
  return [
216
- C.value ? (d(), g("div", ge, [
217
+ C.value ? (d(), h("div", he, [
217
218
  p(G, {
218
219
  class: "request-example-selector",
219
220
  examples: ((u = (m = (r = (t = e.operation.information) == null ? void 0 : t.requestBody) == null ? void 0 : r.content) == null ? void 0 : m["application/json"]) == null ? void 0 : u.examples) ?? [],
@@ -21,6 +21,14 @@ export type ParsedSpecOption = {
21
21
  export type TagsSorterOption = {
22
22
  tagsSorter?: 'alpha' | ((a: Tag, b: Tag) => number);
23
23
  };
24
+ /**
25
+ * Scroll to operation
26
+ *
27
+ * Similar to scrollToId BUT in the case of a section not being open,
28
+ * it uses the lazyBus to ensure the section is open before scrolling to it
29
+ *
30
+ */
31
+ export declare const scrollToOperation: (operationId: string) => void;
24
32
  /**
25
33
  * Provides the sidebar state and methods to control it.
26
34
  */
@@ -37,6 +45,7 @@ export declare function useSidebar(options?: ParsedSpecOption & TagsSorterOption
37
45
  hideModels: import("vue").Ref<boolean>;
38
46
  setParsedSpec: typeof setParsedSpec;
39
47
  defaultOpenAllTags: import("vue").Ref<boolean>;
48
+ scrollToOperation: (operationId: string) => void;
40
49
  };
41
50
  export {};
42
51
  //# sourceMappingURL=useSidebar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAwB,MAAM,mBAAmB,CAAA;AAexE,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAkBD,uDAAuD;AACvD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAWhC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iB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AAE,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAA;CACpD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,SAepD,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,gBAAgB;;;;;;;;;;;;;qCApBzB,MAAM;EAsEpD"}
@@ -1,75 +1,77 @@
1
- import { ssrState as Z } from "@scalar/oas-utils/helpers";
2
- import { ref as h, reactive as z, computed as J, watch as D } from "vue";
3
- import { useNavState as _ } from "./useNavState.js";
4
- import { getLowestHeadingLevel as K } from "../helpers/getLowestHeadingLevel.js";
5
- import { openClientFor as F } from "../helpers/openClientFor.js";
6
- import { hasModels as $ } from "../helpers/hasModels.js";
7
- import { getModels as V } from "../helpers/getModels.js";
8
- import { hasWebhooks as ee } from "../helpers/hasWebhooks.js";
9
- import { getHeadingsFromMarkdown as te } from "../helpers/getHeadingsFromMarkdown.js";
10
- import { useApiClientStore as se } from "../legacy/stores/useApiClientStore.js";
11
- import { useOpenApiStore as oe } from "../legacy/stores/useOpenApiStore.js";
1
+ import { ssrState as $ } from "@scalar/oas-utils/helpers";
2
+ import { ref as m, reactive as J, computed as K, watch as B } from "vue";
3
+ import { lazyBus as ee } from "../components/Content/Lazy/lazyBus.js";
4
+ import { useNavState as te } from "./useNavState.js";
5
+ import { getLowestHeadingLevel as N } from "../helpers/getLowestHeadingLevel.js";
6
+ import { openClientFor as D } from "../helpers/openClientFor.js";
7
+ import { hasModels as se } from "../helpers/hasModels.js";
8
+ import { getModels as F } from "../helpers/getModels.js";
9
+ import { hasWebhooks as oe } from "../helpers/hasWebhooks.js";
10
+ import { scrollToId as V } from "../helpers/scrollToId.js";
11
+ import { getHeadingsFromMarkdown as ie } from "../helpers/getHeadingsFromMarkdown.js";
12
+ import { useApiClientStore as re } from "../legacy/stores/useApiClientStore.js";
13
+ import { useOpenApiStore as le } from "../legacy/stores/useOpenApiStore.js";
12
14
  const {
13
- getHeadingId: B,
15
+ getHeadingId: z,
14
16
  getModelId: P,
15
17
  getOperationId: R,
16
- getSectionId: ie,
17
- getTagId: N,
18
+ getSectionId: Q,
19
+ getTagId: U,
18
20
  getWebhookId: A,
19
- hash: I
20
- } = _(), r = h(void 0), w = z({});
21
+ hash: O
22
+ } = te(), l = m(void 0), S = J({});
21
23
  function q(t) {
22
- var s, i;
23
- return w.tagsSorter === "alpha" ? t.tags = (s = t.tags) == null ? void 0 : s.sort((l, c) => l.name.localeCompare(c.name)) : typeof w.tagsSorter == "function" && (t.tags = (i = t.tags) == null ? void 0 : i.sort(w.tagsSorter)), r.value = t;
24
+ var s, o;
25
+ return S.tagsSorter === "alpha" ? t.tags = (s = t.tags) == null ? void 0 : s.sort((r, c) => r.name.localeCompare(c.name)) : typeof S.tagsSorter == "function" && (t.tags = (o = t.tags) == null ? void 0 : o.sort(S.tagsSorter)), l.value = t;
24
26
  }
25
- const Q = h(!1), U = h(!1), S = z(
26
- Z["useSidebarContent-collapsedSidebarItems"] ?? {}
27
+ const X = m(!1), Y = m(!1), f = J(
28
+ $["useSidebarContent-collapsedSidebarItems"] ?? {}
27
29
  );
28
- function re(t) {
29
- S[t] = !S[t];
30
+ function ne(t) {
31
+ f[t] = !f[t];
30
32
  }
31
- function b(t, s) {
32
- S[t] = s;
33
+ function h(t, s) {
34
+ f[t] = s;
33
35
  }
34
- const C = h([]);
35
- function le(t) {
36
- const s = te(t), i = K(s);
37
- return s.filter((l) => (
36
+ const C = m([]);
37
+ function ae(t) {
38
+ const s = ie(t), o = N(s);
39
+ return s.filter((r) => (
38
40
  // highest level, eg. # Introduction
39
- l.depth === i || // second highest level, eg. ## Authentication
40
- l.depth === i + 1
41
+ r.depth === o || // second highest level, eg. ## Authentication
42
+ r.depth === o + 1
41
43
  ));
42
44
  }
43
- const X = J(() => {
44
- var O, T, y, H, M, j, x, E, G, L;
45
- const { state: t } = se(), s = {}, {
46
- openApi: { globalSecurity: i }
47
- } = oe(), l = [];
45
+ const Z = K(() => {
46
+ var T, I, y, H, M, j, x, E, G, L;
47
+ const { state: t } = re(), s = {}, {
48
+ openApi: { globalSecurity: o }
49
+ } = le(), r = [];
48
50
  let c = null;
49
51
  C.value.forEach((e) => {
50
- var o;
51
- e.depth === K(C.value) ? (c = {
52
- id: B(e),
52
+ var i;
53
+ e.depth === N(C.value) ? (c = {
54
+ id: z(e),
53
55
  title: e.value,
54
56
  show: !t.showApiClient,
55
57
  children: []
56
- }, l.push(c)) : c && ((o = c.children) == null || o.push({
57
- id: B(e),
58
+ }, r.push(c)) : c && ((i = c.children) == null || i.push({
59
+ id: z(e),
58
60
  title: e.value,
59
61
  show: !t.showApiClient
60
62
  }));
61
63
  });
62
- const p = (T = (O = r.value) == null ? void 0 : O.tags) == null ? void 0 : T[0], f = p && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((y = r.value) == null ? void 0 : y.tags) ? (M = (H = r.value) == null ? void 0 : H.tags) == null ? void 0 : M.filter((e) => {
63
- var o;
64
- return ((o = e.operations) == null ? void 0 : o.length) > 0;
64
+ const p = (I = (T = l.value) == null ? void 0 : T.tags) == null ? void 0 : I[0], v = p && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((y = l.value) == null ? void 0 : y.tags) ? (M = (H = l.value) == null ? void 0 : H.tags) == null ? void 0 : M.filter((e) => {
65
+ var i;
66
+ return ((i = e.operations) == null ? void 0 : i.length) > 0;
65
67
  }).map((e) => {
66
- var o;
68
+ var i;
67
69
  return {
68
- id: N(e),
70
+ id: U(e),
69
71
  title: e.name,
70
72
  displayTitle: e["x-displayName"] ?? e.name,
71
73
  show: !0,
72
- children: (o = e.operations) == null ? void 0 : o.map(
74
+ children: (i = e.operations) == null ? void 0 : i.map(
73
75
  (n) => {
74
76
  var d;
75
77
  const a = R(n, e), u = n.name ?? n.path;
@@ -80,7 +82,7 @@ const X = J(() => {
80
82
  deprecated: ((d = n.information) == null ? void 0 : d.deprecated) ?? !1,
81
83
  show: !0,
82
84
  select: () => {
83
- t.showApiClient && F(n, i);
85
+ t.showApiClient && D(n, o);
84
86
  }
85
87
  };
86
88
  }
@@ -88,50 +90,50 @@ const X = J(() => {
88
90
  };
89
91
  }) : (j = p == null ? void 0 : p.operations) == null ? void 0 : j.map((e) => {
90
92
  var a;
91
- const o = R(e, p), n = e.name ?? e.path;
92
- return s[o] = n, {
93
- id: o,
93
+ const i = R(e, p), n = e.name ?? e.path;
94
+ return s[i] = n, {
95
+ id: i,
94
96
  title: n,
95
97
  httpVerb: e.httpVerb,
96
98
  deprecated: ((a = e.information) == null ? void 0 : a.deprecated) ?? !1,
97
99
  show: !0,
98
100
  select: () => {
99
- t.showApiClient && F(e, i);
101
+ t.showApiClient && D(e, o);
100
102
  }
101
103
  };
102
104
  });
103
- let m = $(r.value) && !Q.value ? [
105
+ let g = se(l.value) && !X.value ? [
104
106
  {
105
107
  id: P(),
106
108
  title: "Models",
107
109
  show: !t.showApiClient,
108
- children: Object.keys(V(r.value) ?? {}).map(
110
+ children: Object.keys(F(l.value) ?? {}).map(
109
111
  (e) => {
110
112
  var n;
111
- const o = P(e);
112
- return s[o] = e, {
113
- id: o,
114
- title: ((n = V(r.value)) == null ? void 0 : n[e]).title ?? e,
113
+ const i = P(e);
114
+ return s[i] = e, {
115
+ id: i,
116
+ title: ((n = F(l.value)) == null ? void 0 : n[e]).title ?? e,
115
117
  show: !t.showApiClient
116
118
  };
117
119
  }
118
120
  )
119
121
  }
120
- ] : [], v = ee(r.value) ? [
122
+ ] : [], w = oe(l.value) ? [
121
123
  {
122
124
  id: A(),
123
125
  title: "Webhooks",
124
126
  show: !t.showApiClient,
125
- children: Object.keys(((x = r.value) == null ? void 0 : x.webhooks) ?? {}).map((e) => {
127
+ children: Object.keys(((x = l.value) == null ? void 0 : x.webhooks) ?? {}).map((e) => {
126
128
  var n, a;
127
- const o = A(e);
128
- return s[o] = e, Object.keys(
129
- ((a = (n = r.value) == null ? void 0 : n.webhooks) == null ? void 0 : a[e]) ?? {}
129
+ const i = A(e);
130
+ return s[i] = e, Object.keys(
131
+ ((a = (n = l.value) == null ? void 0 : n.webhooks) == null ? void 0 : a[e]) ?? {}
130
132
  ).map((u) => {
131
- var d, g, W;
133
+ var d, b, W;
132
134
  return {
133
135
  id: A(e, u),
134
- title: (W = (g = (d = r.value) == null ? void 0 : d.webhooks) == null ? void 0 : g[e][u]) == null ? void 0 : W.name,
136
+ title: (W = (b = (d = l.value) == null ? void 0 : d.webhooks) == null ? void 0 : b[e][u]) == null ? void 0 : W.name,
135
137
  httpVerb: u,
136
138
  show: !t.showApiClient
137
139
  };
@@ -139,84 +141,97 @@ const X = J(() => {
139
141
  }).flat()
140
142
  }
141
143
  ] : [];
142
- const Y = (E = r.value) != null && E["x-tagGroups"] ? (L = (G = r.value) == null ? void 0 : G["x-tagGroups"]) == null ? void 0 : L.map((e) => {
144
+ const _ = (E = l.value) != null && E["x-tagGroups"] ? (L = (G = l.value) == null ? void 0 : G["x-tagGroups"]) == null ? void 0 : L.map((e) => {
143
145
  var a;
144
- const o = [];
146
+ const i = [];
145
147
  return (a = e.tags) == null || a.map((u) => {
146
- if (u === "models" && m.length > 0)
147
- o.push(m[0]), m = [];
148
- else if (u === "webhooks" && v.length > 0)
149
- o.push(v[0]), v = [];
148
+ if (u === "models" && g.length > 0)
149
+ i.push(g[0]), g = [];
150
+ else if (u === "webhooks" && w.length > 0)
151
+ i.push(w[0]), w = [];
150
152
  else {
151
- const d = f == null ? void 0 : f.find(
152
- (g) => g.title === u
153
+ const d = v == null ? void 0 : v.find(
154
+ (b) => b.title === u
153
155
  );
154
- d && o.push(d);
156
+ d && i.push(d);
155
157
  }
156
158
  }), {
157
159
  id: e.name,
158
160
  title: e.name,
159
- children: o,
161
+ children: i,
160
162
  show: !0,
161
163
  isGroup: !0
162
164
  };
163
165
  }) : void 0, k = [
164
- ...l,
165
- ...Y ?? f ?? [],
166
- ...v,
167
- ...m
166
+ ...r,
167
+ ..._ ?? v ?? [],
168
+ ...w,
169
+ ...g
168
170
  ];
169
- return U.value && k.forEach((e) => {
170
- b(e.id, !0), e.show = !0;
171
+ return Y.value && k.forEach((e) => {
172
+ h(e.id, !0), e.show = !0;
171
173
  }), {
172
174
  entries: k,
173
175
  titles: s
174
176
  };
175
- }), ne = h(!1), ae = J(() => {
177
+ }), ue = m(!1), de = K(() => {
176
178
  var t, s;
177
- return ((s = (t = X.value) == null ? void 0 : t.titles) == null ? void 0 : s[I.value]) ?? "";
178
- });
179
- function Ce(t) {
180
- return Object.assign(w, t), t != null && t.parsedSpec && (q(t.parsedSpec), D(
179
+ return ((s = (t = Z.value) == null ? void 0 : t.titles) == null ? void 0 : s[O.value]) ?? "";
180
+ }), ce = (t) => {
181
+ const s = Q(t);
182
+ if (s !== t)
183
+ if (f[s])
184
+ V(t);
185
+ else {
186
+ const o = ee.on((r) => {
187
+ r.id === t && (V(t), o());
188
+ });
189
+ h(s, !0);
190
+ }
191
+ };
192
+ function Ie(t) {
193
+ return Object.assign(S, t), t != null && t.parsedSpec && (q(t.parsedSpec), B(
181
194
  () => {
182
- var s, i;
183
- return (i = (s = r.value) == null ? void 0 : s.tags) == null ? void 0 : i.length;
195
+ var s, o;
196
+ return (o = (s = l.value) == null ? void 0 : s.tags) == null ? void 0 : o.length;
184
197
  },
185
198
  () => {
186
- var s, i;
187
- if (I.value) {
188
- const l = ie(I.value);
189
- l && b(l, !0);
199
+ var s, o;
200
+ if (O.value) {
201
+ const r = Q(O.value);
202
+ r && h(r, !0);
190
203
  } else {
191
- const l = (i = (s = r.value) == null ? void 0 : s.tags) == null ? void 0 : i[0];
192
- l && b(N(l), !0);
204
+ const r = (o = (s = l.value) == null ? void 0 : s.tags) == null ? void 0 : o[0];
205
+ r && h(U(r), !0);
193
206
  }
194
207
  }
195
- ), D(
208
+ ), B(
196
209
  () => {
197
- var s, i;
198
- return (i = (s = r.value) == null ? void 0 : s.info) == null ? void 0 : i.description;
210
+ var s, o;
211
+ return (o = (s = l.value) == null ? void 0 : s.info) == null ? void 0 : o.description;
199
212
  },
200
213
  () => {
201
- var i, l;
202
- const s = (l = (i = r.value) == null ? void 0 : i.info) == null ? void 0 : l.description;
203
- return s ? C.value = le(s) : C.value = [];
214
+ var o, r;
215
+ const s = (r = (o = l.value) == null ? void 0 : o.info) == null ? void 0 : r.description;
216
+ return s ? C.value = ae(s) : C.value = [];
204
217
  },
205
218
  {
206
219
  immediate: !0
207
220
  }
208
221
  )), {
209
- breadcrumb: ae,
210
- items: X,
211
- isSidebarOpen: ne,
212
- collapsedSidebarItems: S,
213
- toggleCollapsedSidebarItem: re,
214
- setCollapsedSidebarItem: b,
215
- hideModels: Q,
222
+ breadcrumb: de,
223
+ items: Z,
224
+ isSidebarOpen: ue,
225
+ collapsedSidebarItems: f,
226
+ toggleCollapsedSidebarItem: ne,
227
+ setCollapsedSidebarItem: h,
228
+ hideModels: X,
216
229
  setParsedSpec: q,
217
- defaultOpenAllTags: U
230
+ defaultOpenAllTags: Y,
231
+ scrollToOperation: ce
218
232
  };
219
233
  }
220
234
  export {
221
- Ce as useSidebar
235
+ ce as scrollToOperation,
236
+ Ie as useSidebar
222
237
  };