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