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