@kong-ui-public/entities-vaults 1.2.0 → 1.2.1

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.
@@ -313,7 +313,7 @@ function Ne(U, l, F = "data") {
313
313
  }
314
314
  function Je() {
315
315
  return {
316
- getPropValue: (U, l) => (l == null ? void 0 : l[U]) || void 0
316
+ getPropValue: (U, l) => (l == null ? void 0 : l[U]) ?? void 0
317
317
  };
318
318
  }
319
319
  function Ze() {
@@ -1,4 +1,4 @@
1
- (function(P,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","axios","@kong-ui-public/i18n","@kong/kongponents"],t):(P=typeof globalThis<"u"?globalThis:P||self,t(P["kong-ui-public-entities-vaults"]={},P.Vue,P.VueRouter,P.axios,P["kong-ui-public-i18n"],P.Kongponents))})(this,function(P,t,MU,Ne,cU,Je){"use strict";var PU=(U=>(U.GatewayService="service",U.Route="route",U.Consumer="consumer",U.ConsumerGroup="consumer group",U.Plugin="plugin",U.Upstream="upstream",U.Certificate="certificate",U.CACertificate="ca certificate",U.SNI="SNI",U.Key="key",U.KeySet="key set",U.Vault="vault",U.Application="application",U.Developer="developer",U.acls="ACL Credential",U["basic-auth"]="Basic Auth Credential",U["key-auth"]="Key Auth Credential",U["key-auth-enc"]="Key Auth Encrypted Credential",U.oauth2="OAuth 2.0 Credential",U["hmac-auth"]="HMAC Credential",U.jwt="JWT Credential",U.Target="target",U.Policy="policy",U))(PU||{}),kU=(U=>(U.Edit="edit",U.Create="create",U))(kU||{}),dU=(U=>(U[U.Loading=0]="Loading",U[U.Idle=1]="Idle",U[U.NoResults=2]="NoResults",U[U.Error=3]="Error",U))(dU||{}),z=(U=>(U.ID="id",U.IdArray="id-array",U.Text="plain-text",U.Date="date",U.Redacted="redacted",U.RedactedArray="redacted-array",U.Json="json",U.JsonArray="json-array",U.BadgeTag="badge-tag",U.BadgeStatus="badge-status",U.BadgeMethod="badge-method",U.LinkInternal="link-internal",U.LinkExternal="link-external",U))(z||{}),q=(U=>(U.Basic="basic",U.Advanced="advanced",U.Plugin="plugin",U))(q||{});function fU(U={}){return{axiosInstance:Ne.create({withCredentials:!0,timeout:3e4,...U})}}function Ze(){return{debounce:(U,l)=>{let e;return(...n)=>{clearTimeout(e),e=window==null?void 0:window.setTimeout(()=>{U(...n)},l)}}}}const bU="khcp-user-table-preferences",pe={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ke(){const U=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},l=()=>{const e=U(localStorage.getItem(bU));return!e||!Object.keys(e).length?new Map:new Map(Object.entries(e))};return{setTablePreferences:(e,n)=>{try{const F=l();F.set(e,n),localStorage.setItem(bU,JSON.stringify(Object.fromEntries(F.entries())))}catch(F){console.error("useTablePreferences(setTablePreferences)",F)}},getTablePreferences:e=>{const n=l();return(n==null?void 0:n.get(e))||void 0||pe},deleteAllTablePreferences:()=>{localStorage.removeItem(bU)}}}const Se={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},We={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},me={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ue={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},Te={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},De={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ce={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},he={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Me={deleteModal:Se,baseForm:We,baseTable:me,baseConfigCard:ue,filter:Te,debouncedFilter:De,errors:Ce,toggleModal:he};function yU(){const U=cU.createI18n("en-us",Me);return{i18n:U,i18nT:cU.i18nTComponent(U)}}function fe(U,l,e,n={fetchedItemsKey:"data",searchKeys:["id"]}){e||(e="100");const{axiosInstance:F}=fU({headers:U.requestHeaders}),{i18n:{t:Q}}=yU(),{debounce:a}=Ze(),d=a(async Z=>{await p(Z)},200),o=t.ref(!1),R=t.ref(""),r=t.ref(""),V=t.ref([]),J=t.ref(void 0),i=t.unref(l);let S=`${U.apiBaseUrl}${i}`;U.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,(U==null?void 0:U.controlPlaneId)||""):U.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,U!=null&&U.workspace?`/${U.workspace}`:""));const k=async()=>{try{o.value=!0;const{data:Z}=await F.get(`${S}?size=${e}`);Z!=null&&Z.next||(J.value=n.fetchedItemsKey in Z?Z[n.fetchedItemsKey]:[]),V.value=n.fetchedItemsKey in Z?Z[n.fetchedItemsKey]:[]}catch{V.value=[],R.value=Q("debouncedFilter.errors.fetch")}finally{o.value=!1}},c=t.ref(""),p=async Z=>{var D,f;if(c.value!==Z)if(c.value=Z||"",J.value===void 0)try{o.value=!0,R.value="",r.value="";let b=S+"";Z&&(b+=`/${Z}`);const{data:I}=await F.get(`${b}?size=${e}`);n.fetchedItemsKey in I?V.value=I[n.fetchedItemsKey]:I!=null&&I.id?V.value=[I]:V.value=[]}catch(b){((D=b==null?void 0:b.response)==null?void 0:D.status)===404?r.value=Q("debouncedFilter.errors.invalid"):(V.value=[],R.value=Q("debouncedFilter.errors.fetch"))}finally{o.value=!1}else o.value=!0,r.value="",Z?(V.value=(f=J.value)==null?void 0:f.filter(b=>{var I;let y=!1;for(const u of n.searchKeys){const h=typeof b[u]=="string"?(I=b[u])==null?void 0:I.toLowerCase():b[u];h!=null&&h.includes(Z.toLowerCase())&&(y=!0)}return y}),(!V.value||!V.value.length)&&(r.value=Q("debouncedFilter.errors.invalid"))):V.value=J.value,o.value=!1};return{loading:o,error:R,validationError:r,results:V,allRecords:J,loadItems:k,debouncedQueryChange:d}}function be(U,l){const e=t.unref(l),n=t.computed(()=>U.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${e}`):new URL(e));return n.value.search="",F=>`${n.value.href}/${F}`}function ye(){const{i18n:{t:U}}=yU();return{getMessageFromError:l=>{var e,n,F;if(!l)return U("errors.unexpected");if((e=l==null?void 0:l.response)!=null&&e.data){if(l.response.data.detail)return l.response.data.detail;if((n=l.response.data.details)!=null&&n.length)return l.response.data.details.map(Q=>{let a=U("errors.unexpected");return Q.messages&&typeof Q.messages=="object"&&Q.messages.length&&(a=Q.messages.join(", ")),Q.field?`${Q.field} - ${a}`:a}).join("; ");if(l.response.data.message){const{message:Q}=l.response.data;return Array.isArray(Q)?(F=Q[0])!=null&&F.constraints?Object.values(Q[0].constraints)[0]:Q[0]:Q}if(typeof l.response.data=="string")return l.response.data;if(typeof l.response.data=="object")return Object.keys(l.response.data).map(Q=>`${Q} ${l.response.data[Q]}`).join(", ")}return l.message||U("errors.unexpected")}}}function _U(U,l){const e=t.ref(t.unref(U)),n=t.ref(t.unref(l)),F=t.computed(()=>!!(e.value.app==="konnect"||e.value.isExactMatch)),Q=t.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return a=>{const{page:d,pageSize:o,offset:R,sortColumnKey:r,sortColumnOrder:V,query:J}=a;try{let i=new URL(Q.value.href);return F.value&&J?(i.search="",i=new URL(`${i.href}/${J}/`)):(F.value||new URLSearchParams(J).forEach((S,k)=>{i.searchParams.append(k,S)}),r&&i.searchParams.append("sort_by",r),V==="desc"&&i.searchParams.append("sort_desc","1"),i.searchParams.append("size",String(o))),R&&d!==1&&i.searchParams.append("offset",String(R)),i.href}catch(i){return console.error("RouteList(fetcher)",i),n.value}}}function Ee(U,l,e="data"){const n=t.unref(l),{axiosInstance:F}=fU({headers:U.requestHeaders}),Q=_U(U,n),a=t.ref({status:dU.Idle});return{fetcher:async d=>{try{a.value={status:dU.Loading};const o=Q(d),{data:R}=await F.get(o),r=e&&e.replace(/[^\w-_]/gi,"");let V;R[r]&&Array.isArray(R[r])?V=R[r]:V=Object.keys(R).length?[R]:[];const J={data:V,total:V.length,...R.offset?{pagination:{offset:R.offset}}:null};return a.value={status:dU.Idle,response:J},J}catch(o){const R={data:[],total:0};return d.query&&o.response.status===404?(a.value={status:dU.NoResults,response:R,error:o},R):(a.value={status:dU.Error,response:R,error:o},R)}},fetcherState:a}}function ge(){return{getPropValue:(U,l)=>(l==null?void 0:l[U])||void 0}}function xe(){return{convertKeyToTitle:(U,l="_")=>U?U.split(l).map(e=>e.toLowerCase()==="id"?e.toUpperCase():e.charAt(0).toUpperCase()+e.substring(1)).join(" "):""}}const qU=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,$U=U=>{if(typeof U!="string")throw new TypeError("Invalid argument expected string");const l=U.match(qU);if(!l)throw new Error(`Invalid argument not valid semver ('${U}' received)`);return l.shift(),l},Ut=U=>U==="*"||U==="x"||U==="X",tt=U=>{const l=parseInt(U,10);return isNaN(l)?U:l},je=(U,l)=>typeof U!=typeof l?[String(U),String(l)]:[U,l],ze=(U,l)=>{if(Ut(U)||Ut(l))return 0;const[e,n]=je(tt(U),tt(l));return e>n?1:e<n?-1:0},et=(U,l)=>{for(let e=0;e<Math.max(U.length,l.length);e++){const n=ze(U[e]||"0",l[e]||"0");if(n!==0)return n}return 0},Ye=(U,l)=>{const e=$U(U),n=$U(l),F=e.pop(),Q=n.pop(),a=et(e,n);return a!==0?a:F&&Q?et(F.split("."),Q.split(".")):F||Q?F?-1:1:0},lt=(U,l,e)=>{we(e);const n=Ye(U,l);return Ft[e].includes(n)},Ft={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},nt=Object.keys(Ft),we=U=>{if(typeof U!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof U}`);if(nt.indexOf(U)===-1)throw new Error(`Invalid operator, expected one of ${nt.join("|")}`)},Ge=U=>typeof U=="string"&&/^[v\d]/.test(U)&&qU.test(U);function Ie(U){const{gatewayInfo:l,supportedRange:e}=U;if(!l)return!0;const{edition:n,version:F}=l;if(!Ge(F))return console.error("Invalid version"),!1;const Q=e[n];if(!Q)return!1;const[a,d]=Q;return!(a&&lt(F,a,"<")||d&&lt(F,d,">"))}const X={useAxios:fU,useDebouncedFilter:fe,useDeleteUrlBuilder:be,useErrors:ye,useFetcher:Ee,useFetchUrlBuilder:_U,useHelpers:ge,useStringHelpers:xe,useI18n:yU,useGatewayFeatureSupported:Ie},Oe={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Xe="Copy to clipboard",Le={message:Oe,iconTitle:Xe},He="kong-ui-copy-uuid-notify",Ke={class:"kong-ui-copy-uuid"},ve=["onClick"],Qt=15,Ae=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:U=>["uuid","hidden","redacted","deleted"].includes(U)}},emits:["success","error"],setup(U,{emit:l}){const e=U,{t:n}=cU.createI18n("en-us",Le),F=e.notify||t.inject(He,()=>{}),Q=t.computed(()=>e.idTooltip?{label:e.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:e.uuid}),a=t.computed(()=>!!(e.tooltip&&e.successTooltip)),d=t.ref(e.tooltip),o=t.computed(()=>e.tooltip?{label:d.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),R=t.computed(()=>e.format==="redacted"?"*****":e.format==="deleted"?`*${e.uuid.substring(0,5)}`:e.uuid),r=J=>{d.value=J,setTimeout(()=>{d.value=e.tooltip},1800)},V=J=>{if(!J(e.uuid)){typeof F=="function"&&F({type:"error",message:n("message.fail")}),a.value?r(n("message.fail")):l("error",e.uuid);return}const i=e.uuid.length>Qt,S=e.format==="hidden"||e.format==="redacted"?n("message.success.prefix"):`"${e.uuid.substring(0,Qt)+(i?"...":"")}"`;typeof F=="function"&&F({type:"success",message:`${S}${n("message.success.content")}`}),a.value?r(e.successTooltip):l("success",e.uuid)};return(J,i)=>{const S=t.resolveComponent("KIcon"),k=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Ke,[U.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(U.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},Q.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",U.truncated?"truncated-uuid":null,U.useMono?"mono":null])},t.toDisplayString(R.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(U.tooltip?"KTooltip":"div"),t.mergeProps(o.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(k,null,{default:t.withCtx(({copyToClipboard:c})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(p=>V(c),["stop"])},[t.createVNode(S,{class:"uuid-icon",color:U.iconColor,"hide-title":!!U.tooltip||void 0,icon:"copy",size:"16",title:t.unref(n)("iconTitle")},null,8,["color","hide-title","title"])],8,ve)]),_:1})]),_:1},16))])}}}),Pe=(U,l)=>{const e=U.__vccOpts||U;for(const[n,F]of l)e[n]=F;return e},at=Pe(Ae,[["__scopeId","data-v-bfdaf6f7"]]),_e={key:0,class:"config-card-fieldset-title"},qe=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(U){const l=U,{i18n:{t:e}}=X.useI18n(),{convertKeyToTitle:n}=X.useStringHelpers(),F=t.computed(()=>l.item.key??"json-array-item"),Q=t.computed(()=>l.item.value??l.item),a=t.computed(()=>{const o=JSON.parse(JSON.stringify(Q.value));return l.isArrayItem&&delete o.name,o}),d=t.computed(()=>{var o;return l.isArrayItem?(o=Q.value)!=null&&o.name?n(Q.value.name,"_"):e("baseConfigCard.general.entryTitle",{index:l.index}):""});return(o,R)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(U.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(U.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[U.isArrayItem?(t.openBlock(),t.createElementBlock("legend",_e,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(a.value),(r,V)=>(t.openBlock(),t.createBlock(EU,{key:`${F.value}-property-${V}`,item:{key:r,label:t.unref(n)(r),value:a.value[r]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),eU=(U,l)=>{const e=U.__vccOpts||U;for(const[n,F]of l)e[n]=F;return e},dt=eU(qe,[["__scopeId","data-v-68ca83ec"]]),$e=eU(t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(U){const{i18n:{t:l}}=X.useI18n();return(e,n)=>{const F=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(F,{appearance:"btn-link",class:"navigation-button",onClick:n[0]||(n[0]=Q=>e.$emit("navigation-click",U.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(U.item.value||t.unref(l)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-7410504d"]]),Ul=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(U){const{i18n:{t:l}}=X.useI18n();return(e,n)=>{const F=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(F,{appearance:U.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(U.status?t.unref(l)("baseConfigCard.statusBadge.enabledLabel"):t.unref(l)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),tl="#0044f4",el="#e0e4ea",ll="#3a3f51",Fl="1px",nl="20px",Ql={class:"config-card-details-row"},al=["data-testid"],dl=["data-testid"],ol=["data-testid"],rl=["data-testid"],il={key:1},Vl=["data-testid"],Rl=["data-testid"],Bl=["data-testid"],cl=["data-testid"],sl=["title"],Nl={name:"ConfigCardItem",components:{CopyUuid:at,JsonCardItem:dt,StatusBadge:Ul,InternalLinkItem:$e}},Jl=t.defineComponent({...Nl,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(U,{emit:l}){const e=U;t.useCssVars(V=>({"2c6ac268":R.value?"none":`solid ${t.unref(Fl)} ${t.unref(el)}`,c7a65802:o.value&&a.value?"block":"flex","778426fe":o.value&&a.value?"100%":e.slim?"50%":"25%","777f9b48":o.value&&a.value?"100%":e.slim?"50%":"75%"}));const n=t.useSlots(),{i18n:{t:F,formatUnixTimeStamp:Q}}=X.useI18n(),a=t.computed(()=>e.item.value!==void 0&&e.item.value!==null&&e.item.value!==""),d=t.computed(()=>!!(e.item.tooltip||n["label-tooltip"])),o=t.computed(()=>e.item.type===z.Json||e.item.type===z.JsonArray),R=t.computed(()=>e.item.type===z.JsonArray),r=t.computed(()=>{switch(e.item.type){case z.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${e.item.key}-copy-uuid`,"success-tooltip":F("baseConfigCard.copy.success"),tooltip:F("baseConfigCard.copy.tooltip",{label:e.item.label}),truncated:!1,uuid:e.item.value,notify:()=>{}}};case z.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":F("baseConfigCard.copy.success"),tooltip:F("baseConfigCard.copy.tooltip",{label:e.item.label}),truncated:!1,notify:()=>{}}};case z.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${e.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":F("baseConfigCard.copy.success"),tooltip:F("baseConfigCard.copy.tooltip",{label:e.item.label}),truncated:!1,uuid:e.item.value,notify:()=>{}}};case z.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":F("baseConfigCard.copy.success"),tooltip:F("baseConfigCard.copy.tooltip",{label:e.item.label}),truncated:!1,notify:()=>{}}};case z.Date:return{tag:"div",attrs:{"data-testid":`${e.item.key}-date`},text:Q(e.item.value)};case z.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${e.item.key}-badge-status`,status:e.item.value}};case z.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case z.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case z.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${e.item.key}-internal-link`,item:e.item,onNavigationClick:V=>{l("navigation-click",V)}}};case z.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${e.item.key}-external-link`,href:e.item.value},text:e.item.value};case z.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${e.item.key}-json-content`,item:e.item}};case z.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${e.item.key}-json-array-content`,item:e.item}};default:return{tag:"div",attrs:{"data-testid":`${e.item.key}-plain-text`},text:e.item.value}}});return(V,J)=>{const i=t.resolveComponent("KLabel"),S=t.resolveComponent("KBadge"),k=t.resolveComponent("KMethodBadge");return t.openBlock(),t.createElementBlock("div",Ql,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${U.item.key}-label`},[t.renderSlot(V.$slots,"label",{item:U.item},()=>[t.createVNode(i,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(U.item.label)+" ",1)]),_:2},[d.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${U.item.key}-label-tooltip`},[t.renderSlot(V.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(U.item.tooltip),1)],!0)],8,dl)]),key:"0"}:void 0]),1024)],!0)],8,al),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${U.item.key}-property-value`},[t.renderSlot(V.$slots,U.item.key,{rowValue:U.item.value},()=>[a.value?(t.openBlock(),t.createElementBlock("div",il,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.value.tag),t.normalizeProps(t.guardReactiveProps(r.value.attrs)),{default:t.withCtx(()=>[r.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${U.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.item.value,(c,p)=>(t.openBlock(),t.createBlock(S,{key:`${U.item.key}-badge-tag-${p}`,class:"config-badge","data-testid":`${U.item.key}-badge-tag-${p}`,"truncation-tooltip":c},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,Vl)):t.createCommentVNode("",!0),r.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${U.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.item.value,(c,p)=>(t.openBlock(),t.createBlock(t.unref(at),t.mergeProps(r.value.childAttrs,{key:`${U.item.key}-copy-uuid-${p}`,"data-testid":`${U.item.key}-copy-uuid-${p}`,uuid:c}),null,16,["data-testid","uuid"]))),128))],8,Rl)):r.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${U.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.item.value,(c,p)=>(t.openBlock(),t.createBlock(k,{key:`${U.item.key}-badge-method-${p}`,class:"config-badge","data-testid":`${U.item.key}-badge-method-${p}`,"is-rounded":"",label:c,method:t.unref(Je.MethodsArray).includes(c.toLowerCase())?c.toLowerCase():"custom"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,Bl)):t.createCommentVNode("",!0),r.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${e.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.item.value,(c,p)=>(t.openBlock(),t.createBlock(dt,{key:`json-array-item-${p}`,index:p,"is-array-item":"",item:c},null,8,["index","item"]))),128))],8,cl)):(t.openBlock(),t.createElementBlock("span",{key:4,class:t.normalizeClass(["attrs-data-text",{truncated:U.truncated}]),title:U.truncated?U.item.value:void 0},t.toDisplayString(r.value.text),11,sl))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${U.item.key}-no-value`}," – ",8,rl))],!0)],8,ol)])}}}),EU=eU(Jl,[["__scopeId","data-v-a3c5ab01"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function ot(U){return typeof U>"u"||U===null}function Zl(U){return typeof U=="object"&&U!==null}function pl(U){return Array.isArray(U)?U:ot(U)?[]:[U]}function kl(U,l){var e,n,F,Q;if(l)for(Q=Object.keys(l),e=0,n=Q.length;e<n;e+=1)F=Q[e],U[F]=l[F];return U}function Sl(U,l){var e="",n;for(n=0;n<l;n+=1)e+=U;return e}function Wl(U){return U===0&&Number.NEGATIVE_INFINITY===1/U}var ml=ot,ul=Zl,Tl=pl,Dl=Sl,Cl=Wl,hl=kl,O={isNothing:ml,isObject:ul,toArray:Tl,repeat:Dl,isNegativeZero:Cl,extend:hl};function rt(U,l){var e="",n=U.reason||"(unknown reason)";return U.mark?(U.mark.name&&(e+='in "'+U.mark.name+'" '),e+="("+(U.mark.line+1)+":"+(U.mark.column+1)+")",!l&&U.mark.snippet&&(e+=`
1
+ (function(P,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","axios","@kong-ui-public/i18n","@kong/kongponents"],t):(P=typeof globalThis<"u"?globalThis:P||self,t(P["kong-ui-public-entities-vaults"]={},P.Vue,P.VueRouter,P.axios,P["kong-ui-public-i18n"],P.Kongponents))})(this,function(P,t,MU,Ne,cU,Je){"use strict";var PU=(U=>(U.GatewayService="service",U.Route="route",U.Consumer="consumer",U.ConsumerGroup="consumer group",U.Plugin="plugin",U.Upstream="upstream",U.Certificate="certificate",U.CACertificate="ca certificate",U.SNI="SNI",U.Key="key",U.KeySet="key set",U.Vault="vault",U.Application="application",U.Developer="developer",U.acls="ACL Credential",U["basic-auth"]="Basic Auth Credential",U["key-auth"]="Key Auth Credential",U["key-auth-enc"]="Key Auth Encrypted Credential",U.oauth2="OAuth 2.0 Credential",U["hmac-auth"]="HMAC Credential",U.jwt="JWT Credential",U.Target="target",U.Policy="policy",U))(PU||{}),kU=(U=>(U.Edit="edit",U.Create="create",U))(kU||{}),dU=(U=>(U[U.Loading=0]="Loading",U[U.Idle=1]="Idle",U[U.NoResults=2]="NoResults",U[U.Error=3]="Error",U))(dU||{}),z=(U=>(U.ID="id",U.IdArray="id-array",U.Text="plain-text",U.Date="date",U.Redacted="redacted",U.RedactedArray="redacted-array",U.Json="json",U.JsonArray="json-array",U.BadgeTag="badge-tag",U.BadgeStatus="badge-status",U.BadgeMethod="badge-method",U.LinkInternal="link-internal",U.LinkExternal="link-external",U))(z||{}),q=(U=>(U.Basic="basic",U.Advanced="advanced",U.Plugin="plugin",U))(q||{});function fU(U={}){return{axiosInstance:Ne.create({withCredentials:!0,timeout:3e4,...U})}}function Ze(){return{debounce:(U,l)=>{let e;return(...n)=>{clearTimeout(e),e=window==null?void 0:window.setTimeout(()=>{U(...n)},l)}}}}const bU="khcp-user-table-preferences",pe={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ke(){const U=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},l=()=>{const e=U(localStorage.getItem(bU));return!e||!Object.keys(e).length?new Map:new Map(Object.entries(e))};return{setTablePreferences:(e,n)=>{try{const F=l();F.set(e,n),localStorage.setItem(bU,JSON.stringify(Object.fromEntries(F.entries())))}catch(F){console.error("useTablePreferences(setTablePreferences)",F)}},getTablePreferences:e=>{const n=l();return(n==null?void 0:n.get(e))||void 0||pe},deleteAllTablePreferences:()=>{localStorage.removeItem(bU)}}}const Se={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},We={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},me={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ue={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},Te={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},De={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ce={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},he={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Me={deleteModal:Se,baseForm:We,baseTable:me,baseConfigCard:ue,filter:Te,debouncedFilter:De,errors:Ce,toggleModal:he};function yU(){const U=cU.createI18n("en-us",Me);return{i18n:U,i18nT:cU.i18nTComponent(U)}}function fe(U,l,e,n={fetchedItemsKey:"data",searchKeys:["id"]}){e||(e="100");const{axiosInstance:F}=fU({headers:U.requestHeaders}),{i18n:{t:Q}}=yU(),{debounce:a}=Ze(),d=a(async Z=>{await p(Z)},200),o=t.ref(!1),R=t.ref(""),r=t.ref(""),V=t.ref([]),J=t.ref(void 0),i=t.unref(l);let S=`${U.apiBaseUrl}${i}`;U.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,(U==null?void 0:U.controlPlaneId)||""):U.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,U!=null&&U.workspace?`/${U.workspace}`:""));const k=async()=>{try{o.value=!0;const{data:Z}=await F.get(`${S}?size=${e}`);Z!=null&&Z.next||(J.value=n.fetchedItemsKey in Z?Z[n.fetchedItemsKey]:[]),V.value=n.fetchedItemsKey in Z?Z[n.fetchedItemsKey]:[]}catch{V.value=[],R.value=Q("debouncedFilter.errors.fetch")}finally{o.value=!1}},c=t.ref(""),p=async Z=>{var D,f;if(c.value!==Z)if(c.value=Z||"",J.value===void 0)try{o.value=!0,R.value="",r.value="";let b=S+"";Z&&(b+=`/${Z}`);const{data:I}=await F.get(`${b}?size=${e}`);n.fetchedItemsKey in I?V.value=I[n.fetchedItemsKey]:I!=null&&I.id?V.value=[I]:V.value=[]}catch(b){((D=b==null?void 0:b.response)==null?void 0:D.status)===404?r.value=Q("debouncedFilter.errors.invalid"):(V.value=[],R.value=Q("debouncedFilter.errors.fetch"))}finally{o.value=!1}else o.value=!0,r.value="",Z?(V.value=(f=J.value)==null?void 0:f.filter(b=>{var I;let y=!1;for(const u of n.searchKeys){const h=typeof b[u]=="string"?(I=b[u])==null?void 0:I.toLowerCase():b[u];h!=null&&h.includes(Z.toLowerCase())&&(y=!0)}return y}),(!V.value||!V.value.length)&&(r.value=Q("debouncedFilter.errors.invalid"))):V.value=J.value,o.value=!1};return{loading:o,error:R,validationError:r,results:V,allRecords:J,loadItems:k,debouncedQueryChange:d}}function be(U,l){const e=t.unref(l),n=t.computed(()=>U.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${e}`):new URL(e));return n.value.search="",F=>`${n.value.href}/${F}`}function ye(){const{i18n:{t:U}}=yU();return{getMessageFromError:l=>{var e,n,F;if(!l)return U("errors.unexpected");if((e=l==null?void 0:l.response)!=null&&e.data){if(l.response.data.detail)return l.response.data.detail;if((n=l.response.data.details)!=null&&n.length)return l.response.data.details.map(Q=>{let a=U("errors.unexpected");return Q.messages&&typeof Q.messages=="object"&&Q.messages.length&&(a=Q.messages.join(", ")),Q.field?`${Q.field} - ${a}`:a}).join("; ");if(l.response.data.message){const{message:Q}=l.response.data;return Array.isArray(Q)?(F=Q[0])!=null&&F.constraints?Object.values(Q[0].constraints)[0]:Q[0]:Q}if(typeof l.response.data=="string")return l.response.data;if(typeof l.response.data=="object")return Object.keys(l.response.data).map(Q=>`${Q} ${l.response.data[Q]}`).join(", ")}return l.message||U("errors.unexpected")}}}function _U(U,l){const e=t.ref(t.unref(U)),n=t.ref(t.unref(l)),F=t.computed(()=>!!(e.value.app==="konnect"||e.value.isExactMatch)),Q=t.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return a=>{const{page:d,pageSize:o,offset:R,sortColumnKey:r,sortColumnOrder:V,query:J}=a;try{let i=new URL(Q.value.href);return F.value&&J?(i.search="",i=new URL(`${i.href}/${J}/`)):(F.value||new URLSearchParams(J).forEach((S,k)=>{i.searchParams.append(k,S)}),r&&i.searchParams.append("sort_by",r),V==="desc"&&i.searchParams.append("sort_desc","1"),i.searchParams.append("size",String(o))),R&&d!==1&&i.searchParams.append("offset",String(R)),i.href}catch(i){return console.error("RouteList(fetcher)",i),n.value}}}function Ee(U,l,e="data"){const n=t.unref(l),{axiosInstance:F}=fU({headers:U.requestHeaders}),Q=_U(U,n),a=t.ref({status:dU.Idle});return{fetcher:async d=>{try{a.value={status:dU.Loading};const o=Q(d),{data:R}=await F.get(o),r=e&&e.replace(/[^\w-_]/gi,"");let V;R[r]&&Array.isArray(R[r])?V=R[r]:V=Object.keys(R).length?[R]:[];const J={data:V,total:V.length,...R.offset?{pagination:{offset:R.offset}}:null};return a.value={status:dU.Idle,response:J},J}catch(o){const R={data:[],total:0};return d.query&&o.response.status===404?(a.value={status:dU.NoResults,response:R,error:o},R):(a.value={status:dU.Error,response:R,error:o},R)}},fetcherState:a}}function ge(){return{getPropValue:(U,l)=>(l==null?void 0:l[U])??void 0}}function xe(){return{convertKeyToTitle:(U,l="_")=>U?U.split(l).map(e=>e.toLowerCase()==="id"?e.toUpperCase():e.charAt(0).toUpperCase()+e.substring(1)).join(" "):""}}const qU=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,$U=U=>{if(typeof U!="string")throw new TypeError("Invalid argument expected string");const l=U.match(qU);if(!l)throw new Error(`Invalid argument not valid semver ('${U}' received)`);return l.shift(),l},Ut=U=>U==="*"||U==="x"||U==="X",tt=U=>{const l=parseInt(U,10);return isNaN(l)?U:l},je=(U,l)=>typeof U!=typeof l?[String(U),String(l)]:[U,l],ze=(U,l)=>{if(Ut(U)||Ut(l))return 0;const[e,n]=je(tt(U),tt(l));return e>n?1:e<n?-1:0},et=(U,l)=>{for(let e=0;e<Math.max(U.length,l.length);e++){const n=ze(U[e]||"0",l[e]||"0");if(n!==0)return n}return 0},Ye=(U,l)=>{const e=$U(U),n=$U(l),F=e.pop(),Q=n.pop(),a=et(e,n);return a!==0?a:F&&Q?et(F.split("."),Q.split(".")):F||Q?F?-1:1:0},lt=(U,l,e)=>{we(e);const n=Ye(U,l);return Ft[e].includes(n)},Ft={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},nt=Object.keys(Ft),we=U=>{if(typeof U!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof U}`);if(nt.indexOf(U)===-1)throw new Error(`Invalid operator, expected one of ${nt.join("|")}`)},Ge=U=>typeof U=="string"&&/^[v\d]/.test(U)&&qU.test(U);function Ie(U){const{gatewayInfo:l,supportedRange:e}=U;if(!l)return!0;const{edition:n,version:F}=l;if(!Ge(F))return console.error("Invalid version"),!1;const Q=e[n];if(!Q)return!1;const[a,d]=Q;return!(a&&lt(F,a,"<")||d&&lt(F,d,">"))}const X={useAxios:fU,useDebouncedFilter:fe,useDeleteUrlBuilder:be,useErrors:ye,useFetcher:Ee,useFetchUrlBuilder:_U,useHelpers:ge,useStringHelpers:xe,useI18n:yU,useGatewayFeatureSupported:Ie},Oe={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Xe="Copy to clipboard",Le={message:Oe,iconTitle:Xe},He="kong-ui-copy-uuid-notify",Ke={class:"kong-ui-copy-uuid"},ve=["onClick"],Qt=15,Ae=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:U=>["uuid","hidden","redacted","deleted"].includes(U)}},emits:["success","error"],setup(U,{emit:l}){const e=U,{t:n}=cU.createI18n("en-us",Le),F=e.notify||t.inject(He,()=>{}),Q=t.computed(()=>e.idTooltip?{label:e.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:e.uuid}),a=t.computed(()=>!!(e.tooltip&&e.successTooltip)),d=t.ref(e.tooltip),o=t.computed(()=>e.tooltip?{label:d.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),R=t.computed(()=>e.format==="redacted"?"*****":e.format==="deleted"?`*${e.uuid.substring(0,5)}`:e.uuid),r=J=>{d.value=J,setTimeout(()=>{d.value=e.tooltip},1800)},V=J=>{if(!J(e.uuid)){typeof F=="function"&&F({type:"error",message:n("message.fail")}),a.value?r(n("message.fail")):l("error",e.uuid);return}const i=e.uuid.length>Qt,S=e.format==="hidden"||e.format==="redacted"?n("message.success.prefix"):`"${e.uuid.substring(0,Qt)+(i?"...":"")}"`;typeof F=="function"&&F({type:"success",message:`${S}${n("message.success.content")}`}),a.value?r(e.successTooltip):l("success",e.uuid)};return(J,i)=>{const S=t.resolveComponent("KIcon"),k=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Ke,[U.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(U.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},Q.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",U.truncated?"truncated-uuid":null,U.useMono?"mono":null])},t.toDisplayString(R.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(U.tooltip?"KTooltip":"div"),t.mergeProps(o.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(k,null,{default:t.withCtx(({copyToClipboard:c})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(p=>V(c),["stop"])},[t.createVNode(S,{class:"uuid-icon",color:U.iconColor,"hide-title":!!U.tooltip||void 0,icon:"copy",size:"16",title:t.unref(n)("iconTitle")},null,8,["color","hide-title","title"])],8,ve)]),_:1})]),_:1},16))])}}}),Pe=(U,l)=>{const e=U.__vccOpts||U;for(const[n,F]of l)e[n]=F;return e},at=Pe(Ae,[["__scopeId","data-v-bfdaf6f7"]]),_e={key:0,class:"config-card-fieldset-title"},qe=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(U){const l=U,{i18n:{t:e}}=X.useI18n(),{convertKeyToTitle:n}=X.useStringHelpers(),F=t.computed(()=>l.item.key??"json-array-item"),Q=t.computed(()=>l.item.value??l.item),a=t.computed(()=>{const o=JSON.parse(JSON.stringify(Q.value));return l.isArrayItem&&delete o.name,o}),d=t.computed(()=>{var o;return l.isArrayItem?(o=Q.value)!=null&&o.name?n(Q.value.name,"_"):e("baseConfigCard.general.entryTitle",{index:l.index}):""});return(o,R)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(U.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(U.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[U.isArrayItem?(t.openBlock(),t.createElementBlock("legend",_e,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(a.value),(r,V)=>(t.openBlock(),t.createBlock(EU,{key:`${F.value}-property-${V}`,item:{key:r,label:t.unref(n)(r),value:a.value[r]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),eU=(U,l)=>{const e=U.__vccOpts||U;for(const[n,F]of l)e[n]=F;return e},dt=eU(qe,[["__scopeId","data-v-68ca83ec"]]),$e=eU(t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(U){const{i18n:{t:l}}=X.useI18n();return(e,n)=>{const F=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(F,{appearance:"btn-link",class:"navigation-button",onClick:n[0]||(n[0]=Q=>e.$emit("navigation-click",U.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(U.item.value||t.unref(l)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-7410504d"]]),Ul=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(U){const{i18n:{t:l}}=X.useI18n();return(e,n)=>{const F=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(F,{appearance:U.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(U.status?t.unref(l)("baseConfigCard.statusBadge.enabledLabel"):t.unref(l)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),tl="#0044f4",el="#e0e4ea",ll="#3a3f51",Fl="1px",nl="20px",Ql={class:"config-card-details-row"},al=["data-testid"],dl=["data-testid"],ol=["data-testid"],rl=["data-testid"],il={key:1},Vl=["data-testid"],Rl=["data-testid"],Bl=["data-testid"],cl=["data-testid"],sl=["title"],Nl={name:"ConfigCardItem",components:{CopyUuid:at,JsonCardItem:dt,StatusBadge:Ul,InternalLinkItem:$e}},Jl=t.defineComponent({...Nl,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(U,{emit:l}){const e=U;t.useCssVars(V=>({"2c6ac268":R.value?"none":`solid ${t.unref(Fl)} ${t.unref(el)}`,c7a65802:o.value&&a.value?"block":"flex","778426fe":o.value&&a.value?"100%":e.slim?"50%":"25%","777f9b48":o.value&&a.value?"100%":e.slim?"50%":"75%"}));const n=t.useSlots(),{i18n:{t:F,formatUnixTimeStamp:Q}}=X.useI18n(),a=t.computed(()=>e.item.value!==void 0&&e.item.value!==null&&e.item.value!==""),d=t.computed(()=>!!(e.item.tooltip||n["label-tooltip"])),o=t.computed(()=>e.item.type===z.Json||e.item.type===z.JsonArray),R=t.computed(()=>e.item.type===z.JsonArray),r=t.computed(()=>{switch(e.item.type){case z.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${e.item.key}-copy-uuid`,"success-tooltip":F("baseConfigCard.copy.success"),tooltip:F("baseConfigCard.copy.tooltip",{label:e.item.label}),truncated:!1,uuid:e.item.value,notify:()=>{}}};case z.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":F("baseConfigCard.copy.success"),tooltip:F("baseConfigCard.copy.tooltip",{label:e.item.label}),truncated:!1,notify:()=>{}}};case z.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${e.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":F("baseConfigCard.copy.success"),tooltip:F("baseConfigCard.copy.tooltip",{label:e.item.label}),truncated:!1,uuid:e.item.value,notify:()=>{}}};case z.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":F("baseConfigCard.copy.success"),tooltip:F("baseConfigCard.copy.tooltip",{label:e.item.label}),truncated:!1,notify:()=>{}}};case z.Date:return{tag:"div",attrs:{"data-testid":`${e.item.key}-date`},text:Q(e.item.value)};case z.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${e.item.key}-badge-status`,status:e.item.value}};case z.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case z.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case z.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${e.item.key}-internal-link`,item:e.item,onNavigationClick:V=>{l("navigation-click",V)}}};case z.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${e.item.key}-external-link`,href:e.item.value},text:e.item.value};case z.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${e.item.key}-json-content`,item:e.item}};case z.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${e.item.key}-json-array-content`,item:e.item}};default:return{tag:"div",attrs:{"data-testid":`${e.item.key}-plain-text`},text:e.item.value}}});return(V,J)=>{const i=t.resolveComponent("KLabel"),S=t.resolveComponent("KBadge"),k=t.resolveComponent("KMethodBadge");return t.openBlock(),t.createElementBlock("div",Ql,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${U.item.key}-label`},[t.renderSlot(V.$slots,"label",{item:U.item},()=>[t.createVNode(i,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(U.item.label)+" ",1)]),_:2},[d.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${U.item.key}-label-tooltip`},[t.renderSlot(V.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(U.item.tooltip),1)],!0)],8,dl)]),key:"0"}:void 0]),1024)],!0)],8,al),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${U.item.key}-property-value`},[t.renderSlot(V.$slots,U.item.key,{rowValue:U.item.value},()=>[a.value?(t.openBlock(),t.createElementBlock("div",il,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.value.tag),t.normalizeProps(t.guardReactiveProps(r.value.attrs)),{default:t.withCtx(()=>[r.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${U.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.item.value,(c,p)=>(t.openBlock(),t.createBlock(S,{key:`${U.item.key}-badge-tag-${p}`,class:"config-badge","data-testid":`${U.item.key}-badge-tag-${p}`,"truncation-tooltip":c},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,Vl)):t.createCommentVNode("",!0),r.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${U.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.item.value,(c,p)=>(t.openBlock(),t.createBlock(t.unref(at),t.mergeProps(r.value.childAttrs,{key:`${U.item.key}-copy-uuid-${p}`,"data-testid":`${U.item.key}-copy-uuid-${p}`,uuid:c}),null,16,["data-testid","uuid"]))),128))],8,Rl)):r.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${U.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.item.value,(c,p)=>(t.openBlock(),t.createBlock(k,{key:`${U.item.key}-badge-method-${p}`,class:"config-badge","data-testid":`${U.item.key}-badge-method-${p}`,"is-rounded":"",label:c,method:t.unref(Je.MethodsArray).includes(c.toLowerCase())?c.toLowerCase():"custom"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,Bl)):t.createCommentVNode("",!0),r.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${e.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(U.item.value,(c,p)=>(t.openBlock(),t.createBlock(dt,{key:`json-array-item-${p}`,index:p,"is-array-item":"",item:c},null,8,["index","item"]))),128))],8,cl)):(t.openBlock(),t.createElementBlock("span",{key:4,class:t.normalizeClass(["attrs-data-text",{truncated:U.truncated}]),title:U.truncated?U.item.value:void 0},t.toDisplayString(r.value.text),11,sl))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${U.item.key}-no-value`}," – ",8,rl))],!0)],8,ol)])}}}),EU=eU(Jl,[["__scopeId","data-v-a3c5ab01"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function ot(U){return typeof U>"u"||U===null}function Zl(U){return typeof U=="object"&&U!==null}function pl(U){return Array.isArray(U)?U:ot(U)?[]:[U]}function kl(U,l){var e,n,F,Q;if(l)for(Q=Object.keys(l),e=0,n=Q.length;e<n;e+=1)F=Q[e],U[F]=l[F];return U}function Sl(U,l){var e="",n;for(n=0;n<l;n+=1)e+=U;return e}function Wl(U){return U===0&&Number.NEGATIVE_INFINITY===1/U}var ml=ot,ul=Zl,Tl=pl,Dl=Sl,Cl=Wl,hl=kl,O={isNothing:ml,isObject:ul,toArray:Tl,repeat:Dl,isNegativeZero:Cl,extend:hl};function rt(U,l){var e="",n=U.reason||"(unknown reason)";return U.mark?(U.mark.name&&(e+='in "'+U.mark.name+'" '),e+="("+(U.mark.line+1)+":"+(U.mark.column+1)+")",!l&&U.mark.snippet&&(e+=`
2
2
 
3
3
  `+U.mark.snippet),n+" "+e):n}function sU(U,l){Error.call(this),this.name="YAMLException",this.reason=U,this.mark=l,this.message=rt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}sU.prototype=Object.create(Error.prototype),sU.prototype.constructor=sU,sU.prototype.toString=function(U){return this.name+": "+rt(this,U)};var _=sU;function gU(U,l,e,n,F){var Q="",a="",d=Math.floor(F/2)-1;return n-l>d&&(Q=" ... ",l=n-d+Q.length),e-n>d&&(a=" ...",e=n+d-a.length),{str:Q+U.slice(l,e).replace(/\t/g,"→")+a,pos:n-l+Q.length}}function xU(U,l){return O.repeat(" ",l-U.length)+U}function Ml(U,l){if(l=Object.create(l||null),!U.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);for(var e=/\r?\n|\r|\0/g,n=[0],F=[],Q,a=-1;Q=e.exec(U.buffer);)F.push(Q.index),n.push(Q.index+Q[0].length),U.position<=Q.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var d="",o,R,r=Math.min(U.line+l.linesAfter,F.length).toString().length,V=l.maxLength-(l.indent+r+3);for(o=1;o<=l.linesBefore&&!(a-o<0);o++)R=gU(U.buffer,n[a-o],F[a-o],U.position-(n[a]-n[a-o]),V),d=O.repeat(" ",l.indent)+xU((U.line-o+1).toString(),r)+" | "+R.str+`
4
4
  `+d;for(R=gU(U.buffer,n[a],F[a],U.position,V),d+=O.repeat(" ",l.indent)+xU((U.line+1).toString(),r)+" | "+R.str+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-vaults",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-vaults.umd.js",
6
6
  "module": "./dist/entities-vaults.es.js",
@@ -49,7 +49,7 @@
49
49
  "errorLimit": "700KB"
50
50
  },
51
51
  "dependencies": {
52
- "@kong-ui-public/entities-shared": "^1.5.0"
52
+ "@kong-ui-public/entities-shared": "^1.5.1"
53
53
  },
54
54
  "scripts": {
55
55
  "dev": "cross-env USE_SANDBOX=true vite",