@kong-ui-public/entities-shared 3.33.1 → 3.33.2-pr.2609.f4d92e2e4.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.
Files changed (104) hide show
  1. package/package.json +1 -1
  2. package/dist/entities-shared.es.js +0 -4729
  3. package/dist/entities-shared.umd.js +0 -54
  4. package/dist/style.css +0 -1
  5. package/dist/types/components/common/JsonCodeBlock.vue.d.ts +0 -58
  6. package/dist/types/components/common/JsonCodeBlock.vue.d.ts.map +0 -1
  7. package/dist/types/components/common/TableTags.vue.d.ts +0 -26
  8. package/dist/types/components/common/TableTags.vue.d.ts.map +0 -1
  9. package/dist/types/components/common/TerraformCodeBlock.vue.d.ts +0 -46
  10. package/dist/types/components/common/TerraformCodeBlock.vue.d.ts.map +0 -1
  11. package/dist/types/components/common/YamlCodeBlock.vue.d.ts +0 -16
  12. package/dist/types/components/common/YamlCodeBlock.vue.d.ts.map +0 -1
  13. package/dist/types/components/entity-base-config-card/ConfigCardDisplay.vue.d.ts +0 -151
  14. package/dist/types/components/entity-base-config-card/ConfigCardDisplay.vue.d.ts.map +0 -1
  15. package/dist/types/components/entity-base-config-card/ConfigCardItem.vue.d.ts +0 -116
  16. package/dist/types/components/entity-base-config-card/ConfigCardItem.vue.d.ts.map +0 -1
  17. package/dist/types/components/entity-base-config-card/EntityBaseConfigCard.vue.d.ts +0 -284
  18. package/dist/types/components/entity-base-config-card/EntityBaseConfigCard.vue.d.ts.map +0 -1
  19. package/dist/types/components/entity-base-config-card/InternalLinkItem.vue.d.ts +0 -19
  20. package/dist/types/components/entity-base-config-card/InternalLinkItem.vue.d.ts.map +0 -1
  21. package/dist/types/components/entity-base-config-card/JsonCardItem.vue.d.ts +0 -34
  22. package/dist/types/components/entity-base-config-card/JsonCardItem.vue.d.ts.map +0 -1
  23. package/dist/types/components/entity-base-config-card/StatusBadge.vue.d.ts +0 -15
  24. package/dist/types/components/entity-base-config-card/StatusBadge.vue.d.ts.map +0 -1
  25. package/dist/types/components/entity-base-form/EntityBaseForm.vue.d.ts +0 -288
  26. package/dist/types/components/entity-base-form/EntityBaseForm.vue.d.ts.map +0 -1
  27. package/dist/types/components/entity-base-table/EntityBaseTable.vue.d.ts +0 -325
  28. package/dist/types/components/entity-base-table/EntityBaseTable.vue.d.ts.map +0 -1
  29. package/dist/types/components/entity-base-table/EntityBaseTableCell.vue.d.ts +0 -44
  30. package/dist/types/components/entity-base-table/EntityBaseTableCell.vue.d.ts.map +0 -1
  31. package/dist/types/components/entity-delete-modal/EntityDeleteModal.vue.d.ts +0 -96
  32. package/dist/types/components/entity-delete-modal/EntityDeleteModal.vue.d.ts.map +0 -1
  33. package/dist/types/components/entity-empty-state/EntityEmptyState.vue.d.ts +0 -116
  34. package/dist/types/components/entity-empty-state/EntityEmptyState.vue.d.ts.map +0 -1
  35. package/dist/types/components/entity-filter/EntityFilter.vue.d.ts +0 -37
  36. package/dist/types/components/entity-filter/EntityFilter.vue.d.ts.map +0 -1
  37. package/dist/types/components/entity-form-block/EntityFormBlock.vue.d.ts +0 -20
  38. package/dist/types/components/entity-form-block/EntityFormBlock.vue.d.ts.map +0 -1
  39. package/dist/types/components/entity-form-section/EntityFormSection.vue.d.ts +0 -76
  40. package/dist/types/components/entity-form-section/EntityFormSection.vue.d.ts.map +0 -1
  41. package/dist/types/components/entity-link/EntityLink.vue.d.ts +0 -49
  42. package/dist/types/components/entity-link/EntityLink.vue.d.ts.map +0 -1
  43. package/dist/types/components/entity-toggle-modal/EntityToggleModal.vue.d.ts +0 -64
  44. package/dist/types/components/entity-toggle-modal/EntityToggleModal.vue.d.ts.map +0 -1
  45. package/dist/types/components/icons/IconFilter.vue.d.ts +0 -15
  46. package/dist/types/components/icons/IconFilter.vue.d.ts.map +0 -1
  47. package/dist/types/components/permissions-wrapper/PermissionsWrapper.vue.d.ts +0 -55
  48. package/dist/types/components/permissions-wrapper/PermissionsWrapper.vue.d.ts.map +0 -1
  49. package/dist/types/composables/index.d.ts +0 -39
  50. package/dist/types/composables/index.d.ts.map +0 -1
  51. package/dist/types/composables/useAxios.d.ts +0 -5
  52. package/dist/types/composables/useAxios.d.ts.map +0 -1
  53. package/dist/types/composables/useDebouncedFilter.d.ts +0 -11
  54. package/dist/types/composables/useDebouncedFilter.d.ts.map +0 -1
  55. package/dist/types/composables/useDeleteUrlBuilder.d.ts +0 -3
  56. package/dist/types/composables/useDeleteUrlBuilder.d.ts.map +0 -1
  57. package/dist/types/composables/useErrors.d.ts +0 -11
  58. package/dist/types/composables/useErrors.d.ts.map +0 -1
  59. package/dist/types/composables/useExternalLinkCreator.d.ts +0 -2
  60. package/dist/types/composables/useExternalLinkCreator.d.ts.map +0 -1
  61. package/dist/types/composables/useFetchUrlBuilder.d.ts +0 -6
  62. package/dist/types/composables/useFetchUrlBuilder.d.ts.map +0 -1
  63. package/dist/types/composables/useFetcher.d.ts +0 -40
  64. package/dist/types/composables/useFetcher.d.ts.map +0 -1
  65. package/dist/types/composables/useGatewayFeatureSupported.d.ts +0 -11
  66. package/dist/types/composables/useGatewayFeatureSupported.d.ts.map +0 -1
  67. package/dist/types/composables/useHelpers.d.ts +0 -7
  68. package/dist/types/composables/useHelpers.d.ts.map +0 -1
  69. package/dist/types/composables/useI18n.d.ts +0 -9
  70. package/dist/types/composables/useI18n.d.ts.map +0 -1
  71. package/dist/types/composables/useSchema.d.ts +0 -11
  72. package/dist/types/composables/useSchema.d.ts.map +0 -1
  73. package/dist/types/composables/useStringHelpers.d.ts +0 -5
  74. package/dist/types/composables/useStringHelpers.d.ts.map +0 -1
  75. package/dist/types/composables/useTableState.d.ts +0 -15
  76. package/dist/types/composables/useTableState.d.ts.map +0 -1
  77. package/dist/types/composables/useTruncationDetector.d.ts +0 -12
  78. package/dist/types/composables/useTruncationDetector.d.ts.map +0 -1
  79. package/dist/types/composables/useValidators.d.ts +0 -8
  80. package/dist/types/composables/useValidators.d.ts.map +0 -1
  81. package/dist/types/index.d.ts +0 -25
  82. package/dist/types/index.d.ts.map +0 -1
  83. package/dist/types/types/app-config.d.ts +0 -35
  84. package/dist/types/types/app-config.d.ts.map +0 -1
  85. package/dist/types/types/base.d.ts +0 -12
  86. package/dist/types/types/base.d.ts.map +0 -1
  87. package/dist/types/types/entity-base-config-card.d.ts +0 -112
  88. package/dist/types/types/entity-base-config-card.d.ts.map +0 -1
  89. package/dist/types/types/entity-base-form.d.ts +0 -19
  90. package/dist/types/types/entity-base-form.d.ts.map +0 -1
  91. package/dist/types/types/entity-base-table.d.ts +0 -79
  92. package/dist/types/types/entity-base-table.d.ts.map +0 -1
  93. package/dist/types/types/entity-delete-modal.d.ts +0 -28
  94. package/dist/types/types/entity-delete-modal.d.ts.map +0 -1
  95. package/dist/types/types/entity-empty-state.d.ts +0 -7
  96. package/dist/types/types/entity-empty-state.d.ts.map +0 -1
  97. package/dist/types/types/entity-filter.d.ts +0 -46
  98. package/dist/types/types/entity-filter.d.ts.map +0 -1
  99. package/dist/types/types/entity-link.d.ts +0 -6
  100. package/dist/types/types/entity-link.d.ts.map +0 -1
  101. package/dist/types/types/index.d.ts +0 -11
  102. package/dist/types/types/index.d.ts.map +0 -1
  103. package/dist/types/types/utils.d.ts +0 -13
  104. package/dist/types/types/utils.d.ts.map +0 -1
