@kong-ui-public/entities-consumer-groups 3.9.3-pr.2163.5e2eba97d.0 → 3.9.3-pr.2179.e83bd6955.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.
@@ -1,9 +1,9 @@
1
- import { defineComponent as _e, ref as I, computed as _, watch as we, resolveComponent as Q, openBlock as A, createBlock as z, unref as s, withCtx as p, createElementVNode as F, toDisplayString as G, createVNode as g, createElementBlock as J, Fragment as Le, renderList as je, createCommentVNode as W, onBeforeMount as Ve, createSlots as ke, Teleport as Ge, createTextVNode as ue, reactive as Ae } from "vue";
2
- import { useRouter as Fe } from "vue-router";
3
- import { BookIcon as Te, AddIcon as Qe, TeamIcon as He } from "@kong/icons";
4
- import { createI18n as ze, i18nTComponent as Je } from "@kong-ui-public/i18n";
5
- import { useAxios as Ee, useDebouncedFilter as Be, useTableState as We, useFetcher as Xe, useDeleteUrlBuilder as Ze, FetcherStatus as Ye, EntityBaseTable as eo, EntityFilter as oo, PermissionsWrapper as he, TableTags as to, EntityEmptyState as so, EntityDeleteModal as ro, EntityTypes as no, useErrors as ao, useValidators as uo, EntityBaseFormType as Ie, EntityBaseForm as io, SupportedEntityType as Ke, EntityFormSection as Pe, EntityBaseConfigCard as lo } from "@kong-ui-public/entities-shared";
6
- const co = "#00abd2", mo = "24px", po = {
1
+ import { defineComponent as _e, ref as w, computed as k, watch as we, resolveComponent as L, openBlock as A, createBlock as ee, unref as s, withCtx as p, createElementVNode as K, toDisplayString as G, createVNode as f, createElementBlock as W, Fragment as Oe, renderList as qe, createCommentVNode as X, onBeforeMount as Te, createSlots as ke, Teleport as Ne, createTextVNode as ae, reactive as Se } from "vue";
2
+ import { useRouter as Pe } from "vue-router";
3
+ import { BookIcon as je, AddIcon as Le, TeamIcon as Qe } from "@kong/icons";
4
+ import { createI18n as He, i18nTComponent as ze } from "@kong-ui-public/i18n";
5
+ import { useAxios as $e, useDebouncedFilter as Ve, useTableState as Je, useFetcher as We, useDeleteUrlBuilder as Xe, FetcherStatus as Ze, EntityBaseTable as Ye, EntityFilter as eo, PermissionsWrapper as he, TableTags as oo, EntityEmptyState as to, EntityDeleteModal as so, EntityTypes as ro, useErrors as no, useValidators as ao, EntityBaseFormType as Ie, EntityBaseForm as uo, SupportedEntityType as Fe, EntityFormSection as Ae, EntityBaseConfigCard as io } from "@kong-ui-public/entities-shared";
6
+ const co = "#00abd2", lo = "24px", mo = {
7
7
  list: {
8
8
  table_headers: {
9
9
  name: "Name",
@@ -97,57 +97,57 @@ const co = "#00abd2", mo = "24px", po = {
97
97
  }
98
98
  }
99
99
  }
100
- }, go = {
101
- consumer_groups: po
100
+ }, po = {
101
+ consumer_groups: mo
102
102
  };
103
- function fo() {
104
- const e = ze("en-us", go);
103
+ function go() {
104
+ const e = He("en-us", po);
105
105
  return {
106
106
  i18n: e,
107
- i18nT: Je(e)
107
+ i18nT: ze(e)
108
108
  // Translation component <i18n-t>
109
109
  };
110
110
  }
111
111
  const be = {
112
- useI18n: fo
113
- }, q = "/v2/control-planes/{controlPlaneId}/core-entities", N = "/{workspace}", X = {
112
+ useI18n: go
113
+ }, O = "/v2/control-planes/{controlPlaneId}/core-entities", q = "/{workspace}", Z = {
114
114
  list: {
115
115
  konnect: {
116
- all: `${q}/consumer_groups`,
117
- forModal: `${q}/consumer_groups`,
118
- forConsumer: `${q}/consumers/{consumerId}/consumer_groups`,
119
- oneForConsumer: `${q}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
116
+ all: `${O}/consumer_groups`,
117
+ forModal: `${O}/consumer_groups`,
118
+ forConsumer: `${O}/consumers/{consumerId}/consumer_groups`,
119
+ oneForConsumer: `${O}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
120
120
  },
121
121
  kongManager: {
122
- all: `${N}/consumer_groups?counter=true`,
122
+ all: `${q}/consumer_groups?counter=true`,
123
123
  // we need counter=true to get consumers_count in consumer group list
124
- forModal: `${N}/consumer_groups`,
125
- forConsumer: `${N}/consumers/{consumerId}/consumer_groups`,
126
- oneForConsumer: `${N}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
124
+ forModal: `${q}/consumer_groups`,
125
+ forConsumer: `${q}/consumers/{consumerId}/consumer_groups`,
126
+ oneForConsumer: `${q}/consumers/{consumerId}/consumer_groups/{consumerGroupId}`
127
127
  }
128
128
  },
129
129
  form: {
130
130
  konnect: {
131
+ consumersList: `${O}/consumers`,
132
+ create: `${O}/consumer_groups`,
133
+ edit: `${O}/consumer_groups/{id}`,
134
+ addConsumer: `${O}/consumer_groups/{id}/consumers`,
135
+ removeConsumer: `${O}/consumer_groups/{id}/consumers/{consumerId}`,
136
+ getConsumers: `${O}/consumer_groups/{id}/consumers`
137
+ },
138
+ kongManager: {
131
139
  consumersList: `${q}/consumers`,
132
140
  create: `${q}/consumer_groups`,
133
141
  edit: `${q}/consumer_groups/{id}`,
134
142
  addConsumer: `${q}/consumer_groups/{id}/consumers`,
135
143
  removeConsumer: `${q}/consumer_groups/{id}/consumers/{consumerId}`,
136
144
  getConsumers: `${q}/consumer_groups/{id}/consumers`
137
- },
138
- kongManager: {
139
- consumersList: `${N}/consumers`,
140
- create: `${N}/consumer_groups`,
141
- edit: `${N}/consumer_groups/{id}`,
142
- addConsumer: `${N}/consumer_groups/{id}/consumers`,
143
- removeConsumer: `${N}/consumer_groups/{id}/consumers/{consumerId}`,
144
- getConsumers: `${N}/consumer_groups/{id}/consumers`
145
145
  }
146
146
  }
147
- }, yo = { class: "add-to-group-form-container" }, vo = { class: "add-to-group-cta-text" }, ho = {
147
+ }, fo = { class: "add-to-group-form-container" }, vo = { class: "add-to-group-cta-text" }, yo = {
148
148
  key: 0,
149
149
  class: "kong-ui-entity-add-to-groups-error"
150
- }, _o = { key: 0 }, bo = /* @__PURE__ */ _e({
150
+ }, ho = { key: 0 }, _o = /* @__PURE__ */ _e({
151
151
  __name: "AddToGroupModal",
152
152
  props: {
153
153
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -163,130 +163,130 @@ const be = {
163
163
  }
164
164
  },
165
165
  emits: ["cancel", "add:success", "add:partial-success", "error"],
166
- setup(e, { emit: L }) {
167
- var j;
168
- const { i18n: { t: a } } = be.useI18n(), t = e, v = L, { axiosInstance: i } = Ee((j = t.config) == null ? void 0 : j.axiosRequestConfig), n = I([]), {
169
- debouncedQueryChange: E,
170
- loading: ie,
166
+ setup(e, { emit: N }) {
167
+ var F;
168
+ const { i18n: { t: a } } = be.useI18n(), t = e, v = N, { axiosInstance: i } = $e((F = t.config) == null ? void 0 : F.axiosRequestConfig), n = w([]), {
169
+ debouncedQueryChange: x,
170
+ loading: ue,
171
171
  allRecords: D,
172
- error: le,
172
+ error: ie,
173
173
  loadItems: ce,
174
- results: Z
175
- } = Be(
174
+ results: Y
175
+ } = Ve(
176
176
  t.config,
177
- X.list[t.config.app].forModal,
177
+ Z.list[t.config.app].forModal,
178
178
  "",
179
179
  {
180
180
  fetchedItemsKey: "data",
181
181
  searchKeys: ["name", "id"]
182
182
  }
183
- ), V = _(() => le.value ? a("consumer_groups.errors.general") : ""), B = I(0), te = _(() => D.value === void 0), Y = _(() => Z.value.map((d) => ({
184
- label: d.name,
185
- value: d.id,
186
- selected: n.value.includes(d.id),
187
- data: d
183
+ ), P = k(() => ie.value ? a("consumer_groups.errors.general") : ""), U = w(0), oe = k(() => D.value === void 0), te = k(() => Y.value.map((m) => ({
184
+ label: m.name,
185
+ value: m.id,
186
+ selected: n.value.includes(m.id),
187
+ data: m
188
188
  // we need this to determine whether or not to show the description text
189
- }))), se = (d) => {
190
- var f;
191
- const k = te.value ? Z.value.find((b) => b.id === d) : (f = D.value) == null ? void 0 : f.find((b) => b.id === d);
192
- return k ? k.name : d;
193
- }, de = () => {
194
- x.value = "", R.value = [], M.value = [], v("cancel");
195
- }, R = I([]), $ = I(!1), x = I(""), me = async () => {
189
+ }))), se = (m) => {
190
+ var g;
191
+ const I = oe.value ? Y.value.find((C) => C.id === m) : (g = D.value) == null ? void 0 : g.find((C) => C.id === m);
192
+ return I ? I.name : m;
193
+ }, le = () => {
194
+ M.value = "", $.value = [], V.value = [], v("cancel");
195
+ }, $ = w([]), Q = w(!1), M = w(""), de = async () => {
196
196
  if (!n.value.length) {
197
- x.value = "", M.value = [], v("cancel");
197
+ M.value = "", V.value = [], v("cancel");
198
198
  return;
199
199
  }
200
- $.value = !0, x.value = "", R.value = [], M.value = [];
200
+ Q.value = !0, M.value = "", $.value = [], V.value = [];
201
201
  try {
202
- const d = n.value.map((b) => ge(b)), k = await Promise.allSettled(d);
203
- let f = !0;
204
- k.forEach((b) => {
205
- b.status !== "fulfilled" && (f = !1);
206
- }), f ? (R.value = [], M.value = [], v("add:success", n.value), n.value = []) : (R.value.length && v("add:partial-success", R.value), n.value = [], re(k));
202
+ const m = n.value.map((C) => j(C)), I = await Promise.allSettled(m);
203
+ let g = !0;
204
+ I.forEach((C) => {
205
+ C.status !== "fulfilled" && (g = !1);
206
+ }), g ? ($.value = [], V.value = [], v("add:success", n.value), n.value = []) : ($.value.length && v("add:partial-success", $.value), n.value = [], re(I));
207
207
  } catch {
208
- x.value = a("consumer_groups.errors.add"), v("error", x.value);
208
+ M.value = a("consumer_groups.errors.add"), v("error", M.value);
209
209
  } finally {
210
- $.value = !1;
210
+ Q.value = !1;
211
211
  }
212
- }, pe = _(() => {
213
- var k, f, b, O;
214
- let d = `${t.config.apiBaseUrl}${X.list[t.config.app].forConsumer}`;
215
- return t.config.app === "konnect" ? d = d.replace(/{controlPlaneId}/gi, ((k = t.config) == null ? void 0 : k.controlPlaneId) || "").replace(/{consumerId}/gi, ((f = t.config) == null ? void 0 : f.consumerId) || "") : t.config.app === "kongManager" && (d = d.replace(/\/{workspace}/gi, (b = t.config) != null && b.workspace ? `/${t.config.workspace}` : "").replace(/{consumerId}/gi, ((O = t.config) == null ? void 0 : O.consumerId) || "")), d;
216
- }), ge = async (d) => {
217
- const k = {
218
- group: d
212
+ }, me = k(() => {
213
+ var I, g, C, B;
214
+ let m = `${t.config.apiBaseUrl}${Z.list[t.config.app].forConsumer}`;
215
+ return t.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((I = t.config) == null ? void 0 : I.controlPlaneId) || "").replace(/{consumerId}/gi, ((g = t.config) == null ? void 0 : g.consumerId) || "") : t.config.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, (C = t.config) != null && C.workspace ? `/${t.config.workspace}` : "").replace(/{consumerId}/gi, ((B = t.config) == null ? void 0 : B.consumerId) || "")), m;
216
+ }), j = async (m) => {
217
+ const I = {
218
+ group: m
219
219
  };
220
220
  try {
221
- const f = await i.post(pe.value, k);
222
- return R.value.push(d), f;
223
- } catch (f) {
224
- let b = `${se(d)} - ${f.message}`;
225
- return f.response.status === 409 && (b = `${se(d)} - ${a("consumer_groups.errors.already_added")}`), Promise.reject(Error(b));
221
+ const g = await i.post(me.value, I);
222
+ return $.value.push(m), g;
223
+ } catch (g) {
224
+ let C = `${se(m)} - ${g.message}`;
225
+ return g.response.status === 409 && (C = `${se(m)} - ${a("consumer_groups.errors.already_added")}`), Promise.reject(Error(C));
226
226
  }
227
- }, M = I([]), re = (d) => {
228
- M.value = d.map((k) => {
229
- var f;
230
- return (f = k.reason) == null ? void 0 : f.message;
227
+ }, V = w([]), re = (m) => {
228
+ V.value = m.map((I) => {
229
+ var g;
230
+ return (g = I.reason) == null ? void 0 : g.message;
231
231
  }).filter(Boolean);
232
232
  };
233
- return we(Y, () => {
234
- B.value++;
233
+ return we(te, () => {
234
+ U.value++;
235
235
  }, { immediate: !0, deep: !0 }), we(() => t.visible, () => {
236
236
  t.visible && ce();
237
- }, { immediate: !0 }), (d, k) => {
238
- const f = Q("KMultiselect"), b = Q("KAlert"), O = Q("KPrompt");
239
- return A(), z(O, {
240
- "action-button-disabled": $.value,
237
+ }, { immediate: !0 }), (m, I) => {
238
+ const g = L("KMultiselect"), C = L("KAlert"), B = L("KPrompt");
239
+ return A(), ee(B, {
240
+ "action-button-disabled": Q.value,
241
241
  class: "kong-ui-entities-add-to-groups-modal",
242
242
  "data-testid": "add-to-group-modal",
243
243
  title: s(a)("consumer_groups.consumers.add.title"),
244
244
  visible: e.visible,
245
- onCancel: de,
246
- onProceed: me
245
+ onCancel: le,
246
+ onProceed: de
247
247
  }, {
248
248
  default: p(() => [
249
- F("div", yo, [
250
- F("p", vo, G(s(a)("consumer_groups.consumers.add.ctaText")), 1),
251
- g(f, {
249
+ K("div", fo, [
250
+ K("p", vo, G(s(a)("consumer_groups.consumers.add.ctaText")), 1),
251
+ f(g, {
252
252
  modelValue: n.value,
253
- "onUpdate:modelValue": k[0] || (k[0] = (ee) => n.value = ee),
253
+ "onUpdate:modelValue": I[0] || (I[0] = (T) => n.value = T),
254
254
  autosuggest: "",
255
255
  "data-testid": "add-to-groups-multiselect",
256
- "dropdown-footer-text": te.value ? s(a)("consumer_groups.consumers.add.footer") : void 0,
257
- items: Y.value,
256
+ "dropdown-footer-text": oe.value ? s(a)("consumer_groups.consumers.add.footer") : void 0,
257
+ items: te.value,
258
258
  label: s(a)("consumer_groups.consumers.add.consumer_groups_label"),
259
- loading: s(ie),
259
+ loading: s(ue),
260
260
  placeholder: s(a)("consumer_groups.consumers.add.consumer_group_placeholder"),
261
- readonly: $.value,
261
+ readonly: Q.value,
262
262
  required: "",
263
263
  width: "100%",
264
- onQueryChange: s(E)
264
+ onQueryChange: s(x)
265
265
  }, null, 8, ["modelValue", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly", "onQueryChange"]),
266
- x.value || V.value || M.value.length ? (A(), J("div", ho, [
267
- g(b, { appearance: "danger" }, {
266
+ M.value || P.value || V.value.length ? (A(), W("div", yo, [
267
+ f(C, { appearance: "danger" }, {
268
268
  default: p(() => [
269
- F("p", null, G(s(a)("consumer_groups.errors.add")), 1),
270
- M.value.length ? (A(), J("ul", _o, [
271
- (A(!0), J(Le, null, je(M.value, (ee, K) => (A(), J("li", { key: K }, G(ee), 1))), 128))
272
- ])) : W("", !0),
273
- F("div", null, G(x.value || V.value), 1)
269
+ K("p", null, G(s(a)("consumer_groups.errors.add")), 1),
270
+ V.value.length ? (A(), W("ul", ho, [
271
+ (A(!0), W(Oe, null, qe(V.value, (T, H) => (A(), W("li", { key: H }, G(T), 1))), 128))
272
+ ])) : X("", !0),
273
+ K("div", null, G(M.value || P.value), 1)
274
274
  ]),
275
275
  _: 1
276
276
  })
277
- ])) : W("", !0)
277
+ ])) : X("", !0)
278
278
  ])
279
279
  ]),
280
280
  _: 1
281
281
  }, 8, ["action-button-disabled", "title", "visible"]);
282
282
  };
283
283
  }
284
- }), $e = (e, L) => {
284
+ }), Ee = (e, N) => {
285
285
  const a = e.__vccOpts || e;
286
- for (const [t, v] of L)
286
+ for (const [t, v] of N)
287
287
  a[t] = v;
288
288
  return a;
289
- }, Co = /* @__PURE__ */ $e(bo, [["__scopeId", "data-v-4260ce03"]]), ko = { class: "kong-ui-entities-consumer-groups-list" }, Io = { class: "button-row" }, wo = { class: "empty-state-icon-gateway" }, Eo = /* @__PURE__ */ _e({
289
+ }, bo = /* @__PURE__ */ Ee(_o, [["__scopeId", "data-v-4260ce03"]]), Co = { class: "kong-ui-entities-consumer-groups-list" }, ko = { class: "button-row" }, Io = { class: "empty-state-icon-gateway" }, wo = /* @__PURE__ */ _e({
290
290
  __name: "ConsumerGroupList",
291
291
  props: {
292
292
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -328,33 +328,25 @@ const be = {
328
328
  useActionOutside: {
329
329
  type: Boolean,
330
330
  default: !1
331
- },
332
- /**
333
- * Enables the new empty state design, this prop can be removed when
334
- * the khcp-14756-empty-states-m2 FF is removed.
335
- */
336
- enableV2EmptyStates: {
337
- type: Boolean,
338
- default: !1
339
331
  }
340
332
  },
341
333
  emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success", "add:success", "remove:success"],
342
- setup(e, { emit: L }) {
343
- var Se;
344
- const a = L, t = e, { i18nT: v, i18n: { t: i } } = be.useI18n(), n = Fe(), { axiosInstance: E } = Ee((Se = t.config) == null ? void 0 : Se.axiosRequestConfig), ie = _(() => t.config.app !== "kongManager" || !!t.config.disableSorting), D = {
334
+ setup(e, { emit: N }) {
335
+ var Ge;
336
+ const a = N, t = e, { i18nT: v, i18n: { t: i } } = be.useI18n(), n = Pe(), { axiosInstance: x } = $e((Ge = t.config) == null ? void 0 : Ge.axiosRequestConfig), ue = k(() => t.config.app !== "kongManager" || !!t.config.disableSorting), D = {
345
337
  // the Name column is non-hidable
346
338
  name: { label: i("consumer_groups.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 }
347
339
  };
348
340
  t.config.app === "kongManager" && (D.consumers_count = { label: i("consumer_groups.list.table_headers.consumers_count"), searchable: !1, sortable: !1 }), D.tags = { label: i("consumer_groups.list.table_headers.tags"), sortable: !1 };
349
- const le = D, ce = (r) => ({
341
+ const ie = D, ce = (r) => ({
350
342
  "data-testid": r.username ?? r.custom_id ?? r.id
351
- }), Z = () => {
343
+ }), Y = () => {
352
344
  t.config.consumerId ? c() : n.push(t.config.createRoute);
353
- }, V = _(() => {
354
- var m, h, w, H;
355
- let r = `${t.config.apiBaseUrl}${X.list[t.config.app][$.value ? "forConsumer" : "all"]}`;
356
- return t.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((m = t.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((h = t.config) == null ? void 0 : h.consumerId) || "") : t.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, (w = t.config) != null && w.workspace ? `/${t.config.workspace}` : "").replace(/{consumerId}/gi, ((H = t.config) == null ? void 0 : H.consumerId) || "")), r;
357
- }), B = I(""), te = _(() => {
345
+ }, P = k(() => {
346
+ var d, b, E, J;
347
+ let r = `${t.config.apiBaseUrl}${Z.list[t.config.app][$.value ? "forConsumer" : "all"]}`;
348
+ return t.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerId}/gi, ((b = t.config) == null ? void 0 : b.consumerId) || "") : t.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, (E = t.config) != null && E.workspace ? `/${t.config.workspace}` : "").replace(/{consumerId}/gi, ((J = t.config) == null ? void 0 : J.consumerId) || "")), r;
349
+ }), U = w(""), oe = k(() => {
358
350
  const r = t.config.app === "konnect" || t.config.isExactMatch;
359
351
  return r ? {
360
352
  isExactMatch: r,
@@ -370,19 +362,19 @@ const be = {
370
362
  },
371
363
  schema: t.config.filterSchema
372
364
  };
373
- }), { hasRecords: Y, handleStateChange: se } = We(B), de = _(() => Y.value && t.config.app === "konnect"), R = _(() => !t.enableV2EmptyStates && t.config.app === "konnect"), $ = _(() => !!t.config.consumerId), x = _(
365
+ }), { hasRecords: te, handleStateChange: se } = Je(U), le = k(() => te.value && t.config.app === "konnect"), $ = k(() => !!t.config.consumerId), Q = k(
374
366
  () => $.value ? "kong-ui-entities-consumer-groups-list-in-consumer-page" : "kong-ui-entities-consumer-groups-list"
375
- ), me = _(() => t.config.app === "konnect" && B.value ? "consumer_group" : $.value && !t.config.paginatedEndpoint ? "consumer_groups" : void 0), {
376
- fetcher: pe,
377
- fetcherState: ge,
378
- fetcherCacheKey: M
379
- } = Xe(_(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), V, me), re = () => {
380
- B.value = "";
381
- }, j = () => {
382
- M.value++;
383
- }, d = I(null), k = async (r, m) => {
384
- const h = r.id;
385
- if (!await m(h)) {
367
+ ), M = k(() => t.config.app === "konnect" && U.value ? "consumer_group" : $.value && !t.config.paginatedEndpoint ? "consumer_groups" : void 0), {
368
+ fetcher: de,
369
+ fetcherState: me,
370
+ fetcherCacheKey: j
371
+ } = We(k(() => ({ ...t.config, cacheIdentifier: t.cacheIdentifier })), P, M), V = () => {
372
+ U.value = "";
373
+ }, re = () => {
374
+ j.value++;
375
+ }, F = w(null), m = async (r, d) => {
376
+ const b = r.id;
377
+ if (!await d(b)) {
386
378
  a("copy:error", {
387
379
  entity: r,
388
380
  field: "id",
@@ -393,11 +385,11 @@ const be = {
393
385
  a("copy:success", {
394
386
  entity: r,
395
387
  field: "id",
396
- message: i("consumer_groups.copy.success", { val: h })
388
+ message: i("consumer_groups.copy.success", { val: b })
397
389
  });
398
- }, f = async (r, m) => {
399
- const h = JSON.stringify(r);
400
- if (!await m(h)) {
390
+ }, I = async (r, d) => {
391
+ const b = JSON.stringify(r);
392
+ if (!await d(b)) {
401
393
  a("copy:error", {
402
394
  entity: r,
403
395
  message: i("consumer_groups.errors.copy")
@@ -408,141 +400,141 @@ const be = {
408
400
  entity: r,
409
401
  message: i("consumer_groups.copy.success_brief")
410
402
  });
411
- }, b = async (r) => {
412
- var h;
413
- await ((h = t.canRetrieve) == null ? void 0 : h.call(t, r)) && n.push(t.config.getViewRoute(r.id));
414
- }, O = (r) => ({
403
+ }, g = async (r) => {
404
+ var b;
405
+ await ((b = t.canRetrieve) == null ? void 0 : b.call(t, r)) && n.push(t.config.getViewRoute(r.id));
406
+ }, C = (r) => ({
415
407
  label: i("consumer_groups.actions.view"),
416
408
  to: t.config.getViewRoute(r)
417
- }), ee = (r) => ({
409
+ }), B = (r) => ({
418
410
  label: i("consumer_groups.actions.edit"),
419
411
  to: t.config.getEditRoute(r)
420
- }), K = I(void 0), ne = I(!1), oe = I(!1), fe = I(""), ye = Ze(t.config, V.value), o = (r) => {
421
- K.value = r, ne.value = !0;
422
- }, u = () => {
423
- ne.value = !1;
424
- }, C = async () => {
425
- var r, m, h;
426
- if ((r = K.value) != null && r.id) {
427
- oe.value = !0;
412
+ }), T = w(void 0), H = w(!1), ne = w(!1), pe = w(""), ge = Xe(t.config, P.value), fe = (r) => {
413
+ T.value = r, H.value = !0;
414
+ }, o = () => {
415
+ H.value = !1;
416
+ }, u = async () => {
417
+ var r, d, b;
418
+ if ((r = T.value) != null && r.id) {
419
+ ne.value = !0;
428
420
  try {
429
- await E.delete(ye(K.value.id)), oe.value = !1, ne.value = !1, M.value++, a("delete:success", K.value);
430
- } catch (w) {
431
- fe.value = ((h = (m = w.response) == null ? void 0 : m.data) == null ? void 0 : h.message) || w.message || i("consumer_groups.errors.delete"), a("error", w);
421
+ await x.delete(ge(T.value.id)), ne.value = !1, H.value = !1, j.value++, a("delete:success", T.value);
422
+ } catch (E) {
423
+ pe.value = ((b = (d = E.response) == null ? void 0 : d.data) == null ? void 0 : b.message) || E.message || i("consumer_groups.errors.delete"), a("error", E);
432
424
  } finally {
433
- oe.value = !1;
425
+ ne.value = !1;
434
426
  }
435
427
  }
436
- }, l = I(!1), c = () => {
437
- l.value = !0;
438
- }, T = () => {
439
- l.value = !1;
440
- }, U = (r, m) => {
441
- m || T(), M.value++, a("add:success", r);
442
- }, S = () => {
428
+ }, _ = w(!1), c = () => {
429
+ _.value = !0;
430
+ }, l = () => {
431
+ _.value = !1;
432
+ }, S = (r, d) => {
433
+ d || l(), j.value++, a("add:success", r);
434
+ }, R = () => {
443
435
  $.value && c();
444
- }, P = I(void 0), ae = I(!1), Ue = I(""), De = (r) => {
445
- P.value = r, ae.value = !0;
436
+ }, h = w(void 0), z = w(!1), ve = w(""), Ke = (r) => {
437
+ h.value = r, z.value = !0;
446
438
  }, xe = () => {
447
- ae.value = !1, P.value = void 0;
448
- }, Re = _(() => {
449
- var m, h, w, H;
450
- let r = `${t.config.apiBaseUrl}${X.list[t.config.app].oneForConsumer}`;
451
- return t.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((m = t.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{consumerId}/gi, ((h = t.config) == null ? void 0 : h.consumerId) || "") : t.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, (w = t.config) != null && w.workspace ? `/${t.config.workspace}` : "").replace(/{consumerId}/gi, ((H = t.config) == null ? void 0 : H.consumerId) || "")), r;
452
- }), Me = I(!1), Oe = async () => {
453
- if (P.value) {
439
+ z.value = !1, h.value = void 0;
440
+ }, Ue = k(() => {
441
+ var d, b, E, J;
442
+ let r = `${t.config.apiBaseUrl}${Z.list[t.config.app].oneForConsumer}`;
443
+ return t.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((d = t.config) == null ? void 0 : d.controlPlaneId) || "").replace(/{consumerId}/gi, ((b = t.config) == null ? void 0 : b.consumerId) || "") : t.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, (E = t.config) != null && E.workspace ? `/${t.config.workspace}` : "").replace(/{consumerId}/gi, ((J = t.config) == null ? void 0 : J.consumerId) || "")), r;
444
+ }), Me = w(!1), De = async () => {
445
+ if (h.value) {
454
446
  Me.value = !0;
455
447
  try {
456
- const r = Re.value.replace(/{consumerGroupId}/gi, P.value.id);
457
- await E.delete(r), a("remove:success", P.value), xe(), M.value++;
448
+ const r = Ue.value.replace(/{consumerGroupId}/gi, h.value.id);
449
+ await x.delete(r), a("remove:success", h.value), xe(), j.value++;
458
450
  } catch (r) {
459
- Ue.value = r.message || i("consumer_groups.errors.delete"), a("error", r);
451
+ ve.value = r.message || i("consumer_groups.errors.delete"), a("error", r);
460
452
  } finally {
461
453
  Me.value = !1;
462
454
  }
463
455
  }
464
456
  };
465
- we(ge, (r) => {
466
- var m, h, w;
467
- if (r.status === Ye.Error) {
468
- d.value = {
457
+ we(me, (r) => {
458
+ var d, b, E;
459
+ if (r.status === Ze.Error) {
460
+ F.value = {
469
461
  title: i("consumer_groups.errors.general")
470
- }, (w = (h = (m = r.error) == null ? void 0 : m.response) == null ? void 0 : h.data) != null && w.message && (d.value.message = r.error.response.data.message), a("error", r.error);
462
+ }, (E = (b = (d = r.error) == null ? void 0 : d.response) == null ? void 0 : b.data) != null && E.message && (F.value.message = r.error.response.data.message), a("error", r.error);
471
463
  return;
472
464
  }
473
- d.value = null;
465
+ F.value = null;
474
466
  });
475
- const Ce = I({
467
+ const Ce = w({
476
468
  ctaPath: $.value ? void 0 : t.config.createRoute,
477
469
  ctaText: void 0,
478
470
  message: `${i("consumer_groups.list.empty_state.description")}${t.config.additionMessageForEmptyState ? ` ${t.config.additionMessageForEmptyState}` : ""}`,
479
471
  title: i("consumer_groups.title")
480
472
  });
481
- return Ve(async () => {
473
+ return Te(async () => {
482
474
  await t.canCreate() && (Ce.value.title = $.value ? i("consumer_groups.list.empty_state.title_for_consumer") : i("consumer_groups.list.empty_state.title"), Ce.value.ctaText = $.value ? i("consumer_groups.actions.add_to_group") : i("consumer_groups.actions.create"));
483
- }), (r, m) => {
484
- const h = Q("KButton"), w = Q("KDropdownItem"), H = Q("KClipboardProvider"), qe = Q("KPrompt");
485
- return A(), J("div", ko, [
486
- g(s(eo), {
475
+ }), (r, d) => {
476
+ const b = L("KButton"), E = L("KDropdownItem"), J = L("KClipboardProvider"), Be = L("KPrompt");
477
+ return A(), W("div", Co, [
478
+ f(s(Ye), {
487
479
  "cache-identifier": e.cacheIdentifier,
488
480
  "disable-pagination": $.value && !e.config.paginatedEndpoint,
489
- "disable-sorting": ie.value,
481
+ "disable-sorting": ue.value,
490
482
  "empty-state-options": Ce.value,
491
483
  "enable-entity-actions": "",
492
- "error-message": d.value,
493
- fetcher: s(pe),
494
- "fetcher-cache-key": s(M),
484
+ "error-message": F.value,
485
+ fetcher: s(de),
486
+ "fetcher-cache-key": s(j),
495
487
  "pagination-type": "offset",
496
- "preferences-storage-key": x.value,
497
- query: B.value,
488
+ "preferences-storage-key": Q.value,
489
+ query: U.value,
498
490
  "row-attributes": ce,
499
- "table-headers": s(le),
500
- onClearSearchInput: re,
501
- "onClick:row": m[4] || (m[4] = (y) => b(y)),
502
- onEmptyStateCtaClicked: S,
503
- onSort: j,
491
+ "table-headers": s(ie),
492
+ onClearSearchInput: V,
493
+ "onClick:row": d[3] || (d[3] = (y) => g(y)),
494
+ onEmptyStateCtaClicked: R,
495
+ onSort: re,
504
496
  onState: s(se)
505
497
  }, ke({
506
498
  "toolbar-filter": p(() => [
507
- $.value ? W("", !0) : (A(), z(s(oo), {
499
+ $.value ? X("", !0) : (A(), ee(s(eo), {
508
500
  key: 0,
509
- modelValue: B.value,
510
- "onUpdate:modelValue": m[0] || (m[0] = (y) => B.value = y),
511
- config: te.value
501
+ modelValue: U.value,
502
+ "onUpdate:modelValue": d[0] || (d[0] = (y) => U.value = y),
503
+ config: oe.value
512
504
  }, null, 8, ["modelValue", "config"]))
513
505
  ]),
514
506
  "toolbar-button": p(() => [
515
- (A(), z(Ge, {
507
+ (A(), ee(Ne, {
516
508
  disabled: !e.useActionOutside,
517
509
  to: "#kong-ui-app-page-header-action-button"
518
510
  }, [
519
- F("div", Io, [
520
- de.value ? (A(), z(h, {
511
+ K("div", ko, [
512
+ le.value ? (A(), ee(b, {
521
513
  key: 0,
522
514
  appearance: "secondary",
523
515
  class: "open-learning-hub",
524
516
  "data-testid": "consumer-groups-learn-more-button",
525
517
  icon: "",
526
- onClick: m[1] || (m[1] = (y) => r.$emit("click:learn-more"))
518
+ onClick: d[1] || (d[1] = (y) => r.$emit("click:learn-more"))
527
519
  }, {
528
520
  default: p(() => [
529
- g(s(Te), { decorative: "" })
521
+ f(s(je), { decorative: "" })
530
522
  ]),
531
523
  _: 1
532
- })) : W("", !0),
533
- g(s(he), {
524
+ })) : X("", !0),
525
+ f(s(he), {
534
526
  "auth-function": () => e.canCreate()
535
527
  }, {
536
528
  default: p(() => [
537
- g(h, {
529
+ f(b, {
538
530
  appearance: "primary",
539
531
  "data-testid": "toolbar-add-consumer-group",
540
532
  size: e.useActionOutside ? "medium" : "large",
541
- onClick: Z
533
+ onClick: Y
542
534
  }, {
543
535
  default: p(() => [
544
- g(s(Qe)),
545
- ue(" " + G(e.config.consumerId ? s(i)("consumer_groups.actions.add_to_group") : s(i)("consumer_groups.list.toolbar_actions.new_consumer_group")), 1)
536
+ f(s(Le)),
537
+ ae(" " + G(e.config.consumerId ? s(i)("consumer_groups.actions.add_to_group") : s(i)("consumer_groups.list.toolbar_actions.new_consumer_group")), 1)
546
538
  ]),
547
539
  _: 1
548
540
  }, 8, ["size"])
@@ -553,78 +545,78 @@ const be = {
553
545
  ], 8, ["disabled"]))
554
546
  ]),
555
547
  name: p(({ rowValue: y }) => [
556
- F("b", null, G(y ?? "-"), 1)
548
+ K("b", null, G(y ?? "-"), 1)
557
549
  ]),
558
550
  consumers_count: p(({ rowValue: y }) => [
559
- ue(G(y ?? "-"), 1)
551
+ ae(G(y ?? "-"), 1)
560
552
  ]),
561
553
  tags: p(({ rowValue: y }) => [
562
- g(s(to), { tags: y }, null, 8, ["tags"])
554
+ f(s(oo), { tags: y }, null, 8, ["tags"])
563
555
  ]),
564
556
  actions: p(({ row: y }) => [
565
- g(H, null, {
566
- default: p(({ copyToClipboard: ve }) => [
567
- g(w, {
557
+ f(J, null, {
558
+ default: p(({ copyToClipboard: ye }) => [
559
+ f(E, {
568
560
  "data-testid": "action-entity-copy-id",
569
- onClick: (Ne) => k(y, ve)
561
+ onClick: (Re) => m(y, ye)
570
562
  }, {
571
563
  default: p(() => [
572
- ue(G(s(i)("consumer_groups.actions.copy_id")), 1)
564
+ ae(G(s(i)("consumer_groups.actions.copy_id")), 1)
573
565
  ]),
574
566
  _: 2
575
567
  }, 1032, ["onClick"])
576
568
  ]),
577
569
  _: 2
578
570
  }, 1024),
579
- g(H, null, {
580
- default: p(({ copyToClipboard: ve }) => [
581
- g(w, {
571
+ f(J, null, {
572
+ default: p(({ copyToClipboard: ye }) => [
573
+ f(E, {
582
574
  "data-testid": "action-entity-copy-json",
583
- onClick: (Ne) => f(y, ve)
575
+ onClick: (Re) => I(y, ye)
584
576
  }, {
585
577
  default: p(() => [
586
- ue(G(s(i)("consumer_groups.actions.copy_json")), 1)
578
+ ae(G(s(i)("consumer_groups.actions.copy_json")), 1)
587
579
  ]),
588
580
  _: 2
589
581
  }, 1032, ["onClick"])
590
582
  ]),
591
583
  _: 2
592
584
  }, 1024),
593
- g(s(he), {
585
+ f(s(he), {
594
586
  "auth-function": () => e.canRetrieve(y)
595
587
  }, {
596
588
  default: p(() => [
597
- g(w, {
589
+ f(E, {
598
590
  "data-testid": "action-entity-view",
599
591
  "has-divider": "",
600
- item: O(y.id)
592
+ item: C(y.id)
601
593
  }, null, 8, ["item"])
602
594
  ]),
603
595
  _: 2
604
596
  }, 1032, ["auth-function"]),
605
- g(s(he), {
597
+ f(s(he), {
606
598
  "auth-function": () => e.canEdit(y)
607
599
  }, {
608
600
  default: p(() => [
609
- g(w, {
601
+ f(E, {
610
602
  "data-testid": "action-entity-edit",
611
- item: ee(y.id)
603
+ item: B(y.id)
612
604
  }, null, 8, ["item"])
613
605
  ]),
614
606
  _: 2
615
607
  }, 1032, ["auth-function"]),
616
- g(s(he), {
608
+ f(s(he), {
617
609
  "auth-function": () => e.canDelete(y)
618
610
  }, {
619
611
  default: p(() => [
620
- g(w, {
612
+ f(E, {
621
613
  danger: "",
622
614
  "data-testid": "action-entity-delete",
623
615
  "has-divider": "",
624
- onClick: () => e.config.consumerId ? De(y) : o(y)
616
+ onClick: () => e.config.consumerId ? Ke(y) : fe(y)
625
617
  }, {
626
618
  default: p(() => [
627
- ue(G(e.config.consumerId ? s(i)("consumer_groups.actions.exit") : s(i)("consumer_groups.actions.delete")), 1)
619
+ ae(G(e.config.consumerId ? s(i)("consumer_groups.actions.exit") : s(i)("consumer_groups.actions.delete")), 1)
628
620
  ]),
629
621
  _: 2
630
622
  }, 1032, ["onClick"])
@@ -634,35 +626,12 @@ const be = {
634
626
  ]),
635
627
  _: 2
636
628
  }, [
637
- !s(Y) && R.value ? {
638
- name: "outside-actions",
639
- fn: p(() => [
640
- (A(), z(Ge, {
641
- disabled: !e.useActionOutside,
642
- to: "#kong-ui-app-page-header-action-button"
643
- }, [
644
- g(h, {
645
- appearance: "secondary",
646
- class: "open-learning-hub",
647
- "data-testid": "consumer-groups-learn-more-button",
648
- icon: "",
649
- onClick: m[2] || (m[2] = (y) => r.$emit("click:learn-more"))
650
- }, {
651
- default: p(() => [
652
- g(s(Te), { decorative: "" })
653
- ]),
654
- _: 1
655
- })
656
- ], 8, ["disabled"]))
657
- ]),
658
- key: "0"
659
- } : void 0,
660
- !B.value && e.enableV2EmptyStates && e.config.app === "konnect" ? {
629
+ !U.value && e.config.app === "konnect" ? {
661
630
  name: "empty-state",
662
631
  fn: p(() => {
663
632
  var y;
664
633
  return [
665
- g(s(so), {
634
+ f(s(to), {
666
635
  "action-button-text": s(i)("consumer_groups.list.toolbar_actions.new_consumer_group"),
667
636
  appearance: "secondary",
668
637
  "can-create": () => e.canCreate(),
@@ -670,14 +639,14 @@ const be = {
670
639
  description: s(i)("consumer_groups.list.empty_state_v2.description"),
671
640
  "learn-more": e.config.app === "konnect",
672
641
  title: s(i)("consumer_groups.list.empty_state_v2.title"),
673
- "onClick:create": Z,
674
- "onClick:learnMore": m[3] || (m[3] = (ve) => r.$emit("click:learn-more"))
642
+ "onClick:create": Y,
643
+ "onClick:learnMore": d[2] || (d[2] = (ye) => r.$emit("click:learn-more"))
675
644
  }, ke({
676
645
  image: p(() => [
677
- F("div", wo, [
678
- g(s(He), {
646
+ K("div", Io, [
647
+ f(s(Qe), {
679
648
  color: s(co),
680
- size: s(mo)
649
+ size: s(lo)
681
650
  }, null, 8, ["color", "size"])
682
651
  ])
683
652
  ]),
@@ -686,73 +655,73 @@ const be = {
686
655
  (y = e.config) != null && y.isControlPlaneGroup ? {
687
656
  name: "message",
688
657
  fn: p(() => [
689
- ue(G(s(i)("consumer_groups.list.empty_state_v2.group")), 1)
658
+ ae(G(s(i)("consumer_groups.list.empty_state_v2.group")), 1)
690
659
  ]),
691
660
  key: "0"
692
661
  } : void 0
693
662
  ]), 1032, ["action-button-text", "can-create", "description", "learn-more", "title"])
694
663
  ];
695
664
  }),
696
- key: "1"
665
+ key: "0"
697
666
  } : void 0
698
667
  ]), 1032, ["cache-identifier", "disable-pagination", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "preferences-storage-key", "query", "table-headers", "onState"]),
699
- g(s(ro), {
700
- "action-pending": oe.value,
668
+ f(s(so), {
669
+ "action-pending": ne.value,
701
670
  "data-testid": "delete-consumer-group-modal",
702
671
  description: s(i)("consumer_groups.delete.description"),
703
- "entity-name": K.value && (K.value.name || K.value.id),
704
- "entity-type": s(no).ConsumerGroup,
705
- error: fe.value,
672
+ "entity-name": T.value && (T.value.name || T.value.id),
673
+ "entity-type": s(ro).ConsumerGroup,
674
+ error: pe.value,
706
675
  title: s(i)("consumer_groups.delete.title"),
707
- visible: ne.value,
708
- onCancel: u,
709
- onProceed: C
676
+ visible: H.value,
677
+ onCancel: o,
678
+ onProceed: u
710
679
  }, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"]),
711
- e.config.consumerId ? (A(), z(Co, {
680
+ e.config.consumerId ? (A(), ee(bo, {
712
681
  key: 0,
713
682
  config: e.config,
714
683
  "data-testid": "add-to-group-modal",
715
- visible: l.value,
716
- "onAdd:partialSuccess": m[5] || (m[5] = (y) => U(y, !0)),
717
- "onAdd:success": m[6] || (m[6] = (y) => U(y)),
718
- onCancel: T
719
- }, null, 8, ["config", "visible"])) : W("", !0),
720
- e.config.consumerId && P.value ? (A(), z(qe, {
684
+ visible: _.value,
685
+ "onAdd:partialSuccess": d[4] || (d[4] = (y) => S(y, !0)),
686
+ "onAdd:success": d[5] || (d[5] = (y) => S(y)),
687
+ onCancel: l
688
+ }, null, 8, ["config", "visible"])) : X("", !0),
689
+ e.config.consumerId && h.value ? (A(), ee(Be, {
721
690
  key: 1,
722
691
  "action-button-appearance": "danger",
723
692
  "data-testid": "exit-group-modal",
724
693
  title: s(i)("consumer_groups.consumers.exit.title"),
725
- visible: ae.value,
694
+ visible: z.value,
726
695
  onCancel: xe,
727
- onProceed: Oe
696
+ onProceed: De
728
697
  }, {
729
698
  default: p(() => [
730
- g(s(v), {
699
+ f(s(v), {
731
700
  class: "exit-modal-message",
732
701
  keypath: e.config.consumerUsername ? "consumer_groups.consumers.exit.confirmation" : "consumer_groups.consumers.exit.confirmationNoUsername",
733
702
  tag: "p"
734
703
  }, ke({
735
704
  consumerGroup: p(() => [
736
- F("strong", null, G(P.value.name || P.value.id), 1)
705
+ K("strong", null, G(h.value.name || h.value.id), 1)
737
706
  ]),
738
707
  _: 2
739
708
  }, [
740
709
  e.config.consumerUsername ? {
741
710
  name: "consumer",
742
711
  fn: p(() => [
743
- F("strong", null, G(e.config.consumerUsername), 1)
712
+ K("strong", null, G(e.config.consumerUsername), 1)
744
713
  ]),
745
714
  key: "0"
746
715
  } : void 0
747
716
  ]), 1032, ["keypath"]),
748
- F("p", null, G(s(i)("consumer_groups.consumers.exit.description")), 1)
717
+ K("p", null, G(s(i)("consumer_groups.consumers.exit.description")), 1)
749
718
  ]),
750
719
  _: 1
751
- }, 8, ["title", "visible"])) : W("", !0)
720
+ }, 8, ["title", "visible"])) : X("", !0)
752
721
  ]);
753
722
  };
754
723
  }
755
- }), Ko = /* @__PURE__ */ $e(Eo, [["__scopeId", "data-v-dbf64903"]]), $o = { class: "kong-ui-entities-consumer-group-form" }, xo = { class: "select-item-container" }, Mo = { class: "select-item-label" }, So = {
724
+ }), Ko = /* @__PURE__ */ Ee(wo, [["__scopeId", "data-v-0c166440"]]), $o = { class: "kong-ui-entities-consumer-group-form" }, Eo = { class: "select-item-container" }, xo = { class: "select-item-label" }, Mo = {
756
725
  key: 0,
757
726
  class: "select-item-description"
758
727
  }, Go = /* @__PURE__ */ _e({
@@ -776,9 +745,9 @@ const be = {
776
745
  }
777
746
  },
778
747
  emits: ["update", "error", "loading"],
779
- setup(e, { emit: L }) {
780
- var oe, fe, ye;
781
- const a = e, t = L, { i18n: { t: v } } = be.useI18n(), i = Fe(), n = Ae({
748
+ setup(e, { emit: N }) {
749
+ var pe, ge, fe;
750
+ const a = e, t = N, { i18n: { t: v } } = be.useI18n(), i = Pe(), n = Se({
782
751
  fields: {
783
752
  name: "",
784
753
  tags: "",
@@ -786,147 +755,147 @@ const be = {
786
755
  },
787
756
  errorMessage: "",
788
757
  readonly: !1
789
- }), E = Ae({
758
+ }), x = Se({
790
759
  name: "",
791
760
  tags: "",
792
761
  consumers: []
793
762
  }), {
794
- debouncedQueryChange: ie,
763
+ debouncedQueryChange: ue,
795
764
  loading: D,
796
- error: le,
765
+ error: ie,
797
766
  loadItems: ce,
798
- results: Z
799
- } = Be(a.config, (fe = X.form[(oe = a.config) == null ? void 0 : oe.app]) == null ? void 0 : fe.consumersList, "", {
767
+ results: Y
768
+ } = Ve(a.config, (ge = Z.form[(pe = a.config) == null ? void 0 : pe.app]) == null ? void 0 : ge.consumersList, "", {
800
769
  fetchedItemsKey: "data",
801
770
  searchKeys: ["username", "custom_id", "id"]
802
- }), { axiosInstance: V } = Ee((ye = a.config) == null ? void 0 : ye.axiosRequestConfig), { getMessageFromError: B } = ao(), te = uo(), Y = _(() => Z.value.map((o) => ({
771
+ }), { axiosInstance: P } = $e((fe = a.config) == null ? void 0 : fe.axiosRequestConfig), { getMessageFromError: U } = no(), oe = ao(), te = k(() => Y.value.map((o) => ({
803
772
  label: o.username || o.custom_id,
804
773
  value: o.id,
805
774
  selected: n.fields.consumers.includes(o.id),
806
775
  data: o
807
776
  // we need this to determine whether or not to show the description text
808
- }))), se = _(() => {
777
+ }))), se = k(() => {
809
778
  var o, u;
810
- return (u = X.form[(o = a.config) == null ? void 0 : o.app]) == null ? void 0 : u.edit;
811
- }), de = _(() => a.consumerGroupId ? Ie.Edit : Ie.Create), R = _(() => !!n.fields.name && !re.value), $ = _(() => JSON.stringify(n.fields) !== JSON.stringify(E)), x = (o, u = "", C = "") => {
812
- var c, T, U, S, P, ae;
813
- let l = `${(c = a.config) == null ? void 0 : c.apiBaseUrl}${X.form[(T = a.config) == null ? void 0 : T.app][o]}`;
814
- return ((U = a.config) == null ? void 0 : U.app) === "konnect" ? l = l.replace(/{controlPlaneId}/gi, ((S = a.config) == null ? void 0 : S.controlPlaneId) || "") : ((P = a.config) == null ? void 0 : P.app) === "kongManager" && (l = l.replace(/\/{workspace}/gi, (ae = a.config) != null && ae.workspace ? `/${a.config.workspace}` : "")), l = l.replace(/{id}/gi, u || a.consumerGroupId), (o === "addConsumer" || o === "removeConsumer") && (l = l.replace(/{consumerId}/gi, C)), l;
815
- }, me = () => {
779
+ return (u = Z.form[(o = a.config) == null ? void 0 : o.app]) == null ? void 0 : u.edit;
780
+ }), le = k(() => a.consumerGroupId ? Ie.Edit : Ie.Create), $ = k(() => !!n.fields.name && !re.value), Q = k(() => JSON.stringify(n.fields) !== JSON.stringify(x)), M = (o, u = "", _ = "") => {
781
+ var l, S, R, h, z, ve;
782
+ let c = `${(l = a.config) == null ? void 0 : l.apiBaseUrl}${Z.form[(S = a.config) == null ? void 0 : S.app][o]}`;
783
+ return ((R = a.config) == null ? void 0 : R.app) === "konnect" ? c = c.replace(/{controlPlaneId}/gi, ((h = a.config) == null ? void 0 : h.controlPlaneId) || "") : ((z = a.config) == null ? void 0 : z.app) === "kongManager" && (c = c.replace(/\/{workspace}/gi, (ve = a.config) != null && ve.workspace ? `/${a.config.workspace}` : "")), c = c.replace(/{id}/gi, u || a.consumerGroupId), (o === "addConsumer" || o === "removeConsumer") && (c = c.replace(/{consumerId}/gi, _)), c;
784
+ }, de = () => {
816
785
  var o;
817
786
  i.push(((o = a.config) == null ? void 0 : o.cancelRoute) || { name: "consumer-group-list" });
818
- }, pe = (o) => {
787
+ }, me = (o) => {
819
788
  t("error", o);
820
- }, ge = (o) => {
789
+ }, j = (o) => {
821
790
  t("loading", o);
822
- }, M = async (o) => {
823
- var C, l, c, T, U;
824
- n.fields.name = ((C = o == null ? void 0 : o.item) == null ? void 0 : C.name) || ((l = o == null ? void 0 : o.consumer_group) == null ? void 0 : l.name) || (o == null ? void 0 : o.name) || "";
825
- const u = ((c = o == null ? void 0 : o.item) == null ? void 0 : c.tags) || (o == null ? void 0 : o.consumer_group.tags) || (o == null ? void 0 : o.tags) || [];
791
+ }, V = async (o) => {
792
+ var _, c, l, S, R;
793
+ n.fields.name = ((_ = o == null ? void 0 : o.item) == null ? void 0 : _.name) || ((c = o == null ? void 0 : o.consumer_group) == null ? void 0 : c.name) || (o == null ? void 0 : o.name) || "";
794
+ const u = ((l = o == null ? void 0 : o.item) == null ? void 0 : l.tags) || (o == null ? void 0 : o.consumer_group.tags) || (o == null ? void 0 : o.tags) || [];
826
795
  if (n.fields.tags = (u == null ? void 0 : u.join(", ")) || "", "consumers" in o)
827
- n.fields.consumers = ((T = o == null ? void 0 : o.consumers) == null ? void 0 : T.map((S) => S.id)) || [];
796
+ n.fields.consumers = ((S = o == null ? void 0 : o.consumers) == null ? void 0 : S.map((h) => h.id)) || [];
828
797
  else
829
798
  try {
830
- const { data: S } = await V.get(x("getConsumers"));
831
- n.fields.consumers = "consumers" in S ? (U = S == null ? void 0 : S.consumers) == null ? void 0 : U.map((P) => P.id) : [];
832
- } catch (S) {
833
- f(S);
799
+ const { data: h } = await P.get(M("getConsumers"));
800
+ n.fields.consumers = "consumers" in h ? (R = h == null ? void 0 : h.consumers) == null ? void 0 : R.map((z) => z.id) : [];
801
+ } catch (h) {
802
+ g(h);
834
803
  }
835
- Object.assign(E, n.fields);
836
- }, re = _(() => te.utf8Name(n.fields.name)), j = _(() => {
804
+ Object.assign(x, n.fields);
805
+ }, re = k(() => oe.utf8Name(n.fields.name)), F = k(() => {
837
806
  var o, u;
838
807
  return {
839
808
  name: n.fields.name,
840
- tags: (u = (o = n.fields.tags.split(",")) == null ? void 0 : o.map((C) => String(C || "").trim())) == null ? void 0 : u.filter((C) => C !== "")
809
+ tags: (u = (o = n.fields.tags.split(",")) == null ? void 0 : o.map((_) => String(_ || "").trim())) == null ? void 0 : u.filter((_) => _ !== "")
841
810
  };
842
- }), d = async (o, u = "") => await V.post(x("addConsumer", u, o), { consumer: o }), k = async (o, u = "") => await V.delete(x("removeConsumer", u, o)), f = (o) => {
843
- n.errorMessage = B(o), t("error", o);
844
- }, b = (o = a.consumerGroupId) => {
845
- Object.assign(E, n.fields), t("update", { ...n.fields, id: o });
846
- }, O = (o, u, C = a.consumerGroupId) => {
847
- const l = o == null ? void 0 : o.find((c) => c.status !== "fulfilled");
848
- l ? f({
849
- code: l.status,
811
+ }), m = async (o, u = "") => await P.post(M("addConsumer", u, o), { consumer: o }), I = async (o, u = "") => await P.delete(M("removeConsumer", u, o)), g = (o) => {
812
+ n.errorMessage = U(o), t("error", o);
813
+ }, C = (o = a.consumerGroupId) => {
814
+ Object.assign(x, n.fields), t("update", { ...n.fields, id: o });
815
+ }, B = (o, u, _ = a.consumerGroupId) => {
816
+ const c = o == null ? void 0 : o.find((l) => l.status !== "fulfilled");
817
+ c ? g({
818
+ code: c.status,
850
819
  message: u
851
- }) : b(C);
852
- }, ee = async () => {
820
+ }) : C(_);
821
+ }, T = async () => {
853
822
  let o = "";
854
823
  try {
855
- const { data: u } = await V.post(x("create"), j.value);
824
+ const { data: u } = await P.post(M("create"), F.value);
856
825
  o = "item" in u ? u.item.id : u.id;
857
826
  } catch (u) {
858
- f(u);
827
+ g(u);
859
828
  }
860
829
  if (n.fields.consumers.length > 0 && o)
861
830
  try {
862
- const u = n.fields.consumers.map((l) => d(l, o)), C = await Promise.allSettled(u);
863
- O(C, v("consumer_groups.errors.add_consumer"), o);
831
+ const u = n.fields.consumers.map((c) => m(c, o)), _ = await Promise.allSettled(u);
832
+ B(_, v("consumer_groups.errors.add_consumer"), o);
864
833
  } catch (u) {
865
- f(u);
834
+ g(u);
866
835
  }
867
- else n.fields.consumers.length === 0 && o && b(o);
868
- }, K = async () => {
869
- var C;
836
+ else n.fields.consumers.length === 0 && o && C(o);
837
+ }, H = async () => {
838
+ var _;
870
839
  try {
871
- ((C = a.config) == null ? void 0 : C.app) === "konnect" ? await V.put(x("edit"), j.value) : await V.patch(x("edit"), j.value);
872
- } catch (l) {
873
- f(l);
840
+ ((_ = a.config) == null ? void 0 : _.app) === "konnect" ? await P.put(M("edit"), F.value) : await P.patch(M("edit"), F.value);
841
+ } catch (c) {
842
+ g(c);
874
843
  }
875
- const o = n.fields.consumers.filter((l) => !E.consumers.includes(l)), u = E.consumers.filter((l) => !n.fields.consumers.includes(l));
844
+ const o = n.fields.consumers.filter((c) => !x.consumers.includes(c)), u = x.consumers.filter((c) => !n.fields.consumers.includes(c));
876
845
  if (u.length === 0 && o.length === 0)
877
- b();
846
+ C();
878
847
  else {
879
848
  if (u.length > 0)
880
849
  try {
881
- const l = u.map((T) => k(T)), c = await Promise.allSettled(l);
882
- O(c, v("consumer_groups.errors.remove_consumer"));
883
- } catch (l) {
884
- f(l);
850
+ const c = u.map((S) => I(S)), l = await Promise.allSettled(c);
851
+ B(l, v("consumer_groups.errors.remove_consumer"));
852
+ } catch (c) {
853
+ g(c);
885
854
  }
886
855
  if (o.length > 0)
887
856
  try {
888
- const l = o.map((T) => d(T)), c = await Promise.allSettled(l);
889
- O(c, v("consumer_groups.errors.add_consumer"));
890
- } catch (l) {
891
- f(l);
857
+ const c = o.map((S) => m(S)), l = await Promise.allSettled(c);
858
+ B(l, v("consumer_groups.errors.add_consumer"));
859
+ } catch (c) {
860
+ g(c);
892
861
  }
893
862
  }
894
863
  }, ne = async () => {
895
864
  try {
896
- n.readonly = !0, de.value === Ie.Create ? await ee() : await K();
865
+ n.readonly = !0, le.value === Ie.Create ? await T() : await H();
897
866
  } finally {
898
867
  n.readonly = !1;
899
868
  }
900
869
  };
901
- return Ve(async () => {
870
+ return Te(async () => {
902
871
  a.hideConsumers || await ce();
903
872
  }), (o, u) => {
904
- const C = Q("KInput"), l = Q("KMultiselect");
905
- return A(), J("div", $o, [
906
- g(s(io), {
907
- "can-submit": R.value && $.value,
873
+ const _ = L("KInput"), c = L("KMultiselect");
874
+ return A(), W("div", $o, [
875
+ f(s(uo), {
876
+ "can-submit": $.value && Q.value,
908
877
  config: e.config,
909
878
  "edit-id": e.consumerGroupId,
910
- "entity-type": s(Ke).ConsumerGroup,
911
- "error-message": n.errorMessage || s(le) || re.value,
879
+ "entity-type": s(Fe).ConsumerGroup,
880
+ "error-message": n.errorMessage || s(ie) || re.value,
912
881
  "fetch-url": se.value,
913
- "form-fields": j.value,
882
+ "form-fields": F.value,
914
883
  "is-readonly": n.readonly,
915
- onCancel: me,
916
- "onFetch:error": u[3] || (u[3] = (c) => pe(c)),
917
- "onFetch:success": M,
918
- onLoading: u[4] || (u[4] = (c) => ge(c)),
884
+ onCancel: de,
885
+ "onFetch:error": u[3] || (u[3] = (l) => me(l)),
886
+ "onFetch:success": V,
887
+ onLoading: u[4] || (u[4] = (l) => j(l)),
919
888
  onSubmit: ne
920
889
  }, {
921
890
  default: p(() => [
922
- g(s(Pe), {
891
+ f(s(Ae), {
923
892
  description: s(v)("consumer_groups.form.general_info.description"),
924
893
  title: s(v)("consumer_groups.form.general_info.title")
925
894
  }, {
926
895
  default: p(() => [
927
- g(C, {
896
+ f(_, {
928
897
  modelValue: n.fields.name,
929
- "onUpdate:modelValue": u[0] || (u[0] = (c) => n.fields.name = c),
898
+ "onUpdate:modelValue": u[0] || (u[0] = (l) => n.fields.name = l),
930
899
  modelModifiers: { trim: !0 },
931
900
  autocomplete: "off",
932
901
  "data-testid": "consumer-group-form-name",
@@ -935,9 +904,9 @@ const be = {
935
904
  required: "",
936
905
  type: "text"
937
906
  }, null, 8, ["modelValue", "label", "placeholder"]),
938
- g(C, {
907
+ f(_, {
939
908
  modelValue: n.fields.tags,
940
- "onUpdate:modelValue": u[1] || (u[1] = (c) => n.fields.tags = c),
909
+ "onUpdate:modelValue": u[1] || (u[1] = (l) => n.fields.tags = l),
941
910
  modelModifiers: { trim: !0 },
942
911
  autocomplete: "off",
943
912
  "data-testid": "consumer-group-form-tags",
@@ -953,31 +922,31 @@ const be = {
953
922
  ]),
954
923
  _: 1
955
924
  }, 8, ["description", "title"]),
956
- e.hideConsumers ? W("", !0) : (A(), z(s(Pe), {
925
+ e.hideConsumers ? X("", !0) : (A(), ee(s(Ae), {
957
926
  key: 0,
958
927
  description: s(v)("consumer_groups.form.consumers.description"),
959
928
  "has-divider": "",
960
929
  title: s(v)("consumer_groups.form.consumers.title")
961
930
  }, {
962
931
  default: p(() => [
963
- g(l, {
932
+ f(c, {
964
933
  modelValue: n.fields.consumers,
965
- "onUpdate:modelValue": u[2] || (u[2] = (c) => n.fields.consumers = c),
934
+ "onUpdate:modelValue": u[2] || (u[2] = (l) => n.fields.consumers = l),
966
935
  appearance: "select",
967
936
  autosuggest: "",
968
- items: Y.value,
937
+ items: te.value,
969
938
  label: s(v)("consumer_groups.form.fields.consumers.label"),
970
939
  loading: s(D),
971
940
  placeholder: s(v)("consumer_groups.form.fields.consumers.placeholder"),
972
941
  width: "auto",
973
- onQueryChange: s(ie)
942
+ onQueryChange: s(ue)
974
943
  }, {
975
- "item-template": p(({ item: c }) => {
976
- var T, U, S;
944
+ "item-template": p(({ item: l }) => {
945
+ var S, R, h;
977
946
  return [
978
- F("div", xo, [
979
- F("div", Mo, G(c.label), 1),
980
- (T = c == null ? void 0 : c.data) != null && T.username && ((U = c == null ? void 0 : c.data) != null && U.custom_id) ? (A(), J("div", So, G((S = c == null ? void 0 : c.data) == null ? void 0 : S.custom_id), 1)) : W("", !0)
947
+ K("div", Eo, [
948
+ K("div", xo, G(l.label), 1),
949
+ (S = l == null ? void 0 : l.data) != null && S.username && ((R = l == null ? void 0 : l.data) != null && R.custom_id) ? (A(), W("div", Mo, G((h = l == null ? void 0 : l.data) == null ? void 0 : h.custom_id), 1)) : X("", !0)
981
950
  ])
982
951
  ];
983
952
  }),
@@ -992,7 +961,7 @@ const be = {
992
961
  ]);
993
962
  };
994
963
  }
995
- }), Uo = /* @__PURE__ */ $e(Go, [["__scopeId", "data-v-0487fbd2"]]), Ao = { class: "kong-ui-consumer-group-entity-config-card" }, Do = /* @__PURE__ */ _e({
964
+ }), Uo = /* @__PURE__ */ Ee(Go, [["__scopeId", "data-v-0487fbd2"]]), So = { class: "kong-ui-consumer-group-entity-config-card" }, Do = /* @__PURE__ */ _e({
996
965
  __name: "ConsumerGroupConfigCard",
997
966
  props: {
998
967
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
@@ -1019,7 +988,7 @@ const be = {
1019
988
  },
1020
989
  emits: ["loading", "fetch:error", "fetch:success"],
1021
990
  setup(e) {
1022
- const L = e, { i18n: { t: a } } = be.useI18n(), t = _(() => X.form[L.config.app].edit), v = I({
991
+ const N = e, { i18n: { t: a } } = be.useI18n(), t = k(() => Z.form[N.config.app].edit), v = w({
1023
992
  id: {},
1024
993
  name: {},
1025
994
  created_at: {},
@@ -1028,18 +997,18 @@ const be = {
1028
997
  tooltip: a("consumer_groups.form.fields.tags.tooltip")
1029
998
  }
1030
999
  });
1031
- return (i, n) => (A(), J("div", Ao, [
1032
- g(s(lo), {
1000
+ return (i, n) => (A(), W("div", So, [
1001
+ f(s(io), {
1033
1002
  config: e.config,
1034
1003
  "config-card-doc": e.configCardDoc,
1035
1004
  "config-schema": v.value,
1036
1005
  "data-key": "consumer_group",
1037
- "entity-type": s(Ke).ConsumerGroup,
1006
+ "entity-type": s(Fe).ConsumerGroup,
1038
1007
  "fetch-url": t.value,
1039
1008
  "hide-title": e.hideTitle,
1040
- "onFetch:error": n[0] || (n[0] = (E) => i.$emit("fetch:error", E)),
1041
- "onFetch:success": n[1] || (n[1] = (E) => i.$emit("fetch:success", E)),
1042
- onLoading: n[2] || (n[2] = (E) => i.$emit("loading", E))
1009
+ "onFetch:error": n[0] || (n[0] = (x) => i.$emit("fetch:error", x)),
1010
+ "onFetch:success": n[1] || (n[1] = (x) => i.$emit("fetch:success", x)),
1011
+ onLoading: n[2] || (n[2] = (x) => i.$emit("loading", x))
1043
1012
  }, null, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
1044
1013
  ]));
1045
1014
  }