@kong-ui-public/entities-consumers 2.2.0 → 2.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.
@@ -1,23 +1,23 @@
1
- (function(Q,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(Q=typeof globalThis<"u"?globalThis:Q||self,t(Q["kong-ui-public-entities-consumers"]={},Q.Vue,Q.VueRouter,Q["kong-ui-public-i18n"],Q.axios,Q.Kongponents))})(this,function(Q,t,Te,ye,To,$o){"use strict";const Mo={consumers:{list:{table_headers:{username:"Username",custom_id:"Custom ID",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer",description:"Consumers are the end users of a service.",title_for_consumer_group:"Configure a New Consumer"},toolbar_actions:{new_consumer:"New Consumer"}},title:"Consumers",search:{placeholder:"Filter by name"},actions:{add_consumer:"Add Consumer",create:"New Consumer",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",remove:"Remove",view:"View Details"},delete:{title:"Delete a Consumer",description:"Deleting this consumer will also remove this consumer from any associated consumer group. This action cannot be reversed."},consumer_groups:{add:{title:"Add Consumers",ctaText:"Add consumers to this group",consumers_label:"Consumers",consumer_placeholder:"Add consumer",footer:"Search by exact name or ID to find consumers not included in the list"},remove:{title:"Remove a Consumer",confirmation:"Are you sure you want to remove this consumer {consumer} from consumer group {consumerGroup}?",confirmationNoCG:"Are you sure you want to remove this consumer {consumer} from this consumer group?",description:"Removing this consumer from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumers could not be retrieved",delete:"The consumer could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"Some consumers could not be added at this time.",already_added:"This consumer has already been added to the consumer group"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{title:"Consumer Identification",info:{title:"General Information",description:"General information will help identify and manage added consumer."},consumer_identification:{title:"Consumer Identification",description:"A consumer can have both unique username and unique custom ID or one of them."}},fields:{username:{label:"Username",placeholder:"Enter a unique username",tooltip:"The unique username of the Consumer. You must send either this field or {custom_id} with the request.",custom_id:"custom_id"},custom_id:{label:"Custom ID",placeholder:"Enter a unique custom ID",tooltip:"Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database. You must send either this field or {username} with the request.",username:"username"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Consumer for grouping and filtering."}}}};function jo(){const e=ye.createI18n("en-us",Mo);return{i18n:e,i18nT:ye.i18nTComponent(e)}}const Se={useI18n:jo},$e="/api/runtime_groups/{controlPlaneId}",de="/{workspace}",le={list:{konnect:{all:"/v2/control-planes/{controlPlaneId}/core-entities/consumers",forConsumerGroup:"/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{consumerGroupId}/consumers",oneForConsumerGroup:"/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{consumerGroupId}/consumers/{consumerId}"},kongManager:{all:`${de}/consumers`,forConsumerGroup:`${de}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${de}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`}},form:{konnect:{validate:`${$e}/v1/schemas/json/consumer/validate`,create:`${$e}/consumers`,edit:`${$e}/consumers/{id}`},kongManager:{validate:`${de}/schemas/consumers/validate`,create:`${de}/consumers`,edit:`${de}/consumers/{id}`}}};var nt=(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))(nt||{}),Me=(e=>(e.Edit="edit",e.Create="create",e))(Me||{}),se=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(se||{}),K=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(K||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function je(e={}){return{axiosInstance:To.create({withCredentials:!0,timeout:3e4,...e})}}function Oo(){return{debounce:(e,n)=>{let o;return(...r)=>{clearTimeout(o),o=window==null?void 0:window.setTimeout(()=>{e(...r)},n)}}}}const Oe="khcp-user-table-preferences",Do={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Fo(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},n=()=>{const o=e(localStorage.getItem(Oe));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,r)=>{try{const a=n();a.set(o,r),localStorage.setItem(Oe,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:o=>{const r=n();return(r==null?void 0:r.get(o))||void 0||Do},deleteAllTablePreferences:()=>{localStorage.removeItem(Oe)}}}const Ko={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},qo={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Lo={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},vo={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Po={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"}},Ro={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Uo={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Go={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},zo={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"}},Ho={global:Ko,deleteModal:qo,baseForm:Lo,baseTable:vo,baseConfigCard:Po,filter:Ro,debouncedFilter:Uo,errors:Go,toggleModal:zo};function De(){const e=ye.createI18n("en-us",Ho);return{i18n:e,i18nT:ye.i18nTComponent(e)}}function rt(){const e=(o,r)=>(r==null?void 0:r[o])??void 0,n=(o,r)=>{if(o.length!==r.length)return!1;const a=new Set([...o,...r]);for(const i of a){const l=o.filter(c=>c===i).length,s=r.filter(c=>c===i).length;if(l!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(o,r,a)=>{if(a){if(Object.keys(o).length===Object.keys(r).length)for(const i in o)if(Array.isArray(o[i])&&Array.isArray(r[i])){if(n(o[i],r[i]))continue;return!1}else{if(o[i]===r[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(o)===JSON.stringify(r)}catch{return!1}},sortAlpha:o=>(r,a)=>{let i=r[o]===void 0||r[o]===null?"":r[o],l=a[o]===void 0||a[o]===null?"":a[o];return Array.isArray(r[o])&&(i=r[o][0]),Array.isArray(a[o])&&(l=a[o][0]),i.localeCompare(l)},isValidUuid:o=>o?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(o):!1}}function Jo(e,n,o,r={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="100");const{axiosInstance:a}=je({headers:e.requestHeaders}),{i18n:{t:i}}=De(),{debounce:l}=Oo(),s=l(async h=>{await V(h)},200),c=t.ref(!1),d=t.ref(""),p=t.ref(""),u=t.ref([]),g=t.ref([]),m=t.ref(void 0),S=t.unref(n);let C=`${e.apiBaseUrl}${S}`;e.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:f}=rt(),_=async()=>{try{c.value=!0;const{data:h}=await a.get(`${C}?size=${o}`);h!=null&&h.next||(m.value=r.fetchedItemsKey in h?h[r.fetchedItemsKey]:[]),g.value=r.fetchedItemsKey in h?h[r.fetchedItemsKey]:[],u.value=g.value}catch{u.value=[],d.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},w=t.ref(""),V=async h=>{var k,A,M;if(w.value!==h)if(w.value=h||"",m.value===void 0)try{if(c.value=!0,d.value="",p.value="",e.app==="konnect"){let y=C+"";h&&(y+=`/${h}`);const{data:b}=await a.get(`${y}?size=${o}`);r.fetchedItemsKey in b?u.value=b[r.fetchedItemsKey]:b!=null&&b.id?u.value=[b]:u.value=[]}else if(h){const y=[];f(h)&&r.searchKeys.includes("id")?y.push((async()=>{const{data:E}=await a.get(`${C}/${h}`);return[E[r.fetchedItemsKey]??E]})()):y.push(...r.searchKeys.filter(E=>E!=="id").map(async E=>{const{data:x}=await a.get(`${C}?${E}=${h}`);return x[r.fetchedItemsKey]}));const b=await Promise.all(y),$=new Set;u.value=[],(k=b==null?void 0:b.forEach)==null||k.call(b,E=>{var x;(x=E==null?void 0:E.forEach)==null||x.call(E,N=>{$.has(N.id)||($.add(N.id),u.value.push(N))})})}else u.value=g.value}catch(y){((A=y==null?void 0:y.response)==null?void 0:A.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],d.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",h?(u.value=(M=m.value)==null?void 0:M.filter(y=>{var b;let $=!1;for(const E of r.searchKeys){const x=typeof y[E]=="string"?(b=y[E])==null?void 0:b.toLowerCase():y[E];x!=null&&x.includes(h.toLowerCase())&&($=!0)}return $}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid"))):u.value=m.value,c.value=!1};return{loading:c,error:d,validationError:p,results:u,allRecords:m,loadItems:_,debouncedQueryChange:s}}function Yo(e,n){const o=t.unref(n),r=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return r.value.search="",a=>`${r.value.href}/${a}`}function Wo(){const{i18n:{t:e}}=De();return{getMessageFromError:n=>{var o,r,a;if(!n)return e("errors.unexpected");if((o=n==null?void 0:n.response)!=null&&o.data){if(n.response.data.detail)return n.response.data.detail;if((r=n.response.data.details)!=null&&r.length)return n.response.data.details.map(i=>{let l=e("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(l=i.messages.join(", ")),i.field?`${i.field} - ${l}`:l}).join("; ");if(n.response.data.message){const{message:i}=n.response.data;return Array.isArray(i)?(a=i[0])!=null&&a.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof n.response.data=="string")return n.response.data;if(typeof n.response.data=="object")return Object.keys(n.response.data).map(i=>`${i} ${n.response.data[i]}`).join(", ")}return n.message||e("errors.unexpected")}}}function Zo(e){const n=window.location.origin,o=n.endsWith("/")?n:`${n}/`;try{const r=e.join("/"),a=`${o}${r}`,i=e.some(l=>l.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(a)&&!i&&new URL(a))return`${o}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function at(e,n){const o=t.ref(t.unref(e)),r=t.ref(t.unref(n)),a=t.computed(()=>!!(o.value.app==="konnect"||o.value.isExactMatch)),i=t.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return l=>{const{page:s,pageSize:c,offset:d,sortColumnKey:p,sortColumnOrder:u,query:g}=l;try{let m=new URL(i.value.href);return a.value&&g?(m.search="",m=new URL(`${m.href}?filter[name][contains]=${g}`)):(a.value||new URLSearchParams(g).forEach((S,C)=>{m.searchParams.append(C,S)}),p&&m.searchParams.append("sort_by",p),u==="desc"&&m.searchParams.append("sort_desc","1"),m.searchParams.append("size",String(c))),d&&s!==1&&m.searchParams.append("offset",String(d)),m.href}catch(m){return console.error("RouteList(fetcher)",m),r.value}}}function Qo(e,n,o="data"){const r=t.unref(n),{axiosInstance:a}=je({headers:e.requestHeaders}),i=at(e,r),l=t.ref({status:se.Idle});return{fetcher:async s=>{try{l.value={status:se.Loading};const c=i(s),{data:d}=await a.get(c),p=o&&o.replace(/[^\w-_]/gi,"");let u;d[p]&&Array.isArray(d[p])?u=d[p]:Array.isArray(d)?u=d:u=Object.keys(d).length?[d]:[];const g={data:u,total:u.length,...d.offset?{pagination:{offset:d.offset}}:null};return l.value={status:se.Idle,response:g},g}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(l.value={status:se.NoResults,response:d,error:c},d):(l.value={status:se.Error,response:d,error:c},d)}},fetcherState:l}}function Xo(){const e=(o,r="_")=>o?o.split(r).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:o=>o?o.replace(n,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const it=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,lt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(it);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},st=e=>e==="*"||e==="x"||e==="X",ct=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},en=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],tn=(e,n)=>{if(st(e)||st(n))return 0;const[o,r]=en(ct(e),ct(n));return o>r?1:o<r?-1:0},dt=(e,n)=>{for(let o=0;o<Math.max(e.length,n.length);o++){const r=tn(e[o]||"0",n[o]||"0");if(r!==0)return r}return 0},on=(e,n)=>{const o=lt(e),r=lt(n),a=o.pop(),i=r.pop(),l=dt(o,r);return l!==0?l:a&&i?dt(a.split("."),i.split(".")):a||i?a?-1:1:0},ut=(e,n,o)=>{nn(o);const r=on(e,n);return pt[o].includes(r)},pt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ft=Object.keys(pt),nn=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(ft.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${ft.join("|")}`)},rn=e=>typeof e=="string"&&/^[v\d]/.test(e)&&it.test(e);function an(e){const{gatewayInfo:n,supportedRange:o}=e;if(!n)return!0;const{edition:r,version:a}=n;if(!rn(a))return console.error("Invalid version"),!1;const i=o[r];if(!i)return!1;const[l,s]=i;return!(l&&ut(a,l,"<")||s&&ut(a,s,">"))}function ln(e){const n=t.ref(0),o=t.ref(0),r=t.ref(!1);return t.watch(e,a=>{a&&!r.value&&(n.value=a.offsetWidth,o.value=a.scrollWidth,r.value=!0)}),{isTruncated:t.computed(()=>n.value<o.value)}}const U={useAxios:je,useDebouncedFilter:Jo,useDeleteUrlBuilder:Yo,useErrors:Wo,useExternalLinkCreator:Zo,useFetcher:Qo,useFetchUrlBuilder:at,useHelpers:rt,useStringHelpers:Xo,useI18n:De,useGatewayFeatureSupported:an,useTruncationDetector:ln},sn={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},cn="Copy to clipboard",dn={message:sn,iconTitle:cn},un="kong-ui-copy-uuid-notify",mt="24px",pn=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},fn=e=>(t.pushScopeId("data-v-243f8fec"),e=e(),t.popScopeId(),e),mn=["aria-hidden"],gn={key:0,"data-testid":"kui-icon-svg-title"},hn=fn(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),yn=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:mt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return mt}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",gn,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),hn],8,mn))]),_:1},8,["aria-hidden","style"]))}}),Cn=pn(yn,[["__scopeId","data-v-243f8fec"]]),bn="16px",kn={class:"kong-ui-copy-uuid"},wn=["onClick"],gt=15,xn=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:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:n}){const o=e,{t:r}=ye.createI18n("en-us",dn),a=o.notify||t.inject(un,()=>{}),i=t.computed(()=>o.idTooltip?{label:o.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:o.uuid}),l=t.computed(()=>!!(o.tooltip&&o.successTooltip)),s=t.ref(o.tooltip),c=t.computed(()=>o.tooltip?{label:s.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=t.computed(()=>{var g;return o.format==="redacted"?"*****":o.format==="deleted"?`*${(g=o.uuid)==null?void 0:g.substring(0,5)}`:o.uuid}),p=g=>{s.value=g,setTimeout(()=>{s.value=o.tooltip},1800)},u=g=>{var m,S;if(!g(o.uuid)){typeof a=="function"&&a({type:"error",message:r("message.fail")}),l.value?p(r("message.fail")):n("error",o.uuid);return}const C=((m=o.uuid)==null?void 0:m.length)>gt,f=o.format==="hidden"||o.format==="redacted"?r("message.success.prefix"):`"${((S=o.uuid)==null?void 0:S.substring(0,gt))+(C?"...":"")}"`;typeof a=="function"&&a({type:"success",message:`${f}${r("message.success.content")}`}),l.value?p(o.successTooltip):n("success",o.uuid)};return(g,m)=>{const S=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",kn,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},i.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(d.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(c.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(S,null,{default:t.withCtx(({copyToClipboard:C})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(f=>u(C),["stop"])},[t.createVNode(t.unref(Cn),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(bn),title:t.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,wn)]),_:1})]),_:1},16))])}}}),Sn=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},ht=Sn(xn,[["__scopeId","data-v-0c07874b"]]),_n={key:0,class:"config-card-fieldset-title"},Bn=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const n=e,{i18n:{t:o}}=U.useI18n(),{convertKeyToTitle:r}=U.useStringHelpers(),a=t.computed(()=>n.item.key??"json-array-item"),i=t.computed(()=>n.item.value??n.item),l=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return n.isArrayItem&&delete c.name,c}),s=t.computed(()=>{var c;return n.isArrayItem?(c=i.value)!=null&&c.name?r(i.value.name,"_"):o("baseConfigCard.general.entryTitle",{index:n.index}):""});return(c,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",_n,[t.createElementVNode("b",null,t.toDisplayString(s.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(l.value),(p,u)=>(t.openBlock(),t.createBlock(Fe,{key:`${a.value}-property-${u}`,item:{key:p,label:t.unref(r)(p),value:l.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),X=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},yt=X(Bn,[["__scopeId","data-v-68ca83ec"]]),In=X(t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:n}}=U.useI18n();return(o,r)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(a,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=i=>o.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(n)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-c96811e5"]]),Nn=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:n}}=U.useI18n();return(o,r)=>{const a=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(a,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(n)("baseConfigCard.statusBadge.enabledLabel"):t.unref(n)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),An="#0044f4",En="#e0e4ea",Vn="#3a3f51",Tn="1px",$n="20px",Mn={class:"config-card-details-row"},jn=["data-testid"],On=["data-testid"],Dn=["data-testid"],Fn=["data-testid"],Kn={key:1},qn=["data-testid"],Ln=["data-testid"],vn=["data-testid"],Pn=["data-testid"],Rn={name:"ConfigCardItem",components:{CopyUuid:ht,JsonCardItem:yt,StatusBadge:Nn,InternalLinkItem:In}},Un=t.defineComponent({...Rn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:n}){const o=e;t.useCssVars(m=>({"23f3018c":d.value?"none":`solid ${t.unref(Tn)} ${t.unref(En)}`,"3815ec6d":c.value&&l.value?"block":"flex","1957f153":c.value&&l.value?"100%":o.slim?"50%":"25%","195a372e":c.value&&l.value?"100%":o.slim?"50%":"75%"}));const r=t.useSlots(),{i18n:{t:a,formatUnixTimeStamp:i}}=U.useI18n(),l=t.computed(()=>o.item.value!==void 0&&o.item.value!==null&&o.item.value!==""),s=t.computed(()=>!!(o.item.tooltip||r["label-tooltip"])),c=t.computed(()=>o.item.type===K.Json||o.item.type===K.JsonArray),d=t.computed(()=>o.item.type===K.JsonArray),p=t.computed(()=>{switch(o.item.type){case K.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${o.item.key}-copy-uuid`,"success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,uuid:o.item.value,notify:()=>{}}};case K.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,notify:()=>{}}};case K.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${o.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,uuid:o.item.value,notify:()=>{}}};case K.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,notify:()=>{}}};case K.Date:return{tag:"div",attrs:{"data-testid":`${o.item.key}-date`},text:i(o.item.value)};case K.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${o.item.key}-badge-status`,status:o.item.value}};case K.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case K.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case K.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${o.item.key}-internal-link`,item:o.item,onNavigationClick:m=>{n("navigation-click",m)}}};case K.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${o.item.key}-external-link`,href:o.item.value},text:o.item.value};case K.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-content`,item:o.item}};case K.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-array-content`,item:o.item}};default:return{tag:"div",attrs:{"data-testid":`${o.item.key}-plain-text`},text:o.item.value}}}),u=t.ref(),{isTruncated:g}=U.useTruncationDetector(u);return(m,S)=>{const C=t.resolveComponent("KLabel"),f=t.resolveComponent("KBadge"),_=t.resolveComponent("KMethodBadge"),w=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Mn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(m.$slots,"label",{item:e.item},()=>[t.createVNode(C,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[s.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(m.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,On)]),key:"0"}:void 0]),1024)],!0)],8,jn),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(m.$slots,e.item.key,{rowValue:e.item.value},()=>[l.value?(t.openBlock(),t.createElementBlock("div",Kn,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(p.value.tag),t.normalizeProps(t.guardReactiveProps(p.value.attrs)),{default:t.withCtx(()=>[p.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(V,h)=>(t.openBlock(),t.createBlock(f,{key:`${e.item.key}-badge-tag-${h}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${h}`,"truncation-tooltip":V},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(V),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,qn)):t.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(V,h)=>(t.openBlock(),t.createBlock(t.unref(ht),t.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${h}`,"data-testid":`${e.item.key}-copy-uuid-${h}`,uuid:V}),null,16,["data-testid","uuid"]))),128))],8,Ln)):p.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(V,h)=>(t.openBlock(),t.createBlock(_,{key:`${e.item.key}-badge-method-${h}`,class:"config-badge","data-testid":`${e.item.key}-badge-method-${h}`,"is-rounded":"",label:V,method:t.unref($o.MethodsArray).includes(V.toLowerCase())?V.toLowerCase():"custom"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(V),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,vn)):t.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${o.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(V,h)=>(t.openBlock(),t.createBlock(yt,{key:`json-array-item-${h}`,index:h,"is-array-item":"",item:V},null,8,["index","item"]))),128))],8,Pn)):(t.openBlock(),t.createBlock(w,{key:4,label:t.unref(g)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:u,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Fn))],!0)],8,Dn)])}}}),Fe=X(Un,[["__scopeId","data-v-e851fc7c"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ct(e){return typeof e>"u"||e===null}function Gn(e){return typeof e=="object"&&e!==null}function zn(e){return Array.isArray(e)?e:Ct(e)?[]:[e]}function Hn(e,n){var o,r,a,i;if(n)for(i=Object.keys(n),o=0,r=i.length;o<r;o+=1)a=i[o],e[a]=n[a];return e}function Jn(e,n){var o="",r;for(r=0;r<n;r+=1)o+=e;return o}function Yn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Wn=Ct,Zn=Gn,Qn=zn,Xn=Jn,er=Yn,tr=Hn,R={isNothing:Wn,isObject:Zn,toArray:Qn,repeat:Xn,isNegativeZero:er,extend:tr};function bt(e,n){var o="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(o+='in "'+e.mark.name+'" '),o+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(o+=`
1
+ (function(Q,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],t):(Q=typeof globalThis<"u"?globalThis:Q||self,t(Q["kong-ui-public-entities-consumers"]={},Q.Vue,Q.VueRouter,Q["kong-ui-public-i18n"],Q.axios,Q.Kongponents))})(this,function(Q,t,Te,he,To,$o){"use strict";const Mo={consumers:{list:{table_headers:{username:"Username",custom_id:"Custom ID",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Consumer",description:"Consumers are the end users of a service.",title_for_consumer_group:"Configure a New Consumer"},toolbar_actions:{new_consumer:"New Consumer"}},title:"Consumers",search:{placeholder:"Filter by name"},actions:{add_consumer:"Add Consumer",create:"New Consumer",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",remove:"Remove",view:"View Details"},delete:{title:"Delete a Consumer",description:"Deleting this consumer will also remove this consumer from any associated consumer group. This action cannot be reversed."},consumer_groups:{add:{title:"Add Consumers",ctaText:"Add consumers to this group",consumers_label:"Consumers",consumer_placeholder:"Add consumer",footer:"Search by exact name or ID to find consumers not included in the list"},remove:{title:"Remove a Consumer",confirmation:"Are you sure you want to remove this consumer {consumer} from consumer group {consumerGroup}?",confirmationNoCG:"Are you sure you want to remove this consumer {consumer} from this consumer group?",description:"Removing this consumer from the group could change the rate limit policy applied to this consumer."}},errors:{general:"Consumers could not be retrieved",delete:"The consumer could not be deleted at this time.",copy:"Failed to copy to clipboard",add:"Some consumers could not be added at this time.",already_added:"This consumer has already been added to the consumer group"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{title:"Consumer Identification",info:{title:"General Information",description:"General information will help identify and manage added consumer."},consumer_identification:{title:"Consumer Identification",description:"A consumer can have both unique username and unique custom ID or one of them."}},fields:{username:{label:"Username",placeholder:"Enter a unique username",tooltip:"The unique username of the Consumer. You must send either this field or {custom_id} with the request.",custom_id:"custom_id"},custom_id:{label:"Custom ID",placeholder:"Enter a unique custom ID",tooltip:"Field for storing an existing unique ID for the Consumer - useful for mapping Kong with users in your existing database. You must send either this field or {username} with the request.",username:"username"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Consumer for grouping and filtering."}}}};function jo(){const e=he.createI18n("en-us",Mo);return{i18n:e,i18nT:he.i18nTComponent(e)}}const Se={useI18n:jo},$e="/api/runtime_groups/{controlPlaneId}",ce="/{workspace}",ie={list:{konnect:{all:"/v2/control-planes/{controlPlaneId}/core-entities/consumers",forConsumerGroup:"/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{consumerGroupId}/consumers",oneForConsumerGroup:"/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{consumerGroupId}/consumers/{consumerId}"},kongManager:{all:`${ce}/consumers`,forConsumerGroup:`${ce}/consumer_groups/{consumerGroupId}/consumers`,oneForConsumerGroup:`${ce}/consumer_groups/{consumerGroupId}/consumers/{consumerId}`}},form:{konnect:{validate:`${$e}/v1/schemas/json/consumer/validate`,create:`${$e}/consumers`,edit:`${$e}/consumers/{id}`},kongManager:{validate:`${ce}/schemas/consumers/validate`,create:`${ce}/consumers`,edit:`${ce}/consumers/{id}`}}};var nt=(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))(nt||{}),Me=(e=>(e.Edit="edit",e.Create="create",e))(Me||{}),le=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(le||{}),K=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(K||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function je(e={}){return{axiosInstance:To.create({withCredentials:!0,timeout:3e4,...e})}}function Oo(){return{debounce:(e,n)=>{let o;return(...r)=>{clearTimeout(o),o=window==null?void 0:window.setTimeout(()=>{e(...r)},n)}}}}const Oe="khcp-user-table-preferences",Do={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Fo(){const e=o=>{if(typeof o=="string")try{return JSON.parse(o)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},n=()=>{const o=e(localStorage.getItem(Oe));return!o||!Object.keys(o).length?new Map:new Map(Object.entries(o))};return{setTablePreferences:(o,r)=>{try{const a=n();a.set(o,r),localStorage.setItem(Oe,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:o=>{const r=n();return(r==null?void 0:r.get(o))||void 0||Do},deleteAllTablePreferences:()=>{localStorage.removeItem(Oe)}}}const Ko={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},qo={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Lo={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},vo={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Po={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"}},Ro={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Uo={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Go={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},zo={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"}},Ho={global:Ko,deleteModal:qo,baseForm:Lo,baseTable:vo,baseConfigCard:Po,filter:Ro,debouncedFilter:Uo,errors:Go,toggleModal:zo};function De(){const e=he.createI18n("en-us",Ho);return{i18n:e,i18nT:he.i18nTComponent(e)}}function rt(){const e=(o,r)=>(r==null?void 0:r[o])??void 0,n=(o,r)=>{if(o.length!==r.length)return!1;const a=new Set([...o,...r]);for(const i of a){const l=o.filter(c=>c===i).length,s=r.filter(c=>c===i).length;if(l!==s)return!1}return!0};return{getPropValue:e,objectsAreEqual:(o,r,a)=>{if(a){if(Object.keys(o).length===Object.keys(r).length)for(const i in o)if(Array.isArray(o[i])&&Array.isArray(r[i])){if(n(o[i],r[i]))continue;return!1}else{if(o[i]===r[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(o)===JSON.stringify(r)}catch{return!1}},sortAlpha:o=>(r,a)=>{let i=r[o]===void 0||r[o]===null?"":r[o],l=a[o]===void 0||a[o]===null?"":a[o];return Array.isArray(r[o])&&(i=r[o][0]),Array.isArray(a[o])&&(l=a[o][0]),i.localeCompare(l)},isValidUuid:o=>o?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(o):!1}}function Jo(e,n,o,r={fetchedItemsKey:"data",searchKeys:["id"]}){o||(o="100");const{axiosInstance:a}=je({headers:e.requestHeaders}),{i18n:{t:i}}=De(),{debounce:l}=Oo(),s=l(async h=>{await V(h)},200),c=t.ref(!1),d=t.ref(""),p=t.ref(""),u=t.ref([]),g=t.ref([]),m=t.ref(void 0),S=t.unref(n);let C=`${e.apiBaseUrl}${S}`;e.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:f}=rt(),_=async()=>{try{c.value=!0;const{data:h}=await a.get(`${C}?size=${o}`);h!=null&&h.next||(m.value=r.fetchedItemsKey in h?h[r.fetchedItemsKey]:[]),g.value=r.fetchedItemsKey in h?h[r.fetchedItemsKey]:[],u.value=g.value}catch{u.value=[],d.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},w=t.ref(""),V=async h=>{var k,A,M;if(w.value!==h)if(w.value=h||"",m.value===void 0)try{if(c.value=!0,d.value="",p.value="",e.app==="konnect"){let y=C+"";h&&(y+=`/${h}`);const{data:b}=await a.get(`${y}?size=${o}`);r.fetchedItemsKey in b?u.value=b[r.fetchedItemsKey]:b!=null&&b.id?u.value=[b]:u.value=[]}else if(h){const y=[];f(h)&&r.searchKeys.includes("id")?y.push((async()=>{const{data:E}=await a.get(`${C}/${h}`);return[E[r.fetchedItemsKey]??E]})()):y.push(...r.searchKeys.filter(E=>E!=="id").map(async E=>{const{data:x}=await a.get(`${C}?${E}=${h}`);return x[r.fetchedItemsKey]}));const b=await Promise.all(y),$=new Set;u.value=[],(k=b==null?void 0:b.forEach)==null||k.call(b,E=>{var x;(x=E==null?void 0:E.forEach)==null||x.call(E,N=>{$.has(N.id)||($.add(N.id),u.value.push(N))})})}else u.value=g.value}catch(y){((A=y==null?void 0:y.response)==null?void 0:A.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],d.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",h?(u.value=(M=m.value)==null?void 0:M.filter(y=>{var b;let $=!1;for(const E of r.searchKeys){const x=typeof y[E]=="string"?(b=y[E])==null?void 0:b.toLowerCase():y[E];x!=null&&x.includes(h.toLowerCase())&&($=!0)}return $}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid"))):u.value=m.value,c.value=!1};return{loading:c,error:d,validationError:p,results:u,allRecords:m,loadItems:_,debouncedQueryChange:s}}function Yo(e,n){const o=t.unref(n),r=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${o}`):new URL(o));return r.value.search="",a=>`${r.value.href}/${a}`}function Wo(){const{i18n:{t:e}}=De();return{getMessageFromError:n=>{var o,r,a;if(!n)return e("errors.unexpected");if((o=n==null?void 0:n.response)!=null&&o.data){if(n.response.data.detail)return n.response.data.detail;if((r=n.response.data.details)!=null&&r.length)return n.response.data.details.map(i=>{let l=e("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(l=i.messages.join(", ")),i.field?`${i.field} - ${l}`:l}).join("; ");if(n.response.data.message){const{message:i}=n.response.data;return Array.isArray(i)?(a=i[0])!=null&&a.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof n.response.data=="string")return n.response.data;if(typeof n.response.data=="object")return Object.keys(n.response.data).map(i=>`${i} ${n.response.data[i]}`).join(", ")}return n.message||e("errors.unexpected")}}}function Zo(e){const n=window.location.origin,o=n.endsWith("/")?n:`${n}/`;try{const r=e.join("/"),a=`${o}${r}`,i=e.some(l=>l.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(a)&&!i&&new URL(a))return`${o}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function at(e,n){const o=t.ref(t.unref(e)),r=t.ref(t.unref(n)),a=t.computed(()=>!!(o.value.app==="konnect"||o.value.isExactMatch)),i=t.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return l=>{const{page:s,pageSize:c,offset:d,sortColumnKey:p,sortColumnOrder:u,query:g}=l;try{let m=new URL(i.value.href);return a.value&&g?(m.search="",m=new URL(`${m.href}?filter[name][contains]=${g}`)):(a.value||new URLSearchParams(g).forEach((S,C)=>{m.searchParams.append(C,S)}),p&&m.searchParams.append("sort_by",p),u==="desc"&&m.searchParams.append("sort_desc","1"),m.searchParams.append("size",String(c))),d&&s!==1&&m.searchParams.append("offset",String(d)),m.href}catch(m){return console.error("RouteList(fetcher)",m),r.value}}}function Qo(e,n,o="data"){const r=t.unref(n),{axiosInstance:a}=je({headers:e.requestHeaders}),i=at(e,r),l=t.ref({status:le.Idle});return{fetcher:async s=>{try{l.value={status:le.Loading};const c=i(s),{data:d}=await a.get(c),p=o&&o.replace(/[^\w-_]/gi,"");let u;d[p]&&Array.isArray(d[p])?u=d[p]:Array.isArray(d)?u=d:u=Object.keys(d).length?[d]:[];const g={data:u,total:u.length,...d.offset?{pagination:{offset:d.offset}}:null};return l.value={status:le.Idle,response:g},g}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(l.value={status:le.NoResults,response:d,error:c},d):(l.value={status:le.Error,response:d,error:c},d)}},fetcherState:l}}function Xo(){const e=(o,r="_")=>o?o.split(r).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):"",n=/(?:^|[\s-:'"])\w/g;return{capitalize:o=>o?o.replace(n,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const it=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,lt=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const n=e.match(it);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},st=e=>e==="*"||e==="x"||e==="X",ct=e=>{const n=parseInt(e,10);return isNaN(n)?e:n},en=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],tn=(e,n)=>{if(st(e)||st(n))return 0;const[o,r]=en(ct(e),ct(n));return o>r?1:o<r?-1:0},dt=(e,n)=>{for(let o=0;o<Math.max(e.length,n.length);o++){const r=tn(e[o]||"0",n[o]||"0");if(r!==0)return r}return 0},on=(e,n)=>{const o=lt(e),r=lt(n),a=o.pop(),i=r.pop(),l=dt(o,r);return l!==0?l:a&&i?dt(a.split("."),i.split(".")):a||i?a?-1:1:0},ut=(e,n,o)=>{nn(o);const r=on(e,n);return pt[o].includes(r)},pt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ft=Object.keys(pt),nn=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(ft.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${ft.join("|")}`)},rn=e=>typeof e=="string"&&/^[v\d]/.test(e)&&it.test(e);function an(e){const{gatewayInfo:n,supportedRange:o}=e;if(!n)return!0;const{edition:r,version:a}=n;if(!rn(a))return console.error("Invalid version"),!1;const i=o[r];if(!i)return!1;const[l,s]=i;return!(l&&ut(a,l,"<")||s&&ut(a,s,">"))}function ln(e){const n=t.ref(0),o=t.ref(0),r=t.ref(!1);return t.watch(e,a=>{a&&!r.value&&(n.value=a.offsetWidth,o.value=a.scrollWidth,r.value=!0)}),{isTruncated:t.computed(()=>n.value<o.value)}}const U={useAxios:je,useDebouncedFilter:Jo,useDeleteUrlBuilder:Yo,useErrors:Wo,useExternalLinkCreator:Zo,useFetcher:Qo,useFetchUrlBuilder:at,useHelpers:rt,useStringHelpers:Xo,useI18n:De,useGatewayFeatureSupported:an,useTruncationDetector:ln},sn={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},cn="Copy to clipboard",dn={message:sn,iconTitle:cn},un="kong-ui-copy-uuid-notify",mt="24px",pn=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},fn=e=>(t.pushScopeId("data-v-77afb926"),e=e(),t.popScopeId(),e),mn=["aria-hidden"],gn={key:0,"data-testid":"kui-icon-svg-title"},hn=fn(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),yn=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:mt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return mt}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",gn,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),hn],8,mn))]),_:1},8,["aria-hidden","style"]))}}),Cn=pn(yn,[["__scopeId","data-v-77afb926"]]),bn="16px",kn={class:"kong-ui-copy-uuid"},wn=["onClick"],gt=15,xn=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:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:n}){const o=e,{t:r}=he.createI18n("en-us",dn),a=o.notify||t.inject(un,()=>{}),i=t.computed(()=>o.idTooltip?{label:o.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:o.uuid}),l=t.computed(()=>!!(o.tooltip&&o.successTooltip)),s=t.ref(o.tooltip),c=t.computed(()=>o.tooltip?{label:s.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=t.computed(()=>{var g;return o.format==="redacted"?"*****":o.format==="deleted"?`*${(g=o.uuid)==null?void 0:g.substring(0,5)}`:o.uuid}),p=g=>{s.value=g,setTimeout(()=>{s.value=o.tooltip},1800)},u=g=>{var m,S;if(!g(o.uuid)){typeof a=="function"&&a({type:"error",message:r("message.fail")}),l.value?p(r("message.fail")):n("error",o.uuid);return}const C=((m=o.uuid)==null?void 0:m.length)>gt,f=o.format==="hidden"||o.format==="redacted"?r("message.success.prefix"):`"${((S=o.uuid)==null?void 0:S.substring(0,gt))+(C?"...":"")}"`;typeof a=="function"&&a({type:"success",message:`${f}${r("message.success.content")}`}),l.value?p(o.successTooltip):n("success",o.uuid)};return(g,m)=>{const S=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",kn,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},i.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(d.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(c.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(S,null,{default:t.withCtx(({copyToClipboard:C})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(f=>u(C),["stop"])},[t.createVNode(t.unref(Cn),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(bn),title:t.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,wn)]),_:1})]),_:1},16))])}}}),Sn=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},ht=Sn(xn,[["__scopeId","data-v-0c07874b"]]),_n={key:0,class:"config-card-fieldset-title"},Bn=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const n=e,{i18n:{t:o}}=U.useI18n(),{convertKeyToTitle:r}=U.useStringHelpers(),a=t.computed(()=>n.item.key??"json-array-item"),i=t.computed(()=>n.item.value??n.item),l=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return n.isArrayItem&&delete c.name,c}),s=t.computed(()=>{var c;return n.isArrayItem?(c=i.value)!=null&&c.name?r(i.value.name,"_"):o("baseConfigCard.general.entryTitle",{index:n.index}):""});return(c,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",_n,[t.createElementVNode("b",null,t.toDisplayString(s.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(l.value),(p,u)=>(t.openBlock(),t.createBlock(Fe,{key:`${a.value}-property-${u}`,item:{key:p,label:t.unref(r)(p),value:l.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),X=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},yt=X(Bn,[["__scopeId","data-v-68ca83ec"]]),In=X(t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:n}}=U.useI18n();return(o,r)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(a,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=i=>o.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(n)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-c96811e5"]]),Nn=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:n}}=U.useI18n();return(o,r)=>{const a=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(a,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(n)("baseConfigCard.statusBadge.enabledLabel"):t.unref(n)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),An="#0044f4",En="#e0e4ea",Vn="#3a3f51",Tn="1px",$n="20px",Mn={class:"config-card-details-row"},jn=["data-testid"],On=["data-testid"],Dn=["data-testid"],Fn=["data-testid"],Kn={key:1},qn=["data-testid"],Ln=["data-testid"],vn=["data-testid"],Pn=["data-testid"],Rn={name:"ConfigCardItem",components:{CopyUuid:ht,JsonCardItem:yt,StatusBadge:Nn,InternalLinkItem:In}},Un=t.defineComponent({...Rn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:n}){const o=e;t.useCssVars(m=>({"23f3018c":d.value?"none":`solid ${t.unref(Tn)} ${t.unref(En)}`,"3815ec6d":c.value&&l.value?"block":"flex","1957f153":c.value&&l.value?"100%":o.slim?"50%":"25%","195a372e":c.value&&l.value?"100%":o.slim?"50%":"75%"}));const r=t.useSlots(),{i18n:{t:a,formatUnixTimeStamp:i}}=U.useI18n(),l=t.computed(()=>o.item.value!==void 0&&o.item.value!==null&&o.item.value!==""),s=t.computed(()=>!!(o.item.tooltip||r["label-tooltip"])),c=t.computed(()=>o.item.type===K.Json||o.item.type===K.JsonArray),d=t.computed(()=>o.item.type===K.JsonArray),p=t.computed(()=>{switch(o.item.type){case K.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${o.item.key}-copy-uuid`,"success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,uuid:o.item.value,notify:()=>{}}};case K.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,notify:()=>{}}};case K.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${o.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,uuid:o.item.value,notify:()=>{}}};case K.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:o.item.label}),truncated:!1,notify:()=>{}}};case K.Date:return{tag:"div",attrs:{"data-testid":`${o.item.key}-date`},text:i(o.item.value)};case K.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${o.item.key}-badge-status`,status:o.item.value}};case K.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case K.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case K.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${o.item.key}-internal-link`,item:o.item,onNavigationClick:m=>{n("navigation-click",m)}}};case K.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${o.item.key}-external-link`,href:o.item.value},text:o.item.value};case K.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-content`,item:o.item}};case K.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${o.item.key}-json-array-content`,item:o.item}};default:return{tag:"div",attrs:{"data-testid":`${o.item.key}-plain-text`},text:o.item.value}}}),u=t.ref(),{isTruncated:g}=U.useTruncationDetector(u);return(m,S)=>{const C=t.resolveComponent("KLabel"),f=t.resolveComponent("KBadge"),_=t.resolveComponent("KMethodBadge"),w=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",Mn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(m.$slots,"label",{item:e.item},()=>[t.createVNode(C,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[s.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(m.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,On)]),key:"0"}:void 0]),1024)],!0)],8,jn),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(m.$slots,e.item.key,{rowValue:e.item.value},()=>[l.value?(t.openBlock(),t.createElementBlock("div",Kn,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(p.value.tag),t.normalizeProps(t.guardReactiveProps(p.value.attrs)),{default:t.withCtx(()=>[p.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(V,h)=>(t.openBlock(),t.createBlock(f,{key:`${e.item.key}-badge-tag-${h}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${h}`,"truncation-tooltip":V},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(V),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,qn)):t.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(V,h)=>(t.openBlock(),t.createBlock(t.unref(ht),t.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${h}`,"data-testid":`${e.item.key}-copy-uuid-${h}`,uuid:V}),null,16,["data-testid","uuid"]))),128))],8,Ln)):p.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(V,h)=>(t.openBlock(),t.createBlock(_,{key:`${e.item.key}-badge-method-${h}`,class:"config-badge","data-testid":`${e.item.key}-badge-method-${h}`,"is-rounded":"",label:V,method:t.unref($o.MethodsArray).includes(V.toLowerCase())?V.toLowerCase():"custom"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(V),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,vn)):t.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${o.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(V,h)=>(t.openBlock(),t.createBlock(yt,{key:`json-array-item-${h}`,index:h,"is-array-item":"",item:V},null,8,["index","item"]))),128))],8,Pn)):(t.openBlock(),t.createBlock(w,{key:4,label:t.unref(g)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:u,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Fn))],!0)],8,Dn)])}}}),Fe=X(Un,[["__scopeId","data-v-e851fc7c"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ct(e){return typeof e>"u"||e===null}function Gn(e){return typeof e=="object"&&e!==null}function zn(e){return Array.isArray(e)?e:Ct(e)?[]:[e]}function Hn(e,n){var o,r,a,i;if(n)for(i=Object.keys(n),o=0,r=i.length;o<r;o+=1)a=i[o],e[a]=n[a];return e}function Jn(e,n){var o="",r;for(r=0;r<n;r+=1)o+=e;return o}function Yn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Wn=Ct,Zn=Gn,Qn=zn,Xn=Jn,er=Yn,tr=Hn,R={isNothing:Wn,isObject:Zn,toArray:Qn,repeat:Xn,isNegativeZero:er,extend:tr};function bt(e,n){var o="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(o+='in "'+e.mark.name+'" '),o+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(o+=`
2
2
 
3
- `+e.mark.snippet),r+" "+o):r}function Ce(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=bt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ce.prototype=Object.create(Error.prototype),Ce.prototype.constructor=Ce,Ce.prototype.toString=function(e){return this.name+": "+bt(this,e)};var H=Ce;function Ke(e,n,o,r,a){var i="",l="",s=Math.floor(a/2)-1;return r-n>s&&(i=" ... ",n=r-s+i.length),o-r>s&&(l=" ...",o=r+s-l.length),{str:i+e.slice(n,o).replace(/\t/g,"→")+l,pos:r-n+i.length}}function qe(e,n){return R.repeat(" ",n-e.length)+e}function or(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var o=/\r?\n|\r|\0/g,r=[0],a=[],i,l=-1;i=o.exec(e.buffer);)a.push(i.index),r.push(i.index+i[0].length),e.position<=i.index&&l<0&&(l=r.length-2);l<0&&(l=r.length-1);var s="",c,d,p=Math.min(e.line+n.linesAfter,a.length).toString().length,u=n.maxLength-(n.indent+p+3);for(c=1;c<=n.linesBefore&&!(l-c<0);c++)d=Ke(e.buffer,r[l-c],a[l-c],e.position-(r[l]-r[l-c]),u),s=R.repeat(" ",n.indent)+qe((e.line-c+1).toString(),p)+" | "+d.str+`
3
+ `+e.mark.snippet),r+" "+o):r}function ye(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=bt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ye.prototype=Object.create(Error.prototype),ye.prototype.constructor=ye,ye.prototype.toString=function(e){return this.name+": "+bt(this,e)};var H=ye;function Ke(e,n,o,r,a){var i="",l="",s=Math.floor(a/2)-1;return r-n>s&&(i=" ... ",n=r-s+i.length),o-r>s&&(l=" ...",o=r+s-l.length),{str:i+e.slice(n,o).replace(/\t/g,"→")+l,pos:r-n+i.length}}function qe(e,n){return R.repeat(" ",n-e.length)+e}function or(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var o=/\r?\n|\r|\0/g,r=[0],a=[],i,l=-1;i=o.exec(e.buffer);)a.push(i.index),r.push(i.index+i[0].length),e.position<=i.index&&l<0&&(l=r.length-2);l<0&&(l=r.length-1);var s="",c,d,p=Math.min(e.line+n.linesAfter,a.length).toString().length,u=n.maxLength-(n.indent+p+3);for(c=1;c<=n.linesBefore&&!(l-c<0);c++)d=Ke(e.buffer,r[l-c],a[l-c],e.position-(r[l]-r[l-c]),u),s=R.repeat(" ",n.indent)+qe((e.line-c+1).toString(),p)+" | "+d.str+`
4
4
  `+s;for(d=Ke(e.buffer,r[l],a[l],e.position,u),s+=R.repeat(" ",n.indent)+qe((e.line+1).toString(),p)+" | "+d.str+`
5
5
  `,s+=R.repeat("-",n.indent+p+3+d.pos)+`^
6
6
  `,c=1;c<=n.linesAfter&&!(l+c>=a.length);c++)d=Ke(e.buffer,r[l+c],a[l+c],e.position-(r[l]-r[l+c]),u),s+=R.repeat(" ",n.indent)+qe((e.line+c+1).toString(),p)+" | "+d.str+`
7
7
  `;return s.replace(/\n$/,"")}var nr=or,rr=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ar=["scalar","sequence","mapping"];function ir(e){var n={};return e!==null&&Object.keys(e).forEach(function(o){e[o].forEach(function(r){n[String(r)]=o})}),n}function lr(e,n){if(n=n||{},Object.keys(n).forEach(function(o){if(rr.indexOf(o)===-1)throw new H('Unknown option "'+o+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(o){return o},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=ir(n.styleAliases||null),ar.indexOf(this.kind)===-1)throw new H('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var G=lr;function kt(e,n){var o=[];return e[n].forEach(function(r){var a=o.length;o.forEach(function(i,l){i.tag===r.tag&&i.kind===r.kind&&i.multi===r.multi&&(a=l)}),o[a]=r}),o}function sr(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,o;function r(a){a.multi?(e.multi[a.kind].push(a),e.multi.fallback.push(a)):e[a.kind][a.tag]=e.fallback[a.tag]=a}for(n=0,o=arguments.length;n<o;n+=1)arguments[n].forEach(r);return e}function Le(e){return this.extend(e)}Le.prototype.extend=function(e){var n=[],o=[];if(e instanceof G)o.push(e);else if(Array.isArray(e))o=o.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(n=n.concat(e.implicit)),e.explicit&&(o=o.concat(e.explicit));else throw new H("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(a){if(!(a instanceof G))throw new H("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new H("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new H("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(a){if(!(a instanceof G))throw new H("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Le.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(o),r.compiledImplicit=kt(r,"implicit"),r.compiledExplicit=kt(r,"explicit"),r.compiledTypeMap=sr(r.compiledImplicit,r.compiledExplicit),r};var wt=Le,xt=new G("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),St=new G("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),_t=new G("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Bt=new wt({explicit:[xt,St,_t]});function cr(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function dr(){return null}function ur(e){return e===null}var It=new G("tag:yaml.org,2002:null",{kind:"scalar",resolve:cr,construct:dr,predicate:ur,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function pr(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function fr(e){return e==="true"||e==="True"||e==="TRUE"}function mr(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Nt=new G("tag:yaml.org,2002:bool",{kind:"scalar",resolve:pr,construct:fr,predicate:mr,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function gr(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function hr(e){return 48<=e&&e<=55}function yr(e){return 48<=e&&e<=57}function Cr(e){if(e===null)return!1;var n=e.length,o=0,r=!1,a;if(!n)return!1;if(a=e[o],(a==="-"||a==="+")&&(a=e[++o]),a==="0"){if(o+1===n)return!0;if(a=e[++o],a==="b"){for(o++;o<n;o++)if(a=e[o],a!=="_"){if(a!=="0"&&a!=="1")return!1;r=!0}return r&&a!=="_"}if(a==="x"){for(o++;o<n;o++)if(a=e[o],a!=="_"){if(!gr(e.charCodeAt(o)))return!1;r=!0}return r&&a!=="_"}if(a==="o"){for(o++;o<n;o++)if(a=e[o],a!=="_"){if(!hr(e.charCodeAt(o)))return!1;r=!0}return r&&a!=="_"}}if(a==="_")return!1;for(;o<n;o++)if(a=e[o],a!=="_"){if(!yr(e.charCodeAt(o)))return!1;r=!0}return!(!r||a==="_")}function br(e){var n=e,o=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(o=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return o*parseInt(n.slice(2),2);if(n[1]==="x")return o*parseInt(n.slice(2),16);if(n[1]==="o")return o*parseInt(n.slice(2),8)}return o*parseInt(n,10)}function kr(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!R.isNegativeZero(e)}var At=new G("tag:yaml.org,2002:int",{kind:"scalar",resolve:Cr,construct:br,predicate:kr,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),wr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function xr(e){return!(e===null||!wr.test(e)||e[e.length-1]==="_")}function Sr(e){var n,o;return n=e.replace(/_/g,"").toLowerCase(),o=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?o===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:o*parseFloat(n,10)}var _r=/^[-+]?[0-9]+e/;function Br(e,n){var o;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(R.isNegativeZero(e))return"-0.0";return o=e.toString(10),_r.test(o)?o.replace("e",".e"):o}function Ir(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||R.isNegativeZero(e))}var Et=new G("tag:yaml.org,2002:float",{kind:"scalar",resolve:xr,construct:Sr,predicate:Ir,represent:Br,defaultStyle:"lowercase"}),Vt=Bt.extend({implicit:[It,Nt,At,Et]}),Tt=Vt,$t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Mt=new RegExp("^([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]))?))?$");function Nr(e){return e===null?!1:$t.exec(e)!==null||Mt.exec(e)!==null}function Ar(e){var n,o,r,a,i,l,s,c=0,d=null,p,u,g;if(n=$t.exec(e),n===null&&(n=Mt.exec(e)),n===null)throw new Error("Date resolve error");if(o=+n[1],r=+n[2]-1,a=+n[3],!n[4])return new Date(Date.UTC(o,r,a));if(i=+n[4],l=+n[5],s=+n[6],n[7]){for(c=n[7].slice(0,3);c.length<3;)c+="0";c=+c}return n[9]&&(p=+n[10],u=+(n[11]||0),d=(p*60+u)*6e4,n[9]==="-"&&(d=-d)),g=new Date(Date.UTC(o,r,a,i,l,s,c)),d&&g.setTime(g.getTime()-d),g}function Er(e){return e.toISOString()}var jt=new G("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Nr,construct:Ar,instanceOf:Date,represent:Er});function Vr(e){return e==="<<"||e===null}var Ot=new G("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Vr}),ve=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
- \r`;function Tr(e){if(e===null)return!1;var n,o,r=0,a=e.length,i=ve;for(o=0;o<a;o++)if(n=i.indexOf(e.charAt(o)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function $r(e){var n,o,r=e.replace(/[\r\n=]/g,""),a=r.length,i=ve,l=0,s=[];for(n=0;n<a;n++)n%4===0&&n&&(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)),l=l<<6|i.indexOf(r.charAt(n));return o=a%4*6,o===0?(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)):o===18?(s.push(l>>10&255),s.push(l>>2&255)):o===12&&s.push(l>>4&255),new Uint8Array(s)}function Mr(e){var n="",o=0,r,a,i=e.length,l=ve;for(r=0;r<i;r++)r%3===0&&r&&(n+=l[o>>18&63],n+=l[o>>12&63],n+=l[o>>6&63],n+=l[o&63]),o=(o<<8)+e[r];return a=i%3,a===0?(n+=l[o>>18&63],n+=l[o>>12&63],n+=l[o>>6&63],n+=l[o&63]):a===2?(n+=l[o>>10&63],n+=l[o>>4&63],n+=l[o<<2&63],n+=l[64]):a===1&&(n+=l[o>>2&63],n+=l[o<<4&63],n+=l[64],n+=l[64]),n}function jr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Dt=new G("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Tr,construct:$r,predicate:jr,represent:Mr}),Or=Object.prototype.hasOwnProperty,Dr=Object.prototype.toString;function Fr(e){if(e===null)return!0;var n=[],o,r,a,i,l,s=e;for(o=0,r=s.length;o<r;o+=1){if(a=s[o],l=!1,Dr.call(a)!=="[object Object]")return!1;for(i in a)if(Or.call(a,i))if(!l)l=!0;else return!1;if(!l)return!1;if(n.indexOf(i)===-1)n.push(i);else return!1}return!0}function Kr(e){return e!==null?e:[]}var Ft=new G("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Fr,construct:Kr}),qr=Object.prototype.toString;function Lr(e){if(e===null)return!0;var n,o,r,a,i,l=e;for(i=new Array(l.length),n=0,o=l.length;n<o;n+=1){if(r=l[n],qr.call(r)!=="[object Object]"||(a=Object.keys(r),a.length!==1))return!1;i[n]=[a[0],r[a[0]]]}return!0}function vr(e){if(e===null)return[];var n,o,r,a,i,l=e;for(i=new Array(l.length),n=0,o=l.length;n<o;n+=1)r=l[n],a=Object.keys(r),i[n]=[a[0],r[a[0]]];return i}var Kt=new G("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Lr,construct:vr}),Pr=Object.prototype.hasOwnProperty;function Rr(e){if(e===null)return!0;var n,o=e;for(n in o)if(Pr.call(o,n)&&o[n]!==null)return!1;return!0}function Ur(e){return e!==null?e:{}}var qt=new G("tag:yaml.org,2002:set",{kind:"mapping",resolve:Rr,construct:Ur}),Pe=Tt.extend({implicit:[jt,Ot],explicit:[Dt,Ft,Kt,qt]}),re=Object.prototype.hasOwnProperty,_e=1,Lt=2,vt=3,Be=4,Re=1,Gr=2,Pt=3,zr=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Hr=/[\x85\u2028\u2029]/,Jr=/[,\[\]\{\}]/,Rt=/^(?:!|!!|![a-z\-]+!)$/i,Ut=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Gt(e){return Object.prototype.toString.call(e)}function ee(e){return e===10||e===13}function ce(e){return e===9||e===32}function Y(e){return e===9||e===32||e===10||e===13}function ue(e){return e===44||e===91||e===93||e===123||e===125}function Yr(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function Wr(e){return e===120?2:e===117?4:e===85?8:0}function Zr(e){return 48<=e&&e<=57?e-48:-1}function zt(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
- `: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":""}function Qr(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var Ht=new Array(256),Jt=new Array(256),pe=0;pe<256;pe++)Ht[pe]=zt(pe)?1:0,Jt[pe]=zt(pe);function Xr(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Pe,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Yt(e,n){var o={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return o.snippet=nr(o),new H(n,o)}function I(e,n){throw Yt(e,n)}function Ie(e,n){e.onWarning&&e.onWarning.call(null,Yt(e,n))}var Wt={YAML:function(e,n,o){var r,a,i;e.version!==null&&I(e,"duplication of %YAML directive"),o.length!==1&&I(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),r===null&&I(e,"ill-formed argument of the YAML directive"),a=parseInt(r[1],10),i=parseInt(r[2],10),a!==1&&I(e,"unacceptable YAML version of the document"),e.version=o[0],e.checkLineBreaks=i<2,i!==1&&i!==2&&Ie(e,"unsupported YAML version of the document")},TAG:function(e,n,o){var r,a;o.length!==2&&I(e,"TAG directive accepts exactly two arguments"),r=o[0],a=o[1],Rt.test(r)||I(e,"ill-formed tag handle (first argument) of the TAG directive"),re.call(e.tagMap,r)&&I(e,'there is a previously declared suffix for "'+r+'" tag handle'),Ut.test(a)||I(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{I(e,"tag prefix is malformed: "+a)}e.tagMap[r]=a}};function ae(e,n,o,r){var a,i,l,s;if(n<o){if(s=e.input.slice(n,o),r)for(a=0,i=s.length;a<i;a+=1)l=s.charCodeAt(a),l===9||32<=l&&l<=1114111||I(e,"expected valid JSON character");else zr.test(s)&&I(e,"the stream contains non-printable characters");e.result+=s}}function Zt(e,n,o,r){var a,i,l,s;for(R.isObject(o)||I(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(o),l=0,s=a.length;l<s;l+=1)i=a[l],re.call(n,i)||(n[i]=o[i],r[i]=!0)}function fe(e,n,o,r,a,i,l,s,c){var d,p;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),d=0,p=a.length;d<p;d+=1)Array.isArray(a[d])&&I(e,"nested arrays are not supported inside keys"),typeof a=="object"&&Gt(a[d])==="[object Object]"&&(a[d]="[object Object]");if(typeof a=="object"&&Gt(a)==="[object Object]"&&(a="[object Object]"),a=String(a),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(d=0,p=i.length;d<p;d+=1)Zt(e,n,i[d],o);else Zt(e,n,i,o);else!e.json&&!re.call(o,a)&&re.call(n,a)&&(e.line=l||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,I(e,"duplicated mapping key")),a==="__proto__"?Object.defineProperty(n,a,{configurable:!0,enumerable:!0,writable:!0,value:i}):n[a]=i,delete o[a];return n}function Ue(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):I(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function P(e,n,o){for(var r=0,a=e.input.charCodeAt(e.position);a!==0;){for(;ce(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(n&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(ee(a))for(Ue(e),a=e.input.charCodeAt(e.position),r++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return o!==-1&&r!==0&&e.lineIndent<o&&Ie(e,"deficient indentation"),r}function Ne(e){var n=e.position,o;return o=e.input.charCodeAt(n),!!((o===45||o===46)&&o===e.input.charCodeAt(n+1)&&o===e.input.charCodeAt(n+2)&&(n+=3,o=e.input.charCodeAt(n),o===0||Y(o)))}function Ge(e,n){n===1?e.result+=" ":n>1&&(e.result+=R.repeat(`
10
- `,n-1))}function ea(e,n,o){var r,a,i,l,s,c,d,p,u=e.kind,g=e.result,m;if(m=e.input.charCodeAt(e.position),Y(m)||ue(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(a=e.input.charCodeAt(e.position+1),Y(a)||o&&ue(a)))return!1;for(e.kind="scalar",e.result="",i=l=e.position,s=!1;m!==0;){if(m===58){if(a=e.input.charCodeAt(e.position+1),Y(a)||o&&ue(a))break}else if(m===35){if(r=e.input.charCodeAt(e.position-1),Y(r))break}else{if(e.position===e.lineStart&&Ne(e)||o&&ue(m))break;if(ee(m))if(c=e.line,d=e.lineStart,p=e.lineIndent,P(e,!1,-1),e.lineIndent>=n){s=!0,m=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=c,e.lineStart=d,e.lineIndent=p;break}}s&&(ae(e,i,l,!1),Ge(e,e.line-c),i=l=e.position,s=!1),ce(m)||(l=e.position+1),m=e.input.charCodeAt(++e.position)}return ae(e,i,l,!1),e.result?!0:(e.kind=u,e.result=g,!1)}function ta(e,n){var o,r,a;if(o=e.input.charCodeAt(e.position),o!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=a=e.position;(o=e.input.charCodeAt(e.position))!==0;)if(o===39)if(ae(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),o===39)r=e.position,e.position++,a=e.position;else return!0;else ee(o)?(ae(e,r,a,!0),Ge(e,P(e,!1,n)),r=a=e.position):e.position===e.lineStart&&Ne(e)?I(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);I(e,"unexpected end of the stream within a single quoted scalar")}function oa(e,n){var o,r,a,i,l,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,o=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return ae(e,o,e.position,!0),e.position++,!0;if(s===92){if(ae(e,o,e.position,!0),s=e.input.charCodeAt(++e.position),ee(s))P(e,!1,n);else if(s<256&&Ht[s])e.result+=Jt[s],e.position++;else if((l=Wr(s))>0){for(a=l,i=0;a>0;a--)s=e.input.charCodeAt(++e.position),(l=Yr(s))>=0?i=(i<<4)+l:I(e,"expected hexadecimal character");e.result+=Qr(i),e.position++}else I(e,"unknown escape sequence");o=r=e.position}else ee(s)?(ae(e,o,r,!0),Ge(e,P(e,!1,n)),o=r=e.position):e.position===e.lineStart&&Ne(e)?I(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}I(e,"unexpected end of the stream within a double quoted scalar")}function na(e,n){var o=!0,r,a,i,l=e.tag,s,c=e.anchor,d,p,u,g,m,S=Object.create(null),C,f,_,w;if(w=e.input.charCodeAt(e.position),w===91)p=93,m=!1,s=[];else if(w===123)p=125,m=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),w=e.input.charCodeAt(++e.position);w!==0;){if(P(e,!0,n),w=e.input.charCodeAt(e.position),w===p)return e.position++,e.tag=l,e.anchor=c,e.kind=m?"mapping":"sequence",e.result=s,!0;o?w===44&&I(e,"expected the node content, but found ','"):I(e,"missed comma between flow collection entries"),f=C=_=null,u=g=!1,w===63&&(d=e.input.charCodeAt(e.position+1),Y(d)&&(u=g=!0,e.position++,P(e,!0,n))),r=e.line,a=e.lineStart,i=e.position,me(e,n,_e,!1,!0),f=e.tag,C=e.result,P(e,!0,n),w=e.input.charCodeAt(e.position),(g||e.line===r)&&w===58&&(u=!0,w=e.input.charCodeAt(++e.position),P(e,!0,n),me(e,n,_e,!1,!0),_=e.result),m?fe(e,s,S,f,C,_,r,a,i):u?s.push(fe(e,null,S,f,C,_,r,a,i)):s.push(C),P(e,!0,n),w=e.input.charCodeAt(e.position),w===44?(o=!0,w=e.input.charCodeAt(++e.position)):o=!1}I(e,"unexpected end of the stream within a flow collection")}function ra(e,n){var o,r,a=Re,i=!1,l=!1,s=n,c=0,d=!1,p,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)Re===a?a=u===43?Pt:Gr:I(e,"repeat of a chomping mode identifier");else if((p=Zr(u))>=0)p===0?I(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?I(e,"repeat of an indentation width identifier"):(s=n+p-1,l=!0);else break;if(ce(u)){do u=e.input.charCodeAt(++e.position);while(ce(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ee(u)&&u!==0)}for(;u!==0;){for(Ue(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!l||e.lineIndent<s)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>s&&(s=e.lineIndent),ee(u)){c++;continue}if(e.lineIndent<s){a===Pt?e.result+=R.repeat(`
8
+ \r`;function Tr(e){if(e===null)return!1;var n,o,r=0,a=e.length,i=ve;for(o=0;o<a;o++)if(n=i.indexOf(e.charAt(o)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function $r(e){var n,o,r=e.replace(/[\r\n=]/g,""),a=r.length,i=ve,l=0,s=[];for(n=0;n<a;n++)n%4===0&&n&&(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)),l=l<<6|i.indexOf(r.charAt(n));return o=a%4*6,o===0?(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)):o===18?(s.push(l>>10&255),s.push(l>>2&255)):o===12&&s.push(l>>4&255),new Uint8Array(s)}function Mr(e){var n="",o=0,r,a,i=e.length,l=ve;for(r=0;r<i;r++)r%3===0&&r&&(n+=l[o>>18&63],n+=l[o>>12&63],n+=l[o>>6&63],n+=l[o&63]),o=(o<<8)+e[r];return a=i%3,a===0?(n+=l[o>>18&63],n+=l[o>>12&63],n+=l[o>>6&63],n+=l[o&63]):a===2?(n+=l[o>>10&63],n+=l[o>>4&63],n+=l[o<<2&63],n+=l[64]):a===1&&(n+=l[o>>2&63],n+=l[o<<4&63],n+=l[64],n+=l[64]),n}function jr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Dt=new G("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Tr,construct:$r,predicate:jr,represent:Mr}),Or=Object.prototype.hasOwnProperty,Dr=Object.prototype.toString;function Fr(e){if(e===null)return!0;var n=[],o,r,a,i,l,s=e;for(o=0,r=s.length;o<r;o+=1){if(a=s[o],l=!1,Dr.call(a)!=="[object Object]")return!1;for(i in a)if(Or.call(a,i))if(!l)l=!0;else return!1;if(!l)return!1;if(n.indexOf(i)===-1)n.push(i);else return!1}return!0}function Kr(e){return e!==null?e:[]}var Ft=new G("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Fr,construct:Kr}),qr=Object.prototype.toString;function Lr(e){if(e===null)return!0;var n,o,r,a,i,l=e;for(i=new Array(l.length),n=0,o=l.length;n<o;n+=1){if(r=l[n],qr.call(r)!=="[object Object]"||(a=Object.keys(r),a.length!==1))return!1;i[n]=[a[0],r[a[0]]]}return!0}function vr(e){if(e===null)return[];var n,o,r,a,i,l=e;for(i=new Array(l.length),n=0,o=l.length;n<o;n+=1)r=l[n],a=Object.keys(r),i[n]=[a[0],r[a[0]]];return i}var Kt=new G("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Lr,construct:vr}),Pr=Object.prototype.hasOwnProperty;function Rr(e){if(e===null)return!0;var n,o=e;for(n in o)if(Pr.call(o,n)&&o[n]!==null)return!1;return!0}function Ur(e){return e!==null?e:{}}var qt=new G("tag:yaml.org,2002:set",{kind:"mapping",resolve:Rr,construct:Ur}),Pe=Tt.extend({implicit:[jt,Ot],explicit:[Dt,Ft,Kt,qt]}),re=Object.prototype.hasOwnProperty,_e=1,Lt=2,vt=3,Be=4,Re=1,Gr=2,Pt=3,zr=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Hr=/[\x85\u2028\u2029]/,Jr=/[,\[\]\{\}]/,Rt=/^(?:!|!!|![a-z\-]+!)$/i,Ut=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Gt(e){return Object.prototype.toString.call(e)}function ee(e){return e===10||e===13}function se(e){return e===9||e===32}function Y(e){return e===9||e===32||e===10||e===13}function de(e){return e===44||e===91||e===93||e===123||e===125}function Yr(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function Wr(e){return e===120?2:e===117?4:e===85?8:0}function Zr(e){return 48<=e&&e<=57?e-48:-1}function zt(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
+ `: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":""}function Qr(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var Ht=new Array(256),Jt=new Array(256),ue=0;ue<256;ue++)Ht[ue]=zt(ue)?1:0,Jt[ue]=zt(ue);function Xr(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Pe,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Yt(e,n){var o={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return o.snippet=nr(o),new H(n,o)}function I(e,n){throw Yt(e,n)}function Ie(e,n){e.onWarning&&e.onWarning.call(null,Yt(e,n))}var Wt={YAML:function(e,n,o){var r,a,i;e.version!==null&&I(e,"duplication of %YAML directive"),o.length!==1&&I(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),r===null&&I(e,"ill-formed argument of the YAML directive"),a=parseInt(r[1],10),i=parseInt(r[2],10),a!==1&&I(e,"unacceptable YAML version of the document"),e.version=o[0],e.checkLineBreaks=i<2,i!==1&&i!==2&&Ie(e,"unsupported YAML version of the document")},TAG:function(e,n,o){var r,a;o.length!==2&&I(e,"TAG directive accepts exactly two arguments"),r=o[0],a=o[1],Rt.test(r)||I(e,"ill-formed tag handle (first argument) of the TAG directive"),re.call(e.tagMap,r)&&I(e,'there is a previously declared suffix for "'+r+'" tag handle'),Ut.test(a)||I(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{I(e,"tag prefix is malformed: "+a)}e.tagMap[r]=a}};function ae(e,n,o,r){var a,i,l,s;if(n<o){if(s=e.input.slice(n,o),r)for(a=0,i=s.length;a<i;a+=1)l=s.charCodeAt(a),l===9||32<=l&&l<=1114111||I(e,"expected valid JSON character");else zr.test(s)&&I(e,"the stream contains non-printable characters");e.result+=s}}function Zt(e,n,o,r){var a,i,l,s;for(R.isObject(o)||I(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(o),l=0,s=a.length;l<s;l+=1)i=a[l],re.call(n,i)||(n[i]=o[i],r[i]=!0)}function pe(e,n,o,r,a,i,l,s,c){var d,p;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),d=0,p=a.length;d<p;d+=1)Array.isArray(a[d])&&I(e,"nested arrays are not supported inside keys"),typeof a=="object"&&Gt(a[d])==="[object Object]"&&(a[d]="[object Object]");if(typeof a=="object"&&Gt(a)==="[object Object]"&&(a="[object Object]"),a=String(a),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(d=0,p=i.length;d<p;d+=1)Zt(e,n,i[d],o);else Zt(e,n,i,o);else!e.json&&!re.call(o,a)&&re.call(n,a)&&(e.line=l||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,I(e,"duplicated mapping key")),a==="__proto__"?Object.defineProperty(n,a,{configurable:!0,enumerable:!0,writable:!0,value:i}):n[a]=i,delete o[a];return n}function Ue(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):I(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function P(e,n,o){for(var r=0,a=e.input.charCodeAt(e.position);a!==0;){for(;se(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(n&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(ee(a))for(Ue(e),a=e.input.charCodeAt(e.position),r++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return o!==-1&&r!==0&&e.lineIndent<o&&Ie(e,"deficient indentation"),r}function Ne(e){var n=e.position,o;return o=e.input.charCodeAt(n),!!((o===45||o===46)&&o===e.input.charCodeAt(n+1)&&o===e.input.charCodeAt(n+2)&&(n+=3,o=e.input.charCodeAt(n),o===0||Y(o)))}function Ge(e,n){n===1?e.result+=" ":n>1&&(e.result+=R.repeat(`
10
+ `,n-1))}function ea(e,n,o){var r,a,i,l,s,c,d,p,u=e.kind,g=e.result,m;if(m=e.input.charCodeAt(e.position),Y(m)||de(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(a=e.input.charCodeAt(e.position+1),Y(a)||o&&de(a)))return!1;for(e.kind="scalar",e.result="",i=l=e.position,s=!1;m!==0;){if(m===58){if(a=e.input.charCodeAt(e.position+1),Y(a)||o&&de(a))break}else if(m===35){if(r=e.input.charCodeAt(e.position-1),Y(r))break}else{if(e.position===e.lineStart&&Ne(e)||o&&de(m))break;if(ee(m))if(c=e.line,d=e.lineStart,p=e.lineIndent,P(e,!1,-1),e.lineIndent>=n){s=!0,m=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=c,e.lineStart=d,e.lineIndent=p;break}}s&&(ae(e,i,l,!1),Ge(e,e.line-c),i=l=e.position,s=!1),se(m)||(l=e.position+1),m=e.input.charCodeAt(++e.position)}return ae(e,i,l,!1),e.result?!0:(e.kind=u,e.result=g,!1)}function ta(e,n){var o,r,a;if(o=e.input.charCodeAt(e.position),o!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=a=e.position;(o=e.input.charCodeAt(e.position))!==0;)if(o===39)if(ae(e,r,e.position,!0),o=e.input.charCodeAt(++e.position),o===39)r=e.position,e.position++,a=e.position;else return!0;else ee(o)?(ae(e,r,a,!0),Ge(e,P(e,!1,n)),r=a=e.position):e.position===e.lineStart&&Ne(e)?I(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);I(e,"unexpected end of the stream within a single quoted scalar")}function oa(e,n){var o,r,a,i,l,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,o=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return ae(e,o,e.position,!0),e.position++,!0;if(s===92){if(ae(e,o,e.position,!0),s=e.input.charCodeAt(++e.position),ee(s))P(e,!1,n);else if(s<256&&Ht[s])e.result+=Jt[s],e.position++;else if((l=Wr(s))>0){for(a=l,i=0;a>0;a--)s=e.input.charCodeAt(++e.position),(l=Yr(s))>=0?i=(i<<4)+l:I(e,"expected hexadecimal character");e.result+=Qr(i),e.position++}else I(e,"unknown escape sequence");o=r=e.position}else ee(s)?(ae(e,o,r,!0),Ge(e,P(e,!1,n)),o=r=e.position):e.position===e.lineStart&&Ne(e)?I(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}I(e,"unexpected end of the stream within a double quoted scalar")}function na(e,n){var o=!0,r,a,i,l=e.tag,s,c=e.anchor,d,p,u,g,m,S=Object.create(null),C,f,_,w;if(w=e.input.charCodeAt(e.position),w===91)p=93,m=!1,s=[];else if(w===123)p=125,m=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),w=e.input.charCodeAt(++e.position);w!==0;){if(P(e,!0,n),w=e.input.charCodeAt(e.position),w===p)return e.position++,e.tag=l,e.anchor=c,e.kind=m?"mapping":"sequence",e.result=s,!0;o?w===44&&I(e,"expected the node content, but found ','"):I(e,"missed comma between flow collection entries"),f=C=_=null,u=g=!1,w===63&&(d=e.input.charCodeAt(e.position+1),Y(d)&&(u=g=!0,e.position++,P(e,!0,n))),r=e.line,a=e.lineStart,i=e.position,fe(e,n,_e,!1,!0),f=e.tag,C=e.result,P(e,!0,n),w=e.input.charCodeAt(e.position),(g||e.line===r)&&w===58&&(u=!0,w=e.input.charCodeAt(++e.position),P(e,!0,n),fe(e,n,_e,!1,!0),_=e.result),m?pe(e,s,S,f,C,_,r,a,i):u?s.push(pe(e,null,S,f,C,_,r,a,i)):s.push(C),P(e,!0,n),w=e.input.charCodeAt(e.position),w===44?(o=!0,w=e.input.charCodeAt(++e.position)):o=!1}I(e,"unexpected end of the stream within a flow collection")}function ra(e,n){var o,r,a=Re,i=!1,l=!1,s=n,c=0,d=!1,p,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)Re===a?a=u===43?Pt:Gr:I(e,"repeat of a chomping mode identifier");else if((p=Zr(u))>=0)p===0?I(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?I(e,"repeat of an indentation width identifier"):(s=n+p-1,l=!0);else break;if(se(u)){do u=e.input.charCodeAt(++e.position);while(se(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ee(u)&&u!==0)}for(;u!==0;){for(Ue(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!l||e.lineIndent<s)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>s&&(s=e.lineIndent),ee(u)){c++;continue}if(e.lineIndent<s){a===Pt?e.result+=R.repeat(`
11
11
  `,i?1+c:c):a===Re&&i&&(e.result+=`
12
- `);break}for(r?ce(u)?(d=!0,e.result+=R.repeat(`
12
+ `);break}for(r?se(u)?(d=!0,e.result+=R.repeat(`
13
13
  `,i?1+c:c)):d?(d=!1,e.result+=R.repeat(`
14
14
  `,c+1)):c===0?i&&(e.result+=" "):e.result+=R.repeat(`
15
15
  `,c):e.result+=R.repeat(`
16
- `,i?1+c:c),i=!0,l=!0,c=0,o=e.position;!ee(u)&&u!==0;)u=e.input.charCodeAt(++e.position);ae(e,o,e.position,!1)}return!0}function Qt(e,n){var o,r=e.tag,a=e.anchor,i=[],l,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,I(e,"tab characters must not be used in indentation")),!(c!==45||(l=e.input.charCodeAt(e.position+1),!Y(l))));){if(s=!0,e.position++,P(e,!0,-1)&&e.lineIndent<=n){i.push(null),c=e.input.charCodeAt(e.position);continue}if(o=e.line,me(e,n,vt,!1,!0),i.push(e.result),P(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===o||e.lineIndent>n)&&c!==0)I(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return s?(e.tag=r,e.anchor=a,e.kind="sequence",e.result=i,!0):!1}function aa(e,n,o){var r,a,i,l,s,c,d=e.tag,p=e.anchor,u={},g=Object.create(null),m=null,S=null,C=null,f=!1,_=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),w=e.input.charCodeAt(e.position);w!==0;){if(!f&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,I(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),i=e.line,(w===63||w===58)&&Y(r))w===63?(f&&(fe(e,u,g,m,S,null,l,s,c),m=S=C=null),_=!0,f=!0,a=!0):f?(f=!1,a=!0):I(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=r;else{if(l=e.line,s=e.lineStart,c=e.position,!me(e,o,Lt,!1,!0))break;if(e.line===i){for(w=e.input.charCodeAt(e.position);ce(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),Y(w)||I(e,"a whitespace character is expected after the key-value separator within a block mapping"),f&&(fe(e,u,g,m,S,null,l,s,c),m=S=C=null),_=!0,f=!1,a=!1,m=e.tag,S=e.result;else if(_)I(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=p,!0}else if(_)I(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=p,!0}if((e.line===i||e.lineIndent>n)&&(f&&(l=e.line,s=e.lineStart,c=e.position),me(e,n,Be,!0,a)&&(f?S=e.result:C=e.result),f||(fe(e,u,g,m,S,C,l,s,c),m=S=C=null),P(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>n)&&w!==0)I(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return f&&fe(e,u,g,m,S,null,l,s,c),_&&(e.tag=d,e.anchor=p,e.kind="mapping",e.result=u),_}function ia(e){var n,o=!1,r=!1,a,i,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&I(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(o=!0,l=e.input.charCodeAt(++e.position)):l===33?(r=!0,a="!!",l=e.input.charCodeAt(++e.position)):a="!",n=e.position,o){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(i=e.input.slice(n,e.position),l=e.input.charCodeAt(++e.position)):I(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!Y(l);)l===33&&(r?I(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(n-1,e.position+1),Rt.test(a)||I(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),l=e.input.charCodeAt(++e.position);i=e.input.slice(n,e.position),Jr.test(i)&&I(e,"tag suffix cannot contain flow indicator characters")}i&&!Ut.test(i)&&I(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{I(e,"tag name is malformed: "+i)}return o?e.tag=i:re.call(e.tagMap,a)?e.tag=e.tagMap[a]+i:a==="!"?e.tag="!"+i:a==="!!"?e.tag="tag:yaml.org,2002:"+i:I(e,'undeclared tag handle "'+a+'"'),!0}function la(e){var n,o;if(o=e.input.charCodeAt(e.position),o!==38)return!1;for(e.anchor!==null&&I(e,"duplication of an anchor property"),o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Y(o)&&!ue(o);)o=e.input.charCodeAt(++e.position);return e.position===n&&I(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function sa(e){var n,o,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!Y(r)&&!ue(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&I(e,"name of an alias node must contain at least one character"),o=e.input.slice(n,e.position),re.call(e.anchorMap,o)||I(e,'unidentified alias "'+o+'"'),e.result=e.anchorMap[o],P(e,!0,-1),!0}function me(e,n,o,r,a){var i,l,s,c=1,d=!1,p=!1,u,g,m,S,C,f;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=l=s=Be===o||vt===o,r&&P(e,!0,-1)&&(d=!0,e.lineIndent>n?c=1:e.lineIndent===n?c=0:e.lineIndent<n&&(c=-1)),c===1)for(;ia(e)||la(e);)P(e,!0,-1)?(d=!0,s=i,e.lineIndent>n?c=1:e.lineIndent===n?c=0:e.lineIndent<n&&(c=-1)):s=!1;if(s&&(s=d||a),(c===1||Be===o)&&(_e===o||Lt===o?C=n:C=n+1,f=e.position-e.lineStart,c===1?s&&(Qt(e,f)||aa(e,f,C))||na(e,C)?p=!0:(l&&ra(e,C)||ta(e,C)||oa(e,C)?p=!0:sa(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&I(e,"alias node should not have any properties")):ea(e,C,_e===o)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=s&&Qt(e,f))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&I(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,g=e.implicitTypes.length;u<g;u+=1)if(S=e.implicitTypes[u],S.resolve(e.result)){e.result=S.construct(e.result),e.tag=S.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(re.call(e.typeMap[e.kind||"fallback"],e.tag))S=e.typeMap[e.kind||"fallback"][e.tag];else for(S=null,m=e.typeMap.multi[e.kind||"fallback"],u=0,g=m.length;u<g;u+=1)if(e.tag.slice(0,m[u].tag.length)===m[u].tag){S=m[u];break}S||I(e,"unknown tag !<"+e.tag+">"),e.result!==null&&S.kind!==e.kind&&I(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+S.kind+'", not "'+e.kind+'"'),S.resolve(e.result,e.tag)?(e.result=S.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):I(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function ca(e){var n=e.position,o,r,a,i=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(P(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(i=!0,l=e.input.charCodeAt(++e.position),o=e.position;l!==0&&!Y(l);)l=e.input.charCodeAt(++e.position);for(r=e.input.slice(o,e.position),a=[],r.length<1&&I(e,"directive name must not be less than one character in length");l!==0;){for(;ce(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!ee(l));break}if(ee(l))break;for(o=e.position;l!==0&&!Y(l);)l=e.input.charCodeAt(++e.position);a.push(e.input.slice(o,e.position))}l!==0&&Ue(e),re.call(Wt,r)?Wt[r](e,r,a):Ie(e,'unknown document directive "'+r+'"')}if(P(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,P(e,!0,-1)):i&&I(e,"directives end mark is expected"),me(e,e.lineIndent-1,Be,!1,!0),P(e,!0,-1),e.checkLineBreaks&&Hr.test(e.input.slice(n,e.position))&&Ie(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ne(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,P(e,!0,-1));return}if(e.position<e.length-1)I(e,"end of the stream or a document separator is expected");else return}function Xt(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var o=new Xr(e,n),r=e.indexOf("\0");for(r!==-1&&(o.position=r,I(o,"null byte is not allowed in input")),o.input+="\0";o.input.charCodeAt(o.position)===32;)o.lineIndent+=1,o.position+=1;for(;o.position<o.length-1;)ca(o);return o.documents}function da(e,n,o){n!==null&&typeof n=="object"&&typeof o>"u"&&(o=n,n=null);var r=Xt(e,o);if(typeof n!="function")return r;for(var a=0,i=r.length;a<i;a+=1)n(r[a])}function ua(e,n){var o=Xt(e,n);if(o.length!==0){if(o.length===1)return o[0];throw new H("expected a single document in the stream, but found more")}}var pa=da,fa=ua,eo={loadAll:pa,load:fa},to=Object.prototype.toString,oo=Object.prototype.hasOwnProperty,ze=65279,ma=9,be=10,ga=13,ha=32,ya=33,Ca=34,He=35,ba=37,ka=38,wa=39,xa=42,no=44,Sa=45,Ae=58,_a=61,Ba=62,Ia=63,Na=64,ro=91,ao=93,Aa=96,io=123,Ea=124,lo=125,z={};z[0]="\\0",z[7]="\\a",z[8]="\\b",z[9]="\\t",z[10]="\\n",z[11]="\\v",z[12]="\\f",z[13]="\\r",z[27]="\\e",z[34]='\\"',z[92]="\\\\",z[133]="\\N",z[160]="\\_",z[8232]="\\L",z[8233]="\\P";var Va=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ta=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function $a(e,n){var o,r,a,i,l,s,c;if(n===null)return{};for(o={},r=Object.keys(n),a=0,i=r.length;a<i;a+=1)l=r[a],s=String(n[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),c=e.compiledTypeMap.fallback[l],c&&oo.call(c.styleAliases,s)&&(s=c.styleAliases[s]),o[l]=s;return o}function Ma(e){var n,o,r;if(n=e.toString(16).toUpperCase(),e<=255)o="x",r=2;else if(e<=65535)o="u",r=4;else if(e<=4294967295)o="U",r=8;else throw new H("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+o+R.repeat("0",r-n.length)+n}var ja=1,ke=2;function Oa(e){this.schema=e.schema||Pe,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=R.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=$a(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ke:ja,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function so(e,n){for(var o=R.repeat(" ",n),r=0,a=-1,i="",l,s=e.length;r<s;)a=e.indexOf(`
16
+ `,i?1+c:c),i=!0,l=!0,c=0,o=e.position;!ee(u)&&u!==0;)u=e.input.charCodeAt(++e.position);ae(e,o,e.position,!1)}return!0}function Qt(e,n){var o,r=e.tag,a=e.anchor,i=[],l,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=i),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,I(e,"tab characters must not be used in indentation")),!(c!==45||(l=e.input.charCodeAt(e.position+1),!Y(l))));){if(s=!0,e.position++,P(e,!0,-1)&&e.lineIndent<=n){i.push(null),c=e.input.charCodeAt(e.position);continue}if(o=e.line,fe(e,n,vt,!1,!0),i.push(e.result),P(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===o||e.lineIndent>n)&&c!==0)I(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return s?(e.tag=r,e.anchor=a,e.kind="sequence",e.result=i,!0):!1}function aa(e,n,o){var r,a,i,l,s,c,d=e.tag,p=e.anchor,u={},g=Object.create(null),m=null,S=null,C=null,f=!1,_=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),w=e.input.charCodeAt(e.position);w!==0;){if(!f&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,I(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),i=e.line,(w===63||w===58)&&Y(r))w===63?(f&&(pe(e,u,g,m,S,null,l,s,c),m=S=C=null),_=!0,f=!0,a=!0):f?(f=!1,a=!0):I(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=r;else{if(l=e.line,s=e.lineStart,c=e.position,!fe(e,o,Lt,!1,!0))break;if(e.line===i){for(w=e.input.charCodeAt(e.position);se(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),Y(w)||I(e,"a whitespace character is expected after the key-value separator within a block mapping"),f&&(pe(e,u,g,m,S,null,l,s,c),m=S=C=null),_=!0,f=!1,a=!1,m=e.tag,S=e.result;else if(_)I(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=p,!0}else if(_)I(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=p,!0}if((e.line===i||e.lineIndent>n)&&(f&&(l=e.line,s=e.lineStart,c=e.position),fe(e,n,Be,!0,a)&&(f?S=e.result:C=e.result),f||(pe(e,u,g,m,S,C,l,s,c),m=S=C=null),P(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>n)&&w!==0)I(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return f&&pe(e,u,g,m,S,null,l,s,c),_&&(e.tag=d,e.anchor=p,e.kind="mapping",e.result=u),_}function ia(e){var n,o=!1,r=!1,a,i,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&I(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(o=!0,l=e.input.charCodeAt(++e.position)):l===33?(r=!0,a="!!",l=e.input.charCodeAt(++e.position)):a="!",n=e.position,o){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(i=e.input.slice(n,e.position),l=e.input.charCodeAt(++e.position)):I(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!Y(l);)l===33&&(r?I(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(n-1,e.position+1),Rt.test(a)||I(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),l=e.input.charCodeAt(++e.position);i=e.input.slice(n,e.position),Jr.test(i)&&I(e,"tag suffix cannot contain flow indicator characters")}i&&!Ut.test(i)&&I(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{I(e,"tag name is malformed: "+i)}return o?e.tag=i:re.call(e.tagMap,a)?e.tag=e.tagMap[a]+i:a==="!"?e.tag="!"+i:a==="!!"?e.tag="tag:yaml.org,2002:"+i:I(e,'undeclared tag handle "'+a+'"'),!0}function la(e){var n,o;if(o=e.input.charCodeAt(e.position),o!==38)return!1;for(e.anchor!==null&&I(e,"duplication of an anchor property"),o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Y(o)&&!de(o);)o=e.input.charCodeAt(++e.position);return e.position===n&&I(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function sa(e){var n,o,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!Y(r)&&!de(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&I(e,"name of an alias node must contain at least one character"),o=e.input.slice(n,e.position),re.call(e.anchorMap,o)||I(e,'unidentified alias "'+o+'"'),e.result=e.anchorMap[o],P(e,!0,-1),!0}function fe(e,n,o,r,a){var i,l,s,c=1,d=!1,p=!1,u,g,m,S,C,f;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=l=s=Be===o||vt===o,r&&P(e,!0,-1)&&(d=!0,e.lineIndent>n?c=1:e.lineIndent===n?c=0:e.lineIndent<n&&(c=-1)),c===1)for(;ia(e)||la(e);)P(e,!0,-1)?(d=!0,s=i,e.lineIndent>n?c=1:e.lineIndent===n?c=0:e.lineIndent<n&&(c=-1)):s=!1;if(s&&(s=d||a),(c===1||Be===o)&&(_e===o||Lt===o?C=n:C=n+1,f=e.position-e.lineStart,c===1?s&&(Qt(e,f)||aa(e,f,C))||na(e,C)?p=!0:(l&&ra(e,C)||ta(e,C)||oa(e,C)?p=!0:sa(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&I(e,"alias node should not have any properties")):ea(e,C,_e===o)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=s&&Qt(e,f))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&I(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,g=e.implicitTypes.length;u<g;u+=1)if(S=e.implicitTypes[u],S.resolve(e.result)){e.result=S.construct(e.result),e.tag=S.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(re.call(e.typeMap[e.kind||"fallback"],e.tag))S=e.typeMap[e.kind||"fallback"][e.tag];else for(S=null,m=e.typeMap.multi[e.kind||"fallback"],u=0,g=m.length;u<g;u+=1)if(e.tag.slice(0,m[u].tag.length)===m[u].tag){S=m[u];break}S||I(e,"unknown tag !<"+e.tag+">"),e.result!==null&&S.kind!==e.kind&&I(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+S.kind+'", not "'+e.kind+'"'),S.resolve(e.result,e.tag)?(e.result=S.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):I(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function ca(e){var n=e.position,o,r,a,i=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(P(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(i=!0,l=e.input.charCodeAt(++e.position),o=e.position;l!==0&&!Y(l);)l=e.input.charCodeAt(++e.position);for(r=e.input.slice(o,e.position),a=[],r.length<1&&I(e,"directive name must not be less than one character in length");l!==0;){for(;se(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!ee(l));break}if(ee(l))break;for(o=e.position;l!==0&&!Y(l);)l=e.input.charCodeAt(++e.position);a.push(e.input.slice(o,e.position))}l!==0&&Ue(e),re.call(Wt,r)?Wt[r](e,r,a):Ie(e,'unknown document directive "'+r+'"')}if(P(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,P(e,!0,-1)):i&&I(e,"directives end mark is expected"),fe(e,e.lineIndent-1,Be,!1,!0),P(e,!0,-1),e.checkLineBreaks&&Hr.test(e.input.slice(n,e.position))&&Ie(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ne(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,P(e,!0,-1));return}if(e.position<e.length-1)I(e,"end of the stream or a document separator is expected");else return}function Xt(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var o=new Xr(e,n),r=e.indexOf("\0");for(r!==-1&&(o.position=r,I(o,"null byte is not allowed in input")),o.input+="\0";o.input.charCodeAt(o.position)===32;)o.lineIndent+=1,o.position+=1;for(;o.position<o.length-1;)ca(o);return o.documents}function da(e,n,o){n!==null&&typeof n=="object"&&typeof o>"u"&&(o=n,n=null);var r=Xt(e,o);if(typeof n!="function")return r;for(var a=0,i=r.length;a<i;a+=1)n(r[a])}function ua(e,n){var o=Xt(e,n);if(o.length!==0){if(o.length===1)return o[0];throw new H("expected a single document in the stream, but found more")}}var pa=da,fa=ua,eo={loadAll:pa,load:fa},to=Object.prototype.toString,oo=Object.prototype.hasOwnProperty,ze=65279,ma=9,Ce=10,ga=13,ha=32,ya=33,Ca=34,He=35,ba=37,ka=38,wa=39,xa=42,no=44,Sa=45,Ae=58,_a=61,Ba=62,Ia=63,Na=64,ro=91,ao=93,Aa=96,io=123,Ea=124,lo=125,z={};z[0]="\\0",z[7]="\\a",z[8]="\\b",z[9]="\\t",z[10]="\\n",z[11]="\\v",z[12]="\\f",z[13]="\\r",z[27]="\\e",z[34]='\\"',z[92]="\\\\",z[133]="\\N",z[160]="\\_",z[8232]="\\L",z[8233]="\\P";var Va=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ta=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function $a(e,n){var o,r,a,i,l,s,c;if(n===null)return{};for(o={},r=Object.keys(n),a=0,i=r.length;a<i;a+=1)l=r[a],s=String(n[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),c=e.compiledTypeMap.fallback[l],c&&oo.call(c.styleAliases,s)&&(s=c.styleAliases[s]),o[l]=s;return o}function Ma(e){var n,o,r;if(n=e.toString(16).toUpperCase(),e<=255)o="x",r=2;else if(e<=65535)o="u",r=4;else if(e<=4294967295)o="U",r=8;else throw new H("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+o+R.repeat("0",r-n.length)+n}var ja=1,be=2;function Oa(e){this.schema=e.schema||Pe,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=R.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=$a(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?be:ja,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function so(e,n){for(var o=R.repeat(" ",n),r=0,a=-1,i="",l,s=e.length;r<s;)a=e.indexOf(`
18
18
  `,r),a===-1?(l=e.slice(r),r=s):(l=e.slice(r,a+1),r=a+1),l.length&&l!==`
19
19
  `&&(i+=o),i+=l;return i}function Je(e,n){return`
20
- `+R.repeat(" ",e.indent*n)}function Da(e,n){var o,r,a;for(o=0,r=e.implicitTypes.length;o<r;o+=1)if(a=e.implicitTypes[o],a.resolve(n))return!0;return!1}function Ee(e){return e===ha||e===ma}function we(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ze||65536<=e&&e<=1114111}function co(e){return we(e)&&e!==ze&&e!==ga&&e!==be}function uo(e,n,o){var r=co(e),a=r&&!Ee(e);return(o?r:r&&e!==no&&e!==ro&&e!==ao&&e!==io&&e!==lo)&&e!==He&&!(n===Ae&&!a)||co(n)&&!Ee(n)&&e===He||n===Ae&&a}function Fa(e){return we(e)&&e!==ze&&!Ee(e)&&e!==Sa&&e!==Ia&&e!==Ae&&e!==no&&e!==ro&&e!==ao&&e!==io&&e!==lo&&e!==He&&e!==ka&&e!==xa&&e!==ya&&e!==Ea&&e!==_a&&e!==Ba&&e!==wa&&e!==Ca&&e!==ba&&e!==Na&&e!==Aa}function Ka(e){return!Ee(e)&&e!==Ae}function xe(e,n){var o=e.charCodeAt(n),r;return o>=55296&&o<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(o-55296)*1024+r-56320+65536:o}function po(e){var n=/^\n* /;return n.test(e)}var fo=1,Ye=2,mo=3,go=4,ge=5;function qa(e,n,o,r,a,i,l,s){var c,d=0,p=null,u=!1,g=!1,m=r!==-1,S=-1,C=Fa(xe(e,0))&&Ka(xe(e,e.length-1));if(n||l)for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=xe(e,c),!we(d))return ge;C=C&&uo(d,p,s),p=d}else{for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=xe(e,c),d===be)u=!0,m&&(g=g||c-S-1>r&&e[S+1]!==" ",S=c);else if(!we(d))return ge;C=C&&uo(d,p,s),p=d}g=g||m&&c-S-1>r&&e[S+1]!==" "}return!u&&!g?C&&!l&&!a(e)?fo:i===ke?ge:Ye:o>9&&po(e)?ge:l?i===ke?ge:Ye:g?go:mo}function La(e,n,o,r,a){e.dump=function(){if(n.length===0)return e.quotingType===ke?'""':"''";if(!e.noCompatMode&&(Va.indexOf(n)!==-1||Ta.test(n)))return e.quotingType===ke?'"'+n+'"':"'"+n+"'";var i=e.indent*Math.max(1,o),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=r||e.flowLevel>-1&&o>=e.flowLevel;function c(d){return Da(e,d)}switch(qa(n,s,e.indent,l,c,e.quotingType,e.forceQuotes&&!r,a)){case fo:return n;case Ye:return"'"+n.replace(/'/g,"''")+"'";case mo:return"|"+ho(n,e.indent)+yo(so(n,i));case go:return">"+ho(n,e.indent)+yo(so(va(n,l),i));case ge:return'"'+Pa(n)+'"';default:throw new H("impossible error: invalid scalar style")}}()}function ho(e,n){var o=po(e)?String(n):"",r=e[e.length-1]===`
20
+ `+R.repeat(" ",e.indent*n)}function Da(e,n){var o,r,a;for(o=0,r=e.implicitTypes.length;o<r;o+=1)if(a=e.implicitTypes[o],a.resolve(n))return!0;return!1}function Ee(e){return e===ha||e===ma}function ke(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ze||65536<=e&&e<=1114111}function co(e){return ke(e)&&e!==ze&&e!==ga&&e!==Ce}function uo(e,n,o){var r=co(e),a=r&&!Ee(e);return(o?r:r&&e!==no&&e!==ro&&e!==ao&&e!==io&&e!==lo)&&e!==He&&!(n===Ae&&!a)||co(n)&&!Ee(n)&&e===He||n===Ae&&a}function Fa(e){return ke(e)&&e!==ze&&!Ee(e)&&e!==Sa&&e!==Ia&&e!==Ae&&e!==no&&e!==ro&&e!==ao&&e!==io&&e!==lo&&e!==He&&e!==ka&&e!==xa&&e!==ya&&e!==Ea&&e!==_a&&e!==Ba&&e!==wa&&e!==Ca&&e!==ba&&e!==Na&&e!==Aa}function Ka(e){return!Ee(e)&&e!==Ae}function we(e,n){var o=e.charCodeAt(n),r;return o>=55296&&o<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(o-55296)*1024+r-56320+65536:o}function po(e){var n=/^\n* /;return n.test(e)}var fo=1,Ye=2,mo=3,go=4,me=5;function qa(e,n,o,r,a,i,l,s){var c,d=0,p=null,u=!1,g=!1,m=r!==-1,S=-1,C=Fa(we(e,0))&&Ka(we(e,e.length-1));if(n||l)for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=we(e,c),!ke(d))return me;C=C&&uo(d,p,s),p=d}else{for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=we(e,c),d===Ce)u=!0,m&&(g=g||c-S-1>r&&e[S+1]!==" ",S=c);else if(!ke(d))return me;C=C&&uo(d,p,s),p=d}g=g||m&&c-S-1>r&&e[S+1]!==" "}return!u&&!g?C&&!l&&!a(e)?fo:i===be?me:Ye:o>9&&po(e)?me:l?i===be?me:Ye:g?go:mo}function La(e,n,o,r,a){e.dump=function(){if(n.length===0)return e.quotingType===be?'""':"''";if(!e.noCompatMode&&(Va.indexOf(n)!==-1||Ta.test(n)))return e.quotingType===be?'"'+n+'"':"'"+n+"'";var i=e.indent*Math.max(1,o),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=r||e.flowLevel>-1&&o>=e.flowLevel;function c(d){return Da(e,d)}switch(qa(n,s,e.indent,l,c,e.quotingType,e.forceQuotes&&!r,a)){case fo:return n;case Ye:return"'"+n.replace(/'/g,"''")+"'";case mo:return"|"+ho(n,e.indent)+yo(so(n,i));case go:return">"+ho(n,e.indent)+yo(so(va(n,l),i));case me:return'"'+Pa(n)+'"';default:throw new H("impossible error: invalid scalar style")}}()}function ho(e,n){var o=po(e)?String(n):"",r=e[e.length-1]===`
21
21
  `,a=r&&(e[e.length-2]===`
22
22
  `||e===`
23
23
  `),i=a?"+":r?"":"-";return o+i+`
@@ -28,5 +28,5 @@
28
28
  `:"")+Co(c,n),a=i}return r}function Co(e,n){if(e===""||e[0]===" ")return e;for(var o=/ [^ ]/g,r,a=0,i,l=0,s=0,c="";r=o.exec(e);)s=r.index,s-a>n&&(i=l>a?l:s,c+=`
29
29
  `+e.slice(a,i),a=i+1),l=s;return c+=`
30
30
  `,e.length-a>n&&l>a?c+=e.slice(a,l)+`
31
- `+e.slice(l+1):c+=e.slice(a),c.slice(1)}function Pa(e){for(var n="",o=0,r,a=0;a<e.length;o>=65536?a+=2:a++)o=xe(e,a),r=z[o],!r&&we(o)?(n+=e[a],o>=65536&&(n+=e[a+1])):n+=r||Ma(o);return n}function Ra(e,n,o){var r="",a=e.tag,i,l,s;for(i=0,l=o.length;i<l;i+=1)s=o[i],e.replacer&&(s=e.replacer.call(o,String(i),s)),(oe(e,n,s,!1,!1)||typeof s>"u"&&oe(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=a,e.dump="["+r+"]"}function bo(e,n,o,r){var a="",i=e.tag,l,s,c;for(l=0,s=o.length;l<s;l+=1)c=o[l],e.replacer&&(c=e.replacer.call(o,String(l),c)),(oe(e,n+1,c,!0,!0,!1,!0)||typeof c>"u"&&oe(e,n+1,null,!0,!0,!1,!0))&&((!r||a!=="")&&(a+=Je(e,n)),e.dump&&be===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=i,e.dump=a||"[]"}function Ua(e,n,o){var r="",a=e.tag,i=Object.keys(o),l,s,c,d,p;for(l=0,s=i.length;l<s;l+=1)p="",r!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[l],d=o[c],e.replacer&&(d=e.replacer.call(o,c,d)),oe(e,n,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),oe(e,n,d,!1,!1)&&(p+=e.dump,r+=p));e.tag=a,e.dump="{"+r+"}"}function Ga(e,n,o,r){var a="",i=e.tag,l=Object.keys(o),s,c,d,p,u,g;if(e.sortKeys===!0)l.sort();else if(typeof e.sortKeys=="function")l.sort(e.sortKeys);else if(e.sortKeys)throw new H("sortKeys must be a boolean or a function");for(s=0,c=l.length;s<c;s+=1)g="",(!r||a!=="")&&(g+=Je(e,n)),d=l[s],p=o[d],e.replacer&&(p=e.replacer.call(o,d,p)),oe(e,n+1,d,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&be===e.dump.charCodeAt(0)?g+="?":g+="? "),g+=e.dump,u&&(g+=Je(e,n)),oe(e,n+1,p,!0,u)&&(e.dump&&be===e.dump.charCodeAt(0)?g+=":":g+=": ",g+=e.dump,a+=g));e.tag=i,e.dump=a||"{}"}function ko(e,n,o){var r,a,i,l,s,c;for(a=o?e.explicitTypes:e.implicitTypes,i=0,l=a.length;i<l;i+=1)if(s=a[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof n=="object"&&n instanceof s.instanceOf)&&(!s.predicate||s.predicate(n))){if(o?s.multi&&s.representName?e.tag=s.representName(n):e.tag=s.tag:e.tag="?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,to.call(s.represent)==="[object Function]")r=s.represent(n,c);else if(oo.call(s.represent,c))r=s.represent[c](n,c);else throw new H("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');e.dump=r}return!0}return!1}function oe(e,n,o,r,a,i,l){e.tag=null,e.dump=o,ko(e,o,!1)||ko(e,o,!0);var s=to.call(e.dump),c=r,d;r&&(r=e.flowLevel<0||e.flowLevel>n);var p=s==="[object Object]"||s==="[object Array]",u,g;if(p&&(u=e.duplicates.indexOf(o),g=u!==-1),(e.tag!==null&&e.tag!=="?"||g||e.indent!==2&&n>0)&&(a=!1),g&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&g&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(Ga(e,n,e.dump,a),g&&(e.dump="&ref_"+u+e.dump)):(Ua(e,n,e.dump),g&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!l&&n>0?bo(e,n-1,e.dump,a):bo(e,n,e.dump,a),g&&(e.dump="&ref_"+u+e.dump)):(Ra(e,n,e.dump),g&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&La(e,e.dump,n,i,c);else{if(s==="[object Undefined]"||e.skipInvalid)return!1;throw new H("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function za(e,n){var o=[],r=[],a,i;for(We(e,o,r),a=0,i=r.length;a<i;a+=1)n.duplicates.push(o[r[a]]);n.usedDuplicates=new Array(i)}function We(e,n,o){var r,a,i;if(e!==null&&typeof e=="object")if(a=n.indexOf(e),a!==-1)o.indexOf(a)===-1&&o.push(a);else if(n.push(e),Array.isArray(e))for(a=0,i=e.length;a<i;a+=1)We(e[a],n,o);else for(r=Object.keys(e),a=0,i=r.length;a<i;a+=1)We(e[r[a]],n,o)}function Ha(e,n){n=n||{};var o=new Oa(n);o.noRefs||za(e,o);var r=e;return o.replacer&&(r=o.replacer.call({"":r},"",r)),oe(o,0,r,!0,!0)?o.dump+`
32
- `:""}var Ja=Ha,Ya={dump:Ja};function Ze(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var Wa=G,Za=wt,Qa=Bt,Xa=Vt,ei=Tt,ti=Pe,oi=eo.load,ni=eo.loadAll,ri=Ya.dump,ai=H,ii={binary:Dt,float:Et,map:_t,null:It,pairs:Kt,set:qt,timestamp:jt,bool:Nt,int:At,merge:Ot,omap:Ft,seq:St,str:xt},li=Ze("safeLoad","load"),si=Ze("safeLoadAll","loadAll"),ci=Ze("safeDump","dump"),di={Type:Wa,Schema:Za,FAILSAFE_SCHEMA:Qa,JSON_SCHEMA:Xa,CORE_SCHEMA:ei,DEFAULT_SCHEMA:ti,load:oi,loadAll:ni,dump:ri,YAMLException:ai,types:ii,safeLoad:li,safeLoadAll:si,safeDump:ci};const ui={key:0,class:"config-card-display-form"},pi=["data-testid"],fi={key:0,class:"config-card-prop-section-title"},mi={key:1,class:"config-card-display-json"},gi={key:2,class:"config-card-display-yaml"},hi=X(t.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null}},setup(e){const n=e,o=t.useSlots(),{i18n:{t:r}}=U.useI18n(),a=s=>!!(s.tooltip||o[`${s.key}-label-tooltip`]),i=t.ref(""),l=t.ref("");return t.watch(()=>n.format,s=>{if(s!=="structured"){const c=JSON.parse(JSON.stringify(n.record));delete c.created_at,delete c.updated_at,s==="json"?i.value=JSON.stringify(c,null,2):s==="yaml"&&(l.value=di.dump(c))}},{immediate:!0}),(s,c)=>{const d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",ui,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,p=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${p}-props`,class:t.normalizeClass(`config-card-details-${p}-props`),"data-testid":`config-card-details-${p}-props`},[p!=="basic"?(t.openBlock(),t.createElementBlock("div",fi,t.toDisplayString(p==="advanced"?t.unref(r)("baseConfigCard.sections.advanced"):t.unref(r)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[p],u=>(t.openBlock(),t.createBlock(Fe,{key:u.key,item:u},t.createSlots({label:t.withCtx(()=>[t.renderSlot(s.$slots,`${u.key}-label`,{row:u},void 0,!0)]),[u.key]:t.withCtx(({rowValue:g})=>[t.renderSlot(s.$slots,u.key,{row:u,rowValue:g},void 0,!0)]),_:2},[a(u)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(s.$slots,`${u.key}-label-tooltip`,{row:u},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,pi))),128))])):t.createCommentVNode("",!0),e.format==="json"?(t.openBlock(),t.createElementBlock("div",mi,[t.createVNode(d,{id:"config-card-codeblock",code:i.value,language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),e.format==="yaml"?(t.openBlock(),t.createElementBlock("div",gi,[t.createVNode(d,{id:"config-card-codeblock",code:l.value,language:"yaml",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-c914c7e4"]]),wo="24px",yi=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},Ci=e=>(t.pushScopeId("data-v-81457922"),e=e(),t.popScopeId(),e),bi=["aria-hidden"],ki={key:0,"data-testid":"kui-icon-svg-title"},wi=Ci(()=>t.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),xi=t.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:wo,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return wo}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ki,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),wi],8,bi))]),_:1},8,["aria-hidden","style"]))}}),Si=yi(xi,[["__scopeId","data-v-81457922"]]),_i={"data-testid":"config-card-title"},Bi={class:"config-card-actions"},Ii=["href"],Ni={key:2,class:"config-card-details-section"},Ai={key:3,class:"config-card-details-section"},Ei=["data-testid"],Vi={key:0,class:"config-card-prop-section-title"},Ti=X(t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:n}){var o;const r=e,a=t.useSlots(),{i18n:{t:i}}=U.useI18n(),{getMessageFromError:l}=U.useErrors(),{convertKeyToTitle:s}=U.useStringHelpers(),{axiosInstance:c}=U.useAxios({headers:(o=r.config)==null?void 0:o.requestHeaders}),d=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=y=>{p.value=y==null?void 0:y.value},g={id:{type:K.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:K.BadgeStatus,order:2,section:J.Basic},updated_at:{type:K.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:K.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:K.BadgeTag,order:-1,section:J.Basic}},m=t.ref(!1),S=t.ref(!1),C=t.ref(""),f=t.ref(),_=t.computed(()=>{var y,b,$;if(!f.value)return[];const E=[],x=Object.keys(f.value).length;for(const N in f.value){const T=(b=(y=r.configSchema)==null?void 0:y[N])==null?void 0:b.order,j=($=g[N])==null?void 0:$.order;let q=x;(j||j===0)&&(q=j===-1?x+1:j),T&&(q=T===-1?x+1:T),E.push([N,q])}return E.sort(function(N,T){return N[1]-T[1]}),E.map(N=>{var T,j;const q=N[0],D=(T=f.value)==null?void 0:T[q],L=((j=r.configSchema)==null?void 0:j[q])||{},W=g[q];return{key:q,value:D,hidden:L.hidden||!1,type:L.type??((W==null?void 0:W.type)||K.Text),label:L.label??((W==null?void 0:W.label)||s(q)),tooltip:L.tooltip??((W==null?void 0:W.tooltip)||void 0),section:L.section??((W==null?void 0:W.section)||J.Advanced)}}).filter(N=>!N.hidden&&N.key!==r.pluginConfigKey)}),w=t.computed(()=>{var y,b;if(!f.value||!r.pluginConfigKey)return[];const $=f.value[r.pluginConfigKey]||{},E=Object.keys($).length,x=[];for(const N in $){const T=(b=(y=r.pluginConfigSchema)==null?void 0:y[N])==null?void 0:b.order,j=$[N];let q=j!=null&&j!==""?E-1:E;T&&(q=T===-1?E+1:T),x.push([N,q])}return x.sort(function(N,T){return N[1]-T[1]}),x.map(N=>{var T;const j=N[0],q=$[j],D=((T=r.pluginConfigSchema)==null?void 0:T[j])||{};return{key:j,value:q,hidden:D.hidden||!1,type:D.type??K.Text,label:D.label??s(j),tooltip:D.tooltip??void 0,section:J.Plugin}}).filter(N=>!N.hidden)}),V=t.computed(()=>{var y,b,$,E;return{basic:(y=_.value)==null?void 0:y.filter(x=>x.section===J.Basic),advanced:(b=_.value)==null?void 0:b.filter(x=>x.section===J.Advanced),plugin:(E=w.value)==null?void 0:E.concat(($=_.value)==null?void 0:$.filter(x=>x.section===J.Plugin))}}),h=t.computed(()=>{const y=[];return V.value.basic.length&&y.push("basic"),V.value.advanced.length&&y.push("advanced"),V.value.plugin.length&&y.push("plugin"),y}),k=y=>!!(y.tooltip||a[`${y.key}-label-tooltip`]),A=t.computed(()=>{var y,b;let $=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((y=r.config)==null?void 0:y.controlPlaneId)||""):r.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(b=r.config)!=null&&b.workspace?`/${r.config.workspace}`:"")),$=$.replace(/{id}/gi,r.config.entityId),$}),M=y=>{f.value&&y(JSON.stringify(f.value))?n("copy:success",f.value):n("copy:error")};return t.watch(m,y=>{n("loading",y)},{immediate:!0}),t.onBeforeMount(async()=>{S.value=!1,m.value=!0;try{const{data:y}=await c.get(A.value);if(r.dataKey)if(typeof y[r.dataKey]<"u")f.value={...y[r.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:r.dataKey}));else f.value={...y};Object.keys(r.configSchema).filter(b=>r.configSchema[b].forceShow).forEach(b=>{f.value&&typeof f.value[b]>"u"&&(f.value[b]=null)}),n("fetch:success",y)}catch(y){const b=l(y);C.value=b.startsWith("code")?i("baseConfigCard.errors.load"):b,S.value=!0,n("fetch:error",y)}finally{m.value=!1}}),(y,b)=>{const $=t.resolveComponent("KLabel"),E=t.resolveComponent("KSelect"),x=t.resolveComponent("KButton"),N=t.resolveComponent("KClipboardProvider"),T=t.resolveComponent("KSkeleton"),j=t.resolveComponent("KEmptyState"),q=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(q,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Bi,[t.renderSlot(y.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock($,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(E,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:u})):t.createCommentVNode("",!0),r.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock(x,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(Si),{size:t.unref($n)},null,8,["size"])],8,Ii)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(N,{key:3},{default:t.withCtx(({copyToClipboard:D})=>[!m.value&&!S.value?(t.openBlock(),t.createBlock(x,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:L=>M(D)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),body:t.withCtx(()=>[m.value?(t.openBlock(),t.createBlock(T,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):S.value?(t.openBlock(),t.createBlock(j,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(C.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",Ni,[t.createVNode(hi,{format:p.value,"prop-list-types":h.value,"property-collections":V.value,record:f.value},t.createSlots({_:2},[t.renderList(Object.keys(y.$slots),D=>({name:D,fn:t.withCtx(({row:L,rowValue:W})=>[t.renderSlot(y.$slots,D,{row:L,rowValue:W},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",Ai,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,D=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${D}-props`,class:t.normalizeClass(`config-card-details-${D}-props`),"data-testid":`config-card-details-${D}-props`},[D!=="basic"?(t.openBlock(),t.createElementBlock("div",Vi,t.toDisplayString(D==="advanced"?t.unref(i)("baseConfigCard.sections.advanced"):t.unref(i)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.value[D],L=>(t.openBlock(),t.createBlock(Fe,{key:L.key,item:L},t.createSlots({label:t.withCtx(()=>[t.renderSlot(y.$slots,`${L.key}-label`,{row:L},void 0,!0)]),[L.key]:t.withCtx(({rowValue:W})=>[t.renderSlot(y.$slots,L.key,{row:L,rowValue:W},void 0,!0)]),_:2},[k(L)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(y.$slots,`${L.key}-label-tooltip`,{row:L},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Ei))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",_i,[t.renderSlot(y.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-b3999889"]]),$i=["onReset","onSubmit"],Mi={class:"form-actions","data-testid":"form-actions"},ji=X(t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:n}){var o;const r=e,a=Te.useRouter(),{i18n:{t:i}}=U.useI18n(),{getMessageFromError:l}=U.useErrors(),{axiosInstance:s}=U.useAxios({headers:(o=r.config)==null?void 0:o.requestHeaders}),c=t.ref(!1),d=t.ref(!1),p=t.ref(""),u=t.computed(()=>r.canSubmit===!1||r.isReadonly),g=t.computed(()=>{var f,_;if(!r.editId)return"";let w=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((f=r.config)==null?void 0:f.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(_=r.config)!=null&&_.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.editId),w}),m=()=>{r.config.cancelRoute?a.push(r.config.cancelRoute):S()},S=()=>{n("cancel")},C=()=>{u.value||n("submit")};return t.watch(()=>c.value,f=>{n("loading",f)},{immediate:!0}),t.onBeforeMount(async()=>{if(r.editId)try{d.value=!1,c.value=!0;const{data:f}=await s.get(g.value);n("fetch:success",f)}catch(f){const _=l(f);p.value=_.startsWith("code")?i("baseForm.errors.edit"):_,d.value=!0,n("fetch:error",f)}finally{c.value=!1}}),(f,_)=>{const w=t.resolveComponent("KSkeleton"),V=t.resolveComponent("KEmptyState"),h=t.resolveComponent("KAlert"),k=t.resolveComponent("KButton"),A=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(A,{class:"kong-ui-entity-base-form"},{body:t.withCtx(()=>[c.value?(t.openBlock(),t.createBlock(w,{key:0,type:"form"})):d.value?(t.openBlock(),t.createBlock(V,{key:1,"cta-text":t.unref(i)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":m,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(S,["prevent"]),onSubmit:t.withModifiers(C,["prevent"])},[t.renderSlot(f.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(h,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Mi,[t.renderSlot(f.$slots,"form-actions",{},()=>[t.createVNode(k,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(k,{appearance:"primary","data-testid":"form-submit",disabled:u.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,$i))]),_:3})}}}),[["__scopeId","data-v-81612aef"]]),Oi={key:0,"data-testid":"first-col"},Di=X(t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const n=e,o=t.computed(()=>{var C;return((C=n.rowEl)==null?void 0:C.querySelector(`[data-testid="${n.keyName}"]`))||null}),r=t.computed(()=>{var C;return((C=o.value)==null?void 0:C.querySelector('[data-testid="first-col"]'))||null}),a=t.computed(()=>{var C,f;const _=(C=n.rowEl)==null?void 0:C.querySelectorAll("td");return _?((f=_[0])==null?void 0:f.getAttribute("data-testid"))===n.keyName:!1});let i;const l=()=>{i&&(i.disconnect(),i=void 0)},s=()=>{var C,f,_;d.value=((C=r.value)==null?void 0:C.getBoundingClientRect().width)||0,p.value=((f=o.value)==null?void 0:f.clientWidth)||0,u.value=((_=c.value)==null?void 0:_.innerText)||""},c=t.ref({}),d=t.ref(0),p=t.ref(0),u=t.ref(""),g=t.computed(()=>[r.value,o.value]),m=t.watch(g,C=>{if(a.value&&(l(),"ResizeObserver"in window&&window)){i=new ResizeObserver(f=>{window.requestAnimationFrame(()=>{!Array.isArray(f)||!f.length||s()})});for(const f of C)f&&i.observe(f)}},{immediate:!0,flush:"post",deep:!0}),S=t.computed(()=>a.value?d.value>p.value:!1);return t.onMounted(()=>{s()}),t.onUnmounted(()=>{m()}),(C,f)=>{const _=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[a.value?(t.openBlock(),t.createElementBlock("span",Oi,[t.createVNode(_,{label:S.value?u.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(C.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(C.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-e42a20c9"]]),Fi={class:"toolbar-container"},Ki={key:0,class:"toolbar-button-container"},qi=["data-testid"],Li=X(t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:n}){const o=e,{i18n:{t:r}}=U.useI18n(),a=t.computed(()=>{var h,k;return typeof o.errorMessage=="string"?{hasError:!!o.errorMessage,title:o.errorMessage,message:void 0}:{hasError:!!o.errorMessage,title:(h=o.errorMessage)==null?void 0:h.title,message:(k=o.errorMessage)==null?void 0:k.message}}),i=t.computed(()=>o.cacheIdentifier||o.preferencesStorageKey),l=h=>h.hasData||!!o.query,s=t.computed(()=>{const h=[];return Object.keys(o.tableHeaders).forEach(k=>{const A=o.tableHeaders[k];h.push({label:A.label??k,key:k,sortable:A.sortable??!1})}),o.enableEntityActions&&h.push({key:"actions",hideLabel:!0}),h}),c=h=>({"data-rowid":h.id,"data-testid":h.name,...o.rowAttributes(h)}),d=t.ref({}),p=h=>{var k;return(k=d.value)==null?void 0:k.$el.querySelector(`[data-rowid="${h.id}"]`)},u=h=>{const k={"data-testid":h.headerKey,...o.cellAttributes(h)};return h.colIndex===0&&(k.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),k},g=()=>{n("empty-state-cta-clicked"),m()},m=()=>{n("clear-search-input")},S=t.computed(()=>o.disableRowClick?void 0:(h,k)=>{n("click:row",k)}),C=h=>{n("sort",h)},{setTablePreferences:f,getTablePreferences:_}=Fo(),w=t.computed(()=>{const h=_(o.preferencesStorageKey);return{...o.initialFetcherParams,...h}}),V=h=>{o.preferencesStorageKey&&f(o.preferencesStorageKey,h)};return(h,k)=>{const A=t.resolveComponent("KIcon"),M=t.resolveComponent("KButton"),y=t.resolveComponent("KDropdown"),b=t.resolveComponent("KTable"),$=t.resolveComponent("KCard");return t.openBlock(),t.createBlock($,{class:"kong-ui-entity-base-table",title:e.title},{body:t.withCtx(()=>[t.createVNode(b,{ref_key:"tableRefs",ref:d,"cache-identifier":i.value,"cell-attrs":u,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":a.value.message,"error-state-title":a.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":a.value.hasError,headers:s.value,"hide-pagination-when-optional":"","initial-fetcher-params":w.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":c,"search-input":e.query,onKtableEmptyStateCtaClicked:g,"onRow:click":S.value,onSort:k[0]||(k[0]=E=>C(E)),"onUpdate:tablePreferences":V},t.createSlots({toolbar:t.withCtx(({state:E})=>[t.withDirectives(t.createElementVNode("div",Fi,[t.renderSlot(h.$slots,"toolbar-filter",{},void 0,!0),h.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Ki,[t.renderSlot(h.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,l(E)]])]),actions:t.withCtx(({row:E,rowKey:x,rowValue:N})=>[t.createElementVNode("div",{class:"actions-container","data-testid":E.name},[t.createVNode(y,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(h.$slots,"actions",{row:E,rowKey:x,rowValue:N},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(M,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(A,{color:t.unref(Vn),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,qi)]),_:2},[t.renderList(e.tableHeaders,(E,x)=>({name:x,fn:t.withCtx(({row:N,rowKey:T,rowValue:j})=>[t.createVNode(Di,{"key-name":String(x),"row-el":p(N)},{default:t.withCtx(()=>[t.renderSlot(h.$slots,x,{row:N,rowKey:T,rowValue:j},()=>[t.createTextVNode(t.toDisplayString(j),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-499a771c"]]),vi={key:0,class:"kong-ui-entity-delete-error"},Pi={key:1,class:"description"},Ri=X(t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:n}){const o=e,{i18nT:r}=U.useI18n(),a=t.computed(()=>o.needConfirm?o.entityName:""),i=()=>{n("cancel")},l=()=>{n("proceed")};return(s,c)=>{const d=t.resolveComponent("KAlert"),p=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":a.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:i,onProceed:l},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",vi,[t.createVNode(d,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(r),{class:"message",keypath:o.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.entityType),1)]),_:2},[o.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(o.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),o.description||s.$slots.description?(t.openBlock(),t.createElementBlock("div",Pi,[t.renderSlot(s.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(o.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),Ui={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Gi={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},zi=["fill"],Hi={mask:"url(#mask0_180_20349)"},Ji=["fill"],xo=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${An})`}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("svg",Ui,[t.createElementVNode("mask",Gi,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,zi)]),t.createElementVNode("g",Hi,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ji)])]))}}),Yi={key:1,class:"kong-ui-entity-filter"},Wi={class:"menu-item-title"},Zi={class:"menu-item-indicator"},Qi={class:"menu-item-body"},Xi=["for"],el={class:"menu-item-buttons"},tl={class:"filter-clear-button-container"},ol=X(t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,{i18n:{t:r}}=U.useI18n(),a=t.ref(!1),i=t.ref({}),l=t.computed(()=>{const f=[];return new URLSearchParams(o.modelValue).forEach((_,w)=>{_!==""&&f.push(w)}),f}),s=t.computed(()=>{const f=o.config.fields;return Object.keys(f).filter(_=>f[_].searchable).map(_=>({label:f[_].label||_,value:_}))});t.watch(()=>o.modelValue,f=>{i.value={},new URLSearchParams(f).forEach((_,w)=>{i.value[w]=_})});const c=()=>{a.value=!a.value},d=f=>{n("update:modelValue",f)},p=f=>`filter-${f}`,u=f=>{var _,w;return(((w=(_=o.config.schema)==null?void 0:_[f])==null?void 0:w.values)??[]).map(V=>({value:V,label:V}))},g=f=>{var _,w;return((w=(_=o.config.schema)==null?void 0:_[f])==null?void 0:w.type)??"text"},m=f=>{i.value={...i.value,[f]:""},C()},S=()=>{i.value={},C(!0)},C=(f=!1)=>{const _=Object.keys(i.value).reduce((w,V)=>(i.value[V]&&(w[V]=`${i.value[V]}`),w),{});f&&(a.value=!1),n("update:modelValue",new URLSearchParams(_).toString())};return(f,_)=>{const w=t.resolveComponent("KInput"),V=t.resolveComponent("KButton"),h=t.resolveComponent("KSelect"),k=t.resolveComponent("KMenuItem"),A=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(w,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{before:t.withCtx(()=>[t.createVNode(xo)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Yi,[t.createVNode(V,{appearance:"tertiary","data-testid":"filter-button",onClick:c},{default:t.withCtx(()=>[t.createVNode(xo),t.createTextVNode(" "+t.toDisplayString(t.unref(r)("filter.filterButtonText"))+" "+t.toDisplayString(l.value.length>0?`(${l.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:c},null,512),[[t.vShow,a.value]]),t.withDirectives(t.createVNode(A,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(M,y)=>(t.openBlock(),t.createBlock(k,{key:M.value,"data-testid":M.value,expandable:"","last-menu-item":y===s.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",Wi,[t.createTextVNode(t.toDisplayString(M.label)+" ",1),t.withDirectives(t.createElementVNode("span",Zi,null,512),[[t.vShow,l.value.includes(M.value)]])])]),itemBody:t.withCtx(()=>{var b,$;return[t.createElementVNode("div",Qi,[t.createElementVNode("label",{class:"menu-item-label",for:p(M.value)},t.toDisplayString(t.unref(r)("filter.fieldLabel")),9,Xi),(($=(b=e.config.schema)==null?void 0:b[M.value])==null?void 0:$.type)==="select"?(t.openBlock(),t.createBlock(h,{key:0,id:p(M.value),modelValue:i.value[M.value],"onUpdate:modelValue":E=>i.value[M.value]=E,appearance:"select",items:u(M.value),placeholder:t.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(w,{key:1,id:p(M.value),modelValue:i.value[M.value],"onUpdate:modelValue":E=>i.value[M.value]=E,autocomplete:"off",placeholder:t.unref(r)("filter.inputPlaceholder"),type:g(M.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",el,[t.createVNode(V,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:_[0]||(_[0]=E=>C(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.applyButtonText")),1)]),_:1}),t.createVNode(V,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:E=>m(M.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",tl,[t.createVNode(V,{appearance:"tertiary",size:"small",onClick:S},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,a.value]])]))}}}),[["__scopeId","data-v-15962ee2"]]),Ve=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const n=e,o=t.ref(void 0),r=t.computed(()=>o.value===!0||o.value!==void 0&&n.forceShow===!0);return t.watch(()=>n.authFunction,async()=>{o.value=await n.authFunction()},{immediate:!0}),(a,i)=>r.value?t.renderSlot(a.$slots,"default",{key:0,isAllowed:o.value}):t.createCommentVNode("",!0)}}),nl={class:"form-section-wrapper"},rl={key:0,class:"form-section-title"},al={key:1,class:"form-section-description"},il={key:2,class:"form-section-footer"},ll={class:"form-section-content"},sl=X(t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const n=t.useSlots();return(o,r)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",nl,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createElementBlock("h4",rl,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(n).description?(t.openBlock(),t.createElementBlock("div",al,[t.renderSlot(o.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(n).footer?(t.openBlock(),t.createElementBlock("div",il,[t.renderSlot(o.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",ll,[t.renderSlot(o.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:Qe,useDeleteUrlBuilder:cl,useErrors:dl,useExternalLinkCreator:Yl,useFetchUrlBuilder:Wl,useFetcher:ul,useDebouncedFilter:pl,useStringHelpers:Zl,useHelpers:Ql,useGatewayFeatureSupported:Xl,useTruncationDetector:es}=U,ts="",fl={class:"add-consumer-form-container"},ml={class:"add-consumer-form-cta"},gl={class:"select-item-label"},hl={key:0,class:"select-item-desc"},yl={key:0,class:"kong-ui-entity-add-consumers-error"},Cl={key:0},bl=t.defineComponent({__name:"AddConsumerModal",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.consumerGroupId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(e,{emit:n}){var E;const o=e,{i18n:{t:r}}=Se.useI18n(),{axiosInstance:a}=Qe({headers:(E=o.config)==null?void 0:E.requestHeaders}),i=t.ref([]),{debouncedQueryChange:l,loading:s,allRecords:c,error:d,loadItems:p,results:u}=pl(o.config,le.list[o.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),g=x=>x,m=t.computed(()=>d.value?r("consumers.errors.general"):""),S=t.ref(0),C=t.computed(()=>c.value===void 0),f=t.computed(()=>u.value.map(x=>({label:x.username||x.customId,value:x.id,selected:i.value.includes(x.id),data:x}))),_=x=>{var T;const N=C.value?u.value.find(j=>j.id===x):(T=c.value)==null?void 0:T.find(j=>j.id===x);return N?N.username||N.custom_id:x},w=()=>{k.value="",V.value=[],b.value=[],n("cancel")},V=t.ref([]),h=t.ref(!1),k=t.ref(""),A=async()=>{if(!i.value.length){k.value="",b.value=[],n("cancel");return}h.value=!0,k.value="",V.value=[],b.value=[];try{const x=i.value.map(j=>y(j)),N=await Promise.allSettled(x);let T=!0;N.forEach(j=>{j.status!=="fulfilled"&&(T=!1)}),T?(V.value=[],b.value=[],n("add:success",i.value),i.value=[]):(V.value.length&&n("add:partial-success",V.value),i.value=[],$(N))}catch{k.value=r("consumers.errors.add"),n("error",k.value)}finally{h.value=!1}},M=t.computed(()=>{var N,T,j,q;let x=`${o.config.apiBaseUrl}${le.list[o.config.app].forConsumerGroup}`;return o.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((T=o.config)==null?void 0:T.consumerGroupId)||""):o.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(j=o.config)!=null&&j.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((q=o.config)==null?void 0:q.consumerGroupId)||"")),x}),y=async x=>{const N={consumer:x};try{const T=await a.post(M.value,N);return V.value.push(x),T}catch(T){let j=`${_(x)} - ${T.message}`;return T.response.status===409&&(j=`${_(x)} - ${r("consumers.errors.already_added")}`),Promise.reject(Error(j))}},b=t.ref([]),$=x=>{b.value=x.map(N=>{var T;return(T=N.reason)==null?void 0:T.message}).filter(Boolean)};return t.watch(f,()=>{S.value++},{immediate:!0,deep:!0}),t.watch(()=>o.visible,()=>{o.visible&&p()},{immediate:!0}),(x,N)=>{const T=t.resolveComponent("KMultiselect"),j=t.resolveComponent("KAlert"),q=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(q,{"action-pending":h.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal","is-visible":e.visible,title:t.unref(r)("consumers.consumer_groups.add.title"),onCanceled:w,onProceed:A},{"body-content":t.withCtx(()=>[t.createElementVNode("div",fl,[t.createElementVNode("p",ml,t.toDisplayString(t.unref(r)("consumers.consumer_groups.add.ctaText")),1),t.createVNode(T,{modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=D=>i.value=D),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":C.value?t.unref(r)("consumers.consumer_groups.add.footer"):void 0,items:f.value,label:t.unref(r)("consumers.consumer_groups.add.consumers_label"),loading:t.unref(s),placeholder:t.unref(r)("consumers.consumer_groups.add.consumer_placeholder"),readonly:h.value,required:"",width:"100%",onQueryChange:t.unref(l)},{"item-template":t.withCtx(({item:D})=>[t.createElementVNode("div",gl,t.toDisplayString(D.label),1),g(D).data.username&&g(D).data.custom_id?(t.openBlock(),t.createElementBlock("div",hl,t.toDisplayString(g(D).data.custom_id),1)):t.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),k.value||m.value||b.value.length?(t.openBlock(),t.createElementBlock("div",yl,[t.createVNode(j,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createElementVNode("p",null,t.toDisplayString(t.unref(r)("consumers.errors.add")),1),b.value.length?(t.openBlock(),t.createElementBlock("ul",Cl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,(D,L)=>(t.openBlock(),t.createElementBlock("li",{key:L},t.toDisplayString(D),1))),128))])):t.createCommentVNode("",!0),t.createElementVNode("div",null,t.toDisplayString(k.value||m.value),1)]),_:1})])):t.createCommentVNode("",!0)])]),_:1},8,["action-pending","is-visible","title"])}}}),os="",Xe=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},kl=Xe(bl,[["__scopeId","data-v-68cc6403"]]),wl={class:"kong-ui-entities-consumers-list"},xl={key:1},Sl=t.defineComponent({__name:"ConsumerList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","add:success","remove:success"],setup(e,{emit:n}){var Eo;const o=e,{i18nT:r,i18n:{t:a}}=Se.useI18n(),i=Te.useRouter(),{axiosInstance:l}=Qe({headers:(Eo=o.config)==null?void 0:Eo.requestHeaders}),s=t.ref(1),c=t.computed(()=>!!o.config.consumerGroupId),d=t.computed(()=>o.config.app!=="kongManager"||!!o.config.disableSorting),p={username:{label:a("consumers.list.table_headers.username"),searchable:!0,sortable:!0},custom_id:{label:a("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:a("consumers.list.table_headers.tags"),sortable:!1}},u=p,g=B=>({"data-testid":B.username??B.custom_id??B.id}),m=t.computed(()=>{var O,v,Z,te;let B=`${o.config.apiBaseUrl}${le.list[o.config.app][c.value?"forConsumerGroup":"all"]}`;return o.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((O=o.config)==null?void 0:O.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((v=o.config)==null?void 0:v.consumerGroupId)||""):o.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(Z=o.config)!=null&&Z.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((te=o.config)==null?void 0:te.consumerGroupId)||"")),B}),S=t.ref(""),C=t.computed(()=>{const B=o.config.app==="konnect"||o.config.isExactMatch;return B?{isExactMatch:B,placeholder:a("consumers.search.placeholder")}:{isExactMatch:B,fields:{username:p.username,custom_id:p.custom_id},schema:o.config.filterSchema}}),f=t.computed(()=>c.value?"consumers":void 0),{fetcher:_,fetcherState:w}=ul(o.config,m.value,f.value),V=()=>{S.value=""},h=()=>{s.value++},k=B=>B??"-",A=t.ref(null),M=(B,O)=>{const v=B.id;if(!O(v)){n("copy:error",{entity:B,field:"id",message:a("consumers.errors.copy")});return}n("copy:success",{entity:B,field:"id",message:a("consumers.copy.success",{val:v})})},y=(B,O)=>{const v=JSON.stringify(B);if(!O(v)){n("copy:error",{entity:B,message:a("consumers.errors.copy")});return}n("copy:success",{entity:B,message:a("consumers.copy.success_brief")})},b=async B=>{var v;await((v=o.canRetrieve)==null?void 0:v.call(o,B))&&i.push(o.config.getViewRoute(B.id))},$=B=>({label:a("consumers.actions.view"),to:o.config.getViewRoute(B)}),E=B=>({label:a("consumers.actions.edit"),to:o.config.getEditRoute(B)}),x=t.ref(void 0),N=t.ref(!1),T=t.ref(!1),j=t.ref(""),q=cl(o.config,m.value),D=B=>{x.value=B,N.value=!0},L=()=>{N.value=!1},W=async()=>{var B,O,v;if((B=x.value)!=null&&B.id){T.value=!0;try{await l.delete(q(x.value.id)),T.value=!1,N.value=!1,s.value++,n("delete:success",x.value)}catch(Z){j.value=((v=(O=Z.response)==null?void 0:O.data)==null?void 0:v.message)||Z.message||a("consumers.errors.delete"),n("error",Z)}finally{T.value=!1}}},et=t.ref(!1),So=()=>{et.value=!0},_o=()=>{et.value=!1},Bo=(B,O)=>{O||_o(),s.value++,n("add:success",B)},$l=()=>{c.value&&So()},ne=t.ref(void 0),tt=t.ref(!1),Ml=t.ref(""),jl=B=>{ne.value=B,tt.value=!0},Io=()=>{tt.value=!1,ne.value=void 0},Ol=t.computed(()=>{var O,v,Z,te;let B=`${o.config.apiBaseUrl}${le.list[o.config.app].oneForConsumerGroup}`;return o.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((O=o.config)==null?void 0:O.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((v=o.config)==null?void 0:v.consumerGroupId)||""):o.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(Z=o.config)!=null&&Z.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((te=o.config)==null?void 0:te.consumerGroupId)||"")),B}),No=t.ref(!1),Dl=async()=>{if(ne.value){No.value=!0;try{const B=Ol.value.replace(/{consumerId}/gi,ne.value.id);await l.delete(B),n("remove:success",ne.value),Io(),s.value++}catch(B){Ml.value=B.message||a("consumers.errors.delete"),n("error",B)}finally{No.value=!1}}},Ao=t.ref(!0);t.watch(w,B=>{var O,v,Z,te,ie;if(((v=(O=B==null?void 0:B.response)==null?void 0:O.data)==null?void 0:v.length)===0&&(Ao.value=!1),B.status===se.Error){A.value={title:a("consumers.errors.general")},(ie=(te=(Z=B.error)==null?void 0:Z.response)==null?void 0:te.data)!=null&&ie.message&&(A.value.message=B.error.response.data.message),n("error",B.error);return}A.value=null});const ot=t.ref({ctaPath:c.value?void 0:o.config.createRoute,ctaText:void 0,message:a("consumers.list.empty_state.description"),title:a("consumers.title")});return t.onBeforeMount(async()=>{await o.canCreate()&&(ot.value.title=c.value?a("consumers.list.empty_state.title_for_consumer_group"):a("consumers.list.empty_state.title"),ot.value.ctaText=c.value?a("consumers.actions.add_consumer"):a("consumers.actions.create"))}),(B,O)=>{const v=t.resolveComponent("KButton"),Z=t.resolveComponent("KBadge"),te=t.resolveComponent("KTruncate"),ie=t.resolveComponent("KDropdownItem"),Vo=t.resolveComponent("KClipboardProvider"),Fl=t.resolveComponent("KPrompt");return t.openBlock(),t.createElementBlock("div",wl,[t.createVNode(t.unref(Li),{"cache-identifier":e.cacheIdentifier,"disable-pagination":c.value,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":ot.value,"enable-entity-actions":"","error-message":A.value,fetcher:t.unref(_),"fetcher-cache-key":s.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-consumers-list",query:S.value,"row-attributes":g,"table-headers":t.unref(u),"use-action-outside":e.useActionOutside,onClearSearchInput:V,"onClick:row":O[3]||(O[3]=F=>b(F)),onEmptyStateCtaClicked:$l,onSort:h},{"toolbar-filter":t.withCtx(()=>[c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(ol),{key:0,modelValue:S.value,"onUpdate:modelValue":O[0]||(O[0]=F=>S.value=F),config:C.value},null,8,["modelValue","config"]))]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(Ve),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(v,{appearance:"primary","data-testid":"toolbar-add-consumer",icon:"plus",to:e.config.consumerGroupId?void 0:e.config.createRoute,onClick:O[1]||(O[1]=()=>e.config.consumerGroupId?So():void 0)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.config.consumerGroupId?t.unref(a)("consumers.actions.add_consumer"):t.unref(a)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["to"]),[[t.vShow,Ao.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),username:t.withCtx(({rowValue:F})=>[t.createElementVNode("b",null,t.toDisplayString(k(F)),1)]),custom_id:t.withCtx(({rowValue:F})=>[t.createTextVNode(t.toDisplayString(k(F)),1)]),tags:t.withCtx(({rowValue:F})=>[F&&F.length>0?(t.openBlock(),t.createBlock(te,{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(F,he=>(t.openBlock(),t.createBlock(Z,{key:he,onClick:O[2]||(O[2]=t.withModifiers(()=>{},["stop"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(he),1)]),_:2},1024))),128))]),_:2},1024)):(t.openBlock(),t.createElementBlock("span",xl,"-"))]),actions:t.withCtx(({row:F})=>[t.createVNode(Vo,null,{default:t.withCtx(({copyToClipboard:he})=>[t.createVNode(ie,{"data-testid":"action-entity-copy-id",onClick:Kl=>M(F,he)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(Vo,null,{default:t.withCtx(({copyToClipboard:he})=>[t.createVNode(ie,{"data-testid":"action-entity-copy-json",onClick:Kl=>y(F,he)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(Ve),{"auth-function":()=>e.canRetrieve(F)},{default:t.withCtx(()=>[t.createVNode(ie,{"data-testid":"action-entity-view","has-divider":"",item:$(F.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(Ve),{"auth-function":()=>e.canEdit(F)},{default:t.withCtx(()=>[t.createVNode(ie,{"data-testid":"action-entity-edit",item:E(F.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(Ve),{"auth-function":()=>e.canDelete(F)},{default:t.withCtx(()=>[t.createVNode(ie,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>e.config.consumerGroupId?jl(F):D(F)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.config.consumerGroupId?t.unref(a)("consumers.actions.remove"):t.unref(a)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(Ri),{"action-pending":T.value,"data-testid":"delete-consumer-modal",description:t.unref(a)("consumers.delete.description"),"entity-name":x.value&&(x.value.username||x.value.custom_id||x.value.id),"entity-type":t.unref(nt).Consumer,error:j.value,title:t.unref(a)("consumers.delete.title"),visible:N.value,onCancel:L,onProceed:W},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"]),e.config.consumerGroupId?(t.openBlock(),t.createBlock(kl,{key:0,config:e.config,"data-testid":"add-consumer-modal",visible:et.value,"onAdd:partialSuccess":O[4]||(O[4]=F=>Bo(F,!0)),"onAdd:success":O[5]||(O[5]=F=>Bo(F)),onCancel:_o},null,8,["config","visible"])):t.createCommentVNode("",!0),e.config.consumerGroupId&&ne.value?(t.openBlock(),t.createBlock(Fl,{key:1,"data-testid":"remove-consumer-modal","is-visible":tt.value,title:t.unref(a)("consumers.consumer_groups.remove.title"),type:"danger",onCanceled:Io,onProceed:Dl},{"body-content":t.withCtx(()=>[t.createVNode(t.unref(r),{class:"message",keypath:e.config.consumerGroupName?"consumers.consumer_groups.remove.confirmation":"consumers.consumer_groups.remove.confirmationNoCG",tag:"p"},t.createSlots({consumer:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(ne.value.username||ne.value.custom_id||ne.value.id),1)]),_:2},[e.config.consumerGroupName?{name:"consumerGroup",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(e.config.consumerGroupName),1)]),key:"0"}:void 0]),1032,["keypath"]),t.createElementVNode("p",null,t.toDisplayString(t.unref(a)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["is-visible","title"])):t.createCommentVNode("",!0)])}}}),ns="",_l=Xe(Sl,[["__scopeId","data-v-c7e09c5e"]]),Bl={class:"kong-ui-entities-consumer-form"},Il={class:"fields-group-title"},Nl={class:"fields-group-text"},Al=t.defineComponent({__name:"ConsumerForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},consumerId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:n}){var h;const o=e,{i18nT:r,i18n:{t:a}}=Se.useI18n(),i=Te.useRouter(),{axiosInstance:l}=Qe({headers:(h=o.config)==null?void 0:h.requestHeaders}),{getMessageFromError:s}=dl(),c=t.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),d=t.reactive({username:"",customId:"",tags:""}),p=t.computed(()=>{var k,A;return(A=le.form[(k=o.config)==null?void 0:k.app])==null?void 0:A.edit}),u=()=>{var k;i.push(((k=o.config)==null?void 0:k.cancelRoute)||{name:"consumer-list"})},g=k=>{n("loading",k)},m=k=>{n("error",k)},S=k=>{var M,y,b;c.fields.username=((M=k==null?void 0:k.item)==null?void 0:M.username)||(k==null?void 0:k.username)||"",c.fields.customId=((y=k==null?void 0:k.item)==null?void 0:y.custom_id)||(k==null?void 0:k.custom_id)||"";const A=((b=k==null?void 0:k.item)==null?void 0:b.tags)||(k==null?void 0:k.tags)||[];c.fields.tags=(A==null?void 0:A.join(", "))||"",Object.assign(d,c.fields)},C=t.computed(()=>o.consumerId?Me.Edit:Me.Create),f=k=>{var M,y,b,$,E,x;let A=`${(M=o.config)==null?void 0:M.apiBaseUrl}${le.form[(y=o.config)==null?void 0:y.app][k]}`;return((b=o.config)==null?void 0:b.app)==="konnect"?A=A.replace(/{controlPlaneId}/gi,(($=o.config)==null?void 0:$.controlPlaneId)||""):((E=o.config)==null?void 0:E.app)==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(x=o.config)!=null&&x.workspace?`/${o.config.workspace}`:"")),A=A.replace(/{id}/gi,o.consumerId),A},_=t.computed(()=>!!c.fields.username||!!c.fields.customId),w=t.computed(()=>JSON.stringify(c.fields)!==JSON.stringify(d)),V=async()=>{var k,A,M;try{c.readonly=!0;const y={username:c.fields.username||null,custom_id:c.fields.customId||null,tags:(A=(k=c.fields.tags.split(","))==null?void 0:k.map($=>String($||"").trim()))==null?void 0:A.filter($=>$!=="")};let b;await l.post(f("validate"),y),C.value==="create"?b=await l.post(f("create"),y):C.value==="edit"&&(b=((M=o.config)==null?void 0:M.app)==="konnect"?await l.put(f("edit"),y):await l.patch(f("edit"),y)),S(b==null?void 0:b.data),n("update",b==null?void 0:b.data)}catch(y){c.errorMessage=s(y),n("error",y)}finally{c.readonly=!1}};return(k,A)=>{const M=t.resolveComponent("KInput"),y=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",Bl,[t.createVNode(t.unref(ji),{"can-submit":_.value&&w.value,config:e.config,"edit-id":e.consumerId,"error-message":c.errorMessage,"fetch-url":p.value,"is-readonly":c.readonly,onCancel:u,"onFetch:error":A[3]||(A[3]=b=>m(b)),"onFetch:success":S,onLoading:A[4]||(A[4]=b=>g(b)),onSubmit:V},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(t.unref(sl),{description:t.unref(a)("consumers.form.info.description"),"has-divider":"",title:t.unref(a)("consumers.form.info.title")},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createElementVNode("h5",Il,t.toDisplayString(t.unref(a)("consumers.form.consumer_identification.title"))+"* ",1),t.createElementVNode("p",Nl,t.toDisplayString(t.unref(a)("consumers.form.consumer_identification.description")),1)]),t.createVNode(y,null,{body:t.withCtx(()=>[t.createVNode(M,{modelValue:c.fields.username,"onUpdate:modelValue":A[0]||(A[0]=b=>c.fields.username=b),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:t.unref(a)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(a)("consumers.fields.username.placeholder"),readonly:c.readonly,type:"text"},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),t.createVNode(M,{modelValue:c.fields.customId,"onUpdate:modelValue":A[1]||(A[1]=b=>c.fields.customId=b),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:t.unref(a)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(a)("consumers.fields.custom_id.placeholder"),readonly:c.readonly,type:"text"},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])]),_:1}),t.createVNode(M,{modelValue:c.fields.tags,"onUpdate:modelValue":A[2]||(A[2]=b=>c.fields.tags=b),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:t.unref(a)("consumers.fields.tags.help"),label:t.unref(a)("consumers.fields.tags.label"),"label-attributes":{info:t.unref(a)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(a)("consumers.fields.tags.placeholder"),readonly:c.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),rs="",El=Xe(Al,[["__scopeId","data-v-335659fc"]]),Vl={class:"kong-ui-consumer-entity-config-card"},Tl=t.defineComponent({__name:"ConsumerConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e){const n=e,{i18n:{t:o},i18nT:r}=Se.useI18n(),a=t.computed(()=>le.form[n.config.app].edit),i=t.ref({id:{},username:{section:J.Basic,tooltip:o("consumers.fields.username.tooltip"),order:1},custom_id:{section:J.Basic,tooltip:o("consumers.fields.custom_id.tooltip"),label:o("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:o("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(l,s)=>(t.openBlock(),t.createElementBlock("div",Vl,[t.createVNode(t.unref(Ti),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":i.value,"fetch-url":a.value,"hide-title":e.hideTitle,"onCopy:success":s[0]||(s[0]=c=>l.$emit("copy:success",c)),"onFetch:error":s[1]||(s[1]=c=>l.$emit("fetch:error",c)),"onFetch:success":s[2]||(s[2]=c=>l.$emit("fetch:success",c)),onLoading:s[3]||(s[3]=c=>l.$emit("loading",c))},{"username-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("consumers.fields.username.custom_id")),1)]),_:1})]),"custom_id-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});Q.ConsumerConfigCard=Tl,Q.ConsumerForm=El,Q.ConsumerList=_l,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});
31
+ `+e.slice(l+1):c+=e.slice(a),c.slice(1)}function Pa(e){for(var n="",o=0,r,a=0;a<e.length;o>=65536?a+=2:a++)o=we(e,a),r=z[o],!r&&ke(o)?(n+=e[a],o>=65536&&(n+=e[a+1])):n+=r||Ma(o);return n}function Ra(e,n,o){var r="",a=e.tag,i,l,s;for(i=0,l=o.length;i<l;i+=1)s=o[i],e.replacer&&(s=e.replacer.call(o,String(i),s)),(oe(e,n,s,!1,!1)||typeof s>"u"&&oe(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=a,e.dump="["+r+"]"}function bo(e,n,o,r){var a="",i=e.tag,l,s,c;for(l=0,s=o.length;l<s;l+=1)c=o[l],e.replacer&&(c=e.replacer.call(o,String(l),c)),(oe(e,n+1,c,!0,!0,!1,!0)||typeof c>"u"&&oe(e,n+1,null,!0,!0,!1,!0))&&((!r||a!=="")&&(a+=Je(e,n)),e.dump&&Ce===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=i,e.dump=a||"[]"}function Ua(e,n,o){var r="",a=e.tag,i=Object.keys(o),l,s,c,d,p;for(l=0,s=i.length;l<s;l+=1)p="",r!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[l],d=o[c],e.replacer&&(d=e.replacer.call(o,c,d)),oe(e,n,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),oe(e,n,d,!1,!1)&&(p+=e.dump,r+=p));e.tag=a,e.dump="{"+r+"}"}function Ga(e,n,o,r){var a="",i=e.tag,l=Object.keys(o),s,c,d,p,u,g;if(e.sortKeys===!0)l.sort();else if(typeof e.sortKeys=="function")l.sort(e.sortKeys);else if(e.sortKeys)throw new H("sortKeys must be a boolean or a function");for(s=0,c=l.length;s<c;s+=1)g="",(!r||a!=="")&&(g+=Je(e,n)),d=l[s],p=o[d],e.replacer&&(p=e.replacer.call(o,d,p)),oe(e,n+1,d,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Ce===e.dump.charCodeAt(0)?g+="?":g+="? "),g+=e.dump,u&&(g+=Je(e,n)),oe(e,n+1,p,!0,u)&&(e.dump&&Ce===e.dump.charCodeAt(0)?g+=":":g+=": ",g+=e.dump,a+=g));e.tag=i,e.dump=a||"{}"}function ko(e,n,o){var r,a,i,l,s,c;for(a=o?e.explicitTypes:e.implicitTypes,i=0,l=a.length;i<l;i+=1)if(s=a[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof n=="object"&&n instanceof s.instanceOf)&&(!s.predicate||s.predicate(n))){if(o?s.multi&&s.representName?e.tag=s.representName(n):e.tag=s.tag:e.tag="?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,to.call(s.represent)==="[object Function]")r=s.represent(n,c);else if(oo.call(s.represent,c))r=s.represent[c](n,c);else throw new H("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');e.dump=r}return!0}return!1}function oe(e,n,o,r,a,i,l){e.tag=null,e.dump=o,ko(e,o,!1)||ko(e,o,!0);var s=to.call(e.dump),c=r,d;r&&(r=e.flowLevel<0||e.flowLevel>n);var p=s==="[object Object]"||s==="[object Array]",u,g;if(p&&(u=e.duplicates.indexOf(o),g=u!==-1),(e.tag!==null&&e.tag!=="?"||g||e.indent!==2&&n>0)&&(a=!1),g&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&g&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(Ga(e,n,e.dump,a),g&&(e.dump="&ref_"+u+e.dump)):(Ua(e,n,e.dump),g&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!l&&n>0?bo(e,n-1,e.dump,a):bo(e,n,e.dump,a),g&&(e.dump="&ref_"+u+e.dump)):(Ra(e,n,e.dump),g&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&La(e,e.dump,n,i,c);else{if(s==="[object Undefined]"||e.skipInvalid)return!1;throw new H("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function za(e,n){var o=[],r=[],a,i;for(We(e,o,r),a=0,i=r.length;a<i;a+=1)n.duplicates.push(o[r[a]]);n.usedDuplicates=new Array(i)}function We(e,n,o){var r,a,i;if(e!==null&&typeof e=="object")if(a=n.indexOf(e),a!==-1)o.indexOf(a)===-1&&o.push(a);else if(n.push(e),Array.isArray(e))for(a=0,i=e.length;a<i;a+=1)We(e[a],n,o);else for(r=Object.keys(e),a=0,i=r.length;a<i;a+=1)We(e[r[a]],n,o)}function Ha(e,n){n=n||{};var o=new Oa(n);o.noRefs||za(e,o);var r=e;return o.replacer&&(r=o.replacer.call({"":r},"",r)),oe(o,0,r,!0,!0)?o.dump+`
32
+ `:""}var Ja=Ha,Ya={dump:Ja};function Ze(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var Wa=G,Za=wt,Qa=Bt,Xa=Vt,ei=Tt,ti=Pe,oi=eo.load,ni=eo.loadAll,ri=Ya.dump,ai=H,ii={binary:Dt,float:Et,map:_t,null:It,pairs:Kt,set:qt,timestamp:jt,bool:Nt,int:At,merge:Ot,omap:Ft,seq:St,str:xt},li=Ze("safeLoad","load"),si=Ze("safeLoadAll","loadAll"),ci=Ze("safeDump","dump"),di={Type:Wa,Schema:Za,FAILSAFE_SCHEMA:Qa,JSON_SCHEMA:Xa,CORE_SCHEMA:ei,DEFAULT_SCHEMA:ti,load:oi,loadAll:ni,dump:ri,YAMLException:ai,types:ii,safeLoad:li,safeLoadAll:si,safeDump:ci};const ui={key:0,class:"config-card-display-form"},pi=["data-testid"],fi={key:0,class:"config-card-prop-section-title"},mi={key:1,class:"config-card-display-json"},gi={key:2,class:"config-card-display-yaml"},hi=X(t.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null}},setup(e){const n=e,o=t.useSlots(),{i18n:{t:r}}=U.useI18n(),a=s=>!!(s.tooltip||o[`${s.key}-label-tooltip`]),i=t.ref(""),l=t.ref("");return t.watch(()=>n.format,s=>{if(s!=="structured"){const c=JSON.parse(JSON.stringify(n.record));delete c.created_at,delete c.updated_at,s==="json"?i.value=JSON.stringify(c,null,2):s==="yaml"&&(l.value=di.dump(c))}},{immediate:!0}),(s,c)=>{const d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",ui,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,p=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${p}-props`,class:t.normalizeClass(`config-card-details-${p}-props`),"data-testid":`config-card-details-${p}-props`},[p!=="basic"?(t.openBlock(),t.createElementBlock("div",fi,t.toDisplayString(p==="advanced"?t.unref(r)("baseConfigCard.sections.advanced"):t.unref(r)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[p],u=>(t.openBlock(),t.createBlock(Fe,{key:u.key,item:u},t.createSlots({label:t.withCtx(()=>[t.renderSlot(s.$slots,`${u.key}-label`,{row:u},void 0,!0)]),[u.key]:t.withCtx(({rowValue:g})=>[t.renderSlot(s.$slots,u.key,{row:u,rowValue:g},void 0,!0)]),_:2},[a(u)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(s.$slots,`${u.key}-label-tooltip`,{row:u},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,pi))),128))])):t.createCommentVNode("",!0),e.format==="json"?(t.openBlock(),t.createElementBlock("div",mi,[t.createVNode(d,{id:"config-card-codeblock",code:i.value,language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),e.format==="yaml"?(t.openBlock(),t.createElementBlock("div",gi,[t.createVNode(d,{id:"config-card-codeblock",code:l.value,language:"yaml",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-c914c7e4"]]),wo="24px",yi=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},Ci=e=>(t.pushScopeId("data-v-4c9d405a"),e=e(),t.popScopeId(),e),bi=["aria-hidden"],ki={key:0,"data-testid":"kui-icon-svg-title"},wi=Ci(()=>t.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),xi=t.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:wo,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return wo}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ki,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),wi],8,bi))]),_:1},8,["aria-hidden","style"]))}}),Si=yi(xi,[["__scopeId","data-v-4c9d405a"]]),_i={"data-testid":"config-card-title"},Bi={class:"config-card-actions"},Ii=["href"],Ni={key:2,class:"config-card-details-section"},Ai={key:3,class:"config-card-details-section"},Ei=["data-testid"],Vi={key:0,class:"config-card-prop-section-title"},Ti=X(t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:n}){var o;const r=e,a=t.useSlots(),{i18n:{t:i}}=U.useI18n(),{getMessageFromError:l}=U.useErrors(),{convertKeyToTitle:s}=U.useStringHelpers(),{axiosInstance:c}=U.useAxios({headers:(o=r.config)==null?void 0:o.requestHeaders}),d=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=y=>{p.value=y==null?void 0:y.value},g={id:{type:K.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:K.BadgeStatus,order:2,section:J.Basic},updated_at:{type:K.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:K.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:K.BadgeTag,order:-1,section:J.Basic}},m=t.ref(!1),S=t.ref(!1),C=t.ref(""),f=t.ref(),_=t.computed(()=>{var y,b,$;if(!f.value)return[];const E=[],x=Object.keys(f.value).length;for(const N in f.value){const T=(b=(y=r.configSchema)==null?void 0:y[N])==null?void 0:b.order,j=($=g[N])==null?void 0:$.order;let q=x;(j||j===0)&&(q=j===-1?x+1:j),T&&(q=T===-1?x+1:T),E.push([N,q])}return E.sort(function(N,T){return N[1]-T[1]}),E.map(N=>{var T,j;const q=N[0],D=(T=f.value)==null?void 0:T[q],L=((j=r.configSchema)==null?void 0:j[q])||{},W=g[q];return{key:q,value:D,hidden:L.hidden||!1,type:L.type??((W==null?void 0:W.type)||K.Text),label:L.label??((W==null?void 0:W.label)||s(q)),tooltip:L.tooltip??((W==null?void 0:W.tooltip)||void 0),section:L.section??((W==null?void 0:W.section)||J.Advanced)}}).filter(N=>!N.hidden&&N.key!==r.pluginConfigKey)}),w=t.computed(()=>{var y,b;if(!f.value||!r.pluginConfigKey)return[];const $=f.value[r.pluginConfigKey]||{},E=Object.keys($).length,x=[];for(const N in $){const T=(b=(y=r.pluginConfigSchema)==null?void 0:y[N])==null?void 0:b.order,j=$[N];let q=j!=null&&j!==""?E-1:E;T&&(q=T===-1?E+1:T),x.push([N,q])}return x.sort(function(N,T){return N[1]-T[1]}),x.map(N=>{var T;const j=N[0],q=$[j],D=((T=r.pluginConfigSchema)==null?void 0:T[j])||{};return{key:j,value:q,hidden:D.hidden||!1,type:D.type??K.Text,label:D.label??s(j),tooltip:D.tooltip??void 0,section:J.Plugin}}).filter(N=>!N.hidden)}),V=t.computed(()=>{var y,b,$,E;return{basic:(y=_.value)==null?void 0:y.filter(x=>x.section===J.Basic),advanced:(b=_.value)==null?void 0:b.filter(x=>x.section===J.Advanced),plugin:(E=w.value)==null?void 0:E.concat(($=_.value)==null?void 0:$.filter(x=>x.section===J.Plugin))}}),h=t.computed(()=>{const y=[];return V.value.basic.length&&y.push("basic"),V.value.advanced.length&&y.push("advanced"),V.value.plugin.length&&y.push("plugin"),y}),k=y=>!!(y.tooltip||a[`${y.key}-label-tooltip`]),A=t.computed(()=>{var y,b;let $=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((y=r.config)==null?void 0:y.controlPlaneId)||""):r.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(b=r.config)!=null&&b.workspace?`/${r.config.workspace}`:"")),$=$.replace(/{id}/gi,r.config.entityId),$}),M=y=>{f.value&&y(JSON.stringify(f.value))?n("copy:success",f.value):n("copy:error")};return t.watch(m,y=>{n("loading",y)},{immediate:!0}),t.onBeforeMount(async()=>{S.value=!1,m.value=!0;try{const{data:y}=await c.get(A.value);if(r.dataKey)if(typeof y[r.dataKey]<"u")f.value={...y[r.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:r.dataKey}));else f.value={...y};Object.keys(r.configSchema).filter(b=>r.configSchema[b].forceShow).forEach(b=>{f.value&&typeof f.value[b]>"u"&&(f.value[b]=null)}),n("fetch:success",y)}catch(y){const b=l(y);C.value=b.startsWith("code")?i("baseConfigCard.errors.load"):b,S.value=!0,n("fetch:error",y)}finally{m.value=!1}}),(y,b)=>{const $=t.resolveComponent("KLabel"),E=t.resolveComponent("KSelect"),x=t.resolveComponent("KButton"),N=t.resolveComponent("KClipboardProvider"),T=t.resolveComponent("KSkeleton"),j=t.resolveComponent("KEmptyState"),q=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(q,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Bi,[t.renderSlot(y.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock($,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(E,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:u})):t.createCommentVNode("",!0),r.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock(x,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(Si),{size:t.unref($n)},null,8,["size"])],8,Ii)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(N,{key:3},{default:t.withCtx(({copyToClipboard:D})=>[!m.value&&!S.value?(t.openBlock(),t.createBlock(x,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:L=>M(D)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),body:t.withCtx(()=>[m.value?(t.openBlock(),t.createBlock(T,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):S.value?(t.openBlock(),t.createBlock(j,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(C.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",Ni,[t.createVNode(hi,{format:p.value,"prop-list-types":h.value,"property-collections":V.value,record:f.value},t.createSlots({_:2},[t.renderList(Object.keys(y.$slots),D=>({name:D,fn:t.withCtx(({row:L,rowValue:W})=>[t.renderSlot(y.$slots,D,{row:L,rowValue:W},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",Ai,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,D=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${D}-props`,class:t.normalizeClass(`config-card-details-${D}-props`),"data-testid":`config-card-details-${D}-props`},[D!=="basic"?(t.openBlock(),t.createElementBlock("div",Vi,t.toDisplayString(D==="advanced"?t.unref(i)("baseConfigCard.sections.advanced"):t.unref(i)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.value[D],L=>(t.openBlock(),t.createBlock(Fe,{key:L.key,item:L},t.createSlots({label:t.withCtx(()=>[t.renderSlot(y.$slots,`${L.key}-label`,{row:L},void 0,!0)]),[L.key]:t.withCtx(({rowValue:W})=>[t.renderSlot(y.$slots,L.key,{row:L,rowValue:W},void 0,!0)]),_:2},[k(L)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(y.$slots,`${L.key}-label-tooltip`,{row:L},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Ei))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",_i,[t.renderSlot(y.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-b3999889"]]),$i=["onReset","onSubmit"],Mi={class:"form-actions","data-testid":"form-actions"},ji=X(t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:n}){var o;const r=e,a=Te.useRouter(),{i18n:{t:i}}=U.useI18n(),{getMessageFromError:l}=U.useErrors(),{axiosInstance:s}=U.useAxios({headers:(o=r.config)==null?void 0:o.requestHeaders}),c=t.ref(!1),d=t.ref(!1),p=t.ref(""),u=t.computed(()=>r.canSubmit===!1||r.isReadonly),g=t.computed(()=>{var f,_;if(!r.editId)return"";let w=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((f=r.config)==null?void 0:f.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(_=r.config)!=null&&_.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.editId),w}),m=()=>{r.config.cancelRoute?a.push(r.config.cancelRoute):S()},S=()=>{n("cancel")},C=()=>{u.value||n("submit")};return t.watch(()=>c.value,f=>{n("loading",f)},{immediate:!0}),t.onBeforeMount(async()=>{if(r.editId)try{d.value=!1,c.value=!0;const{data:f}=await s.get(g.value);n("fetch:success",f)}catch(f){const _=l(f);p.value=_.startsWith("code")?i("baseForm.errors.edit"):_,d.value=!0,n("fetch:error",f)}finally{c.value=!1}}),(f,_)=>{const w=t.resolveComponent("KSkeleton"),V=t.resolveComponent("KEmptyState"),h=t.resolveComponent("KAlert"),k=t.resolveComponent("KButton"),A=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(A,{class:"kong-ui-entity-base-form"},{body:t.withCtx(()=>[c.value?(t.openBlock(),t.createBlock(w,{key:0,type:"form"})):d.value?(t.openBlock(),t.createBlock(V,{key:1,"cta-text":t.unref(i)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":m,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(S,["prevent"]),onSubmit:t.withModifiers(C,["prevent"])},[t.renderSlot(f.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(h,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Mi,[t.renderSlot(f.$slots,"form-actions",{},()=>[t.createVNode(k,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(k,{appearance:"primary","data-testid":"form-submit",disabled:u.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,$i))]),_:3})}}}),[["__scopeId","data-v-81612aef"]]),Oi={key:0,"data-testid":"first-col"},Di=X(t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const n=e,o=t.computed(()=>{var C;return((C=n.rowEl)==null?void 0:C.querySelector(`[data-testid="${n.keyName}"]`))||null}),r=t.computed(()=>{var C;return((C=o.value)==null?void 0:C.querySelector('[data-testid="first-col"]'))||null}),a=t.computed(()=>{var C,f;const _=(C=n.rowEl)==null?void 0:C.querySelectorAll("td");return _?((f=_[0])==null?void 0:f.getAttribute("data-testid"))===n.keyName:!1});let i;const l=()=>{i&&(i.disconnect(),i=void 0)},s=()=>{var C,f,_;d.value=((C=r.value)==null?void 0:C.getBoundingClientRect().width)||0,p.value=((f=o.value)==null?void 0:f.clientWidth)||0,u.value=((_=c.value)==null?void 0:_.innerText)||""},c=t.ref({}),d=t.ref(0),p=t.ref(0),u=t.ref(""),g=t.computed(()=>[r.value,o.value]),m=t.watch(g,C=>{if(a.value&&(l(),"ResizeObserver"in window&&window)){i=new ResizeObserver(f=>{window.requestAnimationFrame(()=>{!Array.isArray(f)||!f.length||s()})});for(const f of C)f&&i.observe(f)}},{immediate:!0,flush:"post",deep:!0}),S=t.computed(()=>a.value?d.value>p.value:!1);return t.onMounted(()=>{s()}),t.onUnmounted(()=>{m()}),(C,f)=>{const _=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[a.value?(t.openBlock(),t.createElementBlock("span",Oi,[t.createVNode(_,{label:S.value?u.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(C.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(C.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-e42a20c9"]]),Fi={class:"toolbar-container"},Ki={key:0,class:"toolbar-button-container"},qi=["data-testid"],Li=X(t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:n}){const o=e,{i18n:{t:r}}=U.useI18n(),a=t.computed(()=>{var h,k;return typeof o.errorMessage=="string"?{hasError:!!o.errorMessage,title:o.errorMessage,message:void 0}:{hasError:!!o.errorMessage,title:(h=o.errorMessage)==null?void 0:h.title,message:(k=o.errorMessage)==null?void 0:k.message}}),i=t.computed(()=>o.cacheIdentifier||o.preferencesStorageKey),l=h=>h.hasData||!!o.query,s=t.computed(()=>{const h=[];return Object.keys(o.tableHeaders).forEach(k=>{const A=o.tableHeaders[k];h.push({label:A.label??k,key:k,sortable:A.sortable??!1})}),o.enableEntityActions&&h.push({key:"actions",hideLabel:!0}),h}),c=h=>({"data-rowid":h.id,"data-testid":h.name,...o.rowAttributes(h)}),d=t.ref({}),p=h=>{var k;return(k=d.value)==null?void 0:k.$el.querySelector(`[data-rowid="${h.id}"]`)},u=h=>{const k={"data-testid":h.headerKey,...o.cellAttributes(h)};return h.colIndex===0&&(k.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),k},g=()=>{n("empty-state-cta-clicked"),m()},m=()=>{n("clear-search-input")},S=t.computed(()=>o.disableRowClick?void 0:(h,k)=>{n("click:row",k)}),C=h=>{n("sort",h)},{setTablePreferences:f,getTablePreferences:_}=Fo(),w=t.computed(()=>{const h=_(o.preferencesStorageKey);return{...o.initialFetcherParams,...h}}),V=h=>{o.preferencesStorageKey&&f(o.preferencesStorageKey,h)};return(h,k)=>{const A=t.resolveComponent("KIcon"),M=t.resolveComponent("KButton"),y=t.resolveComponent("KDropdown"),b=t.resolveComponent("KTable"),$=t.resolveComponent("KCard");return t.openBlock(),t.createBlock($,{class:"kong-ui-entity-base-table",title:e.title},{body:t.withCtx(()=>[t.createVNode(b,{ref_key:"tableRefs",ref:d,"cache-identifier":i.value,"cell-attrs":u,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":a.value.message,"error-state-title":a.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":a.value.hasError,headers:s.value,"hide-pagination-when-optional":"","initial-fetcher-params":w.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":c,"search-input":e.query,onKtableEmptyStateCtaClicked:g,"onRow:click":S.value,onSort:k[0]||(k[0]=E=>C(E)),"onUpdate:tablePreferences":V},t.createSlots({toolbar:t.withCtx(({state:E})=>[t.withDirectives(t.createElementVNode("div",Fi,[t.renderSlot(h.$slots,"toolbar-filter",{},void 0,!0),h.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Ki,[t.renderSlot(h.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,l(E)]])]),actions:t.withCtx(({row:E,rowKey:x,rowValue:N})=>[t.createElementVNode("div",{class:"actions-container","data-testid":E.name},[t.createVNode(y,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(h.$slots,"actions",{row:E,rowKey:x,rowValue:N},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(M,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(A,{color:t.unref(Vn),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,qi)]),_:2},[t.renderList(e.tableHeaders,(E,x)=>({name:x,fn:t.withCtx(({row:N,rowKey:T,rowValue:j})=>[t.createVNode(Di,{"key-name":String(x),"row-el":p(N)},{default:t.withCtx(()=>[t.renderSlot(h.$slots,x,{row:N,rowKey:T,rowValue:j},()=>[t.createTextVNode(t.toDisplayString(j),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-499a771c"]]),vi={key:0,class:"kong-ui-entity-delete-error"},Pi={key:1,class:"description"},Ri=X(t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:n}){const o=e,{i18nT:r}=U.useI18n(),a=t.computed(()=>o.needConfirm?o.entityName:""),i=()=>{n("cancel")},l=()=>{n("proceed")};return(s,c)=>{const d=t.resolveComponent("KAlert"),p=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":a.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:i,onProceed:l},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",vi,[t.createVNode(d,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(r),{class:"message",keypath:o.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.entityType),1)]),_:2},[o.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(o.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),o.description||s.$slots.description?(t.openBlock(),t.createElementBlock("div",Pi,[t.renderSlot(s.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(o.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),Ui={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Gi={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},zi=["fill"],Hi={mask:"url(#mask0_180_20349)"},Ji=["fill"],xo=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${An})`}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("svg",Ui,[t.createElementVNode("mask",Gi,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,zi)]),t.createElementVNode("g",Hi,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ji)])]))}}),Yi={key:1,class:"kong-ui-entity-filter"},Wi={class:"menu-item-title"},Zi={class:"menu-item-indicator"},Qi={class:"menu-item-body"},Xi=["for"],el={class:"menu-item-buttons"},tl={class:"filter-clear-button-container"},ol=X(t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,{i18n:{t:r}}=U.useI18n(),a=t.ref(!1),i=t.ref({}),l=t.computed(()=>{const f=[];return new URLSearchParams(o.modelValue).forEach((_,w)=>{_!==""&&f.push(w)}),f}),s=t.computed(()=>{const f=o.config.fields;return Object.keys(f).filter(_=>f[_].searchable).map(_=>({label:f[_].label||_,value:_}))});t.watch(()=>o.modelValue,f=>{i.value={},new URLSearchParams(f).forEach((_,w)=>{i.value[w]=_})});const c=()=>{a.value=!a.value},d=f=>{n("update:modelValue",f)},p=f=>`filter-${f}`,u=f=>{var _,w;return(((w=(_=o.config.schema)==null?void 0:_[f])==null?void 0:w.values)??[]).map(V=>({value:V,label:V}))},g=f=>{var _,w;return((w=(_=o.config.schema)==null?void 0:_[f])==null?void 0:w.type)??"text"},m=f=>{i.value={...i.value,[f]:""},C()},S=()=>{i.value={},C(!0)},C=(f=!1)=>{const _=Object.keys(i.value).reduce((w,V)=>(i.value[V]&&(w[V]=`${i.value[V]}`),w),{});f&&(a.value=!1),n("update:modelValue",new URLSearchParams(_).toString())};return(f,_)=>{const w=t.resolveComponent("KInput"),V=t.resolveComponent("KButton"),h=t.resolveComponent("KSelect"),k=t.resolveComponent("KMenuItem"),A=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(w,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{before:t.withCtx(()=>[t.createVNode(xo)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Yi,[t.createVNode(V,{appearance:"tertiary","data-testid":"filter-button",onClick:c},{default:t.withCtx(()=>[t.createVNode(xo),t.createTextVNode(" "+t.toDisplayString(t.unref(r)("filter.filterButtonText"))+" "+t.toDisplayString(l.value.length>0?`(${l.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:c},null,512),[[t.vShow,a.value]]),t.withDirectives(t.createVNode(A,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(M,y)=>(t.openBlock(),t.createBlock(k,{key:M.value,"data-testid":M.value,expandable:"","last-menu-item":y===s.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",Wi,[t.createTextVNode(t.toDisplayString(M.label)+" ",1),t.withDirectives(t.createElementVNode("span",Zi,null,512),[[t.vShow,l.value.includes(M.value)]])])]),itemBody:t.withCtx(()=>{var b,$;return[t.createElementVNode("div",Qi,[t.createElementVNode("label",{class:"menu-item-label",for:p(M.value)},t.toDisplayString(t.unref(r)("filter.fieldLabel")),9,Xi),(($=(b=e.config.schema)==null?void 0:b[M.value])==null?void 0:$.type)==="select"?(t.openBlock(),t.createBlock(h,{key:0,id:p(M.value),modelValue:i.value[M.value],"onUpdate:modelValue":E=>i.value[M.value]=E,appearance:"select",items:u(M.value),placeholder:t.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(w,{key:1,id:p(M.value),modelValue:i.value[M.value],"onUpdate:modelValue":E=>i.value[M.value]=E,autocomplete:"off",placeholder:t.unref(r)("filter.inputPlaceholder"),type:g(M.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",el,[t.createVNode(V,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:_[0]||(_[0]=E=>C(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.applyButtonText")),1)]),_:1}),t.createVNode(V,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:E=>m(M.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",tl,[t.createVNode(V,{appearance:"tertiary",size:"small",onClick:S},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,a.value]])]))}}}),[["__scopeId","data-v-15962ee2"]]),Ve=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const n=e,o=t.ref(void 0),r=t.computed(()=>o.value===!0||o.value!==void 0&&n.forceShow===!0);return t.watch(()=>n.authFunction,async()=>{o.value=await n.authFunction()},{immediate:!0}),(a,i)=>r.value?t.renderSlot(a.$slots,"default",{key:0,isAllowed:o.value}):t.createCommentVNode("",!0)}}),nl={class:"form-section-wrapper"},rl={key:0,class:"form-section-title"},al={key:1,class:"form-section-description"},il={key:2,class:"form-section-footer"},ll={class:"form-section-content"},sl=X(t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const n=t.useSlots();return(o,r)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",nl,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createElementBlock("h4",rl,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(n).description?(t.openBlock(),t.createElementBlock("div",al,[t.renderSlot(o.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(n).footer?(t.openBlock(),t.createElementBlock("div",il,[t.renderSlot(o.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",ll,[t.renderSlot(o.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:Qe,useDeleteUrlBuilder:cl,useErrors:dl,useExternalLinkCreator:Yl,useFetchUrlBuilder:Wl,useFetcher:ul,useDebouncedFilter:pl,useStringHelpers:Zl,useHelpers:Ql,useGatewayFeatureSupported:Xl,useTruncationDetector:es}=U,ts="",fl={class:"add-consumer-form-container"},ml={class:"add-consumer-form-cta"},gl={class:"select-item-label"},hl={key:0,class:"select-item-desc"},yl={key:0,class:"kong-ui-entity-add-consumers-error"},Cl={key:0},bl=t.defineComponent({__name:"AddConsumerModal",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.consumerGroupId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(e,{emit:n}){var E;const o=e,{i18n:{t:r}}=Se.useI18n(),{axiosInstance:a}=Qe({headers:(E=o.config)==null?void 0:E.requestHeaders}),i=t.ref([]),{debouncedQueryChange:l,loading:s,allRecords:c,error:d,loadItems:p,results:u}=pl(o.config,ie.list[o.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),g=x=>x,m=t.computed(()=>d.value?r("consumers.errors.general"):""),S=t.ref(0),C=t.computed(()=>c.value===void 0),f=t.computed(()=>u.value.map(x=>({label:x.username||x.customId,value:x.id,selected:i.value.includes(x.id),data:x}))),_=x=>{var T;const N=C.value?u.value.find(j=>j.id===x):(T=c.value)==null?void 0:T.find(j=>j.id===x);return N?N.username||N.custom_id:x},w=()=>{k.value="",V.value=[],b.value=[],n("cancel")},V=t.ref([]),h=t.ref(!1),k=t.ref(""),A=async()=>{if(!i.value.length){k.value="",b.value=[],n("cancel");return}h.value=!0,k.value="",V.value=[],b.value=[];try{const x=i.value.map(j=>y(j)),N=await Promise.allSettled(x);let T=!0;N.forEach(j=>{j.status!=="fulfilled"&&(T=!1)}),T?(V.value=[],b.value=[],n("add:success",i.value),i.value=[]):(V.value.length&&n("add:partial-success",V.value),i.value=[],$(N))}catch{k.value=r("consumers.errors.add"),n("error",k.value)}finally{h.value=!1}},M=t.computed(()=>{var N,T,j,q;let x=`${o.config.apiBaseUrl}${ie.list[o.config.app].forConsumerGroup}`;return o.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((T=o.config)==null?void 0:T.consumerGroupId)||""):o.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(j=o.config)!=null&&j.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((q=o.config)==null?void 0:q.consumerGroupId)||"")),x}),y=async x=>{const N={consumer:x};try{const T=await a.post(M.value,N);return V.value.push(x),T}catch(T){let j=`${_(x)} - ${T.message}`;return T.response.status===409&&(j=`${_(x)} - ${r("consumers.errors.already_added")}`),Promise.reject(Error(j))}},b=t.ref([]),$=x=>{b.value=x.map(N=>{var T;return(T=N.reason)==null?void 0:T.message}).filter(Boolean)};return t.watch(f,()=>{S.value++},{immediate:!0,deep:!0}),t.watch(()=>o.visible,()=>{o.visible&&p()},{immediate:!0}),(x,N)=>{const T=t.resolveComponent("KMultiselect"),j=t.resolveComponent("KAlert"),q=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(q,{"action-pending":h.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal","is-visible":e.visible,title:t.unref(r)("consumers.consumer_groups.add.title"),onCanceled:w,onProceed:A},{"body-content":t.withCtx(()=>[t.createElementVNode("div",fl,[t.createElementVNode("p",ml,t.toDisplayString(t.unref(r)("consumers.consumer_groups.add.ctaText")),1),t.createVNode(T,{modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=D=>i.value=D),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":C.value?t.unref(r)("consumers.consumer_groups.add.footer"):void 0,items:f.value,label:t.unref(r)("consumers.consumer_groups.add.consumers_label"),loading:t.unref(s),placeholder:t.unref(r)("consumers.consumer_groups.add.consumer_placeholder"),readonly:h.value,required:"",width:"100%",onQueryChange:t.unref(l)},{"item-template":t.withCtx(({item:D})=>[t.createElementVNode("div",gl,t.toDisplayString(D.label),1),g(D).data.username&&g(D).data.custom_id?(t.openBlock(),t.createElementBlock("div",hl,t.toDisplayString(g(D).data.custom_id),1)):t.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),k.value||m.value||b.value.length?(t.openBlock(),t.createElementBlock("div",yl,[t.createVNode(j,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createElementVNode("p",null,t.toDisplayString(t.unref(r)("consumers.errors.add")),1),b.value.length?(t.openBlock(),t.createElementBlock("ul",Cl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,(D,L)=>(t.openBlock(),t.createElementBlock("li",{key:L},t.toDisplayString(D),1))),128))])):t.createCommentVNode("",!0),t.createElementVNode("div",null,t.toDisplayString(k.value||m.value),1)]),_:1})])):t.createCommentVNode("",!0)])]),_:1},8,["action-pending","is-visible","title"])}}}),os="",Xe=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},kl=Xe(bl,[["__scopeId","data-v-68cc6403"]]),wl={class:"kong-ui-entities-consumers-list"},xl={key:1},Sl=t.defineComponent({__name:"ConsumerList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","add:success","remove:success"],setup(e,{emit:n}){var Eo;const o=e,{i18nT:r,i18n:{t:a}}=Se.useI18n(),i=Te.useRouter(),{axiosInstance:l}=Qe({headers:(Eo=o.config)==null?void 0:Eo.requestHeaders}),s=t.ref(1),c=t.computed(()=>!!o.config.consumerGroupId),d=t.computed(()=>o.config.app!=="kongManager"||!!o.config.disableSorting),p={username:{label:a("consumers.list.table_headers.username"),searchable:!0,sortable:!0},custom_id:{label:a("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:a("consumers.list.table_headers.tags"),sortable:!1}},u=p,g=B=>({"data-testid":B.username??B.custom_id??B.id}),m=t.computed(()=>{var O,v,Z,te;let B=`${o.config.apiBaseUrl}${ie.list[o.config.app][c.value?"forConsumerGroup":"all"]}`;return o.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((O=o.config)==null?void 0:O.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((v=o.config)==null?void 0:v.consumerGroupId)||""):o.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(Z=o.config)!=null&&Z.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((te=o.config)==null?void 0:te.consumerGroupId)||"")),B}),S=t.ref(""),C=t.computed(()=>{const B=o.config.app==="konnect"||o.config.isExactMatch;return B?{isExactMatch:B,placeholder:a("consumers.search.placeholder")}:{isExactMatch:B,fields:{username:p.username,custom_id:p.custom_id},schema:o.config.filterSchema}}),f=t.computed(()=>c.value?"consumers":void 0),{fetcher:_,fetcherState:w}=ul(o.config,m.value,f.value),V=()=>{S.value=""},h=()=>{s.value++},k=B=>B??"-",A=t.ref(null),M=(B,O)=>{const v=B.id;if(!O(v)){n("copy:error",{entity:B,field:"id",message:a("consumers.errors.copy")});return}n("copy:success",{entity:B,field:"id",message:a("consumers.copy.success",{val:v})})},y=(B,O)=>{const v=JSON.stringify(B);if(!O(v)){n("copy:error",{entity:B,message:a("consumers.errors.copy")});return}n("copy:success",{entity:B,message:a("consumers.copy.success_brief")})},b=async B=>{var v;await((v=o.canRetrieve)==null?void 0:v.call(o,B))&&i.push(o.config.getViewRoute(B.id))},$=B=>({label:a("consumers.actions.view"),to:o.config.getViewRoute(B)}),E=B=>({label:a("consumers.actions.edit"),to:o.config.getEditRoute(B)}),x=t.ref(void 0),N=t.ref(!1),T=t.ref(!1),j=t.ref(""),q=cl(o.config,m.value),D=B=>{x.value=B,N.value=!0},L=()=>{N.value=!1},W=async()=>{var B,O,v;if((B=x.value)!=null&&B.id){T.value=!0;try{await l.delete(q(x.value.id)),T.value=!1,N.value=!1,s.value++,n("delete:success",x.value)}catch(Z){j.value=((v=(O=Z.response)==null?void 0:O.data)==null?void 0:v.message)||Z.message||a("consumers.errors.delete"),n("error",Z)}finally{T.value=!1}}},et=t.ref(!1),So=()=>{et.value=!0},_o=()=>{et.value=!1},Bo=(B,O)=>{O||_o(),s.value++,n("add:success",B)},$l=()=>{c.value&&So()},ne=t.ref(void 0),tt=t.ref(!1),Ml=t.ref(""),jl=B=>{ne.value=B,tt.value=!0},Io=()=>{tt.value=!1,ne.value=void 0},Ol=t.computed(()=>{var O,v,Z,te;let B=`${o.config.apiBaseUrl}${ie.list[o.config.app].oneForConsumerGroup}`;return o.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((O=o.config)==null?void 0:O.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((v=o.config)==null?void 0:v.consumerGroupId)||""):o.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(Z=o.config)!=null&&Z.workspace?`/${o.config.workspace}`:"").replace(/{consumerGroupId}/gi,((te=o.config)==null?void 0:te.consumerGroupId)||"")),B}),No=t.ref(!1),Dl=async()=>{if(ne.value){No.value=!0;try{const B=Ol.value.replace(/{consumerId}/gi,ne.value.id);await l.delete(B),n("remove:success",ne.value),Io(),s.value++}catch(B){Ml.value=B.message||a("consumers.errors.delete"),n("error",B)}finally{No.value=!1}}},Ao=t.ref(!0);t.watch(w,B=>{var O,v,Z,te;if(Array.isArray((O=B==null?void 0:B.response)==null?void 0:O.data)&&(Ao.value=B.response.data.length>0),B.status===le.Error){A.value={title:a("consumers.errors.general")},(te=(Z=(v=B.error)==null?void 0:v.response)==null?void 0:Z.data)!=null&&te.message&&(A.value.message=B.error.response.data.message),n("error",B.error);return}A.value=null});const ot=t.ref({ctaPath:c.value?void 0:o.config.createRoute,ctaText:void 0,message:a("consumers.list.empty_state.description"),title:a("consumers.title")});return t.onBeforeMount(async()=>{await o.canCreate()&&(ot.value.title=c.value?a("consumers.list.empty_state.title_for_consumer_group"):a("consumers.list.empty_state.title"),ot.value.ctaText=c.value?a("consumers.actions.add_consumer"):a("consumers.actions.create"))}),(B,O)=>{const v=t.resolveComponent("KButton"),Z=t.resolveComponent("KBadge"),te=t.resolveComponent("KTruncate"),xe=t.resolveComponent("KDropdownItem"),Vo=t.resolveComponent("KClipboardProvider"),Fl=t.resolveComponent("KPrompt");return t.openBlock(),t.createElementBlock("div",wl,[t.createVNode(t.unref(Li),{"cache-identifier":e.cacheIdentifier,"disable-pagination":c.value,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":ot.value,"enable-entity-actions":"","error-message":A.value,fetcher:t.unref(_),"fetcher-cache-key":s.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-consumers-list",query:S.value,"row-attributes":g,"table-headers":t.unref(u),"use-action-outside":e.useActionOutside,onClearSearchInput:V,"onClick:row":O[3]||(O[3]=F=>b(F)),onEmptyStateCtaClicked:$l,onSort:h},{"toolbar-filter":t.withCtx(()=>[c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(ol),{key:0,modelValue:S.value,"onUpdate:modelValue":O[0]||(O[0]=F=>S.value=F),config:C.value},null,8,["modelValue","config"]))]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(Ve),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(v,{appearance:"primary","data-testid":"toolbar-add-consumer",icon:"plus",to:e.config.consumerGroupId?void 0:e.config.createRoute,onClick:O[1]||(O[1]=()=>e.config.consumerGroupId?So():void 0)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.config.consumerGroupId?t.unref(a)("consumers.actions.add_consumer"):t.unref(a)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["to"]),[[t.vShow,Ao.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),username:t.withCtx(({rowValue:F})=>[t.createElementVNode("b",null,t.toDisplayString(k(F)),1)]),custom_id:t.withCtx(({rowValue:F})=>[t.createTextVNode(t.toDisplayString(k(F)),1)]),tags:t.withCtx(({rowValue:F})=>[F&&F.length>0?(t.openBlock(),t.createBlock(te,{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(F,ge=>(t.openBlock(),t.createBlock(Z,{key:ge,onClick:O[2]||(O[2]=t.withModifiers(()=>{},["stop"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ge),1)]),_:2},1024))),128))]),_:2},1024)):(t.openBlock(),t.createElementBlock("span",xl,"-"))]),actions:t.withCtx(({row:F})=>[t.createVNode(Vo,null,{default:t.withCtx(({copyToClipboard:ge})=>[t.createVNode(xe,{"data-testid":"action-entity-copy-id",onClick:Kl=>M(F,ge)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(Vo,null,{default:t.withCtx(({copyToClipboard:ge})=>[t.createVNode(xe,{"data-testid":"action-entity-copy-json",onClick:Kl=>y(F,ge)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(Ve),{"auth-function":()=>e.canRetrieve(F)},{default:t.withCtx(()=>[t.createVNode(xe,{"data-testid":"action-entity-view","has-divider":"",item:$(F.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(Ve),{"auth-function":()=>e.canEdit(F)},{default:t.withCtx(()=>[t.createVNode(xe,{"data-testid":"action-entity-edit",item:E(F.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(Ve),{"auth-function":()=>e.canDelete(F)},{default:t.withCtx(()=>[t.createVNode(xe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>e.config.consumerGroupId?jl(F):D(F)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.config.consumerGroupId?t.unref(a)("consumers.actions.remove"):t.unref(a)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(Ri),{"action-pending":T.value,"data-testid":"delete-consumer-modal",description:t.unref(a)("consumers.delete.description"),"entity-name":x.value&&(x.value.username||x.value.custom_id||x.value.id),"entity-type":t.unref(nt).Consumer,error:j.value,title:t.unref(a)("consumers.delete.title"),visible:N.value,onCancel:L,onProceed:W},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"]),e.config.consumerGroupId?(t.openBlock(),t.createBlock(kl,{key:0,config:e.config,"data-testid":"add-consumer-modal",visible:et.value,"onAdd:partialSuccess":O[4]||(O[4]=F=>Bo(F,!0)),"onAdd:success":O[5]||(O[5]=F=>Bo(F)),onCancel:_o},null,8,["config","visible"])):t.createCommentVNode("",!0),e.config.consumerGroupId&&ne.value?(t.openBlock(),t.createBlock(Fl,{key:1,"data-testid":"remove-consumer-modal","is-visible":tt.value,title:t.unref(a)("consumers.consumer_groups.remove.title"),type:"danger",onCanceled:Io,onProceed:Dl},{"body-content":t.withCtx(()=>[t.createVNode(t.unref(r),{class:"message",keypath:e.config.consumerGroupName?"consumers.consumer_groups.remove.confirmation":"consumers.consumer_groups.remove.confirmationNoCG",tag:"p"},t.createSlots({consumer:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(ne.value.username||ne.value.custom_id||ne.value.id),1)]),_:2},[e.config.consumerGroupName?{name:"consumerGroup",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(e.config.consumerGroupName),1)]),key:"0"}:void 0]),1032,["keypath"]),t.createElementVNode("p",null,t.toDisplayString(t.unref(a)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["is-visible","title"])):t.createCommentVNode("",!0)])}}}),ns="",_l=Xe(Sl,[["__scopeId","data-v-245027d1"]]),Bl={class:"kong-ui-entities-consumer-form"},Il={class:"fields-group-title"},Nl={class:"fields-group-text"},Al=t.defineComponent({__name:"ConsumerForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},consumerId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:n}){var h;const o=e,{i18nT:r,i18n:{t:a}}=Se.useI18n(),i=Te.useRouter(),{axiosInstance:l}=Qe({headers:(h=o.config)==null?void 0:h.requestHeaders}),{getMessageFromError:s}=dl(),c=t.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),d=t.reactive({username:"",customId:"",tags:""}),p=t.computed(()=>{var k,A;return(A=ie.form[(k=o.config)==null?void 0:k.app])==null?void 0:A.edit}),u=()=>{var k;i.push(((k=o.config)==null?void 0:k.cancelRoute)||{name:"consumer-list"})},g=k=>{n("loading",k)},m=k=>{n("error",k)},S=k=>{var M,y,b;c.fields.username=((M=k==null?void 0:k.item)==null?void 0:M.username)||(k==null?void 0:k.username)||"",c.fields.customId=((y=k==null?void 0:k.item)==null?void 0:y.custom_id)||(k==null?void 0:k.custom_id)||"";const A=((b=k==null?void 0:k.item)==null?void 0:b.tags)||(k==null?void 0:k.tags)||[];c.fields.tags=(A==null?void 0:A.join(", "))||"",Object.assign(d,c.fields)},C=t.computed(()=>o.consumerId?Me.Edit:Me.Create),f=k=>{var M,y,b,$,E,x;let A=`${(M=o.config)==null?void 0:M.apiBaseUrl}${ie.form[(y=o.config)==null?void 0:y.app][k]}`;return((b=o.config)==null?void 0:b.app)==="konnect"?A=A.replace(/{controlPlaneId}/gi,(($=o.config)==null?void 0:$.controlPlaneId)||""):((E=o.config)==null?void 0:E.app)==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(x=o.config)!=null&&x.workspace?`/${o.config.workspace}`:"")),A=A.replace(/{id}/gi,o.consumerId),A},_=t.computed(()=>!!c.fields.username||!!c.fields.customId),w=t.computed(()=>JSON.stringify(c.fields)!==JSON.stringify(d)),V=async()=>{var k,A,M;try{c.readonly=!0;const y={username:c.fields.username||null,custom_id:c.fields.customId||null,tags:(A=(k=c.fields.tags.split(","))==null?void 0:k.map($=>String($||"").trim()))==null?void 0:A.filter($=>$!=="")};let b;await l.post(f("validate"),y),C.value==="create"?b=await l.post(f("create"),y):C.value==="edit"&&(b=((M=o.config)==null?void 0:M.app)==="konnect"?await l.put(f("edit"),y):await l.patch(f("edit"),y)),S(b==null?void 0:b.data),n("update",b==null?void 0:b.data)}catch(y){c.errorMessage=s(y),n("error",y)}finally{c.readonly=!1}};return(k,A)=>{const M=t.resolveComponent("KInput"),y=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",Bl,[t.createVNode(t.unref(ji),{"can-submit":_.value&&w.value,config:e.config,"edit-id":e.consumerId,"error-message":c.errorMessage,"fetch-url":p.value,"is-readonly":c.readonly,onCancel:u,"onFetch:error":A[3]||(A[3]=b=>m(b)),"onFetch:success":S,onLoading:A[4]||(A[4]=b=>g(b)),onSubmit:V},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(t.unref(sl),{description:t.unref(a)("consumers.form.info.description"),"has-divider":"",title:t.unref(a)("consumers.form.info.title")},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createElementVNode("h5",Il,t.toDisplayString(t.unref(a)("consumers.form.consumer_identification.title"))+"* ",1),t.createElementVNode("p",Nl,t.toDisplayString(t.unref(a)("consumers.form.consumer_identification.description")),1)]),t.createVNode(y,null,{body:t.withCtx(()=>[t.createVNode(M,{modelValue:c.fields.username,"onUpdate:modelValue":A[0]||(A[0]=b=>c.fields.username=b),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:t.unref(a)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(a)("consumers.fields.username.placeholder"),readonly:c.readonly,type:"text"},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),t.createVNode(M,{modelValue:c.fields.customId,"onUpdate:modelValue":A[1]||(A[1]=b=>c.fields.customId=b),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:t.unref(a)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(a)("consumers.fields.custom_id.placeholder"),readonly:c.readonly,type:"text"},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])]),_:1}),t.createVNode(M,{modelValue:c.fields.tags,"onUpdate:modelValue":A[2]||(A[2]=b=>c.fields.tags=b),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:t.unref(a)("consumers.fields.tags.help"),label:t.unref(a)("consumers.fields.tags.label"),"label-attributes":{info:t.unref(a)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(a)("consumers.fields.tags.placeholder"),readonly:c.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),rs="",El=Xe(Al,[["__scopeId","data-v-335659fc"]]),Vl={class:"kong-ui-consumer-entity-config-card"},Tl=t.defineComponent({__name:"ConsumerConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e){const n=e,{i18n:{t:o},i18nT:r}=Se.useI18n(),a=t.computed(()=>ie.form[n.config.app].edit),i=t.ref({id:{},username:{section:J.Basic,tooltip:o("consumers.fields.username.tooltip"),order:1},custom_id:{section:J.Basic,tooltip:o("consumers.fields.custom_id.tooltip"),label:o("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:o("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(l,s)=>(t.openBlock(),t.createElementBlock("div",Vl,[t.createVNode(t.unref(Ti),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":i.value,"fetch-url":a.value,"hide-title":e.hideTitle,"onCopy:success":s[0]||(s[0]=c=>l.$emit("copy:success",c)),"onFetch:error":s[1]||(s[1]=c=>l.$emit("fetch:error",c)),"onFetch:success":s[2]||(s[2]=c=>l.$emit("fetch:success",c)),onLoading:s[3]||(s[3]=c=>l.$emit("loading",c))},{"username-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("consumers.fields.username.custom_id")),1)]),_:1})]),"custom_id-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});Q.ConsumerConfigCard=Tl,Q.ConsumerForm=El,Q.ConsumerList=_l,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})});