@@ -1,4729 +0,0 @@
1
- import { inject as Dt, ref as K, computed as F, unref as $, toValue as he, watch as be, toRef as Vn, provide as Pt, defineComponent as z, createBlock as j, openBlock as m, resolveDynamicComponent as je, normalizeClass as fe, withCtx as w, createElementBlock as S, createCommentVNode as N, createElementVNode as R, toDisplayString as L, Fragment as ue, renderList as ce, resolveComponent as P, createVNode as M, createTextVNode as q, useCssVars as Ut, useId as Yn, useSlots as De, renderSlot as D, createSlots as Se, normalizeProps as Wn, guardReactiveProps as Jn, mergeProps as qt, onMounted as tt, onBeforeMount as nt, withModifiers as Le, Teleport as Ht, onUnmounted as Gn, withDirectives as xe, vShow as Ce, withKeys as zn, warn as Qn } from "vue";
2
- import pt from "axios";
3
- import { createI18n as Zn, i18nTComponent as Xn } from "@kong-ui-public/i18n";
4
- import { BadgeMethodAppearances as ei, KButton as mt, KTruncate as ti, KBadge as ni } from "@kong/kongponents";
5
- import { BookIcon as Vt, AddIcon as Yt, CloseIcon as ii, ChevronDownIcon as ri, CopyIcon as ai } from "@kong/icons";
6
- import { useRouter as oi } from "vue-router";
7
- var li = /* @__PURE__ */ ((e) => (e.GatewayService = "service", e.Route = "route", e.Consumer = "consumer", e.ConsumerGroup = "consumer group", e.Plugin = "plugin", e.Upstream = "upstream", e.Certificate = "certificate", e.CACertificate = "ca certificate", e.SNI = "SNI", e.Key = "key", e.KeySet = "key set", e.Vault = "vault", e.Application = "application", e.Developer = "developer", e.acls = "ACL Credential", e["basic-auth"] = "Basic Auth Credential", e["key-auth"] = "Key Auth Credential", e["key-auth-enc"] = "Key Auth Encrypted Credential", e.oauth2 = "OAuth 2.0 Credential", e["hmac-auth"] = "HMAC Credential", e.jwt = "JWT Credential", e.Target = "target", e.Policy = "policy", e.Secret = "secret", e.RedisConfiguration = "redis configuration", e))(li || {}), si = /* @__PURE__ */ ((e) => (e.Edit = "edit", e.Create = "create", e))(si || {}), me = /* @__PURE__ */ ((e) => (e[e.InitialLoad = 0] = "InitialLoad", e[e.Loading = 1] = "Loading", e[e.Idle = 2] = "Idle", e[e.NoResults = 3] = "NoResults", e[e.NoRecords = 4] = "NoRecords", e[e.Error = 5] = "Error", e))(me || {}), it = /* @__PURE__ */ ((e) => (e.CaCertificate = "ca_certificate", e.Certificate = "certificate", e.Consumer = "consumer", e.ConsumerGroup = "consumer_group", e.GatewayService = "service", e.Key = "key", e.KeySet = "set", e.Plugin = "plugin", e.Route = "route", e.SNI = "sni", e.Upstream = "upstream", e.Target = "target", e.Vault = "vault", e.Partial = "partial", e.BackendCluster = "backend_cluster", e.VirtualCluster = "virtual_cluster", e.Listener = "listener", e.ProducePolicy = "produce_policy", e.ConsumePolicy = "consume_policy", e.ClusterPolicy = "cluster_policy", e.ListenerPolicy = "listener_policy", e.SchemaRegistry = "schema_registry", e.StaticKey = "static_key", e.Other = "other", e))(it || {});
8
- const Pe = Object.values(it), ci = ["backend_cluster", "virtual_cluster", "listener", "produce_policy", "consume_policy", "cluster_policy", "listener_policy", "schema_registry", "static_key"];
9
- var V = /* @__PURE__ */ ((e) => (e.ID = "id", e.IdArray = "id-array", e.Text = "plain-text", e.Date = "date", e.Redacted = "redacted", e.RedactedArray = "redacted-array", e.Json = "json", e.JsonArray = "json-array", e.BadgeTag = "badge-tag", e.CopyBadge = "copy-badge", e.BadgeStatus = "badge-status", e.BadgeMethod = "badge-method", e.LinkInternal = "link-internal", e.LinkExternal = "link-external", e))(V || {}), ae = /* @__PURE__ */ ((e) => (e.Basic = "basic", e.Advanced = "advanced", e.Plugin = "plugin", e.Policy = "policy", e))(ae || {});
10
- const ht = [
11
- "primary",
12
- "secondary"
13
- ];
14
- function ui() {
15
- return {
16
- getAxiosInstance: (e = {}) => {
17
- try {
18
- const t = Dt("get-axios-instance", void 0);
19
- return typeof t == "function" ? t(e) : pt.create({
20
- withCredentials: !0,
21
- timeout: 3e4,
22
- ...e
23
- });
24
- } catch (t) {
25
- return console.warn("getAxiosInstance:", t.message || t), pt.create({
26
- withCredentials: !0,
27
- timeout: 3e4,
28
- ...e
29
- });
30
- }
31
- },
32
- getTraceIdFromError: (e) => {
33
- var t;
34
- return ((t = e == null ? void 0 : e.response) == null ? void 0 : t.headers["x-datadog-trace-id"]) || "";
35
- }
36
- };
37
- }
38
- function di() {
39
- return {
40
- debounce: (e, t) => {
41
- let n;
42
- return (...i) => {
43
- clearTimeout(n), n = window == null ? void 0 : window.setTimeout(() => {
44
- e(...i);
45
- }, t);
46
- };
47
- }
48
- };
49
- }
50
- const He = "khcp-user-table-preferences", fi = {
51
- pageSize: 30,
52
- sortColumnKey: void 0,
53
- sortColumnOrder: void 0,
54
- columnVisibility: {}
55
- };
56
- function pi() {
57
- const e = (n) => {
58
- if (typeof n == "string")
59
- try {
60
- return JSON.parse(n);
61
- } catch (i) {
62
- console.error("useTablePreferences(tryParseJson)", i);
63
- return;
64
- }
65
- }, t = () => {
66
- const n = e(localStorage.getItem(He));
67
- return !n || !Object.keys(n).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(n));
68
- };
69
- return {
70
- setTablePreferences: (n, i) => {
71
- try {
72
- const r = t();
73
- r.set(n, i), localStorage.setItem(He, JSON.stringify(Object.fromEntries(r.entries())));
74
- } catch (r) {
75
- console.error("useTablePreferences(setTablePreferences)", r);
76
- }
77
- },
78
- getTablePreferences: (n, i) => {
79
- const r = t();
80
- return (r == null ? void 0 : r.get(n)) || void 0 || i || fi;
81
- },
82
- deleteAllTablePreferences: () => {
83
- localStorage.removeItem(He);
84
- }
85
- };
86
- }
87
- function rt(e = {}) {
88
- const { getAxiosInstance: t } = ui();
89
- return {
90
- axiosInstance: t(e)
91
- };
92
- }
93
- const mi = {
94
- actions: {
95
- copyId: "Copy ID",
96
- copied_id: 'Copied "{id}" to the clipboard',
97
- copyToClipboard: "Copied successfully!",
98
- copyToClipboardFailed: "Failed to copy to the clipboard"
99
- }
100
- }, hi = {
101
- message: "Are you sure you want to delete this {entityType}?",
102
- messageWithName: "Are you sure you want to delete this {entityType} {entityName}?"
103
- }, gi = {
104
- actions: {
105
- viewConfiguration: "View Configuration",
106
- save: "Save",
107
- cancel: "Cancel",
108
- back: "Back"
109
- },
110
- configuration: {
111
- title: "Configuration",
112
- message: "Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",
113
- yaml: "YAML",
114
- json: "JSON",
115
- terraform: "Terraform"
116
- },
117
- errors: {
118
- edit: "The entity could not be edited at this time."
119
- }
120
- }, yi = {
121
- emptyState: {
122
- noSearchResultsTitle: "No results found",
123
- noSearchResultsMessage: "Please adjust the criteria and try again.",
124
- noSearchResultsCtaText: "Clear"
125
- }
126
- }, vi = {
127
- title: "Configuration",
128
- actions: {
129
- copy: "Copy JSON"
130
- },
131
- sections: {
132
- advanced: "Advanced",
133
- plugin: "Plugin Specific Configuration",
134
- policy: "Policy Specific Configuration"
135
- },
136
- commonFields: {
137
- id_label: "ID",
138
- name_label: "Name",
139
- enabled_label: "Enabled",
140
- enabled_tooltip: "Enabled is FTW",
141
- updated_at_label: "Last Updated",
142
- created_at_label: "Created",
143
- tags_label: "Tags",
144
- link: "Link",
145
- partial_label: "Redis Configuration"
146
- },
147
- statusBadge: {
148
- enabledLabel: "Enabled",
149
- disabledLabel: "Disabled"
150
- },
151
- copy: {
152
- tooltip: "Copy {label}",
153
- success: "Copied!"
154
- },
155
- errors: {
156
- load: "The entity configuration data could not be loaded at this time.",
157
- copy: "Failed to copy to clipboard"
158
- },
159
- general: {
160
- entryTitle: "Entry {index}",
161
- structuredFormat: "Structured"
162
- }
163
- }, bi = {
164
- learnMore: "Learn more",
165
- pricingTitle: "Pricing: "
166
- }, xi = {
167
- filterButtonText: "Filter",
168
- fieldLabel: "Filter by:",
169
- inputPlaceholder: "Enter a value",
170
- selectPlaceholder: "Select an item",
171
- applyButtonText: "Apply",
172
- clearButtonText: "Clear",
173
- clearAllButtonText: "Clear all filters"
174
- }, Ci = {
175
- errors: {
176
- fetch: "Could not fetch available items",
177
- invalid: "Please select a valid value"
178
- }
179
- }, ki = {
180
- unexpected: "An unexpected error has occurred",
181
- dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.'
182
- }, Ai = {
183
- utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."
184
- }, _i = {
185
- enable: {
186
- title: "Enable {entityType}",
187
- message: "Are you sure you want to enable the {entityType} {entityName}?",
188
- confirmText: "Yes, enable"
189
- },
190
- disable: {
191
- title: "Disable {entityType}",
192
- message: "Are you sure you want to disable the {entityType} {entityName}?",
193
- confirmText: "Yes, disable"
194
- }
195
- }, wi = {
196
- global: mi,
197
- deleteModal: hi,
198
- baseForm: gi,
199
- baseTable: yi,
200
- baseConfigCard: vi,
201
- emptyState: bi,
202
- filter: xi,
203
- debouncedFilter: Ci,
204
- errors: ki,
205
- validationErrors: Ai,
206
- toggleModal: _i
207
- };
208
- function Ue() {
209
- const e = Zn("en-us", wi);
210
- return {
211
- i18n: e,
212
- i18nT: Xn(e)
213
- // Translation component <i18n-t>
214
- };
215
- }
216
- function Wt() {
217
- const e = (o, a) => (a == null ? void 0 : a[o]) ?? void 0, t = (o, a) => {
218
- if (o.length !== a.length) return !1;
219
- const s = /* @__PURE__ */ new Set([...o, ...a]);
220
- for (const l of s) {
221
- const c = o.filter((u) => u === l).length, d = a.filter((u) => u === l).length;
222
- if (c !== d) return !1;
223
- }
224
- return !0;
225
- };
226
- return {
227
- getPropValue: e,
228
- objectsAreEqual: (o, a, s) => {
229
- if (s) {
230
- if (Object.keys(o).length === Object.keys(a).length)
231
- for (const l in o)
232
- if (Array.isArray(o[l]) && Array.isArray(a[l])) {
233
- if (t(o[l], a[l]))
234
- continue;
235
- return !1;
236
- } else {
237
- if (o[l] === a[l])
238
- continue;
239
- return !1;
240
- }
241
- else
242
- return !1;
243
- return !0;
244
- }
245
- try {
246
- return JSON.stringify(o) === JSON.stringify(a);
247
- } catch {
248
- return !1;
249
- }
250
- },
251
- sortAlpha: (o) => (a, s) => {
252
- let l = a[o] === void 0 || a[o] === null ? "" : a[o], c = s[o] === void 0 || s[o] === null ? "" : s[o];
253
- return Array.isArray(a[o]) && (l = a[o][0]), Array.isArray(s[o]) && (c = s[o][0]), l.localeCompare(c);
254
- },
255
- isValidUuid: (o) => o ? /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(o) : !1
256
- };
257
- }
258
- function Si(e, t, n, i = {
259
- fetchedItemsKey: "data",
260
- searchKeys: ["id"]
261
- }) {
262
- n || (n = "1000");
263
- const { axiosInstance: r } = rt(e.axiosRequestConfig), { i18n: { t: o } } = Ue(), { debounce: a } = di(), s = a(async (T) => {
264
- await C(T);
265
- }, 200), l = K(!1), c = K(""), d = K(""), u = K([]), p = K([]), g = K(void 0), h = F(() => {
266
- const T = `${e.apiBaseUrl}${$(t)}`;
267
- return e.app === "konnect" ? T.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" ? T.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : "") : T;
268
- }), { isValidUuid: x } = Wt(), y = async () => {
269
- try {
270
- l.value = !0;
271
- const { data: T } = await r.get(`${h.value}?size=${n}`);
272
- T != null && T.next || (g.value = i.fetchedItemsKey in T ? T[i.fetchedItemsKey] : []), p.value = i.fetchedItemsKey in T ? T[i.fetchedItemsKey] : [], u.value = p.value;
273
- } catch {
274
- u.value = [], c.value = o("debouncedFilter.errors.fetch");
275
- } finally {
276
- l.value = !1;
277
- }
278
- }, k = K(""), C = async (T) => {
279
- var W, X, _;
280
- if (k.value !== T) {
281
- if (k.value = T ?? "", !T) {
282
- u.value = p.value;
283
- return;
284
- }
285
- if (g.value === void 0)
286
- try {
287
- if (l.value = !0, c.value = "", d.value = "", e.app === "konnect") {
288
- const A = `${h.value}/${T}`, { data: O } = await r.get(`${A}?size=${n}`);
289
- i.fetchedItemsKey in O ? u.value = O[i.fetchedItemsKey] : O != null && O[i.exactMatchKey ?? "id"] ? u.value = [O] : u.value = [];
290
- } else {
291
- const A = [];
292
- x(T) && i.searchKeys.includes("id") ? A.push((async () => {
293
- const { data: v } = await r.get(`${h.value}/${T}`);
294
- return [v[i.fetchedItemsKey] ?? v];
295
- })()) : A.push(
296
- ...i.searchKeys.filter((v) => v !== "id").map(async (v) => {
297
- const { data: b } = await r.get(`${h.value}?${v}=${T}`);
298
- return b[i.fetchedItemsKey];
299
- })
300
- );
301
- const O = await Promise.all(A), f = /* @__PURE__ */ new Set();
302
- u.value = [], (W = O == null ? void 0 : O.forEach) == null || W.call(O, (v) => {
303
- var b;
304
- (b = v == null ? void 0 : v.forEach) == null || b.call(v, (H) => {
305
- f.has(H.id) || (f.add(H.id), u.value.push(H));
306
- });
307
- });
308
- }
309
- } catch (A) {
310
- ((X = A == null ? void 0 : A.response) == null ? void 0 : X.status) === 404 ? d.value = o("debouncedFilter.errors.invalid") : (u.value = [], c.value = o("debouncedFilter.errors.fetch"));
311
- } finally {
312
- l.value = !1;
313
- }
314
- else
315
- l.value = !0, d.value = "", u.value = (_ = g.value) == null ? void 0 : _.filter((A) => {
316
- var f;
317
- let O = !1;
318
- for (const v of i.searchKeys) {
319
- const b = typeof A[v] == "string" ? (f = A[v]) == null ? void 0 : f.toLowerCase() : A[v];
320
- b != null && b.includes(T.toLowerCase()) && (O = !0);
321
- }
322
- return O;
323
- }), (!u.value || !u.value.length) && (d.value = o("debouncedFilter.errors.invalid")), l.value = !1;
324
- }
325
- };
326
- return {
327
- loading: l,
328
- error: c,
329
- validationError: d,
330
- results: u,
331
- allRecords: g,
332
- loadItems: y,
333
- debouncedQueryChange: s
334
- };
335
- }
336
- function $i(e, t) {
337
- const n = $(t), i = F(
338
- () => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${n}`) : new URL(n)
339
- );
340
- return i.value.search = "", (r) => `${i.value.href}/${r}`;
341
- }
342
- function Ti() {
343
- const { i18n: { t: e } } = Ue();
344
- return {
345
- getErrorFieldsFromError: (i) => {
346
- var a, s, l;
347
- if (!i)
348
- return {
349
- messages: [e("errors.unexpected")],
350
- fields: []
351
- };
352
- if (((a = i == null ? void 0 : i.response) == null ? void 0 : a.status) === 401)
353
- return {
354
- messages: [],
355
- fields: []
356
- };
357
- let r = [e("errors.unexpected")];
358
- const o = [];
359
- if ((s = i == null ? void 0 : i.response) != null && s.data) {
360
- if ((l = i.response.data.details) != null && l.length)
361
- return r = [], i.response.data.details.forEach((c) => {
362
- let d = e("errors.unexpected");
363
- c.messages && Array.isArray(c.messages) && c.messages.length && (d = c.messages.join(", ")), c.field && o.push({ field: c.field, message: d }), r.push(`${c.field ?? ""} ${d}`);
364
- }), { messages: r, fields: o };
365
- if (i.response.data.message && Array.isArray(i.response.data.message))
366
- return r = [], i.response.data.message.forEach((c) => {
367
- if (c != null && c.constraints) {
368
- const d = Object.values(c.constraints).join(", ");
369
- r.push(d), c.property && o.push({ field: c.property, message: d });
370
- } else c != null && c.property && (c != null && c.message) ? (o.push({ field: c.property, message: c.message }), r.push(c.message)) : r.push(c);
371
- }), { messages: r, fields: o };
372
- if (typeof i.response.data.message == "string" || typeof i.response.data == "string")
373
- return {
374
- messages: [i.response.data.message],
375
- fields: []
376
- };
377
- if (typeof i.response.data == "object")
378
- return r = [], Object.keys(i.response.data).forEach((c) => {
379
- o.push({ field: c, message: i.response.data[c] }), r.push(i.response.data[c]);
380
- }), { messages: r, fields: o };
381
- }
382
- return {
383
- messages: [i.message || e("errors.unexpected")],
384
- fields: []
385
- };
386
- },
387
- getMessageFromError: (i) => {
388
- var r, o, a, s;
389
- if (!i)
390
- return e("errors.unexpected");
391
- if (((r = i == null ? void 0 : i.response) == null ? void 0 : r.status) === 401)
392
- return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."), "";
393
- if ((o = i == null ? void 0 : i.response) != null && o.data) {
394
- if (i.response.data.detail)
395
- return i.response.data.detail;
396
- if ((a = i.response.data.details) != null && a.length)
397
- return i.response.data.details.map((l) => {
398
- let c = e("errors.unexpected");
399
- return l.messages && typeof l.messages == "object" && l.messages.length && (c = l.messages.join(", ")), l.field ? `${l.field} - ${c}` : c;
400
- }).join("; ");
401
- if (i.response.data.message) {
402
- const { message: l } = i.response.data;
403
- return Array.isArray(l) ? (s = l[0]) != null && s.constraints ? Object.values(l[0].constraints)[0] : l[0] : l;
404
- }
405
- if (typeof i.response.data == "string")
406
- return i.response.data;
407
- if (typeof i.response.data == "object")
408
- return Object.keys(i.response.data).map((l) => `${l} ${i.response.data[l]}`).join(", ");
409
- }
410
- return i.message || e("errors.unexpected");
411
- }
412
- };
413
- }
414
- function Ii(e) {
415
- const t = window.location.origin, n = t.endsWith("/") ? t : `${t}/`;
416
- try {
417
- const i = e.join("/"), r = `${n}${i}`, o = e.some((s) => s.trim() === "");
418
- if (/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(r) && !o && new URL(r))
419
- return `${n}${i}`;
420
- throw new Error("Invalid url");
421
- } catch (i) {
422
- return console.warn("Failed to build valid URL:", i), "";
423
- }
424
- }
425
- function Jt(e, t) {
426
- const n = F(() => {
427
- const r = he(e);
428
- return r.app === "konnect" || !!r.isExactMatch;
429
- }), i = F(() => {
430
- const r = he(t);
431
- return r.startsWith("/") ? new URL(`${window.location.origin}${r}`) : new URL(r);
432
- });
433
- return (r) => {
434
- const { page: o, pageSize: a, offset: s, sortColumnKey: l, sortColumnOrder: c, query: d } = r;
435
- try {
436
- let u = new URL(i.value.href);
437
- return n.value && d ? (u.search = "", u = he(e).isExactMatch ? new URL(`${u.href}/${d}`) : new URL(`${u.href}?filter[name][contains]=${d}`)) : (n.value || new URLSearchParams(d).forEach((p, g) => {
438
- u.searchParams.append(g, p);
439
- }), l && u.searchParams.append("sort_by", l), c === "desc" && u.searchParams.append("sort_desc", "1"), u.searchParams.append("size", String(a))), s && o !== 1 && u.searchParams.append("offset", String(s)), u.href;
440
- } catch (u) {
441
- return console.error("RouteList(fetcher)", u), he(t);
442
- }
443
- };
444
- }
445
- const gt = /* @__PURE__ */ new Map();
446
- function Ei(e, t, n) {
447
- const i = K(!0), r = he(e), { axiosInstance: o } = rt(r.axiosRequestConfig), a = Jt(e, t), s = K({
448
- status: me.Idle
449
- }), l = async (u) => {
450
- var g;
451
- const p = he(n) || "data";
452
- try {
453
- s.value = i.value ? { status: me.InitialLoad } : { status: me.Loading }, i.value = !1;
454
- let h = a(u);
455
- h.includes("filter[name]") && (h = `${h}&page[size]=${u.pageSize}&page[number]=${u.page}`);
456
- const x = await o.get(h);
457
- if (x.status >= 400)
458
- throw x;
459
- const y = x.data, k = p && p.replace(/[^\w-_]/gi, "");
460
- let C;
461
- y[k] ? C = Array.isArray(y[k]) ? y[k] : [y[k]] : Array.isArray(y) ? C = y : C = Object.keys(y).length ? [y] : [];
462
- const T = {
463
- data: C,
464
- total: C.length,
465
- ...y.offset ? {
466
- pagination: {
467
- offset: y.offset
468
- }
469
- } : null
470
- };
471
- return T.data.length === 0 && !u.query ? s.value = {
472
- status: me.NoRecords,
473
- response: T
474
- } : s.value = {
475
- status: me.Idle,
476
- response: T
477
- }, T;
478
- } catch (h) {
479
- const x = {
480
- data: [],
481
- total: 0
482
- };
483
- return u.query && (((g = h.response) == null ? void 0 : g.status) === 404 || h.status === 404) ? (s.value = {
484
- status: me.NoResults,
485
- response: x,
486
- error: h.response ? h : { response: h }
487
- }, x) : (s.value = {
488
- status: me.Error,
489
- response: x,
490
- error: h.response ? h : { response: h }
491
- }, x);
492
- }
493
- }, c = r.cacheIdentifier, d = Gt(c);
494
- return { fetcher: l, fetcherState: s, fetcherCacheKey: d };
495
- }
496
- function Gt(e) {
497
- if (e) {
498
- let t = gt.get(e);
499
- return t || (t = K(1), gt.set(e, t)), t;
500
- }
501
- return K(1);
502
- }
503
- function Fi() {
504
- const e = (i, r = "_") => i ? i.split(r).map((o) => o.toLowerCase() === "id" ? o.toUpperCase() : o.charAt(0).toUpperCase() + o.substring(1)).join(" ") : "", t = /(?:^|[\s-:'"])\w/g;
505
- return {
506
- capitalize: (i) => i ? i.replace(t, (r) => r.toUpperCase()) : "",
507
- convertKeyToTitle: e
508
- };
509
- }
510
- const zt = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, yt = (e) => {
511
- if (typeof e != "string")
512
- throw new TypeError("Invalid argument expected string");
513
- const t = e.match(zt);
514
- if (!t)
515
- throw new Error(`Invalid argument not valid semver ('${e}' received)`);
516
- return t.shift(), t;
517
- }, vt = (e) => e === "*" || e === "x" || e === "X", bt = (e) => {
518
- const t = parseInt(e, 10);
519
- return isNaN(t) ? e : t;
520
- }, Oi = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Li = (e, t) => {
521
- if (vt(e) || vt(t))
522
- return 0;
523
- const [n, i] = Oi(bt(e), bt(t));
524
- return n > i ? 1 : n < i ? -1 : 0;
525
- }, xt = (e, t) => {
526
- for (let n = 0; n < Math.max(e.length, t.length); n++) {
527
- const i = Li(e[n] || "0", t[n] || "0");
528
- if (i !== 0)
529
- return i;
530
- }
531
- return 0;
532
- }, Bi = (e, t) => {
533
- const n = yt(e), i = yt(t), r = n.pop(), o = i.pop(), a = xt(n, i);
534
- return a !== 0 ? a : r && o ? xt(r.split("."), o.split(".")) : r || o ? r ? -1 : 1 : 0;
535
- }, Ct = (e, t, n) => {
536
- Ri(n);
537
- const i = Bi(e, t);
538
- return Qt[n].includes(i);
539
- }, Qt = {
540
- ">": [1],
541
- ">=": [0, 1],
542
- "=": [0],
543
- "<=": [-1, 0],
544
- "<": [-1],
545
- "!=": [-1, 1]
546
- }, kt = Object.keys(Qt), Ri = (e) => {
547
- if (typeof e != "string")
548
- throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
549
- if (kt.indexOf(e) === -1)
550
- throw new Error(`Invalid operator, expected one of ${kt.join("|")}`);
551
- }, Ki = (e) => typeof e == "string" && /^[v\d]/.test(e) && zt.test(e);
552
- function Ni(e) {
553
- const { gatewayInfo: t, supportedRange: n } = e;
554
- if (!t)
555
- return !0;
556
- const { edition: i, version: r } = t;
557
- if (!Ki(r))
558
- return console.error("Invalid version"), !1;
559
- const o = n[i];
560
- if (!o)
561
- return !1;
562
- const [a, s] = o;
563
- return !(a && Ct(r, a, "<") || s && Ct(r, s, ">"));
564
- }
565
- function Mi(e) {
566
- const t = K(0), n = K(0), i = K(!1);
567
- return be(e, (o) => {
568
- o && !i.value && (t.value = o.offsetWidth, n.value = o.scrollWidth, i.value = !0);
569
- }), {
570
- isTruncated: F(() => t.value < n.value)
571
- };
572
- }
573
- function ji() {
574
- const { i18n: { t: e } } = Ue();
575
- return {
576
- utf8Name: (n) => /^[\p{N}\p{L}.\-_~]*$/u.test(n) ? "" : e("validationErrors.utf8Name")
577
- };
578
- }
579
- const Ge = Symbol("schema"), Di = (e) => {
580
- Pt(Ge, e);
581
- }, Pi = (e) => {
582
- var r, o;
583
- const t = Dt(Ge, void 0), n = (o = (r = t == null ? void 0 : t.value) == null ? void 0 : r.fields) == null ? void 0 : o.find((a) => Object.keys(a)[0] === e), i = Vn(n == null ? void 0 : n[e]);
584
- return Pt(Ge, i), i;
585
- };
586
- function Ui(e) {
587
- let t = "";
588
- const n = K(!1), i = K(null), r = F(() => {
589
- let a;
590
- return n.value ? a = !0 : i.value ? a = i.value.hasData || e && he(e) : a = !1, !a;
591
- });
592
- return {
593
- tableState: i,
594
- hasRecords: n,
595
- hideTableToolbar: r,
596
- handleStateChange: (a) => {
597
- a.hasData ? n.value = !0 : a.state === "success" && !a.hasData && (!e || !t) && (n.value = !1), e && (t = he(e)), i.value = { ...a };
598
- }
599
- };
600
- }
601
- const Y = {
602
- useAxios: rt,
603
- useDebouncedFilter: Si,
604
- useDeleteUrlBuilder: $i,
605
- useErrors: Ti,
606
- useExternalLinkCreator: Ii,
607
- useFetcher: Ei,
608
- useFetcherCacheKey: Gt,
609
- useFetchUrlBuilder: Jt,
610
- useHelpers: Wt,
611
- useStringHelpers: Fi,
612
- useI18n: Ue,
613
- useGatewayFeatureSupported: Ni,
614
- useTruncationDetector: Mi,
615
- useValidators: ji,
616
- useSchemaProvider: Di,
617
- useSubSchema: Pi,
618
- useTableState: Ui
619
- }, qi = {
620
- key: 0,
621
- class: "config-card-fieldset-title"
622
- }, Hi = /* @__PURE__ */ z({
623
- __name: "JsonCardItem",
624
- props: {
625
- item: {
626
- type: Object,
627
- required: !0
628
- },
629
- index: {
630
- type: Number,
631
- default: -1
632
- },
633
- isArrayItem: {
634
- type: Boolean,
635
- default: !1
636
- }
637
- },
638
- setup(e) {
639
- const t = e, { i18n: { t: n } } = Y.useI18n(), { convertKeyToTitle: i } = Y.useStringHelpers(), r = F(() => t.item.key ?? "json-array-item"), o = F(() => t.item.value ?? t.item), a = F(() => {
640
- const l = JSON.parse(JSON.stringify(o.value));
641
- return t.isArrayItem && delete l.name, l;
642
- }), s = F(() => {
643
- var l;
644
- return t.isArrayItem ? (l = o.value) != null && l.name ? i(o.value.name, "_") : n("baseConfigCard.general.entryTitle", { index: t.index }) : "";
645
- });
646
- return (l, c) => (m(), j(je(e.isArrayItem ? "fieldset" : "div"), {
647
- class: fe(e.isArrayItem ? "config-card-fieldset" : "config-card-json-item")
648
- }, {
649
- default: w(() => [
650
- e.isArrayItem ? (m(), S("legend", qi, [
651
- R("b", null, L(s.value), 1)
652
- ])) : N("", !0),
653
- (m(!0), S(ue, null, ce(Object.keys(a.value), (d, u) => (m(), j(Xt, {
654
- key: `${r.value}-property-${u}`,
655
- item: {
656
- key: d,
657
- label: $(i)(d),
658
- value: a.value[d]
659
- }
660
- }, null, 8, ["item"]))), 128))
661
- ]),
662
- _: 1
663
- }, 8, ["class"]));
664
- }
665
- }), se = (e, t) => {
666
- const n = e.__vccOpts || e;
667
- for (const [i, r] of t)
668
- n[i] = r;
669
- return n;
670
- }, Zt = /* @__PURE__ */ se(Hi, [["__scopeId", "data-v-dc1e39a1"]]), Vi = /* @__PURE__ */ z({
671
- __name: "InternalLinkItem",
672
- props: {
673
- item: {
674
- type: Object,
675
- required: !0
676
- }
677
- },
678
- emits: ["navigation-click"],
679
- setup(e) {
680
- const { i18n: { t } } = Y.useI18n();
681
- return (n, i) => {
682
- const r = P("KButton");
683
- return m(), S("div", null, [
684
- M(r, {
685
- appearance: "tertiary",
686
- class: "navigation-button",
687
- onClick: i[0] || (i[0] = (o) => n.$emit("navigation-click", e.item))
688
- }, {
689
- default: w(() => [
690
- q(L(e.item.value || $(t)("baseConfigCard.commonFields.link")), 1)
691
- ]),
692
- _: 1
693
- })
694
- ]);
695
- };
696
- }
697
- }), Yi = /* @__PURE__ */ se(Vi, [["__scopeId", "data-v-2feb8c2e"]]), Wi = /* @__PURE__ */ z({
698
- __name: "StatusBadge",
699
- props: {
700
- status: {
701
- type: Boolean,
702
- default: !1
703
- }
704
- },
705
- setup(e) {
706
- const { i18n: { t } } = Y.useI18n();
707
- return (n, i) => {
708
- const r = P("KBadge");
709
- return m(), j(r, {
710
- appearance: e.status ? "success" : "neutral"
711
- }, {
712
- default: w(() => [
713
- q(L(e.status ? $(t)("baseConfigCard.statusBadge.enabledLabel") : $(t)("baseConfigCard.statusBadge.disabledLabel")), 1)
714
- ]),
715
- _: 1
716
- }, 8, ["appearance"]);
717
- };
718
- }
719
- }), Ji = "#0044f4", Gi = "#e0e4ea", zi = "#afb7c5", Qi = "#0044f4", Zi = "1px", Xi = "16px", er = "20px", tr = { class: "config-card-details-row" }, nr = ["data-testid"], ir = ["data-testid"], rr = ["data-testid"], ar = ["data-testid"], or = { key: 1 }, lr = ["data-testid"], sr = ["data-testid"], cr = ["data-testid"], ur = ["data-testid"], dr = {
720
- name: "ConfigCardItem",
721
- components: { JsonCardItem: Zt, StatusBadge: Wi, InternalLinkItem: Yi }
722
- }, fr = /* @__PURE__ */ z({
723
- ...dr,
724
- props: {
725
- item: {
726
- type: Object,
727
- required: !0
728
- },
729
- slim: {
730
- type: Boolean,
731
- required: !1,
732
- default: !1
733
- },
734
- truncated: {
735
- type: Boolean,
736
- required: !1,
737
- default: !1
738
- }
739
- },
740
- emits: ["navigation-click"],
741
- setup(e, { emit: t }) {
742
- Ut((W) => ({
743
- v70f369b3: p.value ? "none" : `solid ${$(Zi)} ${$(Gi)}`,
744
- v67c2fae6: u.value && c.value ? "block" : "flex",
745
- v847b138c: u.value && c.value ? "100%" : n.slim ? "50%" : "25%",
746
- v847687d6: u.value && c.value ? "100%" : n.slim ? "50%" : "75%"
747
- }));
748
- const n = e, i = t, r = Yn(), o = De(), { i18n: { t: a, formatIsoDate: s, formatUnixTimeStamp: l } } = Y.useI18n(), c = F(() => n.item.value !== void 0 && n.item.value !== null && n.item.value !== ""), d = F(() => !!(n.item.tooltip || o["label-tooltip"])), u = F(() => n.item.type === V.Json || n.item.type === V.JsonArray), p = F(() => n.item.type === V.JsonArray), g = Y.useSubSchema(n.item.key), h = F(() => {
749
- var W;
750
- return n.item.type ? n.item.type : (W = g == null ? void 0 : g.value) != null && W.encrypted ? V.Redacted : void 0;
751
- }), x = F(() => {
752
- switch (h.value) {
753
- case V.ID:
754
- return {
755
- tag: "KCopy",
756
- attrs: {
757
- "data-testid": `${n.item.key}-copy-uuid`,
758
- "copy-tooltip": a("baseConfigCard.copy.tooltip", { label: n.item.label }),
759
- text: n.item.value
760
- }
761
- };
762
- case V.IdArray:
763
- return {
764
- tag: "div",
765
- additionalComponent: "KCopy",
766
- childAttrs: {
767
- "copy-tooltip": a("baseConfigCard.copy.tooltip", { label: n.item.label })
768
- }
769
- };
770
- case V.Redacted:
771
- return {
772
- tag: "KCopy",
773
- attrs: {
774
- "data-testid": `${n.item.key}-copy-uuid-redacted`,
775
- format: "redacted",
776
- "copy-tooltip": a("baseConfigCard.copy.tooltip", { label: n.item.label }),
777
- text: n.item.value
778
- }
779
- };
780
- case V.RedactedArray:
781
- return {
782
- tag: "div",
783
- additionalComponent: "KCopy",
784
- childAttrs: {
785
- format: "redacted",
786
- "copy-tooltip": a("baseConfigCard.copy.tooltip", { label: n.item.label })
787
- }
788
- };
789
- case V.Date:
790
- return {
791
- tag: "div",
792
- attrs: {
793
- "data-testid": `${n.item.key}-date`
794
- },
795
- text: isNaN(Number(n.item.value)) ? s(n.item.value) : l(n.item.value)
796
- };
797
- case V.BadgeStatus:
798
- return {
799
- tag: "StatusBadge",
800
- attrs: {
801
- "data-testid": `${n.item.key}-badge-status`,
802
- status: n.item.value
803
- }
804
- };
805
- case V.BadgeTag:
806
- return {
807
- tag: "div",
808
- additionalComponent: "KBadge"
809
- };
810
- case V.CopyBadge:
811
- return {
812
- tag: "div",
813
- additionalComponent: "KCopy",
814
- childAttrs: {
815
- badge: !0,
816
- truncate: !0,
817
- truncationLimit: "auto",
818
- text: n.item.value
819
- }
820
- };
821
- case V.BadgeMethod:
822
- return {
823
- tag: "div",
824
- additionalComponent: "KMethodBadge"
825
- };
826
- case V.LinkInternal:
827
- return {
828
- tag: "InternalLinkItem",
829
- attrs: {
830
- "data-testid": `${n.item.key}-internal-link`,
831
- item: n.item,
832
- onNavigationClick: (W) => {
833
- i("navigation-click", W);
834
- }
835
- }
836
- };
837
- case V.LinkExternal:
838
- return {
839
- tag: "KExternalLink",
840
- attrs: {
841
- "data-testid": `${n.item.key}-external-link`,
842
- href: n.item.value
843
- },
844
- text: n.item.value
845
- };
846
- case V.Json:
847
- return {
848
- tag: "JsonCardItem",
849
- attrs: {
850
- "data-testid": `${n.item.key}-json-content`,
851
- item: n.item
852
- }
853
- };
854
- case V.JsonArray:
855
- return {
856
- tag: "div",
857
- additionalComponent: "JsonCardItem",
858
- attrs: {
859
- "data-testid": `${n.item.key}-json-array-content`,
860
- item: n.item
861
- }
862
- };
863
- default:
864
- return n.item.value != null && typeof n.item.value == "object" ? {
865
- tag: "KCodeBlock",
866
- attrs: {
867
- "data-testid": `${n.item.key}-json-code`,
868
- id: `json-code-${r}`,
869
- language: "json",
870
- code: JSON.stringify(n.item.value, null, " "),
871
- maxHeight: "480px",
872
- showLineNumbers: !1
873
- }
874
- } : {
875
- tag: "div",
876
- attrs: {
877
- "data-testid": `${n.item.key}-plain-text`
878
- },
879
- text: n.item.value
880
- };
881
- }
882
- }), y = K(), k = K(), { isTruncated: C } = Y.useTruncationDetector(y), { isTruncated: T } = Y.useTruncationDetector(k);
883
- return (W, X) => {
884
- const _ = P("KTooltip"), A = P("KLabel"), O = P("KBadge"), f = P("KCopy");
885
- return m(), S("div", tr, [
886
- R("div", {
887
- class: "config-card-details-label",
888
- "data-testid": `${e.item.key}-label`
889
- }, [
890
- D(W.$slots, "label", { item: e.item }, () => [
891
- M(A, { "tooltip-attributes": { maxWidth: "500px" } }, Se({
892
- default: w(() => [
893
- M(_, {
894
- text: $(C) ? e.item.label : ""
895
- }, {
896
- default: w(() => [
897
- R("span", {
898
- ref_key: "labelContent",
899
- ref: y,
900
- class: "label-content"
901
- }, L(e.item.label), 513)
902
- ]),
903
- _: 1
904
- }, 8, ["text"])
905
- ]),
906
- _: 2
907
- }, [
908
- d.value ? {
909
- name: "tooltip",
910
- fn: w(() => [
911
- R("div", {
912
- "data-testid": `${e.item.key}-label-tooltip`
913
- }, [
914
- D(W.$slots, "label-tooltip", {}, () => [
915
- q(L(e.item.tooltip), 1)
916
- ], !0)
917
- ], 8, ir)
918
- ]),
919
- key: "0"
920
- } : void 0
921
- ]), 1024)
922
- ], !0)
923
- ], 8, nr),
924
- R("div", {
925
- class: "config-card-details-value",
926
- "data-testid": `${e.item.key}-property-value`
927
- }, [
928
- D(W.$slots, e.item.key, {
929
- rowValue: e.item.value
930
- }, () => [
931
- c.value ? (m(), S("div", or, [
932
- (m(), j(je(x.value.tag), Wn(Jn(x.value.attrs)), {
933
- default: w(() => [
934
- x.value.additionalComponent === "KBadge" ? (m(), S("div", {
935
- key: 0,
936
- "data-testid": `${e.item.key}-badge-tags`
937
- }, [
938
- (m(!0), S(ue, null, ce(e.item.value, (v, b) => (m(), j(O, {
939
- key: `${e.item.key}-badge-tag-${b}`,
940
- class: "config-badge",
941
- "data-testid": `${e.item.key}-badge-tag-${b}`,
942
- tooltip: v,
943
- "truncation-tooltip": ""
944
- }, {
945
- default: w(() => [
946
- q(L(v), 1)
947
- ]),
948
- _: 2
949
- }, 1032, ["data-testid", "tooltip"]))), 128))
950
- ], 8, lr)) : x.value.additionalComponent === "KCopy" ? (m(), S("div", {
951
- key: 1,
952
- class: "copy-uuid-array",
953
- "data-testid": `${e.item.key}-copy-uuid-array`
954
- }, [
955
- (m(!0), S(ue, null, ce(e.item.value, (v, b) => (m(), j(f, qt({ ref_for: !0 }, x.value.childAttrs, {
956
- key: `${e.item.key}-copy-uuid-${b}`,
957
- "data-testid": `${e.item.key}-copy-uuid-${b}`,
958
- text: v
959
- }), null, 16, ["data-testid", "text"]))), 128))
960
- ], 8, sr)) : x.value.additionalComponent === "KMethodBadge" ? (m(), S("div", {
961
- key: 2,
962
- class: "method-badge-array",
963
- "data-testid": `${e.item.key}-badge-methods`
964
- }, [
965
- (m(!0), S(ue, null, ce(e.item.value, (v, b) => (m(), j(O, {
966
- key: `${e.item.key}-badge-method-${b}`,
967
- appearance: Object.values($(ei)).includes(v.toLowerCase()) ? v.toLowerCase() : "custom",
968
- class: "config-badge",
969
- "data-testid": `${e.item.key}-badge-method-${b}`
970
- }, {
971
- default: w(() => [
972
- q(L(v), 1)
973
- ]),
974
- _: 2
975
- }, 1032, ["appearance", "data-testid"]))), 128))
976
- ], 8, cr)) : x.value.additionalComponent === "JsonCardItem" ? (m(), S("div", {
977
- key: 3,
978
- "data-testid": `${n.item.key}-json-array-content`
979
- }, [
980
- (m(!0), S(ue, null, ce(e.item.value, (v, b) => (m(), j(Zt, {
981
- key: `json-array-item-${b}`,
982
- index: b,
983
- "is-array-item": "",
984
- item: v
985
- }, null, 8, ["index", "item"]))), 128))
986
- ], 8, ur)) : (m(), j(_, {
987
- key: 4,
988
- text: $(T) ? e.item.value : ""
989
- }, {
990
- default: w(() => [
991
- R("span", {
992
- ref_key: "textContent",
993
- ref: k,
994
- class: fe(["attrs-data-text", { truncated: e.truncated }])
995
- }, L(x.value.text), 3)
996
- ]),
997
- _: 1
998
- }, 8, ["text"]))
999
- ]),
1000
- _: 1
1001
- }, 16))
1002
- ])) : (m(), S("div", {
1003
- key: 0,
1004
- "data-testid": `${e.item.key}-no-value`
1005
- }, " – ", 8, ar))
1006
- ], !0)
1007
- ], 8, rr)
1008
- ]);
1009
- };
1010
- }
1011
- }), Xt = /* @__PURE__ */ se(fr, [["__scopeId", "data-v-66d61bea"]]), pr = { class: "json-config config-card-code-block" }, mr = {
1012
- key: 0,
1013
- class: "json-endpoint"
1014
- }, en = /* @__PURE__ */ z({
1015
- __name: "JsonCodeBlock",
1016
- props: {
1017
- /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
1018
- config: {
1019
- type: Object,
1020
- required: !1,
1021
- default: () => ({})
1022
- },
1023
- /** Fetcher url for the entity with the filled-in controlPlaneId, workspace, and entity id. */
1024
- fetcherUrl: {
1025
- type: String,
1026
- required: !1,
1027
- default: ""
1028
- },
1029
- /** A record to indicate the entity's configuration, used to populate the JSON code block */
1030
- entityRecord: {
1031
- type: Object,
1032
- required: !0
1033
- },
1034
- /** HTTP request method like GET, POST, PUT, used to make the api call. */
1035
- requestMethod: {
1036
- type: String,
1037
- required: !1,
1038
- default: ""
1039
- }
1040
- },
1041
- setup(e) {
1042
- Ut((r) => ({
1043
- eca0976a: `${i.value}ch`
1044
- }));
1045
- const t = e, n = F(() => t.entityRecord), i = F(() => {
1046
- var a;
1047
- if (!t.fetcherUrl)
1048
- return 0;
1049
- const r = (a = t.fetcherUrl) == null ? void 0 : a.split("/");
1050
- return r.length < 2 ? 0 : 41 + (t.requestMethod === "post" ? r[r.length - 1] : r[r.length - 2]).length;
1051
- });
1052
- return (r, o) => {
1053
- const a = P("KBadge"), s = P("KCodeBlock");
1054
- return m(), S("div", pr, [
1055
- t.fetcherUrl ? (m(), S("div", mr, [
1056
- M(a, {
1057
- appearance: t.requestMethod
1058
- }, {
1059
- default: w(() => [
1060
- q(L(t.requestMethod), 1)
1061
- ]),
1062
- _: 1
1063
- }, 8, ["appearance"]),
1064
- M(s, {
1065
- id: "json-endpoint-codeblock",
1066
- code: t.fetcherUrl,
1067
- language: "json",
1068
- "single-line": "",
1069
- theme: "dark"
1070
- }, null, 8, ["code"])
1071
- ])) : N("", !0),
1072
- t.entityRecord ? (m(), j(s, {
1073
- key: 1,
1074
- id: "json-codeblock",
1075
- class: fe({ "json-content": t.fetcherUrl }),
1076
- code: JSON.stringify(n.value, null, 2),
1077
- language: "json",
1078
- theme: "dark"
1079
- }, null, 8, ["class", "code"])) : N("", !0)
1080
- ]);
1081
- };
1082
- }
1083
- });
1084
- /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
1085
- function tn(e) {
1086
- return typeof e > "u" || e === null;
1087
- }
1088
- function hr(e) {
1089
- return typeof e == "object" && e !== null;
1090
- }
1091
- function gr(e) {
1092
- return Array.isArray(e) ? e : tn(e) ? [] : [e];
1093
- }
1094
- function yr(e, t) {
1095
- var n, i, r, o;
1096
- if (t)
1097
- for (o = Object.keys(t), n = 0, i = o.length; n < i; n += 1)
1098
- r = o[n], e[r] = t[r];
1099
- return e;
1100
- }
1101
- function vr(e, t) {
1102
- var n = "", i;
1103
- for (i = 0; i < t; i += 1)
1104
- n += e;
1105
- return n;
1106
- }
1107
- function br(e) {
1108
- return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
1109
- }
1110
- var xr = tn, Cr = hr, kr = gr, Ar = vr, _r = br, wr = yr, ee = {
1111
- isNothing: xr,
1112
- isObject: Cr,
1113
- toArray: kr,
1114
- repeat: Ar,
1115
- isNegativeZero: _r,
1116
- extend: wr
1117
- };
1118
- function nn(e, t) {
1119
- var n = "", i = e.reason || "(unknown reason)";
1120
- return e.mark ? (e.mark.name && (n += 'in "' + e.mark.name + '" '), n += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !t && e.mark.snippet && (n += `
1121
-
1122
- ` + e.mark.snippet), i + " " + n) : i;
1123
- }
1124
- function Ie(e, t) {
1125
- Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = nn(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
1126
- }
1127
- Ie.prototype = Object.create(Error.prototype);
1128
- Ie.prototype.constructor = Ie;
1129
- Ie.prototype.toString = function(t) {
1130
- return this.name + ": " + nn(this, t);
1131
- };
1132
- var oe = Ie;
1133
- function Ve(e, t, n, i, r) {
1134
- var o = "", a = "", s = Math.floor(r / 2) - 1;
1135
- return i - t > s && (o = " ... ", t = i - s + o.length), n - i > s && (a = " ...", n = i + s - a.length), {
1136
- str: o + e.slice(t, n).replace(/\t/g, "→") + a,
1137
- pos: i - t + o.length
1138
- // relative position
1139
- };
1140
- }
1141
- function Ye(e, t) {
1142
- return ee.repeat(" ", t - e.length) + e;
1143
- }
1144
- function Sr(e, t) {
1145
- if (t = Object.create(t || null), !e.buffer) return null;
1146
- t.maxLength || (t.maxLength = 79), typeof t.indent != "number" && (t.indent = 1), typeof t.linesBefore != "number" && (t.linesBefore = 3), typeof t.linesAfter != "number" && (t.linesAfter = 2);
1147
- for (var n = /\r?\n|\r|\0/g, i = [0], r = [], o, a = -1; o = n.exec(e.buffer); )
1148
- r.push(o.index), i.push(o.index + o[0].length), e.position <= o.index && a < 0 && (a = i.length - 2);
1149
- a < 0 && (a = i.length - 1);
1150
- var s = "", l, c, d = Math.min(e.line + t.linesAfter, r.length).toString().length, u = t.maxLength - (t.indent + d + 3);
1151
- for (l = 1; l <= t.linesBefore && !(a - l < 0); l++)
1152
- c = Ve(
1153
- e.buffer,
1154
- i[a - l],
1155
- r[a - l],
1156
- e.position - (i[a] - i[a - l]),
1157
- u
1158
- ), s = ee.repeat(" ", t.indent) + Ye((e.line - l + 1).toString(), d) + " | " + c.str + `
1159
- ` + s;
1160
- for (c = Ve(e.buffer, i[a], r[a], e.position, u), s += ee.repeat(" ", t.indent) + Ye((e.line + 1).toString(), d) + " | " + c.str + `
1161
- `, s += ee.repeat("-", t.indent + d + 3 + c.pos) + `^
1162
- `, l = 1; l <= t.linesAfter && !(a + l >= r.length); l++)
1163
- c = Ve(
1164
- e.buffer,
1165
- i[a + l],
1166
- r[a + l],
1167
- e.position - (i[a] - i[a + l]),
1168
- u
1169
- ), s += ee.repeat(" ", t.indent) + Ye((e.line + l + 1).toString(), d) + " | " + c.str + `
1170
- `;
1171
- return s.replace(/\n$/, "");
1172
- }
1173
- var $r = Sr, Tr = [
1174
- "kind",
1175
- "multi",
1176
- "resolve",
1177
- "construct",
1178
- "instanceOf",
1179
- "predicate",
1180
- "represent",
1181
- "representName",
1182
- "defaultStyle",
1183
- "styleAliases"
1184
- ], Ir = [
1185
- "scalar",
1186
- "sequence",
1187
- "mapping"
1188
- ];
1189
- function Er(e) {
1190
- var t = {};
1191
- return e !== null && Object.keys(e).forEach(function(n) {
1192
- e[n].forEach(function(i) {
1193
- t[String(i)] = n;
1194
- });
1195
- }), t;
1196
- }
1197
- function Fr(e, t) {
1198
- if (t = t || {}, Object.keys(t).forEach(function(n) {
1199
- if (Tr.indexOf(n) === -1)
1200
- throw new oe('Unknown option "' + n + '" is met in definition of "' + e + '" YAML type.');
1201
- }), this.options = t, this.tag = e, this.kind = t.kind || null, this.resolve = t.resolve || function() {
1202
- return !0;
1203
- }, this.construct = t.construct || function(n) {
1204
- return n;
1205
- }, this.instanceOf = t.instanceOf || null, this.predicate = t.predicate || null, this.represent = t.represent || null, this.representName = t.representName || null, this.defaultStyle = t.defaultStyle || null, this.multi = t.multi || !1, this.styleAliases = Er(t.styleAliases || null), Ir.indexOf(this.kind) === -1)
1206
- throw new oe('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
1207
- }
1208
- var ne = Fr;
1209
- function At(e, t) {
1210
- var n = [];
1211
- return e[t].forEach(function(i) {
1212
- var r = n.length;
1213
- n.forEach(function(o, a) {
1214
- o.tag === i.tag && o.kind === i.kind && o.multi === i.multi && (r = a);
1215
- }), n[r] = i;
1216
- }), n;
1217
- }
1218
- function Or() {
1219
- var e = {
1220
- scalar: {},
1221
- sequence: {},
1222
- mapping: {},
1223
- fallback: {},
1224
- multi: {
1225
- scalar: [],
1226
- sequence: [],
1227
- mapping: [],
1228
- fallback: []
1229
- }
1230
- }, t, n;
1231
- function i(r) {
1232
- r.multi ? (e.multi[r.kind].push(r), e.multi.fallback.push(r)) : e[r.kind][r.tag] = e.fallback[r.tag] = r;
1233
- }
1234
- for (t = 0, n = arguments.length; t < n; t += 1)
1235
- arguments[t].forEach(i);
1236
- return e;
1237
- }
1238
- function ze(e) {
1239
- return this.extend(e);
1240
- }
1241
- ze.prototype.extend = function(t) {
1242
- var n = [], i = [];
1243
- if (t instanceof ne)
1244
- i.push(t);
1245
- else if (Array.isArray(t))
1246
- i = i.concat(t);
1247
- else if (t && (Array.isArray(t.implicit) || Array.isArray(t.explicit)))
1248
- t.implicit && (n = n.concat(t.implicit)), t.explicit && (i = i.concat(t.explicit));
1249
- else
1250
- throw new oe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
1251
- n.forEach(function(o) {
1252
- if (!(o instanceof ne))
1253
- throw new oe("Specified list of YAML types (or a single Type object) contains a non-Type object.");
1254
- if (o.loadKind && o.loadKind !== "scalar")
1255
- throw new oe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
1256
- if (o.multi)
1257
- throw new oe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
1258
- }), i.forEach(function(o) {
1259
- if (!(o instanceof ne))
1260
- throw new oe("Specified list of YAML types (or a single Type object) contains a non-Type object.");
1261
- });
1262
- var r = Object.create(ze.prototype);
1263
- return r.implicit = (this.implicit || []).concat(n), r.explicit = (this.explicit || []).concat(i), r.compiledImplicit = At(r, "implicit"), r.compiledExplicit = At(r, "explicit"), r.compiledTypeMap = Or(r.compiledImplicit, r.compiledExplicit), r;
1264
- };
1265
- var rn = ze, an = new ne("tag:yaml.org,2002:str", {
1266
- kind: "scalar",
1267
- construct: function(e) {
1268
- return e !== null ? e : "";
1269
- }
1270
- }), on = new ne("tag:yaml.org,2002:seq", {
1271
- kind: "sequence",
1272
- construct: function(e) {
1273
- return e !== null ? e : [];
1274
- }
1275
- }), ln = new ne("tag:yaml.org,2002:map", {
1276
- kind: "mapping",
1277
- construct: function(e) {
1278
- return e !== null ? e : {};
1279
- }
1280
- }), sn = new rn({
1281
- explicit: [
1282
- an,
1283
- on,
1284
- ln
1285
- ]
1286
- });
1287
- function Lr(e) {
1288
- if (e === null) return !0;
1289
- var t = e.length;
1290
- return t === 1 && e === "~" || t === 4 && (e === "null" || e === "Null" || e === "NULL");
1291
- }
1292
- function Br() {
1293
- return null;
1294
- }
1295
- function Rr(e) {
1296
- return e === null;
1297
- }
1298
- var cn = new ne("tag:yaml.org,2002:null", {
1299
- kind: "scalar",
1300
- resolve: Lr,
1301
- construct: Br,
1302
- predicate: Rr,
1303
- represent: {
1304
- canonical: function() {
1305
- return "~";
1306
- },
1307
- lowercase: function() {
1308
- return "null";
1309
- },
1310
- uppercase: function() {
1311
- return "NULL";
1312
- },
1313
- camelcase: function() {
1314
- return "Null";
1315
- },
1316
- empty: function() {
1317
- return "";
1318
- }
1319
- },
1320
- defaultStyle: "lowercase"
1321
- });
1322
- function Kr(e) {
1323
- if (e === null) return !1;
1324
- var t = e.length;
1325
- return t === 4 && (e === "true" || e === "True" || e === "TRUE") || t === 5 && (e === "false" || e === "False" || e === "FALSE");
1326
- }
1327
- function Nr(e) {
1328
- return e === "true" || e === "True" || e === "TRUE";
1329
- }
1330
- function Mr(e) {
1331
- return Object.prototype.toString.call(e) === "[object Boolean]";
1332
- }
1333
- var un = new ne("tag:yaml.org,2002:bool", {
1334
- kind: "scalar",
1335
- resolve: Kr,
1336
- construct: Nr,
1337
- predicate: Mr,
1338
- represent: {
1339
- lowercase: function(e) {
1340
- return e ? "true" : "false";
1341
- },
1342
- uppercase: function(e) {
1343
- return e ? "TRUE" : "FALSE";
1344
- },
1345
- camelcase: function(e) {
1346
- return e ? "True" : "False";
1347
- }
1348
- },
1349
- defaultStyle: "lowercase"
1350
- });
1351
- function jr(e) {
1352
- return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
1353
- }
1354
- function Dr(e) {
1355
- return 48 <= e && e <= 55;
1356
- }
1357
- function Pr(e) {
1358
- return 48 <= e && e <= 57;
1359
- }
1360
- function Ur(e) {
1361
- if (e === null) return !1;
1362
- var t = e.length, n = 0, i = !1, r;
1363
- if (!t) return !1;
1364
- if (r = e[n], (r === "-" || r === "+") && (r = e[++n]), r === "0") {
1365
- if (n + 1 === t) return !0;
1366
- if (r = e[++n], r === "b") {
1367
- for (n++; n < t; n++)
1368
- if (r = e[n], r !== "_") {
1369
- if (r !== "0" && r !== "1") return !1;
1370
- i = !0;
1371
- }
1372
- return i && r !== "_";
1373
- }
1374
- if (r === "x") {
1375
- for (n++; n < t; n++)
1376
- if (r = e[n], r !== "_") {
1377
- if (!jr(e.charCodeAt(n))) return !1;
1378
- i = !0;
1379
- }
1380
- return i && r !== "_";
1381
- }
1382
- if (r === "o") {
1383
- for (n++; n < t; n++)
1384
- if (r = e[n], r !== "_") {
1385
- if (!Dr(e.charCodeAt(n))) return !1;
1386
- i = !0;
1387
- }
1388
- return i && r !== "_";
1389
- }
1390
- }
1391
- if (r === "_") return !1;
1392
- for (; n < t; n++)
1393
- if (r = e[n], r !== "_") {
1394
- if (!Pr(e.charCodeAt(n)))
1395
- return !1;
1396
- i = !0;
1397
- }
1398
- return !(!i || r === "_");
1399
- }
1400
- function qr(e) {
1401
- var t = e, n = 1, i;
1402
- if (t.indexOf("_") !== -1 && (t = t.replace(/_/g, "")), i = t[0], (i === "-" || i === "+") && (i === "-" && (n = -1), t = t.slice(1), i = t[0]), t === "0") return 0;
1403
- if (i === "0") {
1404
- if (t[1] === "b") return n * parseInt(t.slice(2), 2);
1405
- if (t[1] === "x") return n * parseInt(t.slice(2), 16);
1406
- if (t[1] === "o") return n * parseInt(t.slice(2), 8);
1407
- }
1408
- return n * parseInt(t, 10);
1409
- }
1410
- function Hr(e) {
1411
- return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !ee.isNegativeZero(e);
1412
- }
1413
- var dn = new ne("tag:yaml.org,2002:int", {
1414
- kind: "scalar",
1415
- resolve: Ur,
1416
- construct: qr,
1417
- predicate: Hr,
1418
- represent: {
1419
- binary: function(e) {
1420
- return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
1421
- },
1422
- octal: function(e) {
1423
- return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
1424
- },
1425
- decimal: function(e) {
1426
- return e.toString(10);
1427
- },
1428
- /* eslint-disable max-len */
1429
- hexadecimal: function(e) {
1430
- return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
1431
- }
1432
- },
1433
- defaultStyle: "decimal",
1434
- styleAliases: {
1435
- binary: [2, "bin"],
1436
- octal: [8, "oct"],
1437
- decimal: [10, "dec"],
1438
- hexadecimal: [16, "hex"]
1439
- }
1440
- }), Vr = new RegExp(
1441
- // 2.5e4, 2.5 and integers
1442
- "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
1443
- );
1444
- function Yr(e) {
1445
- return !(e === null || !Vr.test(e) || // Quick hack to not allow integers end with `_`
1446
- // Probably should update regexp & check speed
1447
- e[e.length - 1] === "_");
1448
- }
1449
- function Wr(e) {
1450
- var t, n;
1451
- return t = e.replace(/_/g, "").toLowerCase(), n = t[0] === "-" ? -1 : 1, "+-".indexOf(t[0]) >= 0 && (t = t.slice(1)), t === ".inf" ? n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : t === ".nan" ? NaN : n * parseFloat(t, 10);
1452
- }
1453
- var Jr = /^[-+]?[0-9]+e/;
1454
- function Gr(e, t) {
1455
- var n;
1456
- if (isNaN(e))
1457
- switch (t) {
1458
- case "lowercase":
1459
- return ".nan";
1460
- case "uppercase":
1461
- return ".NAN";
1462
- case "camelcase":
1463
- return ".NaN";
1464
- }
1465
- else if (Number.POSITIVE_INFINITY === e)
1466
- switch (t) {
1467
- case "lowercase":
1468
- return ".inf";
1469
- case "uppercase":
1470
- return ".INF";
1471
- case "camelcase":
1472
- return ".Inf";
1473
- }
1474
- else if (Number.NEGATIVE_INFINITY === e)
1475
- switch (t) {
1476
- case "lowercase":
1477
- return "-.inf";
1478
- case "uppercase":
1479
- return "-.INF";
1480
- case "camelcase":
1481
- return "-.Inf";
1482
- }
1483
- else if (ee.isNegativeZero(e))
1484
- return "-0.0";
1485
- return n = e.toString(10), Jr.test(n) ? n.replace("e", ".e") : n;
1486
- }
1487
- function zr(e) {
1488
- return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || ee.isNegativeZero(e));
1489
- }
1490
- var fn = new ne("tag:yaml.org,2002:float", {
1491
- kind: "scalar",
1492
- resolve: Yr,
1493
- construct: Wr,
1494
- predicate: zr,
1495
- represent: Gr,
1496
- defaultStyle: "lowercase"
1497
- }), pn = sn.extend({
1498
- implicit: [
1499
- cn,
1500
- un,
1501
- dn,
1502
- fn
1503
- ]
1504
- }), mn = pn, hn = new RegExp(
1505
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
1506
- ), gn = new RegExp(
1507
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
1508
- );
1509
- function Qr(e) {
1510
- return e === null ? !1 : hn.exec(e) !== null || gn.exec(e) !== null;
1511
- }
1512
- function Zr(e) {
1513
- var t, n, i, r, o, a, s, l = 0, c = null, d, u, p;
1514
- if (t = hn.exec(e), t === null && (t = gn.exec(e)), t === null) throw new Error("Date resolve error");
1515
- if (n = +t[1], i = +t[2] - 1, r = +t[3], !t[4])
1516
- return new Date(Date.UTC(n, i, r));
1517
- if (o = +t[4], a = +t[5], s = +t[6], t[7]) {
1518
- for (l = t[7].slice(0, 3); l.length < 3; )
1519
- l += "0";
1520
- l = +l;
1521
- }
1522
- return t[9] && (d = +t[10], u = +(t[11] || 0), c = (d * 60 + u) * 6e4, t[9] === "-" && (c = -c)), p = new Date(Date.UTC(n, i, r, o, a, s, l)), c && p.setTime(p.getTime() - c), p;
1523
- }
1524
- function Xr(e) {
1525
- return e.toISOString();
1526
- }
1527
- var yn = new ne("tag:yaml.org,2002:timestamp", {
1528
- kind: "scalar",
1529
- resolve: Qr,
1530
- construct: Zr,
1531
- instanceOf: Date,
1532
- represent: Xr
1533
- });
1534
- function ea(e) {
1535
- return e === "<<" || e === null;
1536
- }
1537
- var vn = new ne("tag:yaml.org,2002:merge", {
1538
- kind: "scalar",
1539
- resolve: ea
1540
- }), at = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
1541
- \r`;
1542
- function ta(e) {
1543
- if (e === null) return !1;
1544
- var t, n, i = 0, r = e.length, o = at;
1545
- for (n = 0; n < r; n++)
1546
- if (t = o.indexOf(e.charAt(n)), !(t > 64)) {
1547
- if (t < 0) return !1;
1548
- i += 6;
1549
- }
1550
- return i % 8 === 0;
1551
- }
1552
- function na(e) {
1553
- var t, n, i = e.replace(/[\r\n=]/g, ""), r = i.length, o = at, a = 0, s = [];
1554
- for (t = 0; t < r; t++)
1555
- t % 4 === 0 && t && (s.push(a >> 16 & 255), s.push(a >> 8 & 255), s.push(a & 255)), a = a << 6 | o.indexOf(i.charAt(t));
1556
- return n = r % 4 * 6, n === 0 ? (s.push(a >> 16 & 255), s.push(a >> 8 & 255), s.push(a & 255)) : n === 18 ? (s.push(a >> 10 & 255), s.push(a >> 2 & 255)) : n === 12 && s.push(a >> 4 & 255), new Uint8Array(s);
1557
- }
1558
- function ia(e) {
1559
- var t = "", n = 0, i, r, o = e.length, a = at;
1560
- for (i = 0; i < o; i++)
1561
- i % 3 === 0 && i && (t += a[n >> 18 & 63], t += a[n >> 12 & 63], t += a[n >> 6 & 63], t += a[n & 63]), n = (n << 8) + e[i];
1562
- return r = o % 3, r === 0 ? (t += a[n >> 18 & 63], t += a[n >> 12 & 63], t += a[n >> 6 & 63], t += a[n & 63]) : r === 2 ? (t += a[n >> 10 & 63], t += a[n >> 4 & 63], t += a[n << 2 & 63], t += a[64]) : r === 1 && (t += a[n >> 2 & 63], t += a[n << 4 & 63], t += a[64], t += a[64]), t;
1563
- }
1564
- function ra(e) {
1565
- return Object.prototype.toString.call(e) === "[object Uint8Array]";
1566
- }
1567
- var bn = new ne("tag:yaml.org,2002:binary", {
1568
- kind: "scalar",
1569
- resolve: ta,
1570
- construct: na,
1571
- predicate: ra,
1572
- represent: ia
1573
- }), aa = Object.prototype.hasOwnProperty, oa = Object.prototype.toString;
1574
- function la(e) {
1575
- if (e === null) return !0;
1576
- var t = [], n, i, r, o, a, s = e;
1577
- for (n = 0, i = s.length; n < i; n += 1) {
1578
- if (r = s[n], a = !1, oa.call(r) !== "[object Object]") return !1;
1579
- for (o in r)
1580
- if (aa.call(r, o))
1581
- if (!a) a = !0;
1582
- else return !1;
1583
- if (!a) return !1;
1584
- if (t.indexOf(o) === -1) t.push(o);
1585
- else return !1;
1586
- }
1587
- return !0;
1588
- }
1589
- function sa(e) {
1590
- return e !== null ? e : [];
1591
- }
1592
- var xn = new ne("tag:yaml.org,2002:omap", {
1593
- kind: "sequence",
1594
- resolve: la,
1595
- construct: sa
1596
- }), ca = Object.prototype.toString;
1597
- function ua(e) {
1598
- if (e === null) return !0;
1599
- var t, n, i, r, o, a = e;
1600
- for (o = new Array(a.length), t = 0, n = a.length; t < n; t += 1) {
1601
- if (i = a[t], ca.call(i) !== "[object Object]" || (r = Object.keys(i), r.length !== 1)) return !1;
1602
- o[t] = [r[0], i[r[0]]];
1603
- }
1604
- return !0;
1605
- }
1606
- function da(e) {
1607
- if (e === null) return [];
1608
- var t, n, i, r, o, a = e;
1609
- for (o = new Array(a.length), t = 0, n = a.length; t < n; t += 1)
1610
- i = a[t], r = Object.keys(i), o[t] = [r[0], i[r[0]]];
1611
- return o;
1612
- }
1613
- var Cn = new ne("tag:yaml.org,2002:pairs", {
1614
- kind: "sequence",
1615
- resolve: ua,
1616
- construct: da
1617
- }), fa = Object.prototype.hasOwnProperty;
1618
- function pa(e) {
1619
- if (e === null) return !0;
1620
- var t, n = e;
1621
- for (t in n)
1622
- if (fa.call(n, t) && n[t] !== null)
1623
- return !1;
1624
- return !0;
1625
- }
1626
- function ma(e) {
1627
- return e !== null ? e : {};
1628
- }
1629
- var kn = new ne("tag:yaml.org,2002:set", {
1630
- kind: "mapping",
1631
- resolve: pa,
1632
- construct: ma
1633
- }), ot = mn.extend({
1634
- implicit: [
1635
- yn,
1636
- vn
1637
- ],
1638
- explicit: [
1639
- bn,
1640
- xn,
1641
- Cn,
1642
- kn
1643
- ]
1644
- }), ye = Object.prototype.hasOwnProperty, Be = 1, An = 2, _n = 3, Re = 4, We = 1, ha = 2, _t = 3, ga = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, ya = /[\x85\u2028\u2029]/, va = /[,\[\]\{\}]/, wn = /^(?:!|!!|![a-z\-]+!)$/i, Sn = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
1645
- function wt(e) {
1646
- return Object.prototype.toString.call(e);
1647
- }
1648
- function de(e) {
1649
- return e === 10 || e === 13;
1650
- }
1651
- function ve(e) {
1652
- return e === 9 || e === 32;
1653
- }
1654
- function le(e) {
1655
- return e === 9 || e === 32 || e === 10 || e === 13;
1656
- }
1657
- function _e(e) {
1658
- return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
1659
- }
1660
- function ba(e) {
1661
- var t;
1662
- return 48 <= e && e <= 57 ? e - 48 : (t = e | 32, 97 <= t && t <= 102 ? t - 97 + 10 : -1);
1663
- }
1664
- function xa(e) {
1665
- return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
1666
- }
1667
- function Ca(e) {
1668
- return 48 <= e && e <= 57 ? e - 48 : -1;
1669
- }
1670
- function St(e) {
1671
- return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
1672
- ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
1673
- }
1674
- function ka(e) {
1675
- return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode(
1676
- (e - 65536 >> 10) + 55296,
1677
- (e - 65536 & 1023) + 56320
1678
- );
1679
- }
1680
- var $n = new Array(256), Tn = new Array(256);
1681
- for (var ke = 0; ke < 256; ke++)
1682
- $n[ke] = St(ke) ? 1 : 0, Tn[ke] = St(ke);
1683
- function Aa(e, t) {
1684
- this.input = e, this.filename = t.filename || null, this.schema = t.schema || ot, this.onWarning = t.onWarning || null, this.legacy = t.legacy || !1, this.json = t.json || !1, this.listener = t.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
1685
- }
1686
- function In(e, t) {
1687
- var n = {
1688
- name: e.filename,
1689
- buffer: e.input.slice(0, -1),
1690
- // omit trailing \0
1691
- position: e.position,
1692
- line: e.line,
1693
- column: e.position - e.lineStart
1694
- };
1695
- return n.snippet = $r(n), new oe(t, n);
1696
- }
1697
- function E(e, t) {
1698
- throw In(e, t);
1699
- }
1700
- function Ke(e, t) {
1701
- e.onWarning && e.onWarning.call(null, In(e, t));
1702
- }
1703
- var $t = {
1704
- YAML: function(t, n, i) {
1705
- var r, o, a;
1706
- t.version !== null && E(t, "duplication of %YAML directive"), i.length !== 1 && E(t, "YAML directive accepts exactly one argument"), r = /^([0-9]+)\.([0-9]+)$/.exec(i[0]), r === null && E(t, "ill-formed argument of the YAML directive"), o = parseInt(r[1], 10), a = parseInt(r[2], 10), o !== 1 && E(t, "unacceptable YAML version of the document"), t.version = i[0], t.checkLineBreaks = a < 2, a !== 1 && a !== 2 && Ke(t, "unsupported YAML version of the document");
1707
- },
1708
- TAG: function(t, n, i) {
1709
- var r, o;
1710
- i.length !== 2 && E(t, "TAG directive accepts exactly two arguments"), r = i[0], o = i[1], wn.test(r) || E(t, "ill-formed tag handle (first argument) of the TAG directive"), ye.call(t.tagMap, r) && E(t, 'there is a previously declared suffix for "' + r + '" tag handle'), Sn.test(o) || E(t, "ill-formed tag prefix (second argument) of the TAG directive");
1711
- try {
1712
- o = decodeURIComponent(o);
1713
- } catch {
1714
- E(t, "tag prefix is malformed: " + o);
1715
- }
1716
- t.tagMap[r] = o;
1717
- }
1718
- };
1719
- function ge(e, t, n, i) {
1720
- var r, o, a, s;
1721
- if (t < n) {
1722
- if (s = e.input.slice(t, n), i)
1723
- for (r = 0, o = s.length; r < o; r += 1)
1724
- a = s.charCodeAt(r), a === 9 || 32 <= a && a <= 1114111 || E(e, "expected valid JSON character");
1725
- else ga.test(s) && E(e, "the stream contains non-printable characters");
1726
- e.result += s;
1727
- }
1728
- }
1729
- function Tt(e, t, n, i) {
1730
- var r, o, a, s;
1731
- for (ee.isObject(n) || E(e, "cannot merge mappings; the provided source object is unacceptable"), r = Object.keys(n), a = 0, s = r.length; a < s; a += 1)
1732
- o = r[a], ye.call(t, o) || (t[o] = n[o], i[o] = !0);
1733
- }
1734
- function we(e, t, n, i, r, o, a, s, l) {
1735
- var c, d;
1736
- if (Array.isArray(r))
1737
- for (r = Array.prototype.slice.call(r), c = 0, d = r.length; c < d; c += 1)
1738
- Array.isArray(r[c]) && E(e, "nested arrays are not supported inside keys"), typeof r == "object" && wt(r[c]) === "[object Object]" && (r[c] = "[object Object]");
1739
- if (typeof r == "object" && wt(r) === "[object Object]" && (r = "[object Object]"), r = String(r), t === null && (t = {}), i === "tag:yaml.org,2002:merge")
1740
- if (Array.isArray(o))
1741
- for (c = 0, d = o.length; c < d; c += 1)
1742
- Tt(e, t, o[c], n);
1743
- else
1744
- Tt(e, t, o, n);
1745
- else
1746
- !e.json && !ye.call(n, r) && ye.call(t, r) && (e.line = a || e.line, e.lineStart = s || e.lineStart, e.position = l || e.position, E(e, "duplicated mapping key")), r === "__proto__" ? Object.defineProperty(t, r, {
1747
- configurable: !0,
1748
- enumerable: !0,
1749
- writable: !0,
1750
- value: o
1751
- }) : t[r] = o, delete n[r];
1752
- return t;
1753
- }
1754
- function lt(e) {
1755
- var t;
1756
- t = e.input.charCodeAt(e.position), t === 10 ? e.position++ : t === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : E(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
1757
- }
1758
- function Z(e, t, n) {
1759
- for (var i = 0, r = e.input.charCodeAt(e.position); r !== 0; ) {
1760
- for (; ve(r); )
1761
- r === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), r = e.input.charCodeAt(++e.position);
1762
- if (t && r === 35)
1763
- do
1764
- r = e.input.charCodeAt(++e.position);
1765
- while (r !== 10 && r !== 13 && r !== 0);
1766
- if (de(r))
1767
- for (lt(e), r = e.input.charCodeAt(e.position), i++, e.lineIndent = 0; r === 32; )
1768
- e.lineIndent++, r = e.input.charCodeAt(++e.position);
1769
- else
1770
- break;
1771
- }
1772
- return n !== -1 && i !== 0 && e.lineIndent < n && Ke(e, "deficient indentation"), i;
1773
- }
1774
- function qe(e) {
1775
- var t = e.position, n;
1776
- return n = e.input.charCodeAt(t), !!((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2) && (t += 3, n = e.input.charCodeAt(t), n === 0 || le(n)));
1777
- }
1778
- function st(e, t) {
1779
- t === 1 ? e.result += " " : t > 1 && (e.result += ee.repeat(`
1780
- `, t - 1));
1781
- }
1782
- function _a(e, t, n) {
1783
- var i, r, o, a, s, l, c, d, u = e.kind, p = e.result, g;
1784
- if (g = e.input.charCodeAt(e.position), le(g) || _e(g) || g === 35 || g === 38 || g === 42 || g === 33 || g === 124 || g === 62 || g === 39 || g === 34 || g === 37 || g === 64 || g === 96 || (g === 63 || g === 45) && (r = e.input.charCodeAt(e.position + 1), le(r) || n && _e(r)))
1785
- return !1;
1786
- for (e.kind = "scalar", e.result = "", o = a = e.position, s = !1; g !== 0; ) {
1787
- if (g === 58) {
1788
- if (r = e.input.charCodeAt(e.position + 1), le(r) || n && _e(r))
1789
- break;
1790
- } else if (g === 35) {
1791
- if (i = e.input.charCodeAt(e.position - 1), le(i))
1792
- break;
1793
- } else {
1794
- if (e.position === e.lineStart && qe(e) || n && _e(g))
1795
- break;
1796
- if (de(g))
1797
- if (l = e.line, c = e.lineStart, d = e.lineIndent, Z(e, !1, -1), e.lineIndent >= t) {
1798
- s = !0, g = e.input.charCodeAt(e.position);
1799
- continue;
1800
- } else {
1801
- e.position = a, e.line = l, e.lineStart = c, e.lineIndent = d;
1802
- break;
1803
- }
1804
- }
1805
- s && (ge(e, o, a, !1), st(e, e.line - l), o = a = e.position, s = !1), ve(g) || (a = e.position + 1), g = e.input.charCodeAt(++e.position);
1806
- }
1807
- return ge(e, o, a, !1), e.result ? !0 : (e.kind = u, e.result = p, !1);
1808
- }
1809
- function wa(e, t) {
1810
- var n, i, r;
1811
- if (n = e.input.charCodeAt(e.position), n !== 39)
1812
- return !1;
1813
- for (e.kind = "scalar", e.result = "", e.position++, i = r = e.position; (n = e.input.charCodeAt(e.position)) !== 0; )
1814
- if (n === 39)
1815
- if (ge(e, i, e.position, !0), n = e.input.charCodeAt(++e.position), n === 39)
1816
- i = e.position, e.position++, r = e.position;
1817
- else
1818
- return !0;
1819
- else de(n) ? (ge(e, i, r, !0), st(e, Z(e, !1, t)), i = r = e.position) : e.position === e.lineStart && qe(e) ? E(e, "unexpected end of the document within a single quoted scalar") : (e.position++, r = e.position);
1820
- E(e, "unexpected end of the stream within a single quoted scalar");
1821
- }
1822
- function Sa(e, t) {
1823
- var n, i, r, o, a, s;
1824
- if (s = e.input.charCodeAt(e.position), s !== 34)
1825
- return !1;
1826
- for (e.kind = "scalar", e.result = "", e.position++, n = i = e.position; (s = e.input.charCodeAt(e.position)) !== 0; ) {
1827
- if (s === 34)
1828
- return ge(e, n, e.position, !0), e.position++, !0;
1829
- if (s === 92) {
1830
- if (ge(e, n, e.position, !0), s = e.input.charCodeAt(++e.position), de(s))
1831
- Z(e, !1, t);
1832
- else if (s < 256 && $n[s])
1833
- e.result += Tn[s], e.position++;
1834
- else if ((a = xa(s)) > 0) {
1835
- for (r = a, o = 0; r > 0; r--)
1836
- s = e.input.charCodeAt(++e.position), (a = ba(s)) >= 0 ? o = (o << 4) + a : E(e, "expected hexadecimal character");
1837
- e.result += ka(o), e.position++;
1838
- } else
1839
- E(e, "unknown escape sequence");
1840
- n = i = e.position;
1841
- } else de(s) ? (ge(e, n, i, !0), st(e, Z(e, !1, t)), n = i = e.position) : e.position === e.lineStart && qe(e) ? E(e, "unexpected end of the document within a double quoted scalar") : (e.position++, i = e.position);
1842
- }
1843
- E(e, "unexpected end of the stream within a double quoted scalar");
1844
- }
1845
- function $a(e, t) {
1846
- var n = !0, i, r, o, a = e.tag, s, l = e.anchor, c, d, u, p, g, h = /* @__PURE__ */ Object.create(null), x, y, k, C;
1847
- if (C = e.input.charCodeAt(e.position), C === 91)
1848
- d = 93, g = !1, s = [];
1849
- else if (C === 123)
1850
- d = 125, g = !0, s = {};
1851
- else
1852
- return !1;
1853
- for (e.anchor !== null && (e.anchorMap[e.anchor] = s), C = e.input.charCodeAt(++e.position); C !== 0; ) {
1854
- if (Z(e, !0, t), C = e.input.charCodeAt(e.position), C === d)
1855
- return e.position++, e.tag = a, e.anchor = l, e.kind = g ? "mapping" : "sequence", e.result = s, !0;
1856
- n ? C === 44 && E(e, "expected the node content, but found ','") : E(e, "missed comma between flow collection entries"), y = x = k = null, u = p = !1, C === 63 && (c = e.input.charCodeAt(e.position + 1), le(c) && (u = p = !0, e.position++, Z(e, !0, t))), i = e.line, r = e.lineStart, o = e.position, $e(e, t, Be, !1, !0), y = e.tag, x = e.result, Z(e, !0, t), C = e.input.charCodeAt(e.position), (p || e.line === i) && C === 58 && (u = !0, C = e.input.charCodeAt(++e.position), Z(e, !0, t), $e(e, t, Be, !1, !0), k = e.result), g ? we(e, s, h, y, x, k, i, r, o) : u ? s.push(we(e, null, h, y, x, k, i, r, o)) : s.push(x), Z(e, !0, t), C = e.input.charCodeAt(e.position), C === 44 ? (n = !0, C = e.input.charCodeAt(++e.position)) : n = !1;
1857
- }
1858
- E(e, "unexpected end of the stream within a flow collection");
1859
- }
1860
- function Ta(e, t) {
1861
- var n, i, r = We, o = !1, a = !1, s = t, l = 0, c = !1, d, u;
1862
- if (u = e.input.charCodeAt(e.position), u === 124)
1863
- i = !1;
1864
- else if (u === 62)
1865
- i = !0;
1866
- else
1867
- return !1;
1868
- for (e.kind = "scalar", e.result = ""; u !== 0; )
1869
- if (u = e.input.charCodeAt(++e.position), u === 43 || u === 45)
1870
- We === r ? r = u === 43 ? _t : ha : E(e, "repeat of a chomping mode identifier");
1871
- else if ((d = Ca(u)) >= 0)
1872
- d === 0 ? E(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : a ? E(e, "repeat of an indentation width identifier") : (s = t + d - 1, a = !0);
1873
- else
1874
- break;
1875
- if (ve(u)) {
1876
- do
1877
- u = e.input.charCodeAt(++e.position);
1878
- while (ve(u));
1879
- if (u === 35)
1880
- do
1881
- u = e.input.charCodeAt(++e.position);
1882
- while (!de(u) && u !== 0);
1883
- }
1884
- for (; u !== 0; ) {
1885
- for (lt(e), e.lineIndent = 0, u = e.input.charCodeAt(e.position); (!a || e.lineIndent < s) && u === 32; )
1886
- e.lineIndent++, u = e.input.charCodeAt(++e.position);
1887
- if (!a && e.lineIndent > s && (s = e.lineIndent), de(u)) {
1888
- l++;
1889
- continue;
1890
- }
1891
- if (e.lineIndent < s) {
1892
- r === _t ? e.result += ee.repeat(`
1893
- `, o ? 1 + l : l) : r === We && o && (e.result += `
1894
- `);
1895
- break;
1896
- }
1897
- for (i ? ve(u) ? (c = !0, e.result += ee.repeat(`
1898
- `, o ? 1 + l : l)) : c ? (c = !1, e.result += ee.repeat(`
1899
- `, l + 1)) : l === 0 ? o && (e.result += " ") : e.result += ee.repeat(`
1900
- `, l) : e.result += ee.repeat(`
1901
- `, o ? 1 + l : l), o = !0, a = !0, l = 0, n = e.position; !de(u) && u !== 0; )
1902
- u = e.input.charCodeAt(++e.position);
1903
- ge(e, n, e.position, !1);
1904
- }
1905
- return !0;
1906
- }
1907
- function It(e, t) {
1908
- var n, i = e.tag, r = e.anchor, o = [], a, s = !1, l;
1909
- if (e.firstTabInLine !== -1) return !1;
1910
- for (e.anchor !== null && (e.anchorMap[e.anchor] = o), l = e.input.charCodeAt(e.position); l !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, E(e, "tab characters must not be used in indentation")), !(l !== 45 || (a = e.input.charCodeAt(e.position + 1), !le(a)))); ) {
1911
- if (s = !0, e.position++, Z(e, !0, -1) && e.lineIndent <= t) {
1912
- o.push(null), l = e.input.charCodeAt(e.position);
1913
- continue;
1914
- }
1915
- if (n = e.line, $e(e, t, _n, !1, !0), o.push(e.result), Z(e, !0, -1), l = e.input.charCodeAt(e.position), (e.line === n || e.lineIndent > t) && l !== 0)
1916
- E(e, "bad indentation of a sequence entry");
1917
- else if (e.lineIndent < t)
1918
- break;
1919
- }
1920
- return s ? (e.tag = i, e.anchor = r, e.kind = "sequence", e.result = o, !0) : !1;
1921
- }
1922
- function Ia(e, t, n) {
1923
- var i, r, o, a, s, l, c = e.tag, d = e.anchor, u = {}, p = /* @__PURE__ */ Object.create(null), g = null, h = null, x = null, y = !1, k = !1, C;
1924
- if (e.firstTabInLine !== -1) return !1;
1925
- for (e.anchor !== null && (e.anchorMap[e.anchor] = u), C = e.input.charCodeAt(e.position); C !== 0; ) {
1926
- if (!y && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, E(e, "tab characters must not be used in indentation")), i = e.input.charCodeAt(e.position + 1), o = e.line, (C === 63 || C === 58) && le(i))
1927
- C === 63 ? (y && (we(e, u, p, g, h, null, a, s, l), g = h = x = null), k = !0, y = !0, r = !0) : y ? (y = !1, r = !0) : E(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, C = i;
1928
- else {
1929
- if (a = e.line, s = e.lineStart, l = e.position, !$e(e, n, An, !1, !0))
1930
- break;
1931
- if (e.line === o) {
1932
- for (C = e.input.charCodeAt(e.position); ve(C); )
1933
- C = e.input.charCodeAt(++e.position);
1934
- if (C === 58)
1935
- C = e.input.charCodeAt(++e.position), le(C) || E(e, "a whitespace character is expected after the key-value separator within a block mapping"), y && (we(e, u, p, g, h, null, a, s, l), g = h = x = null), k = !0, y = !1, r = !1, g = e.tag, h = e.result;
1936
- else if (k)
1937
- E(e, "can not read an implicit mapping pair; a colon is missed");
1938
- else
1939
- return e.tag = c, e.anchor = d, !0;
1940
- } else if (k)
1941
- E(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
1942
- else
1943
- return e.tag = c, e.anchor = d, !0;
1944
- }
1945
- if ((e.line === o || e.lineIndent > t) && (y && (a = e.line, s = e.lineStart, l = e.position), $e(e, t, Re, !0, r) && (y ? h = e.result : x = e.result), y || (we(e, u, p, g, h, x, a, s, l), g = h = x = null), Z(e, !0, -1), C = e.input.charCodeAt(e.position)), (e.line === o || e.lineIndent > t) && C !== 0)
1946
- E(e, "bad indentation of a mapping entry");
1947
- else if (e.lineIndent < t)
1948
- break;
1949
- }
1950
- return y && we(e, u, p, g, h, null, a, s, l), k && (e.tag = c, e.anchor = d, e.kind = "mapping", e.result = u), k;
1951
- }
1952
- function Ea(e) {
1953
- var t, n = !1, i = !1, r, o, a;
1954
- if (a = e.input.charCodeAt(e.position), a !== 33) return !1;
1955
- if (e.tag !== null && E(e, "duplication of a tag property"), a = e.input.charCodeAt(++e.position), a === 60 ? (n = !0, a = e.input.charCodeAt(++e.position)) : a === 33 ? (i = !0, r = "!!", a = e.input.charCodeAt(++e.position)) : r = "!", t = e.position, n) {
1956
- do
1957
- a = e.input.charCodeAt(++e.position);
1958
- while (a !== 0 && a !== 62);
1959
- e.position < e.length ? (o = e.input.slice(t, e.position), a = e.input.charCodeAt(++e.position)) : E(e, "unexpected end of the stream within a verbatim tag");
1960
- } else {
1961
- for (; a !== 0 && !le(a); )
1962
- a === 33 && (i ? E(e, "tag suffix cannot contain exclamation marks") : (r = e.input.slice(t - 1, e.position + 1), wn.test(r) || E(e, "named tag handle cannot contain such characters"), i = !0, t = e.position + 1)), a = e.input.charCodeAt(++e.position);
1963
- o = e.input.slice(t, e.position), va.test(o) && E(e, "tag suffix cannot contain flow indicator characters");
1964
- }
1965
- o && !Sn.test(o) && E(e, "tag name cannot contain such characters: " + o);
1966
- try {
1967
- o = decodeURIComponent(o);
1968
- } catch {
1969
- E(e, "tag name is malformed: " + o);
1970
- }
1971
- return n ? e.tag = o : ye.call(e.tagMap, r) ? e.tag = e.tagMap[r] + o : r === "!" ? e.tag = "!" + o : r === "!!" ? e.tag = "tag:yaml.org,2002:" + o : E(e, 'undeclared tag handle "' + r + '"'), !0;
1972
- }
1973
- function Fa(e) {
1974
- var t, n;
1975
- if (n = e.input.charCodeAt(e.position), n !== 38) return !1;
1976
- for (e.anchor !== null && E(e, "duplication of an anchor property"), n = e.input.charCodeAt(++e.position), t = e.position; n !== 0 && !le(n) && !_e(n); )
1977
- n = e.input.charCodeAt(++e.position);
1978
- return e.position === t && E(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(t, e.position), !0;
1979
- }
1980
- function Oa(e) {
1981
- var t, n, i;
1982
- if (i = e.input.charCodeAt(e.position), i !== 42) return !1;
1983
- for (i = e.input.charCodeAt(++e.position), t = e.position; i !== 0 && !le(i) && !_e(i); )
1984
- i = e.input.charCodeAt(++e.position);
1985
- return e.position === t && E(e, "name of an alias node must contain at least one character"), n = e.input.slice(t, e.position), ye.call(e.anchorMap, n) || E(e, 'unidentified alias "' + n + '"'), e.result = e.anchorMap[n], Z(e, !0, -1), !0;
1986
- }
1987
- function $e(e, t, n, i, r) {
1988
- var o, a, s, l = 1, c = !1, d = !1, u, p, g, h, x, y;
1989
- if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, o = a = s = Re === n || _n === n, i && Z(e, !0, -1) && (c = !0, e.lineIndent > t ? l = 1 : e.lineIndent === t ? l = 0 : e.lineIndent < t && (l = -1)), l === 1)
1990
- for (; Ea(e) || Fa(e); )
1991
- Z(e, !0, -1) ? (c = !0, s = o, e.lineIndent > t ? l = 1 : e.lineIndent === t ? l = 0 : e.lineIndent < t && (l = -1)) : s = !1;
1992
- if (s && (s = c || r), (l === 1 || Re === n) && (Be === n || An === n ? x = t : x = t + 1, y = e.position - e.lineStart, l === 1 ? s && (It(e, y) || Ia(e, y, x)) || $a(e, x) ? d = !0 : (a && Ta(e, x) || wa(e, x) || Sa(e, x) ? d = !0 : Oa(e) ? (d = !0, (e.tag !== null || e.anchor !== null) && E(e, "alias node should not have any properties")) : _a(e, x, Be === n) && (d = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : l === 0 && (d = s && It(e, y))), e.tag === null)
1993
- e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1994
- else if (e.tag === "?") {
1995
- for (e.result !== null && e.kind !== "scalar" && E(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), u = 0, p = e.implicitTypes.length; u < p; u += 1)
1996
- if (h = e.implicitTypes[u], h.resolve(e.result)) {
1997
- e.result = h.construct(e.result), e.tag = h.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
1998
- break;
1999
- }
2000
- } else if (e.tag !== "!") {
2001
- if (ye.call(e.typeMap[e.kind || "fallback"], e.tag))
2002
- h = e.typeMap[e.kind || "fallback"][e.tag];
2003
- else
2004
- for (h = null, g = e.typeMap.multi[e.kind || "fallback"], u = 0, p = g.length; u < p; u += 1)
2005
- if (e.tag.slice(0, g[u].tag.length) === g[u].tag) {
2006
- h = g[u];
2007
- break;
2008
- }
2009
- h || E(e, "unknown tag !<" + e.tag + ">"), e.result !== null && h.kind !== e.kind && E(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + h.kind + '", not "' + e.kind + '"'), h.resolve(e.result, e.tag) ? (e.result = h.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : E(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
2010
- }
2011
- return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || d;
2012
- }
2013
- function La(e) {
2014
- var t = e.position, n, i, r, o = !1, a;
2015
- for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (a = e.input.charCodeAt(e.position)) !== 0 && (Z(e, !0, -1), a = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || a !== 37)); ) {
2016
- for (o = !0, a = e.input.charCodeAt(++e.position), n = e.position; a !== 0 && !le(a); )
2017
- a = e.input.charCodeAt(++e.position);
2018
- for (i = e.input.slice(n, e.position), r = [], i.length < 1 && E(e, "directive name must not be less than one character in length"); a !== 0; ) {
2019
- for (; ve(a); )
2020
- a = e.input.charCodeAt(++e.position);
2021
- if (a === 35) {
2022
- do
2023
- a = e.input.charCodeAt(++e.position);
2024
- while (a !== 0 && !de(a));
2025
- break;
2026
- }
2027
- if (de(a)) break;
2028
- for (n = e.position; a !== 0 && !le(a); )
2029
- a = e.input.charCodeAt(++e.position);
2030
- r.push(e.input.slice(n, e.position));
2031
- }
2032
- a !== 0 && lt(e), ye.call($t, i) ? $t[i](e, i, r) : Ke(e, 'unknown document directive "' + i + '"');
2033
- }
2034
- if (Z(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, Z(e, !0, -1)) : o && E(e, "directives end mark is expected"), $e(e, e.lineIndent - 1, Re, !1, !0), Z(e, !0, -1), e.checkLineBreaks && ya.test(e.input.slice(t, e.position)) && Ke(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && qe(e)) {
2035
- e.input.charCodeAt(e.position) === 46 && (e.position += 3, Z(e, !0, -1));
2036
- return;
2037
- }
2038
- if (e.position < e.length - 1)
2039
- E(e, "end of the stream or a document separator is expected");
2040
- else
2041
- return;
2042
- }
2043
- function En(e, t) {
2044
- e = String(e), t = t || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
2045
- `), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
2046
- var n = new Aa(e, t), i = e.indexOf("\0");
2047
- for (i !== -1 && (n.position = i, E(n, "null byte is not allowed in input")), n.input += "\0"; n.input.charCodeAt(n.position) === 32; )
2048
- n.lineIndent += 1, n.position += 1;
2049
- for (; n.position < n.length - 1; )
2050
- La(n);
2051
- return n.documents;
2052
- }
2053
- function Ba(e, t, n) {
2054
- t !== null && typeof t == "object" && typeof n > "u" && (n = t, t = null);
2055
- var i = En(e, n);
2056
- if (typeof t != "function")
2057
- return i;
2058
- for (var r = 0, o = i.length; r < o; r += 1)
2059
- t(i[r]);
2060
- }
2061
- function Ra(e, t) {
2062
- var n = En(e, t);
2063
- if (n.length !== 0) {
2064
- if (n.length === 1)
2065
- return n[0];
2066
- throw new oe("expected a single document in the stream, but found more");
2067
- }
2068
- }
2069
- var Ka = Ba, Na = Ra, Fn = {
2070
- loadAll: Ka,
2071
- load: Na
2072
- }, On = Object.prototype.toString, Ln = Object.prototype.hasOwnProperty, ct = 65279, Ma = 9, Ee = 10, ja = 13, Da = 32, Pa = 33, Ua = 34, Qe = 35, qa = 37, Ha = 38, Va = 39, Ya = 42, Bn = 44, Wa = 45, Ne = 58, Ja = 61, Ga = 62, za = 63, Qa = 64, Rn = 91, Kn = 93, Za = 96, Nn = 123, Xa = 124, Mn = 125, re = {};
2073
- re[0] = "\\0";
2074
- re[7] = "\\a";
2075
- re[8] = "\\b";
2076
- re[9] = "\\t";
2077
- re[10] = "\\n";
2078
- re[11] = "\\v";
2079
- re[12] = "\\f";
2080
- re[13] = "\\r";
2081
- re[27] = "\\e";
2082
- re[34] = '\\"';
2083
- re[92] = "\\\\";
2084
- re[133] = "\\N";
2085
- re[160] = "\\_";
2086
- re[8232] = "\\L";
2087
- re[8233] = "\\P";
2088
- var eo = [
2089
- "y",
2090
- "Y",
2091
- "yes",
2092
- "Yes",
2093
- "YES",
2094
- "on",
2095
- "On",
2096
- "ON",
2097
- "n",
2098
- "N",
2099
- "no",
2100
- "No",
2101
- "NO",
2102
- "off",
2103
- "Off",
2104
- "OFF"
2105
- ], to = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
2106
- function no(e, t) {
2107
- var n, i, r, o, a, s, l;
2108
- if (t === null) return {};
2109
- for (n = {}, i = Object.keys(t), r = 0, o = i.length; r < o; r += 1)
2110
- a = i[r], s = String(t[a]), a.slice(0, 2) === "!!" && (a = "tag:yaml.org,2002:" + a.slice(2)), l = e.compiledTypeMap.fallback[a], l && Ln.call(l.styleAliases, s) && (s = l.styleAliases[s]), n[a] = s;
2111
- return n;
2112
- }
2113
- function io(e) {
2114
- var t, n, i;
2115
- if (t = e.toString(16).toUpperCase(), e <= 255)
2116
- n = "x", i = 2;
2117
- else if (e <= 65535)
2118
- n = "u", i = 4;
2119
- else if (e <= 4294967295)
2120
- n = "U", i = 8;
2121
- else
2122
- throw new oe("code point within a string may not be greater than 0xFFFFFFFF");
2123
- return "\\" + n + ee.repeat("0", i - t.length) + t;
2124
- }
2125
- var ro = 1, Fe = 2;
2126
- function ao(e) {
2127
- this.schema = e.schema || ot, this.indent = Math.max(1, e.indent || 2), this.noArrayIndent = e.noArrayIndent || !1, this.skipInvalid = e.skipInvalid || !1, this.flowLevel = ee.isNothing(e.flowLevel) ? -1 : e.flowLevel, this.styleMap = no(this.schema, e.styles || null), this.sortKeys = e.sortKeys || !1, this.lineWidth = e.lineWidth || 80, this.noRefs = e.noRefs || !1, this.noCompatMode = e.noCompatMode || !1, this.condenseFlow = e.condenseFlow || !1, this.quotingType = e.quotingType === '"' ? Fe : ro, this.forceQuotes = e.forceQuotes || !1, this.replacer = typeof e.replacer == "function" ? e.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
2128
- }
2129
- function Et(e, t) {
2130
- for (var n = ee.repeat(" ", t), i = 0, r = -1, o = "", a, s = e.length; i < s; )
2131
- r = e.indexOf(`
2132
- `, i), r === -1 ? (a = e.slice(i), i = s) : (a = e.slice(i, r + 1), i = r + 1), a.length && a !== `
2133
- ` && (o += n), o += a;
2134
- return o;
2135
- }
2136
- function Ze(e, t) {
2137
- return `
2138
- ` + ee.repeat(" ", e.indent * t);
2139
- }
2140
- function oo(e, t) {
2141
- var n, i, r;
2142
- for (n = 0, i = e.implicitTypes.length; n < i; n += 1)
2143
- if (r = e.implicitTypes[n], r.resolve(t))
2144
- return !0;
2145
- return !1;
2146
- }
2147
- function Me(e) {
2148
- return e === Da || e === Ma;
2149
- }
2150
- function Oe(e) {
2151
- return 32 <= e && e <= 126 || 161 <= e && e <= 55295 && e !== 8232 && e !== 8233 || 57344 <= e && e <= 65533 && e !== ct || 65536 <= e && e <= 1114111;
2152
- }
2153
- function Ft(e) {
2154
- return Oe(e) && e !== ct && e !== ja && e !== Ee;
2155
- }
2156
- function Ot(e, t, n) {
2157
- var i = Ft(e), r = i && !Me(e);
2158
- return (
2159
- // ns-plain-safe
2160
- (n ? (
2161
- // c = flow-in
2162
- i
2163
- ) : i && e !== Bn && e !== Rn && e !== Kn && e !== Nn && e !== Mn) && e !== Qe && !(t === Ne && !r) || Ft(t) && !Me(t) && e === Qe || t === Ne && r
2164
- );
2165
- }
2166
- function lo(e) {
2167
- return Oe(e) && e !== ct && !Me(e) && e !== Wa && e !== za && e !== Ne && e !== Bn && e !== Rn && e !== Kn && e !== Nn && e !== Mn && e !== Qe && e !== Ha && e !== Ya && e !== Pa && e !== Xa && e !== Ja && e !== Ga && e !== Va && e !== Ua && e !== qa && e !== Qa && e !== Za;
2168
- }
2169
- function so(e) {
2170
- return !Me(e) && e !== Ne;
2171
- }
2172
- function Te(e, t) {
2173
- var n = e.charCodeAt(t), i;
2174
- return n >= 55296 && n <= 56319 && t + 1 < e.length && (i = e.charCodeAt(t + 1), i >= 56320 && i <= 57343) ? (n - 55296) * 1024 + i - 56320 + 65536 : n;
2175
- }
2176
- function jn(e) {
2177
- var t = /^\n* /;
2178
- return t.test(e);
2179
- }
2180
- var Dn = 1, Xe = 2, Pn = 3, Un = 4, Ae = 5;
2181
- function co(e, t, n, i, r, o, a, s) {
2182
- var l, c = 0, d = null, u = !1, p = !1, g = i !== -1, h = -1, x = lo(Te(e, 0)) && so(Te(e, e.length - 1));
2183
- if (t || a)
2184
- for (l = 0; l < e.length; c >= 65536 ? l += 2 : l++) {
2185
- if (c = Te(e, l), !Oe(c))
2186
- return Ae;
2187
- x = x && Ot(c, d, s), d = c;
2188
- }
2189
- else {
2190
- for (l = 0; l < e.length; c >= 65536 ? l += 2 : l++) {
2191
- if (c = Te(e, l), c === Ee)
2192
- u = !0, g && (p = p || // Foldable line = too long, and not more-indented.
2193
- l - h - 1 > i && e[h + 1] !== " ", h = l);
2194
- else if (!Oe(c))
2195
- return Ae;
2196
- x = x && Ot(c, d, s), d = c;
2197
- }
2198
- p = p || g && l - h - 1 > i && e[h + 1] !== " ";
2199
- }
2200
- return !u && !p ? x && !a && !r(e) ? Dn : o === Fe ? Ae : Xe : n > 9 && jn(e) ? Ae : a ? o === Fe ? Ae : Xe : p ? Un : Pn;
2201
- }
2202
- function uo(e, t, n, i, r) {
2203
- e.dump = function() {
2204
- if (t.length === 0)
2205
- return e.quotingType === Fe ? '""' : "''";
2206
- if (!e.noCompatMode && (eo.indexOf(t) !== -1 || to.test(t)))
2207
- return e.quotingType === Fe ? '"' + t + '"' : "'" + t + "'";
2208
- var o = e.indent * Math.max(1, n), a = e.lineWidth === -1 ? -1 : Math.max(Math.min(e.lineWidth, 40), e.lineWidth - o), s = i || e.flowLevel > -1 && n >= e.flowLevel;
2209
- function l(c) {
2210
- return oo(e, c);
2211
- }
2212
- switch (co(
2213
- t,
2214
- s,
2215
- e.indent,
2216
- a,
2217
- l,
2218
- e.quotingType,
2219
- e.forceQuotes && !i,
2220
- r
2221
- )) {
2222
- case Dn:
2223
- return t;
2224
- case Xe:
2225
- return "'" + t.replace(/'/g, "''") + "'";
2226
- case Pn:
2227
- return "|" + Lt(t, e.indent) + Bt(Et(t, o));
2228
- case Un:
2229
- return ">" + Lt(t, e.indent) + Bt(Et(fo(t, a), o));
2230
- case Ae:
2231
- return '"' + po(t) + '"';
2232
- default:
2233
- throw new oe("impossible error: invalid scalar style");
2234
- }
2235
- }();
2236
- }
2237
- function Lt(e, t) {
2238
- var n = jn(e) ? String(t) : "", i = e[e.length - 1] === `
2239
- `, r = i && (e[e.length - 2] === `
2240
- ` || e === `
2241
- `), o = r ? "+" : i ? "" : "-";
2242
- return n + o + `
2243
- `;
2244
- }
2245
- function Bt(e) {
2246
- return e[e.length - 1] === `
2247
- ` ? e.slice(0, -1) : e;
2248
- }
2249
- function fo(e, t) {
2250
- for (var n = /(\n+)([^\n]*)/g, i = function() {
2251
- var c = e.indexOf(`
2252
- `);
2253
- return c = c !== -1 ? c : e.length, n.lastIndex = c, Rt(e.slice(0, c), t);
2254
- }(), r = e[0] === `
2255
- ` || e[0] === " ", o, a; a = n.exec(e); ) {
2256
- var s = a[1], l = a[2];
2257
- o = l[0] === " ", i += s + (!r && !o && l !== "" ? `
2258
- ` : "") + Rt(l, t), r = o;
2259
- }
2260
- return i;
2261
- }
2262
- function Rt(e, t) {
2263
- if (e === "" || e[0] === " ") return e;
2264
- for (var n = / [^ ]/g, i, r = 0, o, a = 0, s = 0, l = ""; i = n.exec(e); )
2265
- s = i.index, s - r > t && (o = a > r ? a : s, l += `
2266
- ` + e.slice(r, o), r = o + 1), a = s;
2267
- return l += `
2268
- `, e.length - r > t && a > r ? l += e.slice(r, a) + `
2269
- ` + e.slice(a + 1) : l += e.slice(r), l.slice(1);
2270
- }
2271
- function po(e) {
2272
- for (var t = "", n = 0, i, r = 0; r < e.length; n >= 65536 ? r += 2 : r++)
2273
- n = Te(e, r), i = re[n], !i && Oe(n) ? (t += e[r], n >= 65536 && (t += e[r + 1])) : t += i || io(n);
2274
- return t;
2275
- }
2276
- function mo(e, t, n) {
2277
- var i = "", r = e.tag, o, a, s;
2278
- for (o = 0, a = n.length; o < a; o += 1)
2279
- s = n[o], e.replacer && (s = e.replacer.call(n, String(o), s)), (pe(e, t, s, !1, !1) || typeof s > "u" && pe(e, t, null, !1, !1)) && (i !== "" && (i += "," + (e.condenseFlow ? "" : " ")), i += e.dump);
2280
- e.tag = r, e.dump = "[" + i + "]";
2281
- }
2282
- function Kt(e, t, n, i) {
2283
- var r = "", o = e.tag, a, s, l;
2284
- for (a = 0, s = n.length; a < s; a += 1)
2285
- l = n[a], e.replacer && (l = e.replacer.call(n, String(a), l)), (pe(e, t + 1, l, !0, !0, !1, !0) || typeof l > "u" && pe(e, t + 1, null, !0, !0, !1, !0)) && ((!i || r !== "") && (r += Ze(e, t)), e.dump && Ee === e.dump.charCodeAt(0) ? r += "-" : r += "- ", r += e.dump);
2286
- e.tag = o, e.dump = r || "[]";
2287
- }
2288
- function ho(e, t, n) {
2289
- var i = "", r = e.tag, o = Object.keys(n), a, s, l, c, d;
2290
- for (a = 0, s = o.length; a < s; a += 1)
2291
- d = "", i !== "" && (d += ", "), e.condenseFlow && (d += '"'), l = o[a], c = n[l], e.replacer && (c = e.replacer.call(n, l, c)), pe(e, t, l, !1, !1) && (e.dump.length > 1024 && (d += "? "), d += e.dump + (e.condenseFlow ? '"' : "") + ":" + (e.condenseFlow ? "" : " "), pe(e, t, c, !1, !1) && (d += e.dump, i += d));
2292
- e.tag = r, e.dump = "{" + i + "}";
2293
- }
2294
- function go(e, t, n, i) {
2295
- var r = "", o = e.tag, a = Object.keys(n), s, l, c, d, u, p;
2296
- if (e.sortKeys === !0)
2297
- a.sort();
2298
- else if (typeof e.sortKeys == "function")
2299
- a.sort(e.sortKeys);
2300
- else if (e.sortKeys)
2301
- throw new oe("sortKeys must be a boolean or a function");
2302
- for (s = 0, l = a.length; s < l; s += 1)
2303
- p = "", (!i || r !== "") && (p += Ze(e, t)), c = a[s], d = n[c], e.replacer && (d = e.replacer.call(n, c, d)), pe(e, t + 1, c, !0, !0, !0) && (u = e.tag !== null && e.tag !== "?" || e.dump && e.dump.length > 1024, u && (e.dump && Ee === e.dump.charCodeAt(0) ? p += "?" : p += "? "), p += e.dump, u && (p += Ze(e, t)), pe(e, t + 1, d, !0, u) && (e.dump && Ee === e.dump.charCodeAt(0) ? p += ":" : p += ": ", p += e.dump, r += p));
2304
- e.tag = o, e.dump = r || "{}";
2305
- }
2306
- function Nt(e, t, n) {
2307
- var i, r, o, a, s, l;
2308
- for (r = n ? e.explicitTypes : e.implicitTypes, o = 0, a = r.length; o < a; o += 1)
2309
- if (s = r[o], (s.instanceOf || s.predicate) && (!s.instanceOf || typeof t == "object" && t instanceof s.instanceOf) && (!s.predicate || s.predicate(t))) {
2310
- if (n ? s.multi && s.representName ? e.tag = s.representName(t) : e.tag = s.tag : e.tag = "?", s.represent) {
2311
- if (l = e.styleMap[s.tag] || s.defaultStyle, On.call(s.represent) === "[object Function]")
2312
- i = s.represent(t, l);
2313
- else if (Ln.call(s.represent, l))
2314
- i = s.represent[l](t, l);
2315
- else
2316
- throw new oe("!<" + s.tag + '> tag resolver accepts not "' + l + '" style');
2317
- e.dump = i;
2318
- }
2319
- return !0;
2320
- }
2321
- return !1;
2322
- }
2323
- function pe(e, t, n, i, r, o, a) {
2324
- e.tag = null, e.dump = n, Nt(e, n, !1) || Nt(e, n, !0);
2325
- var s = On.call(e.dump), l = i, c;
2326
- i && (i = e.flowLevel < 0 || e.flowLevel > t);
2327
- var d = s === "[object Object]" || s === "[object Array]", u, p;
2328
- if (d && (u = e.duplicates.indexOf(n), p = u !== -1), (e.tag !== null && e.tag !== "?" || p || e.indent !== 2 && t > 0) && (r = !1), p && e.usedDuplicates[u])
2329
- e.dump = "*ref_" + u;
2330
- else {
2331
- if (d && p && !e.usedDuplicates[u] && (e.usedDuplicates[u] = !0), s === "[object Object]")
2332
- i && Object.keys(e.dump).length !== 0 ? (go(e, t, e.dump, r), p && (e.dump = "&ref_" + u + e.dump)) : (ho(e, t, e.dump), p && (e.dump = "&ref_" + u + " " + e.dump));
2333
- else if (s === "[object Array]")
2334
- i && e.dump.length !== 0 ? (e.noArrayIndent && !a && t > 0 ? Kt(e, t - 1, e.dump, r) : Kt(e, t, e.dump, r), p && (e.dump = "&ref_" + u + e.dump)) : (mo(e, t, e.dump), p && (e.dump = "&ref_" + u + " " + e.dump));
2335
- else if (s === "[object String]")
2336
- e.tag !== "?" && uo(e, e.dump, t, o, l);
2337
- else {
2338
- if (s === "[object Undefined]")
2339
- return !1;
2340
- if (e.skipInvalid) return !1;
2341
- throw new oe("unacceptable kind of an object to dump " + s);
2342
- }
2343
- e.tag !== null && e.tag !== "?" && (c = encodeURI(
2344
- e.tag[0] === "!" ? e.tag.slice(1) : e.tag
2345
- ).replace(/!/g, "%21"), e.tag[0] === "!" ? c = "!" + c : c.slice(0, 18) === "tag:yaml.org,2002:" ? c = "!!" + c.slice(18) : c = "!<" + c + ">", e.dump = c + " " + e.dump);
2346
- }
2347
- return !0;
2348
- }
2349
- function yo(e, t) {
2350
- var n = [], i = [], r, o;
2351
- for (et(e, n, i), r = 0, o = i.length; r < o; r += 1)
2352
- t.duplicates.push(n[i[r]]);
2353
- t.usedDuplicates = new Array(o);
2354
- }
2355
- function et(e, t, n) {
2356
- var i, r, o;
2357
- if (e !== null && typeof e == "object")
2358
- if (r = t.indexOf(e), r !== -1)
2359
- n.indexOf(r) === -1 && n.push(r);
2360
- else if (t.push(e), Array.isArray(e))
2361
- for (r = 0, o = e.length; r < o; r += 1)
2362
- et(e[r], t, n);
2363
- else
2364
- for (i = Object.keys(e), r = 0, o = i.length; r < o; r += 1)
2365
- et(e[i[r]], t, n);
2366
- }
2367
- function vo(e, t) {
2368
- t = t || {};
2369
- var n = new ao(t);
2370
- n.noRefs || yo(e, n);
2371
- var i = e;
2372
- return n.replacer && (i = n.replacer.call({ "": i }, "", i)), pe(n, 0, i, !0, !0) ? n.dump + `
2373
- ` : "";
2374
- }
2375
- var bo = vo, xo = {
2376
- dump: bo
2377
- };
2378
- function ut(e, t) {
2379
- return function() {
2380
- throw new Error("Function yaml." + e + " is removed in js-yaml 4. Use yaml." + t + " instead, which is now safe by default.");
2381
- };
2382
- }
2383
- var Co = ne, ko = rn, Ao = sn, _o = pn, wo = mn, So = ot, $o = Fn.load, To = Fn.loadAll, Io = xo.dump, Eo = oe, Fo = {
2384
- binary: bn,
2385
- float: fn,
2386
- map: ln,
2387
- null: cn,
2388
- pairs: Cn,
2389
- set: kn,
2390
- timestamp: yn,
2391
- bool: un,
2392
- int: dn,
2393
- merge: vn,
2394
- omap: xn,
2395
- seq: on,
2396
- str: an
2397
- }, Oo = ut("safeLoad", "load"), Lo = ut("safeLoadAll", "loadAll"), Bo = ut("safeDump", "dump"), Ro = {
2398
- Type: Co,
2399
- Schema: ko,
2400
- FAILSAFE_SCHEMA: Ao,
2401
- JSON_SCHEMA: _o,
2402
- CORE_SCHEMA: wo,
2403
- DEFAULT_SCHEMA: So,
2404
- load: $o,
2405
- loadAll: To,
2406
- dump: Io,
2407
- YAMLException: Eo,
2408
- types: Fo,
2409
- safeLoad: Oo,
2410
- safeLoadAll: Lo,
2411
- safeDump: Bo
2412
- };
2413
- const Ko = { class: "yaml-config config-card-code-block" }, qn = /* @__PURE__ */ z({
2414
- __name: "YamlCodeBlock",
2415
- props: {
2416
- /** A record to indicate the entity's configuration, used to populate the YAML code block */
2417
- entityRecord: {
2418
- type: Object,
2419
- required: !0
2420
- }
2421
- },
2422
- setup(e) {
2423
- const t = e, n = F(() => {
2424
- const i = Object.fromEntries(Object.entries(t.entityRecord).filter(([, r]) => r !== null && r !== "" && (Array.isArray(r) ? r.length !== 0 : !0)));
2425
- return Object.keys(i).length === 0 && i.constructor === Object ? "" : Ro.dump(i).trim();
2426
- });
2427
- return (i, r) => {
2428
- const o = P("KCodeBlock");
2429
- return m(), S("div", Ko, [
2430
- t.entityRecord ? (m(), j(o, {
2431
- key: 0,
2432
- id: "yaml-codeblock",
2433
- code: n.value,
2434
- language: "yaml",
2435
- theme: "dark"
2436
- }, null, 8, ["code"])) : N("", !0)
2437
- ]);
2438
- };
2439
- }
2440
- }), No = { class: "terraform-config config-card-code-block" }, ie = " ", Hn = /* @__PURE__ */ z({
2441
- __name: "TerraformCodeBlock",
2442
- props: {
2443
- /** A record to indicate the entity's configuration, used to populate the Terraform code block */
2444
- entityRecord: {
2445
- type: Object,
2446
- required: !0
2447
- },
2448
- entityType: {
2449
- type: String,
2450
- required: !0,
2451
- validator: (e) => Pe.includes(e)
2452
- },
2453
- credentialType: {
2454
- type: String,
2455
- default: ""
2456
- },
2457
- subEntityType: {
2458
- // only for event gateway entities
2459
- type: String,
2460
- default: ""
2461
- }
2462
- },
2463
- setup(e) {
2464
- const t = e, n = F(() => ci.includes(t.entityType)), i = (l, c) => {
2465
- const d = ie;
2466
- let u = "";
2467
- return typeof l == "string" ? u += `${d}${c} = "${l}"
2468
- ` : u += `${d}${c} = ${String(l ?? "")}
2469
- `, u;
2470
- }, r = (l, c, d = "") => {
2471
- if (typeof l != "object")
2472
- return "Invalid object";
2473
- const u = ie + d;
2474
- let p = "";
2475
- if (c && (p += `${u}${c} = {
2476
- `), l === null)
2477
- return c ? p += `${u}}` : p = "{}", p;
2478
- const g = Object.fromEntries(Object.entries(l).filter(([, x]) => x !== null));
2479
- let h = "";
2480
- for (const [x, y] of Object.entries(g))
2481
- Array.isArray(y) ? y.length === 0 ? h = "[]" : (h = `[
2482
- `, h += o(y, void 0, u), h += `${u}${ie}]`) : y && typeof y == "object" ? (h = `{
2483
- `, h += r(y, void 0, u), h += `${u}${ie}}`) : h = String(y ?? ""), typeof y == "string" && (h = `"${h}"`), p += `${u}${ie}${x} = ${h}
2484
- `;
2485
- return c ? p += `${u}}
2486
- ` : p;
2487
- }, o = (l, c, d = "") => {
2488
- if (!Array.isArray(l))
2489
- return "Invalid array";
2490
- const u = ie + d;
2491
- let p = "";
2492
- c && (l.length === 0 ? p += `${u}${c} = [` : p += `${u}${c} = [
2493
- `);
2494
- for (let g = 0; g < l.length; g++) {
2495
- const h = l[g];
2496
- typeof h == "object" ? (p += `${u}${ie}{
2497
- `, p += r(h, void 0, u), p += `${u}${ie}}`) : typeof h == "string" ? p += `${u}${ie}"${h}"` : p += `${u}${ie}${String(h ?? "")}`, g < l.length - 1 && (p += ","), p += `
2498
- `;
2499
- }
2500
- return c && (l.length === 0 ? p += `]
2501
- ` : p += `${u}]
2502
- `), p;
2503
- }, a = (l) => {
2504
- let c = "";
2505
- for (const [d, u] of Object.entries(l))
2506
- Array.isArray(u) ? c += o(u, d) : typeof u == "object" ? c += r(u, d) : c += i(u, d);
2507
- return c;
2508
- }, s = F(() => {
2509
- var p, g, h, x, y, k, C;
2510
- const l = Object.fromEntries(Object.entries(t.entityRecord).filter(([, T]) => T != null)), c = t.entityRecord.config ? Object.fromEntries(Object.entries((p = t.entityRecord) == null ? void 0 : p.config).filter(([, T]) => T != null)) : void 0;
2511
- if (c && (l.config = c), Object.keys(l).length === 0)
2512
- return "";
2513
- delete l.id;
2514
- let d = "", u = "";
2515
- if ((g = l.service) != null && g.id ? (u = "service", delete l.service) : (h = l.route) != null && h.id ? (u = "route", delete l.route) : (x = l.consumer) != null && x.id ? (u = "consumer", delete l.consumer) : (y = l.consumer_group) != null && y.id ? (u = "consumer_group", delete l.consumer_group) : (k = l.certificate) != null && k.id ? (u = "certificate", delete l.certificate) : (C = l.set) != null && C.id && (u = "set", delete l.set), n.value) {
2516
- const T = t.subEntityType ? `${t.entityType}_${t.subEntityType}` : t.entityType;
2517
- d += `resource "konnect_event_gateway_${T}" "my_eventgateway${T.replaceAll("_", "")}" {
2518
- `, d += `${ie}provider = konnect-beta
2519
- `;
2520
- } else if (t.entityType === "plugin") {
2521
- const T = t.credentialType.replace(/-/g, "_") || (l.name + "").replace(/-/g, "_");
2522
- delete l.name, d += `resource "konnect_gateway_plugin_${T}" "my_${T}" {
2523
- `;
2524
- } else
2525
- d += `resource "konnect_gateway_${t.entityType}" "my_${t.entityType}" {
2526
- `;
2527
- return d += a(l), n.value ? u && (d += `${ie}${u} = {
2528
- `, d += `${ie}${ie}id = konnect_gateway_${u}.my_${u}.id
2529
- `, d += `${ie}}
2530
- `) : d += `${ie}control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
2531
- `, d += `}
2532
- `, d;
2533
- });
2534
- return (l, c) => {
2535
- const d = P("KCodeBlock");
2536
- return m(), S("div", No, [
2537
- t.entityRecord ? (m(), j(d, {
2538
- key: 0,
2539
- id: "terraform-codeblock",
2540
- code: s.value,
2541
- language: "terraform",
2542
- theme: "dark"
2543
- }, null, 8, ["code"])) : N("", !0)
2544
- ]);
2545
- };
2546
- }
2547
- }), Mo = {
2548
- key: 0,
2549
- class: "config-card-display-form"
2550
- }, jo = ["data-testid"], Do = {
2551
- key: 0,
2552
- class: "config-card-prop-section-title"
2553
- }, Po = /* @__PURE__ */ z({
2554
- __name: "ConfigCardDisplay",
2555
- props: {
2556
- /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
2557
- config: {
2558
- type: Object,
2559
- required: !1,
2560
- default: () => ({})
2561
- },
2562
- entityType: {
2563
- type: String,
2564
- required: !0,
2565
- validator: (e) => Pe.includes(e)
2566
- },
2567
- subEntityType: {
2568
- // only for event gateway entities
2569
- type: String,
2570
- default: ""
2571
- },
2572
- propertyCollections: {
2573
- type: Object,
2574
- required: !1,
2575
- default: () => null
2576
- },
2577
- format: {
2578
- type: String,
2579
- required: !1,
2580
- default: "structured",
2581
- validator: (e) => ["structured", "yaml", "json", "terraform"].includes(e)
2582
- },
2583
- propListTypes: {
2584
- type: Array,
2585
- required: !1,
2586
- default: () => []
2587
- },
2588
- /** A record to indicate the entity's configuration, used to populate the JSON/YAML code blocks */
2589
- record: {
2590
- type: Object,
2591
- required: !1,
2592
- default: () => ({})
2593
- },
2594
- /** Fetcher url for the entity with the filled-in controlPlaneId, workspace, and entity id. */
2595
- fetcherUrl: {
2596
- type: String,
2597
- required: !1,
2598
- default: ""
2599
- },
2600
- /**
2601
- * A function to format the entity record before displaying it in the code block.
2602
- */
2603
- codeBlockRecordFormatter: {
2604
- type: Function,
2605
- required: !1,
2606
- default: (e) => e
2607
- }
2608
- },
2609
- setup(e) {
2610
- const t = e, n = De(), { i18n: { t: i } } = Y.useI18n(), r = (s) => !!(s.tooltip || n[`${s.key}-label-tooltip`]), o = F(() => {
2611
- if (!t.record)
2612
- return t.record;
2613
- let s = t.record;
2614
- t.codeBlockRecordFormatter && (s = t.codeBlockRecordFormatter(s, t.format));
2615
- const l = JSON.parse(JSON.stringify(s));
2616
- return delete l.created_at, delete l.updated_at, l;
2617
- }), a = F(() => t.fetcherUrl.replace(/(\?|&)__ui_data=true/, ""));
2618
- return (s, l) => (m(), S(ue, null, [
2619
- e.format === "structured" ? (m(), S("div", Mo, [
2620
- (m(!0), S(ue, null, ce(e.propListTypes, (c) => (m(), S("div", {
2621
- key: `config-card-details-${c}-props`,
2622
- class: fe(`config-card-details-${c}-props`),
2623
- "data-testid": `config-card-details-${c}-props`
2624
- }, [
2625
- c !== "basic" ? (m(), S("div", Do, L(c === "advanced" ? $(i)("baseConfigCard.sections.advanced") : c === "plugin" ? $(i)("baseConfigCard.sections.plugin") : $(i)("baseConfigCard.sections.policy")), 1)) : N("", !0),
2626
- (m(!0), S(ue, null, ce(e.propertyCollections[c], (d) => D(s.$slots, `config-card-item-${d.key}`, {
2627
- key: d.key,
2628
- item: d
2629
- }, () => [
2630
- M(Xt, { item: d }, Se({
2631
- label: w(() => [
2632
- D(s.$slots, `${d.key}-label`, { row: d }, void 0, !0)
2633
- ]),
2634
- [d.key]: w(({ rowValue: u }) => [
2635
- D(s.$slots, d.key, {
2636
- row: d,
2637
- rowValue: u
2638
- }, void 0, !0)
2639
- ]),
2640
- _: 2
2641
- }, [
2642
- r(d) ? {
2643
- name: "label-tooltip",
2644
- fn: w(() => [
2645
- D(s.$slots, `${d.key}-label-tooltip`, { row: d }, void 0, !0)
2646
- ]),
2647
- key: "0"
2648
- } : void 0
2649
- ]), 1032, ["item"])
2650
- ], !0)), 128))
2651
- ], 10, jo))), 128))
2652
- ])) : N("", !0),
2653
- e.format === "json" && o.value ? (m(), j(en, {
2654
- key: 1,
2655
- config: t.config,
2656
- "entity-record": o.value,
2657
- "fetcher-url": a.value,
2658
- "request-method": "get"
2659
- }, null, 8, ["config", "entity-record", "fetcher-url"])) : N("", !0),
2660
- e.format === "yaml" && o.value ? (m(), j(qn, {
2661
- key: 2,
2662
- "entity-record": o.value
2663
- }, null, 8, ["entity-record"])) : N("", !0),
2664
- e.format === "terraform" && o.value ? (m(), j(Hn, {
2665
- key: 3,
2666
- "entity-record": o.value,
2667
- "entity-type": t.entityType,
2668
- "sub-entity-type": t.subEntityType
2669
- }, null, 8, ["entity-record", "entity-type", "sub-entity-type"])) : N("", !0)
2670
- ], 64));
2671
- }
2672
- }), Uo = /* @__PURE__ */ se(Po, [["__scopeId", "data-v-a7689049"]]), qo = {
2673
- class: "config-card-title",
2674
- "data-testid": "config-card-title"
2675
- }, Ho = { class: "config-card-actions" }, Vo = ["href"], Yo = { class: "config-card-details-section" }, Wo = /* @__PURE__ */ z({
2676
- __name: "EntityBaseConfigCard",
2677
- props: {
2678
- /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
2679
- config: {
2680
- type: Object,
2681
- required: !0,
2682
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || e.app === "konnect" && !e.controlPlaneId || e.app === "kongManager" && typeof e.workspace != "string" || !e.entityId)
2683
- },
2684
- /** Schema to configure display of fields */
2685
- configSchema: {
2686
- type: Object,
2687
- required: !1,
2688
- default: () => ({})
2689
- },
2690
- /**
2691
- * Entity type, required to generate terraform code
2692
- */
2693
- entityType: {
2694
- type: String,
2695
- required: !0,
2696
- validator: (e) => Pe.includes(e)
2697
- },
2698
- /**
2699
- * Sub Entity type, required to generate terraform code for event gateway entities
2700
- */
2701
- subEntityType: {
2702
- type: String,
2703
- default: ""
2704
- },
2705
- /** Record key that contains the plugin configuration */
2706
- pluginConfigKey: {
2707
- type: String,
2708
- required: !1,
2709
- default: ""
2710
- },
2711
- /** Configuration schema for the plugin configuration section */
2712
- pluginConfigSchema: {
2713
- type: Object,
2714
- required: !1,
2715
- default: () => ({})
2716
- },
2717
- /** Record key that contains the policy configuration */
2718
- policyConfigKey: {
2719
- type: String,
2720
- required: !1,
2721
- default: ""
2722
- },
2723
- /** Configuration schema for the policy configuration section */
2724
- policyConfigSchema: {
2725
- type: Object,
2726
- required: !1,
2727
- default: () => ({})
2728
- },
2729
- /**
2730
- * Fetch url for the item to display configuration for.
2731
- * We will handle the replacement of {controlPlaneId}, {workspace}, and {id}.
2732
- * Value should NOT contain config.apiBaseUrl, as we auto include this. Typically this will just an entry from
2733
- * the endpoints file.
2734
- *
2735
- * ex. `/v2/control-planes/{controlPlaneId}/core-entities/snis/{id}`
2736
- */
2737
- fetchUrl: {
2738
- type: String,
2739
- required: !0
2740
- },
2741
- /**
2742
- * Optional key to use to access the record from fetched response.data
2743
- * If not provided, response.data will be used.
2744
- */
2745
- dataKey: {
2746
- type: String,
2747
- required: !1,
2748
- default: ""
2749
- },
2750
- /**
2751
- * Function to resolve the record from the fetched response.
2752
- * This prop only works if dataKey is not provided.
2753
- */
2754
- recordResolver: {
2755
- type: Function,
2756
- required: !1,
2757
- default: (e) => e
2758
- },
2759
- /**
2760
- * A function to format the entity record before displaying it in the code block.
2761
- */
2762
- codeBlockRecordFormatter: {
2763
- type: Function,
2764
- required: !1,
2765
- default: (e) => e
2766
- },
2767
- /**
2768
- * Boolean to control card title visibility.
2769
- */
2770
- hideTitle: {
2771
- type: Boolean,
2772
- default: !1
2773
- },
2774
- /**
2775
- * The label text to show for the select Format element
2776
- */
2777
- label: {
2778
- type: String,
2779
- default: "Format: ",
2780
- required: !1
2781
- },
2782
- /**
2783
- * External link for documentation
2784
- */
2785
- configCardDoc: {
2786
- type: String,
2787
- default: "",
2788
- required: !1
2789
- },
2790
- titleTag: {
2791
- type: String,
2792
- default: "h2"
2793
- }
2794
- },
2795
- emits: ["loading", "fetch:success", "fetch:error", "configFormatChange"],
2796
- setup(e, { emit: t }) {
2797
- var O;
2798
- const n = t, i = e, { i18n: { t: r } } = Y.useI18n(), { getMessageFromError: o } = Y.useErrors(), { convertKeyToTitle: a } = Y.useStringHelpers();
2799
- Y.useSubSchema(i.pluginConfigKey);
2800
- const { axiosInstance: s } = Y.useAxios((O = i.config) == null ? void 0 : O.axiosRequestConfig), l = [
2801
- {
2802
- label: r("baseConfigCard.general.structuredFormat"),
2803
- value: "structured",
2804
- selected: !0
2805
- },
2806
- {
2807
- label: r("baseForm.configuration.json"),
2808
- value: "json"
2809
- },
2810
- {
2811
- label: r("baseForm.configuration.yaml"),
2812
- value: "yaml"
2813
- }
2814
- ];
2815
- i.config.app === "konnect" && l.splice(2, 0, {
2816
- label: r("baseForm.configuration.terraform"),
2817
- value: "terraform"
2818
- });
2819
- const c = l[0].value, d = K(c), u = (f) => {
2820
- d.value = f == null ? void 0 : f.value, n("configFormatChange", d.value);
2821
- }, p = (f, v) => {
2822
- localStorage.setItem(f, v);
2823
- };
2824
- be(d, (f) => {
2825
- i.config.formatPreferenceKey && p(i.config.formatPreferenceKey, f);
2826
- }), tt(() => {
2827
- if (i.config.formatPreferenceKey) {
2828
- const f = localStorage.getItem(i.config.formatPreferenceKey);
2829
- f && l.some((v) => v.value === f) ? d.value = f : d.value = c, p(i.config.formatPreferenceKey, d.value);
2830
- }
2831
- });
2832
- const g = {
2833
- id: {
2834
- type: V.ID,
2835
- label: r("baseConfigCard.commonFields.id_label"),
2836
- order: 0,
2837
- section: ae.Basic
2838
- },
2839
- name: {
2840
- order: 1,
2841
- section: ae.Basic
2842
- },
2843
- enabled: {
2844
- type: V.BadgeStatus,
2845
- order: 2,
2846
- section: ae.Basic
2847
- },
2848
- updated_at: {
2849
- type: V.Date,
2850
- label: r("baseConfigCard.commonFields.updated_at_label"),
2851
- order: 3,
2852
- section: ae.Basic
2853
- },
2854
- created_at: {
2855
- type: V.Date,
2856
- label: r("baseConfigCard.commonFields.created_at_label"),
2857
- order: 4,
2858
- section: ae.Basic
2859
- },
2860
- tags: {
2861
- type: V.BadgeTag,
2862
- order: -1,
2863
- // the last property displayed
2864
- section: ae.Basic
2865
- },
2866
- partials: {
2867
- type: V.LinkInternal,
2868
- label: r("baseConfigCard.commonFields.partial_label"),
2869
- order: -1,
2870
- // the last property displayed
2871
- section: ae.Basic
2872
- }
2873
- }, h = K(!1), x = K(!1), y = K(""), k = K({}), C = F(() => {
2874
- var b, H, J;
2875
- if (!k.value)
2876
- return [];
2877
- const f = [], v = Object.keys(k.value).length;
2878
- for (const I in k.value) {
2879
- if (I === "__ui_data") continue;
2880
- const B = (H = (b = i.configSchema) == null ? void 0 : b[I]) == null ? void 0 : H.order, G = (J = g[I]) == null ? void 0 : J.order;
2881
- let U = v;
2882
- (G || G === 0) && (U = G === -1 ? v + 1 : G), B && (U = B === -1 ? v + 1 : B), f.push([I, U]);
2883
- }
2884
- return f.sort(function(I, B) {
2885
- return I[1] - B[1];
2886
- }), f.map((I) => {
2887
- var dt, ft;
2888
- const B = I[0], G = (dt = k.value) == null ? void 0 : dt[B], U = ((ft = i.configSchema) == null ? void 0 : ft[B]) || {}, Q = g[B];
2889
- return {
2890
- key: B,
2891
- value: G,
2892
- hidden: U.hidden || !1,
2893
- type: U.type ?? ((Q == null ? void 0 : Q.type) || V.Text),
2894
- label: U.label ?? ((Q == null ? void 0 : Q.label) || a(B)),
2895
- tooltip: U.tooltip ?? ((Q == null ? void 0 : Q.tooltip) || void 0),
2896
- section: U.section ?? ((Q == null ? void 0 : Q.section) || ae.Advanced)
2897
- };
2898
- }).filter((I) => !I.hidden && I.key !== i.pluginConfigKey);
2899
- }), T = F(() => {
2900
- var H, J;
2901
- if (!k.value || !i.pluginConfigKey)
2902
- return [];
2903
- const f = k.value[i.pluginConfigKey] || {}, v = Object.keys(f).length, b = [];
2904
- for (const I in f) {
2905
- const B = (J = (H = i.pluginConfigSchema) == null ? void 0 : H[I]) == null ? void 0 : J.order, G = f[I];
2906
- let U = G != null && G !== "" ? v - 1 : v;
2907
- B && (U = B === -1 ? v + 1 : B), b.push([I, U]);
2908
- }
2909
- return b.sort(function(I, B) {
2910
- return I[1] - B[1];
2911
- }), b.map((I) => {
2912
- var Q;
2913
- const B = I[0], G = f[B], U = ((Q = i.pluginConfigSchema) == null ? void 0 : Q[B]) || {};
2914
- return {
2915
- key: B,
2916
- value: G,
2917
- hidden: U.hidden || !1,
2918
- type: U.type ?? V.Text,
2919
- label: U.label ?? a(B),
2920
- tooltip: U.tooltip ?? void 0,
2921
- section: ae.Plugin
2922
- };
2923
- }).filter((I) => !I.hidden);
2924
- }), W = F(() => {
2925
- var H, J;
2926
- if (!k.value || !i.policyConfigKey)
2927
- return [];
2928
- const f = k.value[i.policyConfigKey] || {}, v = Object.keys(f).length, b = [];
2929
- for (const I in f) {
2930
- const B = (J = (H = i.policyConfigSchema) == null ? void 0 : H[I]) == null ? void 0 : J.order, G = f[I];
2931
- let U = G != null && G !== "" ? v - 1 : v;
2932
- B && (U = B === -1 ? v + 1 : B), b.push([I, U]);
2933
- }
2934
- return b.sort(function(I, B) {
2935
- return I[1] - B[1];
2936
- }), b.map((I) => {
2937
- var Q;
2938
- const B = I[0], G = f[B], U = ((Q = i.policyConfigSchema) == null ? void 0 : Q[B]) || {};
2939
- return {
2940
- key: B,
2941
- value: G,
2942
- hidden: U.hidden || !1,
2943
- type: U.type ?? V.Text,
2944
- label: U.label ?? a(B),
2945
- tooltip: U.tooltip ?? void 0,
2946
- section: ae.Policy
2947
- };
2948
- }).filter((I) => !I.hidden);
2949
- }), X = F(() => {
2950
- var f, v, b, H, J, I;
2951
- return {
2952
- basic: (f = C.value) == null ? void 0 : f.filter((B) => B.section === ae.Basic),
2953
- advanced: (v = C.value) == null ? void 0 : v.filter((B) => B.section === ae.Advanced),
2954
- plugin: (H = T.value) == null ? void 0 : H.concat((b = C.value) == null ? void 0 : b.filter((B) => B.section === ae.Plugin)),
2955
- policy: (I = W.value) == null ? void 0 : I.concat((J = C.value) == null ? void 0 : J.filter((B) => B.section === ae.Policy))
2956
- };
2957
- }), _ = F(() => {
2958
- const f = [];
2959
- return X.value.basic.length && f.push("basic"), X.value.advanced.length && f.push("advanced"), X.value.plugin.length && f.push("plugin"), X.value.policy.length && f.push("policy"), f;
2960
- }), A = F(() => {
2961
- var v, b;
2962
- let f = `${i.config.apiBaseUrl}${i.fetchUrl}`;
2963
- return i.config.app === "konnect" ? f = f.replace(/{controlPlaneId}/gi, ((v = i.config) == null ? void 0 : v.controlPlaneId) || "") : i.config.app === "kongManager" && (f = f.replace(/\/{workspace}/gi, (b = i.config) != null && b.workspace ? `/${i.config.workspace}` : "")), f = f.replace(/{id}/gi, i.config.entityId), f;
2964
- });
2965
- return be(h, (f) => {
2966
- n("loading", f);
2967
- }, { immediate: !0 }), nt(async () => {
2968
- x.value = !1, h.value = !0;
2969
- try {
2970
- const { data: f } = await s.get(A.value);
2971
- if (i.dataKey)
2972
- if (typeof f[i.dataKey] < "u")
2973
- k.value = { ...f[i.dataKey] };
2974
- else
2975
- throw new Error(r("errors.dataKeyUndefined", { dataKey: i.dataKey }));
2976
- else i.recordResolver ? k.value = { ...i.recordResolver(f) } : k.value = { ...f };
2977
- Object.keys(i.configSchema).filter((b) => i.configSchema[b].forceShow).forEach((b) => {
2978
- k.value && typeof k.value[b] > "u" && (k.value[b] = null);
2979
- }), n("fetch:success", f);
2980
- } catch (f) {
2981
- const v = o(f);
2982
- y.value = v.startsWith("code") ? r("baseConfigCard.errors.load") : v, x.value = !0, n("fetch:error", f);
2983
- } finally {
2984
- h.value = !1;
2985
- }
2986
- }), (f, v) => {
2987
- const b = P("KLabel"), H = P("KSelect"), J = P("KButton"), I = P("KSkeleton"), B = P("KEmptyState"), G = P("KCard");
2988
- return m(), j(G, {
2989
- class: "kong-ui-entity-base-config-card",
2990
- "title-tag": e.titleTag
2991
- }, Se({
2992
- actions: w(() => [
2993
- R("div", Ho, [
2994
- D(f.$slots, "actions", {}, void 0, !0),
2995
- M(b, {
2996
- class: "config-format-select-label",
2997
- "data-testid": "config-format-select-label"
2998
- }, {
2999
- default: w(() => [
3000
- q(L(e.label), 1)
3001
- ]),
3002
- _: 1
3003
- }),
3004
- M(H, {
3005
- modelValue: d.value,
3006
- "onUpdate:modelValue": v[0] || (v[0] = (U) => d.value = U),
3007
- "data-testid": "select-config-format",
3008
- items: l,
3009
- onChange: u
3010
- }, null, 8, ["modelValue"]),
3011
- e.configCardDoc ? (m(), j(J, {
3012
- key: 0,
3013
- appearance: "tertiary",
3014
- class: "book-icon",
3015
- "data-testid": "book-icon"
3016
- }, {
3017
- default: w(() => [
3018
- R("a", {
3019
- href: e.configCardDoc,
3020
- rel: "noopener",
3021
- target: "_blank"
3022
- }, [
3023
- M($(Vt), { size: $(er) }, null, 8, ["size"])
3024
- ], 8, Vo)
3025
- ]),
3026
- _: 1
3027
- })) : N("", !0)
3028
- ])
3029
- ]),
3030
- default: w(() => [
3031
- h.value ? (m(), j(I, {
3032
- key: 0,
3033
- "data-testid": "config-card-loader",
3034
- "table-columns": 2,
3035
- type: "table"
3036
- })) : x.value ? (m(), j(B, {
3037
- key: 1,
3038
- "data-testid": "config-card-fetch-error",
3039
- "icon-variant": "error"
3040
- }, {
3041
- default: w(() => [
3042
- R("h3", null, L(y.value), 1)
3043
- ]),
3044
- _: 1
3045
- })) : N("", !0),
3046
- R("div", Yo, [
3047
- M(Uo, {
3048
- "code-block-record-formatter": e.codeBlockRecordFormatter,
3049
- config: e.config,
3050
- "entity-type": e.entityType,
3051
- "fetcher-url": A.value,
3052
- format: d.value,
3053
- "prop-list-types": _.value,
3054
- "property-collections": X.value,
3055
- record: k.value,
3056
- "sub-entity-type": e.subEntityType
3057
- }, Se({ _: 2 }, [
3058
- ce(Object.keys(f.$slots), (U) => ({
3059
- name: U,
3060
- fn: w((Q) => [
3061
- D(f.$slots, U, qt({ record: k.value }, Q), void 0, !0)
3062
- ])
3063
- }))
3064
- ]), 1032, ["code-block-record-formatter", "config", "entity-type", "fetcher-url", "format", "prop-list-types", "property-collections", "record", "sub-entity-type"])
3065
- ])
3066
- ]),
3067
- _: 2
3068
- }, [
3069
- e.hideTitle ? void 0 : {
3070
- name: "title",
3071
- fn: w(() => [
3072
- R("span", qo, [
3073
- D(f.$slots, "title", {}, () => [
3074
- q(L($(r)("baseConfigCard.title")), 1)
3075
- ], !0)
3076
- ])
3077
- ]),
3078
- key: "0"
3079
- }
3080
- ]), 1032, ["title-tag"]);
3081
- };
3082
- }
3083
- }), ps = /* @__PURE__ */ se(Wo, [["__scopeId", "data-v-f2b42324"]]), Jo = ["novalidate"], Go = /* @__PURE__ */ z({
3084
- __name: "EntityBaseForm",
3085
- props: {
3086
- /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
3087
- config: {
3088
- type: Object,
3089
- required: !0,
3090
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || e.app === "konnect" && !e.controlPlaneId || e.app === "kongManager" && typeof e.workspace != "string")
3091
- },
3092
- /** If a valid edit ID is provided, it will put the form in Edit mode instead of Create */
3093
- editId: {
3094
- type: String,
3095
- required: !1,
3096
- default: ""
3097
- },
3098
- /**
3099
- * Entity type, required to generate terraform code
3100
- */
3101
- entityType: {
3102
- type: String,
3103
- required: !0,
3104
- validator: (e) => Pe.includes(e)
3105
- },
3106
- /**
3107
- * Sub entity type, required for event gateway entities to generate terraform code
3108
- */
3109
- subEntityType: {
3110
- type: String,
3111
- required: !1,
3112
- default: ""
3113
- },
3114
- /**
3115
- * Fetch url for the item to edit. We will handle the replacement of {controlPlaneId}, {workspace}, and {id}.
3116
- * Value should NOT contain config.apiBaseUrl, as we auto include this. Typically this will just an entry from
3117
- * the endpoints file.
3118
- * Required if `editId` is specified.
3119
- *
3120
- * ex. `/v2/control-planes/{controlPlaneId}/core-entities/snis/{id}`
3121
- */
3122
- fetchUrl: {
3123
- type: String,
3124
- required: !1,
3125
- default: ""
3126
- },
3127
- /** Set this prop to true during Save action. Disables save and cancel buttons */
3128
- isReadonly: {
3129
- type: Boolean,
3130
- required: !1,
3131
- default: !1
3132
- },
3133
- /** Used to track form validation, disables save button when false */
3134
- canSubmit: {
3135
- type: Boolean,
3136
- required: !1,
3137
- default: void 0
3138
- },
3139
- /** If form submission fails, this is the error message to display */
3140
- errorMessage: {
3141
- type: String,
3142
- required: !1,
3143
- default: ""
3144
- },
3145
- /** Used to populate the Configuration JSON/YAML code blocks */
3146
- formFields: {
3147
- type: Object,
3148
- required: !0
3149
- },
3150
- /**
3151
- * Set true to disable the form validation upon submission.
3152
- */
3153
- noValidate: {
3154
- type: Boolean,
3155
- default: !1
3156
- },
3157
- /**
3158
- * Wrapper component to use at component's root level.
3159
- */
3160
- wrapperComponent: {
3161
- type: String,
3162
- default: "KCard"
3163
- },
3164
- /**
3165
- * Teleport target for the actions
3166
- */
3167
- actionTeleportTarget: {
3168
- type: String,
3169
- default: void 0
3170
- },
3171
- /**
3172
- * Hide the actions
3173
- */
3174
- hideActions: {
3175
- type: Boolean,
3176
- default: !1
3177
- },
3178
- /**
3179
- * Top offset for the slideout
3180
- */
3181
- slidoutTopOffset: {
3182
- type: Number,
3183
- default: 60
3184
- },
3185
- /**
3186
- * Controls whether to align action buttons to left
3187
- */
3188
- alignActionButtonToLeft: {
3189
- type: Boolean,
3190
- default: !1
3191
- },
3192
- /**
3193
- * Save and Cancel button text override
3194
- */
3195
- saveButtonText: {
3196
- type: String,
3197
- default: void 0
3198
- },
3199
- cancelButtonText: {
3200
- type: String,
3201
- default: void 0
3202
- }
3203
- },
3204
- emits: ["loading", "fetch:success", "fetch:error", "submit", "cancel", "codeBlockTabChange"],
3205
- setup(e, { expose: t, emit: n }) {
3206
- var X;
3207
- const i = n, r = e, o = oi(), { i18n: { t: a } } = Y.useI18n(), { getMessageFromError: s } = Y.useErrors(), { axiosInstance: l } = Y.useAxios((X = r.config) == null ? void 0 : X.axiosRequestConfig), c = K(!1), d = F(() => !!r.editId), u = K(!1), p = K(""), g = F(() => r.canSubmit === !1 || r.isReadonly), h = K(!1), x = F(() => {
3208
- var A, O;
3209
- let _ = `${r.config.apiBaseUrl}${r.fetchUrl}`;
3210
- return r.config.app === "konnect" ? _ = _.replace(/{controlPlaneId}/gi, ((A = r.config) == null ? void 0 : A.controlPlaneId) || "") : r.config.app === "kongManager" && (_ = _.replace(/\/{workspace}/gi, (O = r.config) != null && O.workspace ? `/${r.config.workspace}` : "")), r.editId ? (_ = _.replace(/{id}/gi, r.editId), _) : (_ = _.replace(/\/{id}/gi, ""), _);
3211
- }), y = () => {
3212
- h.value = !h.value;
3213
- }, k = () => {
3214
- r.config.cancelRoute ? o.push(r.config.cancelRoute) : C();
3215
- }, C = () => {
3216
- i("cancel");
3217
- }, T = () => {
3218
- g.value || i("submit");
3219
- }, W = K([
3220
- {
3221
- title: a("baseForm.configuration.json"),
3222
- hash: "#json"
3223
- },
3224
- {
3225
- title: a("baseForm.configuration.yaml"),
3226
- hash: "#yaml"
3227
- }
3228
- ]);
3229
- return r.config.app === "konnect" && r.entityType !== it.Other && W.value.splice(1, 0, {
3230
- title: a("baseForm.configuration.terraform"),
3231
- hash: "#terraform"
3232
- }), be(() => c.value, (_) => {
3233
- i("loading", _);
3234
- }, { immediate: !0 }), nt(async () => {
3235
- if (r.editId)
3236
- try {
3237
- u.value = !1, c.value = !0;
3238
- const { data: _ } = await l.get(x.value);
3239
- i("fetch:success", _);
3240
- } catch (_) {
3241
- const A = s(_);
3242
- p.value = A.startsWith("code") ? a("baseForm.errors.edit") : A, u.value = !0, i("fetch:error", _);
3243
- } finally {
3244
- c.value = !1;
3245
- }
3246
- }), t({
3247
- viewConfig: y,
3248
- formCancel: C,
3249
- formSubmit: T
3250
- }), (_, A) => {
3251
- const O = P("KSkeleton"), f = P("KEmptyState"), v = P("KAlert"), b = P("KButton"), H = P("KTabs"), J = P("KSlideout");
3252
- return m(), j(je(e.wrapperComponent), { class: "kong-ui-entity-base-form" }, {
3253
- default: w(() => [
3254
- c.value ? (m(), j(O, {
3255
- key: 0,
3256
- type: "form"
3257
- })) : u.value ? (m(), j(f, {
3258
- key: 1,
3259
- "action-button-text": $(a)("baseForm.actions.back"),
3260
- "data-testid": "form-fetch-error",
3261
- "icon-variant": "error",
3262
- onClickAction: k
3263
- }, {
3264
- default: w(() => [
3265
- R("h3", null, L(p.value), 1)
3266
- ]),
3267
- _: 1
3268
- }, 8, ["action-button-text"])) : (m(), S("form", {
3269
- key: 2,
3270
- "data-testid": "form-content",
3271
- novalidate: r.noValidate,
3272
- onReset: Le(C, ["prevent"]),
3273
- onSubmit: Le(T, ["prevent"])
3274
- }, [
3275
- D(_.$slots, "default", {}, void 0, !0),
3276
- e.errorMessage ? (m(), j(v, {
3277
- key: 0,
3278
- appearance: "danger",
3279
- "data-testid": "form-error",
3280
- message: e.errorMessage
3281
- }, null, 8, ["message"])) : N("", !0),
3282
- e.hideActions ? N("", !0) : (m(), j(Ht, {
3283
- key: 1,
3284
- disabled: !e.actionTeleportTarget,
3285
- to: e.actionTeleportTarget
3286
- }, [
3287
- R("div", {
3288
- class: fe(["form-actions", { "form-actions-reverted": e.alignActionButtonToLeft }]),
3289
- "data-testid": "form-actions"
3290
- }, [
3291
- D(_.$slots, "form-actions", {}, () => [
3292
- M(b, {
3293
- appearance: "tertiary",
3294
- "data-testid": `${e.entityType}-${d.value ? "edit" : "create"}-form-view-configuration`,
3295
- onClick: A[0] || (A[0] = (I) => y())
3296
- }, {
3297
- default: w(() => [
3298
- q(L($(a)("baseForm.actions.viewConfiguration")), 1)
3299
- ]),
3300
- _: 1
3301
- }, 8, ["data-testid"]),
3302
- M(b, {
3303
- appearance: "secondary",
3304
- "data-testid": `${e.entityType}-${d.value ? "edit" : "create"}-form-cancel`,
3305
- disabled: e.isReadonly,
3306
- type: "reset",
3307
- onClick: A[1] || (A[1] = (I) => !!e.actionTeleportTarget && C())
3308
- }, {
3309
- default: w(() => [
3310
- q(L(e.cancelButtonText ?? $(a)("baseForm.actions.cancel")), 1)
3311
- ]),
3312
- _: 1
3313
- }, 8, ["data-testid", "disabled"]),
3314
- M(b, {
3315
- appearance: "primary",
3316
- "data-testid": `${e.entityType}-${d.value ? "edit" : "create"}-form-submit`,
3317
- disabled: g.value,
3318
- type: "submit",
3319
- onClick: A[2] || (A[2] = (I) => !!e.actionTeleportTarget && T())
3320
- }, {
3321
- default: w(() => [
3322
- q(L(e.saveButtonText ?? $(a)("baseForm.actions.save")), 1)
3323
- ]),
3324
- _: 1
3325
- }, 8, ["data-testid", "disabled"])
3326
- ], !0)
3327
- ], 2)
3328
- ], 8, ["disabled", "to"]))
3329
- ], 40, Jo)),
3330
- M(J, {
3331
- "close-on-blur": !1,
3332
- "data-testid": "form-view-configuration-slideout",
3333
- "has-overlay": !1,
3334
- "offset-top": e.slidoutTopOffset,
3335
- title: $(a)("baseForm.configuration.title"),
3336
- visible: h.value,
3337
- onClose: A[4] || (A[4] = (I) => y())
3338
- }, {
3339
- default: w(() => [
3340
- R("div", null, L($(a)("baseForm.configuration.message")), 1),
3341
- M(H, {
3342
- "data-testid": "form-view-configuration-slideout-tabs",
3343
- tabs: W.value,
3344
- onChange: A[3] || (A[3] = (I) => i("codeBlockTabChange", I.replace("#", "")))
3345
- }, {
3346
- json: w(() => [
3347
- M(en, {
3348
- config: e.config,
3349
- "entity-record": r.formFields,
3350
- "fetcher-url": x.value,
3351
- "request-method": r.editId ? "put" : "post"
3352
- }, null, 8, ["config", "entity-record", "fetcher-url", "request-method"])
3353
- ]),
3354
- yaml: w(() => [
3355
- M(qn, {
3356
- "entity-record": r.formFields
3357
- }, null, 8, ["entity-record"])
3358
- ]),
3359
- terraform: w(() => [
3360
- M(Hn, {
3361
- "entity-record": r.formFields,
3362
- "entity-type": e.entityType,
3363
- "sub-entity-type": e.subEntityType
3364
- }, null, 8, ["entity-record", "entity-type", "sub-entity-type"])
3365
- ]),
3366
- _: 1
3367
- }, 8, ["tabs"])
3368
- ]),
3369
- _: 1
3370
- }, 8, ["offset-top", "title", "visible"])
3371
- ]),
3372
- _: 3
3373
- });
3374
- };
3375
- }
3376
- }), ms = /* @__PURE__ */ se(Go, [["__scopeId", "data-v-10f3d6b0"]]), zo = ["data-truncate"], Qo = /* @__PURE__ */ z({
3377
- __name: "EntityBaseTableCell",
3378
- props: {
3379
- keyName: {
3380
- type: String,
3381
- required: !0
3382
- },
3383
- rowEl: {
3384
- type: [Object, null],
3385
- required: !0
3386
- },
3387
- tooltip: {
3388
- type: Boolean,
3389
- default: !1
3390
- }
3391
- },
3392
- setup(e) {
3393
- const t = e, n = F(() => {
3394
- var y;
3395
- return ((y = t.rowEl) == null ? void 0 : y.querySelector(`[data-testid="${t.keyName}"]`)) || null;
3396
- }), i = F(() => {
3397
- var y;
3398
- return ((y = n.value) == null ? void 0 : y.querySelector('[data-truncate="true"]')) || null;
3399
- }), r = F(() => {
3400
- var k, C;
3401
- const y = (k = t.rowEl) == null ? void 0 : k.querySelectorAll("td");
3402
- return y ? ((C = y[0]) == null ? void 0 : C.getAttribute("data-testid")) === t.keyName : !0;
3403
- }), o = F(() => r.value || t.tooltip);
3404
- let a;
3405
- const s = () => {
3406
- a && (a.disconnect(), a = void 0);
3407
- }, l = () => {
3408
- var k, C, T;
3409
- let y = ((k = n.value) == null ? void 0 : k.clientWidth) || 0;
3410
- if (n.value && "getComputedStyle" in window) {
3411
- const W = window.getComputedStyle(n.value);
3412
- y -= (parseFloat(W.paddingLeft) || 0) + (parseFloat(W.paddingRight) || 0);
3413
- }
3414
- d.value = ((C = i.value) == null ? void 0 : C.getBoundingClientRect().width) || 0, u.value = y, p.value = ((T = c.value) == null ? void 0 : T.innerText) || "";
3415
- }, c = K({}), d = K(0), u = K(0), p = K(""), g = F(() => [i.value, n.value]), h = be(
3416
- g,
3417
- (y) => {
3418
- if (o.value && (s(), "ResizeObserver" in window && window)) {
3419
- a = new ResizeObserver((k) => {
3420
- window.requestAnimationFrame(() => {
3421
- !Array.isArray(k) || !k.length || l();
3422
- });
3423
- });
3424
- for (const k of y)
3425
- k && a.observe(k);
3426
- }
3427
- },
3428
- { immediate: !0, flush: "post", deep: !0 }
3429
- ), x = F(() => o.value ? d.value > u.value : !1);
3430
- return tt(() => {
3431
- l();
3432
- }), Gn(() => {
3433
- h();
3434
- }), (y, k) => {
3435
- const C = P("KTooltip");
3436
- return m(), S("span", {
3437
- ref_key: "contentRef",
3438
- ref: c,
3439
- class: "content-wrapper"
3440
- }, [
3441
- o.value ? (m(), S("span", {
3442
- key: 0,
3443
- "data-truncate": o.value || void 0
3444
- }, [
3445
- M(C, {
3446
- "max-width": "300",
3447
- placement: "bottom-start",
3448
- text: x.value ? p.value : ""
3449
- }, {
3450
- default: w(() => [
3451
- D(y.$slots, "default", {}, void 0, !0)
3452
- ]),
3453
- _: 3
3454
- }, 8, ["text"])
3455
- ], 8, zo)) : D(y.$slots, "default", { key: 1 }, void 0, !0)
3456
- ], 512);
3457
- };
3458
- }
3459
- }), Zo = /* @__PURE__ */ se(Qo, [["__scopeId", "data-v-a3a65cac"]]), Xo = { class: "toolbar-container" }, el = {
3460
- key: 0,
3461
- class: "toolbar-button-container"
3462
- }, tl = {
3463
- key: 0,
3464
- class: "hidden"
3465
- }, nl = /* @__PURE__ */ z({
3466
- __name: "EntityBaseTable",
3467
- props: {
3468
- // table header configuration
3469
- tableHeaders: {
3470
- type: Object,
3471
- required: !0,
3472
- default: () => ({})
3473
- },
3474
- // fetcher function
3475
- fetcher: {
3476
- type: Function,
3477
- required: !0,
3478
- default: async () => ({
3479
- data: [],
3480
- total: 0
3481
- })
3482
- },
3483
- initialFetcherParams: {
3484
- type: Object,
3485
- default: null
3486
- },
3487
- rowKey: {
3488
- type: [String, Function],
3489
- default: "id"
3490
- },
3491
- // used to identify the cache entry
3492
- cacheIdentifier: {
3493
- type: String,
3494
- default: ""
3495
- },
3496
- // cache key for the fetcher
3497
- fetcherCacheKey: {
3498
- type: Number,
3499
- default: 1
3500
- },
3501
- // whether the table is loading
3502
- isLoading: {
3503
- type: Boolean,
3504
- default: !1
3505
- },
3506
- // search query
3507
- query: {
3508
- type: String,
3509
- default: ""
3510
- },
3511
- // Enable client-side sort (e.g. for Koko endpoints that do not support sort)
3512
- enableClientSort: {
3513
- type: Boolean,
3514
- default: !1
3515
- },
3516
- sortHandlerFunction: {
3517
- type: Function,
3518
- default: null
3519
- },
3520
- // whether to show the actions column
3521
- enableEntityActions: {
3522
- type: Boolean,
3523
- default: !0
3524
- },
3525
- // options for the empty state
3526
- emptyStateOptions: {
3527
- type: Object,
3528
- default: () => ({})
3529
- },
3530
- // error message to show in the error state
3531
- // this prop being set (or empty) determines if the KTable is in an error state
3532
- // please use `TableErrorMessage` since `string` is only for backwards compatibility
3533
- errorMessage: {
3534
- type: [String, Object],
3535
- default: null
3536
- },
3537
- paginationAttributes: {
3538
- type: Object,
3539
- default: () => ({})
3540
- },
3541
- hidePaginationWhenOptional: {
3542
- type: Boolean,
3543
- default: !0
3544
- },
3545
- disableSorting: {
3546
- type: Boolean,
3547
- default: void 0
3548
- },
3549
- // A function for applying attributes to cells
3550
- cellAttributes: {
3551
- type: Function,
3552
- default: () => ({})
3553
- },
3554
- // A function for applying attributes to rows
3555
- rowAttributes: {
3556
- type: Function,
3557
- default: () => ({})
3558
- },
3559
- /** tableKey to use for user table preferences. If empty, will fallback to default preferences */
3560
- preferencesStorageKey: {
3561
- type: String,
3562
- default: ""
3563
- },
3564
- /** default table preferences to use if no user preferences are found */
3565
- defaultTablePreferences: {
3566
- type: Object,
3567
- default: null,
3568
- required: !1
3569
- },
3570
- title: {
3571
- type: String,
3572
- default: ""
3573
- },
3574
- titleTag: {
3575
- type: String,
3576
- default: "h2"
3577
- },
3578
- /** default to false, setting to true will suppress the row click event even if "@click:row" is attached */
3579
- disableRowClick: {
3580
- type: Boolean,
3581
- default: !1
3582
- },
3583
- hidePagination: {
3584
- type: Boolean,
3585
- default: !1
3586
- },
3587
- hideToolbar: {
3588
- type: Boolean,
3589
- default: void 0
3590
- },
3591
- /**
3592
- * @deprecated in favour of `paginationAttributes`
3593
- */
3594
- disablePaginationPageJump: {
3595
- type: Boolean,
3596
- default: void 0,
3597
- validator: (e) => (e && console.warn("EntityBaseTable: `disablePaginationPageJump` is deprecated in favour of `paginationAttributes`. Please update your code to use `paginationAttributes` instead."), typeof e == "boolean")
3598
- },
3599
- /**
3600
- * @deprecated in favour of `paginationAttributes`
3601
- */
3602
- paginationType: {
3603
- type: String,
3604
- default: void 0,
3605
- validator: (e) => (e && console.warn("EntityBaseTable: `paginationType` is deprecated in favour of `paginationAttributes`. Please update your code to use `paginationAttributes` instead."), ["default", "offset"].includes(e))
3606
- }
3607
- },
3608
- emits: ["click:row", "sort", "clear-search-input", "empty-state-cta-clicked", "state"],
3609
- setup(e, { emit: t }) {
3610
- const n = e, i = t, { i18n: { t: r } } = Y.useI18n(), o = F(() => {
3611
- var f, v;
3612
- return typeof n.errorMessage == "string" ? {
3613
- hasError: !!n.errorMessage,
3614
- title: n.errorMessage,
3615
- message: void 0
3616
- } : {
3617
- hasError: !!n.errorMessage,
3618
- title: (f = n.errorMessage) == null ? void 0 : f.title,
3619
- message: (v = n.errorMessage) == null ? void 0 : v.message
3620
- };
3621
- }), a = F(() => n.cacheIdentifier || n.preferencesStorageKey), s = F(() => {
3622
- const f = [];
3623
- return Object.keys(n.tableHeaders).forEach((b) => {
3624
- const H = n.tableHeaders[b];
3625
- f.push({
3626
- label: H.label ?? b,
3627
- key: b,
3628
- sortable: H.sortable ?? !1,
3629
- hidable: H.hidable ?? !0
3630
- });
3631
- }), n.enableEntityActions && f.push({
3632
- key: "actions",
3633
- hideLabel: !0
3634
- }), f;
3635
- }), l = (f) => ({
3636
- "data-rowid": f.id,
3637
- "data-testid": f.name,
3638
- ...n.rowAttributes(f)
3639
- }), c = K({}), d = (f) => {
3640
- var v;
3641
- return (v = c.value) == null ? void 0 : v.$el.querySelector(`[data-rowid="${f.id}"]`);
3642
- }, u = (f) => {
3643
- const v = {
3644
- "data-testid": f.headerKey,
3645
- ...n.cellAttributes(f)
3646
- };
3647
- return f.colIndex === 0 && (v.style = {
3648
- maxWidth: "250px",
3649
- overflowX: "hidden",
3650
- textOverflow: "ellipsis"
3651
- }), v;
3652
- }, p = (f) => {
3653
- C(f), i("state", f);
3654
- }, g = () => {
3655
- i("empty-state-cta-clicked"), h();
3656
- }, h = () => {
3657
- i("clear-search-input");
3658
- }, x = F(() => n.disableRowClick ? void 0 : (f, v) => {
3659
- i("click:row", v);
3660
- }), y = (f) => {
3661
- i("sort", f);
3662
- }, { hideTableToolbar: k, handleStateChange: C } = Y.useTableState(() => n.query), { setTablePreferences: T, getTablePreferences: W } = pi(), X = K(W(a.value, n.defaultTablePreferences)), _ = F(() => {
3663
- const f = W(a.value);
3664
- return {
3665
- ...n.initialFetcherParams,
3666
- ...f
3667
- };
3668
- }), A = (f) => {
3669
- X.value = f, s.value.forEach((v) => {
3670
- !("hidable" in v) || !X.value.columnVisibility || v.hidable === !1 && (X.value.columnVisibility[v.key] = !0);
3671
- }), a.value && T(a.value, f);
3672
- }, O = F(() => ({
3673
- disablePageJump: n.disablePaginationPageJump,
3674
- offset: n.paginationType === "offset",
3675
- ...n.paginationAttributes
3676
- }));
3677
- return (f, v) => {
3678
- const b = P("KTableData"), H = P("KCard");
3679
- return m(), j(H, {
3680
- class: "kong-ui-entity-base-table",
3681
- title: e.title,
3682
- "title-tag": e.titleTag
3683
- }, {
3684
- default: w(() => [
3685
- M(b, {
3686
- ref_key: "tableRefs",
3687
- ref: c,
3688
- "cache-identifier": a.value,
3689
- "cell-attrs": u,
3690
- "client-sort": e.enableClientSort,
3691
- "empty-state-action-message": e.query ? $(r)("baseTable.emptyState.noSearchResultsCtaText") : e.emptyStateOptions.ctaText,
3692
- "empty-state-action-route": e.query ? void 0 : e.emptyStateOptions.ctaPath,
3693
- "empty-state-icon-variant": e.query ? "search" : "kong",
3694
- "empty-state-message": e.query ? $(r)("baseTable.emptyState.noSearchResultsMessage") : e.emptyStateOptions.message,
3695
- "empty-state-title": e.query ? $(r)("baseTable.emptyState.noSearchResultsTitle") : e.emptyStateOptions.title,
3696
- error: o.value.hasError,
3697
- "error-state-message": o.value.message,
3698
- "error-state-title": o.value.title,
3699
- fetcher: e.fetcher,
3700
- "fetcher-cache-key": String(e.fetcherCacheKey),
3701
- headers: s.value,
3702
- "hide-pagination": e.hidePagination,
3703
- "hide-pagination-when-optional": e.hidePaginationWhenOptional,
3704
- "hide-toolbar": e.hideToolbar ?? $(k),
3705
- "initial-fetcher-params": _.value,
3706
- loading: e.isLoading,
3707
- "pagination-attributes": O.value,
3708
- "resize-columns": "",
3709
- "row-attrs": l,
3710
- "row-key": e.rowKey,
3711
- "search-input": e.query,
3712
- "sort-handler-function": e.enableClientSort ? e.sortHandlerFunction : void 0,
3713
- sortable: !e.disableSorting,
3714
- "table-preferences": X.value,
3715
- onEmptyStateActionClick: g,
3716
- "onRow:click": x.value,
3717
- onSort: v[0] || (v[0] = (J) => y(J)),
3718
- onState: p,
3719
- "onUpdate:tablePreferences": A
3720
- }, Se({
3721
- toolbar: w(() => [
3722
- R("div", Xo, [
3723
- D(f.$slots, "toolbar-filter", {}, void 0, !0),
3724
- f.$slots["toolbar-button"] ? (m(), S("div", el, [
3725
- D(f.$slots, "toolbar-button", {}, void 0, !0)
3726
- ])) : N("", !0)
3727
- ])
3728
- ]),
3729
- "action-items": w(({ row: J }) => [
3730
- D(f.$slots, "actions", { row: J }, void 0, !0)
3731
- ]),
3732
- _: 2
3733
- }, [
3734
- f.$slots["empty-state"] ? {
3735
- name: "empty-state",
3736
- fn: w(() => [
3737
- D(f.$slots, "empty-state", {}, void 0, !0)
3738
- ]),
3739
- key: "0"
3740
- } : void 0,
3741
- ce(e.tableHeaders, (J, I) => ({
3742
- name: I,
3743
- fn: w(({ row: B, rowValue: G }) => [
3744
- M(Zo, {
3745
- "key-name": String(I),
3746
- "row-el": d(B),
3747
- tooltip: J.tooltip
3748
- }, {
3749
- default: w(() => [
3750
- D(f.$slots, I, {
3751
- row: B,
3752
- rowKey: e.rowKey,
3753
- rowValue: G
3754
- }, () => [
3755
- q(L(G), 1)
3756
- ], !0)
3757
- ]),
3758
- _: 2
3759
- }, 1032, ["key-name", "row-el", "tooltip"])
3760
- ])
3761
- })),
3762
- e.query ? void 0 : {
3763
- name: "empty-state-action-icon",
3764
- fn: w(() => [
3765
- M($(Yt))
3766
- ]),
3767
- key: "1"
3768
- }
3769
- ]), 1032, ["cache-identifier", "client-sort", "empty-state-action-message", "empty-state-action-route", "empty-state-icon-variant", "empty-state-message", "empty-state-title", "error", "error-state-message", "error-state-title", "fetcher", "fetcher-cache-key", "headers", "hide-pagination", "hide-pagination-when-optional", "hide-toolbar", "initial-fetcher-params", "loading", "pagination-attributes", "row-key", "search-input", "sort-handler-function", "sortable", "table-preferences", "onRow:click"]),
3770
- f.$slots["outside-actions"] && $(k) ? (m(), S("div", tl, [
3771
- D(f.$slots, "outside-actions", {}, void 0, !0)
3772
- ])) : N("", !0)
3773
- ]),
3774
- _: 3
3775
- }, 8, ["title", "title-tag"]);
3776
- };
3777
- }
3778
- }), hs = /* @__PURE__ */ se(nl, [["__scopeId", "data-v-44153100"]]), il = {
3779
- key: 0,
3780
- class: "kong-ui-entity-delete-error"
3781
- }, rl = {
3782
- key: 1,
3783
- class: "description"
3784
- }, al = /* @__PURE__ */ z({
3785
- __name: "EntityDeleteModal",
3786
- props: {
3787
- visible: {
3788
- type: Boolean,
3789
- required: !0,
3790
- default: !1
3791
- },
3792
- title: {
3793
- type: String,
3794
- default: "Delete"
3795
- },
3796
- entityType: {
3797
- type: String,
3798
- required: !0
3799
- },
3800
- entityName: {
3801
- type: String,
3802
- default: ""
3803
- },
3804
- needConfirm: {
3805
- type: Boolean,
3806
- default: !0
3807
- },
3808
- description: {
3809
- type: String,
3810
- default: ""
3811
- },
3812
- actionPending: {
3813
- type: Boolean,
3814
- default: !1
3815
- },
3816
- error: {
3817
- type: String,
3818
- default: ""
3819
- }
3820
- },
3821
- emits: ["cancel", "proceed"],
3822
- setup(e, { emit: t }) {
3823
- const { i18nT: n } = Y.useI18n(), i = e, r = t, o = F(() => i.needConfirm ? i.entityName : ""), a = () => {
3824
- r("cancel");
3825
- }, s = () => {
3826
- r("proceed");
3827
- };
3828
- return (l, c) => {
3829
- const d = P("KAlert"), u = P("KPrompt");
3830
- return m(), j(u, {
3831
- "action-button-appearance": "danger",
3832
- "action-button-disabled": e.actionPending,
3833
- "action-button-text": "Yes, delete",
3834
- class: "kong-ui-entity-delete-modal",
3835
- "confirmation-text": o.value,
3836
- title: e.title,
3837
- visible: e.visible,
3838
- onCancel: a,
3839
- onProceed: s
3840
- }, {
3841
- default: w(() => [
3842
- e.error ? (m(), S("div", il, [
3843
- M(d, { appearance: "danger" }, {
3844
- default: w(() => [
3845
- q(L(e.error), 1)
3846
- ]),
3847
- _: 1
3848
- })
3849
- ])) : N("", !0),
3850
- M($(n), {
3851
- class: "message",
3852
- keypath: i.entityName ? "deleteModal.messageWithName" : "deleteModal.message",
3853
- tag: "p"
3854
- }, Se({
3855
- entityType: w(() => [
3856
- q(L(i.entityType), 1)
3857
- ]),
3858
- _: 2
3859
- }, [
3860
- i.entityName ? {
3861
- name: "entityName",
3862
- fn: w(() => [
3863
- R("strong", null, L(i.entityName), 1)
3864
- ]),
3865
- key: "0"
3866
- } : void 0
3867
- ]), 1032, ["keypath"]),
3868
- i.description || l.$slots.description ? (m(), S("div", rl, [
3869
- D(l.$slots, "description", {}, () => [
3870
- R("p", null, L(i.description), 1)
3871
- ], !0)
3872
- ])) : N("", !0)
3873
- ]),
3874
- _: 3
3875
- }, 8, ["action-button-disabled", "confirmation-text", "title", "visible"]);
3876
- };
3877
- }
3878
- }), gs = /* @__PURE__ */ se(al, [["__scopeId", "data-v-4361d622"]]), ol = {
3879
- fill: "none",
3880
- height: "20",
3881
- viewBox: "0 0 20 20",
3882
- width: "20",
3883
- xmlns: "http://www.w3.org/2000/svg"
3884
- }, ll = {
3885
- id: "mask0_180_20349",
3886
- height: "20",
3887
- maskUnits: "userSpaceOnUse",
3888
- style: { "mask-type": "alpha" },
3889
- width: "20",
3890
- x: "0",
3891
- y: "0"
3892
- }, sl = ["fill"], cl = { mask: "url(#mask0_180_20349)" }, ul = ["fill"], Mt = /* @__PURE__ */ z({
3893
- __name: "IconFilter",
3894
- props: {
3895
- color: {
3896
- type: String,
3897
- default: `var(--kong-ui-entity-filter-color, ${Ji})`
3898
- }
3899
- },
3900
- setup(e) {
3901
- return (t, n) => (m(), S("svg", ol, [
3902
- R("mask", ll, [
3903
- R("rect", {
3904
- fill: e.color,
3905
- height: "20",
3906
- width: "20"
3907
- }, null, 8, sl)
3908
- ]),
3909
- R("g", cl, [
3910
- R("path", {
3911
- d: "M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",
3912
- fill: e.color
3913
- }, null, 8, ul)
3914
- ])
3915
- ]));
3916
- }
3917
- }), dl = {
3918
- key: 1,
3919
- class: "kong-ui-entity-filter"
3920
- }, fl = { class: "kong-ui-entity-filter-menu" }, pl = ["data-testid"], ml = ["onClick", "onKeydown"], hl = { class: "menu-item-indicator" }, gl = { class: "menu-item-body" }, yl = ["for"], vl = { class: "menu-item-buttons" }, bl = { class: "filter-clear-button-container" }, xl = /* @__PURE__ */ z({
3921
- __name: "EntityFilter",
3922
- props: {
3923
- // filter config, either exact match or fuzzy match
3924
- config: {
3925
- type: Object,
3926
- required: !0,
3927
- default: () => ({
3928
- isExactMatch: !0,
3929
- placeholder: ""
3930
- })
3931
- },
3932
- // query string
3933
- modelValue: {
3934
- type: String,
3935
- required: !0
3936
- }
3937
- },
3938
- emits: ["update:modelValue"],
3939
- setup(e, { emit: t }) {
3940
- const { i18n: { t: n } } = Y.useI18n(), i = e, r = t, o = K(!1), a = K({}), s = K(/* @__PURE__ */ new Set()), l = F(() => {
3941
- const _ = [];
3942
- return new URLSearchParams(i.modelValue).forEach((A, O) => {
3943
- A !== "" && _.push(O);
3944
- }), _;
3945
- }), c = F(() => {
3946
- const _ = i.config.fields;
3947
- return Object.keys(_).filter((A) => {
3948
- var O;
3949
- return (O = _ == null ? void 0 : _[A]) == null ? void 0 : O.searchable;
3950
- }).map((A) => ({
3951
- label: _[A].label || A,
3952
- value: A,
3953
- expanded: !1
3954
- }));
3955
- });
3956
- be(() => i.modelValue, (_) => {
3957
- a.value = {}, new URLSearchParams(_).forEach((A, O) => {
3958
- a.value[O] = A;
3959
- });
3960
- });
3961
- const d = () => {
3962
- o.value = !o.value;
3963
- }, u = (_) => {
3964
- s.value.has(_) ? s.value.delete(_) : s.value.add(_);
3965
- }, p = (_) => {
3966
- r("update:modelValue", _);
3967
- }, g = () => {
3968
- p("");
3969
- }, h = (_) => `filter-${_}`, x = (_) => {
3970
- var A, O;
3971
- return (((O = (A = i.config.schema) == null ? void 0 : A[_]) == null ? void 0 : O.values) ?? []).map((f) => typeof f == "string" ? { value: f, label: f } : f);
3972
- }, y = (_) => {
3973
- var A, O;
3974
- return ((O = (A = i.config.schema) == null ? void 0 : A[_]) == null ? void 0 : O.type) ?? "text";
3975
- }, k = (_) => {
3976
- a.value = {
3977
- ...a.value,
3978
- [_]: ""
3979
- }, T();
3980
- }, C = () => {
3981
- a.value = {}, T(!0);
3982
- }, T = (_ = !1) => {
3983
- const A = Object.keys(a.value).reduce((O, f) => (a.value[f] && (O[f] = `${a.value[f]}`), O), {});
3984
- _ && (o.value = !1), r("update:modelValue", new URLSearchParams(A).toString());
3985
- }, W = (_) => {
3986
- var A, O;
3987
- return !!((O = (A = i.config.schema) == null ? void 0 : A[_]) != null && O.filterFunction);
3988
- }, X = (_, A) => {
3989
- var f;
3990
- const O = (f = i.config.schema) == null ? void 0 : f[_];
3991
- return (O == null ? void 0 : O.filterFunction) === void 0 ? !0 : O.filterFunction(A);
3992
- };
3993
- return (_, A) => {
3994
- const O = P("KInput"), f = P("KButton"), v = P("KSelect");
3995
- return e.config.isExactMatch ? (m(), j(O, {
3996
- key: 0,
3997
- autocomplete: "off",
3998
- class: "kong-ui-entity-filter-input",
3999
- "data-testid": "search-input",
4000
- "model-value": e.modelValue,
4001
- placeholder: e.config.placeholder,
4002
- "onUpdate:modelValue": p
4003
- }, {
4004
- before: w(() => [
4005
- M(Mt)
4006
- ]),
4007
- after: w(() => [
4008
- xe(M($(ii), {
4009
- class: "kong-ui-entity-filter-clear",
4010
- role: "button",
4011
- tabindex: "0",
4012
- onClick: g
4013
- }, null, 512), [
4014
- [Ce, e.modelValue !== ""]
4015
- ])
4016
- ]),
4017
- _: 1
4018
- }, 8, ["model-value", "placeholder"])) : (m(), S("div", dl, [
4019
- M(f, {
4020
- appearance: "tertiary",
4021
- "data-testid": "filter-button",
4022
- onClick: d
4023
- }, {
4024
- default: w(() => [
4025
- M(Mt),
4026
- q(" " + L($(n)("filter.filterButtonText")) + " " + L(l.value.length > 0 ? `(${l.value.length})` : ""), 1)
4027
- ]),
4028
- _: 1
4029
- }),
4030
- xe(R("div", {
4031
- class: "kong-ui-entity-filter-backdrop",
4032
- onClick: d
4033
- }, null, 512), [
4034
- [Ce, o.value]
4035
- ]),
4036
- xe(R("div", fl, [
4037
- (m(!0), S(ue, null, ce(c.value, (b) => {
4038
- var H, J;
4039
- return m(), S("div", {
4040
- key: b.value,
4041
- class: "kong-ui-entity-filter-menu-item",
4042
- "data-testid": b.value
4043
- }, [
4044
- R("span", {
4045
- class: fe(["menu-item-title", { expanded: s.value.has(b.value) }]),
4046
- role: "button",
4047
- tabindex: "0",
4048
- onClick: (I) => u(b.value),
4049
- onKeydown: zn((I) => u(b.value), ["enter"])
4050
- }, [
4051
- q(L(b.label) + " ", 1),
4052
- xe(R("span", hl, null, 512), [
4053
- [Ce, l.value.includes(b.value)]
4054
- ]),
4055
- M($(ri), {
4056
- class: fe(["menu-item-expand-icon", { expanded: s.value.has(b.value) }]),
4057
- color: $(zi)
4058
- }, null, 8, ["class", "color"])
4059
- ], 42, ml),
4060
- xe(R("div", gl, [
4061
- R("label", {
4062
- class: "menu-item-label",
4063
- for: h(b.value)
4064
- }, L($(n)("filter.fieldLabel")), 9, yl),
4065
- ((J = (H = e.config.schema) == null ? void 0 : H[b.value]) == null ? void 0 : J.type) === "select" ? (m(), j(v, {
4066
- key: 0,
4067
- id: h(b.value),
4068
- modelValue: a.value[b.value],
4069
- "onUpdate:modelValue": (I) => a.value[b.value] = I,
4070
- "enable-filtering": W(b.value),
4071
- "filter-function": (I) => X(b.value, I),
4072
- items: x(b.value),
4073
- placeholder: $(n)("filter.selectPlaceholder")
4074
- }, null, 8, ["id", "modelValue", "onUpdate:modelValue", "enable-filtering", "filter-function", "items", "placeholder"])) : (m(), j(O, {
4075
- key: 1,
4076
- id: h(b.value),
4077
- modelValue: a.value[b.value],
4078
- "onUpdate:modelValue": (I) => a.value[b.value] = I,
4079
- autocomplete: "off",
4080
- placeholder: $(n)("filter.inputPlaceholder"),
4081
- type: y(b.value)
4082
- }, null, 8, ["id", "modelValue", "onUpdate:modelValue", "placeholder", "type"]))
4083
- ], 512), [
4084
- [Ce, s.value.has(b.value)]
4085
- ]),
4086
- xe(R("div", vl, [
4087
- M(f, {
4088
- appearance: "tertiary",
4089
- "data-testid": "apply-filter",
4090
- size: "small",
4091
- onClick: A[0] || (A[0] = (I) => T(!0))
4092
- }, {
4093
- default: w(() => [
4094
- q(L($(n)("filter.applyButtonText")), 1)
4095
- ]),
4096
- _: 1
4097
- }),
4098
- M(f, {
4099
- appearance: "tertiary",
4100
- "data-testid": "clear-filter",
4101
- size: "small",
4102
- onClick: (I) => k(b.value)
4103
- }, {
4104
- default: w(() => [
4105
- q(L($(n)("filter.clearButtonText")), 1)
4106
- ]),
4107
- _: 1
4108
- }, 8, ["onClick"])
4109
- ], 512), [
4110
- [Ce, s.value.has(b.value)]
4111
- ])
4112
- ], 8, pl);
4113
- }), 128)),
4114
- R("div", bl, [
4115
- M(f, {
4116
- appearance: "tertiary",
4117
- size: "small",
4118
- onClick: C
4119
- }, {
4120
- default: w(() => [
4121
- q(L($(n)("filter.clearAllButtonText")), 1)
4122
- ]),
4123
- _: 1
4124
- })
4125
- ])
4126
- ], 512), [
4127
- [Ce, o.value]
4128
- ])
4129
- ]));
4130
- };
4131
- }
4132
- }), ys = /* @__PURE__ */ se(xl, [["__scopeId", "data-v-084f7978"]]), vs = /* @__PURE__ */ z({
4133
- __name: "EntityToggleModal",
4134
- props: {
4135
- visible: {
4136
- type: Boolean,
4137
- required: !0
4138
- },
4139
- action: {
4140
- type: String,
4141
- // 'enable' | 'disable'
4142
- required: !0
4143
- },
4144
- entityId: {
4145
- type: String,
4146
- required: !0
4147
- },
4148
- entityType: {
4149
- type: String,
4150
- required: !0
4151
- },
4152
- entityName: {
4153
- type: String,
4154
- required: !0
4155
- },
4156
- onConfirm: {
4157
- type: Function,
4158
- required: !1,
4159
- default: null
4160
- }
4161
- },
4162
- emits: ["cancel", "proceed"],
4163
- setup(e, { emit: t }) {
4164
- const { i18n: { t: n }, i18nT: i } = Y.useI18n(), r = e, o = t, a = K(!1), s = F(
4165
- () => r.action === "enable" ? n("toggleModal.enable.title", { entityType: r.entityType }) : n("toggleModal.disable.title", { entityType: r.entityType })
4166
- ), l = F(
4167
- () => r.action === "enable" ? n("toggleModal.enable.confirmText") : n("toggleModal.disable.confirmText")
4168
- ), c = () => o("cancel"), d = async () => {
4169
- if (r.onConfirm) {
4170
- a.value = !0;
4171
- try {
4172
- await r.onConfirm(), o("proceed");
4173
- } catch (u) {
4174
- console.error(u);
4175
- } finally {
4176
- a.value = !1;
4177
- }
4178
- }
4179
- };
4180
- return (u, p) => {
4181
- const g = P("KPrompt");
4182
- return m(), j(Ht, { to: "body" }, [
4183
- M(g, {
4184
- "action-button-disabled": a.value,
4185
- "action-button-text": l.value,
4186
- "data-testid": `${e.entityType}-${e.entityId}-toggle-prompt`,
4187
- title: s.value,
4188
- visible: e.visible,
4189
- onCancel: c,
4190
- onProceed: d
4191
- }, {
4192
- default: w(() => [
4193
- M($(i), {
4194
- keypath: `toggleModal.${r.action}.message`,
4195
- scope: "global"
4196
- }, {
4197
- entityType: w(() => [
4198
- q(L(e.entityType), 1)
4199
- ]),
4200
- entityName: w(() => [
4201
- R("strong", null, L(e.entityName), 1)
4202
- ]),
4203
- _: 1
4204
- }, 8, ["keypath"])
4205
- ]),
4206
- _: 1
4207
- }, 8, ["action-button-disabled", "action-button-text", "data-testid", "title", "visible"])
4208
- ]);
4209
- };
4210
- }
4211
- }), bs = /* @__PURE__ */ z({
4212
- __name: "PermissionsWrapper",
4213
- props: {
4214
- /**
4215
- * Provide an async function that returns a boolean to determine whether
4216
- * the wrapper should hide or show the default slot content.
4217
- */
4218
- authFunction: {
4219
- type: Function,
4220
- required: !0,
4221
- default: async () => !0
4222
- },
4223
- /**
4224
- * Should the default slot content be shown once the authFunction is evaluated no matter what?
4225
- * e.g. if you want to display the item but disable it.
4226
- */
4227
- forceShow: {
4228
- type: Boolean,
4229
- default: !1
4230
- }
4231
- },
4232
- setup(e) {
4233
- const t = e, n = K(void 0), i = F(() => n.value === !0 || n.value !== void 0 && t.forceShow === !0);
4234
- return be(() => t.authFunction, async () => {
4235
- n.value = await t.authFunction();
4236
- }, { immediate: !0 }), (r, o) => i.value ? D(r.$slots, "default", {
4237
- key: 0,
4238
- isAllowed: n.value
4239
- }) : N("", !0);
4240
- }
4241
- }), te = [];
4242
- for (let e = 0; e < 256; ++e)
4243
- te.push((e + 256).toString(16).slice(1));
4244
- function Cl(e, t = 0) {
4245
- return (te[e[t + 0]] + te[e[t + 1]] + te[e[t + 2]] + te[e[t + 3]] + "-" + te[e[t + 4]] + te[e[t + 5]] + "-" + te[e[t + 6]] + te[e[t + 7]] + "-" + te[e[t + 8]] + te[e[t + 9]] + "-" + te[e[t + 10]] + te[e[t + 11]] + te[e[t + 12]] + te[e[t + 13]] + te[e[t + 14]] + te[e[t + 15]]).toLowerCase();
4246
- }
4247
- let Je;
4248
- const kl = new Uint8Array(16);
4249
- function Al() {
4250
- if (!Je) {
4251
- if (typeof crypto > "u" || !crypto.getRandomValues)
4252
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
4253
- Je = crypto.getRandomValues.bind(crypto);
4254
- }
4255
- return Je(kl);
4256
- }
4257
- const _l = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), jt = { randomUUID: _l };
4258
- function wl(e, t, n) {
4259
- var r;
4260
- if (jt.randomUUID && !e)
4261
- return jt.randomUUID();
4262
- e = e || {};
4263
- const i = e.random ?? ((r = e.rng) == null ? void 0 : r.call(e)) ?? Al();
4264
- if (i.length < 16)
4265
- throw new Error("Random bytes length must be >= 16");
4266
- return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Cl(i);
4267
- }
4268
- const Sl = ["aria-labelledby"], $l = { class: "form-section-wrapper" }, Tl = {
4269
- key: 1,
4270
- class: "form-section-description"
4271
- }, Il = {
4272
- key: 2,
4273
- class: "form-section-footer"
4274
- }, El = { class: "form-section-content" }, Fl = /* @__PURE__ */ z({
4275
- __name: "EntityFormSection",
4276
- props: {
4277
- title: {
4278
- type: String,
4279
- default: ""
4280
- },
4281
- description: {
4282
- type: String,
4283
- default: ""
4284
- },
4285
- hasDivider: {
4286
- type: Boolean,
4287
- default: !1
4288
- },
4289
- stickyInfoHeader: {
4290
- type: Boolean,
4291
- default: !0
4292
- },
4293
- hideInfoHeader: {
4294
- type: Boolean,
4295
- default: !1
4296
- },
4297
- titleTag: {
4298
- type: String,
4299
- default: "h2"
4300
- }
4301
- },
4302
- setup(e) {
4303
- const t = De(), n = wl();
4304
- return (i, r) => (m(), S("div", {
4305
- "aria-labelledby": e.title ? $(n) : void 0,
4306
- class: fe(["kong-ui-entity-form-section", { "has-divider": e.hasDivider }]),
4307
- role: "group"
4308
- }, [
4309
- R("div", $l, [
4310
- e.hideInfoHeader ? N("", !0) : (m(), S("div", {
4311
- key: 0,
4312
- class: fe(["form-section-info", { sticky: e.stickyInfoHeader }])
4313
- }, [
4314
- e.title ? (m(), j(je(e.titleTag), {
4315
- key: 0,
4316
- id: $(n),
4317
- class: "form-section-title"
4318
- }, {
4319
- default: w(() => [
4320
- q(L(e.title), 1)
4321
- ]),
4322
- _: 1
4323
- }, 8, ["id"])) : N("", !0),
4324
- e.description || $(t).description ? (m(), S("div", Tl, [
4325
- D(i.$slots, "description", {}, () => [
4326
- R("p", null, L(e.description), 1)
4327
- ], !0)
4328
- ])) : N("", !0),
4329
- $(t).footer ? (m(), S("div", Il, [
4330
- D(i.$slots, "footer", {}, void 0, !0)
4331
- ])) : N("", !0)
4332
- ], 2)),
4333
- R("div", El, [
4334
- D(i.$slots, "default", {}, void 0, !0)
4335
- ])
4336
- ])
4337
- ], 10, Sl));
4338
- }
4339
- }), xs = /* @__PURE__ */ se(Fl, [["__scopeId", "data-v-b1f74200"]]), Ol = { class: "ff-form-section" }, Ll = { class: "header" }, Bl = {
4340
- key: 0,
4341
- class: "step"
4342
- }, Rl = { class: "header-content" }, Kl = { class: "header-title" }, Nl = {
4343
- key: 0,
4344
- class: "header-description"
4345
- }, Ml = {
4346
- key: 1,
4347
- class: "header-extra"
4348
- }, jl = { class: "content" }, Dl = /* @__PURE__ */ z({
4349
- __name: "EntityFormBlock",
4350
- props: {
4351
- step: {},
4352
- title: { default: "" },
4353
- description: { default: "" }
4354
- },
4355
- setup(e) {
4356
- const t = De();
4357
- return (n, i) => (m(), S("div", Ol, [
4358
- R("header", Ll, [
4359
- e.step != null ? (m(), S("div", Bl, L(e.step), 1)) : N("", !0),
4360
- R("div", Rl, [
4361
- R("h2", Kl, [
4362
- D(n.$slots, "title", {}, () => [
4363
- q(L(e.title), 1)
4364
- ], !0)
4365
- ]),
4366
- e.description || t.description ? (m(), S("div", Nl, [
4367
- D(n.$slots, "description", {}, () => [
4368
- q(L(e.description), 1)
4369
- ], !0)
4370
- ])) : N("", !0)
4371
- ]),
4372
- t.extra ? (m(), S("div", Ml, [
4373
- D(n.$slots, "extra", {}, void 0, !0)
4374
- ])) : N("", !0)
4375
- ]),
4376
- R("div", jl, [
4377
- D(n.$slots, "default", {}, void 0, !0)
4378
- ])
4379
- ]));
4380
- }
4381
- }), Cs = /* @__PURE__ */ se(Dl, [["__scopeId", "data-v-cb6d2e95"]]), Pl = {
4382
- class: "kong-ui-public-entity-link",
4383
- "data-testid": "entity-link-parent"
4384
- }, Ul = {
4385
- key: 0,
4386
- class: "deleted-entity"
4387
- }, ql = { key: 1 }, Hl = ["onClick"], Vl = /* @__PURE__ */ z({
4388
- __name: "EntityLink",
4389
- props: {
4390
- entityLinkData: {
4391
- type: Object,
4392
- required: !0
4393
- },
4394
- externalLink: {
4395
- type: String,
4396
- required: !1,
4397
- default: ""
4398
- },
4399
- newWindow: {
4400
- type: Boolean,
4401
- required: !1,
4402
- default: !1
4403
- },
4404
- allowCopy: {
4405
- type: Boolean,
4406
- required: !1,
4407
- default: !1
4408
- }
4409
- },
4410
- setup(e) {
4411
- const t = e, n = K(), { isTruncated: i } = Y.useTruncationDetector(n), { i18n: { t: r } } = Y.useI18n(), o = r("global.actions.copyId"), a = K(o), s = F(() => t.entityLinkData.deleted ?? !1), l = F(() => {
4412
- var u;
4413
- return (u = t.entityLinkData.id) != null && u.toString().includes(":") ? t.entityLinkData.id.toString().split(":")[1] : t.entityLinkData.id;
4414
- }), c = F(() => {
4415
- var u;
4416
- return `${(u = l.value) == null ? void 0 : u.toString().slice(0, 5)} (deleted)`;
4417
- }), d = async (u) => {
4418
- await u(l.value || "") && (a.value = r("global.actions.copyToClipboard"), setTimeout(() => {
4419
- a.value = o;
4420
- }, 1800));
4421
- };
4422
- return (u, p) => {
4423
- const g = P("KTooltip"), h = P("KExternalLink"), x = P("KClipboardProvider");
4424
- return m(), S("div", Pl, [
4425
- s.value ? (m(), S("div", Ul, L(c.value), 1)) : l.value ? l.value ? (m(), j(h, {
4426
- key: 2,
4427
- class: "entity-link",
4428
- "hide-icon": !e.newWindow,
4429
- href: e.externalLink,
4430
- target: e.newWindow ? "_blank" : "_self"
4431
- }, {
4432
- default: w(() => [
4433
- M(g, {
4434
- text: $(i) && e.entityLinkData.label || ""
4435
- }, {
4436
- default: w(() => [
4437
- R("span", {
4438
- ref_key: "textContent",
4439
- ref: n,
4440
- class: "entity-link-label"
4441
- }, L(e.entityLinkData.label), 513)
4442
- ]),
4443
- _: 1
4444
- }, 8, ["text"])
4445
- ]),
4446
- _: 1
4447
- }, 8, ["hide-icon", "href", "target"])) : N("", !0) : (m(), S("div", ql, L(" – "))),
4448
- l.value && e.allowCopy ? (m(), j(g, {
4449
- key: a.value,
4450
- class: "copy-uuid-tooltip",
4451
- "max-width": "160",
4452
- placement: "bottom-end",
4453
- text: a.value
4454
- }, {
4455
- default: w(() => [
4456
- M(x, null, {
4457
- default: w(({ copyToClipboard: y }) => [
4458
- R("span", {
4459
- class: "entity-link-copy-id",
4460
- onClick: Le((k) => d(y), ["stop"])
4461
- }, [
4462
- M($(ai), {
4463
- class: "copy-icon",
4464
- color: $(Qi),
4465
- "data-testid": "copy-id",
4466
- size: $(Xi)
4467
- }, null, 8, ["color", "size"])
4468
- ], 8, Hl)
4469
- ]),
4470
- _: 1
4471
- })
4472
- ]),
4473
- _: 1
4474
- }, 8, ["text"])) : N("", !0)
4475
- ]);
4476
- };
4477
- }
4478
- }), ks = /* @__PURE__ */ se(Vl, [["__scopeId", "data-v-96efdfa5"]]), Yl = { class: "kong-ui-public-entity-empty-state" }, Wl = { class: "entity-empty-state-content" }, Jl = {
4479
- key: 0,
4480
- class: "empty-state-image"
4481
- }, Gl = {
4482
- key: 1,
4483
- class: "entity-empty-state-title"
4484
- }, zl = {
4485
- key: 2,
4486
- class: "entity-empty-state-description"
4487
- }, Ql = {
4488
- key: 3,
4489
- class: "entity-empty-state-pricing"
4490
- }, Zl = {
4491
- key: 0,
4492
- class: "entity-empty-state-message"
4493
- }, Xl = {
4494
- key: 1,
4495
- class: "entity-empty-state-action"
4496
- }, es = {
4497
- key: 2,
4498
- class: "entity-empty-state-card-container"
4499
- }, ts = {
4500
- key: 0,
4501
- class: "feature-icon"
4502
- }, ns = { class: "card-header" }, is = ["title"], rs = {
4503
- key: 3,
4504
- class: "entity-empty-state-bottom-container"
4505
- }, as = /* @__PURE__ */ z({
4506
- __name: "EntityEmptyState",
4507
- props: {
4508
- appearance: {
4509
- type: String,
4510
- default: () => "primary",
4511
- validator: (e) => ht.includes(e)
4512
- },
4513
- title: {
4514
- type: String,
4515
- default: ""
4516
- },
4517
- description: {
4518
- type: String,
4519
- default: ""
4520
- },
4521
- pricing: {
4522
- type: String,
4523
- default: ""
4524
- },
4525
- /** A synchronous or asynchronous function, that returns a boolean, that evaluates if the user can create a new entity */
4526
- canCreate: {
4527
- type: Function,
4528
- required: !1,
4529
- default: async () => !0
4530
- },
4531
- actionButtonText: {
4532
- type: String,
4533
- default: ""
4534
- },
4535
- learnMore: {
4536
- type: Boolean,
4537
- default: !1
4538
- },
4539
- features: {
4540
- type: Array,
4541
- default: () => []
4542
- }
4543
- },
4544
- emits: ["click:create", "click:learn-more"],
4545
- setup(e) {
4546
- const t = e, { i18n: { t: n } } = Y.useI18n(), i = K(!1), r = F(() => i.value && !!t.actionButtonText), o = F(() => ht.includes(t.appearance) ? t.appearance : ["primary", t.appearance]);
4547
- return nt(async () => {
4548
- i.value = await t.canCreate();
4549
- }), tt(() => Qn(`EntityEmptyState is deprecated and will be removed in future releases. Please use the KEmptyState component instead.
4550
- Docs: https://kongponents.konghq.com/components/empty-state.html.`)), (a, s) => {
4551
- const l = P("KCard");
4552
- return m(), S("div", Yl, [
4553
- R("div", Wl, [
4554
- a.$slots.image ? (m(), S("div", Jl, [
4555
- D(a.$slots, "image", {}, void 0, !0)
4556
- ])) : N("", !0),
4557
- e.title || a.$slots.title ? (m(), S("div", Gl, [
4558
- R("h1", {
4559
- class: fe(o.value)
4560
- }, [
4561
- D(a.$slots, "title", {}, () => [
4562
- q(L(e.title), 1)
4563
- ], !0)
4564
- ], 2)
4565
- ])) : N("", !0),
4566
- e.description || a.$slots.default ? (m(), S("div", zl, [
4567
- D(a.$slots, "default", {}, () => [
4568
- R("p", null, L(e.description), 1)
4569
- ], !0)
4570
- ])) : N("", !0),
4571
- e.pricing || a.$slots.pricing ? (m(), S("div", Ql, [
4572
- R("p", null, [
4573
- R("b", null, L($(n)("emptyState.pricingTitle")), 1),
4574
- s[2] || (s[2] = q()),
4575
- D(a.$slots, "pricing", {}, () => [
4576
- q(L(e.pricing), 1)
4577
- ], !0)
4578
- ])
4579
- ])) : N("", !0)
4580
- ]),
4581
- a.$slots.message ? (m(), S("div", Zl, [
4582
- D(a.$slots, "message", {}, void 0, !0)
4583
- ])) : N("", !0),
4584
- r.value || e.learnMore || a.$slots.actions ? (m(), S("div", Xl, [
4585
- D(a.$slots, "actions", {}, () => [
4586
- r.value ? (m(), j($(mt), {
4587
- key: 0,
4588
- appearance: "primary",
4589
- "data-testid": "entity-create-button",
4590
- size: e.appearance === "secondary" ? "medium" : "large",
4591
- onClick: s[0] || (s[0] = (c) => a.$emit("click:create"))
4592
- }, {
4593
- default: w(() => [
4594
- M($(Yt)),
4595
- q(" " + L(e.actionButtonText), 1)
4596
- ]),
4597
- _: 1
4598
- }, 8, ["size"])) : N("", !0),
4599
- e.learnMore ? (m(), j($(mt), {
4600
- key: 1,
4601
- appearance: "secondary",
4602
- "data-testid": "entity-learn-more-button",
4603
- size: e.appearance === "secondary" ? "medium" : "large",
4604
- onClick: s[1] || (s[1] = (c) => a.$emit("click:learn-more"))
4605
- }, {
4606
- default: w(() => [
4607
- M($(Vt), { decorative: "" }),
4608
- q(" " + L($(n)("emptyState.learnMore")), 1)
4609
- ]),
4610
- _: 1
4611
- }, 8, ["size"])) : N("", !0)
4612
- ], !0)
4613
- ])) : N("", !0),
4614
- e.features.length ? (m(), S("div", es, [
4615
- (m(!0), S(ue, null, ce(e.features, (c, d) => (m(), j(l, {
4616
- key: c,
4617
- class: "entity-empty-state-card"
4618
- }, {
4619
- title: w(() => [
4620
- a.$slots[`feature-${d}-icon`] ? (m(), S("div", ts, [
4621
- D(a.$slots, `feature-${d}-icon`, {}, void 0, !0)
4622
- ])) : N("", !0),
4623
- R("div", ns, L(c.title), 1)
4624
- ]),
4625
- default: w(() => [
4626
- R("div", {
4627
- title: c.description
4628
- }, L(c.description), 9, is)
4629
- ]),
4630
- _: 2
4631
- }, 1024))), 128))
4632
- ])) : N("", !0),
4633
- a.$slots.bottom ? (m(), S("div", rs, [
4634
- D(a.$slots, "bottom", {}, void 0, !0)
4635
- ])) : N("", !0)
4636
- ]);
4637
- };
4638
- }
4639
- }), As = /* @__PURE__ */ se(as, [["__scopeId", "data-v-645aae54"]]), os = { key: 1 }, _s = /* @__PURE__ */ z({
4640
- __name: "TableTags",
4641
- props: {
4642
- /** The tags to display in the table */
4643
- tags: {
4644
- type: [Array, String],
4645
- default: () => []
4646
- },
4647
- tagMaxWidth: {
4648
- type: String,
4649
- default: void 0
4650
- }
4651
- },
4652
- setup(e) {
4653
- const t = e, n = F(() => {
4654
- if (Array.isArray(t.tags))
4655
- return t.tags;
4656
- if (typeof t.tags == "string")
4657
- try {
4658
- const i = JSON.parse(t.tags);
4659
- return Array.isArray(i) ? i : [];
4660
- } catch {
4661
- return [];
4662
- }
4663
- return [];
4664
- });
4665
- return (i, r) => {
4666
- var o;
4667
- return ((o = n.value) == null ? void 0 : o.length) > 0 ? (m(), j($(ti), { key: 0 }, {
4668
- default: w(() => [
4669
- (m(!0), S(ue, null, ce(n.value, (a) => (m(), j($(ni), {
4670
- key: a,
4671
- "max-width": e.tagMaxWidth,
4672
- onClick: r[0] || (r[0] = Le(() => {
4673
- }, ["stop"]))
4674
- }, {
4675
- default: w(() => [
4676
- q(L(a), 1)
4677
- ]),
4678
- _: 2
4679
- }, 1032, ["max-width"]))), 128))
4680
- ]),
4681
- _: 1
4682
- })) : (m(), S("span", os, "-"));
4683
- };
4684
- }
4685
- }), { useAxios: ws, useDeleteUrlBuilder: Ss, useErrors: $s, useExternalLinkCreator: Ts, useFetchUrlBuilder: Is, useFetcher: Es, useFetcherCacheKey: Fs, useDebouncedFilter: Os, useStringHelpers: Ls, useHelpers: Bs, useGatewayFeatureSupported: Rs, useTruncationDetector: Ks, useValidators: Ns, useSchemaProvider: Ms, useTableState: js } = Y;
4686
- export {
4687
- ht as Appearances,
4688
- Uo as ConfigCardDisplay,
4689
- Xt as ConfigCardItem,
4690
- ae as ConfigurationSchemaSection,
4691
- V as ConfigurationSchemaType,
4692
- ps as EntityBaseConfigCard,
4693
- ms as EntityBaseForm,
4694
- si as EntityBaseFormType,
4695
- hs as EntityBaseTable,
4696
- gs as EntityDeleteModal,
4697
- As as EntityEmptyState,
4698
- ys as EntityFilter,
4699
- Cs as EntityFormBlock,
4700
- xs as EntityFormSection,
4701
- ks as EntityLink,
4702
- vs as EntityToggleModal,
4703
- li as EntityTypes,
4704
- ci as EventGatewayTypesArray,
4705
- me as FetcherStatus,
4706
- Yi as InternalLinkItem,
4707
- en as JsonCodeBlock,
4708
- bs as PermissionsWrapper,
4709
- it as SupportedEntityType,
4710
- Pe as SupportedEntityTypesArray,
4711
- _s as TableTags,
4712
- Hn as TerraformCodeBlock,
4713
- qn as YamlCodeBlock,
4714
- ws as useAxios,
4715
- Os as useDebouncedFilter,
4716
- Ss as useDeleteUrlBuilder,
4717
- $s as useErrors,
4718
- Ts as useExternalLinkCreator,
4719
- Is as useFetchUrlBuilder,
4720
- Es as useFetcher,
4721
- Fs as useFetcherCacheKey,
4722
- Rs as useGatewayFeatureSupported,
4723
- Bs as useHelpers,
4724
- Ms as useSchemaProvider,
4725
- Ls as useStringHelpers,
4726
- js as useTableState,
4727
- Ks as useTruncationDetector,
4728
- Ns as useValidators
4729
- };