@kong-ui-public/forms 4.15.4-pr.2204.9224a4a87.0 → 4.15.4-pr.2204.f9043269d.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/forms.umd.js CHANGED
@@ -1,4 +1,4 @@
1
1
  (function(L,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong-ui-public/entities-shared"],t):(L=typeof globalThis<"u"?globalThis:L||self,t(L["kong-ui-public-forms"]={},L.Vue,L["kong-ui-public-i18n"],L.KongIcons,L["kong-ui-public-entities-shared"]))})(this,function(L,t,ue,Ce,wt){"use strict";function Bn(e,n){for(var o=-1,a=e==null?0:e.length;++o<a&&n(e[o],o,e)!==!1;);return e}function Xa(e){return function(n,o,a){for(var i=-1,r=Object(n),l=a(n),s=l.length;s--;){var c=l[++i];if(o(r[c],c,r)===!1)break}return n}}var Ja=Xa();function Qa(e,n){for(var o=-1,a=Array(e);++o<e;)a[o]=n(o);return a}var Fn=typeof global=="object"&&global&&global.Object===Object&&global,ei=typeof self=="object"&&self&&self.Object===Object&&self,ge=Fn||ei||Function("return this")(),De=ge.Symbol,Rn=Object.prototype,ti=Rn.hasOwnProperty,ni=Rn.toString,lt=De?De.toStringTag:void 0;function oi(e){var n=ti.call(e,lt),o=e[lt];try{e[lt]=void 0;var a=!0}catch{}var i=ni.call(e);return a&&(n?e[lt]=o:delete e[lt]),i}var ai=Object.prototype,ii=ai.toString;function ri(e){return ii.call(e)}var li="[object Null]",si="[object Undefined]",Dn=De?De.toStringTag:void 0;function Le(e){return e==null?e===void 0?si:li:Dn&&Dn in Object(e)?oi(e):ri(e)}function Ue(e){return e!=null&&typeof e=="object"}var di="[object Arguments]";function Ln(e){return Ue(e)&&Le(e)==di}var Un=Object.prototype,ci=Un.hasOwnProperty,mi=Un.propertyIsEnumerable,ui=Ln(function(){return arguments}())?Ln:function(e){return Ue(e)&&ci.call(e,"callee")&&!mi.call(e,"callee")},Pe=Array.isArray;function fi(){return!1}var Pn=typeof L=="object"&&L&&!L.nodeType&&L,$n=Pn&&typeof module=="object"&&module&&!module.nodeType&&module,hi=$n&&$n.exports===Pn,vn=hi?ge.Buffer:void 0,pi=vn?vn.isBuffer:void 0,xn=pi||fi,gi=9007199254740991,yi=/^(?:0|[1-9]\d*)$/;function jn(e,n){var o=typeof e;return n=n??gi,!!n&&(o=="number"||o!="symbol"&&yi.test(e))&&e>-1&&e%1==0&&e<n}var bi=9007199254740991;function qn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=bi}var _i="[object Arguments]",Ei="[object Array]",Si="[object Boolean]",Ti="[object Date]",Ci="[object Error]",wi="[object Function]",ki="[object Map]",Mi="[object Number]",Ai="[object Object]",Ni="[object RegExp]",Ii="[object Set]",Oi="[object String]",Vi="[object WeakMap]",Bi="[object ArrayBuffer]",Fi="[object DataView]",Ri="[object Float32Array]",Di="[object Float64Array]",Li="[object Int8Array]",Ui="[object Int16Array]",Pi="[object Int32Array]",$i="[object Uint8Array]",vi="[object Uint8ClampedArray]",xi="[object Uint16Array]",ji="[object Uint32Array]",q={};q[Ri]=q[Di]=q[Li]=q[Ui]=q[Pi]=q[$i]=q[vi]=q[xi]=q[ji]=!0,q[_i]=q[Ei]=q[Bi]=q[Si]=q[Fi]=q[Ti]=q[Ci]=q[wi]=q[ki]=q[Mi]=q[Ai]=q[Ni]=q[Ii]=q[Oi]=q[Vi]=!1;function qi(e){return Ue(e)&&qn(e.length)&&!!q[Le(e)]}function Wt(e){return function(n){return e(n)}}var zn=typeof L=="object"&&L&&!L.nodeType&&L,st=zn&&typeof module=="object"&&module&&!module.nodeType&&module,zi=st&&st.exports===zn,Zt=zi&&Fn.process,We=function(){try{var e=st&&st.require&&st.require("util").types;return e||Zt&&Zt.binding&&Zt.binding("util")}catch{}}(),Kn=We&&We.isTypedArray,Ki=Kn?Wt(Kn):qi,Hi=Object.prototype,Yi=Hi.hasOwnProperty;function Hn(e,n){var o=Pe(e),a=!o&&ui(e),i=!o&&!a&&xn(e),r=!o&&!a&&!i&&Ki(e),l=o||a||i||r,s=l?Qa(e.length,String):[],c=s.length;for(var m in e)(n||Yi.call(e,m))&&!(l&&(m=="length"||i&&(m=="offset"||m=="parent")||r&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||jn(m,c)))&&s.push(m);return s}var Gi=Object.prototype;function Xt(e){var n=e&&e.constructor,o=typeof n=="function"&&n.prototype||Gi;return e===o}function Yn(e,n){return function(o){return e(n(o))}}var Wi=Yn(Object.keys,Object),Zi=Object.prototype,Xi=Zi.hasOwnProperty;function Ji(e){if(!Xt(e))return Wi(e);var n=[];for(var o in Object(e))Xi.call(e,o)&&o!="constructor"&&n.push(o);return n}function fe(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Qi="[object AsyncFunction]",er="[object Function]",tr="[object GeneratorFunction]",nr="[object Proxy]";function v(e){if(!fe(e))return!1;var n=Le(e);return n==er||n==tr||n==Qi||n==nr}function kt(e){return e!=null&&qn(e.length)&&!v(e)}function Mt(e){return kt(e)?Hn(e):Ji(e)}function or(e,n){return e&&Ja(e,n,Mt)}function ar(e,n){return function(o,a){if(o==null)return o;if(!kt(o))return e(o,a);for(var i=o.length,r=-1,l=Object(o);++r<i&&a(l[r],r,l)!==!1;);return o}}var ir=ar(or);function Jt(e){return e}function rr(e){return typeof e=="function"?e:Jt}function re(e,n){var o=Pe(e)?Bn:ir;return o(e,rr(n))}var lr="[object Symbol]";function At(e){return typeof e=="symbol"||Ue(e)&&Le(e)==lr}var sr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dr=/^\w*$/;function cr(e,n){if(Pe(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||At(e)?!0:dr.test(e)||!sr.test(e)||n!=null&&e in Object(n)}var Qt=ge["__core-js_shared__"],Gn=function(){var e=/[^.]+$/.exec(Qt&&Qt.keys&&Qt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function mr(e){return!!Gn&&Gn in e}var ur=Function.prototype,fr=ur.toString;function xe(e){if(e!=null){try{return fr.call(e)}catch{}try{return e+""}catch{}}return""}var hr=/[\\^$.*+?()[\]{}|]/g,pr=/^\[object .+?Constructor\]$/,gr=Function.prototype,yr=Object.prototype,br=gr.toString,_r=yr.hasOwnProperty,Er=RegExp("^"+br.call(_r).replace(hr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sr(e){if(!fe(e)||mr(e))return!1;var n=v(e)?Er:pr;return n.test(xe(e))}function Tr(e,n){return e==null?void 0:e[n]}function je(e,n){var o=Tr(e,n);return Sr(o)?o:void 0}var dt=je(Object,"create");function Cr(){this.__data__=dt?dt(null):{},this.size=0}function wr(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var kr="__lodash_hash_undefined__",Mr=Object.prototype,Ar=Mr.hasOwnProperty;function Nr(e){var n=this.__data__;if(dt){var o=n[e];return o===kr?void 0:o}return Ar.call(n,e)?n[e]:void 0}var Ir=Object.prototype,Or=Ir.hasOwnProperty;function Vr(e){var n=this.__data__;return dt?n[e]!==void 0:Or.call(n,e)}var Br="__lodash_hash_undefined__";function Fr(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=dt&&n===void 0?Br:n,this}function qe(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}qe.prototype.clear=Cr,qe.prototype.delete=wr,qe.prototype.get=Nr,qe.prototype.has=Vr,qe.prototype.set=Fr;function Rr(){this.__data__=[],this.size=0}function Nt(e,n){return e===n||e!==e&&n!==n}function It(e,n){for(var o=e.length;o--;)if(Nt(e[o][0],n))return o;return-1}var Dr=Array.prototype,Lr=Dr.splice;function Ur(e){var n=this.__data__,o=It(n,e);if(o<0)return!1;var a=n.length-1;return o==a?n.pop():Lr.call(n,o,1),--this.size,!0}function Pr(e){var n=this.__data__,o=It(n,e);return o<0?void 0:n[o][1]}function $r(e){return It(this.__data__,e)>-1}function vr(e,n){var o=this.__data__,a=It(o,e);return a<0?(++this.size,o.push([e,n])):o[a][1]=n,this}function ke(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}ke.prototype.clear=Rr,ke.prototype.delete=Ur,ke.prototype.get=Pr,ke.prototype.has=$r,ke.prototype.set=vr;var ct=je(ge,"Map");function xr(){this.size=0,this.__data__={hash:new qe,map:new(ct||ke),string:new qe}}function jr(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Ot(e,n){var o=e.__data__;return jr(n)?o[typeof n=="string"?"string":"hash"]:o.map}function qr(e){var n=Ot(this,e).delete(e);return this.size-=n?1:0,n}function zr(e){return Ot(this,e).get(e)}function Kr(e){return Ot(this,e).has(e)}function Hr(e,n){var o=Ot(this,e),a=o.size;return o.set(e,n),this.size+=o.size==a?0:1,this}function Me(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}Me.prototype.clear=xr,Me.prototype.delete=qr,Me.prototype.get=zr,Me.prototype.has=Kr,Me.prototype.set=Hr;var Yr="Expected a function";function en(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Yr);var o=function(){var a=arguments,i=n?n.apply(this,a):a[0],r=o.cache;if(r.has(i))return r.get(i);var l=e.apply(this,a);return o.cache=r.set(i,l)||r,l};return o.cache=new(en.Cache||Me),o}en.Cache=Me;var Gr=500;function Wr(e){var n=en(e,function(a){return o.size===Gr&&o.clear(),a}),o=n.cache;return n}var Zr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xr=/\\(\\)?/g,Jr=Wr(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(Zr,function(o,a,i,r){n.push(i?r.replace(Xr,"$1"):a||o)}),n});function Qr(e,n){for(var o=-1,a=e==null?0:e.length,i=Array(a);++o<a;)i[o]=n(e[o],o,e);return i}var Wn=De?De.prototype:void 0,Zn=Wn?Wn.toString:void 0;function Xn(e){if(typeof e=="string")return e;if(Pe(e))return Qr(e,Xn)+"";if(At(e))return Zn?Zn.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Jn(e){return e==null?"":Xn(e)}function el(e,n){return Pe(e)?e:cr(e,n)?[e]:Jr(Jn(e))}function tl(e){if(typeof e=="string"||At(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function nl(e,n){n=el(n,e);for(var o=0,a=n.length;e!=null&&o<a;)e=e[tl(n[o++])];return o&&o==a?e:void 0}function P(e,n,o){var a=e==null?void 0:nl(e,n);return a===void 0?o:a}function G(e){return e==null}const ne="kong-ui-forms-api",Qn="kong-ui-forms-config",eo="redis-partial-list-fetcher-key",ol="redis-partial-info",ze="autofill",he="autofillSlot",_e={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:to,setPrototypeOf:no,isFrozen:al,getPrototypeOf:il,getOwnPropertyDescriptor:rl}=Object;let{freeze:le,seal:ye,create:oo}=Object,{apply:tn,construct:nn}=typeof Reflect<"u"&&Reflect;le||(le=function(n){return n}),ye||(ye=function(n){return n}),tn||(tn=function(n,o,a){return n.apply(o,a)}),nn||(nn=function(n,o){return new n(...o)});const Vt=de(Array.prototype.forEach),ll=de(Array.prototype.lastIndexOf),ao=de(Array.prototype.pop),mt=de(Array.prototype.push),sl=de(Array.prototype.splice),Bt=de(String.prototype.toLowerCase),on=de(String.prototype.toString),io=de(String.prototype.match),ut=de(String.prototype.replace),dl=de(String.prototype.indexOf),cl=de(String.prototype.trim),Ee=de(Object.prototype.hasOwnProperty),se=de(RegExp.prototype.test),ft=ml(TypeError);function de(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return tn(e,n,a)}}function ml(e){return function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return nn(e,o)}}function D(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bt;no&&no(e,null);let a=n.length;for(;a--;){let i=n[a];if(typeof i=="string"){const r=o(i);r!==i&&(al(n)||(n[a]=r),i=r)}e[i]=!0}return e}function ul(e){for(let n=0;n<e.length;n++)Ee(e,n)||(e[n]=null);return e}function Ae(e){const n=oo(null);for(const[o,a]of to(e))Ee(e,o)&&(Array.isArray(a)?n[o]=ul(a):a&&typeof a=="object"&&a.constructor===Object?n[o]=Ae(a):n[o]=a);return n}function ht(e,n){for(;e!==null;){const a=rl(e,n);if(a){if(a.get)return de(a.get);if(typeof a.value=="function")return de(a.value)}e=il(e)}function o(){return null}return o}const ro=le(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),an=le(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),rn=le(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fl=le(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ln=le(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),hl=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),lo=le(["#text"]),so=le(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),sn=le(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),co=le(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ft=le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),pl=ye(/\{\{[\w\W]*|[\w\W]*\}\}/gm),gl=ye(/<%[\w\W]*|[\w\W]*%>/gm),yl=ye(/\$\{[\w\W]*/gm),bl=ye(/^data-[\-\w.\u00B7-\uFFFF]+$/),_l=ye(/^aria-[\-\w]+$/),mo=ye(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),El=ye(/^(?:\w+script|data):/i),Sl=ye(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),uo=ye(/^html$/i),Tl=ye(/^[a-z][.\w]*(-[.\w]+)+$/i);var fo=Object.freeze({__proto__:null,ARIA_ATTR:_l,ATTR_WHITESPACE:Sl,CUSTOM_ELEMENT:Tl,DATA_ATTR:bl,DOCTYPE_NAME:uo,ERB_EXPR:gl,IS_ALLOWED_URI:mo,IS_SCRIPT_OR_DATA:El,MUSTACHE_EXPR:pl,TMPLIT_EXPR:yl});const pt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Cl=function(){return typeof window>"u"?null:window},wl=function(n,o){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&(a=o.getAttribute(i));const r="dompurify"+(a?"#"+a:"");try{return n.createPolicy(r,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},ho=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function po(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cl();const n=N=>po(N);if(n.version="3.2.6",n.removed=[],!e||!e.document||e.document.nodeType!==pt.document||!e.Element)return n.isSupported=!1,n;let{document:o}=e;const a=o,i=a.currentScript,{DocumentFragment:r,HTMLTemplateElement:l,Node:s,Element:c,NodeFilter:m,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:g,trustedTypes:M}=e,B=c.prototype,h=ht(B,"cloneNode"),C=ht(B,"remove"),k=ht(B,"nextSibling"),I=ht(B,"childNodes"),u=ht(B,"parentNode");if(typeof l=="function"){const N=o.createElement("template");N.content&&N.content.ownerDocument&&(o=N.content.ownerDocument)}let b,w="";const{implementation:S,createNodeIterator:y,createDocumentFragment:F,getElementsByTagName:x}=o,{importNode:T}=a;let E=ho();n.isSupported=typeof to=="function"&&typeof u=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:V,ERB_EXPR:R,TMPLIT_EXPR:U,DATA_ATTR:ee,ARIA_ATTR:Oe,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:Ve,CUSTOM_ELEMENT:En}=fo;let{IS_ALLOWED_URI:xt}=fo,O=null;const H=D({},[...ro,...an,...rn,...ln,...lo]);let Z=null;const Ia=D({},[...so,...sn,...co,...Ft]);let X=Object.seal(oo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Et=null,Sn=null,Oa=!0,Tn=!0,Va=!1,Ba=!0,et=!1,jt=!0,Ge=!1,Cn=!1,wn=!1,tt=!1,qt=!1,zt=!1,Fa=!0,Ra=!1;const Ff="user-content-";let kn=!0,St=!1,nt={},ot=null;const Da=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let La=null;const Ua=D({},["audio","video","img","source","image","track"]);let Mn=null;const Pa=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",Ht="http://www.w3.org/2000/svg",Be="http://www.w3.org/1999/xhtml";let at=Be,An=!1,Nn=null;const Rf=D({},[Kt,Ht,Be],on);let Yt=D({},["mi","mo","mn","ms","mtext"]),Gt=D({},["annotation-xml"]);const Df=D({},["title","style","font","a","script"]);let Tt=null;const Lf=["application/xhtml+xml","text/html"],Uf="text/html";let te=null,it=null;const Pf=o.createElement("form"),$a=function(d){return d instanceof RegExp||d instanceof Function},In=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(it&&it===d)){if((!d||typeof d!="object")&&(d={}),d=Ae(d),Tt=Lf.indexOf(d.PARSER_MEDIA_TYPE)===-1?Uf:d.PARSER_MEDIA_TYPE,te=Tt==="application/xhtml+xml"?on:Bt,O=Ee(d,"ALLOWED_TAGS")?D({},d.ALLOWED_TAGS,te):H,Z=Ee(d,"ALLOWED_ATTR")?D({},d.ALLOWED_ATTR,te):Ia,Nn=Ee(d,"ALLOWED_NAMESPACES")?D({},d.ALLOWED_NAMESPACES,on):Rf,Mn=Ee(d,"ADD_URI_SAFE_ATTR")?D(Ae(Pa),d.ADD_URI_SAFE_ATTR,te):Pa,La=Ee(d,"ADD_DATA_URI_TAGS")?D(Ae(Ua),d.ADD_DATA_URI_TAGS,te):Ua,ot=Ee(d,"FORBID_CONTENTS")?D({},d.FORBID_CONTENTS,te):Da,Et=Ee(d,"FORBID_TAGS")?D({},d.FORBID_TAGS,te):Ae({}),Sn=Ee(d,"FORBID_ATTR")?D({},d.FORBID_ATTR,te):Ae({}),nt=Ee(d,"USE_PROFILES")?d.USE_PROFILES:!1,Oa=d.ALLOW_ARIA_ATTR!==!1,Tn=d.ALLOW_DATA_ATTR!==!1,Va=d.ALLOW_UNKNOWN_PROTOCOLS||!1,Ba=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,et=d.SAFE_FOR_TEMPLATES||!1,jt=d.SAFE_FOR_XML!==!1,Ge=d.WHOLE_DOCUMENT||!1,tt=d.RETURN_DOM||!1,qt=d.RETURN_DOM_FRAGMENT||!1,zt=d.RETURN_TRUSTED_TYPE||!1,wn=d.FORCE_BODY||!1,Fa=d.SANITIZE_DOM!==!1,Ra=d.SANITIZE_NAMED_PROPS||!1,kn=d.KEEP_CONTENT!==!1,St=d.IN_PLACE||!1,xt=d.ALLOWED_URI_REGEXP||mo,at=d.NAMESPACE||Be,Yt=d.MATHML_TEXT_INTEGRATION_POINTS||Yt,Gt=d.HTML_INTEGRATION_POINTS||Gt,X=d.CUSTOM_ELEMENT_HANDLING||{},d.CUSTOM_ELEMENT_HANDLING&&$a(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=d.CUSTOM_ELEMENT_HANDLING.tagNameCheck),d.CUSTOM_ELEMENT_HANDLING&&$a(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),et&&(Tn=!1),qt&&(tt=!0),nt&&(O=D({},lo),Z=[],nt.html===!0&&(D(O,ro),D(Z,so)),nt.svg===!0&&(D(O,an),D(Z,sn),D(Z,Ft)),nt.svgFilters===!0&&(D(O,rn),D(Z,sn),D(Z,Ft)),nt.mathMl===!0&&(D(O,ln),D(Z,co),D(Z,Ft))),d.ADD_TAGS&&(O===H&&(O=Ae(O)),D(O,d.ADD_TAGS,te)),d.ADD_ATTR&&(Z===Ia&&(Z=Ae(Z)),D(Z,d.ADD_ATTR,te)),d.ADD_URI_SAFE_ATTR&&D(Mn,d.ADD_URI_SAFE_ATTR,te),d.FORBID_CONTENTS&&(ot===Da&&(ot=Ae(ot)),D(ot,d.FORBID_CONTENTS,te)),kn&&(O["#text"]=!0),Ge&&D(O,["html","head","body"]),O.table&&(D(O,["tbody"]),delete Et.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw ft('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ft('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=d.TRUSTED_TYPES_POLICY,w=b.createHTML("")}else b===void 0&&(b=wl(M,i)),b!==null&&typeof w=="string"&&(w=b.createHTML(""));le&&le(d),it=d}},va=D({},[...an,...rn,...fl]),xa=D({},[...ln,...hl]),$f=function(d){let _=u(d);(!_||!_.tagName)&&(_={namespaceURI:at,tagName:"template"});const A=Bt(d.tagName),z=Bt(_.tagName);return Nn[d.namespaceURI]?d.namespaceURI===Ht?_.namespaceURI===Be?A==="svg":_.namespaceURI===Kt?A==="svg"&&(z==="annotation-xml"||Yt[z]):!!va[A]:d.namespaceURI===Kt?_.namespaceURI===Be?A==="math":_.namespaceURI===Ht?A==="math"&&Gt[z]:!!xa[A]:d.namespaceURI===Be?_.namespaceURI===Ht&&!Gt[z]||_.namespaceURI===Kt&&!Yt[z]?!1:!xa[A]&&(Df[A]||!va[A]):!!(Tt==="application/xhtml+xml"&&Nn[d.namespaceURI]):!1},we=function(d){mt(n.removed,{element:d});try{u(d).removeChild(d)}catch{C(d)}},rt=function(d,_){try{mt(n.removed,{attribute:_.getAttributeNode(d),from:_})}catch{mt(n.removed,{attribute:null,from:_})}if(_.removeAttribute(d),d==="is")if(tt||qt)try{we(_)}catch{}else try{_.setAttribute(d,"")}catch{}},ja=function(d){let _=null,A=null;if(wn)d="<remove></remove>"+d;else{const Q=io(d,/^[\r\n\t ]+/);A=Q&&Q[0]}Tt==="application/xhtml+xml"&&at===Be&&(d='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d+"</body></html>");const z=b?b.createHTML(d):d;if(at===Be)try{_=new g().parseFromString(z,Tt)}catch{}if(!_||!_.documentElement){_=S.createDocument(at,"template",null);try{_.documentElement.innerHTML=An?w:z}catch{}}const ae=_.body||_.documentElement;return d&&A&&ae.insertBefore(o.createTextNode(A),ae.childNodes[0]||null),at===Be?x.call(_,Ge?"html":"body")[0]:Ge?_.documentElement:ae},qa=function(d){return y.call(d.ownerDocument||d,d,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},On=function(d){return d instanceof f&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof p)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},za=function(d){return typeof s=="function"&&d instanceof s};function Fe(N,d,_){Vt(N,A=>{A.call(n,d,_,it)})}const Ka=function(d){let _=null;if(Fe(E.beforeSanitizeElements,d,null),On(d))return we(d),!0;const A=te(d.nodeName);if(Fe(E.uponSanitizeElement,d,{tagName:A,allowedTags:O}),jt&&d.hasChildNodes()&&!za(d.firstElementChild)&&se(/<[/\w!]/g,d.innerHTML)&&se(/<[/\w!]/g,d.textContent)||d.nodeType===pt.progressingInstruction||jt&&d.nodeType===pt.comment&&se(/<[/\w]/g,d.data))return we(d),!0;if(!O[A]||Et[A]){if(!Et[A]&&Ya(A)&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,A)||X.tagNameCheck instanceof Function&&X.tagNameCheck(A)))return!1;if(kn&&!ot[A]){const z=u(d)||d.parentNode,ae=I(d)||d.childNodes;if(ae&&z){const Q=ae.length;for(let me=Q-1;me>=0;--me){const Re=h(ae[me],!0);Re.__removalCount=(d.__removalCount||0)+1,z.insertBefore(Re,k(d))}}}return we(d),!0}return d instanceof c&&!$f(d)||(A==="noscript"||A==="noembed"||A==="noframes")&&se(/<\/no(script|embed|frames)/i,d.innerHTML)?(we(d),!0):(et&&d.nodeType===pt.text&&(_=d.textContent,Vt([V,R,U],z=>{_=ut(_,z," ")}),d.textContent!==_&&(mt(n.removed,{element:d.cloneNode()}),d.textContent=_)),Fe(E.afterSanitizeElements,d,null),!1)},Ha=function(d,_,A){if(Fa&&(_==="id"||_==="name")&&(A in o||A in Pf))return!1;if(!(Tn&&!Sn[_]&&se(ee,_))){if(!(Oa&&se(Oe,_))){if(!Z[_]||Sn[_]){if(!(Ya(d)&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,d)||X.tagNameCheck instanceof Function&&X.tagNameCheck(d))&&(X.attributeNameCheck instanceof RegExp&&se(X.attributeNameCheck,_)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(_))||_==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,A)||X.tagNameCheck instanceof Function&&X.tagNameCheck(A))))return!1}else if(!Mn[_]){if(!se(xt,ut(A,Ve,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&d!=="script"&&dl(A,"data:")===0&&La[d])){if(!(Va&&!se(J,ut(A,Ve,"")))){if(A)return!1}}}}}}return!0},Ya=function(d){return d!=="annotation-xml"&&io(d,En)},Ga=function(d){Fe(E.beforeSanitizeAttributes,d,null);const{attributes:_}=d;if(!_||On(d))return;const A={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let z=_.length;for(;z--;){const ae=_[z],{name:Q,namespaceURI:me,value:Re}=ae,Ct=te(Q),Vn=Re;let ie=Q==="value"?Vn:cl(Vn);if(A.attrName=Ct,A.attrValue=ie,A.keepAttr=!0,A.forceKeepAttr=void 0,Fe(E.uponSanitizeAttribute,d,A),ie=A.attrValue,Ra&&(Ct==="id"||Ct==="name")&&(rt(Q,d),ie=Ff+ie),jt&&se(/((--!?|])>)|<\/(style|title)/i,ie)){rt(Q,d);continue}if(A.forceKeepAttr)continue;if(!A.keepAttr){rt(Q,d);continue}if(!Ba&&se(/\/>/i,ie)){rt(Q,d);continue}et&&Vt([V,R,U],Za=>{ie=ut(ie,Za," ")});const Wa=te(d.nodeName);if(!Ha(Wa,Ct,ie)){rt(Q,d);continue}if(b&&typeof M=="object"&&typeof M.getAttributeType=="function"&&!me)switch(M.getAttributeType(Wa,Ct)){case"TrustedHTML":{ie=b.createHTML(ie);break}case"TrustedScriptURL":{ie=b.createScriptURL(ie);break}}if(ie!==Vn)try{me?d.setAttributeNS(me,Q,ie):d.setAttribute(Q,ie),On(d)?we(d):ao(n.removed)}catch{rt(Q,d)}}Fe(E.afterSanitizeAttributes,d,null)},vf=function N(d){let _=null;const A=qa(d);for(Fe(E.beforeSanitizeShadowDOM,d,null);_=A.nextNode();)Fe(E.uponSanitizeShadowNode,_,null),Ka(_),Ga(_),_.content instanceof r&&N(_.content);Fe(E.afterSanitizeShadowDOM,d,null)};return n.sanitize=function(N){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,A=null,z=null,ae=null;if(An=!N,An&&(N="<!-->"),typeof N!="string"&&!za(N))if(typeof N.toString=="function"){if(N=N.toString(),typeof N!="string")throw ft("dirty is not a string, aborting")}else throw ft("toString is not a function");if(!n.isSupported)return N;if(Cn||In(d),n.removed=[],typeof N=="string"&&(St=!1),St){if(N.nodeName){const Re=te(N.nodeName);if(!O[Re]||Et[Re])throw ft("root node is forbidden and cannot be sanitized in-place")}}else if(N instanceof s)_=ja("<!---->"),A=_.ownerDocument.importNode(N,!0),A.nodeType===pt.element&&A.nodeName==="BODY"||A.nodeName==="HTML"?_=A:_.appendChild(A);else{if(!tt&&!et&&!Ge&&N.indexOf("<")===-1)return b&&zt?b.createHTML(N):N;if(_=ja(N),!_)return tt?null:zt?w:""}_&&wn&&we(_.firstChild);const Q=qa(St?N:_);for(;z=Q.nextNode();)Ka(z),Ga(z),z.content instanceof r&&vf(z.content);if(St)return N;if(tt){if(qt)for(ae=F.call(_.ownerDocument);_.firstChild;)ae.appendChild(_.firstChild);else ae=_;return(Z.shadowroot||Z.shadowrootmode)&&(ae=T.call(a,ae,!0)),ae}let me=Ge?_.outerHTML:_.innerHTML;return Ge&&O["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&se(uo,_.ownerDocument.doctype.name)&&(me="<!DOCTYPE "+_.ownerDocument.doctype.name+`>
2
- `+me),et&&Vt([V,R,U],Re=>{me=ut(me,Re," ")}),b&&zt?b.createHTML(me):me},n.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};In(N),Cn=!0},n.clearConfig=function(){it=null,Cn=!1},n.isValidAttribute=function(N,d,_){it||In({});const A=te(N),z=te(d);return Ha(A,z,_)},n.addHook=function(N,d){typeof d=="function"&&mt(E[N],d)},n.removeHook=function(N,d){if(d!==void 0){const _=ll(E[N],d);return _===-1?void 0:sl(E[N],_,1)[0]}return ao(E[N])},n.removeHooks=function(N){E[N]=[]},n.removeAllHooks=function(){E=ho()},n}var kl=po();function Ml(){this.__data__=new ke,this.size=0}function Al(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function Nl(e){return this.__data__.get(e)}function Il(e){return this.__data__.has(e)}var Ol=200;function Vl(e,n){var o=this.__data__;if(o instanceof ke){var a=o.__data__;if(!ct||a.length<Ol-1)return a.push([e,n]),this.size=++o.size,this;o=this.__data__=new Me(a)}return o.set(e,n),this.size=o.size,this}function Ze(e){var n=this.__data__=new ke(e);this.size=n.size}Ze.prototype.clear=Ml,Ze.prototype.delete=Al,Ze.prototype.get=Nl,Ze.prototype.has=Il,Ze.prototype.set=Vl;var Rt=function(){try{var e=je(Object,"defineProperty");return e({},"",{}),e}catch{}}();function go(e,n,o){n=="__proto__"&&Rt?Rt(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var Bl=Object.prototype,Fl=Bl.hasOwnProperty;function yo(e,n,o){var a=e[n];(!(Fl.call(e,n)&&Nt(a,o))||o===void 0&&!(n in e))&&go(e,n,o)}function Dt(e,n,o,a){var i=!o;o||(o={});for(var r=-1,l=n.length;++r<l;){var s=n[r],c=void 0;c===void 0&&(c=e[s]),i?go(o,s,c):yo(o,s,c)}return o}function Rl(e,n){return e&&Dt(n,Mt(n),e)}function Dl(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var Ll=Object.prototype,Ul=Ll.hasOwnProperty;function Pl(e){if(!fe(e))return Dl(e);var n=Xt(e),o=[];for(var a in e)a=="constructor"&&(n||!Ul.call(e,a))||o.push(a);return o}function Lt(e){return kt(e)?Hn(e,!0):Pl(e)}function $l(e,n){return e&&Dt(n,Lt(n),e)}var bo=typeof L=="object"&&L&&!L.nodeType&&L,_o=bo&&typeof module=="object"&&module&&!module.nodeType&&module,vl=_o&&_o.exports===bo,Eo=vl?ge.Buffer:void 0,So=Eo?Eo.allocUnsafe:void 0;function xl(e,n){if(n)return e.slice();var o=e.length,a=So?So(o):new e.constructor(o);return e.copy(a),a}function jl(e,n){var o=-1,a=e.length;for(n||(n=Array(a));++o<a;)n[o]=e[o];return n}function ql(e,n){for(var o=-1,a=e==null?0:e.length,i=0,r=[];++o<a;){var l=e[o];n(l,o,e)&&(r[i++]=l)}return r}function To(){return[]}var zl=Object.prototype,Kl=zl.propertyIsEnumerable,Co=Object.getOwnPropertySymbols,dn=Co?function(e){return e==null?[]:(e=Object(e),ql(Co(e),function(n){return Kl.call(e,n)}))}:To;function Hl(e,n){return Dt(e,dn(e),n)}function wo(e,n){for(var o=-1,a=n.length,i=e.length;++o<a;)e[i+o]=n[o];return e}var ko=Yn(Object.getPrototypeOf,Object),Yl=Object.getOwnPropertySymbols,Mo=Yl?function(e){for(var n=[];e;)wo(n,dn(e)),e=ko(e);return n}:To;function Gl(e,n){return Dt(e,Mo(e),n)}function Ao(e,n,o){var a=n(e);return Pe(e)?a:wo(a,o(e))}function Wl(e){return Ao(e,Mt,dn)}function Zl(e){return Ao(e,Lt,Mo)}var cn=je(ge,"DataView"),mn=je(ge,"Promise"),Xe=je(ge,"Set"),un=je(ge,"WeakMap"),No="[object Map]",Xl="[object Object]",Io="[object Promise]",Oo="[object Set]",Vo="[object WeakMap]",Bo="[object DataView]",Jl=xe(cn),Ql=xe(ct),es=xe(mn),ts=xe(Xe),ns=xe(un),Ne=Le;(cn&&Ne(new cn(new ArrayBuffer(1)))!=Bo||ct&&Ne(new ct)!=No||mn&&Ne(mn.resolve())!=Io||Xe&&Ne(new Xe)!=Oo||un&&Ne(new un)!=Vo)&&(Ne=function(e){var n=Le(e),o=n==Xl?e.constructor:void 0,a=o?xe(o):"";if(a)switch(a){case Jl:return Bo;case Ql:return No;case es:return Io;case ts:return Oo;case ns:return Vo}return n});var os=Object.prototype,as=os.hasOwnProperty;function is(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&as.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var Fo=ge.Uint8Array;function fn(e){var n=new e.constructor(e.byteLength);return new Fo(n).set(new Fo(e)),n}function rs(e,n){var o=n?fn(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var ls=/\w*$/;function ss(e){var n=new e.constructor(e.source,ls.exec(e));return n.lastIndex=e.lastIndex,n}var Ro=De?De.prototype:void 0,Do=Ro?Ro.valueOf:void 0;function ds(e){return Do?Object(Do.call(e)):{}}function cs(e,n){var o=n?fn(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var ms="[object Boolean]",us="[object Date]",fs="[object Map]",hs="[object Number]",ps="[object RegExp]",gs="[object Set]",ys="[object String]",bs="[object Symbol]",_s="[object ArrayBuffer]",Es="[object DataView]",Ss="[object Float32Array]",Ts="[object Float64Array]",Cs="[object Int8Array]",ws="[object Int16Array]",ks="[object Int32Array]",Ms="[object Uint8Array]",As="[object Uint8ClampedArray]",Ns="[object Uint16Array]",Is="[object Uint32Array]";function Os(e,n,o){var a=e.constructor;switch(n){case _s:return fn(e);case ms:case us:return new a(+e);case Es:return rs(e,o);case Ss:case Ts:case Cs:case ws:case ks:case Ms:case As:case Ns:case Is:return cs(e,o);case fs:return new a;case hs:case ys:return new a(e);case ps:return ss(e);case gs:return new a;case bs:return ds(e)}}var Lo=Object.create,Vs=function(){function e(){}return function(n){if(!fe(n))return{};if(Lo)return Lo(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function Bs(e){return typeof e.constructor=="function"&&!Xt(e)?Vs(ko(e)):{}}var Fs="[object Map]";function Rs(e){return Ue(e)&&Ne(e)==Fs}var Uo=We&&We.isMap,Ds=Uo?Wt(Uo):Rs,Ls="[object Set]";function Us(e){return Ue(e)&&Ne(e)==Ls}var Po=We&&We.isSet,Ps=Po?Wt(Po):Us,$s=1,vs=2,xs=4,$o="[object Arguments]",js="[object Array]",qs="[object Boolean]",zs="[object Date]",Ks="[object Error]",vo="[object Function]",Hs="[object GeneratorFunction]",Ys="[object Map]",Gs="[object Number]",xo="[object Object]",Ws="[object RegExp]",Zs="[object Set]",Xs="[object String]",Js="[object Symbol]",Qs="[object WeakMap]",ed="[object ArrayBuffer]",td="[object DataView]",nd="[object Float32Array]",od="[object Float64Array]",ad="[object Int8Array]",id="[object Int16Array]",rd="[object Int32Array]",ld="[object Uint8Array]",sd="[object Uint8ClampedArray]",dd="[object Uint16Array]",cd="[object Uint32Array]",j={};j[$o]=j[js]=j[ed]=j[td]=j[qs]=j[zs]=j[nd]=j[od]=j[ad]=j[id]=j[rd]=j[Ys]=j[Gs]=j[xo]=j[Ws]=j[Zs]=j[Xs]=j[Js]=j[ld]=j[sd]=j[dd]=j[cd]=!0,j[Ks]=j[vo]=j[Qs]=!1;function gt(e,n,o,a,i,r){var l,s=n&$s,c=n&vs,m=n&xs;if(l!==void 0)return l;if(!fe(e))return e;var p=Pe(e);if(p){if(l=is(e),!s)return jl(e,l)}else{var f=Ne(e),g=f==vo||f==Hs;if(xn(e))return xl(e,s);if(f==xo||f==$o||g&&!i){if(l=c||g?{}:Bs(e),!s)return c?Gl(e,$l(l,e)):Hl(e,Rl(l,e))}else{if(!j[f])return i?e:{};l=Os(e,f,s)}}r||(r=new Ze);var M=r.get(e);if(M)return M;r.set(e,l),Ps(e)?e.forEach(function(C){l.add(gt(C,n,o,C,e,r))}):Ds(e)&&e.forEach(function(C,k){l.set(k,gt(C,n,o,k,e,r))});var B=m?c?Zl:Wl:c?Lt:Mt,h=p?void 0:B(e);return Bn(h||e,function(C,k){h&&(k=C,C=e[k]),yo(l,k,gt(C,n,o,k,e,r))}),l}var md=1,ud=4;function Ie(e){return gt(e,md|ud)}const hn=(e,n="")=>typeof e.id<"u"?n+e.id+"":n+(e.inputName||e.label||e.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),jo=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var fd="[object String]";function Ke(e){return typeof e=="string"||!Pe(e)&&Ue(e)&&Le(e)==fd}const qo={methods:{getFieldRowClasses(e){const n=this.fieldErrors(e).length>0,o={[P(this.options,"validationErrorClass","error")]:n,[P(this.options,"validationSuccessClass","valid")]:!n,disabled:this.fieldDisabled(e),readonly:this.fieldReadonly(e),featured:this.fieldFeatured(e),required:this.fieldRequired(e)};return Array.isArray(e.styleClasses)?re(e.styleClasses,a=>o[a]=!0):Ke(e.styleClasses)&&(o[e.styleClasses]=!0),G(e.type)||(o["field-"+e.type]=!0),o},fieldErrors(e){return this.errors.filter(o=>o.field.fieldName===e.fieldName).map(o=>o.error)},fieldDisabled(e){return v(e.disabled)?e.disabled.call(this,this.model,e,this):G(e.disabled)?!1:e.disabled},fieldReadonly(e){return v(e.readonly)?e.readonly.call(this,this.model,e,this):G(e.readonly)?!1:e.readonly},fieldFeatured(e){return v(e.featured)?e.featured.call(this,this.model,e,this):G(e.featured)?!1:e.featured},fieldRequired(e){return v(e.required)?e.required.call(this,this.model,e,this):G(e.required)?!1:e.required}}};var pn=function(){return ge.Date.now()},hd=/\s/;function pd(e){for(var n=e.length;n--&&hd.test(e.charAt(n)););return n}var gd=/^\s+/;function yd(e){return e&&e.slice(0,pd(e)+1).replace(gd,"")}var zo=NaN,bd=/^[-+]0x[0-9a-f]+$/i,_d=/^0b[01]+$/i,Ed=/^0o[0-7]+$/i,Sd=parseInt;function gn(e){if(typeof e=="number")return e;if(At(e))return zo;if(fe(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=fe(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=yd(e);var o=_d.test(e);return o||Ed.test(e)?Sd(e.slice(2),o?2:8):bd.test(e)?zo:+e}var Td="Expected a function",Cd=Math.max,wd=Math.min;function Je(e,n,o){var a,i,r,l,s,c,m=0,p=!1,f=!1,g=!0;if(typeof e!="function")throw new TypeError(Td);n=gn(n)||0,fe(o)&&(p=!!o.leading,f="maxWait"in o,r=f?Cd(gn(o.maxWait)||0,n):r,g="trailing"in o?!!o.trailing:g);function M(S){var y=a,F=i;return a=i=void 0,m=S,l=e.apply(F,y),l}function B(S){return m=S,s=setTimeout(k,n),p?M(S):l}function h(S){var y=S-c,F=S-m,x=n-y;return f?wd(x,r-F):x}function C(S){var y=S-c,F=S-m;return c===void 0||y>=n||y<0||f&&F>=r}function k(){var S=pn();if(C(S))return I(S);s=setTimeout(k,h(S))}function I(S){return s=void 0,g&&a?M(S):(a=i=void 0,l)}function u(){s!==void 0&&clearTimeout(s),m=0,a=c=i=s=void 0}function b(){return s===void 0?l:I(pn())}function w(){var S=pn(),y=C(S);if(a=arguments,i=this,c=S,y){if(s===void 0)return B(c);if(f)return clearTimeout(s),s=setTimeout(k,n),M(c)}return s===void 0&&(s=setTimeout(k,n)),l}return w.cancel=u,w.flush=b,w}var kd="__lodash_hash_undefined__";function Md(e){return this.__data__.set(e,kd),this}function Ad(e){return this.__data__.has(e)}function Ut(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new Me;++n<o;)this.add(e[n])}Ut.prototype.add=Ut.prototype.push=Md,Ut.prototype.has=Ad;function Nd(e,n,o,a){for(var i=e.length,r=o+-1;++r<i;)if(n(e[r],r,e))return r;return-1}function Id(e){return e!==e}function Od(e,n,o){for(var a=o-1,i=e.length;++a<i;)if(e[a]===n)return a;return-1}function Vd(e,n,o){return n===n?Od(e,n,o):Nd(e,Id,o)}function Bd(e,n){var o=e==null?0:e.length;return!!o&&Vd(e,n,0)>-1}function Fd(e,n){return e.has(n)}function Rd(){}function Ko(e){var n=-1,o=Array(e.size);return e.forEach(function(a){o[++n]=a}),o}var Dd=1/0,Ld=Xe&&1/Ko(new Xe([,-0]))[1]==Dd?function(e){return new Xe(e)}:Rd,Ud=200;function Pd(e,n,o){var a=-1,i=Bd,r=e.length,l=!0,s=[],c=s;if(r>=Ud){var m=Ld(e);if(m)return Ko(m);l=!1,i=Fd,c=new Ut}else c=s;e:for(;++a<r;){var p=e[a],f=p;if(p=p!==0?p:0,l&&f===f){for(var g=c.length;g--;)if(c[g]===f)continue e;s.push(p)}else i(c,f,o)||(c!==s&&c.push(f),s.push(p))}return s}function Ho(e){return e&&e.length?Pd(e):[]}var $d=0;function Yo(e){var n=++$d;return Jn(e)+n}var Go=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,$e="\\d\\d?",ve="\\d\\d",vd="\\d{3}",xd="\\d{4}",yt="[^\\s]+",Wo=/\[([^]*?)\]/gm;function Zo(e,n){for(var o=[],a=0,i=e.length;a<i;a++)o.push(e[a].substr(0,n));return o}var Xo=function(e){return function(n,o){var a=o[e].map(function(r){return r.toLowerCase()}),i=a.indexOf(n.toLowerCase());return i>-1?i:null}};function He(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var a=0,i=n;a<i.length;a++){var r=i[a];for(var l in r)e[l]=r[l]}return e}var Jo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Qo=["January","February","March","April","May","June","July","August","September","October","November","December"],jd=Zo(Qo,3),qd=Zo(Jo,3),ea={dayNamesShort:qd,dayNames:Jo,monthNamesShort:jd,monthNames:Qo,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},Pt=He({},ea),zd=function(e){return Pt=He(Pt,e)},ta=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},ce=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},Kd={D:function(e){return String(e.getDate())},DD:function(e){return ce(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return ce(e.getDay())},ddd:function(e,n){return n.dayNamesShort[e.getDay()]},dddd:function(e,n){return n.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return ce(e.getMonth()+1)},MMM:function(e,n){return n.monthNamesShort[e.getMonth()]},MMMM:function(e,n){return n.monthNames[e.getMonth()]},YY:function(e){return ce(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return ce(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return ce(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return ce(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return ce(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return ce(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return ce(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return ce(e.getMilliseconds(),3)},a:function(e,n){return e.getHours()<12?n.amPm[0]:n.amPm[1]},A:function(e,n){return e.getHours()<12?n.amPm[0].toUpperCase():n.amPm[1].toUpperCase()},ZZ:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+ce(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+ce(Math.floor(Math.abs(n)/60),2)+":"+ce(Math.abs(n)%60,2)}},na=function(e){return+e-1},oa=[null,$e],aa=[null,yt],ia=["isPm",yt,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],ra=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var n=(e+"").match(/([+-]|\d\d)/gi);if(n){var o=+n[1]*60+parseInt(n[2],10);return n[0]==="+"?o:-o}return 0}],Hd={D:["day",$e],DD:["day",ve],Do:["day",$e+yt,function(e){return parseInt(e,10)}],M:["month",$e,na],MM:["month",ve,na],YY:["year",ve,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",$e,void 0,"isPm"],hh:["hour",ve,void 0,"isPm"],H:["hour",$e],HH:["hour",ve],m:["minute",$e],mm:["minute",ve],s:["second",$e],ss:["second",ve],YYYY:["year",xd],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",ve,function(e){return+e*10}],SSS:["millisecond",vd],d:oa,dd:oa,ddd:aa,dddd:aa,MMM:["month",yt,Xo("monthNamesShort")],MMMM:["month",yt,Xo("monthNames")],a:ia,A:ia,ZZ:ra,Z:ra},$t={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Yd=function(e){return He($t,e)},Gd=function(e,n,o){if(n===void 0&&(n=$t.default),o===void 0&&(o={}),typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");n=$t[n]||n;var a=[];n=n.replace(Wo,function(r,l){return a.push(l),"@@@"});var i=He(He({},Pt),o);return n=n.replace(Go,function(r){return Kd[r](e,i)}),n.replace(/@@@/g,function(){return a.shift()})};function Wd(e,n,o){if(o===void 0&&(o={}),typeof n!="string")throw new Error("Invalid format in fecha parse");if(n=$t[n]||n,e.length>1e3)return null;var a=new Date,i={year:a.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},r=[],l=[],s=n.replace(Wo,function(b,w){return l.push(ta(w)),"@@@"}),c={},m={};s=ta(s).replace(Go,function(b){var w=Hd[b],S=w[0],y=w[1],F=w[3];if(c[S])throw new Error("Invalid format. "+S+" specified twice in format");return c[S]=!0,F&&(m[F]=!0),r.push(w),"("+y+")"}),Object.keys(m).forEach(function(b){if(!c[b])throw new Error("Invalid format. "+b+" is required in specified format")}),s=s.replace(/@@@/g,function(){return l.shift()});var p=e.match(new RegExp(s,"i"));if(!p)return null;for(var f=He(He({},Pt),o),g=1;g<p.length;g++){var M=r[g-1],B=M[0],h=M[2],C=h?h(p[g],f):+p[g];if(C==null)return null;i[B]=C}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);var k;if(i.timezoneOffset==null){k=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond);for(var I=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],g=0,u=I.length;g<u;g++)if(c[I[g][0]]&&i[I[g][0]]!==k[I[g][1]]())return null}else if(k=new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond)),i.month>11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return k}var Qe={format:Gd,parse:Wd,defaultI18n:ea,setGlobalDateI18n:zd,setGlobalDateMasks:Yd};function Zd(e,n,o){switch(o.length){case 0:return e.call(n);case 1:return e.call(n,o[0]);case 2:return e.call(n,o[0],o[1]);case 3:return e.call(n,o[0],o[1],o[2])}return e.apply(n,o)}var la=Math.max;function Xd(e,n,o){return n=la(n===void 0?e.length-1:n,0),function(){for(var a=arguments,i=-1,r=la(a.length-n,0),l=Array(r);++i<r;)l[i]=a[n+i];i=-1;for(var s=Array(n+1);++i<n;)s[i]=a[i];return s[n]=o(l),Zd(e,this,s)}}function Jd(e){return function(){return e}}var Qd=Rt?function(e,n){return Rt(e,"toString",{configurable:!0,enumerable:!1,value:Jd(n),writable:!0})}:Jt,ec=800,tc=16,nc=Date.now;function oc(e){var n=0,o=0;return function(){var a=nc(),i=tc-(a-o);if(o=a,i>0){if(++n>=ec)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var ac=oc(Qd);function ic(e,n){return ac(Xd(e,n,Jt),e+"")}function rc(e,n,o){if(!fe(o))return!1;var a=typeof n;return(a=="number"?kt(o)&&jn(n,o.length):a=="string"&&n in o)?Nt(o[n],e):!1}var sa=Object.prototype,lc=sa.hasOwnProperty,sc=ic(function(e,n){e=Object(e);var o=-1,a=n.length,i=a>2?n[2]:void 0;for(i&&rc(n[0],n[1],i)&&(a=1);++o<a;)for(var r=n[o],l=Lt(r),s=-1,c=l.length;++s<c;){var m=l[s],p=e[m];(p===void 0||Nt(p,sa[m])&&!lc.call(e,m))&&(e[m]=r[m])}return e}),dc=ge.isFinite;function cc(e){return typeof e=="number"&&dc(e)}var da=1/0,mc=17976931348623157e292;function uc(e){if(!e)return e===0?e:0;if(e=gn(e),e===da||e===-da){var n=e<0?-1:1;return n*mc}return e===e?e:0}function fc(e){var n=uc(e),o=n%1;return n===n?o?n-o:n:0}function hc(e){return typeof e=="number"&&e==fc(e)}var pc="[object Number]";function vt(e){return typeof e=="number"||Ue(e)&&Le(e)==pc}const pe={general:{packageName:"forms",disable_global_radio:"The plugin is set to 'Scoped' by default when configured under a {scope}. To configure a global plugin, navigate to the global plugin list page.",disable_source_scope_change:"Changing the {scope} is not allowed when configuring a plugin under it."},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}},rla:{view_advanced_fields:"View Advanced Fields",window_type:{label:"Rate Limit Window Type",help:"Sets the time window type to either <code>sliding</code> (default) or <code>fixed</code>.<br><ul><li>Sliding windows apply the rate limiting logic while taking into account previous hit rates (from the window that immediately precedes the current) using a dynamic weight.</li><li>Fixed windows consist of buckets that are statically assigned to a definitive time range, each request is mapped to only one fixed window based on its timestamp and will affect only that window&#39;s counters.</li></ul>",options:{fixed:"Fixed",sliding:"Sliding"}},request_limits:{title:"Request Limits",subtitle:"Set one or more limits on the number of API requests allowed within a defined timeframe.",label:"Limit",label_index:"Limit {index}",request_number:"Request number",time_interval:"Time interval",interval_determiner:"Every",seconds:"Seconds"},start_with_a_use_case:"Start with a use case:",use_case_index:"Use case {index}",error_message:{label:"Error Message",code_placeholder:"Code Message",message_placeholder:"Error Message",help:"Set a custom error code and message to be returned when the rate limit is exceeded."},identifiers:{label:"Identifiers",options:{ip:"IP",credential:"Credential",consumer:"Consumer",service:"Service",header:"Header",path:"Path","consumer-group":"Consumer Group"}},redis:{title:"Configure your Redis",address_example:"e.g. localhost:6379"}},validators:{field_is_required:"This field is required",invalid_format:"Invalid format",number_too_small:"The number is too small. Minimum: {0}",number_too_large:"The number is too large. Maximum: {0}",invalid_number:"Invalid number",invalid_integer:"The value is not an integer",text_too_short:"The length of text is too short. Current: {0}, Minimum: {1}",text_too_long:"The length of text is too long. Current: {0}, Maximum: {1}",this_not_text:"This is not a text",this_not_array:"This is not an array",select_min_items:"Select minimum {0} items",select_max_items:"Select maximum {0} items",invalid_date:"Invalid date",date_is_early:"The date is too early. Current: {0}, Minimum: {1}",date_is_late:"The date is too late. Current: {0}, Maximum: {1}",invalid_email:"Invalid e-mail address",invalid_url:"Invalid URL",invalid_card:"Invalid card format",invalid_card_number:"Invalid card number",invalid_text_contain_number:"Invalid text - cannot contains numbers or special characters",invalid_tex_contain_spec:"Invalid text - cannot contains special characters"},redis:{title:"Redis Configuration",shared_configuration:{label:"Use shared configuration",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins.",title:"Shared Redis Configuration",error:"Fetching shared Redis configurations failed.",tooltip:"Only compatible {type} redis configurations will be listed here.",configuration_selector_label:"Select stored Redis configuration",configuration_selector_placeholder:"Pick Redis configuration",create_new_configuration:"New {type} shared configuration",empty_state:"No shared configurations",badge:"Recommended",selector:{title:"Select a Redis configuration",placeholder:"Filter Configurations",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins."}},dedicated_configuration:{label:"Use dedicated configuration",description:"Create a Redis configuration exclusively for this plugin, with settings that won’t impact other plugins.",title:"Connection Settings"},config_card:{common_fields:{created_at_label:"Created at",updated_at_label:"Last Updated at",type_label:"Redis Type"}},custom_plugin:{alert:"Note: For custom plugins, we cannot determine the correct Redis configuration type. Please ensure you select the appropriate option manually.",tooltip:"To apply a shared redis configuration, the redis fields must defined as Kong plugins in plugin schema."}},fields:{auto_suggest:{error:{load_entity:"There was an error loading {entity}"},recently_created:"Recently created {entity}",items_count:"Currently showing {count} {count, plural, =1 {item} other {items}}, type to search",no_results:"No results",loading:"Loading..."}},vfg:{labels:{on:"On",off:"Off"}}},{t:W}=ue.createI18n("en-us",pe),oe={fieldIsRequired:W("validators.field_is_required"),invalidFormat:W("validators.invalid_format"),numberTooSmall:W("validators.number_too_small"),numberTooBig:W("validators.number_too_large"),invalidNumber:W("validators.invalid_number"),invalidInteger:W("validators.invalid_integer"),textTooSmall:W("validators.text_too_short"),textTooBig:W("validators.text_too_long"),thisNotText:W("validators.this_not_text"),thisNotArray:W("validators.this_not_array"),selectMinItems:W("validators.select_min_items"),selectMaxItems:W("validators.select_max_items"),invalidDate:W("validators.invalid_date"),dateIsEarly:W("validators.date_is_early"),dateIsLate:W("validators.date_is_late"),invalidEmail:W("validators.invalid_email"),invalidURL:W("validators.invalid_url"),invalidCard:W("validators.invalid_card"),invalidCardNumber:W("validators.invalid_card_number"),invalidTextContainNumber:W("validators.invalid_text_contain_number"),invalidTextContainSpec:W("validators.invalid_tex_contain_spec")},K=(e,...n)=>{if(e&&n.length>0)for(let o=0;o<n.length;o++)e=e.replace("{"+(o-1)+"}",String(n[o]||""));return e},be=(e,n,o=oe)=>G(e)||e===""?n?[K(o.fieldIsRequired)]:[]:null,Ye={required:(e,n,o,a=oe)=>be(e,n.required,a)||[],number:(e,n,o,a=oe)=>{let i=be(e,n.required,a);return i!=null||(i=[],cc(e)?(!G(n.min)&&e<n.min,(a=oe)&&i.push(K(a.numberTooSmall,n.min)),!G(n.max)&&e>n.max,(a=oe)&&i.push(K(a.numberTooBig,n.max))):i.push(K(a.invalidNumber))),i},integer:(e,n,o,a=oe)=>{let i=be(e,n.required,a);return i!=null||(i=[],i.concat(Ye.number(e,n,o,a)),hc(e)||i.push(K(a.invalidInteger))),i},double:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(!vt(e)||isNaN(e)?[K(a.invalidNumber)]:[])},string:(e,n,o,a=oe)=>{let i=be(e,n.required,a);return i!=null||(i=[],Ke(e)?(!G(n.min)&&e.length<n.min&&i.push(K(a.textTooSmall,e.length,n.min)),!G(n.max)&&e.length>n.max&&i.push(K(a.textTooBig,e.length,n.max))):i.push(K(a.thisNotText))),i},array:(e,n,o,a=oe)=>{if(n.required){if(!Array.isArray(e))return[K(a.thisNotArray)];if(e.length===0)return[K(a.fieldIsRequired)]}if(!G(e)){if(!G(n.min)&&e.length<n.min)return[K(a.selectMinItems,n.min)];if(!G(n.max)&&e.length>n.max)return[K(a.selectMaxItems,n.max)]}return[]},date:(e,n,o,a=oe)=>{let i=be(e,n.required,a);if(i!=null)return i;i=[];const r=new Date(e);if(isNaN(r.getDate()))return[K(a.invalidDate)];if(!G(n.min)){const l=new Date(n.min);r.valueOf()<l.valueOf()&&i.push(K(a.dateIsEarly,Qe.format(r),Qe.format(l)))}if(!G(n.max)){const l=new Date(n.max);r.valueOf()>l.valueOf()&&i.push(K(a.dateIsLate,Qe.format(r),Qe.format(l)))}return i},regexp:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(!G(n.pattern)&&!new RegExp(n.pattern).test(e)?[K(a.invalidFormat)]:[])},email:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)?[]:[K(a.invalidEmail)])},url:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e)?[]:[K(a.invalidURL)])},creditCard:(e,n,o,a=oe)=>{const i=be(e,n.required,a);if(i!=null)return i;const r=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,l=e.replace(/[^0-9]+/g,"");if(!r.test(l))return[K(a.invalidCard)];let s=0,c,m,p;for(let f=l.length-1;f>=0;f--)c=l.substring(f,f+1),m=parseInt(c,10),p?(m*=2,m>=10?s+=m%10+1:s+=m):s+=m,p=!p;return s%10===0&&l?[]:[K(a.invalidCardNumber)]},alpha:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(/^[a-zA-Z]*$/.test(e)?[]:[K(a.invalidTextContainNumber)])},alphaNumeric:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(/^[a-zA-Z0-9]*$/.test(e)?[]:[K(a.invalidTextContainSpec)])}};Object.keys(Ye).forEach(e=>{const n=Ye[e];v(n)&&(n.locale=o=>(a,i,r)=>n(a,i,r,sc(o,oe)))});function ca(e){return Ke(e)?Ye[e]!=null?Ye[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function yn(e,n,o){let a=P(o.context,"schema.attributes",{});const i=n.value||"input";Ke(i)&&(a=P(a,i)||a),re(a,(r,l)=>{e.setAttribute(l,r)})}const Se={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:yn,updated:yn,componentUpdated:yn}},computed:{value:{cache:!1,get(){let e;return v(P(this.schema,"get"))?e=this.schema.get(this.model):e=P(this.model,this.schema.model),this.formatValueToField(e)},set(e){const n=this.value;e=this.formatValueToModel(e),v(e)?e(e,n):this.updateModelValue(e,n)}}},methods:{validate(e){this.clearValidationErrors();const n=P(this.formOptions,"validateAsync",!1);let o=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const i=[];Array.isArray(this.schema.validator)?re(this.schema.validator,r=>{i.push(ca(r).bind(this))}):i.push(ca(this.schema.validator).bind(this)),re(i,r=>{if(n)o.push(r(this.value,this.schema,this.model));else{const l=r(this.value,this.schema,this.model);l&&v(l.then)?l.then(s=>{s&&(this.errors=this.errors.concat(s));const c=this.errors.length===0;this.$emit("validated",c,this.errors,this)}):l&&(o=o.concat(l))}})}const a=i=>{let r=[];re(Ho(i),s=>{Array.isArray(s)&&s.length>0?r=r.concat(s):Ke(s)&&r.push(s)}),v(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,r,this.schema);const l=r.length===0;return e||this.$emit("validated",l,r,this),this.errors=r,r};return n?Promise.all(o).then(a):a(o)},debouncedValidate(){v(this.debouncedValidateFunc)||(this.debouncedValidateFunc=Je(this.validate.bind(this),P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;v(this.schema.set)?(this.schema.set(this.model,e),o=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,e),o=!0),o&&(this.$emit("modelUpdated",e,this.schema.model),v(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,e,n,this.schema),P(this.formOptions,"validateAfterChanged",!1)===!0&&(P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(e,n){let o=e.replace(/\[(\w+)\]/g,".$1");o=o.replace(/^\./,"");let a=this.model;const i=o.split(".");let r=0;const l=i.length;for(;r<l;){const s=i[r];if(r<l-1)a[s]!==void 0||(a[s]={}),a=a[s];else{a[s]=n;return}++r}},getFieldID(e,n=!1){const o=P(this.formOptions,"fieldIdPrefix","");return hn(e,o)+(n?"-"+Yo():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return P(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},gc=Object.freeze(Object.defineProperty({__proto__:null,default:Se},Symbol.toStringTag,{value:"Module"})),$=(e,n)=>{const o=e.__vccOpts||e;for(const[a,i]of n)o[a]=i;return o},yc={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},bc={class:"material-icons"},_c=$(Object.assign({mixins:[Se],expose:["validate","clearValidationErrors","schema"],emits:["model-updated"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldAdvanced",setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",yc,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:o[0]||(o[0]=(...a)=>n.handleOpen&&n.handleOpen(...a))},[t.createElementVNode("i",bc,t.toDisplayString(n.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),t.createElementVNode("span",null,t.toDisplayString(n.titleText),1)]),t.createElementVNode("div",{class:t.normalizeClass(["advanced-field-dropdown",n.openClass])},[t.createVNode(Y,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])],2)]))}}),[["__scopeId","data-v-9bb032dd"]]),Ec={class:"array-card-container"},ma=$(t.defineComponent({__name:"FieldArrayCardContainer",props:{model:{type:Object,default:()=>null},schema:{type:Object,default:()=>null},index:{type:Number,default:void 0}},emits:["remove-item"],setup(e){const n=e;return t.provide("vfg-array-item-index",n.index),(o,a)=>{const i=t.resolveComponent("KCard"),r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Ec,[t.createVNode(i,{class:"card"},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3}),t.createVNode(r,{appearance:"tertiary",class:"array-card-remove-button",onClick:a[0]||(a[0]=l=>o.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.TrashIcon))]),_:1})])}}}),[["__scopeId","data-v-97302224"]]),Sc={class:"array-item-wrapper"},Tc={class:"array-item"},Cc={class:"array-item-after"},ua=$(t.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Sc,[t.createElementVNode("div",Tc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.TrashIcon))]),_:1})]),t.createElementVNode("div",Cc,[t.renderSlot(n.$slots,"after",{},void 0,!0)])])}}}),[["__scopeId","data-v-51d79db2"]]),wc={class:"multi-item-wrapper"},fa=$(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",wc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>o[1]||(o[1]=[t.createTextVNode(" - Remove Field ")])),_:1}),o[2]||(o[2]=t.createElementVNode("hr",null,null,-1))])}}}),[["__scopeId","data-v-b4fcf731"]]),kc="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",bn=e=>e?e.length===36&&new RegExp(`^${kc}$`).test(e):!1,Mc=e=>({...e,label:e.name,value:e.id});function ha(e,n,o){return o?_e.SET_REFERRAL_VALUE:e&&!n||!e&&n?_e.UPDATE_ENTITY:e&&n?_e.CREATE_FROM_ENTITY:_e.CREATE_NOT_FROM_ENTITY}const _n=50,Ac={mixins:[Se],inject:[ne],emits:["model-updated"],setup(){const{t:e}=ue.createI18n("en-us",pe);return{t:e}},data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ha(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},scope(){return this.schema.label.toLowerCase()},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},async created(){await this.$nextTick();let e,n;switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[ne]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[ne].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}try{e&&(this.initialItems=[{...e,label:this.getSuggestionLabel(e),value:e.id}]),this.items=this.initialItems}catch(o){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",o)}},methods:{onQueryChange(e){e.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=Je(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],a=this.getInputFields(),i=new Set;bn(e)&&a.includes("id")?o.push((async()=>{const r=await this.fetchExact(e);n.push({...r,label:this.getSuggestionLabel(r),value:r.id})})()):o.push(...a.filter(r=>r!=="id").map(async r=>{(await this.fetchSuggestions(e,r)).forEach(s=>{i.has(s.id)||(i.add(s.id),n.push({...s,label:this.getSuggestionLabel(s),value:s.id}))})})),await Promise.all(o),this.items=n,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e){const n=[];let o=null;if(!this[ne])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<_n;){const a=await this[ne].getAll(this.entity,{size:_n,offset:o,...e});if(n.push(...a.data.data),o=a.data.offset,!o)break}return n.slice(0,_n)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[ne]?(await this[ne].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},getSuggestionLabel(e){const n=this.getInputFields();return n.length&&e?n.map(o=>e[o]).filter(Boolean).join(" - "):""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.idValue=e&&e.id,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},Nc=["data-testid","data-testlabel"],Ic=["data-testid"],Oc={class:"autosuggest__results_message"};function Vc(e,n,o,a,i,r){const l=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:a.t("general.disable_source_scope_change",{scope:r.scope})},{default:t.withCtx(()=>[t.createVNode(l,{id:e.schema.model,ref:"suggestion",modelValue:i.idValue,"onUpdate:modelValue":n[0]||(n[0]=s=>i.idValue=s),clearable:"",disabled:e.schema.disabled,"enable-filtering":"","filter-function":()=>!0,items:i.items,loading:i.loading,placeholder:e.schema.placeholder,width:"100%",onChange:r.onSelected,onQueryChange:r.onQueryChange},{"item-template":t.withCtx(({item:s})=>[t.createElementVNode("span",{class:"first-part","data-testid":s.id&&`${s.id}-0`,"data-testlabel":s.label},t.toDisplayString(r.getSuggestionLabel(s).split(" - ")[0]),9,Nc),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.getSuggestionLabel(s).split(" - ").slice(1),(c,m)=>(t.openBlock(),t.createElementBlock("span",{key:m,class:"field-span","data-testid":s.id&&`${s.id}-${m+1}`||m+1},t.toDisplayString(c),9,Ic))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",Oc,[t.createElementVNode("span",null,t.toDisplayString(i.message),1)])]),_:1},8,["id","modelValue","disabled","items","loading","placeholder","onChange","onQueryChange"])]),_:1},8,["text"])}const pa=$(Ac,[["render",Vc],["__scopeId","data-v-a4bb7b25"]]),Bc="#6c7489",Fc="12px",Rc="20px";var Dc=4;function ga(e){return gt(e,Dc)}const Lc=["data-testid","data-testlabel"],Uc={class:"item-label"},Pc={class:"autosuggest__results_message"},$c=$(t.defineComponent({__name:"AutoSuggest",props:t.mergeModels({placeholder:{default:""},suggestions:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyMessage:{default:""},domId:{}},{id:{required:!0},idModifiers:{}}),emits:t.mergeModels(["change","query-change"],["update:id"]),setup(e){const{t:n}=ue.createI18n("en-us",pe),o=t.useModel(e,"id");return(a,i)=>{const r=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(r,{id:a.domId,ref:"suggestion",modelValue:o.value,"onUpdate:modelValue":i[0]||(i[0]=l=>o.value=l),clearable:"",disabled:a.disabled,"enable-filtering":"","filter-function":()=>!0,items:a.suggestions,loading:a.loading,placeholder:a.placeholder,width:"100%",onChange:i[1]||(i[1]=l=>a.$emit("change",l)),onQueryChange:i[2]||(i[2]=l=>a.$emit("query-change",l))},t.createSlots({"item-template":t.withCtx(({item:l})=>[t.renderSlot(a.$slots,"item",{item:l},()=>[t.createElementVNode("span",{class:"item-label","data-testid":l.id&&`${l.id}-0`,"data-testlabel":l.label},t.toDisplayString(l.label),9,Lc)],!0)]),"selected-item-template":t.withCtx(({item:l})=>[t.renderSlot(a.$slots,"selected-item",{item:l},()=>[t.createElementVNode("span",Uc,t.toDisplayString(l.label),1)],!0)]),empty:t.withCtx(()=>[t.createElementVNode("div",Pc,[t.createElementVNode("span",null,t.toDisplayString(a.emptyMessage||t.unref(n)("fields.auto_suggest.no_results")),1)])]),_:2},[a.$slots.before?{name:"before",fn:t.withCtx(()=>[t.renderSlot(a.$slots,"before",{},void 0,!0)]),key:"0"}:void 0]),1032,["id","modelValue","disabled","items","loading","placeholder"])}}}),[["__scopeId","data-v-baeb3bb0"]]),vc=500,xc=50,jc=t.defineComponent({__name:"FieldScopedEntitySelect",props:{transformItem:{type:Function,default:Mc},allowUuidSearch:{type:Boolean,default:!1},placeholder:{},fields:{default:()=>[]},initialItem:{},initialItemSelected:{type:Boolean},domId:{},id:{},entity:{},disabled:{type:Boolean},fieldDisabled:{type:Boolean},getAll:{type:Function},getPartial:{type:Function},getOne:{type:Function}},emits:["change"],setup(e){const n=t.ref(""),o=t.ref(!1),a=t.ref(!1),i=t.ref(""),r=t.ref([]),l=t.ref([]),s=t.ref([]),{t:c}=ue.createI18n("en-us",pe),m=t.ref(null);let p=null;const f=async(u,b)=>{clearTimeout(p),p=setTimeout(()=>{o.value=!0},1500);try{const w=await u();l.value=w,r.value=l.value.map(e.transformItem)}catch(w){if(b!=null&&b.aborted)return;r.value=[],n.value=w.message}finally{clearTimeout(p),o.value=!1}},g=Je((u="")=>{if(i.value=u,!u.trim())return;m.value&&m.value.abort();const b=new AbortController;if(m.value=b,a.value){bn(u)&&e.allowUuidSearch?k(u):C(u);return}bn(u)&&e.allowUuidSearch?f(async()=>await h(u)):f(async()=>await M(u,b.signal),b.signal)},vc,{leading:!0}),M=async(u,b)=>await e.getAll(u,b),B=async()=>{const{data:{data:u,next:b,offset:w}}=await e.getPartial(xc);return(!b||!w)&&(a.value=!0),l.value=u,s.value=u.map(S=>({...e.transformItem(S),group:c("fields.auto_suggest.recently_created",{entity:e.entity})})),u},h=async u=>{const{data:b}=await e.getOne(u);return[b]},C=u=>{u.trim()||(r.value=l.value.map(e.transformItem)),r.value=l.value.filter(b=>e.fields.some(w=>(b[w]||"").includes(u))).map(e.transformItem)},k=u=>{r.value=l.value.filter(b=>b.id===u).map(e.transformItem)},I=t.computed(()=>{var w;const u=i.value.trim(),b=u?r.value:s.value;return e.initialItemSelected?b.some(S=>{var y;return S.value!==((y=e.initialItem)==null?void 0:y.value)})?b:(w=e.initialItem)!=null&&w.value.includes(u)?[e.initialItem,...b]:b:b});return t.onMounted(async()=>{await f(B)}),(u,b)=>(t.openBlock(),t.createBlock($c,{id:u.id,disabled:u.fieldDisabled,"dom-id":u.domId,"empty-message":n.value,loading:o.value,placeholder:u.placeholder,readonly:u.disabled,suggestions:I.value,onChange:b[0]||(b[0]=w=>u.$emit("change",w)),onQueryChange:t.unref(g)},t.createSlots({"selected-item":t.withCtx(({item:w})=>[t.renderSlot(u.$slots,"selected-item",{item:w})]),item:t.withCtx(({item:w})=>[t.renderSlot(u.$slots,"item",{item:w})]),_:2},[u.$slots.before?{name:"before",fn:t.withCtx(()=>[t.renderSlot(u.$slots,"before")]),key:"0"}:void 0]),1032,["id","disabled","dom-id","empty-message","loading","placeholder","readonly","suggestions","onQueryChange"]))}}),qc=1e3,zc={components:{FieldScopedEntitySelect:jc,SearchIcon:Ce.SearchIcon},mixins:[Se],inject:[ne],emits:["model-updated"],setup(){const{t:e}=ue.createI18n("en-us",pe);return{t:e,KUI_ICON_SIZE_40:Rc,KUI_COLOR_TEXT_NEUTRAL:Bc}},data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItem:null,loading:!1,dataDrained:!1}},computed:{fieldState(){return ha(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},scope(){return this.schema.label.toLowerCase()},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search},inputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},allowUuidSearch(){return this.inputFields.includes("id")},inputFieldsWithoutId(){return this.inputFields.filter(e=>e!=="id")},initialValueSelected(){var e;return this.idValue===((e=this.initialItem)==null?void 0:e.id)}},async created(){await this.$nextTick();let e,n;try{switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[ne]){console.warn("[@kong-ui-public/forms] No API service provided");break}this.loading=!0,n=(await this[ne].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}e&&(this.initialItem=this.transformItem(e)),this.loading=!1}catch(o){this.message=this.t("fields.auto_suggest.error.load_entity",{entity:this.schema.entity}),console.error("err!",o)}},methods:{getPartial(e){return this[ne].peek(this.entity,e)},async getAll(e,n){const o=[],a=[],i=new Set;return a.push(...this.inputFieldsWithoutId.map(async r=>{const l=await this.fetchSuggestions(e,r,n);o.push(...this.dedupeSuggestions(l,i))})),await Promise.all(a),o},async getOne(e){return this[ne]?(await this[ne].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},transformItem(e){return{...e,label:this.getSuggestionLabel(e),value:e.id}},dedupeSuggestions(e,n){const o=[];return e.forEach(a=>{n.has(a.id)||(n.add(a.id),o.push(a))}),o},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e,n){if(!this[ne])return console.warn("[@kong-ui-public/forms] No API service provided"),[];const o=this.entity==="consumer_group"?this[ne].getAll:this[ne].getAllV2,{data:a}=await o(this.entity,{size:qc,...e},n);return a.data},async fetchSuggestions(e,n,o){return this.fetchUntilLimit({[n]:e},o)},getSuggestionLabel(e){var o;const n=((o=this.schema)==null?void 0:o.labelField)||"id";return n&&e?e[n]:""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.idValue=e&&e.id,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},Kc={class:"entity-suggestion-item"},Hc={class:"entity-label"},Yc={class:"entity-id"},Gc={class:"selected-entity-item"},Wc={class:"selected-entity-label"};function Zc(e,n,o,a,i,r){const l=t.resolveComponent("SearchIcon"),s=t.resolveComponent("FieldScopedEntitySelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:a.t("general.disable_source_scope_change",{scope:r.scope})},{default:t.withCtx(()=>[t.createVNode(s,{id:i.idValue,"allow-uuid-search":r.allowUuidSearch,disabled:i.loading,"dom-id":e.schema.model,entity:r.entity,"field-disabled":e.schema.disabled,fields:r.inputFieldsWithoutId,"get-all":r.getAll,"get-one":r.getOne,"get-partial":r.getPartial,"initial-item":i.initialItem,"initial-item-selected":r.initialValueSelected,placeholder:i.loading?a.t("fields.auto_suggest.loading"):e.schema.placeholder,"transform-item":r.transformItem,onChange:r.onSelected},{before:t.withCtx(()=>[t.createVNode(l,{color:a.KUI_COLOR_TEXT_NEUTRAL,size:a.KUI_ICON_SIZE_40},null,8,["color","size"])]),item:t.withCtx(({item:c})=>[t.createElementVNode("div",Kc,[t.createElementVNode("span",Hc,t.toDisplayString(c.label||"–"),1),t.createElementVNode("span",Yc,t.toDisplayString(c.id),1)])]),"selected-item":t.withCtx(({item:c})=>[t.createElementVNode("span",Gc,[t.createElementVNode("span",Wc,t.toDisplayString(c.label||"–"),1)])]),_:1},8,["id","allow-uuid-search","disabled","dom-id","entity","field-disabled","fields","get-all","get-one","get-partial","initial-item","initial-item-selected","placeholder","transform-item","onChange"])]),_:1},8,["text"])}const ya=$(zc,[["render",Zc],["__scopeId","data-v-774c16ea"]]);function Xc(e){const n=t.ref([]),o=t.ref(null),a=h=>Ke(h)?Ye[h]!=null?Ye[h]:(console.warn(`'${h}' is not a validator function!`),null):h,i=t.computed({get(){var C,k;let h;return v(P(e.schema,"get"))?h=e.schema.get((C=e.model)==null?void 0:C.value):h=P((k=e.model)==null?void 0:k.value,e.schema.model),M(h)},set(h){const C=i;h=B(h),v(h)?h(h,C):s(h,C)}}),r=h=>{var u;c();const C=P(e.formOptions,"validateAsync",!1);let k=[];if(e.schema.readonly!==!0&&e.disabled!==!0){const b=[],w=(u=e.schema)==null?void 0:u.validator;w&&(Array.isArray(w)?re(w,S=>{b.push(a(S))}):b.push(a(w))),v(e.externalValidator)&&b.push(e.externalValidator),re(b,S=>{var y,F;if(C)k.push(S(i.value,e.schema,(y=e.model)==null?void 0:y.value));else{const x=S(i.value,e.schema,(F=e.model)==null?void 0:F.value);x&&v(x.then)?x.then(T=>{T&&(n.value=n.value.concat(T));const E=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:E,errors:n.value,field:e.schema})}):x&&(k=k.concat(x))}})}const I=b=>{var S,y;let w=[];if(re(Ho(b),F=>{Array.isArray(F)&&F.length>0?w=w.concat(F):Ke(F)&&w.push(F)}),v((S=e.schema)==null?void 0:S.onValidated)&&e.schema.onValidated((y=e.model)==null?void 0:y.value,w,e.schema),!h){const F=w.length===0;e.emitValidated&&e.emitValidated({isValid:F,errors:w,field:e.schema})}return b=w,w};return C?Promise.all(k).then(I):I(k)},l=()=>{v(o.value)?o.value():o.value=Je(r,P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",500)))},s=(h,C)=>{var I,u,b;let k=!1;v(e.schema.set)?(e.schema.set((I=e.model)==null?void 0:I.value,h),k=!0):e.schema.model&&(m(e.schema.model,h),k=!0),k&&(e.emitModelUpdated&&((u=e.model)!=null&&u.value)&&e.emitModelUpdated({value:h,model:e.schema.model}),v(e.schema.onChanged)&&e.schema.onChanged((b=e.model)==null?void 0:b.value,h,C,e.schema),P(e.formOptions,"validateAfterChanged",!1)===!0&&(P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",0))>0?l():r()))},c=()=>{n.value.splice(0)},m=(h,C)=>{var S;let k=h.replace(/\[(\w+)\]/g,".$1");k=k.replace(/^\./,"");let I=((S=e.model)==null?void 0:S.value)||{},u=0;const b=k.split("."),w=b.length;for(;u<w;){const y=b[u];if(u<w-1)I[y]!==void 0||(I[y]={}),I=I[y];else{I[y]=C;return}++u}},p=(h,C=!1)=>{const k=P(e.formOptions,"fieldIdPrefix","");return hn(h,k)+(C?"-"+Yo():"")},f=h=>`${p(h)}-label`,g=()=>P(e.schema,"fieldClasses",[]),M=h=>e.formatValueToField&&typeof e.formatValueToField=="function"?e.formatValueToField(h):h,B=h=>e.formatValueToModel&&typeof e.formatValueToModel=="function"?e.formatValueToModel(h):h;return{value:i,clearValidationErrors:c,getFieldID:p,getLabelId:f,getFieldClasses:g,updateModelValue:s}}function Jc(e){const n=[],o=a=>{const i=["cluster-cache","cluster_cache"];for(const r of i)if(a.model.includes(r))return!1;return new RegExp("(?<=-redis-).*").test(a.model)};return e.fields.forEach(a=>{o(a)&&n.push(a)}),{redis:{id:"_redis",fields:n,model:"__redis_partial",redisType:e._supported_redis_partial_type,redisPath:e._redis_partial_path},redisModels:n.map(a=>a.model)}}function Qc(e,n){const o=new RegExp("(?<=config-redis-).*"),a=/Config\.Redis.*/;return n.filter(r=>{const l=r.model.match(o);return l&&!Object.keys(e).includes(l[0])}).map(r=>{const l=r.label.match(a);return{label:l?l[0]:r.label,key:r.model,value:"N/A",type:"text"}})}const Te={useAbstractFields:Xc,useRedisPartial:Jc,useRedisNonStandardFields:Qc},em={class:"form-field-wrapper"},ba=$(t.defineComponent({__name:"FieldInput",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),l=t.inject(he,void 0),{updateModelValue:s,getFieldID:c,clearValidationErrors:m,value:p}=Te.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:u=>{i("modelUpdated",u.value,u.model)}});n({clearValidationErrors:m});const f=t.computed(()=>{var b;const u=(b=a.schema)==null?void 0:b.inputType.toLowerCase();switch(u){case"string":return"text";case"datetime":return"datetime-local";default:return u||"text"}}),g={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},M=(u,b)=>{var F,x;let w=u;const S=g[f.value]||"",y=Qe.parse(u,S);y&&((F=a.schema)!=null&&F.format?w=Qe.format(y,(x=a.schema)==null?void 0:x.format):w=y.valueOf()),s(w,b)},B=(u,b)=>{vt(u)||(u=NaN),s(u,b)},h=u=>{let b=u;switch(f.value){case"number":case"range":vt(parseFloat(u))&&(b=parseFloat(u));break}p.value=b,s(b,u)},C=u=>{p.value=u,s(u,u)},k=t.ref(null),I=()=>{var u;v(k.value)&&((u=k.value)==null||u.flush())};return t.onMounted(()=>{switch(f.value){case"number":case"range":k.value=Je((u,b)=>{B(u,b)},parseInt(P(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":k.value=Je((u,b)=>{M(u,b)},parseInt(P(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{f.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):f.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):f.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(u,b)=>{const w=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",em,[t.createVNode(w,t.mergeProps(u.$attrs,{id:t.unref(c)(e.schema),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:f.value==="color"||f.value==="range"?t.unref(p):void 0,max:e.schema.max,maxlength:e.schema.maxlength,min:e.schema.min,minlength:e.schema.minlength,"model-value":t.unref(p),name:e.schema.inputName,pattern:e.schema.pattern,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,"show-password-mask-toggle":f.value==="password",type:f.value,width:e.schema.width,onBlur:I,"onUpdate:modelValue":h}),null,16,["id","autocomplete","class","disabled","help","max","maxlength","min","minlength","model-value","name","pattern","placeholder","readonly","required","show-password-mask-toggle","type","width"]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(l)),{schema:e.schema,update:C,value:t.unref(p)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-fe1132bb"]]),tm={name:"FieldMetric",components:{AddIcon:Ce.AddIcon,TrashIcon:Ce.TrashIcon},mixins:[Se],emits:["remove-item"],data(){return{contentVisible:!1}}},nm={key:0,class:"content"};function om(e,n,o,a,i,r){const l=t.resolveComponent("AddIcon"),s=t.resolveComponent("TrashIcon"),c=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field-dropdown",{active:i.contentVisible}])},[t.createElementVNode("div",{class:"title",onClick:n[0]||(n[0]=m=>i.contentVisible=!i.contentVisible)},[t.createTextVNode(t.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),t.createVNode(l,{class:"metric-add-icon"})]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[i.contentVisible?(t.openBlock(),t.createElementBlock("div",nm,[t.renderSlot(e.$slots,"default"),t.createVNode(c,{appearance:"tertiary",class:"metric-remove-button",onClick:n[1]||(n[1]=m=>e.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(s)]),_:1})])):t.createCommentVNode("",!0)]),_:3})],2)}const _a=$(tm,[["render",om]]),am={class:"field-object-container"},im={key:1},rm=["id"],lm={key:0},sm=["onUpdate:modelValue"],dm={key:1},cm=["onUpdate:modelValue"],mm={key:2},um=["onUpdate:modelValue"],fm=["onClick"],Ea=$(Object.assign({mixins:[Se],expose:["validate","clearValidationErrors","schema"],emits:["modelUpdated"],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const e=Object.keys(this.value),n={};for(let o=0;o<e.length;o++){const a=e[o];n[a]=typeof this.value[a]}this.keyTypes=n},methods:{removeElement(e){const n=this.value;delete n[e],this.value=JSON.parse(JSON.stringify(n));const o=this.keyTypes;delete o[e],this.keyTypes=JSON.parse(JSON.stringify(o))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""},updateModel(e,n){this.$emit("modelUpdated",e,n)}}},{__name:"FieldObject",setup(e){return(n,o)=>{const a=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",am,[n.schema.schema?(t.openBlock(),t.createBlock(Y,{key:0,model:n.value,options:n.formOptions,schema:n.schema.schema,onModelUpdated:n.updateModel},null,8,["model","options","schema","onModelUpdated"])):(t.openBlock(),t.createElementBlock("div",im,[t.createElementVNode("table",{id:n.getFieldID(n.schema),class:t.normalizeClass(n.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(i,r)=>(t.openBlock(),t.createElementBlock("tr",{key:r},[t.createElementVNode("td",null,t.toDisplayString(r),1),n.keyTypes[r]==="string"?(t.openBlock(),t.createElementBlock("td",lm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":l=>n.value[r]=l,type:"text"},null,8,sm),[[t.vModelText,n.value[r]]])])):t.createCommentVNode("",!0),n.keyTypes[r]==="boolean"?(t.openBlock(),t.createElementBlock("td",dm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":l=>n.value[r]=l,type:"checkbox"},null,8,cm),[[t.vModelCheckbox,n.value[r]]])])):t.createCommentVNode("",!0),n.keyTypes[r]==="number"?(t.openBlock(),t.createElementBlock("td",mm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":l=>n.value[r]=l,type:"number"},null,8,um),[[t.vModelText,n.value[r]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:l=>n.removeElement(r)},null,8,fm)])]))),128))],10,rm),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":o[0]||(o[0]=i=>n.newKeyType=i)},o[3]||(o[3]=[t.createElementVNode("option",{value:"string"}," String ",-1),t.createElementVNode("option",{value:"number"}," Number ",-1),t.createElementVNode("option",{value:"boolean"}," Boolean ",-1)]),512),[[t.vModelSelect,n.newKeyType]]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[1]||(o[1]=i=>n.newKeyName=i),type:"text"},null,512),[[t.vModelText,n.newKeyName]]),t.createElementVNode("input",{type:"button",value:"Add key",onClick:o[2]||(o[2]=(...i)=>n.addKey&&n.addKey(...i))})]))])),[[a,n.attributes]])}}}),[["__scopeId","data-v-4ace4106"]]),hm=["id"],pm=["data-testid"],gm={class:"item-wrapper"},ym={class:"index-wrapper"},bm={key:0},_m={key:1},Em=["onUpdate:modelValue","placeholder","type","onInput"],Sm={key:0,class:"hint"},Tm={class:"input-item"},Cm=["placeholder"],wm={key:0,class:"hint"},Sa=$(Object.assign({mixins:[Se],expose:["validate","clearValidationErrors","schema"],inject:{autofillSlot:{from:he,default:void 0}},emits:["model-updated"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(e,n)=>({[this.schema.model]:e[n]}),set:(e,n,o)=>e[n]=o[this.schema.model]}):this.model[this.schema.model]},valueInputType(){var e;return["number","integer"].includes((e=this.schema.values)==null?void 0:e.type)?"number":"text"}},mounted(){this.value||(this.value={});let e=[];this.subSchema?e=this.subSchema.fields:this.subFields&&(e=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,e,this.schema.model)},methods:{removeElement(e){const n=this.value;delete n[e],this.value={...n}},transformMapModelValuesToObject(e,n,o){let a={};try{a=JSON.parse(JSON.stringify(e??{}))[o]??{}}catch{}return Object.keys(e).map(i=>{const r=i.indexOf(o+"-");if(r>-1&&Array.isArray(n))if(n.length>0){const s=i.split("-").filter(m=>n.find(p=>p.model===m)),c=i.split(`-${s}`)[0].split(`${o}-`)[1];s.length?a[c]={...a[c],[s]:e[i]}:a[i.substring(r+`${o}-`.length)]=e[i]}else a[i.substring(`${o}-`.length)]=e[i];else{const s=i.split("-").filter(m=>m===this.schema.model),c=i.split(`-${s}`)[0].split(`${o}-`)[1];c&&(a[c]=e[i])}return i}),a},addKey(){var a;const e=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",n=((a=this.schema.values)==null?void 0:a.default)??(this.valueInputType==="number"?0:""),o=this.subSchema?e?[""]:{}:n;this.value[this.newKeyName]=o,this.newKeyName=""},updateModel(e,n){this.$emit("model-updated",this.model[this.schema.model],n)}}},{__name:"FieldObjectAdvanced",setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{id:n.getFieldID(n.schema),class:t.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,"data-testid":`field-object-key-${r}`},[t.createElementVNode("div",null,[t.createElementVNode("div",gm,[t.createElementVNode("div",ym,[t.createElementVNode("strong",null,t.toDisplayString(r),1),t.createElementVNode("div",null,[t.createVNode(a,{appearance:"tertiary",class:"delete",icon:"",type:"button",onClick:l=>n.removeElement(r)},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.TrashIcon))]),_:2},1032,["onClick"])])]),o[1]||(o[1]=t.createElementVNode("hr",{class:"divider"},null,-1)),n.subSchema?(t.openBlock(),t.createElementBlock("div",bm,[t.createVNode(Y,{model:n.transformedModel[r],options:{helpAsHtml:!0},schema:n.subSchema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",_m,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":l=>n.value[r]=l,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:n.valueInputType,onInput:l=>n.updateModel(n.value[r],n.model[n.schema.model])},null,40,Em),[[t.vModelDynamic,n.value[r]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",Sm,t.toDisplayString(n.schema.fields[0].schema.hint),1)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.autofillSlot),{schema:n.schema.fields&&n.schema.fields[0].schema||n.schema.values,update:l=>n.value[r]=l,value:n.value[r]},null,8,["schema","update","value"]))])),o[2]||(o[2]=t.createElementVNode("hr",{class:"wide-divider"},null,-1))])])],8,pm))),128)),t.createElementVNode("div",{class:t.normalizeClass(["input-wrapper",{indent:n.hasObjectKeys}])},[t.createElementVNode("div",Tm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>n.newKeyName=i),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Cm),[[t.vModelText,n.newKeyName]]),t.createVNode(a,{appearance:"tertiary","data-testid":"add-key",disabled:!n.newKeyName,onClick:n.addKey},{default:t.withCtx(()=>[t.createTextVNode(" + Add "+t.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(t.openBlock(),t.createElementBlock("p",wm,t.toDisplayString(n.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,hm)}}}),[["__scopeId","data-v-502ed880"]]),km={class:"radio-selection-group"},Ta=$(t.defineComponent({__name:"FieldRadio",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),{updateModelValue:l,value:s,clearValidationErrors:c}=Te.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:p=>{i("modelUpdated",p.value,p.model)}});n({clearValidationErrors:c});const m=p=>{let f=p;typeof p=="string"&&(f=p.split(","),a.schema.array||(f=f.toString())),l(f,p)};return(p,f)=>{const g=t.resolveComponent("KRadio");return t.openBlock(),t.createElementBlock("div",km,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.values,(M,B)=>(t.openBlock(),t.createBlock(g,{id:e.schema.name+"-"+B,key:M.value,modelValue:t.unref(s),"onUpdate:modelValue":f[0]||(f[0]=h=>t.isRef(s)?s.value=h:null),label:M.name,"label-attributes":{info:e.schema.help},name:e.schema.name,required:e.schema.required||void 0,"selected-value":M.value,onChange:m},null,8,["id","modelValue","label","label-attributes","name","required","selected-value"]))),128))])}}}),[["__scopeId","data-v-09b8afda"]]),Ca=t.defineComponent({__name:"FieldSelect",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.computed(()=>a.schema.selectOptions||{}),l=h=>G(h)?null:h,s=t.toRefs(a),{getFieldID:c,clearValidationErrors:m,value:p}=Te.useAbstractFields({model:s.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:l,emitModelUpdated:h=>{i("modelUpdated",h.value,h.model)}});n({clearValidationErrors:m});const f=t.computed(()=>{const h=a.schema.values;return g(typeof h=="function"?h.apply(this,[a.model,a.schema]):h)}),g=h=>{const C=[];return h.forEach(k=>{C.push({label:B(k),value:M(k),disabled:typeof k=="object"&&k.disabled||void 0,group:typeof k=="object"&&String(k.group||"").toUpperCase()||void 0})}),C},M=h=>{if(fe(h)){if(r.value&&typeof r.value.value<"u")return h[r.value.value];if(typeof h.id<"u")return String(h.id);throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return h},B=h=>{if(fe(h)){if(r.value&&typeof r.value.name<"u")return h[r.value.name];if(typeof h.name<"u")return String(h.name);throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return String(h)};return(h,C)=>{const k=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(k,{id:t.unref(c)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":C[0]||(C[0]=I=>t.isRef(p)?p.value=I:null),class:t.normalizeClass(e.schema.fieldClasses),clearable:!e.schema.required,disabled:e.disabled||void 0,items:f.value,"kpop-attributes":{"data-testid":`${t.unref(c)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:r.value.hideNoneSelectedText?void 0:r.value.noneSelectedText||"Nothing Selected",required:e.schema.required||void 0,width:"100%"},null,8,["id","modelValue","class","clearable","disabled","items","kpop-attributes","label-attributes","name","placeholder","required"])}}}),Mm={name:"FieldArray",components:{FieldArrayItem:ua,FieldArrayMultiItem:fa,FieldSelect:Ca,FieldMetric:_a,FieldObject:Ea,FieldObjectAdvanced:Sa,FieldAutoSuggest:pa,FieldAutoSuggestV2:ya,FieldRadio:Ta,FieldArrayCardContainer:ma,FieldInput:ba},mixins:[Se],inject:{autofillSlot:{from:he,default:void 0}},props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},emits:["refreshModel"],methods:{generateSchema(e,n,o){var i,r,l;let a;return n&&(a=JSON.parse(JSON.stringify(n)),(l=(r=(i=a.schema)==null?void 0:i.fields)==null?void 0:r.map)==null||l.call(r,s=>(s.id=`${s.id||s.model}-${o}`,s))),{...a,set(s,c){e[o]=c},get(){return e[o]}}},newElement(){let e=this.value,n;(!e||!e.push)&&(e=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?n=this.schema.items.default():n=this.schema.items.default),e.push(n),this.value=[...e]},removeElement(e){this.value=this.value.filter((n,o)=>o!==e)},getFieldComponent(e){return e.component?e.component:"field-"+e.type},modelUpdated(){this.$emit("refreshModel")},handleInput(e,n){var a,i;let o=e;((i=(a=this.schema)==null?void 0:a.inputAttributes)==null?void 0:i.type)==="number"&&vt(parseFloat(e))&&(o=parseFloat(e)),this.value=this.value.map((r,l)=>l===n?o:r)}}},Am=["id"],Nm={key:1},Im=["onUpdate:modelValue","aria-labelledby","type"],Om=["onUpdate:modelValue","aria-labelledby"];function Vm(e,n,o,a,i,r){const l=t.resolveComponent("KTextArea"),s=t.resolveComponent("KInput"),c=t.resolveComponent("KButton");return e.schema?(t.openBlock(),t.createElementBlock("div",{key:0,id:e.getFieldID(e.schema),class:t.normalizeClass(e.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(m,p)=>(t.openBlock(),t.createElementBlock("div",{key:p,class:t.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,index:p,model:m,schema:r.generateSchema(e.value,e.schema.items,p),onRemoveItem:f=>r.removeElement(p)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:m,schema:r.generateSchema(e.value,e.schema.items,p),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["index","model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",Nm,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:m,schema:r.generateSchema(e.value,e.schema.items,p),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:2,"data-testid":`${e.getFieldID(e.schema)}-item-${p}`,model:m,schema:r.generateSchema(e.value,e.schema.items,p),onRemoveItem:f=>r.removeElement(p)},{after:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:f=>e.value[p]=f,value:e.value[p]},null,8,["schema","update","value"]))]),default:t.withCtx(()=>{var f;return[e.schema.inputAttributes&&e.schema.inputAttributes.type==="textarea"?(t.openBlock(),t.createBlock(l,t.mergeProps({key:0,ref_for:!0},e.schema.inputAttributes,{id:e.getFieldID(e.schema),modelValue:e.value[p],"onUpdate:modelValue":g=>e.value[p]=g,"aria-labelledby":e.getLabelId(e.schema),autosize:"","character-limit":e.schema.inputAttributes.max,class:e.schema.fieldClasses,maxlength:e.schema.max,minlength:e.schema.min,name:e.schema.inputName,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,resizable:"",rows:e.schema.rows||3}),null,16,["id","modelValue","onUpdate:modelValue","aria-labelledby","character-limit","class","maxlength","minlength","name","placeholder","readonly","required","rows"])):!e.schema.inputAttributes||!e.schema.inputAttributes.type||e.schema.inputAttributes.type==="text"||e.schema.inputAttributes.type==="number"?(t.openBlock(),t.createBlock(s,t.mergeProps({key:1,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{"model-value":e.value[p],type:e.schema.inputAttributes&&e.schema.inputAttributes.type||"text",onInput:g=>{r.handleInput(g,p)}}),null,16,["aria-labelledby","model-value","type","onInput"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,"onUpdate:modelValue":g=>e.value[p]=g,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:((f=e.schema.inputAttributes)==null?void 0:f.type)||"text"}),null,16,Im)),[[t.vModelDynamic,e.value[p]]])]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.withDirectives(t.createElementVNode("input",t.mergeProps({ref_for:!0},e.schema.inputAttributes,{"onUpdate:modelValue":f=>e.value[p]=f,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,Om),[[t.vModelText,e.value[p]]]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:f=>e.value[p]=f,value:e.value[p]},null,8,["schema","update","value"]))],64))],2))),128)),t.createVNode(c,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:r.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Am)):t.createCommentVNode("",!0)}const Bm=$(Mm,[["render",Vm],["__scopeId","data-v-ae802bb2"]]),Fm={class:"form-field-wrapper field-checkbox"},Rm=$(t.defineComponent({__name:"FieldCheckbox",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),{getFieldID:l,value:s,clearValidationErrors:c}=Te.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:m=>{i("modelUpdated",m.value,m.model)}});return n({clearValidationErrors:c}),(m,p)=>{const f=t.resolveComponent("KCheckbox");return t.openBlock(),t.createElementBlock("div",Fm,[t.createVNode(f,t.mergeProps(m.$attrs,{id:t.unref(l)(e.schema),modelValue:t.unref(s),"onUpdate:modelValue":p[0]||(p[0]=g=>t.isRef(s)?s.value=g:null),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:void 0,name:e.schema.inputName,readonly:e.schema.readonly,required:e.schema.required,width:e.schema.width}),null,16,["id","modelValue","autocomplete","class","disabled","help","name","readonly","required","width"])])}}}),[["__scopeId","data-v-6b4ee1cd"]]),Dm={class:"wrapper"},Lm=["disabled"],Um=["id","checked","disabled","onChange","name"],Pm=["disabled"],$m={class:"info"},vm={class:"dropList"},xm=["id","checked","disabled","onChange","name"];function jm(e,n,o,a,i,r){const l=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",Dm,[e.schema.listBox?(t.openBlock(),t.createElementBlock("div",{key:0,class:"listbox form-control",disabled:e.disabled||null},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.items,s=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(s)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(s)||null,disabled:e.disabled||null,onChange:c=>r.onChanged(c,s),name:r.getInputName(s)},null,40,Um),[[l,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(s)),1)])],2))),256))],8,Lm)):t.createCommentVNode("",!0),e.schema.listBox?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:1,class:"combobox form-control",disabled:e.disabled||null},[t.createElementVNode("div",{class:t.normalizeClass(["mainRow",{expanded:i.comboExpanded}]),onClick:n[0]||(n[0]=(...s)=>r.onExpandCombo&&r.onExpandCombo(...s))},[t.createElementVNode("div",$m,t.toDisplayString(r.selectedCount)+" selected",1),n[1]||(n[1]=t.createElementVNode("div",{class:"arrow"},null,-1))],2),t.createElementVNode("div",vm,[i.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.items,s=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(s)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(s)||null,disabled:e.disabled||null,onChange:c=>r.onChanged(c,s),name:r.getInputName(s)},null,40,xm),[[l,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(s)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,Pm))])),[[l,"wrapper"]])}const qm=$({mixins:[Se],data(){return{comboExpanded:!1}},computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(e){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?jo(this.schema.inputName+"_"+this.getItemValue(e)):jo(this.getItemValue(e))},getItemValue(e){if(fe(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return e[this.schema.checklistOptions.value];if(typeof e.value<"u")return e.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},getItemName(e){if(fe(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return e[this.schema.checklistOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},isItemChecked(e){return this.value&&this.value.indexOf(this.getItemValue(e))!==-1},onChanged(e,n){if((G(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const o=ga(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=ga(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",jm]]),zm={name:"FieldKeyValuePairs",components:{TrashIcon:Ce.TrashIcon},mixins:[Se],inject:{autofillSlot:{from:he,default:void 0}},data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var n,o;this.value||(this.value={});const e=((o=this.model)==null?void 0:o[(n=this.schema)==null?void 0:n.model])??{};Object.keys(e).forEach(a=>{this.pairs.push({key:a,value:e[a]})})},methods:{onInput(e,n,o){this.pairs[n][o]=e.target.value},updateValue(){this.value=this.pairs.reduce((e,{key:n,value:o})=>({...e,...n&&o?{[n]:o}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(e){this.pairs.splice(e,1)}}},Km={class:"key-value-pairs-editor"},Hm={class:"pair-item-cell"},Ym=["data-testid","placeholder","value","onInput"],Gm={class:"pair-item-cell"},Wm=["data-testid","placeholder","value","onInput"];function Zm(e,n,o,a,i,r){const l=t.resolveComponent("TrashIcon"),s=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Km,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.pairs,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,class:"pair-item"},[t.createElementVNode("div",Hm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-key-${m}`,placeholder:e.schema.keyInputPlaceholder??"Key",type:"text",value:c.key,onInput:p=>{r.onInput(p,m,"key")}},null,40,Ym),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:p=>r.onInput({target:{value:p}},m,"key"),value:c.key},null,8,["schema","update","value"]))]),t.createElementVNode("div",Gm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-value-${m}`,placeholder:e.schema.valueInputPlaceholder??"Value",type:"text",value:c.value,onInput:p=>{r.onInput(p,m,"value")}},null,40,Wm),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:p=>r.onInput({target:{value:p}},m,"value"),value:c.value},null,8,["schema","update","value"]))]),t.createVNode(s,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${m}`,onClick:()=>{r.removePair(m)}},{default:t.withCtx(()=>[t.createVNode(l)]),_:2},1032,["data-testid","onClick"])]))),128)),t.createVNode(s,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:r.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Xm=$(zm,[["render",Zm],["__scopeId","data-v-70998d5b"]]),Jm=$(t.defineComponent({__name:"FieldLabel",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0}},setup(e){const n=e,o=t.toRefs(n),{getFieldID:a,value:i}=Te.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(r,l)=>{const s=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["field-label",e.schema.fieldClasses])},[t.createVNode(s,{id:t.unref(a)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-d046a15a"]]),Qm=t.defineComponent({__name:"FieldMultiselect",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRef(a,"model"),{getLabelId:l,getFieldID:s,clearValidationErrors:c,value:m}=Te.useAbstractFields({model:r,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:f=>{i("modelUpdated",f.value,f.model)}});n({clearValidationErrors:c});const p=t.computed(()=>{var f,g;return a.schema.values?a.schema.values:(g=(f=a.schema.elements)==null?void 0:f.one_of)!=null&&g.length?a.schema.elements.one_of.map(M=>({label:String(M),value:String(M)})):[]});return(f,g)=>{const M=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(M,{id:t.unref(s)(e.schema),modelValue:t.unref(m),"onUpdate:modelValue":g[0]||(g[0]=B=>t.isRef(m)?m.value=B:null),"aria-labelledby":t.unref(l)(e.schema),class:t.normalizeClass(e.schema.fieldClasses),"data-testid":"field-multiselect",disabled:e.disabled||void 0,items:p.value,"kpop-attributes":{"data-testid":`${t.unref(s)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:e.schema.placeholder,required:e.schema.required||void 0,width:"100%"},null,8,["id","modelValue","aria-labelledby","class","disabled","items","kpop-attributes","label-attributes","name","placeholder","required"])}}}),eu={class:"selection-group"},tu={class:"form-group horizontal-radios"},nu={class:"radio-group"},ou=["disabled","value"],au={class:"control-help"},iu={key:0,class:"option-field"},ru={class:"option-field-container"},lu=$(Object.assign({mixins:[Se],expose:["validate","clearValidationErrors","schema"],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},fieldSchema:[],scope:"scope"}},watch:{checkedGroup:{handler(e,n){if(n===null){this.fieldModel={...this.model};return}const o=this.schema.fields[e].fields,a=this.schema.fields[n].fields;a&&a.forEach(i=>this.updateModel("",i.model)),o&&o.forEach(i=>this.updateModel(this.fieldModel[i.model],i.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((e,n)=>{e.fields&&e.fields.forEach(o=>{var a;this.model[o.model]&&(this.checkedGroup=n,this.fieldSchema.push(o.model),this.scope=(a=o.label)==null?void 0:a.toLowerCase())})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldSelectionGroup",setup(e){const{t:n}=ue.createI18n("en-us",pe);return(o,a)=>(t.openBlock(),t.createElementBlock("div",eu,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.$props.disabled?"k-tooltip":"div"),{"max-width":"300",text:t.unref(n)("general.disable_global_radio",{scope:o.scope})},{default:t.withCtx(()=>[t.createElementVNode("div",tu,[t.createElementVNode("div",nu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:t.normalizeClass(["option-group",{"radio-disabled":o.$props.disabled}])},[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${i.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>o.checkedGroup=l),class:"k-input",disabled:o.$props.disabled,type:"radio",value:r},null,8,ou),[[t.vModelRadio,o.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(i.label)+" ",1),t.createElementVNode("div",au,t.toDisplayString(i.description),1)],2)],2))),128))])])]),_:1},8,["text"])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:"option-group"},[i.fields&&o.checkedGroup===r?(t.openBlock(),t.createElementBlock("div",iu,[t.createElementVNode("div",ru,[t.createVNode(Y,{model:o.model,options:{helpAsHtml:!0},schema:{fields:i.fields},onModelUpdated:o.updateModel},null,8,["model","schema","onModelUpdated"])])])):t.createCommentVNode("",!0)]))),128))]))}}),[["__scopeId","data-v-3ef17c0e"]]),su={class:"form-field-wrapper"},du=t.defineComponent({__name:"FieldSwitch",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,{t:r}=ue.createI18n("en-us",pe),l=g=>g!=null&&a.schema.valueOn?g===a.schema.valueOn:g,s=g=>g!=null&&a.schema.valueOn?g?a.schema.valueOn:a.schema.valueOff:g,c=t.toRefs(a),{getFieldID:m,value:p,clearValidationErrors:f}=Te.useAbstractFields({model:c.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:l,formatValueToModel:s,emitModelUpdated:g=>{i("modelUpdated",g.value,g.model)}});return n({clearValidationErrors:f}),(g,M)=>{const B=t.resolveComponent("KInputSwitch");return t.openBlock(),t.createElementBlock("div",su,[t.createVNode(B,{id:t.unref(m)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":M[0]||(M[0]=h=>t.isRef(p)?p.value=h:null),autocomplete:e.schema.autocomplete,class:t.normalizeClass(e.schema.fieldClasses),disabled:e.disabled||void 0,label:t.unref(p)?e.schema.textOn||t.unref(r)("vfg.labels.on"):e.schema.textOff||t.unref(r)("vfg.labels.off"),"label-attributes":{info:e.schema.help},name:e.schema.inputName,required:e.schema.required||void 0},null,8,["id","modelValue","autocomplete","class","disabled","label","label-attributes","name","required"])])}}}),cu={class:"field-textarea"},mu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:_c,FieldArray:Bm,FieldArrayCardContainer:ma,FieldArrayItem:ua,FieldArrayMultiItem:fa,FieldAutoSuggest:pa,FieldAutoSuggestV2:ya,FieldCheckbox:Rm,FieldChecklist:qm,FieldInput:ba,FieldKeyValuePairs:Xm,FieldLabel:Jm,FieldMetric:_a,FieldMultiselect:Qm,FieldObject:Ea,FieldObjectAdvanced:Sa,FieldRadio:Ta,FieldSelect:Ca,FieldSelectionGroup:lu,FieldSwitch:du,FieldTextArea:$(t.defineComponent({__name:"FieldTextArea",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),l=t.inject(he,void 0),{updateModelValue:s,getFieldID:c,clearValidationErrors:m,value:p}=Te.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:g=>{i("modelUpdated",g.value,g.model)}});n({clearValidationErrors:m});const f=g=>{p.value=g,s(g,g)};return(g,M)=>{const B=t.resolveComponent("KTextArea");return t.openBlock(),t.createElementBlock("div",cu,[t.createVNode(B,t.mergeProps(g.$attrs,{id:t.unref(c)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":M[0]||(M[0]=h=>t.isRef(p)?p.value=h:null),autosize:"","character-limit":e.schema.max,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint||void 0,minlength:e.schema.min,name:e.schema.inputName,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,resizable:"",rows:e.schema.rows||3}),null,16,["id","modelValue","character-limit","class","disabled","help","minlength","name","placeholder","readonly","required","rows"]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(l)),{schema:e.schema,update:f,value:t.unref(p)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-0e146fba"]])},Symbol.toStringTag,{value:"Module"})),mixins:[qo],inject:{"vfg-array-item-index":{default:void 0}},props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated","refreshModel"],data(){return{child:t.ref()}},computed:{schema(){var n;if(!((n=this.field)!=null&&n.schema)||!Array.isArray(this.field.schema.fields))return this.field;const e=this["vfg-array-item-index"];return typeof e!="number"||Number.isNaN(e)?this.field:{...this.field,schema:{...this.field.schema,fields:this.field.schema.fields.map(o=>({...o,...o.id?{id:`${o.id}-${e}`}:void 0}))}}}},methods:{sanitize(e){return kl.sanitize(e)},fieldTypeHasLabel(e){if(G(e.label))return!1;let n="";switch(e.type==="input"?n=e.inputType:n=e.type,n){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(e){const n=P(this.options,"fieldIdPrefix","");return hn(e,n)},getTooltipId(e){return`${this.getFieldID(e)}-tooltip`},getFieldComponent(e){return e.component?e.component:"field-"+e.type},getButtonType(e){return P(e,"type","button")},onFieldValidated(e,n,o){this.$emit("validated",e,n,o)},buttonVisibility(e){return e.buttons&&e.buttons.length>0},buttonClickHandler(e,n,o){return e.onclick.call(this,this.model,n,o,this)},fieldHint(e){return v(e.hint)?e.hint.call(this,this.model,e,this):e.hint},fieldErrors(e){return this.errors.filter(n=>n.field.fieldName===e.fieldName).map(n=>n.error)},onRefreshModel(){this.$emit("refreshModel")},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},validate(e){return this.$refs.child.validate(e)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(e){return e?e.replace(/^[cC]onfig\./,""):""}}},uu=["innerHTML"],fu={class:"icon-wrapper"},hu={key:0,class:"link-wrapper"},pu={class:"field-wrap"},gu={key:0,class:"buttons"},yu=["type","onClick","textContent"],bu={key:1,class:"hint"},_u={key:2,class:"errors help-block"};function Eu(e,n,o,a,i,r){const l=t.resolveComponent("KExternalLink"),s=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[r.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(s,{key:0,"aria-describedby":o.field.help?r.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:r.getFieldID(o.field),info:!o.options.helpAsHtml&&o.field.help?o.field.help:void 0,"tooltip-attributes":o.field.help?{maxWidth:"300",placement:"top",tooltipId:r.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",fu,[t.createElementVNode("span",null,t.toDisplayString(r.formattedLabel(o.field.label)),1)]),o.field.link?(t.openBlock(),t.createElementBlock("div",hu,[t.createVNode(l,{href:o.field.link},{default:t.withCtx(()=>n[0]||(n[0]=[t.createElementVNode("span",{class:"section-header"},"More info",-1)])),_:1},8,["href"])])):t.createCommentVNode("",!0)]),_:2},[o.options.helpAsHtml&&o.field.help?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:r.sanitize(o.field.help)},null,8,uu)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",pu,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(o.field)),t.mergeProps(e.$attrs,{ref:"child",disabled:e.fieldDisabled(o.field)||null,"form-options":o.options,hint:o.field.hint&&o.field.type==="input"?r.fieldHint(o.field):void 0,model:o.model,schema:r.schema,vfg:o.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onRefreshModel","onValidated"])),r.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",gu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.field.buttons,(c,m)=>(t.openBlock(),t.createElementBlock("button",{key:m,class:t.normalizeClass(c.classes),type:r.getButtonType(c),onClick:p=>r.buttonClickHandler(c,o.field,p),textContent:t.toDisplayString(c.label)},null,10,yu))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&o.field.type!=="input"?(t.openBlock(),t.createElementBlock("div",bu,t.toDisplayString(r.fieldHint(o.field)),1)):t.createCommentVNode("",!0),r.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",_u,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fieldErrors(o.field),(c,m)=>(t.openBlock(),t.createElementBlock("span",{key:m},t.toDisplayString(c),1))),128))])):t.createCommentVNode("",!0)],2)}const wa=$(mu,[["render",Eu],["__scopeId","data-v-106c6dba"]]);var bt=(e=>(e.REDIS_CE="redis-ce",e.REDIS_EE="redis-ee",e))(bt||{});const Su=e=>{var n,o;return e.type===bt.REDIS_CE?"Host/Port":(n=e.config.sentinel_nodes)!=null&&n.length?"Sentinel":(o=e.config.cluster_nodes)!=null&&o.length?"Cluster":"Host/Port"},Tu={[bt.REDIS_CE]:"open source",[bt.REDIS_EE]:"enterprise"},ka=e=>Tu[e]??"",Cu={class:"partial-config-card"},wu={class:"config-card-row-label"},ku={class:"label-text"},Mu=["data-testid"],Au=["data-testid"],Nu={key:1},Iu=["data-testid"],Ou=["data-testid"],Vu=$(t.defineComponent({__name:"RedisConfigCard",props:{configFields:{type:Object,required:!0},pluginRedisFields:{type:Array,required:!0}},setup(e){const{t:n,formatUnixTimeStamp:o}=ue.createI18n("en-us",pe),a={id:{order:1},name:{order:1},type:{label:n("redis.config_card.common_fields.type_label"),hidden:!0,type:"hidden"},created_at:{label:n("redis.config_card.common_fields.created_at_label"),formatter:o,order:2},updated_at:{label:n("redis.config_card.common_fields.updated_at_label"),formatter:o,order:3}},i=e,r=f=>f!=null,l=(f,g)=>r(g)&&["password","sentinel_password"].includes(f)?"password":"text",{convertKeyToTitle:s}=wt.useStringHelpers(),c=t.computed(()=>Object.entries(i.configFields).map(([f,g])=>{var M,B,h,C;return{key:f,label:((M=a[f])==null?void 0:M.label)??s(f),value:(B=a[f])!=null&&B.formatter?a[f].formatter(g):g,type:((h=a[f])==null?void 0:h.type)??l(f,g),order:((C=a[f])==null?void 0:C.order)??100}}).sort((f,g)=>f.order-g.order).filter(f=>f.type!=="hidden")),m=Te.useRedisNonStandardFields(i.configFields,i.pluginRedisFields),p=t.computed(()=>c.value.concat(m));return(f,g)=>{const M=t.resolveComponent("KCopy");return t.openBlock(),t.createElementBlock("div",Cu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,({key:B,label:h,value:C,type:k})=>(t.openBlock(),t.createElementBlock("div",{key:B,class:"partial-config-card-row"},[t.createElementVNode("div",wu,[t.createElementVNode("div",ku,t.toDisplayString(h),1)]),t.createElementVNode("div",{class:"config-card-row-value","data-testid":`${B}-property-value`},[r(C)?(t.openBlock(),t.createElementBlock("div",Nu,[k==="password"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${B}-copy-password`},[t.createVNode(M,{format:"redacted",text:String(C)},null,8,["text"])],8,Iu)):(t.openBlock(),t.createElementBlock("div",{key:1,"data-testid":`${B}-plain-text`},t.toDisplayString(C),9,Ou))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${B}-no-value`}," – ",8,Au))],8,Mu)]))),128))])}}}),[["__scopeId","data-v-c1eb723f"]]),Bu={class:"redis-config-select","data-testid":"redis-config-select"},Fu={class:"selected-redis-config"},Ru=["data-testid"],Du={class:"select-item-name","data-testid":"selected-redis-config"},Lu={class:"empty-redis-config","data-testid":"empty-redis-config"},Uu={key:1,class:"redis-shared-config-error-message","data-testid":"redis-config-fetch-error"},Pu="1000",Ma=$(t.defineComponent({__name:"RedisConfigSelect",props:{defaultRedisConfigItem:{type:String,required:!1,default:""},updateRedisModel:{type:Function,required:!0},pluginRedisFields:{type:Array,required:!0},redisType:{type:String,default:"all"},isCustomPlugin:{type:Boolean,default:!1}},emits:["showNewPartialModal"],setup(e){const{t:n}=ue.createI18n("en-us",pe),o=t.inject(eo),a={konnect:{getOne:"/v2/control-planes/{controlPlaneId}/core-entities/partials/{id}",getAll:"/v2/control-planes/{controlPlaneId}/core-entities/partials"},kongManager:{getOne:"/{workspace}/partials/{id}",getAll:"/{workspace}/partials"}},i=e,r=t.ref(null),{getMessageFromError:l}=wt.useErrors(),s=t.inject(Qn),{debouncedQueryChange:c,loading:m,error:p,loadItems:f,results:g}=wt.useDebouncedFilter(s,a[s.app].getAll,Pu,{fetchedItemsKey:"data",searchKeys:["id","name"]}),M=t.computed(()=>p.value?l(p.value):""),B=I=>{let u=`${s.apiBaseUrl}${a[s.app].getOne}`;return s.app==="konnect"?u=u.replace(/{controlPlaneId}/gi,(s==null?void 0:s.controlPlaneId)||""):s.app==="kongManager"&&(u=u.replace(/\/{workspace}/gi,s!=null&&s.workspace?`/${s.workspace}`:"")),u=u.replace(/{id}/gi,String(I)),u},h=t.computed(()=>{const I=(g.value||[]).map(u=>({label:u.id,name:u.name,value:u.id,type:u.type,tag:Su(u)})).filter(u=>u.type==="redis-ce"||u.type==="redis-ee");return i.redisType!=="all"?I.filter(u=>u.type===i.redisType):I}),{axiosInstance:C}=wt.useAxios(s==null?void 0:s.axiosRequestConfig),k=async I=>{if(I){i.updateRedisModel(I);try{const u=await C.get(B(I));if(u.data.config){const b=Object.assign(u.data,u.data.config);delete b.config,r.value=b}}catch(u){console.error(u)}}};return t.watch(()=>o==null?void 0:o.value,async I=>{I&&await f()}),t.onBeforeMount(()=>{f(),i.defaultRedisConfigItem&&k(i.defaultRedisConfigItem)}),(I,u)=>{const b=t.resolveComponent("KLabel"),w=t.resolveComponent("KBadge"),S=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Bu,[t.createVNode(b,{info:e.isCustomPlugin?t.unref(n)("redis.custom_plugin.tooltip"):t.unref(n)("redis.shared_configuration.tooltip",{type:t.unref(ka)(e.redisType)}),"tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("redis.shared_configuration.title")),1)]),_:1},8,["info"]),u[2]||(u[2]=t.createElementVNode("div",{class:"shared-redis-config-title"},null,-1)),t.createVNode(S,{class:"redis-config-select-trigger","data-testid":"redis-config-select-trigger","enable-filtering":"","filter-function":()=>!0,items:h.value,loading:t.unref(m),"model-value":e.defaultRedisConfigItem,placeholder:t.unref(n)("redis.shared_configuration.selector.placeholder"),onChange:u[1]||(u[1]=y=>k(y==null?void 0:y.value)),onQueryChange:t.unref(c)},{"selected-item-template":t.withCtx(({item:y})=>[t.createElementVNode("div",Fu,t.toDisplayString(y.name),1)]),"item-template":t.withCtx(({item:y})=>[t.createElementVNode("div",{class:"plugin-form-redis-configuration-dropdown-item","data-testid":`redis-configuration-dropdown-item-${y.name}`},[t.createElementVNode("span",Du,t.toDisplayString(y.name),1),t.createVNode(w,{appearance:"info",class:"select-item-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.tag),1)]),_:2},1024)],8,Ru)]),empty:t.withCtx(()=>[t.createElementVNode("div",Lu,t.toDisplayString(t.unref(n)("redis.shared_configuration.empty_state")),1)]),"dropdown-footer-text":t.withCtx(()=>[t.createElementVNode("div",{class:"new-redis-config-area","data-testid":"new-redis-config-area",onClick:u[0]||(u[0]=y=>I.$emit("showNewPartialModal"))},[t.createVNode(t.unref(Ce.AddIcon),{size:t.unref(Fc)},null,8,["size"]),t.createElementVNode("span",null,t.toDisplayString(t.unref(n)("redis.shared_configuration.create_new_configuration",{type:t.unref(ka)(e.redisType)})),1)])]),_:1},8,["items","loading","model-value","placeholder","onQueryChange"])]),r.value?(t.openBlock(),t.createBlock(Vu,{key:0,"config-fields":r.value,"plugin-redis-fields":e.pluginRedisFields},null,8,["config-fields","plugin-redis-fields"])):t.createCommentVNode("",!0),M.value?(t.openBlock(),t.createElementBlock("p",Uu,t.toDisplayString(M.value||t.unref(n)("redis.shared_configuration.error")),1)):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-0001f209"]]),$u={key:0},vu={class:"redis-config-radio-group","data-testid":"redis-config-radio-group"},xu={key:0,class:"shared-redis-config"},ju={key:1,class:"dedicated-redis-config"},qu={class:"dedicated-redis-config-title"},zu={name:"VueFormGenerator",components:{formGroup:wa,formRedis:$(t.defineComponent({__name:"FormRedis",props:{tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}},model:{type:Object,default:()=>{}},options:{type:Object,required:!0},field:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default(){return[]}},redisPath:{type:String,default:void 0,required:!1},isEditing:{type:Boolean,default:!1}},emits:["modelUpdated","partialToggled","showNewPartialModal","refreshModel","validated"],setup(e,{emit:n}){const o=e,a=n,{t:i}=ue.createI18n("en-us",pe),r=t.computed(()=>o.field.pluginType==="custom"),l=t.ref(!o.isEditing),s=t.ref(),c=t.ref({}),m=t.ref(),p=h=>v(h.visible)?h.visible.call(this,o.model,h,this):G(h.visible)?!0:h.visible,f=async h=>{a("modelUpdated",[{id:h,path:o.redisPath}],"partials"),m.value=[{id:h,path:o.redisPath}],s.value=h},g=(h,C)=>{c.value={...c.value,[C]:h},a("modelUpdated",h,C)},M=()=>{a("refreshModel")},B=(h,C,k)=>{a("validated",h,C,k)};return t.watch(()=>l.value,h=>{h?m.value&&a("partialToggled","redis",{partials:m.value}):a("partialToggled","partials",c.value)}),t.onBeforeMount(()=>{var h,C,k;if(o.model&&(c.value=o.field.fields.reduce((I,u)=>(Object.keys(o.model).includes(u.model)&&(I[u.model]=o.model[u.model]),I),{})),(k=(C=(h=o==null?void 0:o.model)==null?void 0:h.partials)==null?void 0:C[0])!=null&&k.id){const I=o.model.partials[0].id;l.value=!0,s.value=I}}),(h,C)=>{const k=t.resolveComponent("KAlert"),I=t.resolveComponent("KBadge"),u=t.resolveComponent("KRadio"),b=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",null,[r.value?(t.openBlock(),t.createElementBlock("div",$u,[t.createVNode(k,{"data-testid":"custom-plugin-redis-config-note",message:t.unref(i)("redis.custom_plugin.alert")},null,8,["message"]),t.createVNode(Ma,{"default-redis-config-item":s.value,"is-custom-plugin":"","plugin-redis-fields":e.field.fields,"update-redis-model":f,onShowNewPartialModal:C[0]||(C[0]=w=>h.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields"])])):(t.openBlock(),t.createBlock(b,{key:1,class:"redis-config-card","data-testid":"redis-config-card",title:t.unref(i)("redis.title")},{default:t.withCtx(()=>[t.createElementVNode("div",vu,[t.createVNode(u,{modelValue:l.value,"onUpdate:modelValue":C[1]||(C[1]=w=>l.value=w),card:"","card-orientation":"horizontal","data-testid":"shared-redis-config-radio",description:t.unref(i)("redis.shared_configuration.description"),label:t.unref(i)("redis.shared_configuration.label"),"selected-value":!0},{default:t.withCtx(()=>[t.createVNode(I,{appearance:"success"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("redis.shared_configuration.badge")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),t.createVNode(u,{modelValue:l.value,"onUpdate:modelValue":C[2]||(C[2]=w=>l.value=w),card:"","card-orientation":"horizontal","data-testid":"dedicated-redis-config-radio",description:t.unref(i)("redis.dedicated_configuration.description"),label:t.unref(i)("redis.dedicated_configuration.label"),"selected-value":!1},null,8,["modelValue","description","label"])]),l.value?(t.openBlock(),t.createElementBlock("div",xu,[t.createVNode(Ma,{"default-redis-config-item":s.value,"plugin-redis-fields":e.field.fields,"redis-type":e.field.redisType,"update-redis-model":f,onShowNewPartialModal:C[3]||(C[3]=w=>h.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields","redis-type"])])):(t.openBlock(),t.createElementBlock("div",ju,[t.createElementVNode("div",qu,t.toDisplayString(t.unref(i)("redis.dedicated_configuration.title")),1),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.field.fields,w=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:w.model},[p(w)?(t.openBlock(),t.createBlock(wa,{key:0,ref_for:!0,ref:"children",errors:e.errors,field:w,model:e.model,options:e.options,vfg:e.vfg,onModelUpdated:g,onRefreshModel:M,onValidated:B},null,8,["errors","field","model","options","vfg"])):t.createCommentVNode("",!0)],64))),128))]),_:1}))]))]),_:1},8,["title"]))])}}}),[["__scopeId","data-v-b9a17494"]])},mixins:[qo],inject:{autofillSlot:{from:he,default:void 0}},provide(){var e;return{...!this.autofillSlot&&{[he]:(e=this.$slots)==null?void 0:e[ze]}}},props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:t.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}},enableRedisPartial:{type:Boolean,default:!1},isEditing:{type:Boolean,default:!1}},emits:["validated","modelUpdated","refreshModel","partialToggled","showNewPartialModal"],data(){return{vfg:this,errors:[],children:t.ref([]),collapseStates:{}}},computed:{fields(){const e=[];return this.schema&&this.schema.fields&&re(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&re(this.schema.groups.slice(0),n=>{e.push(n)}),e}},watch:{model:{deep:!0,handler(e,n){n!==e&&e!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(e){return v(e.visible)?e.visible.call(this,this.model,e,this):G(e.visible)?!0:e.visible},onFieldValidated(e,n,o){this.errors=this.errors.filter(i=>i.field.fieldName!==o.schema.fieldName),!e&&n&&n.length>0&&re(n,i=>{this.errors.push({field:o.schema,error:i})});const a=this.errors.length===0;this.$emit("validated",a,this.errors,this)},onRefreshModel(){this.$emit("refreshModel")},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},onPartialToggled(e,n){this.$emit("partialToggled",e,n)},validate(e=null){e===null&&(e=P(this.options,"validateAsync",!1)),this.clearValidationErrors();const n=[],o=[];re(this.$refs.children,i=>{v(i.validate)&&(n.push(i.$refs.child),o.push(i.$refs.child.validate(!0)))});const a=i=>{const r=[];re(i,(s,c)=>{Array.isArray(s)&&s.length>0&&re(s,m=>{r.push({field:n[c].schema,error:m})})}),this.errors=r;const l=r.length===0;return this.$emit("validated",l,r,this),e?r:l};return e?Promise.all(o).then(a):a(o)},clearValidationErrors(){this.errors.splice(0),re(this.$refs.children,e=>{e.clearValidationErrors()})}}},Ku={key:0,class:"vue-form-generator"},Hu={key:0};function Yu(e,n,o,a,i,r){const l=t.resolveComponent("form-redis"),s=t.resolveComponent("form-group"),c=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",Ku,[o.schema.fields?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fields,m=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m.model},[m.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(l,{key:0,errors:i.errors,field:m,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onPartialToggled:r.onPartialToggled,onShowNewPartialModal:p=>e.$emit("showNewPartialModal",m.redisType),onValidated:r.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):r.fieldVisible(m)?(t.openBlock(),t.createBlock(s,{key:1,ref_for:!0,ref:"children",errors:i.errors,field:m,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:1})):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.groups,(m,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`group-${p}`},[m.collapsible!==void 0&&m.collapsible!==!1?(t.openBlock(),t.createBlock(c,{key:0,class:"root-level-collapse","model-value":!1,title:m.collapsible.title},t.createSlots({default:t.withCtx(()=>{var f,g,M,B;return[(f=m.slots)!=null&&f.beforeContent?t.renderSlot(e.$slots,(g=m.slots)==null?void 0:g.beforeContent,{key:0}):t.createCommentVNode("",!0),m.fields.length===0&&((M=m.slots)!=null&&M.emptyState)?t.renderSlot(e.$slots,(B=m.slots)==null?void 0:B.emptyState,{key:1}):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:2,class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.fields,h=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:h.model},[r.fieldVisible(h)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:i.errors,field:h,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),m.collapsible!==!0&&m.collapsible.nestedCollapsible&&m.collapsible.nestedCollapsible.fields.length>0?(t.openBlock(),t.createBlock(c,{key:3,class:"nested-collapse","model-value":i.collapseStates[`group-${p}-nested`]??!0,"trigger-alignment":"leading","trigger-label":i.collapseStates[`group-${p}-nested`]??!0?m.collapsible.nestedCollapsible.triggerLabel.expand:m.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":h=>i.collapseStates[`group-${p}-nested`]=h},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.collapsible.nestedCollapsible.fields,h=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:h.model},[h.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(l,{key:0,errors:i.errors,field:h,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onPartialToggled:r.onPartialToggled,onShowNewPartialModal:C=>e.$emit("showNewPartialModal",h.redisType),onValidated:r.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):r.fieldVisible(h)?(t.openBlock(),t.createBlock(s,{key:1,ref_for:!0,ref:"children",errors:i.errors,field:h,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):t.createCommentVNode("",!0)]}),_:2},[m.collapsible.description?{name:"visible-content",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(m.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:1,class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[m.legend?(t.openBlock(),t.createElementBlock("legend",Hu,t.toDisplayString(m.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.fields,f=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:f.model},[r.fieldVisible(f)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:i.errors,field:f,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):t.createCommentVNode("",!0)}const Y=$(zu,[["render",Yu]]),_t={openIdConnectDocs:"https://developer.konghq.com/plugins/openid-connect/",openIdConnectJWKDocs:"https://developer.konghq.com/plugins/openid-connect/reference/#schema--config-client-jwk",openIdConnectClusterNodesDocs:"https://developer.konghq.com/plugins/openid-connect/reference/#schema--config-redis-cluster-nodes",openIdConfigurationDocs:"https://developer.konghq.com/plugins/openid-connect/reference/",openIdAuthorizationDocs:"https://developer.konghq.com/plugins/openid-connect/#authorization"},Aa=new Set(["config-client_id","config-client_secret","config-issuer"]),Na=new Set(["config-scopes_claim","config-scopes_required","config-audience_claim","config-audience_required","config-roles_claim","config-roles_required","config-groups_claim","config-groups_required","config-authenticated_groups_claim"]),Gu={name:"OIDCForm",components:{VueFormGenerator:Y},provide(){var e;return{[he]:(e=this.$slots)==null?void 0:e[ze]}},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},onPartialToggled:{type:Function,required:!0},isEditing:{type:Boolean,required:!0},enableRedisPartial:{type:Boolean,required:!1},showNewPartialModal:{type:Function,default:()=>{}}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,openIdConnectLink:_t.openIdConnectDocs,openIdConnectJWKLink:_t.openIdConnectJWKDocs,openIdConnectClusterNodesLink:_t.openIdConnectClusterNodesDocs,openIdConfigurationDocs:_t.openIdConfigurationDocs,openIdAuthorizationDocs:_t.openIdAuthorizationDocs,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var e;if(!this.init){this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(i=>!i.model.startsWith("config")&&i.model!=="tags")};const n=this.formSchema.fields.reduce((i,r)=>(i[r.model]=r,i),{});this.commonFieldsSchema={fields:Array.from(Aa).reduce((i,r)=>(n[r]&&i.push(n[r]),i),[])},this.authFieldsSchema={fields:Array.from(Na).reduce((i,r)=>(n[r]&&i.push(n[r]),i),[])};const{redis:o,redisModels:a}=Te.useRedisPartial(this.formSchema);this.advancedFieldsSchema={fields:this.formSchema.fields.filter(i=>i.model.startsWith("config")&&i.model!=="config-auth_methods"&&!Aa.has(i.model)&&!Na.has(i.model)&&(!this.enableRedisPartial||!a.includes(i.model))||i.model==="tags").reduce((i,r)=>{var l,s,c,m;switch(r.model){case"config-client_jwk":{if(Array.isArray((s=(l=r.items)==null?void 0:l.schema)==null?void 0:s.fields))for(const p of r.items.schema.fields)p.label=p.model;i.push({...r,link:this.openIdConnectJWKLink,newElementButtonLabel:"+ Add Client JWK",...Array.isArray((m=(c=r.items)==null?void 0:c.schema)==null?void 0:m.fields)&&r.items.schema.fields.map(p=>({...p,label:p.model}))});break}case"config-session_redis_cluster_nodes":{i.push({...r,link:this.openIdConnectClusterNodesLink,newElementButtonLabel:"+ Add Cluster Node"});break}default:i.push(r)}return i},[])},this.enableRedisPartial&&this.advancedFieldsSchema.fields.unshift(o),this.sessionManagement=this.formModel["config-auth_methods"].includes("session"),this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.formModel["config-auth_methods"].includes("authorization_code")},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.formModel["config-auth_methods"].includes("bearer")},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.formModel["config-auth_methods"].includes("client_credentials")},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.formModel["config-auth_methods"].includes("password")},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.formModel["config-auth_methods"].includes("introspection")},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.formModel["config-auth_methods"].includes("userinfo")},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.formModel["config-auth_methods"].includes("kong_oauth2")},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.formModel["config-auth_methods"].includes("refresh_token")}];for(const i of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const r of i.fields){const l=(e=n[r.model])==null?void 0:e.help;r.help===void 0&&typeof l=="string"&&(r.help=l)}}},getAuthMethodsValue(e,n){const o=[];for(let a=0;a<this.authMethods.length;a++)this.authMethods[a].prop&&this.authMethods[a].value!==e&&o.push(this.authMethods[a].value);return this.sessionManagement&&e&&o.push("session"),n&&(e?o.push(e):o.push("session")),o},handleUpdate(e,n){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(n,e),this.onModelUpdated()}}},Wu={class:"general-settings"},Zu={class:"link-wrapper"},Xu={class:"auth-method-container"},Ju={class:"general-settings"},Qu={class:"link-wrapper"},ef={class:"general-settings"},tf={class:"link-wrapper"};function nf(e,n,o,a,i,r){const l=t.resolveComponent("VueFormGenerator"),s=t.resolveComponent("KExternalLink"),c=t.resolveComponent("KLabel"),m=t.resolveComponent("KCheckbox"),p=t.resolveComponent("KInputSwitch"),f=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[o.formModel.id&&o.isEditing||!o.isEditing?(t.openBlock(),t.createBlock(l,{key:0,class:"global-fields",model:o.formModel,options:o.formOptions,schema:i.globalFields,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(f,{tabs:i.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",Wu,[t.createElementVNode("div",Zu,[t.createVNode(s,{href:i.openIdConfigurationDocs},{default:t.withCtx(()=>n[2]||(n[2]=[t.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)])),_:1},8,["href"])]),n[4]||(n[4]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(l,{key:0,model:o.formModel,options:o.formOptions,schema:i.commonFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(c,null,{default:t.withCtx(()=>n[3]||(n[3]=[t.createTextVNode("Auth Methods")])),_:1}),t.createElementVNode("div",Xu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.authMethods,g=>(t.openBlock(),t.createElementBlock("div",{key:g.value,class:"auth-method"},[t.createVNode(m,{modelValue:g.prop,"onUpdate:modelValue":M=>g.prop=M,onChange:M=>r.handleUpdate(M,g.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(g.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(p,{modelValue:i.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=g=>i.sessionManagement=g),label:"Enable Session Management",onChange:r.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",Ju,[t.createElementVNode("div",Qu,[t.createVNode(s,{href:i.openIdAuthorizationDocs},{default:t.withCtx(()=>n[5]||(n[5]=[t.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)])),_:1},8,["href"])]),n[6]||(n[6]=t.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(l,{key:0,model:o.formModel,options:o.formOptions,schema:i.authFieldsSchema,onModelUpdated:o.onModelUpdated},{"autofill-provider":t.withCtx(g=>[t.renderSlot(e.$slots,"autofill-provider",t.normalizeProps(t.guardReactiveProps(g)),void 0,!0)]),_:3},8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),advanced:t.withCtx(()=>[t.createElementVNode("div",ef,[t.createElementVNode("div",tf,[t.createVNode(s,{href:i.openIdConnectLink},{default:t.withCtx(()=>n[7]||(n[7]=[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)])),_:1},8,["href"])]),n[8]||(n[8]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(l,{key:0,"enable-redis-partial":o.enableRedisPartial,"is-editing":o.isEditing,model:o.formModel,options:o.formOptions,schema:i.advancedFieldsSchema,onModelUpdated:o.onModelUpdated,onPartialToggled:o.onPartialToggled,onShowNewPartialModal:n[1]||(n[1]=()=>o.showNewPartialModal(o.formSchema._supported_redis_partial_type))},null,8,["enable-redis-partial","is-editing","model","options","schema","onModelUpdated","onPartialToggled"])):t.createCommentVNode("",!0)])]),_:3},8,["tabs"])])}const of=$(Gu,[["render",nf],["__scopeId","data-v-741bf3cb"]]),af=$(t.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var l;t.provide(he,(l=t.useSlots())==null?void 0:l[ze]);const{t:n,te:o}=ue.createI18n("en-us",pe),a=e,i=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),r=t.computed(()=>{const s=a.formSchema;return s.fields.map(c=>{const m=`post-function.${c.model}`;return c.hint=o(`${m}.hint`)&&n(`${m}.hint`)||c.hint,c.help=o(`${m}.help`)&&n(`${m}.help`)||c.help,c.newElementButtonLabel=o(`${m}.newElementButtonLabel`)&&n(`${m}.newElementButtonLabel`)||c.newElementButtonLabel,c.model!=="tags"&&(c.valueType==="array"||c.type==="array")&&(c.type="array",c.valueArrayType="array",c.itemContainerComponent="FieldArrayItem",c.fieldClasses="post-function-array-item-container",c.fieldItemsClasses="post-function-array-item",c.inputAttributes={...c.inputAttributes,type:"textarea"}),c}),s});return(s,c)=>i.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-f54f37ae"]]),rf=$(t.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var l;t.provide(he,(l=t.useSlots())==null?void 0:l[ze]);const{t:n,te:o}=ue.createI18n("en-us",pe),a=e,i=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),r=t.computed(()=>{const s=a.formSchema;return s.fields.map(c=>{const m=`exit-transformer.${c.model}`;return c.hint=o(`${m}.hint`)&&n(`${m}.hint`)||c.hint,c.help=o(`${m}.help`)&&n(`${m}.help`)||c.help,c.newElementButtonLabel=o(`${m}.newElementButtonLabel`)&&n(`${m}.newElementButtonLabel`)||c.newElementButtonLabel,c.model!=="tags"&&(c.valueType==="array"||c.type==="array")&&(c.type="array",c.valueArrayType="array",c.itemContainerComponent="FieldArrayItem",c.fieldClasses="exit-transformer-array-item-container",c.fieldItemsClasses="exit-transformer-array-item",c.inputAttributes={...c.inputAttributes,type:"textarea"}),c}),s});return(s,c)=>i.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0d5c541f"]]),lf={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},sf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},df={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},cf={class:"general-settings"},mf={class:"sub-form"},uf={class:"general-settings"},ff={class:"sub-form"},hf={class:"general-settings"},pf=$(t.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var w;t.provide(he,(w=t.useSlots())==null?void 0:w[ze]);const n=e,o=t.ref("zeroSsl"),a=t.ref("shm"),i=t.computed(()=>{var y;const S={};if((y=n.formSchema)!=null&&y.fields)for(const F of n.formSchema.fields)S[F.model]=F;return S}),r=t.computed(()=>{var y;const S=Ie(lf);for(const F of S.fields){const x=(y=i.value[F.model])==null?void 0:y.help;F.help===void 0&&typeof x=="string"&&(F.help=x)}return S}),l=t.computed(()=>{var y;const S=Ie(sf);for(const F of S.fields){const x=(y=i.value[F.model])==null?void 0:y.help;F.help===void 0&&typeof x=="string"&&(F.help=x)}return S}),s=t.computed(()=>{var y;const S=Ie(df);for(const F of S.fields){const x=(y=i.value[F.model])==null?void 0:y.help;F.help===void 0&&typeof x=="string"&&(F.help=x)}return S}),c=t.computed(()=>({fields:n.formSchema.fields.filter(S=>!S.model.startsWith("config")&&S.model!=="tags")})),m=t.computed(()=>({fields:r.value.fields.filter(y=>!l.value.fields.some(F=>F.model===y.model)&&!s.value.fields.some(F=>F.model===y.model))})),p=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage")&&!y.model.startsWith("config-storage_config-consul")&&!y.model.startsWith("config-storage_config-redis")&&!y.model.startsWith("config-storage_config-shm")&&!y.model.startsWith("config-storage_config-vault"))})),f=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-consul"))})),g=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-redis"))})),M=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-shm"))})),B=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-vault"))})),h=t.computed(()=>({fields:n.formSchema.fields.filter(S=>S.model.startsWith("config")&&!m.value.fields.filter(y=>y.model===S.model).length&&!p.value.fields.filter(y=>y.model===S.model).length||S.model==="tags")})),C=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),k=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],I=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];t.onMounted(()=>{o.value==="zeroSsl"&&(n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const u=S=>{o.value=S.value,(S.value==="zeroSsl"||S.value==="other")&&(S.value==="zeroSsl"?n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":n.formModel["config-api_uri"]="https://acme.example.com/",n.formModel["config-tos_accepted"]=!1),S.value==="letsEncrypt"&&(n.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",n.formModel["config-eab_hmac_key"]="",n.formModel["config-eab_kid"]=""),n.onModelUpdated()},b=(S,y)=>{y==="config-storage"&&(a.value=S),n.onModelUpdated()};return(S,y)=>{const F=t.resolveComponent("KSelect"),x=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[e.formModel.id&&e.isEditing||!e.isEditing?(t.openBlock(),t.createBlock(Y,{key:0,class:"global-fields",model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(x,{tabs:k},{general:t.withCtx(()=>[t.createElementVNode("div",cf,[y[0]||(y[0]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),y[1]||(y[1]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:m.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),y[2]||(y[2]=t.createElementVNode("hr",null,null,-1)),t.createVNode(F,{class:"issuer-select",items:I,label:"Issuer",onChange:u}),t.createElementVNode("div",mf,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),o.value==="zeroSsl"||o.value==="other"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),storage:t.withCtx(()=>[t.createElementVNode("div",uf,[y[3]||(y[3]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),y[4]||(y[4]=t.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:p.value,onModelUpdated:b},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",ff,[a.value==="consul"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:f.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="redis"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:g.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="shm"?(t.openBlock(),t.createBlock(Y,{key:2,model:e.formModel,options:e.formOptions,schema:M.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="vault"?(t.openBlock(),t.createBlock(Y,{key:3,model:e.formModel,options:e.formOptions,schema:B.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),advanced:t.withCtx(()=>[t.createElementVNode("div",hf,[y[5]||(y[5]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),y[6]||(y[6]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:h.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-07cecf5b"]]),gf={class:"rla-form-basic-fields"},yf={class:"rla-form-request-limits-subtitle"},bf={class:"rla-form-request-limits-content"},_f={class:"rla-form-window-type"},Ef=["innerHTML"],Sf={class:"rla-form-window-type-radios"},Tf={class:"rla-form-request-limits-items"},Cf={class:"rla-form-request-limits-row"},wf=["id"],kf={class:"rla-form-request-limits-actions"},Mf={key:0,class:"rla-form-request-limits-examples"},Af={class:"rla-form-request-limits-examples-badges"},Nf=["innerHTML"],If={id:"rla-form-error-legend",class:"rla-form-error-inputs"},Of=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:pf,ExitTransformer:rf,OIDCForm:of,PostFunction:af,RLAForm:$(t.defineComponent({__name:"RLAForm",props:{formSchema:{},formModel:{},formOptions:{},onModelUpdated:{type:Function},onPartialToggled:{type:Function},showNewPartialModal:{type:Function},isEditing:{type:Boolean},enableRedisPartial:{type:Boolean}},setup(e){var x;t.provide(he,(x=t.useSlots())==null?void 0:x[ze]);const n={fixed:[{label:"500 requests every hour",description:"A fixed limit of 500 requests per hour resetting sharply on the hour, ensuring no user can exceed this limit.",config:{limit:500,window_size:3600}},{label:"200 requests every 30 minutes",description:"Users are allowed 200 requests per 30 minutes, resetting exactly on the 30 minute mark with no carryover of unused limits.",config:{limit:200,window_size:1800}},{label:"500 requests every day",description:"A strict limit of 5000 requests per day resetting promptly at midnight, preventing any burst traffic or inconsistent user experiences.",config:{limit:500,window_size:86400}}],sliding:[{label:"100 requests every hour",description:"Maximum of 100 requests every rolling hour, continuously adjusting the count over the course of the hour. No hard limit or known reset.",config:{limit:100,window_size:3600}},{label:"300 requests every 30 minutes",description:"Each user can make up to 300 requests in any rolling 30 minute period, with older requests dropping off as new requests are made.",config:{limit:300,window_size:1800}},{label:"500 requests every hour",description:`Each user is allowed 500 requests per hour.
2
+ `+me),et&&Vt([V,R,U],Re=>{me=ut(me,Re," ")}),b&&zt?b.createHTML(me):me},n.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};In(N),Cn=!0},n.clearConfig=function(){it=null,Cn=!1},n.isValidAttribute=function(N,d,_){it||In({});const A=te(N),z=te(d);return Ha(A,z,_)},n.addHook=function(N,d){typeof d=="function"&&mt(E[N],d)},n.removeHook=function(N,d){if(d!==void 0){const _=ll(E[N],d);return _===-1?void 0:sl(E[N],_,1)[0]}return ao(E[N])},n.removeHooks=function(N){E[N]=[]},n.removeAllHooks=function(){E=ho()},n}var kl=po();function Ml(){this.__data__=new ke,this.size=0}function Al(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function Nl(e){return this.__data__.get(e)}function Il(e){return this.__data__.has(e)}var Ol=200;function Vl(e,n){var o=this.__data__;if(o instanceof ke){var a=o.__data__;if(!ct||a.length<Ol-1)return a.push([e,n]),this.size=++o.size,this;o=this.__data__=new Me(a)}return o.set(e,n),this.size=o.size,this}function Ze(e){var n=this.__data__=new ke(e);this.size=n.size}Ze.prototype.clear=Ml,Ze.prototype.delete=Al,Ze.prototype.get=Nl,Ze.prototype.has=Il,Ze.prototype.set=Vl;var Rt=function(){try{var e=je(Object,"defineProperty");return e({},"",{}),e}catch{}}();function go(e,n,o){n=="__proto__"&&Rt?Rt(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var Bl=Object.prototype,Fl=Bl.hasOwnProperty;function yo(e,n,o){var a=e[n];(!(Fl.call(e,n)&&Nt(a,o))||o===void 0&&!(n in e))&&go(e,n,o)}function Dt(e,n,o,a){var i=!o;o||(o={});for(var r=-1,l=n.length;++r<l;){var s=n[r],c=void 0;c===void 0&&(c=e[s]),i?go(o,s,c):yo(o,s,c)}return o}function Rl(e,n){return e&&Dt(n,Mt(n),e)}function Dl(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var Ll=Object.prototype,Ul=Ll.hasOwnProperty;function Pl(e){if(!fe(e))return Dl(e);var n=Xt(e),o=[];for(var a in e)a=="constructor"&&(n||!Ul.call(e,a))||o.push(a);return o}function Lt(e){return kt(e)?Hn(e,!0):Pl(e)}function $l(e,n){return e&&Dt(n,Lt(n),e)}var bo=typeof L=="object"&&L&&!L.nodeType&&L,_o=bo&&typeof module=="object"&&module&&!module.nodeType&&module,vl=_o&&_o.exports===bo,Eo=vl?ge.Buffer:void 0,So=Eo?Eo.allocUnsafe:void 0;function xl(e,n){if(n)return e.slice();var o=e.length,a=So?So(o):new e.constructor(o);return e.copy(a),a}function jl(e,n){var o=-1,a=e.length;for(n||(n=Array(a));++o<a;)n[o]=e[o];return n}function ql(e,n){for(var o=-1,a=e==null?0:e.length,i=0,r=[];++o<a;){var l=e[o];n(l,o,e)&&(r[i++]=l)}return r}function To(){return[]}var zl=Object.prototype,Kl=zl.propertyIsEnumerable,Co=Object.getOwnPropertySymbols,dn=Co?function(e){return e==null?[]:(e=Object(e),ql(Co(e),function(n){return Kl.call(e,n)}))}:To;function Hl(e,n){return Dt(e,dn(e),n)}function wo(e,n){for(var o=-1,a=n.length,i=e.length;++o<a;)e[i+o]=n[o];return e}var ko=Yn(Object.getPrototypeOf,Object),Yl=Object.getOwnPropertySymbols,Mo=Yl?function(e){for(var n=[];e;)wo(n,dn(e)),e=ko(e);return n}:To;function Gl(e,n){return Dt(e,Mo(e),n)}function Ao(e,n,o){var a=n(e);return Pe(e)?a:wo(a,o(e))}function Wl(e){return Ao(e,Mt,dn)}function Zl(e){return Ao(e,Lt,Mo)}var cn=je(ge,"DataView"),mn=je(ge,"Promise"),Xe=je(ge,"Set"),un=je(ge,"WeakMap"),No="[object Map]",Xl="[object Object]",Io="[object Promise]",Oo="[object Set]",Vo="[object WeakMap]",Bo="[object DataView]",Jl=xe(cn),Ql=xe(ct),es=xe(mn),ts=xe(Xe),ns=xe(un),Ne=Le;(cn&&Ne(new cn(new ArrayBuffer(1)))!=Bo||ct&&Ne(new ct)!=No||mn&&Ne(mn.resolve())!=Io||Xe&&Ne(new Xe)!=Oo||un&&Ne(new un)!=Vo)&&(Ne=function(e){var n=Le(e),o=n==Xl?e.constructor:void 0,a=o?xe(o):"";if(a)switch(a){case Jl:return Bo;case Ql:return No;case es:return Io;case ts:return Oo;case ns:return Vo}return n});var os=Object.prototype,as=os.hasOwnProperty;function is(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&as.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var Fo=ge.Uint8Array;function fn(e){var n=new e.constructor(e.byteLength);return new Fo(n).set(new Fo(e)),n}function rs(e,n){var o=n?fn(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var ls=/\w*$/;function ss(e){var n=new e.constructor(e.source,ls.exec(e));return n.lastIndex=e.lastIndex,n}var Ro=De?De.prototype:void 0,Do=Ro?Ro.valueOf:void 0;function ds(e){return Do?Object(Do.call(e)):{}}function cs(e,n){var o=n?fn(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var ms="[object Boolean]",us="[object Date]",fs="[object Map]",hs="[object Number]",ps="[object RegExp]",gs="[object Set]",ys="[object String]",bs="[object Symbol]",_s="[object ArrayBuffer]",Es="[object DataView]",Ss="[object Float32Array]",Ts="[object Float64Array]",Cs="[object Int8Array]",ws="[object Int16Array]",ks="[object Int32Array]",Ms="[object Uint8Array]",As="[object Uint8ClampedArray]",Ns="[object Uint16Array]",Is="[object Uint32Array]";function Os(e,n,o){var a=e.constructor;switch(n){case _s:return fn(e);case ms:case us:return new a(+e);case Es:return rs(e,o);case Ss:case Ts:case Cs:case ws:case ks:case Ms:case As:case Ns:case Is:return cs(e,o);case fs:return new a;case hs:case ys:return new a(e);case ps:return ss(e);case gs:return new a;case bs:return ds(e)}}var Lo=Object.create,Vs=function(){function e(){}return function(n){if(!fe(n))return{};if(Lo)return Lo(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function Bs(e){return typeof e.constructor=="function"&&!Xt(e)?Vs(ko(e)):{}}var Fs="[object Map]";function Rs(e){return Ue(e)&&Ne(e)==Fs}var Uo=We&&We.isMap,Ds=Uo?Wt(Uo):Rs,Ls="[object Set]";function Us(e){return Ue(e)&&Ne(e)==Ls}var Po=We&&We.isSet,Ps=Po?Wt(Po):Us,$s=1,vs=2,xs=4,$o="[object Arguments]",js="[object Array]",qs="[object Boolean]",zs="[object Date]",Ks="[object Error]",vo="[object Function]",Hs="[object GeneratorFunction]",Ys="[object Map]",Gs="[object Number]",xo="[object Object]",Ws="[object RegExp]",Zs="[object Set]",Xs="[object String]",Js="[object Symbol]",Qs="[object WeakMap]",ed="[object ArrayBuffer]",td="[object DataView]",nd="[object Float32Array]",od="[object Float64Array]",ad="[object Int8Array]",id="[object Int16Array]",rd="[object Int32Array]",ld="[object Uint8Array]",sd="[object Uint8ClampedArray]",dd="[object Uint16Array]",cd="[object Uint32Array]",j={};j[$o]=j[js]=j[ed]=j[td]=j[qs]=j[zs]=j[nd]=j[od]=j[ad]=j[id]=j[rd]=j[Ys]=j[Gs]=j[xo]=j[Ws]=j[Zs]=j[Xs]=j[Js]=j[ld]=j[sd]=j[dd]=j[cd]=!0,j[Ks]=j[vo]=j[Qs]=!1;function gt(e,n,o,a,i,r){var l,s=n&$s,c=n&vs,m=n&xs;if(l!==void 0)return l;if(!fe(e))return e;var p=Pe(e);if(p){if(l=is(e),!s)return jl(e,l)}else{var f=Ne(e),g=f==vo||f==Hs;if(xn(e))return xl(e,s);if(f==xo||f==$o||g&&!i){if(l=c||g?{}:Bs(e),!s)return c?Gl(e,$l(l,e)):Hl(e,Rl(l,e))}else{if(!j[f])return i?e:{};l=Os(e,f,s)}}r||(r=new Ze);var M=r.get(e);if(M)return M;r.set(e,l),Ps(e)?e.forEach(function(C){l.add(gt(C,n,o,C,e,r))}):Ds(e)&&e.forEach(function(C,k){l.set(k,gt(C,n,o,k,e,r))});var B=m?c?Zl:Wl:c?Lt:Mt,h=p?void 0:B(e);return Bn(h||e,function(C,k){h&&(k=C,C=e[k]),yo(l,k,gt(C,n,o,k,e,r))}),l}var md=1,ud=4;function Ie(e){return gt(e,md|ud)}const hn=(e,n="")=>typeof e.id<"u"?n+e.id+"":n+(e.inputName||e.label||e.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),jo=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var fd="[object String]";function Ke(e){return typeof e=="string"||!Pe(e)&&Ue(e)&&Le(e)==fd}const qo={methods:{getFieldRowClasses(e){const n=this.fieldErrors(e).length>0,o={[P(this.options,"validationErrorClass","error")]:n,[P(this.options,"validationSuccessClass","valid")]:!n,disabled:this.fieldDisabled(e),readonly:this.fieldReadonly(e),featured:this.fieldFeatured(e),required:this.fieldRequired(e)};return Array.isArray(e.styleClasses)?re(e.styleClasses,a=>o[a]=!0):Ke(e.styleClasses)&&(o[e.styleClasses]=!0),G(e.type)||(o["field-"+e.type]=!0),o},fieldErrors(e){return this.errors.filter(o=>o.field.fieldName===e.fieldName).map(o=>o.error)},fieldDisabled(e){return v(e.disabled)?e.disabled.call(this,this.model,e,this):G(e.disabled)?!1:e.disabled},fieldReadonly(e){return v(e.readonly)?e.readonly.call(this,this.model,e,this):G(e.readonly)?!1:e.readonly},fieldFeatured(e){return v(e.featured)?e.featured.call(this,this.model,e,this):G(e.featured)?!1:e.featured},fieldRequired(e){return v(e.required)?e.required.call(this,this.model,e,this):G(e.required)?!1:e.required}}};var pn=function(){return ge.Date.now()},hd=/\s/;function pd(e){for(var n=e.length;n--&&hd.test(e.charAt(n)););return n}var gd=/^\s+/;function yd(e){return e&&e.slice(0,pd(e)+1).replace(gd,"")}var zo=NaN,bd=/^[-+]0x[0-9a-f]+$/i,_d=/^0b[01]+$/i,Ed=/^0o[0-7]+$/i,Sd=parseInt;function gn(e){if(typeof e=="number")return e;if(At(e))return zo;if(fe(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=fe(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=yd(e);var o=_d.test(e);return o||Ed.test(e)?Sd(e.slice(2),o?2:8):bd.test(e)?zo:+e}var Td="Expected a function",Cd=Math.max,wd=Math.min;function Je(e,n,o){var a,i,r,l,s,c,m=0,p=!1,f=!1,g=!0;if(typeof e!="function")throw new TypeError(Td);n=gn(n)||0,fe(o)&&(p=!!o.leading,f="maxWait"in o,r=f?Cd(gn(o.maxWait)||0,n):r,g="trailing"in o?!!o.trailing:g);function M(S){var y=a,F=i;return a=i=void 0,m=S,l=e.apply(F,y),l}function B(S){return m=S,s=setTimeout(k,n),p?M(S):l}function h(S){var y=S-c,F=S-m,x=n-y;return f?wd(x,r-F):x}function C(S){var y=S-c,F=S-m;return c===void 0||y>=n||y<0||f&&F>=r}function k(){var S=pn();if(C(S))return I(S);s=setTimeout(k,h(S))}function I(S){return s=void 0,g&&a?M(S):(a=i=void 0,l)}function u(){s!==void 0&&clearTimeout(s),m=0,a=c=i=s=void 0}function b(){return s===void 0?l:I(pn())}function w(){var S=pn(),y=C(S);if(a=arguments,i=this,c=S,y){if(s===void 0)return B(c);if(f)return clearTimeout(s),s=setTimeout(k,n),M(c)}return s===void 0&&(s=setTimeout(k,n)),l}return w.cancel=u,w.flush=b,w}var kd="__lodash_hash_undefined__";function Md(e){return this.__data__.set(e,kd),this}function Ad(e){return this.__data__.has(e)}function Ut(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new Me;++n<o;)this.add(e[n])}Ut.prototype.add=Ut.prototype.push=Md,Ut.prototype.has=Ad;function Nd(e,n,o,a){for(var i=e.length,r=o+-1;++r<i;)if(n(e[r],r,e))return r;return-1}function Id(e){return e!==e}function Od(e,n,o){for(var a=o-1,i=e.length;++a<i;)if(e[a]===n)return a;return-1}function Vd(e,n,o){return n===n?Od(e,n,o):Nd(e,Id,o)}function Bd(e,n){var o=e==null?0:e.length;return!!o&&Vd(e,n,0)>-1}function Fd(e,n){return e.has(n)}function Rd(){}function Ko(e){var n=-1,o=Array(e.size);return e.forEach(function(a){o[++n]=a}),o}var Dd=1/0,Ld=Xe&&1/Ko(new Xe([,-0]))[1]==Dd?function(e){return new Xe(e)}:Rd,Ud=200;function Pd(e,n,o){var a=-1,i=Bd,r=e.length,l=!0,s=[],c=s;if(r>=Ud){var m=Ld(e);if(m)return Ko(m);l=!1,i=Fd,c=new Ut}else c=s;e:for(;++a<r;){var p=e[a],f=p;if(p=p!==0?p:0,l&&f===f){for(var g=c.length;g--;)if(c[g]===f)continue e;s.push(p)}else i(c,f,o)||(c!==s&&c.push(f),s.push(p))}return s}function Ho(e){return e&&e.length?Pd(e):[]}var $d=0;function Yo(e){var n=++$d;return Jn(e)+n}var Go=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,$e="\\d\\d?",ve="\\d\\d",vd="\\d{3}",xd="\\d{4}",yt="[^\\s]+",Wo=/\[([^]*?)\]/gm;function Zo(e,n){for(var o=[],a=0,i=e.length;a<i;a++)o.push(e[a].substr(0,n));return o}var Xo=function(e){return function(n,o){var a=o[e].map(function(r){return r.toLowerCase()}),i=a.indexOf(n.toLowerCase());return i>-1?i:null}};function He(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var a=0,i=n;a<i.length;a++){var r=i[a];for(var l in r)e[l]=r[l]}return e}var Jo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Qo=["January","February","March","April","May","June","July","August","September","October","November","December"],jd=Zo(Qo,3),qd=Zo(Jo,3),ea={dayNamesShort:qd,dayNames:Jo,monthNamesShort:jd,monthNames:Qo,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},Pt=He({},ea),zd=function(e){return Pt=He(Pt,e)},ta=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},ce=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},Kd={D:function(e){return String(e.getDate())},DD:function(e){return ce(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return ce(e.getDay())},ddd:function(e,n){return n.dayNamesShort[e.getDay()]},dddd:function(e,n){return n.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return ce(e.getMonth()+1)},MMM:function(e,n){return n.monthNamesShort[e.getMonth()]},MMMM:function(e,n){return n.monthNames[e.getMonth()]},YY:function(e){return ce(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return ce(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return ce(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return ce(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return ce(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return ce(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return ce(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return ce(e.getMilliseconds(),3)},a:function(e,n){return e.getHours()<12?n.amPm[0]:n.amPm[1]},A:function(e,n){return e.getHours()<12?n.amPm[0].toUpperCase():n.amPm[1].toUpperCase()},ZZ:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+ce(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+ce(Math.floor(Math.abs(n)/60),2)+":"+ce(Math.abs(n)%60,2)}},na=function(e){return+e-1},oa=[null,$e],aa=[null,yt],ia=["isPm",yt,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],ra=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var n=(e+"").match(/([+-]|\d\d)/gi);if(n){var o=+n[1]*60+parseInt(n[2],10);return n[0]==="+"?o:-o}return 0}],Hd={D:["day",$e],DD:["day",ve],Do:["day",$e+yt,function(e){return parseInt(e,10)}],M:["month",$e,na],MM:["month",ve,na],YY:["year",ve,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",$e,void 0,"isPm"],hh:["hour",ve,void 0,"isPm"],H:["hour",$e],HH:["hour",ve],m:["minute",$e],mm:["minute",ve],s:["second",$e],ss:["second",ve],YYYY:["year",xd],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",ve,function(e){return+e*10}],SSS:["millisecond",vd],d:oa,dd:oa,ddd:aa,dddd:aa,MMM:["month",yt,Xo("monthNamesShort")],MMMM:["month",yt,Xo("monthNames")],a:ia,A:ia,ZZ:ra,Z:ra},$t={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Yd=function(e){return He($t,e)},Gd=function(e,n,o){if(n===void 0&&(n=$t.default),o===void 0&&(o={}),typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");n=$t[n]||n;var a=[];n=n.replace(Wo,function(r,l){return a.push(l),"@@@"});var i=He(He({},Pt),o);return n=n.replace(Go,function(r){return Kd[r](e,i)}),n.replace(/@@@/g,function(){return a.shift()})};function Wd(e,n,o){if(o===void 0&&(o={}),typeof n!="string")throw new Error("Invalid format in fecha parse");if(n=$t[n]||n,e.length>1e3)return null;var a=new Date,i={year:a.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},r=[],l=[],s=n.replace(Wo,function(b,w){return l.push(ta(w)),"@@@"}),c={},m={};s=ta(s).replace(Go,function(b){var w=Hd[b],S=w[0],y=w[1],F=w[3];if(c[S])throw new Error("Invalid format. "+S+" specified twice in format");return c[S]=!0,F&&(m[F]=!0),r.push(w),"("+y+")"}),Object.keys(m).forEach(function(b){if(!c[b])throw new Error("Invalid format. "+b+" is required in specified format")}),s=s.replace(/@@@/g,function(){return l.shift()});var p=e.match(new RegExp(s,"i"));if(!p)return null;for(var f=He(He({},Pt),o),g=1;g<p.length;g++){var M=r[g-1],B=M[0],h=M[2],C=h?h(p[g],f):+p[g];if(C==null)return null;i[B]=C}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);var k;if(i.timezoneOffset==null){k=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond);for(var I=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],g=0,u=I.length;g<u;g++)if(c[I[g][0]]&&i[I[g][0]]!==k[I[g][1]]())return null}else if(k=new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond)),i.month>11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return k}var Qe={format:Gd,parse:Wd,defaultI18n:ea,setGlobalDateI18n:zd,setGlobalDateMasks:Yd};function Zd(e,n,o){switch(o.length){case 0:return e.call(n);case 1:return e.call(n,o[0]);case 2:return e.call(n,o[0],o[1]);case 3:return e.call(n,o[0],o[1],o[2])}return e.apply(n,o)}var la=Math.max;function Xd(e,n,o){return n=la(n===void 0?e.length-1:n,0),function(){for(var a=arguments,i=-1,r=la(a.length-n,0),l=Array(r);++i<r;)l[i]=a[n+i];i=-1;for(var s=Array(n+1);++i<n;)s[i]=a[i];return s[n]=o(l),Zd(e,this,s)}}function Jd(e){return function(){return e}}var Qd=Rt?function(e,n){return Rt(e,"toString",{configurable:!0,enumerable:!1,value:Jd(n),writable:!0})}:Jt,ec=800,tc=16,nc=Date.now;function oc(e){var n=0,o=0;return function(){var a=nc(),i=tc-(a-o);if(o=a,i>0){if(++n>=ec)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var ac=oc(Qd);function ic(e,n){return ac(Xd(e,n,Jt),e+"")}function rc(e,n,o){if(!fe(o))return!1;var a=typeof n;return(a=="number"?kt(o)&&jn(n,o.length):a=="string"&&n in o)?Nt(o[n],e):!1}var sa=Object.prototype,lc=sa.hasOwnProperty,sc=ic(function(e,n){e=Object(e);var o=-1,a=n.length,i=a>2?n[2]:void 0;for(i&&rc(n[0],n[1],i)&&(a=1);++o<a;)for(var r=n[o],l=Lt(r),s=-1,c=l.length;++s<c;){var m=l[s],p=e[m];(p===void 0||Nt(p,sa[m])&&!lc.call(e,m))&&(e[m]=r[m])}return e}),dc=ge.isFinite;function cc(e){return typeof e=="number"&&dc(e)}var da=1/0,mc=17976931348623157e292;function uc(e){if(!e)return e===0?e:0;if(e=gn(e),e===da||e===-da){var n=e<0?-1:1;return n*mc}return e===e?e:0}function fc(e){var n=uc(e),o=n%1;return n===n?o?n-o:n:0}function hc(e){return typeof e=="number"&&e==fc(e)}var pc="[object Number]";function vt(e){return typeof e=="number"||Ue(e)&&Le(e)==pc}const pe={general:{packageName:"forms",disable_global_radio:"The plugin is set to 'Scoped' by default when configured under a {scope}. To configure a global plugin, navigate to the global plugin list page.",disable_source_scope_change:"Changing the {scope} is not allowed when configuring a plugin under it."},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}},rla:{view_advanced_fields:"View Advanced Fields",window_type:{label:"Rate Limit Window Type",help:"Sets the time window type to either <code>sliding</code> (default) or <code>fixed</code>.<br><ul><li>Sliding windows apply the rate limiting logic while taking into account previous hit rates (from the window that immediately precedes the current) using a dynamic weight.</li><li>Fixed windows consist of buckets that are statically assigned to a definitive time range, each request is mapped to only one fixed window based on its timestamp and will affect only that window&#39;s counters.</li></ul>",options:{fixed:"Fixed",sliding:"Sliding"}},request_limits:{title:"Request Limits",subtitle:"Set one or more limits on the number of API requests allowed within a defined timeframe.",label:"Limit",label_index:"Limit {index}",request_number:"Request number",time_interval:"Time interval",interval_determiner:"Every",seconds:"Seconds"},start_with_a_use_case:"Start with a use case:",use_case_index:"Use case {index}",error_message:{label:"Error Message",code_placeholder:"Code Message",message_placeholder:"Error Message",help:"Set a custom error code and message to be returned when the rate limit is exceeded."},identifiers:{label:"Identifiers",options:{ip:"IP",credential:"Credential",consumer:"Consumer",service:"Service",header:"Header",path:"Path","consumer-group":"Consumer Group"}},redis:{title:"Configure your Redis",address_example:"e.g. localhost:6379"}},validators:{field_is_required:"This field is required",invalid_format:"Invalid format",number_too_small:"The number is too small. Minimum: {0}",number_too_large:"The number is too large. Maximum: {0}",invalid_number:"Invalid number",invalid_integer:"The value is not an integer",text_too_short:"The length of text is too short. Current: {0}, Minimum: {1}",text_too_long:"The length of text is too long. Current: {0}, Maximum: {1}",this_not_text:"This is not a text",this_not_array:"This is not an array",select_min_items:"Select minimum {0} items",select_max_items:"Select maximum {0} items",invalid_date:"Invalid date",date_is_early:"The date is too early. Current: {0}, Minimum: {1}",date_is_late:"The date is too late. Current: {0}, Maximum: {1}",invalid_email:"Invalid e-mail address",invalid_url:"Invalid URL",invalid_card:"Invalid card format",invalid_card_number:"Invalid card number",invalid_text_contain_number:"Invalid text - cannot contains numbers or special characters",invalid_tex_contain_spec:"Invalid text - cannot contains special characters"},redis:{title:"Redis Configuration",shared_configuration:{label:"Use shared configuration",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins.",title:"Shared Redis Configuration",error:"Fetching shared Redis configurations failed.",tooltip:"Only compatible {type} redis configurations will be listed here.",configuration_selector_label:"Select stored Redis configuration",configuration_selector_placeholder:"Pick Redis configuration",create_new_configuration:"New {type} shared configuration",empty_state:"No shared configurations",badge:"Recommended",selector:{title:"Select a Redis configuration",placeholder:"Filter Configurations",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins."}},dedicated_configuration:{label:"Use dedicated configuration",description:"Create a Redis configuration exclusively for this plugin, with settings that won’t impact other plugins.",title:"Connection Settings"},config_card:{common_fields:{created_at_label:"Created at",updated_at_label:"Last Updated at",type_label:"Redis Type"}},custom_plugin:{alert:"Note: For custom plugins, we cannot determine the correct Redis configuration type. Please ensure you select the appropriate option manually.",tooltip:"To apply a shared redis configuration, the redis fields must defined as Kong plugins in plugin schema."}},fields:{auto_suggest:{error:{load_entity:"There was an error loading {entity}"},recently_created:"Recently created {entity}",items_count:"Currently showing {count} {count, plural, =1 {item} other {items}}, type to search",no_results:"No results",loading:"Loading..."}},vfg:{labels:{on:"On",off:"Off"}}},{t:W}=ue.createI18n("en-us",pe),oe={fieldIsRequired:W("validators.field_is_required"),invalidFormat:W("validators.invalid_format"),numberTooSmall:W("validators.number_too_small"),numberTooBig:W("validators.number_too_large"),invalidNumber:W("validators.invalid_number"),invalidInteger:W("validators.invalid_integer"),textTooSmall:W("validators.text_too_short"),textTooBig:W("validators.text_too_long"),thisNotText:W("validators.this_not_text"),thisNotArray:W("validators.this_not_array"),selectMinItems:W("validators.select_min_items"),selectMaxItems:W("validators.select_max_items"),invalidDate:W("validators.invalid_date"),dateIsEarly:W("validators.date_is_early"),dateIsLate:W("validators.date_is_late"),invalidEmail:W("validators.invalid_email"),invalidURL:W("validators.invalid_url"),invalidCard:W("validators.invalid_card"),invalidCardNumber:W("validators.invalid_card_number"),invalidTextContainNumber:W("validators.invalid_text_contain_number"),invalidTextContainSpec:W("validators.invalid_tex_contain_spec")},K=(e,...n)=>{if(e&&n.length>0)for(let o=0;o<n.length;o++)e=e.replace("{"+(o-1)+"}",String(n[o]||""));return e},be=(e,n,o=oe)=>G(e)||e===""?n?[K(o.fieldIsRequired)]:[]:null,Ye={required:(e,n,o,a=oe)=>be(e,n.required,a)||[],number:(e,n,o,a=oe)=>{let i=be(e,n.required,a);return i!=null||(i=[],cc(e)?(!G(n.min)&&e<n.min,(a=oe)&&i.push(K(a.numberTooSmall,n.min)),!G(n.max)&&e>n.max,(a=oe)&&i.push(K(a.numberTooBig,n.max))):i.push(K(a.invalidNumber))),i},integer:(e,n,o,a=oe)=>{let i=be(e,n.required,a);return i!=null||(i=[],i.concat(Ye.number(e,n,o,a)),hc(e)||i.push(K(a.invalidInteger))),i},double:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(!vt(e)||isNaN(e)?[K(a.invalidNumber)]:[])},string:(e,n,o,a=oe)=>{let i=be(e,n.required,a);return i!=null||(i=[],Ke(e)?(!G(n.min)&&e.length<n.min&&i.push(K(a.textTooSmall,e.length,n.min)),!G(n.max)&&e.length>n.max&&i.push(K(a.textTooBig,e.length,n.max))):i.push(K(a.thisNotText))),i},array:(e,n,o,a=oe)=>{if(n.required){if(!Array.isArray(e))return[K(a.thisNotArray)];if(e.length===0)return[K(a.fieldIsRequired)]}if(!G(e)){if(!G(n.min)&&e.length<n.min)return[K(a.selectMinItems,n.min)];if(!G(n.max)&&e.length>n.max)return[K(a.selectMaxItems,n.max)]}return[]},date:(e,n,o,a=oe)=>{let i=be(e,n.required,a);if(i!=null)return i;i=[];const r=new Date(e);if(isNaN(r.getDate()))return[K(a.invalidDate)];if(!G(n.min)){const l=new Date(n.min);r.valueOf()<l.valueOf()&&i.push(K(a.dateIsEarly,Qe.format(r),Qe.format(l)))}if(!G(n.max)){const l=new Date(n.max);r.valueOf()>l.valueOf()&&i.push(K(a.dateIsLate,Qe.format(r),Qe.format(l)))}return i},regexp:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(!G(n.pattern)&&!new RegExp(n.pattern).test(e)?[K(a.invalidFormat)]:[])},email:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)?[]:[K(a.invalidEmail)])},url:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e)?[]:[K(a.invalidURL)])},creditCard:(e,n,o,a=oe)=>{const i=be(e,n.required,a);if(i!=null)return i;const r=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,l=e.replace(/[^0-9]+/g,"");if(!r.test(l))return[K(a.invalidCard)];let s=0,c,m,p;for(let f=l.length-1;f>=0;f--)c=l.substring(f,f+1),m=parseInt(c,10),p?(m*=2,m>=10?s+=m%10+1:s+=m):s+=m,p=!p;return s%10===0&&l?[]:[K(a.invalidCardNumber)]},alpha:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(/^[a-zA-Z]*$/.test(e)?[]:[K(a.invalidTextContainNumber)])},alphaNumeric:(e,n,o,a=oe)=>{const i=be(e,n.required,a);return i??(/^[a-zA-Z0-9]*$/.test(e)?[]:[K(a.invalidTextContainSpec)])}};Object.keys(Ye).forEach(e=>{const n=Ye[e];v(n)&&(n.locale=o=>(a,i,r)=>n(a,i,r,sc(o,oe)))});function ca(e){return Ke(e)?Ye[e]!=null?Ye[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function yn(e,n,o){let a=P(o.context,"schema.attributes",{});const i=n.value||"input";Ke(i)&&(a=P(a,i)||a),re(a,(r,l)=>{e.setAttribute(l,r)})}const Se={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:yn,updated:yn,componentUpdated:yn}},computed:{value:{cache:!1,get(){let e;return v(P(this.schema,"get"))?e=this.schema.get(this.model):e=P(this.model,this.schema.model),this.formatValueToField(e)},set(e){const n=this.value;e=this.formatValueToModel(e),v(e)?e(e,n):this.updateModelValue(e,n)}}},methods:{validate(e){this.clearValidationErrors();const n=P(this.formOptions,"validateAsync",!1);let o=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const i=[];Array.isArray(this.schema.validator)?re(this.schema.validator,r=>{i.push(ca(r).bind(this))}):i.push(ca(this.schema.validator).bind(this)),re(i,r=>{if(n)o.push(r(this.value,this.schema,this.model));else{const l=r(this.value,this.schema,this.model);l&&v(l.then)?l.then(s=>{s&&(this.errors=this.errors.concat(s));const c=this.errors.length===0;this.$emit("validated",c,this.errors,this)}):l&&(o=o.concat(l))}})}const a=i=>{let r=[];re(Ho(i),s=>{Array.isArray(s)&&s.length>0?r=r.concat(s):Ke(s)&&r.push(s)}),v(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,r,this.schema);const l=r.length===0;return e||this.$emit("validated",l,r,this),this.errors=r,r};return n?Promise.all(o).then(a):a(o)},debouncedValidate(){v(this.debouncedValidateFunc)||(this.debouncedValidateFunc=Je(this.validate.bind(this),P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;v(this.schema.set)?(this.schema.set(this.model,e),o=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,e),o=!0),o&&(this.$emit("modelUpdated",e,this.schema.model),v(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,e,n,this.schema),P(this.formOptions,"validateAfterChanged",!1)===!0&&(P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(e,n){let o=e.replace(/\[(\w+)\]/g,".$1");o=o.replace(/^\./,"");let a=this.model;const i=o.split(".");let r=0;const l=i.length;for(;r<l;){const s=i[r];if(r<l-1)a[s]!==void 0||(a[s]={}),a=a[s];else{a[s]=n;return}++r}},getFieldID(e,n=!1){const o=P(this.formOptions,"fieldIdPrefix","");return hn(e,o)+(n?"-"+Yo():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return P(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},gc=Object.freeze(Object.defineProperty({__proto__:null,default:Se},Symbol.toStringTag,{value:"Module"})),$=(e,n)=>{const o=e.__vccOpts||e;for(const[a,i]of n)o[a]=i;return o},yc={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},bc={class:"material-icons"},_c=$(Object.assign({mixins:[Se],expose:["validate","clearValidationErrors","schema"],emits:["model-updated"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldAdvanced",setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",yc,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:o[0]||(o[0]=(...a)=>n.handleOpen&&n.handleOpen(...a))},[t.createElementVNode("i",bc,t.toDisplayString(n.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),t.createElementVNode("span",null,t.toDisplayString(n.titleText),1)]),t.createElementVNode("div",{class:t.normalizeClass(["advanced-field-dropdown",n.openClass])},[t.createVNode(Y,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])],2)]))}}),[["__scopeId","data-v-9bb032dd"]]),Ec={class:"array-card-container"},ma=$(t.defineComponent({__name:"FieldArrayCardContainer",props:{model:{type:Object,default:()=>null},schema:{type:Object,default:()=>null},index:{type:Number,default:void 0}},emits:["remove-item"],setup(e){const n=e;return t.provide("vfg-array-item-index",n.index),(o,a)=>{const i=t.resolveComponent("KCard"),r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Ec,[t.createVNode(i,{class:"card"},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3}),t.createVNode(r,{appearance:"tertiary",class:"array-card-remove-button",onClick:a[0]||(a[0]=l=>o.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.TrashIcon))]),_:1})])}}}),[["__scopeId","data-v-97302224"]]),Sc={class:"array-item-wrapper"},Tc={class:"array-item"},Cc={class:"array-item-after"},ua=$(t.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Sc,[t.createElementVNode("div",Tc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.TrashIcon))]),_:1})]),t.createElementVNode("div",Cc,[t.renderSlot(n.$slots,"after",{},void 0,!0)])])}}}),[["__scopeId","data-v-51d79db2"]]),wc={class:"multi-item-wrapper"},fa=$(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",wc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>o[1]||(o[1]=[t.createTextVNode(" - Remove Field ")])),_:1}),o[2]||(o[2]=t.createElementVNode("hr",null,null,-1))])}}}),[["__scopeId","data-v-b4fcf731"]]),kc="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",bn=e=>e?e.length===36&&new RegExp(`^${kc}$`).test(e):!1,Mc=e=>({...e,label:e.name,value:e.id});function ha(e,n,o){return o?_e.SET_REFERRAL_VALUE:e&&!n||!e&&n?_e.UPDATE_ENTITY:e&&n?_e.CREATE_FROM_ENTITY:_e.CREATE_NOT_FROM_ENTITY}const _n=50,Ac={mixins:[Se],inject:[ne],emits:["model-updated"],setup(){const{t:e}=ue.createI18n("en-us",pe);return{t:e}},data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ha(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},scope(){return this.schema.label.toLowerCase()},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},async created(){await this.$nextTick();let e,n;switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[ne]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[ne].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}try{e&&(this.initialItems=[{...e,label:this.getSuggestionLabel(e),value:e.id}]),this.items=this.initialItems}catch(o){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",o)}},methods:{onQueryChange(e){e.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=Je(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],a=this.getInputFields(),i=new Set;bn(e)&&a.includes("id")?o.push((async()=>{const r=await this.fetchExact(e);n.push({...r,label:this.getSuggestionLabel(r),value:r.id})})()):o.push(...a.filter(r=>r!=="id").map(async r=>{(await this.fetchSuggestions(e,r)).forEach(s=>{i.has(s.id)||(i.add(s.id),n.push({...s,label:this.getSuggestionLabel(s),value:s.id}))})})),await Promise.all(o),this.items=n,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e){const n=[];let o=null;if(!this[ne])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<_n;){const a=await this[ne].getAll(this.entity,{size:_n,offset:o,...e});if(n.push(...a.data.data),o=a.data.offset,!o)break}return n.slice(0,_n)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[ne]?(await this[ne].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},getSuggestionLabel(e){const n=this.getInputFields();return n.length&&e?n.map(o=>e[o]).filter(Boolean).join(" - "):""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.idValue=e&&e.id,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},Nc=["data-testid","data-testlabel"],Ic=["data-testid"],Oc={class:"autosuggest__results_message"};function Vc(e,n,o,a,i,r){const l=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:a.t("general.disable_source_scope_change",{scope:r.scope})},{default:t.withCtx(()=>[t.createVNode(l,{id:e.schema.model,ref:"suggestion",modelValue:i.idValue,"onUpdate:modelValue":n[0]||(n[0]=s=>i.idValue=s),clearable:"",disabled:e.schema.disabled,"enable-filtering":"","filter-function":()=>!0,items:i.items,loading:i.loading,placeholder:e.schema.placeholder,width:"100%",onChange:r.onSelected,onQueryChange:r.onQueryChange},{"item-template":t.withCtx(({item:s})=>[t.createElementVNode("span",{class:"first-part","data-testid":s.id&&`${s.id}-0`,"data-testlabel":s.label},t.toDisplayString(r.getSuggestionLabel(s).split(" - ")[0]),9,Nc),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.getSuggestionLabel(s).split(" - ").slice(1),(c,m)=>(t.openBlock(),t.createElementBlock("span",{key:m,class:"field-span","data-testid":s.id&&`${s.id}-${m+1}`||m+1},t.toDisplayString(c),9,Ic))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",Oc,[t.createElementVNode("span",null,t.toDisplayString(i.message),1)])]),_:1},8,["id","modelValue","disabled","items","loading","placeholder","onChange","onQueryChange"])]),_:1},8,["text"])}const pa=$(Ac,[["render",Vc],["__scopeId","data-v-a4bb7b25"]]),Bc="#6c7489",Fc="12px",Rc="20px";var Dc=4;function ga(e){return gt(e,Dc)}const Lc=["data-testid","data-testlabel"],Uc={class:"item-label"},Pc={class:"autosuggest__results_message"},$c=$(t.defineComponent({__name:"AutoSuggest",props:t.mergeModels({placeholder:{default:""},suggestions:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyMessage:{default:""},domId:{}},{id:{required:!0},idModifiers:{}}),emits:t.mergeModels(["change","query-change"],["update:id"]),setup(e){const{t:n}=ue.createI18n("en-us",pe),o=t.useModel(e,"id");return(a,i)=>{const r=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(r,{id:a.domId,ref:"suggestion",modelValue:o.value,"onUpdate:modelValue":i[0]||(i[0]=l=>o.value=l),clearable:"",disabled:a.disabled,"enable-filtering":"","filter-function":()=>!0,items:a.suggestions,loading:a.loading,placeholder:a.placeholder,width:"100%",onChange:i[1]||(i[1]=l=>a.$emit("change",l)),onQueryChange:i[2]||(i[2]=l=>a.$emit("query-change",l))},t.createSlots({"item-template":t.withCtx(({item:l})=>[t.renderSlot(a.$slots,"item",{item:l},()=>[t.createElementVNode("span",{class:"item-label","data-testid":l.id&&`${l.id}-0`,"data-testlabel":l.label},t.toDisplayString(l.label),9,Lc)],!0)]),"selected-item-template":t.withCtx(({item:l})=>[t.renderSlot(a.$slots,"selected-item",{item:l},()=>[t.createElementVNode("span",Uc,t.toDisplayString(l.label),1)],!0)]),empty:t.withCtx(()=>[t.createElementVNode("div",Pc,[t.createElementVNode("span",null,t.toDisplayString(a.emptyMessage||t.unref(n)("fields.auto_suggest.no_results")),1)])]),_:2},[a.$slots.before?{name:"before",fn:t.withCtx(()=>[t.renderSlot(a.$slots,"before",{},void 0,!0)]),key:"0"}:void 0]),1032,["id","modelValue","disabled","items","loading","placeholder"])}}}),[["__scopeId","data-v-baeb3bb0"]]),vc=500,xc=50,jc=t.defineComponent({__name:"FieldScopedEntitySelect",props:{transformItem:{type:Function,default:Mc},allowUuidSearch:{type:Boolean,default:!1},placeholder:{},fields:{default:()=>[]},initialItem:{},initialItemSelected:{type:Boolean},domId:{},id:{},entity:{},disabled:{type:Boolean},fieldDisabled:{type:Boolean},getAll:{type:Function},getPartial:{type:Function},getOne:{type:Function}},emits:["change"],setup(e){const n=t.ref(""),o=t.ref(!1),a=t.ref(!1),i=t.ref(""),r=t.ref([]),l=t.ref([]),s=t.ref([]),{t:c}=ue.createI18n("en-us",pe),m=t.ref(null);let p=null;const f=async(u,b)=>{clearTimeout(p),p=setTimeout(()=>{o.value=!0},1500);try{const w=await u();l.value=w,r.value=l.value.map(e.transformItem)}catch(w){if(b!=null&&b.aborted)return;r.value=[],n.value=w.message}finally{clearTimeout(p),o.value=!1}},g=Je((u="")=>{if(i.value=u,!u.trim())return;m.value&&m.value.abort();const b=new AbortController;if(m.value=b,a.value){bn(u)&&e.allowUuidSearch?k(u):C(u);return}bn(u)&&e.allowUuidSearch?f(async()=>await h(u)):f(async()=>await M(u,b.signal),b.signal)},vc,{leading:!0}),M=async(u,b)=>await e.getAll(u,b),B=async()=>{const{data:{data:u,next:b,offset:w}}=await e.getPartial(xc);return(!b||!w)&&(a.value=!0),l.value=u,s.value=u.map(S=>({...e.transformItem(S),group:c("fields.auto_suggest.recently_created",{entity:e.entity})})),u},h=async u=>{const{data:b}=await e.getOne(u);return[b]},C=u=>{u.trim()||(r.value=l.value.map(e.transformItem)),r.value=l.value.filter(b=>e.fields.some(w=>(b[w]||"").includes(u))).map(e.transformItem)},k=u=>{r.value=l.value.filter(b=>b.id===u).map(e.transformItem)},I=t.computed(()=>{var w;const u=i.value.trim(),b=u?r.value:s.value;return e.initialItemSelected?b.some(S=>{var y;return S.value!==((y=e.initialItem)==null?void 0:y.value)})?b:(w=e.initialItem)!=null&&w.value.includes(u)?[e.initialItem,...b]:b:b});return t.onMounted(async()=>{await f(B)}),(u,b)=>(t.openBlock(),t.createBlock($c,{id:u.id,disabled:u.fieldDisabled,"dom-id":u.domId,"empty-message":n.value,loading:o.value,placeholder:u.placeholder,readonly:u.disabled,suggestions:I.value,onChange:b[0]||(b[0]=w=>u.$emit("change",w)),onQueryChange:t.unref(g)},t.createSlots({"selected-item":t.withCtx(({item:w})=>[t.renderSlot(u.$slots,"selected-item",{item:w})]),item:t.withCtx(({item:w})=>[t.renderSlot(u.$slots,"item",{item:w})]),_:2},[u.$slots.before?{name:"before",fn:t.withCtx(()=>[t.renderSlot(u.$slots,"before")]),key:"0"}:void 0]),1032,["id","disabled","dom-id","empty-message","loading","placeholder","readonly","suggestions","onQueryChange"]))}}),qc=1e3,zc={components:{FieldScopedEntitySelect:jc,SearchIcon:Ce.SearchIcon},mixins:[Se],inject:[ne],emits:["model-updated"],setup(){const{t:e}=ue.createI18n("en-us",pe);return{t:e,KUI_ICON_SIZE_40:Rc,KUI_COLOR_TEXT_NEUTRAL:Bc}},data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItem:null,loading:!1,dataDrained:!1}},computed:{fieldState(){return ha(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},scope(){return this.schema.label.toLowerCase()},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search},inputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},allowUuidSearch(){return this.inputFields.includes("id")},inputFieldsWithoutId(){return this.inputFields.filter(e=>e!=="id")},initialValueSelected(){var e;return this.idValue===((e=this.initialItem)==null?void 0:e.id)}},async created(){await this.$nextTick();let e,n;try{switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[ne]){console.warn("[@kong-ui-public/forms] No API service provided");break}this.loading=!0,n=(await this[ne].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}e&&(this.initialItem=this.transformItem(e)),this.loading=!1}catch(o){this.message=this.t("fields.auto_suggest.error.load_entity",{entity:this.schema.entity}),console.error("err!",o)}},methods:{getPartial(e){return this[ne].peek(this.entity,e)},async getAll(e,n){const o=[],a=[],i=new Set;return a.push(...this.inputFieldsWithoutId.map(async r=>{const l=await this.fetchSuggestions(e,r,n);o.push(...this.dedupeSuggestions(l,i))})),await Promise.all(a),o},async getOne(e){return this[ne]?(await this[ne].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},transformItem(e){return{...e,label:this.getSuggestionLabel(e),value:e.id}},dedupeSuggestions(e,n){const o=[];return e.forEach(a=>{n.has(a.id)||(n.add(a.id),o.push(a))}),o},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e,n){if(!this[ne])return console.warn("[@kong-ui-public/forms] No API service provided"),[];const o=this.entity==="consumer_group"?this[ne].getAll:this[ne].getAllV2,{data:a}=await o(this.entity,{size:qc,...e},n);return a.data},async fetchSuggestions(e,n,o){return this.fetchUntilLimit({[n]:e},o)},getSuggestionLabel(e){var o;const n=((o=this.schema)==null?void 0:o.labelField)||"id";return n&&e?e[n]:""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.idValue=e&&e.id,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},Kc={class:"entity-suggestion-item"},Hc={class:"entity-label"},Yc={class:"entity-id"},Gc={class:"selected-entity-item"},Wc={class:"selected-entity-label"};function Zc(e,n,o,a,i,r){const l=t.resolveComponent("SearchIcon"),s=t.resolveComponent("FieldScopedEntitySelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:a.t("general.disable_source_scope_change",{scope:r.scope})},{default:t.withCtx(()=>[t.createVNode(s,{id:i.idValue,"allow-uuid-search":r.allowUuidSearch,disabled:i.loading,"dom-id":e.schema.model,entity:r.entity,"field-disabled":e.schema.disabled,fields:r.inputFieldsWithoutId,"get-all":r.getAll,"get-one":r.getOne,"get-partial":r.getPartial,"initial-item":i.initialItem,"initial-item-selected":r.initialValueSelected,placeholder:i.loading?a.t("fields.auto_suggest.loading"):e.schema.placeholder,"transform-item":r.transformItem,onChange:r.onSelected},{before:t.withCtx(()=>[t.createVNode(l,{color:a.KUI_COLOR_TEXT_NEUTRAL,size:a.KUI_ICON_SIZE_40},null,8,["color","size"])]),item:t.withCtx(({item:c})=>[t.createElementVNode("div",Kc,[t.createElementVNode("span",Hc,t.toDisplayString(c.label||"–"),1),t.createElementVNode("span",Yc,t.toDisplayString(c.id),1)])]),"selected-item":t.withCtx(({item:c})=>[t.createElementVNode("span",Gc,[t.createElementVNode("span",Wc,t.toDisplayString(c.label||"–"),1)])]),_:1},8,["id","allow-uuid-search","disabled","dom-id","entity","field-disabled","fields","get-all","get-one","get-partial","initial-item","initial-item-selected","placeholder","transform-item","onChange"])]),_:1},8,["text"])}const ya=$(zc,[["render",Zc],["__scopeId","data-v-774c16ea"]]);function Xc(e){const n=t.ref([]),o=t.ref(null),a=h=>Ke(h)?Ye[h]!=null?Ye[h]:(console.warn(`'${h}' is not a validator function!`),null):h,i=t.computed({get(){var C,k;let h;return v(P(e.schema,"get"))?h=e.schema.get((C=e.model)==null?void 0:C.value):h=P((k=e.model)==null?void 0:k.value,e.schema.model),M(h)},set(h){const C=i;h=B(h),v(h)?h(h,C):s(h,C)}}),r=h=>{var u;c();const C=P(e.formOptions,"validateAsync",!1);let k=[];if(e.schema.readonly!==!0&&e.disabled!==!0){const b=[],w=(u=e.schema)==null?void 0:u.validator;w&&(Array.isArray(w)?re(w,S=>{b.push(a(S))}):b.push(a(w))),v(e.externalValidator)&&b.push(e.externalValidator),re(b,S=>{var y,F;if(C)k.push(S(i.value,e.schema,(y=e.model)==null?void 0:y.value));else{const x=S(i.value,e.schema,(F=e.model)==null?void 0:F.value);x&&v(x.then)?x.then(T=>{T&&(n.value=n.value.concat(T));const E=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:E,errors:n.value,field:e.schema})}):x&&(k=k.concat(x))}})}const I=b=>{var S,y;let w=[];if(re(Ho(b),F=>{Array.isArray(F)&&F.length>0?w=w.concat(F):Ke(F)&&w.push(F)}),v((S=e.schema)==null?void 0:S.onValidated)&&e.schema.onValidated((y=e.model)==null?void 0:y.value,w,e.schema),!h){const F=w.length===0;e.emitValidated&&e.emitValidated({isValid:F,errors:w,field:e.schema})}return b=w,w};return C?Promise.all(k).then(I):I(k)},l=()=>{v(o.value)?o.value():o.value=Je(r,P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",500)))},s=(h,C)=>{var I,u,b;let k=!1;v(e.schema.set)?(e.schema.set((I=e.model)==null?void 0:I.value,h),k=!0):e.schema.model&&(m(e.schema.model,h),k=!0),k&&(e.emitModelUpdated&&((u=e.model)!=null&&u.value)&&e.emitModelUpdated({value:h,model:e.schema.model}),v(e.schema.onChanged)&&e.schema.onChanged((b=e.model)==null?void 0:b.value,h,C,e.schema),P(e.formOptions,"validateAfterChanged",!1)===!0&&(P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",0))>0?l():r()))},c=()=>{n.value.splice(0)},m=(h,C)=>{var S;let k=h.replace(/\[(\w+)\]/g,".$1");k=k.replace(/^\./,"");let I=((S=e.model)==null?void 0:S.value)||{},u=0;const b=k.split("."),w=b.length;for(;u<w;){const y=b[u];if(u<w-1)I[y]!==void 0||(I[y]={}),I=I[y];else{I[y]=C;return}++u}},p=(h,C=!1)=>{const k=P(e.formOptions,"fieldIdPrefix","");return hn(h,k)+(C?"-"+Yo():"")},f=h=>`${p(h)}-label`,g=()=>P(e.schema,"fieldClasses",[]),M=h=>e.formatValueToField&&typeof e.formatValueToField=="function"?e.formatValueToField(h):h,B=h=>e.formatValueToModel&&typeof e.formatValueToModel=="function"?e.formatValueToModel(h):h;return{value:i,clearValidationErrors:c,getFieldID:p,getLabelId:f,getFieldClasses:g,updateModelValue:s}}function Jc(e){const n=[],o=a=>{const i=["cluster-cache","cluster_cache"];for(const r of i)if(a.model.includes(r))return!1;return new RegExp("(?<=-redis-).*").test(a.model)};return e.fields.forEach(a=>{o(a)&&n.push(a)}),{redis:{id:"_redis",fields:n,model:"__redis_partial",redisType:e._supported_redis_partial_type,redisPath:e._redis_partial_path},redisModels:n.map(a=>a.model)}}function Qc(e,n){const o=new RegExp("(?<=config-redis-).*"),a=/Config\.Redis.*/;return n.filter(r=>{const l=r.model.match(o);return l&&!Object.keys(e).includes(l[0])}).map(r=>{const l=r.label.match(a);return{label:l?l[0]:r.label,key:r.model,value:"N/A",type:"text"}})}const Te={useAbstractFields:Xc,useRedisPartial:Jc,useRedisNonStandardFields:Qc},em={class:"form-field-wrapper"},ba=$(t.defineComponent({__name:"FieldInput",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),l=t.inject(he,void 0),{updateModelValue:s,getFieldID:c,clearValidationErrors:m,value:p}=Te.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:u=>{i("modelUpdated",u.value,u.model)}});n({clearValidationErrors:m});const f=t.computed(()=>{var b;const u=(b=a.schema)==null?void 0:b.inputType.toLowerCase();switch(u){case"string":return"text";case"datetime":return"datetime-local";default:return u||"text"}}),g={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},M=(u,b)=>{var F,x;let w=u;const S=g[f.value]||"",y=Qe.parse(u,S);y&&((F=a.schema)!=null&&F.format?w=Qe.format(y,(x=a.schema)==null?void 0:x.format):w=y.valueOf()),s(w,b)},B=(u,b)=>{vt(u)||(u=NaN),s(u,b)},h=u=>{let b=u;switch(f.value){case"number":case"range":vt(parseFloat(u))&&(b=parseFloat(u));break}p.value=b,s(b,u)},C=u=>{p.value=u,s(u,u)},k=t.ref(null),I=()=>{var u;v(k.value)&&((u=k.value)==null||u.flush())};return t.onMounted(()=>{switch(f.value){case"number":case"range":k.value=Je((u,b)=>{B(u,b)},parseInt(P(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":k.value=Je((u,b)=>{M(u,b)},parseInt(P(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{f.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):f.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):f.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(u,b)=>{const w=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",em,[t.createVNode(w,t.mergeProps(u.$attrs,{id:t.unref(c)(e.schema),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:f.value==="color"||f.value==="range"?t.unref(p):void 0,max:e.schema.max,maxlength:e.schema.maxlength,min:e.schema.min,minlength:e.schema.minlength,"model-value":t.unref(p),name:e.schema.inputName,pattern:e.schema.pattern,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,"show-password-mask-toggle":f.value==="password",type:f.value,width:e.schema.width,onBlur:I,"onUpdate:modelValue":h}),null,16,["id","autocomplete","class","disabled","help","max","maxlength","min","minlength","model-value","name","pattern","placeholder","readonly","required","show-password-mask-toggle","type","width"]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(l)),{schema:e.schema,update:C,value:t.unref(p)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-fe1132bb"]]),tm={name:"FieldMetric",components:{AddIcon:Ce.AddIcon,TrashIcon:Ce.TrashIcon},mixins:[Se],emits:["remove-item"],data(){return{contentVisible:!1}}},nm={key:0,class:"content"};function om(e,n,o,a,i,r){const l=t.resolveComponent("AddIcon"),s=t.resolveComponent("TrashIcon"),c=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field-dropdown",{active:i.contentVisible}])},[t.createElementVNode("div",{class:"title",onClick:n[0]||(n[0]=m=>i.contentVisible=!i.contentVisible)},[t.createTextVNode(t.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),t.createVNode(l,{class:"metric-add-icon"})]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[i.contentVisible?(t.openBlock(),t.createElementBlock("div",nm,[t.renderSlot(e.$slots,"default"),t.createVNode(c,{appearance:"tertiary",class:"metric-remove-button",onClick:n[1]||(n[1]=m=>e.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(s)]),_:1})])):t.createCommentVNode("",!0)]),_:3})],2)}const _a=$(tm,[["render",om]]),am={class:"field-object-container"},im={key:1},rm=["id"],lm={key:0},sm=["onUpdate:modelValue"],dm={key:1},cm=["onUpdate:modelValue"],mm={key:2},um=["onUpdate:modelValue"],fm=["onClick"],Ea=$(Object.assign({mixins:[Se],expose:["validate","clearValidationErrors","schema"],emits:["modelUpdated"],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const e=Object.keys(this.value),n={};for(let o=0;o<e.length;o++){const a=e[o];n[a]=typeof this.value[a]}this.keyTypes=n},methods:{removeElement(e){const n=this.value;delete n[e],this.value=JSON.parse(JSON.stringify(n));const o=this.keyTypes;delete o[e],this.keyTypes=JSON.parse(JSON.stringify(o))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""},updateModel(e,n){this.$emit("modelUpdated",e,n)}}},{__name:"FieldObject",setup(e){return(n,o)=>{const a=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",am,[n.schema.schema?(t.openBlock(),t.createBlock(Y,{key:0,model:n.value,options:n.formOptions,schema:n.schema.schema,onModelUpdated:n.updateModel},null,8,["model","options","schema","onModelUpdated"])):(t.openBlock(),t.createElementBlock("div",im,[t.createElementVNode("table",{id:n.getFieldID(n.schema),class:t.normalizeClass(n.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(i,r)=>(t.openBlock(),t.createElementBlock("tr",{key:r},[t.createElementVNode("td",null,t.toDisplayString(r),1),n.keyTypes[r]==="string"?(t.openBlock(),t.createElementBlock("td",lm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":l=>n.value[r]=l,type:"text"},null,8,sm),[[t.vModelText,n.value[r]]])])):t.createCommentVNode("",!0),n.keyTypes[r]==="boolean"?(t.openBlock(),t.createElementBlock("td",dm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":l=>n.value[r]=l,type:"checkbox"},null,8,cm),[[t.vModelCheckbox,n.value[r]]])])):t.createCommentVNode("",!0),n.keyTypes[r]==="number"?(t.openBlock(),t.createElementBlock("td",mm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":l=>n.value[r]=l,type:"number"},null,8,um),[[t.vModelText,n.value[r]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:l=>n.removeElement(r)},null,8,fm)])]))),128))],10,rm),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":o[0]||(o[0]=i=>n.newKeyType=i)},o[3]||(o[3]=[t.createElementVNode("option",{value:"string"}," String ",-1),t.createElementVNode("option",{value:"number"}," Number ",-1),t.createElementVNode("option",{value:"boolean"}," Boolean ",-1)]),512),[[t.vModelSelect,n.newKeyType]]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[1]||(o[1]=i=>n.newKeyName=i),type:"text"},null,512),[[t.vModelText,n.newKeyName]]),t.createElementVNode("input",{type:"button",value:"Add key",onClick:o[2]||(o[2]=(...i)=>n.addKey&&n.addKey(...i))})]))])),[[a,n.attributes]])}}}),[["__scopeId","data-v-4ace4106"]]),hm=["id"],pm=["data-testid"],gm={class:"item-wrapper"},ym={class:"index-wrapper"},bm={key:0},_m={key:1},Em=["onUpdate:modelValue","placeholder","type","onInput"],Sm={key:0,class:"hint"},Tm={class:"input-item"},Cm=["placeholder"],wm={key:0,class:"hint"},Sa=$(Object.assign({mixins:[Se],expose:["validate","clearValidationErrors","schema"],inject:{autofillSlot:{from:he,default:void 0}},emits:["model-updated"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(e,n)=>({[this.schema.model]:e[n]}),set:(e,n,o)=>e[n]=o[this.schema.model]}):this.model[this.schema.model]},valueInputType(){var e;return["number","integer"].includes((e=this.schema.values)==null?void 0:e.type)?"number":"text"}},mounted(){this.value||(this.value={});let e=[];this.subSchema?e=this.subSchema.fields:this.subFields&&(e=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,e,this.schema.model)},methods:{removeElement(e){const n=this.value;delete n[e],this.value={...n}},transformMapModelValuesToObject(e,n,o){let a={};try{a=JSON.parse(JSON.stringify(e??{}))[o]??{}}catch{}return Object.keys(e).map(i=>{const r=i.indexOf(o+"-");if(r>-1&&Array.isArray(n))if(n.length>0){const s=i.split("-").filter(m=>n.find(p=>p.model===m)),c=i.split(`-${s}`)[0].split(`${o}-`)[1];s.length?a[c]={...a[c],[s]:e[i]}:a[i.substring(r+`${o}-`.length)]=e[i]}else a[i.substring(`${o}-`.length)]=e[i];else{const s=i.split("-").filter(m=>m===this.schema.model),c=i.split(`-${s}`)[0].split(`${o}-`)[1];c&&(a[c]=e[i])}return i}),a},addKey(){var a;const e=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",n=((a=this.schema.values)==null?void 0:a.default)??(this.valueInputType==="number"?0:""),o=this.subSchema?e?[""]:{}:n;this.value[this.newKeyName]=o,this.newKeyName=""},updateModel(e,n){this.$emit("model-updated",this.model[this.schema.model],n)}}},{__name:"FieldObjectAdvanced",setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{id:n.getFieldID(n.schema),class:t.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,"data-testid":`field-object-key-${r}`},[t.createElementVNode("div",null,[t.createElementVNode("div",gm,[t.createElementVNode("div",ym,[t.createElementVNode("strong",null,t.toDisplayString(r),1),t.createElementVNode("div",null,[t.createVNode(a,{appearance:"tertiary",class:"delete",icon:"",type:"button",onClick:l=>n.removeElement(r)},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.TrashIcon))]),_:2},1032,["onClick"])])]),o[1]||(o[1]=t.createElementVNode("hr",{class:"divider"},null,-1)),n.subSchema?(t.openBlock(),t.createElementBlock("div",bm,[t.createVNode(Y,{model:n.transformedModel[r],options:{helpAsHtml:!0},schema:n.subSchema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",_m,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":l=>n.value[r]=l,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:n.valueInputType,onInput:l=>n.updateModel(n.value[r],n.model[n.schema.model])},null,40,Em),[[t.vModelDynamic,n.value[r]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",Sm,t.toDisplayString(n.schema.fields[0].schema.hint),1)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.autofillSlot),{schema:n.schema.fields&&n.schema.fields[0].schema||n.schema.values,update:l=>n.value[r]=l,value:n.value[r]},null,8,["schema","update","value"]))])),o[2]||(o[2]=t.createElementVNode("hr",{class:"wide-divider"},null,-1))])])],8,pm))),128)),t.createElementVNode("div",{class:t.normalizeClass(["input-wrapper",{indent:n.hasObjectKeys}])},[t.createElementVNode("div",Tm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>n.newKeyName=i),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Cm),[[t.vModelText,n.newKeyName]]),t.createVNode(a,{appearance:"tertiary","data-testid":"add-key",disabled:!n.newKeyName,onClick:n.addKey},{default:t.withCtx(()=>[t.createTextVNode(" + Add "+t.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(t.openBlock(),t.createElementBlock("p",wm,t.toDisplayString(n.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,hm)}}}),[["__scopeId","data-v-502ed880"]]),km={class:"radio-selection-group"},Ta=$(t.defineComponent({__name:"FieldRadio",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),{updateModelValue:l,value:s,clearValidationErrors:c}=Te.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:p=>{i("modelUpdated",p.value,p.model)}});n({clearValidationErrors:c});const m=p=>{let f=p;typeof p=="string"&&(f=p.split(","),a.schema.array||(f=f.toString())),l(f,p)};return(p,f)=>{const g=t.resolveComponent("KRadio");return t.openBlock(),t.createElementBlock("div",km,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.values,(M,B)=>(t.openBlock(),t.createBlock(g,{id:e.schema.name+"-"+B,key:M.value,modelValue:t.unref(s),"onUpdate:modelValue":f[0]||(f[0]=h=>t.isRef(s)?s.value=h:null),label:M.name,"label-attributes":{info:e.schema.help},name:e.schema.name,required:e.schema.required||void 0,"selected-value":M.value,onChange:m},null,8,["id","modelValue","label","label-attributes","name","required","selected-value"]))),128))])}}}),[["__scopeId","data-v-09b8afda"]]),Ca=t.defineComponent({__name:"FieldSelect",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.computed(()=>a.schema.selectOptions||{}),l=h=>G(h)?null:h,s=t.toRefs(a),{getFieldID:c,clearValidationErrors:m,value:p}=Te.useAbstractFields({model:s.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:l,emitModelUpdated:h=>{i("modelUpdated",h.value,h.model)}});n({clearValidationErrors:m});const f=t.computed(()=>{const h=a.schema.values;return g(typeof h=="function"?h.apply(this,[a.model,a.schema]):h)}),g=h=>{const C=[];return h.forEach(k=>{C.push({label:B(k),value:M(k),disabled:typeof k=="object"&&k.disabled||void 0,group:typeof k=="object"&&String(k.group||"").toUpperCase()||void 0})}),C},M=h=>{if(fe(h)){if(r.value&&typeof r.value.value<"u")return h[r.value.value];if(typeof h.id<"u")return String(h.id);throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return h},B=h=>{if(fe(h)){if(r.value&&typeof r.value.name<"u")return h[r.value.name];if(typeof h.name<"u")return String(h.name);throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return String(h)};return(h,C)=>{const k=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(k,{id:t.unref(c)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":C[0]||(C[0]=I=>t.isRef(p)?p.value=I:null),class:t.normalizeClass(e.schema.fieldClasses),clearable:!e.schema.required,disabled:e.disabled||void 0,items:f.value,"kpop-attributes":{"data-testid":`${t.unref(c)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:r.value.hideNoneSelectedText?void 0:r.value.noneSelectedText||"Nothing Selected",required:e.schema.required||void 0,width:"100%"},null,8,["id","modelValue","class","clearable","disabled","items","kpop-attributes","label-attributes","name","placeholder","required"])}}}),Mm={name:"FieldArray",components:{FieldArrayItem:ua,FieldArrayMultiItem:fa,FieldSelect:Ca,FieldMetric:_a,FieldObject:Ea,FieldObjectAdvanced:Sa,FieldAutoSuggest:pa,FieldAutoSuggestV2:ya,FieldRadio:Ta,FieldArrayCardContainer:ma,FieldInput:ba},mixins:[Se],inject:{autofillSlot:{from:he,default:void 0}},props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},emits:["refreshModel"],methods:{generateSchema(e,n,o){var i,r,l;let a;return n&&(a=JSON.parse(JSON.stringify(n)),(l=(r=(i=a.schema)==null?void 0:i.fields)==null?void 0:r.map)==null||l.call(r,s=>(s.id=`${s.id||s.model}-${o}`,s))),{...a,set(s,c){e[o]=c},get(){return e[o]}}},newElement(){let e=this.value,n;(!e||!e.push)&&(e=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?n=this.schema.items.default():n=this.schema.items.default),e.push(n),this.value=[...e]},removeElement(e){this.value=this.value.filter((n,o)=>o!==e)},getFieldComponent(e){return e.component?e.component:"field-"+e.type},modelUpdated(){this.$emit("refreshModel")},handleInput(e,n){var a,i;let o=e;((i=(a=this.schema)==null?void 0:a.inputAttributes)==null?void 0:i.type)==="number"&&vt(parseFloat(e))&&(o=parseFloat(e)),this.value=this.value.map((r,l)=>l===n?o:r)}}},Am=["id"],Nm={key:1},Im=["onUpdate:modelValue","aria-labelledby","type"],Om=["onUpdate:modelValue","aria-labelledby"];function Vm(e,n,o,a,i,r){const l=t.resolveComponent("KTextArea"),s=t.resolveComponent("KInput"),c=t.resolveComponent("KButton");return e.schema?(t.openBlock(),t.createElementBlock("div",{key:0,id:e.getFieldID(e.schema),class:t.normalizeClass(e.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(m,p)=>(t.openBlock(),t.createElementBlock("div",{key:p,class:t.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,index:p,model:m,schema:r.generateSchema(e.value,e.schema.items,p),onRemoveItem:f=>r.removeElement(p)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:m,schema:r.generateSchema(e.value,e.schema.items,p),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["index","model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",Nm,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:m,schema:r.generateSchema(e.value,e.schema.items,p),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:2,"data-testid":`${e.getFieldID(e.schema)}-item-${p}`,model:m,schema:r.generateSchema(e.value,e.schema.items,p),onRemoveItem:f=>r.removeElement(p)},{after:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:f=>e.value[p]=f,value:e.value[p]},null,8,["schema","update","value"]))]),default:t.withCtx(()=>{var f;return[e.schema.inputAttributes&&e.schema.inputAttributes.type==="textarea"?(t.openBlock(),t.createBlock(l,t.mergeProps({key:0,ref_for:!0},e.schema.inputAttributes,{id:e.getFieldID(e.schema),modelValue:e.value[p],"onUpdate:modelValue":g=>e.value[p]=g,"aria-labelledby":e.getLabelId(e.schema),autosize:"","character-limit":e.schema.inputAttributes.max,class:e.schema.fieldClasses,maxlength:e.schema.max,minlength:e.schema.min,name:e.schema.inputName,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,resizable:"",rows:e.schema.rows||3}),null,16,["id","modelValue","onUpdate:modelValue","aria-labelledby","character-limit","class","maxlength","minlength","name","placeholder","readonly","required","rows"])):!e.schema.inputAttributes||!e.schema.inputAttributes.type||e.schema.inputAttributes.type==="text"||e.schema.inputAttributes.type==="number"?(t.openBlock(),t.createBlock(s,t.mergeProps({key:1,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{"model-value":e.value[p],type:e.schema.inputAttributes&&e.schema.inputAttributes.type||"text",onInput:g=>{r.handleInput(g,p)}}),null,16,["aria-labelledby","model-value","type","onInput"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,"onUpdate:modelValue":g=>e.value[p]=g,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:((f=e.schema.inputAttributes)==null?void 0:f.type)||"text"}),null,16,Im)),[[t.vModelDynamic,e.value[p]]])]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.withDirectives(t.createElementVNode("input",t.mergeProps({ref_for:!0},e.schema.inputAttributes,{"onUpdate:modelValue":f=>e.value[p]=f,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,Om),[[t.vModelText,e.value[p]]]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:f=>e.value[p]=f,value:e.value[p]},null,8,["schema","update","value"]))],64))],2))),128)),t.createVNode(c,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:r.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Am)):t.createCommentVNode("",!0)}const Bm=$(Mm,[["render",Vm],["__scopeId","data-v-ae802bb2"]]),Fm={class:"form-field-wrapper field-checkbox"},Rm=$(t.defineComponent({__name:"FieldCheckbox",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),{getFieldID:l,value:s,clearValidationErrors:c}=Te.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:m=>{i("modelUpdated",m.value,m.model)}});return n({clearValidationErrors:c}),(m,p)=>{const f=t.resolveComponent("KCheckbox");return t.openBlock(),t.createElementBlock("div",Fm,[t.createVNode(f,t.mergeProps(m.$attrs,{id:t.unref(l)(e.schema),modelValue:t.unref(s),"onUpdate:modelValue":p[0]||(p[0]=g=>t.isRef(s)?s.value=g:null),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:void 0,name:e.schema.inputName,readonly:e.schema.readonly,required:e.schema.required,width:e.schema.width}),null,16,["id","modelValue","autocomplete","class","disabled","help","name","readonly","required","width"])])}}}),[["__scopeId","data-v-6b4ee1cd"]]),Dm={class:"wrapper"},Lm=["disabled"],Um=["id","checked","disabled","onChange","name"],Pm=["disabled"],$m={class:"info"},vm={class:"dropList"},xm=["id","checked","disabled","onChange","name"];function jm(e,n,o,a,i,r){const l=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",Dm,[e.schema.listBox?(t.openBlock(),t.createElementBlock("div",{key:0,class:"listbox form-control",disabled:e.disabled||null},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.items,s=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(s)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(s)||null,disabled:e.disabled||null,onChange:c=>r.onChanged(c,s),name:r.getInputName(s)},null,40,Um),[[l,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(s)),1)])],2))),256))],8,Lm)):t.createCommentVNode("",!0),e.schema.listBox?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:1,class:"combobox form-control",disabled:e.disabled||null},[t.createElementVNode("div",{class:t.normalizeClass(["mainRow",{expanded:i.comboExpanded}]),onClick:n[0]||(n[0]=(...s)=>r.onExpandCombo&&r.onExpandCombo(...s))},[t.createElementVNode("div",$m,t.toDisplayString(r.selectedCount)+" selected",1),n[1]||(n[1]=t.createElementVNode("div",{class:"arrow"},null,-1))],2),t.createElementVNode("div",vm,[i.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.items,s=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(s)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(s)||null,disabled:e.disabled||null,onChange:c=>r.onChanged(c,s),name:r.getInputName(s)},null,40,xm),[[l,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(s)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,Pm))])),[[l,"wrapper"]])}const qm=$({mixins:[Se],data(){return{comboExpanded:!1}},computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(e){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?jo(this.schema.inputName+"_"+this.getItemValue(e)):jo(this.getItemValue(e))},getItemValue(e){if(fe(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return e[this.schema.checklistOptions.value];if(typeof e.value<"u")return e.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},getItemName(e){if(fe(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return e[this.schema.checklistOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},isItemChecked(e){return this.value&&this.value.indexOf(this.getItemValue(e))!==-1},onChanged(e,n){if((G(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const o=ga(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=ga(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",jm]]),zm={name:"FieldKeyValuePairs",components:{TrashIcon:Ce.TrashIcon},mixins:[Se],inject:{autofillSlot:{from:he,default:void 0}},data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var n,o;this.value||(this.value={});const e=((o=this.model)==null?void 0:o[(n=this.schema)==null?void 0:n.model])??{};Object.keys(e).forEach(a=>{this.pairs.push({key:a,value:e[a]})})},methods:{onInput(e,n,o){this.pairs[n][o]=e.target.value},updateValue(){this.value=this.pairs.reduce((e,{key:n,value:o})=>({...e,...n&&o?{[n]:o}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(e){this.pairs.splice(e,1)}}},Km={class:"key-value-pairs-editor"},Hm={class:"pair-item-cell"},Ym=["data-testid","placeholder","value","onInput"],Gm={class:"pair-item-cell"},Wm=["data-testid","placeholder","value","onInput"];function Zm(e,n,o,a,i,r){const l=t.resolveComponent("TrashIcon"),s=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Km,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.pairs,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,class:"pair-item"},[t.createElementVNode("div",Hm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-key-${m}`,placeholder:e.schema.keyInputPlaceholder??"Key",type:"text",value:c.key,onInput:p=>{r.onInput(p,m,"key")}},null,40,Ym),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:p=>r.onInput({target:{value:p}},m,"key"),value:c.key},null,8,["schema","update","value"]))]),t.createElementVNode("div",Gm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-value-${m}`,placeholder:e.schema.valueInputPlaceholder??"Value",type:"text",value:c.value,onInput:p=>{r.onInput(p,m,"value")}},null,40,Wm),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:p=>r.onInput({target:{value:p}},m,"value"),value:c.value},null,8,["schema","update","value"]))]),t.createVNode(s,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${m}`,onClick:()=>{r.removePair(m)}},{default:t.withCtx(()=>[t.createVNode(l)]),_:2},1032,["data-testid","onClick"])]))),128)),t.createVNode(s,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:r.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Xm=$(zm,[["render",Zm],["__scopeId","data-v-70998d5b"]]),Jm=$(t.defineComponent({__name:"FieldLabel",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0}},setup(e){const n=e,o=t.toRefs(n),{getFieldID:a,value:i}=Te.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(r,l)=>{const s=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["field-label",e.schema.fieldClasses])},[t.createVNode(s,{id:t.unref(a)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-d046a15a"]]),Qm=t.defineComponent({__name:"FieldMultiselect",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRef(a,"model"),{getLabelId:l,getFieldID:s,clearValidationErrors:c,value:m}=Te.useAbstractFields({model:r,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:f=>{i("modelUpdated",f.value,f.model)}});n({clearValidationErrors:c});const p=t.computed(()=>{var f,g;return a.schema.values?a.schema.values:(g=(f=a.schema.elements)==null?void 0:f.one_of)!=null&&g.length?a.schema.elements.one_of.map(M=>({label:String(M),value:String(M)})):[]});return(f,g)=>{const M=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(M,{id:t.unref(s)(e.schema),modelValue:t.unref(m),"onUpdate:modelValue":g[0]||(g[0]=B=>t.isRef(m)?m.value=B:null),"aria-labelledby":t.unref(l)(e.schema),class:t.normalizeClass(e.schema.fieldClasses),"data-testid":"field-multiselect",disabled:e.disabled||void 0,items:p.value,"kpop-attributes":{"data-testid":`${t.unref(s)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:e.schema.placeholder,required:e.schema.required||void 0,width:"100%"},null,8,["id","modelValue","aria-labelledby","class","disabled","items","kpop-attributes","label-attributes","name","placeholder","required"])}}}),eu={class:"selection-group"},tu={class:"form-group horizontal-radios"},nu={class:"radio-group"},ou=["disabled","value"],au={class:"control-help"},iu={key:0,class:"option-field"},ru={class:"option-field-container"},lu=$(Object.assign({mixins:[Se],expose:["validate","clearValidationErrors","schema"],emits:["model-updated"],data(){return{checkedGroup:null,fieldModel:{...this.model},renderedTrack:[],fieldSchema:[],scope:"scope"}},watch:{checkedGroup:{handler(e,n){if(this.renderedTrack[e]=1,n===null){this.fieldModel={...this.model};return}const o=this.schema.fields[e].fields,a=this.schema.fields[n].fields;a&&a.forEach(i=>this.updateModel("",i.model)),o&&o.forEach(i=>this.updateModel(this.fieldModel[i.model],i.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((e,n)=>{this.renderedTrack.push(0),e.fields&&e.fields.forEach(o=>{var a;this.model[o.model]&&(this.checkedGroup=n,this.fieldSchema.push(o.model),this.scope=(a=o.label)==null?void 0:a.toLowerCase())})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldSelectionGroup",setup(e){const{t:n}=ue.createI18n("en-us",pe);return(o,a)=>(t.openBlock(),t.createElementBlock("div",eu,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.$props.disabled?"k-tooltip":"div"),{"max-width":"300",text:t.unref(n)("general.disable_global_radio",{scope:o.scope})},{default:t.withCtx(()=>[t.createElementVNode("div",tu,[t.createElementVNode("div",nu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:t.normalizeClass(["option-group",{"radio-disabled":o.$props.disabled}])},[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${i.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>o.checkedGroup=l),class:"k-input",disabled:o.$props.disabled,type:"radio",value:r},null,8,ou),[[t.vModelRadio,o.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(i.label)+" ",1),t.createElementVNode("div",au,t.toDisplayString(i.description),1)],2)],2))),128))])])]),_:1},8,["text"])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:"option-group"},[o.renderedTrack[r]?t.withDirectives((t.openBlock(),t.createElementBlock("div",iu,[t.createElementVNode("div",ru,[t.createVNode(Y,{model:o.model,options:{helpAsHtml:!0},schema:{fields:i.fields},onModelUpdated:o.updateModel},null,8,["model","schema","onModelUpdated"])])],512)),[[t.vShow,i.fields&&o.checkedGroup===r]]):t.createCommentVNode("",!0)]))),128))]))}}),[["__scopeId","data-v-0dda17d6"]]),su={class:"form-field-wrapper"},du=t.defineComponent({__name:"FieldSwitch",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,{t:r}=ue.createI18n("en-us",pe),l=g=>g!=null&&a.schema.valueOn?g===a.schema.valueOn:g,s=g=>g!=null&&a.schema.valueOn?g?a.schema.valueOn:a.schema.valueOff:g,c=t.toRefs(a),{getFieldID:m,value:p,clearValidationErrors:f}=Te.useAbstractFields({model:c.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:l,formatValueToModel:s,emitModelUpdated:g=>{i("modelUpdated",g.value,g.model)}});return n({clearValidationErrors:f}),(g,M)=>{const B=t.resolveComponent("KInputSwitch");return t.openBlock(),t.createElementBlock("div",su,[t.createVNode(B,{id:t.unref(m)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":M[0]||(M[0]=h=>t.isRef(p)?p.value=h:null),autocomplete:e.schema.autocomplete,class:t.normalizeClass(e.schema.fieldClasses),disabled:e.disabled||void 0,label:t.unref(p)?e.schema.textOn||t.unref(r)("vfg.labels.on"):e.schema.textOff||t.unref(r)("vfg.labels.off"),"label-attributes":{info:e.schema.help},name:e.schema.inputName,required:e.schema.required||void 0},null,8,["id","modelValue","autocomplete","class","disabled","label","label-attributes","name","required"])])}}}),cu={class:"field-textarea"},mu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:_c,FieldArray:Bm,FieldArrayCardContainer:ma,FieldArrayItem:ua,FieldArrayMultiItem:fa,FieldAutoSuggest:pa,FieldAutoSuggestV2:ya,FieldCheckbox:Rm,FieldChecklist:qm,FieldInput:ba,FieldKeyValuePairs:Xm,FieldLabel:Jm,FieldMetric:_a,FieldMultiselect:Qm,FieldObject:Ea,FieldObjectAdvanced:Sa,FieldRadio:Ta,FieldSelect:Ca,FieldSelectionGroup:lu,FieldSwitch:du,FieldTextArea:$(t.defineComponent({__name:"FieldTextArea",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),l=t.inject(he,void 0),{updateModelValue:s,getFieldID:c,clearValidationErrors:m,value:p}=Te.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:g=>{i("modelUpdated",g.value,g.model)}});n({clearValidationErrors:m});const f=g=>{p.value=g,s(g,g)};return(g,M)=>{const B=t.resolveComponent("KTextArea");return t.openBlock(),t.createElementBlock("div",cu,[t.createVNode(B,t.mergeProps(g.$attrs,{id:t.unref(c)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":M[0]||(M[0]=h=>t.isRef(p)?p.value=h:null),autosize:"","character-limit":e.schema.max,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint||void 0,minlength:e.schema.min,name:e.schema.inputName,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,resizable:"",rows:e.schema.rows||3}),null,16,["id","modelValue","character-limit","class","disabled","help","minlength","name","placeholder","readonly","required","rows"]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(l)),{schema:e.schema,update:f,value:t.unref(p)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-0e146fba"]])},Symbol.toStringTag,{value:"Module"})),mixins:[qo],inject:{"vfg-array-item-index":{default:void 0}},props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated","refreshModel"],data(){return{child:t.ref()}},computed:{schema(){var n;if(!((n=this.field)!=null&&n.schema)||!Array.isArray(this.field.schema.fields))return this.field;const e=this["vfg-array-item-index"];return typeof e!="number"||Number.isNaN(e)?this.field:{...this.field,schema:{...this.field.schema,fields:this.field.schema.fields.map(o=>({...o,...o.id?{id:`${o.id}-${e}`}:void 0}))}}}},methods:{sanitize(e){return kl.sanitize(e)},fieldTypeHasLabel(e){if(G(e.label))return!1;let n="";switch(e.type==="input"?n=e.inputType:n=e.type,n){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(e){const n=P(this.options,"fieldIdPrefix","");return hn(e,n)},getTooltipId(e){return`${this.getFieldID(e)}-tooltip`},getFieldComponent(e){return e.component?e.component:"field-"+e.type},getButtonType(e){return P(e,"type","button")},onFieldValidated(e,n,o){this.$emit("validated",e,n,o)},buttonVisibility(e){return e.buttons&&e.buttons.length>0},buttonClickHandler(e,n,o){return e.onclick.call(this,this.model,n,o,this)},fieldHint(e){return v(e.hint)?e.hint.call(this,this.model,e,this):e.hint},fieldErrors(e){return this.errors.filter(n=>n.field.fieldName===e.fieldName).map(n=>n.error)},onRefreshModel(){this.$emit("refreshModel")},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},validate(e){return this.$refs.child.validate(e)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(e){return e?e.replace(/^[cC]onfig\./,""):""}}},uu=["innerHTML"],fu={class:"icon-wrapper"},hu={key:0,class:"link-wrapper"},pu={class:"field-wrap"},gu={key:0,class:"buttons"},yu=["type","onClick","textContent"],bu={key:1,class:"hint"},_u={key:2,class:"errors help-block"};function Eu(e,n,o,a,i,r){const l=t.resolveComponent("KExternalLink"),s=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[r.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(s,{key:0,"aria-describedby":o.field.help?r.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:r.getFieldID(o.field),info:!o.options.helpAsHtml&&o.field.help?o.field.help:void 0,"tooltip-attributes":o.field.help?{maxWidth:"300",placement:"top",tooltipId:r.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",fu,[t.createElementVNode("span",null,t.toDisplayString(r.formattedLabel(o.field.label)),1)]),o.field.link?(t.openBlock(),t.createElementBlock("div",hu,[t.createVNode(l,{href:o.field.link},{default:t.withCtx(()=>n[0]||(n[0]=[t.createElementVNode("span",{class:"section-header"},"More info",-1)])),_:1},8,["href"])])):t.createCommentVNode("",!0)]),_:2},[o.options.helpAsHtml&&o.field.help?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:r.sanitize(o.field.help)},null,8,uu)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",pu,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(o.field)),t.mergeProps(e.$attrs,{ref:"child",disabled:e.fieldDisabled(o.field)||null,"form-options":o.options,hint:o.field.hint&&o.field.type==="input"?r.fieldHint(o.field):void 0,model:o.model,schema:r.schema,vfg:o.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onRefreshModel","onValidated"])),r.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",gu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.field.buttons,(c,m)=>(t.openBlock(),t.createElementBlock("button",{key:m,class:t.normalizeClass(c.classes),type:r.getButtonType(c),onClick:p=>r.buttonClickHandler(c,o.field,p),textContent:t.toDisplayString(c.label)},null,10,yu))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&o.field.type!=="input"?(t.openBlock(),t.createElementBlock("div",bu,t.toDisplayString(r.fieldHint(o.field)),1)):t.createCommentVNode("",!0),r.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",_u,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fieldErrors(o.field),(c,m)=>(t.openBlock(),t.createElementBlock("span",{key:m},t.toDisplayString(c),1))),128))])):t.createCommentVNode("",!0)],2)}const wa=$(mu,[["render",Eu],["__scopeId","data-v-106c6dba"]]);var bt=(e=>(e.REDIS_CE="redis-ce",e.REDIS_EE="redis-ee",e))(bt||{});const Su=e=>{var n,o;return e.type===bt.REDIS_CE?"Host/Port":(n=e.config.sentinel_nodes)!=null&&n.length?"Sentinel":(o=e.config.cluster_nodes)!=null&&o.length?"Cluster":"Host/Port"},Tu={[bt.REDIS_CE]:"open source",[bt.REDIS_EE]:"enterprise"},ka=e=>Tu[e]??"",Cu={class:"partial-config-card"},wu={class:"config-card-row-label"},ku={class:"label-text"},Mu=["data-testid"],Au=["data-testid"],Nu={key:1},Iu=["data-testid"],Ou=["data-testid"],Vu=$(t.defineComponent({__name:"RedisConfigCard",props:{configFields:{type:Object,required:!0},pluginRedisFields:{type:Array,required:!0}},setup(e){const{t:n,formatUnixTimeStamp:o}=ue.createI18n("en-us",pe),a={id:{order:1},name:{order:1},type:{label:n("redis.config_card.common_fields.type_label"),hidden:!0,type:"hidden"},created_at:{label:n("redis.config_card.common_fields.created_at_label"),formatter:o,order:2},updated_at:{label:n("redis.config_card.common_fields.updated_at_label"),formatter:o,order:3}},i=e,r=f=>f!=null,l=(f,g)=>r(g)&&["password","sentinel_password"].includes(f)?"password":"text",{convertKeyToTitle:s}=wt.useStringHelpers(),c=t.computed(()=>Object.entries(i.configFields).map(([f,g])=>{var M,B,h,C;return{key:f,label:((M=a[f])==null?void 0:M.label)??s(f),value:(B=a[f])!=null&&B.formatter?a[f].formatter(g):g,type:((h=a[f])==null?void 0:h.type)??l(f,g),order:((C=a[f])==null?void 0:C.order)??100}}).sort((f,g)=>f.order-g.order).filter(f=>f.type!=="hidden")),m=Te.useRedisNonStandardFields(i.configFields,i.pluginRedisFields),p=t.computed(()=>c.value.concat(m));return(f,g)=>{const M=t.resolveComponent("KCopy");return t.openBlock(),t.createElementBlock("div",Cu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,({key:B,label:h,value:C,type:k})=>(t.openBlock(),t.createElementBlock("div",{key:B,class:"partial-config-card-row"},[t.createElementVNode("div",wu,[t.createElementVNode("div",ku,t.toDisplayString(h),1)]),t.createElementVNode("div",{class:"config-card-row-value","data-testid":`${B}-property-value`},[r(C)?(t.openBlock(),t.createElementBlock("div",Nu,[k==="password"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${B}-copy-password`},[t.createVNode(M,{format:"redacted",text:String(C)},null,8,["text"])],8,Iu)):(t.openBlock(),t.createElementBlock("div",{key:1,"data-testid":`${B}-plain-text`},t.toDisplayString(C),9,Ou))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${B}-no-value`}," – ",8,Au))],8,Mu)]))),128))])}}}),[["__scopeId","data-v-c1eb723f"]]),Bu={class:"redis-config-select","data-testid":"redis-config-select"},Fu={class:"selected-redis-config"},Ru=["data-testid"],Du={class:"select-item-name","data-testid":"selected-redis-config"},Lu={class:"empty-redis-config","data-testid":"empty-redis-config"},Uu={key:1,class:"redis-shared-config-error-message","data-testid":"redis-config-fetch-error"},Pu="1000",Ma=$(t.defineComponent({__name:"RedisConfigSelect",props:{defaultRedisConfigItem:{type:String,required:!1,default:""},updateRedisModel:{type:Function,required:!0},pluginRedisFields:{type:Array,required:!0},redisType:{type:String,default:"all"},isCustomPlugin:{type:Boolean,default:!1}},emits:["showNewPartialModal"],setup(e){const{t:n}=ue.createI18n("en-us",pe),o=t.inject(eo),a={konnect:{getOne:"/v2/control-planes/{controlPlaneId}/core-entities/partials/{id}",getAll:"/v2/control-planes/{controlPlaneId}/core-entities/partials"},kongManager:{getOne:"/{workspace}/partials/{id}",getAll:"/{workspace}/partials"}},i=e,r=t.ref(null),{getMessageFromError:l}=wt.useErrors(),s=t.inject(Qn),{debouncedQueryChange:c,loading:m,error:p,loadItems:f,results:g}=wt.useDebouncedFilter(s,a[s.app].getAll,Pu,{fetchedItemsKey:"data",searchKeys:["id","name"]}),M=t.computed(()=>p.value?l(p.value):""),B=I=>{let u=`${s.apiBaseUrl}${a[s.app].getOne}`;return s.app==="konnect"?u=u.replace(/{controlPlaneId}/gi,(s==null?void 0:s.controlPlaneId)||""):s.app==="kongManager"&&(u=u.replace(/\/{workspace}/gi,s!=null&&s.workspace?`/${s.workspace}`:"")),u=u.replace(/{id}/gi,String(I)),u},h=t.computed(()=>{const I=(g.value||[]).map(u=>({label:u.id,name:u.name,value:u.id,type:u.type,tag:Su(u)})).filter(u=>u.type==="redis-ce"||u.type==="redis-ee");return i.redisType!=="all"?I.filter(u=>u.type===i.redisType):I}),{axiosInstance:C}=wt.useAxios(s==null?void 0:s.axiosRequestConfig),k=async I=>{if(I){i.updateRedisModel(I);try{const u=await C.get(B(I));if(u.data.config){const b=Object.assign(u.data,u.data.config);delete b.config,r.value=b}}catch(u){console.error(u)}}};return t.watch(()=>o==null?void 0:o.value,async I=>{I&&await f()}),t.onBeforeMount(()=>{f(),i.defaultRedisConfigItem&&k(i.defaultRedisConfigItem)}),(I,u)=>{const b=t.resolveComponent("KLabel"),w=t.resolveComponent("KBadge"),S=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Bu,[t.createVNode(b,{info:e.isCustomPlugin?t.unref(n)("redis.custom_plugin.tooltip"):t.unref(n)("redis.shared_configuration.tooltip",{type:t.unref(ka)(e.redisType)}),"tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("redis.shared_configuration.title")),1)]),_:1},8,["info"]),u[2]||(u[2]=t.createElementVNode("div",{class:"shared-redis-config-title"},null,-1)),t.createVNode(S,{class:"redis-config-select-trigger","data-testid":"redis-config-select-trigger","enable-filtering":"","filter-function":()=>!0,items:h.value,loading:t.unref(m),"model-value":e.defaultRedisConfigItem,placeholder:t.unref(n)("redis.shared_configuration.selector.placeholder"),onChange:u[1]||(u[1]=y=>k(y==null?void 0:y.value)),onQueryChange:t.unref(c)},{"selected-item-template":t.withCtx(({item:y})=>[t.createElementVNode("div",Fu,t.toDisplayString(y.name),1)]),"item-template":t.withCtx(({item:y})=>[t.createElementVNode("div",{class:"plugin-form-redis-configuration-dropdown-item","data-testid":`redis-configuration-dropdown-item-${y.name}`},[t.createElementVNode("span",Du,t.toDisplayString(y.name),1),t.createVNode(w,{appearance:"info",class:"select-item-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.tag),1)]),_:2},1024)],8,Ru)]),empty:t.withCtx(()=>[t.createElementVNode("div",Lu,t.toDisplayString(t.unref(n)("redis.shared_configuration.empty_state")),1)]),"dropdown-footer-text":t.withCtx(()=>[t.createElementVNode("div",{class:"new-redis-config-area","data-testid":"new-redis-config-area",onClick:u[0]||(u[0]=y=>I.$emit("showNewPartialModal"))},[t.createVNode(t.unref(Ce.AddIcon),{size:t.unref(Fc)},null,8,["size"]),t.createElementVNode("span",null,t.toDisplayString(t.unref(n)("redis.shared_configuration.create_new_configuration",{type:t.unref(ka)(e.redisType)})),1)])]),_:1},8,["items","loading","model-value","placeholder","onQueryChange"])]),r.value?(t.openBlock(),t.createBlock(Vu,{key:0,"config-fields":r.value,"plugin-redis-fields":e.pluginRedisFields},null,8,["config-fields","plugin-redis-fields"])):t.createCommentVNode("",!0),M.value?(t.openBlock(),t.createElementBlock("p",Uu,t.toDisplayString(M.value||t.unref(n)("redis.shared_configuration.error")),1)):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-0001f209"]]),$u={key:0},vu={class:"redis-config-radio-group","data-testid":"redis-config-radio-group"},xu={key:0,class:"shared-redis-config"},ju={key:1,class:"dedicated-redis-config"},qu={class:"dedicated-redis-config-title"},zu={name:"VueFormGenerator",components:{formGroup:wa,formRedis:$(t.defineComponent({__name:"FormRedis",props:{tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}},model:{type:Object,default:()=>{}},options:{type:Object,required:!0},field:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default(){return[]}},redisPath:{type:String,default:void 0,required:!1},isEditing:{type:Boolean,default:!1}},emits:["modelUpdated","partialToggled","showNewPartialModal","refreshModel","validated"],setup(e,{emit:n}){const o=e,a=n,{t:i}=ue.createI18n("en-us",pe),r=t.computed(()=>o.field.pluginType==="custom"),l=t.ref(!o.isEditing),s=t.ref(),c=t.ref({}),m=t.ref(),p=h=>v(h.visible)?h.visible.call(this,o.model,h,this):G(h.visible)?!0:h.visible,f=async h=>{a("modelUpdated",[{id:h,path:o.redisPath}],"partials"),m.value=[{id:h,path:o.redisPath}],s.value=h},g=(h,C)=>{c.value={...c.value,[C]:h},a("modelUpdated",h,C)},M=()=>{a("refreshModel")},B=(h,C,k)=>{a("validated",h,C,k)};return t.watch(()=>l.value,h=>{h?m.value&&a("partialToggled","redis",{partials:m.value}):a("partialToggled","partials",c.value)}),t.onBeforeMount(()=>{var h,C,k;if(o.model&&(c.value=o.field.fields.reduce((I,u)=>(Object.keys(o.model).includes(u.model)&&(I[u.model]=o.model[u.model]),I),{})),(k=(C=(h=o==null?void 0:o.model)==null?void 0:h.partials)==null?void 0:C[0])!=null&&k.id){const I=o.model.partials[0].id;l.value=!0,s.value=I}}),(h,C)=>{const k=t.resolveComponent("KAlert"),I=t.resolveComponent("KBadge"),u=t.resolveComponent("KRadio"),b=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",null,[r.value?(t.openBlock(),t.createElementBlock("div",$u,[t.createVNode(k,{"data-testid":"custom-plugin-redis-config-note",message:t.unref(i)("redis.custom_plugin.alert")},null,8,["message"]),t.createVNode(Ma,{"default-redis-config-item":s.value,"is-custom-plugin":"","plugin-redis-fields":e.field.fields,"update-redis-model":f,onShowNewPartialModal:C[0]||(C[0]=w=>h.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields"])])):(t.openBlock(),t.createBlock(b,{key:1,class:"redis-config-card","data-testid":"redis-config-card",title:t.unref(i)("redis.title")},{default:t.withCtx(()=>[t.createElementVNode("div",vu,[t.createVNode(u,{modelValue:l.value,"onUpdate:modelValue":C[1]||(C[1]=w=>l.value=w),card:"","card-orientation":"horizontal","data-testid":"shared-redis-config-radio",description:t.unref(i)("redis.shared_configuration.description"),label:t.unref(i)("redis.shared_configuration.label"),"selected-value":!0},{default:t.withCtx(()=>[t.createVNode(I,{appearance:"success"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("redis.shared_configuration.badge")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),t.createVNode(u,{modelValue:l.value,"onUpdate:modelValue":C[2]||(C[2]=w=>l.value=w),card:"","card-orientation":"horizontal","data-testid":"dedicated-redis-config-radio",description:t.unref(i)("redis.dedicated_configuration.description"),label:t.unref(i)("redis.dedicated_configuration.label"),"selected-value":!1},null,8,["modelValue","description","label"])]),l.value?(t.openBlock(),t.createElementBlock("div",xu,[t.createVNode(Ma,{"default-redis-config-item":s.value,"plugin-redis-fields":e.field.fields,"redis-type":e.field.redisType,"update-redis-model":f,onShowNewPartialModal:C[3]||(C[3]=w=>h.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields","redis-type"])])):(t.openBlock(),t.createElementBlock("div",ju,[t.createElementVNode("div",qu,t.toDisplayString(t.unref(i)("redis.dedicated_configuration.title")),1),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.field.fields,w=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:w.model},[p(w)?(t.openBlock(),t.createBlock(wa,{key:0,ref_for:!0,ref:"children",errors:e.errors,field:w,model:e.model,options:e.options,vfg:e.vfg,onModelUpdated:g,onRefreshModel:M,onValidated:B},null,8,["errors","field","model","options","vfg"])):t.createCommentVNode("",!0)],64))),128))]),_:1}))]))]),_:1},8,["title"]))])}}}),[["__scopeId","data-v-b9a17494"]])},mixins:[qo],inject:{autofillSlot:{from:he,default:void 0}},provide(){var e;return{...!this.autofillSlot&&{[he]:(e=this.$slots)==null?void 0:e[ze]}}},props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:t.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}},enableRedisPartial:{type:Boolean,default:!1},isEditing:{type:Boolean,default:!1}},emits:["validated","modelUpdated","refreshModel","partialToggled","showNewPartialModal"],data(){return{vfg:this,errors:[],children:t.ref([]),collapseStates:{}}},computed:{fields(){const e=[];return this.schema&&this.schema.fields&&re(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&re(this.schema.groups.slice(0),n=>{e.push(n)}),e}},watch:{model:{deep:!0,handler(e,n){n!==e&&e!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(e){return v(e.visible)?e.visible.call(this,this.model,e,this):G(e.visible)?!0:e.visible},onFieldValidated(e,n,o){this.errors=this.errors.filter(i=>i.field.fieldName!==o.schema.fieldName),!e&&n&&n.length>0&&re(n,i=>{this.errors.push({field:o.schema,error:i})});const a=this.errors.length===0;this.$emit("validated",a,this.errors,this)},onRefreshModel(){this.$emit("refreshModel")},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},onPartialToggled(e,n){this.$emit("partialToggled",e,n)},validate(e=null){e===null&&(e=P(this.options,"validateAsync",!1)),this.clearValidationErrors();const n=[],o=[];re(this.$refs.children,i=>{v(i.validate)&&(n.push(i.$refs.child),o.push(i.$refs.child.validate(!0)))});const a=i=>{const r=[];re(i,(s,c)=>{Array.isArray(s)&&s.length>0&&re(s,m=>{r.push({field:n[c].schema,error:m})})}),this.errors=r;const l=r.length===0;return this.$emit("validated",l,r,this),e?r:l};return e?Promise.all(o).then(a):a(o)},clearValidationErrors(){this.errors.splice(0),re(this.$refs.children,e=>{e.clearValidationErrors()})}}},Ku={key:0,class:"vue-form-generator"},Hu={key:0};function Yu(e,n,o,a,i,r){const l=t.resolveComponent("form-redis"),s=t.resolveComponent("form-group"),c=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",Ku,[o.schema.fields?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fields,m=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m.model},[m.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(l,{key:0,errors:i.errors,field:m,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onPartialToggled:r.onPartialToggled,onShowNewPartialModal:p=>e.$emit("showNewPartialModal",m.redisType),onValidated:r.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):r.fieldVisible(m)?(t.openBlock(),t.createBlock(s,{key:1,ref_for:!0,ref:"children",errors:i.errors,field:m,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:1})):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.groups,(m,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`group-${p}`},[m.collapsible!==void 0&&m.collapsible!==!1?(t.openBlock(),t.createBlock(c,{key:0,class:"root-level-collapse","model-value":!1,title:m.collapsible.title},t.createSlots({default:t.withCtx(()=>{var f,g,M,B;return[(f=m.slots)!=null&&f.beforeContent?t.renderSlot(e.$slots,(g=m.slots)==null?void 0:g.beforeContent,{key:0}):t.createCommentVNode("",!0),m.fields.length===0&&((M=m.slots)!=null&&M.emptyState)?t.renderSlot(e.$slots,(B=m.slots)==null?void 0:B.emptyState,{key:1}):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:2,class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.fields,h=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:h.model},[r.fieldVisible(h)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:i.errors,field:h,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),m.collapsible!==!0&&m.collapsible.nestedCollapsible&&m.collapsible.nestedCollapsible.fields.length>0?(t.openBlock(),t.createBlock(c,{key:3,class:"nested-collapse","model-value":i.collapseStates[`group-${p}-nested`]??!0,"trigger-alignment":"leading","trigger-label":i.collapseStates[`group-${p}-nested`]??!0?m.collapsible.nestedCollapsible.triggerLabel.expand:m.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":h=>i.collapseStates[`group-${p}-nested`]=h},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.collapsible.nestedCollapsible.fields,h=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:h.model},[h.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(l,{key:0,errors:i.errors,field:h,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onPartialToggled:r.onPartialToggled,onShowNewPartialModal:C=>e.$emit("showNewPartialModal",h.redisType),onValidated:r.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):r.fieldVisible(h)?(t.openBlock(),t.createBlock(s,{key:1,ref_for:!0,ref:"children",errors:i.errors,field:h,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):t.createCommentVNode("",!0)]}),_:2},[m.collapsible.description?{name:"visible-content",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(m.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:1,class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[m.legend?(t.openBlock(),t.createElementBlock("legend",Hu,t.toDisplayString(m.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.fields,f=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:f.model},[r.fieldVisible(f)?(t.openBlock(),t.createBlock(s,{key:0,ref_for:!0,ref:"children",errors:i.errors,field:f,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):t.createCommentVNode("",!0)}const Y=$(zu,[["render",Yu]]),_t={openIdConnectDocs:"https://developer.konghq.com/plugins/openid-connect/",openIdConnectJWKDocs:"https://developer.konghq.com/plugins/openid-connect/reference/#schema--config-client-jwk",openIdConnectClusterNodesDocs:"https://developer.konghq.com/plugins/openid-connect/reference/#schema--config-redis-cluster-nodes",openIdConfigurationDocs:"https://developer.konghq.com/plugins/openid-connect/reference/",openIdAuthorizationDocs:"https://developer.konghq.com/plugins/openid-connect/#authorization"},Aa=new Set(["config-client_id","config-client_secret","config-issuer"]),Na=new Set(["config-scopes_claim","config-scopes_required","config-audience_claim","config-audience_required","config-roles_claim","config-roles_required","config-groups_claim","config-groups_required","config-authenticated_groups_claim"]),Gu={name:"OIDCForm",components:{VueFormGenerator:Y},provide(){var e;return{[he]:(e=this.$slots)==null?void 0:e[ze]}},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},onPartialToggled:{type:Function,required:!0},isEditing:{type:Boolean,required:!0},enableRedisPartial:{type:Boolean,required:!1},showNewPartialModal:{type:Function,default:()=>{}}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,openIdConnectLink:_t.openIdConnectDocs,openIdConnectJWKLink:_t.openIdConnectJWKDocs,openIdConnectClusterNodesLink:_t.openIdConnectClusterNodesDocs,openIdConfigurationDocs:_t.openIdConfigurationDocs,openIdAuthorizationDocs:_t.openIdAuthorizationDocs,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var e;if(!this.init){this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(i=>!i.model.startsWith("config")&&i.model!=="tags")};const n=this.formSchema.fields.reduce((i,r)=>(i[r.model]=r,i),{});this.commonFieldsSchema={fields:Array.from(Aa).reduce((i,r)=>(n[r]&&i.push(n[r]),i),[])},this.authFieldsSchema={fields:Array.from(Na).reduce((i,r)=>(n[r]&&i.push(n[r]),i),[])};const{redis:o,redisModels:a}=Te.useRedisPartial(this.formSchema);this.advancedFieldsSchema={fields:this.formSchema.fields.filter(i=>i.model.startsWith("config")&&i.model!=="config-auth_methods"&&!Aa.has(i.model)&&!Na.has(i.model)&&(!this.enableRedisPartial||!a.includes(i.model))||i.model==="tags").reduce((i,r)=>{var l,s,c,m;switch(r.model){case"config-client_jwk":{if(Array.isArray((s=(l=r.items)==null?void 0:l.schema)==null?void 0:s.fields))for(const p of r.items.schema.fields)p.label=p.model;i.push({...r,link:this.openIdConnectJWKLink,newElementButtonLabel:"+ Add Client JWK",...Array.isArray((m=(c=r.items)==null?void 0:c.schema)==null?void 0:m.fields)&&r.items.schema.fields.map(p=>({...p,label:p.model}))});break}case"config-session_redis_cluster_nodes":{i.push({...r,link:this.openIdConnectClusterNodesLink,newElementButtonLabel:"+ Add Cluster Node"});break}default:i.push(r)}return i},[])},this.enableRedisPartial&&this.advancedFieldsSchema.fields.unshift(o),this.sessionManagement=this.formModel["config-auth_methods"].includes("session"),this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.formModel["config-auth_methods"].includes("authorization_code")},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.formModel["config-auth_methods"].includes("bearer")},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.formModel["config-auth_methods"].includes("client_credentials")},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.formModel["config-auth_methods"].includes("password")},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.formModel["config-auth_methods"].includes("introspection")},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.formModel["config-auth_methods"].includes("userinfo")},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.formModel["config-auth_methods"].includes("kong_oauth2")},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.formModel["config-auth_methods"].includes("refresh_token")}];for(const i of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const r of i.fields){const l=(e=n[r.model])==null?void 0:e.help;r.help===void 0&&typeof l=="string"&&(r.help=l)}}},getAuthMethodsValue(e,n){const o=[];for(let a=0;a<this.authMethods.length;a++)this.authMethods[a].prop&&this.authMethods[a].value!==e&&o.push(this.authMethods[a].value);return this.sessionManagement&&e&&o.push("session"),n&&(e?o.push(e):o.push("session")),o},handleUpdate(e,n){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(n,e),this.onModelUpdated()}}},Wu={class:"general-settings"},Zu={class:"link-wrapper"},Xu={class:"auth-method-container"},Ju={class:"general-settings"},Qu={class:"link-wrapper"},ef={class:"general-settings"},tf={class:"link-wrapper"};function nf(e,n,o,a,i,r){const l=t.resolveComponent("VueFormGenerator"),s=t.resolveComponent("KExternalLink"),c=t.resolveComponent("KLabel"),m=t.resolveComponent("KCheckbox"),p=t.resolveComponent("KInputSwitch"),f=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[o.formModel.id&&o.isEditing||!o.isEditing?(t.openBlock(),t.createBlock(l,{key:0,class:"global-fields",model:o.formModel,options:o.formOptions,schema:i.globalFields,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(f,{tabs:i.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",Wu,[t.createElementVNode("div",Zu,[t.createVNode(s,{href:i.openIdConfigurationDocs},{default:t.withCtx(()=>n[2]||(n[2]=[t.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)])),_:1},8,["href"])]),n[4]||(n[4]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(l,{key:0,model:o.formModel,options:o.formOptions,schema:i.commonFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(c,null,{default:t.withCtx(()=>n[3]||(n[3]=[t.createTextVNode("Auth Methods")])),_:1}),t.createElementVNode("div",Xu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.authMethods,g=>(t.openBlock(),t.createElementBlock("div",{key:g.value,class:"auth-method"},[t.createVNode(m,{modelValue:g.prop,"onUpdate:modelValue":M=>g.prop=M,onChange:M=>r.handleUpdate(M,g.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(g.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(p,{modelValue:i.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=g=>i.sessionManagement=g),label:"Enable Session Management",onChange:r.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",Ju,[t.createElementVNode("div",Qu,[t.createVNode(s,{href:i.openIdAuthorizationDocs},{default:t.withCtx(()=>n[5]||(n[5]=[t.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)])),_:1},8,["href"])]),n[6]||(n[6]=t.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(l,{key:0,model:o.formModel,options:o.formOptions,schema:i.authFieldsSchema,onModelUpdated:o.onModelUpdated},{"autofill-provider":t.withCtx(g=>[t.renderSlot(e.$slots,"autofill-provider",t.normalizeProps(t.guardReactiveProps(g)),void 0,!0)]),_:3},8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),advanced:t.withCtx(()=>[t.createElementVNode("div",ef,[t.createElementVNode("div",tf,[t.createVNode(s,{href:i.openIdConnectLink},{default:t.withCtx(()=>n[7]||(n[7]=[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)])),_:1},8,["href"])]),n[8]||(n[8]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(l,{key:0,"enable-redis-partial":o.enableRedisPartial,"is-editing":o.isEditing,model:o.formModel,options:o.formOptions,schema:i.advancedFieldsSchema,onModelUpdated:o.onModelUpdated,onPartialToggled:o.onPartialToggled,onShowNewPartialModal:n[1]||(n[1]=()=>o.showNewPartialModal(o.formSchema._supported_redis_partial_type))},null,8,["enable-redis-partial","is-editing","model","options","schema","onModelUpdated","onPartialToggled"])):t.createCommentVNode("",!0)])]),_:3},8,["tabs"])])}const of=$(Gu,[["render",nf],["__scopeId","data-v-741bf3cb"]]),af=$(t.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var l;t.provide(he,(l=t.useSlots())==null?void 0:l[ze]);const{t:n,te:o}=ue.createI18n("en-us",pe),a=e,i=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),r=t.computed(()=>{const s=a.formSchema;return s.fields.map(c=>{const m=`post-function.${c.model}`;return c.hint=o(`${m}.hint`)&&n(`${m}.hint`)||c.hint,c.help=o(`${m}.help`)&&n(`${m}.help`)||c.help,c.newElementButtonLabel=o(`${m}.newElementButtonLabel`)&&n(`${m}.newElementButtonLabel`)||c.newElementButtonLabel,c.model!=="tags"&&(c.valueType==="array"||c.type==="array")&&(c.type="array",c.valueArrayType="array",c.itemContainerComponent="FieldArrayItem",c.fieldClasses="post-function-array-item-container",c.fieldItemsClasses="post-function-array-item",c.inputAttributes={...c.inputAttributes,type:"textarea"}),c}),s});return(s,c)=>i.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-f54f37ae"]]),rf=$(t.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var l;t.provide(he,(l=t.useSlots())==null?void 0:l[ze]);const{t:n,te:o}=ue.createI18n("en-us",pe),a=e,i=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),r=t.computed(()=>{const s=a.formSchema;return s.fields.map(c=>{const m=`exit-transformer.${c.model}`;return c.hint=o(`${m}.hint`)&&n(`${m}.hint`)||c.hint,c.help=o(`${m}.help`)&&n(`${m}.help`)||c.help,c.newElementButtonLabel=o(`${m}.newElementButtonLabel`)&&n(`${m}.newElementButtonLabel`)||c.newElementButtonLabel,c.model!=="tags"&&(c.valueType==="array"||c.type==="array")&&(c.type="array",c.valueArrayType="array",c.itemContainerComponent="FieldArrayItem",c.fieldClasses="exit-transformer-array-item-container",c.fieldItemsClasses="exit-transformer-array-item",c.inputAttributes={...c.inputAttributes,type:"textarea"}),c}),s});return(s,c)=>i.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0d5c541f"]]),lf={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},sf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},df={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},cf={class:"general-settings"},mf={class:"sub-form"},uf={class:"general-settings"},ff={class:"sub-form"},hf={class:"general-settings"},pf=$(t.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var w;t.provide(he,(w=t.useSlots())==null?void 0:w[ze]);const n=e,o=t.ref("zeroSsl"),a=t.ref("shm"),i=t.computed(()=>{var y;const S={};if((y=n.formSchema)!=null&&y.fields)for(const F of n.formSchema.fields)S[F.model]=F;return S}),r=t.computed(()=>{var y;const S=Ie(lf);for(const F of S.fields){const x=(y=i.value[F.model])==null?void 0:y.help;F.help===void 0&&typeof x=="string"&&(F.help=x)}return S}),l=t.computed(()=>{var y;const S=Ie(sf);for(const F of S.fields){const x=(y=i.value[F.model])==null?void 0:y.help;F.help===void 0&&typeof x=="string"&&(F.help=x)}return S}),s=t.computed(()=>{var y;const S=Ie(df);for(const F of S.fields){const x=(y=i.value[F.model])==null?void 0:y.help;F.help===void 0&&typeof x=="string"&&(F.help=x)}return S}),c=t.computed(()=>({fields:n.formSchema.fields.filter(S=>!S.model.startsWith("config")&&S.model!=="tags")})),m=t.computed(()=>({fields:r.value.fields.filter(y=>!l.value.fields.some(F=>F.model===y.model)&&!s.value.fields.some(F=>F.model===y.model))})),p=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage")&&!y.model.startsWith("config-storage_config-consul")&&!y.model.startsWith("config-storage_config-redis")&&!y.model.startsWith("config-storage_config-shm")&&!y.model.startsWith("config-storage_config-vault"))})),f=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-consul"))})),g=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-redis"))})),M=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-shm"))})),B=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-vault"))})),h=t.computed(()=>({fields:n.formSchema.fields.filter(S=>S.model.startsWith("config")&&!m.value.fields.filter(y=>y.model===S.model).length&&!p.value.fields.filter(y=>y.model===S.model).length||S.model==="tags")})),C=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),k=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],I=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];t.onMounted(()=>{o.value==="zeroSsl"&&(n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const u=S=>{o.value=S.value,(S.value==="zeroSsl"||S.value==="other")&&(S.value==="zeroSsl"?n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":n.formModel["config-api_uri"]="https://acme.example.com/",n.formModel["config-tos_accepted"]=!1),S.value==="letsEncrypt"&&(n.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",n.formModel["config-eab_hmac_key"]="",n.formModel["config-eab_kid"]=""),n.onModelUpdated()},b=(S,y)=>{y==="config-storage"&&(a.value=S),n.onModelUpdated()};return(S,y)=>{const F=t.resolveComponent("KSelect"),x=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[e.formModel.id&&e.isEditing||!e.isEditing?(t.openBlock(),t.createBlock(Y,{key:0,class:"global-fields",model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(x,{tabs:k},{general:t.withCtx(()=>[t.createElementVNode("div",cf,[y[0]||(y[0]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),y[1]||(y[1]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:m.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),y[2]||(y[2]=t.createElementVNode("hr",null,null,-1)),t.createVNode(F,{class:"issuer-select",items:I,label:"Issuer",onChange:u}),t.createElementVNode("div",mf,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),o.value==="zeroSsl"||o.value==="other"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),storage:t.withCtx(()=>[t.createElementVNode("div",uf,[y[3]||(y[3]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),y[4]||(y[4]=t.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:p.value,onModelUpdated:b},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",ff,[a.value==="consul"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:f.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="redis"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:g.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="shm"?(t.openBlock(),t.createBlock(Y,{key:2,model:e.formModel,options:e.formOptions,schema:M.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="vault"?(t.openBlock(),t.createBlock(Y,{key:3,model:e.formModel,options:e.formOptions,schema:B.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),advanced:t.withCtx(()=>[t.createElementVNode("div",hf,[y[5]||(y[5]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),y[6]||(y[6]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:h.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-07cecf5b"]]),gf={class:"rla-form-basic-fields"},yf={class:"rla-form-request-limits-subtitle"},bf={class:"rla-form-request-limits-content"},_f={class:"rla-form-window-type"},Ef=["innerHTML"],Sf={class:"rla-form-window-type-radios"},Tf={class:"rla-form-request-limits-items"},Cf={class:"rla-form-request-limits-row"},wf=["id"],kf={class:"rla-form-request-limits-actions"},Mf={key:0,class:"rla-form-request-limits-examples"},Af={class:"rla-form-request-limits-examples-badges"},Nf=["innerHTML"],If={id:"rla-form-error-legend",class:"rla-form-error-inputs"},Of=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:pf,ExitTransformer:rf,OIDCForm:of,PostFunction:af,RLAForm:$(t.defineComponent({__name:"RLAForm",props:{formSchema:{},formModel:{},formOptions:{},onModelUpdated:{type:Function},onPartialToggled:{type:Function},showNewPartialModal:{type:Function},isEditing:{type:Boolean},enableRedisPartial:{type:Boolean}},setup(e){var x;t.provide(he,(x=t.useSlots())==null?void 0:x[ze]);const n={fixed:[{label:"500 requests every hour",description:"A fixed limit of 500 requests per hour resetting sharply on the hour, ensuring no user can exceed this limit.",config:{limit:500,window_size:3600}},{label:"200 requests every 30 minutes",description:"Users are allowed 200 requests per 30 minutes, resetting exactly on the 30 minute mark with no carryover of unused limits.",config:{limit:200,window_size:1800}},{label:"500 requests every day",description:"A strict limit of 5000 requests per day resetting promptly at midnight, preventing any burst traffic or inconsistent user experiences.",config:{limit:500,window_size:86400}}],sliding:[{label:"100 requests every hour",description:"Maximum of 100 requests every rolling hour, continuously adjusting the count over the course of the hour. No hard limit or known reset.",config:{limit:100,window_size:3600}},{label:"300 requests every 30 minutes",description:"Each user can make up to 300 requests in any rolling 30 minute period, with older requests dropping off as new requests are made.",config:{limit:300,window_size:1800}},{label:"500 requests every hour",description:`Each user is allowed 500 requests per hour.
3
3
  If the limit is exceeded and the user receives a 429 error, each additional request within the sliding window (hour)
4
4
  will extend the wait time by about 12 minutes, continuously adjusting as new requests are made.`,config:{limit:500,window_size:3600}}]},o=new Set(["selectionGroup","enabled",...["identifier","limit","window_size","error_code","error_message"].map(T=>`config-${T}`)]),a=T=>T===void 0?!1:o.has(T),{t:i}=ue.createI18n("en-us",pe),r=e,l=t.computed(()=>{var V,R,U;const T=(R=(V=r.formSchema)==null?void 0:V.fields)==null?void 0:R.find(ee=>ee.type==="selectionGroup"&&ee.model==="selectionGroup");return{fields:[(U=r.formSchema)==null?void 0:U.fields.find(ee=>ee.model==="enabled"),T].filter(Boolean)}}),s=t.computed(()=>{var ee,Oe;const T=((Oe=(ee=r.formSchema)==null?void 0:ee.fields)==null?void 0:Oe.filter(J=>!a(J.model)))??[],E=[],V=[],R=[];let U=!1;for(const J of T){const Ve=J.model;if(Ve!==void 0){if(Ve.startsWith("config-redis-")){(J.model==="config-redis-cluster_addresses"||J.model==="config-redis-sentinel_addresses")&&(J.inputAttributes.help=i("rla.redis.address_example")),V.push(J);continue}U?R.push(J):E.push(J),J.model==="config-strategy"&&(U=!0)}}return{endsWithStrategy:{fields:E},redis:r.enableRedisPartial?{fields:[{fields:V,id:"_redis",model:"__redis_partial",redisType:r.formSchema._supported_redis_partial_type}]}:{fields:V},afterStrategy:{fields:R}}}),c=t.computed(()=>{const T=r.formModel["config-window_type"];return Object.prototype.hasOwnProperty.call(n,T)?n[T]:[]}),m=t.computed(()=>{var T,E;return(E=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:E.find(V=>V.model==="config-identifier")}),p=t.computed(()=>{var T,E,V;return(((V=(E=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:E.find(R=>R.model==="config-identifier"))==null?void 0:V.values)??[]).map(R=>({label:i(`rla.identifiers.options.${R}`),value:R}))}),f=t.ref(),g=t.ref(!0),M=t.computed(()=>{var T,E,V;return r.formModel["config-window_type"]??((V=(E=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:E.find(R=>R.model==="config-window_type"))==null?void 0:V.default)}),B=t.computed(()=>{var E,V,R,U,ee,Oe;const T=(R=(V=(E=r.formSchema)==null?void 0:E.fields)==null?void 0:V.find(J=>J.model==="config-window_type"))==null?void 0:R.default;return(((Oe=(ee=(U=r.formSchema)==null?void 0:U.fields)==null?void 0:ee.find(J=>J.model==="config-window_type"))==null?void 0:Oe.values)??[]).sort((J,Ve)=>J===T?-1:Ve===T?1:0)}),h=t.computed(()=>{var E;const T=(E=r.formModel["config-limit"])==null?void 0:E.map((V,R)=>{var U,ee;return{limit:V,windowSize:(ee=(U=r.formModel)==null?void 0:U["config-window_size"])==null?void 0:ee[R]}});return!Array.isArray(T)||T.length===0?[{limit:void 0,windowSize:void 0}]:T}),C=t.computed(()=>{var T,E,V,R;return((T=r.formModel)==null?void 0:T["config-identifier"])??((R=(V=(E=r.formSchema)==null?void 0:E.fields)==null?void 0:V.find(U=>U.model==="config-identifier"))==null?void 0:R.default)}),k=t.computed(()=>{var T,E,V,R;return((T=r.formModel)==null?void 0:T["config-error_code"])??((R=(V=(E=r.formSchema)==null?void 0:E.fields)==null?void 0:V.find(U=>U.model==="config-error_code"))==null?void 0:R.default)}),I=t.computed(()=>{var T,E,V,R;return((T=r.formModel)==null?void 0:T["config-error_message"])??((R=(V=(E=r.formSchema)==null?void 0:E.fields)==null?void 0:V.find(U=>U.model==="config-error_message"))==null?void 0:R.default)}),u=(T,E)=>{if(E===f.value){r.onModelUpdated([],"config-limit"),r.onModelUpdated([],"config-window_size"),t.nextTick(()=>{f.value=void 0});return}r.onModelUpdated([T.config.limit],"config-limit"),r.onModelUpdated([T.config.window_size],"config-window_size"),t.nextTick(()=>{f.value=E})},b=T=>{f.value!==void 0&&(f.value=void 0),T!==null&&r.onModelUpdated(T.toString(),"config-window_type")},w=(T,E)=>{var R;f.value!==void 0&&(f.value=void 0);const V=Ie(((R=r.formModel)==null?void 0:R["config-limit"])??[]);V[T]=E,r.onModelUpdated(V,"config-limit")},S=(T,E)=>{var R;f.value!==void 0&&(f.value=void 0);const V=Ie(((R=r.formModel)==null?void 0:R["config-window_size"])??[]);V[T]=E,r.onModelUpdated(V,"config-window_size")},y=T=>{var R,U;f.value!==void 0&&(f.value=void 0);const E=Ie(((R=r.formModel)==null?void 0:R["config-limit"])??[]),V=Ie(((U=r.formModel)==null?void 0:U["config-window_size"])??[]);E.length===0&&E.push(void 0),V.length===0&&V.push(void 0),E.splice(T+1,0,void 0),V.splice(T+1,0,void 0),r.onModelUpdated(E,"config-limit"),r.onModelUpdated(V,"config-window_size")},F=T=>{var E,V;if(h.value.length>1){f.value!==void 0&&(f.value=void 0);const R=Ie(((E=r.formModel)==null?void 0:E["config-limit"])??[]),U=Ie(((V=r.formModel)==null?void 0:V["config-window_size"])??[]);R.length===0&&R.push(void 0),U.length===0&&U.push(void 0),R.splice(T,1),U.splice(T,1),r.onModelUpdated(R,"config-limit"),r.onModelUpdated(U,"config-window_size")}};return t.watch(()=>r.formModel["config-strategy"],T=>{T!=="redis"&&r.formModel.partials&&r.onModelUpdated(void 0,"partials")}),(T,E)=>{const V=t.resolveComponent("KLabel"),R=t.resolveComponent("KRadio"),U=t.resolveComponent("KInput"),ee=t.resolveComponent("KButton"),Oe=t.resolveComponent("KBadge"),J=t.resolveComponent("KTooltip"),Ve=t.resolveComponent("KCard"),En=t.resolveComponent("KSelect"),xt=t.resolveComponent("KCollapse");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",gf,[t.createVNode(Y,{model:T.formModel,options:T.formOptions,schema:l.value,onModelUpdated:E[0]||(E[0]=(O,H)=>T.onModelUpdated(O,H))},null,8,["model","options","schema"]),t.createVNode(Ve,{class:"rla-form-request-limits"},{title:t.withCtx(()=>[t.createVNode(V,{class:"rla-form-request-limits-title",for:"rla-form-request-limits-legend",required:""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.request_limits.title")),1)]),_:1}),t.createElementVNode("div",yf,t.toDisplayString(t.unref(i)("rla.request_limits.subtitle")),1)]),default:t.withCtx(()=>[t.createElementVNode("div",bf,[t.createElementVNode("div",_f,[t.createVNode(V,{class:"rla-form-window-type-label","tooltip-attributes":{maxWidth:"300",placement:"top"}},{tooltip:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:t.unref(i)("rla.window_type.help")},null,8,Ef)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.window_type.label"))+" ",1)]),_:1}),t.createElementVNode("div",Sf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value,O=>(t.openBlock(),t.createBlock(R,{key:`window-type-${O}`,"model-value":M.value,name:O,"selected-value":O,"onUpdate:modelValue":b},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)(`rla.window_type.options.${O}`)),1)]),_:2},1032,["model-value","name","selected-value"]))),128))])]),t.createElementVNode("div",Tf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,(O,H)=>(t.openBlock(),t.createElementBlock("div",{key:H.toString()},[t.createVNode(V,{for:`rla-form-request-limits-item-${H}-legend`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.request_limits.label_index",{index:H+1})),1)]),_:2},1032,["for"]),t.createElementVNode("div",Cf,[t.createElementVNode("legend",{id:`rla-form-request-limits-item-${H}-legend`,class:"rla-form-request-limits-inputs"},[t.createVNode(U,{"model-value":O.limit&&O.limit.toString(),placeholder:t.unref(i)("rla.request_limits.request_number"),type:"number","onUpdate:modelValue":Z=>w(H,Number.parseInt(Z))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.interval_determiner")),1),t.createVNode(U,{"model-value":O.windowSize&&O.windowSize.toString(),placeholder:t.unref(i)("rla.request_limits.time_interval"),type:"number","onUpdate:modelValue":Z=>S(H,Number.parseInt(Z))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.seconds")),1)],8,wf),t.createElementVNode("div",kf,[t.createVNode(ee,{appearance:"tertiary",disabled:h.value.length<=1,onClick:()=>F(H)},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.RemoveIcon))]),_:2},1032,["disabled","onClick"]),t.createVNode(ee,{appearance:"tertiary",onClick:()=>y(H)},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.AddIcon))]),_:2},1032,["onClick"])])])]))),128))]),c.value.length>0?(t.openBlock(),t.createElementBlock("div",Mf,[t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.start_with_a_use_case")),1),t.createElementVNode("div",Af,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(O,H)=>(t.openBlock(),t.createBlock(J,{key:`use-case-${H}`,"max-width":"300"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(O.description),1),E[10]||(E[10]=t.createElementVNode("br",null,null,-1)),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.label"))+": "+t.toDisplayString(O.config.limit),1),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.time_interval"))+": "+t.toDisplayString(O.config.window_size),1)]),default:t.withCtx(()=>[t.createVNode(Oe,{appearance:f.value===`${M.value}-${H}`?"info":"decorative",class:"rla-form-request-limits-examples-badge",onClick:()=>u(O,`${M.value}-${H}`)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(O.label),1)]),_:2},1032,["appearance","onClick"])]),_:2},1024))),128))])])):t.createCommentVNode("",!0)])]),_:1}),t.createVNode(En,{modelValue:C.value,"onUpdate:modelValue":E[1]||(E[1]=O=>C.value=O),class:"rla-form-identifiers",items:p.value,label:t.unref(i)("rla.identifiers.label"),"label-attributes":{tooltipAttributes:{maxWidth:"300",placement:"top"}},required:"",onSelected:E[2]||(E[2]=O=>r.onModelUpdated(O.value,"config-identifier"))},{"label-tooltip":t.withCtx(()=>[t.createElementVNode("div",{innerHTML:m.value&&m.value.help},null,8,Nf)]),_:1},8,["modelValue","items","label"]),t.createElementVNode("div",null,[t.createVNode(V,{for:"rla-form-error-legend",info:t.unref(i)("rla.error_message.help"),required:"","tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.error_message.label")),1)]),_:1},8,["info"]),t.createElementVNode("legend",If,[t.createVNode(U,{class:"input-error-code","model-value":k.value&&k.value.toString(),placeholder:t.unref(i)("rla.error_message.code_placeholder"),type:"number","onUpdate:modelValue":E[3]||(E[3]=O=>T.onModelUpdated(Number.parseInt(O),"config-error_code"))},null,8,["model-value","placeholder"]),E[11]||(E[11]=t.createElementVNode("div",null,":",-1)),t.createVNode(U,{"model-value":I.value,placeholder:t.unref(i)("rla.error_message.message_placeholder"),"onUpdate:modelValue":E[4]||(E[4]=O=>T.onModelUpdated(O,"config-error_message"))},null,8,["model-value","placeholder"])])])]),t.createVNode(xt,{modelValue:g.value,"onUpdate:modelValue":E[9]||(E[9]=O=>g.value=O),"trigger-label":t.unref(i)("rla.view_advanced_fields")},{default:t.withCtx(()=>[t.createVNode(Y,{model:T.formModel,options:T.formOptions,schema:s.value.endsWithStrategy,onModelUpdated:E[5]||(E[5]=(O,H)=>T.onModelUpdated(O,H))},null,8,["model","options","schema"]),T.formModel["config-strategy"]==="redis"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(T.enableRedisPartial?"div":"KCard"),{key:0,class:"rla-form-redis-card",title:t.unref(i)("rla.redis.title")},{default:t.withCtx(()=>[t.createVNode(Y,{"enable-redis-partial":T.enableRedisPartial,"is-editing":T.isEditing,model:T.formModel,options:T.formOptions,schema:s.value.redis,onModelUpdated:E[6]||(E[6]=(O,H)=>T.onModelUpdated(O,H)),onPartialToggled:T.onPartialToggled,onShowNewPartialModal:E[7]||(E[7]=()=>T.showNewPartialModal(T.formSchema._supported_redis_partial_type))},null,8,["enable-redis-partial","is-editing","model","options","schema","onPartialToggled"])]),_:1},8,["title"])):t.createCommentVNode("",!0),t.createVNode(Y,{class:t.normalizeClass({"rla-last-vfg":T.formModel["config-strategy"]!=="redis"}),model:T.formModel,options:T.formOptions,schema:s.value.afterStrategy,onModelUpdated:E[8]||(E[8]=(O,H)=>T.onModelUpdated(O,H))},null,8,["class","model","options","schema"])]),_:1},8,["modelValue","trigger-label"])],64)}}}),[["__scopeId","data-v-f6dcb65c"]])},Symbol.toStringTag,{value:"Module"})),Vf=["array","metric","advanced","selectionGroup","object-advanced"],Bf=e=>({"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer","rate-limiting-advanced":"RLAForm"})[e];L.AUTOFILL_SLOT=he,L.AUTOFILL_SLOT_NAME=ze,L.FIELD_STATES=_e,L.FORMS_API_KEY=ne,L.FORMS_CONFIG=Qn,L.PartialType=bt,L.REDIS_PARTIAL_FETCHER_KEY=eo,L.REDIS_PARTIAL_INFO=ol,L.VueFormGenerator=Y,L.abstractField=gc,L.composables=Te,L.customFields=Vf,L.getSharedFormName=Bf,L.sharedForms=Of,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});