@kong-ui-public/entities-consumer-credentials 3.2.39 → 3.3.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,114 +1,8 @@
1
- import { defineComponent as X, computed as k, openBlock as _, createBlock as D, resolveDynamicComponent as fe, normalizeStyle as ye, withCtx as l, createElementBlock as q, toDisplayString as T, createCommentVNode as z, pushScopeId as ge, popScopeId as he, createElementVNode as H, ref as C, watch as se, renderSlot as G, unref as b, toValue as Ze, resolveComponent as L, createVNode as v, createSlots as $e, withDirectives as je, vShow as Ke, renderList as Fe, createTextVNode as B, inject as Ge, onMounted as Xe, onUnmounted as Qe, onBeforeMount as et, Teleport as tt, Fragment as rt, withModifiers as at } from "vue";
2
- import { createI18n as Me, i18nTComponent as qe } from "@kong-ui-public/i18n";
3
- import ke from "axios";
4
- import "@kong/kongponents";
5
- import "vue-router";
6
- const _e = "24px", nt = (e, t) => {
7
- const r = e.__vccOpts || e;
8
- for (const [a, n] of t)
9
- r[a] = n;
10
- return r;
11
- }, it = (e) => (ge("data-v-c1f7c39c"), e = e(), he(), e), ot = ["aria-hidden"], lt = {
12
- key: 0,
13
- "data-testid": "kui-icon-svg-title"
14
- }, st = /* @__PURE__ */ it(() => /* @__PURE__ */ H("path", {
15
- d: "M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",
16
- fill: "currentColor"
17
- }, null, -1)), ct = /* @__PURE__ */ X({
18
- __name: "AddIcon",
19
- props: {
20
- /** The accessibility text provided to screen readers */
21
- title: {
22
- type: String,
23
- required: !1,
24
- default: ""
25
- },
26
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
27
- color: {
28
- type: String,
29
- required: !1,
30
- default: "currentColor"
31
- },
32
- /** The CSS display property for the icon. Defaults to `block` */
33
- display: {
34
- type: String,
35
- required: !1,
36
- default: "block"
37
- },
38
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
39
- decorative: {
40
- type: Boolean,
41
- required: !1,
42
- default: !1
43
- },
44
- /** The icon size */
45
- size: {
46
- type: [Number, String],
47
- required: !1,
48
- default: _e,
49
- // if setting to the imported const fails, just pass a number of 24 as the default.
50
- validator: (e) => {
51
- if (typeof e == "number" && e > 0)
52
- return !0;
53
- if (typeof e == "string") {
54
- const t = String(e).replace(/px/gi, ""), r = Number(t);
55
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
56
- return !0;
57
- }
58
- return !1;
59
- }
60
- },
61
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
62
- as: {
63
- type: String,
64
- required: !1,
65
- default: "span"
66
- }
67
- },
68
- setup(e) {
69
- const t = e, r = k(() => {
70
- if (typeof t.size == "number" && t.size > 0)
71
- return `${t.size}px`;
72
- if (typeof t.size == "string") {
73
- const n = String(t.size).replace(/px/gi, ""), o = Number(n);
74
- if (o && !isNaN(o) && Number.isInteger(o) && o > 0)
75
- return `${o}px`;
76
- }
77
- return _e;
78
- }), a = k(() => ({
79
- boxSizing: "border-box",
80
- color: t.color,
81
- display: t.display,
82
- flexShrink: "0",
83
- height: r.value,
84
- lineHeight: "0",
85
- width: r.value
86
- }));
87
- return (n, o) => (_(), D(fe(e.as), {
88
- "aria-hidden": e.decorative ? "true" : void 0,
89
- class: "kui-icon add-icon",
90
- "data-testid": "kui-icon-wrapper-add-icon",
91
- style: ye(a.value)
92
- }, {
93
- default: l(() => [
94
- (_(), q("svg", {
95
- "aria-hidden": e.decorative ? "true" : void 0,
96
- "data-testid": "kui-icon-svg-add-icon",
97
- fill: "none",
98
- height: "100%",
99
- role: "img",
100
- viewBox: "0 0 24 24",
101
- width: "100%",
102
- xmlns: "http://www.w3.org/2000/svg"
103
- }, [
104
- e.title ? (_(), q("title", lt, T(e.title), 1)) : z("", !0),
105
- st
106
- ], 8, ot))
107
- ]),
108
- _: 1
109
- }, 8, ["aria-hidden", "style"]));
110
- }
111
- }), ut = /* @__PURE__ */ nt(ct, [["__scopeId", "data-v-c1f7c39c"]]), dt = {
1
+ import { defineComponent as ae, ref as m, computed as B, watch as ne, onBeforeMount as le, resolveComponent as k, openBlock as p, createElementBlock as j, createVNode as c, unref as s, withCtx as n, createBlock as C, Teleport as ie, withDirectives as ce, createTextVNode as y, toDisplayString as u, vShow as re, createElementVNode as M, Fragment as se, renderList as oe, withModifiers as de, createCommentVNode as K } from "vue";
2
+ import { AddIcon as ue } from "@kong/icons";
3
+ import { createI18n as he, i18nTComponent as pe } from "@kong-ui-public/i18n";
4
+ import { useAxios as ye, useFetcher as ge, useDeleteUrlBuilder as fe, EntityTypes as me, FetcherStatus as Ce, EntityBaseTable as be, PermissionsWrapper as S, EntityDeleteModal as _e } from "@kong-ui-public/entities-shared";
5
+ const ke = {
112
6
  title: "Consumer Credentials",
113
7
  list: {
114
8
  toolbar_actions: {
@@ -249,1813 +143,32 @@ const _e = "24px", nt = (e, t) => {
249
143
  success: "Copied {val} to clipboard",
250
144
  success_brief: "Successfully copied to clipboard"
251
145
  }
252
- }, pt = {
253
- credentials: dt
146
+ }, ve = {
147
+ credentials: ke
254
148
  };
255
- function ft() {
256
- const e = Me("en-us", pt);
149
+ function we() {
150
+ const l = he("en-us", ve);
257
151
  return {
258
- i18n: e,
259
- i18nT: qe(e)
152
+ i18n: l,
153
+ i18nT: pe(l)
260
154
  // Translation component <i18n-t>
261
155
  };
262
156
  }
263
- const yt = {
264
- useI18n: ft
265
- }, gt = {
157
+ const Ae = {
158
+ useI18n: we
159
+ }, Ne = {
266
160
  list: {
267
161
  konnect: "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{consumerId}/{plugin}",
268
162
  kongManager: "/{workspace}/consumers/{consumerId}/{plugin}"
269
163
  }
270
- };
271
- var Pe = /* @__PURE__ */ ((e) => (e.GatewayService = "service", e.Route = "route", e.Consumer = "consumer", e.ConsumerGroup = "consumer group", e.Plugin = "plugin", e.Upstream = "upstream", e.Certificate = "certificate", e.CACertificate = "ca certificate", e.SNI = "SNI", e.Key = "key", e.KeySet = "key set", e.Vault = "vault", e.Application = "application", e.Developer = "developer", e.acls = "ACL Credential", e["basic-auth"] = "Basic Auth Credential", e["key-auth"] = "Key Auth Credential", e["key-auth-enc"] = "Key Auth Encrypted Credential", e.oauth2 = "OAuth 2.0 Credential", e["hmac-auth"] = "HMAC Credential", e.jwt = "JWT Credential", e.Target = "target", e.Policy = "policy", e.Secret = "secret", e))(Pe || {}), ee = /* @__PURE__ */ ((e) => (e[e.Loading = 0] = "Loading", e[e.Idle = 1] = "Idle", e[e.NoResults = 2] = "NoResults", e[e.Error = 3] = "Error", e))(ee || {}), Be = /* @__PURE__ */ ((e) => (e.CaCertificate = "ca_certificate", e.Certificate = "certificate", e.Consumer = "consumer", e.ConsumerGroup = "consumer_group", e.GatewayService = "service", e.Key = "key", e.KeySet = "set", e.Plugin = "plugin", e.Route = "route", e.SNI = "sni", e.Upstream = "upstream", e.Target = "target", e.Vault = "vault", e.Other = "other", e))(Be || {});
272
- Object.values(Be);
273
- function ht() {
274
- return {
275
- getAxiosInstance: (e = {}) => {
276
- try {
277
- const t = Ge("get-axios-instance", void 0);
278
- return typeof t == "function" ? t(e) : ke.create({
279
- withCredentials: !0,
280
- timeout: 3e4,
281
- ...e
282
- });
283
- } catch (t) {
284
- return console.warn("getAxiosInstance:", t.message || t), ke.create({
285
- withCredentials: !0,
286
- timeout: 3e4,
287
- ...e
288
- });
289
- }
290
- },
291
- getTraceIdFromError: (e) => {
292
- var t;
293
- return ((t = e == null ? void 0 : e.response) == null ? void 0 : t.headers["x-datadog-trace-id"]) || "";
294
- }
295
- };
296
- }
297
- function mt() {
298
- return {
299
- debounce: (e, t) => {
300
- let r;
301
- return (...a) => {
302
- clearTimeout(r), r = window == null ? void 0 : window.setTimeout(() => {
303
- e(...a);
304
- }, t);
305
- };
306
- }
307
- };
308
- }
309
- const ue = "khcp-user-table-preferences", vt = {
310
- pageSize: 30,
311
- sortColumnKey: void 0,
312
- sortColumnOrder: void 0,
313
- columnWidths: {},
314
- columnVisibility: {}
315
- };
316
- function bt() {
317
- const e = (r) => {
318
- if (typeof r == "string")
319
- try {
320
- return JSON.parse(r);
321
- } catch (a) {
322
- console.error("useTablePreferences(tryParseJson)", a);
323
- return;
324
- }
325
- }, t = () => {
326
- const r = e(localStorage.getItem(ue));
327
- return !r || !Object.keys(r).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(r));
328
- };
329
- return {
330
- setTablePreferences: (r, a) => {
331
- try {
332
- const n = t();
333
- n.set(r, a), localStorage.setItem(ue, JSON.stringify(Object.fromEntries(n.entries())));
334
- } catch (n) {
335
- console.error("useTablePreferences(setTablePreferences)", n);
336
- }
337
- },
338
- getTablePreferences: (r) => {
339
- const a = t();
340
- return (a == null ? void 0 : a.get(r)) || void 0 || vt;
341
- },
342
- deleteAllTablePreferences: () => {
343
- localStorage.removeItem(ue);
344
- }
345
- };
346
- }
347
- function me(e = {}) {
348
- const { getAxiosInstance: t } = ht();
349
- return {
350
- axiosInstance: t(e)
351
- };
352
- }
353
- const wt = {
354
- actions: {
355
- copyId: "Copy ID",
356
- copied_id: 'Copied "{id}" to the clipboard',
357
- copyToClipboard: "Copied successfully!",
358
- copyToClipboardFailed: "Failed to copy to the clipboard"
359
- }
360
- }, Ct = {
361
- message: "Are you sure you want to delete this {entityType}?",
362
- messageWithName: "Are you sure you want to delete this {entityType} {entityName}?"
363
- }, kt = {
364
- actions: {
365
- viewConfiguration: "View Configuration",
366
- save: "Save",
367
- cancel: "Cancel",
368
- back: "Back"
369
- },
370
- configuration: {
371
- title: "Configuration",
372
- message: "Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",
373
- yaml: "YAML",
374
- json: "JSON",
375
- terraform: "Terraform"
376
- },
377
- errors: {
378
- edit: "The entity could not be edited at this time."
379
- }
380
- }, _t = {
381
- emptyState: {
382
- noSearchResultsTitle: "No results found",
383
- noSearchResultsMessage: "Please adjust the criteria and try again.",
384
- noSearchResultsCtaText: "Clear"
385
- }
386
- }, St = {
387
- title: "Configuration",
388
- actions: {
389
- copy: "Copy JSON"
390
- },
391
- sections: {
392
- advanced: "Advanced",
393
- plugin: "Plugin Specific Configuration"
394
- },
395
- commonFields: {
396
- id_label: "ID",
397
- name_label: "Name",
398
- enabled_label: "Enabled",
399
- enabled_tooltip: "Enabled is FTW",
400
- updated_at_label: "Last Updated",
401
- created_at_label: "Created",
402
- tags_label: "Tags",
403
- link: "Link"
404
- },
405
- statusBadge: {
406
- enabledLabel: "Enabled",
407
- disabledLabel: "Disabled"
408
- },
409
- copy: {
410
- tooltip: "Copy {label}",
411
- success: "Copied!"
412
- },
413
- errors: {
414
- load: "The entity configuration data could not be loaded at this time.",
415
- copy: "Failed to copy to clipboard"
416
- },
417
- general: {
418
- entryTitle: "Entry {index}",
419
- structuredFormat: "Structured"
420
- }
421
- }, xt = {
422
- filterButtonText: "Filter",
423
- fieldLabel: "Filter by:",
424
- inputPlaceholder: "Enter a value",
425
- selectPlaceholder: "Select an item",
426
- applyButtonText: "Apply",
427
- clearButtonText: "Clear",
428
- clearAllButtonText: "Clear all filters"
429
- }, Nt = {
430
- errors: {
431
- fetch: "Could not fetch available items",
432
- invalid: "Please select a valid value"
433
- }
434
- }, At = {
435
- unexpected: "An unexpected error has occurred",
436
- dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.'
437
- }, Tt = {
438
- utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."
439
- }, It = {
440
- enable: {
441
- title: "Enable {entityType}",
442
- message: "Are you sure you want to enable the {entityType} {entityName}?",
443
- confirmText: "Yes, enable"
444
- },
445
- disable: {
446
- title: "Disable {entityType}",
447
- message: "Are you sure you want to disable the {entityType} {entityName}?",
448
- confirmText: "Yes, disable"
449
- }
450
- }, Et = {
451
- global: wt,
452
- deleteModal: Ct,
453
- baseForm: kt,
454
- baseTable: _t,
455
- baseConfigCard: St,
456
- filter: xt,
457
- debouncedFilter: Nt,
458
- errors: At,
459
- validationErrors: Tt,
460
- toggleModal: It
461
- };
462
- function ce() {
463
- const e = Me("en-us", Et);
464
- return {
465
- i18n: e,
466
- i18nT: qe(e)
467
- // Translation component <i18n-t>
468
- };
469
- }
470
- function Le() {
471
- const e = (r, a) => (a == null ? void 0 : a[r]) ?? void 0, t = (r, a) => {
472
- if (r.length !== a.length) return !1;
473
- const n = /* @__PURE__ */ new Set([...r, ...a]);
474
- for (const o of n) {
475
- const i = r.filter((y) => y === o).length, s = a.filter((y) => y === o).length;
476
- if (i !== s) return !1;
477
- }
478
- return !0;
479
- };
480
- return {
481
- getPropValue: e,
482
- objectsAreEqual: (r, a, n) => {
483
- if (n) {
484
- if (Object.keys(r).length === Object.keys(a).length)
485
- for (const o in r)
486
- if (Array.isArray(r[o]) && Array.isArray(a[o])) {
487
- if (t(r[o], a[o]))
488
- continue;
489
- return !1;
490
- } else {
491
- if (r[o] === a[o])
492
- continue;
493
- return !1;
494
- }
495
- else
496
- return !1;
497
- return !0;
498
- }
499
- try {
500
- return JSON.stringify(r) === JSON.stringify(a);
501
- } catch {
502
- return !1;
503
- }
504
- },
505
- sortAlpha: (r) => (a, n) => {
506
- let o = a[r] === void 0 || a[r] === null ? "" : a[r], i = n[r] === void 0 || n[r] === null ? "" : n[r];
507
- return Array.isArray(a[r]) && (o = a[r][0]), Array.isArray(n[r]) && (i = n[r][0]), o.localeCompare(i);
508
- },
509
- isValidUuid: (r) => r ? /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r) : !1
510
- };
511
- }
512
- function Ot(e, t, r, a = {
513
- fetchedItemsKey: "data",
514
- searchKeys: ["id"]
515
- }) {
516
- r || (r = "1000");
517
- const { axiosInstance: n } = me(e.axiosRequestConfig), { i18n: { t: o } } = ce(), { debounce: i } = mt(), s = i(async (g) => {
518
- await M(g);
519
- }, 200), y = C(!1), S = C(""), u = C(""), d = C([]), h = C([]), w = C(void 0), A = k(() => {
520
- const g = `${e.apiBaseUrl}${b(t)}`;
521
- return e.app === "konnect" ? g.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" ? g.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : "") : g;
522
- }), { isValidUuid: $ } = Le(), N = async () => {
523
- try {
524
- y.value = !0;
525
- const { data: g } = await n.get(`${A.value}?size=${r}`);
526
- g != null && g.next || (w.value = a.fetchedItemsKey in g ? g[a.fetchedItemsKey] : []), h.value = a.fetchedItemsKey in g ? g[a.fetchedItemsKey] : [], d.value = h.value;
527
- } catch {
528
- d.value = [], S.value = o("debouncedFilter.errors.fetch");
529
- } finally {
530
- y.value = !1;
531
- }
532
- }, E = C(""), M = async (g) => {
533
- var U, J, c;
534
- if (E.value !== g) {
535
- if (E.value = g ?? "", !g) {
536
- d.value = h.value;
537
- return;
538
- }
539
- if (w.value === void 0)
540
- try {
541
- if (y.value = !0, S.value = "", u.value = "", e.app === "konnect") {
542
- const p = `${A.value}/${g}`, { data: I } = await n.get(`${p}?size=${r}`);
543
- a.fetchedItemsKey in I ? d.value = I[a.fetchedItemsKey] : I != null && I[a.exactMatchKey ?? "id"] ? d.value = [I] : d.value = [];
544
- } else {
545
- const p = [];
546
- $(g) && a.searchKeys.includes("id") ? p.push((async () => {
547
- const { data: O } = await n.get(`${A.value}/${g}`);
548
- return [O[a.fetchedItemsKey] ?? O];
549
- })()) : p.push(
550
- ...a.searchKeys.filter((O) => O !== "id").map(async (O) => {
551
- const { data: R } = await n.get(`${A.value}?${O}=${g}`);
552
- return R[a.fetchedItemsKey];
553
- })
554
- );
555
- const I = await Promise.all(p), W = /* @__PURE__ */ new Set();
556
- d.value = [], (U = I == null ? void 0 : I.forEach) == null || U.call(I, (O) => {
557
- var R;
558
- (R = O == null ? void 0 : O.forEach) == null || R.call(O, (K) => {
559
- W.has(K.id) || (W.add(K.id), d.value.push(K));
560
- });
561
- });
562
- }
563
- } catch (p) {
564
- ((J = p == null ? void 0 : p.response) == null ? void 0 : J.status) === 404 ? u.value = o("debouncedFilter.errors.invalid") : (d.value = [], S.value = o("debouncedFilter.errors.fetch"));
565
- } finally {
566
- y.value = !1;
567
- }
568
- else
569
- y.value = !0, u.value = "", d.value = (c = w.value) == null ? void 0 : c.filter((p) => {
570
- var I;
571
- let W = !1;
572
- for (const O of a.searchKeys) {
573
- const R = typeof p[O] == "string" ? (I = p[O]) == null ? void 0 : I.toLowerCase() : p[O];
574
- R != null && R.includes(g.toLowerCase()) && (W = !0);
575
- }
576
- return W;
577
- }), (!d.value || !d.value.length) && (u.value = o("debouncedFilter.errors.invalid")), y.value = !1;
578
- }
579
- };
580
- return {
581
- loading: y,
582
- error: S,
583
- validationError: u,
584
- results: d,
585
- allRecords: w,
586
- loadItems: N,
587
- debouncedQueryChange: s
588
- };
589
- }
590
- function $t(e, t) {
591
- const r = b(t), a = k(
592
- () => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${r}`) : new URL(r)
593
- );
594
- return a.value.search = "", (n) => `${a.value.href}/${n}`;
595
- }
596
- function jt() {
597
- const { i18n: { t: e } } = ce();
598
- return {
599
- getMessageFromError: (t) => {
600
- var r, a, n, o;
601
- if (!t)
602
- return e("errors.unexpected");
603
- if (((r = t == null ? void 0 : t.response) == null ? void 0 : r.status) === 401)
604
- return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."), "";
605
- if ((a = t == null ? void 0 : t.response) != null && a.data) {
606
- if (t.response.data.detail)
607
- return t.response.data.detail;
608
- if ((n = t.response.data.details) != null && n.length)
609
- return t.response.data.details.map((i) => {
610
- let s = e("errors.unexpected");
611
- return i.messages && typeof i.messages == "object" && i.messages.length && (s = i.messages.join(", ")), i.field ? `${i.field} - ${s}` : s;
612
- }).join("; ");
613
- if (t.response.data.message) {
614
- const { message: i } = t.response.data;
615
- return Array.isArray(i) ? (o = i[0]) != null && o.constraints ? Object.values(i[0].constraints)[0] : i[0] : i;
616
- }
617
- if (typeof t.response.data == "string")
618
- return t.response.data;
619
- if (typeof t.response.data == "object")
620
- return Object.keys(t.response.data).map((i) => `${i} ${t.response.data[i]}`).join(", ");
621
- }
622
- return t.message || e("errors.unexpected");
623
- }
624
- };
625
- }
626
- function Kt(e) {
627
- const t = window.location.origin, r = t.endsWith("/") ? t : `${t}/`;
628
- try {
629
- const a = e.join("/"), n = `${r}${a}`, o = e.some((i) => i.trim() === "");
630
- if (/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n) && !o && new URL(n))
631
- return `${r}${a}`;
632
- throw new Error("Invalid url");
633
- } catch (a) {
634
- return console.warn("Failed to build valid URL:", a), "";
635
- }
636
- }
637
- function Ue(e, t) {
638
- const r = C(b(e)), a = C(b(t)), n = k(
639
- () => !!(r.value.app === "konnect" || r.value.isExactMatch)
640
- ), o = k(
641
- () => a.value.startsWith("/") ? new URL(`${window.location.origin}${a.value}`) : new URL(a.value)
642
- );
643
- return (i) => {
644
- const { page: s, pageSize: y, offset: S, sortColumnKey: u, sortColumnOrder: d, query: h } = i;
645
- try {
646
- let w = new URL(o.value.href);
647
- return n.value && h ? (w.search = "", w = r.value.isExactMatch ? new URL(`${w.href}/${h}/`) : new URL(`${w.href}?filter[name][contains]=${h}`)) : (n.value || new URLSearchParams(h).forEach((A, $) => {
648
- w.searchParams.append($, A);
649
- }), u && w.searchParams.append("sort_by", u), d === "desc" && w.searchParams.append("sort_desc", "1"), w.searchParams.append("size", String(y))), S && s !== 1 && w.searchParams.append("offset", String(S)), w.href;
650
- } catch (w) {
651
- return console.error("RouteList(fetcher)", w), a.value;
652
- }
653
- };
654
- }
655
- function Ft(e, t, r) {
656
- const a = b(t), { axiosInstance: n } = me(e.axiosRequestConfig), o = Ue(e, a), i = C({
657
- status: ee.Idle
658
- });
659
- return { fetcher: async (s) => {
660
- var y;
661
- const S = Ze(r) || "data";
662
- try {
663
- i.value = { status: ee.Loading };
664
- let u = o(s);
665
- u.includes("filter[name]") && (u = `${u}&page[size]=${s.pageSize}&page[number]=${s.page}`);
666
- const d = await n.get(u);
667
- if (d.status >= 400)
668
- throw d;
669
- const h = d.data, w = S && S.replace(/[^\w-_]/gi, "");
670
- let A;
671
- h[w] ? A = Array.isArray(h[w]) ? h[w] : [h[w]] : Array.isArray(h) ? A = h : A = Object.keys(h).length ? [h] : [];
672
- const $ = {
673
- data: A,
674
- total: A.length,
675
- ...h.offset ? {
676
- pagination: {
677
- offset: h.offset
678
- }
679
- } : null
680
- };
681
- return i.value = {
682
- status: ee.Idle,
683
- response: $
684
- }, $;
685
- } catch (u) {
686
- const d = {
687
- data: [],
688
- total: 0
689
- };
690
- return s.query && (((y = u.response) == null ? void 0 : y.status) === 404 || u.status === 404) ? (i.value = {
691
- status: ee.NoResults,
692
- response: d,
693
- error: u.response ? u : { response: u }
694
- }, d) : (i.value = {
695
- status: ee.Error,
696
- response: d,
697
- error: u.response ? u : { response: u }
698
- }, d);
699
- }
700
- }, fetcherState: i };
701
- }
702
- function Mt() {
703
- const e = (r, a = "_") => r ? r.split(a).map((n) => n.toLowerCase() === "id" ? n.toUpperCase() : n.charAt(0).toUpperCase() + n.substring(1)).join(" ") : "", t = /(?:^|[\s-:'"])\w/g;
704
- return {
705
- capitalize: (r) => r ? r.replace(t, (a) => a.toUpperCase()) : "",
706
- convertKeyToTitle: e
707
- };
708
- }
709
- const De = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Se = (e) => {
710
- if (typeof e != "string")
711
- throw new TypeError("Invalid argument expected string");
712
- const t = e.match(De);
713
- if (!t)
714
- throw new Error(`Invalid argument not valid semver ('${e}' received)`);
715
- return t.shift(), t;
716
- }, xe = (e) => e === "*" || e === "x" || e === "X", Ne = (e) => {
717
- const t = parseInt(e, 10);
718
- return isNaN(t) ? e : t;
719
- }, qt = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Pt = (e, t) => {
720
- if (xe(e) || xe(t))
721
- return 0;
722
- const [r, a] = qt(Ne(e), Ne(t));
723
- return r > a ? 1 : r < a ? -1 : 0;
724
- }, Ae = (e, t) => {
725
- for (let r = 0; r < Math.max(e.length, t.length); r++) {
726
- const a = Pt(e[r] || "0", t[r] || "0");
727
- if (a !== 0)
728
- return a;
729
- }
730
- return 0;
731
- }, Bt = (e, t) => {
732
- const r = Se(e), a = Se(t), n = r.pop(), o = a.pop(), i = Ae(r, a);
733
- return i !== 0 ? i : n && o ? Ae(n.split("."), o.split(".")) : n || o ? n ? -1 : 1 : 0;
734
- }, Te = (e, t, r) => {
735
- Lt(r);
736
- const a = Bt(e, t);
737
- return Re[r].includes(a);
738
- }, Re = {
739
- ">": [1],
740
- ">=": [0, 1],
741
- "=": [0],
742
- "<=": [-1, 0],
743
- "<": [-1],
744
- "!=": [-1, 1]
745
- }, Ie = Object.keys(Re), Lt = (e) => {
746
- if (typeof e != "string")
747
- throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
748
- if (Ie.indexOf(e) === -1)
749
- throw new Error(`Invalid operator, expected one of ${Ie.join("|")}`);
750
- }, Ut = (e) => typeof e == "string" && /^[v\d]/.test(e) && De.test(e);
751
- function Dt(e) {
752
- const { gatewayInfo: t, supportedRange: r } = e;
753
- if (!t)
754
- return !0;
755
- const { edition: a, version: n } = t;
756
- if (!Ut(n))
757
- return console.error("Invalid version"), !1;
758
- const o = r[a];
759
- if (!o)
760
- return !1;
761
- const [i, s] = o;
762
- return !(i && Te(n, i, "<") || s && Te(n, s, ">"));
763
- }
764
- function Rt(e) {
765
- const t = C(0), r = C(0), a = C(!1);
766
- return se(e, (n) => {
767
- n && !a.value && (t.value = n.offsetWidth, r.value = n.scrollWidth, a.value = !0);
768
- }), {
769
- isTruncated: k(() => t.value < r.value)
770
- };
771
- }
772
- function zt() {
773
- const { i18n: { t: e } } = ce();
774
- return {
775
- utf8Name: (t) => /^[\p{N}\p{L}.\-_~]*$/u.test(t) ? "" : e("validationErrors.utf8Name")
776
- };
777
- }
778
- const ve = {
779
- useAxios: me,
780
- useDebouncedFilter: Ot,
781
- useDeleteUrlBuilder: $t,
782
- useErrors: jt,
783
- useExternalLinkCreator: Kt,
784
- useFetcher: Ft,
785
- useFetchUrlBuilder: Ue,
786
- useHelpers: Le,
787
- useStringHelpers: Mt,
788
- useI18n: ce,
789
- useGatewayFeatureSupported: Dt,
790
- useTruncationDetector: Rt,
791
- useValidators: zt
792
- }, be = (e, t) => {
793
- const r = e.__vccOpts || e;
794
- for (const [a, n] of t)
795
- r[a] = n;
796
- return r;
797
- };
798
- /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
799
- function ze(e) {
800
- return typeof e > "u" || e === null;
801
- }
802
- function Vt(e) {
803
- return typeof e == "object" && e !== null;
804
- }
805
- function Ht(e) {
806
- return Array.isArray(e) ? e : ze(e) ? [] : [e];
807
- }
808
- function Jt(e, t) {
809
- var r, a, n, o;
810
- if (t)
811
- for (o = Object.keys(t), r = 0, a = o.length; r < a; r += 1)
812
- n = o[r], e[n] = t[n];
813
- return e;
814
- }
815
- function Wt(e, t) {
816
- var r = "", a;
817
- for (a = 0; a < t; a += 1)
818
- r += e;
819
- return r;
820
- }
821
- function Yt(e) {
822
- return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
823
- }
824
- var Zt = ze, Gt = Vt, Xt = Ht, Qt = Wt, er = Yt, tr = Jt, we = {
825
- isNothing: Zt,
826
- isObject: Gt,
827
- toArray: Xt,
828
- repeat: Qt,
829
- isNegativeZero: er,
830
- extend: tr
831
- };
832
- function Ve(e, t) {
833
- var r = "", a = e.reason || "(unknown reason)";
834
- return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !t && e.mark.snippet && (r += `
835
-
836
- ` + e.mark.snippet), a + " " + r) : a;
837
- }
838
- function ie(e, t) {
839
- Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = Ve(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
840
- }
841
- ie.prototype = Object.create(Error.prototype);
842
- ie.prototype.constructor = ie;
843
- ie.prototype.toString = function(e) {
844
- return this.name + ": " + Ve(this, e);
845
- };
846
- var te = ie, rr = [
847
- "kind",
848
- "multi",
849
- "resolve",
850
- "construct",
851
- "instanceOf",
852
- "predicate",
853
- "represent",
854
- "representName",
855
- "defaultStyle",
856
- "styleAliases"
857
- ], ar = [
858
- "scalar",
859
- "sequence",
860
- "mapping"
861
- ];
862
- function nr(e) {
863
- var t = {};
864
- return e !== null && Object.keys(e).forEach(function(r) {
865
- e[r].forEach(function(a) {
866
- t[String(a)] = r;
867
- });
868
- }), t;
869
- }
870
- function ir(e, t) {
871
- if (t = t || {}, Object.keys(t).forEach(function(r) {
872
- if (rr.indexOf(r) === -1)
873
- throw new te('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
874
- }), this.options = t, this.tag = e, this.kind = t.kind || null, this.resolve = t.resolve || function() {
875
- return !0;
876
- }, this.construct = t.construct || function(r) {
877
- return r;
878
- }, this.instanceOf = t.instanceOf || null, this.predicate = t.predicate || null, this.represent = t.represent || null, this.representName = t.representName || null, this.defaultStyle = t.defaultStyle || null, this.multi = t.multi || !1, this.styleAliases = nr(t.styleAliases || null), ar.indexOf(this.kind) === -1)
879
- throw new te('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
880
- }
881
- var j = ir;
882
- function Ee(e, t) {
883
- var r = [];
884
- return e[t].forEach(function(a) {
885
- var n = r.length;
886
- r.forEach(function(o, i) {
887
- o.tag === a.tag && o.kind === a.kind && o.multi === a.multi && (n = i);
888
- }), r[n] = a;
889
- }), r;
890
- }
891
- function or() {
892
- var e = {
893
- scalar: {},
894
- sequence: {},
895
- mapping: {},
896
- fallback: {},
897
- multi: {
898
- scalar: [],
899
- sequence: [],
900
- mapping: [],
901
- fallback: []
902
- }
903
- }, t, r;
904
- function a(n) {
905
- n.multi ? (e.multi[n.kind].push(n), e.multi.fallback.push(n)) : e[n.kind][n.tag] = e.fallback[n.tag] = n;
906
- }
907
- for (t = 0, r = arguments.length; t < r; t += 1)
908
- arguments[t].forEach(a);
909
- return e;
910
- }
911
- function pe(e) {
912
- return this.extend(e);
913
- }
914
- pe.prototype.extend = function(e) {
915
- var t = [], r = [];
916
- if (e instanceof j)
917
- r.push(e);
918
- else if (Array.isArray(e))
919
- r = r.concat(e);
920
- else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit)))
921
- e.implicit && (t = t.concat(e.implicit)), e.explicit && (r = r.concat(e.explicit));
922
- else
923
- throw new te("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
924
- t.forEach(function(n) {
925
- if (!(n instanceof j))
926
- throw new te("Specified list of YAML types (or a single Type object) contains a non-Type object.");
927
- if (n.loadKind && n.loadKind !== "scalar")
928
- throw new te("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
929
- if (n.multi)
930
- throw new te("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
931
- }), r.forEach(function(n) {
932
- if (!(n instanceof j))
933
- throw new te("Specified list of YAML types (or a single Type object) contains a non-Type object.");
934
- });
935
- var a = Object.create(pe.prototype);
936
- return a.implicit = (this.implicit || []).concat(t), a.explicit = (this.explicit || []).concat(r), a.compiledImplicit = Ee(a, "implicit"), a.compiledExplicit = Ee(a, "explicit"), a.compiledTypeMap = or(a.compiledImplicit, a.compiledExplicit), a;
937
- };
938
- var lr = pe, sr = new j("tag:yaml.org,2002:str", {
939
- kind: "scalar",
940
- construct: function(e) {
941
- return e !== null ? e : "";
942
- }
943
- }), cr = new j("tag:yaml.org,2002:seq", {
944
- kind: "sequence",
945
- construct: function(e) {
946
- return e !== null ? e : [];
947
- }
948
- }), ur = new j("tag:yaml.org,2002:map", {
949
- kind: "mapping",
950
- construct: function(e) {
951
- return e !== null ? e : {};
952
- }
953
- }), dr = new lr({
954
- explicit: [
955
- sr,
956
- cr,
957
- ur
958
- ]
959
- });
960
- function pr(e) {
961
- if (e === null) return !0;
962
- var t = e.length;
963
- return t === 1 && e === "~" || t === 4 && (e === "null" || e === "Null" || e === "NULL");
964
- }
965
- function fr() {
966
- return null;
967
- }
968
- function yr(e) {
969
- return e === null;
970
- }
971
- var gr = new j("tag:yaml.org,2002:null", {
972
- kind: "scalar",
973
- resolve: pr,
974
- construct: fr,
975
- predicate: yr,
976
- represent: {
977
- canonical: function() {
978
- return "~";
979
- },
980
- lowercase: function() {
981
- return "null";
982
- },
983
- uppercase: function() {
984
- return "NULL";
985
- },
986
- camelcase: function() {
987
- return "Null";
988
- },
989
- empty: function() {
990
- return "";
991
- }
992
- },
993
- defaultStyle: "lowercase"
994
- });
995
- function hr(e) {
996
- if (e === null) return !1;
997
- var t = e.length;
998
- return t === 4 && (e === "true" || e === "True" || e === "TRUE") || t === 5 && (e === "false" || e === "False" || e === "FALSE");
999
- }
1000
- function mr(e) {
1001
- return e === "true" || e === "True" || e === "TRUE";
1002
- }
1003
- function vr(e) {
1004
- return Object.prototype.toString.call(e) === "[object Boolean]";
1005
- }
1006
- var br = new j("tag:yaml.org,2002:bool", {
1007
- kind: "scalar",
1008
- resolve: hr,
1009
- construct: mr,
1010
- predicate: vr,
1011
- represent: {
1012
- lowercase: function(e) {
1013
- return e ? "true" : "false";
1014
- },
1015
- uppercase: function(e) {
1016
- return e ? "TRUE" : "FALSE";
1017
- },
1018
- camelcase: function(e) {
1019
- return e ? "True" : "False";
1020
- }
1021
- },
1022
- defaultStyle: "lowercase"
1023
- });
1024
- function wr(e) {
1025
- return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
1026
- }
1027
- function Cr(e) {
1028
- return 48 <= e && e <= 55;
1029
- }
1030
- function kr(e) {
1031
- return 48 <= e && e <= 57;
1032
- }
1033
- function _r(e) {
1034
- if (e === null) return !1;
1035
- var t = e.length, r = 0, a = !1, n;
1036
- if (!t) return !1;
1037
- if (n = e[r], (n === "-" || n === "+") && (n = e[++r]), n === "0") {
1038
- if (r + 1 === t) return !0;
1039
- if (n = e[++r], n === "b") {
1040
- for (r++; r < t; r++)
1041
- if (n = e[r], n !== "_") {
1042
- if (n !== "0" && n !== "1") return !1;
1043
- a = !0;
1044
- }
1045
- return a && n !== "_";
1046
- }
1047
- if (n === "x") {
1048
- for (r++; r < t; r++)
1049
- if (n = e[r], n !== "_") {
1050
- if (!wr(e.charCodeAt(r))) return !1;
1051
- a = !0;
1052
- }
1053
- return a && n !== "_";
1054
- }
1055
- if (n === "o") {
1056
- for (r++; r < t; r++)
1057
- if (n = e[r], n !== "_") {
1058
- if (!Cr(e.charCodeAt(r))) return !1;
1059
- a = !0;
1060
- }
1061
- return a && n !== "_";
1062
- }
1063
- }
1064
- if (n === "_") return !1;
1065
- for (; r < t; r++)
1066
- if (n = e[r], n !== "_") {
1067
- if (!kr(e.charCodeAt(r)))
1068
- return !1;
1069
- a = !0;
1070
- }
1071
- return !(!a || n === "_");
1072
- }
1073
- function Sr(e) {
1074
- var t = e, r = 1, a;
1075
- if (t.indexOf("_") !== -1 && (t = t.replace(/_/g, "")), a = t[0], (a === "-" || a === "+") && (a === "-" && (r = -1), t = t.slice(1), a = t[0]), t === "0") return 0;
1076
- if (a === "0") {
1077
- if (t[1] === "b") return r * parseInt(t.slice(2), 2);
1078
- if (t[1] === "x") return r * parseInt(t.slice(2), 16);
1079
- if (t[1] === "o") return r * parseInt(t.slice(2), 8);
1080
- }
1081
- return r * parseInt(t, 10);
1082
- }
1083
- function xr(e) {
1084
- return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !we.isNegativeZero(e);
1085
- }
1086
- var Nr = new j("tag:yaml.org,2002:int", {
1087
- kind: "scalar",
1088
- resolve: _r,
1089
- construct: Sr,
1090
- predicate: xr,
1091
- represent: {
1092
- binary: function(e) {
1093
- return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
1094
- },
1095
- octal: function(e) {
1096
- return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
1097
- },
1098
- decimal: function(e) {
1099
- return e.toString(10);
1100
- },
1101
- /* eslint-disable max-len */
1102
- hexadecimal: function(e) {
1103
- return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
1104
- }
1105
- },
1106
- defaultStyle: "decimal",
1107
- styleAliases: {
1108
- binary: [2, "bin"],
1109
- octal: [8, "oct"],
1110
- decimal: [10, "dec"],
1111
- hexadecimal: [16, "hex"]
1112
- }
1113
- }), Ar = new RegExp(
1114
- // 2.5e4, 2.5 and integers
1115
- "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
1116
- );
1117
- function Tr(e) {
1118
- return !(e === null || !Ar.test(e) || // Quick hack to not allow integers end with `_`
1119
- // Probably should update regexp & check speed
1120
- e[e.length - 1] === "_");
1121
- }
1122
- function Ir(e) {
1123
- var t, r;
1124
- return t = e.replace(/_/g, "").toLowerCase(), r = t[0] === "-" ? -1 : 1, "+-".indexOf(t[0]) >= 0 && (t = t.slice(1)), t === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : t === ".nan" ? NaN : r * parseFloat(t, 10);
1125
- }
1126
- var Er = /^[-+]?[0-9]+e/;
1127
- function Or(e, t) {
1128
- var r;
1129
- if (isNaN(e))
1130
- switch (t) {
1131
- case "lowercase":
1132
- return ".nan";
1133
- case "uppercase":
1134
- return ".NAN";
1135
- case "camelcase":
1136
- return ".NaN";
1137
- }
1138
- else if (Number.POSITIVE_INFINITY === e)
1139
- switch (t) {
1140
- case "lowercase":
1141
- return ".inf";
1142
- case "uppercase":
1143
- return ".INF";
1144
- case "camelcase":
1145
- return ".Inf";
1146
- }
1147
- else if (Number.NEGATIVE_INFINITY === e)
1148
- switch (t) {
1149
- case "lowercase":
1150
- return "-.inf";
1151
- case "uppercase":
1152
- return "-.INF";
1153
- case "camelcase":
1154
- return "-.Inf";
1155
- }
1156
- else if (we.isNegativeZero(e))
1157
- return "-0.0";
1158
- return r = e.toString(10), Er.test(r) ? r.replace("e", ".e") : r;
1159
- }
1160
- function $r(e) {
1161
- return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || we.isNegativeZero(e));
1162
- }
1163
- var jr = new j("tag:yaml.org,2002:float", {
1164
- kind: "scalar",
1165
- resolve: Tr,
1166
- construct: Ir,
1167
- predicate: $r,
1168
- represent: Or,
1169
- defaultStyle: "lowercase"
1170
- }), Kr = dr.extend({
1171
- implicit: [
1172
- gr,
1173
- br,
1174
- Nr,
1175
- jr
1176
- ]
1177
- }), Fr = Kr, He = new RegExp(
1178
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
1179
- ), Je = new RegExp(
1180
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
1181
- );
1182
- function Mr(e) {
1183
- return e === null ? !1 : He.exec(e) !== null || Je.exec(e) !== null;
1184
- }
1185
- function qr(e) {
1186
- var t, r, a, n, o, i, s, y = 0, S = null, u, d, h;
1187
- if (t = He.exec(e), t === null && (t = Je.exec(e)), t === null) throw new Error("Date resolve error");
1188
- if (r = +t[1], a = +t[2] - 1, n = +t[3], !t[4])
1189
- return new Date(Date.UTC(r, a, n));
1190
- if (o = +t[4], i = +t[5], s = +t[6], t[7]) {
1191
- for (y = t[7].slice(0, 3); y.length < 3; )
1192
- y += "0";
1193
- y = +y;
1194
- }
1195
- return t[9] && (u = +t[10], d = +(t[11] || 0), S = (u * 60 + d) * 6e4, t[9] === "-" && (S = -S)), h = new Date(Date.UTC(r, a, n, o, i, s, y)), S && h.setTime(h.getTime() - S), h;
1196
- }
1197
- function Pr(e) {
1198
- return e.toISOString();
1199
- }
1200
- var Br = new j("tag:yaml.org,2002:timestamp", {
1201
- kind: "scalar",
1202
- resolve: Mr,
1203
- construct: qr,
1204
- instanceOf: Date,
1205
- represent: Pr
1206
- });
1207
- function Lr(e) {
1208
- return e === "<<" || e === null;
1209
- }
1210
- var Ur = new j("tag:yaml.org,2002:merge", {
1211
- kind: "scalar",
1212
- resolve: Lr
1213
- }), Ce = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
1214
- \r`;
1215
- function Dr(e) {
1216
- if (e === null) return !1;
1217
- var t, r, a = 0, n = e.length, o = Ce;
1218
- for (r = 0; r < n; r++)
1219
- if (t = o.indexOf(e.charAt(r)), !(t > 64)) {
1220
- if (t < 0) return !1;
1221
- a += 6;
1222
- }
1223
- return a % 8 === 0;
1224
- }
1225
- function Rr(e) {
1226
- var t, r, a = e.replace(/[\r\n=]/g, ""), n = a.length, o = Ce, i = 0, s = [];
1227
- for (t = 0; t < n; t++)
1228
- t % 4 === 0 && t && (s.push(i >> 16 & 255), s.push(i >> 8 & 255), s.push(i & 255)), i = i << 6 | o.indexOf(a.charAt(t));
1229
- return r = n % 4 * 6, r === 0 ? (s.push(i >> 16 & 255), s.push(i >> 8 & 255), s.push(i & 255)) : r === 18 ? (s.push(i >> 10 & 255), s.push(i >> 2 & 255)) : r === 12 && s.push(i >> 4 & 255), new Uint8Array(s);
1230
- }
1231
- function zr(e) {
1232
- var t = "", r = 0, a, n, o = e.length, i = Ce;
1233
- for (a = 0; a < o; a++)
1234
- a % 3 === 0 && a && (t += i[r >> 18 & 63], t += i[r >> 12 & 63], t += i[r >> 6 & 63], t += i[r & 63]), r = (r << 8) + e[a];
1235
- return n = o % 3, n === 0 ? (t += i[r >> 18 & 63], t += i[r >> 12 & 63], t += i[r >> 6 & 63], t += i[r & 63]) : n === 2 ? (t += i[r >> 10 & 63], t += i[r >> 4 & 63], t += i[r << 2 & 63], t += i[64]) : n === 1 && (t += i[r >> 2 & 63], t += i[r << 4 & 63], t += i[64], t += i[64]), t;
1236
- }
1237
- function Vr(e) {
1238
- return Object.prototype.toString.call(e) === "[object Uint8Array]";
1239
- }
1240
- var Hr = new j("tag:yaml.org,2002:binary", {
1241
- kind: "scalar",
1242
- resolve: Dr,
1243
- construct: Rr,
1244
- predicate: Vr,
1245
- represent: zr
1246
- }), Jr = Object.prototype.hasOwnProperty, Wr = Object.prototype.toString;
1247
- function Yr(e) {
1248
- if (e === null) return !0;
1249
- var t = [], r, a, n, o, i, s = e;
1250
- for (r = 0, a = s.length; r < a; r += 1) {
1251
- if (n = s[r], i = !1, Wr.call(n) !== "[object Object]") return !1;
1252
- for (o in n)
1253
- if (Jr.call(n, o))
1254
- if (!i) i = !0;
1255
- else return !1;
1256
- if (!i) return !1;
1257
- if (t.indexOf(o) === -1) t.push(o);
1258
- else return !1;
1259
- }
1260
- return !0;
1261
- }
1262
- function Zr(e) {
1263
- return e !== null ? e : [];
1264
- }
1265
- var Gr = new j("tag:yaml.org,2002:omap", {
1266
- kind: "sequence",
1267
- resolve: Yr,
1268
- construct: Zr
1269
- }), Xr = Object.prototype.toString;
1270
- function Qr(e) {
1271
- if (e === null) return !0;
1272
- var t, r, a, n, o, i = e;
1273
- for (o = new Array(i.length), t = 0, r = i.length; t < r; t += 1) {
1274
- if (a = i[t], Xr.call(a) !== "[object Object]" || (n = Object.keys(a), n.length !== 1)) return !1;
1275
- o[t] = [n[0], a[n[0]]];
1276
- }
1277
- return !0;
1278
- }
1279
- function ea(e) {
1280
- if (e === null) return [];
1281
- var t, r, a, n, o, i = e;
1282
- for (o = new Array(i.length), t = 0, r = i.length; t < r; t += 1)
1283
- a = i[t], n = Object.keys(a), o[t] = [n[0], a[n[0]]];
1284
- return o;
1285
- }
1286
- var ta = new j("tag:yaml.org,2002:pairs", {
1287
- kind: "sequence",
1288
- resolve: Qr,
1289
- construct: ea
1290
- }), ra = Object.prototype.hasOwnProperty;
1291
- function aa(e) {
1292
- if (e === null) return !0;
1293
- var t, r = e;
1294
- for (t in r)
1295
- if (ra.call(r, t) && r[t] !== null)
1296
- return !1;
1297
- return !0;
1298
- }
1299
- function na(e) {
1300
- return e !== null ? e : {};
1301
- }
1302
- var ia = new j("tag:yaml.org,2002:set", {
1303
- kind: "mapping",
1304
- resolve: aa,
1305
- construct: na
1306
- });
1307
- Fr.extend({
1308
- implicit: [
1309
- Br,
1310
- Ur
1311
- ],
1312
- explicit: [
1313
- Hr,
1314
- Gr,
1315
- ta,
1316
- ia
1317
- ]
1318
- });
1319
- function Oe(e) {
1320
- return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
1321
- ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
1322
- }
1323
- var oa = new Array(256), la = new Array(256);
1324
- for (var ae = 0; ae < 256; ae++)
1325
- oa[ae] = Oe(ae) ? 1 : 0, la[ae] = Oe(ae);
1326
- const le = "24px", We = (e, t) => {
1327
- const r = e.__vccOpts || e;
1328
- for (const [a, n] of t)
1329
- r[a] = n;
1330
- return r;
1331
- }, sa = (e) => (ge("data-v-c1f7c39c"), e = e(), he(), e), ca = ["aria-hidden"], ua = {
1332
- key: 0,
1333
- "data-testid": "kui-icon-svg-title"
1334
- }, da = /* @__PURE__ */ sa(() => /* @__PURE__ */ H("path", {
1335
- d: "M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",
1336
- fill: "currentColor"
1337
- }, null, -1)), pa = /* @__PURE__ */ X({
1338
- __name: "AddIcon",
1339
- props: {
1340
- /** The accessibility text provided to screen readers */
1341
- title: {
1342
- type: String,
1343
- required: !1,
1344
- default: ""
1345
- },
1346
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1347
- color: {
1348
- type: String,
1349
- required: !1,
1350
- default: "currentColor"
1351
- },
1352
- /** The CSS display property for the icon. Defaults to `block` */
1353
- display: {
1354
- type: String,
1355
- required: !1,
1356
- default: "block"
1357
- },
1358
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1359
- decorative: {
1360
- type: Boolean,
1361
- required: !1,
1362
- default: !1
1363
- },
1364
- /** The icon size */
1365
- size: {
1366
- type: [Number, String],
1367
- required: !1,
1368
- default: le,
1369
- // if setting to the imported const fails, just pass a number of 24 as the default.
1370
- validator: (e) => {
1371
- if (typeof e == "number" && e > 0)
1372
- return !0;
1373
- if (typeof e == "string") {
1374
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1375
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1376
- return !0;
1377
- }
1378
- return !1;
1379
- }
1380
- },
1381
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1382
- as: {
1383
- type: String,
1384
- required: !1,
1385
- default: "span"
1386
- }
1387
- },
1388
- setup(e) {
1389
- const t = e, r = k(() => {
1390
- if (typeof t.size == "number" && t.size > 0)
1391
- return `${t.size}px`;
1392
- if (typeof t.size == "string") {
1393
- const n = String(t.size).replace(/px/gi, ""), o = Number(n);
1394
- if (o && !isNaN(o) && Number.isInteger(o) && o > 0)
1395
- return `${o}px`;
1396
- }
1397
- return le;
1398
- }), a = k(() => ({
1399
- boxSizing: "border-box",
1400
- color: t.color,
1401
- display: t.display,
1402
- flexShrink: "0",
1403
- height: r.value,
1404
- lineHeight: "0",
1405
- width: r.value
1406
- }));
1407
- return (n, o) => (_(), D(fe(e.as), {
1408
- "aria-hidden": e.decorative ? "true" : void 0,
1409
- class: "kui-icon add-icon",
1410
- "data-testid": "kui-icon-wrapper-add-icon",
1411
- style: ye(a.value)
1412
- }, {
1413
- default: l(() => [
1414
- (_(), q("svg", {
1415
- "aria-hidden": e.decorative ? "true" : void 0,
1416
- "data-testid": "kui-icon-svg-add-icon",
1417
- fill: "none",
1418
- height: "100%",
1419
- role: "img",
1420
- viewBox: "0 0 24 24",
1421
- width: "100%",
1422
- xmlns: "http://www.w3.org/2000/svg"
1423
- }, [
1424
- e.title ? (_(), q("title", ua, T(e.title), 1)) : z("", !0),
1425
- da
1426
- ], 8, ca))
1427
- ]),
1428
- _: 1
1429
- }, 8, ["aria-hidden", "style"]));
1430
- }
1431
- }), fa = /* @__PURE__ */ We(pa, [["__scopeId", "data-v-c1f7c39c"]]), ya = (e) => (ge("data-v-d9894a05"), e = e(), he(), e), ga = ["aria-hidden"], ha = {
1432
- key: 0,
1433
- "data-testid": "kui-icon-svg-title"
1434
- }, ma = /* @__PURE__ */ ya(() => /* @__PURE__ */ H("path", {
1435
- d: "M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",
1436
- fill: "currentColor"
1437
- }, null, -1)), va = /* @__PURE__ */ X({
1438
- __name: "MoreIcon",
1439
- props: {
1440
- /** The accessibility text provided to screen readers */
1441
- title: {
1442
- type: String,
1443
- required: !1,
1444
- default: ""
1445
- },
1446
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1447
- color: {
1448
- type: String,
1449
- required: !1,
1450
- default: "currentColor"
1451
- },
1452
- /** The CSS display property for the icon. Defaults to `block` */
1453
- display: {
1454
- type: String,
1455
- required: !1,
1456
- default: "block"
1457
- },
1458
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1459
- decorative: {
1460
- type: Boolean,
1461
- required: !1,
1462
- default: !1
1463
- },
1464
- /** The icon size */
1465
- size: {
1466
- type: [Number, String],
1467
- required: !1,
1468
- default: le,
1469
- // if setting to the imported const fails, just pass a number of 24 as the default.
1470
- validator: (e) => {
1471
- if (typeof e == "number" && e > 0)
1472
- return !0;
1473
- if (typeof e == "string") {
1474
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1475
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1476
- return !0;
1477
- }
1478
- return !1;
1479
- }
1480
- },
1481
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1482
- as: {
1483
- type: String,
1484
- required: !1,
1485
- default: "span"
1486
- }
1487
- },
1488
- setup(e) {
1489
- const t = e, r = k(() => {
1490
- if (typeof t.size == "number" && t.size > 0)
1491
- return `${t.size}px`;
1492
- if (typeof t.size == "string") {
1493
- const n = String(t.size).replace(/px/gi, ""), o = Number(n);
1494
- if (o && !isNaN(o) && Number.isInteger(o) && o > 0)
1495
- return `${o}px`;
1496
- }
1497
- return le;
1498
- }), a = k(() => ({
1499
- boxSizing: "border-box",
1500
- color: t.color,
1501
- display: t.display,
1502
- flexShrink: "0",
1503
- height: r.value,
1504
- lineHeight: "0",
1505
- width: r.value
1506
- }));
1507
- return (n, o) => (_(), D(fe(e.as), {
1508
- "aria-hidden": e.decorative ? "true" : void 0,
1509
- class: "kui-icon more-icon",
1510
- "data-testid": "kui-icon-wrapper-more-icon",
1511
- style: ye(a.value)
1512
- }, {
1513
- default: l(() => [
1514
- (_(), q("svg", {
1515
- "aria-hidden": e.decorative ? "true" : void 0,
1516
- "data-testid": "kui-icon-svg-more-icon",
1517
- fill: "none",
1518
- height: "100%",
1519
- role: "img",
1520
- viewBox: "0 0 24 24",
1521
- width: "100%",
1522
- xmlns: "http://www.w3.org/2000/svg"
1523
- }, [
1524
- e.title ? (_(), q("title", ha, T(e.title), 1)) : z("", !0),
1525
- ma
1526
- ], 8, ga))
1527
- ]),
1528
- _: 1
1529
- }, 8, ["aria-hidden", "style"]));
1530
- }
1531
- }), ba = /* @__PURE__ */ We(va, [["__scopeId", "data-v-d9894a05"]]), wa = ["data-truncate"], Ca = /* @__PURE__ */ X({
1532
- __name: "EntityBaseTableCell",
1533
- props: {
1534
- keyName: {
1535
- type: String,
1536
- required: !0
1537
- },
1538
- rowEl: {
1539
- type: [Object, null],
1540
- required: !0
1541
- },
1542
- tooltip: {
1543
- type: Boolean,
1544
- default: !1
1545
- }
1546
- },
1547
- setup(e) {
1548
- const t = e, r = k(() => {
1549
- var N;
1550
- return ((N = t.rowEl) == null ? void 0 : N.querySelector(`[data-testid="${t.keyName}"]`)) || null;
1551
- }), a = k(() => {
1552
- var N;
1553
- return ((N = r.value) == null ? void 0 : N.querySelector('[data-truncate="true"]')) || null;
1554
- }), n = k(() => {
1555
- var N, E;
1556
- const M = (N = t.rowEl) == null ? void 0 : N.querySelectorAll("td");
1557
- return M ? ((E = M[0]) == null ? void 0 : E.getAttribute("data-testid")) === t.keyName : !0;
1558
- }), o = k(() => n.value || t.tooltip);
1559
- let i;
1560
- const s = () => {
1561
- i && (i.disconnect(), i = void 0);
1562
- }, y = () => {
1563
- var N, E, M;
1564
- let g = ((N = r.value) == null ? void 0 : N.clientWidth) || 0;
1565
- if (r.value && "getComputedStyle" in window) {
1566
- const U = window.getComputedStyle(r.value);
1567
- g -= (parseFloat(U.paddingLeft) || 0) + (parseFloat(U.paddingRight) || 0);
1568
- }
1569
- u.value = ((E = a.value) == null ? void 0 : E.getBoundingClientRect().width) || 0, d.value = g, h.value = ((M = S.value) == null ? void 0 : M.innerText) || "";
1570
- }, S = C({}), u = C(0), d = C(0), h = C(""), w = k(() => [a.value, r.value]), A = se(
1571
- w,
1572
- (N) => {
1573
- if (o.value && (s(), "ResizeObserver" in window && window)) {
1574
- i = new ResizeObserver((E) => {
1575
- window.requestAnimationFrame(() => {
1576
- !Array.isArray(E) || !E.length || y();
1577
- });
1578
- });
1579
- for (const E of N)
1580
- E && i.observe(E);
1581
- }
1582
- },
1583
- { immediate: !0, flush: "post", deep: !0 }
1584
- ), $ = k(() => o.value ? u.value > d.value : !1);
1585
- return Xe(() => {
1586
- y();
1587
- }), Qe(() => {
1588
- A();
1589
- }), (N, E) => {
1590
- const M = L("KTooltip");
1591
- return _(), q("span", {
1592
- ref_key: "contentRef",
1593
- ref: S,
1594
- class: "content-wrapper"
1595
- }, [
1596
- o.value ? (_(), q("span", {
1597
- key: 0,
1598
- "data-truncate": o.value || void 0
1599
- }, [
1600
- v(M, {
1601
- "max-width": "300",
1602
- placement: "bottom-start",
1603
- text: $.value ? h.value : ""
1604
- }, {
1605
- default: l(() => [
1606
- G(N.$slots, "default", {}, void 0, !0)
1607
- ]),
1608
- _: 3
1609
- }, 8, ["text"])
1610
- ], 8, wa)) : G(N.$slots, "default", { key: 1 }, void 0, !0)
1611
- ], 512);
1612
- };
1613
- }
1614
- }), ka = /* @__PURE__ */ be(Ca, [["__scopeId", "data-v-b252463e"]]), _a = { class: "toolbar-container" }, Sa = {
1615
- key: 0,
1616
- class: "toolbar-button-container"
1617
- }, xa = ["data-testid"], Na = /* @__PURE__ */ X({
1618
- __name: "EntityBaseTable",
1619
- props: {
1620
- // table header configuration
1621
- tableHeaders: {
1622
- type: Object,
1623
- required: !0,
1624
- default: () => ({})
1625
- },
1626
- // fetcher function
1627
- fetcher: {
1628
- type: Function,
1629
- required: !0,
1630
- default: async () => ({
1631
- data: [],
1632
- total: 0
1633
- })
1634
- },
1635
- initialFetcherParams: {
1636
- type: Object,
1637
- default: null
1638
- },
1639
- // used to identify the cache entry
1640
- cacheIdentifier: {
1641
- type: String,
1642
- default: ""
1643
- },
1644
- // cache key for the fetcher
1645
- fetcherCacheKey: {
1646
- type: Number,
1647
- default: 1
1648
- },
1649
- // whether the table is loading
1650
- isLoading: {
1651
- type: Boolean,
1652
- default: !1
1653
- },
1654
- // search query
1655
- query: {
1656
- type: String,
1657
- default: ""
1658
- },
1659
- // Enable client-side sort (e.g. for Koko endpoints that do not support sort)
1660
- enableClientSort: {
1661
- type: Boolean,
1662
- default: !1
1663
- },
1664
- sortHandlerFunction: {
1665
- type: Function,
1666
- default: () => ({})
1667
- },
1668
- // whether to show the actions column
1669
- enableEntityActions: {
1670
- type: Boolean,
1671
- default: !0
1672
- },
1673
- // options for the empty state
1674
- emptyStateOptions: {
1675
- type: Object,
1676
- default: () => ({})
1677
- },
1678
- // error message to show in the error state
1679
- // this prop being set (or empty) determines if the KTable is in an error state
1680
- // please use `TableErrorMessage` since `string` is only for backwards compatibility
1681
- errorMessage: {
1682
- type: [String, Object],
1683
- default: null
1684
- },
1685
- disablePaginationPageJump: {
1686
- type: Boolean,
1687
- default: void 0
1688
- },
1689
- disableSorting: {
1690
- type: Boolean,
1691
- default: void 0
1692
- },
1693
- paginationType: {
1694
- type: String,
1695
- default: void 0
1696
- },
1697
- // A function for applying attributes to cells
1698
- cellAttributes: {
1699
- type: Function,
1700
- default: () => ({})
1701
- },
1702
- // A function for applying attributes to rows
1703
- rowAttributes: {
1704
- type: Function,
1705
- default: () => ({})
1706
- },
1707
- /** tableKey to use for user table preferences. If empty, will fallback to default preferences */
1708
- preferencesStorageKey: {
1709
- type: String,
1710
- default: "",
1711
- required: !0
1712
- },
1713
- /** dropdown menu width, default to 200px, defined in kPop */
1714
- dropdownMenuWidth: {
1715
- type: String,
1716
- default: "",
1717
- required: !1
1718
- },
1719
- title: {
1720
- type: String,
1721
- default: ""
1722
- },
1723
- titleTag: {
1724
- type: String,
1725
- default: "h2"
1726
- },
1727
- /** default to false, setting to true will suppress the row click event even if "@click:row" is attached */
1728
- disableRowClick: {
1729
- type: Boolean,
1730
- default: !1
1731
- }
1732
- },
1733
- emits: ["click:row", "sort", "clear-search-input", "empty-state-cta-clicked"],
1734
- setup(e, { emit: t }) {
1735
- const r = e, a = t, { i18n: { t: n } } = ve.useI18n(), o = k(() => {
1736
- var c, p;
1737
- return typeof r.errorMessage == "string" ? {
1738
- hasError: !!r.errorMessage,
1739
- title: r.errorMessage,
1740
- message: void 0
1741
- } : {
1742
- hasError: !!r.errorMessage,
1743
- title: (c = r.errorMessage) == null ? void 0 : c.title,
1744
- message: (p = r.errorMessage) == null ? void 0 : p.message
1745
- };
1746
- }), i = k(() => r.cacheIdentifier || r.preferencesStorageKey), s = (c) => c.hasData || !!r.query, y = k(() => {
1747
- const c = [];
1748
- return Object.keys(r.tableHeaders).forEach((p) => {
1749
- const I = r.tableHeaders[p];
1750
- c.push({
1751
- label: I.label ?? p,
1752
- key: p,
1753
- sortable: I.sortable ?? !1,
1754
- hidable: I.hidable ?? !0
1755
- });
1756
- }), r.enableEntityActions && c.push({
1757
- key: "actions",
1758
- hideLabel: !0
1759
- }), c;
1760
- }), S = (c) => ({
1761
- "data-rowid": c.id,
1762
- "data-testid": c.name,
1763
- ...r.rowAttributes(c)
1764
- }), u = C({}), d = (c) => {
1765
- var p;
1766
- return (p = u.value) == null ? void 0 : p.$el.querySelector(`[data-rowid="${c.id}"]`);
1767
- }, h = (c) => {
1768
- const p = {
1769
- "data-testid": c.headerKey,
1770
- ...r.cellAttributes(c)
1771
- };
1772
- return c.colIndex === 0 && (p.style = {
1773
- maxWidth: "250px",
1774
- overflowX: "hidden",
1775
- textOverflow: "ellipsis"
1776
- }), p;
1777
- }, w = () => {
1778
- a("empty-state-cta-clicked"), A();
1779
- }, A = () => {
1780
- a("clear-search-input");
1781
- }, $ = k(() => r.disableRowClick ? void 0 : (c, p) => {
1782
- a("click:row", p);
1783
- }), N = (c) => {
1784
- a("sort", c);
1785
- }, { setTablePreferences: E, getTablePreferences: M } = bt(), g = C(M(i.value)), U = k(() => {
1786
- const c = M(i.value);
1787
- return {
1788
- ...r.initialFetcherParams,
1789
- ...c
1790
- };
1791
- }), J = (c) => {
1792
- g.value = c, y.value.forEach((p) => {
1793
- !("hidable" in p) || !g.value.columnVisibility || p.hidable === !1 && (g.value.columnVisibility[p.key] = !0);
1794
- }), i.value && E(i.value, c);
1795
- };
1796
- return (c, p) => {
1797
- const I = L("KButton"), W = L("KDropdown"), O = L("KTable"), R = L("KCard");
1798
- return _(), D(R, {
1799
- class: "kong-ui-entity-base-table",
1800
- title: e.title,
1801
- "title-tag": e.titleTag
1802
- }, {
1803
- default: l(() => [
1804
- v(O, {
1805
- ref_key: "tableRefs",
1806
- ref: u,
1807
- "cache-identifier": i.value,
1808
- "cell-attrs": h,
1809
- "client-sort": e.enableClientSort,
1810
- "disable-pagination-page-jump": e.disablePaginationPageJump,
1811
- "empty-state-action-message": e.query ? b(n)("baseTable.emptyState.noSearchResultsCtaText") : e.emptyStateOptions.ctaText,
1812
- "empty-state-action-route": e.query ? void 0 : e.emptyStateOptions.ctaPath,
1813
- "empty-state-icon-variant": e.query ? "search" : "kong",
1814
- "empty-state-message": e.query ? b(n)("baseTable.emptyState.noSearchResultsMessage") : e.emptyStateOptions.message,
1815
- "empty-state-title": e.query ? b(n)("baseTable.emptyState.noSearchResultsTitle") : e.emptyStateOptions.title,
1816
- error: o.value.hasError,
1817
- "error-state-message": o.value.message,
1818
- "error-state-title": o.value.title,
1819
- fetcher: e.fetcher,
1820
- "fetcher-cache-key": String(e.fetcherCacheKey),
1821
- headers: y.value,
1822
- "hide-pagination-when-optional": "",
1823
- "initial-fetcher-params": U.value,
1824
- loading: e.isLoading,
1825
- "pagination-offset": e.paginationType === "offset",
1826
- "resize-columns": "",
1827
- "row-attrs": S,
1828
- "search-input": e.query,
1829
- "sort-handler-function": e.enableClientSort ? e.sortHandlerFunction : void 0,
1830
- sortable: !e.disableSorting,
1831
- "table-preferences": g.value,
1832
- onEmptyStateActionClick: w,
1833
- "onRow:click": $.value,
1834
- onSort: p[0] || (p[0] = (K) => N(K)),
1835
- "onUpdate:tablePreferences": J
1836
- }, $e({
1837
- toolbar: l(({ state: K }) => [
1838
- je(H("div", _a, [
1839
- G(c.$slots, "toolbar-filter", {}, void 0, !0),
1840
- c.$slots["toolbar-button"] ? (_(), q("div", Sa, [
1841
- G(c.$slots, "toolbar-button", {}, void 0, !0)
1842
- ])) : z("", !0)
1843
- ], 512), [
1844
- [Ke, s(K)]
1845
- ])
1846
- ]),
1847
- actions: l(({ row: K, rowKey: Y, rowValue: Q }) => [
1848
- H("div", {
1849
- class: "actions-container",
1850
- "data-testid": K.name
1851
- }, [
1852
- v(W, {
1853
- "kpop-attributes": { placement: "bottom-end" },
1854
- width: e.dropdownMenuWidth
1855
- }, {
1856
- items: l(() => [
1857
- G(c.$slots, "actions", {
1858
- row: K,
1859
- rowKey: Y,
1860
- rowValue: Q
1861
- }, void 0, !0)
1862
- ]),
1863
- default: l(() => [
1864
- v(I, {
1865
- appearance: "tertiary",
1866
- class: "actions-trigger",
1867
- "data-testid": "overflow-actions-button",
1868
- icon: "",
1869
- size: "small"
1870
- }, {
1871
- default: l(() => [
1872
- v(b(ba))
1873
- ]),
1874
- _: 1
1875
- })
1876
- ]),
1877
- _: 2
1878
- }, 1032, ["width"])
1879
- ], 8, xa)
1880
- ]),
1881
- _: 2
1882
- }, [
1883
- Fe(e.tableHeaders, (K, Y) => ({
1884
- name: Y,
1885
- fn: l(({ row: Q, rowKey: f, rowValue: x }) => [
1886
- v(ka, {
1887
- "key-name": String(Y),
1888
- "row-el": d(Q),
1889
- tooltip: K.tooltip
1890
- }, {
1891
- default: l(() => [
1892
- G(c.$slots, Y, {
1893
- row: Q,
1894
- rowKey: f,
1895
- rowValue: x
1896
- }, () => [
1897
- B(T(x), 1)
1898
- ], !0)
1899
- ]),
1900
- _: 2
1901
- }, 1032, ["key-name", "row-el", "tooltip"])
1902
- ])
1903
- })),
1904
- e.query ? void 0 : {
1905
- name: "empty-state-action-icon",
1906
- fn: l(() => [
1907
- v(b(fa))
1908
- ]),
1909
- key: "0"
1910
- }
1911
- ]), 1032, ["cache-identifier", "client-sort", "disable-pagination-page-jump", "empty-state-action-message", "empty-state-action-route", "empty-state-icon-variant", "empty-state-message", "empty-state-title", "error", "error-state-message", "error-state-title", "fetcher", "fetcher-cache-key", "headers", "initial-fetcher-params", "loading", "pagination-offset", "search-input", "sort-handler-function", "sortable", "table-preferences", "onRow:click"])
1912
- ]),
1913
- _: 3
1914
- }, 8, ["title", "title-tag"]);
1915
- };
1916
- }
1917
- }), Aa = /* @__PURE__ */ be(Na, [["__scopeId", "data-v-71b4425a"]]), Ta = {
1918
- key: 0,
1919
- class: "kong-ui-entity-delete-error"
1920
- }, Ia = {
1921
- key: 1,
1922
- class: "description"
1923
- }, Ea = /* @__PURE__ */ X({
1924
- __name: "EntityDeleteModal",
1925
- props: {
1926
- visible: {
1927
- type: Boolean,
1928
- required: !0,
1929
- default: !1
1930
- },
1931
- title: {
1932
- type: String,
1933
- default: "Delete"
1934
- },
1935
- entityType: {
1936
- type: String,
1937
- required: !0
1938
- },
1939
- entityName: {
1940
- type: String,
1941
- default: ""
1942
- },
1943
- needConfirm: {
1944
- type: Boolean,
1945
- default: !0
1946
- },
1947
- description: {
1948
- type: String,
1949
- default: ""
1950
- },
1951
- actionPending: {
1952
- type: Boolean,
1953
- default: !1
1954
- },
1955
- error: {
1956
- type: String,
1957
- default: ""
1958
- }
1959
- },
1960
- emits: ["cancel", "proceed"],
1961
- setup(e, { emit: t }) {
1962
- const { i18nT: r } = ve.useI18n(), a = e, n = t, o = k(() => a.needConfirm ? a.entityName : ""), i = () => {
1963
- n("cancel");
1964
- }, s = () => {
1965
- n("proceed");
1966
- };
1967
- return (y, S) => {
1968
- const u = L("KAlert"), d = L("KPrompt");
1969
- return _(), D(d, {
1970
- "action-button-appearance": "danger",
1971
- "action-button-disabled": e.actionPending,
1972
- "action-button-text": "Yes, delete",
1973
- class: "kong-ui-entity-delete-modal",
1974
- "confirmation-text": o.value,
1975
- title: e.title,
1976
- visible: e.visible,
1977
- onCancel: i,
1978
- onProceed: s
1979
- }, {
1980
- default: l(() => [
1981
- e.error ? (_(), q("div", Ta, [
1982
- v(u, { appearance: "danger" }, {
1983
- default: l(() => [
1984
- B(T(e.error), 1)
1985
- ]),
1986
- _: 1
1987
- })
1988
- ])) : z("", !0),
1989
- v(b(r), {
1990
- class: "message",
1991
- keypath: a.entityName ? "deleteModal.messageWithName" : "deleteModal.message",
1992
- tag: "p"
1993
- }, $e({
1994
- entityType: l(() => [
1995
- B(T(a.entityType), 1)
1996
- ]),
1997
- _: 2
1998
- }, [
1999
- a.entityName ? {
2000
- name: "entityName",
2001
- fn: l(() => [
2002
- H("strong", null, T(a.entityName), 1)
2003
- ]),
2004
- key: "0"
2005
- } : void 0
2006
- ]), 1032, ["keypath"]),
2007
- a.description || y.$slots.description ? (_(), q("div", Ia, [
2008
- G(y.$slots, "description", {}, () => [
2009
- H("p", null, T(a.description), 1)
2010
- ], !0)
2011
- ])) : z("", !0)
2012
- ]),
2013
- _: 3
2014
- }, 8, ["action-button-disabled", "confirmation-text", "title", "visible"]);
2015
- };
2016
- }
2017
- }), Oa = /* @__PURE__ */ be(Ea, [["__scopeId", "data-v-4361d622"]]), de = /* @__PURE__ */ X({
2018
- __name: "PermissionsWrapper",
2019
- props: {
2020
- /**
2021
- * Provide an async function that returns a boolean to determine whether
2022
- * the wrapper should hide or show the default slot content.
2023
- */
2024
- authFunction: {
2025
- type: Function,
2026
- required: !0,
2027
- default: async () => !0
2028
- },
2029
- /**
2030
- * Should the default slot content be shown once the authFunction is evaluated no matter what?
2031
- * e.g. if you want to display the item but disable it.
2032
- */
2033
- forceShow: {
2034
- type: Boolean,
2035
- default: !1
2036
- }
2037
- },
2038
- setup(e) {
2039
- const t = e, r = C(void 0), a = k(() => r.value === !0 || r.value !== void 0 && t.forceShow === !0);
2040
- return se(() => t.authFunction, async () => {
2041
- r.value = await t.authFunction();
2042
- }, { immediate: !0 }), (n, o) => a.value ? G(n.$slots, "default", {
2043
- key: 0,
2044
- isAllowed: r.value
2045
- }) : z("", !0);
2046
- }
2047
- }), $a = [];
2048
- for (let e = 0; e < 256; ++e)
2049
- $a.push((e + 256).toString(16).slice(1));
2050
- typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2051
- const { useAxios: ja, useDeleteUrlBuilder: Ka, useErrors: Va, useExternalLinkCreator: Ha, useFetchUrlBuilder: Ja, useFetcher: Fa, useDebouncedFilter: Wa, useStringHelpers: Ya, useHelpers: Za, useGatewayFeatureSupported: Ga, useTruncationDetector: Xa, useValidators: Qa } = ve, Ma = { class: "kong-ui-entities-consumer-credentials-list" }, qa = { key: 1 }, Pa = /* @__PURE__ */ X({
164
+ }, De = { class: "kong-ui-entities-consumer-credentials-list" }, Te = { key: 1 }, Ke = /* @__PURE__ */ ae({
2052
165
  __name: "ConsumerCredentialList",
2053
166
  props: {
2054
167
  /** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
2055
168
  config: {
2056
169
  type: Object,
2057
170
  required: !0,
2058
- validator: (e) => !(!e || !["konnect", "kongManager"].includes(e == null ? void 0 : e.app) || !e.createRoute || !e.getEditRoute)
171
+ validator: (l) => !(!l || !["konnect", "kongManager"].includes(l == null ? void 0 : l.app) || !l.createRoute || !l.getEditRoute)
2059
172
  },
2060
173
  // used to override the default identifier for the cache entry
2061
174
  cacheIdentifier: {
@@ -2087,324 +200,324 @@ const { useAxios: ja, useDeleteUrlBuilder: Ka, useErrors: Va, useExternalLinkCre
2087
200
  }
2088
201
  },
2089
202
  emits: ["error", "copy:success", "copy:error", "delete:success"],
2090
- setup(e, { emit: t }) {
2091
- var Q;
2092
- const r = t, a = e, { i18n: { t: n, formatUnixTimeStamp: o } } = yt.useI18n(), { axiosInstance: i } = ja((Q = a.config) == null ? void 0 : Q.axiosRequestConfig), s = C(1), y = {
203
+ setup(l, { emit: I }) {
204
+ var F;
205
+ const g = I, i = l, { i18n: { t: e, formatUnixTimeStamp: L } } = Ae.useI18n(), { axiosInstance: R } = ye((F = i.config) == null ? void 0 : F.axiosRequestConfig), x = m(1), U = {
2093
206
  acls: {
2094
- group: { label: n("credentials.list.table_headers.acls.group") },
2095
- created_at: { label: n("credentials.list.table_headers.acls.created_at") },
2096
- tags: { label: n("credentials.list.table_headers.acls.tags") }
207
+ group: { label: e("credentials.list.table_headers.acls.group") },
208
+ created_at: { label: e("credentials.list.table_headers.acls.created_at") },
209
+ tags: { label: e("credentials.list.table_headers.acls.tags") }
2097
210
  },
2098
211
  "basic-auth": {
2099
- password: { label: n("credentials.list.table_headers.basic-auth.password") },
2100
- username: { label: n("credentials.list.table_headers.basic-auth.username") },
2101
- created_at: { label: n("credentials.list.table_headers.basic-auth.created_at") },
2102
- tags: { label: n("credentials.list.table_headers.basic-auth.tags") }
212
+ password: { label: e("credentials.list.table_headers.basic-auth.password") },
213
+ username: { label: e("credentials.list.table_headers.basic-auth.username") },
214
+ created_at: { label: e("credentials.list.table_headers.basic-auth.created_at") },
215
+ tags: { label: e("credentials.list.table_headers.basic-auth.tags") }
2103
216
  },
2104
217
  "key-auth": {
2105
- key: { label: n("credentials.list.table_headers.key-auth.key") },
2106
- created_at: { label: n("credentials.list.table_headers.key-auth.created_at") },
2107
- tags: { label: n("credentials.list.table_headers.key-auth.tags") }
218
+ key: { label: e("credentials.list.table_headers.key-auth.key") },
219
+ created_at: { label: e("credentials.list.table_headers.key-auth.created_at") },
220
+ tags: { label: e("credentials.list.table_headers.key-auth.tags") }
2108
221
  },
2109
222
  "key-auth-enc": {
2110
- key: { label: n("credentials.list.table_headers.key-auth-enc.key") },
2111
- created_at: { label: n("credentials.list.table_headers.key-auth-enc.created_at") },
2112
- tags: { label: n("credentials.list.table_headers.key-auth-enc.tags") }
223
+ key: { label: e("credentials.list.table_headers.key-auth-enc.key") },
224
+ created_at: { label: e("credentials.list.table_headers.key-auth-enc.created_at") },
225
+ tags: { label: e("credentials.list.table_headers.key-auth-enc.tags") }
2113
226
  },
2114
227
  oauth2: {
2115
- name: { label: n("credentials.list.table_headers.oauth2.name") },
2116
- client_id: { label: n("credentials.list.table_headers.oauth2.client_id") },
2117
- client_secret: { label: n("credentials.list.table_headers.oauth2.client_secret") },
2118
- created_at: { label: n("credentials.list.table_headers.oauth2.created_at") },
2119
- tags: { label: n("credentials.list.table_headers.oauth2.tags") }
228
+ name: { label: e("credentials.list.table_headers.oauth2.name") },
229
+ client_id: { label: e("credentials.list.table_headers.oauth2.client_id") },
230
+ client_secret: { label: e("credentials.list.table_headers.oauth2.client_secret") },
231
+ created_at: { label: e("credentials.list.table_headers.oauth2.created_at") },
232
+ tags: { label: e("credentials.list.table_headers.oauth2.tags") }
2120
233
  },
2121
234
  "hmac-auth": {
2122
- username: { label: n("credentials.list.table_headers.hmac-auth.username") },
2123
- secret: { label: n("credentials.list.table_headers.hmac-auth.secret") },
2124
- created_at: { label: n("credentials.list.table_headers.hmac-auth.created_at") },
2125
- tags: { label: n("credentials.list.table_headers.hmac-auth.tags") }
235
+ username: { label: e("credentials.list.table_headers.hmac-auth.username") },
236
+ secret: { label: e("credentials.list.table_headers.hmac-auth.secret") },
237
+ created_at: { label: e("credentials.list.table_headers.hmac-auth.created_at") },
238
+ tags: { label: e("credentials.list.table_headers.hmac-auth.tags") }
2126
239
  },
2127
240
  jwt: {
2128
- key: { label: n("credentials.list.table_headers.jwt.key") },
2129
- algorithm: { label: n("credentials.list.table_headers.jwt.algorithm") },
2130
- created_at: { label: n("credentials.list.table_headers.jwt.created_at") },
2131
- tags: { label: n("credentials.list.table_headers.jwt.tags") }
241
+ key: { label: e("credentials.list.table_headers.jwt.key") },
242
+ algorithm: { label: e("credentials.list.table_headers.jwt.algorithm") },
243
+ created_at: { label: e("credentials.list.table_headers.jwt.created_at") },
244
+ tags: { label: e("credentials.list.table_headers.jwt.tags") }
2132
245
  }
2133
- }, S = k(() => y[a.config.plugin]), u = k(() => {
2134
- let f = `${a.config.apiBaseUrl}${gt.list[a.config.app]}`;
2135
- return a.config.app === "konnect" ? f = f.replace(/{controlPlaneId}/gi, a.config.controlPlaneId || "").replace(/{consumerId}/gi, a.config.consumerId || "").replace(/{plugin}/gi, a.config.plugin || "") : a.config.app === "kongManager" && (f = f.replace(/\/{workspace}/gi, a.config.workspace ? `/${a.config.workspace}` : "").replace(/{consumerId}/gi, a.config.consumerId || "").replace(/{plugin}/gi, a.config.plugin || "")), f;
2136
- }), { fetcher: d, fetcherState: h } = Fa(a.config, u), w = () => {
2137
- s.value++;
2138
- }, A = C(null), $ = (f, x, V) => {
2139
- const P = x ? f[x] : JSON.stringify(f);
2140
- if (!V(P)) {
2141
- E(f, x);
246
+ }, J = B(() => U[i.config.plugin]), $ = B(() => {
247
+ let t = `${i.config.apiBaseUrl}${Ne.list[i.config.app]}`;
248
+ return i.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, i.config.controlPlaneId || "").replace(/{consumerId}/gi, i.config.consumerId || "").replace(/{plugin}/gi, i.config.plugin || "") : i.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, i.config.workspace ? `/${i.config.workspace}` : "").replace(/{consumerId}/gi, i.config.consumerId || "").replace(/{plugin}/gi, i.config.plugin || "")), t;
249
+ }), { fetcher: q, fetcherState: H } = ge(i.config, $), W = () => {
250
+ x.value++;
251
+ }, w = m(null), b = (t, r, h) => {
252
+ const d = r ? t[r] : JSON.stringify(t);
253
+ if (!h(d)) {
254
+ G(t, r);
2142
255
  return;
2143
256
  }
2144
- N(f, x);
2145
- }, N = (f, x) => {
2146
- r("copy:success", {
2147
- entity: f,
2148
- field: x,
2149
- message: x && !["password", "key", "client_secret", "secret"].includes(x) ? n("credentials.copy.success", { val: f[x] }) : n("credentials.copy.success_brief")
257
+ z(t, r);
258
+ }, z = (t, r) => {
259
+ g("copy:success", {
260
+ entity: t,
261
+ field: r,
262
+ message: r && !["password", "key", "client_secret", "secret"].includes(r) ? e("credentials.copy.success", { val: t[r] }) : e("credentials.copy.success_brief")
2150
263
  });
2151
- }, E = (f, x) => {
2152
- r("copy:error", {
2153
- entity: f,
2154
- field: x,
2155
- message: n("credentials.error.copy")
264
+ }, G = (t, r) => {
265
+ g("copy:error", {
266
+ entity: t,
267
+ field: r,
268
+ message: e("credentials.error.copy")
2156
269
  });
2157
- }, M = (f) => ({
2158
- label: n("credentials.actions.edit"),
2159
- to: a.config.getEditRoute(f)
2160
- }), g = C(void 0), U = C(!1), J = C(!1), c = C(""), p = Ka(a.config, u.value), I = k(() => Pe[a.config.plugin]), W = (f) => {
2161
- g.value = f, U.value = !0;
2162
- }, O = () => {
2163
- U.value = !1;
2164
- }, R = async () => {
2165
- var f, x, V;
2166
- if ((f = g.value) != null && f.id) {
2167
- J.value = !0;
270
+ }, Q = (t) => ({
271
+ label: e("credentials.actions.edit"),
272
+ to: i.config.getEditRoute(t)
273
+ }), A = m(void 0), N = m(!1), D = m(!1), O = m(""), V = fe(i.config, $.value), X = B(() => me[i.config.plugin]), Y = (t) => {
274
+ A.value = t, N.value = !0;
275
+ }, Z = () => {
276
+ N.value = !1;
277
+ }, ee = async () => {
278
+ var t, r, h;
279
+ if ((t = A.value) != null && t.id) {
280
+ D.value = !0;
2168
281
  try {
2169
- await i.delete(p(g.value.id)), J.value = !1, U.value = !1, s.value++, r("delete:success", g.value);
2170
- } catch (P) {
2171
- c.value = ((V = (x = P.response) == null ? void 0 : x.data) == null ? void 0 : V.message) || P.message || n("credentials.error.delete"), r("error", P);
282
+ await R.delete(V(A.value.id)), D.value = !1, N.value = !1, x.value++, g("delete:success", A.value);
283
+ } catch (d) {
284
+ O.value = ((h = (r = d.response) == null ? void 0 : r.data) == null ? void 0 : h.message) || d.message || e("credentials.error.delete"), g("error", d);
2172
285
  } finally {
2173
- J.value = !1;
286
+ D.value = !1;
2174
287
  }
2175
288
  }
2176
- }, K = C(!1);
2177
- se(h, (f) => {
2178
- var x, V, P, oe;
2179
- if (Array.isArray((x = f == null ? void 0 : f.response) == null ? void 0 : x.data) && (K.value = f.response.data.length > 0), f.status === ee.Error) {
2180
- A.value = {
2181
- title: n("credentials.error.general")
2182
- }, (oe = (P = (V = f.error) == null ? void 0 : V.response) == null ? void 0 : P.data) != null && oe.message && (A.value.message = f.error.response.data.message), r("error", f.error);
289
+ }, P = m(!1);
290
+ ne(H, (t) => {
291
+ var r, h, d, T;
292
+ if (Array.isArray((r = t == null ? void 0 : t.response) == null ? void 0 : r.data) && (P.value = t.response.data.length > 0), t.status === Ce.Error) {
293
+ w.value = {
294
+ title: e("credentials.error.general")
295
+ }, (T = (d = (h = t.error) == null ? void 0 : h.response) == null ? void 0 : d.data) != null && T.message && (w.value.message = t.error.response.data.message), g("error", t.error);
2183
296
  return;
2184
297
  }
2185
- A.value = null;
298
+ w.value = null;
2186
299
  });
2187
- const Y = C({
2188
- ctaPath: a.config.createRoute,
300
+ const E = m({
301
+ ctaPath: i.config.createRoute,
2189
302
  ctaText: void 0,
2190
303
  message: "",
2191
- title: n("credentials.title")
304
+ title: e("credentials.title")
2192
305
  });
2193
- return et(async () => {
2194
- await a.canCreate() && (Y.value.title = n(`credentials.list.empty_state.${a.config.plugin}.title`), Y.value.ctaText = n(`credentials.list.empty_state.${a.config.plugin}.cta`));
2195
- }), (f, x) => {
2196
- const V = L("KButton"), P = L("KCopy"), oe = L("KBadge"), Ye = L("KTruncate"), Z = L("KDropdownItem"), re = L("KClipboardProvider");
2197
- return _(), q("div", Ma, [
2198
- v(b(Aa), {
2199
- "cache-identifier": e.cacheIdentifier,
306
+ return le(async () => {
307
+ await i.canCreate() && (E.value.title = e(`credentials.list.empty_state.${i.config.plugin}.title`), E.value.ctaText = e(`credentials.list.empty_state.${i.config.plugin}.cta`));
308
+ }), (t, r) => {
309
+ const h = k("KButton"), d = k("KCopy"), T = k("KBadge"), te = k("KTruncate"), f = k("KDropdownItem"), _ = k("KClipboardProvider");
310
+ return p(), j("div", De, [
311
+ c(s(be), {
312
+ "cache-identifier": l.cacheIdentifier,
2200
313
  "disable-pagination-page-jump": "",
2201
314
  "disable-row-click": "",
2202
315
  "disable-sorting": "",
2203
- "empty-state-options": Y.value,
316
+ "empty-state-options": E.value,
2204
317
  "enable-entity-actions": "",
2205
- "error-message": A.value,
2206
- fetcher: b(d),
2207
- "fetcher-cache-key": s.value,
318
+ "error-message": w.value,
319
+ fetcher: s(q),
320
+ "fetcher-cache-key": x.value,
2208
321
  "pagination-type": "offset",
2209
322
  "preferences-storage-key": "kong-ui-entities-consumer-credentials-list",
2210
- "table-headers": S.value,
2211
- "use-action-outside": e.useActionOutside,
2212
- onSort: w
323
+ "table-headers": J.value,
324
+ "use-action-outside": l.useActionOutside,
325
+ onSort: W
2213
326
  }, {
2214
- "toolbar-button": l(() => [
2215
- (_(), D(tt, {
2216
- disabled: !e.useActionOutside,
327
+ "toolbar-button": n(() => [
328
+ (p(), C(ie, {
329
+ disabled: !l.useActionOutside,
2217
330
  to: "#kong-ui-app-page-header-action-button"
2218
331
  }, [
2219
- v(b(de), {
2220
- "auth-function": () => e.canCreate()
332
+ c(s(S), {
333
+ "auth-function": () => l.canCreate()
2221
334
  }, {
2222
- default: l(() => [
2223
- je(v(V, {
335
+ default: n(() => [
336
+ ce(c(h, {
2224
337
  appearance: "primary",
2225
338
  "data-testid": "toolbar-add-credential",
2226
339
  size: "large",
2227
- to: e.config.createRoute
340
+ to: l.config.createRoute
2228
341
  }, {
2229
- default: l(() => [
2230
- v(b(ut)),
2231
- B(" " + T(b(n)(`credentials.list.toolbar_actions.${e.config.plugin}.new`)), 1)
342
+ default: n(() => [
343
+ c(s(ue)),
344
+ y(" " + u(s(e)(`credentials.list.toolbar_actions.${l.config.plugin}.new`)), 1)
2232
345
  ]),
2233
346
  _: 1
2234
347
  }, 8, ["to"]), [
2235
- [Ke, K.value]
348
+ [re, P.value]
2236
349
  ])
2237
350
  ]),
2238
351
  _: 1
2239
352
  }, 8, ["auth-function"])
2240
353
  ], 8, ["disabled"]))
2241
354
  ]),
2242
- group: l(({ rowValue: m }) => [
2243
- H("b", null, T(m ?? "-"), 1)
355
+ group: n(({ rowValue: a }) => [
356
+ M("b", null, u(a ?? "-"), 1)
2244
357
  ]),
2245
- name: l(({ rowValue: m }) => [
2246
- H("b", null, T(m ?? "-"), 1)
358
+ name: n(({ rowValue: a }) => [
359
+ M("b", null, u(a ?? "-"), 1)
2247
360
  ]),
2248
- username: l(({ rowValue: m }) => [
2249
- H("span", null, T(m ?? "-"), 1)
361
+ username: n(({ rowValue: a }) => [
362
+ M("span", null, u(a ?? "-"), 1)
2250
363
  ]),
2251
- password: l(({ rowValue: m }) => [
2252
- v(P, {
364
+ password: n(({ rowValue: a }) => [
365
+ c(d, {
2253
366
  format: "redacted",
2254
- text: m,
367
+ text: a,
2255
368
  truncate: ""
2256
369
  }, null, 8, ["text"])
2257
370
  ]),
2258
- key: l(({ rowValue: m }) => [
2259
- v(P, {
371
+ key: n(({ rowValue: a }) => [
372
+ c(d, {
2260
373
  format: "redacted",
2261
- text: m,
374
+ text: a,
2262
375
  truncate: ""
2263
376
  }, null, 8, ["text"])
2264
377
  ]),
2265
- client_secret: l(({ rowValue: m }) => [
2266
- v(P, {
378
+ client_secret: n(({ rowValue: a }) => [
379
+ c(d, {
2267
380
  format: "redacted",
2268
- text: m,
381
+ text: a,
2269
382
  truncate: ""
2270
383
  }, null, 8, ["text"])
2271
384
  ]),
2272
- secret: l(({ rowValue: m }) => [
2273
- v(P, {
385
+ secret: n(({ rowValue: a }) => [
386
+ c(d, {
2274
387
  format: "redacted",
2275
- text: m,
388
+ text: a,
2276
389
  truncate: ""
2277
390
  }, null, 8, ["text"])
2278
391
  ]),
2279
- created_at: l(({ rowValue: m }) => [
2280
- B(T(b(o)(m)), 1)
392
+ created_at: n(({ rowValue: a }) => [
393
+ y(u(s(L)(a)), 1)
2281
394
  ]),
2282
- tags: l(({ rowValue: m }) => [
2283
- (m == null ? void 0 : m.length) > 0 ? (_(), D(Ye, { key: 0 }, {
2284
- default: l(() => [
2285
- (_(!0), q(rt, null, Fe(m, (F) => (_(), D(oe, {
2286
- key: F,
2287
- onClick: x[0] || (x[0] = at(() => {
395
+ tags: n(({ rowValue: a }) => [
396
+ (a == null ? void 0 : a.length) > 0 ? (p(), C(te, { key: 0 }, {
397
+ default: n(() => [
398
+ (p(!0), j(se, null, oe(a, (o) => (p(), C(T, {
399
+ key: o,
400
+ onClick: r[0] || (r[0] = de(() => {
2288
401
  }, ["stop"]))
2289
402
  }, {
2290
- default: l(() => [
2291
- B(T(F), 1)
403
+ default: n(() => [
404
+ y(u(o), 1)
2292
405
  ]),
2293
406
  _: 2
2294
407
  }, 1024))), 128))
2295
408
  ]),
2296
409
  _: 2
2297
- }, 1024)) : (_(), q("span", qa, "-"))
410
+ }, 1024)) : (p(), j("span", Te, "-"))
2298
411
  ]),
2299
- actions: l(({ row: m }) => [
2300
- v(re, null, {
2301
- default: l(({ copyToClipboard: F }) => [
2302
- v(Z, {
412
+ actions: n(({ row: a }) => [
413
+ c(_, null, {
414
+ default: n(({ copyToClipboard: o }) => [
415
+ c(f, {
2303
416
  "data-testid": "action-entity-copy-id",
2304
- onClick: (ne) => $(m, "id", F)
417
+ onClick: (v) => b(a, "id", o)
2305
418
  }, {
2306
- default: l(() => [
2307
- B(T(b(n)("credentials.actions.copy_id")), 1)
419
+ default: n(() => [
420
+ y(u(s(e)("credentials.actions.copy_id")), 1)
2308
421
  ]),
2309
422
  _: 2
2310
423
  }, 1032, ["onClick"])
2311
424
  ]),
2312
425
  _: 2
2313
426
  }, 1024),
2314
- e.config.plugin === "basic-auth" ? (_(), D(re, { key: 0 }, {
2315
- default: l(({ copyToClipboard: F }) => [
2316
- v(Z, {
427
+ l.config.plugin === "basic-auth" ? (p(), C(_, { key: 0 }, {
428
+ default: n(({ copyToClipboard: o }) => [
429
+ c(f, {
2317
430
  "data-testid": "action-entity-copy-credential",
2318
- onClick: (ne) => $(m, "password", F)
431
+ onClick: (v) => b(a, "password", o)
2319
432
  }, {
2320
- default: l(() => [
2321
- B(T(b(n)("credentials.actions.copy_credential")), 1)
433
+ default: n(() => [
434
+ y(u(s(e)("credentials.actions.copy_credential")), 1)
2322
435
  ]),
2323
436
  _: 2
2324
437
  }, 1032, ["onClick"])
2325
438
  ]),
2326
439
  _: 2
2327
- }, 1024)) : z("", !0),
2328
- ["key-auth", "key-auth-enc", "jwt"].includes(e.config.plugin) ? (_(), D(re, { key: 1 }, {
2329
- default: l(({ copyToClipboard: F }) => [
2330
- v(Z, {
440
+ }, 1024)) : K("", !0),
441
+ ["key-auth", "key-auth-enc", "jwt"].includes(l.config.plugin) ? (p(), C(_, { key: 1 }, {
442
+ default: n(({ copyToClipboard: o }) => [
443
+ c(f, {
2331
444
  "data-testid": "action-entity-copy-key",
2332
- onClick: (ne) => $(m, "key", F)
445
+ onClick: (v) => b(a, "key", o)
2333
446
  }, {
2334
- default: l(() => [
2335
- B(T(b(n)("credentials.actions.copy_key")), 1)
447
+ default: n(() => [
448
+ y(u(s(e)("credentials.actions.copy_key")), 1)
2336
449
  ]),
2337
450
  _: 2
2338
451
  }, 1032, ["onClick"])
2339
452
  ]),
2340
453
  _: 2
2341
- }, 1024)) : z("", !0),
2342
- e.config.plugin === "oauth2" ? (_(), D(re, { key: 2 }, {
2343
- default: l(({ copyToClipboard: F }) => [
2344
- v(Z, {
454
+ }, 1024)) : K("", !0),
455
+ l.config.plugin === "oauth2" ? (p(), C(_, { key: 2 }, {
456
+ default: n(({ copyToClipboard: o }) => [
457
+ c(f, {
2345
458
  "data-testid": "action-entity-copy-secret",
2346
- onClick: (ne) => $(m, "client_secret", F)
459
+ onClick: (v) => b(a, "client_secret", o)
2347
460
  }, {
2348
- default: l(() => [
2349
- B(T(b(n)("credentials.actions.copy_secret")), 1)
461
+ default: n(() => [
462
+ y(u(s(e)("credentials.actions.copy_secret")), 1)
2350
463
  ]),
2351
464
  _: 2
2352
465
  }, 1032, ["onClick"])
2353
466
  ]),
2354
467
  _: 2
2355
- }, 1024)) : z("", !0),
2356
- e.config.plugin === "hmac-auth" ? (_(), D(re, { key: 3 }, {
2357
- default: l(({ copyToClipboard: F }) => [
2358
- v(Z, {
468
+ }, 1024)) : K("", !0),
469
+ l.config.plugin === "hmac-auth" ? (p(), C(_, { key: 3 }, {
470
+ default: n(({ copyToClipboard: o }) => [
471
+ c(f, {
2359
472
  "data-testid": "action-entity-copy-secret",
2360
- onClick: (ne) => $(m, "secret", F)
473
+ onClick: (v) => b(a, "secret", o)
2361
474
  }, {
2362
- default: l(() => [
2363
- B(T(b(n)("credentials.actions.copy_secret")), 1)
475
+ default: n(() => [
476
+ y(u(s(e)("credentials.actions.copy_secret")), 1)
2364
477
  ]),
2365
478
  _: 2
2366
479
  }, 1032, ["onClick"])
2367
480
  ]),
2368
481
  _: 2
2369
- }, 1024)) : z("", !0),
2370
- v(re, null, {
2371
- default: l(({ copyToClipboard: F }) => [
2372
- v(Z, {
482
+ }, 1024)) : K("", !0),
483
+ c(_, null, {
484
+ default: n(({ copyToClipboard: o }) => [
485
+ c(f, {
2373
486
  "data-testid": "action-entity-copy-json",
2374
- onClick: (ne) => $(m, void 0, F)
487
+ onClick: (v) => b(a, void 0, o)
2375
488
  }, {
2376
- default: l(() => [
2377
- B(T(b(n)("credentials.actions.copy_json")), 1)
489
+ default: n(() => [
490
+ y(u(s(e)("credentials.actions.copy_json")), 1)
2378
491
  ]),
2379
492
  _: 2
2380
493
  }, 1032, ["onClick"])
2381
494
  ]),
2382
495
  _: 2
2383
496
  }, 1024),
2384
- v(b(de), {
2385
- "auth-function": () => e.canEdit(m)
497
+ c(s(S), {
498
+ "auth-function": () => l.canEdit(a)
2386
499
  }, {
2387
- default: l(() => [
2388
- v(Z, {
500
+ default: n(() => [
501
+ c(f, {
2389
502
  "data-testid": "action-entity-edit",
2390
503
  "has-divider": "",
2391
- item: M(m.id)
504
+ item: Q(a.id)
2392
505
  }, null, 8, ["item"])
2393
506
  ]),
2394
507
  _: 2
2395
508
  }, 1032, ["auth-function"]),
2396
- v(b(de), {
2397
- "auth-function": () => e.canDelete(m)
509
+ c(s(S), {
510
+ "auth-function": () => l.canDelete(a)
2398
511
  }, {
2399
- default: l(() => [
2400
- v(Z, {
512
+ default: n(() => [
513
+ c(f, {
2401
514
  danger: "",
2402
515
  "data-testid": "action-entity-delete",
2403
516
  "has-divider": "",
2404
- onClick: (F) => W(m)
517
+ onClick: (o) => Y(a)
2405
518
  }, {
2406
- default: l(() => [
2407
- B(T(b(n)("credentials.actions.delete")), 1)
519
+ default: n(() => [
520
+ y(u(s(e)("credentials.actions.delete")), 1)
2408
521
  ]),
2409
522
  _: 2
2410
523
  }, 1032, ["onClick"])
@@ -2414,25 +527,25 @@ const { useAxios: ja, useDeleteUrlBuilder: Ka, useErrors: Va, useExternalLinkCre
2414
527
  ]),
2415
528
  _: 1
2416
529
  }, 8, ["cache-identifier", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "table-headers", "use-action-outside"]),
2417
- v(b(Oa), {
2418
- "action-pending": J.value,
2419
- description: b(n)("credentials.delete.description"),
2420
- "entity-type": I.value,
2421
- error: c.value,
2422
- title: b(n)(`credentials.delete.${e.config.plugin}.title`),
2423
- visible: U.value,
2424
- onCancel: O,
2425
- onProceed: R
530
+ c(s(_e), {
531
+ "action-pending": D.value,
532
+ description: s(e)("credentials.delete.description"),
533
+ "entity-type": X.value,
534
+ error: O.value,
535
+ title: s(e)(`credentials.delete.${l.config.plugin}.title`),
536
+ visible: N.value,
537
+ onCancel: Z,
538
+ onProceed: ee
2426
539
  }, null, 8, ["action-pending", "description", "entity-type", "error", "title", "visible"])
2427
540
  ]);
2428
541
  };
2429
542
  }
2430
- }), Ba = (e, t) => {
2431
- const r = e.__vccOpts || e;
2432
- for (const [a, n] of t)
2433
- r[a] = n;
2434
- return r;
2435
- }, en = /* @__PURE__ */ Ba(Pa, [["__scopeId", "data-v-4450bd28"]]);
543
+ }), Ie = (l, I) => {
544
+ const g = l.__vccOpts || l;
545
+ for (const [i, e] of I)
546
+ g[i] = e;
547
+ return g;
548
+ }, Me = /* @__PURE__ */ Ie(Ke, [["__scopeId", "data-v-4450bd28"]]);
2436
549
  export {
2437
- en as ConsumerCredentialList
550
+ Me as ConsumerCredentialList
2438
551
  };