@kong-ui-public/entities-upstreams-targets 3.3.20 → 3.4.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,32 +1,50 @@
1
- (function(re,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@kong-ui-public/i18n","@kong/kongponents","vue-router"],t):(re=typeof globalThis<"u"?globalThis:re||self,t(re["kong-ui-entities-upstreams-targets"]={},re.Vue,re.axios,re["kong-ui-public-i18n"],re.Kongponents,re.VueRouter))})(this,function(re,t,Bt,Ue,wl,tt){"use strict";var at=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e.Secret="secret",e))(at||{}),ie=(e=>(e.Edit="edit",e.Create="create",e))(ie||{}),fe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(fe||{}),L=(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.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function Sl(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):Bt.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),Bt.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function _l(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const rt="khcp-user-table-preferences",xl={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function Nl(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(rt));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(rt,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||xl},deleteAllTablePreferences:()=>{localStorage.removeItem(rt)}}}function lt(e={}){const{getAxiosInstance:r}=Sl();return{axiosInstance:r(e)}}const Vl={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Bl={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Il={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Tl={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Al={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"}},Hl={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},El={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ql={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},vl={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Fl={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"}},Ol={global:Vl,deleteModal:Bl,baseForm:Il,baseTable:Tl,baseConfigCard:Al,filter:Hl,debouncedFilter:El,errors:ql,validationErrors:vl,toggleModal:Fl};function De(){const e=Ue.createI18n("en-us",Ol);return{i18n:e,i18nT:Ue.i18nTComponent(e)}}function It(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const i of n){const o=a.filter(c=>c===i).length,d=l.filter(c=>c===i).length;if(o!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const i in a)if(Array.isArray(a[i])&&Array.isArray(l[i])){if(r(a[i],l[i]))continue;return!1}else{if(a[i]===l[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let i=l[a]===void 0||l[a]===null?"":l[a],o=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(i=l[a][0]),Array.isArray(n[a])&&(o=n[a][0]),i.localeCompare(o)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function $l(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="1000");const{axiosInstance:n}=lt(e.axiosRequestConfig),{i18n:{t:i}}=De(),{debounce:o}=_l(),d=o(async I=>{await T(I)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),m=t.ref([]),s=t.ref(void 0),S=t.computed(()=>{const I=`${e.apiBaseUrl}${t.unref(r)}`;return e.app==="konnect"?I.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?I.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):I}),{isValidUuid:_}=It(),g=async()=>{try{c.value=!0;const{data:I}=await n.get(`${S.value}?size=${a}`);I!=null&&I.next||(s.value=l.fetchedItemsKey in I?I[l.fetchedItemsKey]:[]),m.value=l.fetchedItemsKey in I?I[l.fetchedItemsKey]:[],u.value=m.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},x=t.ref(""),T=async I=>{var B,A,f;if(x.value!==I){if(x.value=I??"",!I){u.value=m.value;return}if(s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){const b=`${S.value}/${I}`,{data:N}=await n.get(`${b}?size=${a}`);l.fetchedItemsKey in N?u.value=N[l.fetchedItemsKey]:N!=null&&N[l.exactMatchKey??"id"]?u.value=[N]:u.value=[]}else{const b=[];_(I)&&l.searchKeys.includes("id")?b.push((async()=>{const{data:w}=await n.get(`${S.value}/${I}`);return[w[l.fetchedItemsKey]??w]})()):b.push(...l.searchKeys.filter(w=>w!=="id").map(async w=>{const{data:E}=await n.get(`${S.value}?${w}=${I}`);return E[l.fetchedItemsKey]}));const N=await Promise.all(b),V=new Set;u.value=[],(B=N==null?void 0:N.forEach)==null||B.call(N,w=>{var E;(E=w==null?void 0:w.forEach)==null||E.call(w,H=>{V.has(H.id)||(V.add(H.id),u.value.push(H))})})}}catch(b){((A=b==null?void 0:b.response)==null?void 0:A.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],h.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",u.value=(f=s.value)==null?void 0:f.filter(b=>{var N;let V=!1;for(const w of l.searchKeys){const E=typeof b[w]=="string"?(N=b[w])==null?void 0:N.toLowerCase():b[w];E!=null&&E.includes(I.toLowerCase())&&(V=!0)}return V}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:h,validationError:p,results:u,allRecords:s,loadItems:g,debouncedQueryChange:d}}function Ul(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Dl(){const{i18n:{t:e}}=De();return{getMessageFromError:r=>{var a,l,n,i;if(!r)return e("errors.unexpected");if(((a=r==null?void 0:r.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((l=r==null?void 0:r.response)!=null&&l.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let d=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(d=o.messages.join(", ")),o.field?`${o.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Ml(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,i=e.some(o=>o.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!i&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function Tt(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),i=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return o=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:m}=o;try{let s=new URL(i.value.href);return n.value&&m?(s.search="",s=a.value.isExactMatch?new URL(`${s.href}/${m}/`):new URL(`${s.href}?filter[name][contains]=${m}`)):(n.value||new URLSearchParams(m).forEach((S,_)=>{s.searchParams.append(_,S)}),p&&s.searchParams.append("sort_by",p),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),h&&d!==1&&s.searchParams.append("offset",String(h)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function jl(e,r,a){const l=t.unref(r),{axiosInstance:n}=lt(e.axiosRequestConfig),i=Tt(e,l),o=t.ref({status:fe.Idle});return{fetcher:async d=>{var c;const h=t.toValue(a)||"data";try{o.value={status:fe.Loading};let p=i(d);p.includes("filter[name]")&&(p=`${p}&page[size]=${d.pageSize}&page[number]=${d.page}`);const u=await n.get(p);if(u.status>=400)throw u;const m=u.data,s=h&&h.replace(/[^\w-_]/gi,"");let S;m[s]?S=Array.isArray(m[s])?m[s]:[m[s]]:Array.isArray(m)?S=m:S=Object.keys(m).length?[m]:[];const _={data:S,total:S.length,...m.offset?{pagination:{offset:m.offset}}:null};return o.value={status:fe.Idle,response:_},_}catch(p){const u={data:[],total:0};return d.query&&(((c=p.response)==null?void 0:c.status)===404||p.status===404)?(o.value={status:fe.NoResults,response:u,error:p.response?p:{response:p}},u):(o.value={status:fe.Error,response:u,error:p.response?p:{response:p}},u)}},fetcherState:o}}function Kl(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const At=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ht=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(At);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},Et=e=>e==="*"||e==="x"||e==="X",qt=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Ll=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Pl=(e,r)=>{if(Et(e)||Et(r))return 0;const[a,l]=Ll(qt(e),qt(r));return a>l?1:a<l?-1:0},vt=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Pl(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},Rl=(e,r)=>{const a=Ht(e),l=Ht(r),n=a.pop(),i=l.pop(),o=vt(a,l);return o!==0?o:n&&i?vt(n.split("."),i.split(".")):n||i?n?-1:1:0},Ft=(e,r,a)=>{zl(a);const l=Rl(e,r);return Ot[a].includes(l)},Ot={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},$t=Object.keys(Ot),zl=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if($t.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${$t.join("|")}`)},Jl=e=>typeof e=="string"&&/^[v\d]/.test(e)&&At.test(e);function Wl(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!Jl(n))return console.error("Invalid version"),!1;const i=a[l];if(!i)return!1;const[o,d]=i;return!(o&&Ft(n,o,"<")||d&&Ft(n,d,">"))}function Ql(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}function Zl(){const{i18n:{t:e}}=De();return{utf8Name:r=>/^[\p{N}\p{L}.\-_~]*$/u.test(r)?"":e("validationErrors.utf8Name")}}const Y={useAxios:lt,useDebouncedFilter:$l,useDeleteUrlBuilder:Ul,useErrors:Dl,useExternalLinkCreator:Ml,useFetcher:jl,useFetchUrlBuilder:Tt,useHelpers:It,useStringHelpers:Kl,useI18n:De,useGatewayFeatureSupported:Wl,useTruncationDetector:Ql,useValidators:Zl},Yl={key:0,class:"config-card-fieldset-title"},Gl=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Y.useI18n(),{convertKeyToTitle:l}=Y.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),i=t.computed(()=>r.item.value??r.item),o=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=i.value)!=null&&c.name?l(i.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,h)=>(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",Yl,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(o.value),(p,u)=>(t.openBlock(),t.createBlock(Dt,{key:`${n.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:o.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),oe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Ut=oe(Gl,[["__scopeId","data-v-68ca83ec"]]),Xl=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Y.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=i=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),en=oe(Xl,[["__scopeId","data-v-c96811e5"]]),tn=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Y.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),an="#0044f4",rn="#e0e4ea",ln="#afb7c5",nn="1px",on="20px",sn={class:"config-card-details-row"},cn=["data-testid"],dn=["data-testid"],hn=["data-testid"],pn=["data-testid"],un={key:1},fn=["data-testid"],mn=["data-testid"],gn=["data-testid"],yn=["data-testid"],kn={name:"ConfigCardItem",components:{JsonCardItem:Ut,StatusBadge:tn,InternalLinkItem:en}},bn=t.defineComponent({...kn,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:r}){t.useCssVars(S=>({"2f5b0492":p.value?"none":`solid ${t.unref(nn)} ${t.unref(rn)}`,"5d59c22c":h.value&&d.value?"block":"flex",aa41a894:h.value&&d.value?"100%":a.slim?"50%":"25%",aa3d1cde:h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:o}}=Y.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),h=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),p=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":i("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:o(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:a.item.value}};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:S=>{l("navigation-click",S)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),m=t.ref(),{isTruncated:s}=Y.useTruncationDetector(m);return(S,_)=>{const g=t.resolveComponent("KLabel"),x=t.resolveComponent("KBadge"),T=t.resolveComponent("KCopy"),I=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",sn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(S.$slots,"label",{item:e.item},()=>[t.createVNode(g,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(S.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,dn)]),key:"0"}:void 0]),1024)],!0)],8,cn),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(S.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",un,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.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,(B,A)=>(t.openBlock(),t.createBlock(x,{key:`${e.item.key}-badge-tag-${A}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${A}`,tooltip:B,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(B),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,fn)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(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,(B,A)=>(t.openBlock(),t.createBlock(T,t.mergeProps({ref_for:!0},u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${A}`,"data-testid":`${e.item.key}-copy-uuid-${A}`,text:B}),null,16,["data-testid","text"]))),128))],8,mn)):u.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,(B,A)=>(t.openBlock(),t.createBlock(x,{key:`${e.item.key}-badge-method-${A}`,appearance:Object.values(t.unref(wl.BadgeMethodAppearances)).includes(B.toLowerCase())?B.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${A}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(B),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,gn)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${a.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(B,A)=>(t.openBlock(),t.createBlock(Ut,{key:`json-array-item-${A}`,index:A,"is-array-item":"",item:B},null,8,["index","item"]))),128))],8,yn)):(t.openBlock(),t.createBlock(I,{key:4,text:t.unref(s)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:m,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,pn))],!0)],8,hn)])}}}),Dt=oe(bn,[["__scopeId","data-v-711ebcf2"]]),Cn={class:"json-config"},wn={key:0,class:"json-endpoint"},Mt=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"7a485cf8":`${l.value}ch`}));const r=e,a=t.computed(()=>r.jsonRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const i=(n=r.fetcherUrl)==null?void 0:n.split("/");return i.length<2?0:41+(r.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(n,i)=>{const o=t.resolveComponent("KBadge"),d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Cn,[r.fetcherUrl?(t.openBlock(),t.createElementBlock("div",wn,[t.createVNode(o,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(d,{id:"json-endpoint-codeblock",code:r.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(d,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(a.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function jt(e){return typeof e>"u"||e===null}function Sn(e){return typeof e=="object"&&e!==null}function _n(e){return Array.isArray(e)?e:jt(e)?[]:[e]}function xn(e,r){var a,l,n,i;if(r)for(i=Object.keys(r),a=0,l=i.length;a<l;a+=1)n=i[a],e[n]=r[n];return e}function Nn(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function Vn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Bn=jt,In=Sn,Tn=_n,An=Nn,Hn=Vn,En=xn,Q={isNothing:Bn,isObject:In,toArray:Tn,repeat:An,isNegativeZero:Hn,extend:En};function Kt(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
1
+ (function(re,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@kong-ui-public/i18n","@kong/kongponents","vue-router"],t):(re=typeof globalThis<"u"?globalThis:re||self,t(re["kong-ui-entities-upstreams-targets"]={},re.Vue,re.axios,re["kong-ui-public-i18n"],re.Kongponents,re.VueRouter))})(this,function(re,t,At,Me,Nl,lt){"use strict";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.Secret="secret",e))(nt||{}),se=(e=>(e.Edit="edit",e.Create="create",e))(se||{}),me=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(me||{}),Ee=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="key_set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e))(Ee||{});const je=Object.values(Ee);var L=(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.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function Vl(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):At.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),At.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function Bl(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const ot="khcp-user-table-preferences",Il={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function Tl(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(ot));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(ot,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||Il},deleteAllTablePreferences:()=>{localStorage.removeItem(ot)}}}function it(e={}){const{getAxiosInstance:r}=Vl();return{axiosInstance:r(e)}}const Al={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},El={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Hl={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON",terraform:"Terraform"},errors:{edit:"The entity could not be edited at this time."}},vl={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},$l={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"}},ql={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Ol={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Fl={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ul={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Dl={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"}},Ml={global:Al,deleteModal:El,baseForm:Hl,baseTable:vl,baseConfigCard:$l,filter:ql,debouncedFilter:Ol,errors:Fl,validationErrors:Ul,toggleModal:Dl};function Ke(){const e=Me.createI18n("en-us",Ml);return{i18n:e,i18nT:Me.i18nTComponent(e)}}function Et(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const o of n){const i=a.filter(c=>c===o).length,d=l.filter(c=>c===o).length;if(i!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const o in a)if(Array.isArray(a[o])&&Array.isArray(l[o])){if(r(a[o],l[o]))continue;return!1}else{if(a[o]===l[o])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let o=l[a]===void 0||l[a]===null?"":l[a],i=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(o=l[a][0]),Array.isArray(n[a])&&(i=n[a][0]),o.localeCompare(i)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function jl(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="1000");const{axiosInstance:n}=it(e.axiosRequestConfig),{i18n:{t:o}}=Ke(),{debounce:i}=Bl(),d=i(async T=>{await B(T)},200),c=t.ref(!1),p=t.ref(""),h=t.ref(""),u=t.ref([]),f=t.ref([]),s=t.ref(void 0),b=t.computed(()=>{const T=`${e.apiBaseUrl}${t.unref(r)}`;return e.app==="konnect"?T.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?T.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):T}),{isValidUuid:S}=Et(),g=async()=>{try{c.value=!0;const{data:T}=await n.get(`${b.value}?size=${a}`);T!=null&&T.next||(s.value=l.fetchedItemsKey in T?T[l.fetchedItemsKey]:[]),f.value=l.fetchedItemsKey in T?T[l.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],p.value=o("debouncedFilter.errors.fetch")}finally{c.value=!1}},x=t.ref(""),B=async T=>{var I,A,m;if(x.value!==T){if(x.value=T??"",!T){u.value=f.value;return}if(s.value===void 0)try{if(c.value=!0,p.value="",h.value="",e.app==="konnect"){const C=`${b.value}/${T}`,{data:N}=await n.get(`${C}?size=${a}`);l.fetchedItemsKey in N?u.value=N[l.fetchedItemsKey]:N!=null&&N[l.exactMatchKey??"id"]?u.value=[N]:u.value=[]}else{const C=[];S(T)&&l.searchKeys.includes("id")?C.push((async()=>{const{data:_}=await n.get(`${b.value}/${T}`);return[_[l.fetchedItemsKey]??_]})()):C.push(...l.searchKeys.filter(_=>_!=="id").map(async _=>{const{data:H}=await n.get(`${b.value}?${_}=${T}`);return H[l.fetchedItemsKey]}));const N=await Promise.all(C),V=new Set;u.value=[],(I=N==null?void 0:N.forEach)==null||I.call(N,_=>{var H;(H=_==null?void 0:_.forEach)==null||H.call(_,E=>{V.has(E.id)||(V.add(E.id),u.value.push(E))})})}}catch(C){((A=C==null?void 0:C.response)==null?void 0:A.status)===404?h.value=o("debouncedFilter.errors.invalid"):(u.value=[],p.value=o("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,h.value="",u.value=(m=s.value)==null?void 0:m.filter(C=>{var N;let V=!1;for(const _ of l.searchKeys){const H=typeof C[_]=="string"?(N=C[_])==null?void 0:N.toLowerCase():C[_];H!=null&&H.includes(T.toLowerCase())&&(V=!0)}return V}),(!u.value||!u.value.length)&&(h.value=o("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:p,validationError:h,results:u,allRecords:s,loadItems:g,debouncedQueryChange:d}}function Kl(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Ll(){const{i18n:{t:e}}=Ke();return{getMessageFromError:r=>{var a,l,n,o;if(!r)return e("errors.unexpected");if(((a=r==null?void 0:r.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((l=r==null?void 0:r.response)!=null&&l.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(i=>{let d=e("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(d=i.messages.join(", ")),i.field?`${i.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:i}=r.response.data;return Array.isArray(i)?(o=i[0])!=null&&o.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(i=>`${i} ${r.response.data[i]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Pl(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,o=e.some(i=>i.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!o&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function Ht(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),o=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return i=>{const{page:d,pageSize:c,offset:p,sortColumnKey:h,sortColumnOrder:u,query:f}=i;try{let s=new URL(o.value.href);return n.value&&f?(s.search="",s=a.value.isExactMatch?new URL(`${s.href}/${f}/`):new URL(`${s.href}?filter[name][contains]=${f}`)):(n.value||new URLSearchParams(f).forEach((b,S)=>{s.searchParams.append(S,b)}),h&&s.searchParams.append("sort_by",h),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),p&&d!==1&&s.searchParams.append("offset",String(p)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function Rl(e,r,a){const l=t.unref(r),{axiosInstance:n}=it(e.axiosRequestConfig),o=Ht(e,l),i=t.ref({status:me.Idle});return{fetcher:async d=>{var c;const p=t.toValue(a)||"data";try{i.value={status:me.Loading};let h=o(d);h.includes("filter[name]")&&(h=`${h}&page[size]=${d.pageSize}&page[number]=${d.page}`);const u=await n.get(h);if(u.status>=400)throw u;const f=u.data,s=p&&p.replace(/[^\w-_]/gi,"");let b;f[s]?b=Array.isArray(f[s])?f[s]:[f[s]]:Array.isArray(f)?b=f:b=Object.keys(f).length?[f]:[];const S={data:b,total:b.length,...f.offset?{pagination:{offset:f.offset}}:null};return i.value={status:me.Idle,response:S},S}catch(h){const u={data:[],total:0};return d.query&&(((c=h.response)==null?void 0:c.status)===404||h.status===404)?(i.value={status:me.NoResults,response:u,error:h.response?h:{response:h}},u):(i.value={status:me.Error,response:u,error:h.response?h:{response:h}},u)}},fetcherState:i}}function zl(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const vt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,$t=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(vt);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},qt=e=>e==="*"||e==="x"||e==="X",Ot=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Jl=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Wl=(e,r)=>{if(qt(e)||qt(r))return 0;const[a,l]=Jl(Ot(e),Ot(r));return a>l?1:a<l?-1:0},Ft=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Wl(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},Ql=(e,r)=>{const a=$t(e),l=$t(r),n=a.pop(),o=l.pop(),i=Ft(a,l);return i!==0?i:n&&o?Ft(n.split("."),o.split(".")):n||o?n?-1:1:0},Ut=(e,r,a)=>{Yl(a);const l=Ql(e,r);return Dt[a].includes(l)},Dt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Mt=Object.keys(Dt),Yl=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Mt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Mt.join("|")}`)},Zl=e=>typeof e=="string"&&/^[v\d]/.test(e)&&vt.test(e);function Gl(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!Zl(n))return console.error("Invalid version"),!1;const o=a[l];if(!o)return!1;const[i,d]=o;return!(i&&Ut(n,i,"<")||d&&Ut(n,d,">"))}function Xl(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}function en(){const{i18n:{t:e}}=Ke();return{utf8Name:r=>/^[\p{N}\p{L}.\-_~]*$/u.test(r)?"":e("validationErrors.utf8Name")}}const Z={useAxios:it,useDebouncedFilter:jl,useDeleteUrlBuilder:Kl,useErrors:Ll,useExternalLinkCreator:Pl,useFetcher:Rl,useFetchUrlBuilder:Ht,useHelpers:Et,useStringHelpers:zl,useI18n:Ke,useGatewayFeatureSupported:Gl,useTruncationDetector:Xl,useValidators:en},tn={key:0,class:"config-card-fieldset-title"},an=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Z.useI18n(),{convertKeyToTitle:l}=Z.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),o=t.computed(()=>r.item.value??r.item),i=t.computed(()=>{const c=JSON.parse(JSON.stringify(o.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=o.value)!=null&&c.name?l(o.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,p)=>(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",tn,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(i.value),(h,u)=>(t.openBlock(),t.createBlock(Kt,{key:`${n.value}-property-${u}`,item:{key:h,label:t.unref(l)(h),value:i.value[h]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ie=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},jt=ie(an,[["__scopeId","data-v-68ca83ec"]]),rn=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=o=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),ln=ie(rn,[["__scopeId","data-v-c96811e5"]]),nn=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),on="#0044f4",sn="#e0e4ea",cn="#afb7c5",dn="1px",hn="20px",pn={class:"config-card-details-row"},un=["data-testid"],fn=["data-testid"],mn=["data-testid"],gn=["data-testid"],yn={key:1},kn=["data-testid"],bn=["data-testid"],Cn=["data-testid"],wn=["data-testid"],_n={name:"ConfigCardItem",components:{JsonCardItem:jt,StatusBadge:nn,InternalLinkItem:ln}},Sn=t.defineComponent({..._n,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:r}){t.useCssVars(b=>({"2f5b0492":h.value?"none":`solid ${t.unref(dn)} ${t.unref(sn)}`,"5d59c22c":p.value&&d.value?"block":"flex",aa41a894:p.value&&d.value?"100%":a.slim?"50%":"25%",aa3d1cde:p.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:o,formatUnixTimeStamp:i}}=Z.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),p=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),h=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"copy-tooltip":o("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":o("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":o("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":o("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:i(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:a.item.value}};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:b=>{l("navigation-click",b)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),f=t.ref(),{isTruncated:s}=Z.useTruncationDetector(f);return(b,S)=>{const g=t.resolveComponent("KLabel"),x=t.resolveComponent("KBadge"),B=t.resolveComponent("KCopy"),T=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",pn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(b.$slots,"label",{item:e.item},()=>[t.createVNode(g,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(b.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,fn)]),key:"0"}:void 0]),1024)],!0)],8,un),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(b.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",yn,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.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,(I,A)=>(t.openBlock(),t.createBlock(x,{key:`${e.item.key}-badge-tag-${A}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${A}`,tooltip:I,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(I),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,kn)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(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,(I,A)=>(t.openBlock(),t.createBlock(B,t.mergeProps({ref_for:!0},u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${A}`,"data-testid":`${e.item.key}-copy-uuid-${A}`,text:I}),null,16,["data-testid","text"]))),128))],8,bn)):u.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,(I,A)=>(t.openBlock(),t.createBlock(x,{key:`${e.item.key}-badge-method-${A}`,appearance:Object.values(t.unref(Nl.BadgeMethodAppearances)).includes(I.toLowerCase())?I.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${A}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(I),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Cn)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${a.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(I,A)=>(t.openBlock(),t.createBlock(jt,{key:`json-array-item-${A}`,index:A,"is-array-item":"",item:I},null,8,["index","item"]))),128))],8,wn)):(t.openBlock(),t.createBlock(T,{key:4,text:t.unref(s)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:f,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,gn))],!0)],8,mn)])}}}),Kt=ie(Sn,[["__scopeId","data-v-711ebcf2"]]),xn={class:"json-config"},Nn={key:0,class:"json-endpoint"},Lt=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},entityRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"454fa8c4":`${l.value}ch`}));const r=e,a=t.computed(()=>r.entityRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const o=(n=r.fetcherUrl)==null?void 0:n.split("/");return o.length<2?0:41+(r.requestMethod==="post"?o[o.length-1]:o[o.length-2]).length});return(n,o)=>{const i=t.resolveComponent("KBadge"),d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",xn,[r.fetcherUrl?(t.openBlock(),t.createElementBlock("div",Nn,[t.createVNode(i,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(d,{id:"json-endpoint-codeblock",code:r.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.entityRecord?(t.openBlock(),t.createBlock(d,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(a.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Pt(e){return typeof e>"u"||e===null}function Vn(e){return typeof e=="object"&&e!==null}function Bn(e){return Array.isArray(e)?e:Pt(e)?[]:[e]}function In(e,r){var a,l,n,o;if(r)for(o=Object.keys(r),a=0,l=o.length;a<l;a+=1)n=o[a],e[n]=r[n];return e}function Tn(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function An(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var En=Pt,Hn=Vn,vn=Bn,$n=Tn,qn=An,On=In,Q={isNothing:En,isObject:Hn,toArray:vn,repeat:$n,isNegativeZero:qn,extend:On};function Rt(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
2
2
 
3
- `+e.mark.snippet),l+" "+a):l}function Ae(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=Kt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ae.prototype=Object.create(Error.prototype),Ae.prototype.constructor=Ae,Ae.prototype.toString=function(e){return this.name+": "+Kt(this,e)};var le=Ae;function nt(e,r,a,l,n){var i="",o="",d=Math.floor(n/2)-1;return l-r>d&&(i=" ... ",r=l-d+i.length),a-l>d&&(o=" ...",a=l+d-o.length),{str:i+e.slice(r,a).replace(/\t/g,"→")+o,pos:l-r+i.length}}function ot(e,r){return Q.repeat(" ",r-e.length)+e}function qn(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var a=/\r?\n|\r|\0/g,l=[0],n=[],i,o=-1;i=a.exec(e.buffer);)n.push(i.index),l.push(i.index+i[0].length),e.position<=i.index&&o<0&&(o=l.length-2);o<0&&(o=l.length-1);var d="",c,h,p=Math.min(e.line+r.linesAfter,n.length).toString().length,u=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(o-c<0);c++)h=nt(e.buffer,l[o-c],n[o-c],e.position-(l[o]-l[o-c]),u),d=Q.repeat(" ",r.indent)+ot((e.line-c+1).toString(),p)+" | "+h.str+`
4
- `+d;for(h=nt(e.buffer,l[o],n[o],e.position,u),d+=Q.repeat(" ",r.indent)+ot((e.line+1).toString(),p)+" | "+h.str+`
5
- `,d+=Q.repeat("-",r.indent+p+3+h.pos)+`^
6
- `,c=1;c<=r.linesAfter&&!(o+c>=n.length);c++)h=nt(e.buffer,l[o+c],n[o+c],e.position-(l[o]-l[o+c]),u),d+=Q.repeat(" ",r.indent)+ot((e.line+c+1).toString(),p)+" | "+h.str+`
7
- `;return d.replace(/\n$/,"")}var vn=qn,Fn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],On=["scalar","sequence","mapping"];function $n(e){var r={};return e!==null&&Object.keys(e).forEach(function(a){e[a].forEach(function(l){r[String(l)]=a})}),r}function Un(e,r){if(r=r||{},Object.keys(r).forEach(function(a){if(Fn.indexOf(a)===-1)throw new le('Unknown option "'+a+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(a){return a},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=$n(r.styleAliases||null),On.indexOf(this.kind)===-1)throw new le('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var G=Un;function Lt(e,r){var a=[];return e[r].forEach(function(l){var n=a.length;a.forEach(function(i,o){i.tag===l.tag&&i.kind===l.kind&&i.multi===l.multi&&(n=o)}),a[n]=l}),a}function Dn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,a;function l(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(r=0,a=arguments.length;r<a;r+=1)arguments[r].forEach(l);return e}function it(e){return this.extend(e)}it.prototype.extend=function(e){var r=[],a=[];if(e instanceof G)a.push(e);else if(Array.isArray(e))a=a.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(a=a.concat(e.explicit));else throw new le("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(n){if(!(n instanceof G))throw new le("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new le("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new le("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),a.forEach(function(n){if(!(n instanceof G))throw new le("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(it.prototype);return l.implicit=(this.implicit||[]).concat(r),l.explicit=(this.explicit||[]).concat(a),l.compiledImplicit=Lt(l,"implicit"),l.compiledExplicit=Lt(l,"explicit"),l.compiledTypeMap=Dn(l.compiledImplicit,l.compiledExplicit),l};var Pt=it,Rt=new G("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),zt=new G("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Jt=new G("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Wt=new Pt({explicit:[Rt,zt,Jt]});function Mn(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function jn(){return null}function Kn(e){return e===null}var Qt=new G("tag:yaml.org,2002:null",{kind:"scalar",resolve:Mn,construct:jn,predicate:Kn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Ln(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Pn(e){return e==="true"||e==="True"||e==="TRUE"}function Rn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Zt=new G("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Ln,construct:Pn,predicate:Rn,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 zn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Jn(e){return 48<=e&&e<=55}function Wn(e){return 48<=e&&e<=57}function Qn(e){if(e===null)return!1;var r=e.length,a=0,l=!1,n;if(!r)return!1;if(n=e[a],(n==="-"||n==="+")&&(n=e[++a]),n==="0"){if(a+1===r)return!0;if(n=e[++a],n==="b"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(n!=="0"&&n!=="1")return!1;l=!0}return l&&n!=="_"}if(n==="x"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!zn(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}if(n==="o"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Jn(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}}if(n==="_")return!1;for(;a<r;a++)if(n=e[a],n!=="_"){if(!Wn(e.charCodeAt(a)))return!1;l=!0}return!(!l||n==="_")}function Zn(e){var r=e,a=1,l;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),l=r[0],(l==="-"||l==="+")&&(l==="-"&&(a=-1),r=r.slice(1),l=r[0]),r==="0")return 0;if(l==="0"){if(r[1]==="b")return a*parseInt(r.slice(2),2);if(r[1]==="x")return a*parseInt(r.slice(2),16);if(r[1]==="o")return a*parseInt(r.slice(2),8)}return a*parseInt(r,10)}function Yn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Q.isNegativeZero(e)}var Yt=new G("tag:yaml.org,2002:int",{kind:"scalar",resolve:Qn,construct:Zn,predicate:Yn,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"]}}),Gn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Xn(e){return!(e===null||!Gn.test(e)||e[e.length-1]==="_")}function eo(e){var r,a;return r=e.replace(/_/g,"").toLowerCase(),a=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:a*parseFloat(r,10)}var to=/^[-+]?[0-9]+e/;function ao(e,r){var a;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Q.isNegativeZero(e))return"-0.0";return a=e.toString(10),to.test(a)?a.replace("e",".e"):a}function ro(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Q.isNegativeZero(e))}var Gt=new G("tag:yaml.org,2002:float",{kind:"scalar",resolve:Xn,construct:eo,predicate:ro,represent:ao,defaultStyle:"lowercase"}),Xt=Wt.extend({implicit:[Qt,Zt,Yt,Gt]}),ea=Xt,ta=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),aa=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 lo(e){return e===null?!1:ta.exec(e)!==null||aa.exec(e)!==null}function no(e){var r,a,l,n,i,o,d,c=0,h=null,p,u,m;if(r=ta.exec(e),r===null&&(r=aa.exec(e)),r===null)throw new Error("Date resolve error");if(a=+r[1],l=+r[2]-1,n=+r[3],!r[4])return new Date(Date.UTC(a,l,n));if(i=+r[4],o=+r[5],d=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(p=+r[10],u=+(r[11]||0),h=(p*60+u)*6e4,r[9]==="-"&&(h=-h)),m=new Date(Date.UTC(a,l,n,i,o,d,c)),h&&m.setTime(m.getTime()-h),m}function oo(e){return e.toISOString()}var ra=new G("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:lo,construct:no,instanceOf:Date,represent:oo});function io(e){return e==="<<"||e===null}var la=new G("tag:yaml.org,2002:merge",{kind:"scalar",resolve:io}),st=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
- \r`;function so(e){if(e===null)return!1;var r,a,l=0,n=e.length,i=st;for(a=0;a<n;a++)if(r=i.indexOf(e.charAt(a)),!(r>64)){if(r<0)return!1;l+=6}return l%8===0}function co(e){var r,a,l=e.replace(/[\r\n=]/g,""),n=l.length,i=st,o=0,d=[];for(r=0;r<n;r++)r%4===0&&r&&(d.push(o>>16&255),d.push(o>>8&255),d.push(o&255)),o=o<<6|i.indexOf(l.charAt(r));return a=n%4*6,a===0?(d.push(o>>16&255),d.push(o>>8&255),d.push(o&255)):a===18?(d.push(o>>10&255),d.push(o>>2&255)):a===12&&d.push(o>>4&255),new Uint8Array(d)}function ho(e){var r="",a=0,l,n,i=e.length,o=st;for(l=0;l<i;l++)l%3===0&&l&&(r+=o[a>>18&63],r+=o[a>>12&63],r+=o[a>>6&63],r+=o[a&63]),a=(a<<8)+e[l];return n=i%3,n===0?(r+=o[a>>18&63],r+=o[a>>12&63],r+=o[a>>6&63],r+=o[a&63]):n===2?(r+=o[a>>10&63],r+=o[a>>4&63],r+=o[a<<2&63],r+=o[64]):n===1&&(r+=o[a>>2&63],r+=o[a<<4&63],r+=o[64],r+=o[64]),r}function po(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var na=new G("tag:yaml.org,2002:binary",{kind:"scalar",resolve:so,construct:co,predicate:po,represent:ho}),uo=Object.prototype.hasOwnProperty,fo=Object.prototype.toString;function mo(e){if(e===null)return!0;var r=[],a,l,n,i,o,d=e;for(a=0,l=d.length;a<l;a+=1){if(n=d[a],o=!1,fo.call(n)!=="[object Object]")return!1;for(i in n)if(uo.call(n,i))if(!o)o=!0;else return!1;if(!o)return!1;if(r.indexOf(i)===-1)r.push(i);else return!1}return!0}function go(e){return e!==null?e:[]}var oa=new G("tag:yaml.org,2002:omap",{kind:"sequence",resolve:mo,construct:go}),yo=Object.prototype.toString;function ko(e){if(e===null)return!0;var r,a,l,n,i,o=e;for(i=new Array(o.length),r=0,a=o.length;r<a;r+=1){if(l=o[r],yo.call(l)!=="[object Object]"||(n=Object.keys(l),n.length!==1))return!1;i[r]=[n[0],l[n[0]]]}return!0}function bo(e){if(e===null)return[];var r,a,l,n,i,o=e;for(i=new Array(o.length),r=0,a=o.length;r<a;r+=1)l=o[r],n=Object.keys(l),i[r]=[n[0],l[n[0]]];return i}var ia=new G("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ko,construct:bo}),Co=Object.prototype.hasOwnProperty;function wo(e){if(e===null)return!0;var r,a=e;for(r in a)if(Co.call(a,r)&&a[r]!==null)return!1;return!0}function So(e){return e!==null?e:{}}var sa=new G("tag:yaml.org,2002:set",{kind:"mapping",resolve:wo,construct:So}),ct=ea.extend({implicit:[ra,la],explicit:[na,oa,ia,sa]}),me=Object.prototype.hasOwnProperty,Me=1,ca=2,da=3,je=4,dt=1,_o=2,ha=3,xo=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,No=/[\x85\u2028\u2029]/,Vo=/[,\[\]\{\}]/,pa=/^(?:!|!!|![a-z\-]+!)$/i,ua=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function fa(e){return Object.prototype.toString.call(e)}function se(e){return e===10||e===13}function ye(e){return e===9||e===32}function ne(e){return e===9||e===32||e===10||e===13}function be(e){return e===44||e===91||e===93||e===123||e===125}function Bo(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Io(e){return e===120?2:e===117?4:e===85?8:0}function To(e){return 48<=e&&e<=57?e-48:-1}function ma(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 Ao(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ga=new Array(256),ya=new Array(256),Ce=0;Ce<256;Ce++)ga[Ce]=ma(Ce)?1:0,ya[Ce]=ma(Ce);function Ho(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||ct,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.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 ka(e,r){var a={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return a.snippet=vn(a),new le(r,a)}function q(e,r){throw ka(e,r)}function Ke(e,r){e.onWarning&&e.onWarning.call(null,ka(e,r))}var ba={YAML:function(e,r,a){var l,n,i;e.version!==null&&q(e,"duplication of %YAML directive"),a.length!==1&&q(e,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(a[0]),l===null&&q(e,"ill-formed argument of the YAML directive"),n=parseInt(l[1],10),i=parseInt(l[2],10),n!==1&&q(e,"unacceptable YAML version of the document"),e.version=a[0],e.checkLineBreaks=i<2,i!==1&&i!==2&&Ke(e,"unsupported YAML version of the document")},TAG:function(e,r,a){var l,n;a.length!==2&&q(e,"TAG directive accepts exactly two arguments"),l=a[0],n=a[1],pa.test(l)||q(e,"ill-formed tag handle (first argument) of the TAG directive"),me.call(e.tagMap,l)&&q(e,'there is a previously declared suffix for "'+l+'" tag handle'),ua.test(n)||q(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{q(e,"tag prefix is malformed: "+n)}e.tagMap[l]=n}};function ge(e,r,a,l){var n,i,o,d;if(r<a){if(d=e.input.slice(r,a),l)for(n=0,i=d.length;n<i;n+=1)o=d.charCodeAt(n),o===9||32<=o&&o<=1114111||q(e,"expected valid JSON character");else xo.test(d)&&q(e,"the stream contains non-printable characters");e.result+=d}}function Ca(e,r,a,l){var n,i,o,d;for(Q.isObject(a)||q(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(a),o=0,d=n.length;o<d;o+=1)i=n[o],me.call(r,i)||(r[i]=a[i],l[i]=!0)}function we(e,r,a,l,n,i,o,d,c){var h,p;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),h=0,p=n.length;h<p;h+=1)Array.isArray(n[h])&&q(e,"nested arrays are not supported inside keys"),typeof n=="object"&&fa(n[h])==="[object Object]"&&(n[h]="[object Object]");if(typeof n=="object"&&fa(n)==="[object Object]"&&(n="[object Object]"),n=String(n),r===null&&(r={}),l==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(h=0,p=i.length;h<p;h+=1)Ca(e,r,i[h],a);else Ca(e,r,i,a);else!e.json&&!me.call(a,n)&&me.call(r,n)&&(e.line=o||e.line,e.lineStart=d||e.lineStart,e.position=c||e.position,q(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(r,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):r[n]=i,delete a[n];return r}function ht(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):q(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function W(e,r,a){for(var l=0,n=e.input.charCodeAt(e.position);n!==0;){for(;ye(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(r&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(se(n))for(ht(e),n=e.input.charCodeAt(e.position),l++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return a!==-1&&l!==0&&e.lineIndent<a&&Ke(e,"deficient indentation"),l}function Le(e){var r=e.position,a;return a=e.input.charCodeAt(r),!!((a===45||a===46)&&a===e.input.charCodeAt(r+1)&&a===e.input.charCodeAt(r+2)&&(r+=3,a=e.input.charCodeAt(r),a===0||ne(a)))}function pt(e,r){r===1?e.result+=" ":r>1&&(e.result+=Q.repeat(`
10
- `,r-1))}function Eo(e,r,a){var l,n,i,o,d,c,h,p,u=e.kind,m=e.result,s;if(s=e.input.charCodeAt(e.position),ne(s)||be(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(n=e.input.charCodeAt(e.position+1),ne(n)||a&&be(n)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,d=!1;s!==0;){if(s===58){if(n=e.input.charCodeAt(e.position+1),ne(n)||a&&be(n))break}else if(s===35){if(l=e.input.charCodeAt(e.position-1),ne(l))break}else{if(e.position===e.lineStart&&Le(e)||a&&be(s))break;if(se(s))if(c=e.line,h=e.lineStart,p=e.lineIndent,W(e,!1,-1),e.lineIndent>=r){d=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=h,e.lineIndent=p;break}}d&&(ge(e,i,o,!1),pt(e,e.line-c),i=o=e.position,d=!1),ye(s)||(o=e.position+1),s=e.input.charCodeAt(++e.position)}return ge(e,i,o,!1),e.result?!0:(e.kind=u,e.result=m,!1)}function qo(e,r){var a,l,n;if(a=e.input.charCodeAt(e.position),a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,l=n=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(ge(e,l,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)l=e.position,e.position++,n=e.position;else return!0;else se(a)?(ge(e,l,n,!0),pt(e,W(e,!1,r)),l=n=e.position):e.position===e.lineStart&&Le(e)?q(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);q(e,"unexpected end of the stream within a single quoted scalar")}function vo(e,r){var a,l,n,i,o,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,a=l=e.position;(d=e.input.charCodeAt(e.position))!==0;){if(d===34)return ge(e,a,e.position,!0),e.position++,!0;if(d===92){if(ge(e,a,e.position,!0),d=e.input.charCodeAt(++e.position),se(d))W(e,!1,r);else if(d<256&&ga[d])e.result+=ya[d],e.position++;else if((o=Io(d))>0){for(n=o,i=0;n>0;n--)d=e.input.charCodeAt(++e.position),(o=Bo(d))>=0?i=(i<<4)+o:q(e,"expected hexadecimal character");e.result+=Ao(i),e.position++}else q(e,"unknown escape sequence");a=l=e.position}else se(d)?(ge(e,a,l,!0),pt(e,W(e,!1,r)),a=l=e.position):e.position===e.lineStart&&Le(e)?q(e,"unexpected end of the document within a double quoted scalar"):(e.position++,l=e.position)}q(e,"unexpected end of the stream within a double quoted scalar")}function Fo(e,r){var a=!0,l,n,i,o=e.tag,d,c=e.anchor,h,p,u,m,s,S=Object.create(null),_,g,x,T;if(T=e.input.charCodeAt(e.position),T===91)p=93,s=!1,d=[];else if(T===123)p=125,s=!0,d={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),T=e.input.charCodeAt(++e.position);T!==0;){if(W(e,!0,r),T=e.input.charCodeAt(e.position),T===p)return e.position++,e.tag=o,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=d,!0;a?T===44&&q(e,"expected the node content, but found ','"):q(e,"missed comma between flow collection entries"),g=_=x=null,u=m=!1,T===63&&(h=e.input.charCodeAt(e.position+1),ne(h)&&(u=m=!0,e.position++,W(e,!0,r))),l=e.line,n=e.lineStart,i=e.position,Se(e,r,Me,!1,!0),g=e.tag,_=e.result,W(e,!0,r),T=e.input.charCodeAt(e.position),(m||e.line===l)&&T===58&&(u=!0,T=e.input.charCodeAt(++e.position),W(e,!0,r),Se(e,r,Me,!1,!0),x=e.result),s?we(e,d,S,g,_,x,l,n,i):u?d.push(we(e,null,S,g,_,x,l,n,i)):d.push(_),W(e,!0,r),T=e.input.charCodeAt(e.position),T===44?(a=!0,T=e.input.charCodeAt(++e.position)):a=!1}q(e,"unexpected end of the stream within a flow collection")}function Oo(e,r){var a,l,n=dt,i=!1,o=!1,d=r,c=0,h=!1,p,u;if(u=e.input.charCodeAt(e.position),u===124)l=!1;else if(u===62)l=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)dt===n?n=u===43?ha:_o:q(e,"repeat of a chomping mode identifier");else if((p=To(u))>=0)p===0?q(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?q(e,"repeat of an indentation width identifier"):(d=r+p-1,o=!0);else break;if(ye(u)){do u=e.input.charCodeAt(++e.position);while(ye(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!se(u)&&u!==0)}for(;u!==0;){for(ht(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<d)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>d&&(d=e.lineIndent),se(u)){c++;continue}if(e.lineIndent<d){n===ha?e.result+=Q.repeat(`
11
- `,i?1+c:c):n===dt&&i&&(e.result+=`
12
- `);break}for(l?ye(u)?(h=!0,e.result+=Q.repeat(`
13
- `,i?1+c:c)):h?(h=!1,e.result+=Q.repeat(`
14
- `,c+1)):c===0?i&&(e.result+=" "):e.result+=Q.repeat(`
3
+ `+e.mark.snippet),l+" "+a):l}function He(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=Rt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}He.prototype=Object.create(Error.prototype),He.prototype.constructor=He,He.prototype.toString=function(e){return this.name+": "+Rt(this,e)};var le=He;function st(e,r,a,l,n){var o="",i="",d=Math.floor(n/2)-1;return l-r>d&&(o=" ... ",r=l-d+o.length),a-l>d&&(i=" ...",a=l+d-i.length),{str:o+e.slice(r,a).replace(/\t/g,"→")+i,pos:l-r+o.length}}function ct(e,r){return Q.repeat(" ",r-e.length)+e}function Fn(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var a=/\r?\n|\r|\0/g,l=[0],n=[],o,i=-1;o=a.exec(e.buffer);)n.push(o.index),l.push(o.index+o[0].length),e.position<=o.index&&i<0&&(i=l.length-2);i<0&&(i=l.length-1);var d="",c,p,h=Math.min(e.line+r.linesAfter,n.length).toString().length,u=r.maxLength-(r.indent+h+3);for(c=1;c<=r.linesBefore&&!(i-c<0);c++)p=st(e.buffer,l[i-c],n[i-c],e.position-(l[i]-l[i-c]),u),d=Q.repeat(" ",r.indent)+ct((e.line-c+1).toString(),h)+" | "+p.str+`
4
+ `+d;for(p=st(e.buffer,l[i],n[i],e.position,u),d+=Q.repeat(" ",r.indent)+ct((e.line+1).toString(),h)+" | "+p.str+`
5
+ `,d+=Q.repeat("-",r.indent+h+3+p.pos)+`^
6
+ `,c=1;c<=r.linesAfter&&!(i+c>=n.length);c++)p=st(e.buffer,l[i+c],n[i+c],e.position-(l[i]-l[i+c]),u),d+=Q.repeat(" ",r.indent)+ct((e.line+c+1).toString(),h)+" | "+p.str+`
7
+ `;return d.replace(/\n$/,"")}var Un=Fn,Dn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Mn=["scalar","sequence","mapping"];function jn(e){var r={};return e!==null&&Object.keys(e).forEach(function(a){e[a].forEach(function(l){r[String(l)]=a})}),r}function Kn(e,r){if(r=r||{},Object.keys(r).forEach(function(a){if(Dn.indexOf(a)===-1)throw new le('Unknown option "'+a+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(a){return a},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=jn(r.styleAliases||null),Mn.indexOf(this.kind)===-1)throw new le('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var G=Kn;function zt(e,r){var a=[];return e[r].forEach(function(l){var n=a.length;a.forEach(function(o,i){o.tag===l.tag&&o.kind===l.kind&&o.multi===l.multi&&(n=i)}),a[n]=l}),a}function Ln(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,a;function l(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(r=0,a=arguments.length;r<a;r+=1)arguments[r].forEach(l);return e}function dt(e){return this.extend(e)}dt.prototype.extend=function(e){var r=[],a=[];if(e instanceof G)a.push(e);else if(Array.isArray(e))a=a.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(a=a.concat(e.explicit));else throw new le("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(n){if(!(n instanceof G))throw new le("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new le("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new le("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),a.forEach(function(n){if(!(n instanceof G))throw new le("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(dt.prototype);return l.implicit=(this.implicit||[]).concat(r),l.explicit=(this.explicit||[]).concat(a),l.compiledImplicit=zt(l,"implicit"),l.compiledExplicit=zt(l,"explicit"),l.compiledTypeMap=Ln(l.compiledImplicit,l.compiledExplicit),l};var Jt=dt,Wt=new G("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Qt=new G("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Yt=new G("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Zt=new Jt({explicit:[Wt,Qt,Yt]});function Pn(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Rn(){return null}function zn(e){return e===null}var Gt=new G("tag:yaml.org,2002:null",{kind:"scalar",resolve:Pn,construct:Rn,predicate:zn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Jn(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Wn(e){return e==="true"||e==="True"||e==="TRUE"}function Qn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Xt=new G("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Jn,construct:Wn,predicate:Qn,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 Yn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Zn(e){return 48<=e&&e<=55}function Gn(e){return 48<=e&&e<=57}function Xn(e){if(e===null)return!1;var r=e.length,a=0,l=!1,n;if(!r)return!1;if(n=e[a],(n==="-"||n==="+")&&(n=e[++a]),n==="0"){if(a+1===r)return!0;if(n=e[++a],n==="b"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(n!=="0"&&n!=="1")return!1;l=!0}return l&&n!=="_"}if(n==="x"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Yn(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}if(n==="o"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Zn(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}}if(n==="_")return!1;for(;a<r;a++)if(n=e[a],n!=="_"){if(!Gn(e.charCodeAt(a)))return!1;l=!0}return!(!l||n==="_")}function eo(e){var r=e,a=1,l;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),l=r[0],(l==="-"||l==="+")&&(l==="-"&&(a=-1),r=r.slice(1),l=r[0]),r==="0")return 0;if(l==="0"){if(r[1]==="b")return a*parseInt(r.slice(2),2);if(r[1]==="x")return a*parseInt(r.slice(2),16);if(r[1]==="o")return a*parseInt(r.slice(2),8)}return a*parseInt(r,10)}function to(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Q.isNegativeZero(e)}var ea=new G("tag:yaml.org,2002:int",{kind:"scalar",resolve:Xn,construct:eo,predicate:to,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"]}}),ao=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ro(e){return!(e===null||!ao.test(e)||e[e.length-1]==="_")}function lo(e){var r,a;return r=e.replace(/_/g,"").toLowerCase(),a=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:a*parseFloat(r,10)}var no=/^[-+]?[0-9]+e/;function oo(e,r){var a;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Q.isNegativeZero(e))return"-0.0";return a=e.toString(10),no.test(a)?a.replace("e",".e"):a}function io(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Q.isNegativeZero(e))}var ta=new G("tag:yaml.org,2002:float",{kind:"scalar",resolve:ro,construct:lo,predicate:io,represent:oo,defaultStyle:"lowercase"}),aa=Zt.extend({implicit:[Gt,Xt,ea,ta]}),ra=aa,la=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),na=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 so(e){return e===null?!1:la.exec(e)!==null||na.exec(e)!==null}function co(e){var r,a,l,n,o,i,d,c=0,p=null,h,u,f;if(r=la.exec(e),r===null&&(r=na.exec(e)),r===null)throw new Error("Date resolve error");if(a=+r[1],l=+r[2]-1,n=+r[3],!r[4])return new Date(Date.UTC(a,l,n));if(o=+r[4],i=+r[5],d=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(h=+r[10],u=+(r[11]||0),p=(h*60+u)*6e4,r[9]==="-"&&(p=-p)),f=new Date(Date.UTC(a,l,n,o,i,d,c)),p&&f.setTime(f.getTime()-p),f}function ho(e){return e.toISOString()}var oa=new G("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:so,construct:co,instanceOf:Date,represent:ho});function po(e){return e==="<<"||e===null}var ia=new G("tag:yaml.org,2002:merge",{kind:"scalar",resolve:po}),ht=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
+ \r`;function uo(e){if(e===null)return!1;var r,a,l=0,n=e.length,o=ht;for(a=0;a<n;a++)if(r=o.indexOf(e.charAt(a)),!(r>64)){if(r<0)return!1;l+=6}return l%8===0}function fo(e){var r,a,l=e.replace(/[\r\n=]/g,""),n=l.length,o=ht,i=0,d=[];for(r=0;r<n;r++)r%4===0&&r&&(d.push(i>>16&255),d.push(i>>8&255),d.push(i&255)),i=i<<6|o.indexOf(l.charAt(r));return a=n%4*6,a===0?(d.push(i>>16&255),d.push(i>>8&255),d.push(i&255)):a===18?(d.push(i>>10&255),d.push(i>>2&255)):a===12&&d.push(i>>4&255),new Uint8Array(d)}function mo(e){var r="",a=0,l,n,o=e.length,i=ht;for(l=0;l<o;l++)l%3===0&&l&&(r+=i[a>>18&63],r+=i[a>>12&63],r+=i[a>>6&63],r+=i[a&63]),a=(a<<8)+e[l];return n=o%3,n===0?(r+=i[a>>18&63],r+=i[a>>12&63],r+=i[a>>6&63],r+=i[a&63]):n===2?(r+=i[a>>10&63],r+=i[a>>4&63],r+=i[a<<2&63],r+=i[64]):n===1&&(r+=i[a>>2&63],r+=i[a<<4&63],r+=i[64],r+=i[64]),r}function go(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var sa=new G("tag:yaml.org,2002:binary",{kind:"scalar",resolve:uo,construct:fo,predicate:go,represent:mo}),yo=Object.prototype.hasOwnProperty,ko=Object.prototype.toString;function bo(e){if(e===null)return!0;var r=[],a,l,n,o,i,d=e;for(a=0,l=d.length;a<l;a+=1){if(n=d[a],i=!1,ko.call(n)!=="[object Object]")return!1;for(o in n)if(yo.call(n,o))if(!i)i=!0;else return!1;if(!i)return!1;if(r.indexOf(o)===-1)r.push(o);else return!1}return!0}function Co(e){return e!==null?e:[]}var ca=new G("tag:yaml.org,2002:omap",{kind:"sequence",resolve:bo,construct:Co}),wo=Object.prototype.toString;function _o(e){if(e===null)return!0;var r,a,l,n,o,i=e;for(o=new Array(i.length),r=0,a=i.length;r<a;r+=1){if(l=i[r],wo.call(l)!=="[object Object]"||(n=Object.keys(l),n.length!==1))return!1;o[r]=[n[0],l[n[0]]]}return!0}function So(e){if(e===null)return[];var r,a,l,n,o,i=e;for(o=new Array(i.length),r=0,a=i.length;r<a;r+=1)l=i[r],n=Object.keys(l),o[r]=[n[0],l[n[0]]];return o}var da=new G("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:_o,construct:So}),xo=Object.prototype.hasOwnProperty;function No(e){if(e===null)return!0;var r,a=e;for(r in a)if(xo.call(a,r)&&a[r]!==null)return!1;return!0}function Vo(e){return e!==null?e:{}}var ha=new G("tag:yaml.org,2002:set",{kind:"mapping",resolve:No,construct:Vo}),pt=ra.extend({implicit:[oa,ia],explicit:[sa,ca,da,ha]}),ge=Object.prototype.hasOwnProperty,Le=1,pa=2,ua=3,Pe=4,ut=1,Bo=2,fa=3,Io=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,To=/[\x85\u2028\u2029]/,Ao=/[,\[\]\{\}]/,ma=/^(?:!|!!|![a-z\-]+!)$/i,ga=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ya(e){return Object.prototype.toString.call(e)}function ce(e){return e===10||e===13}function ke(e){return e===9||e===32}function oe(e){return e===9||e===32||e===10||e===13}function Ce(e){return e===44||e===91||e===93||e===123||e===125}function Eo(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Ho(e){return e===120?2:e===117?4:e===85?8:0}function vo(e){return 48<=e&&e<=57?e-48:-1}function ka(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 $o(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ba=new Array(256),Ca=new Array(256),we=0;we<256;we++)ba[we]=ka(we)?1:0,Ca[we]=ka(we);function qo(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||pt,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.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 wa(e,r){var a={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return a.snippet=Un(a),new le(r,a)}function v(e,r){throw wa(e,r)}function Re(e,r){e.onWarning&&e.onWarning.call(null,wa(e,r))}var _a={YAML:function(e,r,a){var l,n,o;e.version!==null&&v(e,"duplication of %YAML directive"),a.length!==1&&v(e,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(a[0]),l===null&&v(e,"ill-formed argument of the YAML directive"),n=parseInt(l[1],10),o=parseInt(l[2],10),n!==1&&v(e,"unacceptable YAML version of the document"),e.version=a[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Re(e,"unsupported YAML version of the document")},TAG:function(e,r,a){var l,n;a.length!==2&&v(e,"TAG directive accepts exactly two arguments"),l=a[0],n=a[1],ma.test(l)||v(e,"ill-formed tag handle (first argument) of the TAG directive"),ge.call(e.tagMap,l)&&v(e,'there is a previously declared suffix for "'+l+'" tag handle'),ga.test(n)||v(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{v(e,"tag prefix is malformed: "+n)}e.tagMap[l]=n}};function ye(e,r,a,l){var n,o,i,d;if(r<a){if(d=e.input.slice(r,a),l)for(n=0,o=d.length;n<o;n+=1)i=d.charCodeAt(n),i===9||32<=i&&i<=1114111||v(e,"expected valid JSON character");else Io.test(d)&&v(e,"the stream contains non-printable characters");e.result+=d}}function Sa(e,r,a,l){var n,o,i,d;for(Q.isObject(a)||v(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(a),i=0,d=n.length;i<d;i+=1)o=n[i],ge.call(r,o)||(r[o]=a[o],l[o]=!0)}function _e(e,r,a,l,n,o,i,d,c){var p,h;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),p=0,h=n.length;p<h;p+=1)Array.isArray(n[p])&&v(e,"nested arrays are not supported inside keys"),typeof n=="object"&&ya(n[p])==="[object Object]"&&(n[p]="[object Object]");if(typeof n=="object"&&ya(n)==="[object Object]"&&(n="[object Object]"),n=String(n),r===null&&(r={}),l==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(p=0,h=o.length;p<h;p+=1)Sa(e,r,o[p],a);else Sa(e,r,o,a);else!e.json&&!ge.call(a,n)&&ge.call(r,n)&&(e.line=i||e.line,e.lineStart=d||e.lineStart,e.position=c||e.position,v(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(r,n,{configurable:!0,enumerable:!0,writable:!0,value:o}):r[n]=o,delete a[n];return r}function ft(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):v(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function W(e,r,a){for(var l=0,n=e.input.charCodeAt(e.position);n!==0;){for(;ke(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(r&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(ce(n))for(ft(e),n=e.input.charCodeAt(e.position),l++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return a!==-1&&l!==0&&e.lineIndent<a&&Re(e,"deficient indentation"),l}function ze(e){var r=e.position,a;return a=e.input.charCodeAt(r),!!((a===45||a===46)&&a===e.input.charCodeAt(r+1)&&a===e.input.charCodeAt(r+2)&&(r+=3,a=e.input.charCodeAt(r),a===0||oe(a)))}function mt(e,r){r===1?e.result+=" ":r>1&&(e.result+=Q.repeat(`
10
+ `,r-1))}function Oo(e,r,a){var l,n,o,i,d,c,p,h,u=e.kind,f=e.result,s;if(s=e.input.charCodeAt(e.position),oe(s)||Ce(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(n=e.input.charCodeAt(e.position+1),oe(n)||a&&Ce(n)))return!1;for(e.kind="scalar",e.result="",o=i=e.position,d=!1;s!==0;){if(s===58){if(n=e.input.charCodeAt(e.position+1),oe(n)||a&&Ce(n))break}else if(s===35){if(l=e.input.charCodeAt(e.position-1),oe(l))break}else{if(e.position===e.lineStart&&ze(e)||a&&Ce(s))break;if(ce(s))if(c=e.line,p=e.lineStart,h=e.lineIndent,W(e,!1,-1),e.lineIndent>=r){d=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=i,e.line=c,e.lineStart=p,e.lineIndent=h;break}}d&&(ye(e,o,i,!1),mt(e,e.line-c),o=i=e.position,d=!1),ke(s)||(i=e.position+1),s=e.input.charCodeAt(++e.position)}return ye(e,o,i,!1),e.result?!0:(e.kind=u,e.result=f,!1)}function Fo(e,r){var a,l,n;if(a=e.input.charCodeAt(e.position),a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,l=n=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(ye(e,l,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)l=e.position,e.position++,n=e.position;else return!0;else ce(a)?(ye(e,l,n,!0),mt(e,W(e,!1,r)),l=n=e.position):e.position===e.lineStart&&ze(e)?v(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);v(e,"unexpected end of the stream within a single quoted scalar")}function Uo(e,r){var a,l,n,o,i,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,a=l=e.position;(d=e.input.charCodeAt(e.position))!==0;){if(d===34)return ye(e,a,e.position,!0),e.position++,!0;if(d===92){if(ye(e,a,e.position,!0),d=e.input.charCodeAt(++e.position),ce(d))W(e,!1,r);else if(d<256&&ba[d])e.result+=Ca[d],e.position++;else if((i=Ho(d))>0){for(n=i,o=0;n>0;n--)d=e.input.charCodeAt(++e.position),(i=Eo(d))>=0?o=(o<<4)+i:v(e,"expected hexadecimal character");e.result+=$o(o),e.position++}else v(e,"unknown escape sequence");a=l=e.position}else ce(d)?(ye(e,a,l,!0),mt(e,W(e,!1,r)),a=l=e.position):e.position===e.lineStart&&ze(e)?v(e,"unexpected end of the document within a double quoted scalar"):(e.position++,l=e.position)}v(e,"unexpected end of the stream within a double quoted scalar")}function Do(e,r){var a=!0,l,n,o,i=e.tag,d,c=e.anchor,p,h,u,f,s,b=Object.create(null),S,g,x,B;if(B=e.input.charCodeAt(e.position),B===91)h=93,s=!1,d=[];else if(B===123)h=125,s=!0,d={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),B=e.input.charCodeAt(++e.position);B!==0;){if(W(e,!0,r),B=e.input.charCodeAt(e.position),B===h)return e.position++,e.tag=i,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=d,!0;a?B===44&&v(e,"expected the node content, but found ','"):v(e,"missed comma between flow collection entries"),g=S=x=null,u=f=!1,B===63&&(p=e.input.charCodeAt(e.position+1),oe(p)&&(u=f=!0,e.position++,W(e,!0,r))),l=e.line,n=e.lineStart,o=e.position,Se(e,r,Le,!1,!0),g=e.tag,S=e.result,W(e,!0,r),B=e.input.charCodeAt(e.position),(f||e.line===l)&&B===58&&(u=!0,B=e.input.charCodeAt(++e.position),W(e,!0,r),Se(e,r,Le,!1,!0),x=e.result),s?_e(e,d,b,g,S,x,l,n,o):u?d.push(_e(e,null,b,g,S,x,l,n,o)):d.push(S),W(e,!0,r),B=e.input.charCodeAt(e.position),B===44?(a=!0,B=e.input.charCodeAt(++e.position)):a=!1}v(e,"unexpected end of the stream within a flow collection")}function Mo(e,r){var a,l,n=ut,o=!1,i=!1,d=r,c=0,p=!1,h,u;if(u=e.input.charCodeAt(e.position),u===124)l=!1;else if(u===62)l=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)ut===n?n=u===43?fa:Bo:v(e,"repeat of a chomping mode identifier");else if((h=vo(u))>=0)h===0?v(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):i?v(e,"repeat of an indentation width identifier"):(d=r+h-1,i=!0);else break;if(ke(u)){do u=e.input.charCodeAt(++e.position);while(ke(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ce(u)&&u!==0)}for(;u!==0;){for(ft(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!i||e.lineIndent<d)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!i&&e.lineIndent>d&&(d=e.lineIndent),ce(u)){c++;continue}if(e.lineIndent<d){n===fa?e.result+=Q.repeat(`
11
+ `,o?1+c:c):n===ut&&o&&(e.result+=`
12
+ `);break}for(l?ke(u)?(p=!0,e.result+=Q.repeat(`
13
+ `,o?1+c:c)):p?(p=!1,e.result+=Q.repeat(`
14
+ `,c+1)):c===0?o&&(e.result+=" "):e.result+=Q.repeat(`
15
15
  `,c):e.result+=Q.repeat(`
16
- `,i?1+c:c),i=!0,o=!0,c=0,a=e.position;!se(u)&&u!==0;)u=e.input.charCodeAt(++e.position);ge(e,a,e.position,!1)}return!0}function wa(e,r){var a,l=e.tag,n=e.anchor,i=[],o,d=!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,q(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!ne(o))));){if(d=!0,e.position++,W(e,!0,-1)&&e.lineIndent<=r){i.push(null),c=e.input.charCodeAt(e.position);continue}if(a=e.line,Se(e,r,da,!1,!0),i.push(e.result),W(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>r)&&c!==0)q(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return d?(e.tag=l,e.anchor=n,e.kind="sequence",e.result=i,!0):!1}function $o(e,r,a){var l,n,i,o,d,c,h=e.tag,p=e.anchor,u={},m=Object.create(null),s=null,S=null,_=null,g=!1,x=!1,T;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),T=e.input.charCodeAt(e.position);T!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,q(e,"tab characters must not be used in indentation")),l=e.input.charCodeAt(e.position+1),i=e.line,(T===63||T===58)&&ne(l))T===63?(g&&(we(e,u,m,s,S,null,o,d,c),s=S=_=null),x=!0,g=!0,n=!0):g?(g=!1,n=!0):q(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,T=l;else{if(o=e.line,d=e.lineStart,c=e.position,!Se(e,a,ca,!1,!0))break;if(e.line===i){for(T=e.input.charCodeAt(e.position);ye(T);)T=e.input.charCodeAt(++e.position);if(T===58)T=e.input.charCodeAt(++e.position),ne(T)||q(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(we(e,u,m,s,S,null,o,d,c),s=S=_=null),x=!0,g=!1,n=!1,s=e.tag,S=e.result;else if(x)q(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=p,!0}else if(x)q(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=h,e.anchor=p,!0}if((e.line===i||e.lineIndent>r)&&(g&&(o=e.line,d=e.lineStart,c=e.position),Se(e,r,je,!0,n)&&(g?S=e.result:_=e.result),g||(we(e,u,m,s,S,_,o,d,c),s=S=_=null),W(e,!0,-1),T=e.input.charCodeAt(e.position)),(e.line===i||e.lineIndent>r)&&T!==0)q(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return g&&we(e,u,m,s,S,null,o,d,c),x&&(e.tag=h,e.anchor=p,e.kind="mapping",e.result=u),x}function Uo(e){var r,a=!1,l=!1,n,i,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&q(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(a=!0,o=e.input.charCodeAt(++e.position)):o===33?(l=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",r=e.position,a){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(i=e.input.slice(r,e.position),o=e.input.charCodeAt(++e.position)):q(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!ne(o);)o===33&&(l?q(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(r-1,e.position+1),pa.test(n)||q(e,"named tag handle cannot contain such characters"),l=!0,r=e.position+1)),o=e.input.charCodeAt(++e.position);i=e.input.slice(r,e.position),Vo.test(i)&&q(e,"tag suffix cannot contain flow indicator characters")}i&&!ua.test(i)&&q(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{q(e,"tag name is malformed: "+i)}return a?e.tag=i:me.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:n==="!"?e.tag="!"+i:n==="!!"?e.tag="tag:yaml.org,2002:"+i:q(e,'undeclared tag handle "'+n+'"'),!0}function Do(e){var r,a;if(a=e.input.charCodeAt(e.position),a!==38)return!1;for(e.anchor!==null&&q(e,"duplication of an anchor property"),a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!ne(a)&&!be(a);)a=e.input.charCodeAt(++e.position);return e.position===r&&q(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function Mo(e){var r,a,l;if(l=e.input.charCodeAt(e.position),l!==42)return!1;for(l=e.input.charCodeAt(++e.position),r=e.position;l!==0&&!ne(l)&&!be(l);)l=e.input.charCodeAt(++e.position);return e.position===r&&q(e,"name of an alias node must contain at least one character"),a=e.input.slice(r,e.position),me.call(e.anchorMap,a)||q(e,'unidentified alias "'+a+'"'),e.result=e.anchorMap[a],W(e,!0,-1),!0}function Se(e,r,a,l,n){var i,o,d,c=1,h=!1,p=!1,u,m,s,S,_,g;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=o=d=je===a||da===a,l&&W(e,!0,-1)&&(h=!0,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)),c===1)for(;Uo(e)||Do(e);)W(e,!0,-1)?(h=!0,d=i,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)):d=!1;if(d&&(d=h||n),(c===1||je===a)&&(Me===a||ca===a?_=r:_=r+1,g=e.position-e.lineStart,c===1?d&&(wa(e,g)||$o(e,g,_))||Fo(e,_)?p=!0:(o&&Oo(e,_)||qo(e,_)||vo(e,_)?p=!0:Mo(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&q(e,"alias node should not have any properties")):Eo(e,_,Me===a)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=d&&wa(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&q(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,m=e.implicitTypes.length;u<m;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(me.call(e.typeMap[e.kind||"fallback"],e.tag))S=e.typeMap[e.kind||"fallback"][e.tag];else for(S=null,s=e.typeMap.multi[e.kind||"fallback"],u=0,m=s.length;u<m;u+=1)if(e.tag.slice(0,s[u].tag.length)===s[u].tag){S=s[u];break}S||q(e,"unknown tag !<"+e.tag+">"),e.result!==null&&S.kind!==e.kind&&q(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)):q(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 jo(e){var r=e.position,a,l,n,i=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(W(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(i=!0,o=e.input.charCodeAt(++e.position),a=e.position;o!==0&&!ne(o);)o=e.input.charCodeAt(++e.position);for(l=e.input.slice(a,e.position),n=[],l.length<1&&q(e,"directive name must not be less than one character in length");o!==0;){for(;ye(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!se(o));break}if(se(o))break;for(a=e.position;o!==0&&!ne(o);)o=e.input.charCodeAt(++e.position);n.push(e.input.slice(a,e.position))}o!==0&&ht(e),me.call(ba,l)?ba[l](e,l,n):Ke(e,'unknown document directive "'+l+'"')}if(W(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,W(e,!0,-1)):i&&q(e,"directives end mark is expected"),Se(e,e.lineIndent-1,je,!1,!0),W(e,!0,-1),e.checkLineBreaks&&No.test(e.input.slice(r,e.position))&&Ke(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Le(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,W(e,!0,-1));return}if(e.position<e.length-1)q(e,"end of the stream or a document separator is expected");else return}function Sa(e,r){e=String(e),r=r||{},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 a=new Ho(e,r),l=e.indexOf("\0");for(l!==-1&&(a.position=l,q(a,"null byte is not allowed in input")),a.input+="\0";a.input.charCodeAt(a.position)===32;)a.lineIndent+=1,a.position+=1;for(;a.position<a.length-1;)jo(a);return a.documents}function Ko(e,r,a){r!==null&&typeof r=="object"&&typeof a>"u"&&(a=r,r=null);var l=Sa(e,a);if(typeof r!="function")return l;for(var n=0,i=l.length;n<i;n+=1)r(l[n])}function Lo(e,r){var a=Sa(e,r);if(a.length!==0){if(a.length===1)return a[0];throw new le("expected a single document in the stream, but found more")}}var Po=Ko,Ro=Lo,_a={loadAll:Po,load:Ro},xa=Object.prototype.toString,Na=Object.prototype.hasOwnProperty,ut=65279,zo=9,He=10,Jo=13,Wo=32,Qo=33,Zo=34,ft=35,Yo=37,Go=38,Xo=39,ei=42,Va=44,ti=45,Pe=58,ai=61,ri=62,li=63,ni=64,Ba=91,Ia=93,oi=96,Ta=123,ii=124,Aa=125,te={};te[0]="\\0",te[7]="\\a",te[8]="\\b",te[9]="\\t",te[10]="\\n",te[11]="\\v",te[12]="\\f",te[13]="\\r",te[27]="\\e",te[34]='\\"',te[92]="\\\\",te[133]="\\N",te[160]="\\_",te[8232]="\\L",te[8233]="\\P";var si=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ci=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function di(e,r){var a,l,n,i,o,d,c;if(r===null)return{};for(a={},l=Object.keys(r),n=0,i=l.length;n<i;n+=1)o=l[n],d=String(r[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&Na.call(c.styleAliases,d)&&(d=c.styleAliases[d]),a[o]=d;return a}function hi(e){var r,a,l;if(r=e.toString(16).toUpperCase(),e<=255)a="x",l=2;else if(e<=65535)a="u",l=4;else if(e<=4294967295)a="U",l=8;else throw new le("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+Q.repeat("0",l-r.length)+r}var pi=1,Ee=2;function ui(e){this.schema=e.schema||ct,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Q.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=di(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==='"'?Ee:pi,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 Ha(e,r){for(var a=Q.repeat(" ",r),l=0,n=-1,i="",o,d=e.length;l<d;)n=e.indexOf(`
18
- `,l),n===-1?(o=e.slice(l),l=d):(o=e.slice(l,n+1),l=n+1),o.length&&o!==`
19
- `&&(i+=a),i+=o;return i}function mt(e,r){return`
20
- `+Q.repeat(" ",e.indent*r)}function fi(e,r){var a,l,n;for(a=0,l=e.implicitTypes.length;a<l;a+=1)if(n=e.implicitTypes[a],n.resolve(r))return!0;return!1}function Re(e){return e===Wo||e===zo}function qe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ut||65536<=e&&e<=1114111}function Ea(e){return qe(e)&&e!==ut&&e!==Jo&&e!==He}function qa(e,r,a){var l=Ea(e),n=l&&!Re(e);return(a?l:l&&e!==Va&&e!==Ba&&e!==Ia&&e!==Ta&&e!==Aa)&&e!==ft&&!(r===Pe&&!n)||Ea(r)&&!Re(r)&&e===ft||r===Pe&&n}function mi(e){return qe(e)&&e!==ut&&!Re(e)&&e!==ti&&e!==li&&e!==Pe&&e!==Va&&e!==Ba&&e!==Ia&&e!==Ta&&e!==Aa&&e!==ft&&e!==Go&&e!==ei&&e!==Qo&&e!==ii&&e!==ai&&e!==ri&&e!==Xo&&e!==Zo&&e!==Yo&&e!==ni&&e!==oi}function gi(e){return!Re(e)&&e!==Pe}function ve(e,r){var a=e.charCodeAt(r),l;return a>=55296&&a<=56319&&r+1<e.length&&(l=e.charCodeAt(r+1),l>=56320&&l<=57343)?(a-55296)*1024+l-56320+65536:a}function va(e){var r=/^\n* /;return r.test(e)}var Fa=1,gt=2,Oa=3,$a=4,_e=5;function yi(e,r,a,l,n,i,o,d){var c,h=0,p=null,u=!1,m=!1,s=l!==-1,S=-1,_=mi(ve(e,0))&&gi(ve(e,e.length-1));if(r||o)for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=ve(e,c),!qe(h))return _e;_=_&&qa(h,p,d),p=h}else{for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=ve(e,c),h===He)u=!0,s&&(m=m||c-S-1>l&&e[S+1]!==" ",S=c);else if(!qe(h))return _e;_=_&&qa(h,p,d),p=h}m=m||s&&c-S-1>l&&e[S+1]!==" "}return!u&&!m?_&&!o&&!n(e)?Fa:i===Ee?_e:gt:a>9&&va(e)?_e:o?i===Ee?_e:gt:m?$a:Oa}function ki(e,r,a,l,n){e.dump=function(){if(r.length===0)return e.quotingType===Ee?'""':"''";if(!e.noCompatMode&&(si.indexOf(r)!==-1||ci.test(r)))return e.quotingType===Ee?'"'+r+'"':"'"+r+"'";var i=e.indent*Math.max(1,a),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),d=l||e.flowLevel>-1&&a>=e.flowLevel;function c(h){return fi(e,h)}switch(yi(r,d,e.indent,o,c,e.quotingType,e.forceQuotes&&!l,n)){case Fa:return r;case gt:return"'"+r.replace(/'/g,"''")+"'";case Oa:return"|"+Ua(r,e.indent)+Da(Ha(r,i));case $a:return">"+Ua(r,e.indent)+Da(Ha(bi(r,o),i));case _e:return'"'+Ci(r)+'"';default:throw new le("impossible error: invalid scalar style")}}()}function Ua(e,r){var a=va(e)?String(r):"",l=e[e.length-1]===`
16
+ `,o?1+c:c),o=!0,i=!0,c=0,a=e.position;!ce(u)&&u!==0;)u=e.input.charCodeAt(++e.position);ye(e,a,e.position,!1)}return!0}function xa(e,r){var a,l=e.tag,n=e.anchor,o=[],i,d=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),!(c!==45||(i=e.input.charCodeAt(e.position+1),!oe(i))));){if(d=!0,e.position++,W(e,!0,-1)&&e.lineIndent<=r){o.push(null),c=e.input.charCodeAt(e.position);continue}if(a=e.line,Se(e,r,ua,!1,!0),o.push(e.result),W(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>r)&&c!==0)v(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return d?(e.tag=l,e.anchor=n,e.kind="sequence",e.result=o,!0):!1}function jo(e,r,a){var l,n,o,i,d,c,p=e.tag,h=e.anchor,u={},f=Object.create(null),s=null,b=null,S=null,g=!1,x=!1,B;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),B=e.input.charCodeAt(e.position);B!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),l=e.input.charCodeAt(e.position+1),o=e.line,(B===63||B===58)&&oe(l))B===63?(g&&(_e(e,u,f,s,b,null,i,d,c),s=b=S=null),x=!0,g=!0,n=!0):g?(g=!1,n=!0):v(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,B=l;else{if(i=e.line,d=e.lineStart,c=e.position,!Se(e,a,pa,!1,!0))break;if(e.line===o){for(B=e.input.charCodeAt(e.position);ke(B);)B=e.input.charCodeAt(++e.position);if(B===58)B=e.input.charCodeAt(++e.position),oe(B)||v(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(_e(e,u,f,s,b,null,i,d,c),s=b=S=null),x=!0,g=!1,n=!1,s=e.tag,b=e.result;else if(x)v(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=p,e.anchor=h,!0}else if(x)v(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=p,e.anchor=h,!0}if((e.line===o||e.lineIndent>r)&&(g&&(i=e.line,d=e.lineStart,c=e.position),Se(e,r,Pe,!0,n)&&(g?b=e.result:S=e.result),g||(_e(e,u,f,s,b,S,i,d,c),s=b=S=null),W(e,!0,-1),B=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>r)&&B!==0)v(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return g&&_e(e,u,f,s,b,null,i,d,c),x&&(e.tag=p,e.anchor=h,e.kind="mapping",e.result=u),x}function Ko(e){var r,a=!1,l=!1,n,o,i;if(i=e.input.charCodeAt(e.position),i!==33)return!1;if(e.tag!==null&&v(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),i===60?(a=!0,i=e.input.charCodeAt(++e.position)):i===33?(l=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",r=e.position,a){do i=e.input.charCodeAt(++e.position);while(i!==0&&i!==62);e.position<e.length?(o=e.input.slice(r,e.position),i=e.input.charCodeAt(++e.position)):v(e,"unexpected end of the stream within a verbatim tag")}else{for(;i!==0&&!oe(i);)i===33&&(l?v(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(r-1,e.position+1),ma.test(n)||v(e,"named tag handle cannot contain such characters"),l=!0,r=e.position+1)),i=e.input.charCodeAt(++e.position);o=e.input.slice(r,e.position),Ao.test(o)&&v(e,"tag suffix cannot contain flow indicator characters")}o&&!ga.test(o)&&v(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{v(e,"tag name is malformed: "+o)}return a?e.tag=o:ge.call(e.tagMap,n)?e.tag=e.tagMap[n]+o:n==="!"?e.tag="!"+o:n==="!!"?e.tag="tag:yaml.org,2002:"+o:v(e,'undeclared tag handle "'+n+'"'),!0}function Lo(e){var r,a;if(a=e.input.charCodeAt(e.position),a!==38)return!1;for(e.anchor!==null&&v(e,"duplication of an anchor property"),a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!oe(a)&&!Ce(a);)a=e.input.charCodeAt(++e.position);return e.position===r&&v(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function Po(e){var r,a,l;if(l=e.input.charCodeAt(e.position),l!==42)return!1;for(l=e.input.charCodeAt(++e.position),r=e.position;l!==0&&!oe(l)&&!Ce(l);)l=e.input.charCodeAt(++e.position);return e.position===r&&v(e,"name of an alias node must contain at least one character"),a=e.input.slice(r,e.position),ge.call(e.anchorMap,a)||v(e,'unidentified alias "'+a+'"'),e.result=e.anchorMap[a],W(e,!0,-1),!0}function Se(e,r,a,l,n){var o,i,d,c=1,p=!1,h=!1,u,f,s,b,S,g;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=i=d=Pe===a||ua===a,l&&W(e,!0,-1)&&(p=!0,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)),c===1)for(;Ko(e)||Lo(e);)W(e,!0,-1)?(p=!0,d=o,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)):d=!1;if(d&&(d=p||n),(c===1||Pe===a)&&(Le===a||pa===a?S=r:S=r+1,g=e.position-e.lineStart,c===1?d&&(xa(e,g)||jo(e,g,S))||Do(e,S)?h=!0:(i&&Mo(e,S)||Fo(e,S)||Uo(e,S)?h=!0:Po(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&v(e,"alias node should not have any properties")):Oo(e,S,Le===a)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(h=d&&xa(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&v(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u<f;u+=1)if(b=e.implicitTypes[u],b.resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ge.call(e.typeMap[e.kind||"fallback"],e.tag))b=e.typeMap[e.kind||"fallback"][e.tag];else for(b=null,s=e.typeMap.multi[e.kind||"fallback"],u=0,f=s.length;u<f;u+=1)if(e.tag.slice(0,s[u].tag.length)===s[u].tag){b=s[u];break}b||v(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&v(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):v(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}function Ro(e){var r=e.position,a,l,n,o=!1,i;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(i=e.input.charCodeAt(e.position))!==0&&(W(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||i!==37));){for(o=!0,i=e.input.charCodeAt(++e.position),a=e.position;i!==0&&!oe(i);)i=e.input.charCodeAt(++e.position);for(l=e.input.slice(a,e.position),n=[],l.length<1&&v(e,"directive name must not be less than one character in length");i!==0;){for(;ke(i);)i=e.input.charCodeAt(++e.position);if(i===35){do i=e.input.charCodeAt(++e.position);while(i!==0&&!ce(i));break}if(ce(i))break;for(a=e.position;i!==0&&!oe(i);)i=e.input.charCodeAt(++e.position);n.push(e.input.slice(a,e.position))}i!==0&&ft(e),ge.call(_a,l)?_a[l](e,l,n):Re(e,'unknown document directive "'+l+'"')}if(W(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,W(e,!0,-1)):o&&v(e,"directives end mark is expected"),Se(e,e.lineIndent-1,Pe,!1,!0),W(e,!0,-1),e.checkLineBreaks&&To.test(e.input.slice(r,e.position))&&Re(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ze(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,W(e,!0,-1));return}if(e.position<e.length-1)v(e,"end of the stream or a document separator is expected");else return}function Na(e,r){e=String(e),r=r||{},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 a=new qo(e,r),l=e.indexOf("\0");for(l!==-1&&(a.position=l,v(a,"null byte is not allowed in input")),a.input+="\0";a.input.charCodeAt(a.position)===32;)a.lineIndent+=1,a.position+=1;for(;a.position<a.length-1;)Ro(a);return a.documents}function zo(e,r,a){r!==null&&typeof r=="object"&&typeof a>"u"&&(a=r,r=null);var l=Na(e,a);if(typeof r!="function")return l;for(var n=0,o=l.length;n<o;n+=1)r(l[n])}function Jo(e,r){var a=Na(e,r);if(a.length!==0){if(a.length===1)return a[0];throw new le("expected a single document in the stream, but found more")}}var Wo=zo,Qo=Jo,Va={loadAll:Wo,load:Qo},Ba=Object.prototype.toString,Ia=Object.prototype.hasOwnProperty,gt=65279,Yo=9,ve=10,Zo=13,Go=32,Xo=33,ei=34,yt=35,ti=37,ai=38,ri=39,li=42,Ta=44,ni=45,Je=58,oi=61,ii=62,si=63,ci=64,Aa=91,Ea=93,di=96,Ha=123,hi=124,va=125,te={};te[0]="\\0",te[7]="\\a",te[8]="\\b",te[9]="\\t",te[10]="\\n",te[11]="\\v",te[12]="\\f",te[13]="\\r",te[27]="\\e",te[34]='\\"',te[92]="\\\\",te[133]="\\N",te[160]="\\_",te[8232]="\\L",te[8233]="\\P";var pi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ui=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function fi(e,r){var a,l,n,o,i,d,c;if(r===null)return{};for(a={},l=Object.keys(r),n=0,o=l.length;n<o;n+=1)i=l[n],d=String(r[i]),i.slice(0,2)==="!!"&&(i="tag:yaml.org,2002:"+i.slice(2)),c=e.compiledTypeMap.fallback[i],c&&Ia.call(c.styleAliases,d)&&(d=c.styleAliases[d]),a[i]=d;return a}function mi(e){var r,a,l;if(r=e.toString(16).toUpperCase(),e<=255)a="x",l=2;else if(e<=65535)a="u",l=4;else if(e<=4294967295)a="U",l=8;else throw new le("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+Q.repeat("0",l-r.length)+r}var gi=1,$e=2;function yi(e){this.schema=e.schema||pt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Q.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=fi(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==='"'?$e:gi,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 $a(e,r){for(var a=Q.repeat(" ",r),l=0,n=-1,o="",i,d=e.length;l<d;)n=e.indexOf(`
18
+ `,l),n===-1?(i=e.slice(l),l=d):(i=e.slice(l,n+1),l=n+1),i.length&&i!==`
19
+ `&&(o+=a),o+=i;return o}function kt(e,r){return`
20
+ `+Q.repeat(" ",e.indent*r)}function ki(e,r){var a,l,n;for(a=0,l=e.implicitTypes.length;a<l;a+=1)if(n=e.implicitTypes[a],n.resolve(r))return!0;return!1}function We(e){return e===Go||e===Yo}function qe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==gt||65536<=e&&e<=1114111}function qa(e){return qe(e)&&e!==gt&&e!==Zo&&e!==ve}function Oa(e,r,a){var l=qa(e),n=l&&!We(e);return(a?l:l&&e!==Ta&&e!==Aa&&e!==Ea&&e!==Ha&&e!==va)&&e!==yt&&!(r===Je&&!n)||qa(r)&&!We(r)&&e===yt||r===Je&&n}function bi(e){return qe(e)&&e!==gt&&!We(e)&&e!==ni&&e!==si&&e!==Je&&e!==Ta&&e!==Aa&&e!==Ea&&e!==Ha&&e!==va&&e!==yt&&e!==ai&&e!==li&&e!==Xo&&e!==hi&&e!==oi&&e!==ii&&e!==ri&&e!==ei&&e!==ti&&e!==ci&&e!==di}function Ci(e){return!We(e)&&e!==Je}function Oe(e,r){var a=e.charCodeAt(r),l;return a>=55296&&a<=56319&&r+1<e.length&&(l=e.charCodeAt(r+1),l>=56320&&l<=57343)?(a-55296)*1024+l-56320+65536:a}function Fa(e){var r=/^\n* /;return r.test(e)}var Ua=1,bt=2,Da=3,Ma=4,xe=5;function wi(e,r,a,l,n,o,i,d){var c,p=0,h=null,u=!1,f=!1,s=l!==-1,b=-1,S=bi(Oe(e,0))&&Ci(Oe(e,e.length-1));if(r||i)for(c=0;c<e.length;p>=65536?c+=2:c++){if(p=Oe(e,c),!qe(p))return xe;S=S&&Oa(p,h,d),h=p}else{for(c=0;c<e.length;p>=65536?c+=2:c++){if(p=Oe(e,c),p===ve)u=!0,s&&(f=f||c-b-1>l&&e[b+1]!==" ",b=c);else if(!qe(p))return xe;S=S&&Oa(p,h,d),h=p}f=f||s&&c-b-1>l&&e[b+1]!==" "}return!u&&!f?S&&!i&&!n(e)?Ua:o===$e?xe:bt:a>9&&Fa(e)?xe:i?o===$e?xe:bt:f?Ma:Da}function _i(e,r,a,l,n){e.dump=function(){if(r.length===0)return e.quotingType===$e?'""':"''";if(!e.noCompatMode&&(pi.indexOf(r)!==-1||ui.test(r)))return e.quotingType===$e?'"'+r+'"':"'"+r+"'";var o=e.indent*Math.max(1,a),i=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),d=l||e.flowLevel>-1&&a>=e.flowLevel;function c(p){return ki(e,p)}switch(wi(r,d,e.indent,i,c,e.quotingType,e.forceQuotes&&!l,n)){case Ua:return r;case bt:return"'"+r.replace(/'/g,"''")+"'";case Da:return"|"+ja(r,e.indent)+Ka($a(r,o));case Ma:return">"+ja(r,e.indent)+Ka($a(Si(r,i),o));case xe:return'"'+xi(r)+'"';default:throw new le("impossible error: invalid scalar style")}}()}function ja(e,r){var a=Fa(e)?String(r):"",l=e[e.length-1]===`
21
21
  `,n=l&&(e[e.length-2]===`
22
22
  `||e===`
23
- `),i=n?"+":l?"":"-";return a+i+`
24
- `}function Da(e){return e[e.length-1]===`
25
- `?e.slice(0,-1):e}function bi(e,r){for(var a=/(\n+)([^\n]*)/g,l=function(){var h=e.indexOf(`
26
- `);return h=h!==-1?h:e.length,a.lastIndex=h,Ma(e.slice(0,h),r)}(),n=e[0]===`
27
- `||e[0]===" ",i,o;o=a.exec(e);){var d=o[1],c=o[2];i=c[0]===" ",l+=d+(!n&&!i&&c!==""?`
28
- `:"")+Ma(c,r),n=i}return l}function Ma(e,r){if(e===""||e[0]===" ")return e;for(var a=/ [^ ]/g,l,n=0,i,o=0,d=0,c="";l=a.exec(e);)d=l.index,d-n>r&&(i=o>n?o:d,c+=`
29
- `+e.slice(n,i),n=i+1),o=d;return c+=`
30
- `,e.length-n>r&&o>n?c+=e.slice(n,o)+`
31
- `+e.slice(o+1):c+=e.slice(n),c.slice(1)}function Ci(e){for(var r="",a=0,l,n=0;n<e.length;a>=65536?n+=2:n++)a=ve(e,n),l=te[a],!l&&qe(a)?(r+=e[n],a>=65536&&(r+=e[n+1])):r+=l||hi(a);return r}function wi(e,r,a){var l="",n=e.tag,i,o,d;for(i=0,o=a.length;i<o;i+=1)d=a[i],e.replacer&&(d=e.replacer.call(a,String(i),d)),(de(e,r,d,!1,!1)||typeof d>"u"&&de(e,r,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=n,e.dump="["+l+"]"}function ja(e,r,a,l){var n="",i=e.tag,o,d,c;for(o=0,d=a.length;o<d;o+=1)c=a[o],e.replacer&&(c=e.replacer.call(a,String(o),c)),(de(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&de(e,r+1,null,!0,!0,!1,!0))&&((!l||n!=="")&&(n+=mt(e,r)),e.dump&&He===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function Si(e,r,a){var l="",n=e.tag,i=Object.keys(a),o,d,c,h,p;for(o=0,d=i.length;o<d;o+=1)p="",l!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[o],h=a[c],e.replacer&&(h=e.replacer.call(a,c,h)),de(e,r,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),de(e,r,h,!1,!1)&&(p+=e.dump,l+=p));e.tag=n,e.dump="{"+l+"}"}function _i(e,r,a,l){var n="",i=e.tag,o=Object.keys(a),d,c,h,p,u,m;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new le("sortKeys must be a boolean or a function");for(d=0,c=o.length;d<c;d+=1)m="",(!l||n!=="")&&(m+=mt(e,r)),h=o[d],p=a[h],e.replacer&&(p=e.replacer.call(a,h,p)),de(e,r+1,h,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&He===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,u&&(m+=mt(e,r)),de(e,r+1,p,!0,u)&&(e.dump&&He===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,n+=m));e.tag=i,e.dump=n||"{}"}function Ka(e,r,a){var l,n,i,o,d,c;for(n=a?e.explicitTypes:e.implicitTypes,i=0,o=n.length;i<o;i+=1)if(d=n[i],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof r=="object"&&r instanceof d.instanceOf)&&(!d.predicate||d.predicate(r))){if(a?d.multi&&d.representName?e.tag=d.representName(r):e.tag=d.tag:e.tag="?",d.represent){if(c=e.styleMap[d.tag]||d.defaultStyle,xa.call(d.represent)==="[object Function]")l=d.represent(r,c);else if(Na.call(d.represent,c))l=d.represent[c](r,c);else throw new le("!<"+d.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function de(e,r,a,l,n,i,o){e.tag=null,e.dump=a,Ka(e,a,!1)||Ka(e,a,!0);var d=xa.call(e.dump),c=l,h;l&&(l=e.flowLevel<0||e.flowLevel>r);var p=d==="[object Object]"||d==="[object Array]",u,m;if(p&&(u=e.duplicates.indexOf(a),m=u!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&r>0)&&(n=!1),m&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&m&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")l&&Object.keys(e.dump).length!==0?(_i(e,r,e.dump,n),m&&(e.dump="&ref_"+u+e.dump)):(Si(e,r,e.dump),m&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?ja(e,r-1,e.dump,n):ja(e,r,e.dump,n),m&&(e.dump="&ref_"+u+e.dump)):(wi(e,r,e.dump),m&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&ki(e,e.dump,r,i,c);else{if(d==="[object Undefined]"||e.skipInvalid)return!1;throw new le("unacceptable kind of an object to dump "+d)}e.tag!==null&&e.tag!=="?"&&(h=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",e.dump=h+" "+e.dump)}return!0}function xi(e,r){var a=[],l=[],n,i;for(yt(e,a,l),n=0,i=l.length;n<i;n+=1)r.duplicates.push(a[l[n]]);r.usedDuplicates=new Array(i)}function yt(e,r,a){var l,n,i;if(e!==null&&typeof e=="object")if(n=r.indexOf(e),n!==-1)a.indexOf(n)===-1&&a.push(n);else if(r.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)yt(e[n],r,a);else for(l=Object.keys(e),n=0,i=l.length;n<i;n+=1)yt(e[l[n]],r,a)}function Ni(e,r){r=r||{};var a=new ui(r);a.noRefs||xi(e,a);var l=e;return a.replacer&&(l=a.replacer.call({"":l},"",l)),de(a,0,l,!0,!0)?a.dump+`
32
- `:""}var Vi=Ni,Bi={dump:Vi};function kt(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var Ii=G,Ti=Pt,Ai=Wt,Hi=Xt,Ei=ea,qi=ct,vi=_a.load,Fi=_a.loadAll,Oi=Bi.dump,$i=le,Ui={binary:na,float:Gt,map:Jt,null:Qt,pairs:ia,set:sa,timestamp:ra,bool:Zt,int:Yt,merge:la,omap:oa,seq:zt,str:Rt},Di=kt("safeLoad","load"),Mi=kt("safeLoadAll","loadAll"),ji=kt("safeDump","dump"),Ki={Type:Ii,Schema:Ti,FAILSAFE_SCHEMA:Ai,JSON_SCHEMA:Hi,CORE_SCHEMA:Ei,DEFAULT_SCHEMA:qi,load:vi,loadAll:Fi,dump:Oi,YAMLException:$i,types:Ui,safeLoad:Di,safeLoadAll:Mi,safeDump:ji};const Li={class:"yaml-config"},La=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>{const l=Object.fromEntries(Object.entries(r.yamlRecord).filter(([,n])=>n!==null&&n!==""&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(l).length===0&&l.constructor===Object?"":Ki.dump(l).trim()});return(l,n)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Li,[r.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Pi={key:0,class:"config-card-display-form"},Ri=["data-testid"],zi={key:0,class:"config-card-prop-section-title"},Ji=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},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:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const r=e,a=t.useSlots(),{i18n:{t:l}}=Y.useI18n(),n=o=>!!(o.tooltip||a[`${o.key}-label-tooltip`]),i=t.computed(()=>{if(!r.record)return r.record;const o=JSON.parse(JSON.stringify(r.record));return delete o.created_at,delete o.updated_at,o});return(o,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Pi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,c=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${c}-props`,class:t.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(t.openBlock(),t.createElementBlock("div",zi,t.toDisplayString(c==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],h=>(t.openBlock(),t.createBlock(Dt,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(o.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[n(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Ri))),128))])):t.createCommentVNode("",!0),e.format==="json"&&r.record?(t.openBlock(),t.createBlock(Mt,{key:1,config:r.config,"fetcher-url":r.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&r.record?(t.openBlock(),t.createBlock(La,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),Wi=oe(Ji,[["__scopeId","data-v-2052238b"]]),ce="24px",Fe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Qi=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),Zi=["aria-hidden"],Yi={key:0,"data-testid":"kui-icon-svg-title"},Gi=Qi(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),Xi=t.defineComponent({__name:"AddIcon",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:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-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",Yi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Gi],8,Zi))]),_:1},8,["aria-hidden","style"]))}}),es=Fe(Xi,[["__scopeId","data-v-c1f7c39c"]]),ts=e=>(t.pushScopeId("data-v-fbe6ddff"),e=e(),t.popScopeId(),e),as=["aria-hidden"],rs={key:0,"data-testid":"kui-icon-svg-title"},ls=ts(()=>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)),ns=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:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,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(l.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",rs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ls],8,as))]),_:1},8,["aria-hidden","style"]))}}),os=Fe(ns,[["__scopeId","data-v-fbe6ddff"]]),is=e=>(t.pushScopeId("data-v-745761f6"),e=e(),t.popScopeId(),e),ss=["aria-hidden"],cs={key:0,"data-testid":"kui-icon-svg-title"},ds=is(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),hs=t.defineComponent({__name:"ChevronDownIcon",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:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-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",cs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ds],8,ss))]),_:1},8,["aria-hidden","style"]))}}),ps=Fe(hs,[["__scopeId","data-v-745761f6"]]),us=e=>(t.pushScopeId("data-v-863d10eb"),e=e(),t.popScopeId(),e),fs=["aria-hidden"],ms={key:0,"data-testid":"kui-icon-svg-title"},gs=us(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),ys=t.defineComponent({__name:"CloseIcon",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:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-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",ms,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),gs],8,fs))]),_:1},8,["aria-hidden","style"]))}}),ks=Fe(ys,[["__scopeId","data-v-863d10eb"]]),bs=e=>(t.pushScopeId("data-v-d9894a05"),e=e(),t.popScopeId(),e),Cs=["aria-hidden"],ws={key:0,"data-testid":"kui-icon-svg-title"},Ss=bs(()=>t.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),_s=t.defineComponent({__name:"MoreIcon",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:ce,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ce}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon more-icon","data-testid":"kui-icon-wrapper-more-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-more-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",ws,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Ss],8,Cs))]),_:1},8,["aria-hidden","style"]))}}),xs=Fe(_s,[["__scopeId","data-v-d9894a05"]]),Ns={class:"config-card-title","data-testid":"config-card-title"},Vs={class:"config-card-actions"},Bs=["href"],Is={class:"config-card-details-section"},Ts=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},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:r}){var a;const l=r,n=e,{i18n:{t:i}}=Y.useI18n(),{getMessageFromError:o}=Y.useErrors(),{convertKeyToTitle:d}=Y.useStringHelpers(),{axiosInstance:c}=Y.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),h=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=f=>{p.value=f==null?void 0:f.value},m={id:{type:L.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:L.BadgeStatus,order:2,section:J.Basic},updated_at:{type:L.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:L.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:L.BadgeTag,order:-1,section:J.Basic}},s=t.ref(!1),S=t.ref(!1),_=t.ref(""),g=t.ref({}),x=t.computed(()=>{var f,b,N;if(!g.value)return[];const V=[],w=Object.keys(g.value).length;for(const E in g.value){const H=(b=(f=n.configSchema)==null?void 0:f[E])==null?void 0:b.order,$=(N=m[E])==null?void 0:N.order;let U=w;($||$===0)&&(U=$===-1?w+1:$),H&&(U=H===-1?w+1:H),V.push([E,U])}return V.sort(function(E,H){return E[1]-H[1]}),V.map(E=>{var H,$;const U=E[0],O=(H=g.value)==null?void 0:H[U],F=(($=n.configSchema)==null?void 0:$[U])||{},j=m[U];return{key:U,value:O,hidden:F.hidden||!1,type:F.type??((j==null?void 0:j.type)||L.Text),label:F.label??((j==null?void 0:j.label)||d(U)),tooltip:F.tooltip??((j==null?void 0:j.tooltip)||void 0),section:F.section??((j==null?void 0:j.section)||J.Advanced)}}).filter(E=>!E.hidden&&E.key!==n.pluginConfigKey)}),T=t.computed(()=>{var f,b;if(!g.value||!n.pluginConfigKey)return[];const N=g.value[n.pluginConfigKey]||{},V=Object.keys(N).length,w=[];for(const E in N){const H=(b=(f=n.pluginConfigSchema)==null?void 0:f[E])==null?void 0:b.order,$=N[E];let U=$!=null&&$!==""?V-1:V;H&&(U=H===-1?V+1:H),w.push([E,U])}return w.sort(function(E,H){return E[1]-H[1]}),w.map(E=>{var H;const $=E[0],U=N[$],O=((H=n.pluginConfigSchema)==null?void 0:H[$])||{};return{key:$,value:U,hidden:O.hidden||!1,type:O.type??L.Text,label:O.label??d($),tooltip:O.tooltip??void 0,section:J.Plugin}}).filter(E=>!E.hidden)}),I=t.computed(()=>{var f,b,N,V;return{basic:(f=x.value)==null?void 0:f.filter(w=>w.section===J.Basic),advanced:(b=x.value)==null?void 0:b.filter(w=>w.section===J.Advanced),plugin:(V=T.value)==null?void 0:V.concat((N=x.value)==null?void 0:N.filter(w=>w.section===J.Plugin))}}),B=t.computed(()=>{const f=[];return I.value.basic.length&&f.push("basic"),I.value.advanced.length&&f.push("advanced"),I.value.plugin.length&&f.push("plugin"),f}),A=t.computed(()=>{var f,b;let N=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((f=n.config)==null?void 0:f.controlPlaneId)||""):n.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(b=n.config)!=null&&b.workspace?`/${n.config.workspace}`:"")),N=N.replace(/{id}/gi,n.config.entityId),N});return t.watch(s,f=>{l("loading",f)},{immediate:!0}),t.onBeforeMount(async()=>{S.value=!1,s.value=!0;try{const{data:f}=await c.get(A.value);if(n.dataKey)if(typeof f[n.dataKey]<"u")g.value={...f[n.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:n.dataKey}));else g.value={...f};Object.keys(n.configSchema).filter(b=>n.configSchema[b].forceShow).forEach(b=>{g.value&&typeof g.value[b]>"u"&&(g.value[b]=null)}),l("fetch:success",f)}catch(f){const b=o(f);_.value=b.startsWith("code")?i("baseConfigCard.errors.load"):b,S.value=!0,l("fetch:error",f)}finally{s.value=!1}}),(f,b)=>{const N=t.resolveComponent("KLabel"),V=t.resolveComponent("KSelect"),w=t.resolveComponent("KButton"),E=t.resolveComponent("KSkeleton"),H=t.resolveComponent("KEmptyState"),$=t.resolveComponent("KCard");return t.openBlock(),t.createBlock($,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Vs,[t.renderSlot(f.$slots,"actions",{},void 0,!0),t.createVNode(N,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(V,{"data-testid":"select-config-format",items:h,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(w,{key:0,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(os),{size:t.unref(on)},null,8,["size"])],8,Bs)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[s.value?(t.openBlock(),t.createBlock(E,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):S.value?(t.openBlock(),t.createBlock(H,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(_.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",Is,[t.createVNode(Wi,{config:e.config,"fetcher-url":A.value,format:p.value,"prop-list-types":B.value,"property-collections":I.value,record:g.value},t.createSlots({_:2},[t.renderList(Object.keys(f.$slots),U=>({name:U,fn:t.withCtx(({row:O,rowValue:F})=>[t.renderSlot(f.$slots,U,{row:O,rowValue:F},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("span",Ns,[t.renderSlot(f.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),As=oe(Ts,[["__scopeId","data-v-f40a683b"]]),Hs=["novalidate"],Es={class:"form-actions","data-testid":"form-actions"},qs=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:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,i=tt.useRouter(),{i18n:{t:o}}=Y.useI18n(),{getMessageFromError:d}=Y.useErrors(),{axiosInstance:c}=Y.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),m=t.computed(()=>n.canSubmit===!1||n.isReadonly),s=t.ref(!1),S=t.computed(()=>{var B,A;let f=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((B=n.config)==null?void 0:B.controlPlaneId)||""):n.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(A=n.config)!=null&&A.workspace?`/${n.config.workspace}`:"")),n.editId?(f=f.replace(/{id}/gi,n.editId),f):(f=f.replace(/\/{id}/gi,""),f)}),_=()=>{s.value=!s.value},g=()=>{n.config.cancelRoute?i.push(n.config.cancelRoute):x()},x=()=>{l("cancel")},T=()=>{m.value||l("submit")},I=t.ref([{title:o("baseForm.configuration.yaml"),hash:"#yaml"},{title:o("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,B=>{l("loading",B)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{p.value=!1,h.value=!0;const{data:B}=await c.get(S.value);l("fetch:success",B)}catch(B){const A=d(B);u.value=A.startsWith("code")?o("baseForm.errors.edit"):A,p.value=!0,l("fetch:error",B)}finally{h.value=!1}}),(B,A)=>{const f=t.resolveComponent("KSkeleton"),b=t.resolveComponent("KEmptyState"),N=t.resolveComponent("KAlert"),V=t.resolveComponent("KButton"),w=t.resolveComponent("KTabs"),E=t.resolveComponent("KSlideout");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(f,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(b,{key:1,"action-button-text":t.unref(o)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:g},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:n.noValidate,onReset:t.withModifiers(x,["prevent"]),onSubmit:t.withModifiers(T,["prevent"])},[t.renderSlot(B.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(N,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Es,[t.renderSlot(B.$slots,"form-actions",{},()=>[t.createVNode(V,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:A[0]||(A[0]=H=>_())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.viewConfiguration")),1)]),_:1}),t.createVNode(V,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(V,{appearance:"primary","data-testid":"form-submit",disabled:m.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,Hs)),t.createVNode(E,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(o)("baseForm.configuration.title"),visible:s.value,onClose:A[1]||(A[1]=H=>_())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("baseForm.configuration.message")),1),t.createVNode(w,{"data-testid":"form-view-configuration-slideout-tabs",tabs:I.value},{json:t.withCtx(()=>[t.createVNode(Mt,{config:e.config,"fetcher-url":S.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(La,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Pa=oe(qs,[["__scopeId","data-v-fd05df8e"]]),vs=["data-truncate"],Fs=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const r=e,a=t.computed(()=>{var g;return((g=r.rowEl)==null?void 0:g.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var g;return((g=a.value)==null?void 0:g.querySelector('[data-truncate="true"]'))||null}),n=t.computed(()=>{var g,x;const T=(g=r.rowEl)==null?void 0:g.querySelectorAll("td");return T?((x=T[0])==null?void 0:x.getAttribute("data-testid"))===r.keyName:!0}),i=t.computed(()=>n.value||r.tooltip);let o;const d=()=>{o&&(o.disconnect(),o=void 0)},c=()=>{var g,x,T;let I=((g=a.value)==null?void 0:g.clientWidth)||0;if(a.value&&"getComputedStyle"in window){const B=window.getComputedStyle(a.value);I-=(parseFloat(B.paddingLeft)||0)+(parseFloat(B.paddingRight)||0)}p.value=((x=l.value)==null?void 0:x.getBoundingClientRect().width)||0,u.value=I,m.value=((T=h.value)==null?void 0:T.innerText)||""},h=t.ref({}),p=t.ref(0),u=t.ref(0),m=t.ref(""),s=t.computed(()=>[l.value,a.value]),S=t.watch(s,g=>{if(i.value&&(d(),"ResizeObserver"in window&&window)){o=new ResizeObserver(x=>{window.requestAnimationFrame(()=>{!Array.isArray(x)||!x.length||c()})});for(const x of g)x&&o.observe(x)}},{immediate:!0,flush:"post",deep:!0}),_=t.computed(()=>i.value?p.value>u.value:!1);return t.onMounted(()=>{c()}),t.onUnmounted(()=>{S()}),(g,x)=>{const T=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:h,class:"content-wrapper"},[i.value?(t.openBlock(),t.createElementBlock("span",{key:0,"data-truncate":i.value||void 0},[t.createVNode(T,{"max-width":"300",placement:"bottom-start",text:_.value?m.value:""},{default:t.withCtx(()=>[t.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,vs)):t.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),Os=oe(Fs,[["__scopeId","data-v-b252463e"]]),$s={class:"toolbar-container"},Us={key:0,class:"toolbar-button-container"},Ds=["data-testid"],Ms=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},sortHandlerFunction:{type:Function,default:()=>({})},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:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:r}){const a=e,l=r,{i18n:{t:n}}=Y.useI18n(),i=t.computed(()=>{var f,b;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(f=a.errorMessage)==null?void 0:f.title,message:(b=a.errorMessage)==null?void 0:b.message}}),o=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=f=>f.hasData||!!a.query,c=t.computed(()=>{const f=[];return Object.keys(a.tableHeaders).forEach(b=>{const N=a.tableHeaders[b];f.push({label:N.label??b,key:b,sortable:N.sortable??!1,hidable:N.hidable??!0})}),a.enableEntityActions&&f.push({key:"actions",hideLabel:!0}),f}),h=f=>({"data-rowid":f.id,"data-testid":f.name,...a.rowAttributes(f)}),p=t.ref({}),u=f=>{var b;return(b=p.value)==null?void 0:b.$el.querySelector(`[data-rowid="${f.id}"]`)},m=f=>{const b={"data-testid":f.headerKey,...a.cellAttributes(f)};return f.colIndex===0&&(b.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),b},s=()=>{l("empty-state-cta-clicked"),S()},S=()=>{l("clear-search-input")},_=t.computed(()=>a.disableRowClick?void 0:(f,b)=>{l("click:row",b)}),g=f=>{l("sort",f)},{setTablePreferences:x,getTablePreferences:T}=Nl(),I=t.ref(T(o.value)),B=t.computed(()=>{const f=T(o.value);return{...a.initialFetcherParams,...f}}),A=f=>{I.value=f,c.value.forEach(b=>{!("hidable"in b)||!I.value.columnVisibility||b.hidable===!1&&(I.value.columnVisibility[b.key]=!0)}),o.value&&x(o.value,f)};return(f,b)=>{const N=t.resolveComponent("KButton"),V=t.resolveComponent("KDropdown"),w=t.resolveComponent("KTable"),E=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(E,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:t.withCtx(()=>[t.createVNode(w,{ref_key:"tableRefs",ref:p,"cache-identifier":o.value,"cell-attrs":m,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,error:i.value.hasError,"error-state-message":i.value.message,"error-state-title":i.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":B.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":h,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":I.value,onEmptyStateActionClick:s,"onRow:click":_.value,onSort:b[0]||(b[0]=H=>g(H)),"onUpdate:tablePreferences":A},t.createSlots({toolbar:t.withCtx(({state:H})=>[t.withDirectives(t.createElementVNode("div",$s,[t.renderSlot(f.$slots,"toolbar-filter",{},void 0,!0),f.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Us,[t.renderSlot(f.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(H)]])]),actions:t.withCtx(({row:H,rowKey:$,rowValue:U})=>[t.createElementVNode("div",{class:"actions-container","data-testid":H.name},[t.createVNode(V,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(f.$slots,"actions",{row:H,rowKey:$,rowValue:U},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(N,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:t.withCtx(()=>[t.createVNode(t.unref(xs))]),_:1})]),_:2},1032,["width"])],8,Ds)]),_:2},[t.renderList(e.tableHeaders,(H,$)=>({name:$,fn:t.withCtx(({row:U,rowKey:O,rowValue:F})=>[t.createVNode(Os,{"key-name":String($),"row-el":u(U),tooltip:H.tooltip},{default:t.withCtx(()=>[t.renderSlot(f.$slots,$,{row:U,rowKey:O,rowValue:F},()=>[t.createTextVNode(t.toDisplayString(F),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(es))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Ra=oe(Ms,[["__scopeId","data-v-71b4425a"]]),js={key:0,class:"kong-ui-entity-delete-error"},Ks={key:1,class:"description"},Ls=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:r}){const{i18nT:a}=Y.useI18n(),l=e,n=r,i=t.computed(()=>l.needConfirm?l.entityName:""),o=()=>{n("cancel")},d=()=>{n("proceed")};return(c,h)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":i.value,title:e.title,visible:e.visible,onCancel:o,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",js,[t.createVNode(p,{appearance:"danger"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Ks,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),za=oe(Ls,[["__scopeId","data-v-4361d622"]]),Ps={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Rs={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},zs=["fill"],Js={mask:"url(#mask0_180_20349)"},Ws=["fill"],Ja=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${an})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Ps,[t.createElementVNode("mask",Rs,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,zs)]),t.createElementVNode("g",Js,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ws)])]))}}),Qs={key:1,class:"kong-ui-entity-filter"},Zs={class:"kong-ui-entity-filter-menu"},Ys=["data-testid"],Gs=["onClick","onKeydown"],Xs={class:"menu-item-indicator"},ec={class:"menu-item-body"},tc=["for"],ac={class:"menu-item-buttons"},rc={class:"filter-clear-button-container"},lc=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:r}){const{i18n:{t:a}}=Y.useI18n(),l=e,n=r,i=t.ref(!1),o=t.ref({}),d=t.ref(new Set),c=t.computed(()=>{const B=[];return new URLSearchParams(l.modelValue).forEach((A,f)=>{A!==""&&B.push(f)}),B}),h=t.computed(()=>{const B=l.config.fields;return Object.keys(B).filter(A=>{var f;return(f=B==null?void 0:B[A])==null?void 0:f.searchable}).map(A=>({label:B[A].label||A,value:A,expanded:!1}))});t.watch(()=>l.modelValue,B=>{o.value={},new URLSearchParams(B).forEach((A,f)=>{o.value[f]=A})});const p=()=>{i.value=!i.value},u=B=>{d.value.has(B)?d.value.delete(B):d.value.add(B)},m=B=>{n("update:modelValue",B)},s=()=>{m("")},S=B=>`filter-${B}`,_=B=>{var A,f;return(((f=(A=l.config.schema)==null?void 0:A[B])==null?void 0:f.values)??[]).map(b=>({value:b,label:b}))},g=B=>{var A,f;return((f=(A=l.config.schema)==null?void 0:A[B])==null?void 0:f.type)??"text"},x=B=>{o.value={...o.value,[B]:""},I()},T=()=>{o.value={},I(!0)},I=(B=!1)=>{const A=Object.keys(o.value).reduce((f,b)=>(o.value[b]&&(f[b]=`${o.value[b]}`),f),{});B&&(i.value=!1),n("update:modelValue",new URLSearchParams(A).toString())};return(B,A)=>{const f=t.resolveComponent("KInput"),b=t.resolveComponent("KButton"),N=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(f,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":m},{before:t.withCtx(()=>[t.createVNode(Ja)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(ks),{class:"kong-ui-entity-filter-clear",onClick:s},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Qs,[t.createVNode(b,{appearance:"tertiary","data-testid":"filter-button",onClick:p},{default:t.withCtx(()=>[t.createVNode(Ja),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:p},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createElementVNode("div",Zs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,V=>{var w,E;return t.openBlock(),t.createElementBlock("div",{key:V.value,class:"kong-ui-entity-filter-menu-item","data-testid":V.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:d.value.has(V.value)}]),role:"button",tabindex:"0",onClick:H=>u(V.value),onKeydown:t.withKeys(H=>u(V.value),["enter"])},[t.createTextVNode(t.toDisplayString(V.label)+" ",1),t.withDirectives(t.createElementVNode("span",Xs,null,512),[[t.vShow,c.value.includes(V.value)]]),t.createVNode(t.unref(ps),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:d.value.has(V.value)}]),color:t.unref(ln)},null,8,["class","color"])],42,Gs),t.withDirectives(t.createElementVNode("div",ec,[t.createElementVNode("label",{class:"menu-item-label",for:S(V.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,tc),((E=(w=e.config.schema)==null?void 0:w[V.value])==null?void 0:E.type)==="select"?(t.openBlock(),t.createBlock(N,{key:0,id:S(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":H=>o.value[V.value]=H,items:_(V.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(f,{key:1,id:S(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":H=>o.value[V.value]=H,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:g(V.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,d.value.has(V.value)]]),t.withDirectives(t.createElementVNode("div",ac,[t.createVNode(b,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:A[0]||(A[0]=H=>I(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(b,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:H=>x(V.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,d.value.has(V.value)]])],8,Ys)}),128)),t.createElementVNode("div",rc,[t.createVNode(b,{appearance:"tertiary",size:"small",onClick:T},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,i.value]])]))}}}),nc=oe(lc,[["__scopeId","data-v-94990087"]]),he=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,i)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}});let ze;const oc=new Uint8Array(16);function ic(){if(!ze&&(ze=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ze))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ze(oc)}const X=[];for(let e=0;e<256;++e)X.push((e+256).toString(16).slice(1));function sc(e,r=0){return X[e[r+0]]+X[e[r+1]]+X[e[r+2]]+X[e[r+3]]+"-"+X[e[r+4]]+X[e[r+5]]+"-"+X[e[r+6]]+X[e[r+7]]+"-"+X[e[r+8]]+X[e[r+9]]+"-"+X[e[r+10]]+X[e[r+11]]+X[e[r+12]]+X[e[r+13]]+X[e[r+14]]+X[e[r+15]]}const cc=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Wa={randomUUID:cc};function dc(e,r,a){if(Wa.randomUUID&&!r&&!e)return Wa.randomUUID();e=e||{};const l=e.random||(e.rng||ic)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,r){a=a||0;for(let n=0;n<16;++n)r[a+n]=l[n];return r}return sc(l)}const hc=["aria-labelledby"],pc={class:"form-section-wrapper"},uc={key:1,class:"form-section-description"},fc={key:2,class:"form-section-footer"},mc={class:"form-section-content"},gc=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},titleTag:{type:String,default:"h2"}},setup(e){const r=t.useSlots(),a=dc();return(l,n)=>(t.openBlock(),t.createElementBlock("div",{"aria-labelledby":e.title?t.unref(a):void 0,class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[t.createElementVNode("div",pc,[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.createBlock(t.resolveDynamicComponent(e.titleTag),{key:0,id:t.unref(a),class:"form-section-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1},8,["id"])):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",uc,[t.renderSlot(l.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",fc,[t.renderSlot(l.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",mc,[t.renderSlot(l.$slots,"default",{},void 0,!0)])])],10,hc))}}),Oe=oe(gc,[["__scopeId","data-v-b1f74200"]]),{useAxios:Je,useDeleteUrlBuilder:Qa,useErrors:Za,useExternalLinkCreator:Sd,useFetchUrlBuilder:_d,useFetcher:Ya,useDebouncedFilter:Ga,useStringHelpers:xd,useHelpers:yc,useGatewayFeatureSupported:Nd,useTruncationDetector:Vd,useValidators:Bd}=Y,We="24px",Xa=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},kc=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),bc=["aria-hidden"],Cc={key:0,"data-testid":"kui-icon-svg-title"},wc=kc(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),bt=Xa(t.defineComponent({__name:"AddIcon",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:We,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return We}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-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",Cc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),wc],8,bc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c1f7c39c"]]),Sc=e=>(t.pushScopeId("data-v-c73ebbaa"),e=e(),t.popScopeId(),e),_c=["aria-hidden"],xc={key:0,"data-testid":"kui-icon-svg-title"},Nc=Sc(()=>t.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Vc=Xa(t.defineComponent({__name:"TrashIcon",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:We,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return We}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-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",xc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Nc],8,_c))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c73ebbaa"]]),Bc={upstreams:{list:{table_headers:{id:"ID",name:"Name",slots:"Slots",tags:"Tags"},empty_state:{title:"Configure a New Upstream",description:"Upstreams are used to load balance incoming requests."},toolbar_actions:{new_upstream:"New Upstream"}},title:"Upstreams",search:{placeholder:"Filter by exact name or ID"},actions:{create:"New Upstream",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete an Upstream",description:"This action cannot be reversed so make sure to check upstream usage before deleting."},errors:{general:"Upstreams could not be retrieved",delete:"The upstream could not be deleted at this time.",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{errors:{name_required:"Name is required",should_be_integer:"Field should contain an integer",in_range:"Accepts an integer in the range of 10 - 65536"},general_info:{title:"General Information",help:"General information will help identify and manage this Upstream."},load_balancing:{title:"Load Balancing",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},health_check:{title:"Health Checks & Circuit Breakers",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},active_health_check:{title:"Active Health Checks",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},passive_health_check:{title:"Passive Health Checks",help:"Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},buttons:{view_documentation:"View documentation"},algorithms:{round_robin_label:"Round Robin",least_connections_label:"Least Connections",consistent_hashing_label:"Consistent Hashing",latency_label:"Latency"},hash_labels:{none:"None",consumer:"Consumer",ip:"IP",header:"Header",cookie:"Cookie",path:"Path",query_argument:"Query Argument",uri_capture:"URI Capture"},hash_tooltips:{hash_on_header:{text:"The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",hash_on:"hash_on",header:"header"},hash_on_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",hash_on:"hash_on",uri_capture:"uri_capture"},hash_on_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",hash_on:"hash_on",query_arg:"query_arg"},hash_on_cookie:{text:"The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},hash_on_cookie_path:{text:"The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},slots:{text:"The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",algorithm:"algorithm",round_robin:"round-robin",consistent_hashing:"consistent-hashing"},tags:"An optional set of strings associated with the Upstream for grouping and filtering.",hash_fallback:{text:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",hash_on:"hash_on",cookie:"cookie"},hash_fallback_header:{text:"The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",hash_fallback:"hash_fallback",header:"header"},hash_fallback_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",hash_fallback:"hash_fallback",query_arg:"query_arg"},hash_fallback_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",hash_fallback:"hash_fallback",uri_capture:"uri_capture"},host_header:{text:"The hostname to be used as {host} header when proxying requests through Kong.",host:"Host"},client_certificate:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},healthcheck_type_labels:{http:"HTTP",https:"HTTPS",tcp:"TCP",grsp:"gRPC",grsps:"gRPCs"},healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},passive_healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},passive_unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},fields:{name:{label:"Name",placeholder:"Enter or select a host",tooltip:"This is a hostname, which must be equal to the {host} of a Service.",host:"host"},host_header:{label:"Host Header"},client_certificate:{label:"Client Certificate",placeholder:"Select or enter a Certificate ID",tooltip:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},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 Upstream for grouping and filtering."},algorithm:{label:"Algorithm",tooltip:"Which load balancing algorithm to use."},slots:{label:"Slots",help:"Accepts an integer in the range of 10 - 65536"},hash_on:{label:"Hash on",help:"What to use as hashing input.",tooltip:"What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."},hash_fallback:{label:"Hash Fallback",help:"What to use as hashing input if the primary hash_on does not return a hash",tooltip:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",hash_on:"hash_on",cookie:"cookie"},active_health_checks:{label:"Active Health Checks",help:"Actively probe the targets for their health."},passive_health_checks:{label:"Passive Health Checks / Circuit Breakers",help:"Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},healthchecks_threshold:{label:"Healthchecks Threshold"},header:{label:"Header"},headers:{label:"Headers",tooltip_active:"Header values can be separated by commas (value1, value2, value3)."},cookie:{label:"Cookie"},cookie_path:{label:"Cookie Path"},query_argument:{label:"Query Argument"},uri_capture:{label:"URI Capture"},active_healthcheck_type:{label:"Active Health Check Type"},http_path:{label:"HTTP Path"},timeout:{label:"Timeout"},concurrency:{label:"Concurrency"},https_sni:{label:"HTTPS SNI"},verify_ssl:{label:"Verify the SSL certificate when performing active health checks using HTTPS"},interval:{label:"Interval",help:"A value of zero indicates that active probes for healthy targets are disabled."},successes:{label:"Successes"},http_statuses:{label:"HTTP Statuses"},http_failures:{label:"HTTP Failures"},tcp_failures:{label:"TCP Failures"},timeouts:{label:"Timeouts"},passive_health_check_type:{label:"Passive Health Check Type"}}},labels:{created_at:"Created at"}},targets:{list:{table_headers:{id:"ID",target_address:"Target Address",weight:"Weight",tags:"Tags"},empty_state:{title:"Configure a New Target",description:"A target is an IP address/hostname with a port that identifies an instance of a backend service."},toolbar_actions:{new_target:"New Target"}},title:"Targets",actions:{create:"New Target",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",mark_healthy:"Mark Healthy",mark_unhealthy:"Mark Unhealthy"},delete:{title:"Delete a Target",description:"This action cannot be reversed so make sure to check target usage before deleting."},errors:{general:"Targets could not be retrieved",delete:"The target could not be deleted at this time.",copy:"Failed to copy to clipboard",weight:"Value must be in range 0 to 65535"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{create:{title:"New Target"},edit:{title:"Edit Target"},buttons:{save:"Save",cancel:"Cancel"},fields:{target:{label:"Target Address",placeholder:"Enter IP/hostname and port",tooltip:"The target address (IP or hostname) and port. If omitted the port defaults to 8000."},weight:{label:"Weight",tooltip:"The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}}}}};function Ic(){const e=Ue.createI18n("en-us",Bc);return{i18n:e,i18nT:Ue.i18nTComponent(e)}}function $e(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,i)=>{if(i){const o={...n};r&&(o.value=n.label),a.value.push(o)}else a.value=a.value.filter(o=>o.value!==n.value)}}}const Qe=[{label:"100",value:"100"},{label:"101",value:"101"},{label:"102",value:"102"},{label:"103",value:"103"},{label:"200",value:"200"},{label:"201",value:"201"},{label:"202",value:"202"},{label:"203",value:"203"},{label:"204",value:"204"},{label:"205",value:"205"},{label:"206",value:"206"},{label:"207",value:"207"},{label:"208",value:"208"},{label:"226",value:"226"},{label:"300",value:"300"},{label:"301",value:"301"},{label:"302",value:"302"},{label:"303",value:"303"},{label:"304",value:"304"},{label:"305",value:"305"},{label:"306",value:"306"},{label:"307",value:"307"},{label:"308",value:"308"},{label:"400",value:"400"},{label:"401",value:"401"},{label:"402",value:"402"},{label:"403",value:"403"},{label:"404",value:"404"},{label:"405",value:"405"},{label:"406",value:"406"},{label:"407",value:"407"},{label:"408",value:"408"},{label:"409",value:"409"},{label:"410",value:"410"},{label:"411",value:"411"},{label:"412",value:"412"},{label:"413",value:"413"},{label:"414",value:"414"},{label:"415",value:"415"},{label:"416",value:"416"},{label:"417",value:"417"},{label:"418",value:"418"},{label:"419",value:"419"},{label:"420",value:"420"},{label:"421",value:"421"},{label:"422",value:"422"},{label:"423",value:"423"},{label:"424",value:"424"},{label:"425",value:"425"},{label:"426",value:"426"},{label:"428",value:"428"},{label:"429",value:"429"},{label:"430",value:"430"},{label:"431",value:"431"},{label:"440",value:"440"},{label:"444",value:"444"},{label:"449",value:"449"},{label:"450",value:"450"},{label:"451",value:"451"},{label:"460",value:"460"},{label:"463",value:"463"},{label:"494",value:"494"},{label:"495",value:"495"},{label:"496",value:"496"},{label:"497",value:"497"},{label:"498",value:"498"},{label:"499",value:"499"},{label:"500",value:"500"},{label:"501",value:"501"},{label:"502",value:"502"},{label:"503",value:"503"},{label:"504",value:"504"},{label:"505",value:"505"},{label:"506",value:"506"},{label:"507",value:"507"},{label:"508",value:"508"},{label:"509",value:"509"},{label:"510",value:"510"},{label:"511",value:"511"},{label:"520",value:"520"},{label:"521",value:"521"},{label:"522",value:"522"},{label:"523",value:"523"},{label:"524",value:"524"},{label:"525",value:"525"},{label:"526",value:"526"},{label:"527",value:"527"},{label:"529",value:"529"},{label:"530",value:"530"},{label:"561",value:"561"},{label:"598",value:"598"},{label:"599",value:"599"}],Ct=10,wt=65536,Tc=0,Ac=65535,xe=0,Ne=255,er=0,tr=255,Hc=0,Ec=65535,ar=0,rr=65535,qc=0,vc=2**31,St=["200","302"],_t=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],xt=["429","404","500","501","502","503","504","505"],Nt=["429","500","503"];function Ze(){const e=c=>/^\d+$/.test(c),r=(c,h,p)=>{if(e(c)){const u=Number(c);return u>=h&&u<=p}else return!1},a=c=>c.map(h=>Number(h)),l=c=>c.map(h=>h.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:St,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:xt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:_t,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:Nt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,m,s,S,_,g,x,T,I,B,A,f,b,N,V,w,E,H,$,U,O,F,j,Z,v,D,K,k,y,C,R,M,z,ee,P,ae,ke,Te,nr,or,ir,sr,cr,dr,hr,pr,ur,fr,mr,gr,yr,kr,br,Cr,wr,Sr,_r,xr,Nr,Vr,Br,Ir,Tr,Ar,Hr,Er,qr,vr,Fr,Or,$r,Ur,Dr,Mr,jr,Kr,Lr,Pr,Rr,zr,Jr,Wr,Qr,Zr,Yr,Gr,Xr,el,tl,al,rl,ll,nl,ol,il,sl,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl;const h=n();return h.name=c.name||"",h.algorithm=c.algorithm||"round-robin",h.hostHeader=c.host_header||"",h.clientCertificate=c.client_certificate?(p=c.client_certificate)==null?void 0:p.id:"",h.tags=((u=c.tags)==null?void 0:u.join(", "))||"",h.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",h.hashOn=c.hash_on||"none",h.hashFallback=c.hash_fallback||"none",h.hashOnHeader=c.hash_on_header||"",h.hashOnCookie=c.hash_on_cookie||"",h.hashOnCookiePath=c.hash_on_cookie_path||"/",h.hashOnQueryArgument=c.hash_on_query_arg||"",h.hashOnUriCapture=c.hash_on_uri_capture||"",h.hashFallbackHeader=c.hash_fallback_header||"",h.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",h.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",h.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",h.activeHealthSwitch=((s=(m=c.healthchecks.active)==null?void 0:m.healthy)==null?void 0:s.interval)!==0||((_=(S=c.healthchecks.active)==null?void 0:S.unhealthy)==null?void 0:_.interval)!==0,h.activeHealthCheck.type=((g=c.healthchecks.active)==null?void 0:g.type)||"http",h.activeHealthCheck.httpPath=((x=c.healthchecks.active)==null?void 0:x.http_path)||"/",h.activeHealthCheck.timeout=((T=c.healthchecks.active)==null?void 0:T.timeout)!==null&&((I=c.healthchecks.active)==null?void 0:I.timeout)!==void 0?(A=(B=c.healthchecks.active)==null?void 0:B.timeout)==null?void 0:A.toString():"",h.activeHealthCheck.concurrency=((f=c.healthchecks.active)==null?void 0:f.concurrency)!==null&&((b=c.healthchecks.active)==null?void 0:b.concurrency)!==void 0?(V=(N=c.healthchecks.active)==null?void 0:N.concurrency)==null?void 0:V.toString():"",h.activeHealthCheck.httpsSni=((w=c.healthchecks.active)==null?void 0:w.https_sni)||"",h.activeHealthCheck.verifySsl=((E=c.healthchecks.active)==null?void 0:E.https_verify_certificate)||!1,h.activeHealthCheck.headers=(H=c.healthchecks.active)!=null&&H.headers&&Object.entries(($=c.healthchecks.active)==null?void 0:$.headers).length>0?Object.entries((U=c.healthchecks.active)==null?void 0:U.headers).map(([wd,Vt])=>({key:wd,values:Vt==null?void 0:Vt.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((F=(O=c.healthchecks.active)==null?void 0:O.healthy)==null?void 0:F.interval)!==null&&((Z=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:Z.interval)!==void 0?(K=(D=(v=c.healthchecks.active)==null?void 0:v.healthy)==null?void 0:D.interval)==null?void 0:K.toString():"0",h.activeHealthCheck.interval=((y=(k=c.healthchecks.active)==null?void 0:k.healthy)==null?void 0:y.interval)!==null&&((R=(C=c.healthchecks.active)==null?void 0:C.healthy)==null?void 0:R.interval)!==void 0?(ee=(z=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:z.interval)==null?void 0:ee.toString():"0",h.activeHealthCheck.successes=((ae=(P=c.healthchecks.active)==null?void 0:P.healthy)==null?void 0:ae.successes)!==null&&((Te=(ke=c.healthchecks.active)==null?void 0:ke.healthy)==null?void 0:Te.successes)!==void 0?(ir=(or=(nr=c.healthchecks.active)==null?void 0:nr.healthy)==null?void 0:or.successes)==null?void 0:ir.toString():"0",h.activeHealthCheck.httpStatuses=(cr=(sr=c.healthchecks.active)==null?void 0:sr.healthy)!=null&&cr.http_statuses?l(((hr=(dr=c.healthchecks.active)==null?void 0:dr.healthy)==null?void 0:hr.http_statuses)||[]):St,h.activeHealthCheck.unhealthyInterval=((ur=(pr=c.healthchecks.active)==null?void 0:pr.unhealthy)==null?void 0:ur.interval)!==null&&((mr=(fr=c.healthchecks.active)==null?void 0:fr.unhealthy)==null?void 0:mr.interval)!==void 0?(kr=(yr=(gr=c.healthchecks.active)==null?void 0:gr.unhealthy)==null?void 0:yr.interval)==null?void 0:kr.toString():"0",h.activeHealthCheck.httpFailures=((Cr=(br=c.healthchecks.active)==null?void 0:br.unhealthy)==null?void 0:Cr.http_failures)!==null&&((Sr=(wr=c.healthchecks.active)==null?void 0:wr.unhealthy)==null?void 0:Sr.http_failures)!==void 0?(Nr=(xr=(_r=c.healthchecks.active)==null?void 0:_r.unhealthy)==null?void 0:xr.http_failures)==null?void 0:Nr.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((Br=(Vr=c.healthchecks.active)==null?void 0:Vr.unhealthy)==null?void 0:Br.timeouts)!==null&&((Tr=(Ir=c.healthchecks.active)==null?void 0:Ir.unhealthy)==null?void 0:Tr.timeouts)!==void 0?(Er=(Hr=(Ar=c.healthchecks.active)==null?void 0:Ar.unhealthy)==null?void 0:Hr.timeouts)==null?void 0:Er.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(vr=(qr=c.healthchecks.active)==null?void 0:qr.unhealthy)!=null&&vr.http_statuses?l(((Or=(Fr=c.healthchecks.active)==null?void 0:Fr.unhealthy)==null?void 0:Or.http_statuses)||[]):xt,h.passiveHealthSwitch=((Ur=($r=c.healthchecks.passive)==null?void 0:$r.healthy)==null?void 0:Ur.successes)!==0||((Mr=(Dr=c.healthchecks.passive)==null?void 0:Dr.unhealthy)==null?void 0:Mr.timeouts)!==0||((Kr=(jr=c.healthchecks.passive)==null?void 0:jr.unhealthy)==null?void 0:Kr.tcp_failures)!==0||((Pr=(Lr=c.healthchecks.passive)==null?void 0:Lr.unhealthy)==null?void 0:Pr.http_failures)!==0,h.passiveHealthCheck.type=((Rr=c.healthchecks.passive)==null?void 0:Rr.type)||"http",h.passiveHealthCheck.successes=((Jr=(zr=c.healthchecks.passive)==null?void 0:zr.healthy)==null?void 0:Jr.successes)!==null&&((Qr=(Wr=c.healthchecks.passive)==null?void 0:Wr.healthy)==null?void 0:Qr.successes)!==void 0?(Gr=(Yr=(Zr=c.healthchecks.passive)==null?void 0:Zr.healthy)==null?void 0:Yr.successes)==null?void 0:Gr.toString():"0",h.passiveHealthCheck.httpStatuses=(el=(Xr=c.healthchecks.passive)==null?void 0:Xr.healthy)!=null&&el.http_statuses?l(((al=(tl=c.healthchecks.passive)==null?void 0:tl.healthy)==null?void 0:al.http_statuses)||[]):_t,h.passiveHealthCheck.timeouts=((ll=(rl=c.healthchecks.passive)==null?void 0:rl.unhealthy)==null?void 0:ll.timeouts)!==null&&((ol=(nl=c.healthchecks.passive)==null?void 0:nl.unhealthy)==null?void 0:ol.timeouts)!==void 0?(cl=(sl=(il=c.healthchecks.passive)==null?void 0:il.unhealthy)==null?void 0:sl.timeouts)==null?void 0:cl.toString():"0",h.passiveHealthCheck.tcpFailures=((hl=(dl=c.healthchecks.passive)==null?void 0:dl.unhealthy)==null?void 0:hl.tcp_failures)!==null&&((ul=(pl=c.healthchecks.passive)==null?void 0:pl.unhealthy)==null?void 0:ul.tcp_failures)!==void 0?(gl=(ml=(fl=c.healthchecks.passive)==null?void 0:fl.unhealthy)==null?void 0:ml.tcp_failures)==null?void 0:gl.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(kl=(yl=c.healthchecks.passive)==null?void 0:yl.unhealthy)!=null&&kl.http_statuses?l(((Cl=(bl=c.healthchecks.passive)==null?void 0:bl.unhealthy)==null?void 0:Cl.http_statuses)||[]):Nt,h},getDefaultUpstreamFields:n,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const pe={useI18n:Ic,useMultiselectCreation:$e,useHelpers:Ze},Ve="/v2/control-planes/{controlPlaneId}/core-entities",Be="/{workspace}",Ie={list:{konnect:`${Ve}/upstreams`,kongManager:`${Be}/upstreams`},form:{konnect:{getServices:`${Ve}/services`,getCertificates:`${Ve}/certificates`,validate:`${Ve}/v1/schemas/json/upstream/validate`,create:`${Ve}/upstreams`,edit:`${Ve}/upstreams/{id}`},kongManager:{getServices:`${Be}/services`,getCertificates:`${Be}/certificates`,validate:`${Be}/schemas/upstreams/validate`,create:`${Be}/upstreams`,edit:`${Be}/upstreams/{id}`}}},Fc={class:"kong-ui-entities-upstreams-list"},Oc={class:"upstream-name"},$c=t.defineComponent({__name:"UpstreamsList",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"],setup(e,{emit:r}){var Z;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),i=tt.useRouter(),{axiosInstance:o}=Je((Z=l.config)==null?void 0:Z.axiosRequestConfig),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var D,K;let v=`${l.config.apiBaseUrl}${Ie.list[l.config.app]}`;return l.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((D=l.config)==null?void 0:D.controlPlaneId)||""):l.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(K=l.config)!=null&&K.workspace?`/${l.config.workspace}`:"")),v}),m=t.ref(""),s=t.computed(()=>{const v=l.config.app==="konnect"||l.config.isExactMatch;if(v)return{isExactMatch:v,placeholder:n("upstreams.search.placeholder")};const{name:D,slots:K}=h;return{isExactMatch:v,fields:{name:D,slots:K},schema:l.config.filterSchema}}),{fetcher:S,fetcherState:_}=Ya(l.config,u.value),g=()=>{m.value=""},x=()=>{d.value++},T=t.ref(null),I=(v,D)=>{const K=v.id;if(!D(K)){a("copy:error",{entity:v,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:v,field:"id",message:n("upstreams.copy.success",{val:K})})},B=(v,D)=>{const K=JSON.stringify(v);if(!D(K)){a("copy:error",{entity:v,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:v,message:n("upstreams.copy.success_brief")})},A=async v=>{var K;await((K=l.canRetrieve)==null?void 0:K.call(l,v))&&i.push(l.config.getViewRoute(v.id))},f=v=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(v)}),b=v=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(v)}),N=t.ref(void 0),V=t.ref(!1),w=t.ref(!1),E=t.ref(""),H=Qa(l.config,u.value),$=v=>{N.value=v,V.value=!0},U=()=>{V.value=!1},O=async()=>{var v,D,K;if((v=N.value)!=null&&v.id){w.value=!0;try{await o.delete(H(N.value.id)),w.value=!1,V.value=!1,d.value++,a("delete:success",N.value)}catch(k){E.value=((K=(D=k.response)==null?void 0:D.data)==null?void 0:K.message)||k.message||n("upstreams.errors.delete"),a("error",k)}finally{w.value=!1}}},F=t.ref(!1);t.watch(_,v=>{var D,K,k,y;if(Array.isArray((D=v==null?void 0:v.response)==null?void 0:D.data)&&(F.value=v.response.data.length>0),v.status===fe.Error){T.value={title:n("upstreams.errors.general")},(y=(k=(K=v.error)==null?void 0:K.response)==null?void 0:k.data)!=null&&y.message&&(T.value.message=v.error.response.data.message),a("error",v.error);return}T.value=null});const j=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(j.value.title=n("upstreams.list.empty_state.title"),j.value.ctaText=n("upstreams.actions.create"))}),(v,D)=>{const K=t.resolveComponent("KButton"),k=t.resolveComponent("KBadge"),y=t.resolveComponent("KTruncate"),C=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Fc,[t.createVNode(t.unref(Ra),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":T.value,fetcher:t.unref(S),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:m.value,"table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onClearSearchInput:g,"onClick:row":D[1]||(D[1]=M=>A(M)),onSort:x},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(nc),{modelValue:m.value,"onUpdate:modelValue":D[0]||(D[0]=M=>m.value=M),config:s.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(he),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createVNode(t.unref(bt)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,F.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:t.withCtx(({rowValue:M})=>[t.createElementVNode("span",Oc,t.toDisplayString(M),1)]),tags:t.withCtx(({rowValue:M})=>[t.createVNode(y,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M,z=>(t.openBlock(),t.createBlock(k,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:M})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(C,{"data-testid":"action-entity-copy-id",onClick:ee=>I(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(C,{"data-testid":"action-entity-copy-json",onClick:ee=>B(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(he),{"auth-function":()=>e.canRetrieve(M)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-view","has-divider":"",item:f(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canEdit(M)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-edit",item:b(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canDelete(M)},{default:t.withCtx(()=>[t.createVNode(C,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>$(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(za),{"action-pending":w.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":N.value&&(N.value.name||N.value.id),"entity-type":t.unref(at).Upstream,error:E.value,title:t.unref(n)("upstreams.delete.title"),visible:V.value,onCancel:U,onProceed:O},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),ue=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Uc=ue($c,[["__scopeId","data-v-9f2efb47"]]),Ye="/v2/control-planes/{controlPlaneId}/core-entities",Ge="/{workspace}",Xe={list:{konnect:`${Ye}/upstreams/{upstreamId}/targets`,kongManager:`${Ge}/upstreams/{upstreamId}/targets`},form:{konnect:{create:`${Ye}/upstreams/{upstreamId}/targets`,edit:`${Ye}/upstreams/{upstreamId}/targets/{id}`,validate:`${Ye}/v1/schemas/json/target/validate`},kongManager:{create:`${Ge}/upstreams/{upstreamId}/targets`,edit:`${Ge}/upstreams/{upstreamId}/targets/{id}`,validate:`${Ge}/schemas/targets/validate`}}},Dc={class:"kong-ui-entities-target-form"},Mc={class:"target-form-container"},jc={key:0,class:"target-form-info"},lr=ue(t.defineComponent({__name:"TargetForm",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.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var A;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),{getMessageFromError:i}=Za(),{axiosInstance:o}=Je((A=l.config)==null?void 0:A.axiosRequestConfig),d=t.computed(()=>{var f;return Xe.form[l.config.app].edit.replace(/{upstreamId}/gi,((f=l.config)==null?void 0:f.upstreamId)||"")}),c=t.computed(()=>l.targetId?ie.Edit:ie.Create),h=t.computed(()=>c.value===ie.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),p=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),m={target:"",weight:100,tags:""},s=t.computed(()=>{const f=parseInt(p.fields.weight.toString(),10);return f<0||f>65535}),S=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),_=f=>{var b;p.fields.target=(f==null?void 0:f.target)||"",p.fields.weight=(f==null?void 0:f.weight)??"",p.fields.tags=((b=f==null?void 0:f.tags)==null?void 0:b.join(", "))||"",Object.assign(u,p.fields)},g=()=>{p.errorMessage="",a("cancel")},x=t.computed(()=>{var b,N;let f=`${l.config.apiBaseUrl}${Xe.form[l.config.app].validate}`;return l.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((b=l.config)==null?void 0:b.controlPlaneId)||""):l.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(N=l.config)!=null&&N.workspace?`/${l.config.workspace}`:"")),f=f.replace(/{id}/gi,l.targetId),f}),T=t.computed(()=>{var b,N,V,w;let f=`${l.config.apiBaseUrl}${Xe.form[l.config.app][c.value]}`;return l.config.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,((b=l.config)==null?void 0:b.controlPlaneId)||"").replace(/{upstreamId}/gi,((N=l.config)==null?void 0:N.upstreamId)||""):l.config.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(V=l.config)!=null&&V.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((w=l.config)==null?void 0:w.upstreamId)||"")),f=f.replace(/{id}/gi,l.targetId),f}),I=t.computed(()=>{var f,b,N;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(N=(b=(f=p.fields.tags)==null?void 0:f.split(","))==null?void 0:b.map(V=>String(V||"").trim()))==null?void 0:N.filter(V=>V!==""),upstream:{id:l.config.upstreamId}}}),B=async()=>{var f,b;try{p.isReadonly=!0,p.errorMessage="";let N;if(await o.post(x.value,I.value),c.value==="create"?N=await o.post(T.value,I.value):c.value==="edit"&&(N=((f=l.config)==null?void 0:f.app)==="konnect"?await o.put(T.value,I.value):await o.patch(T.value,I.value)),N){const{data:V}=N;p.fields.target=(V==null?void 0:V.name)||"",p.fields.weight=(V==null?void 0:V.weight)??100,p.fields.tags=((b=V==null?void 0:V.tags)==null?void 0:b.join(", "))||"",a("update",V),Object.assign(p.fields,m)}}catch(N){p.errorMessage=i(N),a("error",N)}finally{p.isReadonly=!1}};return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,m)}),(f,b)=>{const N=t.resolveComponent("KInput"),V=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(V,{"action-button-disabled":!S.value||p.isReadonly,"action-button-text":t.unref(n)("targets.form.buttons.save"),"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),title:h.value,visible:e.isVisible,onCancel:g,onProceed:B},{default:t.withCtx(()=>[t.createElementVNode("div",Dc,[t.createVNode(t.unref(Pa),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":I.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":b[3]||(b[3]=w=>f.$emit("error",w)),"onFetch:success":_,onLoading:b[4]||(b[4]=w=>f.$emit("loading",w))},{default:t.withCtx(()=>[t.createElementVNode("div",Mc,[f.$slots.info?(t.openBlock(),t.createElementBlock("div",jc,[t.renderSlot(f.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(N,{modelValue:p.fields.target,"onUpdate:modelValue":b[0]||(b[0]=w=>p.fields.target=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(N,{modelValue:p.fields.weight,"onUpdate:modelValue":b[1]||(b[1]=w=>p.fields.weight=w),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:p.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(N,{modelValue:p.fields.tags,"onUpdate:modelValue":b[2]||(b[2]=w=>p.fields.tags=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-cfae2d2a"]]),Kc={class:"kong-ui-entities-targets-list"},Lc={class:"target-address"},Pc=ue(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var K;const a=r,l=e,{i18n:{t:n}}=pe.useI18n(),{axiosInstance:i}=Je((K=l.config)==null?void 0:K.axiosRequestConfig),o=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:n("targets.list.table_headers.target_address"),sortable:!0,hidable:!1},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var y,C,R,M;let k=`${l.config.apiBaseUrl}${Xe.list[l.config.app]}`;return l.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((y=l.config)==null?void 0:y.controlPlaneId)||"").replace(/{upstreamId}/gi,((C=l.config)==null?void 0:C.upstreamId)||""):l.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(R=l.config)!=null&&R.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((M=l.config)==null?void 0:M.upstreamId)||"")),k}),{fetcher:u,fetcherState:m}=Ya(l.config,p.value),s=()=>{o.value++},S=t.ref(null),_=()=>{j.value=!0},g=(k,y)=>{const C=k.id;if(!y(C)){a("copy:error",{entity:k,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:k,field:"id",message:n("targets.copy.success",{val:C})})},x=(k,y)=>{const C=JSON.stringify(k);if(!y(C)){a("copy:error",{entity:k,message:n("targets.errors.copy")});return}a("copy:success",{entity:k,message:n("targets.copy.success_brief")})},T=k=>{F.value=k,j.value=!0},I=k=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(k),B=k=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(k),A=t.ref(void 0),f=t.ref(!1),b=t.ref(!1),N=t.ref(""),V=Qa(l.config,p.value),w=k=>{A.value=k,f.value=!0},E=()=>{f.value=!1},H=async()=>{var k,y,C;if((k=A.value)!=null&&k.id){b.value=!0;try{await i.delete(V(A.value.id)),b.value=!1,f.value=!1,o.value++,a("delete:success",A.value)}catch(R){N.value=((C=(y=R.response)==null?void 0:y.data)==null?void 0:C.message)||R.message||n("targets.errors.delete"),a("error",R)}finally{b.value=!1}}},$=t.ref(!1);t.watch(m,k=>{var y,C,R,M;if(Array.isArray((y=k==null?void 0:k.response)==null?void 0:y.data)&&($.value=k.response.data.length>0),k.status===fe.Error){S.value={title:n("targets.errors.general")},(M=(R=(C=k.error)==null?void 0:C.response)==null?void 0:R.data)!=null&&M.message&&(S.value.message=k.error.response.data.message),a("error",k.error);return}S.value=null});const U=t.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(U.value.title=n("targets.list.empty_state.title"),U.value.ctaText=n("targets.actions.create"))});const O=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,axiosRequestConfig:l.config.axiosRequestConfig,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace}})),F=t.ref(""),j=t.ref(!1),Z=k=>{F.value?a("update:target",k):a("create:target",k),v()},v=()=>{D(),o.value++},D=()=>{j.value=!1,F.value=""};return(k,y)=>{const C=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),M=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),ee=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Kc,[t.createVNode(t.unref(Ra),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":U.value,"enable-entity-actions":"","error-message":S.value,fetcher:t.unref(u),"fetcher-cache-key":o.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:y[1]||(y[1]=()=>l.config.createRoute?void 0:_()),onSort:s},{"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(he),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(C,{appearance:"primary","data-testid":"toolbar-new-target",to:l.config.createRoute?l.config.createRoute:void 0,onClick:y[0]||(y[0]=()=>l.config.createRoute?void 0:_())},{default:t.withCtx(()=>[t.createVNode(t.unref(bt)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,$.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:P})=>[t.createElementVNode("span",Lc,t.toDisplayString(P),1)]),tags:t.withCtx(({rowValue:P})=>[t.createVNode(M,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P,ae=>(t.openBlock(),t.createBlock(R,{key:ae,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ae),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:P})=>[t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:ke=>g(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:ke=>x(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(he),{"auth-function":()=>e.canEdit(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:ae=>T(P.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>I(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:ae=>a("health-actions:healthy",P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>B(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:ae=>a("health-actions:unhealthy",P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(he),{"auth-function":()=>e.canDelete(P)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ae=>w(P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(za),{"action-pending":b.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(at).Target,error:N.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:f.value,onCancel:E,onProceed:H},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(lr,{config:O.value,"is-visible":j.value,"target-id":F.value,onCancel:D,onUpdate:Z},t.createSlots({_:2},[k.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(k.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-e6ed1cfb"]]),Rc={key:1},zc=ue(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var E,H,$,U;const{i18nT:a,i18n:{t:l}}=pe.useI18n(),n=e,i=r,{debouncedQueryChange:o,loading:d,loadItems:c,results:h,allRecords:p}=Ga(n.config,(H=Ie.form[(E=n.config)==null?void 0:E.app])==null?void 0:H.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:m,loadItems:s,results:S}=Ga(n.config,(U=Ie.form[($=n.config)==null?void 0:$.app])==null?void 0:U.getCertificates),_=t.ref(""),g=t.computed(()=>{var O;return!!n.name&&!((O=p.value)!=null&&O.some(F=>F.host===n.name))}),x=t.computed(()=>{var F,j,Z;const O=g.value&&n.name.includes((F=_.value)==null?void 0:F.toLowerCase());return(Z=h.value)==null?void 0:Z.map(v=>({label:v.host,value:v.id})).concat(O?[{label:n.name,value:((j=B.value)==null?void 0:j.value)||n.name}]:[])}),T=t.computed(()=>{var O;return(O=S.value)==null?void 0:O.map(F=>({label:F.id,value:F.id}))}),I=t.ref(""),B=t.ref({value:"",label:""}),A=t.computed(()=>{var O,F;return((O=x.value.find(j=>j.value===I.value))==null?void 0:O.label)||((F=B.value)==null?void 0:F.label)}),f=O=>{_.value=O,o(O)},b=O=>{B.value=O},N=()=>{B.value={value:"",label:""}},V=O=>{I.value=O,i("update:name",A.value)},w=t.ref(!1);return t.onBeforeMount(async()=>{var O,F;try{w.value=!0,await c(),n.name&&(I.value=((F=(O=x.value.find(j=>j.label===n.name))==null?void 0:O.value)==null?void 0:F.toString())||n.name),await s()}finally{w.value=!1}}),(O,F)=>{const j=t.resolveComponent("KSkeleton"),Z=t.resolveComponent("KSelect"),v=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[w.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",Rc,[t.createVNode(Z,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:x.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":I.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:b,onItemRemoved:N,onQueryChange:f,"onUpdate:modelValue":V},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(v,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":F[0]||(F[0]=D=>i("update:host-header",D))},null,8,["label","model-value","readonly"]),t.createVNode(Z,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:T.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(m),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":F[1]||(F[1]=D=>i("update:client-certificate",D))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(v,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":F[2]||(F[2]=D=>i("update:tags",D))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),et={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},Jc={class:"fields-group-title"},Wc={class:"fields-group-text"},Qc={class:"fields-group-title"},Zc={class:"fields-group-text"},Yc=ue(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=pe.useI18n(),{inRange:n}=Ze(),i=e,o=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>i.hashOn,(u,m)=>{m==="header"&&u!==m&&o("update:hash-on-header",""),m==="cookie"&&u!==m&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),m==="query_arg"&&u!==m&&o("update:hash-on-query-argument",""),m==="uri_capture"&&u!==m&&o("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(o("update:hash-fallback","none"),o("update:hash-fallback-header",""),o("update:hash-fallback-query-argument",""),o("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,m)=>{m==="header"&&u!==m&&o("update:hash-fallback-header",""),m==="cookie"&&u!==m&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),m==="query_arg"&&u!==m&&o("update:hash-fallback-query-argument",""),m==="uri_capture"&&u!==m&&o("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?n(i.slots,Ct,wt)?"":l("upstreams.form.errors.in_range"):"");return(u,m)=>{const s=t.resolveComponent("KExternalLink"),S=t.resolveComponent("KSelect"),_=t.resolveComponent("KInput"),g=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(S,{class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[0]||(m[0]=x=>o("update:algorithm",x))},null,8,["items","label","model-value","readonly"]),t.createVNode(_,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(wt),min:t.unref(Ct),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":m[1]||(m[1]=x=>o("update:slots",x))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Jc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",Wc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(S,{class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[2]||(m[2]=x=>o("update:hash-on",x))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(_,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[3]||(m[3]=x=>o("update:hash-on-header",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(_,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[4]||(m[4]=x=>o("update:hash-on-cookie",x))},null,8,["label","model-value","readonly"]),t.createVNode(_,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[5]||(m[5]=x=>o("update:hash-on-cookie-path",x))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(_,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[6]||(m[6]=x=>o("update:hash-on-query-argument",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(_,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[7]||(m[7]=x=>o("update:hash-on-uri-capture",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Qc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",Zc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(S,{class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[8]||(m[8]=x=>o("update:hash-fallback",x))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(_,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[9]||(m[9]=x=>o("update:hash-fallback-header",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(_,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[10]||(m[10]=x=>o("update:hash-on-cookie",x))},null,8,["label","model-value","readonly"]),t.createVNode(_,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[11]||(m[11]=x=>o("update:hash-on-cookie-path",x))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(_,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[12]||(m[12]=x=>o("update:hash-fallback-query-argument",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(_,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":m[13]||(m[13]=x=>o("update:hash-fallback-uri-capture",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),Gc={class:"fields-group-title"},Xc={class:"fields-group-text"},ed={class:"fields-group-title"},td={class:"fields-group-text"},ad=ue(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),l=r;return(n,i)=>{const o=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(o,{"hide-icon":"",href:t.unref(et).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Gc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",Xc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:i[0]||(i[0]=p=>l("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",ed,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",td,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:i[1]||(i[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(Ac),min:t.unref(Tc),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),rd="#d60027",ld={key:2},nd={class:"fields-group-title"},od={class:"fields-group-text"},id={class:"fields-group-title"},sd={class:"fields-group-text"},cd=ue(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),{objectsAreEqual:l}=Ze(),n=e,i=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:h}=$e({replaceId:!0}),{trackNewItems:p}=$e({replaceId:!0});t.watch(()=>n.type,(_,g)=>{g==="tcp"&&_!==g&&i("update:tcp-failures","5"),(g==="https"||g==="grpcs")&&_!==g&&(i("update:https-sni",""),i("update:verify-ssl",!1)),g!=="tcp"&&_==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",St),i("update:unhealthy-http-statuses",xt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,_=>{l(u.value,_)||(u.value=[..._])},{immediate:!0,deep:!0});const m=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),m()},S=_=>{_===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(_,1),m()};return(_,g)=>{const x=t.resolveComponent("KExternalLink"),T=t.resolveComponent("KSelect"),I=t.resolveComponent("KInput"),B=t.resolveComponent("KCheckbox"),A=t.resolveComponent("KLabel"),f=t.resolveComponent("KButton"),b=t.resolveComponent("KMultiselect"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(x,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var V;return[t.createVNode(T,{class:"active-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":g[0]||(g[0]=w=>i("update:type",w))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":g[1]||(g[1]=w=>i("update:http-path",w))},null,8,["label","model-value","readonly"])),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(Ec),min:t.unref(Hc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":g[2]||(g[2]=w=>i("update:timeout",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(vc),min:t.unref(qc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":g[3]||(g[3]=w=>i("update:concurrency",w))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":g[4]||(g[4]=w=>i("update:https-sni",w))},null,8,["label","model-value","readonly"]),t.createVNode(B,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":g[5]||(g[5]=w=>i("update:verify-ssl",w))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((V=e.config)==null?void 0:V.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",ld,[t.createVNode(A,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(w,E)=>(t.openBlock(),t.createElementBlock("div",{key:`${w.header}_${E}`,class:t.normalizeClass(["headers-row",{"margin-top-6":E>0}])},[t.createVNode(I,{modelValue:u.value[E].key,"onUpdate:modelValue":H=>u.value[E].key=H,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${E+1}`,readonly:e.readonly,type:"text",onBlur:m},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(I,{modelValue:u.value[E].values,"onUpdate:modelValue":H=>u.value[E].values=H,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${E+1}`,readonly:e.readonly,type:"text",onBlur:m},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(f,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",disabled:u.value.length===1,icon:"",onClick:H=>S(E)},{default:t.withCtx(()=>[t.createVNode(t.unref(Vc),{class:"delete-item",color:u.value.length>1?t.unref(rd):void 0},null,8,["color"])]),_:2},1032,["disabled","onClick"]),u.value&&E===u.value.length-1?(t.openBlock(),t.createBlock(f,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",icon:"",onClick:s},{default:t.withCtx(()=>[t.createVNode(t.unref(bt))]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",nd,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",od,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(rr),min:t.unref(ar),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[6]||(g[6]=w=>i("update:interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":g[7]||(g[7]=w=>i("update:successes",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[8]||(g[8]=w=>t.unref(h)(w,!0)),onItemRemoved:g[9]||(g[9]=w=>t.unref(h)(w,!1)),"onUpdate:modelValue":g[10]||(g[10]=w=>i("update:http-statuses",w))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",id,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",sd,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(rr),min:t.unref(ar),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[11]||(g[11]=w=>i("update:unhealthy-interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[12]||(g[12]=w=>i("update:tcp-failures",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[13]||(g[13]=w=>i("update:http-failures",w))},null,8,["label","max","min","model-value","readonly"])),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(b,{key:1,autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[14]||(g[14]=w=>t.unref(p)(w,!0)),onItemRemoved:g[15]||(g[15]=w=>t.unref(p)(w,!1)),"onUpdate:modelValue":g[16]||(g[16]=w=>i("update:unhealthy-http-statuses",w))},null,8,["items","label","model-value","readonly"])),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(tr),min:t.unref(er),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":g[17]||(g[17]=w=>i("update:unhealthy-timeouts",w))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-efccf560"]]),dd={class:"fields-group-title"},hd={class:"fields-group-text"},pd={class:"fields-group-title"},ud={class:"fields-group-text"},fd=ue(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=pe.useI18n(),l=e,n=r,i=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),o=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=$e({replaceId:!0}),{trackNewItems:c}=$e({replaceId:!0});return t.watch(()=>l.type,(h,p)=>{p==="tcp"&&h!==p&&n("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(n("update:http-statuses",_t),n("update:unhealthy-http-statuses",Nt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),m=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),S=t.resolveComponent("KMultiselect"),_=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(et).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(m,{class:"passive-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=g=>n("update:type",g))},null,8,["items","label","model-value","readonly"]),t.createVNode(_,null,{default:t.withCtx(()=>[t.createElementVNode("h5",dd,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",hd,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=g=>n("update:successes",g))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=g=>t.unref(d)(g,!0)),onItemRemoved:p[3]||(p[3]=g=>t.unref(d)(g,!1)),"onUpdate:modelValue":p[4]||(p[4]=g=>n("update:http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(_,null,{default:t.withCtx(()=>[t.createElementVNode("h5",pd,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",ud,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(tr),min:t.unref(er),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=g=>n("update:timeouts",g))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(s,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=g=>n("update:tcp-failures",g))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(s,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Ne),min:t.unref(xe),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=g=>n("update:http-failures",g))},null,8,["label","max","min","model-value","readonly"])),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:1,autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Qe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=g=>t.unref(c)(g,!0)),onItemRemoved:p[9]||(p[9]=g=>t.unref(c)(g,!1)),"onUpdate:modelValue":p[10]||(p[10]=g=>n("update:unhealthy-http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-5bd9952e"]]),md={class:"kong-ui-entities-upstreams-form"},gd=ue(t.defineComponent({__name:"UpstreamsForm",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))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:r}){var K;const a=e,l=r,{inRange:n,stringToNumberArray:i,upstreamsResponseToFields:o,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=Ze(),{axiosInstance:p}=Je((K=a.config)==null?void 0:K.axiosRequestConfig),{getMessageFromError:u}=Za(),m=tt.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),S=t.reactive(d()),_=t.computed(()=>!c(s.fields,S)),g=k=>{s.fields.activeHealthCheck.interval=k?"5":"0",s.fields.activeHealthCheck.successes=k?"5":"0",s.fields.activeHealthCheck.httpFailures=k?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=k?"5":"0",s.fields.activeHealthCheck.tcpFailures=k?"5":"0"},x=k=>{s.fields.passiveHealthCheck.timeouts=k?"5":"0",s.fields.passiveHealthCheck.successes=k?"80":"0",s.fields.passiveHealthCheck.tcpFailures=k?"5":"0",s.fields.passiveHealthCheck.httpFailures=k?"5":"0"},T=t.computed(()=>s.fields.slots?n(s.fields.slots,Ct,wt):!0),I=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),B=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),A=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),f=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),b=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),N=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),V=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),w=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),E=t.computed(()=>!!s.fields.name&&T.value&&I.value&&B.value&&A.value&&f.value&&b.value&&N.value&&V.value&&w.value),H=t.computed(()=>a.upstreamId?ie.Edit:ie.Create),$=t.computed(()=>{var k,y;return(y=Ie.form[(k=a.config)==null?void 0:k.app])==null?void 0:y.edit}),U=k=>{Object.assign(s.fields,o(k)),Object.assign(S,h(s.fields))},O=()=>{var k;m.push(((k=a.config)==null?void 0:k.cancelRoute)||{name:"upstreams-list"})},F=k=>{l("loading",k)},j=k=>{l("error",k)},Z=t.computed(()=>{var y,C,R,M,z;const k={name:s.fields.name,slots:Number(s.fields.slots),algorithm:s.fields.algorithm,hash_on:s.fields.hashOn,hash_fallback:s.fields.hashFallback,healthchecks:{}};return s.fields.hostHeader&&(k.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(k.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(k.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(k.tags=(C=(y=s.fields.tags.split(","))==null?void 0:y.map(ee=>String(ee||"").trim()))==null?void 0:C.filter(ee=>ee!=="")),s.fields.hashOn==="header"&&(k.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(k.hash_on_cookie=s.fields.hashOnCookie,k.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(k.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(k.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(k.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(k.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(k.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(k.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(k.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(k.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(k.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?k.healthchecks.active.headers=[]:k.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((ee,P)=>{var ae,ke;return P.key?{...ee,[P.key]:(ke=(ae=P.values.split(","))==null?void 0:ae.map(Te=>String(Te||"").trim()))==null?void 0:ke.filter(Te=>Te!=="")}:{...ee}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(k.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(k.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(k.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(k.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(k.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(k.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(k.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(k.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.tcpFailures&&(k.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((M=a.config)==null?void 0:M.app)==="kongManager"&&H.value===ie.Edit&&(k.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0,successes:0},unhealthy:{interval:0,http_failures:0,tcp_failures:0}}),s.fields.passiveHealthSwitch?(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(k.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(k.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(k.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(k.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.tcpFailures&&(k.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&H.value===ie.Edit&&(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),k}),v=k=>{var C,R,M,z,ee,P;let y=`${(C=a.config)==null?void 0:C.apiBaseUrl}${Ie.form[(R=a.config)==null?void 0:R.app][k]}`;return((M=a.config)==null?void 0:M.app)==="konnect"?y=y.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((ee=a.config)==null?void 0:ee.app)==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(P=a.config)!=null&&P.workspace?`/${a.config.workspace}`:"")),y=y.replace(/{id}/gi,a.upstreamId),y},D=async()=>{var k;try{s.readonly=!0,await p.post(v("validate"),Z.value);let y;H.value===ie.Create?y=await p.post(v("create"),Z.value):H.value===ie.Edit&&(y=((k=a.config)==null?void 0:k.app)==="konnect"?await p.put(v("edit"),Z.value):await p.patch(v("edit"),Z.value)),l("update",y==null?void 0:y.data)}catch(y){s.errorMessage=u(y),l("error",y)}finally{s.readonly=!1}};return(k,y)=>(t.openBlock(),t.createElementBlock("div",md,[t.createVNode(t.unref(Pa),{"can-submit":E.value&&_.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":$.value,"form-fields":Z.value,"is-readonly":s.readonly,onCancel:O,"onFetch:error":j,"onFetch:success":U,onLoading:F,onSubmit:D},{default:t.withCtx(()=>[t.createVNode(zc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":y[0]||(y[0]=C=>s.fields.clientCertificate=C),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":y[1]||(y[1]=C=>s.fields.hostHeader=C),name:s.fields.name,"onUpdate:name":y[2]||(y[2]=C=>s.fields.name=C),tags:s.fields.tags,"onUpdate:tags":y[3]||(y[3]=C=>s.fields.tags=C),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(Yc,{algorithm:s.fields.algorithm,"onUpdate:algorithm":y[4]||(y[4]=C=>s.fields.algorithm=C),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":y[5]||(y[5]=C=>s.fields.hashFallback=C),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":y[6]||(y[6]=C=>s.fields.hashFallbackHeader=C),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":y[7]||(y[7]=C=>s.fields.hashFallbackQueryArgument=C),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":y[8]||(y[8]=C=>s.fields.hashFallbackUriCapture=C),"hash-on":s.fields.hashOn,"onUpdate:hashOn":y[9]||(y[9]=C=>s.fields.hashOn=C),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":y[10]||(y[10]=C=>s.fields.hashOnCookie=C),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":y[11]||(y[11]=C=>s.fields.hashOnCookiePath=C),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":y[12]||(y[12]=C=>s.fields.hashOnHeader=C),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":y[13]||(y[13]=C=>s.fields.hashOnQueryArgument=C),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":y[14]||(y[14]=C=>s.fields.hashOnUriCapture=C),slots:s.fields.slots,"onUpdate:slots":y[15]||(y[15]=C=>s.fields.slots=C),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(ad,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[y[16]||(y[16]=C=>s.fields.activeHealthSwitch=C),g],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":y[17]||(y[17]=C=>s.fields.healthchecksThreshold=C),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[y[18]||(y[18]=C=>s.fields.passiveHealthSwitch=C),x],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(cd,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":y[19]||(y[19]=C=>s.fields.activeHealthCheck.concurrency=C),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":y[20]||(y[20]=C=>s.fields.activeHealthCheck.headers=C),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":y[21]||(y[21]=C=>s.fields.activeHealthCheck.httpFailures=C),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":y[22]||(y[22]=C=>s.fields.activeHealthCheck.httpPath=C),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[23]||(y[23]=C=>s.fields.activeHealthCheck.httpStatuses=C),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":y[24]||(y[24]=C=>s.fields.activeHealthCheck.httpsSni=C),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":y[25]||(y[25]=C=>s.fields.activeHealthCheck.interval=C),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":y[26]||(y[26]=C=>s.fields.activeHealthCheck.successes=C),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[27]||(y[27]=C=>s.fields.activeHealthCheck.tcpFailures=C),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":y[28]||(y[28]=C=>s.fields.activeHealthCheck.timeout=C),type:s.fields.activeHealthCheck.type,"onUpdate:type":y[29]||(y[29]=C=>s.fields.activeHealthCheck.type=C),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[30]||(y[30]=C=>s.fields.activeHealthCheck.unhealthyHttpStatuses=C),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":y[31]||(y[31]=C=>s.fields.activeHealthCheck.unhealthyInterval=C),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":y[32]||(y[32]=C=>s.fields.activeHealthCheck.unhealthyTimeouts=C),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":y[33]||(y[33]=C=>s.fields.activeHealthCheck.verifySsl=C),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(fd,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":y[34]||(y[34]=C=>s.fields.passiveHealthCheck.httpFailures=C),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[35]||(y[35]=C=>s.fields.passiveHealthCheck.httpStatuses=C),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":y[36]||(y[36]=C=>s.fields.passiveHealthCheck.successes=C),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[37]||(y[37]=C=>s.fields.passiveHealthCheck.tcpFailures=C),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":y[38]||(y[38]=C=>s.fields.passiveHealthCheck.timeouts=C),type:s.fields.passiveHealthCheck.type,"onUpdate:type":y[39]||(y[39]=C=>s.fields.passiveHealthCheck.type=C),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[40]||(y[40]=C=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=C),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-0f247a1c"]]),yd=t.createElementVNode("code",null,"10",-1),kd=t.createElementVNode("code",null,"65536",-1),bd={"data-testid":"client_certificate-plain-text"},Cd=t.defineComponent({__name:"UpstreamsConfigCard",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"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=pe.useI18n(),{getPropValue:n}=yc(),i=t.computed(()=>Ie.form[r.config.app].edit),o=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:J.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:J.Basic},hash_on:{order:7,section:J.Basic},hash_on_header:{order:8,section:J.Basic},hash_on_uri_capture:{order:9,section:J.Basic},hash_on_query_arg:{order:10,section:J.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:J.Basic},hash_on_cookie_path:{order:12,section:J.Basic},healthchecks:{order:13,section:J.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(As),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":o.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onFetch:error":c[0]||(c[0]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[1]||(c[1]=h=>d.$emit("fetch:success",h)),onLoading:c[2]||(c[2]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(h.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[yd]),max:t.withCtx(()=>[kd]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",bd,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(n)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});re.TargetForm=lr,re.TargetsList=Pc,re.UpstreamsConfigCard=Cd,re.UpstreamsForm=gd,re.UpstreamsList=Uc,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
23
+ `),o=n?"+":l?"":"-";return a+o+`
24
+ `}function Ka(e){return e[e.length-1]===`
25
+ `?e.slice(0,-1):e}function Si(e,r){for(var a=/(\n+)([^\n]*)/g,l=function(){var p=e.indexOf(`
26
+ `);return p=p!==-1?p:e.length,a.lastIndex=p,La(e.slice(0,p),r)}(),n=e[0]===`
27
+ `||e[0]===" ",o,i;i=a.exec(e);){var d=i[1],c=i[2];o=c[0]===" ",l+=d+(!n&&!o&&c!==""?`
28
+ `:"")+La(c,r),n=o}return l}function La(e,r){if(e===""||e[0]===" ")return e;for(var a=/ [^ ]/g,l,n=0,o,i=0,d=0,c="";l=a.exec(e);)d=l.index,d-n>r&&(o=i>n?i:d,c+=`
29
+ `+e.slice(n,o),n=o+1),i=d;return c+=`
30
+ `,e.length-n>r&&i>n?c+=e.slice(n,i)+`
31
+ `+e.slice(i+1):c+=e.slice(n),c.slice(1)}function xi(e){for(var r="",a=0,l,n=0;n<e.length;a>=65536?n+=2:n++)a=Oe(e,n),l=te[a],!l&&qe(a)?(r+=e[n],a>=65536&&(r+=e[n+1])):r+=l||mi(a);return r}function Ni(e,r,a){var l="",n=e.tag,o,i,d;for(o=0,i=a.length;o<i;o+=1)d=a[o],e.replacer&&(d=e.replacer.call(a,String(o),d)),(he(e,r,d,!1,!1)||typeof d>"u"&&he(e,r,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=n,e.dump="["+l+"]"}function Pa(e,r,a,l){var n="",o=e.tag,i,d,c;for(i=0,d=a.length;i<d;i+=1)c=a[i],e.replacer&&(c=e.replacer.call(a,String(i),c)),(he(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&he(e,r+1,null,!0,!0,!1,!0))&&((!l||n!=="")&&(n+=kt(e,r)),e.dump&&ve===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=o,e.dump=n||"[]"}function Vi(e,r,a){var l="",n=e.tag,o=Object.keys(a),i,d,c,p,h;for(i=0,d=o.length;i<d;i+=1)h="",l!==""&&(h+=", "),e.condenseFlow&&(h+='"'),c=o[i],p=a[c],e.replacer&&(p=e.replacer.call(a,c,p)),he(e,r,c,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),he(e,r,p,!1,!1)&&(h+=e.dump,l+=h));e.tag=n,e.dump="{"+l+"}"}function Bi(e,r,a,l){var n="",o=e.tag,i=Object.keys(a),d,c,p,h,u,f;if(e.sortKeys===!0)i.sort();else if(typeof e.sortKeys=="function")i.sort(e.sortKeys);else if(e.sortKeys)throw new le("sortKeys must be a boolean or a function");for(d=0,c=i.length;d<c;d+=1)f="",(!l||n!=="")&&(f+=kt(e,r)),p=i[d],h=a[p],e.replacer&&(h=e.replacer.call(a,p,h)),he(e,r+1,p,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&ve===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=kt(e,r)),he(e,r+1,h,!0,u)&&(e.dump&&ve===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,n+=f));e.tag=o,e.dump=n||"{}"}function Ra(e,r,a){var l,n,o,i,d,c;for(n=a?e.explicitTypes:e.implicitTypes,o=0,i=n.length;o<i;o+=1)if(d=n[o],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof r=="object"&&r instanceof d.instanceOf)&&(!d.predicate||d.predicate(r))){if(a?d.multi&&d.representName?e.tag=d.representName(r):e.tag=d.tag:e.tag="?",d.represent){if(c=e.styleMap[d.tag]||d.defaultStyle,Ba.call(d.represent)==="[object Function]")l=d.represent(r,c);else if(Ia.call(d.represent,c))l=d.represent[c](r,c);else throw new le("!<"+d.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function he(e,r,a,l,n,o,i){e.tag=null,e.dump=a,Ra(e,a,!1)||Ra(e,a,!0);var d=Ba.call(e.dump),c=l,p;l&&(l=e.flowLevel<0||e.flowLevel>r);var h=d==="[object Object]"||d==="[object Array]",u,f;if(h&&(u=e.duplicates.indexOf(a),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&r>0)&&(n=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(h&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")l&&Object.keys(e.dump).length!==0?(Bi(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(Vi(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!i&&r>0?Pa(e,r-1,e.dump,n):Pa(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(Ni(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&_i(e,e.dump,r,o,c);else{if(d==="[object Undefined]"||e.skipInvalid)return!1;throw new le("unacceptable kind of an object to dump "+d)}e.tag!==null&&e.tag!=="?"&&(p=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?p="!"+p:p.slice(0,18)==="tag:yaml.org,2002:"?p="!!"+p.slice(18):p="!<"+p+">",e.dump=p+" "+e.dump)}return!0}function Ii(e,r){var a=[],l=[],n,o;for(Ct(e,a,l),n=0,o=l.length;n<o;n+=1)r.duplicates.push(a[l[n]]);r.usedDuplicates=new Array(o)}function Ct(e,r,a){var l,n,o;if(e!==null&&typeof e=="object")if(n=r.indexOf(e),n!==-1)a.indexOf(n)===-1&&a.push(n);else if(r.push(e),Array.isArray(e))for(n=0,o=e.length;n<o;n+=1)Ct(e[n],r,a);else for(l=Object.keys(e),n=0,o=l.length;n<o;n+=1)Ct(e[l[n]],r,a)}function Ti(e,r){r=r||{};var a=new yi(r);a.noRefs||Ii(e,a);var l=e;return a.replacer&&(l=a.replacer.call({"":l},"",l)),he(a,0,l,!0,!0)?a.dump+`
32
+ `:""}var Ai=Ti,Ei={dump:Ai};function wt(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var Hi=G,vi=Jt,$i=Zt,qi=aa,Oi=ra,Fi=pt,Ui=Va.load,Di=Va.loadAll,Mi=Ei.dump,ji=le,Ki={binary:sa,float:ta,map:Yt,null:Gt,pairs:da,set:ha,timestamp:oa,bool:Xt,int:ea,merge:ia,omap:ca,seq:Qt,str:Wt},Li=wt("safeLoad","load"),Pi=wt("safeLoadAll","loadAll"),Ri=wt("safeDump","dump"),zi={Type:Hi,Schema:vi,FAILSAFE_SCHEMA:$i,JSON_SCHEMA:qi,CORE_SCHEMA:Oi,DEFAULT_SCHEMA:Fi,load:Ui,loadAll:Di,dump:Mi,YAMLException:ji,types:Ki,safeLoad:Li,safeLoadAll:Pi,safeDump:Ri};const Ji={class:"yaml-config"},za=t.defineComponent({__name:"YamlCodeBlock",props:{entityRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>{const l=Object.fromEntries(Object.entries(r.entityRecord).filter(([,n])=>n!==null&&n!==""&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(l).length===0&&l.constructor===Object?"":zi.dump(l).trim()});return(l,n)=>{const o=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Ji,[r.entityRecord?(t.openBlock(),t.createBlock(o,{key:0,id:"yaml-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Wi={class:"terraform-config"},ne=" ",Ja=t.defineComponent({__name:"TerraformCodeBlock",props:{entityRecord:{type:Object,required:!0},entityType:{type:String,required:!0,validator:e=>je.includes(e)}},setup(e){const r=e,a=(d,c)=>{const p=ne;let h="";return typeof d=="string"?h+=`
33
+ ${p}${c} = "${d}"`:h+=`
34
+ ${p}${c} = ${String(d??"")}`,h},l=(d,c,p="")=>{if(typeof d!="object")return"Invalid object";const h=ne+p;let u="";if(c&&(u+=`
35
+ ${h}${c} = {
36
+ `),d===null)return c?u+=`${h}}`:u="{}",u;const f=Object.fromEntries(Object.entries(d).filter(([,b])=>b!==null));let s="";for(const[b,S]of Object.entries(f))Array.isArray(S)?S.length===0?s="[]":(s=`[
37
+ `,s+=n(S,void 0,h),s+=`${h}${ne}]`):S&&typeof S=="object"?(s=`{
38
+ `,s+=l(S,void 0,h),s+=`${h}${ne}}`):s=String(S??""),typeof S=="string"&&(s=`"${s}"`),u+=`${h}${ne}${b} = ${s}
39
+ `;return c?u+=`${h}}`:u},n=(d,c,p="")=>{if(!Array.isArray(d))return"Invalid array";const h=ne+p;let u="";c&&(d.length===0?u+=`${h}${c} = [`:u+=`
40
+ ${h}${c} = [
41
+ `);for(let f=0;f<d.length;f++){const s=d[f];typeof s=="object"?(u+=`${h}${ne}{
42
+ `,u+=l(s,void 0,h),u+=`${h}${ne}}`):typeof s=="string"?u+=`${h}${ne}"${s}"`:u+=`${h}${ne}${String(s??"")}`,f<d.length-1&&(u+=","),u+=`
43
+ `}return c&&(d.length===0?u+="]":u+=`${h}]`),u},o=d=>{let c="";for(const[p,h]of Object.entries(d))Array.isArray(h)?c+=n(h,p):typeof h=="object"?c+=l(h,p):c+=a(h,p);return c},i=t.computed(()=>{var d,c,p,h,u,f,s;const b=Object.fromEntries(Object.entries(r.entityRecord).filter(([,B])=>B!=null)),S=r.entityRecord.config?Object.fromEntries(Object.entries((d=r.entityRecord)==null?void 0:d.config).filter(([,B])=>B!=null)):void 0;if(S&&(b.config=S),Object.keys(b).length===0)return"";delete b.id;let g="",x="";if((c=b.service)!=null&&c.id?(x="service",delete b.service):(p=b.route)!=null&&p.id?(x="route",delete b.route):(h=b.consumer)!=null&&h.id?(x="consumer",delete b.consumer):(u=b.consumer_group)!=null&&u.id?(x="consumer_group",delete b.consumer_group):(f=b.certificate)!=null&&f.id?(x="certificate",delete b.certificate):(s=b.key_set)!=null&&s.id&&(x="key_set",delete b.key_set),r.entityType==="plugin"){const B=(b.name+"").replace(/-/g,"_");delete b.name,g+=`resource "konnect_gateway_plugin_${B}" "my_${B}" {`}else g+=`resource "konnect_gateway_${r.entityType}" "my_${r.entityType}" {`;return g+=o(b),g+=`
44
+ ${ne}control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
45
+ `,x&&(g+=`
46
+ ${ne}${x} = {
47
+ `,g+=`${ne}${ne}id = konnect_gateway_${x}.my_${x}.id
48
+ `,g+=`${ne}}
49
+ `),g+=`}
50
+ `,g});return(d,c)=>{const p=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Wi,[r.entityRecord?(t.openBlock(),t.createBlock(p,{key:0,id:"terraform-codeblock",code:i.value,language:"terraform",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Qi={key:0,class:"config-card-display-form"},Yi=["data-testid"],Zi={key:0,class:"config-card-prop-section-title"},Gi=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},entityType:{type:String,required:!0,validator:e=>je.includes(e)},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json","terraform"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const r=e,a=t.useSlots(),{i18n:{t:l}}=Z.useI18n(),n=i=>!!(i.tooltip||a[`${i.key}-label-tooltip`]),o=t.computed(()=>{if(!r.record)return r.record;const i=JSON.parse(JSON.stringify(r.record));return delete i.created_at,delete i.updated_at,i});return(i,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Qi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,c=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${c}-props`,class:t.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(t.openBlock(),t.createElementBlock("div",Zi,t.toDisplayString(c==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],p=>(t.openBlock(),t.createBlock(Kt,{key:p.key,item:p},t.createSlots({label:t.withCtx(()=>[t.renderSlot(i.$slots,`${p.key}-label`,{row:p},void 0,!0)]),[p.key]:t.withCtx(({rowValue:h})=>[t.renderSlot(i.$slots,p.key,{row:p,rowValue:h},void 0,!0)]),_:2},[n(p)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(i.$slots,`${p.key}-label-tooltip`,{row:p},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Yi))),128))])):t.createCommentVNode("",!0),e.format==="json"&&o.value?(t.openBlock(),t.createBlock(Lt,{key:1,config:r.config,"entity-record":o.value,"fetcher-url":r.fetcherUrl,"request-method":"get"},null,8,["config","entity-record","fetcher-url"])):t.createCommentVNode("",!0),e.format==="yaml"&&o.value?(t.openBlock(),t.createBlock(za,{key:2,"entity-record":o.value},null,8,["entity-record"])):t.createCommentVNode("",!0),e.format==="terraform"&&o.value?(t.openBlock(),t.createBlock(Ja,{key:3,"entity-record":o.value,"entity-type":r.entityType},null,8,["entity-record","entity-type"])):t.createCommentVNode("",!0)],64))}}),Xi=ie(Gi,[["__scopeId","data-v-d15be7fe"]]),de="24px",Fe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},es=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),ts=["aria-hidden"],as={key:0,"data-testid":"kui-icon-svg-title"},rs=es(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),ls=t.defineComponent({__name:"AddIcon",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:de,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-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",as,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),rs],8,ts))]),_:1},8,["aria-hidden","style"]))}}),ns=Fe(ls,[["__scopeId","data-v-c1f7c39c"]]),os=e=>(t.pushScopeId("data-v-fbe6ddff"),e=e(),t.popScopeId(),e),is=["aria-hidden"],ss={key:0,"data-testid":"kui-icon-svg-title"},cs=os(()=>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)),ds=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:de,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(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(l.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",ss,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),cs],8,is))]),_:1},8,["aria-hidden","style"]))}}),hs=Fe(ds,[["__scopeId","data-v-fbe6ddff"]]),ps=e=>(t.pushScopeId("data-v-745761f6"),e=e(),t.popScopeId(),e),us=["aria-hidden"],fs={key:0,"data-testid":"kui-icon-svg-title"},ms=ps(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),gs=t.defineComponent({__name:"ChevronDownIcon",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:de,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-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",fs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ms],8,us))]),_:1},8,["aria-hidden","style"]))}}),ys=Fe(gs,[["__scopeId","data-v-745761f6"]]),ks=e=>(t.pushScopeId("data-v-863d10eb"),e=e(),t.popScopeId(),e),bs=["aria-hidden"],Cs={key:0,"data-testid":"kui-icon-svg-title"},ws=ks(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),_s=t.defineComponent({__name:"CloseIcon",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:de,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-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",Cs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ws],8,bs))]),_:1},8,["aria-hidden","style"]))}}),Ss=Fe(_s,[["__scopeId","data-v-863d10eb"]]),xs=e=>(t.pushScopeId("data-v-d9894a05"),e=e(),t.popScopeId(),e),Ns=["aria-hidden"],Vs={key:0,"data-testid":"kui-icon-svg-title"},Bs=xs(()=>t.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),Is=t.defineComponent({__name:"MoreIcon",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:de,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon more-icon","data-testid":"kui-icon-wrapper-more-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-more-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",Vs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Bs],8,Ns))]),_:1},8,["aria-hidden","style"]))}}),Ts=Fe(Is,[["__scopeId","data-v-d9894a05"]]),As={class:"config-card-title","data-testid":"config-card-title"},Es={class:"config-card-actions"},Hs=["href"],vs={class:"config-card-details-section"},$s=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:()=>({})},entityType:{type:String,required:!0,validator:e=>je.includes(e)},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},titleTag:{type:String,default:"h2"},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:r}){var a;const l=r,n=e,{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:i}=Z.useErrors(),{convertKeyToTitle:d}=Z.useStringHelpers(),{axiosInstance:c}=Z.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),p=[{label:o("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:o("baseForm.configuration.json"),value:"json"},{label:o("baseForm.configuration.yaml"),value:"yaml"}];n.enableTerraform&&p.splice(2,0,{label:o("baseForm.configuration.terraform"),value:"terraform"});const h=t.ref("structured"),u=m=>{h.value=m==null?void 0:m.value},f={id:{type:L.ID,label:o("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:L.BadgeStatus,order:2,section:J.Basic},updated_at:{type:L.Date,label:o("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:L.Date,label:o("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:L.BadgeTag,order:-1,section:J.Basic}},s=t.ref(!1),b=t.ref(!1),S=t.ref(""),g=t.ref({}),x=t.computed(()=>{var m,C,N;if(!g.value)return[];const V=[],_=Object.keys(g.value).length;for(const H in g.value){const E=(C=(m=n.configSchema)==null?void 0:m[H])==null?void 0:C.order,F=(N=f[H])==null?void 0:N.order;let U=_;(F||F===0)&&(U=F===-1?_+1:F),E&&(U=E===-1?_+1:E),V.push([H,U])}return V.sort(function(H,E){return H[1]-E[1]}),V.map(H=>{var E,F;const U=H[0],O=(E=g.value)==null?void 0:E[U],q=((F=n.configSchema)==null?void 0:F[U])||{},j=f[U];return{key:U,value:O,hidden:q.hidden||!1,type:q.type??((j==null?void 0:j.type)||L.Text),label:q.label??((j==null?void 0:j.label)||d(U)),tooltip:q.tooltip??((j==null?void 0:j.tooltip)||void 0),section:q.section??((j==null?void 0:j.section)||J.Advanced)}}).filter(H=>!H.hidden&&H.key!==n.pluginConfigKey)}),B=t.computed(()=>{var m,C;if(!g.value||!n.pluginConfigKey)return[];const N=g.value[n.pluginConfigKey]||{},V=Object.keys(N).length,_=[];for(const H in N){const E=(C=(m=n.pluginConfigSchema)==null?void 0:m[H])==null?void 0:C.order,F=N[H];let U=F!=null&&F!==""?V-1:V;E&&(U=E===-1?V+1:E),_.push([H,U])}return _.sort(function(H,E){return H[1]-E[1]}),_.map(H=>{var E;const F=H[0],U=N[F],O=((E=n.pluginConfigSchema)==null?void 0:E[F])||{};return{key:F,value:U,hidden:O.hidden||!1,type:O.type??L.Text,label:O.label??d(F),tooltip:O.tooltip??void 0,section:J.Plugin}}).filter(H=>!H.hidden)}),T=t.computed(()=>{var m,C,N,V;return{basic:(m=x.value)==null?void 0:m.filter(_=>_.section===J.Basic),advanced:(C=x.value)==null?void 0:C.filter(_=>_.section===J.Advanced),plugin:(V=B.value)==null?void 0:V.concat((N=x.value)==null?void 0:N.filter(_=>_.section===J.Plugin))}}),I=t.computed(()=>{const m=[];return T.value.basic.length&&m.push("basic"),T.value.advanced.length&&m.push("advanced"),T.value.plugin.length&&m.push("plugin"),m}),A=t.computed(()=>{var m,C;let N=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((m=n.config)==null?void 0:m.controlPlaneId)||""):n.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(C=n.config)!=null&&C.workspace?`/${n.config.workspace}`:"")),N=N.replace(/{id}/gi,n.config.entityId),N});return t.watch(s,m=>{l("loading",m)},{immediate:!0}),t.onBeforeMount(async()=>{b.value=!1,s.value=!0;try{const{data:m}=await c.get(A.value);if(n.dataKey)if(typeof m[n.dataKey]<"u")g.value={...m[n.dataKey]};else throw new Error(o("errors.dataKeyUndefined",{dataKey:n.dataKey}));else g.value={...m};Object.keys(n.configSchema).filter(C=>n.configSchema[C].forceShow).forEach(C=>{g.value&&typeof g.value[C]>"u"&&(g.value[C]=null)}),l("fetch:success",m)}catch(m){const C=i(m);S.value=C.startsWith("code")?o("baseConfigCard.errors.load"):C,b.value=!0,l("fetch:error",m)}finally{s.value=!1}}),(m,C)=>{const N=t.resolveComponent("KLabel"),V=t.resolveComponent("KSelect"),_=t.resolveComponent("KButton"),H=t.resolveComponent("KSkeleton"),E=t.resolveComponent("KEmptyState"),F=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(F,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Es,[t.renderSlot(m.$slots,"actions",{},void 0,!0),t.createVNode(N,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(V,{"data-testid":"select-config-format",items:p,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(_,{key:0,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(hs),{size:t.unref(hn)},null,8,["size"])],8,Hs)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[s.value?(t.openBlock(),t.createBlock(H,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):b.value?(t.openBlock(),t.createBlock(E,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(S.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",vs,[t.createVNode(Xi,{config:e.config,"entity-type":e.entityType,"fetcher-url":A.value,format:h.value,"prop-list-types":I.value,"property-collections":T.value,record:g.value},t.createSlots({_:2},[t.renderList(Object.keys(m.$slots),U=>({name:U,fn:t.withCtx(({row:O,rowValue:q})=>[t.renderSlot(m.$slots,U,{row:O,rowValue:q},void 0,!0)])}))]),1032,["config","entity-type","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("span",As,[t.renderSlot(m.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),qs=ie($s,[["__scopeId","data-v-85381f68"]]),Os=["novalidate"],Fs={class:"form-actions","data-testid":"form-actions"},Us=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:""},entityType:{type:String,required:!0,validator:e=>je.includes(e)},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:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,o=lt.useRouter(),{i18n:{t:i}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),p=t.ref(!1),h=t.ref(!1),u=t.ref(""),f=t.computed(()=>n.canSubmit===!1||n.isReadonly),s=t.ref(!1),b=t.computed(()=>{var I,A;let m=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((I=n.config)==null?void 0:I.controlPlaneId)||""):n.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(A=n.config)!=null&&A.workspace?`/${n.config.workspace}`:"")),n.editId?(m=m.replace(/{id}/gi,n.editId),m):(m=m.replace(/\/{id}/gi,""),m)}),S=()=>{s.value=!s.value},g=()=>{n.config.cancelRoute?o.push(n.config.cancelRoute):x()},x=()=>{l("cancel")},B=()=>{f.value||l("submit")},T=t.ref([{title:i("baseForm.configuration.json"),hash:"#json"},{title:i("baseForm.configuration.yaml"),hash:"#yaml"}]);return n.enableTerraform&&T.value.splice(1,0,{title:i("baseForm.configuration.terraform"),hash:"#terraform"}),t.watch(()=>p.value,I=>{l("loading",I)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{h.value=!1,p.value=!0;const{data:I}=await c.get(b.value);l("fetch:success",I)}catch(I){const A=d(I);u.value=A.startsWith("code")?i("baseForm.errors.edit"):A,h.value=!0,l("fetch:error",I)}finally{p.value=!1}}),(I,A)=>{const m=t.resolveComponent("KSkeleton"),C=t.resolveComponent("KEmptyState"),N=t.resolveComponent("KAlert"),V=t.resolveComponent("KButton"),_=t.resolveComponent("KTabs"),H=t.resolveComponent("KSlideout");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[p.value?(t.openBlock(),t.createBlock(m,{key:0,type:"form"})):h.value?(t.openBlock(),t.createBlock(C,{key:1,"action-button-text":t.unref(i)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:g},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:n.noValidate,onReset:t.withModifiers(x,["prevent"]),onSubmit:t.withModifiers(B,["prevent"])},[t.renderSlot(I.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(N,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Fs,[t.renderSlot(I.$slots,"form-actions",{},()=>[t.createVNode(V,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:A[0]||(A[0]=E=>S())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.viewConfiguration")),1)]),_:1}),t.createVNode(V,{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(V,{appearance:"primary","data-testid":"form-submit",disabled:f.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,Os)),t.createVNode(H,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(i)("baseForm.configuration.title"),visible:s.value,onClose:A[1]||(A[1]=E=>S())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("baseForm.configuration.message")),1),t.createVNode(_,{"data-testid":"form-view-configuration-slideout-tabs",tabs:T.value},{json:t.withCtx(()=>[t.createVNode(Lt,{config:e.config,"entity-record":n.formFields,"fetcher-url":b.value,"request-method":n.editId?"put":"post"},null,8,["config","entity-record","fetcher-url","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(za,{"entity-record":n.formFields},null,8,["entity-record"])]),terraform:t.withCtx(()=>[t.createVNode(Ja,{"entity-record":n.formFields,"entity-type":e.entityType},null,8,["entity-record","entity-type"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Wa=ie(Us,[["__scopeId","data-v-073c33c8"]]),Ds=["data-truncate"],Ms=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const r=e,a=t.computed(()=>{var g;return((g=r.rowEl)==null?void 0:g.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var g;return((g=a.value)==null?void 0:g.querySelector('[data-truncate="true"]'))||null}),n=t.computed(()=>{var g,x;const B=(g=r.rowEl)==null?void 0:g.querySelectorAll("td");return B?((x=B[0])==null?void 0:x.getAttribute("data-testid"))===r.keyName:!0}),o=t.computed(()=>n.value||r.tooltip);let i;const d=()=>{i&&(i.disconnect(),i=void 0)},c=()=>{var g,x,B;let T=((g=a.value)==null?void 0:g.clientWidth)||0;if(a.value&&"getComputedStyle"in window){const I=window.getComputedStyle(a.value);T-=(parseFloat(I.paddingLeft)||0)+(parseFloat(I.paddingRight)||0)}h.value=((x=l.value)==null?void 0:x.getBoundingClientRect().width)||0,u.value=T,f.value=((B=p.value)==null?void 0:B.innerText)||""},p=t.ref({}),h=t.ref(0),u=t.ref(0),f=t.ref(""),s=t.computed(()=>[l.value,a.value]),b=t.watch(s,g=>{if(o.value&&(d(),"ResizeObserver"in window&&window)){i=new ResizeObserver(x=>{window.requestAnimationFrame(()=>{!Array.isArray(x)||!x.length||c()})});for(const x of g)x&&i.observe(x)}},{immediate:!0,flush:"post",deep:!0}),S=t.computed(()=>o.value?h.value>u.value:!1);return t.onMounted(()=>{c()}),t.onUnmounted(()=>{b()}),(g,x)=>{const B=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:p,class:"content-wrapper"},[o.value?(t.openBlock(),t.createElementBlock("span",{key:0,"data-truncate":o.value||void 0},[t.createVNode(B,{"max-width":"300",placement:"bottom-start",text:S.value?f.value:""},{default:t.withCtx(()=>[t.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,Ds)):t.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),js=ie(Ms,[["__scopeId","data-v-b252463e"]]),Ks={class:"toolbar-container"},Ls={key:0,class:"toolbar-button-container"},Ps=["data-testid"],Rs=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},sortHandlerFunction:{type:Function,default:()=>({})},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:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:r}){const a=e,l=r,{i18n:{t:n}}=Z.useI18n(),o=t.computed(()=>{var m,C;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(m=a.errorMessage)==null?void 0:m.title,message:(C=a.errorMessage)==null?void 0:C.message}}),i=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=m=>m.hasData||!!a.query,c=t.computed(()=>{const m=[];return Object.keys(a.tableHeaders).forEach(C=>{const N=a.tableHeaders[C];m.push({label:N.label??C,key:C,sortable:N.sortable??!1,hidable:N.hidable??!0})}),a.enableEntityActions&&m.push({key:"actions",hideLabel:!0}),m}),p=m=>({"data-rowid":m.id,"data-testid":m.name,...a.rowAttributes(m)}),h=t.ref({}),u=m=>{var C;return(C=h.value)==null?void 0:C.$el.querySelector(`[data-rowid="${m.id}"]`)},f=m=>{const C={"data-testid":m.headerKey,...a.cellAttributes(m)};return m.colIndex===0&&(C.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),C},s=()=>{l("empty-state-cta-clicked"),b()},b=()=>{l("clear-search-input")},S=t.computed(()=>a.disableRowClick?void 0:(m,C)=>{l("click:row",C)}),g=m=>{l("sort",m)},{setTablePreferences:x,getTablePreferences:B}=Tl(),T=t.ref(B(i.value)),I=t.computed(()=>{const m=B(i.value);return{...a.initialFetcherParams,...m}}),A=m=>{T.value=m,c.value.forEach(C=>{!("hidable"in C)||!T.value.columnVisibility||C.hidable===!1&&(T.value.columnVisibility[C.key]=!0)}),i.value&&x(i.value,m)};return(m,C)=>{const N=t.resolveComponent("KButton"),V=t.resolveComponent("KDropdown"),_=t.resolveComponent("KTable"),H=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(H,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:t.withCtx(()=>[t.createVNode(_,{ref_key:"tableRefs",ref:h,"cache-identifier":i.value,"cell-attrs":f,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,error:o.value.hasError,"error-state-message":o.value.message,"error-state-title":o.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":I.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":p,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":T.value,onEmptyStateActionClick:s,"onRow:click":S.value,onSort:C[0]||(C[0]=E=>g(E)),"onUpdate:tablePreferences":A},t.createSlots({toolbar:t.withCtx(({state:E})=>[t.withDirectives(t.createElementVNode("div",Ks,[t.renderSlot(m.$slots,"toolbar-filter",{},void 0,!0),m.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Ls,[t.renderSlot(m.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(E)]])]),actions:t.withCtx(({row:E,rowKey:F,rowValue:U})=>[t.createElementVNode("div",{class:"actions-container","data-testid":E.name},[t.createVNode(V,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(m.$slots,"actions",{row:E,rowKey:F,rowValue:U},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(N,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:t.withCtx(()=>[t.createVNode(t.unref(Ts))]),_:1})]),_:2},1032,["width"])],8,Ps)]),_:2},[t.renderList(e.tableHeaders,(E,F)=>({name:F,fn:t.withCtx(({row:U,rowKey:O,rowValue:q})=>[t.createVNode(js,{"key-name":String(F),"row-el":u(U),tooltip:E.tooltip},{default:t.withCtx(()=>[t.renderSlot(m.$slots,F,{row:U,rowKey:O,rowValue:q},()=>[t.createTextVNode(t.toDisplayString(q),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(ns))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Qa=ie(Rs,[["__scopeId","data-v-71b4425a"]]),zs={key:0,class:"kong-ui-entity-delete-error"},Js={key:1,class:"description"},Ws=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:r}){const{i18nT:a}=Z.useI18n(),l=e,n=r,o=t.computed(()=>l.needConfirm?l.entityName:""),i=()=>{n("cancel")},d=()=>{n("proceed")};return(c,p)=>{const h=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":o.value,title:e.title,visible:e.visible,onCancel:i,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",zs,[t.createVNode(h,{appearance:"danger"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Js,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Ya=ie(Ws,[["__scopeId","data-v-4361d622"]]),Qs={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ys={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Zs=["fill"],Gs={mask:"url(#mask0_180_20349)"},Xs=["fill"],Za=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${on})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Qs,[t.createElementVNode("mask",Ys,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Zs)]),t.createElementVNode("g",Gs,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Xs)])]))}}),ec={key:1,class:"kong-ui-entity-filter"},tc={class:"kong-ui-entity-filter-menu"},ac=["data-testid"],rc=["onClick","onKeydown"],lc={class:"menu-item-indicator"},nc={class:"menu-item-body"},oc=["for"],ic={class:"menu-item-buttons"},sc={class:"filter-clear-button-container"},cc=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:r}){const{i18n:{t:a}}=Z.useI18n(),l=e,n=r,o=t.ref(!1),i=t.ref({}),d=t.ref(new Set),c=t.computed(()=>{const I=[];return new URLSearchParams(l.modelValue).forEach((A,m)=>{A!==""&&I.push(m)}),I}),p=t.computed(()=>{const I=l.config.fields;return Object.keys(I).filter(A=>{var m;return(m=I==null?void 0:I[A])==null?void 0:m.searchable}).map(A=>({label:I[A].label||A,value:A,expanded:!1}))});t.watch(()=>l.modelValue,I=>{i.value={},new URLSearchParams(I).forEach((A,m)=>{i.value[m]=A})});const h=()=>{o.value=!o.value},u=I=>{d.value.has(I)?d.value.delete(I):d.value.add(I)},f=I=>{n("update:modelValue",I)},s=()=>{f("")},b=I=>`filter-${I}`,S=I=>{var A,m;return(((m=(A=l.config.schema)==null?void 0:A[I])==null?void 0:m.values)??[]).map(C=>({value:C,label:C}))},g=I=>{var A,m;return((m=(A=l.config.schema)==null?void 0:A[I])==null?void 0:m.type)??"text"},x=I=>{i.value={...i.value,[I]:""},T()},B=()=>{i.value={},T(!0)},T=(I=!1)=>{const A=Object.keys(i.value).reduce((m,C)=>(i.value[C]&&(m[C]=`${i.value[C]}`),m),{});I&&(o.value=!1),n("update:modelValue",new URLSearchParams(A).toString())};return(I,A)=>{const m=t.resolveComponent("KInput"),C=t.resolveComponent("KButton"),N=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(m,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":f},{before:t.withCtx(()=>[t.createVNode(Za)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(Ss),{class:"kong-ui-entity-filter-clear",onClick:s},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",ec,[t.createVNode(C,{appearance:"tertiary","data-testid":"filter-button",onClick:h},{default:t.withCtx(()=>[t.createVNode(Za),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:h},null,512),[[t.vShow,o.value]]),t.withDirectives(t.createElementVNode("div",tc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,V=>{var _,H;return t.openBlock(),t.createElementBlock("div",{key:V.value,class:"kong-ui-entity-filter-menu-item","data-testid":V.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:d.value.has(V.value)}]),role:"button",tabindex:"0",onClick:E=>u(V.value),onKeydown:t.withKeys(E=>u(V.value),["enter"])},[t.createTextVNode(t.toDisplayString(V.label)+" ",1),t.withDirectives(t.createElementVNode("span",lc,null,512),[[t.vShow,c.value.includes(V.value)]]),t.createVNode(t.unref(ys),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:d.value.has(V.value)}]),color:t.unref(cn)},null,8,["class","color"])],42,rc),t.withDirectives(t.createElementVNode("div",nc,[t.createElementVNode("label",{class:"menu-item-label",for:b(V.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,oc),((H=(_=e.config.schema)==null?void 0:_[V.value])==null?void 0:H.type)==="select"?(t.openBlock(),t.createBlock(N,{key:0,id:b(V.value),modelValue:i.value[V.value],"onUpdate:modelValue":E=>i.value[V.value]=E,items:S(V.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(m,{key:1,id:b(V.value),modelValue:i.value[V.value],"onUpdate:modelValue":E=>i.value[V.value]=E,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:g(V.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,d.value.has(V.value)]]),t.withDirectives(t.createElementVNode("div",ic,[t.createVNode(C,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:A[0]||(A[0]=E=>T(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(C,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:E=>x(V.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,d.value.has(V.value)]])],8,ac)}),128)),t.createElementVNode("div",sc,[t.createVNode(C,{appearance:"tertiary",size:"small",onClick:B},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,o.value]])]))}}}),dc=ie(cc,[["__scopeId","data-v-94990087"]]),pe=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,o)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}});let Qe;const hc=new Uint8Array(16);function pc(){if(!Qe&&(Qe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qe(hc)}const X=[];for(let e=0;e<256;++e)X.push((e+256).toString(16).slice(1));function uc(e,r=0){return X[e[r+0]]+X[e[r+1]]+X[e[r+2]]+X[e[r+3]]+"-"+X[e[r+4]]+X[e[r+5]]+"-"+X[e[r+6]]+X[e[r+7]]+"-"+X[e[r+8]]+X[e[r+9]]+"-"+X[e[r+10]]+X[e[r+11]]+X[e[r+12]]+X[e[r+13]]+X[e[r+14]]+X[e[r+15]]}const fc=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ga={randomUUID:fc};function mc(e,r,a){if(Ga.randomUUID&&!r&&!e)return Ga.randomUUID();e=e||{};const l=e.random||(e.rng||pc)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,r){a=a||0;for(let n=0;n<16;++n)r[a+n]=l[n];return r}return uc(l)}const gc=["aria-labelledby"],yc={class:"form-section-wrapper"},kc={key:1,class:"form-section-description"},bc={key:2,class:"form-section-footer"},Cc={class:"form-section-content"},wc=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},titleTag:{type:String,default:"h2"}},setup(e){const r=t.useSlots(),a=mc();return(l,n)=>(t.openBlock(),t.createElementBlock("div",{"aria-labelledby":e.title?t.unref(a):void 0,class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[t.createElementVNode("div",yc,[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.createBlock(t.resolveDynamicComponent(e.titleTag),{key:0,id:t.unref(a),class:"form-section-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1},8,["id"])):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",kc,[t.renderSlot(l.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",bc,[t.renderSlot(l.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",Cc,[t.renderSlot(l.$slots,"default",{},void 0,!0)])])],10,gc))}}),Ue=ie(wc,[["__scopeId","data-v-b1f74200"]]),{useAxios:Ye,useDeleteUrlBuilder:Xa,useErrors:er,useExternalLinkCreator:Bd,useFetchUrlBuilder:Id,useFetcher:tr,useDebouncedFilter:ar,useStringHelpers:Td,useHelpers:_c,useGatewayFeatureSupported:Ad,useTruncationDetector:Ed,useValidators:Hd}=Z,Ze="24px",rr=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Sc=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),xc=["aria-hidden"],Nc={key:0,"data-testid":"kui-icon-svg-title"},Vc=Sc(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),_t=rr(t.defineComponent({__name:"AddIcon",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:Ze,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return Ze}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-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",Nc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Vc],8,xc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c1f7c39c"]]),Bc=e=>(t.pushScopeId("data-v-c73ebbaa"),e=e(),t.popScopeId(),e),Ic=["aria-hidden"],Tc={key:0,"data-testid":"kui-icon-svg-title"},Ac=Bc(()=>t.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Ec=rr(t.defineComponent({__name:"TrashIcon",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:Ze,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return Ze}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-trash-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",Tc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Ac],8,Ic))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c73ebbaa"]]),Hc={upstreams:{list:{table_headers:{id:"ID",name:"Name",slots:"Slots",tags:"Tags"},empty_state:{title:"Configure a New Upstream",description:"Upstreams are used to load balance incoming requests."},toolbar_actions:{new_upstream:"New Upstream"}},title:"Upstreams",search:{placeholder:"Filter by exact name or ID"},actions:{create:"New Upstream",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete an Upstream",description:"This action cannot be reversed so make sure to check upstream usage before deleting."},errors:{general:"Upstreams could not be retrieved",delete:"The upstream could not be deleted at this time.",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{errors:{name_required:"Name is required",should_be_integer:"Field should contain an integer",in_range:"Accepts an integer in the range of 10 - 65536"},general_info:{title:"General Information",help:"General information will help identify and manage this Upstream."},load_balancing:{title:"Load Balancing",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},health_check:{title:"Health Checks & Circuit Breakers",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},active_health_check:{title:"Active Health Checks",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},passive_health_check:{title:"Passive Health Checks",help:"Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},buttons:{view_documentation:"View documentation"},algorithms:{round_robin_label:"Round Robin",least_connections_label:"Least Connections",consistent_hashing_label:"Consistent Hashing",latency_label:"Latency"},hash_labels:{none:"None",consumer:"Consumer",ip:"IP",header:"Header",cookie:"Cookie",path:"Path",query_argument:"Query Argument",uri_capture:"URI Capture"},hash_tooltips:{hash_on_header:{text:"The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",hash_on:"hash_on",header:"header"},hash_on_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",hash_on:"hash_on",uri_capture:"uri_capture"},hash_on_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",hash_on:"hash_on",query_arg:"query_arg"},hash_on_cookie:{text:"The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},hash_on_cookie_path:{text:"The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},slots:{text:"The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",algorithm:"algorithm",round_robin:"round-robin",consistent_hashing:"consistent-hashing"},tags:"An optional set of strings associated with the Upstream for grouping and filtering.",hash_fallback:{text:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",hash_on:"hash_on",cookie:"cookie"},hash_fallback_header:{text:"The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",hash_fallback:"hash_fallback",header:"header"},hash_fallback_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",hash_fallback:"hash_fallback",query_arg:"query_arg"},hash_fallback_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",hash_fallback:"hash_fallback",uri_capture:"uri_capture"},host_header:{text:"The hostname to be used as {host} header when proxying requests through Kong.",host:"Host"},client_certificate:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},healthcheck_type_labels:{http:"HTTP",https:"HTTPS",tcp:"TCP",grsp:"gRPC",grsps:"gRPCs"},healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},passive_healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},passive_unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},fields:{name:{label:"Name",placeholder:"Enter or select a host",tooltip:"This is a hostname, which must be equal to the {host} of a Service.",host:"host"},host_header:{label:"Host Header"},client_certificate:{label:"Client Certificate",placeholder:"Select or enter a Certificate ID",tooltip:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},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 Upstream for grouping and filtering."},algorithm:{label:"Algorithm",tooltip:"Which load balancing algorithm to use."},slots:{label:"Slots",help:"Accepts an integer in the range of 10 - 65536"},hash_on:{label:"Hash on",help:"What to use as hashing input.",tooltip:"What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."},hash_fallback:{label:"Hash Fallback",help:"What to use as hashing input if the primary hash_on does not return a hash",tooltip:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",hash_on:"hash_on",cookie:"cookie"},active_health_checks:{label:"Active Health Checks",help:"Actively probe the targets for their health."},passive_health_checks:{label:"Passive Health Checks / Circuit Breakers",help:"Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},healthchecks_threshold:{label:"Healthchecks Threshold"},header:{label:"Header"},headers:{label:"Headers",tooltip_active:"Header values can be separated by commas (value1, value2, value3)."},cookie:{label:"Cookie"},cookie_path:{label:"Cookie Path"},query_argument:{label:"Query Argument"},uri_capture:{label:"URI Capture"},active_healthcheck_type:{label:"Active Health Check Type"},http_path:{label:"HTTP Path"},timeout:{label:"Timeout"},concurrency:{label:"Concurrency"},https_sni:{label:"HTTPS SNI"},verify_ssl:{label:"Verify the SSL certificate when performing active health checks using HTTPS"},interval:{label:"Interval",help:"A value of zero indicates that active probes for healthy targets are disabled."},successes:{label:"Successes"},http_statuses:{label:"HTTP Statuses"},http_failures:{label:"HTTP Failures"},tcp_failures:{label:"TCP Failures"},timeouts:{label:"Timeouts"},passive_health_check_type:{label:"Passive Health Check Type"}}},labels:{created_at:"Created at"}},targets:{list:{table_headers:{id:"ID",target_address:"Target Address",weight:"Weight",tags:"Tags"},empty_state:{title:"Configure a New Target",description:"A target is an IP address/hostname with a port that identifies an instance of a backend service."},toolbar_actions:{new_target:"New Target"}},title:"Targets",actions:{create:"New Target",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",mark_healthy:"Mark Healthy",mark_unhealthy:"Mark Unhealthy"},delete:{title:"Delete a Target",description:"This action cannot be reversed so make sure to check target usage before deleting."},errors:{general:"Targets could not be retrieved",delete:"The target could not be deleted at this time.",copy:"Failed to copy to clipboard",weight:"Value must be in range 0 to 65535"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{create:{title:"New Target"},edit:{title:"Edit Target"},buttons:{save:"Save",cancel:"Cancel"},fields:{target:{label:"Target Address",placeholder:"Enter IP/hostname and port",tooltip:"The target address (IP or hostname) and port. If omitted the port defaults to 8000."},weight:{label:"Weight",tooltip:"The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}}}}};function vc(){const e=Me.createI18n("en-us",Hc);return{i18n:e,i18nT:Me.i18nTComponent(e)}}function De(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,o)=>{if(o){const i={...n};r&&(i.value=n.label),a.value.push(i)}else a.value=a.value.filter(i=>i.value!==n.value)}}}const Ge=[{label:"100",value:"100"},{label:"101",value:"101"},{label:"102",value:"102"},{label:"103",value:"103"},{label:"200",value:"200"},{label:"201",value:"201"},{label:"202",value:"202"},{label:"203",value:"203"},{label:"204",value:"204"},{label:"205",value:"205"},{label:"206",value:"206"},{label:"207",value:"207"},{label:"208",value:"208"},{label:"226",value:"226"},{label:"300",value:"300"},{label:"301",value:"301"},{label:"302",value:"302"},{label:"303",value:"303"},{label:"304",value:"304"},{label:"305",value:"305"},{label:"306",value:"306"},{label:"307",value:"307"},{label:"308",value:"308"},{label:"400",value:"400"},{label:"401",value:"401"},{label:"402",value:"402"},{label:"403",value:"403"},{label:"404",value:"404"},{label:"405",value:"405"},{label:"406",value:"406"},{label:"407",value:"407"},{label:"408",value:"408"},{label:"409",value:"409"},{label:"410",value:"410"},{label:"411",value:"411"},{label:"412",value:"412"},{label:"413",value:"413"},{label:"414",value:"414"},{label:"415",value:"415"},{label:"416",value:"416"},{label:"417",value:"417"},{label:"418",value:"418"},{label:"419",value:"419"},{label:"420",value:"420"},{label:"421",value:"421"},{label:"422",value:"422"},{label:"423",value:"423"},{label:"424",value:"424"},{label:"425",value:"425"},{label:"426",value:"426"},{label:"428",value:"428"},{label:"429",value:"429"},{label:"430",value:"430"},{label:"431",value:"431"},{label:"440",value:"440"},{label:"444",value:"444"},{label:"449",value:"449"},{label:"450",value:"450"},{label:"451",value:"451"},{label:"460",value:"460"},{label:"463",value:"463"},{label:"494",value:"494"},{label:"495",value:"495"},{label:"496",value:"496"},{label:"497",value:"497"},{label:"498",value:"498"},{label:"499",value:"499"},{label:"500",value:"500"},{label:"501",value:"501"},{label:"502",value:"502"},{label:"503",value:"503"},{label:"504",value:"504"},{label:"505",value:"505"},{label:"506",value:"506"},{label:"507",value:"507"},{label:"508",value:"508"},{label:"509",value:"509"},{label:"510",value:"510"},{label:"511",value:"511"},{label:"520",value:"520"},{label:"521",value:"521"},{label:"522",value:"522"},{label:"523",value:"523"},{label:"524",value:"524"},{label:"525",value:"525"},{label:"526",value:"526"},{label:"527",value:"527"},{label:"529",value:"529"},{label:"530",value:"530"},{label:"561",value:"561"},{label:"598",value:"598"},{label:"599",value:"599"}],St=10,xt=65536,$c=0,qc=65535,Ne=0,Ve=255,lr=0,nr=255,Oc=0,Fc=65535,or=0,ir=65535,Uc=0,Dc=2**31,Nt=["200","302"],Vt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],Bt=["429","404","500","501","502","503","504","505"],It=["429","500","503"];function Xe(){const e=c=>/^\d+$/.test(c),r=(c,p,h)=>{if(e(c)){const u=Number(c);return u>=p&&u<=h}else return!1},a=c=>c.map(p=>Number(p)),l=c=>c.map(p=>p.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:Nt,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:Bt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:Vt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:It,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var h,u,f,s,b,S,g,x,B,T,I,A,m,C,N,V,_,H,E,F,U,O,q,j,Y,$,D,K,k,y,w,R,M,z,ee,P,ae,be,Ae,cr,dr,hr,pr,ur,fr,mr,gr,yr,kr,br,Cr,wr,_r,Sr,xr,Nr,Vr,Br,Ir,Tr,Ar,Er,Hr,vr,$r,qr,Or,Fr,Ur,Dr,Mr,jr,Kr,Lr,Pr,Rr,zr,Jr,Wr,Qr,Yr,Zr,Gr,Xr,el,tl,al,rl,ll,nl,ol,il,sl,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,wl,_l,Sl,xl;const p=n();return p.name=c.name||"",p.algorithm=c.algorithm||"round-robin",p.hostHeader=c.host_header||"",p.clientCertificate=c.client_certificate?(h=c.client_certificate)==null?void 0:h.id:"",p.tags=((u=c.tags)==null?void 0:u.join(", "))||"",p.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",p.hashOn=c.hash_on||"none",p.hashFallback=c.hash_fallback||"none",p.hashOnHeader=c.hash_on_header||"",p.hashOnCookie=c.hash_on_cookie||"",p.hashOnCookiePath=c.hash_on_cookie_path||"/",p.hashOnQueryArgument=c.hash_on_query_arg||"",p.hashOnUriCapture=c.hash_on_uri_capture||"",p.hashFallbackHeader=c.hash_fallback_header||"",p.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",p.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",p.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",p.activeHealthSwitch=((s=(f=c.healthchecks.active)==null?void 0:f.healthy)==null?void 0:s.interval)!==0||((S=(b=c.healthchecks.active)==null?void 0:b.unhealthy)==null?void 0:S.interval)!==0,p.activeHealthCheck.type=((g=c.healthchecks.active)==null?void 0:g.type)||"http",p.activeHealthCheck.httpPath=((x=c.healthchecks.active)==null?void 0:x.http_path)||"/",p.activeHealthCheck.timeout=((B=c.healthchecks.active)==null?void 0:B.timeout)!==null&&((T=c.healthchecks.active)==null?void 0:T.timeout)!==void 0?(A=(I=c.healthchecks.active)==null?void 0:I.timeout)==null?void 0:A.toString():"",p.activeHealthCheck.concurrency=((m=c.healthchecks.active)==null?void 0:m.concurrency)!==null&&((C=c.healthchecks.active)==null?void 0:C.concurrency)!==void 0?(V=(N=c.healthchecks.active)==null?void 0:N.concurrency)==null?void 0:V.toString():"",p.activeHealthCheck.httpsSni=((_=c.healthchecks.active)==null?void 0:_.https_sni)||"",p.activeHealthCheck.verifySsl=((H=c.healthchecks.active)==null?void 0:H.https_verify_certificate)||!1,p.activeHealthCheck.headers=(E=c.healthchecks.active)!=null&&E.headers&&Object.entries((F=c.healthchecks.active)==null?void 0:F.headers).length>0?Object.entries((U=c.healthchecks.active)==null?void 0:U.headers).map(([Vd,Tt])=>({key:Vd,values:Tt==null?void 0:Tt.join(", ")})):[{key:"",values:""}],p.activeHealthCheck.interval=((q=(O=c.healthchecks.active)==null?void 0:O.healthy)==null?void 0:q.interval)!==null&&((Y=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:Y.interval)!==void 0?(K=(D=($=c.healthchecks.active)==null?void 0:$.healthy)==null?void 0:D.interval)==null?void 0:K.toString():"0",p.activeHealthCheck.interval=((y=(k=c.healthchecks.active)==null?void 0:k.healthy)==null?void 0:y.interval)!==null&&((R=(w=c.healthchecks.active)==null?void 0:w.healthy)==null?void 0:R.interval)!==void 0?(ee=(z=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:z.interval)==null?void 0:ee.toString():"0",p.activeHealthCheck.successes=((ae=(P=c.healthchecks.active)==null?void 0:P.healthy)==null?void 0:ae.successes)!==null&&((Ae=(be=c.healthchecks.active)==null?void 0:be.healthy)==null?void 0:Ae.successes)!==void 0?(hr=(dr=(cr=c.healthchecks.active)==null?void 0:cr.healthy)==null?void 0:dr.successes)==null?void 0:hr.toString():"0",p.activeHealthCheck.httpStatuses=(ur=(pr=c.healthchecks.active)==null?void 0:pr.healthy)!=null&&ur.http_statuses?l(((mr=(fr=c.healthchecks.active)==null?void 0:fr.healthy)==null?void 0:mr.http_statuses)||[]):Nt,p.activeHealthCheck.unhealthyInterval=((yr=(gr=c.healthchecks.active)==null?void 0:gr.unhealthy)==null?void 0:yr.interval)!==null&&((br=(kr=c.healthchecks.active)==null?void 0:kr.unhealthy)==null?void 0:br.interval)!==void 0?(_r=(wr=(Cr=c.healthchecks.active)==null?void 0:Cr.unhealthy)==null?void 0:wr.interval)==null?void 0:_r.toString():"0",p.activeHealthCheck.httpFailures=((xr=(Sr=c.healthchecks.active)==null?void 0:Sr.unhealthy)==null?void 0:xr.http_failures)!==null&&((Vr=(Nr=c.healthchecks.active)==null?void 0:Nr.unhealthy)==null?void 0:Vr.http_failures)!==void 0?(Tr=(Ir=(Br=c.healthchecks.active)==null?void 0:Br.unhealthy)==null?void 0:Ir.http_failures)==null?void 0:Tr.toString():"0",p.activeHealthCheck.unhealthyTimeouts=((Er=(Ar=c.healthchecks.active)==null?void 0:Ar.unhealthy)==null?void 0:Er.timeouts)!==null&&((vr=(Hr=c.healthchecks.active)==null?void 0:Hr.unhealthy)==null?void 0:vr.timeouts)!==void 0?(Or=(qr=($r=c.healthchecks.active)==null?void 0:$r.unhealthy)==null?void 0:qr.timeouts)==null?void 0:Or.toString():"0",p.activeHealthCheck.unhealthyHttpStatuses=(Ur=(Fr=c.healthchecks.active)==null?void 0:Fr.unhealthy)!=null&&Ur.http_statuses?l(((Mr=(Dr=c.healthchecks.active)==null?void 0:Dr.unhealthy)==null?void 0:Mr.http_statuses)||[]):Bt,p.passiveHealthSwitch=((Kr=(jr=c.healthchecks.passive)==null?void 0:jr.healthy)==null?void 0:Kr.successes)!==0||((Pr=(Lr=c.healthchecks.passive)==null?void 0:Lr.unhealthy)==null?void 0:Pr.timeouts)!==0||((zr=(Rr=c.healthchecks.passive)==null?void 0:Rr.unhealthy)==null?void 0:zr.tcp_failures)!==0||((Wr=(Jr=c.healthchecks.passive)==null?void 0:Jr.unhealthy)==null?void 0:Wr.http_failures)!==0,p.passiveHealthCheck.type=((Qr=c.healthchecks.passive)==null?void 0:Qr.type)||"http",p.passiveHealthCheck.successes=((Zr=(Yr=c.healthchecks.passive)==null?void 0:Yr.healthy)==null?void 0:Zr.successes)!==null&&((Xr=(Gr=c.healthchecks.passive)==null?void 0:Gr.healthy)==null?void 0:Xr.successes)!==void 0?(al=(tl=(el=c.healthchecks.passive)==null?void 0:el.healthy)==null?void 0:tl.successes)==null?void 0:al.toString():"0",p.passiveHealthCheck.httpStatuses=(ll=(rl=c.healthchecks.passive)==null?void 0:rl.healthy)!=null&&ll.http_statuses?l(((ol=(nl=c.healthchecks.passive)==null?void 0:nl.healthy)==null?void 0:ol.http_statuses)||[]):Vt,p.passiveHealthCheck.timeouts=((sl=(il=c.healthchecks.passive)==null?void 0:il.unhealthy)==null?void 0:sl.timeouts)!==null&&((dl=(cl=c.healthchecks.passive)==null?void 0:cl.unhealthy)==null?void 0:dl.timeouts)!==void 0?(ul=(pl=(hl=c.healthchecks.passive)==null?void 0:hl.unhealthy)==null?void 0:pl.timeouts)==null?void 0:ul.toString():"0",p.passiveHealthCheck.tcpFailures=((ml=(fl=c.healthchecks.passive)==null?void 0:fl.unhealthy)==null?void 0:ml.tcp_failures)!==null&&((yl=(gl=c.healthchecks.passive)==null?void 0:gl.unhealthy)==null?void 0:yl.tcp_failures)!==void 0?(Cl=(bl=(kl=c.healthchecks.passive)==null?void 0:kl.unhealthy)==null?void 0:bl.tcp_failures)==null?void 0:Cl.toString():"",p.passiveHealthCheck.unhealthyHttpStatuses=(_l=(wl=c.healthchecks.passive)==null?void 0:wl.unhealthy)!=null&&_l.http_statuses?l(((xl=(Sl=c.healthchecks.passive)==null?void 0:Sl.unhealthy)==null?void 0:xl.http_statuses)||[]):It,p},getDefaultUpstreamFields:n,objectsAreEqual:(c,p)=>{try{return JSON.stringify(c)===JSON.stringify(p)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const ue={useI18n:vc,useMultiselectCreation:De,useHelpers:Xe},Be="/v2/control-planes/{controlPlaneId}/core-entities",Ie="/{workspace}",Te={list:{konnect:`${Be}/upstreams`,kongManager:`${Ie}/upstreams`},form:{konnect:{getServices:`${Be}/services`,getCertificates:`${Be}/certificates`,validate:`${Be}/v1/schemas/json/upstream/validate`,create:`${Be}/upstreams`,edit:`${Be}/upstreams/{id}`},kongManager:{getServices:`${Ie}/services`,getCertificates:`${Ie}/certificates`,validate:`${Ie}/schemas/upstreams/validate`,create:`${Ie}/upstreams`,edit:`${Ie}/upstreams/{id}`}}},Mc={class:"kong-ui-entities-upstreams-list"},jc={class:"upstream-name"},Kc=t.defineComponent({__name:"UpstreamsList",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"],setup(e,{emit:r}){var Y;const a=r,l=e,{i18n:{t:n}}=ue.useI18n(),o=lt.useRouter(),{axiosInstance:i}=Ye((Y=l.config)==null?void 0:Y.axiosRequestConfig),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),p={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},h=p,u=t.computed(()=>{var D,K;let $=`${l.config.apiBaseUrl}${Te.list[l.config.app]}`;return l.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((D=l.config)==null?void 0:D.controlPlaneId)||""):l.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(K=l.config)!=null&&K.workspace?`/${l.config.workspace}`:"")),$}),f=t.ref(""),s=t.computed(()=>{const $=l.config.app==="konnect"||l.config.isExactMatch;if($)return{isExactMatch:$,placeholder:n("upstreams.search.placeholder")};const{name:D,slots:K}=p;return{isExactMatch:$,fields:{name:D,slots:K},schema:l.config.filterSchema}}),{fetcher:b,fetcherState:S}=tr(l.config,u.value),g=()=>{f.value=""},x=()=>{d.value++},B=t.ref(null),T=($,D)=>{const K=$.id;if(!D(K)){a("copy:error",{entity:$,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:$,field:"id",message:n("upstreams.copy.success",{val:K})})},I=($,D)=>{const K=JSON.stringify($);if(!D(K)){a("copy:error",{entity:$,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:$,message:n("upstreams.copy.success_brief")})},A=async $=>{var K;await((K=l.canRetrieve)==null?void 0:K.call(l,$))&&o.push(l.config.getViewRoute($.id))},m=$=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute($)}),C=$=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute($)}),N=t.ref(void 0),V=t.ref(!1),_=t.ref(!1),H=t.ref(""),E=Xa(l.config,u.value),F=$=>{N.value=$,V.value=!0},U=()=>{V.value=!1},O=async()=>{var $,D,K;if(($=N.value)!=null&&$.id){_.value=!0;try{await i.delete(E(N.value.id)),_.value=!1,V.value=!1,d.value++,a("delete:success",N.value)}catch(k){H.value=((K=(D=k.response)==null?void 0:D.data)==null?void 0:K.message)||k.message||n("upstreams.errors.delete"),a("error",k)}finally{_.value=!1}}},q=t.ref(!1);t.watch(S,$=>{var D,K,k,y;if(Array.isArray((D=$==null?void 0:$.response)==null?void 0:D.data)&&(q.value=$.response.data.length>0),$.status===me.Error){B.value={title:n("upstreams.errors.general")},(y=(k=(K=$.error)==null?void 0:K.response)==null?void 0:k.data)!=null&&y.message&&(B.value.message=$.error.response.data.message),a("error",$.error);return}B.value=null});const j=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(j.value.title=n("upstreams.list.empty_state.title"),j.value.ctaText=n("upstreams.actions.create"))}),($,D)=>{const K=t.resolveComponent("KButton"),k=t.resolveComponent("KBadge"),y=t.resolveComponent("KTruncate"),w=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Mc,[t.createVNode(t.unref(Qa),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":B.value,fetcher:t.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:f.value,"table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onClearSearchInput:g,"onClick:row":D[1]||(D[1]=M=>A(M)),onSort:x},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(dc),{modelValue:f.value,"onUpdate:modelValue":D[0]||(D[0]=M=>f.value=M),config:s.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(pe),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createVNode(t.unref(_t)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,q.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:t.withCtx(({rowValue:M})=>[t.createElementVNode("span",jc,t.toDisplayString(M),1)]),tags:t.withCtx(({rowValue:M})=>[t.createVNode(y,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M,z=>(t.openBlock(),t.createBlock(k,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:M})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(w,{"data-testid":"action-entity-copy-id",onClick:ee=>T(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(w,{"data-testid":"action-entity-copy-json",onClick:ee=>I(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(pe),{"auth-function":()=>e.canRetrieve(M)},{default:t.withCtx(()=>[t.createVNode(w,{"data-testid":"action-entity-view","has-divider":"",item:m(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(pe),{"auth-function":()=>e.canEdit(M)},{default:t.withCtx(()=>[t.createVNode(w,{"data-testid":"action-entity-edit",item:C(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(pe),{"auth-function":()=>e.canDelete(M)},{default:t.withCtx(()=>[t.createVNode(w,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>F(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(Ya),{"action-pending":_.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":N.value&&(N.value.name||N.value.id),"entity-type":t.unref(nt).Upstream,error:H.value,title:t.unref(n)("upstreams.delete.title"),visible:V.value,onCancel:U,onProceed:O},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),fe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Lc=fe(Kc,[["__scopeId","data-v-9f2efb47"]]),et="/v2/control-planes/{controlPlaneId}/core-entities",tt="/{workspace}",at={list:{konnect:`${et}/upstreams/{upstreamId}/targets`,kongManager:`${tt}/upstreams/{upstreamId}/targets`},form:{konnect:{create:`${et}/upstreams/{upstreamId}/targets`,edit:`${et}/upstreams/{upstreamId}/targets/{id}`,validate:`${et}/v1/schemas/json/target/validate`},kongManager:{create:`${tt}/upstreams/{upstreamId}/targets`,edit:`${tt}/upstreams/{upstreamId}/targets/{id}`,validate:`${tt}/schemas/targets/validate`}}},Pc={class:"kong-ui-entities-target-form"},Rc={class:"target-form-container"},zc={key:0,class:"target-form-info"},sr=fe(t.defineComponent({__name:"TargetForm",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.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var A;const a=r,l=e,{i18n:{t:n}}=ue.useI18n(),{getMessageFromError:o}=er(),{axiosInstance:i}=Ye((A=l.config)==null?void 0:A.axiosRequestConfig),d=t.computed(()=>{var m;return at.form[l.config.app].edit.replace(/{upstreamId}/gi,((m=l.config)==null?void 0:m.upstreamId)||"")}),c=t.computed(()=>l.targetId?se.Edit:se.Create),p=t.computed(()=>c.value===se.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),h=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),f={target:"",weight:100,tags:""},s=t.computed(()=>{const m=parseInt(h.fields.weight.toString(),10);return m<0||m>65535}),b=t.computed(()=>JSON.stringify(h.fields)!==JSON.stringify(u)&&!!h.fields.target&&!!h.fields.weight&&!s.value),S=m=>{var C;h.fields.target=(m==null?void 0:m.target)||"",h.fields.weight=(m==null?void 0:m.weight)??"",h.fields.tags=((C=m==null?void 0:m.tags)==null?void 0:C.join(", "))||"",Object.assign(u,h.fields)},g=()=>{h.errorMessage="",a("cancel")},x=t.computed(()=>{var C,N;let m=`${l.config.apiBaseUrl}${at.form[l.config.app].validate}`;return l.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((C=l.config)==null?void 0:C.controlPlaneId)||""):l.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(N=l.config)!=null&&N.workspace?`/${l.config.workspace}`:"")),m=m.replace(/{id}/gi,l.targetId),m}),B=t.computed(()=>{var C,N,V,_;let m=`${l.config.apiBaseUrl}${at.form[l.config.app][c.value]}`;return l.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((C=l.config)==null?void 0:C.controlPlaneId)||"").replace(/{upstreamId}/gi,((N=l.config)==null?void 0:N.upstreamId)||""):l.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(V=l.config)!=null&&V.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((_=l.config)==null?void 0:_.upstreamId)||"")),m=m.replace(/{id}/gi,l.targetId),m}),T=t.computed(()=>{var m,C,N;return{target:h.fields.target,weight:parseInt(h.fields.weight),tags:(N=(C=(m=h.fields.tags)==null?void 0:m.split(","))==null?void 0:C.map(V=>String(V||"").trim()))==null?void 0:N.filter(V=>V!==""),upstream:{id:l.config.upstreamId}}}),I=async()=>{var m,C;try{h.isReadonly=!0,h.errorMessage="";let N;if(await i.post(x.value,T.value),c.value==="create"?N=await i.post(B.value,T.value):c.value==="edit"&&(N=((m=l.config)==null?void 0:m.app)==="konnect"?await i.put(B.value,T.value):await i.patch(B.value,T.value)),N){const{data:V}=N;h.fields.target=(V==null?void 0:V.name)||"",h.fields.weight=(V==null?void 0:V.weight)??100,h.fields.tags=((C=V==null?void 0:V.tags)==null?void 0:C.join(", "))||"",a("update",V),Object.assign(h.fields,f)}}catch(N){h.errorMessage=o(N),a("error",N)}finally{h.isReadonly=!1}};return t.watch(()=>l.targetId,()=>{Object.assign(h.fields,f)}),(m,C)=>{const N=t.resolveComponent("KInput"),V=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(V,{"action-button-disabled":!b.value||h.isReadonly,"action-button-text":t.unref(n)("targets.form.buttons.save"),"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),title:p.value,visible:e.isVisible,onCancel:g,onProceed:I},{default:t.withCtx(()=>[t.createElementVNode("div",Pc,[t.createVNode(t.unref(Wa),{config:e.config,"edit-id":e.targetId,"entity-type":t.unref(Ee).Target,"error-message":h.errorMessage,"fetch-url":d.value,"form-fields":T.value,"is-readonly":h.isReadonly,onCancel:g,"onFetch:error":C[3]||(C[3]=_=>m.$emit("error",_)),"onFetch:success":S,onLoading:C[4]||(C[4]=_=>m.$emit("loading",_))},{default:t.withCtx(()=>[t.createElementVNode("div",Rc,[m.$slots.info?(t.openBlock(),t.createElementBlock("div",zc,[t.renderSlot(m.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(N,{modelValue:h.fields.target,"onUpdate:modelValue":C[0]||(C[0]=_=>h.fields.target=_),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:h.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(N,{modelValue:h.fields.weight,"onUpdate:modelValue":C[1]||(C[1]=_=>h.fields.weight=_),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:h.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(N,{modelValue:h.fields.tags,"onUpdate:modelValue":C[2]||(C[2]=_=>h.fields.tags=_),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:h.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-77947aef"]]),Jc={class:"kong-ui-entities-targets-list"},Wc={class:"target-address"},Qc=fe(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var K;const a=r,l=e,{i18n:{t:n}}=ue.useI18n(),{axiosInstance:o}=Ye((K=l.config)==null?void 0:K.axiosRequestConfig),i=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),p={target:{label:n("targets.list.table_headers.target_address"),sortable:!0,hidable:!1},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},h=t.computed(()=>{var y,w,R,M;let k=`${l.config.apiBaseUrl}${at.list[l.config.app]}`;return l.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((y=l.config)==null?void 0:y.controlPlaneId)||"").replace(/{upstreamId}/gi,((w=l.config)==null?void 0:w.upstreamId)||""):l.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(R=l.config)!=null&&R.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((M=l.config)==null?void 0:M.upstreamId)||"")),k}),{fetcher:u,fetcherState:f}=tr(l.config,h.value),s=()=>{i.value++},b=t.ref(null),S=()=>{j.value=!0},g=(k,y)=>{const w=k.id;if(!y(w)){a("copy:error",{entity:k,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:k,field:"id",message:n("targets.copy.success",{val:w})})},x=(k,y)=>{const w=JSON.stringify(k);if(!y(w)){a("copy:error",{entity:k,message:n("targets.errors.copy")});return}a("copy:success",{entity:k,message:n("targets.copy.success_brief")})},B=k=>{q.value=k,j.value=!0},T=k=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(k),I=k=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(k),A=t.ref(void 0),m=t.ref(!1),C=t.ref(!1),N=t.ref(""),V=Xa(l.config,h.value),_=k=>{A.value=k,m.value=!0},H=()=>{m.value=!1},E=async()=>{var k,y,w;if((k=A.value)!=null&&k.id){C.value=!0;try{await o.delete(V(A.value.id)),C.value=!1,m.value=!1,i.value++,a("delete:success",A.value)}catch(R){N.value=((w=(y=R.response)==null?void 0:y.data)==null?void 0:w.message)||R.message||n("targets.errors.delete"),a("error",R)}finally{C.value=!1}}},F=t.ref(!1);t.watch(f,k=>{var y,w,R,M;if(Array.isArray((y=k==null?void 0:k.response)==null?void 0:y.data)&&(F.value=k.response.data.length>0),k.status===me.Error){b.value={title:n("targets.errors.general")},(M=(R=(w=k.error)==null?void 0:w.response)==null?void 0:R.data)!=null&&M.message&&(b.value.message=k.error.response.data.message),a("error",k.error);return}b.value=null});const U=t.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(U.value.title=n("targets.list.empty_state.title"),U.value.ctaText=n("targets.actions.create"))});const O=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,axiosRequestConfig:l.config.axiosRequestConfig,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace}})),q=t.ref(""),j=t.ref(!1),Y=k=>{q.value?a("update:target",k):a("create:target",k),$()},$=()=>{D(),i.value++},D=()=>{j.value=!1,q.value=""};return(k,y)=>{const w=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),M=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),ee=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Jc,[t.createVNode(t.unref(Qa),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":U.value,"enable-entity-actions":"","error-message":b.value,fetcher:t.unref(u),"fetcher-cache-key":i.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:y[1]||(y[1]=()=>l.config.createRoute?void 0:S()),onSort:s},{"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(pe),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(w,{appearance:"primary","data-testid":"toolbar-new-target",to:l.config.createRoute?l.config.createRoute:void 0,onClick:y[0]||(y[0]=()=>l.config.createRoute?void 0:S())},{default:t.withCtx(()=>[t.createVNode(t.unref(_t)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,F.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:P})=>[t.createElementVNode("span",Wc,t.toDisplayString(P),1)]),tags:t.withCtx(({rowValue:P})=>[t.createVNode(M,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P,ae=>(t.openBlock(),t.createBlock(R,{key:ae,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ae),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:P})=>[t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:be=>g(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:be=>x(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(pe),{"auth-function":()=>e.canEdit(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:ae=>B(P.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(pe),{"auth-function":()=>T(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:ae=>a("health-actions:healthy",P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(pe),{"auth-function":()=>I(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:ae=>a("health-actions:unhealthy",P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(pe),{"auth-function":()=>e.canDelete(P)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ae=>_(P)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(Ya),{"action-pending":C.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(nt).Target,error:N.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:m.value,onCancel:H,onProceed:E},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(sr,{config:O.value,"is-visible":j.value,"target-id":q.value,onCancel:D,onUpdate:Y},t.createSlots({_:2},[k.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(k.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-e6ed1cfb"]]),Yc={key:1},Zc=fe(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var H,E,F,U;const{i18nT:a,i18n:{t:l}}=ue.useI18n(),n=e,o=r,{debouncedQueryChange:i,loading:d,loadItems:c,results:p,allRecords:h}=ar(n.config,(E=Te.form[(H=n.config)==null?void 0:H.app])==null?void 0:E.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:s,results:b}=ar(n.config,(U=Te.form[(F=n.config)==null?void 0:F.app])==null?void 0:U.getCertificates),S=t.ref(""),g=t.computed(()=>{var O;return!!n.name&&!((O=h.value)!=null&&O.some(q=>q.host===n.name))}),x=t.computed(()=>{var q,j,Y;const O=g.value&&n.name.includes((q=S.value)==null?void 0:q.toLowerCase());return(Y=p.value)==null?void 0:Y.map($=>({label:$.host,value:$.id})).concat(O?[{label:n.name,value:((j=I.value)==null?void 0:j.value)||n.name}]:[])}),B=t.computed(()=>{var O;return(O=b.value)==null?void 0:O.map(q=>({label:q.id,value:q.id}))}),T=t.ref(""),I=t.ref({value:"",label:""}),A=t.computed(()=>{var O,q;return((O=x.value.find(j=>j.value===T.value))==null?void 0:O.label)||((q=I.value)==null?void 0:q.label)}),m=O=>{S.value=O,i(O)},C=O=>{I.value=O},N=()=>{I.value={value:"",label:""}},V=O=>{T.value=O,o("update:name",A.value)},_=t.ref(!1);return t.onBeforeMount(async()=>{var O,q;try{_.value=!0,await c(),n.name&&(T.value=((q=(O=x.value.find(j=>j.label===n.name))==null?void 0:O.value)==null?void 0:q.toString())||n.name),await s()}finally{_.value=!1}}),(O,q)=>{const j=t.resolveComponent("KSkeleton"),Y=t.resolveComponent("KSelect"),$=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Ue),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[_.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",Yc,[t.createVNode(Y,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:x.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":T.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:C,onItemRemoved:N,onQueryChange:m,"onUpdate:modelValue":V},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode($,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":q[0]||(q[0]=D=>o("update:host-header",D))},null,8,["label","model-value","readonly"]),t.createVNode(Y,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:B.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(f),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":q[1]||(q[1]=D=>o("update:client-certificate",D))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode($,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":q[2]||(q[2]=D=>o("update:tags",D))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),rt={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},Gc={class:"fields-group-title"},Xc={class:"fields-group-text"},ed={class:"fields-group-title"},td={class:"fields-group-text"},ad=fe(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=ue.useI18n(),{inRange:n}=Xe(),o=e,i=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>o.hashOn,(u,f)=>{f==="header"&&u!==f&&i("update:hash-on-header",""),f==="cookie"&&u!==f&&(i("update:hash-on-cookie",""),i("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&i("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&i("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(i("update:hash-fallback","none"),i("update:hash-fallback-header",""),i("update:hash-fallback-query-argument",""),i("update:hash-fallback-uri-capture",""))}),t.watch(()=>o.hashFallback,(u,f)=>{f==="header"&&u!==f&&i("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(i("update:hash-on-cookie",""),i("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&i("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&i("update:hash-fallback-uri-capture","")});const p=t.computed(()=>o.hashOn==="cookie"||o.hashOn==="none"),h=t.computed(()=>o.slots?n(o.slots,St,xt)?"":l("upstreams.form.errors.in_range"):"");return(u,f)=>{const s=t.resolveComponent("KExternalLink"),b=t.resolveComponent("KSelect"),S=t.resolveComponent("KInput"),g=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Ue),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(rt).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(b,{class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=x=>i("update:algorithm",x))},null,8,["items","label","model-value","readonly"]),t.createVNode(S,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!h.value,"error-message":h.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(xt),min:t.unref(St),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":f[1]||(f[1]=x=>i("update:slots",x))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Gc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",Xc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(b,{class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[2]||(f[2]=x=>i("update:hash-on",x))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(S,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[3]||(f[3]=x=>i("update:hash-on-header",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(S,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[4]||(f[4]=x=>i("update:hash-on-cookie",x))},null,8,["label","model-value","readonly"]),t.createVNode(S,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[5]||(f[5]=x=>i("update:hash-on-cookie-path",x))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(S,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[6]||(f[6]=x=>i("update:hash-on-query-argument",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(S,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[7]||(f[7]=x=>i("update:hash-on-uri-capture",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",ed,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",td,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(b,{class:"hash-fallback-select",disabled:p.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[8]||(f[8]=x=>i("update:hash-fallback",x))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(S,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[9]||(f[9]=x=>i("update:hash-fallback-header",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(S,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[10]||(f[10]=x=>i("update:hash-on-cookie",x))},null,8,["label","model-value","readonly"]),t.createVNode(S,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[11]||(f[11]=x=>i("update:hash-on-cookie-path",x))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(S,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[12]||(f[12]=x=>i("update:hash-fallback-query-argument",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(S,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[13]||(f[13]=x=>i("update:hash-fallback-uri-capture",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),rd={class:"fields-group-title"},ld={class:"fields-group-text"},nd={class:"fields-group-title"},od={class:"fields-group-text"},id=fe(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=ue.useI18n(),l=r;return(n,o)=>{const i=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),p=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Ue),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(i,{"hide-icon":"",href:t.unref(rt).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",rd,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",ld,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:o[0]||(o[0]=h=>l("update:active-health-switch",h))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",nd,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",od,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:o[1]||(o[1]=h=>l("update:passive-health-switch",h))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(p,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(qc),min:t.unref($c),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":o[2]||(o[2]=h=>l("update:healthchecks-threshold",h))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),sd="#d60027",cd={key:2},dd={class:"fields-group-title"},hd={class:"fields-group-text"},pd={class:"fields-group-title"},ud={class:"fields-group-text"},fd=fe(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=ue.useI18n(),{objectsAreEqual:l}=Xe(),n=e,o=r,i=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:p}=De({replaceId:!0}),{trackNewItems:h}=De({replaceId:!0});t.watch(()=>n.type,(S,g)=>{g==="tcp"&&S!==g&&o("update:tcp-failures","5"),(g==="https"||g==="grpcs")&&S!==g&&(o("update:https-sni",""),o("update:verify-ssl",!1)),g!=="tcp"&&S==="tcp"&&(o("update:http-path","/"),o("update:http-statuses",Nt),o("update:unhealthy-http-statuses",Bt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,S=>{l(u.value,S)||(u.value=[...S])},{immediate:!0,deep:!0});const f=()=>{o("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),f()},b=S=>{S===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(S,1),f()};return(S,g)=>{const x=t.resolveComponent("KExternalLink"),B=t.resolveComponent("KSelect"),T=t.resolveComponent("KInput"),I=t.resolveComponent("KCheckbox"),A=t.resolveComponent("KLabel"),m=t.resolveComponent("KButton"),C=t.resolveComponent("KMultiselect"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Ue),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(x,{"hide-icon":"",href:t.unref(rt).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var V;return[t.createVNode(B,{class:"active-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":g[0]||(g[0]=_=>o("update:type",_))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(T,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":g[1]||(g[1]=_=>o("update:http-path",_))},null,8,["label","model-value","readonly"])),t.createVNode(T,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(Fc),min:t.unref(Oc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":g[2]||(g[2]=_=>o("update:timeout",_))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(T,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(Dc),min:t.unref(Uc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":g[3]||(g[3]=_=>o("update:concurrency",_))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(T,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":g[4]||(g[4]=_=>o("update:https-sni",_))},null,8,["label","model-value","readonly"]),t.createVNode(I,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":g[5]||(g[5]=_=>o("update:verify-ssl",_))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((V=e.config)==null?void 0:V.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",cd,[t.createVNode(A,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(_,H)=>(t.openBlock(),t.createElementBlock("div",{key:`${_.header}_${H}`,class:t.normalizeClass(["headers-row",{"margin-top-6":H>0}])},[t.createVNode(T,{modelValue:u.value[H].key,"onUpdate:modelValue":E=>u.value[H].key=E,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${H+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(T,{modelValue:u.value[H].values,"onUpdate:modelValue":E=>u.value[H].values=E,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${H+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(m,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",disabled:u.value.length===1,icon:"",onClick:E=>b(H)},{default:t.withCtx(()=>[t.createVNode(t.unref(Ec),{class:"delete-item",color:u.value.length>1?t.unref(sd):void 0},null,8,["color"])]),_:2},1032,["disabled","onClick"]),u.value&&H===u.value.length-1?(t.openBlock(),t.createBlock(m,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",icon:"",onClick:s},{default:t.withCtx(()=>[t.createVNode(t.unref(_t))]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",dd,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",hd,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(T,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(ir),min:t.unref(or),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[6]||(g[6]=_=>o("update:interval",_))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(T,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Ve),min:t.unref(Ne),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":g[7]||(g[7]=_=>o("update:successes",_))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ge),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[8]||(g[8]=_=>t.unref(p)(_,!0)),onItemRemoved:g[9]||(g[9]=_=>t.unref(p)(_,!1)),"onUpdate:modelValue":g[10]||(g[10]=_=>o("update:http-statuses",_))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",pd,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",ud,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(T,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(ir),min:t.unref(or),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[11]||(g[11]=_=>o("update:unhealthy-interval",_))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(T,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Ve),min:t.unref(Ne),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[12]||(g[12]=_=>o("update:tcp-failures",_))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(T,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Ve),min:t.unref(Ne),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[13]||(g[13]=_=>o("update:http-failures",_))},null,8,["label","max","min","model-value","readonly"])),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(C,{key:1,autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ge),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[14]||(g[14]=_=>t.unref(h)(_,!0)),onItemRemoved:g[15]||(g[15]=_=>t.unref(h)(_,!1)),"onUpdate:modelValue":g[16]||(g[16]=_=>o("update:unhealthy-http-statuses",_))},null,8,["items","label","model-value","readonly"])),t.createVNode(T,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(nr),min:t.unref(lr),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":g[17]||(g[17]=_=>o("update:unhealthy-timeouts",_))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-efccf560"]]),md={class:"fields-group-title"},gd={class:"fields-group-text"},yd={class:"fields-group-title"},kd={class:"fields-group-text"},bd=fe(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=ue.useI18n(),l=e,n=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),i=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=De({replaceId:!0}),{trackNewItems:c}=De({replaceId:!0});return t.watch(()=>l.type,(p,h)=>{h==="tcp"&&p!==h&&n("update:tcp-failures","5"),h!=="tcp"&&p==="tcp"&&(n("update:http-statuses",Vt),n("update:unhealthy-http-statuses",It))}),(p,h)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),b=t.resolveComponent("KMultiselect"),S=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Ue),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(rt).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(f,{class:"passive-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":h[0]||(h[0]=g=>n("update:type",g))},null,8,["items","label","model-value","readonly"]),t.createVNode(S,null,{default:t.withCtx(()=>[t.createElementVNode("h5",md,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",gd,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Ve),min:t.unref(Ne),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":h[1]||(h[1]=g=>n("update:successes",g))},null,8,["label","max","min","model-value","readonly"]),i.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(b,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ge),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:h[2]||(h[2]=g=>t.unref(d)(g,!0)),onItemRemoved:h[3]||(h[3]=g=>t.unref(d)(g,!1)),"onUpdate:modelValue":h[4]||(h[4]=g=>n("update:http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(S,null,{default:t.withCtx(()=>[t.createElementVNode("h5",yd,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",kd,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(nr),min:t.unref(lr),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":h[5]||(h[5]=g=>n("update:timeouts",g))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(s,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Ve),min:t.unref(Ne),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":h[6]||(h[6]=g=>n("update:tcp-failures",g))},null,8,["label","max","min","model-value","readonly"]),i.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(s,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Ve),min:t.unref(Ne),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":h[7]||(h[7]=g=>n("update:http-failures",g))},null,8,["label","max","min","model-value","readonly"])),i.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(b,{key:1,autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ge),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:h[8]||(h[8]=g=>t.unref(c)(g,!0)),onItemRemoved:h[9]||(h[9]=g=>t.unref(c)(g,!1)),"onUpdate:modelValue":h[10]||(h[10]=g=>n("update:unhealthy-http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-5bd9952e"]]),Cd={class:"kong-ui-entities-upstreams-form"},wd=fe(t.defineComponent({__name:"UpstreamsForm",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))},upstreamId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(e,{emit:r}){var K;const a=e,l=r,{inRange:n,stringToNumberArray:o,upstreamsResponseToFields:i,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:p}=Xe(),{axiosInstance:h}=Ye((K=a.config)==null?void 0:K.axiosRequestConfig),{getMessageFromError:u}=er(),f=lt.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),b=t.reactive(d()),S=t.computed(()=>!c(s.fields,b)),g=k=>{s.fields.activeHealthCheck.interval=k?"5":"0",s.fields.activeHealthCheck.successes=k?"5":"0",s.fields.activeHealthCheck.httpFailures=k?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=k?"5":"0",s.fields.activeHealthCheck.tcpFailures=k?"5":"0"},x=k=>{s.fields.passiveHealthCheck.timeouts=k?"5":"0",s.fields.passiveHealthCheck.successes=k?"80":"0",s.fields.passiveHealthCheck.tcpFailures=k?"5":"0",s.fields.passiveHealthCheck.httpFailures=k?"5":"0"},B=t.computed(()=>s.fields.slots?n(s.fields.slots,St,xt):!0),T=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),I=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),A=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),m=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),C=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),N=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),V=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),_=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),H=t.computed(()=>!!s.fields.name&&B.value&&T.value&&I.value&&A.value&&m.value&&C.value&&N.value&&V.value&&_.value),E=t.computed(()=>a.upstreamId?se.Edit:se.Create),F=t.computed(()=>{var k,y;return(y=Te.form[(k=a.config)==null?void 0:k.app])==null?void 0:y.edit}),U=k=>{Object.assign(s.fields,i(k)),Object.assign(b,p(s.fields))},O=()=>{var k;f.push(((k=a.config)==null?void 0:k.cancelRoute)||{name:"upstreams-list"})},q=k=>{l("loading",k)},j=k=>{l("error",k)},Y=t.computed(()=>{var y,w,R,M,z;const k={name:s.fields.name,slots:Number(s.fields.slots),algorithm:s.fields.algorithm,hash_on:s.fields.hashOn,hash_fallback:s.fields.hashFallback,healthchecks:{}};return s.fields.hostHeader&&(k.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(k.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(k.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(k.tags=(w=(y=s.fields.tags.split(","))==null?void 0:y.map(ee=>String(ee||"").trim()))==null?void 0:w.filter(ee=>ee!=="")),s.fields.hashOn==="header"&&(k.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(k.hash_on_cookie=s.fields.hashOnCookie,k.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(k.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(k.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(k.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(k.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(k.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(k.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(k.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(k.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(k.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?k.healthchecks.active.headers=[]:k.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((ee,P)=>{var ae,be;return P.key?{...ee,[P.key]:(be=(ae=P.values.split(","))==null?void 0:ae.map(Ae=>String(Ae||"").trim()))==null?void 0:be.filter(Ae=>Ae!=="")}:{...ee}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(k.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(k.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(k.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(k.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(k.healthchecks.active.healthy.http_statuses=o(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(k.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(k.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.active.unhealthy.http_statuses=o(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(k.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.tcpFailures&&(k.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((M=a.config)==null?void 0:M.app)==="kongManager"&&E.value===se.Edit&&(k.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0,successes:0},unhealthy:{interval:0,http_failures:0,tcp_failures:0}}),s.fields.passiveHealthSwitch?(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(k.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(k.healthchecks.passive.healthy.http_statuses=o(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(k.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.passive.unhealthy.http_statuses=o(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(k.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.tcpFailures&&(k.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&E.value===se.Edit&&(k.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),k}),$=k=>{var w,R,M,z,ee,P;let y=`${(w=a.config)==null?void 0:w.apiBaseUrl}${Te.form[(R=a.config)==null?void 0:R.app][k]}`;return((M=a.config)==null?void 0:M.app)==="konnect"?y=y.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((ee=a.config)==null?void 0:ee.app)==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(P=a.config)!=null&&P.workspace?`/${a.config.workspace}`:"")),y=y.replace(/{id}/gi,a.upstreamId),y},D=async()=>{var k;try{s.readonly=!0,await h.post($("validate"),Y.value);let y;E.value===se.Create?y=await h.post($("create"),Y.value):E.value===se.Edit&&(y=((k=a.config)==null?void 0:k.app)==="konnect"?await h.put($("edit"),Y.value):await h.patch($("edit"),Y.value)),l("update",y==null?void 0:y.data)}catch(y){s.errorMessage=u(y),l("error",y)}finally{s.readonly=!1}};return(k,y)=>(t.openBlock(),t.createElementBlock("div",Cd,[t.createVNode(t.unref(Wa),{"can-submit":H.value&&S.value,config:e.config,"edit-id":e.upstreamId,"enable-terraform":e.enableTerraform,"entity-type":t.unref(Ee).Upstream,"error-message":s.errorMessage,"fetch-url":F.value,"form-fields":Y.value,"is-readonly":s.readonly,onCancel:O,"onFetch:error":j,"onFetch:success":U,onLoading:q,onSubmit:D},{default:t.withCtx(()=>[t.createVNode(Zc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":y[0]||(y[0]=w=>s.fields.clientCertificate=w),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":y[1]||(y[1]=w=>s.fields.hostHeader=w),name:s.fields.name,"onUpdate:name":y[2]||(y[2]=w=>s.fields.name=w),tags:s.fields.tags,"onUpdate:tags":y[3]||(y[3]=w=>s.fields.tags=w),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(ad,{algorithm:s.fields.algorithm,"onUpdate:algorithm":y[4]||(y[4]=w=>s.fields.algorithm=w),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":y[5]||(y[5]=w=>s.fields.hashFallback=w),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":y[6]||(y[6]=w=>s.fields.hashFallbackHeader=w),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":y[7]||(y[7]=w=>s.fields.hashFallbackQueryArgument=w),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":y[8]||(y[8]=w=>s.fields.hashFallbackUriCapture=w),"hash-on":s.fields.hashOn,"onUpdate:hashOn":y[9]||(y[9]=w=>s.fields.hashOn=w),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":y[10]||(y[10]=w=>s.fields.hashOnCookie=w),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":y[11]||(y[11]=w=>s.fields.hashOnCookiePath=w),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":y[12]||(y[12]=w=>s.fields.hashOnHeader=w),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":y[13]||(y[13]=w=>s.fields.hashOnQueryArgument=w),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":y[14]||(y[14]=w=>s.fields.hashOnUriCapture=w),slots:s.fields.slots,"onUpdate:slots":y[15]||(y[15]=w=>s.fields.slots=w),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(id,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[y[16]||(y[16]=w=>s.fields.activeHealthSwitch=w),g],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":y[17]||(y[17]=w=>s.fields.healthchecksThreshold=w),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[y[18]||(y[18]=w=>s.fields.passiveHealthSwitch=w),x],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(fd,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":y[19]||(y[19]=w=>s.fields.activeHealthCheck.concurrency=w),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":y[20]||(y[20]=w=>s.fields.activeHealthCheck.headers=w),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":y[21]||(y[21]=w=>s.fields.activeHealthCheck.httpFailures=w),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":y[22]||(y[22]=w=>s.fields.activeHealthCheck.httpPath=w),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[23]||(y[23]=w=>s.fields.activeHealthCheck.httpStatuses=w),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":y[24]||(y[24]=w=>s.fields.activeHealthCheck.httpsSni=w),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":y[25]||(y[25]=w=>s.fields.activeHealthCheck.interval=w),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":y[26]||(y[26]=w=>s.fields.activeHealthCheck.successes=w),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[27]||(y[27]=w=>s.fields.activeHealthCheck.tcpFailures=w),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":y[28]||(y[28]=w=>s.fields.activeHealthCheck.timeout=w),type:s.fields.activeHealthCheck.type,"onUpdate:type":y[29]||(y[29]=w=>s.fields.activeHealthCheck.type=w),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[30]||(y[30]=w=>s.fields.activeHealthCheck.unhealthyHttpStatuses=w),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":y[31]||(y[31]=w=>s.fields.activeHealthCheck.unhealthyInterval=w),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":y[32]||(y[32]=w=>s.fields.activeHealthCheck.unhealthyTimeouts=w),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":y[33]||(y[33]=w=>s.fields.activeHealthCheck.verifySsl=w),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(bd,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":y[34]||(y[34]=w=>s.fields.passiveHealthCheck.httpFailures=w),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[35]||(y[35]=w=>s.fields.passiveHealthCheck.httpStatuses=w),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":y[36]||(y[36]=w=>s.fields.passiveHealthCheck.successes=w),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[37]||(y[37]=w=>s.fields.passiveHealthCheck.tcpFailures=w),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":y[38]||(y[38]=w=>s.fields.passiveHealthCheck.timeouts=w),type:s.fields.passiveHealthCheck.type,"onUpdate:type":y[39]||(y[39]=w=>s.fields.passiveHealthCheck.type=w),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[40]||(y[40]=w=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=w),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-ebffe769"]]),_d=t.createElementVNode("code",null,"10",-1),Sd=t.createElementVNode("code",null,"65536",-1),xd={"data-testid":"client_certificate-plain-text"},Nd=t.defineComponent({__name:"UpstreamsConfigCard",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},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=ue.useI18n(),{getPropValue:n}=_c(),o=t.computed(()=>Te.form[r.config.app].edit),i=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:J.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:J.Basic},hash_on:{order:7,section:J.Basic},hash_on_header:{order:8,section:J.Basic},hash_on_uri_capture:{order:9,section:J.Basic},hash_on_query_arg:{order:10,section:J.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:J.Basic},hash_on_cookie_path:{order:12,section:J.Basic},healthchecks:{order:13,section:J.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(qs),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":i.value,"enable-terraform":e.enableTerraform,"entity-type":t.unref(Ee).Upstream,"fetch-url":o.value,"hide-title":e.hideTitle,"onFetch:error":c[0]||(c[0]=p=>d.$emit("fetch:error",p)),"onFetch:success":c[1]||(c[1]=p=>d.$emit("fetch:success",p)),onLoading:c[2]||(c[2]=p=>d.$emit("loading",p))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:p})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(p.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[_d]),max:t.withCtx(()=>[Sd]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(p=>{var h;return[t.createElementVNode("div",null,[t.createElementVNode("div",xd,[t.createElementVNode("span",null,t.toDisplayString((h=t.unref(n)("rowValue",p))==null?void 0:h.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}});re.TargetForm=sr,re.TargetsList=Qc,re.UpstreamsConfigCard=Nd,re.UpstreamsForm=wd,re.UpstreamsList=Lc,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});