@kong-ui-public/forms 4.15.2 → 4.15.3-pr.2309.a2df9fc64.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.es.js +2903 -2381
- package/dist/forms.umd.js +3 -2
- package/dist/style.css +1 -1
- package/dist/types/components/FormGenerator.vue.d.ts +1 -0
- package/dist/types/components/FormGenerator.vue.d.ts.map +1 -1
- package/dist/types/components/FormGroup.vue.d.ts +1 -0
- package/dist/types/components/FormGroup.vue.d.ts.map +1 -1
- package/dist/types/components/forms/OIDCForm.vue.d.ts +1 -0
- package/package.json +6 -5
package/dist/forms.umd.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
(function(I,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):(I=typeof globalThis<"u"?globalThis:I||self,t(I["kong-ui-public-forms"]={},I.Vue,I["kong-ui-public-i18n"],I.KongIcons,I["kong-ui-public-entities-shared"]))})(this,function(I,t,ee,oe,Pe){"use strict";function pt(e,n){for(var o=-1,a=e==null?0:e.length;++o<a&&n(e[o],o,e)!==!1;);return e}function Zn(e){return function(n,o,a){for(var r=-1,i=Object(n),s=a(n),l=s.length;l--;){var d=s[++r];if(o(i[d],d,i)===!1)break}return n}}var Jn=Zn();function Qn(e,n){for(var o=-1,a=Array(e);++o<e;)a[o]=n(o);return a}var gt=typeof global=="object"&&global&&global.Object===Object&&global,Xn=typeof self=="object"&&self&&self.Object===Object&&self,J=gt||Xn||Function("return this")(),se=J.Symbol,yt=Object.prototype,eo=yt.hasOwnProperty,to=yt.toString,Be=se?se.toStringTag:void 0;function no(e){var n=eo.call(e,Be),o=e[Be];try{e[Be]=void 0;var a=!0}catch{}var r=to.call(e);return a&&(n?e[Be]=o:delete e[Be]),r}var oo=Object.prototype,ro=oo.toString;function ao(e){return ro.call(e)}var io="[object Null]",lo="[object Undefined]",bt=se?se.toStringTag:void 0;function de(e){return e==null?e===void 0?lo:io:bt&&bt in Object(e)?no(e):ao(e)}function ce(e){return e!=null&&typeof e=="object"}var so="[object Arguments]";function _t(e){return ce(e)&&de(e)==so}var kt=Object.prototype,co=kt.hasOwnProperty,mo=kt.propertyIsEnumerable,uo=_t(function(){return arguments}())?_t:function(e){return ce(e)&&co.call(e,"callee")&&!mo.call(e,"callee")},me=Array.isArray;function fo(){return!1}var Ct=typeof I=="object"&&I&&!I.nodeType&&I,wt=Ct&&typeof module=="object"&&module&&!module.nodeType&&module,ho=wt&&wt.exports===Ct,Et=ho?J.Buffer:void 0,po=Et?Et.isBuffer:void 0,St=po||fo,go=9007199254740991,yo=/^(?:0|[1-9]\d*)$/;function Mt(e,n){var o=typeof e;return n=n??go,!!n&&(o=="number"||o!="symbol"&&yo.test(e))&&e>-1&&e%1==0&&e<n}var bo=9007199254740991;function Vt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=bo}var _o="[object Arguments]",ko="[object Array]",Co="[object Boolean]",wo="[object Date]",Eo="[object Error]",So="[object Function]",Mo="[object Map]",Vo="[object Number]",To="[object Object]",No="[object RegExp]",Bo="[object Set]",Io="[object String]",Ao="[object WeakMap]",Oo="[object ArrayBuffer]",Fo="[object DataView]",$o="[object Float32Array]",Uo="[object Float64Array]",Ro="[object Int8Array]",Do="[object Int16Array]",Po="[object Int32Array]",jo="[object Uint8Array]",Lo="[object Uint8ClampedArray]",qo="[object Uint16Array]",vo="[object Uint32Array]",D={};D[$o]=D[Uo]=D[Ro]=D[Do]=D[Po]=D[jo]=D[Lo]=D[qo]=D[vo]=!0,D[_o]=D[ko]=D[Oo]=D[Co]=D[Fo]=D[wo]=D[Eo]=D[So]=D[Mo]=D[Vo]=D[To]=D[No]=D[Bo]=D[Io]=D[Ao]=!1;function Ko(e){return ce(e)&&Vt(e.length)&&!!D[de(e)]}function Qe(e){return function(n){return e(n)}}var Tt=typeof I=="object"&&I&&!I.nodeType&&I,Ie=Tt&&typeof module=="object"&&module&&!module.nodeType&&module,zo=Ie&&Ie.exports===Tt,Xe=zo&>.process,Se=function(){try{var e=Ie&&Ie.require&&Ie.require("util").types;return e||Xe&&Xe.binding&&Xe.binding("util")}catch{}}(),Nt=Se&&Se.isTypedArray,xo=Nt?Qe(Nt):Ko,Ho=Object.prototype,Yo=Ho.hasOwnProperty;function Bt(e,n){var o=me(e),a=!o&&uo(e),r=!o&&!a&&St(e),i=!o&&!a&&!r&&xo(e),s=o||a||r||i,l=s?Qn(e.length,String):[],d=l.length;for(var c in e)(n||Yo.call(e,c))&&!(s&&(c=="length"||r&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Mt(c,d)))&&l.push(c);return l}var Go=Object.prototype;function et(e){var n=e&&e.constructor,o=typeof n=="function"&&n.prototype||Go;return e===o}function It(e,n){return function(o){return e(n(o))}}var Wo=It(Object.keys,Object),Zo=Object.prototype,Jo=Zo.hasOwnProperty;function Qo(e){if(!et(e))return Wo(e);var n=[];for(var o in Object(e))Jo.call(e,o)&&o!="constructor"&&n.push(o);return n}function W(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Xo="[object AsyncFunction]",er="[object Function]",tr="[object GeneratorFunction]",nr="[object Proxy]";function $(e){if(!W(e))return!1;var n=de(e);return n==er||n==tr||n==Xo||n==nr}function je(e){return e!=null&&Vt(e.length)&&!$(e)}function Le(e){return je(e)?Bt(e):Qo(e)}function or(e,n){return e&&Jn(e,n,Le)}function rr(e,n){return function(o,a){if(o==null)return o;if(!je(o))return e(o,a);for(var r=o.length,i=-1,s=Object(o);++i<r&&a(s[i],i,s)!==!1;);return o}}var ar=rr(or);function tt(e){return e}function ir(e){return typeof e=="function"?e:tt}function Y(e,n){var o=me(e)?pt:ar;return o(e,ir(n))}var lr="[object Symbol]";function qe(e){return typeof e=="symbol"||ce(e)&&de(e)==lr}var sr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dr=/^\w*$/;function cr(e,n){if(me(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||qe(e)?!0:dr.test(e)||!sr.test(e)||n!=null&&e in Object(n)}var nt=J["__core-js_shared__"],At=function(){var e=/[^.]+$/.exec(nt&&nt.keys&&nt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function mr(e){return!!At&&At in e}var ur=Function.prototype,fr=ur.toString;function pe(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,kr=RegExp("^"+br.call(_r).replace(hr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cr(e){if(!W(e)||mr(e))return!1;var n=$(e)?kr:pr;return n.test(pe(e))}function wr(e,n){return e==null?void 0:e[n]}function ge(e,n){var o=wr(e,n);return Cr(o)?o:void 0}var Ae=ge(Object,"create");function Er(){this.__data__=Ae?Ae(null):{},this.size=0}function Sr(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Mr="__lodash_hash_undefined__",Vr=Object.prototype,Tr=Vr.hasOwnProperty;function Nr(e){var n=this.__data__;if(Ae){var o=n[e];return o===Mr?void 0:o}return Tr.call(n,e)?n[e]:void 0}var Br=Object.prototype,Ir=Br.hasOwnProperty;function Ar(e){var n=this.__data__;return Ae?n[e]!==void 0:Ir.call(n,e)}var Or="__lodash_hash_undefined__";function Fr(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Ae&&n===void 0?Or:n,this}function ye(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])}}ye.prototype.clear=Er,ye.prototype.delete=Sr,ye.prototype.get=Nr,ye.prototype.has=Ar,ye.prototype.set=Fr;function $r(){this.__data__=[],this.size=0}function ve(e,n){return e===n||e!==e&&n!==n}function Ke(e,n){for(var o=e.length;o--;)if(ve(e[o][0],n))return o;return-1}var Ur=Array.prototype,Rr=Ur.splice;function Dr(e){var n=this.__data__,o=Ke(n,e);if(o<0)return!1;var a=n.length-1;return o==a?n.pop():Rr.call(n,o,1),--this.size,!0}function Pr(e){var n=this.__data__,o=Ke(n,e);return o<0?void 0:n[o][1]}function jr(e){return Ke(this.__data__,e)>-1}function Lr(e,n){var o=this.__data__,a=Ke(o,e);return a<0?(++this.size,o.push([e,n])):o[a][1]=n,this}function re(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])}}re.prototype.clear=$r,re.prototype.delete=Dr,re.prototype.get=Pr,re.prototype.has=jr,re.prototype.set=Lr;var Oe=ge(J,"Map");function qr(){this.size=0,this.__data__={hash:new ye,map:new(Oe||re),string:new ye}}function vr(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function ze(e,n){var o=e.__data__;return vr(n)?o[typeof n=="string"?"string":"hash"]:o.map}function Kr(e){var n=ze(this,e).delete(e);return this.size-=n?1:0,n}function zr(e){return ze(this,e).get(e)}function xr(e){return ze(this,e).has(e)}function Hr(e,n){var o=ze(this,e),a=o.size;return o.set(e,n),this.size+=o.size==a?0:1,this}function ae(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])}}ae.prototype.clear=qr,ae.prototype.delete=Kr,ae.prototype.get=zr,ae.prototype.has=xr,ae.prototype.set=Hr;var Yr="Expected a function";function ot(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Yr);var o=function(){var a=arguments,r=n?n.apply(this,a):a[0],i=o.cache;if(i.has(r))return i.get(r);var s=e.apply(this,a);return o.cache=i.set(r,s)||i,s};return o.cache=new(ot.Cache||ae),o}ot.Cache=ae;var Gr=500;function Wr(e){var n=ot(e,function(a){return o.size===Gr&&o.clear(),a}),o=n.cache;return n}var Zr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jr=/\\(\\)?/g,Qr=Wr(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(Zr,function(o,a,r,i){n.push(r?i.replace(Jr,"$1"):a||o)}),n});function Xr(e,n){for(var o=-1,a=e==null?0:e.length,r=Array(a);++o<a;)r[o]=n(e[o],o,e);return r}var Ot=se?se.prototype:void 0,Ft=Ot?Ot.toString:void 0;function $t(e){if(typeof e=="string")return e;if(me(e))return Xr(e,$t)+"";if(qe(e))return Ft?Ft.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Ut(e){return e==null?"":$t(e)}function ea(e,n){return me(e)?e:cr(e,n)?[e]:Qr(Ut(e))}function ta(e){if(typeof e=="string"||qe(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function na(e,n){n=ea(n,e);for(var o=0,a=n.length;e!=null&&o<a;)e=e[ta(n[o++])];return o&&o==a?e:void 0}function F(e,n,o){var a=e==null?void 0:na(e,n);return a===void 0?o:a}function q(e){return e==null}const ue="kong-ui-forms-api",Rt="kong-ui-forms-config",Dt="redis-partial-list-fetcher-key",oa="redis-partial-info",be="autofill",Z="autofillSlot";function ra(){this.__data__=new re,this.size=0}function aa(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function ia(e){return this.__data__.get(e)}function la(e){return this.__data__.has(e)}var sa=200;function da(e,n){var o=this.__data__;if(o instanceof re){var a=o.__data__;if(!Oe||a.length<sa-1)return a.push([e,n]),this.size=++o.size,this;o=this.__data__=new ae(a)}return o.set(e,n),this.size=o.size,this}function Me(e){var n=this.__data__=new re(e);this.size=n.size}Me.prototype.clear=ra,Me.prototype.delete=aa,Me.prototype.get=ia,Me.prototype.has=la,Me.prototype.set=da;var xe=function(){try{var e=ge(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Pt(e,n,o){n=="__proto__"&&xe?xe(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var ca=Object.prototype,ma=ca.hasOwnProperty;function jt(e,n,o){var a=e[n];(!(ma.call(e,n)&&ve(a,o))||o===void 0&&!(n in e))&&Pt(e,n,o)}function He(e,n,o,a){var r=!o;o||(o={});for(var i=-1,s=n.length;++i<s;){var l=n[i],d=void 0;d===void 0&&(d=e[l]),r?Pt(o,l,d):jt(o,l,d)}return o}function ua(e,n){return e&&He(n,Le(n),e)}function fa(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var ha=Object.prototype,pa=ha.hasOwnProperty;function ga(e){if(!W(e))return fa(e);var n=et(e),o=[];for(var a in e)a=="constructor"&&(n||!pa.call(e,a))||o.push(a);return o}function Ye(e){return je(e)?Bt(e,!0):ga(e)}function ya(e,n){return e&&He(n,Ye(n),e)}var Lt=typeof I=="object"&&I&&!I.nodeType&&I,qt=Lt&&typeof module=="object"&&module&&!module.nodeType&&module,ba=qt&&qt.exports===Lt,vt=ba?J.Buffer:void 0,Kt=vt?vt.allocUnsafe:void 0;function _a(e,n){if(n)return e.slice();var o=e.length,a=Kt?Kt(o):new e.constructor(o);return e.copy(a),a}function ka(e,n){var o=-1,a=e.length;for(n||(n=Array(a));++o<a;)n[o]=e[o];return n}function Ca(e,n){for(var o=-1,a=e==null?0:e.length,r=0,i=[];++o<a;){var s=e[o];n(s,o,e)&&(i[r++]=s)}return i}function zt(){return[]}var wa=Object.prototype,Ea=wa.propertyIsEnumerable,xt=Object.getOwnPropertySymbols,rt=xt?function(e){return e==null?[]:(e=Object(e),Ca(xt(e),function(n){return Ea.call(e,n)}))}:zt;function Sa(e,n){return He(e,rt(e),n)}function Ht(e,n){for(var o=-1,a=n.length,r=e.length;++o<a;)e[r+o]=n[o];return e}var Yt=It(Object.getPrototypeOf,Object),Ma=Object.getOwnPropertySymbols,Gt=Ma?function(e){for(var n=[];e;)Ht(n,rt(e)),e=Yt(e);return n}:zt;function Va(e,n){return He(e,Gt(e),n)}function Wt(e,n,o){var a=n(e);return me(e)?a:Ht(a,o(e))}function Ta(e){return Wt(e,Le,rt)}function Na(e){return Wt(e,Ye,Gt)}var at=ge(J,"DataView"),it=ge(J,"Promise"),Ve=ge(J,"Set"),lt=ge(J,"WeakMap"),Zt="[object Map]",Ba="[object Object]",Jt="[object Promise]",Qt="[object Set]",Xt="[object WeakMap]",en="[object DataView]",Ia=pe(at),Aa=pe(Oe),Oa=pe(it),Fa=pe(Ve),$a=pe(lt),ie=de;(at&&ie(new at(new ArrayBuffer(1)))!=en||Oe&&ie(new Oe)!=Zt||it&&ie(it.resolve())!=Jt||Ve&&ie(new Ve)!=Qt||lt&&ie(new lt)!=Xt)&&(ie=function(e){var n=de(e),o=n==Ba?e.constructor:void 0,a=o?pe(o):"";if(a)switch(a){case Ia:return en;case Aa:return Zt;case Oa:return Jt;case Fa:return Qt;case $a:return Xt}return n});var Ua=Object.prototype,Ra=Ua.hasOwnProperty;function Da(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&Ra.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var tn=J.Uint8Array;function st(e){var n=new e.constructor(e.byteLength);return new tn(n).set(new tn(e)),n}function Pa(e,n){var o=n?st(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var ja=/\w*$/;function La(e){var n=new e.constructor(e.source,ja.exec(e));return n.lastIndex=e.lastIndex,n}var nn=se?se.prototype:void 0,on=nn?nn.valueOf:void 0;function qa(e){return on?Object(on.call(e)):{}}function va(e,n){var o=n?st(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var Ka="[object Boolean]",za="[object Date]",xa="[object Map]",Ha="[object Number]",Ya="[object RegExp]",Ga="[object Set]",Wa="[object String]",Za="[object Symbol]",Ja="[object ArrayBuffer]",Qa="[object DataView]",Xa="[object Float32Array]",ei="[object Float64Array]",ti="[object Int8Array]",ni="[object Int16Array]",oi="[object Int32Array]",ri="[object Uint8Array]",ai="[object Uint8ClampedArray]",ii="[object Uint16Array]",li="[object Uint32Array]";function si(e,n,o){var a=e.constructor;switch(n){case Ja:return st(e);case Ka:case za:return new a(+e);case Qa:return Pa(e,o);case Xa:case ei:case ti:case ni:case oi:case ri:case ai:case ii:case li:return va(e,o);case xa:return new a;case Ha:case Wa:return new a(e);case Ya:return La(e);case Ga:return new a;case Za:return qa(e)}}var rn=Object.create,di=function(){function e(){}return function(n){if(!W(n))return{};if(rn)return rn(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function ci(e){return typeof e.constructor=="function"&&!et(e)?di(Yt(e)):{}}var mi="[object Map]";function ui(e){return ce(e)&&ie(e)==mi}var an=Se&&Se.isMap,fi=an?Qe(an):ui,hi="[object Set]";function pi(e){return ce(e)&&ie(e)==hi}var ln=Se&&Se.isSet,gi=ln?Qe(ln):pi,yi=1,bi=2,_i=4,sn="[object Arguments]",ki="[object Array]",Ci="[object Boolean]",wi="[object Date]",Ei="[object Error]",dn="[object Function]",Si="[object GeneratorFunction]",Mi="[object Map]",Vi="[object Number]",cn="[object Object]",Ti="[object RegExp]",Ni="[object Set]",Bi="[object String]",Ii="[object Symbol]",Ai="[object WeakMap]",Oi="[object ArrayBuffer]",Fi="[object DataView]",$i="[object Float32Array]",Ui="[object Float64Array]",Ri="[object Int8Array]",Di="[object Int16Array]",Pi="[object Int32Array]",ji="[object Uint8Array]",Li="[object Uint8ClampedArray]",qi="[object Uint16Array]",vi="[object Uint32Array]",R={};R[sn]=R[ki]=R[Oi]=R[Fi]=R[Ci]=R[wi]=R[$i]=R[Ui]=R[Ri]=R[Di]=R[Pi]=R[Mi]=R[Vi]=R[cn]=R[Ti]=R[Ni]=R[Bi]=R[Ii]=R[ji]=R[Li]=R[qi]=R[vi]=!0,R[Ei]=R[dn]=R[Ai]=!1;function Fe(e,n,o,a,r,i){var s,l=n&yi,d=n&bi,c=n&_i;if(s!==void 0)return s;if(!W(e))return e;var f=me(e);if(f){if(s=Da(e),!l)return ka(e,s)}else{var u=ie(e),h=u==dn||u==Si;if(St(e))return _a(e,l);if(u==cn||u==sn||h&&!r){if(s=d||h?{}:ci(e),!l)return d?Va(e,ya(s,e)):Sa(e,ua(s,e))}else{if(!R[u])return r?e:{};s=si(e,u,l)}}i||(i=new Me);var w=i.get(e);if(w)return w;i.set(e,s),gi(e)?e.forEach(function(_){s.add(Fe(_,n,o,_,e,i))}):fi(e)&&e.forEach(function(_,C){s.set(C,Fe(_,n,o,C,e,i))});var B=c?d?Na:Ta:d?Ye:Le,m=f?void 0:B(e);return pt(m||e,function(_,C){m&&(C=_,_=e[C]),jt(s,C,Fe(_,n,o,C,e,i))}),s}var Ki=1,zi=4;function le(e){return Fe(e,Ki|zi)}const dt=(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,""),mn=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var xi="[object String]";function _e(e){return typeof e=="string"||!me(e)&&ce(e)&&de(e)==xi}const un={methods:{getFieldRowClasses(e){const n=this.fieldErrors(e).length>0,o={[F(this.options,"validationErrorClass","error")]:n,[F(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)?Y(e.styleClasses,a=>o[a]=!0):_e(e.styleClasses)&&(o[e.styleClasses]=!0),q(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 $(e.disabled)?e.disabled.call(this,this.model,e,this):q(e.disabled)?!1:e.disabled},fieldReadonly(e){return $(e.readonly)?e.readonly.call(this,this.model,e,this):q(e.readonly)?!1:e.readonly},fieldFeatured(e){return $(e.featured)?e.featured.call(this,this.model,e,this):q(e.featured)?!1:e.featured},fieldRequired(e){return $(e.required)?e.required.call(this,this.model,e,this):q(e.required)?!1:e.required}}};var ct=function(){return J.Date.now()},Hi=/\s/;function Yi(e){for(var n=e.length;n--&&Hi.test(e.charAt(n)););return n}var Gi=/^\s+/;function Wi(e){return e&&e.slice(0,Yi(e)+1).replace(Gi,"")}var fn=NaN,Zi=/^[-+]0x[0-9a-f]+$/i,Ji=/^0b[01]+$/i,Qi=/^0o[0-7]+$/i,Xi=parseInt;function mt(e){if(typeof e=="number")return e;if(qe(e))return fn;if(W(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=W(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Wi(e);var o=Ji.test(e);return o||Qi.test(e)?Xi(e.slice(2),o?2:8):Zi.test(e)?fn:+e}var el="Expected a function",tl=Math.max,nl=Math.min;function $e(e,n,o){var a,r,i,s,l,d,c=0,f=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(el);n=mt(n)||0,W(o)&&(f=!!o.leading,u="maxWait"in o,i=u?tl(mt(o.maxWait)||0,n):i,h="trailing"in o?!!o.trailing:h);function w(b){var p=a,T=r;return a=r=void 0,c=b,s=e.apply(T,p),s}function B(b){return c=b,l=setTimeout(C,n),f?w(b):s}function m(b){var p=b-d,T=b-c,P=n-p;return u?nl(P,i-T):P}function _(b){var p=b-d,T=b-c;return d===void 0||p>=n||p<0||u&&T>=i}function C(){var b=ct();if(_(b))return S(b);l=setTimeout(C,m(b))}function S(b){return l=void 0,h&&a?w(b):(a=r=void 0,s)}function g(){l!==void 0&&clearTimeout(l),c=0,a=d=r=l=void 0}function M(){return l===void 0?s:S(ct())}function E(){var b=ct(),p=_(b);if(a=arguments,r=this,d=b,p){if(l===void 0)return B(d);if(u)return clearTimeout(l),l=setTimeout(C,n),w(d)}return l===void 0&&(l=setTimeout(C,n)),s}return E.cancel=g,E.flush=M,E}var ol="__lodash_hash_undefined__";function rl(e){return this.__data__.set(e,ol),this}function al(e){return this.__data__.has(e)}function Ge(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new ae;++n<o;)this.add(e[n])}Ge.prototype.add=Ge.prototype.push=rl,Ge.prototype.has=al;function il(e,n,o,a){for(var r=e.length,i=o+-1;++i<r;)if(n(e[i],i,e))return i;return-1}function ll(e){return e!==e}function sl(e,n,o){for(var a=o-1,r=e.length;++a<r;)if(e[a]===n)return a;return-1}function dl(e,n,o){return n===n?sl(e,n,o):il(e,ll,o)}function cl(e,n){var o=e==null?0:e.length;return!!o&&dl(e,n,0)>-1}function ml(e,n){return e.has(n)}function ul(){}function hn(e){var n=-1,o=Array(e.size);return e.forEach(function(a){o[++n]=a}),o}var fl=1/0,hl=Ve&&1/hn(new Ve([,-0]))[1]==fl?function(e){return new Ve(e)}:ul,pl=200;function gl(e,n,o){var a=-1,r=cl,i=e.length,s=!0,l=[],d=l;if(i>=pl){var c=hl(e);if(c)return hn(c);s=!1,r=ml,d=new Ge}else d=l;e:for(;++a<i;){var f=e[a],u=f;if(f=f!==0?f:0,s&&u===u){for(var h=d.length;h--;)if(d[h]===u)continue e;l.push(f)}else r(d,u,o)||(d!==l&&d.push(u),l.push(f))}return l}function pn(e){return e&&e.length?gl(e):[]}var yl=0;function gn(e){var n=++yl;return Ut(e)+n}var yn=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,fe="\\d\\d?",he="\\d\\d",bl="\\d{3}",_l="\\d{4}",Ue="[^\\s]+",bn=/\[([^]*?)\]/gm;function _n(e,n){for(var o=[],a=0,r=e.length;a<r;a++)o.push(e[a].substr(0,n));return o}var kn=function(e){return function(n,o){var a=o[e].map(function(i){return i.toLowerCase()}),r=a.indexOf(n.toLowerCase());return r>-1?r:null}};function ke(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var a=0,r=n;a<r.length;a++){var i=r[a];for(var s in i)e[s]=i[s]}return e}var Cn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],wn=["January","February","March","April","May","June","July","August","September","October","November","December"],kl=_n(wn,3),Cl=_n(Cn,3),En={dayNamesShort:Cl,dayNames:Cn,monthNamesShort:kl,monthNames:wn,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},We=ke({},En),wl=function(e){return We=ke(We,e)},Sn=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},G=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},El={D:function(e){return String(e.getDate())},DD:function(e){return G(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return G(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 G(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 G(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return G(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return G(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return G(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return G(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return G(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return G(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return G(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?"-":"+")+G(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+G(Math.floor(Math.abs(n)/60),2)+":"+G(Math.abs(n)%60,2)}},Mn=function(e){return+e-1},Vn=[null,fe],Tn=[null,Ue],Nn=["isPm",Ue,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],Bn=["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}],Sl={D:["day",fe],DD:["day",he],Do:["day",fe+Ue,function(e){return parseInt(e,10)}],M:["month",fe,Mn],MM:["month",he,Mn],YY:["year",he,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",fe,void 0,"isPm"],hh:["hour",he,void 0,"isPm"],H:["hour",fe],HH:["hour",he],m:["minute",fe],mm:["minute",he],s:["second",fe],ss:["second",he],YYYY:["year",_l],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",he,function(e){return+e*10}],SSS:["millisecond",bl],d:Vn,dd:Vn,ddd:Tn,dddd:Tn,MMM:["month",Ue,kn("monthNamesShort")],MMMM:["month",Ue,kn("monthNames")],a:Nn,A:Nn,ZZ:Bn,Z:Bn},Ze={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"},Ml=function(e){return ke(Ze,e)},Vl=function(e,n,o){if(n===void 0&&(n=Ze.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=Ze[n]||n;var a=[];n=n.replace(bn,function(i,s){return a.push(s),"@@@"});var r=ke(ke({},We),o);return n=n.replace(yn,function(i){return El[i](e,r)}),n.replace(/@@@/g,function(){return a.shift()})};function Tl(e,n,o){if(o===void 0&&(o={}),typeof n!="string")throw new Error("Invalid format in fecha parse");if(n=Ze[n]||n,e.length>1e3)return null;var a=new Date,r={year:a.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],s=[],l=n.replace(bn,function(M,E){return s.push(Sn(E)),"@@@"}),d={},c={};l=Sn(l).replace(yn,function(M){var E=Sl[M],b=E[0],p=E[1],T=E[3];if(d[b])throw new Error("Invalid format. "+b+" specified twice in format");return d[b]=!0,T&&(c[T]=!0),i.push(E),"("+p+")"}),Object.keys(c).forEach(function(M){if(!d[M])throw new Error("Invalid format. "+M+" is required in specified format")}),l=l.replace(/@@@/g,function(){return s.shift()});var f=e.match(new RegExp(l,"i"));if(!f)return null;for(var u=ke(ke({},We),o),h=1;h<f.length;h++){var w=i[h-1],B=w[0],m=w[2],_=m?m(f[h],u):+f[h];if(_==null)return null;r[B]=_}r.isPm===1&&r.hour!=null&&+r.hour!=12?r.hour=+r.hour+12:r.isPm===0&&+r.hour==12&&(r.hour=0);var C;if(r.timezoneOffset==null){C=new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond);for(var S=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],h=0,g=S.length;h<g;h++)if(d[S[h][0]]&&r[S[h][0]]!==C[S[h][1]]())return null}else if(C=new Date(Date.UTC(r.year,r.month,r.day,r.hour,r.minute-r.timezoneOffset,r.second,r.millisecond)),r.month>11||r.month<0||r.day>31||r.day<1||r.hour>23||r.hour<0||r.minute>59||r.minute<0||r.second>59||r.second<0)return null;return C}var Te={format:Vl,parse:Tl,defaultI18n:En,setGlobalDateI18n:wl,setGlobalDateMasks:Ml};function Nl(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 In=Math.max;function Bl(e,n,o){return n=In(n===void 0?e.length-1:n,0),function(){for(var a=arguments,r=-1,i=In(a.length-n,0),s=Array(i);++r<i;)s[r]=a[n+r];r=-1;for(var l=Array(n+1);++r<n;)l[r]=a[r];return l[n]=o(s),Nl(e,this,l)}}function Il(e){return function(){return e}}var Al=xe?function(e,n){return xe(e,"toString",{configurable:!0,enumerable:!1,value:Il(n),writable:!0})}:tt,Ol=800,Fl=16,$l=Date.now;function Ul(e){var n=0,o=0;return function(){var a=$l(),r=Fl-(a-o);if(o=a,r>0){if(++n>=Ol)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var Rl=Ul(Al);function Dl(e,n){return Rl(Bl(e,n,tt),e+"")}function Pl(e,n,o){if(!W(o))return!1;var a=typeof n;return(a=="number"?je(o)&&Mt(n,o.length):a=="string"&&n in o)?ve(o[n],e):!1}var An=Object.prototype,jl=An.hasOwnProperty,Ll=Dl(function(e,n){e=Object(e);var o=-1,a=n.length,r=a>2?n[2]:void 0;for(r&&Pl(n[0],n[1],r)&&(a=1);++o<a;)for(var i=n[o],s=Ye(i),l=-1,d=s.length;++l<d;){var c=s[l],f=e[c];(f===void 0||ve(f,An[c])&&!jl.call(e,c))&&(e[c]=i[c])}return e}),ql=J.isFinite;function vl(e){return typeof e=="number"&&ql(e)}var On=1/0,Kl=17976931348623157e292;function zl(e){if(!e)return e===0?e:0;if(e=mt(e),e===On||e===-On){var n=e<0?-1:1;return n*Kl}return e===e?e:0}function xl(e){var n=zl(e),o=n%1;return n===n?o?n-o:n:0}function Hl(e){return typeof e=="number"&&e==xl(e)}var Yl="[object Number]";function Je(e){return typeof e=="number"||ce(e)&&de(e)==Yl}const te={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'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."}},vfg:{labels:{on:"On",off:"Off"}}},{t:v}=ee.createI18n("en-us",te),x={fieldIsRequired:v("validators.field_is_required"),invalidFormat:v("validators.invalid_format"),numberTooSmall:v("validators.number_too_small"),numberTooBig:v("validators.number_too_large"),invalidNumber:v("validators.invalid_number"),invalidInteger:v("validators.invalid_integer"),textTooSmall:v("validators.text_too_short"),textTooBig:v("validators.text_too_long"),thisNotText:v("validators.this_not_text"),thisNotArray:v("validators.this_not_array"),selectMinItems:v("validators.select_min_items"),selectMaxItems:v("validators.select_max_items"),invalidDate:v("validators.invalid_date"),dateIsEarly:v("validators.date_is_early"),dateIsLate:v("validators.date_is_late"),invalidEmail:v("validators.invalid_email"),invalidURL:v("validators.invalid_url"),invalidCard:v("validators.invalid_card"),invalidCardNumber:v("validators.invalid_card_number"),invalidTextContainNumber:v("validators.invalid_text_contain_number"),invalidTextContainSpec:v("validators.invalid_tex_contain_spec")},j=(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},Q=(e,n,o=x)=>q(e)||e===""?n?[j(o.fieldIsRequired)]:[]:null,Ce={required:(e,n,o,a=x)=>Q(e,n.required,a)||[],number:(e,n,o,a=x)=>{let r=Q(e,n.required,a);return r!=null||(r=[],vl(e)?(!q(n.min)&&e<n.min,(a=x)&&r.push(j(a.numberTooSmall,n.min)),!q(n.max)&&e>n.max,(a=x)&&r.push(j(a.numberTooBig,n.max))):r.push(j(a.invalidNumber))),r},integer:(e,n,o,a=x)=>{let r=Q(e,n.required,a);return r!=null||(r=[],r.concat(Ce.number(e,n,o,a)),Hl(e)||r.push(j(a.invalidInteger))),r},double:(e,n,o,a=x)=>{const r=Q(e,n.required,a);return r??(!Je(e)||isNaN(e)?[j(a.invalidNumber)]:[])},string:(e,n,o,a=x)=>{let r=Q(e,n.required,a);return r!=null||(r=[],_e(e)?(!q(n.min)&&e.length<n.min&&r.push(j(a.textTooSmall,e.length,n.min)),!q(n.max)&&e.length>n.max&&r.push(j(a.textTooBig,e.length,n.max))):r.push(j(a.thisNotText))),r},array:(e,n,o,a=x)=>{if(n.required){if(!Array.isArray(e))return[j(a.thisNotArray)];if(e.length===0)return[j(a.fieldIsRequired)]}if(!q(e)){if(!q(n.min)&&e.length<n.min)return[j(a.selectMinItems,n.min)];if(!q(n.max)&&e.length>n.max)return[j(a.selectMaxItems,n.max)]}return[]},date:(e,n,o,a=x)=>{let r=Q(e,n.required,a);if(r!=null)return r;r=[];const i=new Date(e);if(isNaN(i.getDate()))return[j(a.invalidDate)];if(!q(n.min)){const s=new Date(n.min);i.valueOf()<s.valueOf()&&r.push(j(a.dateIsEarly,Te.format(i),Te.format(s)))}if(!q(n.max)){const s=new Date(n.max);i.valueOf()>s.valueOf()&&r.push(j(a.dateIsLate,Te.format(i),Te.format(s)))}return r},regexp:(e,n,o,a=x)=>{const r=Q(e,n.required,a);return r??(!q(n.pattern)&&!new RegExp(n.pattern).test(e)?[j(a.invalidFormat)]:[])},email:(e,n,o,a=x)=>{const r=Q(e,n.required,a);return r??(/^(([^<>()\[\]\\.,;:\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)?[]:[j(a.invalidEmail)])},url:(e,n,o,a=x)=>{const r=Q(e,n.required,a);return r??(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e)?[]:[j(a.invalidURL)])},creditCard:(e,n,o,a=x)=>{const r=Q(e,n.required,a);if(r!=null)return r;const i=/^(?: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})$/,s=e.replace(/[^0-9]+/g,"");if(!i.test(s))return[j(a.invalidCard)];let l=0,d,c,f;for(let u=s.length-1;u>=0;u--)d=s.substring(u,u+1),c=parseInt(d,10),f?(c*=2,c>=10?l+=c%10+1:l+=c):l+=c,f=!f;return l%10===0&&s?[]:[j(a.invalidCardNumber)]},alpha:(e,n,o,a=x)=>{const r=Q(e,n.required,a);return r??(/^[a-zA-Z]*$/.test(e)?[]:[j(a.invalidTextContainNumber)])},alphaNumeric:(e,n,o,a=x)=>{const r=Q(e,n.required,a);return r??(/^[a-zA-Z0-9]*$/.test(e)?[]:[j(a.invalidTextContainSpec)])}};Object.keys(Ce).forEach(e=>{const n=Ce[e];$(n)&&(n.locale=o=>(a,r,i)=>n(a,r,i,Ll(o,x)))});function Fn(e){return _e(e)?Ce[e]!=null?Ce[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function ut(e,n,o){let a=F(o.context,"schema.attributes",{});const r=n.value||"input";_e(r)&&(a=F(a,r)||a),Y(a,(i,s)=>{e.setAttribute(s,i)})}const ne={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:ut,updated:ut,componentUpdated:ut}},computed:{value:{cache:!1,get(){let e;return $(F(this.schema,"get"))?e=this.schema.get(this.model):e=F(this.model,this.schema.model),this.formatValueToField(e)},set(e){const n=this.value;e=this.formatValueToModel(e),$(e)?e(e,n):this.updateModelValue(e,n)}}},methods:{validate(e){this.clearValidationErrors();const n=F(this.formOptions,"validateAsync",!1);let o=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const r=[];Array.isArray(this.schema.validator)?Y(this.schema.validator,i=>{r.push(Fn(i).bind(this))}):r.push(Fn(this.schema.validator).bind(this)),Y(r,i=>{if(n)o.push(i(this.value,this.schema,this.model));else{const s=i(this.value,this.schema,this.model);s&&$(s.then)?s.then(l=>{l&&(this.errors=this.errors.concat(l));const d=this.errors.length===0;this.$emit("validated",d,this.errors,this)}):s&&(o=o.concat(s))}})}const a=r=>{let i=[];Y(pn(r),l=>{Array.isArray(l)&&l.length>0?i=i.concat(l):_e(l)&&i.push(l)}),$(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,i,this.schema);const s=i.length===0;return e||this.$emit("validated",s,i,this),this.errors=i,i};return n?Promise.all(o).then(a):a(o)},debouncedValidate(){$(this.debouncedValidateFunc)||(this.debouncedValidateFunc=$e(this.validate.bind(this),F(this.schema,"validateDebounceTime",F(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;$(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),$(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,e,n,this.schema),F(this.formOptions,"validateAfterChanged",!1)===!0&&(F(this.schema,"validateDebounceTime",F(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 r=o.split(".");let i=0;const s=r.length;for(;i<s;){const l=r[i];if(i<s-1)a[l]!==void 0||(a[l]={}),a=a[l];else{a[l]=n;return}++i}},getFieldID(e,n=!1){const o=F(this.formOptions,"fieldIdPrefix","");return dt(e,o)+(n?"-"+gn():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return F(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},Gl=Object.freeze(Object.defineProperty({__proto__:null,default:ne},Symbol.toStringTag,{value:"Module"})),U=(e,n)=>{const o=e.__vccOpts||e;for(const[a,r]of n)o[a]=r;return o},Wl={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Zl={class:"material-icons"},Jl=U(Object.assign({mixins:[ne],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",Wl,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:o[0]||(o[0]=(...a)=>n.handleOpen&&n.handleOpen(...a))},[t.createElementVNode("i",Zl,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(L,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])],2)]))}}),[["__scopeId","data-v-9bb032dd"]]),Ql={class:"array-card-container"},$n=U(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 r=t.resolveComponent("KCard"),i=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Ql,[t.createVNode(r,{class:"card"},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3}),t.createVNode(i,{appearance:"tertiary",class:"array-card-remove-button",onClick:a[0]||(a[0]=s=>o.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.TrashIcon))]),_:1})])}}}),[["__scopeId","data-v-97302224"]]),Xl={class:"array-item-wrapper"},es={class:"array-item"},ts={class:"array-item-after"},Un=U(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",Xl,[t.createElementVNode("div",es,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=r=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.TrashIcon))]),_:1})]),t.createElementVNode("div",ts,[t.renderSlot(n.$slots,"after",{},void 0,!0)])])}}}),[["__scopeId","data-v-51d79db2"]]),ns={class:"multi-item-wrapper"},Rn=U(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",ns,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=r=>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"]]),os="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",rs=e=>e?e.length===36&&new RegExp(`^${os}$`).test(e):!1,ft=50,we={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};function as(e,n,o){return o?we.SET_REFERRAL_VALUE:e&&!n||!e&&n?we.UPDATE_ENTITY:e&&n?we.CREATE_FROM_ENTITY:we.CREATE_NOT_FROM_ENTITY}const is={mixins:[ne],inject:[ue],emits:["model-updated"],setup(){const{t:e}=ee.createI18n("en-us",te);return{t:e}},data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return as(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 we.UPDATE_ENTITY:if(!this[ue]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[ue].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 we.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case we.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=$e(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],a=this.getInputFields(),r=new Set;rs(e)&&a.includes("id")?o.push((async()=>{const i=await this.fetchExact(e);n.push({...i,label:this.getSuggestionLabel(i),value:i.id})})()):o.push(...a.filter(i=>i!=="id").map(async i=>{(await this.fetchSuggestions(e,i)).forEach(l=>{r.has(l.id)||(r.add(l.id),n.push({...l,label:this.getSuggestionLabel(l),value:l.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[ue])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<ft;){const a=await this[ue].getAll(this.entity,{size:ft,offset:o,...e});if(n.push(...a.data.data),o=a.data.offset,!o)break}return n.slice(0,ft)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[ue]?(await this[ue].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}}},ls=["data-testid","data-testlabel"],ss=["data-testid"],ds={class:"autosuggest__results_message"};function cs(e,n,o,a,r,i){const s=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:i.scope})},{default:t.withCtx(()=>[t.createVNode(s,{id:e.schema.model,ref:"suggestion",modelValue:r.idValue,"onUpdate:modelValue":n[0]||(n[0]=l=>r.idValue=l),clearable:"",disabled:e.schema.disabled,"enable-filtering":"","filter-function":()=>!0,items:r.items,loading:r.loading,placeholder:e.schema.placeholder,width:"100%",onChange:i.onSelected,onQueryChange:i.onQueryChange},{"item-template":t.withCtx(({item:l})=>[t.createElementVNode("span",{class:"first-part","data-testid":l.id&&`${l.id}-0`,"data-testlabel":l.label},t.toDisplayString(i.getSuggestionLabel(l).split(" - ")[0]),9,ls),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.getSuggestionLabel(l).split(" - ").slice(1),(d,c)=>(t.openBlock(),t.createElementBlock("span",{key:c,class:"field-span","data-testid":l.id&&`${l.id}-${c+1}`||c+1},t.toDisplayString(d),9,ss))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",ds,[t.createElementVNode("span",null,t.toDisplayString(r.message),1)])]),_:1},8,["id","modelValue","disabled","items","loading","placeholder","onChange","onQueryChange"])]),_:1},8,["text"])}const Dn=U(is,[["render",cs],["__scopeId","data-v-40a272a2"]]);function ms(e){const n=t.ref([]),o=t.ref(null),a=m=>_e(m)?Ce[m]!=null?Ce[m]:(console.warn(`'${m}' is not a validator function!`),null):m,r=t.computed({get(){var _,C;let m;return $(F(e.schema,"get"))?m=e.schema.get((_=e.model)==null?void 0:_.value):m=F((C=e.model)==null?void 0:C.value,e.schema.model),w(m)},set(m){const _=r;m=B(m),$(m)?m(m,_):l(m,_)}}),i=m=>{var g;d();const _=F(e.formOptions,"validateAsync",!1);let C=[];if(e.schema.readonly!==!0&&e.disabled!==!0){const M=[],E=(g=e.schema)==null?void 0:g.validator;E&&(Array.isArray(E)?Y(E,b=>{M.push(a(b))}):M.push(a(E))),$(e.externalValidator)&&M.push(e.externalValidator),Y(M,b=>{var p,T;if(_)C.push(b(r.value,e.schema,(p=e.model)==null?void 0:p.value));else{const P=b(r.value,e.schema,(T=e.model)==null?void 0:T.value);P&&$(P.then)?P.then(y=>{y&&(n.value=n.value.concat(y));const k=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:k,errors:n.value,field:e.schema})}):P&&(C=C.concat(P))}})}const S=M=>{var b,p;let E=[];if(Y(pn(M),T=>{Array.isArray(T)&&T.length>0?E=E.concat(T):_e(T)&&E.push(T)}),$((b=e.schema)==null?void 0:b.onValidated)&&e.schema.onValidated((p=e.model)==null?void 0:p.value,E,e.schema),!m){const T=E.length===0;e.emitValidated&&e.emitValidated({isValid:T,errors:E,field:e.schema})}return M=E,E};return _?Promise.all(C).then(S):S(C)},s=()=>{$(o.value)?o.value():o.value=$e(i,F(e.schema,"validateDebounceTime",F(e.formOptions,"validateDebounceTime",500)))},l=(m,_)=>{var S,g,M;let C=!1;$(e.schema.set)?(e.schema.set((S=e.model)==null?void 0:S.value,m),C=!0):e.schema.model&&(c(e.schema.model,m),C=!0),C&&(e.emitModelUpdated&&((g=e.model)!=null&&g.value)&&e.emitModelUpdated({value:m,model:e.schema.model}),$(e.schema.onChanged)&&e.schema.onChanged((M=e.model)==null?void 0:M.value,m,_,e.schema),F(e.formOptions,"validateAfterChanged",!1)===!0&&(F(e.schema,"validateDebounceTime",F(e.formOptions,"validateDebounceTime",0))>0?s():i()))},d=()=>{n.value.splice(0)},c=(m,_)=>{var b;let C=m.replace(/\[(\w+)\]/g,".$1");C=C.replace(/^\./,"");let S=((b=e.model)==null?void 0:b.value)||{},g=0;const M=C.split("."),E=M.length;for(;g<E;){const p=M[g];if(g<E-1)S[p]!==void 0||(S[p]={}),S=S[p];else{S[p]=_;return}++g}},f=(m,_=!1)=>{const C=F(e.formOptions,"fieldIdPrefix","");return dt(m,C)+(_?"-"+gn():"")},u=m=>`${f(m)}-label`,h=()=>F(e.schema,"fieldClasses",[]),w=m=>e.formatValueToField&&typeof e.formatValueToField=="function"?e.formatValueToField(m):m,B=m=>e.formatValueToModel&&typeof e.formatValueToModel=="function"?e.formatValueToModel(m):m;return{value:r,clearValidationErrors:d,getFieldID:f,getLabelId:u,getFieldClasses:h,updateModelValue:l}}function us(e){const n=[],o=a=>{const r=["cluster-cache","cluster_cache"];for(const i of r)if(a.model.includes(i))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 fs(e,n){const o=new RegExp("(?<=config-redis-).*"),a=/Config\.Redis.*/;return n.filter(i=>{const s=i.model.match(o);return s&&!Object.keys(e).includes(s[0])}).map(i=>{const s=i.label.match(a);return{label:s?s[0]:i.label,key:i.model,value:"N/A",type:"text"}})}const X={useAbstractFields:ms,useRedisPartial:us,useRedisNonStandardFields:fs},hs={class:"form-field-wrapper"},Pn=U(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,r=o,i=t.toRefs(a),s=t.inject(Z,void 0),{updateModelValue:l,getFieldID:d,clearValidationErrors:c,value:f}=X.useAbstractFields({model:i.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:g=>{r("modelUpdated",g.value,g.model)}});n({clearValidationErrors:c});const u=t.computed(()=>{var M;const g=(M=a.schema)==null?void 0:M.inputType.toLowerCase();switch(g){case"string":return"text";case"datetime":return"datetime-local";default:return g||"text"}}),h={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},w=(g,M)=>{var T,P;let E=g;const b=h[u.value]||"",p=Te.parse(g,b);p&&((T=a.schema)!=null&&T.format?E=Te.format(p,(P=a.schema)==null?void 0:P.format):E=p.valueOf()),l(E,M)},B=(g,M)=>{Je(g)||(g=NaN),l(g,M)},m=g=>{let M=g;switch(u.value){case"number":case"range":Je(parseFloat(g))&&(M=parseFloat(g));break}f.value=M,l(M,g)},_=g=>{f.value=g,l(g,g)},C=t.ref(null),S=()=>{var g;$(C.value)&&((g=C.value)==null||g.flush())};return t.onMounted(()=>{switch(u.value){case"number":case"range":C.value=$e((g,M)=>{B(g,M)},parseInt(F(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":C.value=$e((g,M)=>{w(g,M)},parseInt(F(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{u.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):u.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):u.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(g,M)=>{const E=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",hs,[t.createVNode(E,t.mergeProps(g.$attrs,{id:t.unref(d)(e.schema),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:u.value==="color"||u.value==="range"?t.unref(f):void 0,max:e.schema.max,maxlength:e.schema.maxlength,min:e.schema.min,minlength:e.schema.minlength,"model-value":t.unref(f),name:e.schema.inputName,pattern:e.schema.pattern,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,"show-password-mask-toggle":u.value==="password",type:u.value,width:e.schema.width,onBlur:S,"onUpdate:modelValue":m}),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(s)),{schema:e.schema,update:_,value:t.unref(f)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-fe1132bb"]]),ps={name:"FieldMetric",components:{AddIcon:oe.AddIcon,TrashIcon:oe.TrashIcon},mixins:[ne],emits:["remove-item"],data(){return{contentVisible:!1}}},gs={key:0,class:"content"};function ys(e,n,o,a,r,i){const s=t.resolveComponent("AddIcon"),l=t.resolveComponent("TrashIcon"),d=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field-dropdown",{active:r.contentVisible}])},[t.createElementVNode("div",{class:"title",onClick:n[0]||(n[0]=c=>r.contentVisible=!r.contentVisible)},[t.createTextVNode(t.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),t.createVNode(s,{class:"metric-add-icon"})]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[r.contentVisible?(t.openBlock(),t.createElementBlock("div",gs,[t.renderSlot(e.$slots,"default"),t.createVNode(d,{appearance:"tertiary",class:"metric-remove-button",onClick:n[1]||(n[1]=c=>e.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(l)]),_:1})])):t.createCommentVNode("",!0)]),_:3})],2)}const jn=U(ps,[["render",ys]]),bs={class:"field-object-container"},_s={key:1},ks=["id"],Cs={key:0},ws=["onUpdate:modelValue"],Es={key:1},Ss=["onUpdate:modelValue"],Ms={key:2},Vs=["onUpdate:modelValue"],Ts=["onClick"],Ln=U(Object.assign({mixins:[ne],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",bs,[n.schema.schema?(t.openBlock(),t.createBlock(L,{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",_s,[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,(r,i)=>(t.openBlock(),t.createElementBlock("tr",{key:i},[t.createElementVNode("td",null,t.toDisplayString(i),1),n.keyTypes[i]==="string"?(t.openBlock(),t.createElementBlock("td",Cs,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[i]=s,type:"text"},null,8,ws),[[t.vModelText,n.value[i]]])])):t.createCommentVNode("",!0),n.keyTypes[i]==="boolean"?(t.openBlock(),t.createElementBlock("td",Es,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[i]=s,type:"checkbox"},null,8,Ss),[[t.vModelCheckbox,n.value[i]]])])):t.createCommentVNode("",!0),n.keyTypes[i]==="number"?(t.openBlock(),t.createElementBlock("td",Ms,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[i]=s,type:"number"},null,8,Vs),[[t.vModelText,n.value[i]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:s=>n.removeElement(i)},null,8,Ts)])]))),128))],10,ks),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":o[0]||(o[0]=r=>n.newKeyType=r)},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]=r=>n.newKeyName=r),type:"text"},null,512),[[t.vModelText,n.newKeyName]]),t.createElementVNode("input",{type:"button",value:"Add key",onClick:o[2]||(o[2]=(...r)=>n.addKey&&n.addKey(...r))})]))])),[[a,n.attributes]])}}}),[["__scopeId","data-v-4ace4106"]]),Ns=["id"],Bs=["data-testid"],Is={class:"item-wrapper"},As={class:"index-wrapper"},Os={key:0},Fs={key:1},$s=["onUpdate:modelValue","placeholder","type","onInput"],Us={key:0,class:"hint"},Rs={class:"input-item"},Ds=["placeholder"],Ps={key:0,class:"hint"},qn=U(Object.assign({mixins:[ne],expose:["validate","clearValidationErrors","schema"],inject:{autofillSlot:{from:Z,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(r=>{const i=r.indexOf(o+"-");if(i>-1&&Array.isArray(n))if(n.length>0){const l=r.split("-").filter(c=>n.find(f=>f.model===c)),d=r.split(`-${l}`)[0].split(`${o}-`)[1];l.length?a[d]={...a[d],[l]:e[r]}:a[r.substring(i+`${o}-`.length)]=e[r]}else a[r.substring(`${o}-`.length)]=e[r];else{const l=r.split("-").filter(c=>c===this.schema.model),d=r.split(`-${l}`)[0].split(`${o}-`)[1];d&&(a[d]=e[r])}return r}),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,(r,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,"data-testid":`field-object-key-${i}`},[t.createElementVNode("div",null,[t.createElementVNode("div",Is,[t.createElementVNode("div",As,[t.createElementVNode("strong",null,t.toDisplayString(i),1),t.createElementVNode("div",null,[t.createVNode(a,{appearance:"tertiary",class:"delete",icon:"",type:"button",onClick:s=>n.removeElement(i)},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.TrashIcon))]),_:2},1032,["onClick"])])]),o[1]||(o[1]=t.createElementVNode("hr",{class:"divider"},null,-1)),n.subSchema?(t.openBlock(),t.createElementBlock("div",Os,[t.createVNode(L,{model:n.transformedModel[i],options:{helpAsHtml:!0},schema:n.subSchema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",Fs,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[i]=s,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:n.valueInputType,onInput:s=>n.updateModel(n.value[i],n.model[n.schema.model])},null,40,$s),[[t.vModelDynamic,n.value[i]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",Us,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:s=>n.value[i]=s,value:n.value[i]},null,8,["schema","update","value"]))])),o[2]||(o[2]=t.createElementVNode("hr",{class:"wide-divider"},null,-1))])])],8,Bs))),128)),t.createElementVNode("div",{class:t.normalizeClass(["input-wrapper",{indent:n.hasObjectKeys}])},[t.createElementVNode("div",Rs,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=r=>n.newKeyName=r),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Ds),[[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",Ps,t.toDisplayString(n.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,Ns)}}}),[["__scopeId","data-v-502ed880"]]),js={class:"radio-selection-group"},vn=U(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,r=o,i=t.toRefs(a),{updateModelValue:s,value:l,clearValidationErrors:d}=X.useAbstractFields({model:i.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:f=>{r("modelUpdated",f.value,f.model)}});n({clearValidationErrors:d});const c=f=>{let u=f;typeof f=="string"&&(u=f.split(","),a.schema.array||(u=u.toString())),s(u,f)};return(f,u)=>{const h=t.resolveComponent("KRadio");return t.openBlock(),t.createElementBlock("div",js,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.values,(w,B)=>(t.openBlock(),t.createBlock(h,{id:e.schema.name+"-"+B,key:w.value,modelValue:t.unref(l),"onUpdate:modelValue":u[0]||(u[0]=m=>t.isRef(l)?l.value=m:null),label:w.name,"label-attributes":{info:e.schema.help},name:e.schema.name,required:e.schema.required||void 0,"selected-value":w.value,onChange:c},null,8,["id","modelValue","label","label-attributes","name","required","selected-value"]))),128))])}}}),[["__scopeId","data-v-09b8afda"]]),Kn=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,r=o,i=t.computed(()=>a.schema.selectOptions||{}),s=m=>q(m)?null:m,l=t.toRefs(a),{getFieldID:d,clearValidationErrors:c,value:f}=X.useAbstractFields({model:l.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:s,emitModelUpdated:m=>{r("modelUpdated",m.value,m.model)}});n({clearValidationErrors:c});const u=t.computed(()=>{const m=a.schema.values;return h(typeof m=="function"?m.apply(this,[a.model,a.schema]):m)}),h=m=>{const _=[];return m.forEach(C=>{_.push({label:B(C),value:w(C),disabled:typeof C=="object"&&C.disabled||void 0,group:typeof C=="object"&&String(C.group||"").toUpperCase()||void 0})}),_},w=m=>{if(W(m)){if(i.value&&typeof i.value.value<"u")return m[i.value.value];if(typeof m.id<"u")return String(m.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 m},B=m=>{if(W(m)){if(i.value&&typeof i.value.name<"u")return m[i.value.name];if(typeof m.name<"u")return String(m.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(m)};return(m,_)=>{const C=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(C,{id:t.unref(d)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":_[0]||(_[0]=S=>t.isRef(f)?f.value=S:null),class:t.normalizeClass(e.schema.fieldClasses),clearable:!e.schema.required,disabled:e.disabled||void 0,items:u.value,"kpop-attributes":{"data-testid":`${t.unref(d)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:i.value.hideNoneSelectedText?void 0:i.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"])}}}),Ls={name:"FieldArray",components:{FieldArrayItem:Un,FieldArrayMultiItem:Rn,FieldSelect:Kn,FieldMetric:jn,FieldObject:Ln,FieldObjectAdvanced:qn,FieldAutoSuggest:Dn,FieldRadio:vn,FieldArrayCardContainer:$n,FieldInput:Pn},mixins:[ne],inject:{autofillSlot:{from:Z,default:void 0}},props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},emits:["refreshModel"],methods:{generateSchema(e,n,o){var r,i,s;let a;return n&&(a=JSON.parse(JSON.stringify(n)),(s=(i=(r=a.schema)==null?void 0:r.fields)==null?void 0:i.map)==null||s.call(i,l=>(l.id=`${l.id||l.model}-${o}`,l))),{...a,set(l,d){e[o]=d},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,r;let o=e;((r=(a=this.schema)==null?void 0:a.inputAttributes)==null?void 0:r.type)==="number"&&Je(parseFloat(e))&&(o=parseFloat(e)),this.value=this.value.map((i,s)=>s===n?o:i)}}},qs=["id"],vs={key:1},Ks=["onUpdate:modelValue","aria-labelledby","type"],zs=["onUpdate:modelValue","aria-labelledby"];function xs(e,n,o,a,r,i){const s=t.resolveComponent("KTextArea"),l=t.resolveComponent("KInput"),d=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,(c,f)=>(t.openBlock(),t.createElementBlock("div",{key:f,class:t.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,index:f,model:c,schema:i.generateSchema(e.value,e.schema.items,f),onRemoveItem:u=>i.removeElement(f)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,f),onModelUpdated:i.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["index","model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",vs,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,f),onModelUpdated:i.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-${f}`,model:c,schema:i.generateSchema(e.value,e.schema.items,f),onRemoveItem:u=>i.removeElement(f)},{after:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.autofillSlot),{schema:e.schema,update:u=>e.value[f]=u,value:e.value[f]},null,8,["schema","update","value"]))]),default:t.withCtx(()=>{var u;return[e.schema.inputAttributes&&e.schema.inputAttributes.type==="textarea"?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,ref_for:!0},e.schema.inputAttributes,{id:e.getFieldID(e.schema),modelValue:e.value[f],"onUpdate:modelValue":h=>e.value[f]=h,"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(l,t.mergeProps({key:1,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{"model-value":e.value[f],type:e.schema.inputAttributes&&e.schema.inputAttributes.type||"text",onInput:h=>{i.handleInput(h,f)}}),null,16,["aria-labelledby","model-value","type","onInput"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,"onUpdate:modelValue":h=>e.value[f]=h,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:((u=e.schema.inputAttributes)==null?void 0:u.type)||"text"}),null,16,Ks)),[[t.vModelDynamic,e.value[f]]])]}),_: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":u=>e.value[f]=u,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,zs),[[t.vModelText,e.value[f]]]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.autofillSlot),{schema:e.schema,update:u=>e.value[f]=u,value:e.value[f]},null,8,["schema","update","value"]))],64))],2))),128)),t.createVNode(d,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:i.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,qs)):t.createCommentVNode("",!0)}const Hs=U(Ls,[["render",xs],["__scopeId","data-v-27efd618"]]),Ys={class:"form-field-wrapper field-checkbox"},Gs=U(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,r=o,i=t.toRefs(a),{getFieldID:s,value:l,clearValidationErrors:d}=X.useAbstractFields({model:i.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:c=>{r("modelUpdated",c.value,c.model)}});return n({clearValidationErrors:d}),(c,f)=>{const u=t.resolveComponent("KCheckbox");return t.openBlock(),t.createElementBlock("div",Ys,[t.createVNode(u,t.mergeProps(c.$attrs,{id:t.unref(s)(e.schema),modelValue:t.unref(l),"onUpdate:modelValue":f[0]||(f[0]=h=>t.isRef(l)?l.value=h: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"]]);var Ws=4;function zn(e){return Fe(e,Ws)}const Zs={class:"wrapper"},Js=["disabled"],Qs=["id","checked","disabled","onChange","name"],Xs=["disabled"],ed={class:"info"},td={class:"dropList"},nd=["id","checked","disabled","onChange","name"];function od(e,n,o,a,r,i){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",Zs,[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(i.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":i.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(l)||null,disabled:e.disabled||null,onChange:d=>i.onChanged(d,l),name:i.getInputName(l)},null,40,Qs),[[s,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)])],2))),256))],8,Js)):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:r.comboExpanded}]),onClick:n[0]||(n[0]=(...l)=>i.onExpandCombo&&i.onExpandCombo(...l))},[t.createElementVNode("div",ed,t.toDisplayString(i.selectedCount)+" selected",1),n[1]||(n[1]=t.createElementVNode("div",{class:"arrow"},null,-1))],2),t.createElementVNode("div",td,[r.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(i.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":i.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(l)||null,disabled:e.disabled||null,onChange:d=>i.onChanged(d,l),name:i.getInputName(l)},null,40,nd),[[s,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,Xs))])),[[s,"wrapper"]])}const rd=U({mixins:[ne],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?mn(this.schema.inputName+"_"+this.getItemValue(e)):mn(this.getItemValue(e))},getItemValue(e){if(W(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(W(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((q(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const o=zn(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=zn(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",od]]),ad={name:"FieldKeyValuePairs",components:{TrashIcon:oe.TrashIcon},mixins:[ne],inject:{autofillSlot:{from:Z,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)}}},id={class:"key-value-pairs-editor"},ld={class:"pair-item-cell"},sd=["data-testid","placeholder","value","onInput"],dd={class:"pair-item-cell"},cd=["data-testid","placeholder","value","onInput"];function md(e,n,o,a,r,i){const s=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",id,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.pairs,(d,c)=>(t.openBlock(),t.createElementBlock("div",{key:c,class:"pair-item"},[t.createElementVNode("div",ld,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-key-${c}`,placeholder:e.schema.keyInputPlaceholder??"Key",type:"text",value:d.key,onInput:f=>{i.onInput(f,c,"key")}},null,40,sd),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.autofillSlot),{schema:e.schema,update:f=>i.onInput({target:{value:f}},c,"key"),value:d.key},null,8,["schema","update","value"]))]),t.createElementVNode("div",dd,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-value-${c}`,placeholder:e.schema.valueInputPlaceholder??"Value",type:"text",value:d.value,onInput:f=>{i.onInput(f,c,"value")}},null,40,cd),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.autofillSlot),{schema:e.schema,update:f=>i.onInput({target:{value:f}},c,"value"),value:d.value},null,8,["schema","update","value"]))]),t.createVNode(l,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${c}`,onClick:()=>{i.removePair(c)}},{default:t.withCtx(()=>[t.createVNode(s)]),_:2},1032,["data-testid","onClick"])]))),128)),t.createVNode(l,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:i.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const ud=U(ad,[["render",md],["__scopeId","data-v-70998d5b"]]),fd=U(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:r}=X.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(i,s)=>{const l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["field-label",e.schema.fieldClasses])},[t.createVNode(l,{id:t.unref(a)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-d046a15a"]]),hd=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,r=o,i=t.toRef(a,"model"),{getLabelId:s,getFieldID:l,clearValidationErrors:d,value:c}=X.useAbstractFields({model:i,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:u=>{r("modelUpdated",u.value,u.model)}});n({clearValidationErrors:d});const f=t.computed(()=>{var u,h;return a.schema.values?a.schema.values:(h=(u=a.schema.elements)==null?void 0:u.one_of)!=null&&h.length?a.schema.elements.one_of.map(w=>({label:String(w),value:String(w)})):[]});return(u,h)=>{const w=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(w,{id:t.unref(l)(e.schema),modelValue:t.unref(c),"onUpdate:modelValue":h[0]||(h[0]=B=>t.isRef(c)?c.value=B:null),"aria-labelledby":t.unref(s)(e.schema),class:t.normalizeClass(e.schema.fieldClasses),"data-testid":"field-multiselect",disabled:e.disabled||void 0,items:f.value,"kpop-attributes":{"data-testid":`${t.unref(l)(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"])}}}),pd={class:"selection-group"},gd={class:"form-group horizontal-radios"},yd={class:"radio-group"},bd=["disabled","value"],_d={class:"control-help"},kd={class:"option-field"},Cd={class:"option-field-container"},wd=U(Object.assign({mixins:[ne],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(r=>this.updateModel("",r.model)),o&&o.forEach(r=>this.updateModel(this.fieldModel[r.model],r.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}=ee.createI18n("en-us",te);return(o,a)=>(t.openBlock(),t.createElementBlock("div",pd,[(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",gd,[t.createElementVNode("div",yd,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(r,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:t.normalizeClass(["option-group",{"radio-disabled":o.$props.disabled}])},[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${r.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=s=>o.checkedGroup=s),class:"k-input",disabled:o.$props.disabled,type:"radio",value:i},null,8,bd),[[t.vModelRadio,o.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(r.label)+" ",1),t.createElementVNode("div",_d,t.toDisplayString(r.description),1)],2)],2))),128))])])]),_:1},8,["text"])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(r,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:"option-group"},[t.withDirectives(t.createElementVNode("div",kd,[t.createElementVNode("div",Cd,[t.createVNode(L,{model:o.model,options:{helpAsHtml:!0},schema:{fields:r.fields},onModelUpdated:o.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[t.vShow,r.fields&&o.checkedGroup===i]])]))),128))]))}}),[["__scopeId","data-v-7b085c16"]]),Ed={class:"form-field-wrapper"},Sd=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,r=o,{t:i}=ee.createI18n("en-us",te),s=h=>h!=null&&a.schema.valueOn?h===a.schema.valueOn:h,l=h=>h!=null&&a.schema.valueOn?h?a.schema.valueOn:a.schema.valueOff:h,d=t.toRefs(a),{getFieldID:c,value:f,clearValidationErrors:u}=X.useAbstractFields({model:d.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:s,formatValueToModel:l,emitModelUpdated:h=>{r("modelUpdated",h.value,h.model)}});return n({clearValidationErrors:u}),(h,w)=>{const B=t.resolveComponent("KInputSwitch");return t.openBlock(),t.createElementBlock("div",Ed,[t.createVNode(B,{id:t.unref(c)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":w[0]||(w[0]=m=>t.isRef(f)?f.value=m:null),autocomplete:e.schema.autocomplete,class:t.normalizeClass(e.schema.fieldClasses),disabled:e.disabled||void 0,label:t.unref(f)?e.schema.textOn||t.unref(i)("vfg.labels.on"):e.schema.textOff||t.unref(i)("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"])])}}}),Md={class:"field-textarea"},Vd={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:Jl,FieldArray:Hs,FieldArrayCardContainer:$n,FieldArrayItem:Un,FieldArrayMultiItem:Rn,FieldAutoSuggest:Dn,FieldCheckbox:Gs,FieldChecklist:rd,FieldInput:Pn,FieldKeyValuePairs:ud,FieldLabel:fd,FieldMetric:jn,FieldMultiselect:hd,FieldObject:Ln,FieldObjectAdvanced:qn,FieldRadio:vn,FieldSelect:Kn,FieldSelectionGroup:wd,FieldSwitch:Sd,FieldTextArea:U(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,r=o,i=t.toRefs(a),s=t.inject(Z,void 0),{updateModelValue:l,getFieldID:d,clearValidationErrors:c,value:f}=X.useAbstractFields({model:i.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:h=>{r("modelUpdated",h.value,h.model)}});n({clearValidationErrors:c});const u=h=>{f.value=h,l(h,h)};return(h,w)=>{const B=t.resolveComponent("KTextArea");return t.openBlock(),t.createElementBlock("div",Md,[t.createVNode(B,t.mergeProps(h.$attrs,{id:t.unref(d)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":w[0]||(w[0]=m=>t.isRef(f)?f.value=m: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(s)),{schema:e.schema,update:u,value:t.unref(f)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-0e146fba"]])},Symbol.toStringTag,{value:"Module"})),mixins:[un],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:{fieldTypeHasLabel(e){if(q(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=F(this.options,"fieldIdPrefix","");return dt(e,n)},getTooltipId(e){return`${this.getFieldID(e)}-tooltip`},getFieldComponent(e){return e.component?e.component:"field-"+e.type},getButtonType(e){return F(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 $(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\./,""):""}}},Td=["innerHTML"],Nd={class:"icon-wrapper"},Bd=["innerHTML"],Id={key:0,class:"link-wrapper"},Ad={class:"field-wrap"},Od={key:0,class:"buttons"},Fd=["type","onClick","textContent"],$d=["innerHTML"],Ud={key:2,class:"errors help-block"},Rd=["innerHTML"];function Dd(e,n,o,a,r,i){const s=t.resolveComponent("KExternalLink"),l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[i.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(l,{key:0,"aria-describedby":o.field.help?i.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:i.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:i.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",Nd,[t.createElementVNode("span",{innerHTML:i.formattedLabel(o.field.label)},null,8,Bd)]),o.field.link?(t.openBlock(),t.createElementBlock("div",Id,[t.createVNode(s,{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:o.field.help},null,8,Td)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",Ad,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.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"?i.fieldHint(o.field):void 0,model:o.model,schema:i.schema,vfg:o.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onRefreshModel","onValidated"])),i.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",Od,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.field.buttons,(d,c)=>(t.openBlock(),t.createElementBlock("button",{key:c,class:t.normalizeClass(d.classes),type:i.getButtonType(d),onClick:f=>i.buttonClickHandler(d,o.field,f),textContent:t.toDisplayString(d.label)},null,10,Fd))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&o.field.type!=="input"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"hint",innerHTML:i.fieldHint(o.field)},null,8,$d)):t.createCommentVNode("",!0),i.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",Ud,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.fieldErrors(o.field),(d,c)=>(t.openBlock(),t.createElementBlock("span",{key:c,innerHTML:d},null,8,Rd))),128))])):t.createCommentVNode("",!0)],2)}const xn=U(Vd,[["render",Dd],["__scopeId","data-v-172f268b"]]),Pd="12px";var Re=(e=>(e.REDIS_CE="redis-ce",e.REDIS_EE="redis-ee",e))(Re||{});const jd=e=>{var n,o;return e.type===Re.REDIS_CE?"Host/Port":(n=e.config.sentinel_nodes)!=null&&n.length?"Sentinel":(o=e.config.cluster_nodes)!=null&&o.length?"Cluster":"Host/Port"},Ld={[Re.REDIS_CE]:"open source",[Re.REDIS_EE]:"enterprise"},Hn=e=>Ld[e]??"",qd={class:"partial-config-card"},vd={class:"config-card-row-label"},Kd={class:"label-text"},zd=["data-testid"],xd=["data-testid"],Hd={key:1},Yd=["data-testid"],Gd=["data-testid"],Wd=U(t.defineComponent({__name:"RedisConfigCard",props:{configFields:{type:Object,required:!0},pluginRedisFields:{type:Array,required:!0}},setup(e){const{t:n,formatUnixTimeStamp:o}=ee.createI18n("en-us",te),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}},r=e,i=u=>u!=null,s=(u,h)=>i(h)&&["password","sentinel_password"].includes(u)?"password":"text",{convertKeyToTitle:l}=Pe.useStringHelpers(),d=t.computed(()=>Object.entries(r.configFields).map(([u,h])=>{var w,B,m,_;return{key:u,label:((w=a[u])==null?void 0:w.label)??l(u),value:(B=a[u])!=null&&B.formatter?a[u].formatter(h):h,type:((m=a[u])==null?void 0:m.type)??s(u,h),order:((_=a[u])==null?void 0:_.order)??100}}).sort((u,h)=>u.order-h.order).filter(u=>u.type!=="hidden")),c=X.useRedisNonStandardFields(r.configFields,r.pluginRedisFields),f=t.computed(()=>d.value.concat(c));return(u,h)=>{const w=t.resolveComponent("KCopy");return t.openBlock(),t.createElementBlock("div",qd,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,({key:B,label:m,value:_,type:C})=>(t.openBlock(),t.createElementBlock("div",{key:B,class:"partial-config-card-row"},[t.createElementVNode("div",vd,[t.createElementVNode("div",Kd,t.toDisplayString(m),1)]),t.createElementVNode("div",{class:"config-card-row-value","data-testid":`${B}-property-value`},[i(_)?(t.openBlock(),t.createElementBlock("div",Hd,[C==="password"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${B}-copy-password`},[t.createVNode(w,{format:"redacted",text:String(_)},null,8,["text"])],8,Yd)):(t.openBlock(),t.createElementBlock("div",{key:1,"data-testid":`${B}-plain-text`},t.toDisplayString(_),9,Gd))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${B}-no-value`}," – ",8,xd))],8,zd)]))),128))])}}}),[["__scopeId","data-v-c1eb723f"]]),Zd={class:"redis-config-select","data-testid":"redis-config-select"},Jd={class:"selected-redis-config"},Qd=["data-testid"],Xd={class:"select-item-name","data-testid":"selected-redis-config"},ec={class:"empty-redis-config","data-testid":"empty-redis-config"},tc={key:1,class:"redis-shared-config-error-message","data-testid":"redis-config-fetch-error"},nc="1000",Yn=U(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}=ee.createI18n("en-us",te),o=t.inject(Dt),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"}},r=e,i=t.ref(null),{getMessageFromError:s}=Pe.useErrors(),l=t.inject(Rt),{debouncedQueryChange:d,loading:c,error:f,loadItems:u,results:h}=Pe.useDebouncedFilter(l,a[l.app].getAll,nc,{fetchedItemsKey:"data",searchKeys:["id","name"]}),w=t.computed(()=>f.value?s(f.value):""),B=S=>{let g=`${l.apiBaseUrl}${a[l.app].getOne}`;return l.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(l==null?void 0:l.controlPlaneId)||""):l.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,l!=null&&l.workspace?`/${l.workspace}`:"")),g=g.replace(/{id}/gi,String(S)),g},m=t.computed(()=>{const S=(h.value||[]).map(g=>({label:g.id,name:g.name,value:g.id,type:g.type,tag:jd(g)})).filter(g=>g.type==="redis-ce"||g.type==="redis-ee");return r.redisType!=="all"?S.filter(g=>g.type===r.redisType):S}),{axiosInstance:_}=Pe.useAxios(l==null?void 0:l.axiosRequestConfig),C=async S=>{if(S){r.updateRedisModel(S);try{const g=await _.get(B(S));if(g.data.config){const M=Object.assign(g.data,g.data.config);delete M.config,i.value=M}}catch(g){console.error(g)}}};return t.watch(()=>o==null?void 0:o.value,async S=>{S&&await u()}),t.onBeforeMount(()=>{u(),r.defaultRedisConfigItem&&C(r.defaultRedisConfigItem)}),(S,g)=>{const M=t.resolveComponent("KLabel"),E=t.resolveComponent("KBadge"),b=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Zd,[t.createVNode(M,{info:e.isCustomPlugin?t.unref(n)("redis.custom_plugin.tooltip"):t.unref(n)("redis.shared_configuration.tooltip",{type:t.unref(Hn)(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"]),g[2]||(g[2]=t.createElementVNode("div",{class:"shared-redis-config-title"},null,-1)),t.createVNode(b,{class:"redis-config-select-trigger","data-testid":"redis-config-select-trigger","enable-filtering":"","filter-function":()=>!0,items:m.value,loading:t.unref(c),"model-value":e.defaultRedisConfigItem,placeholder:t.unref(n)("redis.shared_configuration.selector.placeholder"),onChange:g[1]||(g[1]=p=>C(p==null?void 0:p.value)),onQueryChange:t.unref(d)},{"selected-item-template":t.withCtx(({item:p})=>[t.createElementVNode("div",Jd,t.toDisplayString(p.name),1)]),"item-template":t.withCtx(({item:p})=>[t.createElementVNode("div",{class:"plugin-form-redis-configuration-dropdown-item","data-testid":`redis-configuration-dropdown-item-${p.name}`},[t.createElementVNode("span",Xd,t.toDisplayString(p.name),1),t.createVNode(E,{appearance:"info",class:"select-item-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p.tag),1)]),_:2},1024)],8,Qd)]),empty:t.withCtx(()=>[t.createElementVNode("div",ec,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:g[0]||(g[0]=p=>S.$emit("showNewPartialModal"))},[t.createVNode(t.unref(oe.AddIcon),{size:t.unref(Pd)},null,8,["size"]),t.createElementVNode("span",null,t.toDisplayString(t.unref(n)("redis.shared_configuration.create_new_configuration",{type:t.unref(Hn)(e.redisType)})),1)])]),_:1},8,["items","loading","model-value","placeholder","onQueryChange"])]),i.value?(t.openBlock(),t.createBlock(Wd,{key:0,"config-fields":i.value,"plugin-redis-fields":e.pluginRedisFields},null,8,["config-fields","plugin-redis-fields"])):t.createCommentVNode("",!0),w.value?(t.openBlock(),t.createElementBlock("p",tc,t.toDisplayString(w.value||t.unref(n)("redis.shared_configuration.error")),1)):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-0001f209"]]),oc={key:0},rc={class:"redis-config-radio-group","data-testid":"redis-config-radio-group"},ac={key:0,class:"shared-redis-config"},ic={key:1,class:"dedicated-redis-config"},lc={class:"dedicated-redis-config-title"},sc={name:"VueFormGenerator",components:{formGroup:xn,formRedis:U(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:r}=ee.createI18n("en-us",te),i=t.computed(()=>o.field.pluginType==="custom"),s=t.ref(!o.isEditing),l=t.ref(),d=t.ref({}),c=t.ref(),f=m=>$(m.visible)?m.visible.call(this,o.model,m,this):q(m.visible)?!0:m.visible,u=async m=>{a("modelUpdated",[{id:m,path:o.redisPath}],"partials"),c.value=[{id:m,path:o.redisPath}],l.value=m},h=(m,_)=>{d.value={...d.value,[_]:m},a("modelUpdated",m,_)},w=()=>{a("refreshModel")},B=(m,_,C)=>{a("validated",m,_,C)};return t.watch(()=>s.value,m=>{m?c.value&&a("partialToggled","redis",{partials:c.value}):a("partialToggled","partials",d.value)}),t.onBeforeMount(()=>{var m,_,C;if(o.model&&(d.value=o.field.fields.reduce((S,g)=>(Object.keys(o.model).includes(g.model)&&(S[g.model]=o.model[g.model]),S),{})),(C=(_=(m=o==null?void 0:o.model)==null?void 0:m.partials)==null?void 0:_[0])!=null&&C.id){const S=o.model.partials[0].id;s.value=!0,l.value=S}}),(m,_)=>{const C=t.resolveComponent("KAlert"),S=t.resolveComponent("KBadge"),g=t.resolveComponent("KRadio"),M=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",null,[i.value?(t.openBlock(),t.createElementBlock("div",oc,[t.createVNode(C,{"data-testid":"custom-plugin-redis-config-note",message:t.unref(r)("redis.custom_plugin.alert")},null,8,["message"]),t.createVNode(Yn,{"default-redis-config-item":l.value,"is-custom-plugin":"","plugin-redis-fields":e.field.fields,"update-redis-model":u,onShowNewPartialModal:_[0]||(_[0]=E=>m.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields"])])):(t.openBlock(),t.createBlock(M,{key:1,class:"redis-config-card","data-testid":"redis-config-card",title:t.unref(r)("redis.title")},{default:t.withCtx(()=>[t.createElementVNode("div",rc,[t.createVNode(g,{modelValue:s.value,"onUpdate:modelValue":_[1]||(_[1]=E=>s.value=E),card:"","card-orientation":"horizontal","data-testid":"shared-redis-config-radio",description:t.unref(r)("redis.shared_configuration.description"),label:t.unref(r)("redis.shared_configuration.label"),"selected-value":!0},{default:t.withCtx(()=>[t.createVNode(S,{appearance:"success"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("redis.shared_configuration.badge")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),t.createVNode(g,{modelValue:s.value,"onUpdate:modelValue":_[2]||(_[2]=E=>s.value=E),card:"","card-orientation":"horizontal","data-testid":"dedicated-redis-config-radio",description:t.unref(r)("redis.dedicated_configuration.description"),label:t.unref(r)("redis.dedicated_configuration.label"),"selected-value":!1},null,8,["modelValue","description","label"])]),s.value?(t.openBlock(),t.createElementBlock("div",ac,[t.createVNode(Yn,{"default-redis-config-item":l.value,"plugin-redis-fields":e.field.fields,"redis-type":e.field.redisType,"update-redis-model":u,onShowNewPartialModal:_[3]||(_[3]=E=>m.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields","redis-type"])])):(t.openBlock(),t.createElementBlock("div",ic,[t.createElementVNode("div",lc,t.toDisplayString(t.unref(r)("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,E=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:E.model},[f(E)?(t.openBlock(),t.createBlock(xn,{key:0,ref_for:!0,ref:"children",errors:e.errors,field:E,model:e.model,options:e.options,vfg:e.vfg,onModelUpdated:h,onRefreshModel:w,onValidated:B},null,8,["errors","field","model","options","vfg"])):t.createCommentVNode("",!0)],64))),128))]),_:1}))]))]),_:1},8,["title"]))])}}}),[["__scopeId","data-v-b9a17494"]])},mixins:[un],inject:{autofillSlot:{from:Z,default:void 0}},provide(){var e;return{...!this.autofillSlot&&{[Z]:(e=this.$slots)==null?void 0:e[be]}}},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&&Y(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&Y(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 $(e.visible)?e.visible.call(this,this.model,e,this):q(e.visible)?!0:e.visible},onFieldValidated(e,n,o){this.errors=this.errors.filter(r=>r.field.fieldName!==o.schema.fieldName),!e&&n&&n.length>0&&Y(n,r=>{this.errors.push({field:o.schema,error:r})});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=F(this.options,"validateAsync",!1)),this.clearValidationErrors();const n=[],o=[];Y(this.$refs.children,r=>{$(r.validate)&&(n.push(r.$refs.child),o.push(r.$refs.child.validate(!0)))});const a=r=>{const i=[];Y(r,(l,d)=>{Array.isArray(l)&&l.length>0&&Y(l,c=>{i.push({field:n[d].schema,error:c})})}),this.errors=i;const s=i.length===0;return this.$emit("validated",s,i,this),e?i:s};return e?Promise.all(o).then(a):a(o)},clearValidationErrors(){this.errors.splice(0),Y(this.$refs.children,e=>{e.clearValidationErrors()})}}},dc={key:0,class:"vue-form-generator"},cc={key:0};function mc(e,n,o,a,r,i){const s=t.resolveComponent("form-redis"),l=t.resolveComponent("form-group"),d=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",dc,[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(i.fields,c=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:c.model},[c.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(s,{key:0,errors:r.errors,field:c,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:r.vfg,onModelUpdated:i.onModelUpdated,onPartialToggled:i.onPartialToggled,onShowNewPartialModal:f=>e.$emit("showNewPartialModal",c.redisType),onValidated:i.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):i.fieldVisible(c)?(t.openBlock(),t.createBlock(l,{key:1,ref_for:!0,ref:"children",errors:r.errors,field:c,model:o.model,options:o.options,vfg:r.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.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(i.groups,(c,f)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`group-${f}`},[c.collapsible!==void 0&&c.collapsible!==!1?(t.openBlock(),t.createBlock(d,{key:0,class:"root-level-collapse","model-value":!1,title:c.collapsible.title},t.createSlots({default:t.withCtx(()=>{var u,h,w,B;return[(u=c.slots)!=null&&u.beforeContent?t.renderSlot(e.$slots,(h=c.slots)==null?void 0:h.beforeContent,{key:0}):t.createCommentVNode("",!0),c.fields.length===0&&((w=c.slots)!=null&&w.emptyState)?t.renderSlot(e.$slots,(B=c.slots)==null?void 0:B.emptyState,{key:1}):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:2,class:t.normalizeClass(e.getFieldRowClasses(c))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.fields,m=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m.model},[i.fieldVisible(m)?(t.openBlock(),t.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:r.errors,field:m,model:o.model,options:o.options,vfg:r.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),c.collapsible!==!0&&c.collapsible.nestedCollapsible&&c.collapsible.nestedCollapsible.fields.length>0?(t.openBlock(),t.createBlock(d,{key:3,class:"nested-collapse","model-value":r.collapseStates[`group-${f}-nested`]??!0,"trigger-alignment":"leading","trigger-label":r.collapseStates[`group-${f}-nested`]??!0?c.collapsible.nestedCollapsible.triggerLabel.expand:c.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":m=>r.collapseStates[`group-${f}-nested`]=m},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(e.getFieldRowClasses(c))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.collapsible.nestedCollapsible.fields,m=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m.model},[m.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(s,{key:0,errors:r.errors,field:m,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:r.vfg,onModelUpdated:i.onModelUpdated,onPartialToggled:i.onPartialToggled,onShowNewPartialModal:_=>e.$emit("showNewPartialModal",m.redisType),onValidated:i.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):i.fieldVisible(m)?(t.openBlock(),t.createBlock(l,{key:1,ref_for:!0,ref:"children",errors:r.errors,field:m,model:o.model,options:o.options,vfg:r.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.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},[c.collapsible.description?{name:"visible-content",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:1,class:t.normalizeClass(e.getFieldRowClasses(c))},{default:t.withCtx(()=>[c.legend?(t.openBlock(),t.createElementBlock("legend",cc,t.toDisplayString(c.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.fields,u=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:u.model},[i.fieldVisible(u)?(t.openBlock(),t.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:r.errors,field:u,model:o.model,options:o.options,vfg:r.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.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 L=U(sc,[["render",mc]]),De={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"},Gn=new Set(["config-client_id","config-client_secret","config-issuer"]),Wn=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"]),uc={name:"OIDCForm",components:{VueFormGenerator:L},provide(){var e;return{[Z]:(e=this.$slots)==null?void 0:e[be]}},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:De.openIdConnectDocs,openIdConnectJWKLink:De.openIdConnectJWKDocs,openIdConnectClusterNodesLink:De.openIdConnectClusterNodesDocs,openIdConfigurationDocs:De.openIdConfigurationDocs,openIdAuthorizationDocs:De.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(r=>!r.model.startsWith("config")&&r.model!=="tags")};const n=this.formSchema.fields.reduce((r,i)=>(r[i.model]=i,r),{});this.commonFieldsSchema={fields:Array.from(Gn).reduce((r,i)=>(n[i]&&r.push(n[i]),r),[])},this.authFieldsSchema={fields:Array.from(Wn).reduce((r,i)=>(n[i]&&r.push(n[i]),r),[])};const{redis:o,redisModels:a}=X.useRedisPartial(this.formSchema);this.advancedFieldsSchema={fields:this.formSchema.fields.filter(r=>r.model.startsWith("config")&&r.model!=="config-auth_methods"&&!Gn.has(r.model)&&!Wn.has(r.model)&&(!this.enableRedisPartial||!a.includes(r.model))||r.model==="tags").reduce((r,i)=>{var s,l,d,c;switch(i.model){case"config-client_jwk":{if(Array.isArray((l=(s=i.items)==null?void 0:s.schema)==null?void 0:l.fields))for(const f of i.items.schema.fields)f.label=f.model;r.push({...i,link:this.openIdConnectJWKLink,newElementButtonLabel:"+ Add Client JWK",...Array.isArray((c=(d=i.items)==null?void 0:d.schema)==null?void 0:c.fields)&&i.items.schema.fields.map(f=>({...f,label:f.model}))});break}case"config-session_redis_cluster_nodes":{r.push({...i,link:this.openIdConnectClusterNodesLink,newElementButtonLabel:"+ Add Cluster Node"});break}default:r.push(i)}return r},[])},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 r of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const i of r.fields){const s=(e=n[i.model])==null?void 0:e.help;i.help===void 0&&typeof s=="string"&&(i.help=s)}}},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()}}},fc={class:"general-settings"},hc={class:"link-wrapper"},pc={class:"auth-method-container"},gc={class:"general-settings"},yc={class:"link-wrapper"},bc={class:"general-settings"},_c={class:"link-wrapper"};function kc(e,n,o,a,r,i){const s=t.resolveComponent("VueFormGenerator"),l=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KLabel"),c=t.resolveComponent("KCheckbox"),f=t.resolveComponent("KInputSwitch"),u=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[o.formModel.id&&o.isEditing||!o.isEditing?(t.openBlock(),t.createBlock(s,{key:0,class:"global-fields",model:o.formModel,options:o.formOptions,schema:r.globalFields,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(u,{tabs:r.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",fc,[t.createElementVNode("div",hc,[t.createVNode(l,{href:r.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)),i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:r.commonFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(d,null,{default:t.withCtx(()=>n[3]||(n[3]=[t.createTextVNode("Auth Methods")])),_:1}),t.createElementVNode("div",pc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.authMethods,h=>(t.openBlock(),t.createElementBlock("div",{key:h.value,class:"auth-method"},[t.createVNode(c,{modelValue:h.prop,"onUpdate:modelValue":w=>h.prop=w,onChange:w=>i.handleUpdate(w,h.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(h.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(f,{modelValue:r.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=h=>r.sessionManagement=h),label:"Enable Session Management",onChange:i.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",gc,[t.createElementVNode("div",yc,[t.createVNode(l,{href:r.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)),i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:r.authFieldsSchema,onModelUpdated:o.onModelUpdated},{"autofill-provider":t.withCtx(h=>[t.renderSlot(e.$slots,"autofill-provider",t.normalizeProps(t.guardReactiveProps(h)),void 0,!0)]),_:3},8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),advanced:t.withCtx(()=>[t.createElementVNode("div",bc,[t.createElementVNode("div",_c,[t.createVNode(l,{href:r.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)),i.displayForm?(t.openBlock(),t.createBlock(s,{key:0,"enable-redis-partial":o.enableRedisPartial,"is-editing":o.isEditing,model:o.formModel,options:o.formOptions,schema:r.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 Cc=U(uc,[["render",kc],["__scopeId","data-v-741bf3cb"]]),wc=U(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 s;t.provide(Z,(s=t.useSlots())==null?void 0:s[be]);const{t:n,te:o}=ee.createI18n("en-us",te),a=e,r=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),i=t.computed(()=>{const l=a.formSchema;return l.fields.map(d=>{const c=`post-function.${d.model}`;return d.hint=o(`${c}.hint`)&&n(`${c}.hint`)||d.hint,d.help=o(`${c}.help`)&&n(`${c}.help`)||d.help,d.newElementButtonLabel=o(`${c}.newElementButtonLabel`)&&n(`${c}.newElementButtonLabel`)||d.newElementButtonLabel,d.model!=="tags"&&(d.valueType==="array"||d.type==="array")&&(d.type="array",d.valueArrayType="array",d.itemContainerComponent="FieldArrayItem",d.fieldClasses="post-function-array-item-container",d.fieldItemsClasses="post-function-array-item",d.inputAttributes={...d.inputAttributes,type:"textarea"}),d}),l});return(l,d)=>r.value?(t.openBlock(),t.createBlock(L,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-f54f37ae"]]),Ec=U(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 s;t.provide(Z,(s=t.useSlots())==null?void 0:s[be]);const{t:n,te:o}=ee.createI18n("en-us",te),a=e,r=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),i=t.computed(()=>{const l=a.formSchema;return l.fields.map(d=>{const c=`exit-transformer.${d.model}`;return d.hint=o(`${c}.hint`)&&n(`${c}.hint`)||d.hint,d.help=o(`${c}.help`)&&n(`${c}.help`)||d.help,d.newElementButtonLabel=o(`${c}.newElementButtonLabel`)&&n(`${c}.newElementButtonLabel`)||d.newElementButtonLabel,d.model!=="tags"&&(d.valueType==="array"||d.type==="array")&&(d.type="array",d.valueArrayType="array",d.itemContainerComponent="FieldArrayItem",d.fieldClasses="exit-transformer-array-item-container",d.fieldItemsClasses="exit-transformer-array-item",d.inputAttributes={...d.inputAttributes,type:"textarea"}),d}),l});return(l,d)=>r.value?(t.openBlock(),t.createBlock(L,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0d5c541f"]]),Sc={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}]},Mc={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}]},Vc={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}]},Tc={class:"general-settings"},Nc={class:"sub-form"},Bc={class:"general-settings"},Ic={class:"sub-form"},Ac={class:"general-settings"},Oc=U(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 E;t.provide(Z,(E=t.useSlots())==null?void 0:E[be]);const n=e,o=t.ref("zeroSsl"),a=t.ref("shm"),r=t.computed(()=>{var p;const b={};if((p=n.formSchema)!=null&&p.fields)for(const T of n.formSchema.fields)b[T.model]=T;return b}),i=t.computed(()=>{var p;const b=le(Sc);for(const T of b.fields){const P=(p=r.value[T.model])==null?void 0:p.help;T.help===void 0&&typeof P=="string"&&(T.help=P)}return b}),s=t.computed(()=>{var p;const b=le(Mc);for(const T of b.fields){const P=(p=r.value[T.model])==null?void 0:p.help;T.help===void 0&&typeof P=="string"&&(T.help=P)}return b}),l=t.computed(()=>{var p;const b=le(Vc);for(const T of b.fields){const P=(p=r.value[T.model])==null?void 0:p.help;T.help===void 0&&typeof P=="string"&&(T.help=P)}return b}),d=t.computed(()=>({fields:n.formSchema.fields.filter(b=>!b.model.startsWith("config")&&b.model!=="tags")})),c=t.computed(()=>({fields:i.value.fields.filter(p=>!s.value.fields.some(T=>T.model===p.model)&&!l.value.fields.some(T=>T.model===p.model))})),f=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage")&&!p.model.startsWith("config-storage_config-consul")&&!p.model.startsWith("config-storage_config-redis")&&!p.model.startsWith("config-storage_config-shm")&&!p.model.startsWith("config-storage_config-vault"))})),u=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-consul"))})),h=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-redis"))})),w=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-shm"))})),B=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-vault"))})),m=t.computed(()=>({fields:n.formSchema.fields.filter(b=>b.model.startsWith("config")&&!c.value.fields.filter(p=>p.model===b.model).length&&!f.value.fields.filter(p=>p.model===b.model).length||b.model==="tags")})),_=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),C=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],S=[{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 g=b=>{o.value=b.value,(b.value==="zeroSsl"||b.value==="other")&&(b.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),b.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()},M=(b,p)=>{p==="config-storage"&&(a.value=b),n.onModelUpdated()};return(b,p)=>{const T=t.resolveComponent("KSelect"),P=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[e.formModel.id&&e.isEditing||!e.isEditing?(t.openBlock(),t.createBlock(L,{key:0,class:"global-fields",model:e.formModel,options:e.formOptions,schema:d.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(P,{tabs:C},{general:t.withCtx(()=>[t.createElementVNode("div",Tc,[p[0]||(p[0]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),p[1]||(p[1]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),_.value?(t.openBlock(),t.createBlock(L,{key:0,model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),p[2]||(p[2]=t.createElementVNode("hr",null,null,-1)),t.createVNode(T,{class:"issuer-select",items:S,label:"Issuer",onChange:g}),t.createElementVNode("div",Nc,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(L,{key:0,model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),o.value==="zeroSsl"||o.value==="other"?(t.openBlock(),t.createBlock(L,{key:1,model:e.formModel,options:e.formOptions,schema:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),storage:t.withCtx(()=>[t.createElementVNode("div",Bc,[p[3]||(p[3]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),p[4]||(p[4]=t.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),_.value?(t.openBlock(),t.createBlock(L,{key:0,model:e.formModel,options:e.formOptions,schema:f.value,onModelUpdated:M},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",Ic,[a.value==="consul"?(t.openBlock(),t.createBlock(L,{key:0,model:e.formModel,options:e.formOptions,schema:u.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="redis"?(t.openBlock(),t.createBlock(L,{key:1,model:e.formModel,options:e.formOptions,schema:h.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="shm"?(t.openBlock(),t.createBlock(L,{key:2,model:e.formModel,options:e.formOptions,schema:w.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="vault"?(t.openBlock(),t.createBlock(L,{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",Ac,[p[5]||(p[5]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),p[6]||(p[6]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),_.value?(t.openBlock(),t.createBlock(L,{key:0,model:e.formModel,options:e.formOptions,schema:m.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-07cecf5b"]]),Fc={class:"rla-form-basic-fields"},$c={class:"rla-form-request-limits-subtitle"},Uc={class:"rla-form-request-limits-content"},Rc={class:"rla-form-window-type"},Dc=["innerHTML"],Pc={class:"rla-form-window-type-radios"},jc={class:"rla-form-request-limits-items"},Lc={class:"rla-form-request-limits-row"},qc=["id"],vc={class:"rla-form-request-limits-actions"},Kc={key:0,class:"rla-form-request-limits-examples"},zc={class:"rla-form-request-limits-examples-badges"},xc=["innerHTML"],Hc={id:"rla-form-error-legend",class:"rla-form-error-inputs"},Yc=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:Oc,ExitTransformer:Ec,OIDCForm:Cc,PostFunction:wc,RLAForm:U(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 P;t.provide(Z,(P=t.useSlots())==null?void 0:P[be]);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.
|
|
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,be,Ce,St){"use strict";function Vn(e,n){for(var o=-1,r=e==null?0:e.length;++o<r&&n(e[o],o,e)!==!1;);return e}function Gr(e){return function(n,o,r){for(var a=-1,i=Object(n),d=r(n),l=d.length;l--;){var m=d[++a];if(o(i[m],m,i)===!1)break}return n}}var Wr=Gr();function Zr(e,n){for(var o=-1,r=Array(e);++o<e;)r[o]=n(o);return r}var Bn=typeof global=="object"&&global&&global.Object===Object&&global,Xr=typeof self=="object"&&self&&self.Object===Object&&self,ue=Bn||Xr||Function("return this")(),Fe=ue.Symbol,Fn=Object.prototype,Jr=Fn.hasOwnProperty,Qr=Fn.toString,it=Fe?Fe.toStringTag:void 0;function ea(e){var n=Jr.call(e,it),o=e[it];try{e[it]=void 0;var r=!0}catch{}var a=Qr.call(e);return r&&(n?e[it]=o:delete e[it]),a}var ta=Object.prototype,na=ta.toString;function oa(e){return na.call(e)}var ra="[object Null]",aa="[object Undefined]",Rn=Fe?Fe.toStringTag:void 0;function Re(e){return e==null?e===void 0?aa:ra:Rn&&Rn in Object(e)?ea(e):oa(e)}function De(e){return e!=null&&typeof e=="object"}var ia="[object Arguments]";function Dn(e){return De(e)&&Re(e)==ia}var Ln=Object.prototype,la=Ln.hasOwnProperty,sa=Ln.propertyIsEnumerable,da=Dn(function(){return arguments}())?Dn:function(e){return De(e)&&la.call(e,"callee")&&!sa.call(e,"callee")},Le=Array.isArray;function ca(){return!1}var Un=typeof L=="object"&&L&&!L.nodeType&&L,Pn=Un&&typeof module=="object"&&module&&!module.nodeType&&module,ma=Pn&&Pn.exports===Un,$n=ma?ue.Buffer:void 0,fa=$n?$n.isBuffer:void 0,vn=fa||ca,ua=9007199254740991,pa=/^(?:0|[1-9]\d*)$/;function xn(e,n){var o=typeof e;return n=n??ua,!!n&&(o=="number"||o!="symbol"&&pa.test(e))&&e>-1&&e%1==0&&e<n}var ha=9007199254740991;function jn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ha}var ga="[object Arguments]",ya="[object Array]",ba="[object Boolean]",_a="[object Date]",Ea="[object Error]",Ta="[object Function]",Ca="[object Map]",wa="[object Number]",Sa="[object Object]",ka="[object RegExp]",Ma="[object Set]",Aa="[object String]",Na="[object WeakMap]",Ia="[object ArrayBuffer]",Oa="[object DataView]",Va="[object Float32Array]",Ba="[object Float64Array]",Fa="[object Int8Array]",Ra="[object Int16Array]",Da="[object Int32Array]",La="[object Uint8Array]",Ua="[object Uint8ClampedArray]",Pa="[object Uint16Array]",$a="[object Uint32Array]",z={};z[Va]=z[Ba]=z[Fa]=z[Ra]=z[Da]=z[La]=z[Ua]=z[Pa]=z[$a]=!0,z[ga]=z[ya]=z[Ia]=z[ba]=z[Oa]=z[_a]=z[Ea]=z[Ta]=z[Ca]=z[wa]=z[Sa]=z[ka]=z[Ma]=z[Aa]=z[Na]=!1;function va(e){return De(e)&&jn(e.length)&&!!z[Re(e)]}function Wt(e){return function(n){return e(n)}}var zn=typeof L=="object"&&L&&!L.nodeType&&L,lt=zn&&typeof module=="object"&&module&&!module.nodeType&&module,xa=lt&<.exports===zn,Zt=xa&&Bn.process,We=function(){try{var e=lt&<.require&<.require("util").types;return e||Zt&&Zt.binding&&Zt.binding("util")}catch{}}(),qn=We&&We.isTypedArray,ja=qn?Wt(qn):va,za=Object.prototype,qa=za.hasOwnProperty;function Kn(e,n){var o=Le(e),r=!o&&da(e),a=!o&&!r&&vn(e),i=!o&&!r&&!a&&ja(e),d=o||r||a||i,l=d?Zr(e.length,String):[],m=l.length;for(var c in e)(n||qa.call(e,c))&&!(d&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||xn(c,m)))&&l.push(c);return l}var Ka=Object.prototype;function Xt(e){var n=e&&e.constructor,o=typeof n=="function"&&n.prototype||Ka;return e===o}function Hn(e,n){return function(o){return e(n(o))}}var Ha=Hn(Object.keys,Object),Ya=Object.prototype,Ga=Ya.hasOwnProperty;function Wa(e){if(!Xt(e))return Ha(e);var n=[];for(var o in Object(e))Ga.call(e,o)&&o!="constructor"&&n.push(o);return n}function me(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Za="[object AsyncFunction]",Xa="[object Function]",Ja="[object GeneratorFunction]",Qa="[object Proxy]";function $(e){if(!me(e))return!1;var n=Re(e);return n==Xa||n==Ja||n==Za||n==Qa}function kt(e){return e!=null&&jn(e.length)&&!$(e)}function Mt(e){return kt(e)?Kn(e):Wa(e)}function ei(e,n){return e&&Wr(e,n,Mt)}function ti(e,n){return function(o,r){if(o==null)return o;if(!kt(o))return e(o,r);for(var a=o.length,i=-1,d=Object(o);++i<a&&r(d[i],i,d)!==!1;);return o}}var ni=ti(ei);function Jt(e){return e}function oi(e){return typeof e=="function"?e:Jt}function ae(e,n){var o=Le(e)?Vn:ni;return o(e,oi(n))}var ri="[object Symbol]";function At(e){return typeof e=="symbol"||De(e)&&Re(e)==ri}var ai=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ii=/^\w*$/;function li(e,n){if(Le(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||At(e)?!0:ii.test(e)||!ai.test(e)||n!=null&&e in Object(n)}var Qt=ue["__core-js_shared__"],Yn=function(){var e=/[^.]+$/.exec(Qt&&Qt.keys&&Qt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function si(e){return!!Yn&&Yn in e}var di=Function.prototype,ci=di.toString;function ve(e){if(e!=null){try{return ci.call(e)}catch{}try{return e+""}catch{}}return""}var mi=/[\\^$.*+?()[\]{}|]/g,fi=/^\[object .+?Constructor\]$/,ui=Function.prototype,pi=Object.prototype,hi=ui.toString,gi=pi.hasOwnProperty,yi=RegExp("^"+hi.call(gi).replace(mi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function bi(e){if(!me(e)||si(e))return!1;var n=$(e)?yi:fi;return n.test(ve(e))}function _i(e,n){return e==null?void 0:e[n]}function xe(e,n){var o=_i(e,n);return bi(o)?o:void 0}var st=xe(Object,"create");function Ei(){this.__data__=st?st(null):{},this.size=0}function Ti(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Ci="__lodash_hash_undefined__",wi=Object.prototype,Si=wi.hasOwnProperty;function ki(e){var n=this.__data__;if(st){var o=n[e];return o===Ci?void 0:o}return Si.call(n,e)?n[e]:void 0}var Mi=Object.prototype,Ai=Mi.hasOwnProperty;function Ni(e){var n=this.__data__;return st?n[e]!==void 0:Ai.call(n,e)}var Ii="__lodash_hash_undefined__";function Oi(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=st&&n===void 0?Ii:n,this}function je(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}je.prototype.clear=Ei,je.prototype.delete=Ti,je.prototype.get=ki,je.prototype.has=Ni,je.prototype.set=Oi;function Vi(){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 Bi=Array.prototype,Fi=Bi.splice;function Ri(e){var n=this.__data__,o=It(n,e);if(o<0)return!1;var r=n.length-1;return o==r?n.pop():Fi.call(n,o,1),--this.size,!0}function Di(e){var n=this.__data__,o=It(n,e);return o<0?void 0:n[o][1]}function Li(e){return It(this.__data__,e)>-1}function Ui(e,n){var o=this.__data__,r=It(o,e);return r<0?(++this.size,o.push([e,n])):o[r][1]=n,this}function we(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}we.prototype.clear=Vi,we.prototype.delete=Ri,we.prototype.get=Di,we.prototype.has=Li,we.prototype.set=Ui;var dt=xe(ue,"Map");function Pi(){this.size=0,this.__data__={hash:new je,map:new(dt||we),string:new je}}function $i(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 $i(n)?o[typeof n=="string"?"string":"hash"]:o.map}function vi(e){var n=Ot(this,e).delete(e);return this.size-=n?1:0,n}function xi(e){return Ot(this,e).get(e)}function ji(e){return Ot(this,e).has(e)}function zi(e,n){var o=Ot(this,e),r=o.size;return o.set(e,n),this.size+=o.size==r?0:1,this}function Se(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var r=e[n];this.set(r[0],r[1])}}Se.prototype.clear=Pi,Se.prototype.delete=vi,Se.prototype.get=xi,Se.prototype.has=ji,Se.prototype.set=zi;var qi="Expected a function";function en(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(qi);var o=function(){var r=arguments,a=n?n.apply(this,r):r[0],i=o.cache;if(i.has(a))return i.get(a);var d=e.apply(this,r);return o.cache=i.set(a,d)||i,d};return o.cache=new(en.Cache||Se),o}en.Cache=Se;var Ki=500;function Hi(e){var n=en(e,function(r){return o.size===Ki&&o.clear(),r}),o=n.cache;return n}var Yi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gi=/\\(\\)?/g,Wi=Hi(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(Yi,function(o,r,a,i){n.push(a?i.replace(Gi,"$1"):r||o)}),n});function Zi(e,n){for(var o=-1,r=e==null?0:e.length,a=Array(r);++o<r;)a[o]=n(e[o],o,e);return a}var Gn=Fe?Fe.prototype:void 0,Wn=Gn?Gn.toString:void 0;function Zn(e){if(typeof e=="string")return e;if(Le(e))return Zi(e,Zn)+"";if(At(e))return Wn?Wn.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Xn(e){return e==null?"":Zn(e)}function Xi(e,n){return Le(e)?e:li(e,n)?[e]:Wi(Xn(e))}function Ji(e){if(typeof e=="string"||At(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Qi(e,n){n=Xi(n,e);for(var o=0,r=n.length;e!=null&&o<r;)e=e[Ji(n[o++])];return o&&o==r?e:void 0}function P(e,n,o){var r=e==null?void 0:Qi(e,n);return r===void 0?o:r}function G(e){return e==null}const Ue="kong-ui-forms-api",Jn="kong-ui-forms-config",Qn="redis-partial-list-fetcher-key",el="redis-partial-info",ze="autofill",fe="autofillSlot";/*! @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:eo,setPrototypeOf:to,isFrozen:tl,getPrototypeOf:nl,getOwnPropertyDescriptor:ol}=Object;let{freeze:ie,seal:pe,create:no}=Object,{apply:tn,construct:nn}=typeof Reflect<"u"&&Reflect;ie||(ie=function(n){return n}),pe||(pe=function(n){return n}),tn||(tn=function(n,o,r){return n.apply(o,r)}),nn||(nn=function(n,o){return new n(...o)});const Vt=se(Array.prototype.forEach),rl=se(Array.prototype.lastIndexOf),oo=se(Array.prototype.pop),ct=se(Array.prototype.push),al=se(Array.prototype.splice),Bt=se(String.prototype.toLowerCase),on=se(String.prototype.toString),ro=se(String.prototype.match),mt=se(String.prototype.replace),il=se(String.prototype.indexOf),ll=se(String.prototype.trim),ge=se(Object.prototype.hasOwnProperty),le=se(RegExp.prototype.test),ft=sl(TypeError);function se(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var o=arguments.length,r=new Array(o>1?o-1:0),a=1;a<o;a++)r[a-1]=arguments[a];return tn(e,n,r)}}function sl(e){return function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return nn(e,o)}}function D(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bt;to&&to(e,null);let r=n.length;for(;r--;){let a=n[r];if(typeof a=="string"){const i=o(a);i!==a&&(tl(n)||(n[r]=i),a=i)}e[a]=!0}return e}function dl(e){for(let n=0;n<e.length;n++)ge(e,n)||(e[n]=null);return e}function ke(e){const n=no(null);for(const[o,r]of eo(e))ge(e,o)&&(Array.isArray(r)?n[o]=dl(r):r&&typeof r=="object"&&r.constructor===Object?n[o]=ke(r):n[o]=r);return n}function ut(e,n){for(;e!==null;){const r=ol(e,n);if(r){if(r.get)return se(r.get);if(typeof r.value=="function")return se(r.value)}e=nl(e)}function o(){return null}return o}const ao=ie(["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"]),rn=ie(["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"]),an=ie(["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"]),cl=ie(["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=ie(["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"]),ml=ie(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),io=ie(["#text"]),lo=ie(["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=ie(["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"]),so=ie(["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=ie(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fl=pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ul=pe(/<%[\w\W]*|[\w\W]*%>/gm),pl=pe(/\$\{[\w\W]*/gm),hl=pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),gl=pe(/^aria-[\-\w]+$/),co=pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yl=pe(/^(?:\w+script|data):/i),bl=pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mo=pe(/^html$/i),_l=pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var fo=Object.freeze({__proto__:null,ARIA_ATTR:gl,ATTR_WHITESPACE:bl,CUSTOM_ELEMENT:_l,DATA_ATTR:hl,DOCTYPE_NAME:mo,ERB_EXPR:ul,IS_ALLOWED_URI:co,IS_SCRIPT_OR_DATA:yl,MUSTACHE_EXPR:fl,TMPLIT_EXPR:pl});const pt={element:1,text:3,progressingInstruction:7,comment:8,document:9},El=function(){return typeof window>"u"?null:window},Tl=function(n,o){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let r=null;const a="data-tt-policy-suffix";o&&o.hasAttribute(a)&&(r=o.getAttribute(a));const i="dompurify"+(r?"#"+r:"");try{return n.createPolicy(i,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},uo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function po(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:El();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 r=o,a=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:d,Node:l,Element:m,NodeFilter:c,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:M}=e,R=m.prototype,f=ut(R,"cloneNode"),C=ut(R,"remove"),w=ut(R,"nextSibling"),O=ut(R,"childNodes"),g=ut(R,"parentNode");if(typeof d=="function"){const N=o.createElement("template");N.content&&N.content.ownerDocument&&(o=N.content.ownerDocument)}let S,A="";const{implementation:T,createNodeIterator:y,createDocumentFragment:B,getElementsByTagName:x}=o,{importNode:E}=r;let _=uo();n.isSupported=typeof eo=="function"&&typeof g=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:V,ERB_EXPR:F,TMPLIT_EXPR:U,DATA_ATTR:ee,ARIA_ATTR:Ne,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:Ie,CUSTOM_ELEMENT:_n}=fo;let{IS_ALLOWED_URI:xt}=fo,I=null;const H=D({},[...ao,...rn,...an,...ln,...io]);let Z=null;const Mr=D({},[...lo,...sn,...so,...Ft]);let X=Object.seal(no(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,En=null,Ar=!0,Tn=!0,Nr=!1,Ir=!0,Qe=!1,jt=!0,Ge=!1,Cn=!1,wn=!1,et=!1,zt=!1,qt=!1,Or=!0,Vr=!1;const pu="user-content-";let Sn=!0,Tt=!1,tt={},nt=null;const Br=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 Fr=null;const Rr=D({},["audio","video","img","source","image","track"]);let kn=null;const Dr=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",Oe="http://www.w3.org/1999/xhtml";let ot=Oe,Mn=!1,An=null;const hu=D({},[Kt,Ht,Oe],on);let Yt=D({},["mi","mo","mn","ms","mtext"]),Gt=D({},["annotation-xml"]);const gu=D({},["title","style","font","a","script"]);let Ct=null;const yu=["application/xhtml+xml","text/html"],bu="text/html";let te=null,rt=null;const _u=o.createElement("form"),Lr=function(s){return s instanceof RegExp||s instanceof Function},Nn=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rt&&rt===s)){if((!s||typeof s!="object")&&(s={}),s=ke(s),Ct=yu.indexOf(s.PARSER_MEDIA_TYPE)===-1?bu:s.PARSER_MEDIA_TYPE,te=Ct==="application/xhtml+xml"?on:Bt,I=ge(s,"ALLOWED_TAGS")?D({},s.ALLOWED_TAGS,te):H,Z=ge(s,"ALLOWED_ATTR")?D({},s.ALLOWED_ATTR,te):Mr,An=ge(s,"ALLOWED_NAMESPACES")?D({},s.ALLOWED_NAMESPACES,on):hu,kn=ge(s,"ADD_URI_SAFE_ATTR")?D(ke(Dr),s.ADD_URI_SAFE_ATTR,te):Dr,Fr=ge(s,"ADD_DATA_URI_TAGS")?D(ke(Rr),s.ADD_DATA_URI_TAGS,te):Rr,nt=ge(s,"FORBID_CONTENTS")?D({},s.FORBID_CONTENTS,te):Br,Et=ge(s,"FORBID_TAGS")?D({},s.FORBID_TAGS,te):ke({}),En=ge(s,"FORBID_ATTR")?D({},s.FORBID_ATTR,te):ke({}),tt=ge(s,"USE_PROFILES")?s.USE_PROFILES:!1,Ar=s.ALLOW_ARIA_ATTR!==!1,Tn=s.ALLOW_DATA_ATTR!==!1,Nr=s.ALLOW_UNKNOWN_PROTOCOLS||!1,Ir=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Qe=s.SAFE_FOR_TEMPLATES||!1,jt=s.SAFE_FOR_XML!==!1,Ge=s.WHOLE_DOCUMENT||!1,et=s.RETURN_DOM||!1,zt=s.RETURN_DOM_FRAGMENT||!1,qt=s.RETURN_TRUSTED_TYPE||!1,wn=s.FORCE_BODY||!1,Or=s.SANITIZE_DOM!==!1,Vr=s.SANITIZE_NAMED_PROPS||!1,Sn=s.KEEP_CONTENT!==!1,Tt=s.IN_PLACE||!1,xt=s.ALLOWED_URI_REGEXP||co,ot=s.NAMESPACE||Oe,Yt=s.MATHML_TEXT_INTEGRATION_POINTS||Yt,Gt=s.HTML_INTEGRATION_POINTS||Gt,X=s.CUSTOM_ELEMENT_HANDLING||{},s.CUSTOM_ELEMENT_HANDLING&&Lr(s.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=s.CUSTOM_ELEMENT_HANDLING.tagNameCheck),s.CUSTOM_ELEMENT_HANDLING&&Lr(s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Qe&&(Tn=!1),zt&&(et=!0),tt&&(I=D({},io),Z=[],tt.html===!0&&(D(I,ao),D(Z,lo)),tt.svg===!0&&(D(I,rn),D(Z,sn),D(Z,Ft)),tt.svgFilters===!0&&(D(I,an),D(Z,sn),D(Z,Ft)),tt.mathMl===!0&&(D(I,ln),D(Z,so),D(Z,Ft))),s.ADD_TAGS&&(I===H&&(I=ke(I)),D(I,s.ADD_TAGS,te)),s.ADD_ATTR&&(Z===Mr&&(Z=ke(Z)),D(Z,s.ADD_ATTR,te)),s.ADD_URI_SAFE_ATTR&&D(kn,s.ADD_URI_SAFE_ATTR,te),s.FORBID_CONTENTS&&(nt===Br&&(nt=ke(nt)),D(nt,s.FORBID_CONTENTS,te)),Sn&&(I["#text"]=!0),Ge&&D(I,["html","head","body"]),I.table&&(D(I,["tbody"]),delete Et.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw ft('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ft('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=s.TRUSTED_TYPES_POLICY,A=S.createHTML("")}else S===void 0&&(S=Tl(M,a)),S!==null&&typeof A=="string"&&(A=S.createHTML(""));ie&&ie(s),rt=s}},Ur=D({},[...rn,...an,...cl]),Pr=D({},[...ln,...ml]),Eu=function(s){let b=g(s);(!b||!b.tagName)&&(b={namespaceURI:ot,tagName:"template"});const k=Bt(s.tagName),q=Bt(b.tagName);return An[s.namespaceURI]?s.namespaceURI===Ht?b.namespaceURI===Oe?k==="svg":b.namespaceURI===Kt?k==="svg"&&(q==="annotation-xml"||Yt[q]):!!Ur[k]:s.namespaceURI===Kt?b.namespaceURI===Oe?k==="math":b.namespaceURI===Ht?k==="math"&&Gt[q]:!!Pr[k]:s.namespaceURI===Oe?b.namespaceURI===Ht&&!Gt[q]||b.namespaceURI===Kt&&!Yt[q]?!1:!Pr[k]&&(gu[k]||!Ur[k]):!!(Ct==="application/xhtml+xml"&&An[s.namespaceURI]):!1},Te=function(s){ct(n.removed,{element:s});try{g(s).removeChild(s)}catch{C(s)}},at=function(s,b){try{ct(n.removed,{attribute:b.getAttributeNode(s),from:b})}catch{ct(n.removed,{attribute:null,from:b})}if(b.removeAttribute(s),s==="is")if(et||zt)try{Te(b)}catch{}else try{b.setAttribute(s,"")}catch{}},$r=function(s){let b=null,k=null;if(wn)s="<remove></remove>"+s;else{const Q=ro(s,/^[\r\n\t ]+/);k=Q&&Q[0]}Ct==="application/xhtml+xml"&&ot===Oe&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");const q=S?S.createHTML(s):s;if(ot===Oe)try{b=new h().parseFromString(q,Ct)}catch{}if(!b||!b.documentElement){b=T.createDocument(ot,"template",null);try{b.documentElement.innerHTML=Mn?A:q}catch{}}const oe=b.body||b.documentElement;return s&&k&&oe.insertBefore(o.createTextNode(k),oe.childNodes[0]||null),ot===Oe?x.call(b,Ge?"html":"body")[0]:Ge?b.documentElement:oe},vr=function(s){return y.call(s.ownerDocument||s,s,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},In=function(s){return s instanceof u&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof p)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},xr=function(s){return typeof l=="function"&&s instanceof l};function Ve(N,s,b){Vt(N,k=>{k.call(n,s,b,rt)})}const jr=function(s){let b=null;if(Ve(_.beforeSanitizeElements,s,null),In(s))return Te(s),!0;const k=te(s.nodeName);if(Ve(_.uponSanitizeElement,s,{tagName:k,allowedTags:I}),jt&&s.hasChildNodes()&&!xr(s.firstElementChild)&&le(/<[/\w!]/g,s.innerHTML)&&le(/<[/\w!]/g,s.textContent)||s.nodeType===pt.progressingInstruction||jt&&s.nodeType===pt.comment&&le(/<[/\w]/g,s.data))return Te(s),!0;if(!I[k]||Et[k]){if(!Et[k]&&qr(k)&&(X.tagNameCheck instanceof RegExp&&le(X.tagNameCheck,k)||X.tagNameCheck instanceof Function&&X.tagNameCheck(k)))return!1;if(Sn&&!nt[k]){const q=g(s)||s.parentNode,oe=O(s)||s.childNodes;if(oe&&q){const Q=oe.length;for(let ce=Q-1;ce>=0;--ce){const Be=f(oe[ce],!0);Be.__removalCount=(s.__removalCount||0)+1,q.insertBefore(Be,w(s))}}}return Te(s),!0}return s instanceof m&&!Eu(s)||(k==="noscript"||k==="noembed"||k==="noframes")&&le(/<\/no(script|embed|frames)/i,s.innerHTML)?(Te(s),!0):(Qe&&s.nodeType===pt.text&&(b=s.textContent,Vt([V,F,U],q=>{b=mt(b,q," ")}),s.textContent!==b&&(ct(n.removed,{element:s.cloneNode()}),s.textContent=b)),Ve(_.afterSanitizeElements,s,null),!1)},zr=function(s,b,k){if(Or&&(b==="id"||b==="name")&&(k in o||k in _u))return!1;if(!(Tn&&!En[b]&&le(ee,b))){if(!(Ar&&le(Ne,b))){if(!Z[b]||En[b]){if(!(qr(s)&&(X.tagNameCheck instanceof RegExp&&le(X.tagNameCheck,s)||X.tagNameCheck instanceof Function&&X.tagNameCheck(s))&&(X.attributeNameCheck instanceof RegExp&&le(X.attributeNameCheck,b)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(b))||b==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&le(X.tagNameCheck,k)||X.tagNameCheck instanceof Function&&X.tagNameCheck(k))))return!1}else if(!kn[b]){if(!le(xt,mt(k,Ie,""))){if(!((b==="src"||b==="xlink:href"||b==="href")&&s!=="script"&&il(k,"data:")===0&&Fr[s])){if(!(Nr&&!le(J,mt(k,Ie,"")))){if(k)return!1}}}}}}return!0},qr=function(s){return s!=="annotation-xml"&&ro(s,_n)},Kr=function(s){Ve(_.beforeSanitizeAttributes,s,null);const{attributes:b}=s;if(!b||In(s))return;const k={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let q=b.length;for(;q--;){const oe=b[q],{name:Q,namespaceURI:ce,value:Be}=oe,wt=te(Q),On=Be;let re=Q==="value"?On:ll(On);if(k.attrName=wt,k.attrValue=re,k.keepAttr=!0,k.forceKeepAttr=void 0,Ve(_.uponSanitizeAttribute,s,k),re=k.attrValue,Vr&&(wt==="id"||wt==="name")&&(at(Q,s),re=pu+re),jt&&le(/((--!?|])>)|<\/(style|title)/i,re)){at(Q,s);continue}if(k.forceKeepAttr)continue;if(!k.keepAttr){at(Q,s);continue}if(!Ir&&le(/\/>/i,re)){at(Q,s);continue}Qe&&Vt([V,F,U],Yr=>{re=mt(re,Yr," ")});const Hr=te(s.nodeName);if(!zr(Hr,wt,re)){at(Q,s);continue}if(S&&typeof M=="object"&&typeof M.getAttributeType=="function"&&!ce)switch(M.getAttributeType(Hr,wt)){case"TrustedHTML":{re=S.createHTML(re);break}case"TrustedScriptURL":{re=S.createScriptURL(re);break}}if(re!==On)try{ce?s.setAttributeNS(ce,Q,re):s.setAttribute(Q,re),In(s)?Te(s):oo(n.removed)}catch{at(Q,s)}}Ve(_.afterSanitizeAttributes,s,null)},Tu=function N(s){let b=null;const k=vr(s);for(Ve(_.beforeSanitizeShadowDOM,s,null);b=k.nextNode();)Ve(_.uponSanitizeShadowNode,b,null),jr(b),Kr(b),b.content instanceof i&&N(b.content);Ve(_.afterSanitizeShadowDOM,s,null)};return n.sanitize=function(N){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=null,k=null,q=null,oe=null;if(Mn=!N,Mn&&(N="<!-->"),typeof N!="string"&&!xr(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||Nn(s),n.removed=[],typeof N=="string"&&(Tt=!1),Tt){if(N.nodeName){const Be=te(N.nodeName);if(!I[Be]||Et[Be])throw ft("root node is forbidden and cannot be sanitized in-place")}}else if(N instanceof l)b=$r("<!---->"),k=b.ownerDocument.importNode(N,!0),k.nodeType===pt.element&&k.nodeName==="BODY"||k.nodeName==="HTML"?b=k:b.appendChild(k);else{if(!et&&!Qe&&!Ge&&N.indexOf("<")===-1)return S&&qt?S.createHTML(N):N;if(b=$r(N),!b)return et?null:qt?A:""}b&&wn&&Te(b.firstChild);const Q=vr(Tt?N:b);for(;q=Q.nextNode();)jr(q),Kr(q),q.content instanceof i&&Tu(q.content);if(Tt)return N;if(et){if(zt)for(oe=B.call(b.ownerDocument);b.firstChild;)oe.appendChild(b.firstChild);else oe=b;return(Z.shadowroot||Z.shadowrootmode)&&(oe=E.call(r,oe,!0)),oe}let ce=Ge?b.outerHTML:b.innerHTML;return Ge&&I["!doctype"]&&b.ownerDocument&&b.ownerDocument.doctype&&b.ownerDocument.doctype.name&&le(mo,b.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+b.ownerDocument.doctype.name+`>
|
|
2
|
+
`+ce),Qe&&Vt([V,F,U],Be=>{ce=mt(ce,Be," ")}),S&&qt?S.createHTML(ce):ce},n.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Nn(N),Cn=!0},n.clearConfig=function(){rt=null,Cn=!1},n.isValidAttribute=function(N,s,b){rt||Nn({});const k=te(N),q=te(s);return zr(k,q,b)},n.addHook=function(N,s){typeof s=="function"&&ct(_[N],s)},n.removeHook=function(N,s){if(s!==void 0){const b=rl(_[N],s);return b===-1?void 0:al(_[N],b,1)[0]}return oo(_[N])},n.removeHooks=function(N){_[N]=[]},n.removeAllHooks=function(){_=uo()},n}var Cl=po();function wl(){this.__data__=new we,this.size=0}function Sl(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function kl(e){return this.__data__.get(e)}function Ml(e){return this.__data__.has(e)}var Al=200;function Nl(e,n){var o=this.__data__;if(o instanceof we){var r=o.__data__;if(!dt||r.length<Al-1)return r.push([e,n]),this.size=++o.size,this;o=this.__data__=new Se(r)}return o.set(e,n),this.size=o.size,this}function Ze(e){var n=this.__data__=new we(e);this.size=n.size}Ze.prototype.clear=wl,Ze.prototype.delete=Sl,Ze.prototype.get=kl,Ze.prototype.has=Ml,Ze.prototype.set=Nl;var Rt=function(){try{var e=xe(Object,"defineProperty");return e({},"",{}),e}catch{}}();function ho(e,n,o){n=="__proto__"&&Rt?Rt(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var Il=Object.prototype,Ol=Il.hasOwnProperty;function go(e,n,o){var r=e[n];(!(Ol.call(e,n)&&Nt(r,o))||o===void 0&&!(n in e))&&ho(e,n,o)}function Dt(e,n,o,r){var a=!o;o||(o={});for(var i=-1,d=n.length;++i<d;){var l=n[i],m=void 0;m===void 0&&(m=e[l]),a?ho(o,l,m):go(o,l,m)}return o}function Vl(e,n){return e&&Dt(n,Mt(n),e)}function Bl(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var Fl=Object.prototype,Rl=Fl.hasOwnProperty;function Dl(e){if(!me(e))return Bl(e);var n=Xt(e),o=[];for(var r in e)r=="constructor"&&(n||!Rl.call(e,r))||o.push(r);return o}function Lt(e){return kt(e)?Kn(e,!0):Dl(e)}function Ll(e,n){return e&&Dt(n,Lt(n),e)}var yo=typeof L=="object"&&L&&!L.nodeType&&L,bo=yo&&typeof module=="object"&&module&&!module.nodeType&&module,Ul=bo&&bo.exports===yo,_o=Ul?ue.Buffer:void 0,Eo=_o?_o.allocUnsafe:void 0;function Pl(e,n){if(n)return e.slice();var o=e.length,r=Eo?Eo(o):new e.constructor(o);return e.copy(r),r}function $l(e,n){var o=-1,r=e.length;for(n||(n=Array(r));++o<r;)n[o]=e[o];return n}function vl(e,n){for(var o=-1,r=e==null?0:e.length,a=0,i=[];++o<r;){var d=e[o];n(d,o,e)&&(i[a++]=d)}return i}function To(){return[]}var xl=Object.prototype,jl=xl.propertyIsEnumerable,Co=Object.getOwnPropertySymbols,dn=Co?function(e){return e==null?[]:(e=Object(e),vl(Co(e),function(n){return jl.call(e,n)}))}:To;function zl(e,n){return Dt(e,dn(e),n)}function wo(e,n){for(var o=-1,r=n.length,a=e.length;++o<r;)e[a+o]=n[o];return e}var So=Hn(Object.getPrototypeOf,Object),ql=Object.getOwnPropertySymbols,ko=ql?function(e){for(var n=[];e;)wo(n,dn(e)),e=So(e);return n}:To;function Kl(e,n){return Dt(e,ko(e),n)}function Mo(e,n,o){var r=n(e);return Le(e)?r:wo(r,o(e))}function Hl(e){return Mo(e,Mt,dn)}function Yl(e){return Mo(e,Lt,ko)}var cn=xe(ue,"DataView"),mn=xe(ue,"Promise"),Xe=xe(ue,"Set"),fn=xe(ue,"WeakMap"),Ao="[object Map]",Gl="[object Object]",No="[object Promise]",Io="[object Set]",Oo="[object WeakMap]",Vo="[object DataView]",Wl=ve(cn),Zl=ve(dt),Xl=ve(mn),Jl=ve(Xe),Ql=ve(fn),Me=Re;(cn&&Me(new cn(new ArrayBuffer(1)))!=Vo||dt&&Me(new dt)!=Ao||mn&&Me(mn.resolve())!=No||Xe&&Me(new Xe)!=Io||fn&&Me(new fn)!=Oo)&&(Me=function(e){var n=Re(e),o=n==Gl?e.constructor:void 0,r=o?ve(o):"";if(r)switch(r){case Wl:return Vo;case Zl:return Ao;case Xl:return No;case Jl:return Io;case Ql:return Oo}return n});var es=Object.prototype,ts=es.hasOwnProperty;function ns(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&ts.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var Bo=ue.Uint8Array;function un(e){var n=new e.constructor(e.byteLength);return new Bo(n).set(new Bo(e)),n}function os(e,n){var o=n?un(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var rs=/\w*$/;function as(e){var n=new e.constructor(e.source,rs.exec(e));return n.lastIndex=e.lastIndex,n}var Fo=Fe?Fe.prototype:void 0,Ro=Fo?Fo.valueOf:void 0;function is(e){return Ro?Object(Ro.call(e)):{}}function ls(e,n){var o=n?un(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var ss="[object Boolean]",ds="[object Date]",cs="[object Map]",ms="[object Number]",fs="[object RegExp]",us="[object Set]",ps="[object String]",hs="[object Symbol]",gs="[object ArrayBuffer]",ys="[object DataView]",bs="[object Float32Array]",_s="[object Float64Array]",Es="[object Int8Array]",Ts="[object Int16Array]",Cs="[object Int32Array]",ws="[object Uint8Array]",Ss="[object Uint8ClampedArray]",ks="[object Uint16Array]",Ms="[object Uint32Array]";function As(e,n,o){var r=e.constructor;switch(n){case gs:return un(e);case ss:case ds:return new r(+e);case ys:return os(e,o);case bs:case _s:case Es:case Ts:case Cs:case ws:case Ss:case ks:case Ms:return ls(e,o);case cs:return new r;case ms:case ps:return new r(e);case fs:return as(e);case us:return new r;case hs:return is(e)}}var Do=Object.create,Ns=function(){function e(){}return function(n){if(!me(n))return{};if(Do)return Do(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function Is(e){return typeof e.constructor=="function"&&!Xt(e)?Ns(So(e)):{}}var Os="[object Map]";function Vs(e){return De(e)&&Me(e)==Os}var Lo=We&&We.isMap,Bs=Lo?Wt(Lo):Vs,Fs="[object Set]";function Rs(e){return De(e)&&Me(e)==Fs}var Uo=We&&We.isSet,Ds=Uo?Wt(Uo):Rs,Ls=1,Us=2,Ps=4,Po="[object Arguments]",$s="[object Array]",vs="[object Boolean]",xs="[object Date]",js="[object Error]",$o="[object Function]",zs="[object GeneratorFunction]",qs="[object Map]",Ks="[object Number]",vo="[object Object]",Hs="[object RegExp]",Ys="[object Set]",Gs="[object String]",Ws="[object Symbol]",Zs="[object WeakMap]",Xs="[object ArrayBuffer]",Js="[object DataView]",Qs="[object Float32Array]",ed="[object Float64Array]",td="[object Int8Array]",nd="[object Int16Array]",od="[object Int32Array]",rd="[object Uint8Array]",ad="[object Uint8ClampedArray]",id="[object Uint16Array]",ld="[object Uint32Array]",j={};j[Po]=j[$s]=j[Xs]=j[Js]=j[vs]=j[xs]=j[Qs]=j[ed]=j[td]=j[nd]=j[od]=j[qs]=j[Ks]=j[vo]=j[Hs]=j[Ys]=j[Gs]=j[Ws]=j[rd]=j[ad]=j[id]=j[ld]=!0,j[js]=j[$o]=j[Zs]=!1;function ht(e,n,o,r,a,i){var d,l=n&Ls,m=n&Us,c=n&Ps;if(d!==void 0)return d;if(!me(e))return e;var p=Le(e);if(p){if(d=ns(e),!l)return $l(e,d)}else{var u=Me(e),h=u==$o||u==zs;if(vn(e))return Pl(e,l);if(u==vo||u==Po||h&&!a){if(d=m||h?{}:Is(e),!l)return m?Kl(e,Ll(d,e)):zl(e,Vl(d,e))}else{if(!j[u])return a?e:{};d=As(e,u,l)}}i||(i=new Ze);var M=i.get(e);if(M)return M;i.set(e,d),Ds(e)?e.forEach(function(C){d.add(ht(C,n,o,C,e,i))}):Bs(e)&&e.forEach(function(C,w){d.set(w,ht(C,n,o,w,e,i))});var R=c?m?Yl:Hl:m?Lt:Mt,f=p?void 0:R(e);return Vn(f||e,function(C,w){f&&(w=C,C=e[w]),go(d,w,ht(C,n,o,w,e,i))}),d}var sd=1,dd=4;function Ae(e){return ht(e,sd|dd)}const pn=(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,""),xo=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var cd="[object String]";function qe(e){return typeof e=="string"||!Le(e)&&De(e)&&Re(e)==cd}const jo={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)?ae(e.styleClasses,r=>o[r]=!0):qe(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 $(e.disabled)?e.disabled.call(this,this.model,e,this):G(e.disabled)?!1:e.disabled},fieldReadonly(e){return $(e.readonly)?e.readonly.call(this,this.model,e,this):G(e.readonly)?!1:e.readonly},fieldFeatured(e){return $(e.featured)?e.featured.call(this,this.model,e,this):G(e.featured)?!1:e.featured},fieldRequired(e){return $(e.required)?e.required.call(this,this.model,e,this):G(e.required)?!1:e.required}}};var hn=function(){return ue.Date.now()},md=/\s/;function fd(e){for(var n=e.length;n--&&md.test(e.charAt(n)););return n}var ud=/^\s+/;function pd(e){return e&&e.slice(0,fd(e)+1).replace(ud,"")}var zo=NaN,hd=/^[-+]0x[0-9a-f]+$/i,gd=/^0b[01]+$/i,yd=/^0o[0-7]+$/i,bd=parseInt;function gn(e){if(typeof e=="number")return e;if(At(e))return zo;if(me(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=me(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=pd(e);var o=gd.test(e);return o||yd.test(e)?bd(e.slice(2),o?2:8):hd.test(e)?zo:+e}var _d="Expected a function",Ed=Math.max,Td=Math.min;function gt(e,n,o){var r,a,i,d,l,m,c=0,p=!1,u=!1,h=!0;if(typeof e!="function")throw new TypeError(_d);n=gn(n)||0,me(o)&&(p=!!o.leading,u="maxWait"in o,i=u?Ed(gn(o.maxWait)||0,n):i,h="trailing"in o?!!o.trailing:h);function M(T){var y=r,B=a;return r=a=void 0,c=T,d=e.apply(B,y),d}function R(T){return c=T,l=setTimeout(w,n),p?M(T):d}function f(T){var y=T-m,B=T-c,x=n-y;return u?Td(x,i-B):x}function C(T){var y=T-m,B=T-c;return m===void 0||y>=n||y<0||u&&B>=i}function w(){var T=hn();if(C(T))return O(T);l=setTimeout(w,f(T))}function O(T){return l=void 0,h&&r?M(T):(r=a=void 0,d)}function g(){l!==void 0&&clearTimeout(l),c=0,r=m=a=l=void 0}function S(){return l===void 0?d:O(hn())}function A(){var T=hn(),y=C(T);if(r=arguments,a=this,m=T,y){if(l===void 0)return R(m);if(u)return clearTimeout(l),l=setTimeout(w,n),M(m)}return l===void 0&&(l=setTimeout(w,n)),d}return A.cancel=g,A.flush=S,A}var Cd="__lodash_hash_undefined__";function wd(e){return this.__data__.set(e,Cd),this}function Sd(e){return this.__data__.has(e)}function Ut(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new Se;++n<o;)this.add(e[n])}Ut.prototype.add=Ut.prototype.push=wd,Ut.prototype.has=Sd;function kd(e,n,o,r){for(var a=e.length,i=o+-1;++i<a;)if(n(e[i],i,e))return i;return-1}function Md(e){return e!==e}function Ad(e,n,o){for(var r=o-1,a=e.length;++r<a;)if(e[r]===n)return r;return-1}function Nd(e,n,o){return n===n?Ad(e,n,o):kd(e,Md,o)}function Id(e,n){var o=e==null?0:e.length;return!!o&&Nd(e,n,0)>-1}function Od(e,n){return e.has(n)}function Vd(){}function qo(e){var n=-1,o=Array(e.size);return e.forEach(function(r){o[++n]=r}),o}var Bd=1/0,Fd=Xe&&1/qo(new Xe([,-0]))[1]==Bd?function(e){return new Xe(e)}:Vd,Rd=200;function Dd(e,n,o){var r=-1,a=Id,i=e.length,d=!0,l=[],m=l;if(i>=Rd){var c=Fd(e);if(c)return qo(c);d=!1,a=Od,m=new Ut}else m=l;e:for(;++r<i;){var p=e[r],u=p;if(p=p!==0?p:0,d&&u===u){for(var h=m.length;h--;)if(m[h]===u)continue e;l.push(p)}else a(m,u,o)||(m!==l&&m.push(u),l.push(p))}return l}function Ko(e){return e&&e.length?Dd(e):[]}var Ld=0;function Ho(e){var n=++Ld;return Xn(e)+n}var Yo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Pe="\\d\\d?",$e="\\d\\d",Ud="\\d{3}",Pd="\\d{4}",yt="[^\\s]+",Go=/\[([^]*?)\]/gm;function Wo(e,n){for(var o=[],r=0,a=e.length;r<a;r++)o.push(e[r].substr(0,n));return o}var Zo=function(e){return function(n,o){var r=o[e].map(function(i){return i.toLowerCase()}),a=r.indexOf(n.toLowerCase());return a>-1?a:null}};function Ke(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var r=0,a=n;r<a.length;r++){var i=a[r];for(var d in i)e[d]=i[d]}return e}var Xo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Jo=["January","February","March","April","May","June","July","August","September","October","November","December"],$d=Wo(Jo,3),vd=Wo(Xo,3),Qo={dayNamesShort:vd,dayNames:Xo,monthNamesShort:$d,monthNames:Jo,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=Ke({},Qo),xd=function(e){return Pt=Ke(Pt,e)},er=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},de=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},jd={D:function(e){return String(e.getDate())},DD:function(e){return de(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return de(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 de(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 de(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return de(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return de(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return de(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return de(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return de(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return de(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return de(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?"-":"+")+de(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+de(Math.floor(Math.abs(n)/60),2)+":"+de(Math.abs(n)%60,2)}},tr=function(e){return+e-1},nr=[null,Pe],or=[null,yt],rr=["isPm",yt,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],ar=["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}],zd={D:["day",Pe],DD:["day",$e],Do:["day",Pe+yt,function(e){return parseInt(e,10)}],M:["month",Pe,tr],MM:["month",$e,tr],YY:["year",$e,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",Pe,void 0,"isPm"],hh:["hour",$e,void 0,"isPm"],H:["hour",Pe],HH:["hour",$e],m:["minute",Pe],mm:["minute",$e],s:["second",Pe],ss:["second",$e],YYYY:["year",Pd],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",$e,function(e){return+e*10}],SSS:["millisecond",Ud],d:nr,dd:nr,ddd:or,dddd:or,MMM:["month",yt,Zo("monthNamesShort")],MMMM:["month",yt,Zo("monthNames")],a:rr,A:rr,ZZ:ar,Z:ar},$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"},qd=function(e){return Ke($t,e)},Kd=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 r=[];n=n.replace(Go,function(i,d){return r.push(d),"@@@"});var a=Ke(Ke({},Pt),o);return n=n.replace(Yo,function(i){return jd[i](e,a)}),n.replace(/@@@/g,function(){return r.shift()})};function Hd(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 r=new Date,a={year:r.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],d=[],l=n.replace(Go,function(S,A){return d.push(er(A)),"@@@"}),m={},c={};l=er(l).replace(Yo,function(S){var A=zd[S],T=A[0],y=A[1],B=A[3];if(m[T])throw new Error("Invalid format. "+T+" specified twice in format");return m[T]=!0,B&&(c[B]=!0),i.push(A),"("+y+")"}),Object.keys(c).forEach(function(S){if(!m[S])throw new Error("Invalid format. "+S+" is required in specified format")}),l=l.replace(/@@@/g,function(){return d.shift()});var p=e.match(new RegExp(l,"i"));if(!p)return null;for(var u=Ke(Ke({},Pt),o),h=1;h<p.length;h++){var M=i[h-1],R=M[0],f=M[2],C=f?f(p[h],u):+p[h];if(C==null)return null;a[R]=C}a.isPm===1&&a.hour!=null&&+a.hour!=12?a.hour=+a.hour+12:a.isPm===0&&+a.hour==12&&(a.hour=0);var w;if(a.timezoneOffset==null){w=new Date(a.year,a.month,a.day,a.hour,a.minute,a.second,a.millisecond);for(var O=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],h=0,g=O.length;h<g;h++)if(m[O[h][0]]&&a[O[h][0]]!==w[O[h][1]]())return null}else if(w=new Date(Date.UTC(a.year,a.month,a.day,a.hour,a.minute-a.timezoneOffset,a.second,a.millisecond)),a.month>11||a.month<0||a.day>31||a.day<1||a.hour>23||a.hour<0||a.minute>59||a.minute<0||a.second>59||a.second<0)return null;return w}var Je={format:Kd,parse:Hd,defaultI18n:Qo,setGlobalDateI18n:xd,setGlobalDateMasks:qd};function Yd(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 ir=Math.max;function Gd(e,n,o){return n=ir(n===void 0?e.length-1:n,0),function(){for(var r=arguments,a=-1,i=ir(r.length-n,0),d=Array(i);++a<i;)d[a]=r[n+a];a=-1;for(var l=Array(n+1);++a<n;)l[a]=r[a];return l[n]=o(d),Yd(e,this,l)}}function Wd(e){return function(){return e}}var Zd=Rt?function(e,n){return Rt(e,"toString",{configurable:!0,enumerable:!1,value:Wd(n),writable:!0})}:Jt,Xd=800,Jd=16,Qd=Date.now;function ec(e){var n=0,o=0;return function(){var r=Qd(),a=Jd-(r-o);if(o=r,a>0){if(++n>=Xd)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var tc=ec(Zd);function nc(e,n){return tc(Gd(e,n,Jt),e+"")}function oc(e,n,o){if(!me(o))return!1;var r=typeof n;return(r=="number"?kt(o)&&xn(n,o.length):r=="string"&&n in o)?Nt(o[n],e):!1}var lr=Object.prototype,rc=lr.hasOwnProperty,ac=nc(function(e,n){e=Object(e);var o=-1,r=n.length,a=r>2?n[2]:void 0;for(a&&oc(n[0],n[1],a)&&(r=1);++o<r;)for(var i=n[o],d=Lt(i),l=-1,m=d.length;++l<m;){var c=d[l],p=e[c];(p===void 0||Nt(p,lr[c])&&!rc.call(e,c))&&(e[c]=i[c])}return e}),ic=ue.isFinite;function lc(e){return typeof e=="number"&&ic(e)}var sr=1/0,sc=17976931348623157e292;function dc(e){if(!e)return e===0?e:0;if(e=gn(e),e===sr||e===-sr){var n=e<0?-1:1;return n*sc}return e===e?e:0}function cc(e){var n=dc(e),o=n%1;return n===n?o?n-o:n:0}function mc(e){return typeof e=="number"&&e==cc(e)}var fc="[object Number]";function vt(e){return typeof e=="number"||De(e)&&Re(e)==fc}const _e={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'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."}},vfg:{labels:{on:"On",off:"Off"}}},{t:W}=be.createI18n("en-us",_e),ne={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},he=(e,n,o=ne)=>G(e)||e===""?n?[K(o.fieldIsRequired)]:[]:null,He={required:(e,n,o,r=ne)=>he(e,n.required,r)||[],number:(e,n,o,r=ne)=>{let a=he(e,n.required,r);return a!=null||(a=[],lc(e)?(!G(n.min)&&e<n.min,(r=ne)&&a.push(K(r.numberTooSmall,n.min)),!G(n.max)&&e>n.max,(r=ne)&&a.push(K(r.numberTooBig,n.max))):a.push(K(r.invalidNumber))),a},integer:(e,n,o,r=ne)=>{let a=he(e,n.required,r);return a!=null||(a=[],a.concat(He.number(e,n,o,r)),mc(e)||a.push(K(r.invalidInteger))),a},double:(e,n,o,r=ne)=>{const a=he(e,n.required,r);return a??(!vt(e)||isNaN(e)?[K(r.invalidNumber)]:[])},string:(e,n,o,r=ne)=>{let a=he(e,n.required,r);return a!=null||(a=[],qe(e)?(!G(n.min)&&e.length<n.min&&a.push(K(r.textTooSmall,e.length,n.min)),!G(n.max)&&e.length>n.max&&a.push(K(r.textTooBig,e.length,n.max))):a.push(K(r.thisNotText))),a},array:(e,n,o,r=ne)=>{if(n.required){if(!Array.isArray(e))return[K(r.thisNotArray)];if(e.length===0)return[K(r.fieldIsRequired)]}if(!G(e)){if(!G(n.min)&&e.length<n.min)return[K(r.selectMinItems,n.min)];if(!G(n.max)&&e.length>n.max)return[K(r.selectMaxItems,n.max)]}return[]},date:(e,n,o,r=ne)=>{let a=he(e,n.required,r);if(a!=null)return a;a=[];const i=new Date(e);if(isNaN(i.getDate()))return[K(r.invalidDate)];if(!G(n.min)){const d=new Date(n.min);i.valueOf()<d.valueOf()&&a.push(K(r.dateIsEarly,Je.format(i),Je.format(d)))}if(!G(n.max)){const d=new Date(n.max);i.valueOf()>d.valueOf()&&a.push(K(r.dateIsLate,Je.format(i),Je.format(d)))}return a},regexp:(e,n,o,r=ne)=>{const a=he(e,n.required,r);return a??(!G(n.pattern)&&!new RegExp(n.pattern).test(e)?[K(r.invalidFormat)]:[])},email:(e,n,o,r=ne)=>{const a=he(e,n.required,r);return a??(/^(([^<>()\[\]\\.,;:\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(r.invalidEmail)])},url:(e,n,o,r=ne)=>{const a=he(e,n.required,r);return a??(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e)?[]:[K(r.invalidURL)])},creditCard:(e,n,o,r=ne)=>{const a=he(e,n.required,r);if(a!=null)return a;const i=/^(?: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})$/,d=e.replace(/[^0-9]+/g,"");if(!i.test(d))return[K(r.invalidCard)];let l=0,m,c,p;for(let u=d.length-1;u>=0;u--)m=d.substring(u,u+1),c=parseInt(m,10),p?(c*=2,c>=10?l+=c%10+1:l+=c):l+=c,p=!p;return l%10===0&&d?[]:[K(r.invalidCardNumber)]},alpha:(e,n,o,r=ne)=>{const a=he(e,n.required,r);return a??(/^[a-zA-Z]*$/.test(e)?[]:[K(r.invalidTextContainNumber)])},alphaNumeric:(e,n,o,r=ne)=>{const a=he(e,n.required,r);return a??(/^[a-zA-Z0-9]*$/.test(e)?[]:[K(r.invalidTextContainSpec)])}};Object.keys(He).forEach(e=>{const n=He[e];$(n)&&(n.locale=o=>(r,a,i)=>n(r,a,i,ac(o,ne)))});function dr(e){return qe(e)?He[e]!=null?He[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function yn(e,n,o){let r=P(o.context,"schema.attributes",{});const a=n.value||"input";qe(a)&&(r=P(r,a)||r),ae(r,(i,d)=>{e.setAttribute(d,i)})}const Ee={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 $(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),$(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 a=[];Array.isArray(this.schema.validator)?ae(this.schema.validator,i=>{a.push(dr(i).bind(this))}):a.push(dr(this.schema.validator).bind(this)),ae(a,i=>{if(n)o.push(i(this.value,this.schema,this.model));else{const d=i(this.value,this.schema,this.model);d&&$(d.then)?d.then(l=>{l&&(this.errors=this.errors.concat(l));const m=this.errors.length===0;this.$emit("validated",m,this.errors,this)}):d&&(o=o.concat(d))}})}const r=a=>{let i=[];ae(Ko(a),l=>{Array.isArray(l)&&l.length>0?i=i.concat(l):qe(l)&&i.push(l)}),$(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,i,this.schema);const d=i.length===0;return e||this.$emit("validated",d,i,this),this.errors=i,i};return n?Promise.all(o).then(r):r(o)},debouncedValidate(){$(this.debouncedValidateFunc)||(this.debouncedValidateFunc=gt(this.validate.bind(this),P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;$(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),$(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 r=this.model;const a=o.split(".");let i=0;const d=a.length;for(;i<d;){const l=a[i];if(i<d-1)r[l]!==void 0||(r[l]={}),r=r[l];else{r[l]=n;return}++i}},getFieldID(e,n=!1){const o=P(this.formOptions,"fieldIdPrefix","");return pn(e,o)+(n?"-"+Ho():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return P(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},uc=Object.freeze(Object.defineProperty({__proto__:null,default:Ee},Symbol.toStringTag,{value:"Module"})),v=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},pc={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},hc={class:"material-icons"},gc=v(Object.assign({mixins:[Ee],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",pc,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:o[0]||(o[0]=(...r)=>n.handleOpen&&n.handleOpen(...r))},[t.createElementVNode("i",hc,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"]]),yc={class:"array-card-container"},cr=v(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,r)=>{const a=t.resolveComponent("KCard"),i=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",yc,[t.createVNode(a,{class:"card"},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3}),t.createVNode(i,{appearance:"tertiary",class:"array-card-remove-button",onClick:r[0]||(r[0]=d=>o.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.TrashIcon))]),_:1})])}}}),[["__scopeId","data-v-97302224"]]),bc={class:"array-item-wrapper"},_c={class:"array-item"},Ec={class:"array-item-after"},mr=v(t.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(n,o)=>{const r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",bc,[t.createElementVNode("div",_c,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(r,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=a=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Ce.TrashIcon))]),_:1})]),t.createElementVNode("div",Ec,[t.renderSlot(n.$slots,"after",{},void 0,!0)])])}}}),[["__scopeId","data-v-51d79db2"]]),Tc={class:"multi-item-wrapper"},fr=v(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Tc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(r,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=a=>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"]]),Cc="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",wc=e=>e?e.length===36&&new RegExp(`^${Cc}$`).test(e):!1,bn=50,Ye={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"};function Sc(e,n,o){return o?Ye.SET_REFERRAL_VALUE:e&&!n||!e&&n?Ye.UPDATE_ENTITY:e&&n?Ye.CREATE_FROM_ENTITY:Ye.CREATE_NOT_FROM_ENTITY}const kc={mixins:[Ee],inject:[Ue],emits:["model-updated"],setup(){const{t:e}=be.createI18n("en-us",_e);return{t:e}},data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return Sc(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 Ye.UPDATE_ENTITY:if(!this[Ue]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[Ue].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 Ye.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case Ye.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=gt(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],r=this.getInputFields(),a=new Set;wc(e)&&r.includes("id")?o.push((async()=>{const i=await this.fetchExact(e);n.push({...i,label:this.getSuggestionLabel(i),value:i.id})})()):o.push(...r.filter(i=>i!=="id").map(async i=>{(await this.fetchSuggestions(e,i)).forEach(l=>{a.has(l.id)||(a.add(l.id),n.push({...l,label:this.getSuggestionLabel(l),value:l.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[Ue])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<bn;){const r=await this[Ue].getAll(this.entity,{size:bn,offset:o,...e});if(n.push(...r.data.data),o=r.data.offset,!o)break}return n.slice(0,bn)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[Ue]?(await this[Ue].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}}},Mc=["data-testid","data-testlabel"],Ac=["data-testid"],Nc={class:"autosuggest__results_message"};function Ic(e,n,o,r,a,i){const d=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:r.t("general.disable_source_scope_change",{scope:i.scope})},{default:t.withCtx(()=>[t.createVNode(d,{id:e.schema.model,ref:"suggestion",modelValue:a.idValue,"onUpdate:modelValue":n[0]||(n[0]=l=>a.idValue=l),clearable:"",disabled:e.schema.disabled,"enable-filtering":"","filter-function":()=>!0,items:a.items,loading:a.loading,placeholder:e.schema.placeholder,width:"100%",onChange:i.onSelected,onQueryChange:i.onQueryChange},{"item-template":t.withCtx(({item:l})=>[t.createElementVNode("span",{class:"first-part","data-testid":l.id&&`${l.id}-0`,"data-testlabel":l.label},t.toDisplayString(i.getSuggestionLabel(l).split(" - ")[0]),9,Mc),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.getSuggestionLabel(l).split(" - ").slice(1),(m,c)=>(t.openBlock(),t.createElementBlock("span",{key:c,class:"field-span","data-testid":l.id&&`${l.id}-${c+1}`||c+1},t.toDisplayString(m),9,Ac))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",Nc,[t.createElementVNode("span",null,t.toDisplayString(a.message),1)])]),_:1},8,["id","modelValue","disabled","items","loading","placeholder","onChange","onQueryChange"])]),_:1},8,["text"])}const ur=v(kc,[["render",Ic],["__scopeId","data-v-40a272a2"]]);function Oc(e){const n=t.ref([]),o=t.ref(null),r=f=>qe(f)?He[f]!=null?He[f]:(console.warn(`'${f}' is not a validator function!`),null):f,a=t.computed({get(){var C,w;let f;return $(P(e.schema,"get"))?f=e.schema.get((C=e.model)==null?void 0:C.value):f=P((w=e.model)==null?void 0:w.value,e.schema.model),M(f)},set(f){const C=a;f=R(f),$(f)?f(f,C):l(f,C)}}),i=f=>{var g;m();const C=P(e.formOptions,"validateAsync",!1);let w=[];if(e.schema.readonly!==!0&&e.disabled!==!0){const S=[],A=(g=e.schema)==null?void 0:g.validator;A&&(Array.isArray(A)?ae(A,T=>{S.push(r(T))}):S.push(r(A))),$(e.externalValidator)&&S.push(e.externalValidator),ae(S,T=>{var y,B;if(C)w.push(T(a.value,e.schema,(y=e.model)==null?void 0:y.value));else{const x=T(a.value,e.schema,(B=e.model)==null?void 0:B.value);x&&$(x.then)?x.then(E=>{E&&(n.value=n.value.concat(E));const _=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:_,errors:n.value,field:e.schema})}):x&&(w=w.concat(x))}})}const O=S=>{var T,y;let A=[];if(ae(Ko(S),B=>{Array.isArray(B)&&B.length>0?A=A.concat(B):qe(B)&&A.push(B)}),$((T=e.schema)==null?void 0:T.onValidated)&&e.schema.onValidated((y=e.model)==null?void 0:y.value,A,e.schema),!f){const B=A.length===0;e.emitValidated&&e.emitValidated({isValid:B,errors:A,field:e.schema})}return S=A,A};return C?Promise.all(w).then(O):O(w)},d=()=>{$(o.value)?o.value():o.value=gt(i,P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",500)))},l=(f,C)=>{var O,g,S;let w=!1;$(e.schema.set)?(e.schema.set((O=e.model)==null?void 0:O.value,f),w=!0):e.schema.model&&(c(e.schema.model,f),w=!0),w&&(e.emitModelUpdated&&((g=e.model)!=null&&g.value)&&e.emitModelUpdated({value:f,model:e.schema.model}),$(e.schema.onChanged)&&e.schema.onChanged((S=e.model)==null?void 0:S.value,f,C,e.schema),P(e.formOptions,"validateAfterChanged",!1)===!0&&(P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",0))>0?d():i()))},m=()=>{n.value.splice(0)},c=(f,C)=>{var T;let w=f.replace(/\[(\w+)\]/g,".$1");w=w.replace(/^\./,"");let O=((T=e.model)==null?void 0:T.value)||{},g=0;const S=w.split("."),A=S.length;for(;g<A;){const y=S[g];if(g<A-1)O[y]!==void 0||(O[y]={}),O=O[y];else{O[y]=C;return}++g}},p=(f,C=!1)=>{const w=P(e.formOptions,"fieldIdPrefix","");return pn(f,w)+(C?"-"+Ho():"")},u=f=>`${p(f)}-label`,h=()=>P(e.schema,"fieldClasses",[]),M=f=>e.formatValueToField&&typeof e.formatValueToField=="function"?e.formatValueToField(f):f,R=f=>e.formatValueToModel&&typeof e.formatValueToModel=="function"?e.formatValueToModel(f):f;return{value:a,clearValidationErrors:m,getFieldID:p,getLabelId:u,getFieldClasses:h,updateModelValue:l}}function Vc(e){const n=[],o=r=>{const a=["cluster-cache","cluster_cache"];for(const i of a)if(r.model.includes(i))return!1;return new RegExp("(?<=-redis-).*").test(r.model)};return e.fields.forEach(r=>{o(r)&&n.push(r)}),{redis:{id:"_redis",fields:n,model:"__redis_partial",redisType:e._supported_redis_partial_type,redisPath:e._redis_partial_path},redisModels:n.map(r=>r.model)}}function Bc(e,n){const o=new RegExp("(?<=config-redis-).*"),r=/Config\.Redis.*/;return n.filter(i=>{const d=i.model.match(o);return d&&!Object.keys(e).includes(d[0])}).map(i=>{const d=i.label.match(r);return{label:d?d[0]:i.label,key:i.model,value:"N/A",type:"text"}})}const ye={useAbstractFields:Oc,useRedisPartial:Vc,useRedisNonStandardFields:Bc},Fc={class:"form-field-wrapper"},pr=v(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 r=e,a=o,i=t.toRefs(r),d=t.inject(fe,void 0),{updateModelValue:l,getFieldID:m,clearValidationErrors:c,value:p}=ye.useAbstractFields({model:i.model,schema:r.schema,formOptions:r.formOptions,emitModelUpdated:g=>{a("modelUpdated",g.value,g.model)}});n({clearValidationErrors:c});const u=t.computed(()=>{var S;const g=(S=r.schema)==null?void 0:S.inputType.toLowerCase();switch(g){case"string":return"text";case"datetime":return"datetime-local";default:return g||"text"}}),h={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},M=(g,S)=>{var B,x;let A=g;const T=h[u.value]||"",y=Je.parse(g,T);y&&((B=r.schema)!=null&&B.format?A=Je.format(y,(x=r.schema)==null?void 0:x.format):A=y.valueOf()),l(A,S)},R=(g,S)=>{vt(g)||(g=NaN),l(g,S)},f=g=>{let S=g;switch(u.value){case"number":case"range":vt(parseFloat(g))&&(S=parseFloat(g));break}p.value=S,l(S,g)},C=g=>{p.value=g,l(g,g)},w=t.ref(null),O=()=>{var g;$(w.value)&&((g=w.value)==null||g.flush())};return t.onMounted(()=>{switch(u.value){case"number":case"range":w.value=gt((g,S)=>{R(g,S)},parseInt(P(r.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":w.value=gt((g,S)=>{M(g,S)},parseInt(P(r.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{u.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):u.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):u.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(g,S)=>{const A=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",Fc,[t.createVNode(A,t.mergeProps(g.$attrs,{id:t.unref(m)(e.schema),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:u.value==="color"||u.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":u.value==="password",type:u.value,width:e.schema.width,onBlur:O,"onUpdate:modelValue":f}),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(d)),{schema:e.schema,update:C,value:t.unref(p)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-fe1132bb"]]),Rc={name:"FieldMetric",components:{AddIcon:Ce.AddIcon,TrashIcon:Ce.TrashIcon},mixins:[Ee],emits:["remove-item"],data(){return{contentVisible:!1}}},Dc={key:0,class:"content"};function Lc(e,n,o,r,a,i){const d=t.resolveComponent("AddIcon"),l=t.resolveComponent("TrashIcon"),m=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field-dropdown",{active:a.contentVisible}])},[t.createElementVNode("div",{class:"title",onClick:n[0]||(n[0]=c=>a.contentVisible=!a.contentVisible)},[t.createTextVNode(t.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),t.createVNode(d,{class:"metric-add-icon"})]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[a.contentVisible?(t.openBlock(),t.createElementBlock("div",Dc,[t.renderSlot(e.$slots,"default"),t.createVNode(m,{appearance:"tertiary",class:"metric-remove-button",onClick:n[1]||(n[1]=c=>e.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(l)]),_:1})])):t.createCommentVNode("",!0)]),_:3})],2)}const hr=v(Rc,[["render",Lc]]),Uc={class:"field-object-container"},Pc={key:1},$c=["id"],vc={key:0},xc=["onUpdate:modelValue"],jc={key:1},zc=["onUpdate:modelValue"],qc={key:2},Kc=["onUpdate:modelValue"],Hc=["onClick"],gr=v(Object.assign({mixins:[Ee],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 r=e[o];n[r]=typeof this.value[r]}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 r=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",Uc,[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",Pc,[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,(a,i)=>(t.openBlock(),t.createElementBlock("tr",{key:i},[t.createElementVNode("td",null,t.toDisplayString(i),1),n.keyTypes[i]==="string"?(t.openBlock(),t.createElementBlock("td",vc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":d=>n.value[i]=d,type:"text"},null,8,xc),[[t.vModelText,n.value[i]]])])):t.createCommentVNode("",!0),n.keyTypes[i]==="boolean"?(t.openBlock(),t.createElementBlock("td",jc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":d=>n.value[i]=d,type:"checkbox"},null,8,zc),[[t.vModelCheckbox,n.value[i]]])])):t.createCommentVNode("",!0),n.keyTypes[i]==="number"?(t.openBlock(),t.createElementBlock("td",qc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":d=>n.value[i]=d,type:"number"},null,8,Kc),[[t.vModelText,n.value[i]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:d=>n.removeElement(i)},null,8,Hc)])]))),128))],10,$c),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":o[0]||(o[0]=a=>n.newKeyType=a)},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]=a=>n.newKeyName=a),type:"text"},null,512),[[t.vModelText,n.newKeyName]]),t.createElementVNode("input",{type:"button",value:"Add key",onClick:o[2]||(o[2]=(...a)=>n.addKey&&n.addKey(...a))})]))])),[[r,n.attributes]])}}}),[["__scopeId","data-v-4ace4106"]]),Yc=["id"],Gc=["data-testid"],Wc={class:"item-wrapper"},Zc={class:"index-wrapper"},Xc={key:0},Jc={key:1},Qc=["onUpdate:modelValue","placeholder","type","onInput"],em={key:0,class:"hint"},tm={class:"input-item"},nm=["placeholder"],om={key:0,class:"hint"},yr=v(Object.assign({mixins:[Ee],expose:["validate","clearValidationErrors","schema"],inject:{autofillSlot:{from:fe,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 r={};try{r=JSON.parse(JSON.stringify(e??{}))[o]??{}}catch{}return Object.keys(e).map(a=>{const i=a.indexOf(o+"-");if(i>-1&&Array.isArray(n))if(n.length>0){const l=a.split("-").filter(c=>n.find(p=>p.model===c)),m=a.split(`-${l}`)[0].split(`${o}-`)[1];l.length?r[m]={...r[m],[l]:e[a]}:r[a.substring(i+`${o}-`.length)]=e[a]}else r[a.substring(`${o}-`.length)]=e[a];else{const l=a.split("-").filter(c=>c===this.schema.model),m=a.split(`-${l}`)[0].split(`${o}-`)[1];m&&(r[m]=e[a])}return a}),r},addKey(){var r;const e=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",n=((r=this.schema.values)==null?void 0:r.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 r=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,(a,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,"data-testid":`field-object-key-${i}`},[t.createElementVNode("div",null,[t.createElementVNode("div",Wc,[t.createElementVNode("div",Zc,[t.createElementVNode("strong",null,t.toDisplayString(i),1),t.createElementVNode("div",null,[t.createVNode(r,{appearance:"tertiary",class:"delete",icon:"",type:"button",onClick:d=>n.removeElement(i)},{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",Xc,[t.createVNode(Y,{model:n.transformedModel[i],options:{helpAsHtml:!0},schema:n.subSchema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",Jc,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":d=>n.value[i]=d,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:n.valueInputType,onInput:d=>n.updateModel(n.value[i],n.model[n.schema.model])},null,40,Qc),[[t.vModelDynamic,n.value[i]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",em,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:d=>n.value[i]=d,value:n.value[i]},null,8,["schema","update","value"]))])),o[2]||(o[2]=t.createElementVNode("hr",{class:"wide-divider"},null,-1))])])],8,Gc))),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]=a=>n.newKeyName=a),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,nm),[[t.vModelText,n.newKeyName]]),t.createVNode(r,{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",om,t.toDisplayString(n.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,Yc)}}}),[["__scopeId","data-v-502ed880"]]),rm={class:"radio-selection-group"},br=v(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 r=e,a=o,i=t.toRefs(r),{updateModelValue:d,value:l,clearValidationErrors:m}=ye.useAbstractFields({model:i.model,schema:r.schema,formOptions:r.formOptions,emitModelUpdated:p=>{a("modelUpdated",p.value,p.model)}});n({clearValidationErrors:m});const c=p=>{let u=p;typeof p=="string"&&(u=p.split(","),r.schema.array||(u=u.toString())),d(u,p)};return(p,u)=>{const h=t.resolveComponent("KRadio");return t.openBlock(),t.createElementBlock("div",rm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.values,(M,R)=>(t.openBlock(),t.createBlock(h,{id:e.schema.name+"-"+R,key:M.value,modelValue:t.unref(l),"onUpdate:modelValue":u[0]||(u[0]=f=>t.isRef(l)?l.value=f: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:c},null,8,["id","modelValue","label","label-attributes","name","required","selected-value"]))),128))])}}}),[["__scopeId","data-v-09b8afda"]]),_r=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 r=e,a=o,i=t.computed(()=>r.schema.selectOptions||{}),d=f=>G(f)?null:f,l=t.toRefs(r),{getFieldID:m,clearValidationErrors:c,value:p}=ye.useAbstractFields({model:l.model,schema:r.schema,formOptions:r.formOptions,formatValueToField:d,emitModelUpdated:f=>{a("modelUpdated",f.value,f.model)}});n({clearValidationErrors:c});const u=t.computed(()=>{const f=r.schema.values;return h(typeof f=="function"?f.apply(this,[r.model,r.schema]):f)}),h=f=>{const C=[];return f.forEach(w=>{C.push({label:R(w),value:M(w),disabled:typeof w=="object"&&w.disabled||void 0,group:typeof w=="object"&&String(w.group||"").toUpperCase()||void 0})}),C},M=f=>{if(me(f)){if(i.value&&typeof i.value.value<"u")return f[i.value.value];if(typeof f.id<"u")return String(f.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 f},R=f=>{if(me(f)){if(i.value&&typeof i.value.name<"u")return f[i.value.name];if(typeof f.name<"u")return String(f.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(f)};return(f,C)=>{const w=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(w,{id:t.unref(m)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":C[0]||(C[0]=O=>t.isRef(p)?p.value=O:null),class:t.normalizeClass(e.schema.fieldClasses),clearable:!e.schema.required,disabled:e.disabled||void 0,items:u.value,"kpop-attributes":{"data-testid":`${t.unref(m)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:i.value.hideNoneSelectedText?void 0:i.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"])}}}),am={name:"FieldArray",components:{FieldArrayItem:mr,FieldArrayMultiItem:fr,FieldSelect:_r,FieldMetric:hr,FieldObject:gr,FieldObjectAdvanced:yr,FieldAutoSuggest:ur,FieldRadio:br,FieldArrayCardContainer:cr,FieldInput:pr},mixins:[Ee],inject:{autofillSlot:{from:fe,default:void 0}},props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},emits:["refreshModel"],methods:{generateSchema(e,n,o){var a,i,d;let r;return n&&(r=JSON.parse(JSON.stringify(n)),(d=(i=(a=r.schema)==null?void 0:a.fields)==null?void 0:i.map)==null||d.call(i,l=>(l.id=`${l.id||l.model}-${o}`,l))),{...r,set(l,m){e[o]=m},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 r,a;let o=e;((a=(r=this.schema)==null?void 0:r.inputAttributes)==null?void 0:a.type)==="number"&&vt(parseFloat(e))&&(o=parseFloat(e)),this.value=this.value.map((i,d)=>d===n?o:i)}}},im=["id"],lm={key:1},sm=["onUpdate:modelValue","aria-labelledby","type"],dm=["onUpdate:modelValue","aria-labelledby"];function cm(e,n,o,r,a,i){const d=t.resolveComponent("KTextArea"),l=t.resolveComponent("KInput"),m=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,(c,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:c,schema:i.generateSchema(e.value,e.schema.items,p),onRemoveItem:u=>i.removeElement(p)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,p),onModelUpdated:i.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["index","model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",lm,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:c,schema:i.generateSchema(e.value,e.schema.items,p),onModelUpdated:i.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:c,schema:i.generateSchema(e.value,e.schema.items,p),onRemoveItem:u=>i.removeElement(p)},{after:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.autofillSlot),{schema:e.schema,update:u=>e.value[p]=u,value:e.value[p]},null,8,["schema","update","value"]))]),default:t.withCtx(()=>{var u;return[e.schema.inputAttributes&&e.schema.inputAttributes.type==="textarea"?(t.openBlock(),t.createBlock(d,t.mergeProps({key:0,ref_for:!0},e.schema.inputAttributes,{id:e.getFieldID(e.schema),modelValue:e.value[p],"onUpdate:modelValue":h=>e.value[p]=h,"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(l,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:h=>{i.handleInput(h,p)}}),null,16,["aria-labelledby","model-value","type","onInput"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,"onUpdate:modelValue":h=>e.value[p]=h,"aria-labelledby":e.getLabelId(e.schema),ref_for:!0},e.schema.inputAttributes,{type:((u=e.schema.inputAttributes)==null?void 0:u.type)||"text"}),null,16,sm)),[[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":u=>e.value[p]=u,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,dm),[[t.vModelText,e.value[p]]]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.autofillSlot),{schema:e.schema,update:u=>e.value[p]=u,value:e.value[p]},null,8,["schema","update","value"]))],64))],2))),128)),t.createVNode(m,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:i.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,im)):t.createCommentVNode("",!0)}const mm=v(am,[["render",cm],["__scopeId","data-v-27efd618"]]),fm={class:"form-field-wrapper field-checkbox"},um=v(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 r=e,a=o,i=t.toRefs(r),{getFieldID:d,value:l,clearValidationErrors:m}=ye.useAbstractFields({model:i.model,schema:r.schema,formOptions:r.formOptions,emitModelUpdated:c=>{a("modelUpdated",c.value,c.model)}});return n({clearValidationErrors:m}),(c,p)=>{const u=t.resolveComponent("KCheckbox");return t.openBlock(),t.createElementBlock("div",fm,[t.createVNode(u,t.mergeProps(c.$attrs,{id:t.unref(d)(e.schema),modelValue:t.unref(l),"onUpdate:modelValue":p[0]||(p[0]=h=>t.isRef(l)?l.value=h: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"]]);var pm=4;function Er(e){return ht(e,pm)}const hm={class:"wrapper"},gm=["disabled"],ym=["id","checked","disabled","onChange","name"],bm=["disabled"],_m={class:"info"},Em={class:"dropList"},Tm=["id","checked","disabled","onChange","name"];function Cm(e,n,o,r,a,i){const d=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",hm,[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(i.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":i.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(l)||null,disabled:e.disabled||null,onChange:m=>i.onChanged(m,l),name:i.getInputName(l)},null,40,ym),[[d,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)])],2))),256))],8,gm)):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:a.comboExpanded}]),onClick:n[0]||(n[0]=(...l)=>i.onExpandCombo&&i.onExpandCombo(...l))},[t.createElementVNode("div",_m,t.toDisplayString(i.selectedCount)+" selected",1),n[1]||(n[1]=t.createElementVNode("div",{class:"arrow"},null,-1))],2),t.createElementVNode("div",Em,[a.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(i.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":i.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:i.isItemChecked(l)||null,disabled:e.disabled||null,onChange:m=>i.onChanged(m,l),name:i.getInputName(l)},null,40,Tm),[[d,"input"]]),t.createTextVNode(t.toDisplayString(i.getItemName(l)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,bm))])),[[d,"wrapper"]])}const wm=v({mixins:[Ee],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?xo(this.schema.inputName+"_"+this.getItemValue(e)):xo(this.getItemValue(e))},getItemValue(e){if(me(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(me(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=Er(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=Er(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Cm]]),Sm={name:"FieldKeyValuePairs",components:{TrashIcon:Ce.TrashIcon},mixins:[Ee],inject:{autofillSlot:{from:fe,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(r=>{this.pairs.push({key:r,value:e[r]})})},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"},Mm={class:"pair-item-cell"},Am=["data-testid","placeholder","value","onInput"],Nm={class:"pair-item-cell"},Im=["data-testid","placeholder","value","onInput"];function Om(e,n,o,r,a,i){const d=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",km,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.pairs,(m,c)=>(t.openBlock(),t.createElementBlock("div",{key:c,class:"pair-item"},[t.createElementVNode("div",Mm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-key-${c}`,placeholder:e.schema.keyInputPlaceholder??"Key",type:"text",value:m.key,onInput:p=>{i.onInput(p,c,"key")}},null,40,Am),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.autofillSlot),{schema:e.schema,update:p=>i.onInput({target:{value:p}},c,"key"),value:m.key},null,8,["schema","update","value"]))]),t.createElementVNode("div",Nm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-value-${c}`,placeholder:e.schema.valueInputPlaceholder??"Value",type:"text",value:m.value,onInput:p=>{i.onInput(p,c,"value")}},null,40,Im),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.autofillSlot),{schema:e.schema,update:p=>i.onInput({target:{value:p}},c,"value"),value:m.value},null,8,["schema","update","value"]))]),t.createVNode(l,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${c}`,onClick:()=>{i.removePair(c)}},{default:t.withCtx(()=>[t.createVNode(d)]),_:2},1032,["data-testid","onClick"])]))),128)),t.createVNode(l,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:i.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const Vm=v(Sm,[["render",Om],["__scopeId","data-v-70998d5b"]]),Bm=v(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:r,value:a}=ye.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(i,d)=>{const l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["field-label",e.schema.fieldClasses])},[t.createVNode(l,{id:t.unref(r)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-d046a15a"]]),Fm=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 r=e,a=o,i=t.toRef(r,"model"),{getLabelId:d,getFieldID:l,clearValidationErrors:m,value:c}=ye.useAbstractFields({model:i,schema:r.schema,formOptions:r.formOptions,emitModelUpdated:u=>{a("modelUpdated",u.value,u.model)}});n({clearValidationErrors:m});const p=t.computed(()=>{var u,h;return r.schema.values?r.schema.values:(h=(u=r.schema.elements)==null?void 0:u.one_of)!=null&&h.length?r.schema.elements.one_of.map(M=>({label:String(M),value:String(M)})):[]});return(u,h)=>{const M=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(M,{id:t.unref(l)(e.schema),modelValue:t.unref(c),"onUpdate:modelValue":h[0]||(h[0]=R=>t.isRef(c)?c.value=R:null),"aria-labelledby":t.unref(d)(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(l)(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"])}}}),Rm={class:"selection-group"},Dm={class:"form-group horizontal-radios"},Lm={class:"radio-group"},Um=["disabled","value"],Pm={class:"control-help"},$m={class:"option-field"},vm={class:"option-field-container"},xm=v(Object.assign({mixins:[Ee],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,r=this.schema.fields[n].fields;r&&r.forEach(a=>this.updateModel("",a.model)),o&&o.forEach(a=>this.updateModel(this.fieldModel[a.model],a.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((e,n)=>{e.fields&&e.fields.forEach(o=>{var r;this.model[o.model]&&(this.checkedGroup=n,this.fieldSchema.push(o.model),this.scope=(r=o.label)==null?void 0:r.toLowerCase())})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldSelectionGroup",setup(e){const{t:n}=be.createI18n("en-us",_e);return(o,r)=>(t.openBlock(),t.createElementBlock("div",Rm,[(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",Dm,[t.createElementVNode("div",Lm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(a,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:t.normalizeClass(["option-group",{"radio-disabled":o.$props.disabled}])},[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${a.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":r[0]||(r[0]=d=>o.checkedGroup=d),class:"k-input",disabled:o.$props.disabled,type:"radio",value:i},null,8,Um),[[t.vModelRadio,o.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(a.label)+" ",1),t.createElementVNode("div",Pm,t.toDisplayString(a.description),1)],2)],2))),128))])])]),_:1},8,["text"])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(a,i)=>(t.openBlock(),t.createElementBlock("div",{key:i,class:"option-group"},[t.withDirectives(t.createElementVNode("div",$m,[t.createElementVNode("div",vm,[t.createVNode(Y,{model:o.model,options:{helpAsHtml:!0},schema:{fields:a.fields},onModelUpdated:o.updateModel},null,8,["model","schema","onModelUpdated"])])],512),[[t.vShow,a.fields&&o.checkedGroup===i]])]))),128))]))}}),[["__scopeId","data-v-7b085c16"]]),jm={class:"form-field-wrapper"},zm=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 r=e,a=o,{t:i}=be.createI18n("en-us",_e),d=h=>h!=null&&r.schema.valueOn?h===r.schema.valueOn:h,l=h=>h!=null&&r.schema.valueOn?h?r.schema.valueOn:r.schema.valueOff:h,m=t.toRefs(r),{getFieldID:c,value:p,clearValidationErrors:u}=ye.useAbstractFields({model:m.model,schema:r.schema,formOptions:r.formOptions,formatValueToField:d,formatValueToModel:l,emitModelUpdated:h=>{a("modelUpdated",h.value,h.model)}});return n({clearValidationErrors:u}),(h,M)=>{const R=t.resolveComponent("KInputSwitch");return t.openBlock(),t.createElementBlock("div",jm,[t.createVNode(R,{id:t.unref(c)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":M[0]||(M[0]=f=>t.isRef(p)?p.value=f: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(i)("vfg.labels.on"):e.schema.textOff||t.unref(i)("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"])])}}}),qm={class:"field-textarea"},Km={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:gc,FieldArray:mm,FieldArrayCardContainer:cr,FieldArrayItem:mr,FieldArrayMultiItem:fr,FieldAutoSuggest:ur,FieldCheckbox:um,FieldChecklist:wm,FieldInput:pr,FieldKeyValuePairs:Vm,FieldLabel:Bm,FieldMetric:hr,FieldMultiselect:Fm,FieldObject:gr,FieldObjectAdvanced:yr,FieldRadio:br,FieldSelect:_r,FieldSelectionGroup:xm,FieldSwitch:zm,FieldTextArea:v(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 r=e,a=o,i=t.toRefs(r),d=t.inject(fe,void 0),{updateModelValue:l,getFieldID:m,clearValidationErrors:c,value:p}=ye.useAbstractFields({model:i.model,schema:r.schema,formOptions:r.formOptions,emitModelUpdated:h=>{a("modelUpdated",h.value,h.model)}});n({clearValidationErrors:c});const u=h=>{p.value=h,l(h,h)};return(h,M)=>{const R=t.resolveComponent("KTextArea");return t.openBlock(),t.createElementBlock("div",qm,[t.createVNode(R,t.mergeProps(h.$attrs,{id:t.unref(m)(e.schema),modelValue:t.unref(p),"onUpdate:modelValue":M[0]||(M[0]=f=>t.isRef(p)?p.value=f: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(d)),{schema:e.schema,update:u,value:t.unref(p)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-0e146fba"]])},Symbol.toStringTag,{value:"Module"})),mixins:[jo],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 Cl.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 pn(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 $(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\./,""):""}}},Hm=["innerHTML"],Ym={class:"icon-wrapper"},Gm={key:0,class:"link-wrapper"},Wm={class:"field-wrap"},Zm={key:0,class:"buttons"},Xm=["type","onClick","textContent"],Jm={key:1,class:"hint"},Qm={key:2,class:"errors help-block"};function ef(e,n,o,r,a,i){const d=t.resolveComponent("KExternalLink"),l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[i.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(l,{key:0,"aria-describedby":o.field.help?i.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:i.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:i.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",Ym,[t.createElementVNode("span",null,t.toDisplayString(i.formattedLabel(o.field.label)),1)]),o.field.link?(t.openBlock(),t.createElementBlock("div",Gm,[t.createVNode(d,{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:i.sanitize(o.field.help)},null,8,Hm)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",Wm,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.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"?i.fieldHint(o.field):void 0,model:o.model,schema:i.schema,vfg:o.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onRefreshModel","onValidated"])),i.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",Zm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.field.buttons,(m,c)=>(t.openBlock(),t.createElementBlock("button",{key:c,class:t.normalizeClass(m.classes),type:i.getButtonType(m),onClick:p=>i.buttonClickHandler(m,o.field,p),textContent:t.toDisplayString(m.label)},null,10,Xm))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&o.field.type!=="input"?(t.openBlock(),t.createElementBlock("div",Jm,t.toDisplayString(i.fieldHint(o.field)),1)):t.createCommentVNode("",!0),i.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",Qm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.fieldErrors(o.field),(m,c)=>(t.openBlock(),t.createElementBlock("span",{key:c},t.toDisplayString(m),1))),128))])):t.createCommentVNode("",!0)],2)}const Tr=v(Km,[["render",ef],["__scopeId","data-v-106c6dba"]]),tf="12px";var bt=(e=>(e.REDIS_CE="redis-ce",e.REDIS_EE="redis-ee",e))(bt||{});const nf=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"},of={[bt.REDIS_CE]:"open source",[bt.REDIS_EE]:"enterprise"},Cr=e=>of[e]??"",rf={class:"partial-config-card"},af={class:"config-card-row-label"},lf={class:"label-text"},sf=["data-testid"],df=["data-testid"],cf={key:1},mf=["data-testid"],ff=["data-testid"],uf=v(t.defineComponent({__name:"RedisConfigCard",props:{configFields:{type:Object,required:!0},pluginRedisFields:{type:Array,required:!0}},setup(e){const{t:n,formatUnixTimeStamp:o}=be.createI18n("en-us",_e),r={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}},a=e,i=u=>u!=null,d=(u,h)=>i(h)&&["password","sentinel_password"].includes(u)?"password":"text",{convertKeyToTitle:l}=St.useStringHelpers(),m=t.computed(()=>Object.entries(a.configFields).map(([u,h])=>{var M,R,f,C;return{key:u,label:((M=r[u])==null?void 0:M.label)??l(u),value:(R=r[u])!=null&&R.formatter?r[u].formatter(h):h,type:((f=r[u])==null?void 0:f.type)??d(u,h),order:((C=r[u])==null?void 0:C.order)??100}}).sort((u,h)=>u.order-h.order).filter(u=>u.type!=="hidden")),c=ye.useRedisNonStandardFields(a.configFields,a.pluginRedisFields),p=t.computed(()=>m.value.concat(c));return(u,h)=>{const M=t.resolveComponent("KCopy");return t.openBlock(),t.createElementBlock("div",rf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,({key:R,label:f,value:C,type:w})=>(t.openBlock(),t.createElementBlock("div",{key:R,class:"partial-config-card-row"},[t.createElementVNode("div",af,[t.createElementVNode("div",lf,t.toDisplayString(f),1)]),t.createElementVNode("div",{class:"config-card-row-value","data-testid":`${R}-property-value`},[i(C)?(t.openBlock(),t.createElementBlock("div",cf,[w==="password"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${R}-copy-password`},[t.createVNode(M,{format:"redacted",text:String(C)},null,8,["text"])],8,mf)):(t.openBlock(),t.createElementBlock("div",{key:1,"data-testid":`${R}-plain-text`},t.toDisplayString(C),9,ff))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${R}-no-value`}," – ",8,df))],8,sf)]))),128))])}}}),[["__scopeId","data-v-c1eb723f"]]),pf={class:"redis-config-select","data-testid":"redis-config-select"},hf={class:"selected-redis-config"},gf=["data-testid"],yf={class:"select-item-name","data-testid":"selected-redis-config"},bf={class:"empty-redis-config","data-testid":"empty-redis-config"},_f={key:1,class:"redis-shared-config-error-message","data-testid":"redis-config-fetch-error"},Ef="1000",wr=v(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}=be.createI18n("en-us",_e),o=t.inject(Qn),r={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"}},a=e,i=t.ref(null),{getMessageFromError:d}=St.useErrors(),l=t.inject(Jn),{debouncedQueryChange:m,loading:c,error:p,loadItems:u,results:h}=St.useDebouncedFilter(l,r[l.app].getAll,Ef,{fetchedItemsKey:"data",searchKeys:["id","name"]}),M=t.computed(()=>p.value?d(p.value):""),R=O=>{let g=`${l.apiBaseUrl}${r[l.app].getOne}`;return l.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(l==null?void 0:l.controlPlaneId)||""):l.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,l!=null&&l.workspace?`/${l.workspace}`:"")),g=g.replace(/{id}/gi,String(O)),g},f=t.computed(()=>{const O=(h.value||[]).map(g=>({label:g.id,name:g.name,value:g.id,type:g.type,tag:nf(g)})).filter(g=>g.type==="redis-ce"||g.type==="redis-ee");return a.redisType!=="all"?O.filter(g=>g.type===a.redisType):O}),{axiosInstance:C}=St.useAxios(l==null?void 0:l.axiosRequestConfig),w=async O=>{if(O){a.updateRedisModel(O);try{const g=await C.get(R(O));if(g.data.config){const S=Object.assign(g.data,g.data.config);delete S.config,i.value=S}}catch(g){console.error(g)}}};return t.watch(()=>o==null?void 0:o.value,async O=>{O&&await u()}),t.onBeforeMount(()=>{u(),a.defaultRedisConfigItem&&w(a.defaultRedisConfigItem)}),(O,g)=>{const S=t.resolveComponent("KLabel"),A=t.resolveComponent("KBadge"),T=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",pf,[t.createVNode(S,{info:e.isCustomPlugin?t.unref(n)("redis.custom_plugin.tooltip"):t.unref(n)("redis.shared_configuration.tooltip",{type:t.unref(Cr)(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"]),g[2]||(g[2]=t.createElementVNode("div",{class:"shared-redis-config-title"},null,-1)),t.createVNode(T,{class:"redis-config-select-trigger","data-testid":"redis-config-select-trigger","enable-filtering":"","filter-function":()=>!0,items:f.value,loading:t.unref(c),"model-value":e.defaultRedisConfigItem,placeholder:t.unref(n)("redis.shared_configuration.selector.placeholder"),onChange:g[1]||(g[1]=y=>w(y==null?void 0:y.value)),onQueryChange:t.unref(m)},{"selected-item-template":t.withCtx(({item:y})=>[t.createElementVNode("div",hf,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",yf,t.toDisplayString(y.name),1),t.createVNode(A,{appearance:"info",class:"select-item-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.tag),1)]),_:2},1024)],8,gf)]),empty:t.withCtx(()=>[t.createElementVNode("div",bf,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:g[0]||(g[0]=y=>O.$emit("showNewPartialModal"))},[t.createVNode(t.unref(Ce.AddIcon),{size:t.unref(tf)},null,8,["size"]),t.createElementVNode("span",null,t.toDisplayString(t.unref(n)("redis.shared_configuration.create_new_configuration",{type:t.unref(Cr)(e.redisType)})),1)])]),_:1},8,["items","loading","model-value","placeholder","onQueryChange"])]),i.value?(t.openBlock(),t.createBlock(uf,{key:0,"config-fields":i.value,"plugin-redis-fields":e.pluginRedisFields},null,8,["config-fields","plugin-redis-fields"])):t.createCommentVNode("",!0),M.value?(t.openBlock(),t.createElementBlock("p",_f,t.toDisplayString(M.value||t.unref(n)("redis.shared_configuration.error")),1)):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-0001f209"]]),Tf={key:0},Cf={class:"redis-config-radio-group","data-testid":"redis-config-radio-group"},wf={key:0,class:"shared-redis-config"},Sf={key:1,class:"dedicated-redis-config"},kf={class:"dedicated-redis-config-title"},Mf={name:"VueFormGenerator",components:{formGroup:Tr,formRedis:v(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,r=n,{t:a}=be.createI18n("en-us",_e),i=t.computed(()=>o.field.pluginType==="custom"),d=t.ref(!o.isEditing),l=t.ref(),m=t.ref({}),c=t.ref(),p=f=>$(f.visible)?f.visible.call(this,o.model,f,this):G(f.visible)?!0:f.visible,u=async f=>{r("modelUpdated",[{id:f,path:o.redisPath}],"partials"),c.value=[{id:f,path:o.redisPath}],l.value=f},h=(f,C)=>{m.value={...m.value,[C]:f},r("modelUpdated",f,C)},M=()=>{r("refreshModel")},R=(f,C,w)=>{r("validated",f,C,w)};return t.watch(()=>d.value,f=>{f?c.value&&r("partialToggled","redis",{partials:c.value}):r("partialToggled","partials",m.value)}),t.onBeforeMount(()=>{var f,C,w;if(o.model&&(m.value=o.field.fields.reduce((O,g)=>(Object.keys(o.model).includes(g.model)&&(O[g.model]=o.model[g.model]),O),{})),(w=(C=(f=o==null?void 0:o.model)==null?void 0:f.partials)==null?void 0:C[0])!=null&&w.id){const O=o.model.partials[0].id;d.value=!0,l.value=O}}),(f,C)=>{const w=t.resolveComponent("KAlert"),O=t.resolveComponent("KBadge"),g=t.resolveComponent("KRadio"),S=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",null,[i.value?(t.openBlock(),t.createElementBlock("div",Tf,[t.createVNode(w,{"data-testid":"custom-plugin-redis-config-note",message:t.unref(a)("redis.custom_plugin.alert")},null,8,["message"]),t.createVNode(wr,{"default-redis-config-item":l.value,"is-custom-plugin":"","plugin-redis-fields":e.field.fields,"update-redis-model":u,onShowNewPartialModal:C[0]||(C[0]=A=>f.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields"])])):(t.openBlock(),t.createBlock(S,{key:1,class:"redis-config-card","data-testid":"redis-config-card",title:t.unref(a)("redis.title")},{default:t.withCtx(()=>[t.createElementVNode("div",Cf,[t.createVNode(g,{modelValue:d.value,"onUpdate:modelValue":C[1]||(C[1]=A=>d.value=A),card:"","card-orientation":"horizontal","data-testid":"shared-redis-config-radio",description:t.unref(a)("redis.shared_configuration.description"),label:t.unref(a)("redis.shared_configuration.label"),"selected-value":!0},{default:t.withCtx(()=>[t.createVNode(O,{appearance:"success"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("redis.shared_configuration.badge")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),t.createVNode(g,{modelValue:d.value,"onUpdate:modelValue":C[2]||(C[2]=A=>d.value=A),card:"","card-orientation":"horizontal","data-testid":"dedicated-redis-config-radio",description:t.unref(a)("redis.dedicated_configuration.description"),label:t.unref(a)("redis.dedicated_configuration.label"),"selected-value":!1},null,8,["modelValue","description","label"])]),d.value?(t.openBlock(),t.createElementBlock("div",wf,[t.createVNode(wr,{"default-redis-config-item":l.value,"plugin-redis-fields":e.field.fields,"redis-type":e.field.redisType,"update-redis-model":u,onShowNewPartialModal:C[3]||(C[3]=A=>f.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields","redis-type"])])):(t.openBlock(),t.createElementBlock("div",Sf,[t.createElementVNode("div",kf,t.toDisplayString(t.unref(a)("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,A=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:A.model},[p(A)?(t.openBlock(),t.createBlock(Tr,{key:0,ref_for:!0,ref:"children",errors:e.errors,field:A,model:e.model,options:e.options,vfg:e.vfg,onModelUpdated:h,onRefreshModel:M,onValidated:R},null,8,["errors","field","model","options","vfg"])):t.createCommentVNode("",!0)],64))),128))]),_:1}))]))]),_:1},8,["title"]))])}}}),[["__scopeId","data-v-b9a17494"]])},mixins:[jo],inject:{autofillSlot:{from:fe,default:void 0}},provide(){var e;return{...!this.autofillSlot&&{[fe]:(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&&ae(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&ae(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 $(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(a=>a.field.fieldName!==o.schema.fieldName),!e&&n&&n.length>0&&ae(n,a=>{this.errors.push({field:o.schema,error:a})});const r=this.errors.length===0;this.$emit("validated",r,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=[];ae(this.$refs.children,a=>{$(a.validate)&&(n.push(a.$refs.child),o.push(a.$refs.child.validate(!0)))});const r=a=>{const i=[];ae(a,(l,m)=>{Array.isArray(l)&&l.length>0&&ae(l,c=>{i.push({field:n[m].schema,error:c})})}),this.errors=i;const d=i.length===0;return this.$emit("validated",d,i,this),e?i:d};return e?Promise.all(o).then(r):r(o)},clearValidationErrors(){this.errors.splice(0),ae(this.$refs.children,e=>{e.clearValidationErrors()})}}},Af={key:0,class:"vue-form-generator"},Nf={key:0};function If(e,n,o,r,a,i){const d=t.resolveComponent("form-redis"),l=t.resolveComponent("form-group"),m=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",Af,[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(i.fields,c=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:c.model},[c.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(d,{key:0,errors:a.errors,field:c,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onPartialToggled:i.onPartialToggled,onShowNewPartialModal:p=>e.$emit("showNewPartialModal",c.redisType),onValidated:i.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):i.fieldVisible(c)?(t.openBlock(),t.createBlock(l,{key:1,ref_for:!0,ref:"children",errors:a.errors,field:c,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.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(i.groups,(c,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`group-${p}`},[c.collapsible!==void 0&&c.collapsible!==!1?(t.openBlock(),t.createBlock(m,{key:0,class:"root-level-collapse","model-value":!1,title:c.collapsible.title},t.createSlots({default:t.withCtx(()=>{var u,h,M,R;return[(u=c.slots)!=null&&u.beforeContent?t.renderSlot(e.$slots,(h=c.slots)==null?void 0:h.beforeContent,{key:0}):t.createCommentVNode("",!0),c.fields.length===0&&((M=c.slots)!=null&&M.emptyState)?t.renderSlot(e.$slots,(R=c.slots)==null?void 0:R.emptyState,{key:1}):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:2,class:t.normalizeClass(e.getFieldRowClasses(c))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.fields,f=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:f.model},[i.fieldVisible(f)?(t.openBlock(),t.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:f,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),c.collapsible!==!0&&c.collapsible.nestedCollapsible&&c.collapsible.nestedCollapsible.fields.length>0?(t.openBlock(),t.createBlock(m,{key:3,class:"nested-collapse","model-value":a.collapseStates[`group-${p}-nested`]??!0,"trigger-alignment":"leading","trigger-label":a.collapseStates[`group-${p}-nested`]??!0?c.collapsible.nestedCollapsible.triggerLabel.expand:c.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":f=>a.collapseStates[`group-${p}-nested`]=f},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(e.getFieldRowClasses(c))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.collapsible.nestedCollapsible.fields,f=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:f.model},[f.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(d,{key:0,errors:a.errors,field:f,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onPartialToggled:i.onPartialToggled,onShowNewPartialModal:C=>e.$emit("showNewPartialModal",f.redisType),onValidated:i.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):i.fieldVisible(f)?(t.openBlock(),t.createBlock(l,{key:1,ref_for:!0,ref:"children",errors:a.errors,field:f,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.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},[c.collapsible.description?{name:"visible-content",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:1,class:t.normalizeClass(e.getFieldRowClasses(c))},{default:t.withCtx(()=>[c.legend?(t.openBlock(),t.createElementBlock("legend",Nf,t.toDisplayString(c.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.fields,u=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:u.model},[i.fieldVisible(u)?(t.openBlock(),t.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:a.errors,field:u,model:o.model,options:o.options,vfg:a.vfg,onModelUpdated:i.onModelUpdated,onRefreshModel:i.onRefreshModel,onValidated:i.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=v(Mf,[["render",If]]),_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"},Sr=new Set(["config-client_id","config-client_secret","config-issuer"]),kr=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"]),Of={name:"OIDCForm",components:{VueFormGenerator:Y},provide(){var e;return{[fe]:(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(a=>!a.model.startsWith("config")&&a.model!=="tags")};const n=this.formSchema.fields.reduce((a,i)=>(a[i.model]=i,a),{});this.commonFieldsSchema={fields:Array.from(Sr).reduce((a,i)=>(n[i]&&a.push(n[i]),a),[])},this.authFieldsSchema={fields:Array.from(kr).reduce((a,i)=>(n[i]&&a.push(n[i]),a),[])};const{redis:o,redisModels:r}=ye.useRedisPartial(this.formSchema);this.advancedFieldsSchema={fields:this.formSchema.fields.filter(a=>a.model.startsWith("config")&&a.model!=="config-auth_methods"&&!Sr.has(a.model)&&!kr.has(a.model)&&(!this.enableRedisPartial||!r.includes(a.model))||a.model==="tags").reduce((a,i)=>{var d,l,m,c;switch(i.model){case"config-client_jwk":{if(Array.isArray((l=(d=i.items)==null?void 0:d.schema)==null?void 0:l.fields))for(const p of i.items.schema.fields)p.label=p.model;a.push({...i,link:this.openIdConnectJWKLink,newElementButtonLabel:"+ Add Client JWK",...Array.isArray((c=(m=i.items)==null?void 0:m.schema)==null?void 0:c.fields)&&i.items.schema.fields.map(p=>({...p,label:p.model}))});break}case"config-session_redis_cluster_nodes":{a.push({...i,link:this.openIdConnectClusterNodesLink,newElementButtonLabel:"+ Add Cluster Node"});break}default:a.push(i)}return a},[])},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 a of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const i of a.fields){const d=(e=n[i.model])==null?void 0:e.help;i.help===void 0&&typeof d=="string"&&(i.help=d)}}},getAuthMethodsValue(e,n){const o=[];for(let r=0;r<this.authMethods.length;r++)this.authMethods[r].prop&&this.authMethods[r].value!==e&&o.push(this.authMethods[r].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()}}},Vf={class:"general-settings"},Bf={class:"link-wrapper"},Ff={class:"auth-method-container"},Rf={class:"general-settings"},Df={class:"link-wrapper"},Lf={class:"general-settings"},Uf={class:"link-wrapper"};function Pf(e,n,o,r,a,i){const d=t.resolveComponent("VueFormGenerator"),l=t.resolveComponent("KExternalLink"),m=t.resolveComponent("KLabel"),c=t.resolveComponent("KCheckbox"),p=t.resolveComponent("KInputSwitch"),u=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[o.formModel.id&&o.isEditing||!o.isEditing?(t.openBlock(),t.createBlock(d,{key:0,class:"global-fields",model:o.formModel,options:o.formOptions,schema:a.globalFields,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(u,{tabs:a.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",Vf,[t.createElementVNode("div",Bf,[t.createVNode(l,{href:a.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)),i.displayForm?(t.openBlock(),t.createBlock(d,{key:0,model:o.formModel,options:o.formOptions,schema:a.commonFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(m,null,{default:t.withCtx(()=>n[3]||(n[3]=[t.createTextVNode("Auth Methods")])),_:1}),t.createElementVNode("div",Ff,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.authMethods,h=>(t.openBlock(),t.createElementBlock("div",{key:h.value,class:"auth-method"},[t.createVNode(c,{modelValue:h.prop,"onUpdate:modelValue":M=>h.prop=M,onChange:M=>i.handleUpdate(M,h.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(h.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(p,{modelValue:a.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=h=>a.sessionManagement=h),label:"Enable Session Management",onChange:i.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",Rf,[t.createElementVNode("div",Df,[t.createVNode(l,{href:a.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)),i.displayForm?(t.openBlock(),t.createBlock(d,{key:0,model:o.formModel,options:o.formOptions,schema:a.authFieldsSchema,onModelUpdated:o.onModelUpdated},{"autofill-provider":t.withCtx(h=>[t.renderSlot(e.$slots,"autofill-provider",t.normalizeProps(t.guardReactiveProps(h)),void 0,!0)]),_:3},8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),advanced:t.withCtx(()=>[t.createElementVNode("div",Lf,[t.createElementVNode("div",Uf,[t.createVNode(l,{href:a.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)),i.displayForm?(t.openBlock(),t.createBlock(d,{key:0,"enable-redis-partial":o.enableRedisPartial,"is-editing":o.isEditing,model:o.formModel,options:o.formOptions,schema:a.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 $f=v(Of,[["render",Pf],["__scopeId","data-v-741bf3cb"]]),vf=v(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 d;t.provide(fe,(d=t.useSlots())==null?void 0:d[ze]);const{t:n,te:o}=be.createI18n("en-us",_e),r=e,a=t.computed(()=>r.formModel.id&&r.isEditing||!r.isEditing),i=t.computed(()=>{const l=r.formSchema;return l.fields.map(m=>{const c=`post-function.${m.model}`;return m.hint=o(`${c}.hint`)&&n(`${c}.hint`)||m.hint,m.help=o(`${c}.help`)&&n(`${c}.help`)||m.help,m.newElementButtonLabel=o(`${c}.newElementButtonLabel`)&&n(`${c}.newElementButtonLabel`)||m.newElementButtonLabel,m.model!=="tags"&&(m.valueType==="array"||m.type==="array")&&(m.type="array",m.valueArrayType="array",m.itemContainerComponent="FieldArrayItem",m.fieldClasses="post-function-array-item-container",m.fieldItemsClasses="post-function-array-item",m.inputAttributes={...m.inputAttributes,type:"textarea"}),m}),l});return(l,m)=>a.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-f54f37ae"]]),xf=v(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 d;t.provide(fe,(d=t.useSlots())==null?void 0:d[ze]);const{t:n,te:o}=be.createI18n("en-us",_e),r=e,a=t.computed(()=>r.formModel.id&&r.isEditing||!r.isEditing),i=t.computed(()=>{const l=r.formSchema;return l.fields.map(m=>{const c=`exit-transformer.${m.model}`;return m.hint=o(`${c}.hint`)&&n(`${c}.hint`)||m.hint,m.help=o(`${c}.help`)&&n(`${c}.help`)||m.help,m.newElementButtonLabel=o(`${c}.newElementButtonLabel`)&&n(`${c}.newElementButtonLabel`)||m.newElementButtonLabel,m.model!=="tags"&&(m.valueType==="array"||m.type==="array")&&(m.type="array",m.valueArrayType="array",m.itemContainerComponent="FieldArrayItem",m.fieldClasses="exit-transformer-array-item-container",m.fieldItemsClasses="exit-transformer-array-item",m.inputAttributes={...m.inputAttributes,type:"textarea"}),m}),l});return(l,m)=>a.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:i.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0d5c541f"]]),jf={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}]},zf={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}]},qf={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}]},Kf={class:"general-settings"},Hf={class:"sub-form"},Yf={class:"general-settings"},Gf={class:"sub-form"},Wf={class:"general-settings"},Zf=v(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 A;t.provide(fe,(A=t.useSlots())==null?void 0:A[ze]);const n=e,o=t.ref("zeroSsl"),r=t.ref("shm"),a=t.computed(()=>{var y;const T={};if((y=n.formSchema)!=null&&y.fields)for(const B of n.formSchema.fields)T[B.model]=B;return T}),i=t.computed(()=>{var y;const T=Ae(jf);for(const B of T.fields){const x=(y=a.value[B.model])==null?void 0:y.help;B.help===void 0&&typeof x=="string"&&(B.help=x)}return T}),d=t.computed(()=>{var y;const T=Ae(zf);for(const B of T.fields){const x=(y=a.value[B.model])==null?void 0:y.help;B.help===void 0&&typeof x=="string"&&(B.help=x)}return T}),l=t.computed(()=>{var y;const T=Ae(qf);for(const B of T.fields){const x=(y=a.value[B.model])==null?void 0:y.help;B.help===void 0&&typeof x=="string"&&(B.help=x)}return T}),m=t.computed(()=>({fields:n.formSchema.fields.filter(T=>!T.model.startsWith("config")&&T.model!=="tags")})),c=t.computed(()=>({fields:i.value.fields.filter(y=>!d.value.fields.some(B=>B.model===y.model)&&!l.value.fields.some(B=>B.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"))})),u=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-consul"))})),h=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"))})),R=t.computed(()=>({fields:n.formSchema.fields.filter(y=>y.model.startsWith("config-storage_config-vault"))})),f=t.computed(()=>({fields:n.formSchema.fields.filter(T=>T.model.startsWith("config")&&!c.value.fields.filter(y=>y.model===T.model).length&&!p.value.fields.filter(y=>y.model===T.model).length||T.model==="tags")})),C=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),w=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],O=[{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 g=T=>{o.value=T.value,(T.value==="zeroSsl"||T.value==="other")&&(T.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),T.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()},S=(T,y)=>{y==="config-storage"&&(r.value=T),n.onModelUpdated()};return(T,y)=>{const B=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:m.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(x,{tabs:w},{general:t.withCtx(()=>[t.createElementVNode("div",Kf,[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:c.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(B,{class:"issuer-select",items:O,label:"Issuer",onChange:g}),t.createElementVNode("div",Hf,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:d.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:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),storage:t.withCtx(()=>[t.createElementVNode("div",Yf,[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:S},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",Gf,[r.value==="consul"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:u.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),r.value==="redis"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:h.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),r.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),r.value==="vault"?(t.openBlock(),t.createBlock(Y,{key:3,model:e.formModel,options:e.formOptions,schema:R.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),advanced:t.withCtx(()=>[t.createElementVNode("div",Wf,[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:f.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-07cecf5b"]]),Xf={class:"rla-form-basic-fields"},Jf={class:"rla-form-request-limits-subtitle"},Qf={class:"rla-form-request-limits-content"},eu={class:"rla-form-window-type"},tu=["innerHTML"],nu={class:"rla-form-window-type-radios"},ou={class:"rla-form-request-limits-items"},ru={class:"rla-form-request-limits-row"},au=["id"],iu={class:"rla-form-request-limits-actions"},lu={key:0,class:"rla-form-request-limits-examples"},su={class:"rla-form-request-limits-examples-badges"},du=["innerHTML"],cu={id:"rla-form-error-legend",class:"rla-form-error-inputs"},mu=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:Zf,ExitTransformer:xf,OIDCForm:$f,PostFunction:vf,RLAForm:v(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(fe,(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
3
|
If the limit is exceeded and the user receives a 429 error, each additional request within the sliding window (hour)
|
|
3
|
-
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(y=>`config-${y}`)]),a=y=>y===void 0?!1:o.has(y),{t:r}=ee.createI18n("en-us",te),i=e,s=t.computed(()=>{var V,N,O;const y=(N=(V=i.formSchema)==null?void 0:V.fields)==null?void 0:N.find(H=>H.type==="selectionGroup"&&H.model==="selectionGroup");return{fields:[(O=i.formSchema)==null?void 0:O.fields.find(H=>H.model==="enabled"),y].filter(Boolean)}}),l=t.computed(()=>{var H,Ee;const y=((Ee=(H=i.formSchema)==null?void 0:H.fields)==null?void 0:Ee.filter(z=>!a(z.model)))??[],k=[],V=[],N=[];let O=!1;for(const z of y){const Ne=z.model;if(Ne!==void 0){if(Ne.startsWith("config-redis-")){(z.model==="config-redis-cluster_addresses"||z.model==="config-redis-sentinel_addresses")&&(z.inputAttributes.help=r("rla.redis.address_example")),V.push(z);continue}O?N.push(z):k.push(z),z.model==="config-strategy"&&(O=!0)}}return{endsWithStrategy:{fields:k},redis:i.enableRedisPartial?{fields:[{fields:V,id:"_redis",model:"__redis_partial",redisType:i.formSchema._supported_redis_partial_type}]}:{fields:V},afterStrategy:{fields:N}}}),d=t.computed(()=>{const y=i.formModel["config-window_type"];return Object.prototype.hasOwnProperty.call(n,y)?n[y]:[]}),c=t.computed(()=>{var y,k;return(k=(y=i.formSchema)==null?void 0:y.fields)==null?void 0:k.find(V=>V.model==="config-identifier")}),f=t.computed(()=>{var y,k,V;return(((V=(k=(y=i.formSchema)==null?void 0:y.fields)==null?void 0:k.find(N=>N.model==="config-identifier"))==null?void 0:V.values)??[]).map(N=>({label:r(`rla.identifiers.options.${N}`),value:N}))}),u=t.ref(),h=t.ref(!0),w=t.computed(()=>{var y,k,V;return i.formModel["config-window_type"]??((V=(k=(y=i.formSchema)==null?void 0:y.fields)==null?void 0:k.find(N=>N.model==="config-window_type"))==null?void 0:V.default)}),B=t.computed(()=>{var k,V,N,O,H,Ee;const y=(N=(V=(k=i.formSchema)==null?void 0:k.fields)==null?void 0:V.find(z=>z.model==="config-window_type"))==null?void 0:N.default;return(((Ee=(H=(O=i.formSchema)==null?void 0:O.fields)==null?void 0:H.find(z=>z.model==="config-window_type"))==null?void 0:Ee.values)??[]).sort((z,Ne)=>z===y?-1:Ne===y?1:0)}),m=t.computed(()=>{var k;const y=(k=i.formModel["config-limit"])==null?void 0:k.map((V,N)=>{var O,H;return{limit:V,windowSize:(H=(O=i.formModel)==null?void 0:O["config-window_size"])==null?void 0:H[N]}});return!Array.isArray(y)||y.length===0?[{limit:void 0,windowSize:void 0}]:y}),_=t.computed(()=>{var y,k,V,N;return((y=i.formModel)==null?void 0:y["config-identifier"])??((N=(V=(k=i.formSchema)==null?void 0:k.fields)==null?void 0:V.find(O=>O.model==="config-identifier"))==null?void 0:N.default)}),C=t.computed(()=>{var y,k,V,N;return((y=i.formModel)==null?void 0:y["config-error_code"])??((N=(V=(k=i.formSchema)==null?void 0:k.fields)==null?void 0:V.find(O=>O.model==="config-error_code"))==null?void 0:N.default)}),S=t.computed(()=>{var y,k,V,N;return((y=i.formModel)==null?void 0:y["config-error_message"])??((N=(V=(k=i.formSchema)==null?void 0:k.fields)==null?void 0:V.find(O=>O.model==="config-error_message"))==null?void 0:N.default)}),g=(y,k)=>{if(k===u.value){i.onModelUpdated([],"config-limit"),i.onModelUpdated([],"config-window_size"),t.nextTick(()=>{u.value=void 0});return}i.onModelUpdated([y.config.limit],"config-limit"),i.onModelUpdated([y.config.window_size],"config-window_size"),t.nextTick(()=>{u.value=k})},M=y=>{u.value!==void 0&&(u.value=void 0),y!==null&&i.onModelUpdated(y.toString(),"config-window_type")},E=(y,k)=>{var N;u.value!==void 0&&(u.value=void 0);const V=le(((N=i.formModel)==null?void 0:N["config-limit"])??[]);V[y]=k,i.onModelUpdated(V,"config-limit")},b=(y,k)=>{var N;u.value!==void 0&&(u.value=void 0);const V=le(((N=i.formModel)==null?void 0:N["config-window_size"])??[]);V[y]=k,i.onModelUpdated(V,"config-window_size")},p=y=>{var N,O;u.value!==void 0&&(u.value=void 0);const k=le(((N=i.formModel)==null?void 0:N["config-limit"])??[]),V=le(((O=i.formModel)==null?void 0:O["config-window_size"])??[]);k.length===0&&k.push(void 0),V.length===0&&V.push(void 0),k.splice(y+1,0,void 0),V.splice(y+1,0,void 0),i.onModelUpdated(k,"config-limit"),i.onModelUpdated(V,"config-window_size")},T=y=>{var k,V;if(m.value.length>1){u.value!==void 0&&(u.value=void 0);const N=le(((k=i.formModel)==null?void 0:k["config-limit"])??[]),O=le(((V=i.formModel)==null?void 0:V["config-window_size"])??[]);N.length===0&&N.push(void 0),O.length===0&&O.push(void 0),N.splice(y,1),O.splice(y,1),i.onModelUpdated(N,"config-limit"),i.onModelUpdated(O,"config-window_size")}};return t.watch(()=>i.formModel["config-strategy"],y=>{y!=="redis"&&i.formModel.partials&&i.onModelUpdated(void 0,"partials")}),(y,k)=>{const V=t.resolveComponent("KLabel"),N=t.resolveComponent("KRadio"),O=t.resolveComponent("KInput"),H=t.resolveComponent("KButton"),Ee=t.resolveComponent("KBadge"),z=t.resolveComponent("KTooltip"),Ne=t.resolveComponent("KCard"),Zc=t.resolveComponent("KSelect"),Jc=t.resolveComponent("KCollapse");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Fc,[t.createVNode(L,{model:y.formModel,options:y.formOptions,schema:s.value,onModelUpdated:k[0]||(k[0]=(A,K)=>y.onModelUpdated(A,K))},null,8,["model","options","schema"]),t.createVNode(Ne,{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(r)("rla.request_limits.title")),1)]),_:1}),t.createElementVNode("div",$c,t.toDisplayString(t.unref(r)("rla.request_limits.subtitle")),1)]),default:t.withCtx(()=>[t.createElementVNode("div",Uc,[t.createElementVNode("div",Rc,[t.createVNode(V,{class:"rla-form-window-type-label","tooltip-attributes":{maxWidth:"300",placement:"top"}},{tooltip:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:t.unref(r)("rla.window_type.help")},null,8,Dc)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("rla.window_type.label"))+" ",1)]),_:1}),t.createElementVNode("div",Pc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value,A=>(t.openBlock(),t.createBlock(N,{key:`window-type-${A}`,"model-value":w.value,name:A,"selected-value":A,"onUpdate:modelValue":M},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)(`rla.window_type.options.${A}`)),1)]),_:2},1032,["model-value","name","selected-value"]))),128))])]),t.createElementVNode("div",jc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.value,(A,K)=>(t.openBlock(),t.createElementBlock("div",{key:K.toString()},[t.createVNode(V,{for:`rla-form-request-limits-item-${K}-legend`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("rla.request_limits.label_index",{index:K+1})),1)]),_:2},1032,["for"]),t.createElementVNode("div",Lc,[t.createElementVNode("legend",{id:`rla-form-request-limits-item-${K}-legend`,class:"rla-form-request-limits-inputs"},[t.createVNode(O,{"model-value":A.limit&&A.limit.toString(),placeholder:t.unref(r)("rla.request_limits.request_number"),type:"number","onUpdate:modelValue":ht=>E(K,Number.parseInt(ht))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(r)("rla.request_limits.interval_determiner")),1),t.createVNode(O,{"model-value":A.windowSize&&A.windowSize.toString(),placeholder:t.unref(r)("rla.request_limits.time_interval"),type:"number","onUpdate:modelValue":ht=>b(K,Number.parseInt(ht))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(r)("rla.request_limits.seconds")),1)],8,qc),t.createElementVNode("div",vc,[t.createVNode(H,{appearance:"tertiary",disabled:m.value.length<=1,onClick:()=>T(K)},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.RemoveIcon))]),_:2},1032,["disabled","onClick"]),t.createVNode(H,{appearance:"tertiary",onClick:()=>p(K)},{default:t.withCtx(()=>[t.createVNode(t.unref(oe.AddIcon))]),_:2},1032,["onClick"])])])]))),128))]),d.value.length>0?(t.openBlock(),t.createElementBlock("div",Kc,[t.createElementVNode("div",null,t.toDisplayString(t.unref(r)("rla.start_with_a_use_case")),1),t.createElementVNode("div",zc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,(A,K)=>(t.openBlock(),t.createBlock(z,{key:`use-case-${K}`,"max-width":"300"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(A.description),1),k[10]||(k[10]=t.createElementVNode("br",null,null,-1)),t.createElementVNode("div",null,t.toDisplayString(t.unref(r)("rla.request_limits.label"))+": "+t.toDisplayString(A.config.limit),1),t.createElementVNode("div",null,t.toDisplayString(t.unref(r)("rla.request_limits.time_interval"))+": "+t.toDisplayString(A.config.window_size),1)]),default:t.withCtx(()=>[t.createVNode(Ee,{appearance:u.value===`${w.value}-${K}`?"info":"decorative",class:"rla-form-request-limits-examples-badge",onClick:()=>g(A,`${w.value}-${K}`)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(A.label),1)]),_:2},1032,["appearance","onClick"])]),_:2},1024))),128))])])):t.createCommentVNode("",!0)])]),_:1}),t.createVNode(Zc,{modelValue:_.value,"onUpdate:modelValue":k[1]||(k[1]=A=>_.value=A),class:"rla-form-identifiers",items:f.value,label:t.unref(r)("rla.identifiers.label"),"label-attributes":{tooltipAttributes:{maxWidth:"300",placement:"top"}},required:"",onSelected:k[2]||(k[2]=A=>i.onModelUpdated(A.value,"config-identifier"))},{"label-tooltip":t.withCtx(()=>[t.createElementVNode("div",{innerHTML:c.value&&c.value.help},null,8,xc)]),_:1},8,["modelValue","items","label"]),t.createElementVNode("div",null,[t.createVNode(V,{for:"rla-form-error-legend",info:t.unref(r)("rla.error_message.help"),required:"","tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("rla.error_message.label")),1)]),_:1},8,["info"]),t.createElementVNode("legend",Hc,[t.createVNode(O,{class:"input-error-code","model-value":C.value&&C.value.toString(),placeholder:t.unref(r)("rla.error_message.code_placeholder"),type:"number","onUpdate:modelValue":k[3]||(k[3]=A=>y.onModelUpdated(Number.parseInt(A),"config-error_code"))},null,8,["model-value","placeholder"]),k[11]||(k[11]=t.createElementVNode("div",null,":",-1)),t.createVNode(O,{"model-value":S.value,placeholder:t.unref(r)("rla.error_message.message_placeholder"),"onUpdate:modelValue":k[4]||(k[4]=A=>y.onModelUpdated(A,"config-error_message"))},null,8,["model-value","placeholder"])])])]),t.createVNode(Jc,{modelValue:h.value,"onUpdate:modelValue":k[9]||(k[9]=A=>h.value=A),"trigger-label":t.unref(r)("rla.view_advanced_fields")},{default:t.withCtx(()=>[t.createVNode(L,{model:y.formModel,options:y.formOptions,schema:l.value.endsWithStrategy,onModelUpdated:k[5]||(k[5]=(A,K)=>y.onModelUpdated(A,K))},null,8,["model","options","schema"]),y.formModel["config-strategy"]==="redis"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(y.enableRedisPartial?"div":"KCard"),{key:0,class:"rla-form-redis-card",title:t.unref(r)("rla.redis.title")},{default:t.withCtx(()=>[t.createVNode(L,{"enable-redis-partial":y.enableRedisPartial,"is-editing":y.isEditing,model:y.formModel,options:y.formOptions,schema:l.value.redis,onModelUpdated:k[6]||(k[6]=(A,K)=>y.onModelUpdated(A,K)),onPartialToggled:y.onPartialToggled,onShowNewPartialModal:k[7]||(k[7]=()=>y.showNewPartialModal(y.formSchema._supported_redis_partial_type))},null,8,["enable-redis-partial","is-editing","model","options","schema","onPartialToggled"])]),_:1},8,["title"])):t.createCommentVNode("",!0),t.createVNode(L,{class:t.normalizeClass({"rla-last-vfg":y.formModel["config-strategy"]!=="redis"}),model:y.formModel,options:y.formOptions,schema:l.value.afterStrategy,onModelUpdated:k[8]||(k[8]=(A,K)=>y.onModelUpdated(A,K))},null,8,["class","model","options","schema"])]),_:1},8,["modelValue","trigger-label"])],64)}}}),[["__scopeId","data-v-f6dcb65c"]])},Symbol.toStringTag,{value:"Module"})),Gc=["array","metric","advanced","selectionGroup","object-advanced"],Wc=e=>({"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer","rate-limiting-advanced":"RLAForm"})[e];I.AUTOFILL_SLOT=Z,I.AUTOFILL_SLOT_NAME=be,I.FORMS_API_KEY=ue,I.FORMS_CONFIG=Rt,I.PartialType=Re,I.REDIS_PARTIAL_FETCHER_KEY=Dt,I.REDIS_PARTIAL_INFO=oa,I.VueFormGenerator=L,I.abstractField=Gl,I.composables=X,I.customFields=Gc,I.getSharedFormName=Wc,I.sharedForms=Yc,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|
|
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(E=>`config-${E}`)]),r=E=>E===void 0?!1:o.has(E),{t:a}=be.createI18n("en-us",_e),i=e,d=t.computed(()=>{var V,F,U;const E=(F=(V=i.formSchema)==null?void 0:V.fields)==null?void 0:F.find(ee=>ee.type==="selectionGroup"&&ee.model==="selectionGroup");return{fields:[(U=i.formSchema)==null?void 0:U.fields.find(ee=>ee.model==="enabled"),E].filter(Boolean)}}),l=t.computed(()=>{var ee,Ne;const E=((Ne=(ee=i.formSchema)==null?void 0:ee.fields)==null?void 0:Ne.filter(J=>!r(J.model)))??[],_=[],V=[],F=[];let U=!1;for(const J of E){const Ie=J.model;if(Ie!==void 0){if(Ie.startsWith("config-redis-")){(J.model==="config-redis-cluster_addresses"||J.model==="config-redis-sentinel_addresses")&&(J.inputAttributes.help=a("rla.redis.address_example")),V.push(J);continue}U?F.push(J):_.push(J),J.model==="config-strategy"&&(U=!0)}}return{endsWithStrategy:{fields:_},redis:i.enableRedisPartial?{fields:[{fields:V,id:"_redis",model:"__redis_partial",redisType:i.formSchema._supported_redis_partial_type}]}:{fields:V},afterStrategy:{fields:F}}}),m=t.computed(()=>{const E=i.formModel["config-window_type"];return Object.prototype.hasOwnProperty.call(n,E)?n[E]:[]}),c=t.computed(()=>{var E,_;return(_=(E=i.formSchema)==null?void 0:E.fields)==null?void 0:_.find(V=>V.model==="config-identifier")}),p=t.computed(()=>{var E,_,V;return(((V=(_=(E=i.formSchema)==null?void 0:E.fields)==null?void 0:_.find(F=>F.model==="config-identifier"))==null?void 0:V.values)??[]).map(F=>({label:a(`rla.identifiers.options.${F}`),value:F}))}),u=t.ref(),h=t.ref(!0),M=t.computed(()=>{var E,_,V;return i.formModel["config-window_type"]??((V=(_=(E=i.formSchema)==null?void 0:E.fields)==null?void 0:_.find(F=>F.model==="config-window_type"))==null?void 0:V.default)}),R=t.computed(()=>{var _,V,F,U,ee,Ne;const E=(F=(V=(_=i.formSchema)==null?void 0:_.fields)==null?void 0:V.find(J=>J.model==="config-window_type"))==null?void 0:F.default;return(((Ne=(ee=(U=i.formSchema)==null?void 0:U.fields)==null?void 0:ee.find(J=>J.model==="config-window_type"))==null?void 0:Ne.values)??[]).sort((J,Ie)=>J===E?-1:Ie===E?1:0)}),f=t.computed(()=>{var _;const E=(_=i.formModel["config-limit"])==null?void 0:_.map((V,F)=>{var U,ee;return{limit:V,windowSize:(ee=(U=i.formModel)==null?void 0:U["config-window_size"])==null?void 0:ee[F]}});return!Array.isArray(E)||E.length===0?[{limit:void 0,windowSize:void 0}]:E}),C=t.computed(()=>{var E,_,V,F;return((E=i.formModel)==null?void 0:E["config-identifier"])??((F=(V=(_=i.formSchema)==null?void 0:_.fields)==null?void 0:V.find(U=>U.model==="config-identifier"))==null?void 0:F.default)}),w=t.computed(()=>{var E,_,V,F;return((E=i.formModel)==null?void 0:E["config-error_code"])??((F=(V=(_=i.formSchema)==null?void 0:_.fields)==null?void 0:V.find(U=>U.model==="config-error_code"))==null?void 0:F.default)}),O=t.computed(()=>{var E,_,V,F;return((E=i.formModel)==null?void 0:E["config-error_message"])??((F=(V=(_=i.formSchema)==null?void 0:_.fields)==null?void 0:V.find(U=>U.model==="config-error_message"))==null?void 0:F.default)}),g=(E,_)=>{if(_===u.value){i.onModelUpdated([],"config-limit"),i.onModelUpdated([],"config-window_size"),t.nextTick(()=>{u.value=void 0});return}i.onModelUpdated([E.config.limit],"config-limit"),i.onModelUpdated([E.config.window_size],"config-window_size"),t.nextTick(()=>{u.value=_})},S=E=>{u.value!==void 0&&(u.value=void 0),E!==null&&i.onModelUpdated(E.toString(),"config-window_type")},A=(E,_)=>{var F;u.value!==void 0&&(u.value=void 0);const V=Ae(((F=i.formModel)==null?void 0:F["config-limit"])??[]);V[E]=_,i.onModelUpdated(V,"config-limit")},T=(E,_)=>{var F;u.value!==void 0&&(u.value=void 0);const V=Ae(((F=i.formModel)==null?void 0:F["config-window_size"])??[]);V[E]=_,i.onModelUpdated(V,"config-window_size")},y=E=>{var F,U;u.value!==void 0&&(u.value=void 0);const _=Ae(((F=i.formModel)==null?void 0:F["config-limit"])??[]),V=Ae(((U=i.formModel)==null?void 0:U["config-window_size"])??[]);_.length===0&&_.push(void 0),V.length===0&&V.push(void 0),_.splice(E+1,0,void 0),V.splice(E+1,0,void 0),i.onModelUpdated(_,"config-limit"),i.onModelUpdated(V,"config-window_size")},B=E=>{var _,V;if(f.value.length>1){u.value!==void 0&&(u.value=void 0);const F=Ae(((_=i.formModel)==null?void 0:_["config-limit"])??[]),U=Ae(((V=i.formModel)==null?void 0:V["config-window_size"])??[]);F.length===0&&F.push(void 0),U.length===0&&U.push(void 0),F.splice(E,1),U.splice(E,1),i.onModelUpdated(F,"config-limit"),i.onModelUpdated(U,"config-window_size")}};return t.watch(()=>i.formModel["config-strategy"],E=>{E!=="redis"&&i.formModel.partials&&i.onModelUpdated(void 0,"partials")}),(E,_)=>{const V=t.resolveComponent("KLabel"),F=t.resolveComponent("KRadio"),U=t.resolveComponent("KInput"),ee=t.resolveComponent("KButton"),Ne=t.resolveComponent("KBadge"),J=t.resolveComponent("KTooltip"),Ie=t.resolveComponent("KCard"),_n=t.resolveComponent("KSelect"),xt=t.resolveComponent("KCollapse");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Xf,[t.createVNode(Y,{model:E.formModel,options:E.formOptions,schema:d.value,onModelUpdated:_[0]||(_[0]=(I,H)=>E.onModelUpdated(I,H))},null,8,["model","options","schema"]),t.createVNode(Ie,{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(a)("rla.request_limits.title")),1)]),_:1}),t.createElementVNode("div",Jf,t.toDisplayString(t.unref(a)("rla.request_limits.subtitle")),1)]),default:t.withCtx(()=>[t.createElementVNode("div",Qf,[t.createElementVNode("div",eu,[t.createVNode(V,{class:"rla-form-window-type-label","tooltip-attributes":{maxWidth:"300",placement:"top"}},{tooltip:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:t.unref(a)("rla.window_type.help")},null,8,tu)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.window_type.label"))+" ",1)]),_:1}),t.createElementVNode("div",nu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R.value,I=>(t.openBlock(),t.createBlock(F,{key:`window-type-${I}`,"model-value":M.value,name:I,"selected-value":I,"onUpdate:modelValue":S},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)(`rla.window_type.options.${I}`)),1)]),_:2},1032,["model-value","name","selected-value"]))),128))])]),t.createElementVNode("div",ou,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,(I,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(a)("rla.request_limits.label_index",{index:H+1})),1)]),_:2},1032,["for"]),t.createElementVNode("div",ru,[t.createElementVNode("legend",{id:`rla-form-request-limits-item-${H}-legend`,class:"rla-form-request-limits-inputs"},[t.createVNode(U,{"model-value":I.limit&&I.limit.toString(),placeholder:t.unref(a)("rla.request_limits.request_number"),type:"number","onUpdate:modelValue":Z=>A(H,Number.parseInt(Z))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.interval_determiner")),1),t.createVNode(U,{"model-value":I.windowSize&&I.windowSize.toString(),placeholder:t.unref(a)("rla.request_limits.time_interval"),type:"number","onUpdate:modelValue":Z=>T(H,Number.parseInt(Z))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.seconds")),1)],8,au),t.createElementVNode("div",iu,[t.createVNode(ee,{appearance:"tertiary",disabled:f.value.length<=1,onClick:()=>B(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))]),m.value.length>0?(t.openBlock(),t.createElementBlock("div",lu,[t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.start_with_a_use_case")),1),t.createElementVNode("div",su,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.value,(I,H)=>(t.openBlock(),t.createBlock(J,{key:`use-case-${H}`,"max-width":"300"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(I.description),1),_[10]||(_[10]=t.createElementVNode("br",null,null,-1)),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.label"))+": "+t.toDisplayString(I.config.limit),1),t.createElementVNode("div",null,t.toDisplayString(t.unref(a)("rla.request_limits.time_interval"))+": "+t.toDisplayString(I.config.window_size),1)]),default:t.withCtx(()=>[t.createVNode(Ne,{appearance:u.value===`${M.value}-${H}`?"info":"decorative",class:"rla-form-request-limits-examples-badge",onClick:()=>g(I,`${M.value}-${H}`)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(I.label),1)]),_:2},1032,["appearance","onClick"])]),_:2},1024))),128))])])):t.createCommentVNode("",!0)])]),_:1}),t.createVNode(_n,{modelValue:C.value,"onUpdate:modelValue":_[1]||(_[1]=I=>C.value=I),class:"rla-form-identifiers",items:p.value,label:t.unref(a)("rla.identifiers.label"),"label-attributes":{tooltipAttributes:{maxWidth:"300",placement:"top"}},required:"",onSelected:_[2]||(_[2]=I=>i.onModelUpdated(I.value,"config-identifier"))},{"label-tooltip":t.withCtx(()=>[t.createElementVNode("div",{innerHTML:c.value&&c.value.help},null,8,du)]),_:1},8,["modelValue","items","label"]),t.createElementVNode("div",null,[t.createVNode(V,{for:"rla-form-error-legend",info:t.unref(a)("rla.error_message.help"),required:"","tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("rla.error_message.label")),1)]),_:1},8,["info"]),t.createElementVNode("legend",cu,[t.createVNode(U,{class:"input-error-code","model-value":w.value&&w.value.toString(),placeholder:t.unref(a)("rla.error_message.code_placeholder"),type:"number","onUpdate:modelValue":_[3]||(_[3]=I=>E.onModelUpdated(Number.parseInt(I),"config-error_code"))},null,8,["model-value","placeholder"]),_[11]||(_[11]=t.createElementVNode("div",null,":",-1)),t.createVNode(U,{"model-value":O.value,placeholder:t.unref(a)("rla.error_message.message_placeholder"),"onUpdate:modelValue":_[4]||(_[4]=I=>E.onModelUpdated(I,"config-error_message"))},null,8,["model-value","placeholder"])])])]),t.createVNode(xt,{modelValue:h.value,"onUpdate:modelValue":_[9]||(_[9]=I=>h.value=I),"trigger-label":t.unref(a)("rla.view_advanced_fields")},{default:t.withCtx(()=>[t.createVNode(Y,{model:E.formModel,options:E.formOptions,schema:l.value.endsWithStrategy,onModelUpdated:_[5]||(_[5]=(I,H)=>E.onModelUpdated(I,H))},null,8,["model","options","schema"]),E.formModel["config-strategy"]==="redis"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(E.enableRedisPartial?"div":"KCard"),{key:0,class:"rla-form-redis-card",title:t.unref(a)("rla.redis.title")},{default:t.withCtx(()=>[t.createVNode(Y,{"enable-redis-partial":E.enableRedisPartial,"is-editing":E.isEditing,model:E.formModel,options:E.formOptions,schema:l.value.redis,onModelUpdated:_[6]||(_[6]=(I,H)=>E.onModelUpdated(I,H)),onPartialToggled:E.onPartialToggled,onShowNewPartialModal:_[7]||(_[7]=()=>E.showNewPartialModal(E.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":E.formModel["config-strategy"]!=="redis"}),model:E.formModel,options:E.formOptions,schema:l.value.afterStrategy,onModelUpdated:_[8]||(_[8]=(I,H)=>E.onModelUpdated(I,H))},null,8,["class","model","options","schema"])]),_:1},8,["modelValue","trigger-label"])],64)}}}),[["__scopeId","data-v-f6dcb65c"]])},Symbol.toStringTag,{value:"Module"})),fu=["array","metric","advanced","selectionGroup","object-advanced"],uu=e=>({"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer","rate-limiting-advanced":"RLAForm"})[e];L.AUTOFILL_SLOT=fe,L.AUTOFILL_SLOT_NAME=ze,L.FORMS_API_KEY=Ue,L.FORMS_CONFIG=Jn,L.PartialType=bt,L.REDIS_PARTIAL_FETCHER_KEY=Qn,L.REDIS_PARTIAL_INFO=el,L.VueFormGenerator=Y,L.abstractField=uc,L.composables=ye,L.customFields=fu,L.getSharedFormName=uu,L.sharedForms=mu,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|