@danielgindi/selectbox 1.0.135 → 1.0.137

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @danielgindi/selectbox 1.0.135
2
+ * @danielgindi/selectbox 1.0.137
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
- "use strict";var e=require("@danielgindi/dom-utils/lib/Dom"),t=require("@danielgindi/dom-utils/lib/DomCompat"),s=require("@danielgindi/dom-utils/lib/Css"),i=require("@danielgindi/dom-utils/lib/DomEventsSink"),r=require("@danielgindi/virtual-list-helper"),n=require("keycode-js"),l=require("mitt"),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=function(e){return e&&e.Math===Math&&e},u=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof o&&o)||a("object"==typeof o&&o)||function(){return this}()||Function("return this")(),c="object"==typeof document&&document.all,d=void 0===c&&void 0!==c?function(e){return"function"==typeof e||e===c}:function(e){return"function"==typeof e},h=d,m=function(e){return"object"==typeof e?null!==e:h(e)},p=m,_=u.document,f=p(_)&&p(_.createElement),g=function(e){return f?_.createElement(e):{}},b=g("span").classList,I=b&&b.constructor&&b.constructor.prototype,v=I===Object.prototype?void 0:I,y=function(e){try{return!!e()}catch(e){return!0}},S=!y((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),E=S,L=Function.prototype,C=L.call,w=E&&L.bind.bind(C,C),k=E?w:function(e){return function(){return C.apply(e,arguments)}},x=k,T=x({}.toString),P=x("".slice),O=function(e){return P(T(e),8,-1)},A=y,N=O,V=Object,M=k("".split),F=A((function(){return!V("z").propertyIsEnumerable(0)}))?function(e){return"String"===N(e)?M(e,""):V(e)}:V,W=function(e){return null==e},B=W,D=TypeError,R=function(e){if(B(e))throw new D("Can't call method on "+e);return e},U=F,H=R,G=function(e){return U(H(e))},z={exports:{}},j=u,K=Object.defineProperty,$=function(e,t){try{K(j,e,{value:t,configurable:!0,writable:!0})}catch(s){j[e]=t}return t},q=(z.exports,u),Q=$,Y="__core-js_shared__",X=z.exports=q[Y]||Q(Y,{});(X.versions||(X.versions=[])).push({version:"3.36.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",source:"https://github.com/zloirock/core-js"});var J,Z,ee=z.exports,te=ee,se=function(e,t){return te[e]||(te[e]=t||{})},ie=R,re=Object,ne=function(e){return re(ie(e))},le=ne,oe=k({}.hasOwnProperty),ae=Object.hasOwn||function(e,t){return oe(le(e),t)},ue=k,ce=0,de=Math.random(),he=ue(1..toString),me=function(e){return"Symbol("+(void 0===e?"":e)+")_"+he(++ce+de,36)},pe=u,_e="undefined"!=typeof navigator&&String(navigator.userAgent)||"",fe=pe.process,ge=pe.Deno,be=fe&&fe.versions||ge&&ge.version,Ie=be&&be.v8;Ie&&(Z=(J=Ie.split("."))[0]>0&&J[0]<4?1:+(J[0]+J[1])),!Z&&_e&&(!(J=_e.match(/Edge\/(\d+)/))||J[1]>=74)&&(J=_e.match(/Chrome\/(\d+)/))&&(Z=+J[1]);var ve,ye=Z,Se=y,Ee=u.String,Le=!!Object.getOwnPropertySymbols&&!Se((function(){var e=Symbol("symbol detection");return!Ee(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ye&&ye<41})),Ce=Le&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,we=se,ke=ae,xe=me,Te=Le,Pe=Ce,Oe=u.Symbol,Ae=we("wks"),Ne=Pe?Oe.for||Oe:Oe&&Oe.withoutSetter||xe,Ve=function(e){return ke(Ae,e)||(Ae[e]=Te&&ke(Oe,e)?Oe[e]:Ne("Symbol."+e)),Ae[e]},Me=m,Fe=String,We=TypeError,Be=function(e){if(Me(e))return e;throw new We(Fe(e)+" is not an object")},De={},Re=!y((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),Ue=Re&&y((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),He={},Ge=g,ze=!Re&&!y((function(){return 7!==Object.defineProperty(Ge("div"),"a",{get:function(){return 7}}).a})),je=S,Ke=Function.prototype.call,$e=je?Ke.bind(Ke):function(){return Ke.apply(Ke,arguments)},qe=u,Qe=d,Ye=function(e,t){return arguments.length<2?(s=qe[e],Qe(s)?s:void 0):qe[e]&&qe[e][t];var s},Xe=k({}.isPrototypeOf),Je=Ye,Ze=d,et=Xe,tt=Object,st=Ce?function(e){return"symbol"==typeof e}:function(e){var t=Je("Symbol");return Ze(t)&&et(t.prototype,tt(e))},it=String,rt=d,nt=function(e){try{return it(e)}catch(e){return"Object"}},lt=TypeError,ot=function(e){if(rt(e))return e;throw new lt(nt(e)+" is not a function")},at=ot,ut=W,ct=function(e,t){var s=e[t];return ut(s)?void 0:at(s)},dt=$e,ht=d,mt=m,pt=TypeError,_t=$e,ft=m,gt=st,bt=ct,It=function(e,t){var s,i;if("string"===t&&ht(s=e.toString)&&!mt(i=dt(s,e)))return i;if(ht(s=e.valueOf)&&!mt(i=dt(s,e)))return i;if("string"!==t&&ht(s=e.toString)&&!mt(i=dt(s,e)))return i;throw new pt("Can't convert object to primitive value")},vt=TypeError,yt=Ve("toPrimitive"),St=function(e,t){if(!ft(e)||gt(e))return e;var s,i=bt(e,yt);if(i){if(void 0===t&&(t="default"),s=_t(i,e,t),!ft(s)||gt(s))return s;throw new vt("Can't convert object to primitive value")}return void 0===t&&(t="number"),It(e,t)},Et=st,Lt=function(e){var t=St(e,"string");return Et(t)?t:t+""},Ct=Re,wt=ze,kt=Ue,xt=Be,Tt=Lt,Pt=TypeError,Ot=Object.defineProperty,At=Object.getOwnPropertyDescriptor,Nt="enumerable",Vt="configurable",Mt="writable",Ft=(He.f=Ct?kt?function(e,t,s){if(xt(e),t=Tt(t),xt(s),"function"==typeof e&&"prototype"===t&&"value"in s&&Mt in s&&!s[Mt]){var i=At(e,t);i&&i[Mt]&&(e[t]=s.value,s={configurable:Vt in s?s[Vt]:i[Vt],enumerable:Nt in s?s[Nt]:i[Nt],writable:!1})}return Ot(e,t,s)}:Ot:function(e,t,s){if(xt(e),t=Tt(t),xt(s),wt)try{return Ot(e,t,s)}catch(e){}if("get"in s||"set"in s)throw new Pt("Accessors not supported");return"value"in s&&(e[t]=s.value),e},Math.ceil),Wt=Math.floor,Bt=Math.trunc||function(e){var t=+e;return(t>0?Wt:Ft)(t)},Dt=function(e){var t=+e;return t!=t||0===t?0:Bt(t)},Rt=Dt,Ut=Math.max,Ht=Math.min,Gt=Dt,zt=Math.min,jt=function(e){var t=Gt(e);return t>0?zt(t,9007199254740991):0},Kt=jt,$t=G,qt=function(e,t){var s=Rt(e);return s<0?Ut(s+t,0):Ht(s,t)},Qt=function(e){return Kt(e.length)},Yt=function(e){return function(t,s,i){var r=$t(t),n=Qt(r);if(0===n)return!e&&-1;var l,o=qt(i,n);if(e&&s!=s){for(;n>o;)if((l=r[o++])!=l)return!0}else for(;n>o;o++)if((e||o in r)&&r[o]===s)return e||o||0;return!e&&-1}},Xt={includes:Yt(!0),indexOf:Yt(!1)},Jt={},Zt=ae,es=G,ts=Xt.indexOf,ss=Jt,is=k([].push),rs=function(e,t){var s,i=es(e),r=0,n=[];for(s in i)!Zt(ss,s)&&Zt(i,s)&&is(n,s);for(;t.length>r;)Zt(i,s=t[r++])&&(~ts(n,s)||is(n,s));return n},ns=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ls=rs,os=ns,as=Object.keys||function(e){return ls(e,os)},us=Re,cs=Ue,ds=He,hs=Be,ms=G,ps=as,_s=(De.f=us&&!cs?Object.defineProperties:function(e,t){hs(e);for(var s,i=ms(t),r=ps(t),n=r.length,l=0;n>l;)ds.f(e,s=r[l++],i[s]);return e},Ye("document","documentElement")),fs=me,gs=se("keys"),bs=function(e){return gs[e]||(gs[e]=fs(e))},Is=Be,vs=De,ys=ns,Ss=Jt,Es=_s,Ls=g,Cs="prototype",ws="script",ks=bs("IE_PROTO"),xs=function(){},Ts=function(e){return"<"+ws+">"+e+"</"+ws+">"},Ps=function(e){e.write(Ts("")),e.close();var t=e.parentWindow.Object;return e=null,t},Os=function(){try{ve=new ActiveXObject("htmlfile")}catch(e){}var e,t,s;Os="undefined"!=typeof document?document.domain&&ve?Ps(ve):(t=Ls("iframe"),s="java"+ws+":",t.style.display="none",Es.appendChild(t),t.src=String(s),(e=t.contentWindow.document).open(),e.write(Ts("document.F=Object")),e.close(),e.F):Ps(ve);for(var i=ys.length;i--;)delete Os[Cs][ys[i]];return Os()};Ss[ks]=!0;var As=Object.create||function(e,t){var s;return null!==e?(xs[Cs]=Is(e),s=new xs,xs[Cs]=null,s[ks]=e):s=Os(),void 0===t?s:vs.f(s,t)},Ns=Ve,Vs=As,Ms=He.f,Fs=Ns("unscopables"),Ws=Array.prototype;void 0===Ws[Fs]&&Ms(Ws,Fs,{configurable:!0,value:Vs(null)});var Bs,Ds,Rs,Us={},Hs=d,Gs=u.WeakMap,zs=Hs(Gs)&&/native code/.test(String(Gs)),js=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ks=He,$s=js,qs=Re?function(e,t,s){return Ks.f(e,t,$s(1,s))}:function(e,t,s){return e[t]=s,e},Qs=zs,Ys=u,Xs=m,Js=qs,Zs=ae,ei=ee,ti=bs,si=Jt,ii="Object already initialized",ri=Ys.TypeError,ni=Ys.WeakMap;if(Qs||ei.state){var li=ei.state||(ei.state=new ni);li.get=li.get,li.has=li.has,li.set=li.set,Bs=function(e,t){if(li.has(e))throw new ri(ii);return t.facade=e,li.set(e,t),t},Ds=function(e){return li.get(e)||{}},Rs=function(e){return li.has(e)}}else{var oi=ti("state");si[oi]=!0,Bs=function(e,t){if(Zs(e,oi))throw new ri(ii);return t.facade=e,Js(e,oi,t),t},Ds=function(e){return Zs(e,oi)?e[oi]:{}},Rs=function(e){return Zs(e,oi)}}var ai={set:Bs,get:Ds,has:Rs,enforce:function(e){return Rs(e)?Ds(e):Bs(e,{})},getterFor:function(e){return function(t){var s;if(!Xs(t)||(s=Ds(t)).type!==e)throw new ri("Incompatible receiver, "+e+" required");return s}}},ui={},ci={},di={}.propertyIsEnumerable,hi=Object.getOwnPropertyDescriptor,mi=hi&&!di.call({1:2},1),pi=(ci.f=mi?function(e){var t=hi(this,e);return!!t&&t.enumerable}:di,Re),_i=$e,fi=ci,gi=js,bi=G,Ii=Lt,vi=ae,yi=ze,Si=Object.getOwnPropertyDescriptor,Ei=(ui.f=pi?Si:function(e,t){if(e=bi(e),t=Ii(t),yi)try{return Si(e,t)}catch(e){}if(vi(e,t))return gi(!_i(fi.f,e,t),e[t])},{exports:{}}),Li=Re,Ci=ae,wi=Function.prototype,ki=Li&&Object.getOwnPropertyDescriptor,xi=Ci(wi,"name"),Ti={EXISTS:xi,PROPER:xi&&"something"===function(){}.name,CONFIGURABLE:xi&&(!Li||Li&&ki(wi,"name").configurable)},Pi=d,Oi=ee,Ai=k(Function.toString);Pi(Oi.inspectSource)||(Oi.inspectSource=function(e){return Ai(e)});var Ni=Oi.inspectSource,Vi=(Ei.exports,k),Mi=y,Fi=d,Wi=ae,Bi=Re,Di=Ti.CONFIGURABLE,Ri=Ni,Ui=ai.enforce,Hi=ai.get,Gi=String,zi=Object.defineProperty,ji=Vi("".slice),Ki=Vi("".replace),$i=Vi([].join),qi=Bi&&!Mi((function(){return 8!==zi((function(){}),"length",{value:8}).length})),Qi=String(String).split("String"),Yi=Ei.exports=function(e,t,s){"Symbol("===ji(Gi(t),0,7)&&(t="["+Ki(Gi(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),s&&s.getter&&(t="get "+t),s&&s.setter&&(t="set "+t),(!Wi(e,"name")||Di&&e.name!==t)&&(Bi?zi(e,"name",{value:t,configurable:!0}):e.name=t),qi&&s&&Wi(s,"arity")&&e.length!==s.arity&&zi(e,"length",{value:s.arity});try{s&&Wi(s,"constructor")&&s.constructor?Bi&&zi(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=Ui(e);return Wi(i,"source")||(i.source=$i(Qi,"string"==typeof t?t:"")),e};Function.prototype.toString=Yi((function(){return Fi(this)&&Hi(this).source||Ri(this)}),"toString");var Xi,Ji,Zi,er=Ei.exports,tr=d,sr=He,ir=er,rr=$,nr=function(e,t,s,i){i||(i={});var r=i.enumerable,n=void 0!==i.name?i.name:t;if(tr(s)&&ir(s,n,i),i.global)r?e[t]=s:rr(t,s);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=s:sr.f(e,t,{value:s,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},lr={},or=rs,ar=ns.concat("length","prototype"),ur=(lr.f=Object.getOwnPropertyNames||function(e){return or(e,ar)},{}),cr=(ur.f=Object.getOwnPropertySymbols,Ye),dr=lr,hr=ur,mr=Be,pr=k([].concat),_r=cr("Reflect","ownKeys")||function(e){var t=dr.f(mr(e)),s=hr.f;return s?pr(t,s(e)):t},fr=ae,gr=_r,br=ui,Ir=He,vr=y,yr=d,Sr=/#|\.prototype\./,Er=function(e,t){var s=Cr[Lr(e)];return s===kr||s!==wr&&(yr(t)?vr(t):!!t)},Lr=Er.normalize=function(e){return String(e).replace(Sr,".").toLowerCase()},Cr=Er.data={},wr=Er.NATIVE="N",kr=Er.POLYFILL="P",xr=Er,Tr=u,Pr=ui.f,Or=qs,Ar=nr,Nr=$,Vr=function(e,t,s){for(var i=gr(t),r=Ir.f,n=br.f,l=0;l<i.length;l++){var o=i[l];fr(e,o)||s&&fr(s,o)||r(e,o,n(t,o))}},Mr=xr,Fr=function(e,t){var s,i,r,n,l,o=e.target,a=e.global,u=e.stat;if(s=a?Tr:u?Tr[o]||Nr(o,{}):Tr[o]&&Tr[o].prototype)for(i in t){if(n=t[i],r=e.dontCallGetSet?(l=Pr(s,i))&&l.value:s[i],!Mr(a?i:o+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof n==typeof r)continue;Vr(n,r)}(e.sham||r&&r.sham)&&Or(n,"sham",!0),Ar(s,i,n,e)}},Wr=!y((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Br=ae,Dr=d,Rr=ne,Ur=Wr,Hr=bs("IE_PROTO"),Gr=Object,zr=Gr.prototype,jr=Ur?Gr.getPrototypeOf:function(e){var t=Rr(e);if(Br(t,Hr))return t[Hr];var s=t.constructor;return Dr(s)&&t instanceof s?s.prototype:t instanceof Gr?zr:null},Kr=y,$r=d,qr=m,Qr=jr,Yr=nr,Xr=Ve("iterator"),Jr=!1;[].keys&&("next"in(Zi=[].keys())?(Ji=Qr(Qr(Zi)))!==Object.prototype&&(Xi=Ji):Jr=!0);var Zr=!qr(Xi)||Kr((function(){var e={};return Xi[Xr].call(e)!==e}));Zr&&(Xi={}),$r(Xi[Xr])||Yr(Xi,Xr,(function(){return this}));var en={IteratorPrototype:Xi,BUGGY_SAFARI_ITERATORS:Jr},tn=He.f,sn=ae,rn=Ve("toStringTag"),nn=function(e,t,s){e&&!s&&(e=e.prototype),e&&!sn(e,rn)&&tn(e,rn,{configurable:!0,value:t})},ln=en.IteratorPrototype,on=As,an=js,un=nn,cn=Us,dn=function(){return this},hn=k,mn=ot,pn=m,_n=function(e){return pn(e)||null===e},fn=String,gn=TypeError,bn=function(e,t,s){try{return hn(mn(Object.getOwnPropertyDescriptor(e,t)[s]))}catch(e){}},In=m,vn=R,yn=function(e){if(_n(e))return e;throw new gn("Can't set "+fn(e)+" as a prototype")},Sn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,s={};try{(e=bn(Object.prototype,"__proto__","set"))(s,[]),t=s instanceof Array}catch(e){}return function(s,i){return vn(s),yn(i),In(s)?(t?e(s,i):s.__proto__=i,s):s}}():void 0),En=Fr,Ln=$e,Cn=d,wn=function(e,t,s,i){var r=t+" Iterator";return e.prototype=on(ln,{next:an(+!i,s)}),un(e,r,!1,!0),cn[r]=dn,e},kn=jr,xn=Sn,Tn=nn,Pn=qs,On=nr,An=Us,Nn=Ti.PROPER,Vn=Ti.CONFIGURABLE,Mn=en.IteratorPrototype,Fn=en.BUGGY_SAFARI_ITERATORS,Wn=Ve("iterator"),Bn="keys",Dn="values",Rn="entries",Un=function(){return this},Hn=G,Gn=function(e){Ws[Fs][e]=!0},zn=Us,jn=ai,Kn=He.f,$n=function(e,t,s,i,r,n,l){wn(s,t,i);var o,a,u,c=function(e){if(e===r&&_)return _;if(!Fn&&e&&e in m)return m[e];switch(e){case Bn:case Dn:case Rn:return function(){return new s(this,e)}}return function(){return new s(this)}},d=t+" Iterator",h=!1,m=e.prototype,p=m[Wn]||m["@@iterator"]||r&&m[r],_=!Fn&&p||c(r),f="Array"===t&&m.entries||p;if(f&&(o=kn(f.call(new e)))!==Object.prototype&&o.next&&(kn(o)!==Mn&&(xn?xn(o,Mn):Cn(o[Wn])||On(o,Wn,Un)),Tn(o,d,!0,!0)),Nn&&r===Dn&&p&&p.name!==Dn&&(Vn?Pn(m,"name",Dn):(h=!0,_=function(){return Ln(p,this)})),r)if(a={values:c(Dn),keys:n?_:c(Bn),entries:c(Rn)},l)for(u in a)(Fn||h||!(u in m))&&On(m,u,a[u]);else En({target:t,proto:!0,forced:Fn||h},a);return m[Wn]!==_&&On(m,Wn,_,{name:r}),An[t]=_,a},qn=function(e,t){return{value:e,done:t}},Qn=Re,Yn="Array Iterator",Xn=jn.set,Jn=jn.getterFor(Yn),Zn=$n(Array,"Array",(function(e,t){Xn(this,{type:Yn,target:Hn(e),index:0,kind:t})}),(function(){var e=Jn(this),t=e.target,s=e.index++;if(!t||s>=t.length)return e.target=void 0,qn(void 0,!0);switch(e.kind){case"keys":return qn(s,!1);case"values":return qn(t[s],!1)}return qn([s,t[s]],!1)}),"values"),el=zn.Arguments=zn.Array;if(Gn("keys"),Gn("values"),Gn("entries"),Qn&&"values"!==el.name)try{Kn(el,"name",{value:"values"})}catch(e){}var tl=u,sl={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},il=v,rl=Zn,nl=qs,ll=nn,ol=Ve("iterator"),al=rl.values,ul=function(e,t){if(e){if(e[ol]!==al)try{nl(e,ol,al)}catch(t){e[ol]=al}if(ll(e,t,!0),sl[t])for(var s in rl)if(e[s]!==rl[s])try{nl(e,s,rl[s])}catch(t){e[s]=rl[s]}}};for(var cl in sl)ul(tl[cl]&&tl[cl].prototype,cl);ul(il,"DOMTokenList");var dl=S,hl=Function.prototype,ml=hl.apply,pl=hl.call,_l="object"==typeof Reflect&&Reflect.apply||(dl?pl.bind(ml):function(){return pl.apply(ml,arguments)}),fl={};fl[Ve("toStringTag")]="z";var gl,bl,Il="[object z]"===String(fl),vl=d,yl=O,Sl=Ve("toStringTag"),El=Object,Ll="Arguments"===yl(function(){return arguments}()),Cl=Il?yl:function(e){var t,s,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(e){}}(t=El(e),Sl))?s:Ll?yl(t):"Object"===(i=yl(t))&&vl(t.callee)?"Arguments":i},wl=String,kl=function(e){if("Symbol"===Cl(e))throw new TypeError("Cannot convert a Symbol value to a string");return wl(e)},xl=Be,Tl=y,Pl=u.RegExp,Ol=Tl((function(){var e=Pl("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Al=Ol||Tl((function(){return!Pl("a","y").sticky})),Nl={BROKEN_CARET:Ol||Tl((function(){var e=Pl("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Al,UNSUPPORTED_Y:Ol},Vl=y,Ml=u.RegExp,Fl=Vl((function(){var e=Ml(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})),Wl=y,Bl=u.RegExp,Dl=Wl((function(){var e=Bl("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Rl=$e,Ul=k,Hl=kl,Gl=function(){var e=xl(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},zl=Nl,jl=As,Kl=ai.get,$l=Fl,ql=Dl,Ql=se("native-string-replace",String.prototype.replace),Yl=RegExp.prototype.exec,Xl=Yl,Jl=Ul("".charAt),Zl=Ul("".indexOf),eo=Ul("".replace),to=Ul("".slice),so=(bl=/b*/g,Rl(Yl,gl=/a/,"a"),Rl(Yl,bl,"a"),0!==gl.lastIndex||0!==bl.lastIndex),io=zl.BROKEN_CARET,ro=void 0!==/()??/.exec("")[1];(so||ro||io||$l||ql)&&(Xl=function(e){var t,s,i,r,n,l,o,a=this,u=Kl(a),c=Hl(e),d=u.raw;if(d)return d.lastIndex=a.lastIndex,t=Rl(Xl,d,c),a.lastIndex=d.lastIndex,t;var h=u.groups,m=io&&a.sticky,p=Rl(Gl,a),_=a.source,f=0,g=c;if(m&&(p=eo(p,"y",""),-1===Zl(p,"g")&&(p+="g"),g=to(c,a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==Jl(c,a.lastIndex-1))&&(_="(?: "+_+")",g=" "+g,f++),s=new RegExp("^(?:"+_+")",p)),ro&&(s=new RegExp("^"+_+"$(?!\\s)",p)),so&&(i=a.lastIndex),r=Rl(Yl,m?s:a,g),m?r?(r.input=to(r.input,f),r[0]=to(r[0],f),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:so&&r&&(a.lastIndex=a.global?r.index+r[0].length:i),ro&&r&&r.length>1&&Rl(Ql,r[0],s,(function(){for(n=1;n<arguments.length-2;n++)void 0===arguments[n]&&(r[n]=void 0)})),r&&h)for(r.groups=l=jl(null),n=0;n<h.length;n++)l[(o=h[n])[0]]=r[o[1]];return r});var no=Xl;Fr({target:"RegExp",proto:!0,forced:/./.exec!==no},{exec:no});var lo=$e,oo=nr,ao=no,uo=y,co=Ve,ho=qs,mo=co("species"),po=RegExp.prototype,_o=k,fo=Dt,go=kl,bo=R,Io=_o("".charAt),vo=_o("".charCodeAt),yo=_o("".slice),So=function(e){return function(t,s){var i,r,n=go(bo(t)),l=fo(s),o=n.length;return l<0||l>=o?e?"":void 0:(i=vo(n,l))<55296||i>56319||l+1===o||(r=vo(n,l+1))<56320||r>57343?e?Io(n,l):i:e?yo(n,l,l+2):r-56320+(i-55296<<10)+65536}},Eo={codeAt:So(!1),charAt:So(!0)}.charAt,Lo=k,Co=ne,wo=Math.floor,ko=Lo("".charAt),xo=Lo("".replace),To=Lo("".slice),Po=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Oo=/\$([$&'`]|\d{1,2})/g,Ao=$e,No=Be,Vo=d,Mo=O,Fo=no,Wo=TypeError,Bo=_l,Do=$e,Ro=k,Uo=function(e,t,s,i){var r=co(e),n=!uo((function(){var t={};return t[r]=function(){return 7},7!==""[e](t)})),l=n&&!uo((function(){var t=!1,s=/a/;return"split"===e&&((s={}).constructor={},s.constructor[mo]=function(){return s},s.flags="",s[r]=/./[r]),s.exec=function(){return t=!0,null},s[r](""),!t}));if(!n||!l||s){var o=/./[r],a=t(r,""[e],(function(e,t,s,i,r){var l=t.exec;return l===ao||l===po.exec?n&&!r?{done:!0,value:lo(o,t,s,i)}:{done:!0,value:lo(e,s,t,i)}:{done:!1}}));oo(String.prototype,e,a[0]),oo(po,r,a[1])}i&&ho(po[r],"sham",!0)},Ho=y,Go=Be,zo=d,jo=W,Ko=Dt,$o=jt,qo=kl,Qo=R,Yo=function(e,t,s){return t+(s?Eo(e,t).length:1)},Xo=ct,Jo=function(e,t,s,i,r,n){var l=s+e.length,o=i.length,a=Oo;return void 0!==r&&(r=Co(r),a=Po),xo(n,a,(function(n,a){var u;switch(ko(a,0)){case"$":return"$";case"&":return e;case"`":return To(t,0,s);case"'":return To(t,l);case"<":u=r[To(a,1,-1)];break;default:var c=+a;if(0===c)return n;if(c>o){var d=wo(c/10);return 0===d?n:d<=o?void 0===i[d-1]?ko(a,1):i[d-1]+ko(a,1):n}u=i[c-1]}return void 0===u?"":u}))},Zo=function(e,t){var s=e.exec;if(Vo(s)){var i=Ao(s,e,t);return null!==i&&No(i),i}if("RegExp"===Mo(e))return Ao(Fo,e,t);throw new Wo("RegExp#exec called on incompatible receiver")},ea=Ve("replace"),ta=Math.max,sa=Math.min,ia=Ro([].concat),ra=Ro([].push),na=Ro("".indexOf),la=Ro("".slice),oa="$0"==="a".replace(/./,"$0"),aa=!!/./[ea]&&""===/./[ea]("a","$0");Uo("replace",(function(e,t,s){var i=aa?"$":"$0";return[function(e,s){var i=Qo(this),r=jo(e)?void 0:Xo(e,ea);return r?Do(r,e,i,s):Do(t,qo(i),e,s)},function(e,r){var n=Go(this),l=qo(e);if("string"==typeof r&&-1===na(r,i)&&-1===na(r,"$<")){var o=s(t,n,l,r);if(o.done)return o.value}var a=zo(r);a||(r=qo(r));var u,c=n.global;c&&(u=n.unicode,n.lastIndex=0);for(var d,h=[];null!==(d=Zo(n,l))&&(ra(h,d),c);)""===qo(d[0])&&(n.lastIndex=Yo(l,$o(n.lastIndex),u));for(var m,p="",_=0,f=0;f<h.length;f++){for(var g,b=qo((d=h[f])[0]),I=ta(sa(Ko(d.index),l.length),0),v=[],y=1;y<d.length;y++)ra(v,void 0===(m=d[y])?m:String(m));var S=d.groups;if(a){var E=ia([b],v,I,l);void 0!==S&&ra(E,S),g=qo(Bo(r,void 0,E))}else g=Jo(b,l,I,v,S,r);I>=_&&(p+=la(l,_,I)+g,_=I+b.length)}return p+la(l,_)}]}),!!Ho((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!oa||aa);var ua=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const ca=Symbol("item"),da=Symbol("destroyed"),ha=Symbol("ghost"),ma=Object.prototype.hasOwnProperty;let pa={baseClassName:"droplist",autoItemBlur:!0,autoItemBlurDelay:300,capturesFocus:!0,multi:!1,keyDownHandler:null,autoCheckGroupChildren:!0,useExactTargetWidth:!1,constrainToWindow:!0,autoFlipDirection:!0,estimateWidth:!1,virtualMinItems:100,labelProp:"label",valueProp:"value",on:null};class _a{constructor(t){const n={...pa};for(let[e,s]of Object.entries(t))void 0!==s&&(n[e]=s);const o=this._p={ownsEl:!0,elOriginalDisplay:"",baseClassName:n.baseClassName,additionalClasses:n.additionalClasses,direction:"ltr"===n.direction?"ltr":"rtl"===n.direction?"rtl":"auto",autoItemBlur:n.autoItemBlur,autoItemBlurDelay:n.autoItemBlurDelay,capturesFocus:n.capturesFocus,multi:n.multi,keyDownHandler:n.keyDownHandler,autoCheckGroupChildren:n.autoCheckGroupChildren,useExactTargetWidth:n.useExactTargetWidth,constrainToWindow:n.constrainToWindow,autoFlipDirection:n.autoFlipDirection,estimatedItemHeight:n.estimatedItemHeight,estimateWidth:n.estimateWidth,virtualMinItems:n.virtualMinItems,labelProp:n.labelProp,valueProp:n.valueProp,renderItem:n.renderItem,unrenderItem:n.unrenderItem,on:n.on||null,silenceEvents:!0,mitt:l(),focusItemIndex:-1,focusItemEl:null,sink:new i};let a=[o.baseClassName];o.additionalClasses&&(a=a.concat((o.additionalClasses+"").split(" ").filter((e=>e))));const u={top:"-9999px"};let c=n.el;if(c instanceof Element?(o.elOriginalDisplay=c.style.display||"",c.classList.add(...a),c.role="menu",s.setCssProps(c,u),o.ownsEl=!1):c=e.createElement("ul",{class:a.join(" "),role:"menu",css:u}),o.el=c,o.items=[],o.groupCount=0,o.mouseHandled=!1,o.virtualListHelper=new r({list:o.el,virtual:!0,buffer:5,estimatedItemHeight:n.estimatedItemHeight||20,itemElementCreatorFn:()=>e.createElement("li",{role:"menuitem",tabIndex:o.capturesFocus?-1:null}),onItemRender:(e,t)=>{let s;t===ha?(s={label:o.lastMeasureLongestLabelText,value:"Measure",[ca]:{[o.labelProp]:o.lastMeasureLongestLabelText,[o.valueProp]:"Measure"}},e.setAttribute("aria-hidden","true")):s=o.items[t],s||console.warn("onItemRender called for ("+t+") which has no item"),e.className="".concat(o.baseClassName,"__item");const i=e.classList;o.multi?s._nocheck?i.add("".concat(o.baseClassName,"__item_multi_nocheck")):(i.add("".concat(o.baseClassName,"__item_multi")),s._checked&&i.add("".concat(o.baseClassName,"__item_checked"))):i.add("".concat(o.baseClassName,"__item_single")),s._group&&i.add("".concat(o.baseClassName,"__item_group")),s._child&&i.add("".concat(o.baseClassName,"__item_child")),s._nointeraction&&i.add("".concat(o.baseClassName,"__item_nointeraction")),o.focusItemIndex===t&&(o.focusItemEl=e,i.add("".concat(o.baseClassName,"__item_focus"))),this._renderItemContent(s,e),e[ca]=s}}),"function"==typeof o.unrenderItem){const e=o.unrenderItem;o.virtualListHelper.setOnItemUnrender((t=>{try{e(t[ca][ca],t)}catch(e){console.error(e)}delete t[ca],o.focusItemEl===t&&(o.focusItemEl=null)}))}else o.virtualListHelper.setOnItemUnrender((e=>{delete e[ca],o.focusItemEl===e&&(o.focusItemEl=null)}));o.capturesFocus&&(c.tabIndex=0),this._hookMouseEvents(),this._hookTouchEvents(),this._hookFocusEvents(),this._hookKeyEvents(),this.silenceEvents=!1}destroy(){if(this[da])return;this[da]=!0;const e=this._p;var s;if(clearTimeout(e.blurTimer),clearTimeout(e.filterTimer),e.sink.remove(),e.virtualListHelper.destroy(),e.el&&t.remove(e.el),e.currentSubDropList&&(null===(s=e.currentSubDropList)||void 0===s||null===(s=s.droplist)||void 0===s||s.destroy(),e.currentSubDropList=null),!e.ownsEl){for(let t of Array.from(e.el.classList))t.startsWith(e.baseClassName)&&e.el.classList.remove(t);e.el.removeAttribute("role");for(let t of["position","left","top","right","bottom","z-index"])e.el.style[t]="";e.el.style.display=e.elOriginalDisplay}e.lastPositionTarget&&(e.lastPositionTarget.classList.remove("has_".concat(e.baseClassName),"has_".concat(e.baseClassName,"_above"),"has_".concat(e.baseClassName,"_below")),delete e.lastPositionTarget),this._p=null}get el(){return this._p.el}elContains(e){var t;let s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!this.el.contains(e)||!(!s||null===(t=this._p.currentSubDropList)||void 0===t||null===(t=t.droplist)||void 0===t||!t.elContains(e))}setAdditionalClasses(e){return this._p.additionalClasses=e,this._syncBaseClasses(),this}setDirection(e){return this._p.direction="ltr"===e?"ltr":"rtl"===e?"rtl":"auto",this._syncBaseClasses(),this}getDirection(){return this._p.direction}setLabelProp(e){return this._p.labelProp=e,this}setRenderItem(e){return this._p.renderItem=e,this}setUnrenderItem(e){const t=this._p;if(t.unrenderItem=e,"function"==typeof t.unrenderItem){const e=t.unrenderItem;t.virtualListHelper.setOnItemUnrender((s=>{try{e(s[ca][ca],s)}catch(e){console.error(e)}delete s[ca],t.focusItemEl===s&&(t.focusItemEl=null)}))}else t.virtualListHelper.setOnItemUnrender((e=>{delete e[ca],t.focusItemEl===e&&(t.focusItemEl=null)}));return this}setValueProp(e){return this._p.valueProp=e,this}_syncBaseClasses(){const e=this._p,t=e.el;if(!t)return;let s=[e.baseClassName];"ltr"!==e.direction&&"rtl"!==e.direction||s.push("".concat(e.baseClassName,"__")+e.direction),e.additionalClasses&&(s=s.concat(e.additionalClasses)),t.className=s.join(" ")}blurFocusedItem(){var e;const t=this._p;if(clearTimeout(t.blurTimer),!this.hasFocusedItem())return;let s=t.focusItemEl;s&&(s.classList.remove("".concat(t.baseClassName,"__item_focus")),t.focusItemEl=null);const i=t.items[t.focusItemIndex];t.focusItemIndex=-1,i&&(t.currentSubDropList&&this._hideSublist(),this._trigger("itemblur",{value:i.value,item:null!==(e=i[ca])&&void 0!==e?e:i}))}nextPage(e){this._move("next_page",e)}previousPage(e){this._move("prev_page",e)}goToFirst(e){this._move("first",e)}goToLast(e){this._move("last",e)}toggleFocusedItem(){const e=this._p;if(this.hasFocusedItem()&&e.multi){var s;let i=e.items[e.focusItemIndex];if(i._nocheck||i._nointeraction)return this;i._checked=!i._checked,e.focusItemEl&&t.toggleClass(e.focusItemEl,"".concat(e.baseClassName,"__item_checked"),i._checked),this._trigger("check",{value:i.value,item:null!==(s=i[ca])&&void 0!==s?s:i,checked:i._checked,isGroup:i._group,isCheckingGroup:!1}),this._updateGroupStateForItem(i)}return this}triggerItemSelection(t,s){var i,r;const n=this._p;return n.focusItemEl=n.focusItemEl||e.closestUntil(s.target,"li",n.el),n.focusItemIndex=n.virtualListHelper.getItemIndexFromElement(n.focusItemEl),void 0===n.focusItemIndex&&(n.focusItemIndex=-1),!(t=null!==(i=t)&&void 0!==i?i:n.focusItemEl[ca])._nointeraction&&(n.multi||this._setSingleSelectedItemEl(n.focusItemEl),this._trigger("select",{value:t?t.value:void 0,item:null!==(r=t[ca])&&void 0!==r?r:t,event:s,el:n.focusItemEl}),!0)}addItem(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return this.addItems([e],t)}addItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;const s=this._p,i=s.labelProp,r=s.valueProp;let n=s.multi,l=s.items;(null==t||t<0||t>=s.items.length)&&(t=-1),this._determineVirtualMode(l.length+e.length);for(let o=0,a=e.length;o<a;o++){let a=e[o],u={[ca]:a,label:a[i],value:a[r],_nocheck:!!a._nocheck,_nointeraction:!!a._nointeraction,_subitems:a._subitems};n&&(u._checked=!!a._checked),a._group&&(u._group=!0,s.groupCount++),a._child&&(u._child=!0),-1!==t?l.splice(t,0,u):l.push(u),-1!==t&&t++}return s.virtualListHelper.addItemsAt(e.length,-1===t?t:t-e.length).render(),this}setItems(e){const t=this._p;return t.items.length=0,t.groupCount=0,t.virtualListHelper.setCount(0),this.addItems(e)}updateItemByValue(e,t){const s=this._p;let i=this.itemIndexByValue(e);if(-1===i)return this;let r=this.itemAtIndex(i);return r[ca]=t,ma.call(t,s.labelProp)&&(r.label=t[s.labelProp]),ma.call(t,s.valueProp)&&(r.value=t[s.valueProp]),ma.call(t,"_nocheck")&&(r._nocheck=!!t._nocheck),ma.call(t,"_nointeraction")&&(r._nointeraction=!!t._nointeraction),ma.call(t,"_subitems")&&(r._subitems=!!t._subitems),s.multi&&ma.call(t,"_checked")&&(r._checked=!!t._checked),ma.call(t,"_group")&&!!t._group!==r._group&&(r._group?s.groupCount--:s.groupCount++,t._group=!!r._group),ma.call(t,"_child")&&(r._child=!!t._child),s.virtualListHelper.isItemRendered(i)&&s.virtualListHelper.refreshItemAt(i).render(),this}removeItem(e,t){const s=this._p;let i=this.itemIndexByValueOrLabel(e,t);return-1===i||(s.items.splice(i,1)[0]._group&&s.groupCount--,s.virtualListHelper.removeItemsAt(i,1).render()),this}removeAllItems(){const e=this._p;return e.items.length=0,e.groupCount=0,e.virtualListHelper.setCount(0).render(),this}invalidate(){return this._p.virtualListHelper.invalidate().render(),this}itemDataByValue(e){const t=this._p;for(let s=0,i=t.items.length;s<i;s++){let i=t.items[s];if(i.value===e)return i[ca]}return null}itemIndexByValue(e){const t=this._p;for(let s=0,i=t.items.length;s<i;s++)if(t.items[s].value===e)return s;return-1}itemIndexByValueOrLabel(e,t){const s=this._p;for(let i=0,r=s.items.length;i<r;i++){let r=s.items[i];if(r.value===e||r.label===t)return i}return-1}items(){return this._p.items.map((e=>e[ca]))}itemsReference(){return this._p.items}itemCount(){return this._p.items.length}itemAtIndex(e){var t;return null===(t=this._p.items[e])||void 0===t?void 0:t[ca]}relayout(e){const i=this._p,r=i.el;if(!this.isVisible())return this;let n=window,l={},o=e.targetOffset||s.getElementOffset(e.target);l.left=o.left,l.top=o.top,l.height=null==e.targetHeight?s.getElementHeight(e.target,!0,!0):e.targetHeight,l.width=null==e.targetWidth?s.getElementWidth(e.target,!0,!0):e.targetWidth,l.bottom=l.top+l.height;let a={};a.top=n.pageYOffset,a.left=n.pageXOffset,a.width=n.innerWidth,a.height=n.innerHeight,a.bottom=a.top+a.height,a.right=a.left+a.width;let u=e.position&&"bottom"===e.position.y?"above":"below";r.style.width="",(i.estimateWidth||i.virtualListHelper.isVirtual())&&this._measureItem(),i.virtualListHelper.isVirtual()&&i.virtualListHelper.render(),e.updateWidth||"number"==typeof e.updateWidth?this._updateWidth(e):this._updateWidth();let c,d=l.top-a.top,h=a.bottom-l.bottom;const m=getComputedStyle(r);let p="border-box"===m.boxSizing,_=(parseFloat(m.paddingTop)||0)+(parseFloat(m.paddingBottom)||0),f=(parseFloat(m.borderTopWidth)||0)+(parseFloat(m.borderBottomWidth)||0);i.virtualListHelper.isVirtual()?c=i.virtualListHelper.estimateFullHeight()+_+f:(r.style.height="",r.style.top="-9999px",c=Math.max(s.getElementHeight(i.el),r.scrollHeight),c+=_+f);let g=parseFloat(m.maxHeight);isNaN(g)||(p||(g+=_+f),c=Math.min(c,g));let b=d>=c,I=h>=c,v=i.currentDirection||u;"above"===v&&!b&&I?v="below":"below"===v&&!I&&b?v="above":b&&I?v!==u&&("above"===u&&d>=h||"below"===u&&h>=d)&&(v=u):b||I||(d>h?v="above":h>d&&(v="below")),i.currentDirection=v;let y={width:s.getElementWidth(r,!0,!0),height:Math.min(c,Math.max(d,h,0))},S=void 0!==e.targetRtl?e.targetRtl:null!=e.target&&"rtl"===getComputedStyle(e.target).direction,E="rtl"===getComputedStyle(document.documentElement).direction,L=s.anchoredPosition(e.target,e.anchor?e.anchor.x:"start",e.anchor?e.anchor.y:"bottom",l,S),C=s.anchoredPosition(r,e.position?e.position.x:"start",e.position?e.position.y:"top",y,S),w="top"===C.ySpec&&"above"===v||"bottom"===C.ySpec&&"below"===v||"bottom"!==C.ySpec&&"top"!==C.ySpec&&"above"===v,k=void 0!==n.pageXOffset?n.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft;k=Math.abs(k),E&&(k=document.documentElement.scrollWidth-k-document.documentElement.clientWidth);let x=k,T=document.documentElement.clientWidth+k-y.width,P={position:"absolute",left:l.left,top:l.top+(w?L.bottom-C.bottom:L.top-C.top)};if(E&&(P.left-=document.documentElement.clientWidth-document.documentElement.scrollWidth),P.left+=L.left-C.left,e.offset&&(e.offset.y&&(w?P.top-=e.offset.y:P.top+=e.offset.y),e.offset.x)){let t="rtl"===m.direction;P.left+=t?-e.offset.x:e.offset.x}if(i.autoFlipDirection&&("right"===C.xSpec&&P.left<x&&(Math.max(P.left,x)+y.width-l.left)/l.width>.5||"left"===C.xSpec&&P.left>T&&(Math.min(P.left,T)-l.left)/l.width<.5)&&(P.left-=L.left-C.left,P.left+=L.right-C.right),i.constrainToWindow)for(let e of E?["min","max"]:["max","min"])"min"===e&&P.left<x?P.left=x:"max"===e&&P.left>T&&(P.left=T);return P.left+="px",P.top+="px",s.setCssProps(r,P),s.setElementHeight(r,y.height,!0,!0),i.virtualListHelper.render(),e&&e.target&&(i.lastPositionTarget=e.target,t.toggleClass(e.target,"has_".concat(i.baseClassName),!0),t.toggleClass(e.target,"has_".concat(i.baseClassName,"_below"),"below"===v),t.toggleClass(e.target,"has_".concat(i.baseClassName,"_above"),"above"===v),t.toggleClass(r,"".concat(i.baseClassName,"__is_below"),"below"===v),t.toggleClass(r,"".concat(i.baseClassName,"__is_above"),"above"===v)),this}setItemChecked(e,s){const i=this._p;s=!!s;let r=this.itemIndexByValue(e);if(-1===r)return this;let n=i.virtualListHelper.getItemElementAt(r);if(!n)return this;let l=n[ca];return s=s&&!l._nocheck,l._checked!==s&&(l._checked=s,t.toggleClass(n,"".concat(i.baseClassName,"__item_checked"),l._checked),this._updateGroupStateForItem(l)),this}setCheckedValues(e){const s=this._p;let i=[];for(let r=0,n=s.items.length;r<n;r++){let n=s.items[r],l=!n._nocheck&&-1!==e.indexOf(n.value);if(n._group&&i.push(r),n._checked===l)continue;n._checked=l;let o=s.virtualListHelper.getItemElementAt(r);o&&t.toggleClass(o,"".concat(s.baseClassName,"__item_checked"),n._checked)}if(s.autoCheckGroupChildren)for(let e=0,t=i.length;e<t;e++)this._updateGroupCheckedState(i[e],!1);return this}getCheckedValues(e){const t=this._p;e=e&&t.groupCount>0;let s=[];for(let i=0,r=t.items.length;i<r;i++){let r=t.items[i];r._checked&&(e&&r._group||s.push(r.value))}return s}getCheckedItems(e){const t=this._p;e=e&&t.groupCount>0;let s=[];for(let i=0,r=t.items.length;i<r;i++){let r=t.items[i];r._checked&&(e&&r._group||s.push(r[ca]))}return s}show(e){const t=this._p;t.hiding=!1,this.isVisible()||this._trigger("show:before"),t.mouseHandled=!1,setTimeout((()=>{this[da]||t.onDocumentMouseDown||t.sink.add(document,"mousedown",t.onDocumentMouseDown=e=>{t.el.contains(e.target)||this._delayBlurItemOnBlur()})}));const s=t.el;if(s.style.position="absolute",s.classList.remove("".concat(t.baseClassName,"__is-hiding")),document.body.appendChild(s),t.visible=!0,t.el.style.display="","none"===getComputedStyle(t.el).display&&(t.el.style.display="block"),e){const t=getComputedStyle(s),i=s.style.maxHeight;let r=document.body.clientHeight-(parseFloat(t.marginTop)||0)-(parseFloat(t.marginBottom)||0)-("border-box"===t.boxSizing?0:(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0));s.style.maxHeight=Math.min(r,parseFloat(t.maxHeight)||r)+"px",this.relayout(e),s.style.maxHeight=i}else t.virtualListHelper.isVirtual()&&t.virtualListHelper.render();return this.isVisible()&&this._trigger("show"),this}hide(){const e=this._p,i=e.el;if(e.onDocumentMouseDown&&(e.sink.remove(document,"mousedown",e.onDocumentMouseDown),e.onDocumentMouseDown=null),this.isVisible()){if(this._trigger("hide:before"),e.hiding=!0,i&&(i.classList.add("".concat(e.baseClassName,"__is-hiding")),s.parseTransition(getComputedStyle(e.el).transition).reduce(((e,t)=>Math.max(e,t.delay+t.duration)),0)>0?setTimeout((()=>{this[da]||this._p&&i.parentNode&&e.hiding&&(t.remove(i),i.classList.remove("".concat(e.baseClassName,"__is-hiding")),e.visible=!1,this._trigger("hide:after"))})):(t.remove(i),i.classList.remove("".concat(e.baseClassName,"__is-hiding")))),e.visible=!1,this.blurFocusedItem(),this._trigger("hide"),this[da])return;this._trigger("hide:after"),e.currentSubDropList&&this._hideSublist()}return e.lastPositionTarget&&(e.lastPositionTarget.classList.remove("has_".concat(e.baseClassName),"has_".concat(e.baseClassName,"_above"),"has_".concat(e.baseClassName,"_below")),delete e.lastPositionTarget),this}isVisible(){const e=this._p;return!!e.visible&&e.el.parentNode&&"none"!==getComputedStyle(e.el).display}hasFocusedItem(){return this._p.focusItemIndex>-1}getFocusedItemIndex(){return this.hasFocusedItem()?this._p.focusItemIndex:-1}setFocusedItemAtIndex(e){const t=this._p;t.focusItemIndex=e;let s=null;e>-1&&(s=t.items[e]),s&&s._nointeraction&&(s=null),e>-1&&this.scrollItemIndexIntoView(e);let i=s?t.virtualListHelper.getItemElementAt(e):null;if(t.focusItemEl!==i&&(t.focusItemEl&&(t.focusItemEl.classList.remove("".concat(t.baseClassName,"__item_focus")),t.focusItemEl=null),i)){var r;i.classList.add("".concat(t.baseClassName,"__item_focus")),t.focusItemEl=i;const e=i[ca];this._trigger("itemfocus",{value:e.value,item:null!==(r=e[ca])&&void 0!==r?r:e,event:null,el:i}),this._showSublist(e,i)}return this}_showSublist(e,t){var s,i;if(null===(s=e._subitems)||void 0===s||!s.length)return;const r=this._p,n=new _a({baseClassName:r.baseClassName,additionalClasses:r.additionalClasses,direction:r.direction,autoItemBlur:r.autoItemBlur,autoItemBlurDelay:r.autoItemBlurDelay,capturesFocus:r.capturesFocus,multi:r.multi,keyDownHandler:r.keyDownHandler,autoCheckGroupChildren:r.autoCheckGroupChildren,useExactTargetWidth:r.useExactTargetWidth,constrainToWindow:r.constrainToWindow,autoFlipDirection:r.autoFlipDirection,estimatedItemHeight:r.estimatedItemHeight,estimateWidth:r.estimateWidth,virtualMinItems:r.virtualMinItems,labelProp:r.labelProp,valueProp:r.valueProp,renderItem:r.renderItem,unrenderItem:r.unrenderItem});let l=e=>{this[da]||e.relatedTarget&&this.elContains(e.relatedTarget,!0)||(this._delayBlurItemOnBlur(),this._trigger("subitems:blur",e))};n.on("select",(e=>{this._trigger("subitems:select",e)})).on("subitems:select",(e=>{this._trigger("subitems:select",e)})).on("blur",l).on("subitems:blur",l).on("_back_key_pressed",(()=>{this._hideSublist()})),n.setItems(e._subitems),this._trigger("show_subitems",{value:e.value,item:null!==(i=e[ca])&&void 0!==i?i:e,el:t,droplist:n}),n.show({target:t,position:{x:"start",y:"top"},anchor:{x:"end",y:"top"},offset:{x:0,y:0},updateWidth:!1}),r.currentSubDropList={item:e,itemElement:t,droplist:n},n.el.focus()}_hideSublist(){const e=this._p;if(!e.currentSubDropList)return;const t=e.currentSubDropList;let s=!!document.activeElement&&t.droplist.elContains(document.activeElement,!0);t.droplist.hide(),t.droplist.destroy(),e.currentSubDropList=null,s&&!this[da]&&this.el.focus(),this._trigger("hide_subitems",{value:t.item.value,item:t.item,el:t.itemElement})}setFocusedItem(e){const t=this._p;let s=e._nointeraction?-1:this._getItemIndex(e);return s>-1&&t.items[s]._nointeraction&&(s=-1),this.setFocusedItemAtIndex(s)}setFocusedItemByValue(e){return this.setFocusedItemAtIndex(this.itemIndexByValue(e))}setSingleSelectedItemAtIndex(e){const t=this._p;let s=null;return e>-1&&!t.items[e]._nointeraction&&(s=t.virtualListHelper.getItemElementAt(e)),this._setSingleSelectedItemEl(s),this}setSingleSelectedItem(e){const t=this._p;let s=e._nointeraction?-1:this._getItemIndex(e);return s>-1&&t.items[s]._nointeraction&&(s=-1),this.setSingleSelectedItemAtIndex(s)}setSingleSelectedItemByValue(e){return this.setSingleSelectedItemAtIndex(this.itemIndexByValue(e))}next(e){this._move("next",e)}previous(e){this._move("prev",e)}isFirstItem(){const e=this._p;return 0===e.focusItemIndex&&e.focusItemIndex<e.items.length}isLastItem(){const e=this._p;return e.focusItemIndex>-1&&e.focusItemIndex===e.items.length-1}scrollItemIndexIntoView(e){const t=this._p;if(this._hasScroll()){const s=t.el,i=s.scrollTop;let r,n=-1,l=30;for(;l-- >0&&(r=t.virtualListHelper.getItemPosition(e),r!==n);){n=r;let l=t.virtualListHelper.getItemSize(e),o=s.clientHeight;r<i?s.scrollTop=r:r+l>i+o&&(s.scrollTop=r+l-o),t.virtualListHelper.render()}}return this}on(e,t){return this._p.mitt.on(e,t),this}once(e,t){let s=i=>{this._p.mitt.off(e,s),t(i)};return this._p.mitt.on(e,s),this}off(e,t){return e||e?this._p.mitt.off(e,t):this._p.mitt.all.clear(),this}emit(e,t){return this._p.mitt.emit(e,t),this}_getItemIndex(e){const t=this._p;let s=-1;if(e&&(s=t.items.indexOf(e),-1===s)){let t=e&&void 0!==e.value?e.value:e,i=e&&e.label?e.label:t;s=this.itemIndexByValueOrLabel(t,i)}return s}_setSingleSelectedItemEl(e){const t=this._p;return t.singleSelectedItemEl&&(t.singleSelectedItemEl.classList.remove("".concat(t.baseClassName,"__item_checked")),t.singleSelectedItemEl=null),e&&(e.classList.add("".concat(t.baseClassName,"__item_checked")),t.singleSelectedItemEl=e),this}_trigger(e,t){const s=this._p;s.on&&s.on(e,...void 0===t?[]:[t]),s.mitt.emit(e,t)}_itemUpAction(t,s){if(e.closestUntil(t.target,".requires-pointer-events,button",s))return;let i=this._p;if(!this._mouseHandled){if(this.triggerItemSelection(null,t),this[da])return;this.toggleFocusedItem(),document.activeElement!==this.el&&i.focusItemEl&&clearTimeout(i.blurTimer),setTimeout((()=>{this._mouseHandled=!1}),0)}}_hookMouseEvents(){const t=this._p;t.sink.add(t.el,"mouseup",(t=>{const s=e.closestUntil(t.target,"li",t.currentTarget);s&&0===t.button&&this._itemUpAction(t,s)})).add(t.el,"mouseover",(t=>{const s=e.closestUntil(t.target,"li",t.currentTarget);s&&this._handleMouseOver(t,s)}))}_handleMouseOver(e,t){this._focus(e,t,null,!0)}_hookTouchEvents(){const t=this._p;let s;t.sink.add(t.el,"touchstart",(i=>{const r=e.closestUntil(i.target,"li",i.currentTarget);if(!r)return;if(s)return;if(e.closestUntil(i.target,".requires-pointer-events,button",r))return;s=i.changedTouches[0].identifier,this._handleMouseOver(i,r);let n=!1,l=()=>{n=!0},o=()=>{s=null,t.sink.remove(null,".dropdown_touchextra")},a=r.parentNode;for(;a;)t.sink.add(a,"scroll.dropdown_touchextra",l),a=a.parentNode;t.sink.add(window,"scroll.dropdown_touchextra",l),t.sink.add(window,"touchcancel.dropdown_touchextra",o),t.sink.add(t.el,"touchend.dropdown_touchextra",(t=>{const i=e.closestUntil(t.target,"li",t.currentTarget);return i&&Array.prototype.find.call(t.changedTouches,(e=>e.identifier===s))?(o(),void(n||(this._itemUpAction(t,i),t.preventDefault()))):o()}))}))}_hookFocusEvents(){const e=this._p;e.sink.add(e.el,"focus",(t=>{let s=e.focusItemEl||e.el.firstChild;this._focus(t,s,null,!1)})).add(e.el,"blur",(e=>{setTimeout((()=>{this[da]||document.activeElement&&this.elContains(document.activeElement,!0)||(this._delayBlurItemOnBlur(),this._trigger("blur",e))}))}))}_hookKeyEvents(){const e=this._p;e.sink.add(e.el,"keydown",(e=>this._keydown(e)))}_keydown(e){const t=this._p;if(t.keyDownHandler&&t.keyDownHandler.call(this,e))return;let s=!0;switch(e.key){case n.VALUE_PAGE_UP:case n.VALUE_PAGE_DOWN:case n.VALUE_HOME:case n.VALUE_END:case n.VALUE_UP:case n.VALUE_DOWN:switch(e.preventDefault(),e.key){case n.VALUE_PAGE_UP:this.previousPage(e);break;case n.VALUE_PAGE_DOWN:this.nextPage(e);break;case n.VALUE_HOME:this._move("first",e);break;case n.VALUE_END:this._move("last",e);break;case n.VALUE_UP:this.previous(e);break;case n.VALUE_DOWN:this.next(e)}break;case n.VALUE_LEFT:case n.VALUE_RIGHT:if(e.key===n.VALUE_RIGHT&&"rtl"!==getComputedStyle(e.target).direction||e.key===n.VALUE_LEFT&&"rtl"===getComputedStyle(e.target).direction){let e=t.items[t.focusItemIndex];t.focusItemIndex>-1&&e._subitems&&this._showSublist(e,t.focusItemEl)}else t.currentSubDropList?(this._hideSublist(),s=!1):this._trigger("_back_key_pressed");break;case n.VALUE_ENTER:this.triggerItemSelection(null,e),e.preventDefault();break;case n.VALUE_SPACE:this.toggleFocusedItem(),e.preventDefault();break;case n.VALUE_ESCAPE:e.preventDefault(),this.hide();break;default:if("keydown"===e.type)return;this._keydownFreeType(e),s=!1}}_keydownFreeType(e){const t=this._p;let s=e.key||String.fromCharCode(e.keyCode);if(1!==s.length)return;clearTimeout(t.filterTimer);let i,r=(t.previousFilter||"")+s,n=new RegExp("^".concat(ua(r)),"i"),l=-1,o=t.focusItemIndex;for(let e=0,s=t.items.length;e<s&&(-1!==l&&e<o||(i=t.items[e],!(n.test(i.label)&&(l=e,-1===o||e>=o))));e++);if(-1===l){r=s,n=new RegExp("^".concat(ua(r)),"i");for(let e=0,s=t.items.length;e<s&&(-1!==l&&e<o||(i=t.items[e],!(n.test(i.label)&&(l=e,-1===o||e>=o))));e++);}if(l>-1){let s=t.virtualListHelper.getItemElementAt(l);this._focus(e,s||null,l,!0),this.isVisible()||this.triggerItemSelection(s?null:t.items[l],e),t.previousFilter=r,t.filterTimer=setTimeout((()=>{delete t.previousFilter}),1e3)}else delete t.previousFilter}_focus(e,t,s,i){var r;const n=this._p;if(n._isFocusingItem)return;n._isFocusingItem=!0,!s&&t&&(s=n.virtualListHelper.getItemIndexFromElement(t)),s>-1?this.scrollItemIndexIntoView(s):void 0===s&&(t=null);let l=t||n.virtualListHelper.getItemElementAt(s);if(!l||l[ca]._nointeraction)return n._isFocusingItem=!1,void this.blurFocusedItem();if(l===n.focusItemEl)return n._isFocusingItem=!1,void clearTimeout(n.blurTimer);this.blurFocusedItem(),l.classList.add("".concat(n.baseClassName,"__item_focus")),n.focusItemEl=l,n.focusItemIndex=s;const o=n.items[s];this._trigger("itemfocus",{value:o.value,item:null!==(r=o[ca])&&void 0!==r?r:o,event:e,el:l}),n._isFocusingItem=!1,i&&this._showSublist(o,l)}_delayBlurItemOnBlur(){if(this[da])return;const e=this._p;e.autoItemBlur&&(clearTimeout(e.blurTimer),e.blurTimer=setTimeout((()=>{this[da]||this.blurFocusedItem()}),e.autoItemBlurDelay))}_move(e,t){const i=this._p;let r,n,l=!1;if("first"===e)n=0,l=!1;else if("last"===e)n=i.items.length-1,l=!0;else if("prev"===e){if(!this.hasFocusedItem())return this._move("last",t);n=i.focusItemIndex-1,-1===n&&(n=i.items.length-1),l=!0}else if("next"===e){if(!this.hasFocusedItem())return this._move("first",t);n=i.focusItemIndex+1,n===i.items.length&&(n=0),l=!1}else{if("prev_page"!==e&&"next_page"!==e)return;if(!this.hasFocusedItem())return this._move("prev_page"===e?"prev":"next",t);if("prev_page"===e&&this.isFirstItem()||"next_page"===e&&this.isLastItem())return;if(!this._hasScroll())return this._move("prev_page"===e?"first":"last",t);if(i.virtualListHelper.isVirtual()){let t=i.virtualListHelper.getVisibleItemCount();n=i.focusItemIndex,"prev_page"===e?n-=t:n+=t,n<0?n=0:n>=i.items.length&&(n=i.items.length)}else if(i.focusItemEl){let t=s.getElementOffset(i.focusItemEl).top,l=s.getElementHeight(i.el,!0);for(;;){if(r=i.focusItemEl.nextElementSibling,!r)return;if("LI"===r.tagName)if("prev_page"===e){if(s.getElementOffset(r).top-t+l<=0)break}else if(s.getElementOffset(r).top-t-l>=0)break}r&&(n=i.virtualListHelper.getItemIndexFromElement(r),void 0===n&&(n=-1))}l="prev_page"===e}let o=i.items.length;if(n>=o)return;let a=i.items[n],u=n;for(;a&&a._nointeraction&&(l?(n--,-1===n&&(n=o)):(n++,n===o&&(n=0)),a=i.items[n],n!==u););r=i.virtualListHelper.getItemElementAt(n),this._focus(t,r||null,n,!1),this.isVisible()||this.triggerItemSelection(a,t)}_hasScroll(){return this.el.clientHeight<this.el.scrollHeight}_updateGroupStateForItem(e){const s=this._p;if(!s.multi)return this;if(e._group){var i;let n=0;if(s.autoCheckGroupChildren){let i=s.items;for(let l=i.indexOf(e)+1,o=i.length;l<o;l++){var r;let o=i[l];if(o._group||!o._child&&i[l-1]._child)break;if(!!o._checked===e._checked)continue;o._checked=e._checked,n++;let a=s.virtualListHelper.getItemElementAt(l);a&&t.toggleClass(a,"".concat(s.baseClassName,"__item_checked"),e._checked),this._trigger("check",{value:o.value,item:null!==(r=o[ca])&&void 0!==r?r:o,checked:o._checked,isGroup:o._group,isCheckingGroup:!0})}}this._trigger("groupcheck",{value:e.value,item:null!==(i=e[ca])&&void 0!==i?i:e,affectedItems:n})}else if(s.groupCount>0&&s.autoCheckGroupChildren){let t=s.items,i=-1;for(let s=t.indexOf(e)-1;s>=0;s--)if(t[s]._group){i=s;break}i>-1&&this._updateGroupCheckedState(i,!0)}return this}_updateGroupCheckedState(e,s){const i=this._p;if(!(i.multi&&i.autoCheckGroupChildren&&e>-1))return this;let r=i.items,n=r[e];if(!n||!n._group)return this;let l,o=!1,a=!1;for(let t=e+1,s=r.length;t<s&&(l=r[t],!(l._group||!l._child&&r[t-1]._child));t++)l._checked?o=!0:l._checked||(a=!0);let u=o&&!a;if(!!n._checked!==u){n._checked=u;let r=i.virtualListHelper.getItemElementAt(e);var c;r&&t.toggleClass(r,"".concat(i.baseClassName,"__item_checked"),n._checked),s&&this._trigger("check",{value:n.value,item:null!==(c=n[ca])&&void 0!==c?c:n,checked:n._checked,isGroup:n._group,isCheckingGroup:!1})}return this}_measureItem(){const e=this._p;if(e.lastMeasureItemCount!==e.items.length){let t=e.lastMeasureLongestLabel||1,s=e.lastMeasureLongestLabelText||"";for(let i=0,r=e.items,n=r.length;i<n;i++){const e=r[i];let n=e.label;null==n&&(n=e.value),null==n&&(n="");let l=n.length;l>t&&(t=l,s=n)}e.lastMeasureItemCount=e.items.length,e.lastMeasureLongestLabel=t,e.lastMeasureLongestLabelText=s}return(e.estimateWidth||e.virtualListHelper.isVirtual())&&e.virtualListHelper.createGhostItemElement(ha,!0,(t=>{e.lastMeasureItemWidth=s.getElementWidth(t,!0,!0)})),this}_determineVirtualMode(e){const t=this._p;let s=t.items;void 0===e&&(e=s.length);let i=e>=t.virtualMinItems;return i!==t.virtualListHelper.isVirtual()&&t.virtualListHelper.setVirtual(i).render(),this}_renderItemContent(t,s){const i=this._p;i.renderItem&&!1!==i.renderItem(t[ca]||t,s)||(s.appendChild(e.createElement("span",{class:"".concat(i.baseClassName,"__item_label"),textContent:t.label})),i.multi&&(t._nocheck||s.insertBefore(e.createElement("span",{class:"checkbox"}),s.firstChild)))}_updateWidth(e){const t=this._p,i=t.el;let r=0;e&&(r="number"==typeof e.updateWidth||null!=e.targetWidth?e.updateWidth:s.getElementWidth(e.target,!0,!0));let n=0;t.useExactTargetWidth||(t.estimateWidth||t.virtualListHelper.isVirtual()?n=t.lastMeasureItemWidth:(i.style.width="",n=s.getElementWidth(i,!0,!0)));let l=Math.max(n,r);s.setElementWidth(i,l,!0,!0);const o=getComputedStyle(i);let a=(parseFloat(o.borderLeftWidth)||0)+(parseFloat(o.borderRightWidth)||0),u=i.scrollWidth+a;if(u>l){let e=u-l;i.style.width="".concat(parseFloat(i.style.width)+e,"px"),l=u}return l}}const fa=(e,t,s)=>{let i,r,n,l,o=0;s||(s={});const a=()=>{o=!1===s.leading?0:Date.now(),i=null,l=e.apply(r,n),i||(r=n=null)},u=function(){const u=Date.now();o||!1!==s.leading||(o=u);const c=t-(u-o);return r=this,n=arguments,c<=0||c>t?(i&&(clearTimeout(i),i=null),o=u,l=e.apply(r,n),i||(r=n=null)):i||!1===s.trailing||(i=setTimeout(a,c)),l};return u.cancel=()=>{clearTimeout(i),o=0,i=r=n=null},u.isScheduled=()=>!!i,u},ga=Symbol("item"),ba=Symbol("destroyed"),Ia=Symbol("no_results_items"),va=Symbol("rest_multi_items"),ya=!!("ontouchstart"in window||window.DocumentTouch&&window.document instanceof window.DocumentTouch||window.navigator.maxTouchPoints),Sa=function(e,t){return e instanceof Element&&e.classList.contains(t)},Ea=["font-family","font-size","font-weight","font-size","letter-spacing","text-transform","word-spacing","text-indent","box-sizing","padding-left","padding-right"],La={el:null,baseClassName:"selectbox",disabled:!1,clearable:!0,hasOpenIndicator:!0,placeholder:"",sortSelectedItems:!0,sortListItems:!1,sortListCheckedFirst:!0,stickyValues:null,sortItemComparator:null,splitListCheckedGroups:!0,treatGroupSelectionAsItems:!1,blurOnSingleSelection:"touch",multi:!1,showSelection:!0,showPlaceholderInTooltip:!1,multiPlaceholderFormatter:null,searchable:!0,noResultsText:"No matching results",filterThrottleWindow:300,filterOnEmptyTerm:!1,labelProp:"label",valueProp:"value",multiItemLabelProp:"short_label",maxMultiItems:null,multiItemsRestLabelProvider:null,items:[],selectedValues:void 0,value:void 0,isLoadingMode:!1};exports.DropList=_a,exports.SelectBox=class{constructor(s){const r={...La};for(let[e,t]of Object.entries(s))void 0!==t&&(r[e]=t);const n=this._p={ownsEl:!0,baseClassName:r.baseClassName,additionalClasses:r.additionalClasses,direction:"ltr"===r.direction?"ltr":"rtl"===r.direction?"rtl":"auto",listOptions:r.listOptions,disabled:!!r.disabled,clearable:!!r.clearable,hasOpenIndicator:!!r.hasOpenIndicator,placeholder:r.placeholder,sortSelectedItems:!!r.sortSelectedItems,sortListItems:!!r.sortListItems,sortListCheckedFirst:!!r.sortListCheckedFirst,stickyValues:Array.isArray(r.stickyValues)?new Set(r.stickyValues):null,sortItemComparator:r.sortItemComparator,splitListCheckedGroups:!!r.splitListCheckedGroups,treatGroupSelectionAsItems:r.treatGroupSelectionAsItems,blurOnSingleSelection:r.blurOnSingleSelection,multi:r.multi,showSelection:r.showSelection,showPlaceholderInTooltip:r.showPlaceholderInTooltip,multiPlaceholderFormatter:r.multiPlaceholderFormatter,searchable:r.searchable,noResultsText:r.noResultsText,filterThrottleWindow:r.filterThrottleWindow,filterOnEmptyTerm:r.filterOnEmptyTerm,labelProp:r.labelProp,valueProp:r.valueProp,multiItemLabelProp:r.multiItemLabelProp,maxMultiItems:r.maxMultiItems,multiItemsRestLabelProvider:r.multiItemsRestLabelProvider,renderSingleItem:r.renderSingleItem,unrenderSingleItem:r.unrenderSingleItem,renderMultiItem:r.renderMultiItem,unrenderMultiItem:r.unrenderMultiItem,renderRestMultiItem:r.renderRestMultiItem,unrenderRestMultiItem:r.unrenderRestMultiItem,renderNoResultsItem:r.renderNoResultsItem,unrenderNoResultsItem:r.unrenderNoResultsItem,filterFn:r.filterFn,on:r.on||null,silenceEvents:!0,mitt:l(),isLoadingMode:!!r.isLoadingMode,items:[],filteredItems:null,currentItemsView:[],itemsChanged:!0,sink:new i,resizeObserver:null,selectedItems:[],selectedValues:[],selectionChanged:!0,resortBySelectionNeeded:!1,throttledUpdateListItems:fa((()=>this._updateListItems()),r.filterThrottleWindow,{leading:!0,trailing:!0}),filterTerm:""};let o=r.el;o instanceof Element?n.ownsEl=!1:o=e.createElement("span"),e.setElementAttrs(o,{role:"combobox","aria-haspopup":"true","aria-expanded":"false"}),n.el=o,this._syncBaseClasses(),this._renderBase(),n.multiItemEls=[],this.enable(!n.disabled),this._setupDropdownMenu(),n.sink.add(o,"click",(e=>{n.clearButtonWrapper&&n.clearButtonWrapper.contains(e.target)||o.contains(document.activeElement)||(n.input.focus(),n.input.selectionStart=n.input.selectionEnd=n.input.value.length)})),n.sink.add(o,"focus",(e=>{const t=e.target;if(!o.contains(e.relatedTarget)&&!Sa(t,"".concat(n.baseClassName,"__search_field"))&&!Sa(t,"".concat(n.baseClassName,"__item"))){let e=o.querySelector(".".concat(n.baseClassName,"__search_field"));e&&e.focus()}}),!0),n.sink.add(n.input,"keydown",(e=>{this._handleInputKeydown(e)})).add(n.input,"input",(()=>{this._resizeInput()}));const a=(()=>{let e;return()=>{e&&clearTimeout(e),e=setTimeout((()=>{t.toggleClass(o,"".concat(n.baseClassName,"__focus"),o.contains(document.activeElement))}))}})();if(n.sink.add(o,"focus",a,!0),n.sink.add(o,"blur",a,!0),n.sink.add(window,"resize",(()=>this._resizeInput())),n.sink.add(window,"orientationchange",(()=>this._resizeInput())),void 0!==window.ResizeObserver){let e={borderBoxSize:{blockSize:null,inlineSize:null},contentBoxSize:{blockSize:null,inlineSize:null}};n.resizeObserver=new ResizeObserver((t=>{if(this[ba])return;const s=t[0];e&&s.borderBoxSize[0].blockSize===e.borderBoxSize.blockSize&&s.borderBoxSize[0].inlineSize===e.borderBoxSize.inlineSize&&s.contentBoxSize[0].blockSize===e.contentBoxSize.blockSize&&s.contentBoxSize[0].inlineSize===e.contentBoxSize.inlineSize||(n.resizeObserver.unobserve(n.el),this._resizeInput(),requestAnimationFrame((()=>n.resizeObserver.observe(n.el)))),e.borderBoxSize=s.borderBoxSize[0],e.contentBoxSize=s.contentBoxSize[0]})),n.resizeObserver.observe(n.el)}return this.setItems(r.items),delete r.items,r.multi&&Array.isArray(r.selectedValues)?this.setSelectedValues(r.selectedValues):null!=r.value&&this.setValue(r.value),this._scheduleSync("full"),this.silenceEvents=!1,this}destroy(){var e;if(this[ba])return;this[ba]=!0;const s=this._p;if(s.syncTimeout&&(clearTimeout(s.syncTimeout),delete s.syncTimeout),this._stopTrackingPresence(),s.sink.remove(),s.dropList&&s.dropList.destroy(),s.throttledUpdateListItems&&s.throttledUpdateListItems.cancel(),this._cleanupSingleWrapper(),s.unrenderMultiItem||s.unrenderRestMultiItem)for(;s.multiItemEls.length>0;)this._removeMultiItemElementByIndex(s.multiItemEls.length-1);if(t.remove(s.list),t.remove(s.singleWrapper),t.remove(s.input),t.remove(s.inputBackBuffer),t.remove(s.clearButtonWrapper),t.remove(s.openIndicator),!s.ownsEl){for(let e of Array.from(s.el.classList))e.startsWith(s.baseClassName)&&s.el.classList.remove(e);s.el.removeAttribute("role"),s.el.removeAttribute("aria-haspopup"),s.el.removeAttribute("aria-expanded")}null===(e=s.resizeObserver)||void 0===e||e.disconnect(),this._p=null}get el(){return this._p.el}enable(e){const t=this._p;void 0===e&&(e=!0),t.disabled=!e,t.el.setAttribute("aria-disabled",t.disabled.toString()),t.input.disabled=!!t.disabled;const s=t.multiItemEls;for(let e of s)t.disabled?e.removeAttribute("tabindex"):e.setAttribute("tabindex","0");return this}isEnabled(){return!this._p.disabled}disable(e){return this.enable(void 0!==e&&!e)}isDisabled(){return this._p.disabled}setAdditionalClasses(e){return this._p.additionalClasses=e,this._syncBaseClasses(),this}setItems(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const s=this._p;return e||(e=[]),s.items=e.slice(0),s.filteredItems=null,s.itemsChanged=!0,this._updateItemByValueMap(),t&&this.setSelectedValues(this.getSelectedValues()),this._trigger("itemschanged",{term:null,mutated:!0,count:this.getFilteredItemCount()}),this}getFilteredItemCount(){const e=this._p;return e.filteredItems?e.filteredItems.length:e.items?e.items.length:0}isFilterPending(){const e=this._p;return!!(e.throttledUpdateListItems.isScheduled()||!e.filteredItems&&(e.filterTerm||e.filterOnEmptyTerm&&e.filterFn))}updateItemByValue(e,t){const s=this._p;let i=s.itemByValueMap.get(e);i&&Object.assign(i,t),s.dropList&&s.dropList.updateItemByValue(e,t)}getItems(){return this._p.items}setClearable(e){return e=!!e,this._p.clearable===e||(this._p.clearable=!!e,this._scheduleSync("render_clear")),this}getClearable(){return this._p.clearable}setHasOpenIndicator(e){return e=!!e,this._p.hasOpenIndicator===e||(this._p.hasOpenIndicator=e,this._scheduleSync("render_base")),this}getHasOpenIndicator(){return this._p.hasOpenIndicator}setPlaceholder(e){return this._p.placeholder=null==e?"":String(e),this._scheduleSync("render_base"),this}getPlaceHolder(){return this._p.placeholder}setSearchTerm(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=this._p;return s.input?(s.input.value=e,this._scheduleSync("resize_input"),t&&(s.filterTerm=s.input.value.trim(),s.filteredItems=null,s.itemsChanged=!0,this._trigger("search",{value:s.input.value}),s.throttledUpdateListItems()),this):this}getSearchTerm(){const e=this._p;return e.input?e.input.value:""}invokeRefilter(){const e=this._p;return e.filterTerm||e.filterOnEmptyTerm||e.filteredItems?(e.filteredItems=null,e.itemsChanged=!0,e.throttledUpdateListItems(),this):this}setSortSelectedItems(e){const t=this._p;return e=!!e,t.sortSelectedItems===e||(t.sortSelectedItems=e,this._scheduleSync("render_items")),this}isSortSelectedItemsEnabled(){return this._p.sortSelectedItems}setSortListItems(e){const t=this._p;return e=!!e,t.sortListItems===e||(t.sortListItems=e,t.filteredItems=null,t.itemsChanged=!0,this._scheduleSync("render_list")),this}isSortListItemsEnabled(){return this._p.sortListItems}setSortListCheckedFirst(e){const t=this._p;return e=!!e,t.sortCheckedFirst===e||(t.sortCheckedFirst=e,t.itemsChanged=!0,this._scheduleSync("render_list")),this}isSortListCheckedFirstEnabled(){return this._p.sortListCheckedFirst}setStickyValues(e){const t=this._p;return t.stickyValues=Array.isArray(e)?new Set(e):null,t.itemsChanged=!0,this._scheduleSync("render_list"),this}getStickyValues(){return this._p.stickyValues?Array.from(this._p.stickyValues):null}setSortItemComparator(e){const t=this._p;return t.sortItemComparator===e||(t.sortItemComparator=e,t.itemsChanged=!0,this._scheduleSync("render_list")),this}getSortItemComparator(){return this._p.sortItemComparator}setTreatGroupSelectionAsItems(e){const t=this._p;return e=!!e,t.treatGroupSelectionAsItems===e||(t.treatGroupSelectionAsItems=e,t.itemsChanged=!0,this._scheduleSync("render_list")),this}isTreatGroupSelectionAsItemsEnabled(){return!this._p.treatGroupSelectionAsItems}setSplitListCheckedGroups(e){const t=this._p;return e=!!e,t.splitListCheckedGroups===e||(t.splitListCheckedGroups=e,t.itemsChanged=!0,this._scheduleSync("render_list")),this}isSplitListCheckedGroupsEnabled(){return this._p.splitListCheckedGroups}setShowSelection(e){const t=this._p;return e=!!e,t.showSelection===e||(t.showSelection=e,this._scheduleSync("render_items")),this}isShowSelectionEnabled(){return this._p.showSelection}setShowPlaceholderInTooltip(e){const t=this._p;return e=!!e,t.showPlaceholderInTooltip===e||(t.showPlaceholderInTooltip=e,this._scheduleSync("render_base")),this}isShowPlaceholderInTooltipEnabled(){return this._p.showPlaceholderInTooltip}setMultiPlaceholderFormatter(e){const t=this._p;return t.multiPlaceholderFormatter===e||(t.multiPlaceholderFormatter=e,this._scheduleSync("render_base")),this}setBlurOnSingleSelection(e){const t=this._p;return t.blurOnSingleSelection===e||(t.blurOnSingleSelection=e),this}getBlurOnSingleSelection(){return this._p.blurOnSingleSelection}setMulti(e){const s=this._p;return e=!!e,s.multi===e||(s.multi=e,this._setupDropdownMenu(),t.remove(s.clearButtonWrapper),delete s.clearButtonWrapper,e&&s.selectedValues&&1===s.selectedValues.length&&Array.isArray(s.selectedValues[0])&&this.setSelectedValues(s.selectedValues[0]),this._scheduleSync("full")),this}isMultiEnabled(){return this._p.multi}setSearchable(e){const t=this._p;return e=!!e,t.searchable===e||(t.searchable=e,this._scheduleSync("full")),this}isSearchableEnabled(){return this._p.searchable}setNoResultsText(e){return this._p.noResultsText=e,this._scheduleSync("render_list"),this}getNoResultsText(){return this._p.noResultsText}setFilterThrottleWindow(e){const t=this._p;t.filterThrottleWindow=e;let s=!!t.throttledUpdateListItems&&t.throttledUpdateListItems.isScheduled();return t.throttledUpdateListItems&&t.throttledUpdateListItems.cancel(),t.throttledUpdateListItems=fa((()=>this._updateListItems()),t.filterThrottleWindow,!0),s&&t.throttledUpdateListItems(),this}getFilterThrottleWindow(){return this._p.filterThrottleWindow}setFilterOnEmptyTerm(e){const t=this._p;return t.filterOnEmptyTerm===e||(t.filterOnEmptyTerm=e,t.throttledUpdateListItems()),this}getFilterOnEmptyTerm(){return this._p.filterOnEmptyTerm}setListOptions(e){return this._p.listOptions=e,this._setupDropdownMenu(),this}setRenderSingleItem(e,t){const s=this._p;return s.renderSingleItem=e,s.unrenderSingleItem=t,this}setRenderMultiItem(e,t){const s=this._p;return s.renderMultiItem=e,s.unrenderMultiItem=t,this}setRenderRestMultiItem(e,t){const s=this._p;return s.renderRestMultiItem=e,s.unrenderRestMultiItem=t,this}setRenderNoResultsItem(e,t){const s=this._p;return s.renderNoResultsItem=e,s.unrenderNoResultsItem=t,this}setLabelProp(e){const t=this._p;return t.labelProp=e,t.dropList&&t.dropList.setLabelProp(e),this}setValueProp(e){const t=this._p;return t.valueProp===e||(t.valueProp=e,t.dropList&&t.dropList.setValueProp(e),this._updateItemByValueMap()),this}setMultiItemLabelProp(e){return this._p.multiItemLabelProp=e,this}setMaxMultiItems(e){return this._p.maxMultiItems=e,this}setMultiItemsRestLabelProvider(e){return this._p.multiItemsRestLabelProvider=e,this}setFilterFn(e){const t=this._p;return t.filterFn===e||(t.filterFn=e,t.throttledUpdateListItems()),this}getFilterFn(){return this._p.filterFn}focusInput(){const e=this._p;return e.input&&e.input.focus(),this}blurInput(){const e=this._p;return e.input&&e.input.blur(),this}clear(){return this._performClearWithEvent(!0)?(this[ba],this):this}getValue(){const e=this._p;return e.multi?e.selectedValues.slice(0):e.selectedValues.length>0?e.selectedValues[0]:void 0}setValue(e){return this._p.multi?this.setSelectedValues(Array.isArray(e)?e:void 0!==e?[e]:[]):this.setSelectedValues(void 0!==e?[e]:[])}getSelectedValues(){return this._p.selectedValues.slice(0)}setSelectedValues(e){const t=this._p,s=t.valueProp;t.multi||(e=e.slice(0,1));let i=new Set,r=[],n=[];for(let l of e){if(i.has(l))continue;i.add(l),r.push(l);let e=t.itemByValueMap.get(l);void 0!==e?n.push(e):n.push({[s]:l})}return t.selectedValues=r,t.selectedItems=n,t.selectionChanged=!0,t.resortBySelectionNeeded=!0,this._scheduleSync("full"),this}getSelectedValueCount(){return this._p.selectedValues.length}getSelectedItems(){return this._p.selectedItems.slice(0)}setSelectedItems(e){return this._setSelectedItems(e),this}openList(){const e=this._p;return e.dropList.isVisible()||e.isLoadingMode&&0===e.items.length||(this._trigger("open:before",{list:e.dropList}),e.dropList.setDirection(getComputedStyle(e.el).direction),e.dropList.show(this._getDropListPositionOptions()),this._repositionDropList(),this._repositionDropList(),e.dropList.hasFocusedItem()&&e.dropList.setFocusedItemAtIndex(e.dropList.getFocusedItemIndex())),this}closeList(){const e=this._p;return this[ba]?this:e.dropList.isVisible()?(e.dropList.hide(),this):this}toggleList(e){const t=this._p;return(void 0===e?!t.dropList.isVisible():e)?this.openList():this.closeList()}isListOpen(){return!!this._p.dropListVisible}toggleLoading(e){return this.setIsLoadingMode(void 0===e?!this.getIsLoadingMode():!!e)}setIsLoadingMode(e){const t=this._p;return e=void 0===e||!!e,t.isLoadingMode===e||(t.isLoadingMode=e,t.isLoadingMode&&0===t.items.length&&this.isListOpen()?this.closeList():!t.isLoadingMode&&document.activeElement&&((t.multi||t.searchable)&&t.input.contains(document.activeElement)||!t.multi&&!t.searchable&&t.el.contains(document.activeElement))&&this.openList(),this._scheduleSync("render_base")),this}getIsLoadingMode(){return this._p.isLoadingMode}setDirection(e){return this._p.direction="ltr"===e?"ltr":"rtl"===e?"rtl":"auto",this._syncBaseClasses(),this}getDirection(){return this._p.direction}refreshSize(){return this._resizeInput(),this}on(e,t){return this._p.mitt.on(e,t),this}once(e,t){let s=i=>{this._p.mitt.off(e,s),t(i)};return this._p.mitt.on(e,s),this}off(e,t){return e||e?this._p.mitt.off(e,t):this._p.mitt.all.clear(),this}emit(e,t){return this._p.mitt.emit(e,t),this}_updateItemByValueMap(){const e=this._p,t=e.itemByValueMap=new Map,s=e.valueProp;for(let i of e.items)t.set(i[s],i)}_renderBase(){const s=this._p;if(s.inputBackBuffer||(s.inputBackBuffer=e.createElement("span",{css:{position:"absolute",zIndex:-1,left:0,top:"-9999px",whiteSpace:"pre"}})),s.input||(s.inputWrapper=e.createElement("span",{class:"".concat(s.baseClassName,"__search_wrapper")},s.input=e.createElement("input",{class:"".concat(s.baseClassName,"__search_field"),type:"search",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox","aria-autocomplete":"list",readOnly:!(s.searchable||s.multi)}))),s.multi){if(s.singleWrapper&&(this._cleanupSingleWrapper(),t.remove(s.singleWrapper),delete s.singleWrapper),!s.list){this._unregisterDropdownEvents();const t=document.activeElement;s.list=e.createElement("ul",{class:"".concat(s.baseClassName,"__list")}),s.el.appendChild(s.list),s.list.appendChild(s.inputWrapper),s.el.classList.remove("".concat(s.baseClassName,"__single")),s.el.classList.add("".concat(s.baseClassName,"__multi")),s.sink.add(s.list,"click",(t=>{e.closestUntil(t.target,".".concat(s.baseClassName,"__item_remove"),t.currentTarget)&&(s.disabled||this._removeMultiItemFromEvent(e.closestUntil(t.target,".".concat(s.baseClassName,"__item"),t.currentTarget),t))})).add(s.list,"keydown",(t=>{e.closestUntil(t.target,".".concat(s.baseClassName,"__item"),t.currentTarget)&&this._handleMultiKeydown(t)})),t===s.input&&s.input.focus(),this._registerDropdownEvents()}}else if(s.list&&(t.remove(s.list),s.sink.remove(s.list),delete s.list),!s.singleWrapper){this._unregisterDropdownEvents();const t=document.activeElement;s.singleWrapper=e.createElement("div",{class:"".concat(s.baseClassName,"__single_wrapper")}),s.el.appendChild(s.singleWrapper),s.el.appendChild(s.inputWrapper),s.el.classList.remove("".concat(s.baseClassName,"__multi")),s.el.classList.add("".concat(s.baseClassName,"__single")),t===s.input&&s.input.focus(),this._registerDropdownEvents()}s.hasOpenIndicator!==!!s.openIndicator&&(s.hasOpenIndicator?(s.openIndicator=e.createElement("span",{class:"".concat(s.baseClassName,"__open_indicator")}),s.el.appendChild(s.openIndicator)):(t.remove(s.openIndicator),delete s.openIndicator,s.el.classList.remove("".concat(s.baseClassName,"__has_open_indicator")))),s.isLoadingMode!==!!s.spinner&&(s.isLoadingMode?(s.spinner=e.createElement("span",{class:"".concat(s.baseClassName,"__spinner")}),s.el.appendChild(s.spinner),s.el.classList.add("".concat(s.baseClassName,"__has_spinner"))):(t.remove(s.spinner),delete s.spinner,s.el.classList.remove("".concat(s.baseClassName,"__has_spinner"))))}_syncBaseClasses(){const e=this._p,t=e.el;if(!t)return;let s=[e.baseClassName];e.multi?s.push("".concat(e.baseClassName,"__multi")):s.push("".concat(e.baseClassName,"__single")),this.isListOpen()?s.push("".concat(e.baseClassName,"__open_list")):s.push("".concat(e.baseClassName,"__closed_list")),e.hasOpenIndicator&&s.push("".concat(e.baseClassName,"__has_open_indicator")),e.clearButtonWrapper&&s.push("".concat(e.baseClassName,"__has_clear")),e.isLoadingMode&&s.push("".concat(e.baseClassName,"__has_spinner")),0===e.selectedValues.length&&s.push("".concat(e.baseClassName,"__empty_selection")),e.selectedValues.length>0&&s.push("".concat(e.baseClassName,"__has_selection")),(e.searchable||e.multi)&&s.push("".concat(e.baseClassName,"__searchable")),"ltr"!==e.direction&&"rtl"!==e.direction||s.push("".concat(e.baseClassName,"__")+e.direction),e.additionalClasses&&(s=s.concat(e.additionalClasses)),t.className=s.join(" ")}_setupDropdownMenu(){const t=this._p,s=t.valueProp;t.dropList&&(t.dropList.destroy(),delete t.dropList,t.itemsChanged=!0,t.selectionChanged=!0,t.resortBySelectionNeeded=!0);const i=t.renderNoResultsItem,r=t.unrenderNoResultsItem,n=(t.listOptions||{}).renderItem,l=(t.listOptions||{}).unrenderItem,o=i||n?(r,l)=>r&&r[s]===Ia?(i&&!1!==i(r,l)||l.appendChild(e.createElement("div",{class:"droplist-no-results-content",textContent:t.noResultsText})),!0):!!n&&n(r,l):null,a=r||n?(e,t)=>{if(e&&e[s]===Ia){if(r)return r(e,t)}else if(l)return l(e,t);return!1}:null,u=t.dropList=new _a({virtualMinItems:10,...t.listOptions,renderItem:o,unrenderItem:a,multi:t.multi,capturesFocus:!1,labelProp:t.labelProp,valueProp:t.valueProp,on:(e,s)=>{switch(e){case"show:before":{t.dropListVisible=!0,t.el.setAttribute("aria-expanded","true"),t.el.classList.add("".concat(t.baseClassName,"__open_list")),t.el.classList.remove("".concat(t.baseClassName,"__closed_list")),t.resortBySelectionNeeded&&t.sortListCheckedFirst&&t.multi&&(t.itemsChanged=!0),this._updateListItems(),this._trigger("open",{list:u}),this._startTrackingPresence(),t.sink.add(window,"resize.trackposition",(()=>this._repositionDropList()));let e=t.el.parentNode;for(;e;)(e.scrollHeight>e.offsetHeight||e.scrollWidth>e.offsetWidth)&&(e===document.documentElement&&(e=window),t.sink.add(e,"scroll.trackposition",(()=>this._repositionDropList()))),e=e.parentNode}break;case"hide":if(t.dropListVisible=!1,t.el.setAttribute("aria-expanded","false"),t.el.classList.remove("".concat(t.baseClassName,"__open_list")),t.el.classList.add("".concat(t.baseClassName,"__closed_list")),t.multi||(this._setInputText(""),this._scheduleSync("render_base")),this._trigger("close"),this[ba])return;this._stopTrackingPresence(),t.sink.remove(null,".trackposition");break;case"check":{if(!t.multi)return;const e=s.item,i=s.value;let r=s.checked;if(s.isGroup&&!t.treatGroupSelectionAsItems)return;let n={value:i,item:e,cancel:!1};if(this._trigger((r?"addsel":"removesel")+":before",n),n.cancel)return void t.dropList.setItemChecked(i,!r);if(r)t.selectedItems.push(e),t.selectedValues.push(i);else{const e=t.selectedValues.indexOf(i);-1!==e&&(t.selectedItems.splice(e,1),t.selectedValues.splice(e,1))}const l=!!s.isCheckingGroup;t.showSelection&&(r?(1===u.itemCount()&&this._setInputText(""),t.sortSelectedItems?l||this._scheduleSync("full"):(null!=t.maxMultiItems&&(t.treatGroupSelectionAsItems?t.selectedItems:t.selectedItems.filter((e=>!e._group))).length>t.maxMultiItems?this._scheduleSync("addOrUpdateMultiItemRestElement"):this._scheduleSync("addMultiItemElement",e),l||this._scheduleSync("render_base"))):(null!=t.maxMultiItems&&(t.treatGroupSelectionAsItems?t.selectedItems:t.selectedItems.filter((e=>!e._group))).length===t.maxMultiItems?this._scheduleSync("removeMultiItemRestElement"):this._scheduleSync("removeMultiItemElement",e),l||this._scheduleSync("render_base"))),this._trigger(r?"addsel":"removesel",{value:i,item:e})}break;case"groupcheck":if(!t.multi)return;s.affectedItems&&this._scheduleSync(t.sortSelectedItems?"full":"render_base");break;case"select":{if(t.multi)return;const e=s.item,i=s.value;if(!this._performSelectWithEvent(e,i))return;if(this[ba])return;this.closeList(),("touch"===t.blurOnSingleSelection&&ya||"touch"!==t.blurOnSingleSelection&&t.blurOnSingleSelection)&&t.input&&t.input.blur()}}}});t.sink.add(u.el,"mousedown",(t=>{e.closestUntil(t.target,"li",t.currentTarget)&&t.preventDefault()})),this._registerDropdownEvents()}_unregisterDropdownEvents(){this._p.sink.remove(null,".dropdown")}_registerDropdownEvents(){const t=this._p;this._unregisterDropdownEvents();const s=t.dropList;if(!s)return;let i=!1,r=null;const l=t.multi||t.searchable?t.input:t.el;t.sink.add(l,"keydown.dropdown",(e=>{if(e.currentTarget.readOnly)return;let i=!1,r=t.lastKeyAllowsNonTypeKeys;t.lastKeyAllowsNonTypeKeys=!1;let l=t.input&&t.input.value.length>0;switch(e.key){case n.VALUE_PAGE_UP:case n.VALUE_PAGE_DOWN:case n.VALUE_UP:case n.VALUE_DOWN:case n.VALUE_HOME:case n.VALUE_END:if((e.key===n.VALUE_HOME||e.key===n.VALUE_END)&&l&&!r){s._keydownFreeType(e);break}switch(t.lastKeyAllowsNonTypeKeys=!0,e.preventDefault(),e.key){case n.VALUE_PAGE_UP:s.isVisible()&&s.previousPage(e);break;case n.VALUE_PAGE_DOWN:s.isVisible()&&s.nextPage(e);break;case n.VALUE_UP:s.isVisible()?s.previous(e):this._movePrev();break;case n.VALUE_DOWN:s.isVisible()?s.next(e):this._moveNext();break;case n.VALUE_HOME:s.goToFirst(e);break;case n.VALUE_END:s.goToLast(e)}break;case n.VALUE_SPACE:r&&(t.lastKeyAllowsNonTypeKeys=!0,s.isVisible()&&s.hasFocusedItem()&&(i=!0,t.multi?s.toggleFocusedItem(e):s.triggerItemSelection(null,e),e.preventDefault()));break;case n.VALUE_ENTER:s.isVisible()&&s.hasFocusedItem()&&(i=!0,e.preventDefault(),s.triggerItemSelection(null,e));break;case n.VALUE_TAB:s.isVisible()&&s.hasFocusedItem()&&s.triggerItemSelection(null,e);break;case n.VALUE_ESCAPE:s.isVisible()&&(s.hide(e),e.preventDefault());break;default:s._keydownFreeType(e)}i||e.key!==n.VALUE_ENTER&&(e.key!==n.VALUE_SPACE||!t.lastKeyAllowsNonTypeKeys||t.multi||s.hasFocusedItem()||t.disabled)||(this.toggleList(),e.preventDefault(),e.stopPropagation())})),t.input&&t.sink.add(t.input,"input.dropdown",(()=>{t.disabled||(t.filterTerm=t.input.value.trim(),t.filteredItems=null,t.itemsChanged=!0,this._trigger("search",{value:t.input.value}),t.throttledUpdateListItems())})).add(t.input,"click.dropdown",(()=>{t.disabled||!t.multi&&t.searchable&&this.openList()})).add(t.input,"focus.dropdown",(()=>{t.disabled||(this._trigger("search:focus"),this[ba]||(i=!1,this.openList(),i=!0,setTimeout((()=>{i=!1}),10)))})).add(t.input,"blur.dropdown",(()=>{t.disabled||(this._trigger("search:blur"),this[ba]||(t.throttledUpdateListItems&&t.throttledUpdateListItems.cancel(),this.closeList()))})),t.sink.add(t.el,"mousedown.dropdown",(()=>{t.multi||t.searchable||i||t.disabled||this.toggleList(),i=!1})).add(t.el,"touchstart.dropdown",(s=>{if(r)return;if(r=s.changedTouches[0].identifier,this.isDisabled())return;if(e.closestUntil(s.target,".".concat(t.baseClassName,"__item,.").concat(t.baseClassName,"__clear"),t.el))return;let i=()=>{r=null,t.sink.remove(t.el,".dropdown_touchextra")};(t.input||t.el).focus(),t.sink.add(t.el,"touchend.dropdown_touchextra",(e=>{if(!Array.prototype.find.call(s.changedTouches,(e=>e.identifier===r)))return i();e.preventDefault(),i()})).add(t.el,"touchmove.dropdown_touchextra",(e=>{e.preventDefault()})).add(t.el,"touchcancel.dropdown_touchextra",i)}))}_performSelectWithEvent(e,t){let s={value:t,item:e,cancel:!1};return this._trigger("select:before",s),!s.cancel&&!this[ba]&&(this._setSelectedItems([e]),this._trigger("select",{value:t,item:e}),!0)}_performClearWithEvent(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t={cancel:!1};return this._trigger("clear:before",t),!t.cancel&&!this[ba]&&(this._setSelectedItems([]),e&&this._setInputText(""),this._trigger("clear"),!0)}_movePrev(){var e;const t=this._p;if(this.isMultiEnabled())return;let s=this.getSelectedItems(),i=null!==(e=t.filteredItems)&&void 0!==e?e:t.items;if(t.currentItemsView&&t.currentItemsView.length===i.length&&(i=t.currentItemsView),i.length+(t.clearable?1:0)>1){let e=s.length>0?i.indexOf(s[0])-1:i.length-1;-1!==e||t.clearable||(e=i.length-1);let r=-1===e?null:i[e];r?this._performSelectWithEvent(r,r[t.valueProp]):this._performClearWithEvent()}}_moveNext(){var e;const t=this._p;if(this.isMultiEnabled())return;let s=this.getSelectedItems(),i=null!==(e=t.filteredItems)&&void 0!==e?e:t.items;if(t.currentItemsView&&t.currentItemsView.length===i.length&&(i=t.currentItemsView),i.length+(t.clearable?1:0)>1){let e=s.length>0?i.indexOf(s[0])+1:0;e===i.length&&(e=t.clearable?-1:0);let r=-1===e?null:i[e];r?this._performSelectWithEvent(r,r[t.valueProp]):this._performClearWithEvent()}}_updateListItems(){const e=this._p,t=e.dropList;if(!t||!e.dropListVisible)return;if(!e.filteredItems&&(e.filterTerm||e.filterOnEmptyTerm&&e.filterFn)&&this._refilterItems(),(e.itemsChanged||e.selectionChanged)&&(e.dropList._lastSerializedBox=null),e.itemsChanged){let s=e.filteredItems||e.items;(e.sortListItems||e.sortListCheckedFirst&&e.multi)&&(s=this._sortItems(s,e.sortListItems,e.sortListCheckedFirst&&e.multi,e.splitListCheckedGroups)),t.removeAllItems(),0===s.length&&e.noResultsText&&(s=[{[e.labelProp]:e.noResultsText,[e.valueProp]:Ia,_nointeraction:!0,_nocheck:!0}]),t.addItems(s),e.currentItemsView=s,e.itemsChanged=!1,e.selectionChanged=!0,e.resortBySelectionNeeded=!1}let s=!1;if(e.selectionChanged){if(e.multi)e.dropList.setCheckedValues(e.selectedValues);else{const t=e.dropList.itemIndexByValue(this.getValue());e.dropList.setFocusedItemAtIndex(t).setSingleSelectedItemAtIndex(t),s=e.dropList.hasFocusedItem()}e.selectionChanged=!1}this._repositionDropList(),s&&e.dropList.setFocusedItemAtIndex(e.dropList.getFocusedItemIndex())}_refilterItems(){const e=this._p,t=e.filterTerm,s=e.treatGroupSelectionAsItems;if(t||e.filterOnEmptyTerm&&e.filterFn){let i;if("function"==typeof e.filterFn&&(i=e.filterFn(e.items,t)),!Array.isArray(i))if(t){const r=new RegExp(ua(t),"i"),n=e.labelProp,l=e.multiItemLabelProp;i=e.items.filter((e=>!(s||!e._group)||r.test(e[n]||e[l])))}else i=null;if(e.filteredItems=i,i&&!s){let e=-1,t=i.length;for(let s=0;s<t;s++)i[s]._group&&(-1!==e&&e===s-1&&(i.splice(e,1),s--,t--),e=s);-1!==e&&e===t-1&&i.splice(e,1)}}else e.filteredItems=null;this._trigger("itemschanged",{term:t,mutated:!1,count:this.getFilteredItemCount()}),e.itemsChanged=!0}_setSelectedItems(e){const t=this._p,s=t.valueProp;t.multi?(t.selectedItems=e.filter((e=>void 0!==e[s])),t.selectedValues=t.selectedItems.map((e=>e[s]))):(t.selectedItems=e.slice(0,1),t.selectedValues=e.slice(0,1).map((e=>e[s]))),t.selectionChanged=!0,t.resortBySelectionNeeded=!0,this._updateListItems(),this._scheduleSync("full")}_scheduleSync(e,t){const s=this._p;s.syncQueue||(s.syncQueue=[]),("full"===e||"render_items"===e&&!s.syncQueue.some((e=>"full"===e.mode)))&&(s.syncQueue.length=0),0!==s.syncQueue.length&&["full","render_items"].includes(e)||s.syncQueue.push({mode:e,data:t}),s.syncTimeout||(s.syncTimeout=setTimeout((()=>{delete s.syncTimeout;let e=s.syncQueue;delete s.syncQueue,this._performSync(e)})))}_performSync(e){const t=this._p;if(!this[ba])for(let i of e)switch(i.mode){case"full":this._syncFull(!0,!0);break;case"render_base":this._syncFull(!1,!1);break;case"render_items":this._syncFull(!0,!1);break;case"render_list":this._syncFull(!1,!0);break;case"render_clear":this._syncClearButton(),this._resizeInput();break;case"singleItem":this._syncSingleItem();break;case"removeMultiItemElement":if(t.showSelection)this._syncPlaceholder();else{const e=t.valueProp,s=i.data[e];let r=t.multiItemEls.findIndex((t=>t[ga][e]===s));-1!==r&&this._removeMultiItemElementByIndex(r)}break;case"addMultiItemElement":t.showSelection?this._addMultiItemElement(i.data):this._syncPlaceholder();break;case"addOrUpdateMultiItemRestElement":t.showSelection?this._addMultiItemRestElement():this._syncPlaceholder();break;case"removeMultiItemRestElement":if(t.showSelection){var s;let e=t.multiItemEls[t.multiItemEls.length-1];(null==e||null===(s=e[ga])||void 0===s?void 0:s[t.valueProp])===va&&this._removeMultiItemElementByIndex(t.multiItemEls.length-1)}else this._syncPlaceholder();break;case"resize_input":this._resizeInput()}}_cleanupSingleWrapper(){const e=this._p;if(e.singleWrapper){if(e.unrenderSingleItem&&e.singleWrapper.childNodes.length>0)try{e.unrenderSingleItem(e.singleWrapper[ga],e.singleWrapper)}catch(e){console.error(e)}delete e.singleWrapper[ga],e.singleWrapper.innerHTML=""}}_removeMultiItemElementByIndex(e){const s=this._p,i=s.multiItemEls;if(i.length>e){var r;const n=i[e],l=n[ga];let o=(null==l?void 0:l[s.valueProp])===va&&null!==(r=s.unrenderRestMultiItem)&&void 0!==r?r:s.unrenderMultiItem;if(o&&n.childNodes.length>0)try{o(l,n)}catch(e){console.error(e)}t.remove(n),e===i.length-1?i.pop():i.splice(e,1)}}_renderSingleItemContent(e){const t=this._p;if(!t.renderSingleItem||!1===t.renderSingleItem(e,t.singleWrapper)){const s=t.labelProp;let i=e[t.multiItemLabelProp]||e[s];null==i&&(i=""),t.singleWrapper.appendChild(document.createTextNode(i))}}_renderMultiItemContent(t,s){var i;const r=this._p;let n=t[r.valueProp]===va&&null!==(i=r.renderRestMultiItem)&&void 0!==i?i:r.renderMultiItem;if(!n||!1===n(t,s)){const i=r.labelProp,n=t[r.multiItemLabelProp]||t[i];s.appendChild(e.createElement("span",{textContent:n}))}}_addMultiItemElement(e){const s=this._p,i=this._renderMultiItem(e);return!!i&&(t.before(s.inputWrapper,i),s.multiItemEls.push(i),!0)}_addMultiItemRestElement(){const e=this._p;let t=e.selectedItems.slice(0),s=(e.treatGroupSelectionAsItems?t:t.filter((e=>!e._group))).length-e.maxMultiItems,i=e.multiItemsRestLabelProvider?e.multiItemsRestLabelProvider(s,t):"+ ".concat(s);this._addMultiItemElement({items:t,[e.valueProp]:va,[e.labelProp]:i})}_syncClearButton(){const s=this._p,i=s.multiItemLabelProp;s.selectedItems.length>0&&s.selectedItems.some((e=>!1!==e[i]))&&s.clearable&&s.showSelection?s.clearButtonWrapper||(s.clearButtonWrapper=e.createElement(s.multi?"li":"span",{class:"".concat(s.baseClassName,"__clear")},s.clearButton=e.createElement("button")),s.multi?t.append(s.list,s.clearButtonWrapper):t.append(s.el,s.clearButtonWrapper),s.el.classList.add("".concat(s.baseClassName,"__has_clear")),s.sink.add(s.clearButton,"click",(()=>{this.isDisabled()||this.clear()}))):s.clearButtonWrapper&&(s.sink.remove(s.clearButton,"click"),t.remove(s.clearButtonWrapper),delete s.clearButtonWrapper,delete s.clearButton,s.el.classList.remove("".concat(s.baseClassName,"__has_clear")))}_syncPlaceholder(){const e=this._p,t=e.multiItemLabelProp;let s="";e.multi&&!e.showSelection?s="function"==typeof e.multiPlaceholderFormatter?e.multiPlaceholderFormatter(e.selectedItems):((e,t)=>{if(0===e.length)return"";let s=e[0][t]+"";return e.length>1&&(s+=" (+".concat(e.length-1,")")),s})(e.selectedItems,e.labelProp):0!==e.selectedItems.length&&e.showSelection&&!e.selectedItems.every((e=>!1===e[t]))||(s=null==e.placeholder?"":e.placeholder+""),e.input.setAttribute("placeholder",s),e.showPlaceholderInTooltip?e.input.setAttribute("title",s):e.input.removeAttribute("title")}_syncSingleItem(){const e=this._p;e.singleWrapper&&this._cleanupSingleWrapper();const t=e.selectedItems;t.length>0&&(this._renderSingleItemContent(t[0]),e.singleWrapper[ga]=t[0])}_syncFull(e,s){const i=this._p,r=i.multiItemLabelProp;if(this._renderBase(),this._syncClearButton(),this._syncPlaceholder(),(e=i.multi&&i.showSelection&&(e||i.selectedItems.filter((e=>!1!==e[r])).length!==i.multiItemEls.length))||!i.showSelection||!i.multi)for(;i.multiItemEls.length>0;)this._removeMultiItemElementByIndex(i.multiItemEls.length-1);if(i.multi){if(e){const e=i.selectedItems,t=i.treatGroupSelectionAsItems;if(i.sortSelectedItems){const t=i.labelProp,s=i.multiItemLabelProp,r=i.valueProp,n=i.stickyValues,l=i.sortItemComparator||((e,i)=>{if(null!==n){let t=n.has(e[r]),s=n.has(i[r]);if(t&&!s)return-1;if(!t&&s)return 1}const l=e[s]||e[t],o=i[s]||i[t];return l<o?-1:l>o?1:0});e.sort(l),i.selectedValues=e.map((e=>e[r]))}let s=0,r=i.maxMultiItems,n=!1;for(let i=0;i<e.length;i++)if(t||!e[i]._group){if(null!=r&&s===r){n=!0;break}this._addMultiItemElement(e[i])&&s++}n&&this._addMultiItemRestElement()}}else i.multi||this._syncSingleItem();return t.getRootNode(i.el)!==document||(t.toggleClass(i.el,"".concat(i.baseClassName,"__empty_selection"),0===i.selectedValues.length),t.toggleClass(i.el,"".concat(i.baseClassName,"__has_selection"),i.selectedValues.length>0),i.searchable||i.multi?(i.input&&(i.input.readOnly=!1),i.el.classList.add("".concat(i.baseClassName,"__searchable"))):(i.input&&(i.input.readOnly=!0),i.el.classList.remove("".concat(i.baseClassName,"__searchable"))),this._resizeInput(),s&&this._updateListItems()),this}_trigger(e,t){const s=this._p;s.on&&s.on(e,...void 0===t?[]:[t]),s.mitt.emit(e,t)}_renderMultiItem(t){var s;const i=this._p,r=i.labelProp,n=null!==(s=t[i.multiItemLabelProp])&&void 0!==s?s:t[r];if(!1===n)return null;const l=e.createElement("li",{class:"".concat(i.baseClassName,"__item"),tabindex:"0",title:n},[e.createElement("span",{class:"".concat(i.baseClassName,"__item_remove"),role:"presentation"})]);return this._renderMultiItemContent(t,l),l[ga]=t,l}_removeMultiItemFromEvent(t,s){const i=this._p;let r;if(/key/.test(s.type)){const l=s;l.key===n.VALUE_DELETE?r=e.next(t,".".concat(i.baseClassName,"__item,.").concat(i.baseClassName,"__search_wrapper")):l.key===n.VALUE_BACK_SPACE&&(r=e.prev(t,".".concat(i.baseClassName,"__item,.").concat(i.baseClassName,"__search_wrapper")))}else/click|mouse|touch/.test(s.type)&&(r=e.next(t,".".concat(i.baseClassName,"__item,.").concat(i.baseClassName,"__search_wrapper")));const l=t[ga],o=l[i.valueProp];if(void 0!==l)if(o===va){let e=(i.treatGroupSelectionAsItems?i.selectedItems:i.selectedItems.filter((e=>!e._group))).slice(i.maxMultiItems),t=[];for(let s of e){let e={value:o,item:s,cancel:!1};this._trigger("removesel:before",e),e.cancel||t.push(s)}if(t.length>0){this._removeMultiItemElementByIndex(i.multiItemEls.length-1);for(let e of t){let t=i.selectedItems.indexOf(e);-1===t&&(t=i.selectedValues.indexOf(o[i.valueProp])),-1!==t&&(i.selectedItems.splice(t,1),i.selectedValues.splice(t,1),i.selectionChanged=!0,i.resortBySelectionNeeded=!0)}}e.length>t.length&&this._addMultiItemRestElement(),t.length>0&&this._scheduleSync("render_list")}else{let e={value:o,item:l,cancel:!1};if(this._trigger("removesel:before",e),e.cancel)return this;this._removeMultiItem(l),this._trigger("removesel",{value:o,item:l})}return r||(r=i.el.querySelector(".".concat(i.baseClassName,"__item, .").concat(i.baseClassName,"__search_field"))),Sa(r,"".concat(i.baseClassName,"__search_wrapper"))&&(r=r.querySelector("input")),r&&r.focus(),this}_removeMultiItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=this._p,i=s.valueProp,r=s.labelProp,n=e[i];let l=s.selectedItems.indexOf(e);-1===l&&(l=s.selectedValues.indexOf(n)),-1!==l&&(s.selectedItems.splice(l,1),s.selectedValues.splice(l,1),s.selectionChanged=!0,s.resortBySelectionNeeded=!0),l=s.multiItemEls.findIndex((t=>t[ga]===e)),-1===l&&(l=s.multiItemEls.findIndex((e=>e[ga][i]===n))),-1!==l&&this._removeMultiItemElementByIndex(l),t&&(this._setInputText(e[s.multiItemLabelProp]||e[r]),s.input.focus(),s.input.selectionStart=s.input.selectionEnd=s.input.value.length),this._scheduleSync("render_list")}_setInputText(e){const t=this._p;t.input.value=null==e?"":String(e),t.filterTerm="",t.filteredItems=null,t.itemsChanged=!0}_resizeInput(){const e=this._p,i=e.el;if(!i.parentNode||!document.body.contains(i))return this;const r=e.input,n=e.inputBackBuffer;let l=r.value||r.placeholder;t.toggleClass(i,"".concat(e.baseClassName,"__has_input"),!!l),t.toggleClass(i,"".concat(e.baseClassName,"__empty_input"),!l);let o=!1;if(e.multi&&0===e.multiItemEls.length&&e.showSelection){r.style.width="";let t=0,n=0,l=getComputedStyle(e.list||i,"::before");l.content&&"none"!==l.content&&"absolute"!==l.position&&"none"!==l.float&&(t=s.getPseudoElementWidth(e.list||i,"::before",!0,!0,!0));let a=getComputedStyle(e.list||i,"::after");a.content&&"none"!==a.content&&"absolute"!==a.position&&"none"!==a.float&&(n=s.getPseudoElementWidth(e.list||i,"::after",!0,!0,!0));let u=s.getElementWidth(e.list||i);u-=t+n,r.style.width="".concat(u,"px"),o=!0}else{s.setCssProps(n,s.getCssProps(r,Ea)),n.textContent=l,i.appendChild(n);const a=getComputedStyle(r),u=(parseFloat(a.paddingLeft)||0)+(parseFloat(a.paddingRight)||0),c=.75*(parseFloat(a["font-size"])||0)+u,d=s.getElementWidth(n,!0,!0),h=s.getElementWidth(r,!0,!0);let m=Math.max(d,c);if(m!==h){s.setElementWidth(r,m,!0,!0);let t=(parseFloat(a.borderLeftWidth)||0)+(parseFloat(a.borderRightWidth)||0),i=r.scrollWidth+t;if(i>m){let e=i-m;r.style.width="".concat(parseFloat(r.style.width)+e,"px"),m+=e}if(e.singleWrapper&&(e.singleWrapper.style.width="",l)){let i=m-u-t;s.getElementWidth(e.singleWrapper,!1,!1)<i&&s.setElementWidth(e.singleWrapper,i,!1,!1)}o=!0}t.remove(n)}return o&&this._trigger("input:resize"),this}_repositionDropList(){const e=this._p,t=e.el;if(!e.dropList||!e.dropListVisible||!e.dropList.isVisible())return this;const s=t.getBoundingClientRect(),i=s.left+","+s.top+","+s.right+","+s.bottom;return e.dropList._lastSerializedBox!==i&&(e.dropList.relayout(this._getDropListPositionOptions()),e.dropList._lastSerializedBox=i),this}_handleInputKeydown(e){const t=this._p,s=e.target;if(e.key===n.VALUE_BACK_SPACE&&e.ctrlKey&&0===s.value.length)this.clear(),e.preventDefault();else if(e.key===n.VALUE_BACK_SPACE&&0===s.value.length){const s=t.multiItemEls[t.multiItemEls.length-1];if(!s||void 0===s[ga].value)return;const i=s[ga],r=i[t.valueProp];let n={value:r,item:i,cancel:!1};if(this._trigger("removesel:before",n),n.cancel)return;this._removeMultiItem(i,!0),this._trigger("removesel",{value:r,item:i}),e.preventDefault()}}_handleMultiKeydown(t){const s=this._p;if(s.disabled)return;const i="rtl"===getComputedStyle(s.el).direction;let r;if(t.key===(i?n.VALUE_LEFT:n.VALUE_RIGHT))r=e.next(t.target,".".concat(s.baseClassName,"__item,.").concat(s.baseClassName,"__search_wrapper")),Sa(r,"".concat(s.baseClassName,"__search_wrapper"))&&(r=r.querySelector("input")),r&&r.focus(),t.preventDefault();else if(t.key===(i?n.VALUE_RIGHT:n.VALUE_LEFT))r=e.prev(t.target,".".concat(s.baseClassName,"__item,.").concat(s.baseClassName,"__search_wrapper")),Sa(r,"".concat(s.baseClassName,"__search_wrapper"))&&(r=r.querySelector("input")),r&&r.focus(),t.preventDefault();else if(t.key===n.VALUE_BACK_SPACE&&t.ctrlKey){const i=[];let r=t.target;for(;r;)i.push(r),r=e.prev(r,".".concat(s.baseClassName,"__item"));for(;i.length;)this._removeMultiItemFromEvent(i.shift(),t);t.preventDefault()}else t.key!==n.VALUE_DELETE&&t.key!==n.VALUE_BACK_SPACE||(this._removeMultiItemFromEvent(e.closestUntil(t.target,".".concat(s.baseClassName,"__item"),s.el),t),t.preventDefault())}_getDropListPositionOptions(){return{target:this._p.el,offset:{x:0,y:0},anchor:{x:"start",y:"bottom"},position:{x:"start",y:"top"},updateWidth:!0}}_startTrackingPresence(){const e=this._p;this._stopTrackingPresence(),e.presenceInt=setInterval((function(){t.getRootNode(e.el)!==document&&this.hide()}),200)}_stopTrackingPresence(){const e=this._p;e.presenceInt&&(clearInterval(e.presenceInt),e.presenceInt=null)}_sortItems(e,t,s,i){const r=this._p;if(!t&&!s)return e;const n=r.labelProp,l=r.multiItemLabelProp,o=r.valueProp,a=r.stickyValues,u=r.sortItemComparator||((e,t)=>{if(null!==a){let s=a.has(e[o]),i=a.has(t[o]);if(s&&!i)return-1;if(!s&&i)return 1}const s=e[n]||e[l],i=t[n]||t[l];return s<i?-1:s>i?1:0});let c=[],d=null,h=[c];const m=new Set(r.selectedValues);let p,_,f;for(_=0,f=e.length;_<f;_++)p=e[_],p._group&&c.length&&(c=[],h.push(c)),c.push(p);c.length||(h.length=0),a&&e.length>0&&!e[0]._group&&(d=h[0].filter((e=>a.has(e[o]))),d.length>0?(h[0]=h[0].filter((e=>!a.has(e[o]))),0===h[0].length&&h.shift()):d=null),t&&h.sort(((e,t)=>{if(e=e[0],t=t[0],null!==a){let s=a.has(e[o]),i=a.has(t[o]);if(s&&!i)return-1;if(!s&&i)return 1}return!e._group&&t._group?-1:e._group&&!t._group?1:u(e,t)})),d&&h.unshift(d);const g=[],b=[];for(let e=0,i=h.length;e<i;e++)c=h[e],c.sort(((e,i)=>{if(e._group&&!i._group)return-1;if(!e._group&&i._group)return 1;if(s){const t=m.has(e[o]),s=m.has(i[o]);if(t&&!s)return-1;if(!t&&s)return 1}return t?u(e,i):0})),b.push(c);if(s&&i){let e;for(let t=0,s=h.length;t<s;t++)if(c=h[t],c!==d){e=null;for(let t=0,s=c.length;t<s;t++)if(p=c[t],!p._group){if(!m.has(p[r.valueProp]))break;e||(e=[],c[0]._group&&e.push(c[0])),e.push(p),c.splice(t--,1),s--}if(e&&(g.push(e),0===c.length||1===c.length&&c[0]._group)){h.splice(t--,1),s--;let e=b.indexOf(c);-1!==e&&b.splice(e,1)}}else{g.push(d);let e=b.indexOf(d);-1!==e&&b.splice(e,1)}}const I=[];I.length=e.length;let v=0;h=g.length?g.concat(b):b;for(let e=0,t=h.length;e<t;e++)for(c=h[e],_=0,f=c.length;_<f;_++)I[v++]=c[_];return I}};
5
+ "use strict";var e=require("@danielgindi/dom-utils/lib/Dom"),t=require("@danielgindi/dom-utils/lib/DomCompat"),s=require("@danielgindi/dom-utils/lib/Css"),i=require("@danielgindi/dom-utils/lib/DomEventsSink"),r=require("@danielgindi/virtual-list-helper"),n=require("keycode-js"),l=require("mitt"),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=function(e){return e&&e.Math===Math&&e},u=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof o&&o)||a("object"==typeof o&&o)||function(){return this}()||Function("return this")(),c="object"==typeof document&&document.all,d=void 0===c&&void 0!==c?function(e){return"function"==typeof e||e===c}:function(e){return"function"==typeof e},h=d,m=function(e){return"object"==typeof e?null!==e:h(e)},p=m,_=u.document,f=p(_)&&p(_.createElement),g=function(e){return f?_.createElement(e):{}},b=g("span").classList,I=b&&b.constructor&&b.constructor.prototype,v=I===Object.prototype?void 0:I,y=function(e){try{return!!e()}catch(e){return!0}},S=!y((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),E=S,L=Function.prototype,C=L.call,w=E&&L.bind.bind(C,C),k=E?w:function(e){return function(){return C.apply(e,arguments)}},x=k,T=x({}.toString),P=x("".slice),O=function(e){return P(T(e),8,-1)},A=y,N=O,V=Object,M=k("".split),F=A((function(){return!V("z").propertyIsEnumerable(0)}))?function(e){return"String"===N(e)?M(e,""):V(e)}:V,W=function(e){return null==e},B=W,D=TypeError,R=function(e){if(B(e))throw new D("Can't call method on "+e);return e},U=F,H=R,G=function(e){return U(H(e))},z={exports:{}},j=u,K=Object.defineProperty,$=function(e,t){try{K(j,e,{value:t,configurable:!0,writable:!0})}catch(s){j[e]=t}return t},q=$,Q="__core-js_shared__",Y=u[Q]||q(Q,{}),X=(z.exports,Y);(z.exports=function(e,t){return X[e]||(X[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.35.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE",source:"https://github.com/zloirock/core-js"});var J,Z,ee=z.exports,te=R,se=Object,ie=function(e){return se(te(e))},re=ie,ne=k({}.hasOwnProperty),le=Object.hasOwn||function(e,t){return ne(re(e),t)},oe=k,ae=0,ue=Math.random(),ce=oe(1..toString),de=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ce(++ae+ue,36)},he=u,me="undefined"!=typeof navigator&&String(navigator.userAgent)||"",pe=he.process,_e=he.Deno,fe=pe&&pe.versions||_e&&_e.version,ge=fe&&fe.v8;ge&&(Z=(J=ge.split("."))[0]>0&&J[0]<4?1:+(J[0]+J[1])),!Z&&me&&(!(J=me.match(/Edge\/(\d+)/))||J[1]>=74)&&(J=me.match(/Chrome\/(\d+)/))&&(Z=+J[1]);var be,Ie=Z,ve=y,ye=u.String,Se=!!Object.getOwnPropertySymbols&&!ve((function(){var e=Symbol("symbol detection");return!ye(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ie&&Ie<41})),Ee=Se&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Le=ee,Ce=le,we=de,ke=Se,xe=Ee,Te=u.Symbol,Pe=Le("wks"),Oe=xe?Te.for||Te:Te&&Te.withoutSetter||we,Ae=function(e){return Ce(Pe,e)||(Pe[e]=ke&&Ce(Te,e)?Te[e]:Oe("Symbol."+e)),Pe[e]},Ne=m,Ve=String,Me=TypeError,Fe=function(e){if(Ne(e))return e;throw new Me(Ve(e)+" is not an object")},We={},Be=!y((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),De=Be&&y((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Re={},Ue=g,He=!Be&&!y((function(){return 7!==Object.defineProperty(Ue("div"),"a",{get:function(){return 7}}).a})),Ge=S,ze=Function.prototype.call,je=Ge?ze.bind(ze):function(){return ze.apply(ze,arguments)},Ke=u,$e=d,qe=function(e,t){return arguments.length<2?(s=Ke[e],$e(s)?s:void 0):Ke[e]&&Ke[e][t];var s},Qe=k({}.isPrototypeOf),Ye=qe,Xe=d,Je=Qe,Ze=Object,et=Ee?function(e){return"symbol"==typeof e}:function(e){var t=Ye("Symbol");return Xe(t)&&Je(t.prototype,Ze(e))},tt=String,st=d,it=function(e){try{return tt(e)}catch(e){return"Object"}},rt=TypeError,nt=function(e){if(st(e))return e;throw new rt(it(e)+" is not a function")},lt=nt,ot=W,at=function(e,t){var s=e[t];return ot(s)?void 0:lt(s)},ut=je,ct=d,dt=m,ht=TypeError,mt=je,pt=m,_t=et,ft=at,gt=function(e,t){var s,i;if("string"===t&&ct(s=e.toString)&&!dt(i=ut(s,e)))return i;if(ct(s=e.valueOf)&&!dt(i=ut(s,e)))return i;if("string"!==t&&ct(s=e.toString)&&!dt(i=ut(s,e)))return i;throw new ht("Can't convert object to primitive value")},bt=TypeError,It=Ae("toPrimitive"),vt=function(e,t){if(!pt(e)||_t(e))return e;var s,i=ft(e,It);if(i){if(void 0===t&&(t="default"),s=mt(i,e,t),!pt(s)||_t(s))return s;throw new bt("Can't convert object to primitive value")}return void 0===t&&(t="number"),gt(e,t)},yt=et,St=function(e){var t=vt(e,"string");return yt(t)?t:t+""},Et=Be,Lt=He,Ct=De,wt=Fe,kt=St,xt=TypeError,Tt=Object.defineProperty,Pt=Object.getOwnPropertyDescriptor,Ot="enumerable",At="configurable",Nt="writable",Vt=(Re.f=Et?Ct?function(e,t,s){if(wt(e),t=kt(t),wt(s),"function"==typeof e&&"prototype"===t&&"value"in s&&Nt in s&&!s[Nt]){var i=Pt(e,t);i&&i[Nt]&&(e[t]=s.value,s={configurable:At in s?s[At]:i[At],enumerable:Ot in s?s[Ot]:i[Ot],writable:!1})}return Tt(e,t,s)}:Tt:function(e,t,s){if(wt(e),t=kt(t),wt(s),Lt)try{return Tt(e,t,s)}catch(e){}if("get"in s||"set"in s)throw new xt("Accessors not supported");return"value"in s&&(e[t]=s.value),e},Math.ceil),Mt=Math.floor,Ft=Math.trunc||function(e){var t=+e;return(t>0?Mt:Vt)(t)},Wt=function(e){var t=+e;return t!=t||0===t?0:Ft(t)},Bt=Wt,Dt=Math.max,Rt=Math.min,Ut=Wt,Ht=Math.min,Gt=function(e){var t=Ut(e);return t>0?Ht(t,9007199254740991):0},zt=Gt,jt=G,Kt=function(e,t){var s=Bt(e);return s<0?Dt(s+t,0):Rt(s,t)},$t=function(e){return zt(e.length)},qt=function(e){return function(t,s,i){var r,n=jt(t),l=$t(n),o=Kt(i,l);if(e&&s!=s){for(;l>o;)if((r=n[o++])!=r)return!0}else for(;l>o;o++)if((e||o in n)&&n[o]===s)return e||o||0;return!e&&-1}},Qt={includes:qt(!0),indexOf:qt(!1)},Yt={},Xt=le,Jt=G,Zt=Qt.indexOf,es=Yt,ts=k([].push),ss=function(e,t){var s,i=Jt(e),r=0,n=[];for(s in i)!Xt(es,s)&&Xt(i,s)&&ts(n,s);for(;t.length>r;)Xt(i,s=t[r++])&&(~Zt(n,s)||ts(n,s));return n},is=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rs=ss,ns=is,ls=Object.keys||function(e){return rs(e,ns)},os=Be,as=De,us=Re,cs=Fe,ds=G,hs=ls,ms=(We.f=os&&!as?Object.defineProperties:function(e,t){cs(e);for(var s,i=ds(t),r=hs(t),n=r.length,l=0;n>l;)us.f(e,s=r[l++],i[s]);return e},qe("document","documentElement")),ps=de,_s=ee("keys"),fs=function(e){return _s[e]||(_s[e]=ps(e))},gs=Fe,bs=We,Is=is,vs=Yt,ys=ms,Ss=g,Es="prototype",Ls="script",Cs=fs("IE_PROTO"),ws=function(){},ks=function(e){return"<"+Ls+">"+e+"</"+Ls+">"},xs=function(e){e.write(ks("")),e.close();var t=e.parentWindow.Object;return e=null,t},Ts=function(){try{be=new ActiveXObject("htmlfile")}catch(e){}var e,t,s;Ts="undefined"!=typeof document?document.domain&&be?xs(be):(t=Ss("iframe"),s="java"+Ls+":",t.style.display="none",ys.appendChild(t),t.src=String(s),(e=t.contentWindow.document).open(),e.write(ks("document.F=Object")),e.close(),e.F):xs(be);for(var i=Is.length;i--;)delete Ts[Es][Is[i]];return Ts()};vs[Cs]=!0;var Ps=Object.create||function(e,t){var s;return null!==e?(ws[Es]=gs(e),s=new ws,ws[Es]=null,s[Cs]=e):s=Ts(),void 0===t?s:bs.f(s,t)},Os=Ae,As=Ps,Ns=Re.f,Vs=Os("unscopables"),Ms=Array.prototype;void 0===Ms[Vs]&&Ns(Ms,Vs,{configurable:!0,value:As(null)});var Fs,Ws,Bs,Ds={},Rs=d,Us=u.WeakMap,Hs=Rs(Us)&&/native code/.test(String(Us)),Gs=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},zs=Re,js=Gs,Ks=Be?function(e,t,s){return zs.f(e,t,js(1,s))}:function(e,t,s){return e[t]=s,e},$s=Hs,qs=u,Qs=m,Ys=Ks,Xs=le,Js=Y,Zs=fs,ei=Yt,ti="Object already initialized",si=qs.TypeError,ii=qs.WeakMap;if($s||Js.state){var ri=Js.state||(Js.state=new ii);ri.get=ri.get,ri.has=ri.has,ri.set=ri.set,Fs=function(e,t){if(ri.has(e))throw new si(ti);return t.facade=e,ri.set(e,t),t},Ws=function(e){return ri.get(e)||{}},Bs=function(e){return ri.has(e)}}else{var ni=Zs("state");ei[ni]=!0,Fs=function(e,t){if(Xs(e,ni))throw new si(ti);return t.facade=e,Ys(e,ni,t),t},Ws=function(e){return Xs(e,ni)?e[ni]:{}},Bs=function(e){return Xs(e,ni)}}var li={set:Fs,get:Ws,has:Bs,enforce:function(e){return Bs(e)?Ws(e):Fs(e,{})},getterFor:function(e){return function(t){var s;if(!Qs(t)||(s=Ws(t)).type!==e)throw new si("Incompatible receiver, "+e+" required");return s}}},oi={},ai={},ui={}.propertyIsEnumerable,ci=Object.getOwnPropertyDescriptor,di=ci&&!ui.call({1:2},1),hi=(ai.f=di?function(e){var t=ci(this,e);return!!t&&t.enumerable}:ui,Be),mi=je,pi=ai,_i=Gs,fi=G,gi=St,bi=le,Ii=He,vi=Object.getOwnPropertyDescriptor,yi=(oi.f=hi?vi:function(e,t){if(e=fi(e),t=gi(t),Ii)try{return vi(e,t)}catch(e){}if(bi(e,t))return _i(!mi(pi.f,e,t),e[t])},{exports:{}}),Si=Be,Ei=le,Li=Function.prototype,Ci=Si&&Object.getOwnPropertyDescriptor,wi=Ei(Li,"name"),ki={EXISTS:wi,PROPER:wi&&"something"===function(){}.name,CONFIGURABLE:wi&&(!Si||Si&&Ci(Li,"name").configurable)},xi=d,Ti=Y,Pi=k(Function.toString);xi(Ti.inspectSource)||(Ti.inspectSource=function(e){return Pi(e)});var Oi=Ti.inspectSource,Ai=(yi.exports,k),Ni=y,Vi=d,Mi=le,Fi=Be,Wi=ki.CONFIGURABLE,Bi=Oi,Di=li.enforce,Ri=li.get,Ui=String,Hi=Object.defineProperty,Gi=Ai("".slice),zi=Ai("".replace),ji=Ai([].join),Ki=Fi&&!Ni((function(){return 8!==Hi((function(){}),"length",{value:8}).length})),$i=String(String).split("String"),qi=yi.exports=function(e,t,s){"Symbol("===Gi(Ui(t),0,7)&&(t="["+zi(Ui(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),s&&s.getter&&(t="get "+t),s&&s.setter&&(t="set "+t),(!Mi(e,"name")||Wi&&e.name!==t)&&(Fi?Hi(e,"name",{value:t,configurable:!0}):e.name=t),Ki&&s&&Mi(s,"arity")&&e.length!==s.arity&&Hi(e,"length",{value:s.arity});try{s&&Mi(s,"constructor")&&s.constructor?Fi&&Hi(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=Di(e);return Mi(i,"source")||(i.source=ji($i,"string"==typeof t?t:"")),e};Function.prototype.toString=qi((function(){return Vi(this)&&Ri(this).source||Bi(this)}),"toString");var Qi,Yi,Xi,Ji=yi.exports,Zi=d,er=Re,tr=Ji,sr=$,ir=function(e,t,s,i){i||(i={});var r=i.enumerable,n=void 0!==i.name?i.name:t;if(Zi(s)&&tr(s,n,i),i.global)r?e[t]=s:sr(t,s);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=s:er.f(e,t,{value:s,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},rr={},nr=ss,lr=is.concat("length","prototype"),or=(rr.f=Object.getOwnPropertyNames||function(e){return nr(e,lr)},{}),ar=(or.f=Object.getOwnPropertySymbols,qe),ur=rr,cr=or,dr=Fe,hr=k([].concat),mr=ar("Reflect","ownKeys")||function(e){var t=ur.f(dr(e)),s=cr.f;return s?hr(t,s(e)):t},pr=le,_r=mr,fr=oi,gr=Re,br=y,Ir=d,vr=/#|\.prototype\./,yr=function(e,t){var s=Er[Sr(e)];return s===Cr||s!==Lr&&(Ir(t)?br(t):!!t)},Sr=yr.normalize=function(e){return String(e).replace(vr,".").toLowerCase()},Er=yr.data={},Lr=yr.NATIVE="N",Cr=yr.POLYFILL="P",wr=yr,kr=u,xr=oi.f,Tr=Ks,Pr=ir,Or=$,Ar=function(e,t,s){for(var i=_r(t),r=gr.f,n=fr.f,l=0;l<i.length;l++){var o=i[l];pr(e,o)||s&&pr(s,o)||r(e,o,n(t,o))}},Nr=wr,Vr=function(e,t){var s,i,r,n,l,o=e.target,a=e.global,u=e.stat;if(s=a?kr:u?kr[o]||Or(o,{}):kr[o]&&kr[o].prototype)for(i in t){if(n=t[i],r=e.dontCallGetSet?(l=xr(s,i))&&l.value:s[i],!Nr(a?i:o+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof n==typeof r)continue;Ar(n,r)}(e.sham||r&&r.sham)&&Tr(n,"sham",!0),Pr(s,i,n,e)}},Mr=!y((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Fr=le,Wr=d,Br=ie,Dr=Mr,Rr=fs("IE_PROTO"),Ur=Object,Hr=Ur.prototype,Gr=Dr?Ur.getPrototypeOf:function(e){var t=Br(e);if(Fr(t,Rr))return t[Rr];var s=t.constructor;return Wr(s)&&t instanceof s?s.prototype:t instanceof Ur?Hr:null},zr=y,jr=d,Kr=m,$r=Gr,qr=ir,Qr=Ae("iterator"),Yr=!1;[].keys&&("next"in(Xi=[].keys())?(Yi=$r($r(Xi)))!==Object.prototype&&(Qi=Yi):Yr=!0);var Xr=!Kr(Qi)||zr((function(){var e={};return Qi[Qr].call(e)!==e}));Xr&&(Qi={}),jr(Qi[Qr])||qr(Qi,Qr,(function(){return this}));var Jr={IteratorPrototype:Qi,BUGGY_SAFARI_ITERATORS:Yr},Zr=Re.f,en=le,tn=Ae("toStringTag"),sn=function(e,t,s){e&&!s&&(e=e.prototype),e&&!en(e,tn)&&Zr(e,tn,{configurable:!0,value:t})},rn=Jr.IteratorPrototype,nn=Ps,ln=Gs,on=sn,an=Ds,un=function(){return this},cn=k,dn=nt,hn=m,mn=function(e){return hn(e)||null===e},pn=String,_n=TypeError,fn=function(e,t,s){try{return cn(dn(Object.getOwnPropertyDescriptor(e,t)[s]))}catch(e){}},gn=Fe,bn=function(e){if(mn(e))return e;throw new _n("Can't set "+pn(e)+" as a prototype")},In=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,s={};try{(e=fn(Object.prototype,"__proto__","set"))(s,[]),t=s instanceof Array}catch(e){}return function(s,i){return gn(s),bn(i),t?e(s,i):s.__proto__=i,s}}():void 0),vn=Vr,yn=je,Sn=d,En=function(e,t,s,i){var r=t+" Iterator";return e.prototype=nn(rn,{next:ln(+!i,s)}),on(e,r,!1,!0),an[r]=un,e},Ln=Gr,Cn=In,wn=sn,kn=Ks,xn=ir,Tn=Ds,Pn=ki.PROPER,On=ki.CONFIGURABLE,An=Jr.IteratorPrototype,Nn=Jr.BUGGY_SAFARI_ITERATORS,Vn=Ae("iterator"),Mn="keys",Fn="values",Wn="entries",Bn=function(){return this},Dn=G,Rn=function(e){Ms[Vs][e]=!0},Un=Ds,Hn=li,Gn=Re.f,zn=function(e,t,s,i,r,n,l){En(s,t,i);var o,a,u,c=function(e){if(e===r&&_)return _;if(!Nn&&e&&e in m)return m[e];switch(e){case Mn:case Fn:case Wn:return function(){return new s(this,e)}}return function(){return new s(this)}},d=t+" Iterator",h=!1,m=e.prototype,p=m[Vn]||m["@@iterator"]||r&&m[r],_=!Nn&&p||c(r),f="Array"===t&&m.entries||p;if(f&&(o=Ln(f.call(new e)))!==Object.prototype&&o.next&&(Ln(o)!==An&&(Cn?Cn(o,An):Sn(o[Vn])||xn(o,Vn,Bn)),wn(o,d,!0,!0)),Pn&&r===Fn&&p&&p.name!==Fn&&(On?kn(m,"name",Fn):(h=!0,_=function(){return yn(p,this)})),r)if(a={values:c(Fn),keys:n?_:c(Mn),entries:c(Wn)},l)for(u in a)(Nn||h||!(u in m))&&xn(m,u,a[u]);else vn({target:t,proto:!0,forced:Nn||h},a);return m[Vn]!==_&&xn(m,Vn,_,{name:r}),Tn[t]=_,a},jn=function(e,t){return{value:e,done:t}},Kn=Be,$n="Array Iterator",qn=Hn.set,Qn=Hn.getterFor($n),Yn=zn(Array,"Array",(function(e,t){qn(this,{type:$n,target:Dn(e),index:0,kind:t})}),(function(){var e=Qn(this),t=e.target,s=e.index++;if(!t||s>=t.length)return e.target=void 0,jn(void 0,!0);switch(e.kind){case"keys":return jn(s,!1);case"values":return jn(t[s],!1)}return jn([s,t[s]],!1)}),"values"),Xn=Un.Arguments=Un.Array;if(Rn("keys"),Rn("values"),Rn("entries"),Kn&&"values"!==Xn.name)try{Gn(Xn,"name",{value:"values"})}catch(e){}var Jn=u,Zn={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},el=v,tl=Yn,sl=Ks,il=sn,rl=Ae("iterator"),nl=tl.values,ll=function(e,t){if(e){if(e[rl]!==nl)try{sl(e,rl,nl)}catch(t){e[rl]=nl}if(il(e,t,!0),Zn[t])for(var s in tl)if(e[s]!==tl[s])try{sl(e,s,tl[s])}catch(t){e[s]=tl[s]}}};for(var ol in Zn)ll(Jn[ol]&&Jn[ol].prototype,ol);ll(el,"DOMTokenList");var al=S,ul=Function.prototype,cl=ul.apply,dl=ul.call,hl="object"==typeof Reflect&&Reflect.apply||(al?dl.bind(cl):function(){return dl.apply(cl,arguments)}),ml={};ml[Ae("toStringTag")]="z";var pl,_l,fl="[object z]"===String(ml),gl=d,bl=O,Il=Ae("toStringTag"),vl=Object,yl="Arguments"===bl(function(){return arguments}()),Sl=fl?bl:function(e){var t,s,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(e){}}(t=vl(e),Il))?s:yl?bl(t):"Object"===(i=bl(t))&&gl(t.callee)?"Arguments":i},El=String,Ll=function(e){if("Symbol"===Sl(e))throw new TypeError("Cannot convert a Symbol value to a string");return El(e)},Cl=Fe,wl=y,kl=u.RegExp,xl=wl((function(){var e=kl("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Tl=xl||wl((function(){return!kl("a","y").sticky})),Pl={BROKEN_CARET:xl||wl((function(){var e=kl("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Tl,UNSUPPORTED_Y:xl},Ol=y,Al=u.RegExp,Nl=Ol((function(){var e=Al(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})),Vl=y,Ml=u.RegExp,Fl=Vl((function(){var e=Ml("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Wl=je,Bl=k,Dl=Ll,Rl=function(){var e=Cl(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Ul=Pl,Hl=Ps,Gl=li.get,zl=Nl,jl=Fl,Kl=ee("native-string-replace",String.prototype.replace),$l=RegExp.prototype.exec,ql=$l,Ql=Bl("".charAt),Yl=Bl("".indexOf),Xl=Bl("".replace),Jl=Bl("".slice),Zl=(_l=/b*/g,Wl($l,pl=/a/,"a"),Wl($l,_l,"a"),0!==pl.lastIndex||0!==_l.lastIndex),eo=Ul.BROKEN_CARET,to=void 0!==/()??/.exec("")[1];(Zl||to||eo||zl||jl)&&(ql=function(e){var t,s,i,r,n,l,o,a=this,u=Gl(a),c=Dl(e),d=u.raw;if(d)return d.lastIndex=a.lastIndex,t=Wl(ql,d,c),a.lastIndex=d.lastIndex,t;var h=u.groups,m=eo&&a.sticky,p=Wl(Rl,a),_=a.source,f=0,g=c;if(m&&(p=Xl(p,"y",""),-1===Yl(p,"g")&&(p+="g"),g=Jl(c,a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==Ql(c,a.lastIndex-1))&&(_="(?: "+_+")",g=" "+g,f++),s=new RegExp("^(?:"+_+")",p)),to&&(s=new RegExp("^"+_+"$(?!\\s)",p)),Zl&&(i=a.lastIndex),r=Wl($l,m?s:a,g),m?r?(r.input=Jl(r.input,f),r[0]=Jl(r[0],f),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:Zl&&r&&(a.lastIndex=a.global?r.index+r[0].length:i),to&&r&&r.length>1&&Wl(Kl,r[0],s,(function(){for(n=1;n<arguments.length-2;n++)void 0===arguments[n]&&(r[n]=void 0)})),r&&h)for(r.groups=l=Hl(null),n=0;n<h.length;n++)l[(o=h[n])[0]]=r[o[1]];return r});var so=ql;Vr({target:"RegExp",proto:!0,forced:/./.exec!==so},{exec:so});var io=je,ro=ir,no=so,lo=y,oo=Ae,ao=Ks,uo=oo("species"),co=RegExp.prototype,ho=k,mo=Wt,po=Ll,_o=R,fo=ho("".charAt),go=ho("".charCodeAt),bo=ho("".slice),Io=function(e){return function(t,s){var i,r,n=po(_o(t)),l=mo(s),o=n.length;return l<0||l>=o?e?"":void 0:(i=go(n,l))<55296||i>56319||l+1===o||(r=go(n,l+1))<56320||r>57343?e?fo(n,l):i:e?bo(n,l,l+2):r-56320+(i-55296<<10)+65536}},vo={codeAt:Io(!1),charAt:Io(!0)}.charAt,yo=k,So=ie,Eo=Math.floor,Lo=yo("".charAt),Co=yo("".replace),wo=yo("".slice),ko=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,xo=/\$([$&'`]|\d{1,2})/g,To=je,Po=Fe,Oo=d,Ao=O,No=so,Vo=TypeError,Mo=hl,Fo=je,Wo=k,Bo=function(e,t,s,i){var r=oo(e),n=!lo((function(){var t={};return t[r]=function(){return 7},7!==""[e](t)})),l=n&&!lo((function(){var t=!1,s=/a/;return"split"===e&&((s={}).constructor={},s.constructor[uo]=function(){return s},s.flags="",s[r]=/./[r]),s.exec=function(){return t=!0,null},s[r](""),!t}));if(!n||!l||s){var o=/./[r],a=t(r,""[e],(function(e,t,s,i,r){var l=t.exec;return l===no||l===co.exec?n&&!r?{done:!0,value:io(o,t,s,i)}:{done:!0,value:io(e,s,t,i)}:{done:!1}}));ro(String.prototype,e,a[0]),ro(co,r,a[1])}i&&ao(co[r],"sham",!0)},Do=y,Ro=Fe,Uo=d,Ho=W,Go=Wt,zo=Gt,jo=Ll,Ko=R,$o=function(e,t,s){return t+(s?vo(e,t).length:1)},qo=at,Qo=function(e,t,s,i,r,n){var l=s+e.length,o=i.length,a=xo;return void 0!==r&&(r=So(r),a=ko),Co(n,a,(function(n,a){var u;switch(Lo(a,0)){case"$":return"$";case"&":return e;case"`":return wo(t,0,s);case"'":return wo(t,l);case"<":u=r[wo(a,1,-1)];break;default:var c=+a;if(0===c)return n;if(c>o){var d=Eo(c/10);return 0===d?n:d<=o?void 0===i[d-1]?Lo(a,1):i[d-1]+Lo(a,1):n}u=i[c-1]}return void 0===u?"":u}))},Yo=function(e,t){var s=e.exec;if(Oo(s)){var i=To(s,e,t);return null!==i&&Po(i),i}if("RegExp"===Ao(e))return To(No,e,t);throw new Vo("RegExp#exec called on incompatible receiver")},Xo=Ae("replace"),Jo=Math.max,Zo=Math.min,ea=Wo([].concat),ta=Wo([].push),sa=Wo("".indexOf),ia=Wo("".slice),ra="$0"==="a".replace(/./,"$0"),na=!!/./[Xo]&&""===/./[Xo]("a","$0");Bo("replace",(function(e,t,s){var i=na?"$":"$0";return[function(e,s){var i=Ko(this),r=Ho(e)?void 0:qo(e,Xo);return r?Fo(r,e,i,s):Fo(t,jo(i),e,s)},function(e,r){var n=Ro(this),l=jo(e);if("string"==typeof r&&-1===sa(r,i)&&-1===sa(r,"$<")){var o=s(t,n,l,r);if(o.done)return o.value}var a=Uo(r);a||(r=jo(r));var u,c=n.global;c&&(u=n.unicode,n.lastIndex=0);for(var d,h=[];null!==(d=Yo(n,l))&&(ta(h,d),c);)""===jo(d[0])&&(n.lastIndex=$o(l,zo(n.lastIndex),u));for(var m,p="",_=0,f=0;f<h.length;f++){for(var g,b=jo((d=h[f])[0]),I=Jo(Zo(Go(d.index),l.length),0),v=[],y=1;y<d.length;y++)ta(v,void 0===(m=d[y])?m:String(m));var S=d.groups;if(a){var E=ea([b],v,I,l);void 0!==S&&ta(E,S),g=jo(Mo(r,void 0,E))}else g=Qo(b,l,I,v,S,r);I>=_&&(p+=ia(l,_,I)+g,_=I+b.length)}return p+ia(l,_)}]}),!!Do((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!ra||na);var la=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const oa=Symbol("item"),aa=Symbol("destroyed"),ua=Symbol("ghost"),ca=Object.prototype.hasOwnProperty;let da={baseClassName:"droplist",autoItemBlur:!0,autoItemBlurDelay:300,capturesFocus:!0,multi:!1,keyDownHandler:null,autoCheckGroupChildren:!0,useExactTargetWidth:!1,constrainToWindow:!0,autoFlipDirection:!0,estimateWidth:!1,virtualMinItems:100,labelProp:"label",valueProp:"value",on:null};class ha{constructor(t){const n={...da};for(let[e,s]of Object.entries(t))void 0!==s&&(n[e]=s);const o=this._p={ownsEl:!0,elOriginalDisplay:"",baseClassName:n.baseClassName,additionalClasses:n.additionalClasses,direction:"ltr"===n.direction?"ltr":"rtl"===n.direction?"rtl":"auto",autoItemBlur:n.autoItemBlur,autoItemBlurDelay:n.autoItemBlurDelay,capturesFocus:n.capturesFocus,multi:n.multi,keyDownHandler:n.keyDownHandler,autoCheckGroupChildren:n.autoCheckGroupChildren,useExactTargetWidth:n.useExactTargetWidth,constrainToWindow:n.constrainToWindow,autoFlipDirection:n.autoFlipDirection,estimatedItemHeight:n.estimatedItemHeight,estimateWidth:n.estimateWidth,virtualMinItems:n.virtualMinItems,labelProp:n.labelProp,valueProp:n.valueProp,renderItem:n.renderItem,unrenderItem:n.unrenderItem,on:n.on||null,silenceEvents:!0,mitt:l(),focusItemIndex:-1,focusItemEl:null,sink:new i};let a=[o.baseClassName];o.additionalClasses&&(a=a.concat((o.additionalClasses+"").split(" ").filter((e=>e))));const u={top:"-9999px"};let c=n.el;if(c instanceof Element?(o.elOriginalDisplay=c.style.display||"",c.classList.add(...a),c.role="menu",s.setCssProps(c,u),o.ownsEl=!1):c=e.createElement("ul",{class:a.join(" "),role:"menu",css:u}),o.el=c,o.items=[],o.groupCount=0,o.mouseHandled=!1,o.virtualListHelper=new r({list:o.el,virtual:!0,buffer:5,estimatedItemHeight:n.estimatedItemHeight||20,itemElementCreatorFn:()=>e.createElement("li",{role:"menuitem",tabIndex:o.capturesFocus?-1:null}),onItemRender:(e,t)=>{let s;t===ua?(s={label:o.lastMeasureLongestLabelText,value:"Measure",[oa]:{[o.labelProp]:o.lastMeasureLongestLabelText,[o.valueProp]:"Measure"}},e.setAttribute("aria-hidden","true")):s=o.items[t],s||console.warn("onItemRender called for ("+t+") which has no item"),e.className="".concat(o.baseClassName,"__item");const i=e.classList;o.multi?s._nocheck?i.add("".concat(o.baseClassName,"__item_multi_nocheck")):(i.add("".concat(o.baseClassName,"__item_multi")),s._checked&&i.add("".concat(o.baseClassName,"__item_checked"))):i.add("".concat(o.baseClassName,"__item_single")),s._group&&i.add("".concat(o.baseClassName,"__item_group")),s._child&&i.add("".concat(o.baseClassName,"__item_child")),s._nointeraction&&i.add("".concat(o.baseClassName,"__item_nointeraction")),o.focusItemIndex===t&&(o.focusItemEl=e,i.add("".concat(o.baseClassName,"__item_focus"))),this._renderItemContent(s,e),e[oa]=s}}),"function"==typeof o.unrenderItem){const e=o.unrenderItem;o.virtualListHelper.setOnItemUnrender((t=>{try{e(t[oa][oa],t)}catch(e){console.error(e)}delete t[oa],o.focusItemEl===t&&(o.focusItemEl=null)}))}else o.virtualListHelper.setOnItemUnrender((e=>{delete e[oa],o.focusItemEl===e&&(o.focusItemEl=null)}));o.capturesFocus&&(c.tabIndex=0),this._hookMouseEvents(),this._hookTouchEvents(),this._hookFocusEvents(),this._hookKeyEvents(),this.silenceEvents=!1}destroy(){if(this[aa])return;this[aa]=!0;const e=this._p;var s;if(clearTimeout(e.blurTimer),clearTimeout(e.filterTimer),e.sink.remove(),e.virtualListHelper.destroy(),e.el&&t.remove(e.el),e.currentSubDropList&&(null===(s=e.currentSubDropList)||void 0===s||null===(s=s.droplist)||void 0===s||s.destroy(),e.currentSubDropList=null),!e.ownsEl){for(let t of Array.from(e.el.classList))t.startsWith(e.baseClassName)&&e.el.classList.remove(t);e.el.removeAttribute("role");for(let t of["position","left","top","right","bottom","z-index"])e.el.style[t]="";e.el.style.display=e.elOriginalDisplay}e.lastPositionTarget&&(e.lastPositionTarget.classList.remove("has_".concat(e.baseClassName),"has_".concat(e.baseClassName,"_above"),"has_".concat(e.baseClassName,"_below")),delete e.lastPositionTarget),this._p=null}get el(){return this._p.el}elContains(e){var t;let s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!this.el.contains(e)||!(!s||null===(t=this._p.currentSubDropList)||void 0===t||null===(t=t.droplist)||void 0===t||!t.elContains(e))}setAdditionalClasses(e){return this._p.additionalClasses=e,this._syncBaseClasses(),this}setDirection(e){return this._p.direction="ltr"===e?"ltr":"rtl"===e?"rtl":"auto",this._syncBaseClasses(),this}getDirection(){return this._p.direction}setLabelProp(e){return this._p.labelProp=e,this}setRenderItem(e){return this._p.renderItem=e,this}setUnrenderItem(e){const t=this._p;if(t.unrenderItem=e,"function"==typeof t.unrenderItem){const e=t.unrenderItem;t.virtualListHelper.setOnItemUnrender((s=>{try{e(s[oa][oa],s)}catch(e){console.error(e)}delete s[oa],t.focusItemEl===s&&(t.focusItemEl=null)}))}else t.virtualListHelper.setOnItemUnrender((e=>{delete e[oa],t.focusItemEl===e&&(t.focusItemEl=null)}));return this}setValueProp(e){return this._p.valueProp=e,this}_syncBaseClasses(){const e=this._p,t=e.el;if(!t)return;let s=[e.baseClassName];"ltr"!==e.direction&&"rtl"!==e.direction||s.push("".concat(e.baseClassName,"__")+e.direction),e.additionalClasses&&(s=s.concat(e.additionalClasses)),t.className=s.join(" ")}blurFocusedItem(){var e;const t=this._p;if(clearTimeout(t.blurTimer),!this.hasFocusedItem())return;let s=t.focusItemEl;s&&(s.classList.remove("".concat(t.baseClassName,"__item_focus")),t.focusItemEl=null);const i=t.items[t.focusItemIndex];t.focusItemIndex=-1,i&&(t.currentSubDropList&&this._hideSublist(),this._trigger("itemblur",{value:i.value,item:null!==(e=i[oa])&&void 0!==e?e:i}))}nextPage(e){this._move("next_page",e)}previousPage(e){this._move("prev_page",e)}goToFirst(e){this._move("first",e)}goToLast(e){this._move("last",e)}toggleFocusedItem(){const e=this._p;if(this.hasFocusedItem()&&e.multi){var s;let i=e.items[e.focusItemIndex];if(i._nocheck||i._nointeraction)return this;i._checked=!i._checked,e.focusItemEl&&t.toggleClass(e.focusItemEl,"".concat(e.baseClassName,"__item_checked"),i._checked),this._trigger("check",{value:i.value,item:null!==(s=i[oa])&&void 0!==s?s:i,checked:i._checked,isGroup:i._group,isCheckingGroup:!1}),this._updateGroupStateForItem(i)}return this}triggerItemSelection(t,s){var i,r;const n=this._p;return n.focusItemEl=n.focusItemEl||e.closestUntil(s.target,"li",n.el),n.focusItemIndex=n.virtualListHelper.getItemIndexFromElement(n.focusItemEl),void 0===n.focusItemIndex&&(n.focusItemIndex=-1),!(t=null!==(i=t)&&void 0!==i?i:n.focusItemEl[oa])._nointeraction&&(n.multi||this._setSingleSelectedItemEl(n.focusItemEl),this._trigger("select",{value:t?t.value:void 0,item:null!==(r=t[oa])&&void 0!==r?r:t,event:s,el:n.focusItemEl}),!0)}addItem(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return this.addItems([e],t)}addItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;const s=this._p,i=s.labelProp,r=s.valueProp;let n=s.multi,l=s.items;(null==t||t<0||t>=s.items.length)&&(t=-1),this._determineVirtualMode(l.length+e.length);for(let o=0,a=e.length;o<a;o++){let a=e[o],u={[oa]:a,label:a[i],value:a[r],_nocheck:!!a._nocheck,_nointeraction:!!a._nointeraction,_subitems:a._subitems};n&&(u._checked=!!a._checked),a._group&&(u._group=!0,s.groupCount++),a._child&&(u._child=!0),-1!==t?l.splice(t,0,u):l.push(u),-1!==t&&t++}return s.virtualListHelper.addItemsAt(e.length,-1===t?t:t-e.length).render(),this}setItems(e){const t=this._p;return t.items.length=0,t.groupCount=0,t.virtualListHelper.setCount(0),this.addItems(e)}updateItemByValue(e,t){const s=this._p;let i=this.itemIndexByValue(e);if(-1===i)return this;let r=this.itemAtIndex(i);return r[oa]=t,ca.call(t,s.labelProp)&&(r.label=t[s.labelProp]),ca.call(t,s.valueProp)&&(r.value=t[s.valueProp]),ca.call(t,"_nocheck")&&(r._nocheck=!!t._nocheck),ca.call(t,"_nointeraction")&&(r._nointeraction=!!t._nointeraction),ca.call(t,"_subitems")&&(r._subitems=!!t._subitems),s.multi&&ca.call(t,"_checked")&&(r._checked=!!t._checked),ca.call(t,"_group")&&!!t._group!==r._group&&(r._group?s.groupCount--:s.groupCount++,t._group=!!r._group),ca.call(t,"_child")&&(r._child=!!t._child),s.virtualListHelper.isItemRendered(i)&&s.virtualListHelper.refreshItemAt(i).render(),this}removeItem(e,t){const s=this._p;let i=this.itemIndexByValueOrLabel(e,t);return-1===i||(s.items.splice(i,1)[0]._group&&s.groupCount--,s.virtualListHelper.removeItemsAt(i,1).render()),this}removeAllItems(){const e=this._p;return e.items.length=0,e.groupCount=0,e.virtualListHelper.setCount(0).render(),this}invalidate(){return this._p.virtualListHelper.invalidate().render(),this}itemDataByValue(e){const t=this._p;for(let s=0,i=t.items.length;s<i;s++){let i=t.items[s];if(i.value===e)return i[oa]}return null}itemIndexByValue(e){const t=this._p;for(let s=0,i=t.items.length;s<i;s++)if(t.items[s].value===e)return s;return-1}itemIndexByValueOrLabel(e,t){const s=this._p;for(let i=0,r=s.items.length;i<r;i++){let r=s.items[i];if(r.value===e||r.label===t)return i}return-1}items(){return this._p.items.map((e=>e[oa]))}itemsReference(){return this._p.items}itemCount(){return this._p.items.length}itemAtIndex(e){var t;return null===(t=this._p.items[e])||void 0===t?void 0:t[oa]}relayout(e){const i=this._p,r=i.el;if(!this.isVisible())return this;let n=window,l={},o=e.targetOffset||s.getElementOffset(e.target);l.left=o.left,l.top=o.top,l.height=null==e.targetHeight?s.getElementHeight(e.target,!0,!0):e.targetHeight,l.width=null==e.targetWidth?s.getElementWidth(e.target,!0,!0):e.targetWidth,l.bottom=l.top+l.height;let a={};a.top=n.pageYOffset,a.left=n.pageXOffset,a.width=n.innerWidth,a.height=n.innerHeight,a.bottom=a.top+a.height,a.right=a.left+a.width;let u=e.position&&"bottom"===e.position.y?"above":"below";r.style.width="",(i.estimateWidth||i.virtualListHelper.isVirtual())&&this._measureItem(),i.virtualListHelper.isVirtual()&&i.virtualListHelper.render(),e.updateWidth||"number"==typeof e.updateWidth?this._updateWidth(e):this._updateWidth();let c,d=l.top-a.top,h=a.bottom-l.bottom;const m=getComputedStyle(r);let p="border-box"===m.boxSizing,_=(parseFloat(m.paddingTop)||0)+(parseFloat(m.paddingBottom)||0),f=(parseFloat(m.borderTopWidth)||0)+(parseFloat(m.borderBottomWidth)||0);i.virtualListHelper.isVirtual()?c=i.virtualListHelper.estimateFullHeight()+_+f:(r.style.height="",r.style.top="-9999px",c=Math.max(s.getElementHeight(i.el),r.scrollHeight),c+=_+f);let g=parseFloat(m.maxHeight);isNaN(g)||(p||(g+=_+f),c=Math.min(c,g));let b=d>=c,I=h>=c,v=i.currentDirection||u;"above"===v&&!b&&I?v="below":"below"===v&&!I&&b?v="above":b&&I?v!==u&&("above"===u&&d>=h||"below"===u&&h>=d)&&(v=u):b||I||(d>h?v="above":h>d&&(v="below")),i.currentDirection=v;let y={width:s.getElementWidth(r,!0,!0),height:Math.min(c,Math.max(d,h,0))},S=void 0!==e.targetRtl?e.targetRtl:null!=e.target&&"rtl"===getComputedStyle(e.target).direction,E="rtl"===getComputedStyle(document.documentElement).direction,L=s.anchoredPosition(e.target,e.anchor?e.anchor.x:"start",e.anchor?e.anchor.y:"bottom",l,S),C=s.anchoredPosition(r,e.position?e.position.x:"start",e.position?e.position.y:"top",y,S),w="top"===C.ySpec&&"above"===v||"bottom"===C.ySpec&&"below"===v||"bottom"!==C.ySpec&&"top"!==C.ySpec&&"above"===v,k=void 0!==n.pageXOffset?n.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft;k=Math.abs(k),E&&(k=document.documentElement.scrollWidth-k-document.documentElement.clientWidth);let x=k,T=document.documentElement.clientWidth+k-y.width,P={position:"absolute",left:l.left,top:l.top+(w?L.bottom-C.bottom:L.top-C.top)};if(E&&(P.left-=document.documentElement.clientWidth-document.documentElement.scrollWidth),P.left+=L.left-C.left,e.offset&&(e.offset.y&&(w?P.top-=e.offset.y:P.top+=e.offset.y),e.offset.x)){let t="rtl"===m.direction;P.left+=t?-e.offset.x:e.offset.x}if(i.autoFlipDirection&&("right"===C.xSpec&&P.left<x&&(Math.max(P.left,x)+y.width-l.left)/l.width>.5||"left"===C.xSpec&&P.left>T&&(Math.min(P.left,T)-l.left)/l.width<.5)&&(P.left-=L.left-C.left,P.left+=L.right-C.right),i.constrainToWindow)for(let e of E?["min","max"]:["max","min"])"min"===e&&P.left<x?P.left=x:"max"===e&&P.left>T&&(P.left=T);return P.left+="px",P.top+="px",s.setCssProps(r,P),s.setElementHeight(r,y.height,!0,!0),i.virtualListHelper.render(),e&&e.target&&(i.lastPositionTarget=e.target,t.toggleClass(e.target,"has_".concat(i.baseClassName),!0),t.toggleClass(e.target,"has_".concat(i.baseClassName,"_below"),"below"===v),t.toggleClass(e.target,"has_".concat(i.baseClassName,"_above"),"above"===v),t.toggleClass(r,"".concat(i.baseClassName,"__is_below"),"below"===v),t.toggleClass(r,"".concat(i.baseClassName,"__is_above"),"above"===v)),this}setItemChecked(e,s){const i=this._p;s=!!s;let r=this.itemIndexByValue(e);if(-1===r)return this;let n=i.virtualListHelper.getItemElementAt(r);if(!n)return this;let l=n[oa];return s=s&&!l._nocheck,l._checked!==s&&(l._checked=s,t.toggleClass(n,"".concat(i.baseClassName,"__item_checked"),l._checked),this._updateGroupStateForItem(l)),this}setCheckedValues(e){const s=this._p;let i=[];for(let r=0,n=s.items.length;r<n;r++){let n=s.items[r],l=!n._nocheck&&-1!==e.indexOf(n.value);if(n._group&&i.push(r),n._checked===l)continue;n._checked=l;let o=s.virtualListHelper.getItemElementAt(r);o&&t.toggleClass(o,"".concat(s.baseClassName,"__item_checked"),n._checked)}if(s.autoCheckGroupChildren)for(let e=0,t=i.length;e<t;e++)this._updateGroupCheckedState(i[e],!1);return this}getCheckedValues(e){const t=this._p;e=e&&t.groupCount>0;let s=[];for(let i=0,r=t.items.length;i<r;i++){let r=t.items[i];r._checked&&(e&&r._group||s.push(r.value))}return s}getCheckedItems(e){const t=this._p;e=e&&t.groupCount>0;let s=[];for(let i=0,r=t.items.length;i<r;i++){let r=t.items[i];r._checked&&(e&&r._group||s.push(r[oa]))}return s}show(e){const t=this._p;t.hiding=!1,this.isVisible()||this._trigger("show:before"),t.mouseHandled=!1,setTimeout((()=>{this[aa]||t.onDocumentMouseDown||t.sink.add(document,"mousedown",t.onDocumentMouseDown=e=>{t.el.contains(e.target)||this._delayBlurItemOnBlur()})}));const s=t.el;if(s.style.position="absolute",s.classList.remove("".concat(t.baseClassName,"__is-hiding")),document.body.appendChild(s),t.visible=!0,t.el.style.display="","none"===getComputedStyle(t.el).display&&(t.el.style.display="block"),e){const t=getComputedStyle(s),i=s.style.maxHeight;let r=document.body.clientHeight-(parseFloat(t.marginTop)||0)-(parseFloat(t.marginBottom)||0)-("border-box"===t.boxSizing?0:(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0));s.style.maxHeight=Math.min(r,parseFloat(t.maxHeight)||r)+"px",this.relayout(e),s.style.maxHeight=i}else t.virtualListHelper.isVirtual()&&t.virtualListHelper.render();return this.isVisible()&&this._trigger("show"),this}hide(){const e=this._p,i=e.el;if(e.onDocumentMouseDown&&(e.sink.remove(document,"mousedown",e.onDocumentMouseDown),e.onDocumentMouseDown=null),this.isVisible()){if(this._trigger("hide:before"),e.hiding=!0,i&&(i.classList.add("".concat(e.baseClassName,"__is-hiding")),s.parseTransition(getComputedStyle(e.el).transition).reduce(((e,t)=>Math.max(e,t.delay+t.duration)),0)>0?setTimeout((()=>{this[aa]||this._p&&i.parentNode&&e.hiding&&(t.remove(i),i.classList.remove("".concat(e.baseClassName,"__is-hiding")),e.visible=!1,this._trigger("hide:after"))})):(t.remove(i),i.classList.remove("".concat(e.baseClassName,"__is-hiding")))),e.visible=!1,this.blurFocusedItem(),this._trigger("hide"),this[aa])return;this._trigger("hide:after"),e.currentSubDropList&&this._hideSublist()}return e.lastPositionTarget&&(e.lastPositionTarget.classList.remove("has_".concat(e.baseClassName),"has_".concat(e.baseClassName,"_above"),"has_".concat(e.baseClassName,"_below")),delete e.lastPositionTarget),this}isVisible(){const e=this._p;return!!e.visible&&e.el.parentNode&&"none"!==getComputedStyle(e.el).display}hasFocusedItem(){return this._p.focusItemIndex>-1}getFocusedItemIndex(){return this.hasFocusedItem()?this._p.focusItemIndex:-1}setFocusedItemAtIndex(e){const t=this._p;t.focusItemIndex=e;let s=null;e>-1&&(s=t.items[e]),s&&s._nointeraction&&(s=null),e>-1&&this.scrollItemIndexIntoView(e);let i=s?t.virtualListHelper.getItemElementAt(e):null;if(t.focusItemEl!==i&&(t.focusItemEl&&(t.focusItemEl.classList.remove("".concat(t.baseClassName,"__item_focus")),t.focusItemEl=null),i)){var r;i.classList.add("".concat(t.baseClassName,"__item_focus")),t.focusItemEl=i;const e=i[oa];this._trigger("itemfocus",{value:e.value,item:null!==(r=e[oa])&&void 0!==r?r:e,event:null,el:i}),this._showSublist(e,i)}return this}_showSublist(e,t){var s,i;if(null===(s=e._subitems)||void 0===s||!s.length)return;const r=this._p,n=new ha({baseClassName:r.baseClassName,additionalClasses:r.additionalClasses,direction:r.direction,autoItemBlur:r.autoItemBlur,autoItemBlurDelay:r.autoItemBlurDelay,capturesFocus:r.capturesFocus,multi:r.multi,keyDownHandler:r.keyDownHandler,autoCheckGroupChildren:r.autoCheckGroupChildren,useExactTargetWidth:r.useExactTargetWidth,constrainToWindow:r.constrainToWindow,autoFlipDirection:r.autoFlipDirection,estimatedItemHeight:r.estimatedItemHeight,estimateWidth:r.estimateWidth,virtualMinItems:r.virtualMinItems,labelProp:r.labelProp,valueProp:r.valueProp,renderItem:r.renderItem,unrenderItem:r.unrenderItem});let l=e=>{this[aa]||e.relatedTarget&&this.elContains(e.relatedTarget,!0)||(this._delayBlurItemOnBlur(),this._trigger("subitems:blur",e))};n.on("select",(e=>{this._trigger("subitems:select",e)})).on("subitems:select",(e=>{this._trigger("subitems:select",e)})).on("blur",l).on("subitems:blur",l).on("_back_key_pressed",(()=>{this._hideSublist()})),n.setItems(e._subitems),this._trigger("show_subitems",{value:e.value,item:null!==(i=e[oa])&&void 0!==i?i:e,el:t,droplist:n}),n.show({target:t,position:{x:"start",y:"top"},anchor:{x:"end",y:"top"},offset:{x:0,y:0},updateWidth:!1}),r.currentSubDropList={item:e,itemElement:t,droplist:n},n.el.focus()}_hideSublist(){const e=this._p;if(!e.currentSubDropList)return;const t=e.currentSubDropList;let s=!!document.activeElement&&t.droplist.elContains(document.activeElement,!0);t.droplist.hide(),t.droplist.destroy(),e.currentSubDropList=null,s&&!this[aa]&&this.el.focus(),this._trigger("hide_subitems",{value:t.item.value,item:t.item,el:t.itemElement})}setFocusedItem(e){const t=this._p;let s=e._nointeraction?-1:this._getItemIndex(e);return s>-1&&t.items[s]._nointeraction&&(s=-1),this.setFocusedItemAtIndex(s)}setFocusedItemByValue(e){return this.setFocusedItemAtIndex(this.itemIndexByValue(e))}setSingleSelectedItemAtIndex(e){const t=this._p;let s=null;return e>-1&&!t.items[e]._nointeraction&&(s=t.virtualListHelper.getItemElementAt(e)),this._setSingleSelectedItemEl(s),this}setSingleSelectedItem(e){const t=this._p;let s=e._nointeraction?-1:this._getItemIndex(e);return s>-1&&t.items[s]._nointeraction&&(s=-1),this.setSingleSelectedItemAtIndex(s)}setSingleSelectedItemByValue(e){return this.setSingleSelectedItemAtIndex(this.itemIndexByValue(e))}next(e){this._move("next",e)}previous(e){this._move("prev",e)}isFirstItem(){const e=this._p;return 0===e.focusItemIndex&&e.focusItemIndex<e.items.length}isLastItem(){const e=this._p;return e.focusItemIndex>-1&&e.focusItemIndex===e.items.length-1}scrollItemIndexIntoView(e){const t=this._p;if(this._hasScroll()){const s=t.el,i=s.scrollTop;let r,n=-1,l=30;for(;l-- >0&&(r=t.virtualListHelper.getItemPosition(e),r!==n);){n=r;let l=t.virtualListHelper.getItemSize(e),o=s.clientHeight;r<i?s.scrollTop=r:r+l>i+o&&(s.scrollTop=r+l-o),t.virtualListHelper.render()}}return this}on(e,t){return this._p.mitt.on(e,t),this}once(e,t){let s=i=>{this._p.mitt.off(e,s),t(i)};return this._p.mitt.on(e,s),this}off(e,t){return e||e?this._p.mitt.off(e,t):this._p.mitt.all.clear(),this}emit(e,t){return this._p.mitt.emit(e,t),this}_getItemIndex(e){const t=this._p;let s=-1;if(e&&(s=t.items.indexOf(e),-1===s)){let t=e&&void 0!==e.value?e.value:e,i=e&&e.label?e.label:t;s=this.itemIndexByValueOrLabel(t,i)}return s}_setSingleSelectedItemEl(e){const t=this._p;return t.singleSelectedItemEl&&(t.singleSelectedItemEl.classList.remove("".concat(t.baseClassName,"__item_checked")),t.singleSelectedItemEl=null),e&&(e.classList.add("".concat(t.baseClassName,"__item_checked")),t.singleSelectedItemEl=e),this}_trigger(e,t){const s=this._p;s.on&&s.on(e,...void 0===t?[]:[t]),s.mitt.emit(e,t)}_itemUpAction(t,s){if(e.closestUntil(t.target,".requires-pointer-events,button",s))return;let i=this._p;if(!this._mouseHandled){if(this.triggerItemSelection(null,t),this[aa])return;this.toggleFocusedItem(),document.activeElement!==this.el&&i.focusItemEl&&clearTimeout(i.blurTimer),setTimeout((()=>{this._mouseHandled=!1}),0)}}_hookMouseEvents(){const t=this._p;t.sink.add(t.el,"mouseup",(t=>{const s=e.closestUntil(t.target,"li",t.currentTarget);s&&0===t.button&&this._itemUpAction(t,s)})).add(t.el,"mouseover",(t=>{const s=e.closestUntil(t.target,"li",t.currentTarget);s&&this._handleMouseOver(t,s)}))}_handleMouseOver(e,t){this._focus(e,t,null,!0)}_hookTouchEvents(){const t=this._p;let s;t.sink.add(t.el,"touchstart",(i=>{const r=e.closestUntil(i.target,"li",i.currentTarget);if(!r)return;if(s)return;if(e.closestUntil(i.target,".requires-pointer-events,button",r))return;s=i.changedTouches[0].identifier,this._handleMouseOver(i,r);let n=!1,l=()=>{n=!0},o=()=>{s=null,t.sink.remove(null,".dropdown_touchextra")},a=r.parentNode;for(;a;)t.sink.add(a,"scroll.dropdown_touchextra",l),a=a.parentNode;t.sink.add(window,"scroll.dropdown_touchextra",l),t.sink.add(window,"touchcancel.dropdown_touchextra",o),t.sink.add(t.el,"touchend.dropdown_touchextra",(t=>{const i=e.closestUntil(t.target,"li",t.currentTarget);return i&&Array.prototype.find.call(t.changedTouches,(e=>e.identifier===s))?(o(),void(n||(this._itemUpAction(t,i),t.preventDefault()))):o()}))}))}_hookFocusEvents(){const e=this._p;e.sink.add(e.el,"focus",(t=>{let s=e.focusItemEl||e.el.firstChild;this._focus(t,s,null,!1)})).add(e.el,"blur",(e=>{setTimeout((()=>{this[aa]||document.activeElement&&this.elContains(document.activeElement,!0)||(this._delayBlurItemOnBlur(),this._trigger("blur",e))}))}))}_hookKeyEvents(){const e=this._p;e.sink.add(e.el,"keydown",(e=>this._keydown(e)))}_keydown(e){const t=this._p;if(t.keyDownHandler&&t.keyDownHandler.call(this,e))return;let s=!0;switch(e.key){case n.VALUE_PAGE_UP:case n.VALUE_PAGE_DOWN:case n.VALUE_HOME:case n.VALUE_END:case n.VALUE_UP:case n.VALUE_DOWN:switch(e.preventDefault(),e.key){case n.VALUE_PAGE_UP:this.previousPage(e);break;case n.VALUE_PAGE_DOWN:this.nextPage(e);break;case n.VALUE_HOME:this._move("first",e);break;case n.VALUE_END:this._move("last",e);break;case n.VALUE_UP:this.previous(e);break;case n.VALUE_DOWN:this.next(e)}break;case n.VALUE_LEFT:case n.VALUE_RIGHT:if(e.key===n.VALUE_RIGHT&&"rtl"!==getComputedStyle(e.target).direction||e.key===n.VALUE_LEFT&&"rtl"===getComputedStyle(e.target).direction){let e=t.items[t.focusItemIndex];t.focusItemIndex>-1&&e._subitems&&this._showSublist(e,t.focusItemEl)}else t.currentSubDropList?(this._hideSublist(),s=!1):this._trigger("_back_key_pressed");break;case n.VALUE_ENTER:this.triggerItemSelection(null,e),e.preventDefault();break;case n.VALUE_SPACE:this.toggleFocusedItem(),e.preventDefault();break;case n.VALUE_ESCAPE:e.preventDefault(),this.hide();break;default:if("keydown"===e.type)return;this._keydownFreeType(e),s=!1}}_keydownFreeType(e){const t=this._p;let s=e.key||String.fromCharCode(e.keyCode);if(1!==s.length)return;clearTimeout(t.filterTimer);let i,r=(t.previousFilter||"")+s,n=new RegExp("^".concat(la(r)),"i"),l=-1,o=t.focusItemIndex;for(let e=0,s=t.items.length;e<s&&(-1!==l&&e<o||(i=t.items[e],!(n.test(i.label)&&(l=e,-1===o||e>=o))));e++);if(-1===l){r=s,n=new RegExp("^".concat(la(r)),"i");for(let e=0,s=t.items.length;e<s&&(-1!==l&&e<o||(i=t.items[e],!(n.test(i.label)&&(l=e,-1===o||e>=o))));e++);}if(l>-1){let s=t.virtualListHelper.getItemElementAt(l);this._focus(e,s||null,l,!0),this.isVisible()||this.triggerItemSelection(s?null:t.items[l],e),t.previousFilter=r,t.filterTimer=setTimeout((()=>{delete t.previousFilter}),1e3)}else delete t.previousFilter}_focus(e,t,s,i){var r;const n=this._p;if(n._isFocusingItem)return;n._isFocusingItem=!0,!s&&t&&(s=n.virtualListHelper.getItemIndexFromElement(t)),s>-1?this.scrollItemIndexIntoView(s):void 0===s&&(t=null);let l=t||n.virtualListHelper.getItemElementAt(s);if(!l||l[oa]._nointeraction)return n._isFocusingItem=!1,void this.blurFocusedItem();if(l===n.focusItemEl)return n._isFocusingItem=!1,void clearTimeout(n.blurTimer);this.blurFocusedItem(),l.classList.add("".concat(n.baseClassName,"__item_focus")),n.focusItemEl=l,n.focusItemIndex=s;const o=n.items[s];this._trigger("itemfocus",{value:o.value,item:null!==(r=o[oa])&&void 0!==r?r:o,event:e,el:l}),n._isFocusingItem=!1,i&&this._showSublist(o,l)}_delayBlurItemOnBlur(){if(this[aa])return;const e=this._p;e.autoItemBlur&&(clearTimeout(e.blurTimer),e.blurTimer=setTimeout((()=>{this[aa]||this.blurFocusedItem()}),e.autoItemBlurDelay))}_move(e,t){const i=this._p;let r,n,l=!1;if("first"===e)n=0,l=!1;else if("last"===e)n=i.items.length-1,l=!0;else if("prev"===e){if(!this.hasFocusedItem())return this._move("last",t);n=i.focusItemIndex-1,-1===n&&(n=i.items.length-1),l=!0}else if("next"===e){if(!this.hasFocusedItem())return this._move("first",t);n=i.focusItemIndex+1,n===i.items.length&&(n=0),l=!1}else{if("prev_page"!==e&&"next_page"!==e)return;if(!this.hasFocusedItem())return this._move("prev_page"===e?"prev":"next",t);if("prev_page"===e&&this.isFirstItem()||"next_page"===e&&this.isLastItem())return;if(!this._hasScroll())return this._move("prev_page"===e?"first":"last",t);if(i.virtualListHelper.isVirtual()){let t=i.virtualListHelper.getVisibleItemCount();n=i.focusItemIndex,"prev_page"===e?n-=t:n+=t,n<0?n=0:n>=i.items.length&&(n=i.items.length)}else if(i.focusItemEl){let t=s.getElementOffset(i.focusItemEl).top,l=s.getElementHeight(i.el,!0);for(;;){if(r=i.focusItemEl.nextElementSibling,!r)return;if("LI"===r.tagName)if("prev_page"===e){if(s.getElementOffset(r).top-t+l<=0)break}else if(s.getElementOffset(r).top-t-l>=0)break}r&&(n=i.virtualListHelper.getItemIndexFromElement(r),void 0===n&&(n=-1))}l="prev_page"===e}let o=i.items.length;if(n>=o)return;let a=i.items[n],u=n;for(;a&&a._nointeraction&&(l?(n--,-1===n&&(n=o)):(n++,n===o&&(n=0)),a=i.items[n],n!==u););r=i.virtualListHelper.getItemElementAt(n),this._focus(t,r||null,n,!1),this.isVisible()||this.triggerItemSelection(a,t)}_hasScroll(){return this.el.clientHeight<this.el.scrollHeight}_updateGroupStateForItem(e){const s=this._p;if(!s.multi)return this;if(e._group){var i;let n=0;if(s.autoCheckGroupChildren){let i=s.items;for(let l=i.indexOf(e)+1,o=i.length;l<o;l++){var r;let o=i[l];if(o._group||!o._child&&i[l-1]._child)break;if(!!o._checked===e._checked)continue;o._checked=e._checked,n++;let a=s.virtualListHelper.getItemElementAt(l);a&&t.toggleClass(a,"".concat(s.baseClassName,"__item_checked"),e._checked),this._trigger("check",{value:o.value,item:null!==(r=o[oa])&&void 0!==r?r:o,checked:o._checked,isGroup:o._group,isCheckingGroup:!0})}}this._trigger("groupcheck",{value:e.value,item:null!==(i=e[oa])&&void 0!==i?i:e,affectedItems:n})}else if(s.groupCount>0&&s.autoCheckGroupChildren){let t=s.items,i=-1;for(let s=t.indexOf(e)-1;s>=0;s--)if(t[s]._group){i=s;break}i>-1&&this._updateGroupCheckedState(i,!0)}return this}_updateGroupCheckedState(e,s){const i=this._p;if(!(i.multi&&i.autoCheckGroupChildren&&e>-1))return this;let r=i.items,n=r[e];if(!n||!n._group)return this;let l,o=!1,a=!1;for(let t=e+1,s=r.length;t<s&&(l=r[t],!(l._group||!l._child&&r[t-1]._child));t++)l._checked?o=!0:l._checked||(a=!0);if(!o&&!a)return this;let u=o&&!a;if(!!n._checked!==u){n._checked=u;let r=i.virtualListHelper.getItemElementAt(e);var c;r&&t.toggleClass(r,"".concat(i.baseClassName,"__item_checked"),n._checked),s&&this._trigger("check",{value:n.value,item:null!==(c=n[oa])&&void 0!==c?c:n,checked:n._checked,isGroup:n._group,isCheckingGroup:!1})}return this}_measureItem(){const e=this._p;if(e.lastMeasureItemCount!==e.items.length){let t=e.lastMeasureLongestLabel||1,s=e.lastMeasureLongestLabelText||"";for(let i=0,r=e.items,n=r.length;i<n;i++){const e=r[i];let n=e.label;null==n&&(n=e.value),null==n&&(n="");let l=n.length;l>t&&(t=l,s=n)}e.lastMeasureItemCount=e.items.length,e.lastMeasureLongestLabel=t,e.lastMeasureLongestLabelText=s}return(e.estimateWidth||e.virtualListHelper.isVirtual())&&e.virtualListHelper.createGhostItemElement(ua,!0,(t=>{e.lastMeasureItemWidth=s.getElementWidth(t,!0,!0)})),this}_determineVirtualMode(e){const t=this._p;let s=t.items;void 0===e&&(e=s.length);let i=e>=t.virtualMinItems;return i!==t.virtualListHelper.isVirtual()&&t.virtualListHelper.setVirtual(i).render(),this}_renderItemContent(t,s){const i=this._p;i.renderItem&&!1!==i.renderItem(t[oa]||t,s)||(s.appendChild(e.createElement("span",{class:"".concat(i.baseClassName,"__item_label"),textContent:t.label})),i.multi&&(t._nocheck||s.insertBefore(e.createElement("span",{class:"checkbox"}),s.firstChild)))}_updateWidth(e){const t=this._p,i=t.el;let r=0;e&&(r="number"==typeof e.updateWidth||null!=e.targetWidth?e.updateWidth:s.getElementWidth(e.target,!0,!0));let n=0;t.useExactTargetWidth||(t.estimateWidth||t.virtualListHelper.isVirtual()?n=t.lastMeasureItemWidth:(i.style.width="",n=s.getElementWidth(i,!0,!0)));let l=Math.max(n,r);s.setElementWidth(i,l,!0,!0);const o=getComputedStyle(i);let a=(parseFloat(o.borderLeftWidth)||0)+(parseFloat(o.borderRightWidth)||0),u=i.scrollWidth+a;if(u>l){let e=u-l;i.style.width="".concat(parseFloat(i.style.width)+e,"px"),l=u}return l}}const ma=(e,t,s)=>{let i,r,n,l,o=0;s||(s={});const a=()=>{o=!1===s.leading?0:Date.now(),i=null,l=e.apply(r,n),i||(r=n=null)},u=function(){const u=Date.now();o||!1!==s.leading||(o=u);const c=t-(u-o);return r=this,n=arguments,c<=0||c>t?(i&&(clearTimeout(i),i=null),o=u,l=e.apply(r,n),i||(r=n=null)):i||!1===s.trailing||(i=setTimeout(a,c)),l};return u.cancel=()=>{clearTimeout(i),o=0,i=r=n=null},u.isScheduled=()=>!!i,u},pa=Symbol("item"),_a=Symbol("destroyed"),fa=Symbol("no_results_items"),ga=Symbol("rest_multi_items"),ba=!!("ontouchstart"in window||window.DocumentTouch&&window.document instanceof window.DocumentTouch||window.navigator.maxTouchPoints),Ia=function(e,t){return e instanceof Element&&e.classList.contains(t)},va=["font-family","font-size","font-weight","font-size","letter-spacing","text-transform","word-spacing","text-indent","box-sizing","padding-left","padding-right"],ya={el:null,baseClassName:"selectbox",disabled:!1,clearable:!0,hasOpenIndicator:!0,placeholder:"",sortSelectedItems:!0,sortListItems:!1,sortListCheckedFirst:!0,stickyValues:null,sortItemComparator:null,splitListCheckedGroups:!0,treatGroupSelectionAsItems:!1,blurOnSingleSelection:"touch",multi:!1,showSelection:!0,showPlaceholderInTooltip:!1,multiPlaceholderFormatter:null,searchable:!0,noResultsText:"No matching results",filterThrottleWindow:300,filterOnEmptyTerm:!1,labelProp:"label",valueProp:"value",multiItemLabelProp:"short_label",maxMultiItems:null,multiItemsRestLabelProvider:null,items:[],selectedValues:void 0,value:void 0,isLoadingMode:!1};exports.DropList=ha,exports.SelectBox=class{constructor(s){const r={...ya};for(let[e,t]of Object.entries(s))void 0!==t&&(r[e]=t);const n=this._p={ownsEl:!0,baseClassName:r.baseClassName,additionalClasses:r.additionalClasses,direction:"ltr"===r.direction?"ltr":"rtl"===r.direction?"rtl":"auto",listOptions:r.listOptions,disabled:!!r.disabled,clearable:!!r.clearable,hasOpenIndicator:!!r.hasOpenIndicator,placeholder:r.placeholder,sortSelectedItems:!!r.sortSelectedItems,sortListItems:!!r.sortListItems,sortListCheckedFirst:!!r.sortListCheckedFirst,stickyValues:Array.isArray(r.stickyValues)?new Set(r.stickyValues):null,sortItemComparator:r.sortItemComparator,splitListCheckedGroups:!!r.splitListCheckedGroups,treatGroupSelectionAsItems:r.treatGroupSelectionAsItems,blurOnSingleSelection:r.blurOnSingleSelection,multi:r.multi,showSelection:r.showSelection,showPlaceholderInTooltip:r.showPlaceholderInTooltip,multiPlaceholderFormatter:r.multiPlaceholderFormatter,searchable:r.searchable,noResultsText:r.noResultsText,filterThrottleWindow:r.filterThrottleWindow,filterOnEmptyTerm:r.filterOnEmptyTerm,labelProp:r.labelProp,valueProp:r.valueProp,multiItemLabelProp:r.multiItemLabelProp,maxMultiItems:r.maxMultiItems,multiItemsRestLabelProvider:r.multiItemsRestLabelProvider,renderSingleItem:r.renderSingleItem,unrenderSingleItem:r.unrenderSingleItem,renderMultiItem:r.renderMultiItem,unrenderMultiItem:r.unrenderMultiItem,renderRestMultiItem:r.renderRestMultiItem,unrenderRestMultiItem:r.unrenderRestMultiItem,renderNoResultsItem:r.renderNoResultsItem,unrenderNoResultsItem:r.unrenderNoResultsItem,filterFn:r.filterFn,on:r.on||null,silenceEvents:!0,mitt:l(),isLoadingMode:!!r.isLoadingMode,items:[],filteredItems:null,currentItemsView:[],itemsChanged:!0,sink:new i,resizeObserver:null,selectedItems:[],selectedValues:[],selectionChanged:!0,resortBySelectionNeeded:!1,throttledUpdateListItems:ma((()=>this._updateListItems()),r.filterThrottleWindow,{leading:!0,trailing:!0}),filterTerm:""};let o=r.el;o instanceof Element?n.ownsEl=!1:o=e.createElement("span"),e.setElementAttrs(o,{role:"combobox","aria-haspopup":"true","aria-expanded":"false"}),n.el=o,this._syncBaseClasses(),this._renderBase(),n.multiItemEls=[],this.enable(!n.disabled),this._setupDropdownMenu(),n.sink.add(o,"click",(e=>{n.clearButtonWrapper&&n.clearButtonWrapper.contains(e.target)||o.contains(document.activeElement)||(n.input.focus(),n.input.selectionStart=n.input.selectionEnd=n.input.value.length)})),n.sink.add(o,"focus",(e=>{const t=e.target;if(!o.contains(e.relatedTarget)&&!Ia(t,"".concat(n.baseClassName,"__search_field"))&&!Ia(t,"".concat(n.baseClassName,"__item"))){let e=o.querySelector(".".concat(n.baseClassName,"__search_field"));e&&e.focus()}}),!0),n.sink.add(n.input,"keydown",(e=>{this._handleInputKeydown(e)})).add(n.input,"input",(()=>{this._resizeInput()}));const a=(()=>{let e;return()=>{e&&clearTimeout(e),e=setTimeout((()=>{t.toggleClass(o,"".concat(n.baseClassName,"__focus"),o.contains(document.activeElement))}))}})();if(n.sink.add(o,"focus",a,!0),n.sink.add(o,"blur",a,!0),n.sink.add(window,"resize",(()=>this._resizeInput())),n.sink.add(window,"orientationchange",(()=>this._resizeInput())),void 0!==window.ResizeObserver){let e={borderBoxSize:{blockSize:null,inlineSize:null},contentBoxSize:{blockSize:null,inlineSize:null}};n.resizeObserver=new ResizeObserver((t=>{if(this[_a])return;const s=t[0];e&&s.borderBoxSize[0].blockSize===e.borderBoxSize.blockSize&&s.borderBoxSize[0].inlineSize===e.borderBoxSize.inlineSize&&s.contentBoxSize[0].blockSize===e.contentBoxSize.blockSize&&s.contentBoxSize[0].inlineSize===e.contentBoxSize.inlineSize||(n.resizeObserver.unobserve(n.el),this._resizeInput(),requestAnimationFrame((()=>n.resizeObserver.observe(n.el)))),e.borderBoxSize=s.borderBoxSize[0],e.contentBoxSize=s.contentBoxSize[0]})),n.resizeObserver.observe(n.el)}return this.setItems(r.items),delete r.items,r.multi&&Array.isArray(r.selectedValues)?this.setSelectedValues(r.selectedValues):null!=r.value&&this.setValue(r.value),this._scheduleSync("full"),this.silenceEvents=!1,this}destroy(){var e;if(this[_a])return;this[_a]=!0;const s=this._p;if(s.syncTimeout&&(clearTimeout(s.syncTimeout),delete s.syncTimeout),this._stopTrackingPresence(),s.sink.remove(),s.dropList&&s.dropList.destroy(),s.throttledUpdateListItems&&s.throttledUpdateListItems.cancel(),this._cleanupSingleWrapper(),s.unrenderMultiItem||s.unrenderRestMultiItem)for(;s.multiItemEls.length>0;)this._removeMultiItemElementByIndex(s.multiItemEls.length-1);if(t.remove(s.list),t.remove(s.singleWrapper),t.remove(s.input),t.remove(s.inputBackBuffer),t.remove(s.clearButtonWrapper),t.remove(s.openIndicator),!s.ownsEl){for(let e of Array.from(s.el.classList))e.startsWith(s.baseClassName)&&s.el.classList.remove(e);s.el.removeAttribute("role"),s.el.removeAttribute("aria-haspopup"),s.el.removeAttribute("aria-expanded")}null===(e=s.resizeObserver)||void 0===e||e.disconnect(),this._p=null}get el(){return this._p.el}enable(e){const t=this._p;void 0===e&&(e=!0),t.disabled=!e,t.el.setAttribute("aria-disabled",t.disabled.toString()),t.input.disabled=!!t.disabled;const s=t.multiItemEls;for(let e of s)t.disabled?e.removeAttribute("tabindex"):e.setAttribute("tabindex","0");return this}isEnabled(){return!this._p.disabled}disable(e){return this.enable(void 0!==e&&!e)}isDisabled(){return this._p.disabled}setAdditionalClasses(e){return this._p.additionalClasses=e,this._syncBaseClasses(),this}setItems(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const s=this._p;return e||(e=[]),s.items=e.slice(0),s.filteredItems=null,s.itemsChanged=!0,this._updateItemByValueMap(),t&&this.setSelectedValues(this.getSelectedValues()),this._trigger("itemschanged",{term:null,mutated:!0,count:this.getFilteredItemCount()}),this}getFilteredItemCount(){const e=this._p;return e.filteredItems?e.filteredItems.length:e.items?e.items.length:0}isFilterPending(){const e=this._p;return!!(e.throttledUpdateListItems.isScheduled()||!e.filteredItems&&(e.filterTerm||e.filterOnEmptyTerm&&e.filterFn))}updateItemByValue(e,t){const s=this._p;let i=s.itemByValueMap.get(e);i&&Object.assign(i,t),s.dropList&&s.dropList.updateItemByValue(e,t)}getItems(){return this._p.items}setClearable(e){return e=!!e,this._p.clearable===e||(this._p.clearable=!!e,this._scheduleSync("render_clear")),this}getClearable(){return this._p.clearable}setHasOpenIndicator(e){return e=!!e,this._p.hasOpenIndicator===e||(this._p.hasOpenIndicator=e,this._scheduleSync("render_base")),this}getHasOpenIndicator(){return this._p.hasOpenIndicator}setPlaceholder(e){return this._p.placeholder=null==e?"":String(e),this._scheduleSync("render_base"),this}getPlaceHolder(){return this._p.placeholder}setSearchTerm(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=this._p;return s.input?(s.input.value=e,this._scheduleSync("resize_input"),t&&(s.filterTerm=s.input.value.trim(),s.filteredItems=null,s.itemsChanged=!0,this._trigger("search",{value:s.input.value}),s.throttledUpdateListItems()),this):this}getSearchTerm(){const e=this._p;return e.input?e.input.value:""}invokeRefilter(){const e=this._p;return e.filterTerm||e.filterOnEmptyTerm||e.filteredItems?(e.filteredItems=null,e.itemsChanged=!0,e.throttledUpdateListItems(),this):this}setSortSelectedItems(e){const t=this._p;return e=!!e,t.sortSelectedItems===e||(t.sortSelectedItems=e,this._scheduleSync("render_items")),this}isSortSelectedItemsEnabled(){return this._p.sortSelectedItems}setSortListItems(e){const t=this._p;return e=!!e,t.sortListItems===e||(t.sortListItems=e,t.filteredItems=null,t.itemsChanged=!0,this._scheduleSync("render_list")),this}isSortListItemsEnabled(){return this._p.sortListItems}setSortListCheckedFirst(e){const t=this._p;return e=!!e,t.sortCheckedFirst===e||(t.sortCheckedFirst=e,t.itemsChanged=!0,this._scheduleSync("render_list")),this}isSortListCheckedFirstEnabled(){return this._p.sortListCheckedFirst}setStickyValues(e){const t=this._p;return t.stickyValues=Array.isArray(e)?new Set(e):null,t.itemsChanged=!0,this._scheduleSync("render_list"),this}getStickyValues(){return this._p.stickyValues?Array.from(this._p.stickyValues):null}setSortItemComparator(e){const t=this._p;return t.sortItemComparator===e||(t.sortItemComparator=e,t.itemsChanged=!0,this._scheduleSync("render_list")),this}getSortItemComparator(){return this._p.sortItemComparator}setTreatGroupSelectionAsItems(e){const t=this._p;return e=!!e,t.treatGroupSelectionAsItems===e||(t.treatGroupSelectionAsItems=e,t.itemsChanged=!0,this._scheduleSync("render_list")),this}isTreatGroupSelectionAsItemsEnabled(){return!this._p.treatGroupSelectionAsItems}setSplitListCheckedGroups(e){const t=this._p;return e=!!e,t.splitListCheckedGroups===e||(t.splitListCheckedGroups=e,t.itemsChanged=!0,this._scheduleSync("render_list")),this}isSplitListCheckedGroupsEnabled(){return this._p.splitListCheckedGroups}setShowSelection(e){const t=this._p;return e=!!e,t.showSelection===e||(t.showSelection=e,this._scheduleSync("render_items")),this}isShowSelectionEnabled(){return this._p.showSelection}setShowPlaceholderInTooltip(e){const t=this._p;return e=!!e,t.showPlaceholderInTooltip===e||(t.showPlaceholderInTooltip=e,this._scheduleSync("render_base")),this}isShowPlaceholderInTooltipEnabled(){return this._p.showPlaceholderInTooltip}setMultiPlaceholderFormatter(e){const t=this._p;return t.multiPlaceholderFormatter===e||(t.multiPlaceholderFormatter=e,this._scheduleSync("render_base")),this}setBlurOnSingleSelection(e){const t=this._p;return t.blurOnSingleSelection===e||(t.blurOnSingleSelection=e),this}getBlurOnSingleSelection(){return this._p.blurOnSingleSelection}setMulti(e){const s=this._p;return e=!!e,s.multi===e||(s.multi=e,this._setupDropdownMenu(),t.remove(s.clearButtonWrapper),delete s.clearButtonWrapper,e&&s.selectedValues&&1===s.selectedValues.length&&Array.isArray(s.selectedValues[0])&&this.setSelectedValues(s.selectedValues[0]),this._scheduleSync("full")),this}isMultiEnabled(){return this._p.multi}setSearchable(e){const t=this._p;return e=!!e,t.searchable===e||(t.searchable=e,this._scheduleSync("full")),this}isSearchableEnabled(){return this._p.searchable}setNoResultsText(e){return this._p.noResultsText=e,this._scheduleSync("render_list"),this}getNoResultsText(){return this._p.noResultsText}setFilterThrottleWindow(e){const t=this._p;t.filterThrottleWindow=e;let s=!!t.throttledUpdateListItems&&t.throttledUpdateListItems.isScheduled();return t.throttledUpdateListItems&&t.throttledUpdateListItems.cancel(),t.throttledUpdateListItems=ma((()=>this._updateListItems()),t.filterThrottleWindow,!0),s&&t.throttledUpdateListItems(),this}getFilterThrottleWindow(){return this._p.filterThrottleWindow}setFilterOnEmptyTerm(e){const t=this._p;return t.filterOnEmptyTerm===e||(t.filterOnEmptyTerm=e,t.throttledUpdateListItems()),this}getFilterOnEmptyTerm(){return this._p.filterOnEmptyTerm}setListOptions(e){return this._p.listOptions=e,this._setupDropdownMenu(),this}setRenderSingleItem(e,t){const s=this._p;return s.renderSingleItem=e,s.unrenderSingleItem=t,this}setRenderMultiItem(e,t){const s=this._p;return s.renderMultiItem=e,s.unrenderMultiItem=t,this}setRenderRestMultiItem(e,t){const s=this._p;return s.renderRestMultiItem=e,s.unrenderRestMultiItem=t,this}setRenderNoResultsItem(e,t){const s=this._p;return s.renderNoResultsItem=e,s.unrenderNoResultsItem=t,this}setLabelProp(e){const t=this._p;return t.labelProp=e,t.dropList&&t.dropList.setLabelProp(e),this}setValueProp(e){const t=this._p;return t.valueProp===e||(t.valueProp=e,t.dropList&&t.dropList.setValueProp(e),this._updateItemByValueMap()),this}setMultiItemLabelProp(e){return this._p.multiItemLabelProp=e,this}setMaxMultiItems(e){return this._p.maxMultiItems=e,this}setMultiItemsRestLabelProvider(e){return this._p.multiItemsRestLabelProvider=e,this}setFilterFn(e){const t=this._p;return t.filterFn===e||(t.filterFn=e,t.throttledUpdateListItems()),this}getFilterFn(){return this._p.filterFn}focusInput(){const e=this._p;return e.input&&e.input.focus(),this}blurInput(){const e=this._p;return e.input&&e.input.blur(),this}clear(){return this._performClearWithEvent(!0)?(this[_a],this):this}getValue(){const e=this._p;return e.multi?e.selectedValues.slice(0):e.selectedValues.length>0?e.selectedValues[0]:void 0}setValue(e){return this._p.multi?this.setSelectedValues(Array.isArray(e)?e:void 0!==e?[e]:[]):this.setSelectedValues(void 0!==e?[e]:[])}getSelectedValues(){return this._p.selectedValues.slice(0)}setSelectedValues(e){const t=this._p,s=t.valueProp;t.multi||(e=e.slice(0,1));let i=new Set,r=[],n=[];for(let l of e){if(i.has(l))continue;i.add(l),r.push(l);let e=t.itemByValueMap.get(l);void 0!==e?n.push(e):n.push({[s]:l})}return t.selectedValues=r,t.selectedItems=n,t.selectionChanged=!0,t.resortBySelectionNeeded=!0,this._scheduleSync("full"),this}getSelectedValueCount(){return this._p.selectedValues.length}getSelectedItems(){return this._p.selectedItems.slice(0)}setSelectedItems(e){return this._setSelectedItems(e),this}openList(){const e=this._p;return e.dropList.isVisible()||e.isLoadingMode&&0===e.items.length||(this._trigger("open:before",{list:e.dropList}),e.dropList.setDirection(getComputedStyle(e.el).direction),e.dropList.show(this._getDropListPositionOptions()),this._repositionDropList(),this._repositionDropList(),e.dropList.hasFocusedItem()&&e.dropList.setFocusedItemAtIndex(e.dropList.getFocusedItemIndex())),this}closeList(){const e=this._p;return this[_a]?this:e.dropList.isVisible()?(e.dropList.hide(),this):this}toggleList(e){const t=this._p;return(void 0===e?!t.dropList.isVisible():e)?this.openList():this.closeList()}isListOpen(){return!!this._p.dropListVisible}toggleLoading(e){return this.setIsLoadingMode(void 0===e?!this.getIsLoadingMode():!!e)}setIsLoadingMode(e){const t=this._p;return e=void 0===e||!!e,t.isLoadingMode===e||(t.isLoadingMode=e,t.isLoadingMode&&0===t.items.length&&this.isListOpen()?this.closeList():!t.isLoadingMode&&document.activeElement&&((t.multi||t.searchable)&&t.input.contains(document.activeElement)||!t.multi&&!t.searchable&&t.el.contains(document.activeElement))&&this.openList(),this._scheduleSync("render_base")),this}getIsLoadingMode(){return this._p.isLoadingMode}setDirection(e){return this._p.direction="ltr"===e?"ltr":"rtl"===e?"rtl":"auto",this._syncBaseClasses(),this}getDirection(){return this._p.direction}refreshSize(){return this._resizeInput(),this}on(e,t){return this._p.mitt.on(e,t),this}once(e,t){let s=i=>{this._p.mitt.off(e,s),t(i)};return this._p.mitt.on(e,s),this}off(e,t){return e||e?this._p.mitt.off(e,t):this._p.mitt.all.clear(),this}emit(e,t){return this._p.mitt.emit(e,t),this}_updateItemByValueMap(){const e=this._p,t=e.itemByValueMap=new Map,s=e.valueProp;for(let i of e.items)t.set(i[s],i)}_renderBase(){const s=this._p;if(s.inputBackBuffer||(s.inputBackBuffer=e.createElement("span",{css:{position:"absolute",zIndex:-1,left:0,top:"-9999px",whiteSpace:"pre"}})),s.input||(s.inputWrapper=e.createElement("span",{class:"".concat(s.baseClassName,"__search_wrapper")},s.input=e.createElement("input",{class:"".concat(s.baseClassName,"__search_field"),type:"search",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox","aria-autocomplete":"list",readOnly:!(s.searchable||s.multi)}))),s.multi){if(s.singleWrapper&&(this._cleanupSingleWrapper(),t.remove(s.singleWrapper),delete s.singleWrapper),!s.list){this._unregisterDropdownEvents();const t=document.activeElement;s.list=e.createElement("ul",{class:"".concat(s.baseClassName,"__list")}),s.el.appendChild(s.list),s.list.appendChild(s.inputWrapper),s.el.classList.remove("".concat(s.baseClassName,"__single")),s.el.classList.add("".concat(s.baseClassName,"__multi")),s.sink.add(s.list,"click",(t=>{e.closestUntil(t.target,".".concat(s.baseClassName,"__item_remove"),t.currentTarget)&&(s.disabled||this._removeMultiItemFromEvent(e.closestUntil(t.target,".".concat(s.baseClassName,"__item"),t.currentTarget),t))})).add(s.list,"keydown",(t=>{e.closestUntil(t.target,".".concat(s.baseClassName,"__item"),t.currentTarget)&&this._handleMultiKeydown(t)})),t===s.input&&s.input.focus(),this._registerDropdownEvents()}}else if(s.list&&(t.remove(s.list),s.sink.remove(s.list),delete s.list),!s.singleWrapper){this._unregisterDropdownEvents();const t=document.activeElement;s.singleWrapper=e.createElement("div",{class:"".concat(s.baseClassName,"__single_wrapper")}),s.el.appendChild(s.singleWrapper),s.el.appendChild(s.inputWrapper),s.el.classList.remove("".concat(s.baseClassName,"__multi")),s.el.classList.add("".concat(s.baseClassName,"__single")),t===s.input&&s.input.focus(),this._registerDropdownEvents()}s.hasOpenIndicator!==!!s.openIndicator&&(s.hasOpenIndicator?(s.openIndicator=e.createElement("span",{class:"".concat(s.baseClassName,"__open_indicator")}),s.el.appendChild(s.openIndicator)):(t.remove(s.openIndicator),delete s.openIndicator,s.el.classList.remove("".concat(s.baseClassName,"__has_open_indicator")))),s.isLoadingMode!==!!s.spinner&&(s.isLoadingMode?(s.spinner=e.createElement("span",{class:"".concat(s.baseClassName,"__spinner")}),s.el.appendChild(s.spinner),s.el.classList.add("".concat(s.baseClassName,"__has_spinner"))):(t.remove(s.spinner),delete s.spinner,s.el.classList.remove("".concat(s.baseClassName,"__has_spinner"))))}_syncBaseClasses(){const e=this._p,t=e.el;if(!t)return;let s=[e.baseClassName];e.multi?s.push("".concat(e.baseClassName,"__multi")):s.push("".concat(e.baseClassName,"__single")),this.isListOpen()?s.push("".concat(e.baseClassName,"__open_list")):s.push("".concat(e.baseClassName,"__closed_list")),e.hasOpenIndicator&&s.push("".concat(e.baseClassName,"__has_open_indicator")),e.clearButtonWrapper&&s.push("".concat(e.baseClassName,"__has_clear")),e.isLoadingMode&&s.push("".concat(e.baseClassName,"__has_spinner")),0===e.selectedValues.length&&s.push("".concat(e.baseClassName,"__empty_selection")),e.selectedValues.length>0&&s.push("".concat(e.baseClassName,"__has_selection")),(e.searchable||e.multi)&&s.push("".concat(e.baseClassName,"__searchable")),"ltr"!==e.direction&&"rtl"!==e.direction||s.push("".concat(e.baseClassName,"__")+e.direction),e.additionalClasses&&(s=s.concat(e.additionalClasses)),t.className=s.join(" ")}_setupDropdownMenu(){const t=this._p,s=t.valueProp;t.dropList&&(t.dropList.destroy(),delete t.dropList,t.itemsChanged=!0,t.selectionChanged=!0,t.resortBySelectionNeeded=!0);const i=t.renderNoResultsItem,r=t.unrenderNoResultsItem,n=(t.listOptions||{}).renderItem,l=(t.listOptions||{}).unrenderItem,o=i||n?(r,l)=>r&&r[s]===fa?(i&&!1!==i(r,l)||l.appendChild(e.createElement("div",{class:"droplist-no-results-content",textContent:t.noResultsText})),!0):!!n&&n(r,l):null,a=r||n?(e,t)=>{if(e&&e[s]===fa){if(r)return r(e,t)}else if(l)return l(e,t);return!1}:null,u=t.dropList=new ha({virtualMinItems:10,...t.listOptions,renderItem:o,unrenderItem:a,multi:t.multi,capturesFocus:!1,labelProp:t.labelProp,valueProp:t.valueProp,on:(e,s)=>{switch(e){case"show:before":{t.dropListVisible=!0,t.el.setAttribute("aria-expanded","true"),t.el.classList.add("".concat(t.baseClassName,"__open_list")),t.el.classList.remove("".concat(t.baseClassName,"__closed_list")),t.resortBySelectionNeeded&&t.sortListCheckedFirst&&t.multi&&(t.itemsChanged=!0),this._updateListItems(),this._trigger("open",{list:u}),this._startTrackingPresence(),t.sink.add(window,"resize.trackposition",(()=>this._repositionDropList()));let e=t.el.parentNode;for(;e;)(e.scrollHeight>e.offsetHeight||e.scrollWidth>e.offsetWidth)&&(e===document.documentElement&&(e=window),t.sink.add(e,"scroll.trackposition",(()=>this._repositionDropList()))),e=e.parentNode}break;case"hide":if(t.dropListVisible=!1,t.el.setAttribute("aria-expanded","false"),t.el.classList.remove("".concat(t.baseClassName,"__open_list")),t.el.classList.add("".concat(t.baseClassName,"__closed_list")),t.multi||(this._setInputText(""),this._scheduleSync("render_base")),this._trigger("close"),this[_a])return;this._stopTrackingPresence(),t.sink.remove(null,".trackposition");break;case"check":{if(!t.multi)return;const e=s.item,i=s.value;let r=s.checked;if(s.isGroup&&!t.treatGroupSelectionAsItems)return;let n={value:i,item:e,cancel:!1};if(this._trigger((r?"addsel":"removesel")+":before",n),n.cancel)return void t.dropList.setItemChecked(i,!r);if(r)t.selectedItems.push(e),t.selectedValues.push(i);else{const e=t.selectedValues.indexOf(i);-1!==e&&(t.selectedItems.splice(e,1),t.selectedValues.splice(e,1))}const l=!!s.isCheckingGroup;t.showSelection&&(r?(1===u.itemCount()&&this._setInputText(""),t.sortSelectedItems?l||this._scheduleSync("full"):(null!=t.maxMultiItems&&(t.treatGroupSelectionAsItems?t.selectedItems:t.selectedItems.filter((e=>!e._group))).length>t.maxMultiItems?this._scheduleSync("addOrUpdateMultiItemRestElement"):this._scheduleSync("addMultiItemElement",e),l||this._scheduleSync("render_base"))):(null!=t.maxMultiItems&&(t.treatGroupSelectionAsItems?t.selectedItems:t.selectedItems.filter((e=>!e._group))).length===t.maxMultiItems?this._scheduleSync("removeMultiItemRestElement"):this._scheduleSync("removeMultiItemElement",e),l||this._scheduleSync("render_base"))),this._trigger(r?"addsel":"removesel",{value:i,item:e})}break;case"groupcheck":if(!t.multi)return;s.affectedItems&&this._scheduleSync(t.sortSelectedItems?"full":"render_base");break;case"select":{if(t.multi)return;const e=s.item,i=s.value;if(!this._performSelectWithEvent(e,i))return;if(this[_a])return;this.closeList(),("touch"===t.blurOnSingleSelection&&ba||"touch"!==t.blurOnSingleSelection&&t.blurOnSingleSelection)&&t.input&&t.input.blur()}}}});t.sink.add(u.el,"mousedown",(t=>{e.closestUntil(t.target,"li",t.currentTarget)&&t.preventDefault()})),this._registerDropdownEvents()}_unregisterDropdownEvents(){this._p.sink.remove(null,".dropdown")}_registerDropdownEvents(){const t=this._p;this._unregisterDropdownEvents();const s=t.dropList;if(!s)return;let i=!1,r=null;const l=t.multi||t.searchable?t.input:t.el;t.sink.add(l,"keydown.dropdown",(e=>{if(e.currentTarget.readOnly)return;let i=!1,r=t.lastKeyAllowsNonTypeKeys;t.lastKeyAllowsNonTypeKeys=!1;let l=t.input&&t.input.value.length>0;switch(e.key){case n.VALUE_PAGE_UP:case n.VALUE_PAGE_DOWN:case n.VALUE_UP:case n.VALUE_DOWN:case n.VALUE_HOME:case n.VALUE_END:if((e.key===n.VALUE_HOME||e.key===n.VALUE_END)&&l&&!r){s._keydownFreeType(e);break}switch(t.lastKeyAllowsNonTypeKeys=!0,e.preventDefault(),e.key){case n.VALUE_PAGE_UP:s.isVisible()&&s.previousPage(e);break;case n.VALUE_PAGE_DOWN:s.isVisible()&&s.nextPage(e);break;case n.VALUE_UP:s.isVisible()?s.previous(e):this._movePrev();break;case n.VALUE_DOWN:s.isVisible()?s.next(e):this._moveNext();break;case n.VALUE_HOME:s.goToFirst(e);break;case n.VALUE_END:s.goToLast(e)}break;case n.VALUE_SPACE:r&&(t.lastKeyAllowsNonTypeKeys=!0,s.isVisible()&&s.hasFocusedItem()&&(i=!0,t.multi?s.toggleFocusedItem(e):s.triggerItemSelection(null,e),e.preventDefault()));break;case n.VALUE_ENTER:s.isVisible()&&s.hasFocusedItem()&&(i=!0,e.preventDefault(),s.triggerItemSelection(null,e));break;case n.VALUE_TAB:s.isVisible()&&s.hasFocusedItem()&&s.triggerItemSelection(null,e);break;case n.VALUE_ESCAPE:s.isVisible()&&(s.hide(e),e.preventDefault());break;default:s._keydownFreeType(e)}i||e.key!==n.VALUE_ENTER&&(e.key!==n.VALUE_SPACE||!t.lastKeyAllowsNonTypeKeys||t.multi||s.hasFocusedItem()||t.disabled)||(this.toggleList(),e.preventDefault(),e.stopPropagation())})),t.input&&t.sink.add(t.input,"input.dropdown",(()=>{t.disabled||(t.filterTerm=t.input.value.trim(),t.filteredItems=null,t.itemsChanged=!0,this._trigger("search",{value:t.input.value}),t.throttledUpdateListItems())})).add(t.input,"click.dropdown",(()=>{t.disabled||!t.multi&&t.searchable&&this.openList()})).add(t.input,"focus.dropdown",(()=>{t.disabled||(this._trigger("search:focus"),this[_a]||(i=!1,this.openList(),i=!0,setTimeout((()=>{i=!1}),10)))})).add(t.input,"blur.dropdown",(()=>{t.disabled||(this._trigger("search:blur"),this[_a]||(t.throttledUpdateListItems&&t.throttledUpdateListItems.cancel(),this.closeList()))})),t.sink.add(t.el,"mousedown.dropdown",(()=>{t.multi||t.searchable||i||t.disabled||this.toggleList(),i=!1})).add(t.el,"touchstart.dropdown",(s=>{if(r)return;if(r=s.changedTouches[0].identifier,this.isDisabled())return;if(e.closestUntil(s.target,".".concat(t.baseClassName,"__item,.").concat(t.baseClassName,"__clear"),t.el))return;let i=()=>{r=null,t.sink.remove(t.el,".dropdown_touchextra")};(t.input||t.el).focus(),t.sink.add(t.el,"touchend.dropdown_touchextra",(e=>{if(!Array.prototype.find.call(s.changedTouches,(e=>e.identifier===r)))return i();e.preventDefault(),i()})).add(t.el,"touchmove.dropdown_touchextra",(e=>{e.preventDefault()})).add(t.el,"touchcancel.dropdown_touchextra",i)}))}_performSelectWithEvent(e,t){let s={value:t,item:e,cancel:!1};return this._trigger("select:before",s),!s.cancel&&!this[_a]&&(this._setSelectedItems([e]),this._trigger("select",{value:t,item:e}),!0)}_performClearWithEvent(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t={cancel:!1};return this._trigger("clear:before",t),!t.cancel&&!this[_a]&&(this._setSelectedItems([]),e&&this._setInputText(""),this._trigger("clear"),!0)}_movePrev(){var e;const t=this._p;if(this.isMultiEnabled())return;let s=this.getSelectedItems(),i=null!==(e=t.filteredItems)&&void 0!==e?e:t.items;if(t.currentItemsView&&t.currentItemsView.length===i.length&&(i=t.currentItemsView),i.length+(t.clearable?1:0)>1){let e=s.length>0?i.indexOf(s[0])-1:i.length-1;-1!==e||t.clearable||(e=i.length-1);let r=-1===e?null:i[e];r?this._performSelectWithEvent(r,r[t.valueProp]):this._performClearWithEvent()}}_moveNext(){var e;const t=this._p;if(this.isMultiEnabled())return;let s=this.getSelectedItems(),i=null!==(e=t.filteredItems)&&void 0!==e?e:t.items;if(t.currentItemsView&&t.currentItemsView.length===i.length&&(i=t.currentItemsView),i.length+(t.clearable?1:0)>1){let e=s.length>0?i.indexOf(s[0])+1:0;e===i.length&&(e=t.clearable?-1:0);let r=-1===e?null:i[e];r?this._performSelectWithEvent(r,r[t.valueProp]):this._performClearWithEvent()}}_updateListItems(){const e=this._p,t=e.dropList;if(!t||!e.dropListVisible)return;if(!e.filteredItems&&(e.filterTerm||e.filterOnEmptyTerm&&e.filterFn)&&this._refilterItems(),(e.itemsChanged||e.selectionChanged)&&(e.dropList._lastSerializedBox=null),e.itemsChanged){let s=e.filteredItems||e.items;(e.sortListItems||e.sortListCheckedFirst&&e.multi)&&(s=this._sortItems(s,e.sortListItems,e.sortListCheckedFirst&&e.multi,e.splitListCheckedGroups)),t.removeAllItems(),0===s.length&&e.noResultsText&&(s=[{[e.labelProp]:e.noResultsText,[e.valueProp]:fa,_nointeraction:!0,_nocheck:!0}]),t.addItems(s),e.currentItemsView=s,e.itemsChanged=!1,e.selectionChanged=!0,e.resortBySelectionNeeded=!1}let s=!1;if(e.selectionChanged){if(e.multi)e.dropList.setCheckedValues(e.selectedValues);else{const t=e.dropList.itemIndexByValue(this.getValue());e.dropList.setFocusedItemAtIndex(t).setSingleSelectedItemAtIndex(t),s=e.dropList.hasFocusedItem()}e.selectionChanged=!1}this._repositionDropList(),s&&e.dropList.setFocusedItemAtIndex(e.dropList.getFocusedItemIndex())}_refilterItems(){const e=this._p,t=e.filterTerm,s=e.treatGroupSelectionAsItems;if(t||e.filterOnEmptyTerm&&e.filterFn){let i;if("function"==typeof e.filterFn&&(i=e.filterFn(e.items,t)),!Array.isArray(i))if(t){const r=new RegExp(la(t),"i"),n=e.labelProp,l=e.multiItemLabelProp;i=e.items.filter((e=>!(s||!e._group)||r.test(e[n]||e[l])))}else i=null;if(e.filteredItems=i,i&&!s){let e=-1,t=i.length;for(let s=0;s<t;s++)i[s]._group&&(-1!==e&&e===s-1&&(i.splice(e,1),s--,t--),e=s);-1!==e&&e===t-1&&i.splice(e,1)}}else e.filteredItems=null;this._trigger("itemschanged",{term:t,mutated:!1,count:this.getFilteredItemCount()}),e.itemsChanged=!0}_setSelectedItems(e){const t=this._p,s=t.valueProp;t.multi?(t.selectedItems=e.filter((e=>void 0!==e[s])),t.selectedValues=t.selectedItems.map((e=>e[s]))):(t.selectedItems=e.slice(0,1),t.selectedValues=e.slice(0,1).map((e=>e[s]))),t.selectionChanged=!0,t.resortBySelectionNeeded=!0,this._updateListItems(),this._scheduleSync("full")}_scheduleSync(e,t){const s=this._p;s.syncQueue||(s.syncQueue=[]),("full"===e||"render_items"===e&&!s.syncQueue.some((e=>"full"===e.mode)))&&(s.syncQueue.length=0),0!==s.syncQueue.length&&["full","render_items"].includes(e)||s.syncQueue.push({mode:e,data:t}),s.syncTimeout||(s.syncTimeout=setTimeout((()=>{delete s.syncTimeout;let e=s.syncQueue;delete s.syncQueue,this._performSync(e)})))}_performSync(e){const t=this._p;if(!this[_a])for(let i of e)switch(i.mode){case"full":this._syncFull(!0,!0);break;case"render_base":this._syncFull(!1,!1);break;case"render_items":this._syncFull(!0,!1);break;case"render_list":this._syncFull(!1,!0);break;case"render_clear":this._syncClearButton(),this._resizeInput();break;case"singleItem":this._syncSingleItem();break;case"removeMultiItemElement":if(t.showSelection)this._syncPlaceholder();else{const e=t.valueProp,s=i.data[e];let r=t.multiItemEls.findIndex((t=>t[pa][e]===s));-1!==r&&this._removeMultiItemElementByIndex(r)}break;case"addMultiItemElement":t.showSelection?this._addMultiItemElement(i.data):this._syncPlaceholder();break;case"addOrUpdateMultiItemRestElement":t.showSelection?this._addMultiItemRestElement():this._syncPlaceholder();break;case"removeMultiItemRestElement":if(t.showSelection){var s;let e=t.multiItemEls[t.multiItemEls.length-1];(null==e||null===(s=e[pa])||void 0===s?void 0:s[t.valueProp])===ga&&this._removeMultiItemElementByIndex(t.multiItemEls.length-1)}else this._syncPlaceholder();break;case"resize_input":this._resizeInput()}}_cleanupSingleWrapper(){const e=this._p;if(e.singleWrapper){if(e.unrenderSingleItem&&e.singleWrapper.childNodes.length>0)try{e.unrenderSingleItem(e.singleWrapper[pa],e.singleWrapper)}catch(e){console.error(e)}delete e.singleWrapper[pa],e.singleWrapper.innerHTML=""}}_removeMultiItemElementByIndex(e){const s=this._p,i=s.multiItemEls;if(i.length>e){var r;const n=i[e],l=n[pa];let o=(null==l?void 0:l[s.valueProp])===ga&&null!==(r=s.unrenderRestMultiItem)&&void 0!==r?r:s.unrenderMultiItem;if(o&&n.childNodes.length>0)try{o(l,n)}catch(e){console.error(e)}t.remove(n),e===i.length-1?i.pop():i.splice(e,1)}}_renderSingleItemContent(e){const t=this._p;if(!t.renderSingleItem||!1===t.renderSingleItem(e,t.singleWrapper)){const s=t.labelProp;let i=e[t.multiItemLabelProp]||e[s];null==i&&(i=""),t.singleWrapper.appendChild(document.createTextNode(i))}}_renderMultiItemContent(t,s){var i;const r=this._p;let n=t[r.valueProp]===ga&&null!==(i=r.renderRestMultiItem)&&void 0!==i?i:r.renderMultiItem;if(!n||!1===n(t,s)){const i=r.labelProp,n=t[r.multiItemLabelProp]||t[i];s.appendChild(e.createElement("span",{textContent:n}))}}_addMultiItemElement(e){const s=this._p,i=this._renderMultiItem(e);return!!i&&(t.before(s.inputWrapper,i),s.multiItemEls.push(i),!0)}_addMultiItemRestElement(){const e=this._p;let t=e.selectedItems.slice(0),s=(e.treatGroupSelectionAsItems?t:t.filter((e=>!e._group))).length-e.maxMultiItems,i=e.multiItemsRestLabelProvider?e.multiItemsRestLabelProvider(s,t):"+ ".concat(s);this._addMultiItemElement({items:t,[e.valueProp]:ga,[e.labelProp]:i})}_syncClearButton(){const s=this._p,i=s.multiItemLabelProp;s.selectedItems.length>0&&s.selectedItems.some((e=>!1!==e[i]))&&s.clearable&&s.showSelection?s.clearButtonWrapper||(s.clearButtonWrapper=e.createElement(s.multi?"li":"span",{class:"".concat(s.baseClassName,"__clear")},s.clearButton=e.createElement("button")),s.multi?t.append(s.list,s.clearButtonWrapper):t.append(s.el,s.clearButtonWrapper),s.el.classList.add("".concat(s.baseClassName,"__has_clear")),s.sink.add(s.clearButton,"click",(()=>{this.isDisabled()||this.clear()}))):s.clearButtonWrapper&&(s.sink.remove(s.clearButton,"click"),t.remove(s.clearButtonWrapper),delete s.clearButtonWrapper,delete s.clearButton,s.el.classList.remove("".concat(s.baseClassName,"__has_clear")))}_syncPlaceholder(){const e=this._p,t=e.multiItemLabelProp;let s="";e.multi&&!e.showSelection?s="function"==typeof e.multiPlaceholderFormatter?e.multiPlaceholderFormatter(e.selectedItems):((e,t)=>{if(0===e.length)return"";let s=e[0][t]+"";return e.length>1&&(s+=" (+".concat(e.length-1,")")),s})(e.selectedItems,e.labelProp):0!==e.selectedItems.length&&e.showSelection&&!e.selectedItems.every((e=>!1===e[t]))||(s=null==e.placeholder?"":e.placeholder+""),e.input.setAttribute("placeholder",s),e.showPlaceholderInTooltip?e.input.setAttribute("title",s):e.input.removeAttribute("title")}_syncSingleItem(){const e=this._p;e.singleWrapper&&this._cleanupSingleWrapper();const t=e.selectedItems;t.length>0&&(this._renderSingleItemContent(t[0]),e.singleWrapper[pa]=t[0])}_syncFull(e,s){const i=this._p,r=i.multiItemLabelProp;if(this._renderBase(),this._syncClearButton(),this._syncPlaceholder(),(e=i.multi&&i.showSelection&&(e||i.selectedItems.filter((e=>!1!==e[r])).length!==i.multiItemEls.length))||!i.showSelection||!i.multi)for(;i.multiItemEls.length>0;)this._removeMultiItemElementByIndex(i.multiItemEls.length-1);if(i.multi){if(e){const e=i.selectedItems,t=i.treatGroupSelectionAsItems;if(i.sortSelectedItems){const t=i.labelProp,s=i.multiItemLabelProp,r=i.valueProp,n=i.stickyValues,l=i.sortItemComparator||((e,i)=>{if(null!==n){let t=n.has(e[r]),s=n.has(i[r]);if(t&&!s)return-1;if(!t&&s)return 1}const l=e[s]||e[t],o=i[s]||i[t];return l<o?-1:l>o?1:0});e.sort(l),i.selectedValues=e.map((e=>e[r]))}let s=0,r=i.maxMultiItems,n=!1;for(let i=0;i<e.length;i++)if(t||!e[i]._group){if(null!=r&&s===r){n=!0;break}this._addMultiItemElement(e[i])&&s++}n&&this._addMultiItemRestElement()}}else i.multi||this._syncSingleItem();return t.getRootNode(i.el)!==document||(t.toggleClass(i.el,"".concat(i.baseClassName,"__empty_selection"),0===i.selectedValues.length),t.toggleClass(i.el,"".concat(i.baseClassName,"__has_selection"),i.selectedValues.length>0),i.searchable||i.multi?(i.input&&(i.input.readOnly=!1),i.el.classList.add("".concat(i.baseClassName,"__searchable"))):(i.input&&(i.input.readOnly=!0),i.el.classList.remove("".concat(i.baseClassName,"__searchable"))),this._resizeInput(),s&&this._updateListItems()),this}_trigger(e,t){const s=this._p;s.on&&s.on(e,...void 0===t?[]:[t]),s.mitt.emit(e,t)}_renderMultiItem(t){var s;const i=this._p,r=i.labelProp,n=null!==(s=t[i.multiItemLabelProp])&&void 0!==s?s:t[r];if(!1===n)return null;const l=e.createElement("li",{class:"".concat(i.baseClassName,"__item"),tabindex:"0",title:n},[e.createElement("span",{class:"".concat(i.baseClassName,"__item_remove"),role:"presentation"})]);return this._renderMultiItemContent(t,l),l[pa]=t,l}_removeMultiItemFromEvent(t,s){const i=this._p;let r;if(/key/.test(s.type)){const l=s;l.key===n.VALUE_DELETE?r=e.next(t,".".concat(i.baseClassName,"__item,.").concat(i.baseClassName,"__search_wrapper")):l.key===n.VALUE_BACK_SPACE&&(r=e.prev(t,".".concat(i.baseClassName,"__item,.").concat(i.baseClassName,"__search_wrapper")))}else/click|mouse|touch/.test(s.type)&&(r=e.next(t,".".concat(i.baseClassName,"__item,.").concat(i.baseClassName,"__search_wrapper")));const l=t[pa],o=l[i.valueProp];if(void 0!==l)if(o===ga){let e=(i.treatGroupSelectionAsItems?i.selectedItems:i.selectedItems.filter((e=>!e._group))).slice(i.maxMultiItems),t=[];for(let s of e){let e={value:o,item:s,cancel:!1};this._trigger("removesel:before",e),e.cancel||t.push(s)}if(t.length>0){this._removeMultiItemElementByIndex(i.multiItemEls.length-1);for(let e of t){let t=i.selectedItems.indexOf(e);-1===t&&(t=i.selectedValues.indexOf(o[i.valueProp])),-1!==t&&(i.selectedItems.splice(t,1),i.selectedValues.splice(t,1),i.selectionChanged=!0,i.resortBySelectionNeeded=!0)}}e.length>t.length&&this._addMultiItemRestElement(),t.length>0&&this._scheduleSync("render_list")}else{let e={value:o,item:l,cancel:!1};if(this._trigger("removesel:before",e),e.cancel)return this;this._removeMultiItem(l),this._trigger("removesel",{value:o,item:l})}return r||(r=i.el.querySelector(".".concat(i.baseClassName,"__item, .").concat(i.baseClassName,"__search_field"))),Ia(r,"".concat(i.baseClassName,"__search_wrapper"))&&(r=r.querySelector("input")),r&&r.focus(),this}_removeMultiItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=this._p,i=s.valueProp,r=s.labelProp,n=e[i];let l=s.selectedItems.indexOf(e);-1===l&&(l=s.selectedValues.indexOf(n)),-1!==l&&(s.selectedItems.splice(l,1),s.selectedValues.splice(l,1),s.selectionChanged=!0,s.resortBySelectionNeeded=!0),l=s.multiItemEls.findIndex((t=>t[pa]===e)),-1===l&&(l=s.multiItemEls.findIndex((e=>e[pa][i]===n))),-1!==l&&this._removeMultiItemElementByIndex(l),t&&(this._setInputText(e[s.multiItemLabelProp]||e[r]),s.input.focus(),s.input.selectionStart=s.input.selectionEnd=s.input.value.length),this._scheduleSync("render_list")}_setInputText(e){const t=this._p;t.input.value=null==e?"":String(e),t.filterTerm="",t.filteredItems=null,t.itemsChanged=!0}_resizeInput(){const e=this._p,i=e.el;if(!i.parentNode||!document.body.contains(i))return this;const r=e.input,n=e.inputBackBuffer;let l=r.value||r.placeholder;t.toggleClass(i,"".concat(e.baseClassName,"__has_input"),!!l),t.toggleClass(i,"".concat(e.baseClassName,"__empty_input"),!l);let o=!1;if(e.multi&&0===e.multiItemEls.length&&e.showSelection){r.style.width="";let t=0,n=0,l=getComputedStyle(e.list||i,"::before");l.content&&"none"!==l.content&&"absolute"!==l.position&&"none"!==l.float&&(t=s.getPseudoElementWidth(e.list||i,"::before",!0,!0,!0));let a=getComputedStyle(e.list||i,"::after");a.content&&"none"!==a.content&&"absolute"!==a.position&&"none"!==a.float&&(n=s.getPseudoElementWidth(e.list||i,"::after",!0,!0,!0));let u=s.getElementWidth(e.list||i);u-=t+n,r.style.width="".concat(u,"px"),o=!0}else{s.setCssProps(n,s.getCssProps(r,va)),n.textContent=l,i.appendChild(n);const a=getComputedStyle(r),u=(parseFloat(a.paddingLeft)||0)+(parseFloat(a.paddingRight)||0),c=.75*(parseFloat(a["font-size"])||0)+u,d=s.getElementWidth(n,!0,!0),h=s.getElementWidth(r,!0,!0);let m=Math.max(d,c);if(m!==h){s.setElementWidth(r,m,!0,!0);let t=(parseFloat(a.borderLeftWidth)||0)+(parseFloat(a.borderRightWidth)||0),i=r.scrollWidth+t;if(i>m){let e=i-m;r.style.width="".concat(parseFloat(r.style.width)+e,"px"),m+=e}if(e.singleWrapper&&(e.singleWrapper.style.width="",l)){let i=m-u-t;s.getElementWidth(e.singleWrapper,!1,!1)<i&&s.setElementWidth(e.singleWrapper,i,!1,!1)}o=!0}t.remove(n)}return o&&this._trigger("input:resize"),this}_repositionDropList(){const e=this._p,t=e.el;if(!e.dropList||!e.dropListVisible||!e.dropList.isVisible())return this;const s=t.getBoundingClientRect(),i=s.left+","+s.top+","+s.right+","+s.bottom;return e.dropList._lastSerializedBox!==i&&(e.dropList.relayout(this._getDropListPositionOptions()),e.dropList._lastSerializedBox=i),this}_handleInputKeydown(e){const t=this._p,s=e.target;if(e.key===n.VALUE_BACK_SPACE&&e.ctrlKey&&0===s.value.length)this.clear(),e.preventDefault();else if(e.key===n.VALUE_BACK_SPACE&&0===s.value.length){const s=t.multiItemEls[t.multiItemEls.length-1];if(!s||void 0===s[pa].value)return;const i=s[pa],r=i[t.valueProp];let n={value:r,item:i,cancel:!1};if(this._trigger("removesel:before",n),n.cancel)return;this._removeMultiItem(i,!0),this._trigger("removesel",{value:r,item:i}),e.preventDefault()}}_handleMultiKeydown(t){const s=this._p;if(s.disabled)return;const i="rtl"===getComputedStyle(s.el).direction;let r;if(t.key===(i?n.VALUE_LEFT:n.VALUE_RIGHT))r=e.next(t.target,".".concat(s.baseClassName,"__item,.").concat(s.baseClassName,"__search_wrapper")),Ia(r,"".concat(s.baseClassName,"__search_wrapper"))&&(r=r.querySelector("input")),r&&r.focus(),t.preventDefault();else if(t.key===(i?n.VALUE_RIGHT:n.VALUE_LEFT))r=e.prev(t.target,".".concat(s.baseClassName,"__item,.").concat(s.baseClassName,"__search_wrapper")),Ia(r,"".concat(s.baseClassName,"__search_wrapper"))&&(r=r.querySelector("input")),r&&r.focus(),t.preventDefault();else if(t.key===n.VALUE_BACK_SPACE&&t.ctrlKey){const i=[];let r=t.target;for(;r;)i.push(r),r=e.prev(r,".".concat(s.baseClassName,"__item"));for(;i.length;)this._removeMultiItemFromEvent(i.shift(),t);t.preventDefault()}else t.key!==n.VALUE_DELETE&&t.key!==n.VALUE_BACK_SPACE||(this._removeMultiItemFromEvent(e.closestUntil(t.target,".".concat(s.baseClassName,"__item"),s.el),t),t.preventDefault())}_getDropListPositionOptions(){return{target:this._p.el,offset:{x:0,y:0},anchor:{x:"start",y:"bottom"},position:{x:"start",y:"top"},updateWidth:!0}}_startTrackingPresence(){const e=this._p;this._stopTrackingPresence(),e.presenceInt=setInterval((function(){t.getRootNode(e.el)!==document&&this.hide()}),200)}_stopTrackingPresence(){const e=this._p;e.presenceInt&&(clearInterval(e.presenceInt),e.presenceInt=null)}_sortItems(e,t,s,i){const r=this._p;if(!t&&!s)return e;const n=r.labelProp,l=r.multiItemLabelProp,o=r.valueProp,a=r.stickyValues,u=r.sortItemComparator||((e,t)=>{if(null!==a){let s=a.has(e[o]),i=a.has(t[o]);if(s&&!i)return-1;if(!s&&i)return 1}const s=e[n]||e[l],i=t[n]||t[l];return s<i?-1:s>i?1:0});let c=[],d=null,h=[c];const m=new Set(r.selectedValues);let p,_,f;for(_=0,f=e.length;_<f;_++)p=e[_],p._group&&c.length&&(c=[],h.push(c)),c.push(p);c.length||(h.length=0),a&&e.length>0&&!e[0]._group&&(d=h[0].filter((e=>a.has(e[o]))),d.length>0?(h[0]=h[0].filter((e=>!a.has(e[o]))),0===h[0].length&&h.shift()):d=null),t&&h.sort(((e,t)=>{if(e=e[0],t=t[0],null!==a){let s=a.has(e[o]),i=a.has(t[o]);if(s&&!i)return-1;if(!s&&i)return 1}return!e._group&&t._group?-1:e._group&&!t._group?1:u(e,t)})),d&&h.unshift(d);const g=[],b=[];for(let e=0,i=h.length;e<i;e++)c=h[e],c.sort(((e,i)=>{if(e._group&&!i._group)return-1;if(!e._group&&i._group)return 1;if(s){const t=m.has(e[o]),s=m.has(i[o]);if(t&&!s)return-1;if(!t&&s)return 1}return t?u(e,i):0})),b.push(c);if(s&&i){let e;for(let t=0,s=h.length;t<s;t++)if(c=h[t],c!==d){e=null;for(let t=0,s=c.length;t<s;t++)if(p=c[t],!p._group){if(!m.has(p[r.valueProp]))break;e||(e=[],c[0]._group&&e.push(c[0])),e.push(p),c.splice(t--,1),s--}if(e&&(g.push(e),0===c.length||1===c.length&&c[0]._group)){h.splice(t--,1),s--;let e=b.indexOf(c);-1!==e&&b.splice(e,1)}}else{g.push(d);let e=b.indexOf(d);-1!==e&&b.splice(e,1)}}const I=[];I.length=e.length;let v=0;h=g.length?g.concat(b):b;for(let e=0,t=h.length;e<t;e++)for(c=h[e],_=0,f=c.length;_<f;_++)I[v++]=c[_];return I}};
6
6
  //# sourceMappingURL=index.js.map
7
7
 
8
8
  //# sourceMappingURL=lib.cjs.min.js.map