jsf.js_next_gen 4.1.0-beta.20 → 4.1.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/docs/index.html +35 -1
- package/dist/window/faces-development.js +54 -7
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +54 -7
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.map +1 -1
- package/package.json +2 -2
package/dist/window/faces.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see faces.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={563(e,t,n){n.d(t,{J:()=>en,$:()=>tn});const r=3e4;function s(e,t){for(let n=0,s=t.length;n<s;n+=r)Array.prototype.push.apply(e,Array.prototype.slice.call(t,n,n+r));return e}class i extends Array{constructor(e=[]){super(),(e=Array.isArray(e)?e:[e])._another?this._another=e._another:this._another=e,s(this,e),this.flatMap=e=>this._flatMap(e),this.flat=(e=1)=>this._flat(e)}map(e,t){return l(Array.prototype.map.call(this._another,e,t))}concat(...e){return l(Array.prototype.concat.apply(this._another,e))}reverse(){return l(Array.prototype.reverse.call(this._another))}slice(e,t){return l(Array.prototype.slice.call(this._another,e,t))}splice(e,t){return l(Array.prototype.splice.call(this._another,e,null!=t?t:0))}filter(e,t){return l(Array.prototype.filter.call(this._another,e,t))}reduce(e,t){return Array.prototype.reduce.call(this._another,e,t)}_flat(e=1){return this._flatResolve(this._another,e)}_flatResolve(e,t=1){if(0==t)return e;let n=[];return e.forEach((e=>{e=Array.isArray(e)?e:[e];let r=this._flatResolve(e,t-1);n=n.concat(r)})),u(n)}_flatMap(e){let t=this.map((t=>e(t)));return this._flatResolve(t)}}function l(e){let t=new i(e);return new Proxy(t,{get:(e,t,n)=>"symbol"==typeof t?e._another[t]:isNaN(parseInt(t))?e[t]:e._another[t],set:(e,t,n)=>(e[t]=n,e._another[t]=n,!0)})}var o,a=Array.prototype.flatMap?function(...e){return(null==e?void 0:e.flatMap)?e:l(e)}:function(...e){return l(e)};function u(e){const t=s([],e);return Array.prototype.flatMap?t:l(t)}class c{constructor(e){this._value=e}get value(){return this._value}map(e){e||(e=e=>e);let t=e(this.value);return new c(t)}flatMap(e){let t=this.map(e);for(;(null==t?void 0:t.value)instanceof c;)t=t.value;return t}}class h extends c{constructor(e){super(e)}get value(){return this._value instanceof c?this._value.flatMap().value:this._value}static fromNullable(e){return new h(e)}isAbsent(){return void 0===this.value||null==this.value}isPresent(e){let t=this.isAbsent();return!t&&e&&e.call(this,this),!t}ifPresentLazy(e=()=>{}){return this.isPresent.call(this,e),this}orElse(e){return this.isPresent()?this:null==e?h.absent:this.flatMap((()=>e))}orElseLazy(e){return this.isPresent()?this:this.flatMap(e)}flatMap(e){let t=super.flatMap(e);return t instanceof h?t.flatMap():h.fromNullable(t.value)}getIf(...e){e=this.preprocessKeys(...e);let t=this;for(let n=0;n<e.length;n++){let r=this.keyVal(e[n]),s=this.arrayIndex(e[n]);if(""===r&&s>=0){if(t=this.getClass().fromNullable(t.value instanceof Array?t.value.length<s?null:t.value[s]:null),t.isAbsent())return t}else if(r&&s>=0){if(t.getIfPresent(r).isAbsent())return t;if(t=t.getIfPresent(r).value instanceof Array?this.getClass().fromNullable(t.getIfPresent(r).value[s]):this.getClass().absent,t.isAbsent())return t}else{if(t=t.getIfPresent(r),t.isAbsent())return t;s>-1&&(t=this.getClass().fromNullable(t.value[s]))}}return t}match(e){return!this.isAbsent()&&e(this.value)}get(e=h.absent){return this.isAbsent()?this.getClass().fromNullable(e).flatMap():this.getClass().fromNullable(this.value).flatMap()}toJson(){return JSON.stringify(this.value)}getClass(){return h}arrayIndex(e){let t=e.indexOf("["),n=e.indexOf("]");return t>=0&&n>0&&t<n?parseInt(e.substring(t+1,n)):-1}keyVal(e){let t=e.indexOf("[");return t>=0?e.substring(0,t):e}getIfPresent(e){return this.isAbsent()?this.getClass().absent:this.getClass().fromNullable(this.value[e]).flatMap()}resolve(e){if(this.isAbsent())return h.absent;try{return h.fromNullable(e(this.value))}catch(e){return h.absent}}preprocessKeys(...e){return new a(...e).flatMap((e=>new a(...e.split(/]\s*\[/gi)).map((e=>(-1==(e=e.replace(/^\s+|\s+$/g,"")).indexOf("[")&&-1!=e.indexOf("]")&&(e="["+e),-1==e.indexOf("]")&&-1!=e.indexOf("[")&&(e+="]"),e)))))}}h.absent=h.fromNullable(null);class d extends h{constructor(e,t="value"){super(e),this.key=t}get value(){return this._value?this._value[this.key]:null}set value(e){this._value&&(this._value[this.key]=e)}orElse(e){let t={};return t[this.key]=e,this.isPresent()?this:new d(t,this.key)}orElseLazy(e){if(this.isPresent())return this;{let t={};return t[this.key]=e(),new d(t,this.key)}}getClass(){return d}static fromNullable(e,t="value"){return new d(e,t)}}d.absent=d.fromNullable(null),function(e){function t(e){let t=/\s/,n=(e=e.replace(/^\s\s*/,"")).length;for(;t.test(e.charAt(--n)););return e.slice(0,n+1)}function n(e){return!!arguments.length&&null!=e&&("string"==typeof e||e instanceof String)}e.saveResolve=function(e,t=null){try{let n=e();return h.fromNullable(null!=n?n:t)}catch(e){return h.absent}},e.saveResolveLazy=function(e,t=null){try{let n=e();return h.fromNullable(null!=n?n:t())}catch(e){return h.absent}},e.strToArray=function(e,n=/\./gi){let r=[];return e.split(n).forEach((e=>{r.push(t(e))})),r},e.trim=t,e.objToArray=function(e,t=0,n=[]){return"__undefined__"==(null!=e?e:"__undefined__")?null!=n?n:null:e instanceof Array&&!t&&!n?e:u(n.concat(Array.prototype.slice.call(e,t)))},e.equalsIgnoreCase=function(e,t){let n=null!=t?t:"___no_value__";return(null!=e?e:"___no_value__").toLowerCase()===n.toLowerCase()},e.assertType=function(e,t){return n(t)?typeof e==t:e instanceof t},e.isString=n,e.isFunc=function(e){return e instanceof Function||"function"==typeof e},e.objAssign=function(e,...t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");let n=Object(e);return Object.assign?(t.forEach((e=>Object.assign(n,e))),n):(t.filter((e=>null!=e)).forEach((e=>{let t=e;[...Object.keys(t),...Object.getOwnPropertySymbols(t).filter((e=>Object.prototype.propertyIsEnumerable.call(t,e)))].forEach((e=>n[e]=t[e]))})),n)}}(o||(o={}));class v{constructor(e){this.parent=e}set value(e){}get value(){return this.parent}}function f(e,...t){if(t.length<1)return new v(e);const n=w(e,...t);return new class{set value(e){n.target[n.key]=e}get value(){return n.target[n.key]}}}function p(e,...t){if(t.length<1)return new v(e);const n=w(e,...t);return new class{set value(e){Array.isArray(e)||(e=[e]),n.target[n.key]?(Array.isArray(n.target[n.key])||(n.target[n.key]=[n.target[n.key]]),s(n.target[n.key],e)):n.target[n.key]=e}}}function m(e){let t=e.indexOf("[");return t>=0?e.substring(0,t):e}function g(e){let t=e.indexOf("["),n=e.indexOf("]");return t>=0&&n>0&&t<n?parseInt(e.substring(t+1,n)):-1}function y(e,t,n={}){let r=[];r.length=t,r[t-1]=n,s(e,r)}function E(e){return new a(...e).flatMap((e=>e.split("["))).map((e=>-1!=e.indexOf("]")?"["+e:e)).filter((e=>""!=e))}function w(e,...t){t=E(t);let n=e,r=null,s=null,i=-1;for(let e=0;e<t.length;e++)if(s=m(t[e]),i=g(t[e]),-1!=i){if(!Array.isArray(n))throw Error("Associative array referenced as index array in path reference");let s=-1;e<t.length-1&&(s=g(t[e+1]));let l=void 0!==(null==n?void 0:n[i]);y(n,i+1,-1!=s?[]:{}),r=i,e==t.length-1?n[i]=l?n[i]:null:n=n[i]}else{if(Array.isArray(n))throw Error("Index array referenced as associative array in path reference");let i=-1;e<t.length-1&&(i=g(t[e+1])),r=s;let l=void 0!==(null==n?void 0:n[s]);e==t.length-1?l||(n[s]=null):(l||(n[s]=-1==i?{}:[]),n=n[s])}return{target:n,key:r}}function b(...e){return A(!0,!1,...e)}function A(e=!0,t=!1,...n){let r={};return new a(...n).map((e=>({arr:e,keys:Object.keys(e)}))).forEach((({arr:n,keys:i})=>{i.forEach((i=>{let l=n[i];!Array.isArray(l)&&t&&(l=new a(...[l])),e||!(null==r?void 0:r[i])?function(e,t,n,r,i){if(e)if(void 0===(null==t?void 0:t[n]))t[n]=i;else if(Array.isArray(t[n])){let e=t[n],r=[];i.forEach((t=>{-1==e.indexOf(t)&&r.push(t)})),s(t[n],r)}else{let e=t[n],r=[];i.forEach((t=>{e!=t&&r.push(t)})),t[n]=new a(...[]),t[n].push(e),s(t[n],r)}else t[n]=r[n]}(t,r,i,n,l):!e&&(null==r?void 0:r[i])&&function(e,t,n,r,i){if(e)if(void 0===(null==t?void 0:t[n]))t[n]=i;else if(Array.isArray(t[n]))s(t[n],i);else{let e=t[n];t[n]=new a(...[]),t[n].push(e),s(t[n],i)}}(t,r,i,0,l)}))})),r}const S=o.objAssign;class x extends d{constructor(e,t,n){super(e,t),this.arrPos=null!=n?n:-1}get value(){return""==this.key&&this.arrPos>=0?this._value[this.arrPos]:this.key&&this.arrPos>=0?this._value[this.key][this.arrPos]:this._value[this.key]}set value(e){""==this.key&&this.arrPos>=0?this._value[this.arrPos]=e:this.key&&this.arrPos>=0?this._value[this.key][this.arrPos]=e:this._value[this.key]=e}}x.absent=x.fromNullable(null);class _ extends h{constructor(e,t){super(e),this.configDef=t}get shallowCopy(){return this.shallowCopy$()}shallowCopy$(){let e=new _({});return e.shallowMerge(this.value),e}get deepCopy(){return this.deepCopy$()}deepCopy$(){return new _(S({},this.value))}static fromNullable(e){return new _(e)}shallowMerge(e,t=!0,n=!1){let r=A(t,n,this.value,e.value);Array.isArray(this._value)?(this._value.length=0,s(this._value,r)):(Object.getOwnPropertyNames(this._value).forEach((e=>delete this._value[e])),Object.getOwnPropertyNames(r).forEach((e=>this._value[e]=r[e])))}append(...e){return p(this._value,...e)}appendIf(e,...t){return function(e,t,...n){return!e||n.length<1?new v(t):p(t,...n)}(e,this._value,...t)}assign(...e){return f(this.value,...e)}assignIf(e,...t){return function(e,t,...n){return!e||n.length<1?new v(t):f(t,...n)}(e,this._value,...t)}getIf(...e){return this.assertAccessPath(...e),this.getClass().fromNullable(function(e,...t){let n=null;t=E(t);let r=e;for(let e=0;e<t.length;e++){let s=t[e];if(s=-1!=g(s)?g(s):s,r=null==r?void 0:r[s],void 0===r)return null;n=r}return r}(this.value,...e))}get(e){return this.getClass().fromNullable(super.get(e).value)}delete(e){return e in this.value&&delete this.value[e],this}toJson(){return JSON.stringify(this.value)}getClass(){return _}setVal(e){this._value=e}assertAccessPath(...e){var t,n,r,s,i,l,o,a,c;if(e=this.preprocessKeys(...e),!this.configDef)return;let d=h.fromNullable(Object.keys(this.configDef).map((e=>{let t={};return t[e]=this.configDef[e],t})));for(let v=0;v<e.length;v++){let f=this.keyVal(e[v]),p=this.arrayIndex(e[v]);if(d=this.isArray(p)?""!=f?Array.isArray(d.value)?h.fromNullable(null===(n=null===(t=u(d.value).find((e=>{var t;return!(null===(t=null==e?void 0:e[f])||void 0===t||!t)})))||void 0===t?void 0:t[f])||void 0===n?void 0:n[p]):h.fromNullable(null!==(i=null===(s=null===(r=d.value)||void 0===r?void 0:r[f])||void 0===s?void 0:s[p])&&void 0!==i?i:null):Array.isArray(d.value)?h.fromNullable(null===(l=d.value)||void 0===l?void 0:l[p]):h.absent:Array.isArray(d.value)?h.fromNullable(null===(o=u(d.value).find((e=>{var t;return!(null===(t=null==e?void 0:e[f])||void 0===t||!t)})))||void 0===o?void 0:o[f]):h.fromNullable(null!==(c=null===(a=d.value)||void 0===a?void 0:a[f])&&void 0!==c?c:null),!d.isPresent())throw Error("Access Path to config invalid");if("__ANY_POINT__"==d.value)return}}isNoArray(e){return-1==e}isArray(e){return!this.isNoArray(e)}}var R;function N(e){let t=1;for(;e.lookAhead(t)!=R.EO_STRM;)t++;return--t}!function(e){e.EO_STRM="__EO_STRM__",e.BEF_STRM="___BEF_STRM__"}(R||(R={}));class I{constructor(e,...t){this.first=e,this.selectedPos=0,this.strms=[e],t.forEach((e=>{Array.isArray(e)?s(this.strms,e):this.strms.push(e)})),this.activeStrm=this.strms[this.selectedPos]}current(){return this.activeStrm.current()}hasNext(){return!!this.activeStrm.hasNext()||!(this.selectedPos>=this.strms.length)&&-1!=this.findNextStrm()}findNextStrm(){let e=!1,t=this.selectedPos;for(;!e&&t<this.strms.length;)e=this.strms[t].hasNext(),e||t++;return e?t:-1}lookAhead(e=1){const t=this.strms.slice(this.selectedPos);if(!t.length)return R.EO_STRM;const n=[...t];for(;n.length;){let t=n.shift(),r=t.lookAhead(e);if(r!=R.EO_STRM)return r;e-=N(t)}return R.EO_STRM}next(){return this.activeStrm.hasNext()?this.activeStrm.next():(this.selectedPos=this.findNextStrm(),-1==this.selectedPos?R.EO_STRM:(this.activeStrm=this.strms[this.selectedPos],this.activeStrm.next()))}reset(){this.activeStrm=this.strms[0],this.selectedPos=0;for(let e=0;e<this.strms.length;e++)this.strms[e].reset()}}class C{constructor(...e){this.dataPos=-1,this.value=e}static ofArray(e){const t=new C;return t.value=null!=e?e:[],t}lookAhead(e=1){return this.dataPos+e>this.value.length-1?R.EO_STRM:this.value[this.dataPos+e]}hasNext(){return this.value.length-1>this.dataPos}next(){var e;return this.dataPos++,null!==(e=null==this?void 0:this.value[this.dataPos])&&void 0!==e?e:R.EO_STRM}reset(){this.dataPos=-1}current(){return this.value[Math.max(0,this.dataPos)]}}class T{constructor(e,t){this._current=R.BEF_STRM,this._filterIdx={},this._unfilteredPos=0,this.filterFunc=e,this.inputDataSource=t}hasNext(){let e,t=1,n=!1;for(;!n&&(e=this.inputDataSource.lookAhead(t))!=R.EO_STRM;)this.filterFunc(e)?(this._filterIdx[this._unfilteredPos+t]=!0,n=!0):t++;return n}next(){var e,t;let n=R.EO_STRM;for(;this.inputDataSource.hasNext();){this._unfilteredPos++;let r=this.inputDataSource.next();if(r!=R.EO_STRM&&(null!==(t=null===(e=this._filterIdx)||void 0===e?void 0:e[this._unfilteredPos])&&void 0!==t&&t||this.filterFunc(r))){this._filterIdx[this._unfilteredPos]=!0,n=r;break}}return this._current=n,n}lookAhead(e=1){var t;let n=R.EO_STRM;for(let r=1;e>0&&(n=this.inputDataSource.lookAhead(r))!=R.EO_STRM;r++)((null===(t=this._filterIdx)||void 0===t?void 0:t[this._unfilteredPos+r])||this.filterFunc(n))&&(e--,this._filterIdx[this._unfilteredPos+r]=!0);return n}current(){return this._current}reset(){this._current=R.BEF_STRM,this._filterIdx={},this._unfilteredPos=0,this.inputDataSource.reset()}}class O{constructor(e,t){this.mapFunc=e,this.inputDataSource=t}hasNext(){return this.inputDataSource.hasNext()}next(){return this.mapFunc(this.inputDataSource.next())}reset(){this.inputDataSource.reset()}current(){return this.mapFunc(this.inputDataSource.current())}lookAhead(e=1){const t=this.inputDataSource.lookAhead(e);return t==R.EO_STRM?t:this.mapFunc(t)}}class M{constructor(){this.data=[]}collect(e){this.data.push(e)}get finalValue(){return this.data}}function k(){var e;let t="undefined"!=typeof globalThis&&globalThis.window?globalThis.window:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0!==n.g&&(null===n.g||void 0===n.g?void 0:n.g.window)?n.g.window:void 0!==n.g?n.g:null;return null!==(e=null==t?void 0:t.window)&&void 0!==e?e:t}const P=o.trim,j=o.isString,D=o.equalsIgnoreCase,L=o.objToArray;function q(e,t){for(let n=t.length;n>0;n-=r){const s=Math.max(0,n-r);e.prepend(...t.slice(s,n))}}class F extends d{constructor(e){super(null==e?void 0:e[0],"nonce"),this.rootElems=e}isAbsent(){const e=this.value;return void 0===e||""==e}get value(){var e,t,n,r,s;return null!==(n=null===(t=null===(e=null==this?void 0:this.rootElems)||void 0===e?void 0:e[0])||void 0===t?void 0:t.nonce)&&void 0!==n?n:null===(s=null===(r=null==this?void 0:this.rootElems)||void 0===r?void 0:r[0])||void 0===s?void 0:s.getAttribute("nonce")}set value(e){var t;(null===(t=null==this?void 0:this.rootElems)||void 0===t?void 0:t.length)&&this.rootElems.forEach((t=>{void 0!==(null==t?void 0:t.nonce)?t.nonce=e:t.setAttribute("nonce",e)}))}}var H;!function(e){e.SELECT="select",e.BUTTON="button",e.SUBMIT="submit",e.RESET="reset",e.IMAGE="image",e.RADIO="radio",e.CHECKBOX="checkbox"}(H||(H={}));class V extends d{constructor(e,t,n=null){super(e,t),this.element=e,this.name=t,this.defaultVal=n}get value(){let e=this.element.get(0).orElse().values;return e.length?e[0].getAttribute(this.name):this.defaultVal}set value(e){let t=this.element.get(0).orElse().values;for(let n=0;n<t.length;n++)t[n].setAttribute(this.name,e)}getClass(){return V}static fromNullable(e,t="value"){return new V(e,t)}}class $ extends d{constructor(e,t,n=null){super(e,t),this.element=e,this.name=t,this.defaultVal=n}get value(){let e=this.element.values;return e.length?e[0].style[this.name]:this.defaultVal}set value(e){let t=this.element.values;for(let n=0;n<t.length;n++)t[n].style[this.name]=e}getClass(){return $}static fromNullable(e,t="value"){return new $(e,t)}}const B=()=>!0;class U{constructor(...e){if(this.rootNode=[],this.pos=-1,this._limits=-1,!h.fromNullable(e).isAbsent()&&e.length)for(let t=0;t<e.length;t++)if(e[t])if(j(e[t])){let n=U.querySelectorAll(e[t]);n.isAbsent()||s(e,n.values)}else e[t]instanceof U?s(this.rootNode,e[t].values):Array.isArray(e[t])?s(e,e[t]):this.rootNode.push(e[t])}get value(){return this.getAsElem(0)}get values(){return this.allElems()}get global(){return k}get stream(){throw Error("Not implemented, include Stream.ts for this to work")}get lazyStream(){throw Error("Not implemented, include Stream.ts for this to work")}get id(){return new V(this.get(0),"id")}get length(){return this.rootNode.length}get tagName(){return this.getAsElem(0).getIf("tagName")}get nodeName(){return this.getAsElem(0).getIf("nodeName")}isTag(e){return!this.isAbsent()&&(this.nodeName.orElse("__none___").value.toLowerCase()==e.toLowerCase()||this.tagName.orElse("__none___").value.toLowerCase()==e.toLowerCase())}get type(){return this.getAsElem(0).getIf("type")}get name(){return new d(this.getAsElem(0).value,"name")}get inputValue(){return this.getAsElem(0).getIf("value").isPresent()?new d(this.getAsElem(0).value):d.absent}get val(){return this.inputValue.value}set val(e){this.inputValue.value=e}get nodeId(){return this.id.value}set nodeId(e){this.id.value=e}get checked(){return u(this.values).every((e=>!!e.checked))}set checked(e){this.eachElem((t=>t.checked=e))}get elements(){return this.querySelectorAll("input, select, textarea, fieldset")}get deepElements(){return this.querySelectorAllDeep("input, select, textarea, fieldset")}querySelectorAllDeep(e){let t=[],n=this.querySelectorAll(e);n.length&&t.push(n);let r=this.querySelectorAll("*").shadowRoot;if(r.length){let n=r.querySelectorAllDeep(e);n.length&&t.push(n)}return new U(t)}get disabled(){return this.attr("disabled").isPresent()}set disabled(e){e?this.attr("disabled").value="disabled":this.removeAttribute("disabled")}removeAttribute(e){this.eachElem((t=>t.removeAttribute(e)))}get childNodes(){let e=[];return this.eachElem((t=>{e=e.concat(L(t.childNodes))})),new U(e)}get asArray(){return u(this.rootNode).filter((e=>null!=e)).map((e=>U.byId(e)))}get offsetWidth(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetWidth)).reduce(((e,t)=>e+t),0)}get offsetHeight(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetHeight)).reduce(((e,t)=>e+t),0)}get offsetLeft(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetLeft)).reduce(((e,t)=>e+t),0)}get offsetTop(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetTop)).reduce(((e,t)=>e+t),0)}get asNodeArray(){return u(this.rootNode.filter((e=>null!=e)))}get nonce(){return new F(this.rootNode)}static querySelectorAllDeep(e){return new U(document).querySelectorAllDeep(e)}static querySelectorAll(e){return-1!=e.indexOf("/shadow/")?new U(document)._querySelectorAllDeep(e):new U(document)._querySelectorAll(e)}static byId(e,t=!1){return j(e)?t?new U(document).byIdDeep(e):new U(document).byId(e):new U(e)}static byTagName(e){return j(e)?new U(document).byTagName(e):new U(e)}static globalEval(e,t){return new U(document).globalEval(e,t)}static globalEvalSticky(e,t){return new U(document).globalEvalSticky(e,t)}static fromMarkup(e){const t=document.implementation.createHTMLDocument("");let n=(e=P(e)).toLowerCase();if(-1!=n.search(/<!doctype[^\w\-]+/gi)||-1!=n.search(/<html[^\w\-]+/gi)||-1!=n.search(/<head[^\w\-]+/gi)||-1!=n.search(/<body[^\w\-]+/gi))return t.documentElement.innerHTML=e,new U(t.documentElement);{let t=function(e,t){let n=["<",t,">"].join(""),r=["<",t," "].join("");return 0==e.indexOf(n)||0==e.indexOf(r)},r=new U(document.createElement("div"));return t(n,"thead")||t(n,"tbody")||t(n,"tfoot")?(r.html(`<table>${e}</table>`),r.querySelectorAll("table").get(0).childNodes.detach()):t(n,"tr")?(r.html(`<table><tbody>${e}</tbody></table>`),r.querySelectorAll("tbody").get(0).childNodes.detach()):t(n,"td")||t(n,"th")?(r.html(`<table><tbody><tr>${e}</tr></tbody></table>`),r.querySelectorAll("tr").get(0).childNodes.detach()):(r.html(e),r.childNodes.detach())}}get(e){return e<this.rootNode.length?new U(this.rootNode[e]):U.absent}getAsElem(e,t=h.absent){return e<this.rootNode.length?h.fromNullable(this.rootNode[e]):t}filesFromElem(e){var t;return e<this.rootNode.length&&(null===(t=this.rootNode[e])||void 0===t?void 0:t.files)?this.rootNode[e].files:[]}allElems(){return this.rootNode}isAbsent(){return 0==this.length}isPresent(e){let t=this.isAbsent();return!t&&e&&e.call(this,this),!t}ifPresentLazy(e=function(){}){return this.isPresent.call(this,e),this}delete(){this.eachElem((e=>{e.parentNode&&e.parentNode.removeChild(e)}))}querySelectorAll(e){return-1!=e.indexOf("/shadow/")?this._querySelectorAllDeep(e):this._querySelectorAll(e)}closest(e){return-1!=e.indexOf("/shadow/")?this._closestDeep(e):this._closest(e)}byId(e,t){let n=[];return t&&(n=n.concat(u((null==this?void 0:this.rootNode)||[]).filter((t=>e==t.id)).map((e=>new U(e))))),n=n.concat(this.querySelectorAll(`[id="${e}"]`)),new U(n)}byIdDeep(e,t){let n=[];t&&(n=n.concat(u((null==this?void 0:this.rootNode)||[]).filter((t=>e==t.id)).map((e=>new U(e)))));let r=this.querySelectorAllDeep(`[id="${e}"]`);return r.length&&n.push(r),new U(n)}byTagName(e,t,n){var r;let s=[];return t&&(s=u(null!==(r=null==this?void 0:this.rootNode)&&void 0!==r?r:[]).filter((t=>(null==t?void 0:t.tagName)==e)).reduce(((e,t)=>e.concat([t])),s)),n?s.push(this.querySelectorAllDeep(e)):s.push(this.querySelectorAll(e)),new U(s)}attr(e,t=null){return new V(this,e,t)}style(e,t=null){return new $(this,e,t)}hasClass(e){let t=!1;return this.eachElem((n=>{if(t=n.classList.contains(e),t)return!1})),t}addClass(e){return this.eachElem((t=>t.classList.add(e))),this}removeClass(e){return this.eachElem((t=>t.classList.remove(e))),this}isMultipartCandidate(e=!1){const t="input[type='file']";return this.matchesSelector(t)||(e?this.querySelectorAllDeep(t):this.querySelectorAll(t)).first().isPresent()}html(e){return h.fromNullable(e).isAbsent()?this.isPresent()?h.fromNullable(this.innerHTML):h.absent:(this.innerHTML=e,this)}dispatchEvent(e){return this.eachElem((t=>t.dispatchEvent(e))),this}set innerHTML(e){this.eachElem((t=>t.innerHTML=e))}get innerHTML(){let e=[];return this.eachElem((t=>e.push(t.innerHTML))),e.join("")}set innerHtml(e){this.innerHTML=e}get innerHtml(){return this.innerHTML}filterSelector(e){let t=[];return this.eachElem((n=>{this._matchesSelector(n,e)&&t.push(n)})),new U(t)}matchesSelector(e){return this.asArray.some((t=>this._matchesSelector(t.getAsElem(0).value,e)))}getIf(...e){let t=this.childNodes;for(let n=0;n<e.length;n++)if(t=t.filterSelector(e[n]),t.isAbsent())return t;return t}eachElem(e){for(let t=0,n=this.rootNode.length;t<n&&!1!==e(this.rootNode[t],t);t++);return this}firstElem(e=e=>e){return this.rootNode.length>0&&e(this.rootNode[0],0),this}lastElem(e=e=>e){return this.rootNode.length>0&&e(this.rootNode[this.rootNode.length-1],this.rootNode.length-1),this}each(e){return u(this.rootNode).forEach(((t,n)=>{if(null!=t)return e(U.byId(t),n)})),this}replace(e){return this.each((t=>{let n=t.getAsElem(0).value,r=n.parentElement,s=n.nextElementSibling,i=n.previousElementSibling;null!=s?new U(s).insertBefore(e):i?new U(i).insertAfter(e):new U(r).append(e),t.delete()})),e}first(e=e=>e){return this.rootNode.length>=1?(e(this.get(0),0),this.get(0)):this}last(e=e=>e){if(this.rootNode.length>=1){let t=this.get(this.rootNode.length-1);return e(t,0),t}return this}filter(e){let t=[];return this.each((n=>{e(n)&&t.push(n)})),new U(t)}globalEval(e,t){var n,r,s;const i=null!==(r=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==r?r:null===(s=document.documentElement.getElementsByTagName("head"))||void 0===s?void 0:s[0],l=document.createElement("script");t&&(void 0!==(null==l?void 0:l.nonce)?l.nonce=t:l.setAttribute("nonce",t)),l.type="text/javascript",l.innerHTML=e;let o=i.appendChild(l);return i.removeChild(o),this}globalEvalSticky(e,t){let n=document.getElementsByTagName("head")[0]||document.documentElement,r=document.createElement("script");return this.applyNonce(t,r),r.type="text/javascript",r.innerHTML=e,n.appendChild(r),this}detach(){return this.eachElem((e=>{e.parentNode.removeChild(e)})),this}appendTo(e){return o.isString(e)?(this.appendTo(U.querySelectorAll(e)),this):(this.eachElem((t=>{e.getAsElem(0).orElseLazy((()=>({appendChild:()=>{}}))).value.appendChild(t)})),this)}loadScriptEval(e,t=0,n){return this._loadScriptEval(!1,e,t,n),this}loadScriptEvalSticky(e,t=0,n){return this._loadScriptEval(!0,e,t,n),this}insertAfter(...e){this.each((t=>{let n=t.getAsElem(0).value,r=n.parentNode;for(let t=0;t<e.length;t++){let s=n.nextSibling;e[t].eachElem((e=>{s?(r.insertBefore(e,s),n=s):r.appendChild(e)}))}}));let t=[];return t.push(this),t=t.concat(e),new U(t)}insertBefore(...e){this.each((t=>{let n=t.getAsElem(0).value,r=n.parentNode;for(let t=0;t<e.length;t++)e[t].eachElem((e=>{r.insertBefore(e,n)}))}));let t=[];return t.push(this),t=t.concat(e),new U(t)}orElse(...e){return this.isPresent()?this:new U(...e)}orElseLazy(e){return this.isPresent()?this:new U(e())}allParents(e){let t=this.parent(),n=[];for(;t.isPresent();)t.matchesSelector(e)&&n.push(t),t=t.parent();return new U(n)}firstParent(e){let t=this.parent();for(;t.isPresent();){if(t.matchesSelector(e))return t;t=t.parent()}return U.absent}parentsWhileMatch(e){const t=[];let n=this.parent().filter((t=>t.matchesSelector(e)));for(;n.isPresent();)t.push(n),n=n.parent().filter((t=>t.matchesSelector(e)));return new U(t)}parent(){let e=[];return this.eachElem((t=>{let n=t.parentNode||t.host||t.shadowRoot;n&&-1==e.indexOf(n)&&e.push(n)})),new U(e)}copyAttrs(e){return e.eachElem((e=>{let t=L(e.attributes);for(let e of t){let t=e.value,n=e.name;switch(n){case"id":this.id.value=t;break;case"disabled":this.resolveAttributeHolder("disabled").disabled=t;break;case"checked":this.resolveAttributeHolder("checked").checked=t;break;case"nonce":break;default:this.attr(n).value=t}}})),e.nonce.isPresent((()=>{this.nonce.value=e.nonce.value})),this}outerHTML(e,t,n,r=!1){var s;if(this.isAbsent())return;let i=this.getAsElem(0).value,l=null===document||void 0===document?void 0:document.activeElement,o=null==l?void 0:l.id,a=!!o&&!!(null===(s=null==i?void 0:i.contains)||void 0===s?void 0:s.call(i,l)),u=a?U.getCaretPosition(l):null,c=U.fromMarkup(e),h=[],d=c.get(0),v=i.parentNode,f=d.getAsElem(0).value;if(v.replaceChild(f,i),h.push(new U(f)),this.isAbsent())return this;let p=[];if(c.length>1&&(p=p.concat(c.values.slice(1)),h.push(U.byId(f).insertAfter(new U(p)))),t&&this.runScripts(),n&&this.runCss(),a){let e=U.byId(o);e.isPresent()&&null!=u&&void 0!==u&&e.eachElem((e=>U.setCaretPosition(e,u)))}return c}runScripts(e=!1,t=B){const n=t=>{if(t.length){let n=[];u(t).forEach((t=>{t.nonce?(n.length&&(this.globalEval(n.join("\n")),n.length=0),e?this.globalEvalSticky(t.evalText,t.nonce):this.globalEval(t.evalText,t.nonce)):n.push(t.evalText)})),n.length&&(e?this.globalEvalSticky(n.join("\n")):this.globalEval(n.join("\n")),n.length=0),t=[]}return t};let r=[],s=["","script","text/javascript","text/ecmascript","ecmascript"],i=i=>{var l,o,a,u;let c=i.tagName,h=(null!==(l=null==i?void 0:i.type)&&void 0!==l?l:"").toLowerCase();if(c&&D(c,"script")&&-1!=s.indexOf(h)){let s=i.getAttribute("src");if(void 0!==s&&null!=s&&s.length>0){let l=null!==(o=null==i?void 0:i.nonce)&&void 0!==o?o:i.getAttribute("nonce").value;t(s)&&(r=n(r),e?l?this.loadScriptEvalSticky(s,0,l):this.loadScriptEvalSticky(s,0):l?this.loadScriptEval(s,0,l):this.loadScriptEval(s,0))}else{let e=P(i.text||i.innerText||i.innerHTML),t=!0;for(;t;)t=!1,"\x3c!--"==e.substring(0,4)&&(e=e.substring(4),t=!0),"//\x3c!--"==e.substring(0,4)&&(e=e.substring(6),t=!0),"//<![CDATA["==e.substring(0,11)&&(e=e.substring(11),t=!0);let n=null!==(u=null!==(a=null==i?void 0:i.nonce)&&void 0!==a?a:i.getAttribute("nonce").value)&&void 0!==u?u:"";r.push({nonce:n,evalText:e})}}};try{new U(this.filterSelector("script"),this.querySelectorAll("script")).asArray.flatMap((e=>[...e.values])).sort(((e,t)=>t.compareDocumentPosition(e)-3)).forEach((e=>i(e))),n(r)}catch(e){if(console&&console.error){const t=e;console.error(t.message||t.description)}}finally{i=null}return this}runCss(){return new U(this.filterSelector("link, style"),this.querySelectorAll("link, style")).asArray.flatMap((e=>[...e.values])).sort(((e,t)=>e.compareDocumentPosition(t)-3)).forEach((e=>(e=>{const t=U.byId(e),n=t.tagName.orElse("").value;let r=U.fromMarkup(`<${n.toLowerCase()} />`);r=r.copyAttrs(t),r.innerHTML=e.innerHTML,t.replace(r)})(e))),this}click(){return this.fireEvent("click"),this}addEventListener(e,t,n){return this.eachElem((r=>r.addEventListener(e,t,n))),this}removeEventListener(e,t,n){return this.eachElem((r=>r.removeEventListener(e,t,n))),this}fireEvent(e,t={}){let n={bubbles:!0,cancelable:!0};n=b(n,t),this.eachElem((t=>{let r;if(t.ownerDocument)r=t.ownerDocument;else{if(9!=t.nodeType)throw new Error("Invalid node passed to fireEvent: "+t.id);r=t}if(t.dispatchEvent){let r=Event;switch(e){case"click":case"mousedown":case"mouseup":case"mousemove":r=this.global().MouseEvent;break;case"keyup":case"keydown":case"keypress":r=this.global().KeyboardEvent;break;case"focus":case"change":case"blur":case"select":break;default:throw"fireEvent: Couldn't find an event class for event '"+e+"'."}let s=new r(e,n);s.synthetic=!0,t.dispatchEvent(s)}else if(t.fireEvent){let s=r.createEventObject();s.synthetic=!0,Object.keys(n).forEach((e=>s[e]=n[e])),t.fireEvent("on"+e,s)}}))}textContent(e=""){return this.asArray.map((e=>e.getAsElem(0).orElseLazy((()=>({textContent:""}))).value.textContent||"")).reduce(((t,n)=>[t,e,n].join("")),"")}innerText(e=""){return this.asArray.map((e=>e.getAsElem(0).orElseLazy((()=>({innerText:""}))).value.innerText||"")).reduce(((t,n)=>[t,n].join(e)),"")}encodeFormElement(e={}){if(this.name.isAbsent())return;let t=b(e);return this.each((e=>{var n,r;if(e.name.isAbsent())return;let s=e.name.value,i=e.tagName.orElse("__none__").value.toLowerCase(),l=e.type.orElse("__none__").value.toLowerCase();if(l=l.toLowerCase(),("input"==i||"textarea"==i||"select"==i)&&null!=s&&""!=s&&!e.disabled){if("select"==i){let n=e.getAsElem(0).value;if(n.selectedIndex>=0){let e=n.options.length;for(let r=0;r<e;r++)if(n.options[r].selected){let e=n.options[r];p(t,s).value=null!=e.getAttribute("value")?e.value:e.text}}}if(i!=H.SELECT&&l!=H.BUTTON&&l!=H.RESET&&l!=H.SUBMIT&&l!=H.IMAGE&&(l!=H.CHECKBOX&&l!=H.RADIO||e.checked)){let i=null===(r=null===(n=e.value)||void 0===n?void 0:n.value)||void 0===r?void 0:r.files,l=null!=i?i:[];if(null==l?void 0:l.length)f(t,s).value=Array.from(l);else{if(i)return;p(t,s).value=e.inputValue.value}}}})),t}get cDATAAsString(){let e=this.asArray.flatMap((e=>e.childNodes.asArray)).filter((e=>{var t,n;return 4==(null===(n=null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.value)||void 0===n?void 0:n.nodeType)})).reduce(((e,t)=>{var n,r,s;return e.push(null!==(s=null===(r=null===(n=null==t?void 0:t.value)||void 0===n?void 0:n.value)||void 0===r?void 0:r.data)&&void 0!==s?s:""),e}),[]);return e.join("")}subNodes(e,t){return h.fromNullable(t).isAbsent()&&(t=this.length),new U(this.rootNode.slice(e,Math.min(t,this.length)))}limits(e){return this._limits=e,this}hasNext(){let e=-1!=this._limits&&this.pos>=this._limits-1,t=this.pos>=this.values.length-1;return!(e||t)}next(){return this.hasNext()?(this.pos++,new U(this.values[this.pos])):null}lookAhead(e=1){return this.values.length-1<this.pos+e?R.EO_STRM:new U(this.values[this.pos+e])}current(){return-1==this.pos?R.BEF_STRM:new U(this.values[this.pos])}reset(){this.pos=-1}attachShadow(e={mode:"open"}){let t=[];return this.eachElem((n=>{var r;let s;if(!(null===(r=n)||void 0===r?void 0:r.attachShadow))throw new Error("Shadow dom creation not supported by the browser, please use a shim, to gain this functionality");s=U.byId(n.attachShadow(e)),t.push(s)})),new U(t)}waitUntilDom(e){return t=this,n=arguments,s=function*(e,t={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}){return function(e,t,n={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}){return new Promise(((r,s)=>{let i=null;const l=new Error("Mutation observer timeout");function o(e,t){let r=null;return t(e)?e:(r=n.childList?t(e)?e:e.childNodes.filter((e=>t(e))).first().value.value:n.subtree?t(e)?e:e.querySelectorAll(" * ").filter((e=>t(e))).first().value.value:t(e)?e:null,r)}let a=e;if(a=o(a,t))r(new U(a));else if("undefined"!=typeof MutationObserver){const o=setTimeout((()=>(i.disconnect(),s(l))),n.timeout),a=n=>{const s=new U(n.map((e=>e.target))).filter((e=>t(e))).first();s.isPresent()&&(clearTimeout(o),i.disconnect(),r(new U(s||e)))};i=new MutationObserver(a);let u=Object.assign({},n);delete u.timeout,e.eachElem((e=>{i.observe(e,u)}))}else{let i,a;i=setInterval((()=>{let n=o(e,t);n&&(a&&(clearTimeout(a),clearInterval(i),i=null),r(new U(n||e)))}),n.interval),a=setTimeout((()=>{i&&(clearInterval(i),s(l))}),n.timeout)}}))}(this,e,t)},new((r=void 0)||(r=Promise))((function(e,i){function l(e){try{a(s.next(e))}catch(e){i(e)}}function o(e){try{a(s.throw(e))}catch(e){i(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(l,o)}a((s=s.apply(t,n||[])).next())}));var t,n,r,s}get shadowElements(){let e=(this.querySelectorAll("*").filter((e=>e.hasShadow)).allElems()||[]).map((e=>e.shadowRoot)).filter((e=>!!e));return new U(e)}get shadowRoot(){let e=[];for(let t=0;t<this.rootNode.length;t++)this.rootNode[t].shadowRoot&&e.push(this.rootNode[t].shadowRoot);return new U(e)}get hasShadow(){for(let e=0;e<this.rootNode.length;e++)if(this.rootNode[e].shadowRoot)return!0;return!1}static getCaretPosition(e){try{if("number"==typeof(null==e?void 0:e.selectionStart))return e.selectionStart}catch(e){}return 0}static setCaretPosition(e,t){(null==e?void 0:e.focus)&&(null==e||e.focus());try{(null==e?void 0:e.setSelectionRange)&&(null==e||e.setSelectionRange(t,t))}catch(e){}}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}concat(e,t=!0){let n=this.asArray;const r=new U(n.concat(e.asArray));if(!t)return r;let s={};return new U(r.asArray.filter((e=>{const t=!(null==s?void 0:s[e.value.value.outerHTML]);return s[e.value.value.outerHTML]=!0,t})))}append(e){return this.each((t=>e.appendTo(t))),this}prependTo(e){return e.eachElem((e=>{q(e,this.allElems())})),this}prepend(e){return this.eachElem((t=>{q(t,e.allElems())})),this}_querySelectorAll(e){var t,n;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let r=[];for(let t=0;t<this.rootNode.length;t++){if(!(null===(n=this.rootNode[t])||void 0===n?void 0:n.querySelectorAll))continue;let s=this.rootNode[t].querySelectorAll(e);r=r.concat(L(s))}return new U(r)}_querySelectorAllDeep(e){var t;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let n=new U(this.rootNode),r=e.split(/\/shadow\//);for(let e=0;e<r.length;e++){if(""==r[e])continue;let t=r[e];n=n.querySelectorAll(t),e<r.length-1&&(n=n.shadowRoot)}return n}_closest(e){var t,n;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let r=[];for(let t=0;t<this.rootNode.length;t++){if(!(null===(n=this.rootNode[t])||void 0===n?void 0:n.closest))continue;let s=[this.rootNode[t].closest(e)];r=r.concat(s)}return new U(r)}_closestDeep(e){var t;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let n=new U(this.rootNode),r=e.split(/\/shadow\//);for(let e=0;e<r.length;e++){if(""==r[e])continue;let t=r[e];n=n.closest(t),e<r.length-1&&(n=n.shadowRoot)}return n}_matchesSelector(e,t){if(e.matches)return e.matches(t);var n=(document||ownerDocument).querySelectorAll(t);return-1!==Array.prototype.indexOf.call(n,e)}_loadScriptEval(e,t,n=0,r){let s=this.createSourceNode(t,r),i=this.createSourceNode(null,r),l=`nonce_${Date.now()}_${Math.random()}`;i.innerHTML=`document.head["${l}"] = true`;let o=document.head;if(o.appendChild(i),o.removeChild(i),o[l]){try{n?setTimeout((()=>{o.appendChild(s),e||o.removeChild(s)}),n):(o.appendChild(s),e||o.removeChild(s))}finally{delete o[l]}return this}}resolveAttributeHolder(e="value"){let t=[];return t[e]=null,e in this.getAsElem(0).value?this.getAsElem(0).value:t}createSourceNode(e,t){let n=document.createElement("script");return n.type="text/javascript",t&&(void 0!==(null==n?void 0:n.nonce)?n.nonce=t:n.setAttribute("nonce",t)),e&&(n.src=e),n}applyNonce(e,t){e&&(void 0!==(null==t?void 0:t.nonce)?t.nonce=e:t.setAttribute("nonce",e))}}U.absent=new U,U.global=k;const z=U,W=U.querySelectorAll;var X;!function(e){e[e.PENDING=0]="PENDING",e[e.FULFILLED=1]="FULFILLED",e[e.REJECTED=2]="REJECTED"}(X||(X={}));const G=o.isString;class Q extends U{constructor(e,t="text/xml"){var n;G(e)?super(null==(n=e)?null:o.saveResolveLazy((()=>new(k().DOMParser)),(()=>(()=>{let e=new ActiveXObject("Microsoft.XMLDOM");return e.async=!1,{parseFromString:(t,n)=>e.loadXML(t)}})())).value.parseFromString(n,t)):super(e)}isXMLParserError(){return this.querySelectorAll("parsererror").isPresent()}toString(){let e=[];return this.eachElem((t=>{var n,r,s,i;let l=null!==(i=null===(s=null===(r=null===(n=k())||void 0===n?void 0:n.XMLSerializer)||void 0===r?void 0:r.constructor())||void 0===s?void 0:s.serializeToString(t))&&void 0!==i?i:null==t?void 0:t.xml;l&&e.push(l)})),e.join("")}parserErrorText(e){return this.querySelectorAll("parsererror").textContent(e)}static parseXML(e){return new Q(e)}static parseHTML(e){return new Q(e,"text/html")}static fromString(e,t="text/xml"){return new Q(e,t)}}class J{constructor(e,t){this.activeDataSource=null,this.walkedDataSources=[],this._currPos=0,this.mapFunc=e,this.inputDataSource=t}hasNext(){return this.resolveActiveHasNext()||this.resolveNextHasNext()}resolveActiveHasNext(){let e=!1;return this.activeDataSource&&(e=this.activeDataSource.hasNext()),e}lookAhead(e=1){var t;let n=null===(t=null==this?void 0:this.activeDataSource)||void 0===t?void 0:t.lookAhead(e);if((null==this?void 0:this.activeDataSource)&&n!=R.EO_STRM)return n;this.activeDataSource&&(e-=N(this.activeDataSource));for(let t=1;;t++){let n=this.inputDataSource.lookAhead(t);if(n===R.EO_STRM)return R.EO_STRM;let r=this.mapFunc(n),s=this.toDatasource(r),i=s.lookAhead(e);if(i!=R.EO_STRM)return i;e-=N(s)}}toDatasource(e){let t=Array.isArray(e)?C.ofArray(e):e;return this.walkedDataSources.push(t),t}resolveNextHasNext(){let e=!1;for(;!e&&this.inputDataSource.hasNext();){let t=this.mapFunc(this.inputDataSource.next());this.activeDataSource=this.toDatasource(t),e=this.activeDataSource.hasNext()}return e}next(){if(this.hasNext())return this._currPos++,this.activeDataSource.next()}reset(){this.inputDataSource.reset(),this.walkedDataSources.forEach((e=>e.reset())),this.walkedDataSources=[],this._currPos=0,this.activeDataSource=null}current(){return this.activeDataSource||this.hasNext(),this.activeDataSource.current()}}class K{constructor(...e){this._limits=-1,this.pos=-1,this.value=e}static of(...e){return K.ofArr(e)}static ofArr(e){const t=new K;return t.value=null!=e?e:[],t}static ofAssoc(e){return this.ofArr(Object.keys(e)).map((t=>[t,e[t]]))}static ofDataSource(e){let t=[];for(;e.hasNext();)t.push(e.next());return K.ofArr(t)}static ofDomQuery(e){return K.ofArr(e.asArray)}static ofConfig(e){return K.ofArr(Object.keys(e.value)).map((t=>[t,e.value[t]]))}current(){return-1==this.pos?R.BEF_STRM:this.pos>=this.value.length?R.EO_STRM:this.value[this.pos]}limits(e){return this._limits=e,this}concat(...e){let t=[this].concat(e);return K.ofArr(t).flatMap((e=>e))}onElem(e){for(let t=0;t<this.value.length&&(-1==this._limits||t<this._limits)&&!1!==e(this.value[t],t);t++);return this}each(e){this.onElem(e),this.reset()}map(e){e||(e=e=>e);let t=[];return this.each((n=>{t.push(e(n))})),K.ofArr(t)}flatMap(e){let t=[];return this.each((n=>{let r=e(n);t=Array.isArray(r)?t.concat(r):t.concat(r.value)})),K.ofArr(t)}filter(e){let t=[];return this.each((n=>{e(n)&&t.push(n)})),K.ofArr(t)}reduce(e,t=null){let n=null!=t?0:1,r=null!=t?t:this.value.length?this.value[0]:null;for(let t=n;t<this.value.length&&(-1==this._limits||t<this._limits);t++)r=e(r,this.value[t]);return this.reset(),h.fromNullable(r)}first(){return this.reset(),this.value&&this.value.length?h.fromNullable(this.value[0]):h.absent}last(){let e=this._limits>0?Math.min(this._limits,this.value.length):this.value.length;return this.reset(),h.fromNullable(e?this.value[e-1]:null)}anyMatch(e){for(let t=0;t<this.value.length&&(-1==this._limits||t<this._limits);t++)if(e(this.value[t]))return!0;return this.reset(),!1}allMatch(e){if(!this.value.length)return!1;let t=0;for(let n=0;n<this.value.length;n++)e(this.value[n])&&t++;return this.reset(),t==this.value.length}noneMatch(e){let t=0;for(let n=0;n<this.value.length;n++)e(this.value[n])||t++;return this.reset(),t==this.value.length}sort(e){let t=this.value.slice().sort(e);return K.ofArr(t)}collect(e){return this.each((t=>e.collect(t))),this.reset(),e.finalValue}hasNext(){let e=-1!=this._limits&&this.pos>=this._limits-1,t=this.pos>=this.value.length-1;return!(e||t)}next(){return this.hasNext()?(this.pos++,this.value[this.pos]):null}lookAhead(e=1){return this.pos+e>=this.value.length?R.EO_STRM:this.value[this.pos+e]}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}reset(){this.pos=-1}}class Y{static of(...e){return Y.ofArr(e)}static ofArr(e){return new Y(C.ofArray(e))}static ofAssoc(e){return this.ofArr(Object.keys(e)).map((t=>[t,e[t]]))}static ofStreamDataSource(e){return new Y(e)}static ofDomQuery(e){return Y.ofArr(e.asArray)}static ofConfig(e){return Y.ofArr(Object.keys(e.value)).map((t=>[t,e.value[t]]))}constructor(e){this._limits=-1,this.pos=-1,this.dataSource=e}hasNext(){return!this.isOverLimits()&&this.dataSource.hasNext()}next(){let e=this.dataSource.next();return this.pos++,e}lookAhead(e=1){return this.dataSource.lookAhead(e)}current(){return this.dataSource.current()}reset(){this.dataSource.reset(),this.pos=-1,this._limits=-1}concat(...e){return Y.ofStreamDataSource(new I(this,e))}nextFilter(e){if(this.hasNext()){let t=this.next();return e(t)?t:this.nextFilter(e)}return null}limits(e){return this._limits=e,this}collect(e){for(;this.hasNext();){let t=this.next();e.collect(t)}return this.reset(),e.finalValue}onElem(e){return new Y(new O((t=>(!1===e(t,this.pos)&&this.stop(),t)),this))}filter(e){return new Y(new T(e,this))}map(e){return new Y(new O(e,this))}flatMap(e){return new Y(new J(e,this))}each(e){for(;this.hasNext();)!1===e(this.next())&&this.stop();this.reset()}reduce(e,t=null){if(!this.hasNext())return h.absent;let n,r=R.EO_STRM;if(null!=t)n=t,r=this.next();else{if(n=this.next(),!this.hasNext())return h.fromNullable(n);r=this.next()}for(n=e(n,r);this.hasNext();)r=this.next(),n=e(n,r);return this.reset(),h.fromNullable(n)}last(){return this.hasNext()?this.reduce(((e,t)=>t)):h.absent}first(){return this.reset(),this.hasNext()?h.fromNullable(this.next()):h.absent}anyMatch(e){for(;this.hasNext();)if(e(this.next()))return!0;return!1}allMatch(e){for(;this.hasNext();)if(!e(this.next()))return!1;return!0}noneMatch(e){for(;this.hasNext();)if(e(this.next()))return!1;return!0}sort(e){let t=this.collect(new M);return t=t.sort(e),Y.ofArr(t)}get value(){return this.collect(new M)}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}stop(){this.pos=this._limits+1e9,this._limits=0}isOverLimits(){return-1!=this._limits&&this.pos>=this._limits-1}}Object.defineProperty(U.prototype,"stream",{get:function(){return K.ofDomQuery(this)}}),Object.defineProperty(U.prototype,"lazyStream",{get:function(){return Y.ofDomQuery(this)}}),void 0!==k&&function(){if(void 0===k().Reflect||void 0===k().customElements||k().customElements.polyfillWrapFlushCallback)return;const e=HTMLElement;k().HTMLElement={HTMLElement:function(){return Reflect.construct(e,[],this.constructor)}}.HTMLElement,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}();const Z="namedViewRoot",ee="jakarta.faces.source",te="myfaces.NamingContainerId",ne="myfaces.viewId",re="jakarta.faces.ViewState",se="jakarta.faces.ClientWindow",ie=Object.freeze((()=>{})),le="",oe=(Object.freeze({}),["<input type='hidden'","name='",re,"' value='' />"].join(le)),ae=["<input type='hidden'","' name='",se,"' value='' />"].join(le),ue="@all",ce="@none",he="@this",de="jakarta.faces.partial.execute",ve="jakarta.faces.partial.render",fe="_myfaces.rendeOverride",pe="jakarta.faces.windowId",me="jakarta.faces.behavior.event",ge="render",ye="onerror",Ee="onevent",we="begin",be="source",Ae="error-name",Se="error-message",xe="responseXML",_e="httpError",Re="emptyResponse",Ne="malformedXML",Ie="params",Ce="timeout",Te="execute",Oe="myfaces.internal",Me="myfaces.source.formId",ke="myfaces.upload.progress",Pe="myfaces.upload.preinit",je="myfaces.upload.loadstart",De="myfaces.upload.loadend",Le="myfaces.upload.load",qe="myfaces.upload.error",Fe="myfaces.upload.abort",He="myfaces.upload.timeout",Ve="myfaces.source.controlId",$e="myfaces.request.passThrough",Be="myfaces.request.pps",Ue="jakarta.faces.encodedURL",ze="POST",We="HEAD",Xe="FORM",Ge="BODY",Qe="[name='"+re+"']",Je="[name='"+se+"']",Ke="processResponse",Ye="partial-response",Ze="changes",et="update",tt="delete",nt="insert",rt="eval",st="error",it="attributes",lt="extension",ot="redirect",at="before",ut="after",ct="myfaces.updateForms",ht="myfaces.updateElems",dt="myfaces.headElems",vt="myfaces",ft="myfaces.appliedViewState",pt="myfaces.appliedClientWindow";function mt(){var e;return null!==(e=null===window||void 0===window?void 0:window.faces)&&void 0!==e?e:null===window||void 0===window?void 0:window.jsf}function gt(e){return e&&(null==e?void 0:e.replace)?(null===window||void 0===window?void 0:window.faces)?e.replace(/javax\.faces/gi,"jakarta.faces"):e.replace(/jakarta\.faces/gi,"javax.faces"):e}class yt{constructor(){this.MSG_TEST="Testmessage",this.MSG_DEV_MODE="Note, this message is only sent, because project stage is development and no other error listeners are registered.",this.MSG_AFFECTED_CLASS="Affected Class=",this.MSG_AFFECTED_METHOD="Affected Method=",this.MSG_ERROR_NAME="Error Name=",this.MSG_ERROR_MESSAGE="Error Message=",this.MSG_SERVER_ERROR_NAME="Server Error Name=",this.MSG_ERROR_DESC="Error Description=",this.MSG_ERROR_NO="Error Number=",this.MSG_ERROR_LINENO="Error Line Number=",this.ERR_FORM="Sourceform could not be determined, either because element is not attached to a form or we have multiple forms with named elements of the same identifier or name, stopping the ajax processing",this.ERR_VIEWSTATE="faces.viewState= param value not of type form!",this.ERR_TRANSPORT="Transport type {0} does not exist",this.ERR_EVT_PASS="an event must be passed down (either an event object null or undefined) ",this.ERR_CONSTRUCT="Parts of the response couldn't be retrieved when constructing the event data= {0} ",this.ERR_MALFORMEDXML="The server response could not be parsed, the server has returned with a response which is not xml !",this.ERR_SOURCE_FUNC="source cannot be a function (probably source and event were not defined or set to null",this.ERR_EV_OR_UNKNOWN="An event object or unknown must be passed as second parameter",this.ERR_SOURCE_NOSTR="source cannot be a string",this.ERR_SOURCE_DEF_NULL="source must be defined or null",this.ERR_MUST_STRING="{0}: {1} namespace must be of type String",this.ERR_REF_OR_ID="{0}: {1} a reference node or identifier must be provided",this.ERR_PARAM_GENERIC="{0}: parameter {1} must be of type {2}",this.ERR_PARAM_STR="{0}: {1} param must be of type string",this.ERR_PARAM_STR_RE="{0}: {1} param must be of type string or a regular expression",this.ERR_PARAM_MIXMAPS="{0}: both a source as well as a destination map must be provided",this.ERR_MUST_BE_PROVIDED="{0}: an {1} and a {2} must be provided",this.ERR_MUST_BE_PROVIDED1="{0}: {1} must be set",this.ERR_REPLACE_EL="replaceElements called while evalNodes is not an array",this.ERR_EMPTY_RESPONSE="{0}: The response cannot be null or empty!",this.ERR_ITEM_ID_NOTFOUND="{0}: item with identifier {1} could not be found",this.ERR_PPR_IDREQ="{0}: Error in PPR Insert, id must be present",this.ERR_PPR_INSERTBEFID="{0}: Error in PPR Insert, before id or after id must be present",this.ERR_PPR_INSERTBEFID_1="{0}: Error in PPR Insert, before node of id {1} does not exist in document",this.ERR_PPR_INSERTBEFID_2="{0}: Error in PPR Insert, after node of id {1} does not exist in document",this.ERR_PPR_DELID="{0}: Error in delete, id not in xml markup",this.ERR_PPR_UNKNOWNCID="{0}: Unknown Html-Component-ID= {1}",this.ERR_NO_VIEWROOTATTR="{0}: Changing of ViewRoot attributes is not supported",this.ERR_NO_HEADATTR="{0}: Changing of Head attributes is not supported",this.ERR_RED_URL="{0}: Redirect without url",this.ERR_REQ_FAILED_UNKNOWN="Request failed with unknown status",this.ERR_REQU_FAILED="Request failed with status {0} and reason {1}",this.UNKNOWN="UNKNOWN"}}const Et=e=>!(!e||-1==e.search(/\/jakarta\.faces\.resource.*\/faces\.js.*/)&&-1==(null==e?void 0:e.search(/\/faces-development\.js.*/))&&-1==(null==e?void 0:e.search(/\/faces-uncompressed\.js.*/))&&-1==(null==e?void 0:e.search(/\/faces[^.]*\.js.*ln=jakarta.faces.*/gi))&&-1==(null==e?void 0:e.search(/\/javax\.faces\.resource.*\/jsf\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf-development\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf-uncompressed\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf[^.]*\.js.*ln=javax.faces.*/gi))),wt="src";function bt(e){return null!=e&&e.length>1}class At extends z{static get windowId(){return new At(document.body).windowId}static get nonce(){return new At(document.body).nonce}get windowId(){const e=function(){let e=window.location.href,t=new RegExp("[\\?&]windowId=([^&#\\;]*)").exec(e);return null!=t?t[1]:null};if(this.value.isPresent()){let t=this.querySelectorAll("form input[name='"+pe+"']");if(t.length>1)throw Error("Multiple different windowIds found in document");return h.fromNullable(t.isPresent()?t.getAsElem(0).value.value:e())}return h.fromNullable(e())}get nonce(){var e;let t=new St(window.myfaces).getIf("config","cspMeta","nonce");if(t.value)return d.fromNullable(t);let n=new z(document.currentScript).nonce;if(n.isPresent())return d.fromNullable(n);let r=h.fromNullable(null===(e=z.querySelectorAll("script[src], link[src]").asArray.filter((e=>e.nonce.isPresent()&&null!=e.attr(wt).value)).filter((e=>{var t;return Et(null!==(t=e.attr(wt).value)&&void 0!==t?t:void 0)})))||void 0===e?void 0:e[0]);return(null==r?void 0:r.value)?new U(r.value).nonce:d.absent}static searchJsfJsFor(e){return new At(document).searchJsfJsFor(e)}searchJsfJsFor(e){var t;return h.fromNullable(null===(t=z.querySelectorAll("script[src], link[src]").asArray.filter((e=>{var t;return Et(null!==(t=e.attr(wt).value)&&void 0!==t?t:void 0)})).map((t=>{var n;return(null!==(n=t.attr(wt).value)&&void 0!==n?n:"").match(e)})).filter(bt).map((e=>decodeURIComponent(e[1]))))||void 0===t?void 0:t[0])}globalEvalSticky(e,t){return new At(super.globalEvalSticky(e,null!=t?t:this.nonce.value))}runScripts(e=!1,t){return super.runScripts(e,(e=>{var n,r;return(null===(n=null==t?void 0:t(e))||void 0===n||n)&&!Et(e)&&!(-1!=(r=e).search(/\/faces[^.]*\.js.*ln=myfaces.testscripts.*/gi)||-1!=r.search(/\/jsf[^.]*\.js.*ln=myfaces.testscripts.*/gi))}))}runHeadInserts(e=!0){let t=At.byId(document.head),n=[];this.filter((function(n){if(!e)return!0;const r=n.tagName.value;if(!r)return!0;let s=n.attr("href").orElseLazy((()=>n.attr("src").value)).orElseLazy((()=>n.attr("rel").value));return!s.isPresent()||!t.querySelectorAll(`${r}[href='${s.value}']`).length&&!t.querySelectorAll(`${r}[src='${s.value}']`).length&&!t.querySelectorAll(`${r}[rel='${s.value}']`).length})).each((e=>{"SCRIPT"!=e.tagName.value?(new At(...n).runScripts(!0),n=[],t.append(e)):n.push(e)})),new At(...n).runScripts(!0)}static byId(e,t=!1){var n,r,s;const i=U.byId(e,t);if("development"==mt().getProjectStage().toLowerCase()&&(null===window||void 0===window?void 0:window.console)&&i.isAbsent()&&e){let t=null!==(s=null!==(r=null===(n=null==e?void 0:e.id)||void 0===n?void 0:n.value)&&void 0!==r?r:null==e?void 0:e.id)&&void 0!==s?s:e.toString();console.error("Element "+t+"not found")}return new At(i)}filter(e){return new At(super.filter(e))}}class St extends _{constructor(e){super(e),this.$nspEnabled=!0}assignIf(e,...t){const n=this.remap(t);return super.assignIf(e,...n)}assign(...e){const t=this.remap(e);return super.assign(...t)}append(...e){return super.append(...e)}appendIf(e,...t){const n=this.remap(t);return super.appendIf(e,...n)}getIf(...e){const t=this.remap(e);return super.getIf(...t)}get(e){return super.get(gt(e))}delete(e){return super.delete(gt(e))}static fromNullable(e){return new St(e)}getClass(){return St}shallowCopy$(){const e=super.shallowCopy$();return new St(e)}get deepCopy(){return new St(super.deepCopy$())}remap(e){return this.$nspEnabled?new a(...e).map((e=>gt(e))):e}}function xt(e,t,n){return(t=t||new _({})).getIf(n).orElseLazy((()=>e.getIf(n).value)).orElse(ie).value}function _t(e){if(!e.getIf(Z).isPresent())return(e,t)=>[e,t];const t=e.getIf(te).value+mt().separatorchar;return(e,n)=>0==e.indexOf(t)?[e,n]:[t+e,n]}function Rt(e){var t,n;return null!==(n=null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.windowId)&&void 0!==n?n:At.windowId.value}var Nt,It;!function(e){let t;function n(e,n,...r){var s,i;t=null!=t?t:new yt;let l=null!==(i=null!==(s=t[e])&&void 0!==s?s:n)&&void 0!==i?i:e;return r.forEach(((e,t)=>{l=l.replace(new RegExp(["\\{",t,"\\}"].join(le),"g"),e)})),l}function r(e,t,n,r,s,i){return new Error(i+(null!=r?r:"impl/util/Lang/")+s)}e.getLanguage=function(){var e,t,n;return(null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:null===navigator||void 0===navigator?void 0:navigator.language)&&void 0!==n?n:"en").split("-")[0]},e.failSaveResolve=function(e,t=null){return o.saveResolve(e,t)},e.failSaveExecute=function(e,t=null){o.saveResolve(e,t)},e.getMessage=n,e.keyValToStr=function(e,t,n="\n"){return[e,t].join(n)},e.makeException=r,e.getGlobalConfig=function(e,t){var n,r,s;return null!==(s=null===(r=null===(n=null===window||void 0===window?void 0:window.myfaces)||void 0===n?void 0:n.config)||void 0===r?void 0:r[e])&&void 0!==s?s:t},e.getForm=function(e,t){const s=new z(e),i=t?new z(function(e){var t,n;let r=e,s=null!==(n=null!==(t=null==r?void 0:r.srcElement)&&void 0!==t?t:null==r?void 0:r.target)&&void 0!==n?n:null==r?void 0:r.source;for(;s&&1!=s.nodeType;)s=s.parentNode;return s}(t)):U.absent;if(s.isTag(Xe))return s;if(s.attr(Xe).isPresent()){const e=s.attr(Xe).value,t=z.byId(e,!0);if(t.isPresent())return t}let l=s.firstParent(Xe).orElseLazy((()=>s.byTagName(Xe,!0))).orElseLazy((()=>i.firstParent(Xe))).orElseLazy((()=>i.byTagName(Xe))).first();return l=l.orElseLazy((()=>z.byTagName(Xe))),function(e){if(e.isAbsent()||e.length>1)throw r(new Error,0,0,"Impl","getForm",n("ERR_FORM"))}(l),l},e.getLocalOrGlobalConfig=function(e,t,n){var r,s,i,l,o,a,u;return null!==(u=null!==(l=null===(i=null===(s=null===(r=e.value)||void 0===r?void 0:r.myfaces)||void 0===s?void 0:s.config)||void 0===i?void 0:i[t])&&void 0!==l?l:null===(a=null===(o=null===window||void 0===window?void 0:window.myfaces)||void 0===o?void 0:o.config)||void 0===a?void 0:a[t])&&void 0!==u?u:n},e.ofAssoc=function(e){return new a(...Object.keys(e)).map((t=>[t,e[t]]))},e.collectAssoc=function(e,t){return e[t[0]]=t[1],e};let s={};e.debounce=function(e,t,n){function r(){clearTimeout(s[e]),delete s[e]}(null==s?void 0:s[e])&&r(),n>0?s[e]=setTimeout((()=>{try{t()}finally{r()}}),n):t()}}(Nt||(Nt={})),function(e){function t(t,n="",r="",s="Assertion Error"){if(!t)throw e.raiseError(new Error,n,r,s)}function n(t,n,r="",s="",i="Type Assertion Error"){if(t&&!o.assertType(t,n))throw e.raiseError(new Error,r,s,i)}function r(e,t="",r="",s="Assertion Error"){n(e,"function",t,r,s)}e.assertRequestIntegrity=function(e,n){r(e.getIf(ye).value),r(e.getIf(Ee).value),t(n.isPresent(),Nt.getMessage("ERR_MUST_BE_PROVIDED1","{0}: source must be provided or exist","source element id"),"faces.ajax.request","ArgNotSet")},e.assertUrlExists=function(t){if(t.attr("url").isAbsent())throw e.raiseError(new Error,Nt.getMessage("ERR_RED_URL",void 0,"processRedirect"),"processRedirect")},e.assertValidXMLResponse=function(e){t(!e.isAbsent(),Re,Ke),t(!e.isXMLParserError(),e.parserErrorText(le),Ke),t(e.querySelectorAll(Ye).isPresent(),"Partial response not set",Ke)},e.raiseError=function(e,t,n,r,s){let i=null!=r?r:Ne,l=null!=s?s:Ne,o=null!=t?t:le;return Nt.makeException(e,i,l,"Response",n||(arguments.caller?arguments.caller.toString():"_raiseError"),o)},e.assert=t,e.assertType=n,e.assertFunction=r,e.assertDelay=function(e){if(!(e>=0))throw new Error("Invalid delay value: "+e)}}(It||(It={}));class Ct{static createFromRequest(e,t,n,r){let s=new Ct;if(s.type="event",s.status=r,s.source=t.getIf("_source","_element").value,!s.source){let e=n.getIf(be).orElseLazy((()=>n.getIf(ee).value)).orElseLazy((()=>n.getIf($e,ee).value)).value;e&&(s.source=z.byId(e,!0).first().value.value),s.source&&(t.assign("_source","_element").value=s.source)}return r!==we&&(s.responseCode=null==e?void 0:e.status,s.responseText=null==e?void 0:e.responseText,s.responseXML=null==e?void 0:e.responseXML),s}}const Tt=Nt.getMessage;var Ot;!function(e){e.SERVER_ERROR="serverError",e.HTTP_ERROR="httpError",e.CLIENT_ERROR="clientError",e.TIMEOUT="timeout"}(Ot||(Ot={}));class Mt extends Ct{constructor(e,t,n,r=null,s=null,i=-1,l=null,o=Ot.CLIENT_ERROR){super(),this.type="error",this.source=z.byId(e).value.orElse(e).value,this.type="error",this.errorName=t,this.errorMessage=o==Ot.SERVER_ERROR?o+": "+n:n,this.responseCode=i,this.responseText=r,this.responseXML=s,this.status=l,this.description=`Status: ${this.status}\nResponse Code: ${this.responseCode}\nError Message: ${this.errorMessage}`,this.typeDetails=o,o==Ot.SERVER_ERROR&&(this.serverErrorName=this.errorName,this.serverErrorMessage=this.errorMessage)}static fromClient(e){var t,n,r,s;return new Mt(null!==(t=null==e?void 0:e.source)&&void 0!==t?t:"client",null!==(n=null==e?void 0:e.name)&&void 0!==n?n:le,null!==(r=null==e?void 0:e.message)&&void 0!==r?r:le,null!==(s=null==e?void 0:e.stack)&&void 0!==s?s:le)}static fromHttpConnection(e,t,n,r,s,i,l=""){return new Mt(e,t,n,r,s,i,l,Ot.HTTP_ERROR)}static fromGeneric(e,t,n=Ot.SERVER_ERROR){let r=this.getMsg,s=r(e,be),i=r(e,Ae),l=r(e,Se),o=r(e,"status"),a=r(e,"responseText"),u=e.getIf(xe).value;return new Mt(s,i,l,a,u,t,o,n)}static getMsg(e,t){return Tt(e.getIf(t).orElse(le).value)}static fromServerError(e){return this.fromGeneric(e,-1)}}class kt{constructor(e,t){this.id=e,this.value=t;let n=e.indexOf(re);this.nameSpace=n>0?e.substr(0,n-1):le}get hasNameSpace(){var e;return!!(null!==(e=null==this?void 0:this.nameSpace)&&void 0!==e?e:le).length}}class Pt{constructor(e){this.namedViewRoot=!1;const t=e.includes(gt(re));this.name=t?re:se,this.template=t?oe:ae}withNamingContainerId(e){return this.namingContainerId=e,this}withParent(e){return this.parent=e,this}withNamedViewRoot(e){return this.namedViewRoot=e,this}build(){var e;const t=z.fromMarkup(gt(this.template));return t.id.value=this.buildId(),t.name.value=this.buildName(),null===(e=this.parent)||void 0===e||e.append(t),t}buildId(){var e;const t=mt().separatorchar;return((null===(e=this.namingContainerId)||void 0===e?void 0:e.length)?[this.namingContainerId,gt(this.name),this.nextIndex()]:[gt(this.name),this.nextIndex()]).join(t)}buildName(){var e;return this.namedViewRoot&&(null===(e=this.namingContainerId)||void 0===e?void 0:e.length)?[this.namingContainerId,gt(this.name)].join(mt().separatorchar):gt(this.name)}nextIndex(){const e=mt().separatorchar;return W(`[name*='${gt(this.name)}']`).asArray.map((e=>e.id.orElse("0").value)).map((t=>t.substring(t.lastIndexOf(e)+1))).map((e=>parseInt(e))).filter((e=>!isNaN(e))).reduce(((e,t)=>Math.max(e,t)),0)+1}}const jt=o.trim,Dt=Nt.ofAssoc;class Lt{constructor(e,t,n){this.request=e,this.externalContext=t,this.internalContext=n}replaceHead(e){const t=e.querySelectorAll(We);if(!t.isPresent())return;const n=At.querySelectorAll(We);n.childNodes.delete(),this.addToHead(t),n.copyAttrs(t)}addToHead(e){const t=new At(e),n=["SCRIPT"];t.filter((e=>-1==n.indexOf(e.tagName.orElse("").value))).runHeadInserts(!0);const r="HEAD"===e.tagName.value?e.childNodes:e,s=new U(...r.asArray.filter((e=>-1!=n.indexOf(e.tagName.orElse("").value))));this.addToHeadDeferred(s)}addToHeadDeferred(e){this.internalContext.assign(dt).value.push(e)}replaceBody(e){const t=e.querySelectorAll(Ge);if(!t.isPresent())return;const n=t.innerHTML,r=At.querySelectorAll(Ge),s=r.querySelectorAll(Xe);r.html(n).copyAttrs(t),this.externalContext.assign(gt(fe)).value="@all",this.storeForPostProcessing(s,r)}eval(e){At.globalEval(e.cDATAAsString)}error(e){const t=new St({});t.assign(be).value=this.externalContext.getIf(ee).get(0).value,t.assign(Ae).value=e.querySelectorAll(Ae).textContent(le),t.assign(Se).value=e.querySelectorAll(Se).cDATAAsString;const n=this.internalContext.get(xe).isPresent();t.assignIf(n,xe).value=this.internalContext.getIf(xe).value.get(0).value;const r=Mt.fromServerError(t);this.triggerOnError(r),Kt.sendError(r)}redirect(e){It.assertUrlExists(e);const t=jt(e.attr("url").value);t!=le&&(window.location.href=t)}update(e,t){const n=At.byId(e.id.value,!0).outerHTML(t,!1,!1),r=null==n?void 0:n.firstParent(Xe).orElseLazy((()=>n.byTagName(Xe,!0)));r&&this.storeForPostProcessing(r,n)}delete(e){z.byId(e.id.value,!0).delete()}attributes(e){const t=z.byId(e.id.value,!0);e.byTagName("attribute").each((e=>{t.attr(e.attr("name").value).value=e.attr("value").value}))}replaceViewRoot(e){this.replaceHead(e),this.replaceBody(e)}insert(e){const t=e.attr(at),n=e.attr(ut),r=z.fromMarkup(e.cDATAAsString);t.isPresent()&&(z.byId(t.value,!0).insertBefore(r),this.internalContext.assign(ht).value.push(r)),n.isPresent()&&(z.byId(n.value,!0).insertAfter(r),this.internalContext.assign(ht).value.push(r))}insertWithSubTags(e){const t=e.querySelectorAll(at),n=e.querySelectorAll(ut);t.each((e=>{const t=e.attr("id"),n=z.fromMarkup(e.cDATAAsString);t.isPresent()&&(z.byId(t.value,!0).insertBefore(n),this.internalContext.assign(ht).value.push(n))})),n.each((e=>{const t=e.attr("id"),n=z.fromMarkup(e.cDATAAsString);t.isPresent()&&(z.byId(t.value,!0).insertAfter(n),this.internalContext.assign(ht).value.push(n))}))}processViewState(e){if(Lt.isViewStateNode(e)){const t=e.cDATAAsString;return this.internalContext.assign(ft,e.id.value).value=new kt(gt(e.id.value),t),!0}return!1}processClientWindow(e){if(Lt.isClientWindowNode(e)){const t=e.cDATAAsString;return this.internalContext.assign(pt,e.id.value).value=new kt(gt(e.id.value),t),!0}return!1}globalEval(){new At(...this.internalContext.getIf(dt).value).runHeadInserts(!0);let e=new At(...this.internalContext.getIf(ht).value);e.runCss(),e.runScripts()}fixViewStates(){Dt(this.internalContext.getIf(ft).orElse({}).value).forEach((([,e])=>{const t=this.internalContext.getIf(te),n=!!this.internalContext.getIf(Z).value,r=this.getContainerForms(t).filter((e=>this.isInExecuteOrRender(e)));this.appendViewStateToForms(r,n,e.value,t.orElse("").value)}))}fixClientWindow(){Dt(this.internalContext.getIf(pt).orElse({}).value).forEach((([,e])=>{const t=this.internalContext.getIf(te),n=!!this.internalContext.getIf(Z).value,r=this.getContainerForms(t).filter((e=>this.isInExecuteOrRender(e)));this.appendClientWindowToForms(r,n,e.value,t.orElse("").value)}))}updateNamedViewRootState(){let e=this.internalContext.getIf(te),t=this.internalContext.getIf(Z);if(e.isPresent()&&(t.isAbsent()||!t.value)){const t=mt().separatorchar;this.internalContext.assign(Z).value=!!document.getElementById(e.value)||W(`input[name*='${gt(re)}']`).filter((n=>0==n.attr("name").value.indexOf(e.value+t))).length>0}}done(){const e=Ct.createFromRequest(this.request.value,this.internalContext,this.externalContext,"success"),t=this.externalContext.getIf(Ee).orElseLazy((()=>this.internalContext.getIf(Ee).value)).orElse(ie).value;Kt.sendEvent(e,t)}appendViewStateToForms(e,t,n,r=""){this.assignState(e,gt(Qe),t,n,r)}appendClientWindowToForms(e,t,n,r=""){this.assignState(e,gt(Je),t,n,r)}assignState(e,t,n,r,s){e.each((e=>{e.querySelectorAll(t).orElseLazy((()=>(e=>new Pt(t).withNamingContainerId(s).withParent(e).withNamedViewRoot(n).build())(e))).val=r}))}storeForPostProcessing(e,t){this.storeForUpdate(e),this.storeForEval(t)}storeForUpdate(e){this.internalContext.assign(ct).value.push(e)}storeForEval(e){this.internalContext.assign(ht).value.push(e)}static isViewStateNode(e){var t,n,r,s,i,l;const o=mt().separatorchar;return void 0!==(null===(t=null==e?void 0:e.id)||void 0===t?void 0:t.value)&&((null===(n=null==e?void 0:e.id)||void 0===n?void 0:n.value)==gt(re)||-1!=(null===(s=null===(r=null==e?void 0:e.id)||void 0===r?void 0:r.value)||void 0===s?void 0:s.indexOf([o,gt(re)].join(le)))||-1!=(null===(l=null===(i=null==e?void 0:e.id)||void 0===i?void 0:i.value)||void 0===l?void 0:l.indexOf([gt(re),o].join(le))))}static isClientWindowNode(e){var t,n,r,s,i,l;const o=mt().separatorchar;return void 0!==(null===(t=null==e?void 0:e.id)||void 0===t?void 0:t.value)&&((null===(n=null==e?void 0:e.id)||void 0===n?void 0:n.value)==gt(se)||-1!=(null===(s=null===(r=null==e?void 0:e.id)||void 0===r?void 0:r.value)||void 0===s?void 0:s.indexOf([o,gt(se)].join(le)))||-1!=(null===(l=null===(i=null==e?void 0:e.id)||void 0===i?void 0:i.value)||void 0===l?void 0:l.indexOf([gt(se),o].join(le))))}triggerOnError(e){this.externalContext.getIf(ye).orElseLazy((()=>this.internalContext.getIf(ye).value)).orElse(ie).value(e)}isInExecuteOrRender(e){const t=this.externalContext.getIf(gt(de)).orElse("@none").value.split(/\s+/gi),n=this.externalContext.getIf(fe).orElseLazy((()=>this.externalContext.getIf(gt(ve)).value)).orElse(ce).value.split(/\s+/gi);return[...t.concat(...n)].filter((t=>{if(-1!=[ue,ce].indexOf(t))return!0;const n=this.getNameOrIdSelector(t);return e.matchesSelector(n)||e.querySelectorAll(n).isPresent()||e.firstParent(n).isPresent()})).length>0}getContainerForms(e){return e.isPresent()?W(this.getNameOrIdSelector(e.value)).orElseLazy((()=>z.byTagName(Ge))).byTagName(Xe,!0):z.byTagName(Xe)}getNameOrIdSelector(e){return`[id='${e}'], [name='${e}']`}}var qt;!function(e){e.processResponse=function(e,n){let r=St.fromNullable(e),{externalContext:s,internalContext:i}=function(e){let t=St.fromNullable(e),n=t.getIf(Oe);return n.isPresent()||(n=St.fromNullable({})),n.assign(dt).value=[],n.assign(ct).value=[],n.assign(ht).value=[],{externalContext:t,internalContext:n}}(n),l=function(e){let t=new Q(gt(e.getIf("responseXML").value));return It.assertValidXMLResponse(t),t}(r),o=new Lt(r,s,i);i.assign(xe).value=l,l.querySelectorAll(Ye).each((e=>function(e,n,r){var s;let i=null===(s=null==e?void 0:e.id)||void 0===s?void 0:s.value;r.assignIf(!!i,te).value=i,n.updateNamedViewRootState();const l=[st,ot,Ze].join(",");e.querySelectorAll(l).each((e=>{switch(e.tagName.value){case st:n.error(e);break;case ot:n.redirect(e);break;case Ze:!function(e,n){const r=[et,rt,nt,tt,it,lt].join(", ");e.querySelectorAll(r).each((e=>{switch(e.tagName.value){case et:!function(e,t){(function(e,t){return e.processViewState(t)||e.processClientWindow(t)})(t,e)||function(e,t){let n=e.cDATAAsString;switch(e.id.value){case gt("jakarta.faces.ViewRoot"):t.replaceViewRoot(z.fromMarkup(n.substring(n.indexOf("<html"))));break;case gt("jakarta.faces.ViewHead"):t.replaceHead(z.fromMarkup(n));break;case gt("jakarta.faces.ViewBody"):t.replaceBody(z.fromMarkup(n));break;case gt("jakarta.faces.Resource"):t.addToHead(z.fromMarkup(n));break;default:t.update(e,n)}}(e,t)}(e,n);break;case rt:n.eval(e);break;case nt:t(n,e);break;case tt:n.delete(e);break;case it:n.attributes(e)}}))}(e,n)}}))}(e,o,i))),o.updateNamedViewRootState(),o.fixViewStates(),o.fixClientWindow(),o.globalEval(),o.done()};let t=function(e,t){t.querySelectorAll([at,ut].join(",")).length?e.insertWithSubTags(t):e.insert(t)}}(qt||(qt={}));class Ft{constructor(){this.catchFunctions=[],this.thenFunctions=[]}resolve(e){this.thenFunctions.reduce(((e,t)=>t(e)),e)}reject(e){this.catchFunctions.reduce(((e,t)=>t(e)),e)}catch(e){return this.catchFunctions.push(e),this}finally(e){return this.catchFunctions.push(e),this.thenFunctions.push(e),this}then(e){return this.thenFunctions.push(e),this}}function Ht(e,t=(e,t)=>[e,t],n=""){if(e.isAbsent())return n;const r=e.value;return new a(...Object.keys(r)).filter((e=>r.hasOwnProperty(e))).flatMap((e=>r[e].map((n=>t(e,n))))).filter((([,e])=>!(e instanceof At.global().File))).map((e=>`${encodeURIComponent(e[0])}=${encodeURIComponent(e[1])}`)).join("&")}function Vt(e){var t,n;return e.length<3?[null!==(t=null==e?void 0:e[0])&&void 0!==t?t:[],null!==(n=null==e?void 0:e[1])&&void 0!==n?n:[]]:e}const $t=Nt.ofAssoc,Bt=(e,t)=>[e,t];class Ut extends _{constructor(e,t=Bt,n,r){super({}),this.paramsMapper=t,this.isMultipartRequest=!1,this.initFormData(e,n,r)}toFormData(){return this.buildFormData()}toString(e=""){return Ht(this,this.paramsMapper,e)}initFormData(e,t,n){this.detectMultipartRequest(e,t),this.encodeSubmittableFields(e,n),this.applyViewState(e)}detectMultipartRequest(e,t){t&&!t.includes(ce)&&(this.isMultipartRequest=e.isMultipartCandidate(!0))}applyViewState(e){if(this.getIf(gt(re)).isPresent())return;const t=e.querySelectorAllDeep(`[name*='${gt(re)}'`),n=t.inputValue;this.appendIf(n.isPresent(),this.remapKeyForNamingContainer(t.name.value)).value=n.value}encodeSubmittableFields(e,t=[]){const n=t.map((e=>this.remapKeyForNamingContainer(e)));(function(e){const t=function(e){return mt().getViewState(e.getAsElem(0).value).split("&").filter((e=>!!(e||"").replace(/\s+/g,""))).map((e=>{let t=decodeURIComponent(e),n=t.indexOf("=");return-1===n?[t]:[t.substring(0,n),t.substring(n+1)]}))}(e),n=e.querySelectorAllDeep("input[type='file']").asArray.map((e=>[e.name.value||e.id.value,e.filesFromElem(0)])).flatMap((([e,t])=>[...t].map((t=>[e,t]))));return t.concat(n)})(e).map(Vt).map((([e,t])=>this.paramsMapper(e,t))).filter((([e])=>this.isFieldIncluded(e,n))).forEach((([e,t])=>this.append(e).value=t))}isFieldIncluded(e,t){return!(t.length&&!e.startsWith("@"))||t.includes(e)}buildFormData(){return $t(this.value).flatMap((([e,t])=>Array.isArray(t)?new a(...t).map((t=>({key:e,value:t}))):[{key:e,value:t}])).map((({key:e,value:t})=>({key:this.remapKeyForNamingContainer(e),value:t}))).reduce(((e,{key:t,value:n})=>(e.append(t,n),e)),new FormData)}remapKeyForNamingContainer(e){const[t]=this.paramsMapper(e,le);return t}}const zt=Nt.failSaveExecute;class Wt extends Ft{constructor(e,t,n=0,r=ze,s="application/x-www-form-urlencoded"){super(),this.requestContext=e,this.internalContext=t,this.timeout=n,this.ajaxType=r,this.contentType=s,this.ERR_INVALID_RESPONSE="Invalid Response",this.ERR_EMPTY_RESPONSE="Empty Response",this.stopProgress=!1,this.xhrObject=new XMLHttpRequest,this.registerXhrCallbacks((e=>this.resolve(e)),(e=>this.reject(e)))}start(){const e=zt,t=this.xhrObject,n=z.byId(this.internalContext.getIf(Me).value);try{const r=this.requestContext.getIf($e,de).get(ce).value.split(/\s+/gi),s=!0===this.internalContext.getIf(Be).value?r:[],i=new Ut(n,_t(this.internalContext),r,s);this.requestContext.$nspEnabled=!1;const l=this.requestContext,o=l.getIf($e);o.$nspEnabled=!1;try{i.shallowMerge(o,!0,!0)}finally{this.requestContext.$nspEnabled=!0,o.$nspEnabled=!0}this.appendIssuingItem(i),this.responseContext=o.deepCopy;const a=this.responseContext;a.assign(Oe).value=this.internalContext.value,a.assign(Ee).value=l.getIf(Ee).value,a.assign(ye).value=l.getIf(ye).value,t.open(this.ajaxType,function(e,t,n=ze){return function(e){const t=e.elements;return void 0===t[Ue]?e.action:t[Ue].value}(e.getAsElem(0).value)+("GET"==n?"?"+t.toString():le)}(n,i,this.ajaxType),!0),this.timeout&&(t.timeout=this.timeout),i.isMultipartRequest||e((()=>t.setRequestHeader("Content-Type",`${this.contentType}; charset=utf-8`))),e((()=>t.setRequestHeader("Faces-Request","partial/ajax"))),e((()=>t.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"))),this.sendEvent(we),this.sendRequest(i)}catch(e){throw this.handleErrorAndClearQueue(e),e}return this}cancel(){try{this.xhrObject.abort()}catch(e){this.handleError(e)}}registerXhrCallbacks(e,t){const n=this.xhrObject;n.onabort=()=>{this.onAbort(e,t)},n.ontimeout=()=>{this.onTimeout(e,t)},n.onload=()=>{this.onResponseReceived(e)},n.onloadend=()=>{this.onResponseProcessed(this.xhrObject,e)},this.registerUploadCallbacks(n),n.onerror=e=>{if(this.isCancelledResponse(this.xhrObject))return this.stopProgress=!0,void t();this.stopProgress||this.handleError(e)}}registerUploadCallbacks(e){var t,n;(null==e?void 0:e.upload)&&(null===(n=(t=this.internalContext.getIf(Pe)).value)||void 0===n||n.call(t,e.upload),e.upload.addEventListener("progress",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(ke)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("load",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(Le)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("loadstart",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(je)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("loadend",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(De)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("abort",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(Fe)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("timeout",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(He)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("error",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(qe)).value)||void 0===r||r.call(n,e.upload,t)})))}isCancelledResponse(e){return 0===(null==e?void 0:e.status)&&4===(null==e?void 0:e.readyState)&&""===(null==e?void 0:e.responseText)&&null===(null==e?void 0:e.responseXML)}onAbort(e,t){this.handleHttpError(t)}onTimeout(e,t){this.sendEvent("TIMEOUT_EVENT"),this.handleHttpError(e)}onResponseReceived(e){var t;this.sendEvent("complete"),this.processRequestErrors(e)||mt().ajax.response(this.xhrObject,null!==(t=this.responseContext.value)&&void 0!==t?t:{})}processRequestErrors(e){var t,n,r,s,i;const l=new Q(null===(t=this.xhrObject)||void 0===t?void 0:t.responseXML),o=null!==(r=null===(n=this.xhrObject)||void 0===n?void 0:n.responseText)&&void 0!==r?r:"",a=null!==(i=null===(s=this.xhrObject)||void 0===s?void 0:s.status)&&void 0!==i?i:-1;return a>=300||a<200?(this.handleHttpError(e),!0):l.isXMLParserError()||l.isAbsent()&&o.trim().length>0?(this.handleGenericResponseError(this.ERR_INVALID_RESPONSE,"The response xml is invalid",Ne,e),!0):!!l.isAbsent()&&(this.handleGenericResponseError(this.ERR_EMPTY_RESPONSE,"The response has provided no data",Re,e),!0)}handleGenericResponseError(e,t,n,r){var s,i,l,o;const a=new Mt(this.internalContext.getIf(Ve).value,e,t,null!==(i=null===(s=this.xhrObject)||void 0===s?void 0:s.responseText)&&void 0!==i?i:"",null!==(o=null===(l=this.xhrObject)||void 0===l?void 0:l.responseXML)&&void 0!==o?o:null,this.xhrObject.status,n);this.finalizeError(a,r)}handleHttpError(e,t="Generic HTTP Error"){var n,r,s,i,l,o;this.stopProgress=!0;const a=new Mt(this.internalContext.getIf(Ve).value,_e,t,null!==(r=null===(n=this.xhrObject)||void 0===n?void 0:n.responseText)&&void 0!==r?r:"",null!==(i=null===(s=this.xhrObject)||void 0===s?void 0:s.responseXML)&&void 0!==i?i:null,null!==(o=null===(l=this.xhrObject)||void 0===l?void 0:l.status)&&void 0!==o?o:-1,_e);this.finalizeError(a,e)}finalizeError(e,t){try{this.handleError(e,!0)}finally{t(e),this.stopProgress=!0}}onResponseProcessed(e,t){this.stopProgress||t(e)}sendRequest(e){"GET"!==this.ajaxType?this.xhrObject.send(e.isMultipartRequest?e.toFormData():e.toString()):this.xhrObject.send(null)}sendEvent(e){var t;const n=Ct.createFromRequest(this.xhrObject,this.internalContext,this.requestContext,e);try{const e=xt(this.requestContext,this.responseContext,Ee);Kt.sendEvent(n,e)}catch(e){throw e.source=null!==(t=null==e?void 0:e.source)&&void 0!==t?t:this.requestContext.getIf(be).value,this.handleErrorAndClearQueue(e),e}}handleErrorAndClearQueue(e,t=!1){this.handleError(e,t),this.reject(e)}handleError(e,t=!1){var n;const r=t?Mt.fromHttpConnection(e.source,e.type,null!==(n=e.message)&&void 0!==n?n:le,e.responseText,e.responseXML,e.responseCode,e.status):Mt.fromClient(e),s=xt(this.requestContext,this.responseContext,ye);Kt.sendError(r,s)}appendIssuingItem(e){var t,n;const r=this.internalContext.getIf(Ve).value,s=null!==(n=null===(t=e.getIf(gt(me)).value)||void 0===t?void 0:t[0])&&void 0!==n?n:null,i=!!s&&"click"!==s;if(r&&e.getIf(r).isAbsent()&&!i){const t=z.byId(r),n=t.inputValue,s=new St({}),i=t.type.orElse("").value.toLowerCase(),l=i===Wt.TYPE_CHECKBOX||i===Wt.TYPE_RADIO;if(l&&!t.checked)return;l?s.assign(r).value=n.orElse(!0).value:n.isPresent()&&(s.assign(r).value=n.value),e.shallowMerge(s,!0,!0)}}}Wt.TYPE_CHECKBOX="checkbox",Wt.TYPE_RADIO="radio";const Xt=Nt.debounce;class Gt{constructor(){this.queue=[],this.taskRunning=!1,this.debounceKey="xhrQueue_"+Gt.instanceCount++}enqueue(e,t=0){Xt(this.debounceKey,(()=>{const t=this.enrichRunnable(e);this.taskRunning?this.queue.push(t):(this.signalTaskRunning(),t.start())}),t)}next(){this.updateTaskRunning();const e=this.queue.shift();null==e||e.start()}clear(){this.queue.length=0,this.updateTaskRunning()}get isEmpty(){return!this.queue.length}enrichRunnable(e){return e.then((()=>this.next())).catch((()=>this.clear()))}signalTaskRunning(){this.taskRunning=!0}updateTaskRunning(){this.taskRunning=!this.isEmpty}}var Qt,Jt,Kt,Yt,Zt,en,tn;Gt.instanceCount=0,function(e){e.Production="Production",e.Development="Development",e.SystemTest="SystemTest",e.UnitTest="UnitTest"}(Qt||(Qt={})),function(e){e.onerror="onerror",e.onevent="onevent",e.render="render",e.execute="execute",e.myfaces="myfaces",e.delay="delay",e.timeout="timeout",e.resetValues="resetValues",e.windowId="windowId",e.params="params"}(Jt||(Jt={})),function(e){const t=o.trim,n=Nt.getMessage,r=Nt.getGlobalConfig;var s=It.assert;const i=Nt.ofAssoc,l=Nt.collectAssoc;let a=null,u=null,c=[],d=[];function v(){const e=At.searchJsfJsFor(/stage=([^&;]*)/).value;return e in Qt?e:Qt.Production}function f(e,t=function(e){}){t(e),d.forEach((t=>{t(e)})),r("defaultErrorOutput",console?console.error:alert)(e)}function p(e,t){const n=function(e){const t=e.querySelectorAll(`input[type='hidden'][name*='${gt(re)}']`).attr("name").orElse("").value,n=mt().separatorchar,r=t.split(n,2)[0];return-1===r.indexOf(gt(re))?r:""}(t);n&&(e.assign(Z).value=!0,e.assign(te).value=n)}function m(e,n,r,s,i,l=""){const o=mt().separatorchar;let a=r?t(r).split(/\s+/gi):[],u=[],c={};const h=e=>{const t=l.length?l+o:le;let n=s.id.value;const r=n.substring(0,n.lastIndexOf(o)),i=r.length?r+o:le,a=0===e.indexOf(o);let u;return a||l.length&&0==e.indexOf(t)?u=[t,e=0==(e=a?e.substring(1):e).indexOf(t)?e.substring(t.length):e].join(le):(0==n.indexOf(t)&&(n=n.substring(t.length)),u=0==e.indexOf(n)?[t,e].join(le):[i,e].join(le)),z.byId(u).isPresent()?u:e};for(let t=0;t<a.length;t++)if(!(a[t]in c))switch(a[t]){case ce:return e.delete(n);case ue:return e.assign(n).value=ue,e;case"@form":u.push(h(s.id.value)),c[s.id.value]=!0;break;case he:i in c||(u.push(h(i)),c[i]=!0);break;default:u.push(h(a[t])),c[a[t]]=!0}return e.assign(n).value=u.join(" "),e}function g(){var e,t;return null!==(t=null===(e=null===window||void 0===window?void 0:window[vt])||void 0===e?void 0:e.config)&&void 0!==t?t:{}}e.requestQueue=null,e.getSeparatorChar=function(){var e,t;return null!==(t=null===(e=g())||void 0===e?void 0:e.separator)&&void 0!==t?t:null!=u?u:u=At.searchJsfJsFor(/separator=([^&;]*)/).orElse(":").value},e.reset=function(){a=null,u=null,c=[],d=[],e.requestQueue=null},e.getProjectStage=function(){var e,t;return null!==(t=null===(e=g())||void 0===e?void 0:e.projectStage)&&void 0!==t?t:null!=a?a:a=v()},e.resolveProjectStateFromURL=v,e.chain=function(e,n,...r){let s=!0;return r.every((r=>{let i=function(e,n,r){if("string"!=typeof r)return!1!==r.call(e,n);{let s=t(r);return 0==s.indexOf("function ")&&(s=`return ${s} (event)`),!1!==new Function("event",s).call(e,n)}}(e,n,r);return!1===i&&(s=!1),s})),s},e.request=function(t,n,r){var s,o,a,u,c,h,d,v,f,g,y,E,w,b,A,S,x,R,N,I,C,T,O,M,k,P,j,D,L;const{options:q,elem:F,elementId:H,windowId:V,isResetValues:$}=function(e,t,n=null){var r;const s=z.byId(n||e.target,!0),i=new St(t).deepCopy;return{options:i,elem:s,elementId:s.id.value,windowId:Rt(i),isResetValues:!0===(null===(r=i.value)||void 0===r?void 0:r.resetValues)}}(n,r,t),B=new St({}),U=new St({});It.assertRequestIntegrity(q,F);const W=function(e,t){return Nt.getForm(e.getAsElem(0).value,t)}(F,n),X=function(e){const t=e.querySelectorAll(`input[type='hidden'][name*='${gt(re)}']`).id.orElse("").value,n=mt().separatorchar,r=t.split(n,2)[0],s=-1===r.indexOf(gt(re))?r:"";return 0===e.id.value.indexOf(s)?s:""}(W),G=W.id.value,Q=function(e){let t=e.getIf("delay").orElse(0).value;return t="none"===t?0:t,It.assertDelay(t),t}(q),J=function(e){var t;let n=Nt.getLocalOrGlobalConfig;return null!==(t=e.getIf(Ce).value)&&void 0!==t?t:n(e.value,Ce,0)}(q);var K;B.assignIf(!!V,pe).value=V,B.assign($e).value=(K=q.value,i(K).filter((e=>!(e[0]in Jt))).reduce(l,{}));const Y=(Z=q.getIf(Ie).orElse({}).value,Array.isArray(Z)?Z.reduce(l,{}):Z);var Z;let te=B.getIf($e);var ie,le,oe,ae;te.$nspEnabled=!1,te.shallowMerge(new _(Y),!0),te.$nspEnabled=!0,B.assignIf(!!n,$e,"jakarta.faces.partial.event").value=null==n?void 0:n.type,B.assign(be).value=H,B.assign(ne).value=X,B.assign(Ee).value=null===(s=q.value)||void 0===s?void 0:s.onevent,B.assign(ye).value=null===(o=q.value)||void 0===o?void 0:o.onerror,B.assign(vt).value=null===(a=q.value)||void 0===a?void 0:a.myfaces,B.assign($e,ee).value=H,B.assign($e,"jakarta.faces.partial.ajax").value=!0,B.assignIf($,$e,"jakarta.faces.partial.resetValues").value=!0,U.assign(Me).value=G,U.assign(Pe).value=null===(h=null===(c=null===(u=q.value)||void 0===u?void 0:u.myfaces)||void 0===c?void 0:c.upload)||void 0===h?void 0:h.preinit,U.assign(je).value=null===(f=null===(v=null===(d=q.value)||void 0===d?void 0:d.myfaces)||void 0===v?void 0:v.upload)||void 0===f?void 0:f.loadstart,U.assign(ke).value=null===(E=null===(y=null===(g=q.value)||void 0===g?void 0:g.myfaces)||void 0===y?void 0:y.upload)||void 0===E?void 0:E.progress,U.assign(De).value=null===(A=null===(b=null===(w=q.value)||void 0===w?void 0:w.myfaces)||void 0===b?void 0:b.upload)||void 0===A?void 0:A.loadend,U.assign(Le).value=null===(R=null===(x=null===(S=q.value)||void 0===S?void 0:S.myfaces)||void 0===x?void 0:x.upload)||void 0===R?void 0:R.load,U.assign(qe).value=null===(C=null===(I=null===(N=q.value)||void 0===N?void 0:N.myfaces)||void 0===I?void 0:I.upload)||void 0===C?void 0:C.error,U.assign(Fe).value=null===(M=null===(O=null===(T=q.value)||void 0===T?void 0:T.myfaces)||void 0===O?void 0:O.upload)||void 0===M?void 0:M.abort,U.assign(He).value=null===(j=null===(P=null===(k=q.value)||void 0===k?void 0:k.myfaces)||void 0===P?void 0:P.upload)||void 0===j?void 0:j.timeout,B.assign($e,G).value=G,U.assign(Ve).value=H,U.assign(Be).value=null!==(L=null===(D=function(e){var t;return null===(t=i(e).filter((e=>"myfaces"==e[0])).reduce(l,{}))||void 0===t?void 0:t[vt]}(q.value))||void 0===D?void 0:D.pps)&&void 0!==L&&L,function(e,t){let n=mt().getClientWindow(e.getAsElem(0).value);n&&(t.assign($e,se).value=n)}(W,B),le=B,oe=W,ae=H,(ie=q).getIf(Te).isPresent()?(ie.assign(Te).value=[ie.getIf(Te).value,he].join(" "),m(le.getIf($e).get({}),de,ie.getIf(Te).value,oe,ae,le.getIf(ne).value)):le.assign($e,de).value=ae,function(e,t,n,r){e.getIf(ge).isPresent()&&m(t.getIf($e).get({}),ve,e.getIf(ge).value,n,r,t.getIf(ne).value)}(q,B,W,H),p(U,W),e.queueHandler.addRequestToQueue(F,W,B,U,Q,J)},e.response=function(e,t){qt.processResponse(e,t)},e.addOnError=function(e){d.push(e)},e.addOnEvent=function(e){c.push(e)},e.sendEvent=function(e,t=function(e){}){t(e),c.forEach((t=>t(e)))},e.stdErrorHandler=function(t,n,r,s=!1){try{f(Mt.fromClient(r))}finally{s&&(null===e.requestQueue||void 0===e.requestQueue||e.requestQueue.clear())}},e.sendError=f,e.getClientWindow=function(e){const t="___mf_id_altered__",n="___init____";let r=e?z.byId(e):W("form"),i=r.filterSelector(`input[name='${gt(se)}']`).orElseLazy((()=>r.querySelectorAll(`input[name='${gt(se)}']`))).asArray.map((e=>e.val)).reduce(((e,r)=>e==n?r:e==t||e!=r?t:r),n);return s(t!=i,"Multiple different windowIds found in document"),i!=n?i:(function(){const e=window.location.href,t=new RegExp("[\\?&]jfwid=([^&#\\;]*)").exec(e);return null!=t?h.fromNullable(t[1]):h.fromNullable(null)}()||At.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null)).value},e.getViewState=function(e){let t=z.byId(e,!0);if(!t.isTag(Xe))throw new Error(n("ERR_VIEWSTATE"));const r=new _({});p(r,z.byId(e));let s=t.deepElements.encodeFormElement();return Ht(new St(s),_t(r))},e.queueHandler={addRequestToQueue:function(t,n,r,s,i=0,l=0){e.requestQueue=null!==e.requestQueue&&void 0!==e.requestQueue?e.requestQueue:new Gt,e.requestQueue.enqueue(new Wt(r,s,l),i)}}}(Kt||(Kt={})),function(e){const t=z.global().location.protocol.replace("http","ws")+"//";e.sockets={},e.components={},e.clientIdsByTokens={},e.reset=function(){Object.values(e.sockets).forEach((e=>{try{e.close()}catch(e){}})),e.sockets={},e.components={},e.clientIdsByTokens={}},e.init=function(r,i,l,o,a,u,c,h,d){var v,f,p;if(c=s(c),!z.global().WebSocket)return void c(-1,l);let m=i.substr(i.indexOf("?")+1);e.components[r]||(e.components[r]={channelToken:m,onopen:s(o),onmessage:s(a),onerror:s(u),onclose:c,behaviors:h,autoconnect:d},e.clientIdsByTokens[m]||(e.clientIdsByTokens[m]=[]),e.clientIdsByTokens[m].push(r),e.sockets[m]||(e.sockets[m]=new n(m,function(e){if(e.indexOf("://")<0){let n=z.global().location.hostname+":"+z.global().location.port;return t+n+e}return e}(i),l))),d&&(null!==(f=null===(v=z.global())||void 0===v?void 0:v.faces)&&void 0!==f?f:null===(p=z.global())||void 0===p?void 0:p.jsf).push.open(r)},e.open=function(t){var n;r(null===(n=e.components[t])||void 0===n?void 0:n.channelToken).open()},e.close=function(t){r(e.components[t].channelToken).close()};class n{constructor(e,t,n){this.channelToken=e,this.url=t,this.channel=n,this.socket=null,this.reconnectAttempts=0,this.hasEverConnected=!1,this.hasNotifiedInitialOpenAttempt=!1}open(){this.socket&&1===this.socket.readyState||(this.socket=new WebSocket(this.url),this.bindCallbacks(),this.notifyInitialOpenAttempt())}onopen(e){this.hasEverConnected=!0,this.reconnectAttempts=0}onerror(e){}onmessage(t){var n,r,s;let i=JSON.parse(t.data),l=e.clientIdsByTokens[this.channelToken];if(l){for(let o=l.length-1;o>=0;o--){let a=l[o];if(document.getElementById(a)){try{null===(r=null===(n=e.components[a])||void 0===n?void 0:n.onmessage)||void 0===r||r.call(n,i,this.channel,t)}catch(e){}let l=null===(s=null===e.components||void 0===e.components?void 0:e.components[a])||void 0===s?void 0:s.behaviors,o=null==l?void 0:l[i];if(o&&o.length)for(let e=0;e<o.length;e++)try{o[e](null)}catch(e){}}else l.splice(o,1)}0===l.length&&this.close()}}onclose(e){if(this.isTerminalClose(e))return this.notifyClose(e),void this.resetConnectionState();this.notifyErrorAndPruneMissingComponents(e)&&(this.closeIfChannelHasNoComponents()||this.scheduleReconnect())}close(){if(this.socket){let e=this.socket;this.socket=null,e.close()}}notifyInitialOpenAttempt(){var t,n;if(this.reconnectAttempts||this.hasNotifiedInitialOpenAttempt)return;this.hasNotifiedInitialOpenAttempt=!0;let r=e.clientIdsByTokens[this.channelToken];if(r)for(let s=r.length-1;s>=0;s--){let i=r[s];null===(n=null===(t=e.components[i])||void 0===t?void 0:t.onopen)||void 0===n||n.call(t,this.channel)}}isTerminalClose(e){return!this.socket||!this.hasEverConnected||1e3===e.code||1008===e.code||this.reconnectAttempts>=25}notifyClose(t){var n,r;let s=e.clientIdsByTokens[this.channelToken];if(s)for(let i=s.length-1;i>=0;i--){let l=s[i];null===(r=null===(n=null===e.components||void 0===e.components?void 0:e.components[l])||void 0===n?void 0:n.onclose)||void 0===r||r.call(n,null==t?void 0:t.code,null==this?void 0:this.channel,t)}}resetConnectionState(){this.reconnectAttempts=0,this.hasEverConnected=!1,this.hasNotifiedInitialOpenAttempt=!1}notifyErrorAndPruneMissingComponents(t){var n,r;let s=e.clientIdsByTokens[this.channelToken];if(!s)return!1;for(let i=s.length-1;i>=0;i--){let l=s[i];if(document.getElementById(l))try{null===(r=null===(n=null===e.components||void 0===e.components?void 0:e.components[l])||void 0===n?void 0:n.onerror)||void 0===r||r.call(n,null==t?void 0:t.code,null==this?void 0:this.channel,t)}catch(e){}else s.splice(i,1)}return!0}closeIfChannelHasNoComponents(){var t;return 0===(null===(t=e.clientIdsByTokens[this.channelToken])||void 0===t?void 0:t.length)&&(this.close(),!0)}scheduleReconnect(){const e=++this.reconnectAttempts;this.socket=null,setTimeout((()=>this.open()),500*e)}bindCallbacks(){this.socket.onopen=e=>this.onopen(e),this.socket.onmessage=e=>this.onmessage(e),this.socket.onclose=e=>this.onclose(e),this.socket.onerror=e=>this.onerror(e)}}function r(t){let n=e.sockets[t];if(n)return n;throw new Error("Unknown channelToken: "+t)}function s(e){return"function"==typeof e?e:"string"==typeof e&&"function"==typeof z.global()[e]?z.global()[e]:()=>{}}}(Yt||(Yt={})),function(e){const t=Nt.ofAssoc;e.setHiddenInput=function(e,t,n){const r=document.forms;z.byId(r[e]).each((e=>{const r=e.querySelectorAll(`input[type='hidden'][name='${t}']`);if(r.isPresent())r.inputValue.value=n;else{const r=z.fromMarkup(`<input type='hidden' id='${t}' name='${t}'>`);r.inputValue.value=n,r.appendTo(e)}}))},e.clearHiddenInput=function(e,t){var n;const r=document.forms,s=null===(n=null==r?void 0:r[e])||void 0===n?void 0:n.elements;let i=null==s?void 0:s[t];i&&z.byId(i).delete()},e.submitForm=function(e,n=null,r=null,s={}){var i,l,o,a,u;s=s||{};let c="clearFormHiddenParams_"+e.replace(/-/g,"$:").replace(/:/g,"_");null===(i=null===window||void 0===window?void 0:window[c])||void 0===i||i.call(window,e),(null===(a=null===(o=null===(l=null===window||void 0===window?void 0:window.myfaces)||void 0===l?void 0:l.core)||void 0===o?void 0:o.config)||void 0===a?void 0:a.autoScroll)&&(null===window||void 0===window?void 0:window.getScrolling)&&myfaces.oam.setHiddenInput(e,"autoScroll",null===window||void 0===window?void 0:window.getScrolling());let h=Array.isArray(s)?[...s]:t(s);h.forEach((([t,n])=>myfaces.oam.setHiddenInput(e,t,n))),myfaces.oam.setHiddenInput(e,`${e}:_idcl`,null!=n?n:"");const d=document.forms;return z.byId(null!==(u=null==d?void 0:d[e])&&void 0!==u?u:document.getElementById(e)).each((t=>{var n;const s=t.getAsElem(0).value,i=t.getAsElem(0).value.getAttribute("target");"null"!=r&&r&&t.getAsElem(0).value.setAttribute("target",r);const l=null===(n=null==s?void 0:s.onsubmit)||void 0===n?void 0:n.call(s,null);try{(l||void 0===l)&&s.submit()}catch(e){null===window||void 0===window||window.console.error(e)}finally{null==i||"null"==i?t.getAsElem(0).value.removeAttribute("target"):t.getAsElem(0).value.setAttribute("target",i),h.forEach((([t,n])=>{myfaces.oam.clearHiddenInput(e,t)})),myfaces.oam.clearHiddenInput(e,`${e}:_idcl`)}})),!1}}(Zt||(Zt={})),function(e){let t,n,r;e.specversion=4e5,e.implversion=0,e.separatorchar=function(){const e="#{facesContext.namingContainerSeparatorChar}";return e.match(/\#\{facesContext.namingContainerSeparatorChar\}/gi)?Kt.getSeparatorChar():e}(),e.contextpath="#{facesContext.externalContext.requestContextPath}",e.getProjectStage=function(){return Kt.getProjectStage()},e.getViewState=function(e){return Kt.getViewState(e)},e.getClientWindow=function(e){return Kt.getClientWindow(e)},function(e){e.request=function(e,t,n){Kt.request(e,t,n)},e.response=function(e,t){Kt.response(e,t)},e.addOnError=function(e){Kt.addOnError(e)},e.addOnEvent=function(e){Kt.addOnEvent(e)}}(t=e.ajax||(e.ajax={})),function(e){e.chain=function(e,t,...n){return Kt.chain(e,null!=t?t:null,...n)}}(n=e.util||(e.util={})),function(e){e.init=function(e,t,n,r,s,i,l,o,a){Yt.init(e,t,n,r,s,i,l,o,a)},e.open=function(e){Yt.open(e)},e.close=function(e){Yt.close(e)}}(r=e.push||(e.push={}))}(en||(en={})),function(e){e.ab=function(e,t,n,r,s,i={},l={}){var o,a;i||(i={}),l||(l={}),n&&(i[Ie]=null!==(o=null==i?void 0:i[Ie])&&void 0!==o?o:{},i[Ie][gt(me)]=n),r&&(i[Te]=r),s&&(i[ge]=s),i.params||(i.params={});for(let e in l)i.params[e]=l[e];(null!==(a=null===window||void 0===window?void 0:window.faces)&&void 0!==a?a:window.jsf).ajax.request(e,t,i)};const t=[];let n=null;e.onDomReady=function(e){"complete"!==document.readyState?(t.push(e),n||(n=()=>{window.removeEventListener("DOMContentLoaded",n),n=null;try{t.forEach((e=>e()))}finally{t.length=0}},window.addEventListener("DOMContentLoaded",n))):(n&&n(),e())},e.reserveNamespace=function(e){let t=window;const n=e.split(".");for(const e of n)t[e]=t[e]||{},t=t[e]},e.oam=Zt}(tn||(tn={}))}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r,s,i,l={};if(n.r(l),n.d(l,{faces:()=>o,myfaces:()=>a}),!window.faces){const e=n(563).J;window.faces=null!==(r=null===window||void 0===window?void 0:window.faces)&&void 0!==r?r:e}if(!(null===(s=null===window||void 0===window?void 0:window.myfaces)||void 0===s?void 0:s.ab)){const e=n(563).$;window.myfaces=null!==(i=null===window||void 0===window?void 0:window.myfaces)&&void 0!==i?i:{},Object.keys(e).forEach((t=>{var n,r;return window.myfaces[t]=null!==(r=null===(n=window.myfaces)||void 0===n?void 0:n[t])&&void 0!==r?r:e[t]}))}var o=window.faces,a=window.myfaces,u=window;for(var c in l)u[c]=l[c];l.__esModule&&Object.defineProperty(u,"__esModule",{value:!0})})();
|
|
2
|
+
(()=>{"use strict";var e={563(e,t,n){n.d(t,{J:()=>en,$:()=>tn});const r=3e4;function s(e,t){for(let n=0,s=t.length;n<s;n+=r)Array.prototype.push.apply(e,Array.prototype.slice.call(t,n,n+r));return e}class i extends Array{constructor(e=[]){super(),(e=Array.isArray(e)?e:[e])._another?this._another=e._another:this._another=e,s(this,e),this.flatMap=e=>this._flatMap(e),this.flat=(e=1)=>this._flat(e)}map(e,t){return l(Array.prototype.map.call(this._another,e,t))}concat(...e){return l(Array.prototype.concat.apply(this._another,e))}reverse(){return l(Array.prototype.reverse.call(this._another))}slice(e,t){return l(Array.prototype.slice.call(this._another,e,t))}splice(e,t){return l(Array.prototype.splice.call(this._another,e,null!=t?t:0))}filter(e,t){return l(Array.prototype.filter.call(this._another,e,t))}reduce(e,t){return Array.prototype.reduce.call(this._another,e,t)}_flat(e=1){return this._flatResolve(this._another,e)}_flatResolve(e,t=1){if(0==t)return e;let n=[];return e.forEach((e=>{e=Array.isArray(e)?e:[e];let r=this._flatResolve(e,t-1);n=n.concat(r)})),u(n)}_flatMap(e){let t=this.map((t=>e(t)));return this._flatResolve(t)}}function l(e){let t=new i(e);return new Proxy(t,{get:(e,t,n)=>"symbol"==typeof t?e._another[t]:isNaN(parseInt(t))?e[t]:e._another[t],set:(e,t,n)=>(e[t]=n,e._another[t]=n,!0)})}var o,a=Array.prototype.flatMap?function(...e){return(null==e?void 0:e.flatMap)?e:l(e)}:function(...e){return l(e)};function u(e){const t=s([],e);return Array.prototype.flatMap?t:l(t)}class c{constructor(e){this._value=e}get value(){return this._value}map(e){e||(e=e=>e);let t=e(this.value);return new c(t)}flatMap(e){let t=this.map(e);for(;(null==t?void 0:t.value)instanceof c;)t=t.value;return t}}class h extends c{constructor(e){super(e)}get value(){return this._value instanceof c?this._value.flatMap().value:this._value}static fromNullable(e){return new h(e)}isAbsent(){return void 0===this.value||null==this.value}isPresent(e){let t=this.isAbsent();return!t&&e&&e.call(this,this),!t}ifPresentLazy(e=()=>{}){return this.isPresent.call(this,e),this}orElse(e){return this.isPresent()?this:null==e?h.absent:this.flatMap((()=>e))}orElseLazy(e){return this.isPresent()?this:this.flatMap(e)}flatMap(e){let t=super.flatMap(e);return t instanceof h?t.flatMap():h.fromNullable(t.value)}getIf(...e){e=this.preprocessKeys(...e);let t=this;for(let n=0;n<e.length;n++){let r=this.keyVal(e[n]),s=this.arrayIndex(e[n]);if(""===r&&s>=0){if(t=this.getClass().fromNullable(t.value instanceof Array?t.value.length<s?null:t.value[s]:null),t.isAbsent())return t}else if(r&&s>=0){if(t.getIfPresent(r).isAbsent())return t;if(t=t.getIfPresent(r).value instanceof Array?this.getClass().fromNullable(t.getIfPresent(r).value[s]):this.getClass().absent,t.isAbsent())return t}else{if(t=t.getIfPresent(r),t.isAbsent())return t;s>-1&&(t=this.getClass().fromNullable(t.value[s]))}}return t}match(e){return!this.isAbsent()&&e(this.value)}get(e=h.absent){return this.isAbsent()?this.getClass().fromNullable(e).flatMap():this.getClass().fromNullable(this.value).flatMap()}toJson(){return JSON.stringify(this.value)}getClass(){return h}arrayIndex(e){let t=e.indexOf("["),n=e.indexOf("]");return t>=0&&n>0&&t<n?parseInt(e.substring(t+1,n)):-1}keyVal(e){let t=e.indexOf("[");return t>=0?e.substring(0,t):e}getIfPresent(e){return this.isAbsent()?this.getClass().absent:this.getClass().fromNullable(this.value[e]).flatMap()}resolve(e){if(this.isAbsent())return h.absent;try{return h.fromNullable(e(this.value))}catch(e){return h.absent}}preprocessKeys(...e){return new a(...e).flatMap((e=>new a(...e.split(/]\s*\[/gi)).map((e=>(-1==(e=e.replace(/^\s+|\s+$/g,"")).indexOf("[")&&-1!=e.indexOf("]")&&(e="["+e),-1==e.indexOf("]")&&-1!=e.indexOf("[")&&(e+="]"),e)))))}}h.absent=h.fromNullable(null);class d extends h{constructor(e,t="value"){super(e),this.key=t}get value(){return this._value?this._value[this.key]:null}set value(e){this._value&&(this._value[this.key]=e)}orElse(e){let t={};return t[this.key]=e,this.isPresent()?this:new d(t,this.key)}orElseLazy(e){if(this.isPresent())return this;{let t={};return t[this.key]=e(),new d(t,this.key)}}getClass(){return d}static fromNullable(e,t="value"){return new d(e,t)}}d.absent=d.fromNullable(null),function(e){function t(e){let t=/\s/,n=(e=e.replace(/^\s\s*/,"")).length;for(;t.test(e.charAt(--n)););return e.slice(0,n+1)}function n(e){return!!arguments.length&&null!=e&&("string"==typeof e||e instanceof String)}e.saveResolve=function(e,t=null){try{let n=e();return h.fromNullable(null!=n?n:t)}catch(e){return h.absent}},e.saveResolveLazy=function(e,t=null){try{let n=e();return h.fromNullable(null!=n?n:t())}catch(e){return h.absent}},e.strToArray=function(e,n=/\./gi){let r=[];return e.split(n).forEach((e=>{r.push(t(e))})),r},e.trim=t,e.objToArray=function(e,t=0,n=[]){return"__undefined__"==(null!=e?e:"__undefined__")?null!=n?n:null:e instanceof Array&&!t&&!n?e:u(n.concat(Array.prototype.slice.call(e,t)))},e.equalsIgnoreCase=function(e,t){let n=null!=t?t:"___no_value__";return(null!=e?e:"___no_value__").toLowerCase()===n.toLowerCase()},e.assertType=function(e,t){return n(t)?typeof e==t:e instanceof t},e.isString=n,e.isFunc=function(e){return e instanceof Function||"function"==typeof e},e.objAssign=function(e,...t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");let n=Object(e);return Object.assign?(t.forEach((e=>Object.assign(n,e))),n):(t.filter((e=>null!=e)).forEach((e=>{let t=e;[...Object.keys(t),...Object.getOwnPropertySymbols(t).filter((e=>Object.prototype.propertyIsEnumerable.call(t,e)))].forEach((e=>n[e]=t[e]))})),n)}}(o||(o={}));class v{constructor(e){this.parent=e}set value(e){}get value(){return this.parent}}function f(e,...t){if(t.length<1)return new v(e);const n=w(e,...t);return new class{set value(e){n.target[n.key]=e}get value(){return n.target[n.key]}}}function p(e,...t){if(t.length<1)return new v(e);const n=w(e,...t);return new class{set value(e){Array.isArray(e)||(e=[e]),n.target[n.key]?(Array.isArray(n.target[n.key])||(n.target[n.key]=[n.target[n.key]]),s(n.target[n.key],e)):n.target[n.key]=e}}}function m(e){let t=e.indexOf("[");return t>=0?e.substring(0,t):e}function g(e){let t=e.indexOf("["),n=e.indexOf("]");return t>=0&&n>0&&t<n?parseInt(e.substring(t+1,n)):-1}function y(e,t,n={}){let r=[];r.length=t,r[t-1]=n,s(e,r)}function E(e){return new a(...e).flatMap((e=>e.split("["))).map((e=>-1!=e.indexOf("]")?"["+e:e)).filter((e=>""!=e))}function w(e,...t){t=E(t);let n=e,r=null,s=null,i=-1;for(let e=0;e<t.length;e++)if(s=m(t[e]),i=g(t[e]),-1!=i){if(!Array.isArray(n))throw Error("Associative array referenced as index array in path reference");let s=-1;e<t.length-1&&(s=g(t[e+1]));let l=void 0!==(null==n?void 0:n[i]);y(n,i+1,-1!=s?[]:{}),r=i,e==t.length-1?n[i]=l?n[i]:null:n=n[i]}else{if(Array.isArray(n))throw Error("Index array referenced as associative array in path reference");let i=-1;e<t.length-1&&(i=g(t[e+1])),r=s;let l=void 0!==(null==n?void 0:n[s]);e==t.length-1?l||(n[s]=null):(l||(n[s]=-1==i?{}:[]),n=n[s])}return{target:n,key:r}}function b(...e){return A(!0,!1,...e)}function A(e=!0,t=!1,...n){let r={};return new a(...n).map((e=>({arr:e,keys:Object.keys(e)}))).forEach((({arr:n,keys:i})=>{i.forEach((i=>{let l=n[i];!Array.isArray(l)&&t&&(l=new a(...[l])),e||!(null==r?void 0:r[i])?function(e,t,n,r,i){if(e)if(void 0===(null==t?void 0:t[n]))t[n]=i;else if(Array.isArray(t[n])){let e=t[n],r=[];i.forEach((t=>{-1==e.indexOf(t)&&r.push(t)})),s(t[n],r)}else{let e=t[n],r=[];i.forEach((t=>{e!=t&&r.push(t)})),t[n]=new a(...[]),t[n].push(e),s(t[n],r)}else t[n]=r[n]}(t,r,i,n,l):!e&&(null==r?void 0:r[i])&&function(e,t,n,r,i){if(e)if(void 0===(null==t?void 0:t[n]))t[n]=i;else if(Array.isArray(t[n]))s(t[n],i);else{let e=t[n];t[n]=new a(...[]),t[n].push(e),s(t[n],i)}}(t,r,i,0,l)}))})),r}const S=o.objAssign;class x extends d{constructor(e,t,n){super(e,t),this.arrPos=null!=n?n:-1}get value(){return""==this.key&&this.arrPos>=0?this._value[this.arrPos]:this.key&&this.arrPos>=0?this._value[this.key][this.arrPos]:this._value[this.key]}set value(e){""==this.key&&this.arrPos>=0?this._value[this.arrPos]=e:this.key&&this.arrPos>=0?this._value[this.key][this.arrPos]=e:this._value[this.key]=e}}x.absent=x.fromNullable(null);class _ extends h{constructor(e,t){super(e),this.configDef=t}get shallowCopy(){return this.shallowCopy$()}shallowCopy$(){let e=new _({});return e.shallowMerge(this.value),e}get deepCopy(){return this.deepCopy$()}deepCopy$(){return new _(S({},this.value))}static fromNullable(e){return new _(e)}shallowMerge(e,t=!0,n=!1){let r=A(t,n,this.value,e.value);Array.isArray(this._value)?(this._value.length=0,s(this._value,r)):(Object.getOwnPropertyNames(this._value).forEach((e=>delete this._value[e])),Object.getOwnPropertyNames(r).forEach((e=>this._value[e]=r[e])))}append(...e){return p(this._value,...e)}appendIf(e,...t){return function(e,t,...n){return!e||n.length<1?new v(t):p(t,...n)}(e,this._value,...t)}assign(...e){return f(this.value,...e)}assignIf(e,...t){return function(e,t,...n){return!e||n.length<1?new v(t):f(t,...n)}(e,this._value,...t)}getIf(...e){return this.assertAccessPath(...e),this.getClass().fromNullable(function(e,...t){let n=null;t=E(t);let r=e;for(let e=0;e<t.length;e++){let s=t[e];if(s=-1!=g(s)?g(s):s,r=null==r?void 0:r[s],void 0===r)return null;n=r}return r}(this.value,...e))}get(e){return this.getClass().fromNullable(super.get(e).value)}delete(e){return e in this.value&&delete this.value[e],this}toJson(){return JSON.stringify(this.value)}getClass(){return _}setVal(e){this._value=e}assertAccessPath(...e){var t,n,r,s,i,l,o,a,c;if(e=this.preprocessKeys(...e),!this.configDef)return;let d=h.fromNullable(Object.keys(this.configDef).map((e=>{let t={};return t[e]=this.configDef[e],t})));for(let v=0;v<e.length;v++){let f=this.keyVal(e[v]),p=this.arrayIndex(e[v]);if(d=this.isArray(p)?""!=f?Array.isArray(d.value)?h.fromNullable(null===(n=null===(t=u(d.value).find((e=>{var t;return!(null===(t=null==e?void 0:e[f])||void 0===t||!t)})))||void 0===t?void 0:t[f])||void 0===n?void 0:n[p]):h.fromNullable(null!==(i=null===(s=null===(r=d.value)||void 0===r?void 0:r[f])||void 0===s?void 0:s[p])&&void 0!==i?i:null):Array.isArray(d.value)?h.fromNullable(null===(l=d.value)||void 0===l?void 0:l[p]):h.absent:Array.isArray(d.value)?h.fromNullable(null===(o=u(d.value).find((e=>{var t;return!(null===(t=null==e?void 0:e[f])||void 0===t||!t)})))||void 0===o?void 0:o[f]):h.fromNullable(null!==(c=null===(a=d.value)||void 0===a?void 0:a[f])&&void 0!==c?c:null),!d.isPresent())throw Error("Access Path to config invalid");if("__ANY_POINT__"==d.value)return}}isNoArray(e){return-1==e}isArray(e){return!this.isNoArray(e)}}var R;function N(e){let t=1;for(;e.lookAhead(t)!=R.EO_STRM;)t++;return--t}!function(e){e.EO_STRM="__EO_STRM__",e.BEF_STRM="___BEF_STRM__"}(R||(R={}));class I{constructor(e,...t){this.first=e,this.selectedPos=0,this.strms=[e],t.forEach((e=>{Array.isArray(e)?s(this.strms,e):this.strms.push(e)})),this.activeStrm=this.strms[this.selectedPos]}current(){return this.activeStrm.current()}hasNext(){return!!this.activeStrm.hasNext()||!(this.selectedPos>=this.strms.length)&&-1!=this.findNextStrm()}findNextStrm(){let e=!1,t=this.selectedPos;for(;!e&&t<this.strms.length;)e=this.strms[t].hasNext(),e||t++;return e?t:-1}lookAhead(e=1){const t=this.strms.slice(this.selectedPos);if(!t.length)return R.EO_STRM;const n=[...t];for(;n.length;){let t=n.shift(),r=t.lookAhead(e);if(r!=R.EO_STRM)return r;e-=N(t)}return R.EO_STRM}next(){return this.activeStrm.hasNext()?this.activeStrm.next():(this.selectedPos=this.findNextStrm(),-1==this.selectedPos?R.EO_STRM:(this.activeStrm=this.strms[this.selectedPos],this.activeStrm.next()))}reset(){this.activeStrm=this.strms[0],this.selectedPos=0;for(let e=0;e<this.strms.length;e++)this.strms[e].reset()}}class C{constructor(...e){this.dataPos=-1,this.value=e}static ofArray(e){const t=new C;return t.value=null!=e?e:[],t}lookAhead(e=1){return this.dataPos+e>this.value.length-1?R.EO_STRM:this.value[this.dataPos+e]}hasNext(){return this.value.length-1>this.dataPos}next(){var e;return this.dataPos++,null!==(e=null==this?void 0:this.value[this.dataPos])&&void 0!==e?e:R.EO_STRM}reset(){this.dataPos=-1}current(){return this.value[Math.max(0,this.dataPos)]}}class T{constructor(e,t){this._current=R.BEF_STRM,this._filterIdx={},this._unfilteredPos=0,this.filterFunc=e,this.inputDataSource=t}hasNext(){let e,t=1,n=!1;for(;!n&&(e=this.inputDataSource.lookAhead(t))!=R.EO_STRM;)this.filterFunc(e)?(this._filterIdx[this._unfilteredPos+t]=!0,n=!0):t++;return n}next(){var e,t;let n=R.EO_STRM;for(;this.inputDataSource.hasNext();){this._unfilteredPos++;let r=this.inputDataSource.next();if(r!=R.EO_STRM&&(null!==(t=null===(e=this._filterIdx)||void 0===e?void 0:e[this._unfilteredPos])&&void 0!==t&&t||this.filterFunc(r))){this._filterIdx[this._unfilteredPos]=!0,n=r;break}}return this._current=n,n}lookAhead(e=1){var t;let n=R.EO_STRM;for(let r=1;e>0&&(n=this.inputDataSource.lookAhead(r))!=R.EO_STRM;r++)((null===(t=this._filterIdx)||void 0===t?void 0:t[this._unfilteredPos+r])||this.filterFunc(n))&&(e--,this._filterIdx[this._unfilteredPos+r]=!0);return n}current(){return this._current}reset(){this._current=R.BEF_STRM,this._filterIdx={},this._unfilteredPos=0,this.inputDataSource.reset()}}class O{constructor(e,t){this.mapFunc=e,this.inputDataSource=t}hasNext(){return this.inputDataSource.hasNext()}next(){return this.mapFunc(this.inputDataSource.next())}reset(){this.inputDataSource.reset()}current(){return this.mapFunc(this.inputDataSource.current())}lookAhead(e=1){const t=this.inputDataSource.lookAhead(e);return t==R.EO_STRM?t:this.mapFunc(t)}}class M{constructor(){this.data=[]}collect(e){this.data.push(e)}get finalValue(){return this.data}}function k(){var e;let t="undefined"!=typeof globalThis&&globalThis.window?globalThis.window:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0!==n.g&&(null===n.g||void 0===n.g?void 0:n.g.window)?n.g.window:void 0!==n.g?n.g:null;return null!==(e=null==t?void 0:t.window)&&void 0!==e?e:t}const P=o.trim,j=o.isString,D=o.equalsIgnoreCase,L=o.objToArray;function q(e,t){for(let n=t.length;n>0;n-=r){const s=Math.max(0,n-r);e.prepend(...t.slice(s,n))}}class F extends d{constructor(e){super(null==e?void 0:e[0],"nonce"),this.rootElems=e}isAbsent(){const e=this.value;return void 0===e||""==e}get value(){var e,t,n,r,s;return null!==(n=null===(t=null===(e=null==this?void 0:this.rootElems)||void 0===e?void 0:e[0])||void 0===t?void 0:t.nonce)&&void 0!==n?n:null===(s=null===(r=null==this?void 0:this.rootElems)||void 0===r?void 0:r[0])||void 0===s?void 0:s.getAttribute("nonce")}set value(e){var t;(null===(t=null==this?void 0:this.rootElems)||void 0===t?void 0:t.length)&&this.rootElems.forEach((t=>{void 0!==(null==t?void 0:t.nonce)?t.nonce=e:t.setAttribute("nonce",e)}))}}var H;!function(e){e.SELECT="select",e.BUTTON="button",e.SUBMIT="submit",e.RESET="reset",e.IMAGE="image",e.RADIO="radio",e.CHECKBOX="checkbox"}(H||(H={}));class V extends d{constructor(e,t,n=null){super(e,t),this.element=e,this.name=t,this.defaultVal=n}get value(){let e=this.element.get(0).orElse().values;return e.length?e[0].getAttribute(this.name):this.defaultVal}set value(e){let t=this.element.get(0).orElse().values;for(let n=0;n<t.length;n++)t[n].setAttribute(this.name,e)}getClass(){return V}static fromNullable(e,t="value"){return new V(e,t)}}class $ extends d{constructor(e,t,n=null){super(e,t),this.element=e,this.name=t,this.defaultVal=n}get value(){let e=this.element.values;return e.length?e[0].style[this.name]:this.defaultVal}set value(e){let t=this.element.values;for(let n=0;n<t.length;n++)t[n].style[this.name]=e}getClass(){return $}static fromNullable(e,t="value"){return new $(e,t)}}const B=()=>!0;class U{constructor(...e){if(this.rootNode=[],this.pos=-1,this._limits=-1,!h.fromNullable(e).isAbsent()&&e.length)for(let t=0;t<e.length;t++)if(e[t])if(j(e[t])){let n=U.querySelectorAll(e[t]);n.isAbsent()||s(e,n.values)}else e[t]instanceof U?s(this.rootNode,e[t].values):Array.isArray(e[t])?s(e,e[t]):this.rootNode.push(e[t])}get value(){return this.getAsElem(0)}get values(){return this.allElems()}get global(){return k}get stream(){throw Error("Not implemented, include Stream.ts for this to work")}get lazyStream(){throw Error("Not implemented, include Stream.ts for this to work")}get id(){return new V(this.get(0),"id")}get length(){return this.rootNode.length}get tagName(){return this.getAsElem(0).getIf("tagName")}get nodeName(){return this.getAsElem(0).getIf("nodeName")}isTag(e){return!this.isAbsent()&&(this.nodeName.orElse("__none___").value.toLowerCase()==e.toLowerCase()||this.tagName.orElse("__none___").value.toLowerCase()==e.toLowerCase())}get type(){return this.getAsElem(0).getIf("type")}get name(){return new d(this.getAsElem(0).value,"name")}get inputValue(){return this.getAsElem(0).getIf("value").isPresent()?new d(this.getAsElem(0).value):d.absent}get val(){return this.inputValue.value}set val(e){this.inputValue.value=e}get nodeId(){return this.id.value}set nodeId(e){this.id.value=e}get checked(){return u(this.values).every((e=>!!e.checked))}set checked(e){this.eachElem((t=>t.checked=e))}get elements(){return this.querySelectorAll("input, select, textarea, fieldset")}get deepElements(){return this.querySelectorAllDeep("input, select, textarea, fieldset")}querySelectorAllDeep(e){let t=[],n=this.querySelectorAll(e);n.length&&t.push(n);let r=this._collectShadowRoots();if(r.length){let n=new U(r).querySelectorAllDeep(e);n.length&&t.push(n)}return new U(t)}_collectShadowRoots(){var e,t;let n=[];for(let r=0;r<(null!==(t=null===(e=null==this?void 0:this.rootNode)||void 0===e?void 0:e.length)&&void 0!==t?t:0);r++){let e=this.rootNode[r];if(!(null==e?void 0:e.querySelectorAll))continue;let t=e.querySelectorAll("*");for(let e=0,r=t.length;e<r;e++){let r=t[e].shadowRoot;r&&n.push(r)}}return n}get disabled(){return this.attr("disabled").isPresent()}set disabled(e){e?this.attr("disabled").value="disabled":this.removeAttribute("disabled")}removeAttribute(e){this.eachElem((t=>t.removeAttribute(e)))}get childNodes(){let e=[];return this.eachElem((t=>{s(e,t.childNodes)})),new U(e)}get asArray(){return u(this.rootNode).filter((e=>null!=e)).map((e=>U.byId(e)))}get offsetWidth(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetWidth)).reduce(((e,t)=>e+t),0)}get offsetHeight(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetHeight)).reduce(((e,t)=>e+t),0)}get offsetLeft(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetLeft)).reduce(((e,t)=>e+t),0)}get offsetTop(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetTop)).reduce(((e,t)=>e+t),0)}get asNodeArray(){return u(this.rootNode.filter((e=>null!=e)))}get nonce(){return new F(this.rootNode)}static querySelectorAllDeep(e){return new U(document).querySelectorAllDeep(e)}static querySelectorAll(e){return-1!=e.indexOf("/shadow/")?new U(document)._querySelectorAllDeep(e):new U(document)._querySelectorAll(e)}static byId(e,t=!1){return j(e)?t?new U(document).byIdDeep(e):new U(document).byId(e):new U(e)}static byTagName(e){return j(e)?new U(document).byTagName(e):new U(e)}static globalEval(e,t){return new U(document).globalEval(e,t)}static globalEvalSticky(e,t){return new U(document).globalEvalSticky(e,t)}static fromMarkup(e){const t=document.implementation.createHTMLDocument("");let n=(e=P(e)).toLowerCase();if(-1!=n.search(/<!doctype[^\w\-]+/gi)||-1!=n.search(/<html[^\w\-]+/gi)||-1!=n.search(/<head[^\w\-]+/gi)||-1!=n.search(/<body[^\w\-]+/gi))return t.documentElement.innerHTML=e,new U(t.documentElement);{let t=function(e,t){let n=["<",t,">"].join(""),r=["<",t," "].join("");return 0==e.indexOf(n)||0==e.indexOf(r)},r=new U(document.createElement("div"));return t(n,"thead")||t(n,"tbody")||t(n,"tfoot")?(r.html(`<table>${e}</table>`),r.querySelectorAll("table").get(0).childNodes.detach()):t(n,"tr")?(r.html(`<table><tbody>${e}</tbody></table>`),r.querySelectorAll("tbody").get(0).childNodes.detach()):t(n,"td")||t(n,"th")?(r.html(`<table><tbody><tr>${e}</tr></tbody></table>`),r.querySelectorAll("tr").get(0).childNodes.detach()):(r.html(e),r.childNodes.detach())}}get(e){return e<this.rootNode.length?new U(this.rootNode[e]):U.absent}getAsElem(e,t=h.absent){return e<this.rootNode.length?h.fromNullable(this.rootNode[e]):t}filesFromElem(e){var t;return e<this.rootNode.length&&(null===(t=this.rootNode[e])||void 0===t?void 0:t.files)?this.rootNode[e].files:[]}allElems(){return this.rootNode}isAbsent(){return 0==this.length}isPresent(e){let t=this.isAbsent();return!t&&e&&e.call(this,this),!t}ifPresentLazy(e=function(){}){return this.isPresent.call(this,e),this}delete(){this.eachElem((e=>{e.parentNode&&e.parentNode.removeChild(e)}))}querySelectorAll(e){return-1!=e.indexOf("/shadow/")?this._querySelectorAllDeep(e):this._querySelectorAll(e)}closest(e){return-1!=e.indexOf("/shadow/")?this._closestDeep(e):this._closest(e)}byId(e,t){let n=[];return t&&(n=n.concat(u((null==this?void 0:this.rootNode)||[]).filter((t=>e==t.id)).map((e=>new U(e))))),n=n.concat(this.querySelectorAll(`[id="${e}"]`)),new U(n)}byIdDeep(e,t){let n=[];t&&(n=n.concat(u((null==this?void 0:this.rootNode)||[]).filter((t=>e==t.id)).map((e=>new U(e)))));let r=this.querySelectorAllDeep(`[id="${e}"]`);return r.length&&n.push(r),new U(n)}byTagName(e,t,n){var r;let i=[];return t&&s(i,u(null!==(r=null==this?void 0:this.rootNode)&&void 0!==r?r:[]).filter((t=>(null==t?void 0:t.tagName)==e))),n?i.push(this.querySelectorAllDeep(e)):i.push(this.querySelectorAll(e)),new U(i)}attr(e,t=null){return new V(this,e,t)}style(e,t=null){return new $(this,e,t)}hasClass(e){let t=!1;return this.eachElem((n=>{if(t=n.classList.contains(e),t)return!1})),t}addClass(e){return this.eachElem((t=>t.classList.add(e))),this}removeClass(e){return this.eachElem((t=>t.classList.remove(e))),this}isMultipartCandidate(e=!1){const t="input[type='file']";return this.matchesSelector(t)||(e?this.querySelectorAllDeep(t):this.querySelectorAll(t)).first().isPresent()}html(e){return h.fromNullable(e).isAbsent()?this.isPresent()?h.fromNullable(this.innerHTML):h.absent:(this.innerHTML=e,this)}dispatchEvent(e){return this.eachElem((t=>t.dispatchEvent(e))),this}set innerHTML(e){this.eachElem((t=>t.innerHTML=e))}get innerHTML(){let e=[];return this.eachElem((t=>e.push(t.innerHTML))),e.join("")}set innerHtml(e){this.innerHTML=e}get innerHtml(){return this.innerHTML}filterSelector(e){let t=[];return this.eachElem((n=>{this._matchesSelector(n,e)&&t.push(n)})),new U(t)}matchesSelector(e){return this.asArray.some((t=>this._matchesSelector(t.getAsElem(0).value,e)))}getIf(...e){let t=this.childNodes;for(let n=0;n<e.length;n++)if(t=t.filterSelector(e[n]),t.isAbsent())return t;return t}eachElem(e){for(let t=0,n=this.rootNode.length;t<n&&!1!==e(this.rootNode[t],t);t++);return this}firstElem(e=e=>e){return this.rootNode.length>0&&e(this.rootNode[0],0),this}lastElem(e=e=>e){return this.rootNode.length>0&&e(this.rootNode[this.rootNode.length-1],this.rootNode.length-1),this}each(e){return u(this.rootNode).forEach(((t,n)=>{if(null!=t)return e(U.byId(t),n)})),this}replace(e){return this.each((t=>{let n=t.getAsElem(0).value,r=n.parentElement,s=n.nextElementSibling,i=n.previousElementSibling;null!=s?new U(s).insertBefore(e):i?new U(i).insertAfter(e):new U(r).append(e),t.delete()})),e}first(e=e=>e){return this.rootNode.length>=1?(e(this.get(0),0),this.get(0)):this}last(e=e=>e){if(this.rootNode.length>=1){let t=this.get(this.rootNode.length-1);return e(t,0),t}return this}filter(e){let t=[];return this.each((n=>{e(n)&&t.push(n)})),new U(t)}globalEval(e,t){var n,r,s;const i=null!==(r=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==r?r:null===(s=document.documentElement.getElementsByTagName("head"))||void 0===s?void 0:s[0],l=document.createElement("script");t&&(void 0!==(null==l?void 0:l.nonce)?l.nonce=t:l.setAttribute("nonce",t)),l.type="text/javascript",l.innerHTML=e;let o=i.appendChild(l);return i.removeChild(o),this}globalEvalSticky(e,t){let n=document.getElementsByTagName("head")[0]||document.documentElement,r=document.createElement("script");return this.applyNonce(t,r),r.type="text/javascript",r.innerHTML=e,n.appendChild(r),this}detach(){return this.eachElem((e=>{e.parentNode.removeChild(e)})),this}appendTo(e){return o.isString(e)?(this.appendTo(U.querySelectorAll(e)),this):(this.eachElem((t=>{e.getAsElem(0).orElseLazy((()=>({appendChild:()=>{}}))).value.appendChild(t)})),this)}loadScriptEval(e,t=0,n){return this._loadScriptEval(!1,e,t,n),this}loadScriptEvalSticky(e,t=0,n){return this._loadScriptEval(!0,e,t,n),this}insertAfter(...e){this.each((t=>{let n=t.getAsElem(0).value,r=n.parentNode;for(let t=0;t<e.length;t++){let s=n.nextSibling;e[t].eachElem((e=>{s?(r.insertBefore(e,s),n=s):r.appendChild(e)}))}}));let t=[];return t.push(this),t=t.concat(e),new U(t)}insertBefore(...e){this.each((t=>{let n=t.getAsElem(0).value,r=n.parentNode;for(let t=0;t<e.length;t++)e[t].eachElem((e=>{r.insertBefore(e,n)}))}));let t=[];return t.push(this),t=t.concat(e),new U(t)}orElse(...e){return this.isPresent()?this:new U(...e)}orElseLazy(e){return this.isPresent()?this:new U(e())}allParents(e){let t=this.parent(),n=[];for(;t.isPresent();)t.matchesSelector(e)&&n.push(t),t=t.parent();return new U(n)}firstParent(e){let t=this.parent();for(;t.isPresent();){if(t.matchesSelector(e))return t;t=t.parent()}return U.absent}parentsWhileMatch(e){const t=[];let n=this.parent().filter((t=>t.matchesSelector(e)));for(;n.isPresent();)t.push(n),n=n.parent().filter((t=>t.matchesSelector(e)));return new U(t)}parent(){let e=[];return this.eachElem((t=>{let n=t.parentNode||t.host||t.shadowRoot;n&&-1==e.indexOf(n)&&e.push(n)})),new U(e)}copyAttrs(e){return e.eachElem((e=>{let t=L(e.attributes);for(let e of t){let t=e.value,n=e.name;switch(n){case"id":this.id.value=t;break;case"disabled":this.resolveAttributeHolder("disabled").disabled=t;break;case"checked":this.resolveAttributeHolder("checked").checked=t;break;case"nonce":break;default:this.attr(n).value=t}}})),e.nonce.isPresent((()=>{this.nonce.value=e.nonce.value})),this}outerHTML(e,t,n,r=!1){var s;if(this.isAbsent())return;let i=this.getAsElem(0).value,l=null===document||void 0===document?void 0:document.activeElement,o=null==l?void 0:l.id,a=!!o&&!!(null===(s=null==i?void 0:i.contains)||void 0===s?void 0:s.call(i,l)),u=a?U.getCaretPosition(l):null,c=U.fromMarkup(e),h=[],d=c.get(0),v=i.parentNode,f=d.getAsElem(0).value;if(v.replaceChild(f,i),h.push(new U(f)),this.isAbsent())return this;let p=[];if(c.length>1&&(p=p.concat(c.values.slice(1)),h.push(U.byId(f).insertAfter(new U(p)))),t&&this.runScripts(),n&&this.runCss(),a){let e=U.byId(o);e.isPresent()&&null!=u&&void 0!==u&&e.eachElem((e=>U.setCaretPosition(e,u)))}return c}runScripts(e=!1,t=B){const n=t=>{if(t.length){let n=[];u(t).forEach((t=>{t.nonce?(n.length&&(this.globalEval(n.join("\n")),n.length=0),e?this.globalEvalSticky(t.evalText,t.nonce):this.globalEval(t.evalText,t.nonce)):n.push(t.evalText)})),n.length&&(e?this.globalEvalSticky(n.join("\n")):this.globalEval(n.join("\n")),n.length=0),t=[]}return t};let r=[],s=["","script","text/javascript","text/ecmascript","ecmascript"],i=i=>{var l,o,a,u;let c=i.tagName,h=(null!==(l=null==i?void 0:i.type)&&void 0!==l?l:"").toLowerCase();if(c&&D(c,"script")&&-1!=s.indexOf(h)){let s=i.getAttribute("src");if(void 0!==s&&null!=s&&s.length>0){let l=null!==(o=null==i?void 0:i.nonce)&&void 0!==o?o:i.getAttribute("nonce").value;t(s)&&(r=n(r),e?l?this.loadScriptEvalSticky(s,0,l):this.loadScriptEvalSticky(s,0):l?this.loadScriptEval(s,0,l):this.loadScriptEval(s,0))}else{let e=P(i.text||i.innerText||i.innerHTML),t=!0;for(;t;)t=!1,"\x3c!--"==e.substring(0,4)&&(e=e.substring(4),t=!0),"//\x3c!--"==e.substring(0,4)&&(e=e.substring(6),t=!0),"//<![CDATA["==e.substring(0,11)&&(e=e.substring(11),t=!0);let n=null!==(u=null!==(a=null==i?void 0:i.nonce)&&void 0!==a?a:i.getAttribute("nonce").value)&&void 0!==u?u:"";r.push({nonce:n,evalText:e})}}};try{new U(this.filterSelector("script"),this.querySelectorAll("script")).asArray.flatMap((e=>[...e.values])).sort(((e,t)=>t.compareDocumentPosition(e)-3)).forEach((e=>i(e))),n(r)}catch(e){if(console&&console.error){const t=e;console.error(t.message||t.description)}}finally{i=null}return this}runCss(){return new U(this.filterSelector("link, style"),this.querySelectorAll("link, style")).asArray.flatMap((e=>[...e.values])).sort(((e,t)=>e.compareDocumentPosition(t)-3)).forEach((e=>(e=>{const t=U.byId(e),n=t.tagName.orElse("").value;let r=U.fromMarkup(`<${n.toLowerCase()} />`);r=r.copyAttrs(t),r.innerHTML=e.innerHTML,t.replace(r)})(e))),this}click(){return this.fireEvent("click"),this}addEventListener(e,t,n){return this.eachElem((r=>r.addEventListener(e,t,n))),this}removeEventListener(e,t,n){return this.eachElem((r=>r.removeEventListener(e,t,n))),this}fireEvent(e,t={}){let n={bubbles:!0,cancelable:!0};n=b(n,t),this.eachElem((t=>{let r;if(t.ownerDocument)r=t.ownerDocument;else{if(9!=t.nodeType)throw new Error("Invalid node passed to fireEvent: "+t.id);r=t}if(t.dispatchEvent){let r=Event;switch(e){case"click":case"mousedown":case"mouseup":case"mousemove":r=this.global().MouseEvent;break;case"keyup":case"keydown":case"keypress":r=this.global().KeyboardEvent;break;case"focus":case"change":case"blur":case"select":break;default:throw"fireEvent: Couldn't find an event class for event '"+e+"'."}let s=new r(e,n);s.synthetic=!0,t.dispatchEvent(s)}else if(t.fireEvent){let s=r.createEventObject();s.synthetic=!0,Object.keys(n).forEach((e=>s[e]=n[e])),t.fireEvent("on"+e,s)}}))}textContent(e=""){return this.asArray.map((e=>e.getAsElem(0).orElseLazy((()=>({textContent:""}))).value.textContent||"")).reduce(((t,n)=>[t,e,n].join("")),"")}innerText(e=""){return this.asArray.map((e=>e.getAsElem(0).orElseLazy((()=>({innerText:""}))).value.innerText||"")).reduce(((t,n)=>[t,n].join(e)),"")}encodeFormElement(e={}){if(this.name.isAbsent())return;let t=b(e);return this.each((e=>{var n,r;if(e.name.isAbsent())return;let s=e.name.value,i=e.tagName.orElse("__none__").value.toLowerCase(),l=e.type.orElse("__none__").value.toLowerCase();if(l=l.toLowerCase(),("input"==i||"textarea"==i||"select"==i)&&null!=s&&""!=s&&!e.disabled){if("select"==i){let n=e.getAsElem(0).value;if(n.selectedIndex>=0){let e=n.options.length;for(let r=0;r<e;r++)if(n.options[r].selected){let e=n.options[r];p(t,s).value=null!=e.getAttribute("value")?e.value:e.text}}}if(i!=H.SELECT&&l!=H.BUTTON&&l!=H.RESET&&l!=H.SUBMIT&&l!=H.IMAGE&&(l!=H.CHECKBOX&&l!=H.RADIO||e.checked)){let i=null===(r=null===(n=e.value)||void 0===n?void 0:n.value)||void 0===r?void 0:r.files,l=null!=i?i:[];if(null==l?void 0:l.length)f(t,s).value=Array.from(l);else{if(i)return;p(t,s).value=e.inputValue.value}}}})),t}get cDATAAsString(){let e=this.asArray.flatMap((e=>e.childNodes.asArray)).filter((e=>{var t,n;return 4==(null===(n=null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.value)||void 0===n?void 0:n.nodeType)})).reduce(((e,t)=>{var n,r,s;return e.push(null!==(s=null===(r=null===(n=null==t?void 0:t.value)||void 0===n?void 0:n.value)||void 0===r?void 0:r.data)&&void 0!==s?s:""),e}),[]);return e.join("")}subNodes(e,t){return h.fromNullable(t).isAbsent()&&(t=this.length),new U(this.rootNode.slice(e,Math.min(t,this.length)))}limits(e){return this._limits=e,this}hasNext(){let e=-1!=this._limits&&this.pos>=this._limits-1,t=this.pos>=this.values.length-1;return!(e||t)}next(){return this.hasNext()?(this.pos++,new U(this.values[this.pos])):null}lookAhead(e=1){return this.values.length-1<this.pos+e?R.EO_STRM:new U(this.values[this.pos+e])}current(){return-1==this.pos?R.BEF_STRM:new U(this.values[this.pos])}reset(){this.pos=-1}attachShadow(e={mode:"open"}){let t=[];return this.eachElem((n=>{var r;let s;if(!(null===(r=n)||void 0===r?void 0:r.attachShadow))throw new Error("Shadow dom creation not supported by the browser, please use a shim, to gain this functionality");s=U.byId(n.attachShadow(e)),t.push(s)})),new U(t)}waitUntilDom(e){return t=this,n=arguments,s=function*(e,t={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}){return function(e,t,n={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}){return new Promise(((r,s)=>{let i=null;const l=new Error("Mutation observer timeout");function o(e,t){let r=null;return t(e)?e:(r=n.childList?t(e)?e:e.childNodes.filter((e=>t(e))).first().value.value:n.subtree?t(e)?e:e.querySelectorAll(" * ").filter((e=>t(e))).first().value.value:t(e)?e:null,r)}let a=e;if(a=o(a,t))r(new U(a));else if("undefined"!=typeof MutationObserver){const o=setTimeout((()=>(i.disconnect(),s(l))),n.timeout),a=n=>{const s=new U(n.map((e=>e.target))).filter((e=>t(e))).first();s.isPresent()&&(clearTimeout(o),i.disconnect(),r(new U(s||e)))};i=new MutationObserver(a);let u=Object.assign({},n);delete u.timeout,e.eachElem((e=>{i.observe(e,u)}))}else{let i,a;i=setInterval((()=>{let n=o(e,t);n&&(a&&(clearTimeout(a),clearInterval(i),i=null),r(new U(n||e)))}),n.interval),a=setTimeout((()=>{i&&(clearInterval(i),s(l))}),n.timeout)}}))}(this,e,t)},new((r=void 0)||(r=Promise))((function(e,i){function l(e){try{a(s.next(e))}catch(e){i(e)}}function o(e){try{a(s.throw(e))}catch(e){i(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(l,o)}a((s=s.apply(t,n||[])).next())}));var t,n,r,s}get shadowElements(){let e=(this.querySelectorAll("*").filter((e=>e.hasShadow)).allElems()||[]).map((e=>e.shadowRoot)).filter((e=>!!e));return new U(e)}get shadowRoot(){let e=[];for(let t=0;t<this.rootNode.length;t++)this.rootNode[t].shadowRoot&&e.push(this.rootNode[t].shadowRoot);return new U(e)}get hasShadow(){for(let e=0;e<this.rootNode.length;e++)if(this.rootNode[e].shadowRoot)return!0;return!1}static getCaretPosition(e){try{if("number"==typeof(null==e?void 0:e.selectionStart))return e.selectionStart}catch(e){}return 0}static setCaretPosition(e,t){(null==e?void 0:e.focus)&&(null==e||e.focus());try{(null==e?void 0:e.setSelectionRange)&&(null==e||e.setSelectionRange(t,t))}catch(e){}}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}concat(e,t=!0){let n=this.asArray;const r=new U(n.concat(e.asArray));if(!t)return r;let s={};return new U(r.asArray.filter((e=>{const t=!(null==s?void 0:s[e.value.value.outerHTML]);return s[e.value.value.outerHTML]=!0,t})))}append(e){return this.each((t=>e.appendTo(t))),this}prependTo(e){return e.eachElem((e=>{q(e,this.allElems())})),this}prepend(e){return this.eachElem((t=>{q(t,e.allElems())})),this}_querySelectorAll(e){var t,n;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let r=[];for(let t=0;t<this.rootNode.length;t++)(null===(n=this.rootNode[t])||void 0===n?void 0:n.querySelectorAll)&&s(r,this.rootNode[t].querySelectorAll(e));return new U(r)}_querySelectorAllDeep(e){var t;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let n=new U(this.rootNode),r=e.split(/\/shadow\//);for(let e=0;e<r.length;e++){if(""==r[e])continue;let t=r[e];n=n.querySelectorAll(t),e<r.length-1&&(n=n.shadowRoot)}return n}_closest(e){var t,n;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let r=[];for(let t=0;t<this.rootNode.length;t++){if(!(null===(n=this.rootNode[t])||void 0===n?void 0:n.closest))continue;let s=[this.rootNode[t].closest(e)];r=r.concat(s)}return new U(r)}_closestDeep(e){var t;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let n=new U(this.rootNode),r=e.split(/\/shadow\//);for(let e=0;e<r.length;e++){if(""==r[e])continue;let t=r[e];n=n.closest(t),e<r.length-1&&(n=n.shadowRoot)}return n}_matchesSelector(e,t){if(e.matches)return e.matches(t);var n=(document||ownerDocument).querySelectorAll(t);return-1!==Array.prototype.indexOf.call(n,e)}_loadScriptEval(e,t,n=0,r){let s=this.createSourceNode(t,r),i=this.createSourceNode(null,r),l=`nonce_${Date.now()}_${Math.random()}`;i.innerHTML=`document.head["${l}"] = true`;let o=document.head;if(o.appendChild(i),o.removeChild(i),o[l]){try{n?setTimeout((()=>{o.appendChild(s),e||o.removeChild(s)}),n):(o.appendChild(s),e||o.removeChild(s))}finally{delete o[l]}return this}}resolveAttributeHolder(e="value"){let t=[];return t[e]=null,e in this.getAsElem(0).value?this.getAsElem(0).value:t}createSourceNode(e,t){let n=document.createElement("script");return n.type="text/javascript",t&&(void 0!==(null==n?void 0:n.nonce)?n.nonce=t:n.setAttribute("nonce",t)),e&&(n.src=e),n}applyNonce(e,t){e&&(void 0!==(null==t?void 0:t.nonce)?t.nonce=e:t.setAttribute("nonce",e))}}U.absent=new U,U.global=k;const z=U,W=U.querySelectorAll;var X;!function(e){e[e.PENDING=0]="PENDING",e[e.FULFILLED=1]="FULFILLED",e[e.REJECTED=2]="REJECTED"}(X||(X={}));const G=o.isString;class Q extends U{constructor(e,t="text/xml"){var n;G(e)?super(null==(n=e)?null:o.saveResolveLazy((()=>new(k().DOMParser)),(()=>(()=>{let e=new ActiveXObject("Microsoft.XMLDOM");return e.async=!1,{parseFromString:(t,n)=>e.loadXML(t)}})())).value.parseFromString(n,t)):super(e)}isXMLParserError(){return this.querySelectorAll("parsererror").isPresent()}toString(){let e=[];return this.eachElem((t=>{var n,r,s,i;let l=null!==(i=null===(s=null===(r=null===(n=k())||void 0===n?void 0:n.XMLSerializer)||void 0===r?void 0:r.constructor())||void 0===s?void 0:s.serializeToString(t))&&void 0!==i?i:null==t?void 0:t.xml;l&&e.push(l)})),e.join("")}parserErrorText(e){return this.querySelectorAll("parsererror").textContent(e)}static parseXML(e){return new Q(e)}static parseHTML(e){return new Q(e,"text/html")}static fromString(e,t="text/xml"){return new Q(e,t)}}class J{constructor(e,t){this.activeDataSource=null,this.walkedDataSources=[],this._currPos=0,this.mapFunc=e,this.inputDataSource=t}hasNext(){return this.resolveActiveHasNext()||this.resolveNextHasNext()}resolveActiveHasNext(){let e=!1;return this.activeDataSource&&(e=this.activeDataSource.hasNext()),e}lookAhead(e=1){var t;let n=null===(t=null==this?void 0:this.activeDataSource)||void 0===t?void 0:t.lookAhead(e);if((null==this?void 0:this.activeDataSource)&&n!=R.EO_STRM)return n;this.activeDataSource&&(e-=N(this.activeDataSource));for(let t=1;;t++){let n=this.inputDataSource.lookAhead(t);if(n===R.EO_STRM)return R.EO_STRM;let r=this.mapFunc(n),s=this.toDatasource(r),i=s.lookAhead(e);if(i!=R.EO_STRM)return i;e-=N(s)}}toDatasource(e){let t=Array.isArray(e)?C.ofArray(e):e;return this.walkedDataSources.push(t),t}resolveNextHasNext(){let e=!1;for(;!e&&this.inputDataSource.hasNext();){let t=this.mapFunc(this.inputDataSource.next());this.activeDataSource=this.toDatasource(t),e=this.activeDataSource.hasNext()}return e}next(){if(this.hasNext())return this._currPos++,this.activeDataSource.next()}reset(){this.inputDataSource.reset(),this.walkedDataSources.forEach((e=>e.reset())),this.walkedDataSources=[],this._currPos=0,this.activeDataSource=null}current(){return this.activeDataSource||this.hasNext(),this.activeDataSource.current()}}class K{constructor(...e){this._limits=-1,this.pos=-1,this.value=e}static of(...e){return K.ofArr(e)}static ofArr(e){const t=new K;return t.value=null!=e?e:[],t}static ofAssoc(e){return this.ofArr(Object.keys(e)).map((t=>[t,e[t]]))}static ofDataSource(e){let t=[];for(;e.hasNext();)t.push(e.next());return K.ofArr(t)}static ofDomQuery(e){return K.ofArr(e.asArray)}static ofConfig(e){return K.ofArr(Object.keys(e.value)).map((t=>[t,e.value[t]]))}current(){return-1==this.pos?R.BEF_STRM:this.pos>=this.value.length?R.EO_STRM:this.value[this.pos]}limits(e){return this._limits=e,this}concat(...e){let t=[this].concat(e);return K.ofArr(t).flatMap((e=>e))}onElem(e){for(let t=0;t<this.value.length&&(-1==this._limits||t<this._limits)&&!1!==e(this.value[t],t);t++);return this}each(e){this.onElem(e),this.reset()}map(e){e||(e=e=>e);let t=[];return this.each((n=>{t.push(e(n))})),K.ofArr(t)}flatMap(e){let t=[];return this.each((n=>{let r=e(n);t=Array.isArray(r)?t.concat(r):t.concat(r.value)})),K.ofArr(t)}filter(e){let t=[];return this.each((n=>{e(n)&&t.push(n)})),K.ofArr(t)}reduce(e,t=null){let n=null!=t?0:1,r=null!=t?t:this.value.length?this.value[0]:null;for(let t=n;t<this.value.length&&(-1==this._limits||t<this._limits);t++)r=e(r,this.value[t]);return this.reset(),h.fromNullable(r)}first(){return this.reset(),this.value&&this.value.length?h.fromNullable(this.value[0]):h.absent}last(){let e=this._limits>0?Math.min(this._limits,this.value.length):this.value.length;return this.reset(),h.fromNullable(e?this.value[e-1]:null)}anyMatch(e){for(let t=0;t<this.value.length&&(-1==this._limits||t<this._limits);t++)if(e(this.value[t]))return!0;return this.reset(),!1}allMatch(e){if(!this.value.length)return!1;let t=0;for(let n=0;n<this.value.length;n++)e(this.value[n])&&t++;return this.reset(),t==this.value.length}noneMatch(e){let t=0;for(let n=0;n<this.value.length;n++)e(this.value[n])||t++;return this.reset(),t==this.value.length}sort(e){let t=this.value.slice().sort(e);return K.ofArr(t)}collect(e){return this.each((t=>e.collect(t))),this.reset(),e.finalValue}hasNext(){let e=-1!=this._limits&&this.pos>=this._limits-1,t=this.pos>=this.value.length-1;return!(e||t)}next(){return this.hasNext()?(this.pos++,this.value[this.pos]):null}lookAhead(e=1){return this.pos+e>=this.value.length?R.EO_STRM:this.value[this.pos+e]}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}reset(){this.pos=-1}}class Y{static of(...e){return Y.ofArr(e)}static ofArr(e){return new Y(C.ofArray(e))}static ofAssoc(e){return this.ofArr(Object.keys(e)).map((t=>[t,e[t]]))}static ofStreamDataSource(e){return new Y(e)}static ofDomQuery(e){return Y.ofArr(e.asArray)}static ofConfig(e){return Y.ofArr(Object.keys(e.value)).map((t=>[t,e.value[t]]))}constructor(e){this._limits=-1,this.pos=-1,this.dataSource=e}hasNext(){return!this.isOverLimits()&&this.dataSource.hasNext()}next(){let e=this.dataSource.next();return this.pos++,e}lookAhead(e=1){return this.dataSource.lookAhead(e)}current(){return this.dataSource.current()}reset(){this.dataSource.reset(),this.pos=-1,this._limits=-1}concat(...e){return Y.ofStreamDataSource(new I(this,e))}nextFilter(e){if(this.hasNext()){let t=this.next();return e(t)?t:this.nextFilter(e)}return null}limits(e){return this._limits=e,this}collect(e){for(;this.hasNext();){let t=this.next();e.collect(t)}return this.reset(),e.finalValue}onElem(e){return new Y(new O((t=>(!1===e(t,this.pos)&&this.stop(),t)),this))}filter(e){return new Y(new T(e,this))}map(e){return new Y(new O(e,this))}flatMap(e){return new Y(new J(e,this))}each(e){for(;this.hasNext();)!1===e(this.next())&&this.stop();this.reset()}reduce(e,t=null){if(!this.hasNext())return h.absent;let n,r=R.EO_STRM;if(null!=t)n=t,r=this.next();else{if(n=this.next(),!this.hasNext())return h.fromNullable(n);r=this.next()}for(n=e(n,r);this.hasNext();)r=this.next(),n=e(n,r);return this.reset(),h.fromNullable(n)}last(){return this.hasNext()?this.reduce(((e,t)=>t)):h.absent}first(){return this.reset(),this.hasNext()?h.fromNullable(this.next()):h.absent}anyMatch(e){for(;this.hasNext();)if(e(this.next()))return!0;return!1}allMatch(e){for(;this.hasNext();)if(!e(this.next()))return!1;return!0}noneMatch(e){for(;this.hasNext();)if(e(this.next()))return!1;return!0}sort(e){let t=this.collect(new M);return t=t.sort(e),Y.ofArr(t)}get value(){return this.collect(new M)}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}stop(){this.pos=this._limits+1e9,this._limits=0}isOverLimits(){return-1!=this._limits&&this.pos>=this._limits-1}}Object.defineProperty(U.prototype,"stream",{get:function(){return K.ofDomQuery(this)}}),Object.defineProperty(U.prototype,"lazyStream",{get:function(){return Y.ofDomQuery(this)}}),void 0!==k&&function(){if(void 0===k().Reflect||void 0===k().customElements||k().customElements.polyfillWrapFlushCallback)return;const e=HTMLElement;k().HTMLElement={HTMLElement:function(){return Reflect.construct(e,[],this.constructor)}}.HTMLElement,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}();const Z="namedViewRoot",ee="jakarta.faces.source",te="myfaces.NamingContainerId",ne="myfaces.viewId",re="jakarta.faces.ViewState",se="jakarta.faces.ClientWindow",ie=Object.freeze((()=>{})),le="",oe=(Object.freeze({}),["<input type='hidden'","name='",re,"' value='' />"].join(le)),ae=["<input type='hidden'","' name='",se,"' value='' />"].join(le),ue="@all",ce="@none",he="@this",de="jakarta.faces.partial.execute",ve="jakarta.faces.partial.render",fe="_myfaces.rendeOverride",pe="jakarta.faces.windowId",me="jakarta.faces.behavior.event",ge="render",ye="onerror",Ee="onevent",we="begin",be="source",Ae="error-name",Se="error-message",xe="responseXML",_e="httpError",Re="emptyResponse",Ne="malformedXML",Ie="params",Ce="timeout",Te="execute",Oe="myfaces.internal",Me="myfaces.source.formId",ke="myfaces.upload.progress",Pe="myfaces.upload.preinit",je="myfaces.upload.loadstart",De="myfaces.upload.loadend",Le="myfaces.upload.load",qe="myfaces.upload.error",Fe="myfaces.upload.abort",He="myfaces.upload.timeout",Ve="myfaces.source.controlId",$e="myfaces.request.passThrough",Be="myfaces.request.pps",Ue="jakarta.faces.encodedURL",ze="POST",We="HEAD",Xe="FORM",Ge="BODY",Qe="[name='"+re+"']",Je="[name='"+se+"']",Ke="processResponse",Ye="partial-response",Ze="changes",et="update",tt="delete",nt="insert",rt="eval",st="error",it="attributes",lt="extension",ot="redirect",at="before",ut="after",ct="myfaces.updateForms",ht="myfaces.updateElems",dt="myfaces.headElems",vt="myfaces",ft="myfaces.appliedViewState",pt="myfaces.appliedClientWindow";function mt(){var e;return null!==(e=null===window||void 0===window?void 0:window.faces)&&void 0!==e?e:null===window||void 0===window?void 0:window.jsf}function gt(e){return e&&(null==e?void 0:e.replace)?(null===window||void 0===window?void 0:window.faces)?e.replace(/javax\.faces/gi,"jakarta.faces"):e.replace(/jakarta\.faces/gi,"javax.faces"):e}class yt{constructor(){this.MSG_TEST="Testmessage",this.MSG_DEV_MODE="Note, this message is only sent, because project stage is development and no other error listeners are registered.",this.MSG_AFFECTED_CLASS="Affected Class=",this.MSG_AFFECTED_METHOD="Affected Method=",this.MSG_ERROR_NAME="Error Name=",this.MSG_ERROR_MESSAGE="Error Message=",this.MSG_SERVER_ERROR_NAME="Server Error Name=",this.MSG_ERROR_DESC="Error Description=",this.MSG_ERROR_NO="Error Number=",this.MSG_ERROR_LINENO="Error Line Number=",this.ERR_FORM="Sourceform could not be determined, either because element is not attached to a form or we have multiple forms with named elements of the same identifier or name, stopping the ajax processing",this.ERR_VIEWSTATE="faces.viewState= param value not of type form!",this.ERR_TRANSPORT="Transport type {0} does not exist",this.ERR_EVT_PASS="an event must be passed down (either an event object null or undefined) ",this.ERR_CONSTRUCT="Parts of the response couldn't be retrieved when constructing the event data= {0} ",this.ERR_MALFORMEDXML="The server response could not be parsed, the server has returned with a response which is not xml !",this.ERR_SOURCE_FUNC="source cannot be a function (probably source and event were not defined or set to null",this.ERR_EV_OR_UNKNOWN="An event object or unknown must be passed as second parameter",this.ERR_SOURCE_NOSTR="source cannot be a string",this.ERR_SOURCE_DEF_NULL="source must be defined or null",this.ERR_MUST_STRING="{0}: {1} namespace must be of type String",this.ERR_REF_OR_ID="{0}: {1} a reference node or identifier must be provided",this.ERR_PARAM_GENERIC="{0}: parameter {1} must be of type {2}",this.ERR_PARAM_STR="{0}: {1} param must be of type string",this.ERR_PARAM_STR_RE="{0}: {1} param must be of type string or a regular expression",this.ERR_PARAM_MIXMAPS="{0}: both a source as well as a destination map must be provided",this.ERR_MUST_BE_PROVIDED="{0}: an {1} and a {2} must be provided",this.ERR_MUST_BE_PROVIDED1="{0}: {1} must be set",this.ERR_REPLACE_EL="replaceElements called while evalNodes is not an array",this.ERR_EMPTY_RESPONSE="{0}: The response cannot be null or empty!",this.ERR_ITEM_ID_NOTFOUND="{0}: item with identifier {1} could not be found",this.ERR_PPR_IDREQ="{0}: Error in PPR Insert, id must be present",this.ERR_PPR_INSERTBEFID="{0}: Error in PPR Insert, before id or after id must be present",this.ERR_PPR_INSERTBEFID_1="{0}: Error in PPR Insert, before node of id {1} does not exist in document",this.ERR_PPR_INSERTBEFID_2="{0}: Error in PPR Insert, after node of id {1} does not exist in document",this.ERR_PPR_DELID="{0}: Error in delete, id not in xml markup",this.ERR_PPR_UNKNOWNCID="{0}: Unknown Html-Component-ID= {1}",this.ERR_NO_VIEWROOTATTR="{0}: Changing of ViewRoot attributes is not supported",this.ERR_NO_HEADATTR="{0}: Changing of Head attributes is not supported",this.ERR_RED_URL="{0}: Redirect without url",this.ERR_REQ_FAILED_UNKNOWN="Request failed with unknown status",this.ERR_REQU_FAILED="Request failed with status {0} and reason {1}",this.UNKNOWN="UNKNOWN"}}const Et=e=>!(!e||-1==e.search(/\/jakarta\.faces\.resource.*\/faces\.js.*/)&&-1==(null==e?void 0:e.search(/\/faces-development\.js.*/))&&-1==(null==e?void 0:e.search(/\/faces-uncompressed\.js.*/))&&-1==(null==e?void 0:e.search(/\/faces[^.]*\.js.*ln=jakarta.faces.*/gi))&&-1==(null==e?void 0:e.search(/\/javax\.faces\.resource.*\/jsf\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf-development\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf-uncompressed\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf[^.]*\.js.*ln=javax.faces.*/gi))),wt="src";function bt(e){return null!=e&&e.length>1}class At extends z{static get windowId(){return new At(document.body).windowId}static get nonce(){return new At(document.body).nonce}get windowId(){const e=function(){let e=window.location.href,t=new RegExp("[\\?&]windowId=([^&#\\;]*)").exec(e);return null!=t?t[1]:null};if(this.value.isPresent()){let t=this.querySelectorAll("form input[name='"+pe+"']");if(t.length>1)throw Error("Multiple different windowIds found in document");return h.fromNullable(t.isPresent()?t.getAsElem(0).value.value:e())}return h.fromNullable(e())}get nonce(){var e;let t=new St(window.myfaces).getIf("config","cspMeta","nonce");if(t.value)return d.fromNullable(t);let n=new z(document.currentScript).nonce;if(n.isPresent())return d.fromNullable(n);let r=h.fromNullable(null===(e=z.querySelectorAll("script[src], link[src]").asArray.filter((e=>e.nonce.isPresent()&&null!=e.attr(wt).value)).filter((e=>{var t;return Et(null!==(t=e.attr(wt).value)&&void 0!==t?t:void 0)})))||void 0===e?void 0:e[0]);return(null==r?void 0:r.value)?new U(r.value).nonce:d.absent}static searchJsfJsFor(e){return new At(document).searchJsfJsFor(e)}searchJsfJsFor(e){var t;return h.fromNullable(null===(t=z.querySelectorAll("script[src], link[src]").asArray.filter((e=>{var t;return Et(null!==(t=e.attr(wt).value)&&void 0!==t?t:void 0)})).map((t=>{var n;return(null!==(n=t.attr(wt).value)&&void 0!==n?n:"").match(e)})).filter(bt).map((e=>decodeURIComponent(e[1]))))||void 0===t?void 0:t[0])}globalEvalSticky(e,t){return new At(super.globalEvalSticky(e,null!=t?t:this.nonce.value))}runScripts(e=!1,t){return super.runScripts(e,(e=>{var n,r;return(null===(n=null==t?void 0:t(e))||void 0===n||n)&&!Et(e)&&!(-1!=(r=e).search(/\/faces[^.]*\.js.*ln=myfaces.testscripts.*/gi)||-1!=r.search(/\/jsf[^.]*\.js.*ln=myfaces.testscripts.*/gi))}))}runHeadInserts(e=!0){let t=At.byId(document.head),n=[];this.filter((function(n){if(!e)return!0;const r=n.tagName.value;if(!r)return!0;let s=n.attr("href").orElseLazy((()=>n.attr("src").value)).orElseLazy((()=>n.attr("rel").value));return!s.isPresent()||!t.querySelectorAll(`${r}[href='${s.value}']`).length&&!t.querySelectorAll(`${r}[src='${s.value}']`).length&&!t.querySelectorAll(`${r}[rel='${s.value}']`).length})).each((e=>{"SCRIPT"!=e.tagName.value?(new At(...n).runScripts(!0),n=[],t.append(e)):n.push(e)})),new At(...n).runScripts(!0)}static byId(e,t=!1){var n,r,s;const i=U.byId(e,t);if("development"==mt().getProjectStage().toLowerCase()&&(null===window||void 0===window?void 0:window.console)&&i.isAbsent()&&e){let t=null!==(s=null!==(r=null===(n=null==e?void 0:e.id)||void 0===n?void 0:n.value)&&void 0!==r?r:null==e?void 0:e.id)&&void 0!==s?s:e.toString();console.error("Element "+t+"not found")}return new At(i)}filter(e){return new At(super.filter(e))}}class St extends _{constructor(e){super(e),this.$nspEnabled=!0}assignIf(e,...t){const n=this.remap(t);return super.assignIf(e,...n)}assign(...e){const t=this.remap(e);return super.assign(...t)}append(...e){return super.append(...e)}appendIf(e,...t){const n=this.remap(t);return super.appendIf(e,...n)}getIf(...e){const t=this.remap(e);return super.getIf(...t)}get(e){return super.get(gt(e))}delete(e){return super.delete(gt(e))}static fromNullable(e){return new St(e)}getClass(){return St}shallowCopy$(){const e=super.shallowCopy$();return new St(e)}get deepCopy(){return new St(super.deepCopy$())}remap(e){return this.$nspEnabled?new a(...e).map((e=>gt(e))):e}}function xt(e,t,n){return(t=t||new _({})).getIf(n).orElseLazy((()=>e.getIf(n).value)).orElse(ie).value}function _t(e){if(!e.getIf(Z).isPresent())return(e,t)=>[e,t];const t=e.getIf(te).value+mt().separatorchar;return(e,n)=>0==e.indexOf(t)?[e,n]:[t+e,n]}function Rt(e){var t,n;return null!==(n=null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.windowId)&&void 0!==n?n:At.windowId.value}var Nt,It;!function(e){let t;function n(e,n,...r){var s,i;t=null!=t?t:new yt;let l=null!==(i=null!==(s=t[e])&&void 0!==s?s:n)&&void 0!==i?i:e;return r.forEach(((e,t)=>{l=l.replace(new RegExp(["\\{",t,"\\}"].join(le),"g"),e)})),l}function r(e,t,n,r,s,i){return new Error(i+(null!=r?r:"impl/util/Lang/")+s)}e.getLanguage=function(){var e,t,n;return(null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:null===navigator||void 0===navigator?void 0:navigator.language)&&void 0!==n?n:"en").split("-")[0]},e.failSaveResolve=function(e,t=null){return o.saveResolve(e,t)},e.failSaveExecute=function(e,t=null){o.saveResolve(e,t)},e.getMessage=n,e.keyValToStr=function(e,t,n="\n"){return[e,t].join(n)},e.makeException=r,e.getGlobalConfig=function(e,t){var n,r,s;return null!==(s=null===(r=null===(n=null===window||void 0===window?void 0:window.myfaces)||void 0===n?void 0:n.config)||void 0===r?void 0:r[e])&&void 0!==s?s:t},e.getForm=function(e,t){const s=new z(e),i=t?new z(function(e){var t,n;let r=e,s=null!==(n=null!==(t=null==r?void 0:r.srcElement)&&void 0!==t?t:null==r?void 0:r.target)&&void 0!==n?n:null==r?void 0:r.source;for(;s&&1!=s.nodeType;)s=s.parentNode;return s}(t)):U.absent;if(s.isTag(Xe))return s;if(s.attr(Xe).isPresent()){const e=s.attr(Xe).value,t=z.byId(e,!0);if(t.isPresent())return t}let l=s.firstParent(Xe).orElseLazy((()=>s.byTagName(Xe,!0))).orElseLazy((()=>i.firstParent(Xe))).orElseLazy((()=>i.byTagName(Xe))).first();return l=l.orElseLazy((()=>z.byTagName(Xe))),function(e){if(e.isAbsent()||e.length>1)throw r(new Error,0,0,"Impl","getForm",n("ERR_FORM"))}(l),l},e.getLocalOrGlobalConfig=function(e,t,n){var r,s,i,l,o,a,u;return null!==(u=null!==(l=null===(i=null===(s=null===(r=e.value)||void 0===r?void 0:r.myfaces)||void 0===s?void 0:s.config)||void 0===i?void 0:i[t])&&void 0!==l?l:null===(a=null===(o=null===window||void 0===window?void 0:window.myfaces)||void 0===o?void 0:o.config)||void 0===a?void 0:a[t])&&void 0!==u?u:n},e.ofAssoc=function(e){return new a(...Object.keys(e)).map((t=>[t,e[t]]))},e.collectAssoc=function(e,t){return e[t[0]]=t[1],e};let s={};e.debounce=function(e,t,n){function r(){clearTimeout(s[e]),delete s[e]}(null==s?void 0:s[e])&&r(),n>0?s[e]=setTimeout((()=>{try{t()}finally{r()}}),n):t()}}(Nt||(Nt={})),function(e){function t(t,n="",r="",s="Assertion Error"){if(!t)throw e.raiseError(new Error,n,r,s)}function n(t,n,r="",s="",i="Type Assertion Error"){if(t&&!o.assertType(t,n))throw e.raiseError(new Error,r,s,i)}function r(e,t="",r="",s="Assertion Error"){n(e,"function",t,r,s)}e.assertRequestIntegrity=function(e,n){r(e.getIf(ye).value),r(e.getIf(Ee).value),t(n.isPresent(),Nt.getMessage("ERR_MUST_BE_PROVIDED1","{0}: source must be provided or exist","source element id"),"faces.ajax.request","ArgNotSet")},e.assertUrlExists=function(t){if(t.attr("url").isAbsent())throw e.raiseError(new Error,Nt.getMessage("ERR_RED_URL",void 0,"processRedirect"),"processRedirect")},e.assertValidXMLResponse=function(e){t(!e.isAbsent(),Re,Ke),t(!e.isXMLParserError(),e.parserErrorText(le),Ke),t(e.querySelectorAll(Ye).isPresent(),"Partial response not set",Ke)},e.raiseError=function(e,t,n,r,s){let i=null!=r?r:Ne,l=null!=s?s:Ne,o=null!=t?t:le;return Nt.makeException(e,i,l,"Response",n||(arguments.caller?arguments.caller.toString():"_raiseError"),o)},e.assert=t,e.assertType=n,e.assertFunction=r,e.assertDelay=function(e){if(!(e>=0))throw new Error("Invalid delay value: "+e)}}(It||(It={}));class Ct{static createFromRequest(e,t,n,r){let s=new Ct;if(s.type="event",s.status=r,s.source=t.getIf("_source","_element").value,!s.source){let e=n.getIf(be).orElseLazy((()=>n.getIf(ee).value)).orElseLazy((()=>n.getIf($e,ee).value)).value;e&&(s.source=z.byId(e,!0).first().value.value),s.source&&(t.assign("_source","_element").value=s.source)}return r!==we&&(s.responseCode=null==e?void 0:e.status,s.responseText=null==e?void 0:e.responseText,s.responseXML=null==e?void 0:e.responseXML),s}}const Tt=Nt.getMessage;var Ot;!function(e){e.SERVER_ERROR="serverError",e.HTTP_ERROR="httpError",e.CLIENT_ERROR="clientError",e.TIMEOUT="timeout"}(Ot||(Ot={}));class Mt extends Ct{constructor(e,t,n,r=null,s=null,i=-1,l=null,o=Ot.CLIENT_ERROR){super(),this.type="error",this.source=z.byId(e).value.orElse(e).value,this.type="error",this.errorName=t,this.errorMessage=o==Ot.SERVER_ERROR?o+": "+n:n,this.responseCode=i,this.responseText=r,this.responseXML=s,this.status=l,this.description=`Status: ${this.status}\nResponse Code: ${this.responseCode}\nError Message: ${this.errorMessage}`,this.typeDetails=o,o==Ot.SERVER_ERROR&&(this.serverErrorName=this.errorName,this.serverErrorMessage=this.errorMessage)}static fromClient(e){var t,n,r,s;return new Mt(null!==(t=null==e?void 0:e.source)&&void 0!==t?t:"client",null!==(n=null==e?void 0:e.name)&&void 0!==n?n:le,null!==(r=null==e?void 0:e.message)&&void 0!==r?r:le,null!==(s=null==e?void 0:e.stack)&&void 0!==s?s:le)}static fromHttpConnection(e,t,n,r,s,i,l=""){return new Mt(e,t,n,r,s,i,l,Ot.HTTP_ERROR)}static fromGeneric(e,t,n=Ot.SERVER_ERROR){let r=this.getMsg,s=r(e,be),i=r(e,Ae),l=r(e,Se),o=r(e,"status"),a=r(e,"responseText"),u=e.getIf(xe).value;return new Mt(s,i,l,a,u,t,o,n)}static getMsg(e,t){return Tt(e.getIf(t).orElse(le).value)}static fromServerError(e){return this.fromGeneric(e,-1)}}class kt{constructor(e,t){this.id=e,this.value=t;let n=e.indexOf(re);this.nameSpace=n>0?e.substr(0,n-1):le}get hasNameSpace(){var e;return!!(null!==(e=null==this?void 0:this.nameSpace)&&void 0!==e?e:le).length}}class Pt{constructor(e){this.namedViewRoot=!1;const t=e.includes(gt(re));this.name=t?re:se,this.template=t?oe:ae}withNamingContainerId(e){return this.namingContainerId=e,this}withParent(e){return this.parent=e,this}withNamedViewRoot(e){return this.namedViewRoot=e,this}build(){var e;const t=z.fromMarkup(gt(this.template));return t.id.value=this.buildId(),t.name.value=this.buildName(),null===(e=this.parent)||void 0===e||e.append(t),t}buildId(){var e;const t=mt().separatorchar;return((null===(e=this.namingContainerId)||void 0===e?void 0:e.length)?[this.namingContainerId,gt(this.name),this.nextIndex()]:[gt(this.name),this.nextIndex()]).join(t)}buildName(){var e;return this.namedViewRoot&&(null===(e=this.namingContainerId)||void 0===e?void 0:e.length)?[this.namingContainerId,gt(this.name)].join(mt().separatorchar):gt(this.name)}nextIndex(){const e=mt().separatorchar;return W(`[name*='${gt(this.name)}']`).asArray.map((e=>e.id.orElse("0").value)).map((t=>t.substring(t.lastIndexOf(e)+1))).map((e=>parseInt(e))).filter((e=>!isNaN(e))).reduce(((e,t)=>Math.max(e,t)),0)+1}}const jt=o.trim,Dt=Nt.ofAssoc;class Lt{constructor(e,t,n){this.request=e,this.externalContext=t,this.internalContext=n}replaceHead(e){const t=e.querySelectorAll(We);if(!t.isPresent())return;const n=At.querySelectorAll(We);n.childNodes.delete(),this.addToHead(t),n.copyAttrs(t)}addToHead(e){const t=new At(e),n=["SCRIPT"];t.filter((e=>-1==n.indexOf(e.tagName.orElse("").value))).runHeadInserts(!0);const r="HEAD"===e.tagName.value?e.childNodes:e,s=new U(...r.asArray.filter((e=>-1!=n.indexOf(e.tagName.orElse("").value))));this.addToHeadDeferred(s)}addToHeadDeferred(e){this.internalContext.assign(dt).value.push(e)}replaceBody(e){const t=e.querySelectorAll(Ge);if(!t.isPresent())return;const n=t.innerHTML,r=At.querySelectorAll(Ge),s=r.querySelectorAll(Xe);r.html(n).copyAttrs(t),this.externalContext.assign(gt(fe)).value="@all",this.storeForPostProcessing(s,r)}eval(e){At.globalEval(e.cDATAAsString)}error(e){const t=new St({});t.assign(be).value=this.externalContext.getIf(ee).get(0).value,t.assign(Ae).value=e.querySelectorAll(Ae).textContent(le),t.assign(Se).value=e.querySelectorAll(Se).cDATAAsString;const n=this.internalContext.get(xe).isPresent();t.assignIf(n,xe).value=this.internalContext.getIf(xe).value.get(0).value;const r=Mt.fromServerError(t);this.triggerOnError(r),Kt.sendError(r)}redirect(e){It.assertUrlExists(e);const t=jt(e.attr("url").value);t!=le&&(window.location.href=t)}update(e,t){const n=At.byId(e.id.value,!0).outerHTML(t,!1,!1),r=null==n?void 0:n.firstParent(Xe).orElseLazy((()=>n.byTagName(Xe,!0)));r&&this.storeForPostProcessing(r,n)}delete(e){z.byId(e.id.value,!0).delete()}attributes(e){const t=z.byId(e.id.value,!0);e.byTagName("attribute").each((e=>{t.attr(e.attr("name").value).value=e.attr("value").value}))}replaceViewRoot(e){this.replaceHead(e),this.replaceBody(e)}insert(e){const t=e.attr(at),n=e.attr(ut),r=z.fromMarkup(e.cDATAAsString);t.isPresent()&&(z.byId(t.value,!0).insertBefore(r),this.internalContext.assign(ht).value.push(r)),n.isPresent()&&(z.byId(n.value,!0).insertAfter(r),this.internalContext.assign(ht).value.push(r))}insertWithSubTags(e){const t=e.querySelectorAll(at),n=e.querySelectorAll(ut);t.each((e=>{const t=e.attr("id"),n=z.fromMarkup(e.cDATAAsString);t.isPresent()&&(z.byId(t.value,!0).insertBefore(n),this.internalContext.assign(ht).value.push(n))})),n.each((e=>{const t=e.attr("id"),n=z.fromMarkup(e.cDATAAsString);t.isPresent()&&(z.byId(t.value,!0).insertAfter(n),this.internalContext.assign(ht).value.push(n))}))}processViewState(e){if(Lt.isViewStateNode(e)){const t=e.cDATAAsString;return this.internalContext.assign(ft,e.id.value).value=new kt(gt(e.id.value),t),!0}return!1}processClientWindow(e){if(Lt.isClientWindowNode(e)){const t=e.cDATAAsString;return this.internalContext.assign(pt,e.id.value).value=new kt(gt(e.id.value),t),!0}return!1}globalEval(){new At(...this.internalContext.getIf(dt).value).runHeadInserts(!0);let e=new At(...this.internalContext.getIf(ht).value);e.runCss(),e.runScripts()}fixViewStates(){Dt(this.internalContext.getIf(ft).orElse({}).value).forEach((([,e])=>{const t=this.internalContext.getIf(te),n=!!this.internalContext.getIf(Z).value,r=this.getContainerForms(t).filter((e=>this.isInExecuteOrRender(e)));this.appendViewStateToForms(r,n,e.value,t.orElse("").value)}))}fixClientWindow(){Dt(this.internalContext.getIf(pt).orElse({}).value).forEach((([,e])=>{const t=this.internalContext.getIf(te),n=!!this.internalContext.getIf(Z).value,r=this.getContainerForms(t).filter((e=>this.isInExecuteOrRender(e)));this.appendClientWindowToForms(r,n,e.value,t.orElse("").value)}))}updateNamedViewRootState(){let e=this.internalContext.getIf(te),t=this.internalContext.getIf(Z);if(e.isPresent()&&(t.isAbsent()||!t.value)){const t=mt().separatorchar;this.internalContext.assign(Z).value=!!document.getElementById(e.value)||W(`input[name*='${gt(re)}']`).filter((n=>0==n.attr("name").value.indexOf(e.value+t))).length>0}}done(){const e=Ct.createFromRequest(this.request.value,this.internalContext,this.externalContext,"success"),t=this.externalContext.getIf(Ee).orElseLazy((()=>this.internalContext.getIf(Ee).value)).orElse(ie).value;Kt.sendEvent(e,t)}appendViewStateToForms(e,t,n,r=""){this.assignState(e,gt(Qe),t,n,r)}appendClientWindowToForms(e,t,n,r=""){this.assignState(e,gt(Je),t,n,r)}assignState(e,t,n,r,s){e.each((e=>{e.querySelectorAll(t).orElseLazy((()=>(e=>new Pt(t).withNamingContainerId(s).withParent(e).withNamedViewRoot(n).build())(e))).val=r}))}storeForPostProcessing(e,t){this.storeForUpdate(e),this.storeForEval(t)}storeForUpdate(e){this.internalContext.assign(ct).value.push(e)}storeForEval(e){this.internalContext.assign(ht).value.push(e)}static isViewStateNode(e){var t,n,r,s,i,l;const o=mt().separatorchar;return void 0!==(null===(t=null==e?void 0:e.id)||void 0===t?void 0:t.value)&&((null===(n=null==e?void 0:e.id)||void 0===n?void 0:n.value)==gt(re)||-1!=(null===(s=null===(r=null==e?void 0:e.id)||void 0===r?void 0:r.value)||void 0===s?void 0:s.indexOf([o,gt(re)].join(le)))||-1!=(null===(l=null===(i=null==e?void 0:e.id)||void 0===i?void 0:i.value)||void 0===l?void 0:l.indexOf([gt(re),o].join(le))))}static isClientWindowNode(e){var t,n,r,s,i,l;const o=mt().separatorchar;return void 0!==(null===(t=null==e?void 0:e.id)||void 0===t?void 0:t.value)&&((null===(n=null==e?void 0:e.id)||void 0===n?void 0:n.value)==gt(se)||-1!=(null===(s=null===(r=null==e?void 0:e.id)||void 0===r?void 0:r.value)||void 0===s?void 0:s.indexOf([o,gt(se)].join(le)))||-1!=(null===(l=null===(i=null==e?void 0:e.id)||void 0===i?void 0:i.value)||void 0===l?void 0:l.indexOf([gt(se),o].join(le))))}triggerOnError(e){this.externalContext.getIf(ye).orElseLazy((()=>this.internalContext.getIf(ye).value)).orElse(ie).value(e)}isInExecuteOrRender(e){const t=this.externalContext.getIf(gt(de)).orElse("@none").value.split(/\s+/gi),n=this.externalContext.getIf(fe).orElseLazy((()=>this.externalContext.getIf(gt(ve)).value)).orElse(ce).value.split(/\s+/gi);return[...t.concat(...n)].filter((t=>{if(-1!=[ue,ce].indexOf(t))return!0;const n=this.getNameOrIdSelector(t);return e.matchesSelector(n)||e.querySelectorAll(n).isPresent()||e.firstParent(n).isPresent()})).length>0}getContainerForms(e){return e.isPresent()?W(this.getNameOrIdSelector(e.value)).orElseLazy((()=>z.byTagName(Ge))).byTagName(Xe,!0):z.byTagName(Xe)}getNameOrIdSelector(e){return`[id='${e}'], [name='${e}']`}}var qt;!function(e){e.processResponse=function(e,n){let r=St.fromNullable(e),{externalContext:s,internalContext:i}=function(e){let t=St.fromNullable(e),n=t.getIf(Oe);return n.isPresent()||(n=St.fromNullable({})),n.assign(dt).value=[],n.assign(ct).value=[],n.assign(ht).value=[],{externalContext:t,internalContext:n}}(n),l=function(e){let t=new Q(gt(e.getIf("responseXML").value));return It.assertValidXMLResponse(t),t}(r),o=new Lt(r,s,i);i.assign(xe).value=l,l.querySelectorAll(Ye).each((e=>function(e,n,r){var s;let i=null===(s=null==e?void 0:e.id)||void 0===s?void 0:s.value;r.assignIf(!!i,te).value=i,n.updateNamedViewRootState();const l=[st,ot,Ze].join(",");e.querySelectorAll(l).each((e=>{switch(e.tagName.value){case st:n.error(e);break;case ot:n.redirect(e);break;case Ze:!function(e,n){const r=[et,rt,nt,tt,it,lt].join(", ");e.querySelectorAll(r).each((e=>{switch(e.tagName.value){case et:!function(e,t){(function(e,t){return e.processViewState(t)||e.processClientWindow(t)})(t,e)||function(e,t){let n=e.cDATAAsString;switch(e.id.value){case gt("jakarta.faces.ViewRoot"):t.replaceViewRoot(z.fromMarkup(n.substring(n.indexOf("<html"))));break;case gt("jakarta.faces.ViewHead"):t.replaceHead(z.fromMarkup(n));break;case gt("jakarta.faces.ViewBody"):t.replaceBody(z.fromMarkup(n));break;case gt("jakarta.faces.Resource"):t.addToHead(z.fromMarkup(n));break;default:t.update(e,n)}}(e,t)}(e,n);break;case rt:n.eval(e);break;case nt:t(n,e);break;case tt:n.delete(e);break;case it:n.attributes(e)}}))}(e,n)}}))}(e,o,i))),o.updateNamedViewRootState(),o.fixViewStates(),o.fixClientWindow(),o.globalEval(),o.done()};let t=function(e,t){t.querySelectorAll([at,ut].join(",")).length?e.insertWithSubTags(t):e.insert(t)}}(qt||(qt={}));class Ft{constructor(){this.catchFunctions=[],this.thenFunctions=[]}resolve(e){this.thenFunctions.reduce(((e,t)=>t(e)),e)}reject(e){this.catchFunctions.reduce(((e,t)=>t(e)),e)}catch(e){return this.catchFunctions.push(e),this}finally(e){return this.catchFunctions.push(e),this.thenFunctions.push(e),this}then(e){return this.thenFunctions.push(e),this}}function Ht(e,t=(e,t)=>[e,t],n=""){if(e.isAbsent())return n;const r=e.value;return new a(...Object.keys(r)).filter((e=>r.hasOwnProperty(e))).flatMap((e=>r[e].map((n=>t(e,n))))).filter((([,e])=>!(e instanceof At.global().File))).map((e=>`${encodeURIComponent(e[0])}=${encodeURIComponent(e[1])}`)).join("&")}function Vt(e){var t,n;return e.length<3?[null!==(t=null==e?void 0:e[0])&&void 0!==t?t:[],null!==(n=null==e?void 0:e[1])&&void 0!==n?n:[]]:e}const $t=Nt.ofAssoc,Bt=(e,t)=>[e,t];class Ut extends _{constructor(e,t=Bt,n,r){super({}),this.paramsMapper=t,this.isMultipartRequest=!1,this.initFormData(e,n,r)}toFormData(){return this.buildFormData()}toString(e=""){return Ht(this,this.paramsMapper,e)}initFormData(e,t,n){this.detectMultipartRequest(e,t),this.encodeSubmittableFields(e,n),this.applyViewState(e)}detectMultipartRequest(e,t){t&&!t.includes(ce)&&(this.isMultipartRequest=e.isMultipartCandidate(!0))}applyViewState(e){if(this.getIf(gt(re)).isPresent())return;const t=e.querySelectorAllDeep(`[name*='${gt(re)}'`),n=t.inputValue;this.appendIf(n.isPresent(),this.remapKeyForNamingContainer(t.name.value)).value=n.value}encodeSubmittableFields(e,t=[]){const n=t.map((e=>this.remapKeyForNamingContainer(e)));(function(e){const t=function(e){return mt().getViewState(e.getAsElem(0).value).split("&").filter((e=>!!(e||"").replace(/\s+/g,""))).map((e=>{let t=decodeURIComponent(e),n=t.indexOf("=");return-1===n?[t]:[t.substring(0,n),t.substring(n+1)]}))}(e),n=e.querySelectorAllDeep("input[type='file']").asArray.map((e=>[e.name.value||e.id.value,e.filesFromElem(0)])).flatMap((([e,t])=>[...t].map((t=>[e,t]))));return t.concat(n)})(e).map(Vt).map((([e,t])=>this.paramsMapper(e,t))).filter((([e])=>this.isFieldIncluded(e,n))).forEach((([e,t])=>this.append(e).value=t))}isFieldIncluded(e,t){return!(t.length&&!e.startsWith("@"))||t.includes(e)}buildFormData(){return $t(this.value).flatMap((([e,t])=>Array.isArray(t)?new a(...t).map((t=>({key:e,value:t}))):[{key:e,value:t}])).map((({key:e,value:t})=>({key:this.remapKeyForNamingContainer(e),value:t}))).reduce(((e,{key:t,value:n})=>(e.append(t,n),e)),new FormData)}remapKeyForNamingContainer(e){const[t]=this.paramsMapper(e,le);return t}}const zt=Nt.failSaveExecute;class Wt extends Ft{constructor(e,t,n=0,r=ze,s="application/x-www-form-urlencoded"){super(),this.requestContext=e,this.internalContext=t,this.timeout=n,this.ajaxType=r,this.contentType=s,this.ERR_INVALID_RESPONSE="Invalid Response",this.ERR_EMPTY_RESPONSE="Empty Response",this.stopProgress=!1,this.xhrObject=new XMLHttpRequest,this.registerXhrCallbacks((e=>this.resolve(e)),(e=>this.reject(e)))}start(){const e=zt,t=this.xhrObject,n=z.byId(this.internalContext.getIf(Me).value);try{const r=this.requestContext.getIf($e,de).get(ce).value.split(/\s+/gi),s=!0===this.internalContext.getIf(Be).value?r:[],i=new Ut(n,_t(this.internalContext),r,s);this.requestContext.$nspEnabled=!1;const l=this.requestContext,o=l.getIf($e);o.$nspEnabled=!1;try{i.shallowMerge(o,!0,!0)}finally{this.requestContext.$nspEnabled=!0,o.$nspEnabled=!0}this.appendIssuingItem(i),this.responseContext=o.deepCopy;const a=this.responseContext;a.assign(Oe).value=this.internalContext.value,a.assign(Ee).value=l.getIf(Ee).value,a.assign(ye).value=l.getIf(ye).value,t.open(this.ajaxType,function(e,t,n=ze){return function(e){const t=e.elements;return void 0===t[Ue]?e.action:t[Ue].value}(e.getAsElem(0).value)+("GET"==n?"?"+t.toString():le)}(n,i,this.ajaxType),!0),this.timeout&&(t.timeout=this.timeout),i.isMultipartRequest||e((()=>t.setRequestHeader("Content-Type",`${this.contentType}; charset=utf-8`))),e((()=>t.setRequestHeader("Faces-Request","partial/ajax"))),e((()=>t.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"))),this.sendEvent(we),this.sendRequest(i)}catch(e){throw this.handleErrorAndClearQueue(e),e}return this}cancel(){try{this.xhrObject.abort()}catch(e){this.handleError(e)}}registerXhrCallbacks(e,t){const n=this.xhrObject;n.onabort=()=>{this.onAbort(e,t)},n.ontimeout=()=>{this.onTimeout(e,t)},n.onload=()=>{this.onResponseReceived(e)},n.onloadend=()=>{this.onResponseProcessed(this.xhrObject,e)},this.registerUploadCallbacks(n),n.onerror=e=>{if(this.isCancelledResponse(this.xhrObject))return this.stopProgress=!0,void t();this.stopProgress||this.handleError(e)}}registerUploadCallbacks(e){var t,n;(null==e?void 0:e.upload)&&(null===(n=(t=this.internalContext.getIf(Pe)).value)||void 0===n||n.call(t,e.upload),e.upload.addEventListener("progress",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(ke)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("load",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(Le)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("loadstart",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(je)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("loadend",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(De)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("abort",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(Fe)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("timeout",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(He)).value)||void 0===r||r.call(n,e.upload,t)})),e.upload.addEventListener("error",(t=>{var n,r;null===(r=(n=this.internalContext.getIf(qe)).value)||void 0===r||r.call(n,e.upload,t)})))}isCancelledResponse(e){return 0===(null==e?void 0:e.status)&&4===(null==e?void 0:e.readyState)&&""===(null==e?void 0:e.responseText)&&null===(null==e?void 0:e.responseXML)}onAbort(e,t){this.handleHttpError(t)}onTimeout(e,t){this.sendEvent("TIMEOUT_EVENT"),this.handleHttpError(e)}onResponseReceived(e){var t;this.sendEvent("complete"),this.processRequestErrors(e)||mt().ajax.response(this.xhrObject,null!==(t=this.responseContext.value)&&void 0!==t?t:{})}processRequestErrors(e){var t,n,r,s,i;const l=new Q(null===(t=this.xhrObject)||void 0===t?void 0:t.responseXML),o=null!==(r=null===(n=this.xhrObject)||void 0===n?void 0:n.responseText)&&void 0!==r?r:"",a=null!==(i=null===(s=this.xhrObject)||void 0===s?void 0:s.status)&&void 0!==i?i:-1;return a>=300||a<200?(this.handleHttpError(e),!0):l.isXMLParserError()||l.isAbsent()&&o.trim().length>0?(this.handleGenericResponseError(this.ERR_INVALID_RESPONSE,"The response xml is invalid",Ne,e),!0):!!l.isAbsent()&&(this.handleGenericResponseError(this.ERR_EMPTY_RESPONSE,"The response has provided no data",Re,e),!0)}handleGenericResponseError(e,t,n,r){var s,i,l,o;const a=new Mt(this.internalContext.getIf(Ve).value,e,t,null!==(i=null===(s=this.xhrObject)||void 0===s?void 0:s.responseText)&&void 0!==i?i:"",null!==(o=null===(l=this.xhrObject)||void 0===l?void 0:l.responseXML)&&void 0!==o?o:null,this.xhrObject.status,n);this.finalizeError(a,r)}handleHttpError(e,t="Generic HTTP Error"){var n,r,s,i,l,o;this.stopProgress=!0;const a=new Mt(this.internalContext.getIf(Ve).value,_e,t,null!==(r=null===(n=this.xhrObject)||void 0===n?void 0:n.responseText)&&void 0!==r?r:"",null!==(i=null===(s=this.xhrObject)||void 0===s?void 0:s.responseXML)&&void 0!==i?i:null,null!==(o=null===(l=this.xhrObject)||void 0===l?void 0:l.status)&&void 0!==o?o:-1,_e);this.finalizeError(a,e)}finalizeError(e,t){try{this.handleError(e,!0)}finally{t(e),this.stopProgress=!0}}onResponseProcessed(e,t){this.stopProgress||t(e)}sendRequest(e){"GET"!==this.ajaxType?this.xhrObject.send(e.isMultipartRequest?e.toFormData():e.toString()):this.xhrObject.send(null)}sendEvent(e){var t;const n=Ct.createFromRequest(this.xhrObject,this.internalContext,this.requestContext,e);try{const e=xt(this.requestContext,this.responseContext,Ee);Kt.sendEvent(n,e)}catch(e){throw e.source=null!==(t=null==e?void 0:e.source)&&void 0!==t?t:this.requestContext.getIf(be).value,this.handleErrorAndClearQueue(e),e}}handleErrorAndClearQueue(e,t=!1){this.handleError(e,t),this.reject(e)}handleError(e,t=!1){var n;const r=t?Mt.fromHttpConnection(e.source,e.type,null!==(n=e.message)&&void 0!==n?n:le,e.responseText,e.responseXML,e.responseCode,e.status):Mt.fromClient(e),s=xt(this.requestContext,this.responseContext,ye);Kt.sendError(r,s)}appendIssuingItem(e){var t,n;const r=this.internalContext.getIf(Ve).value,s=null!==(n=null===(t=e.getIf(gt(me)).value)||void 0===t?void 0:t[0])&&void 0!==n?n:null,i=!!s&&"click"!==s;if(r&&e.getIf(r).isAbsent()&&!i){const t=z.byId(r),n=t.inputValue,s=new St({}),i=t.type.orElse("").value.toLowerCase(),l=i===Wt.TYPE_CHECKBOX||i===Wt.TYPE_RADIO;if(l&&!t.checked)return;l?s.assign(r).value=n.orElse(!0).value:n.isPresent()&&(s.assign(r).value=n.value),e.shallowMerge(s,!0,!0)}}}Wt.TYPE_CHECKBOX="checkbox",Wt.TYPE_RADIO="radio";const Xt=Nt.debounce;class Gt{constructor(){this.queue=[],this.taskRunning=!1,this.debounceKey="xhrQueue_"+Gt.instanceCount++}enqueue(e,t=0){Xt(this.debounceKey,(()=>{const t=this.enrichRunnable(e);this.taskRunning?this.queue.push(t):(this.signalTaskRunning(),t.start())}),t)}next(){this.updateTaskRunning();const e=this.queue.shift();null==e||e.start()}clear(){this.queue.length=0,this.updateTaskRunning()}get isEmpty(){return!this.queue.length}enrichRunnable(e){return e.then((()=>this.next())).catch((()=>this.clear()))}signalTaskRunning(){this.taskRunning=!0}updateTaskRunning(){this.taskRunning=!this.isEmpty}}var Qt,Jt,Kt,Yt,Zt,en,tn;Gt.instanceCount=0,function(e){e.Production="Production",e.Development="Development",e.SystemTest="SystemTest",e.UnitTest="UnitTest"}(Qt||(Qt={})),function(e){e.onerror="onerror",e.onevent="onevent",e.render="render",e.execute="execute",e.myfaces="myfaces",e.delay="delay",e.timeout="timeout",e.resetValues="resetValues",e.windowId="windowId",e.params="params"}(Jt||(Jt={})),function(e){const t=o.trim,n=Nt.getMessage,r=Nt.getGlobalConfig;var s=It.assert;const i=Nt.ofAssoc,l=Nt.collectAssoc;let a=null,u=null,c=[],d=[];function v(){const e=At.searchJsfJsFor(/stage=([^&;]*)/).value;return e in Qt?e:Qt.Production}function f(e,t=function(e){}){t(e),d.forEach((t=>{t(e)})),r("defaultErrorOutput",console?console.error:alert)(e)}function p(e,t){const n=function(e){const t=e.querySelectorAll(`input[type='hidden'][name*='${gt(re)}']`).attr("name").orElse("").value,n=mt().separatorchar,r=t.split(n,2)[0];return-1===r.indexOf(gt(re))?r:""}(t);n&&(e.assign(Z).value=!0,e.assign(te).value=n)}function m(e,n,r,s,i,l=""){const o=mt().separatorchar;let a=r?t(r).split(/\s+/gi):[],u=[],c={};const h=e=>{const t=l.length?l+o:le;let n=s.id.value;const r=n.substring(0,n.lastIndexOf(o)),i=r.length?r+o:le,a=0===e.indexOf(o);let u;return a||l.length&&0==e.indexOf(t)?u=[t,e=0==(e=a?e.substring(1):e).indexOf(t)?e.substring(t.length):e].join(le):(0==n.indexOf(t)&&(n=n.substring(t.length)),u=0==e.indexOf(n)?[t,e].join(le):[i,e].join(le)),z.byId(u).isPresent()?u:e};for(let t=0;t<a.length;t++)if(!(a[t]in c))switch(a[t]){case ce:return e.delete(n);case ue:return e.assign(n).value=ue,e;case"@form":u.push(h(s.id.value)),c[s.id.value]=!0;break;case he:i in c||(u.push(h(i)),c[i]=!0);break;default:u.push(h(a[t])),c[a[t]]=!0}return e.assign(n).value=u.join(" "),e}function g(){var e,t;return null!==(t=null===(e=null===window||void 0===window?void 0:window[vt])||void 0===e?void 0:e.config)&&void 0!==t?t:{}}e.requestQueue=null,e.getSeparatorChar=function(){var e,t;return null!==(t=null===(e=g())||void 0===e?void 0:e.separator)&&void 0!==t?t:null!=u?u:u=At.searchJsfJsFor(/separator=([^&;]*)/).orElse(":").value},e.reset=function(){a=null,u=null,c=[],d=[],e.requestQueue=null},e.getProjectStage=function(){var e,t;return null!==(t=null===(e=g())||void 0===e?void 0:e.projectStage)&&void 0!==t?t:null!=a?a:a=v()},e.resolveProjectStateFromURL=v,e.chain=function(e,n,...r){let s=!0;return r.every((r=>{let i=function(e,n,r){if("string"!=typeof r)return!1!==r.call(e,n);{let s=t(r);return 0==s.indexOf("function ")&&(s=`return ${s} (event)`),!1!==new Function("event",s).call(e,n)}}(e,n,r);return!1===i&&(s=!1),s})),s},e.request=function(t,n,r){var s,o,a,u,c,h,d,v,f,g,y,E,w,b,A,S,x,R,N,I,C,T,O,M,k,P,j,D,L;const{options:q,elem:F,elementId:H,windowId:V,isResetValues:$}=function(e,t,n=null){var r;const s=z.byId(n||e.target,!0),i=new St(t).deepCopy;return{options:i,elem:s,elementId:s.id.value,windowId:Rt(i),isResetValues:!0===(null===(r=i.value)||void 0===r?void 0:r.resetValues)}}(n,r,t),B=new St({}),U=new St({});It.assertRequestIntegrity(q,F);const W=function(e,t){return Nt.getForm(e.getAsElem(0).value,t)}(F,n),X=function(e){const t=e.querySelectorAll(`input[type='hidden'][name*='${gt(re)}']`).id.orElse("").value,n=mt().separatorchar,r=t.split(n,2)[0],s=-1===r.indexOf(gt(re))?r:"";return 0===e.id.value.indexOf(s)?s:""}(W),G=W.id.value,Q=function(e){let t=e.getIf("delay").orElse(0).value;return t="none"===t?0:t,It.assertDelay(t),t}(q),J=function(e){var t;let n=Nt.getLocalOrGlobalConfig;return null!==(t=e.getIf(Ce).value)&&void 0!==t?t:n(e.value,Ce,0)}(q);var K;B.assignIf(!!V,pe).value=V,B.assign($e).value=(K=q.value,i(K).filter((e=>!(e[0]in Jt))).reduce(l,{}));const Y=(Z=q.getIf(Ie).orElse({}).value,Array.isArray(Z)?Z.reduce(l,{}):Z);var Z;let te=B.getIf($e);var ie,le,oe,ae;te.$nspEnabled=!1,te.shallowMerge(new _(Y),!0),te.$nspEnabled=!0,B.assignIf(!!n,$e,"jakarta.faces.partial.event").value=null==n?void 0:n.type,B.assign(be).value=H,B.assign(ne).value=X,B.assign(Ee).value=null===(s=q.value)||void 0===s?void 0:s.onevent,B.assign(ye).value=null===(o=q.value)||void 0===o?void 0:o.onerror,B.assign(vt).value=null===(a=q.value)||void 0===a?void 0:a.myfaces,B.assign($e,ee).value=H,B.assign($e,"jakarta.faces.partial.ajax").value=!0,B.assignIf($,$e,"jakarta.faces.partial.resetValues").value=!0,U.assign(Me).value=G,U.assign(Pe).value=null===(h=null===(c=null===(u=q.value)||void 0===u?void 0:u.myfaces)||void 0===c?void 0:c.upload)||void 0===h?void 0:h.preinit,U.assign(je).value=null===(f=null===(v=null===(d=q.value)||void 0===d?void 0:d.myfaces)||void 0===v?void 0:v.upload)||void 0===f?void 0:f.loadstart,U.assign(ke).value=null===(E=null===(y=null===(g=q.value)||void 0===g?void 0:g.myfaces)||void 0===y?void 0:y.upload)||void 0===E?void 0:E.progress,U.assign(De).value=null===(A=null===(b=null===(w=q.value)||void 0===w?void 0:w.myfaces)||void 0===b?void 0:b.upload)||void 0===A?void 0:A.loadend,U.assign(Le).value=null===(R=null===(x=null===(S=q.value)||void 0===S?void 0:S.myfaces)||void 0===x?void 0:x.upload)||void 0===R?void 0:R.load,U.assign(qe).value=null===(C=null===(I=null===(N=q.value)||void 0===N?void 0:N.myfaces)||void 0===I?void 0:I.upload)||void 0===C?void 0:C.error,U.assign(Fe).value=null===(M=null===(O=null===(T=q.value)||void 0===T?void 0:T.myfaces)||void 0===O?void 0:O.upload)||void 0===M?void 0:M.abort,U.assign(He).value=null===(j=null===(P=null===(k=q.value)||void 0===k?void 0:k.myfaces)||void 0===P?void 0:P.upload)||void 0===j?void 0:j.timeout,B.assign($e,G).value=G,U.assign(Ve).value=H,U.assign(Be).value=null!==(L=null===(D=function(e){var t;return null===(t=i(e).filter((e=>"myfaces"==e[0])).reduce(l,{}))||void 0===t?void 0:t[vt]}(q.value))||void 0===D?void 0:D.pps)&&void 0!==L&&L,function(e,t){let n=mt().getClientWindow(e.getAsElem(0).value);n&&(t.assign($e,se).value=n)}(W,B),le=B,oe=W,ae=H,(ie=q).getIf(Te).isPresent()?(ie.assign(Te).value=[ie.getIf(Te).value,he].join(" "),m(le.getIf($e).get({}),de,ie.getIf(Te).value,oe,ae,le.getIf(ne).value)):le.assign($e,de).value=ae,function(e,t,n,r){e.getIf(ge).isPresent()&&m(t.getIf($e).get({}),ve,e.getIf(ge).value,n,r,t.getIf(ne).value)}(q,B,W,H),p(U,W),e.queueHandler.addRequestToQueue(F,W,B,U,Q,J)},e.response=function(e,t){qt.processResponse(e,t)},e.addOnError=function(e){d.push(e)},e.addOnEvent=function(e){c.push(e)},e.sendEvent=function(e,t=function(e){}){t(e),c.forEach((t=>t(e)))},e.stdErrorHandler=function(t,n,r,s=!1){try{f(Mt.fromClient(r))}finally{s&&(null===e.requestQueue||void 0===e.requestQueue||e.requestQueue.clear())}},e.sendError=f,e.getClientWindow=function(e){const t="___mf_id_altered__",n="___init____";let r=e?z.byId(e):W("form"),i=r.filterSelector(`input[name='${gt(se)}']`).orElseLazy((()=>r.querySelectorAll(`input[name='${gt(se)}']`))).asArray.map((e=>e.val)).reduce(((e,r)=>e==n?r:e==t||e!=r?t:r),n);return s(t!=i,"Multiple different windowIds found in document"),i!=n?i:(function(){const e=window.location.href,t=new RegExp("[\\?&]jfwid=([^&#\\;]*)").exec(e);return null!=t?h.fromNullable(t[1]):h.fromNullable(null)}()||At.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null)).value},e.getViewState=function(e){let t=z.byId(e,!0);if(!t.isTag(Xe))throw new Error(n("ERR_VIEWSTATE"));const r=new _({});p(r,z.byId(e));let s=t.deepElements.encodeFormElement();return Ht(new St(s),_t(r))},e.queueHandler={addRequestToQueue:function(t,n,r,s,i=0,l=0){e.requestQueue=null!==e.requestQueue&&void 0!==e.requestQueue?e.requestQueue:new Gt,e.requestQueue.enqueue(new Wt(r,s,l),i)}}}(Kt||(Kt={})),function(e){const t=z.global().location.protocol.replace("http","ws")+"//";e.sockets={},e.components={},e.clientIdsByTokens={},e.reset=function(){Object.values(e.sockets).forEach((e=>{try{e.close()}catch(e){}})),e.sockets={},e.components={},e.clientIdsByTokens={}},e.init=function(r,i,l,o,a,u,c,h,d){var v,f,p;if(c=s(c),!z.global().WebSocket)return void c(-1,l);let m=i.substr(i.indexOf("?")+1);e.components[r]||(e.components[r]={channelToken:m,onopen:s(o),onmessage:s(a),onerror:s(u),onclose:c,behaviors:h,autoconnect:d},e.clientIdsByTokens[m]||(e.clientIdsByTokens[m]=[]),e.clientIdsByTokens[m].push(r),e.sockets[m]||(e.sockets[m]=new n(m,function(e){if(e.indexOf("://")<0){let n=z.global().location.hostname+":"+z.global().location.port;return t+n+e}return e}(i),l))),d&&(null!==(f=null===(v=z.global())||void 0===v?void 0:v.faces)&&void 0!==f?f:null===(p=z.global())||void 0===p?void 0:p.jsf).push.open(r)},e.open=function(t){var n;r(null===(n=e.components[t])||void 0===n?void 0:n.channelToken).open()},e.close=function(t){r(e.components[t].channelToken).close()};class n{constructor(e,t,n){this.channelToken=e,this.url=t,this.channel=n,this.socket=null,this.reconnectAttempts=0,this.hasEverConnected=!1,this.hasNotifiedInitialOpenAttempt=!1}open(){this.socket&&1===this.socket.readyState||(this.socket=new WebSocket(this.url),this.bindCallbacks(),this.notifyInitialOpenAttempt())}onopen(e){this.hasEverConnected=!0,this.reconnectAttempts=0}onerror(e){}onmessage(t){var n,r,s;let i=JSON.parse(t.data),l=e.clientIdsByTokens[this.channelToken];if(l){for(let o=l.length-1;o>=0;o--){let a=l[o];if(document.getElementById(a)){try{null===(r=null===(n=e.components[a])||void 0===n?void 0:n.onmessage)||void 0===r||r.call(n,i,this.channel,t)}catch(e){}let l=null===(s=null===e.components||void 0===e.components?void 0:e.components[a])||void 0===s?void 0:s.behaviors,o=null==l?void 0:l[i];if(o&&o.length)for(let e=0;e<o.length;e++)try{o[e](null)}catch(e){}}else l.splice(o,1)}0===l.length&&this.close()}}onclose(e){if(this.isTerminalClose(e))return this.notifyClose(e),void this.resetConnectionState();this.notifyErrorAndPruneMissingComponents(e)&&(this.closeIfChannelHasNoComponents()||this.scheduleReconnect())}close(){if(this.socket){let e=this.socket;this.socket=null,e.close()}}notifyInitialOpenAttempt(){var t,n;if(this.reconnectAttempts||this.hasNotifiedInitialOpenAttempt)return;this.hasNotifiedInitialOpenAttempt=!0;let r=e.clientIdsByTokens[this.channelToken];if(r)for(let s=r.length-1;s>=0;s--){let i=r[s];null===(n=null===(t=e.components[i])||void 0===t?void 0:t.onopen)||void 0===n||n.call(t,this.channel)}}isTerminalClose(e){return!this.socket||!this.hasEverConnected||1e3===e.code||1008===e.code||this.reconnectAttempts>=25}notifyClose(t){var n,r;let s=e.clientIdsByTokens[this.channelToken];if(s)for(let i=s.length-1;i>=0;i--){let l=s[i];null===(r=null===(n=null===e.components||void 0===e.components?void 0:e.components[l])||void 0===n?void 0:n.onclose)||void 0===r||r.call(n,null==t?void 0:t.code,null==this?void 0:this.channel,t)}}resetConnectionState(){this.reconnectAttempts=0,this.hasEverConnected=!1,this.hasNotifiedInitialOpenAttempt=!1}notifyErrorAndPruneMissingComponents(t){var n,r;let s=e.clientIdsByTokens[this.channelToken];if(!s)return!1;for(let i=s.length-1;i>=0;i--){let l=s[i];if(document.getElementById(l))try{null===(r=null===(n=null===e.components||void 0===e.components?void 0:e.components[l])||void 0===n?void 0:n.onerror)||void 0===r||r.call(n,null==t?void 0:t.code,null==this?void 0:this.channel,t)}catch(e){}else s.splice(i,1)}return!0}closeIfChannelHasNoComponents(){var t;return 0===(null===(t=e.clientIdsByTokens[this.channelToken])||void 0===t?void 0:t.length)&&(this.close(),!0)}scheduleReconnect(){const e=++this.reconnectAttempts;this.socket=null,setTimeout((()=>this.open()),500*e)}bindCallbacks(){this.socket.onopen=e=>this.onopen(e),this.socket.onmessage=e=>this.onmessage(e),this.socket.onclose=e=>this.onclose(e),this.socket.onerror=e=>this.onerror(e)}}function r(t){let n=e.sockets[t];if(n)return n;throw new Error("Unknown channelToken: "+t)}function s(e){return"function"==typeof e?e:"string"==typeof e&&"function"==typeof z.global()[e]?z.global()[e]:()=>{}}}(Yt||(Yt={})),function(e){const t=Nt.ofAssoc;e.setHiddenInput=function(e,t,n){const r=document.forms;z.byId(r[e]).each((e=>{const r=e.querySelectorAll(`input[type='hidden'][name='${t}']`);if(r.isPresent())r.inputValue.value=n;else{const r=z.fromMarkup(`<input type='hidden' id='${t}' name='${t}'>`);r.inputValue.value=n,r.appendTo(e)}}))},e.clearHiddenInput=function(e,t){var n;const r=document.forms,s=null===(n=null==r?void 0:r[e])||void 0===n?void 0:n.elements;let i=null==s?void 0:s[t];i&&z.byId(i).delete()},e.submitForm=function(e,n=null,r=null,s={}){var i,l,o,a,u;s=s||{};let c="clearFormHiddenParams_"+e.replace(/-/g,"$:").replace(/:/g,"_");null===(i=null===window||void 0===window?void 0:window[c])||void 0===i||i.call(window,e),(null===(a=null===(o=null===(l=null===window||void 0===window?void 0:window.myfaces)||void 0===l?void 0:l.core)||void 0===o?void 0:o.config)||void 0===a?void 0:a.autoScroll)&&(null===window||void 0===window?void 0:window.getScrolling)&&myfaces.oam.setHiddenInput(e,"autoScroll",null===window||void 0===window?void 0:window.getScrolling());let h=Array.isArray(s)?[...s]:t(s);h.forEach((([t,n])=>myfaces.oam.setHiddenInput(e,t,n))),myfaces.oam.setHiddenInput(e,`${e}:_idcl`,null!=n?n:"");const d=document.forms;return z.byId(null!==(u=null==d?void 0:d[e])&&void 0!==u?u:document.getElementById(e)).each((t=>{var n;const s=t.getAsElem(0).value,i=t.getAsElem(0).value.getAttribute("target");"null"!=r&&r&&t.getAsElem(0).value.setAttribute("target",r);const l=null===(n=null==s?void 0:s.onsubmit)||void 0===n?void 0:n.call(s,null);try{(l||void 0===l)&&s.submit()}catch(e){null===window||void 0===window||window.console.error(e)}finally{null==i||"null"==i?t.getAsElem(0).value.removeAttribute("target"):t.getAsElem(0).value.setAttribute("target",i),h.forEach((([t,n])=>{myfaces.oam.clearHiddenInput(e,t)})),myfaces.oam.clearHiddenInput(e,`${e}:_idcl`)}})),!1}}(Zt||(Zt={})),function(e){let t,n,r;e.specversion=4e5,e.implversion=0,e.separatorchar=function(){const e="#{facesContext.namingContainerSeparatorChar}";return e.match(/\#\{facesContext.namingContainerSeparatorChar\}/gi)?Kt.getSeparatorChar():e}(),e.contextpath="#{facesContext.externalContext.requestContextPath}",e.getProjectStage=function(){return Kt.getProjectStage()},e.getViewState=function(e){return Kt.getViewState(e)},e.getClientWindow=function(e){return Kt.getClientWindow(e)},function(e){e.request=function(e,t,n){Kt.request(e,t,n)},e.response=function(e,t){Kt.response(e,t)},e.addOnError=function(e){Kt.addOnError(e)},e.addOnEvent=function(e){Kt.addOnEvent(e)}}(t=e.ajax||(e.ajax={})),function(e){e.chain=function(e,t,...n){return Kt.chain(e,null!=t?t:null,...n)}}(n=e.util||(e.util={})),function(e){e.init=function(e,t,n,r,s,i,l,o,a){Yt.init(e,t,n,r,s,i,l,o,a)},e.open=function(e){Yt.open(e)},e.close=function(e){Yt.close(e)}}(r=e.push||(e.push={}))}(en||(en={})),function(e){e.ab=function(e,t,n,r,s,i={},l={}){var o,a;i||(i={}),l||(l={}),n&&(i[Ie]=null!==(o=null==i?void 0:i[Ie])&&void 0!==o?o:{},i[Ie][gt(me)]=n),r&&(i[Te]=r),s&&(i[ge]=s),i.params||(i.params={});for(let e in l)i.params[e]=l[e];(null!==(a=null===window||void 0===window?void 0:window.faces)&&void 0!==a?a:window.jsf).ajax.request(e,t,i)};const t=[];let n=null;e.onDomReady=function(e){"complete"!==document.readyState?(t.push(e),n||(n=()=>{window.removeEventListener("DOMContentLoaded",n),n=null;try{t.forEach((e=>e()))}finally{t.length=0}},window.addEventListener("DOMContentLoaded",n))):(n&&n(),e())},e.reserveNamespace=function(e){let t=window;const n=e.split(".");for(const e of n)t[e]=t[e]||{},t=t[e]},e.oam=Zt}(tn||(tn={}))}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r,s,i,l={};if(n.r(l),n.d(l,{faces:()=>o,myfaces:()=>a}),!window.faces){const e=n(563).J;window.faces=null!==(r=null===window||void 0===window?void 0:window.faces)&&void 0!==r?r:e}if(!(null===(s=null===window||void 0===window?void 0:window.myfaces)||void 0===s?void 0:s.ab)){const e=n(563).$;window.myfaces=null!==(i=null===window||void 0===window?void 0:window.myfaces)&&void 0!==i?i:{},Object.keys(e).forEach((t=>{var n,r;return window.myfaces[t]=null!==(r=null===(n=window.myfaces)||void 0===n?void 0:n[t])&&void 0!==r?r:e[t]}))}var o=window.faces,a=window.myfaces,u=window;for(var c in l)u[c]=l[c];l.__esModule&&Object.defineProperty(u,"__esModule",{value:!0})})();
|
|
3
3
|
//# sourceMappingURL=faces.js.map
|