@kong-ui-public/spec-renderer 2.0.31 → 2.0.32
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.
package/dist/spec-renderer.es.js
CHANGED
|
@@ -49756,7 +49756,7 @@ const Dy = /* @__PURE__ */ QC(XC), Gg = "default", eP = "#3a3f51", tP = "#afb7c5
|
|
|
49756
49756
|
for (const [Za, ut] of Xr)
|
|
49757
49757
|
yo[Za] = ut;
|
|
49758
49758
|
return yo;
|
|
49759
|
-
}, rP = (Gt) => (Fy("data-v-
|
|
49759
|
+
}, rP = (Gt) => (Fy("data-v-02210aee"), Gt = Gt(), $y(), Gt), oP = ["aria-hidden"], aP = {
|
|
49760
49760
|
key: 0,
|
|
49761
49761
|
"data-testid": "kui-icon-svg-title"
|
|
49762
49762
|
}, nP = /* @__PURE__ */ rP(() => /* @__PURE__ */ Jc("path", {
|
|
@@ -49855,7 +49855,7 @@ const Dy = /* @__PURE__ */ QC(XC), Gg = "default", eP = "#3a3f51", tP = "#afb7c5
|
|
|
49855
49855
|
_: 1
|
|
49856
49856
|
}, 8, ["aria-hidden", "style"]));
|
|
49857
49857
|
}
|
|
49858
|
-
}), sP = /* @__PURE__ */ qy(iP, [["__scopeId", "data-v-
|
|
49858
|
+
}), sP = /* @__PURE__ */ qy(iP, [["__scopeId", "data-v-02210aee"]]), cP = (Gt) => (Fy("data-v-5b2d3ba5"), Gt = Gt(), $y(), Gt), lP = ["aria-hidden"], uP = {
|
|
49859
49859
|
key: 0,
|
|
49860
49860
|
"data-testid": "kui-icon-svg-title"
|
|
49861
49861
|
}, pP = /* @__PURE__ */ cP(() => /* @__PURE__ */ Jc("path", {
|
|
@@ -49954,7 +49954,7 @@ const Dy = /* @__PURE__ */ QC(XC), Gg = "default", eP = "#3a3f51", tP = "#afb7c5
|
|
|
49954
49954
|
_: 1
|
|
49955
49955
|
}, 8, ["aria-hidden", "style"]));
|
|
49956
49956
|
}
|
|
49957
|
-
}), hP = /* @__PURE__ */ qy(dP, [["__scopeId", "data-v-
|
|
49957
|
+
}), hP = /* @__PURE__ */ qy(dP, [["__scopeId", "data-v-5b2d3ba5"]]), gP = (Gt) => (Fy("data-v-41114e4d"), Gt = Gt(), $y(), Gt), fP = ["aria-hidden"], mP = {
|
|
49958
49958
|
key: 0,
|
|
49959
49959
|
"data-testid": "kui-icon-svg-title"
|
|
49960
49960
|
}, bP = /* @__PURE__ */ gP(() => /* @__PURE__ */ Jc("path", {
|
|
@@ -50053,7 +50053,7 @@ const Dy = /* @__PURE__ */ QC(XC), Gg = "default", eP = "#3a3f51", tP = "#afb7c5
|
|
|
50053
50053
|
_: 1
|
|
50054
50054
|
}, 8, ["aria-hidden", "style"]));
|
|
50055
50055
|
}
|
|
50056
|
-
}), yP = /* @__PURE__ */ qy(vP, [["__scopeId", "data-v-
|
|
50056
|
+
}), yP = /* @__PURE__ */ qy(vP, [["__scopeId", "data-v-41114e4d"]]), kP = ["aria-controls", "aria-expanded", "aria-label"], wP = {
|
|
50057
50057
|
"aria-hidden": "true",
|
|
50058
50058
|
class: "icon-wrapper"
|
|
50059
50059
|
}, xP = {
|
|
@@ -214,4 +214,4 @@ div#sidebar {
|
|
|
214
214
|
top: unset;
|
|
215
215
|
left: unset;
|
|
216
216
|
}
|
|
217
|
-
`,a.setAttribute("data-testid","relative-sidebar-styles"),this.shadowRoot.appendChild(a)}_n(this,uu)&&r1.use({target:this.shadowRoot,testId:"hide-essentials-styles"});const r={hasSidebar:_n(this,Uu),applicationRegistrationEnabled:_n(this,Md),currentVersion:{version:_n(this,Ld)},onViewSpecClick:()=>{this.dispatchEvent(new CustomEvent("clicked-view-spec",{bubbles:!0}))},onRegisterClick:()=>{this.dispatchEvent(new CustomEvent("clicked-register",{bubbles:!0}))},..._n(this,Dd)};hl(this,Kc,Df({url:_n(this,jp),spec:_n(this,$u),domNode:this.rootElement,deepLinking:!0,filter:!0,presets:[Df.presets.apis,Df.SwaggerUIStandalonePreset],plugins:[Df.plugins.DownloadUrl,h3.SwaggerUIKongTheme],layout:"KongLayout",theme:r}))}showOperation(r){if(!_n(this,Kc))return!1;const a=uy(r);return _n(this,Kc).layoutActions.show(a,!0),!0}hideOperation(r){if(!_n(this,Kc))return!1;const a=uy(r);return _n(this,Kc).layoutActions.show(a,!1),!0}scrollToOperation(r){if(!_n(this,Kc))return!1;const a=yC(r);let i=this.shadowRoot.getElementById(a);if(!i){const x=this.shadowRoot.querySelector(`[data-tag='${r.tag}']`);if(!x||(x.click(),i=this.shadowRoot.getElementById(a),!i))return!1}const m=window.matchMedia("(prefers-reduced-motion: no-preference)");let A;m&&m.matches&&(A="smooth"),i.scrollIntoView({behavior:A})}get autoInit(){return _n(this,Bd)}set autoInit(r){hl(this,Bd,Pg(r))}get hasSidebar(){return _n(this,Uu)}set hasSidebar(r){hl(this,Uu,Pg(r))}get relativeSidebar(){return _n(this,Cp)}set relativeSidebar(r){hl(this,Cp,Pg(r))}get essentialsOnly(){return _n(this,uu)}set essentialsOnly(r){hl(this,uu,Pg(r))}get spec(){return _n(this,$u)}set spec(r){if(!r)throw new Error("Spec cannot be empty");let a;typeof r=="string"?a=JSON.parse(r):typeof r=="object"&&(a=r),hl(this,$u,a),_n(this,Kc)&&_n(this,Kc).getSystem().specActions.updateJsonSpec(_n(this,$u))}get url(){return _n(this,jp)}set url(r){hl(this,jp,r)}get themeOverrides(){return _n(this,Dd)}set themeOverrides(r){hl(this,Dd,r)}get applicationRegistrationEnabled(){return _n(this,Md)}set applicationRegistrationEnabled(r){hl(this,Md,Pg(r))}get currentVersion(){return _n(this,Ld)}set currentVersion(r){hl(this,Ld,r)}static get observedAttributes(){return["url","spec","auto-init","has-sidebar","relative-sidebar","essentials-only","application-registration-enabled","current-version","theme-overrides"]}}Bd=new WeakMap,$u=new WeakMap,jp=new WeakMap,Uu=new WeakMap,Cp=new WeakMap,uu=new WeakMap,Kc=new WeakMap,Dd=new WeakMap,Md=new WeakMap,Ld=new WeakMap,Za(Rg,"name","kong-swagger-ui"),customElements.get(Rg.name)?console.warn(`Cannot register ${Rg.name}. Element is already defined, ignoring`):customElements.define(Rg.name,Rg)})()})();const S1=["application-registration-enabled","current-version","essentials-only","has-sidebar","relative-sidebar","spec","theme-overrides","url"],_1={key:1,"data-testid":"kong-public-ui-spec-details-error"},A1=St.defineComponent({__name:"SpecDetails",props:{document:{type:Object,default:null},url:{type:String,default:""},hasSidebar:{type:Boolean,default:!1},relativeSidebar:{type:Boolean,default:!1},themeOverrides:{type:Object,default:null},essentialsOnly:{type:Boolean,default:!1},activeOperation:{type:Object,default:null},applicationRegistrationEnabled:{type:Boolean,default:!1},currentVersion:{type:String,default:()=>{}}},setup(ir){const yo=ir,{i18n:Lo}=Ku.useI18n(),cn=St.ref(null),ut=St.computed(()=>!!(yo.document||yo.url)),b=St.ref(!1),j=()=>{if(!cn.value)return;const o={...yo.activeOperation};if(o&&o.tag){const u=decodeURIComponent(o.tag.trim().replaceAll(/\s/g,"%20"));o.tag=u}cn.value.showOperation(o),cn.value.scrollToOperation(o),b.value=!0};return St.onMounted(()=>{yo.activeOperation&&j()}),St.watch(()=>yo.activeOperation,()=>{yo.activeOperation&&j()}),(o,u)=>(St.openBlock(),St.createElementBlock("div",{class:St.normalizeClass(["kong-public-ui-spec-details",{"active-op-focused":b.value}])},[ut.value?(St.openBlock(),St.createElementBlock("kong-swagger-ui",{key:0,ref_key:"swaggerRef",ref:cn,"application-registration-enabled":ir.applicationRegistrationEnabled,"current-version":ir.currentVersion,"data-testid":"kong-public-ui-spec-details-swagger","essentials-only":ir.essentialsOnly,"has-sidebar":ir.hasSidebar,"relative-sidebar":ir.relativeSidebar,spec:ir.document,"theme-overrides":encodeURIComponent(JSON.stringify(ir.themeOverrides)),url:ir.url},null,8,S1)):(St.openBlock(),St.createElementBlock("div",_1,St.toDisplayString(St.unref(Lo).t("specDetails.error")),1))],2))}}),Ud=(ir,yo)=>{const Lo=ir.__vccOpts||ir;for(const[cn,ut]of yo)Lo[cn]=ut;return Lo},_y=Ud(A1,[["__scopeId","data-v-71bf6e29"]]);let qg;const O1=new Uint8Array(16);function j1(){if(!qg&&(qg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qg(O1)}const ds=[];for(let ir=0;ir<256;++ir)ds.push((ir+256).toString(16).slice(1));function C1(ir,yo=0){return ds[ir[yo+0]]+ds[ir[yo+1]]+ds[ir[yo+2]]+ds[ir[yo+3]]+"-"+ds[ir[yo+4]]+ds[ir[yo+5]]+"-"+ds[ir[yo+6]]+ds[ir[yo+7]]+"-"+ds[ir[yo+8]]+ds[ir[yo+9]]+"-"+ds[ir[yo+10]]+ds[ir[yo+11]]+ds[ir[yo+12]]+ds[ir[yo+13]]+ds[ir[yo+14]]+ds[ir[yo+15]]}let Ay,B0,D0=0,M0=0;function P1(ir,yo,Lo){let cn=yo&&Lo||0;const ut=yo||new Array(16);ir=ir||{};let b=ir.node||Ay,j=ir.clockseq!==void 0?ir.clockseq:B0;if(b==null||j==null){const O=ir.random||(ir.rng||j1)();b==null&&(b=Ay=[O[0]|1,O[1],O[2],O[3],O[4],O[5]]),j==null&&(j=B0=(O[6]<<8|O[7])&16383)}let o=ir.msecs!==void 0?ir.msecs:Date.now(),u=ir.nsecs!==void 0?ir.nsecs:M0+1;const y=o-D0+(u-M0)/1e4;if(y<0&&ir.clockseq===void 0&&(j=j+1&16383),(y<0||o>D0)&&ir.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");D0=o,M0=u,B0=j,o+=122192928e5;const S=((o&268435455)*1e4+u)%4294967296;ut[cn++]=S>>>24&255,ut[cn++]=S>>>16&255,ut[cn++]=S>>>8&255,ut[cn++]=S&255;const w=o/4294967296*1e4&268435455;ut[cn++]=w>>>8&255,ut[cn++]=w&255,ut[cn++]=w>>>24&15|16,ut[cn++]=w>>>16&255,ut[cn++]=j>>>8|128,ut[cn++]=j&255;for(let O=0;O<6;++O)ut[cn+O]=b[O];return yo||C1(ut)}var Kg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function I1(ir){return ir&&ir.__esModule&&Object.prototype.hasOwnProperty.call(ir,"default")?ir.default:ir}var Hg={exports:{}};Hg.exports,function(ir,yo){var Lo=200,cn="__lodash_hash_undefined__",ut=9007199254740991,b="[object Arguments]",j="[object Array]",o="[object Boolean]",u="[object Date]",y="[object Error]",S="[object Function]",w="[object GeneratorFunction]",O="[object Map]",T="[object Number]",p="[object Object]",n="[object Promise]",l="[object RegExp]",d="[object Set]",s="[object String]",g="[object Symbol]",k="[object WeakMap]",E="[object ArrayBuffer]",f="[object DataView]",_="[object Float32Array]",P="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",F="[object Int32Array]",M="[object Uint8Array]",N="[object Uint8ClampedArray]",q="[object Uint16Array]",W="[object Uint32Array]",te=/[\\^$.*+?()[\]{}|]/g,re=/\w*$/,Z=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,Q={};Q[b]=Q[j]=Q[E]=Q[f]=Q[o]=Q[u]=Q[_]=Q[P]=Q[R]=Q[D]=Q[F]=Q[O]=Q[T]=Q[p]=Q[l]=Q[d]=Q[s]=Q[g]=Q[M]=Q[N]=Q[q]=Q[W]=!0,Q[y]=Q[S]=Q[k]=!1;var fe=typeof Kg=="object"&&Kg&&Kg.Object===Object&&Kg,ne=typeof self=="object"&&self&&self.Object===Object&&self,ae=fe||ne||Function("return this")(),me=yo&&!yo.nodeType&&yo,Pe=me&&!0&&ir&&!ir.nodeType&&ir,Fe=Pe&&Pe.exports===me;function ze(We,or){return We.set(or[0],or[1]),We}function $e(We,or){return We.add(or),We}function Je(We,or){for(var Rr=-1,ko=We?We.length:0;++Rr<ko&&or(We[Rr],Rr,We)!==!1;);return We}function Te(We,or){for(var Rr=-1,ko=or.length,wn=We.length;++Rr<ko;)We[wn+Rr]=or[Rr];return We}function Ae(We,or,Rr,ko){var wn=-1,Vn=We?We.length:0;for(ko&&Vn&&(Rr=We[++wn]);++wn<Vn;)Rr=or(Rr,We[wn],wn,We);return Rr}function lt(We,or){for(var Rr=-1,ko=Array(We);++Rr<We;)ko[Rr]=or(Rr);return ko}function dt(We,or){return We==null?void 0:We[or]}function Pt(We){var or=!1;if(We!=null&&typeof We.toString!="function")try{or=!!(We+"")}catch{}return or}function Vt(We){var or=-1,Rr=Array(We.size);return We.forEach(function(ko,wn){Rr[++or]=[wn,ko]}),Rr}function yr(We,or){return function(Rr){return We(or(Rr))}}function Jt(We){var or=-1,Rr=Array(We.size);return We.forEach(function(ko){Rr[++or]=ko}),Rr}var Ar=Array.prototype,ur=Function.prototype,Or=Object.prototype,Br=ae["__core-js_shared__"],kr=function(){var We=/[^.]+$/.exec(Br&&Br.keys&&Br.keys.IE_PROTO||"");return We?"Symbol(src)_1."+We:""}(),Bt=ur.toString,De=Or.hasOwnProperty,et=Or.toString,At=RegExp("^"+Bt.call(De).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ke=Fe?ae.Buffer:void 0,Ye=ae.Symbol,jt=ae.Uint8Array,Dt=yr(Object.getPrototypeOf,Object),xr=Object.create,X=Or.propertyIsEnumerable,pe=Ar.splice,ke=Object.getOwnPropertySymbols,Ve=Ke?Ke.isBuffer:void 0,ot=yr(Object.keys,Object),pt=Bn(ae,"DataView"),Ge=Bn(ae,"Map"),Ot=Bn(ae,"Promise"),hr=Bn(ae,"Set"),_t=Bn(ae,"WeakMap"),Ie=Bn(Object,"create"),He=Xn(pt),Qe=Xn(Ge),vt=Xn(Ot),_r=Xn(hr),Sr=Xn(_t),Yr=Ye?Ye.prototype:void 0,Xr=Yr?Yr.valueOf:void 0;function bo(We){var or=-1,Rr=We?We.length:0;for(this.clear();++or<Rr;){var ko=We[or];this.set(ko[0],ko[1])}}function zt(){this.__data__=Ie?Ie(null):{}}function Er(We){return this.has(We)&&delete this.__data__[We]}function Jr(We){var or=this.__data__;if(Ie){var Rr=or[We];return Rr===cn?void 0:Rr}return De.call(or,We)?or[We]:void 0}function go(We){var or=this.__data__;return Ie?or[We]!==void 0:De.call(or,We)}function Po(We,or){var Rr=this.__data__;return Rr[We]=Ie&&or===void 0?cn:or,this}bo.prototype.clear=zt,bo.prototype.delete=Er,bo.prototype.get=Jr,bo.prototype.has=go,bo.prototype.set=Po;function so(We){var or=-1,Rr=We?We.length:0;for(this.clear();++or<Rr;){var ko=We[or];this.set(ko[0],ko[1])}}function Io(){this.__data__=[]}function Oo(We){var or=this.__data__,Rr=mt(or,We);if(Rr<0)return!1;var ko=or.length-1;return Rr==ko?or.pop():pe.call(or,Rr,1),!0}function Do(We){var or=this.__data__,Rr=mt(or,We);return Rr<0?void 0:or[Rr][1]}function _a(We){return mt(this.__data__,We)>-1}function bn(We,or){var Rr=this.__data__,ko=mt(Rr,We);return ko<0?Rr.push([We,or]):Rr[ko][1]=or,this}so.prototype.clear=Io,so.prototype.delete=Oo,so.prototype.get=Do,so.prototype.has=_a,so.prototype.set=bn;function aa(We){var or=-1,Rr=We?We.length:0;for(this.clear();++or<Rr;){var ko=We[or];this.set(ko[0],ko[1])}}function Wo(){this.__data__={hash:new bo,map:new(Ge||so),string:new bo}}function Pa(We){return ki(this,We).delete(We)}function La(We){return ki(this,We).get(We)}function tr(We){return ki(this,We).has(We)}function pr(We,or){return ki(this,We).set(We,or),this}aa.prototype.clear=Wo,aa.prototype.delete=Pa,aa.prototype.get=La,aa.prototype.has=tr,aa.prototype.set=pr;function ar(We){this.__data__=new so(We)}function Qr(){this.__data__=new so}function sr(We){return this.__data__.delete(We)}function ha(We){return this.__data__.get(We)}function ao(We){return this.__data__.has(We)}function st(We,or){var Rr=this.__data__;if(Rr instanceof so){var ko=Rr.__data__;if(!Ge||ko.length<Lo-1)return ko.push([We,or]),this;Rr=this.__data__=new aa(ko)}return Rr.set(We,or),this}ar.prototype.clear=Qr,ar.prototype.delete=sr,ar.prototype.get=ha,ar.prototype.has=ao,ar.prototype.set=st;function Ee(We,or){var Rr=ei(We)||Fi(We)?lt(We.length,String):[],ko=Rr.length,wn=!!ko;for(var Vn in We)(or||De.call(We,Vn))&&!(wn&&(Vn=="length"||Li(Vn,ko)))&&Rr.push(Vn);return Rr}function Ue(We,or,Rr){var ko=We[or];(!(De.call(We,or)&&Ki(ko,Rr))||Rr===void 0&&!(or in We))&&(We[or]=Rr)}function mt(We,or){for(var Rr=We.length;Rr--;)if(Ki(We[Rr][0],or))return Rr;return-1}function Ft(We,or){return We&&un(or,vo(or),We)}function wr(We,or,Rr,ko,wn,Vn,Wn){var ti;if(ko&&(ti=Vn?ko(We,wn,Vn,Wn):ko(We)),ti!==void 0)return ti;if(!xt(We))return We;var wi=ei(We);if(wi){if(ti=Ni(We),!or)return tn(We,ti)}else{var gi=hi(We),as=gi==S||gi==w;if(ji(We))return Ro(We,or);if(gi==p||gi==b||as&&!Vn){if(Pt(We))return Vn?We:{};if(ti=Un(as?{}:We),!or)return fa(We,Ft(ti,We))}else{if(!Q[gi])return Vn?We:{};ti=za(We,gi,wr,or)}}Wn||(Wn=new ar);var hc=Wn.get(We);if(hc)return hc;if(Wn.set(We,ti),!wi)var ns=Rr?Qn(We):vo(We);return Je(ns||We,function(rn,Xs){ns&&(Xs=rn,rn=We[Xs]),Ue(ti,Xs,wr(rn,or,Rr,ko,Xs,We,Wn))}),ti}function ht(We){return xt(We)?xr(We):{}}function Lt(We,or,Rr){var ko=or(We);return ei(We)?ko:Te(ko,Rr(We))}function Tr(We){return et.call(We)}function gr(We){if(!xt(We)||fn(We))return!1;var or=dn(We)||Pt(We)?At:Z;return or.test(Xn(We))}function co(We){if(!ui(We))return ot(We);var or=[];for(var Rr in Object(We))De.call(We,Rr)&&Rr!="constructor"&&or.push(Rr);return or}function Ro(We,or){if(or)return We.slice();var Rr=new We.constructor(We.length);return We.copy(Rr),Rr}function ga(We){var or=new We.constructor(We.byteLength);return new jt(or).set(new jt(We)),or}function ka(We,or){var Rr=or?ga(We.buffer):We.buffer;return new We.constructor(Rr,We.byteOffset,We.byteLength)}function Qa(We,or,Rr){var ko=or?Rr(Vt(We),!0):Vt(We);return Ae(ko,ze,new We.constructor)}function gn(We){var or=new We.constructor(We.source,re.exec(We));return or.lastIndex=We.lastIndex,or}function Ca(We,or,Rr){var ko=or?Rr(Jt(We),!0):Jt(We);return Ae(ko,$e,new We.constructor)}function Ia(We){return Xr?Object(Xr.call(We)):{}}function Ka(We,or){var Rr=or?ga(We.buffer):We.buffer;return new We.constructor(Rr,We.byteOffset,We.length)}function tn(We,or){var Rr=-1,ko=We.length;for(or||(or=Array(ko));++Rr<ko;)or[Rr]=We[Rr];return or}function un(We,or,Rr,ko){Rr||(Rr={});for(var wn=-1,Vn=or.length;++wn<Vn;){var Wn=or[wn],ti=ko?ko(Rr[Wn],We[Wn],Wn,Rr,We):void 0;Ue(Rr,Wn,ti===void 0?We[Wn]:ti)}return Rr}function fa(We,or){return un(We,ma(We),or)}function Qn(We){return Lt(We,vo,ma)}function ki(We,or){var Rr=We.__data__;return hs(or)?Rr[typeof or=="string"?"string":"hash"]:Rr.map}function Bn(We,or){var Rr=dt(We,or);return gr(Rr)?Rr:void 0}var ma=ke?yr(ke,Object):zo,hi=Tr;(pt&&hi(new pt(new ArrayBuffer(1)))!=f||Ge&&hi(new Ge)!=O||Ot&&hi(Ot.resolve())!=n||hr&&hi(new hr)!=d||_t&&hi(new _t)!=k)&&(hi=function(We){var or=et.call(We),Rr=or==p?We.constructor:void 0,ko=Rr?Xn(Rr):void 0;if(ko)switch(ko){case He:return f;case Qe:return O;case vt:return n;case _r:return d;case Sr:return k}return or});function Ni(We){var or=We.length,Rr=We.constructor(or);return or&&typeof We[0]=="string"&&De.call(We,"index")&&(Rr.index=We.index,Rr.input=We.input),Rr}function Un(We){return typeof We.constructor=="function"&&!ui(We)?ht(Dt(We)):{}}function za(We,or,Rr,ko){var wn=We.constructor;switch(or){case E:return ga(We);case o:case u:return new wn(+We);case f:return ka(We,ko);case _:case P:case R:case D:case F:case M:case N:case q:case W:return Ka(We,ko);case O:return Qa(We,ko,Rr);case T:case s:return new wn(We);case l:return gn(We);case d:return Ca(We,ko,Rr);case g:return Ia(We)}}function Li(We,or){return or=or??ut,!!or&&(typeof We=="number"||le.test(We))&&We>-1&&We%1==0&&We<or}function hs(We){var or=typeof We;return or=="string"||or=="number"||or=="symbol"||or=="boolean"?We!=="__proto__":We===null}function fn(We){return!!kr&&kr in We}function ui(We){var or=We&&We.constructor,Rr=typeof or=="function"&&or.prototype||Or;return We===Rr}function Xn(We){if(We!=null){try{return Bt.call(We)}catch{}try{return We+""}catch{}}return""}function os(We){return wr(We,!0,!0)}function Ki(We,or){return We===or||We!==We&&or!==or}function Fi(We){return $i(We)&&De.call(We,"callee")&&(!X.call(We,"callee")||et.call(We)==b)}var ei=Array.isArray;function Ha(We){return We!=null&&gs(We.length)&&!dn(We)}function $i(We){return oo(We)&&Ha(We)}var ji=Ve||kn;function dn(We){var or=xt(We)?et.call(We):"";return or==S||or==w}function gs(We){return typeof We=="number"&&We>-1&&We%1==0&&We<=ut}function xt(We){var or=typeof We;return!!We&&(or=="object"||or=="function")}function oo(We){return!!We&&typeof We=="object"}function vo(We){return Ha(We)?Ee(We):co(We)}function zo(){return[]}function kn(){return!1}ir.exports=os}(Hg,Hg.exports);var T1=Hg.exports;const L0=I1(T1),Rp="default",R1="#3a3f51",z1="#afb7c5",Oy="20px",zp="24px",F0=(ir,yo)=>{const Lo=ir.__vccOpts||ir;for(const[cn,ut]of yo)Lo[cn]=ut;return Lo},N1=ir=>(St.pushScopeId("data-v-a8e0d45a"),ir=ir(),St.popScopeId(),ir),B1=["aria-hidden"],D1={key:0,"data-testid":"kui-icon-svg-title"},M1=N1(()=>St.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),L1=St.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:zp,validator:ir=>{if(typeof ir=="number"&&ir>0)return!0;if(typeof ir=="string"){const yo=String(ir).replace(/px/gi,""),Lo=Number(yo);if(Lo&&!isNaN(Lo)&&Number.isInteger(Lo)&&Lo>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(ir){const yo=ir,Lo=St.computed(()=>{if(typeof yo.size=="number"&&yo.size>0)return`${yo.size}px`;if(typeof yo.size=="string"){const ut=String(yo.size).replace(/px/gi,""),b=Number(ut);if(b&&!isNaN(b)&&Number.isInteger(b)&&b>0)return`${b}px`}return zp}),cn=St.computed(()=>({boxSizing:"border-box",color:yo.color,display:yo.display,height:Lo.value,lineHeight:"0",width:Lo.value}));return(ut,b)=>(St.openBlock(),St.createBlock(St.resolveDynamicComponent(ir.as),{"aria-hidden":ir.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:St.normalizeStyle(cn.value)},{default:St.withCtx(()=>[(St.openBlock(),St.createElementBlock("svg",{"aria-hidden":ir.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"},[ir.title?(St.openBlock(),St.createElementBlock("title",D1,St.toDisplayString(ir.title),1)):St.createCommentVNode("",!0),M1],8,B1))]),_:1},8,["aria-hidden","style"]))}}),F1=F0(L1,[["__scopeId","data-v-a8e0d45a"]]),$1=ir=>(St.pushScopeId("data-v-35e43fa5"),ir=ir(),St.popScopeId(),ir),U1=["aria-hidden"],q1={key:0,"data-testid":"kui-icon-svg-title"},K1=$1(()=>St.createElementVNode("path",{d:"M9.4 18L8 16.6L12.6 12L8 7.4L9.4 6L15.4 12L9.4 18Z",fill:"currentColor"},null,-1)),H1=St.defineComponent({__name:"ChevronRightIcon",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:zp,validator:ir=>{if(typeof ir=="number"&&ir>0)return!0;if(typeof ir=="string"){const yo=String(ir).replace(/px/gi,""),Lo=Number(yo);if(Lo&&!isNaN(Lo)&&Number.isInteger(Lo)&&Lo>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(ir){const yo=ir,Lo=St.computed(()=>{if(typeof yo.size=="number"&&yo.size>0)return`${yo.size}px`;if(typeof yo.size=="string"){const ut=String(yo.size).replace(/px/gi,""),b=Number(ut);if(b&&!isNaN(b)&&Number.isInteger(b)&&b>0)return`${b}px`}return zp}),cn=St.computed(()=>({boxSizing:"border-box",color:yo.color,display:yo.display,height:Lo.value,lineHeight:"0",width:Lo.value}));return(ut,b)=>(St.openBlock(),St.createBlock(St.resolveDynamicComponent(ir.as),{"aria-hidden":ir.decorative?"true":void 0,class:"kui-icon chevron-right-icon","data-testid":"kui-icon-wrapper-chevron-right-icon",style:St.normalizeStyle(cn.value)},{default:St.withCtx(()=>[(St.openBlock(),St.createElementBlock("svg",{"aria-hidden":ir.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-right-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[ir.title?(St.openBlock(),St.createElementBlock("title",q1,St.toDisplayString(ir.title),1)):St.createCommentVNode("",!0),K1],8,U1))]),_:1},8,["aria-hidden","style"]))}}),V1=F0(H1,[["__scopeId","data-v-35e43fa5"]]),W1=ir=>(St.pushScopeId("data-v-627e758e"),ir=ir(),St.popScopeId(),ir),J1=["aria-hidden"],G1={key:0,"data-testid":"kui-icon-svg-title"},Y1=W1(()=>St.createElementVNode("path",{d:"M10 18V16H14V18H10ZM6 13V11H18V13H6ZM3 8V6H21V8H3Z",fill:"currentColor"},null,-1)),Z1=St.defineComponent({__name:"FilterIcon",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:zp,validator:ir=>{if(typeof ir=="number"&&ir>0)return!0;if(typeof ir=="string"){const yo=String(ir).replace(/px/gi,""),Lo=Number(yo);if(Lo&&!isNaN(Lo)&&Number.isInteger(Lo)&&Lo>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(ir){const yo=ir,Lo=St.computed(()=>{if(typeof yo.size=="number"&&yo.size>0)return`${yo.size}px`;if(typeof yo.size=="string"){const ut=String(yo.size).replace(/px/gi,""),b=Number(ut);if(b&&!isNaN(b)&&Number.isInteger(b)&&b>0)return`${b}px`}return zp}),cn=St.computed(()=>({boxSizing:"border-box",color:yo.color,display:yo.display,height:Lo.value,lineHeight:"0",width:Lo.value}));return(ut,b)=>(St.openBlock(),St.createBlock(St.resolveDynamicComponent(ir.as),{"aria-hidden":ir.decorative?"true":void 0,class:"kui-icon filter-icon","data-testid":"kui-icon-wrapper-filter-icon",style:St.normalizeStyle(cn.value)},{default:St.withCtx(()=>[(St.openBlock(),St.createElementBlock("svg",{"aria-hidden":ir.decorative?"true":void 0,"data-testid":"kui-icon-svg-filter-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[ir.title?(St.openBlock(),St.createElementBlock("title",G1,St.toDisplayString(ir.title),1)):St.createCommentVNode("",!0),Y1],8,J1))]),_:1},8,["aria-hidden","style"]))}}),Q1=F0(Z1,[["__scopeId","data-v-627e758e"]]),X1=["aria-controls","aria-expanded","aria-label"],ex={"aria-hidden":"true",class:"icon-wrapper"},tx={"aria-hidden":"true",class:"label truncated"},rx=["title"],jy=Ud(St.defineComponent({__name:"OperationsListSectionHeader",props:{isCollapsed:{type:Boolean,required:!0},name:{type:String,required:!0},description:{type:String,default:void 0},contentElementId:{type:String,required:!0}},emits:["toggle"],setup(ir){const yo=ir,{i18n:Lo}=Ku.useI18n(),cn=St.computed(()=>yo.isCollapsed?Lo.t("specOperationsList.section.expandAriaLabel",{section:`"${yo.name}"`}):Lo.t("specOperationsList.section.collapseAriaLabel",{section:`"${yo.name}"`}));return(ut,b)=>(St.openBlock(),St.createElementBlock("button",{"aria-controls":ir.contentElementId,"aria-expanded":ir.isCollapsed?"false":"true","aria-label":cn.value,class:St.normalizeClass(["header",{"header--collapsed":ir.isCollapsed}]),type:"button",onClick:b[0]||(b[0]=j=>ut.$emit("toggle"))},[St.createElementVNode("div",ex,[ir.isCollapsed?(St.openBlock(),St.createBlock(St.unref(V1),{key:0,color:`var(--kong-ui-spec-renderer-operations-list-section-icon-color-collapsed, ${St.unref(z1)})`,size:St.unref(Oy)},null,8,["color","size"])):(St.openBlock(),St.createBlock(St.unref(F1),{key:1,color:`var(--kong-ui-spec-renderer-operations-list-section-icon-color-expanded, ${St.unref(R1)})`,icon:"chevronDown",size:St.unref(Oy)},null,8,["color","size"]))]),St.createElementVNode("h1",tx,St.toDisplayString(ir.name),1),St.createElementVNode("div",{class:"description truncated",title:ir.description},St.toDisplayString(ir.description),9,rx)],10,X1))}}),[["__scopeId","data-v-98e20a36"]]),ox=["data-testid"],ax=["title"],nx={class:"details"},ix=["aria-label","title"],Cy=Ud(St.defineComponent({__name:"OperationsListItem",props:{item:{type:Object,required:!0,validator:ir=>ir.method!==void 0&&ir.summary!==void 0&&ir.path!==void 0},isSelected:{type:Boolean,default:!1},disableSelection:{type:Boolean,default:!1}},emits:["click"],setup(ir){const yo=ir,{i18n:Lo}=Ku.useI18n(),cn=St.computed(()=>{var b,j;return`spec-operations-list-item-${(b=yo.item.method)==null?void 0:b.toLowerCase()}${(j=yo.item.path)==null?void 0:j.replaceAll("/","-")}-${yo.item.tag||"-"}`}),ut=St.computed(()=>yo.item.method||"");return(b,j)=>{const o=St.resolveComponent("KBadge");return St.openBlock(),St.createElementBlock("button",{class:St.normalizeClass(["spec-operations-list-item",{"item--selected":ir.isSelected,[`item--method-${ir.item.method}`]:!0,disabled:ir.disableSelection}]),"data-testid":cn.value,type:"button",onClick:j[0]||(j[0]=u=>b.$emit("click",ir.item))},[ir.item.summary?(St.openBlock(),St.createElementBlock("h2",{key:0,class:"summary truncated",title:ir.item.summary},St.toDisplayString(ir.item.summary),9,ax)):St.createCommentVNode("",!0),St.createElementVNode("div",nx,[St.createVNode(o,{appearance:"custom","aria-label":St.unref(Lo).t("specOperationsList.item.methodAriaLabel",{method:ut.value.toUpperCase()}),"background-color":"var(--kong-ui-spec-renderer-operations-list-item-method-background)",class:"method-badge",color:"var(--kong-ui-spec-renderer-operations-list-item-method-color)",tabindex:"-1"},{default:St.withCtx(()=>[St.createTextVNode(St.toDisplayString(ut.value.toUpperCase()),1)]),_:1},8,["aria-label"]),St.createElementVNode("span",{"aria-label":St.unref(Lo).t("specOperationsList.item.pathAriaLabel",{path:ir.item.path}),class:"path truncated",title:ir.item.path},St.toDisplayString(ir.item.path),9,ix)])],10,ox)}}}),[["__scopeId","data-v-5610ea54"]]),sx=["aria-label"],cx={key:0},lx={key:0,class:"filter-wrapper"},ux={key:1},px=["data-testid"],dx=["id"],hx={key:0,class:"section","data-testid":"spec-operations-list-untagged-items"},gx=["id"],fx={key:2,"data-testid":"kong-ui-public-spec-operations-list-empty"},mx={class:"center"},bx={key:1,"data-testid":"kong-ui-public-spec-operations-list-error"},{getSizeFromString:vx,hasRequiredProps:Py}=Ku.useUtilities(),Iy=Ud(St.defineComponent({__name:"SpecOperationsList",props:{operations:{type:Array,required:!0,validator:ir=>!ir.length||Py(ir,["method","path"])},tags:{type:Array,default:()=>[],validator:ir=>!ir.length||Py(ir,["name"])},isFilterable:{type:Boolean,default:!0},filterFunction:{type:Function,default:({items:ir,query:yo})=>(yo=yo.toLowerCase(),ir.filter(Lo=>Lo.tag&&Lo.tag.toLowerCase().includes(yo))),validator:ir=>!!ir&&typeof ir=="function"},deselect:{type:Boolean,default:!1},disableSelection:{type:Boolean,default:!1},width:{type:String,default:"210"}},emits:["selected"],setup(ir,{emit:yo}){const Lo=ir,cn=yo,{i18n:ut}=Ku.useI18n(),b=St.computed(()=>P1()),j=St.ref(""),o=St.ref([]),u=St.ref(),y=St.ref([]),S=()=>{const k=o.value;if(!Lo.isFilterable){y.value=k;return}if(!Lo.filterFunction||typeof Lo.filterFunction!="function")throw new Error(`filterFunction property must be a function, got ${typeof Lo.filterFunction}`);y.value=Lo.filterFunction({items:k,query:j.value})},w=St.computed(()=>vx(Lo.width)),O=St.computed(()=>{const k=[];return y.value.forEach(E=>{E.tag&&!k.includes(E.tag)&&k.push(E.tag)}),k}),T=St.computed(()=>o.value.filter(k=>!k.tag)),p=k=>{if(!Lo.tags||!Array.isArray(Lo.tags))return"";const E=Lo.tags.find(f=>f.name===k);return(E==null?void 0:E.description)||""},n=k=>y.value.filter(E=>E.tag===k),l=k=>{const E=u.value;return!!E&&E.path===k.path&&E.method===k.method&&E.operationId===k.operationId&&E.tag===k.tag},d=k=>`${b.value}-section-${k.toLowerCase()}`,s=k=>{Lo.disableSelection||(u.value=k,cn("selected",k))},g=()=>{o.value=[],Lo.operations&&(Lo.operations.forEach(k=>{var f;const E=L0(k);(f=k.tags)!=null&&f.length?k.tags.forEach(_=>{delete E.tags,E.tag=_,o.value.push(L0(E))}):(delete E.tags,E.tag=null,o.value.push(L0(E)))}),S())};return St.watch(()=>Lo.deselect,()=>{Lo.deselect&&(u.value=void 0)}),St.watch(()=>Lo.operations,()=>g()),St.watch(j,()=>S()),St.onMounted(()=>{g()}),(k,E)=>{const f=St.resolveComponent("KInput"),_=St.resolveComponent("KCollapse");return St.openBlock(),St.createElementBlock("section",{"aria-label":St.unref(ut).t("specOperationsList.ariaLabel"),class:"kong-ui-public-spec-operations-list","data-testid":"kong-ui-public-spec-operations-list",role:"navigation",style:St.normalizeStyle({width:w.value})},[ir.operations?(St.openBlock(),St.createElementBlock("div",cx,[ir.isFilterable?(St.openBlock(),St.createElementBlock("div",lx,[St.createVNode(f,{modelValue:j.value,"onUpdate:modelValue":E[0]||(E[0]=P=>j.value=P),class:"filter-input","data-testid":"spec-operations-list-filter",placeholder:St.unref(ut).t("specOperationsList.filterPlaceholder")},{before:St.withCtx(()=>[St.createVNode(St.unref(Q1),{decorative:""})]),_:1},8,["modelValue","placeholder"])])):St.createCommentVNode("",!0),y.value.length?(St.openBlock(),St.createElementBlock("div",ux,[(St.openBlock(!0),St.createElementBlock(St.Fragment,null,St.renderList(O.value,P=>(St.openBlock(),St.createElementBlock("div",{key:P,class:"section-wrapper","data-testid":`spec-operations-list-section-${P.toLowerCase().replaceAll(" ","-")}`},[St.createVNode(_,{"model-value":!1,"trigger-alignment":"leading"},{trigger:St.withCtx(({isCollapsed:R,toggle:D})=>[St.createVNode(jy,{"content-element-id":d(P),"data-testid":`spec-operations-list-section-${P.toLowerCase().replaceAll(" ","-")}-collapse-trigger`,description:p(P),"is-collapsed":R,name:P,onToggle:D},null,8,["content-element-id","data-testid","description","is-collapsed","name","onToggle"])]),default:St.withCtx(()=>[St.createElementVNode("div",{id:d(P)},[(St.openBlock(!0),St.createElementBlock(St.Fragment,null,St.renderList(n(P),R=>St.renderSlot(k.$slots,"item",{key:`${R.path}-${R.method}`,item:R,section:P,select:()=>s(R)},()=>[St.createVNode(Cy,{"disable-selection":ir.disableSelection,"is-selected":l(R),item:R,section:P,onClick:s},null,8,["disable-selection","is-selected","item","section"])],!0)),128))],8,dx)]),_:2},1024)],8,px))),128)),!ir.isFilterable||!j.value?(St.openBlock(),St.createElementBlock("div",hx,[St.createVNode(_,{"model-value":!1,"trigger-alignment":"leading"},{trigger:St.withCtx(({isCollapsed:P,toggle:R})=>[St.createVNode(jy,{"content-element-id":d(St.unref(Rp)),"data-testid":"spec-operations-list-section-untagged-collapse-trigger",description:p(St.unref(Rp)),"is-collapsed":P,name:St.unref(Rp),onToggle:R},null,8,["content-element-id","description","is-collapsed","name","onToggle"])]),default:St.withCtx(()=>[St.createElementVNode("div",{id:d(St.unref(Rp))},[(St.openBlock(!0),St.createElementBlock(St.Fragment,null,St.renderList(T.value,P=>St.renderSlot(k.$slots,"untagged-item",{key:`${P.path}-${P.method}`,item:P,section:St.unref(Rp),select:()=>s(P)},()=>[St.createVNode(Cy,{"disable-selection":ir.disableSelection,"is-selected":l(P),item:P,onClick:s},null,8,["disable-selection","is-selected","item"])],!0)),128))],8,gx)]),_:3})])):St.createCommentVNode("",!0)])):(St.openBlock(),St.createElementBlock("div",fx,[St.renderSlot(k.$slots,"empty-state",{},()=>[St.createElementVNode("div",mx,St.toDisplayString(St.unref(ut).t("specOperationsList.noResults")),1)],!0)]))])):(St.openBlock(),St.createElementBlock("div",bx,[St.renderSlot(k.$slots,"error-state",{},()=>[St.createTextVNode(St.toDisplayString(St.unref(ut).t("specOperationsList.error")),1)],!0)]))],12,sx)}}}),[["__scopeId","data-v-751da895"]]),yx={class:"kong-ui-public-spec-renderer"},kx={key:0,class:"spec-container"},wx={class:"spec-renderer-ops-list-empty-state","data-testid":"spec-renderer-ops-list-empty-state"},xx={key:1,"data-testid":"kong-ui-public-spec-renderer-error"},{hasRequiredProps:Ty}=Ku.useUtilities(),Ex=Ud(St.defineComponent({__name:"SpecRenderer",props:{spec:{type:Object,required:!0},essentialsOnly:{type:Boolean,default:!1},operationsList:{type:Array,required:!0,validator:ir=>!ir.length||Ty(ir,["method","path"])},tags:{type:Array,default:()=>[],validator:ir=>!ir.length||Ty(ir,["name"])},navWidth:{type:String,default:"310"},deselect:{type:Boolean,default:!1}},setup(ir){const yo=ir,{i18n:Lo}=Ku.useI18n(),cn=St.computed(()=>!!(yo.spec&&yo.operationsList)),ut=St.ref(),b=j=>{ut.value=j};return(j,o)=>{const u=St.resolveComponent("KEmptyState");return St.openBlock(),St.createElementBlock("div",yx,[cn.value?(St.openBlock(),St.createElementBlock("div",kx,[St.createVNode(Iy,{"data-testid":"spec-renderer-ops-list-content",deselect:ir.deselect,operations:ir.operationsList,tags:ir.tags,width:ir.navWidth,onSelected:b},{"empty-state":St.withCtx(()=>[St.createElementVNode("div",wx,[St.renderSlot(j.$slots,"ops-list-empty-state",{},void 0,!0)])]),_:3},8,["deselect","operations","tags","width"]),St.createVNode(_y,{"active-operation":ut.value,class:"spec-renderer-details","data-testid":"spec-renderer-details-content",document:ir.spec,"essentials-only":ir.essentialsOnly,"has-sidebar":!1},null,8,["active-operation","document","essentials-only"])])):(St.openBlock(),St.createElementBlock("div",xx,[St.renderSlot(j.$slots,"error-state",{},()=>[St.createVNode(u,{"cta-is-hidden":"","icon-size":"50","is-error":!0},{title:St.withCtx(()=>[St.createTextVNode(St.toDisplayString(St.unref(Lo).t("specRenderer.error")),1)]),_:1})],!0)]))])}}}),[["__scopeId","data-v-573e5489"]]);$n.DEFAULT_UNTAGGED_SECTION_NAME=Rp,$n.SpecDetails=_y,$n.SpecOperationsList=Iy,$n.SpecRenderer=Ex,Object.defineProperty($n,Symbol.toStringTag,{value:"Module"})});
|
|
217
|
+
`,a.setAttribute("data-testid","relative-sidebar-styles"),this.shadowRoot.appendChild(a)}_n(this,uu)&&r1.use({target:this.shadowRoot,testId:"hide-essentials-styles"});const r={hasSidebar:_n(this,Uu),applicationRegistrationEnabled:_n(this,Md),currentVersion:{version:_n(this,Ld)},onViewSpecClick:()=>{this.dispatchEvent(new CustomEvent("clicked-view-spec",{bubbles:!0}))},onRegisterClick:()=>{this.dispatchEvent(new CustomEvent("clicked-register",{bubbles:!0}))},..._n(this,Dd)};hl(this,Kc,Df({url:_n(this,jp),spec:_n(this,$u),domNode:this.rootElement,deepLinking:!0,filter:!0,presets:[Df.presets.apis,Df.SwaggerUIStandalonePreset],plugins:[Df.plugins.DownloadUrl,h3.SwaggerUIKongTheme],layout:"KongLayout",theme:r}))}showOperation(r){if(!_n(this,Kc))return!1;const a=uy(r);return _n(this,Kc).layoutActions.show(a,!0),!0}hideOperation(r){if(!_n(this,Kc))return!1;const a=uy(r);return _n(this,Kc).layoutActions.show(a,!1),!0}scrollToOperation(r){if(!_n(this,Kc))return!1;const a=yC(r);let i=this.shadowRoot.getElementById(a);if(!i){const x=this.shadowRoot.querySelector(`[data-tag='${r.tag}']`);if(!x||(x.click(),i=this.shadowRoot.getElementById(a),!i))return!1}const m=window.matchMedia("(prefers-reduced-motion: no-preference)");let A;m&&m.matches&&(A="smooth"),i.scrollIntoView({behavior:A})}get autoInit(){return _n(this,Bd)}set autoInit(r){hl(this,Bd,Pg(r))}get hasSidebar(){return _n(this,Uu)}set hasSidebar(r){hl(this,Uu,Pg(r))}get relativeSidebar(){return _n(this,Cp)}set relativeSidebar(r){hl(this,Cp,Pg(r))}get essentialsOnly(){return _n(this,uu)}set essentialsOnly(r){hl(this,uu,Pg(r))}get spec(){return _n(this,$u)}set spec(r){if(!r)throw new Error("Spec cannot be empty");let a;typeof r=="string"?a=JSON.parse(r):typeof r=="object"&&(a=r),hl(this,$u,a),_n(this,Kc)&&_n(this,Kc).getSystem().specActions.updateJsonSpec(_n(this,$u))}get url(){return _n(this,jp)}set url(r){hl(this,jp,r)}get themeOverrides(){return _n(this,Dd)}set themeOverrides(r){hl(this,Dd,r)}get applicationRegistrationEnabled(){return _n(this,Md)}set applicationRegistrationEnabled(r){hl(this,Md,Pg(r))}get currentVersion(){return _n(this,Ld)}set currentVersion(r){hl(this,Ld,r)}static get observedAttributes(){return["url","spec","auto-init","has-sidebar","relative-sidebar","essentials-only","application-registration-enabled","current-version","theme-overrides"]}}Bd=new WeakMap,$u=new WeakMap,jp=new WeakMap,Uu=new WeakMap,Cp=new WeakMap,uu=new WeakMap,Kc=new WeakMap,Dd=new WeakMap,Md=new WeakMap,Ld=new WeakMap,Za(Rg,"name","kong-swagger-ui"),customElements.get(Rg.name)?console.warn(`Cannot register ${Rg.name}. Element is already defined, ignoring`):customElements.define(Rg.name,Rg)})()})();const S1=["application-registration-enabled","current-version","essentials-only","has-sidebar","relative-sidebar","spec","theme-overrides","url"],_1={key:1,"data-testid":"kong-public-ui-spec-details-error"},A1=St.defineComponent({__name:"SpecDetails",props:{document:{type:Object,default:null},url:{type:String,default:""},hasSidebar:{type:Boolean,default:!1},relativeSidebar:{type:Boolean,default:!1},themeOverrides:{type:Object,default:null},essentialsOnly:{type:Boolean,default:!1},activeOperation:{type:Object,default:null},applicationRegistrationEnabled:{type:Boolean,default:!1},currentVersion:{type:String,default:()=>{}}},setup(ir){const yo=ir,{i18n:Lo}=Ku.useI18n(),cn=St.ref(null),ut=St.computed(()=>!!(yo.document||yo.url)),b=St.ref(!1),j=()=>{if(!cn.value)return;const o={...yo.activeOperation};if(o&&o.tag){const u=decodeURIComponent(o.tag.trim().replaceAll(/\s/g,"%20"));o.tag=u}cn.value.showOperation(o),cn.value.scrollToOperation(o),b.value=!0};return St.onMounted(()=>{yo.activeOperation&&j()}),St.watch(()=>yo.activeOperation,()=>{yo.activeOperation&&j()}),(o,u)=>(St.openBlock(),St.createElementBlock("div",{class:St.normalizeClass(["kong-public-ui-spec-details",{"active-op-focused":b.value}])},[ut.value?(St.openBlock(),St.createElementBlock("kong-swagger-ui",{key:0,ref_key:"swaggerRef",ref:cn,"application-registration-enabled":ir.applicationRegistrationEnabled,"current-version":ir.currentVersion,"data-testid":"kong-public-ui-spec-details-swagger","essentials-only":ir.essentialsOnly,"has-sidebar":ir.hasSidebar,"relative-sidebar":ir.relativeSidebar,spec:ir.document,"theme-overrides":encodeURIComponent(JSON.stringify(ir.themeOverrides)),url:ir.url},null,8,S1)):(St.openBlock(),St.createElementBlock("div",_1,St.toDisplayString(St.unref(Lo).t("specDetails.error")),1))],2))}}),Ud=(ir,yo)=>{const Lo=ir.__vccOpts||ir;for(const[cn,ut]of yo)Lo[cn]=ut;return Lo},_y=Ud(A1,[["__scopeId","data-v-71bf6e29"]]);let qg;const O1=new Uint8Array(16);function j1(){if(!qg&&(qg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qg(O1)}const ds=[];for(let ir=0;ir<256;++ir)ds.push((ir+256).toString(16).slice(1));function C1(ir,yo=0){return ds[ir[yo+0]]+ds[ir[yo+1]]+ds[ir[yo+2]]+ds[ir[yo+3]]+"-"+ds[ir[yo+4]]+ds[ir[yo+5]]+"-"+ds[ir[yo+6]]+ds[ir[yo+7]]+"-"+ds[ir[yo+8]]+ds[ir[yo+9]]+"-"+ds[ir[yo+10]]+ds[ir[yo+11]]+ds[ir[yo+12]]+ds[ir[yo+13]]+ds[ir[yo+14]]+ds[ir[yo+15]]}let Ay,B0,D0=0,M0=0;function P1(ir,yo,Lo){let cn=yo&&Lo||0;const ut=yo||new Array(16);ir=ir||{};let b=ir.node||Ay,j=ir.clockseq!==void 0?ir.clockseq:B0;if(b==null||j==null){const O=ir.random||(ir.rng||j1)();b==null&&(b=Ay=[O[0]|1,O[1],O[2],O[3],O[4],O[5]]),j==null&&(j=B0=(O[6]<<8|O[7])&16383)}let o=ir.msecs!==void 0?ir.msecs:Date.now(),u=ir.nsecs!==void 0?ir.nsecs:M0+1;const y=o-D0+(u-M0)/1e4;if(y<0&&ir.clockseq===void 0&&(j=j+1&16383),(y<0||o>D0)&&ir.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");D0=o,M0=u,B0=j,o+=122192928e5;const S=((o&268435455)*1e4+u)%4294967296;ut[cn++]=S>>>24&255,ut[cn++]=S>>>16&255,ut[cn++]=S>>>8&255,ut[cn++]=S&255;const w=o/4294967296*1e4&268435455;ut[cn++]=w>>>8&255,ut[cn++]=w&255,ut[cn++]=w>>>24&15|16,ut[cn++]=w>>>16&255,ut[cn++]=j>>>8|128,ut[cn++]=j&255;for(let O=0;O<6;++O)ut[cn+O]=b[O];return yo||C1(ut)}var Kg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function I1(ir){return ir&&ir.__esModule&&Object.prototype.hasOwnProperty.call(ir,"default")?ir.default:ir}var Hg={exports:{}};Hg.exports,function(ir,yo){var Lo=200,cn="__lodash_hash_undefined__",ut=9007199254740991,b="[object Arguments]",j="[object Array]",o="[object Boolean]",u="[object Date]",y="[object Error]",S="[object Function]",w="[object GeneratorFunction]",O="[object Map]",T="[object Number]",p="[object Object]",n="[object Promise]",l="[object RegExp]",d="[object Set]",s="[object String]",g="[object Symbol]",k="[object WeakMap]",E="[object ArrayBuffer]",f="[object DataView]",_="[object Float32Array]",P="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",F="[object Int32Array]",M="[object Uint8Array]",N="[object Uint8ClampedArray]",q="[object Uint16Array]",W="[object Uint32Array]",te=/[\\^$.*+?()[\]{}|]/g,re=/\w*$/,Z=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,Q={};Q[b]=Q[j]=Q[E]=Q[f]=Q[o]=Q[u]=Q[_]=Q[P]=Q[R]=Q[D]=Q[F]=Q[O]=Q[T]=Q[p]=Q[l]=Q[d]=Q[s]=Q[g]=Q[M]=Q[N]=Q[q]=Q[W]=!0,Q[y]=Q[S]=Q[k]=!1;var fe=typeof Kg=="object"&&Kg&&Kg.Object===Object&&Kg,ne=typeof self=="object"&&self&&self.Object===Object&&self,ae=fe||ne||Function("return this")(),me=yo&&!yo.nodeType&&yo,Pe=me&&!0&&ir&&!ir.nodeType&&ir,Fe=Pe&&Pe.exports===me;function ze(We,or){return We.set(or[0],or[1]),We}function $e(We,or){return We.add(or),We}function Je(We,or){for(var Rr=-1,ko=We?We.length:0;++Rr<ko&&or(We[Rr],Rr,We)!==!1;);return We}function Te(We,or){for(var Rr=-1,ko=or.length,wn=We.length;++Rr<ko;)We[wn+Rr]=or[Rr];return We}function Ae(We,or,Rr,ko){var wn=-1,Vn=We?We.length:0;for(ko&&Vn&&(Rr=We[++wn]);++wn<Vn;)Rr=or(Rr,We[wn],wn,We);return Rr}function lt(We,or){for(var Rr=-1,ko=Array(We);++Rr<We;)ko[Rr]=or(Rr);return ko}function dt(We,or){return We==null?void 0:We[or]}function Pt(We){var or=!1;if(We!=null&&typeof We.toString!="function")try{or=!!(We+"")}catch{}return or}function Vt(We){var or=-1,Rr=Array(We.size);return We.forEach(function(ko,wn){Rr[++or]=[wn,ko]}),Rr}function yr(We,or){return function(Rr){return We(or(Rr))}}function Jt(We){var or=-1,Rr=Array(We.size);return We.forEach(function(ko){Rr[++or]=ko}),Rr}var Ar=Array.prototype,ur=Function.prototype,Or=Object.prototype,Br=ae["__core-js_shared__"],kr=function(){var We=/[^.]+$/.exec(Br&&Br.keys&&Br.keys.IE_PROTO||"");return We?"Symbol(src)_1."+We:""}(),Bt=ur.toString,De=Or.hasOwnProperty,et=Or.toString,At=RegExp("^"+Bt.call(De).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ke=Fe?ae.Buffer:void 0,Ye=ae.Symbol,jt=ae.Uint8Array,Dt=yr(Object.getPrototypeOf,Object),xr=Object.create,X=Or.propertyIsEnumerable,pe=Ar.splice,ke=Object.getOwnPropertySymbols,Ve=Ke?Ke.isBuffer:void 0,ot=yr(Object.keys,Object),pt=Bn(ae,"DataView"),Ge=Bn(ae,"Map"),Ot=Bn(ae,"Promise"),hr=Bn(ae,"Set"),_t=Bn(ae,"WeakMap"),Ie=Bn(Object,"create"),He=Xn(pt),Qe=Xn(Ge),vt=Xn(Ot),_r=Xn(hr),Sr=Xn(_t),Yr=Ye?Ye.prototype:void 0,Xr=Yr?Yr.valueOf:void 0;function bo(We){var or=-1,Rr=We?We.length:0;for(this.clear();++or<Rr;){var ko=We[or];this.set(ko[0],ko[1])}}function zt(){this.__data__=Ie?Ie(null):{}}function Er(We){return this.has(We)&&delete this.__data__[We]}function Jr(We){var or=this.__data__;if(Ie){var Rr=or[We];return Rr===cn?void 0:Rr}return De.call(or,We)?or[We]:void 0}function go(We){var or=this.__data__;return Ie?or[We]!==void 0:De.call(or,We)}function Po(We,or){var Rr=this.__data__;return Rr[We]=Ie&&or===void 0?cn:or,this}bo.prototype.clear=zt,bo.prototype.delete=Er,bo.prototype.get=Jr,bo.prototype.has=go,bo.prototype.set=Po;function so(We){var or=-1,Rr=We?We.length:0;for(this.clear();++or<Rr;){var ko=We[or];this.set(ko[0],ko[1])}}function Io(){this.__data__=[]}function Oo(We){var or=this.__data__,Rr=mt(or,We);if(Rr<0)return!1;var ko=or.length-1;return Rr==ko?or.pop():pe.call(or,Rr,1),!0}function Do(We){var or=this.__data__,Rr=mt(or,We);return Rr<0?void 0:or[Rr][1]}function _a(We){return mt(this.__data__,We)>-1}function bn(We,or){var Rr=this.__data__,ko=mt(Rr,We);return ko<0?Rr.push([We,or]):Rr[ko][1]=or,this}so.prototype.clear=Io,so.prototype.delete=Oo,so.prototype.get=Do,so.prototype.has=_a,so.prototype.set=bn;function aa(We){var or=-1,Rr=We?We.length:0;for(this.clear();++or<Rr;){var ko=We[or];this.set(ko[0],ko[1])}}function Wo(){this.__data__={hash:new bo,map:new(Ge||so),string:new bo}}function Pa(We){return ki(this,We).delete(We)}function La(We){return ki(this,We).get(We)}function tr(We){return ki(this,We).has(We)}function pr(We,or){return ki(this,We).set(We,or),this}aa.prototype.clear=Wo,aa.prototype.delete=Pa,aa.prototype.get=La,aa.prototype.has=tr,aa.prototype.set=pr;function ar(We){this.__data__=new so(We)}function Qr(){this.__data__=new so}function sr(We){return this.__data__.delete(We)}function ha(We){return this.__data__.get(We)}function ao(We){return this.__data__.has(We)}function st(We,or){var Rr=this.__data__;if(Rr instanceof so){var ko=Rr.__data__;if(!Ge||ko.length<Lo-1)return ko.push([We,or]),this;Rr=this.__data__=new aa(ko)}return Rr.set(We,or),this}ar.prototype.clear=Qr,ar.prototype.delete=sr,ar.prototype.get=ha,ar.prototype.has=ao,ar.prototype.set=st;function Ee(We,or){var Rr=ei(We)||Fi(We)?lt(We.length,String):[],ko=Rr.length,wn=!!ko;for(var Vn in We)(or||De.call(We,Vn))&&!(wn&&(Vn=="length"||Li(Vn,ko)))&&Rr.push(Vn);return Rr}function Ue(We,or,Rr){var ko=We[or];(!(De.call(We,or)&&Ki(ko,Rr))||Rr===void 0&&!(or in We))&&(We[or]=Rr)}function mt(We,or){for(var Rr=We.length;Rr--;)if(Ki(We[Rr][0],or))return Rr;return-1}function Ft(We,or){return We&&un(or,vo(or),We)}function wr(We,or,Rr,ko,wn,Vn,Wn){var ti;if(ko&&(ti=Vn?ko(We,wn,Vn,Wn):ko(We)),ti!==void 0)return ti;if(!xt(We))return We;var wi=ei(We);if(wi){if(ti=Ni(We),!or)return tn(We,ti)}else{var gi=hi(We),as=gi==S||gi==w;if(ji(We))return Ro(We,or);if(gi==p||gi==b||as&&!Vn){if(Pt(We))return Vn?We:{};if(ti=Un(as?{}:We),!or)return fa(We,Ft(ti,We))}else{if(!Q[gi])return Vn?We:{};ti=za(We,gi,wr,or)}}Wn||(Wn=new ar);var hc=Wn.get(We);if(hc)return hc;if(Wn.set(We,ti),!wi)var ns=Rr?Qn(We):vo(We);return Je(ns||We,function(rn,Xs){ns&&(Xs=rn,rn=We[Xs]),Ue(ti,Xs,wr(rn,or,Rr,ko,Xs,We,Wn))}),ti}function ht(We){return xt(We)?xr(We):{}}function Lt(We,or,Rr){var ko=or(We);return ei(We)?ko:Te(ko,Rr(We))}function Tr(We){return et.call(We)}function gr(We){if(!xt(We)||fn(We))return!1;var or=dn(We)||Pt(We)?At:Z;return or.test(Xn(We))}function co(We){if(!ui(We))return ot(We);var or=[];for(var Rr in Object(We))De.call(We,Rr)&&Rr!="constructor"&&or.push(Rr);return or}function Ro(We,or){if(or)return We.slice();var Rr=new We.constructor(We.length);return We.copy(Rr),Rr}function ga(We){var or=new We.constructor(We.byteLength);return new jt(or).set(new jt(We)),or}function ka(We,or){var Rr=or?ga(We.buffer):We.buffer;return new We.constructor(Rr,We.byteOffset,We.byteLength)}function Qa(We,or,Rr){var ko=or?Rr(Vt(We),!0):Vt(We);return Ae(ko,ze,new We.constructor)}function gn(We){var or=new We.constructor(We.source,re.exec(We));return or.lastIndex=We.lastIndex,or}function Ca(We,or,Rr){var ko=or?Rr(Jt(We),!0):Jt(We);return Ae(ko,$e,new We.constructor)}function Ia(We){return Xr?Object(Xr.call(We)):{}}function Ka(We,or){var Rr=or?ga(We.buffer):We.buffer;return new We.constructor(Rr,We.byteOffset,We.length)}function tn(We,or){var Rr=-1,ko=We.length;for(or||(or=Array(ko));++Rr<ko;)or[Rr]=We[Rr];return or}function un(We,or,Rr,ko){Rr||(Rr={});for(var wn=-1,Vn=or.length;++wn<Vn;){var Wn=or[wn],ti=ko?ko(Rr[Wn],We[Wn],Wn,Rr,We):void 0;Ue(Rr,Wn,ti===void 0?We[Wn]:ti)}return Rr}function fa(We,or){return un(We,ma(We),or)}function Qn(We){return Lt(We,vo,ma)}function ki(We,or){var Rr=We.__data__;return hs(or)?Rr[typeof or=="string"?"string":"hash"]:Rr.map}function Bn(We,or){var Rr=dt(We,or);return gr(Rr)?Rr:void 0}var ma=ke?yr(ke,Object):zo,hi=Tr;(pt&&hi(new pt(new ArrayBuffer(1)))!=f||Ge&&hi(new Ge)!=O||Ot&&hi(Ot.resolve())!=n||hr&&hi(new hr)!=d||_t&&hi(new _t)!=k)&&(hi=function(We){var or=et.call(We),Rr=or==p?We.constructor:void 0,ko=Rr?Xn(Rr):void 0;if(ko)switch(ko){case He:return f;case Qe:return O;case vt:return n;case _r:return d;case Sr:return k}return or});function Ni(We){var or=We.length,Rr=We.constructor(or);return or&&typeof We[0]=="string"&&De.call(We,"index")&&(Rr.index=We.index,Rr.input=We.input),Rr}function Un(We){return typeof We.constructor=="function"&&!ui(We)?ht(Dt(We)):{}}function za(We,or,Rr,ko){var wn=We.constructor;switch(or){case E:return ga(We);case o:case u:return new wn(+We);case f:return ka(We,ko);case _:case P:case R:case D:case F:case M:case N:case q:case W:return Ka(We,ko);case O:return Qa(We,ko,Rr);case T:case s:return new wn(We);case l:return gn(We);case d:return Ca(We,ko,Rr);case g:return Ia(We)}}function Li(We,or){return or=or??ut,!!or&&(typeof We=="number"||le.test(We))&&We>-1&&We%1==0&&We<or}function hs(We){var or=typeof We;return or=="string"||or=="number"||or=="symbol"||or=="boolean"?We!=="__proto__":We===null}function fn(We){return!!kr&&kr in We}function ui(We){var or=We&&We.constructor,Rr=typeof or=="function"&&or.prototype||Or;return We===Rr}function Xn(We){if(We!=null){try{return Bt.call(We)}catch{}try{return We+""}catch{}}return""}function os(We){return wr(We,!0,!0)}function Ki(We,or){return We===or||We!==We&&or!==or}function Fi(We){return $i(We)&&De.call(We,"callee")&&(!X.call(We,"callee")||et.call(We)==b)}var ei=Array.isArray;function Ha(We){return We!=null&&gs(We.length)&&!dn(We)}function $i(We){return oo(We)&&Ha(We)}var ji=Ve||kn;function dn(We){var or=xt(We)?et.call(We):"";return or==S||or==w}function gs(We){return typeof We=="number"&&We>-1&&We%1==0&&We<=ut}function xt(We){var or=typeof We;return!!We&&(or=="object"||or=="function")}function oo(We){return!!We&&typeof We=="object"}function vo(We){return Ha(We)?Ee(We):co(We)}function zo(){return[]}function kn(){return!1}ir.exports=os}(Hg,Hg.exports);var T1=Hg.exports;const L0=I1(T1),Rp="default",R1="#3a3f51",z1="#afb7c5",Oy="20px",zp="24px",F0=(ir,yo)=>{const Lo=ir.__vccOpts||ir;for(const[cn,ut]of yo)Lo[cn]=ut;return Lo},N1=ir=>(St.pushScopeId("data-v-02210aee"),ir=ir(),St.popScopeId(),ir),B1=["aria-hidden"],D1={key:0,"data-testid":"kui-icon-svg-title"},M1=N1(()=>St.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),L1=St.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:zp,validator:ir=>{if(typeof ir=="number"&&ir>0)return!0;if(typeof ir=="string"){const yo=String(ir).replace(/px/gi,""),Lo=Number(yo);if(Lo&&!isNaN(Lo)&&Number.isInteger(Lo)&&Lo>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(ir){const yo=ir,Lo=St.computed(()=>{if(typeof yo.size=="number"&&yo.size>0)return`${yo.size}px`;if(typeof yo.size=="string"){const ut=String(yo.size).replace(/px/gi,""),b=Number(ut);if(b&&!isNaN(b)&&Number.isInteger(b)&&b>0)return`${b}px`}return zp}),cn=St.computed(()=>({boxSizing:"border-box",color:yo.color,display:yo.display,height:Lo.value,lineHeight:"0",width:Lo.value}));return(ut,b)=>(St.openBlock(),St.createBlock(St.resolveDynamicComponent(ir.as),{"aria-hidden":ir.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:St.normalizeStyle(cn.value)},{default:St.withCtx(()=>[(St.openBlock(),St.createElementBlock("svg",{"aria-hidden":ir.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"},[ir.title?(St.openBlock(),St.createElementBlock("title",D1,St.toDisplayString(ir.title),1)):St.createCommentVNode("",!0),M1],8,B1))]),_:1},8,["aria-hidden","style"]))}}),F1=F0(L1,[["__scopeId","data-v-02210aee"]]),$1=ir=>(St.pushScopeId("data-v-5b2d3ba5"),ir=ir(),St.popScopeId(),ir),U1=["aria-hidden"],q1={key:0,"data-testid":"kui-icon-svg-title"},K1=$1(()=>St.createElementVNode("path",{d:"M9.4 18L8 16.6L12.6 12L8 7.4L9.4 6L15.4 12L9.4 18Z",fill:"currentColor"},null,-1)),H1=St.defineComponent({__name:"ChevronRightIcon",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:zp,validator:ir=>{if(typeof ir=="number"&&ir>0)return!0;if(typeof ir=="string"){const yo=String(ir).replace(/px/gi,""),Lo=Number(yo);if(Lo&&!isNaN(Lo)&&Number.isInteger(Lo)&&Lo>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(ir){const yo=ir,Lo=St.computed(()=>{if(typeof yo.size=="number"&&yo.size>0)return`${yo.size}px`;if(typeof yo.size=="string"){const ut=String(yo.size).replace(/px/gi,""),b=Number(ut);if(b&&!isNaN(b)&&Number.isInteger(b)&&b>0)return`${b}px`}return zp}),cn=St.computed(()=>({boxSizing:"border-box",color:yo.color,display:yo.display,height:Lo.value,lineHeight:"0",width:Lo.value}));return(ut,b)=>(St.openBlock(),St.createBlock(St.resolveDynamicComponent(ir.as),{"aria-hidden":ir.decorative?"true":void 0,class:"kui-icon chevron-right-icon","data-testid":"kui-icon-wrapper-chevron-right-icon",style:St.normalizeStyle(cn.value)},{default:St.withCtx(()=>[(St.openBlock(),St.createElementBlock("svg",{"aria-hidden":ir.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-right-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[ir.title?(St.openBlock(),St.createElementBlock("title",q1,St.toDisplayString(ir.title),1)):St.createCommentVNode("",!0),K1],8,U1))]),_:1},8,["aria-hidden","style"]))}}),V1=F0(H1,[["__scopeId","data-v-5b2d3ba5"]]),W1=ir=>(St.pushScopeId("data-v-41114e4d"),ir=ir(),St.popScopeId(),ir),J1=["aria-hidden"],G1={key:0,"data-testid":"kui-icon-svg-title"},Y1=W1(()=>St.createElementVNode("path",{d:"M10 18V16H14V18H10ZM6 13V11H18V13H6ZM3 8V6H21V8H3Z",fill:"currentColor"},null,-1)),Z1=St.defineComponent({__name:"FilterIcon",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:zp,validator:ir=>{if(typeof ir=="number"&&ir>0)return!0;if(typeof ir=="string"){const yo=String(ir).replace(/px/gi,""),Lo=Number(yo);if(Lo&&!isNaN(Lo)&&Number.isInteger(Lo)&&Lo>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(ir){const yo=ir,Lo=St.computed(()=>{if(typeof yo.size=="number"&&yo.size>0)return`${yo.size}px`;if(typeof yo.size=="string"){const ut=String(yo.size).replace(/px/gi,""),b=Number(ut);if(b&&!isNaN(b)&&Number.isInteger(b)&&b>0)return`${b}px`}return zp}),cn=St.computed(()=>({boxSizing:"border-box",color:yo.color,display:yo.display,height:Lo.value,lineHeight:"0",width:Lo.value}));return(ut,b)=>(St.openBlock(),St.createBlock(St.resolveDynamicComponent(ir.as),{"aria-hidden":ir.decorative?"true":void 0,class:"kui-icon filter-icon","data-testid":"kui-icon-wrapper-filter-icon",style:St.normalizeStyle(cn.value)},{default:St.withCtx(()=>[(St.openBlock(),St.createElementBlock("svg",{"aria-hidden":ir.decorative?"true":void 0,"data-testid":"kui-icon-svg-filter-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[ir.title?(St.openBlock(),St.createElementBlock("title",G1,St.toDisplayString(ir.title),1)):St.createCommentVNode("",!0),Y1],8,J1))]),_:1},8,["aria-hidden","style"]))}}),Q1=F0(Z1,[["__scopeId","data-v-41114e4d"]]),X1=["aria-controls","aria-expanded","aria-label"],ex={"aria-hidden":"true",class:"icon-wrapper"},tx={"aria-hidden":"true",class:"label truncated"},rx=["title"],jy=Ud(St.defineComponent({__name:"OperationsListSectionHeader",props:{isCollapsed:{type:Boolean,required:!0},name:{type:String,required:!0},description:{type:String,default:void 0},contentElementId:{type:String,required:!0}},emits:["toggle"],setup(ir){const yo=ir,{i18n:Lo}=Ku.useI18n(),cn=St.computed(()=>yo.isCollapsed?Lo.t("specOperationsList.section.expandAriaLabel",{section:`"${yo.name}"`}):Lo.t("specOperationsList.section.collapseAriaLabel",{section:`"${yo.name}"`}));return(ut,b)=>(St.openBlock(),St.createElementBlock("button",{"aria-controls":ir.contentElementId,"aria-expanded":ir.isCollapsed?"false":"true","aria-label":cn.value,class:St.normalizeClass(["header",{"header--collapsed":ir.isCollapsed}]),type:"button",onClick:b[0]||(b[0]=j=>ut.$emit("toggle"))},[St.createElementVNode("div",ex,[ir.isCollapsed?(St.openBlock(),St.createBlock(St.unref(V1),{key:0,color:`var(--kong-ui-spec-renderer-operations-list-section-icon-color-collapsed, ${St.unref(z1)})`,size:St.unref(Oy)},null,8,["color","size"])):(St.openBlock(),St.createBlock(St.unref(F1),{key:1,color:`var(--kong-ui-spec-renderer-operations-list-section-icon-color-expanded, ${St.unref(R1)})`,icon:"chevronDown",size:St.unref(Oy)},null,8,["color","size"]))]),St.createElementVNode("h1",tx,St.toDisplayString(ir.name),1),St.createElementVNode("div",{class:"description truncated",title:ir.description},St.toDisplayString(ir.description),9,rx)],10,X1))}}),[["__scopeId","data-v-98e20a36"]]),ox=["data-testid"],ax=["title"],nx={class:"details"},ix=["aria-label","title"],Cy=Ud(St.defineComponent({__name:"OperationsListItem",props:{item:{type:Object,required:!0,validator:ir=>ir.method!==void 0&&ir.summary!==void 0&&ir.path!==void 0},isSelected:{type:Boolean,default:!1},disableSelection:{type:Boolean,default:!1}},emits:["click"],setup(ir){const yo=ir,{i18n:Lo}=Ku.useI18n(),cn=St.computed(()=>{var b,j;return`spec-operations-list-item-${(b=yo.item.method)==null?void 0:b.toLowerCase()}${(j=yo.item.path)==null?void 0:j.replaceAll("/","-")}-${yo.item.tag||"-"}`}),ut=St.computed(()=>yo.item.method||"");return(b,j)=>{const o=St.resolveComponent("KBadge");return St.openBlock(),St.createElementBlock("button",{class:St.normalizeClass(["spec-operations-list-item",{"item--selected":ir.isSelected,[`item--method-${ir.item.method}`]:!0,disabled:ir.disableSelection}]),"data-testid":cn.value,type:"button",onClick:j[0]||(j[0]=u=>b.$emit("click",ir.item))},[ir.item.summary?(St.openBlock(),St.createElementBlock("h2",{key:0,class:"summary truncated",title:ir.item.summary},St.toDisplayString(ir.item.summary),9,ax)):St.createCommentVNode("",!0),St.createElementVNode("div",nx,[St.createVNode(o,{appearance:"custom","aria-label":St.unref(Lo).t("specOperationsList.item.methodAriaLabel",{method:ut.value.toUpperCase()}),"background-color":"var(--kong-ui-spec-renderer-operations-list-item-method-background)",class:"method-badge",color:"var(--kong-ui-spec-renderer-operations-list-item-method-color)",tabindex:"-1"},{default:St.withCtx(()=>[St.createTextVNode(St.toDisplayString(ut.value.toUpperCase()),1)]),_:1},8,["aria-label"]),St.createElementVNode("span",{"aria-label":St.unref(Lo).t("specOperationsList.item.pathAriaLabel",{path:ir.item.path}),class:"path truncated",title:ir.item.path},St.toDisplayString(ir.item.path),9,ix)])],10,ox)}}}),[["__scopeId","data-v-5610ea54"]]),sx=["aria-label"],cx={key:0},lx={key:0,class:"filter-wrapper"},ux={key:1},px=["data-testid"],dx=["id"],hx={key:0,class:"section","data-testid":"spec-operations-list-untagged-items"},gx=["id"],fx={key:2,"data-testid":"kong-ui-public-spec-operations-list-empty"},mx={class:"center"},bx={key:1,"data-testid":"kong-ui-public-spec-operations-list-error"},{getSizeFromString:vx,hasRequiredProps:Py}=Ku.useUtilities(),Iy=Ud(St.defineComponent({__name:"SpecOperationsList",props:{operations:{type:Array,required:!0,validator:ir=>!ir.length||Py(ir,["method","path"])},tags:{type:Array,default:()=>[],validator:ir=>!ir.length||Py(ir,["name"])},isFilterable:{type:Boolean,default:!0},filterFunction:{type:Function,default:({items:ir,query:yo})=>(yo=yo.toLowerCase(),ir.filter(Lo=>Lo.tag&&Lo.tag.toLowerCase().includes(yo))),validator:ir=>!!ir&&typeof ir=="function"},deselect:{type:Boolean,default:!1},disableSelection:{type:Boolean,default:!1},width:{type:String,default:"210"}},emits:["selected"],setup(ir,{emit:yo}){const Lo=ir,cn=yo,{i18n:ut}=Ku.useI18n(),b=St.computed(()=>P1()),j=St.ref(""),o=St.ref([]),u=St.ref(),y=St.ref([]),S=()=>{const k=o.value;if(!Lo.isFilterable){y.value=k;return}if(!Lo.filterFunction||typeof Lo.filterFunction!="function")throw new Error(`filterFunction property must be a function, got ${typeof Lo.filterFunction}`);y.value=Lo.filterFunction({items:k,query:j.value})},w=St.computed(()=>vx(Lo.width)),O=St.computed(()=>{const k=[];return y.value.forEach(E=>{E.tag&&!k.includes(E.tag)&&k.push(E.tag)}),k}),T=St.computed(()=>o.value.filter(k=>!k.tag)),p=k=>{if(!Lo.tags||!Array.isArray(Lo.tags))return"";const E=Lo.tags.find(f=>f.name===k);return(E==null?void 0:E.description)||""},n=k=>y.value.filter(E=>E.tag===k),l=k=>{const E=u.value;return!!E&&E.path===k.path&&E.method===k.method&&E.operationId===k.operationId&&E.tag===k.tag},d=k=>`${b.value}-section-${k.toLowerCase()}`,s=k=>{Lo.disableSelection||(u.value=k,cn("selected",k))},g=()=>{o.value=[],Lo.operations&&(Lo.operations.forEach(k=>{var f;const E=L0(k);(f=k.tags)!=null&&f.length?k.tags.forEach(_=>{delete E.tags,E.tag=_,o.value.push(L0(E))}):(delete E.tags,E.tag=null,o.value.push(L0(E)))}),S())};return St.watch(()=>Lo.deselect,()=>{Lo.deselect&&(u.value=void 0)}),St.watch(()=>Lo.operations,()=>g()),St.watch(j,()=>S()),St.onMounted(()=>{g()}),(k,E)=>{const f=St.resolveComponent("KInput"),_=St.resolveComponent("KCollapse");return St.openBlock(),St.createElementBlock("section",{"aria-label":St.unref(ut).t("specOperationsList.ariaLabel"),class:"kong-ui-public-spec-operations-list","data-testid":"kong-ui-public-spec-operations-list",role:"navigation",style:St.normalizeStyle({width:w.value})},[ir.operations?(St.openBlock(),St.createElementBlock("div",cx,[ir.isFilterable?(St.openBlock(),St.createElementBlock("div",lx,[St.createVNode(f,{modelValue:j.value,"onUpdate:modelValue":E[0]||(E[0]=P=>j.value=P),class:"filter-input","data-testid":"spec-operations-list-filter",placeholder:St.unref(ut).t("specOperationsList.filterPlaceholder")},{before:St.withCtx(()=>[St.createVNode(St.unref(Q1),{decorative:""})]),_:1},8,["modelValue","placeholder"])])):St.createCommentVNode("",!0),y.value.length?(St.openBlock(),St.createElementBlock("div",ux,[(St.openBlock(!0),St.createElementBlock(St.Fragment,null,St.renderList(O.value,P=>(St.openBlock(),St.createElementBlock("div",{key:P,class:"section-wrapper","data-testid":`spec-operations-list-section-${P.toLowerCase().replaceAll(" ","-")}`},[St.createVNode(_,{"model-value":!1,"trigger-alignment":"leading"},{trigger:St.withCtx(({isCollapsed:R,toggle:D})=>[St.createVNode(jy,{"content-element-id":d(P),"data-testid":`spec-operations-list-section-${P.toLowerCase().replaceAll(" ","-")}-collapse-trigger`,description:p(P),"is-collapsed":R,name:P,onToggle:D},null,8,["content-element-id","data-testid","description","is-collapsed","name","onToggle"])]),default:St.withCtx(()=>[St.createElementVNode("div",{id:d(P)},[(St.openBlock(!0),St.createElementBlock(St.Fragment,null,St.renderList(n(P),R=>St.renderSlot(k.$slots,"item",{key:`${R.path}-${R.method}`,item:R,section:P,select:()=>s(R)},()=>[St.createVNode(Cy,{"disable-selection":ir.disableSelection,"is-selected":l(R),item:R,section:P,onClick:s},null,8,["disable-selection","is-selected","item","section"])],!0)),128))],8,dx)]),_:2},1024)],8,px))),128)),!ir.isFilterable||!j.value?(St.openBlock(),St.createElementBlock("div",hx,[St.createVNode(_,{"model-value":!1,"trigger-alignment":"leading"},{trigger:St.withCtx(({isCollapsed:P,toggle:R})=>[St.createVNode(jy,{"content-element-id":d(St.unref(Rp)),"data-testid":"spec-operations-list-section-untagged-collapse-trigger",description:p(St.unref(Rp)),"is-collapsed":P,name:St.unref(Rp),onToggle:R},null,8,["content-element-id","description","is-collapsed","name","onToggle"])]),default:St.withCtx(()=>[St.createElementVNode("div",{id:d(St.unref(Rp))},[(St.openBlock(!0),St.createElementBlock(St.Fragment,null,St.renderList(T.value,P=>St.renderSlot(k.$slots,"untagged-item",{key:`${P.path}-${P.method}`,item:P,section:St.unref(Rp),select:()=>s(P)},()=>[St.createVNode(Cy,{"disable-selection":ir.disableSelection,"is-selected":l(P),item:P,onClick:s},null,8,["disable-selection","is-selected","item"])],!0)),128))],8,gx)]),_:3})])):St.createCommentVNode("",!0)])):(St.openBlock(),St.createElementBlock("div",fx,[St.renderSlot(k.$slots,"empty-state",{},()=>[St.createElementVNode("div",mx,St.toDisplayString(St.unref(ut).t("specOperationsList.noResults")),1)],!0)]))])):(St.openBlock(),St.createElementBlock("div",bx,[St.renderSlot(k.$slots,"error-state",{},()=>[St.createTextVNode(St.toDisplayString(St.unref(ut).t("specOperationsList.error")),1)],!0)]))],12,sx)}}}),[["__scopeId","data-v-751da895"]]),yx={class:"kong-ui-public-spec-renderer"},kx={key:0,class:"spec-container"},wx={class:"spec-renderer-ops-list-empty-state","data-testid":"spec-renderer-ops-list-empty-state"},xx={key:1,"data-testid":"kong-ui-public-spec-renderer-error"},{hasRequiredProps:Ty}=Ku.useUtilities(),Ex=Ud(St.defineComponent({__name:"SpecRenderer",props:{spec:{type:Object,required:!0},essentialsOnly:{type:Boolean,default:!1},operationsList:{type:Array,required:!0,validator:ir=>!ir.length||Ty(ir,["method","path"])},tags:{type:Array,default:()=>[],validator:ir=>!ir.length||Ty(ir,["name"])},navWidth:{type:String,default:"310"},deselect:{type:Boolean,default:!1}},setup(ir){const yo=ir,{i18n:Lo}=Ku.useI18n(),cn=St.computed(()=>!!(yo.spec&&yo.operationsList)),ut=St.ref(),b=j=>{ut.value=j};return(j,o)=>{const u=St.resolveComponent("KEmptyState");return St.openBlock(),St.createElementBlock("div",yx,[cn.value?(St.openBlock(),St.createElementBlock("div",kx,[St.createVNode(Iy,{"data-testid":"spec-renderer-ops-list-content",deselect:ir.deselect,operations:ir.operationsList,tags:ir.tags,width:ir.navWidth,onSelected:b},{"empty-state":St.withCtx(()=>[St.createElementVNode("div",wx,[St.renderSlot(j.$slots,"ops-list-empty-state",{},void 0,!0)])]),_:3},8,["deselect","operations","tags","width"]),St.createVNode(_y,{"active-operation":ut.value,class:"spec-renderer-details","data-testid":"spec-renderer-details-content",document:ir.spec,"essentials-only":ir.essentialsOnly,"has-sidebar":!1},null,8,["active-operation","document","essentials-only"])])):(St.openBlock(),St.createElementBlock("div",xx,[St.renderSlot(j.$slots,"error-state",{},()=>[St.createVNode(u,{"cta-is-hidden":"","icon-size":"50","is-error":!0},{title:St.withCtx(()=>[St.createTextVNode(St.toDisplayString(St.unref(Lo).t("specRenderer.error")),1)]),_:1})],!0)]))])}}}),[["__scopeId","data-v-573e5489"]]);$n.DEFAULT_UNTAGGED_SECTION_NAME=Rp,$n.SpecDetails=_y,$n.SpecOperationsList=Iy,$n.SpecRenderer=Ex,Object.defineProperty($n,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/spec-renderer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.32",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/spec-renderer.umd.js",
|
|
6
6
|
"module": "./dist/spec-renderer.es.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@kong-ui-public/swagger-ui-web-component": "^0.10.10",
|
|
38
|
-
"@kong/icons": "^1.8.
|
|
38
|
+
"@kong/icons": "^1.8.13",
|
|
39
39
|
"lodash.clonedeep": "^4.5.0",
|
|
40
40
|
"uuid": "^9.0.1",
|
|
41
41
|
"@kong-ui-public/i18n": "^2.1.0"
|