UNPKG

jsf.js_next_gen

Version:

A next generation typescript reimplementation of jsf.js

2 lines 109 kB
/*! For license information please see jsf.js.LICENSE.txt */ (()=>{"use strict";var e={771:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqual=t.shallowMerge=t.simpleShallowMerge=t.deepCopy=t.buildPath=t.resolve=t.appendIf=t.assignIf=t.append=t.assign=void 0;const r=n(86);class s{constructor(e){this.parent=e}set value(e){}get value(){return this.parent}}function l(e,...t){if(t.length<1)return new s(e);const n=d(e,...t);return new class{set value(e){n.target[n.key]=e}get value(){return n.target[n.key]}}}function o(e,...t){if(t.length<1)return new s(e);const n=d(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]]),n.target[n.key].push(...e)):n.target[n.key]=e}}}function i(e){let t=e.indexOf("[");return t>=0?e.substring(0,t):e}function a(e){let t=e.indexOf("["),n=e.indexOf("]");return t>=0&&n>0&&t<n?parseInt(e.substring(t+1,n)):-1}function u(e,t,n={}){let r=[];r.length=t,r[t-1]=n,e.push(...r)}function c(e){return new r.Es2019Array(...e).flatMap((e=>e.split("["))).map((e=>-1!=e.indexOf("]")?"["+e:e)).filter((e=>""!=e))}function d(e,...t){t=c(t);let n=e,r=null,s=null,l=-1;for(let e=0;e<t.length;e++)if(s=i(t[e]),l=a(t[e]),-1!=l){if(!Array.isArray(n))throw Error("Associative array referenced as index array in path reference");let s=-1;e<t.length-1&&(s=a(t[e+1]));let o=void 0!==(null==n?void 0:n[l]);u(n,l+1,-1!=s?[]:{}),r=l,e==t.length-1?n[l]=o?n[l]:null:n=n[l]}else{if(Array.isArray(n))throw Error("Index array referenced as associative array in path reference");let l=-1;e<t.length-1&&(l=a(t[e+1])),r=s;let o=void 0!==(null==n?void 0:n[s]);e==t.length-1?o||(n[s]=null):(o||(n[s]=-1==l?{}:[]),n=n[s])}return{target:n,key:r}}function h(e=!0,t=!1,...n){let s={};return new r.Es2019Array(...n).map((e=>({arr:e,keys:Object.keys(e)}))).forEach((({arr:n,keys:l})=>{l.forEach((l=>{let o=n[l];!Array.isArray(o)&&t&&(o=new r.Es2019Array(...[o])),e||!(null==s?void 0:s[l])?function(e,t,n,s,l){if(e)if(void 0===(null==t?void 0:t[n]))t[n]=l;else if(Array.isArray(t[n])){let e=t[n],r=[];l.forEach((t=>{-1==e.indexOf(t)&&r.push(t)})),t[n].push(...r)}else{let e=t[n],s=[];l.forEach((t=>{e!=t&&s.push(t)})),t[n]=new r.Es2019Array(...[]),t[n].push(e),t[n].push(...s)}else t[n]=s[n]}(t,s,l,n,o):!e&&(null==s?void 0:s[l])&&function(e,t,n,s,l){if(e)if(void 0===(null==t?void 0:t[n]))t[n]=l;else if(Array.isArray(t[n]))t[n].push(...l);else{let e=t[n];t[n]=new r.Es2019Array(...[]),t[n].push(e),t[n].push(...l)}}(t,s,l,0,o)}))})),s}t.assign=l,t.append=o,t.assignIf=function(e,t,...n){return!e||n.length<1?new s(t):l(t,...n)},t.appendIf=function(e,t,...n){return!e||n.length<1?new s(t):o(t,...n)},t.resolve=function(e,...t){let n=null;t=c(t);let r=e;for(let e=0;e<t.length;e++){let s=t[e];if(s=-1!=a(s)?a(s):s,r=null==r?void 0:r[s],void 0===r)return null;n=r}return r},t.buildPath=d,t.deepCopy=function(e){return JSON.parse(JSON.stringify(e))},t.simpleShallowMerge=function(...e){return h(!0,!1,...e)},t.shallowMerge=h,t.deepEqual=function e(t,n){if(t==n)return!1;if(typeof t!=typeof n)return!1;if(Array.isArray(t)&&Array.isArray(n)){if(t.length!=n.length)return;return t.every(((t,r)=>e(t,n[r])))}if("object"==typeof t&&"object"==typeof n){let r=Object.keys(t),s=Object.keys(n);return r.length==s.length&&r.every((e=>-1!=s.indexOf(e)))&&r.every((r=>e(t[r],n[r])))}return!1}},517:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Config=t.CONFIG_ANY=t.CONFIG_VALUE=void 0;const r=n(86),s=n(204);var l=n(519).Lang.objAssign;const o=n(771);class i extends s.ValueEmbedder{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}}i.absent=i.fromNullable(null),t.CONFIG_VALUE="__END_POINT__",t.CONFIG_ANY="__ANY_POINT__";class a extends s.Optional{constructor(e,t){super(e),this.configDef=t}get shallowCopy(){return this.shallowCopy$()}shallowCopy$(){let e=new a({});return e.shallowMerge(this.value),e}get deepCopy(){return this.deepCopy$()}deepCopy$(){return new a(l({},this.value))}static fromNullable(e){return new a(e)}shallowMerge(e,t=!0,n=!1){let r=(0,o.shallowMerge)(t,n,this.value,e.value);Array.isArray(this._value)?(this._value.length=0,this._value.push(...r)):(Object.getOwnPropertyNames(this._value).forEach((e=>delete this._value[e])),Object.getOwnPropertyNames(r).forEach((e=>this._value[e]=r[e])))}append(...e){return(0,o.append)(this._value,...e)}appendIf(e,...t){return(0,o.appendIf)(e,this._value,...t)}assign(...e){return(0,o.assign)(this.value,...e)}assignIf(e,...t){return(0,o.assignIf)(e,this._value,...t)}getIf(...e){return this.assertAccessPath(...e),this.getClass().fromNullable((0,o.resolve)(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 a}setVal(e){this._value=e}assertAccessPath(...e){var n,l,o,i,a,u,c,d,h;if(e=this.preprocessKeys(...e),!this.configDef)return;let E=s.Optional.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 _=this.keyVal(e[v]),f=this.arrayIndex(e[v]);if(E=this.isArray(f)?""!=_?Array.isArray(E.value)?s.Optional.fromNullable(null===(l=null===(n=new r.Es2019Array(...E.value).find((e=>{var t;return!(null===(t=null==e?void 0:e[_])||void 0===t||!t)})))||void 0===n?void 0:n[_])||void 0===l?void 0:l[f]):s.Optional.fromNullable(null!==(a=null===(i=null===(o=E.value)||void 0===o?void 0:o[_])||void 0===i?void 0:i[f])&&void 0!==a?a:null):Array.isArray(E.value)?s.Optional.fromNullable(null===(u=E.value)||void 0===u?void 0:u[f]):s.Optional.absent:Array.isArray(E.value)?s.Optional.fromNullable(null===(c=new r.Es2019Array(...E.value).find((e=>{var t;return!(null===(t=null==e?void 0:e[_])||void 0===t||!t)})))||void 0===c?void 0:c[_]):s.Optional.fromNullable(null!==(h=null===(d=E.value)||void 0===d?void 0:d[_])&&void 0!==h?h:null),!E.isPresent())throw Error("Access Path to config invalid");if(E.value==t.CONFIG_ANY)return}}isNoArray(e){return-1==e}isArray(e){return!this.isNoArray(e)}}t.Config=a},331:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(s,l){function o(e){try{a(r.next(e))}catch(e){l(e)}}function i(e){try{a(r.throw(e))}catch(e){l(e)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,i)}a((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.DQ$=t.DQ=t.DomQueryCollector=t.DomQuery=t.Style=t.ElementAttribute=void 0;const s=n(204),l=n(785),o=n(519),i=n(228),a=n(86);var u=o.Lang.trim,c=o.Lang.isString,d=o.Lang.equalsIgnoreCase,h=o.Lang.objToArray;const E=n(771);class v extends s.ValueEmbedder{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 _;!function(e){e.SELECT="select",e.BUTTON="button",e.SUBMIT="submit",e.RESET="reset",e.IMAGE="image",e.RADIO="radio",e.CHECKBOX="checkbox"}(_||(_={}));class f extends s.ValueEmbedder{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);t[0].setAttribute(this.name,e)}getClass(){return f}static fromNullable(e,t="value"){return new f(e,t)}}t.ElementAttribute=f;class p extends s.ValueEmbedder{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 f}static fromNullable(e,t="value"){return new f(e,t)}}t.Style=p;const T=()=>!0;class A{constructor(...e){if(this.rootNode=[],this.pos=-1,this._limits=-1,!s.Optional.fromNullable(e).isAbsent()&&e.length)for(let t=0;t<e.length;t++)if(e[t])if(c(e[t])){let n=A.querySelectorAll(e[t]);n.isAbsent()||e.push(...n.values)}else e[t]instanceof A?this.rootNode.push(...e[t].values):this.rootNode.push(e[t])}get value(){return this.getAsElem(0)}get values(){return this.allElems()}get global(){return i._global$}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 f(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 s.ValueEmbedder(this.getAsElem(0).value,"name")}get inputValue(){return this.getAsElem(0).getIf("value").isPresent()?new s.ValueEmbedder(this.getAsElem(0).value):s.ValueEmbedder.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 new a.Es2019Array(...this.values).every((e=>!!e.checked))}set checked(e){this.eachElem((t=>t.checked=e))}get elements(){return this.querySelectorAll("input, checkbox, select, textarea, fieldset")}get deepElements(){return this.querySelectorAllDeep("input, select, textarea, checkbox, 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 A(...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(h(t.childNodes))})),new A(...e)}get asArray(){return new a.Es2019Array(...this.rootNode).filter((e=>null!=e)).map((e=>A.byId(e)))}get offsetWidth(){return new a.Es2019Array(...this.rootNode).filter((e=>null!=e)).map((e=>e.offsetWidth)).reduce(((e,t)=>e+t),0)}get offsetHeight(){return new a.Es2019Array(...this.rootNode).filter((e=>null!=e)).map((e=>e.offsetHeight)).reduce(((e,t)=>e+t),0)}get offsetLeft(){return new a.Es2019Array(...this.rootNode).filter((e=>null!=e)).map((e=>e.offsetLeft)).reduce(((e,t)=>e+t),0)}get offsetTop(){return new a.Es2019Array(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetTop)).reduce(((e,t)=>e+t),0)}get asNodeArray(){return new a.Es2019Array(...this.rootNode.filter((e=>null!=e)))}get nonce(){return new v(this.rootNode)}static querySelectorAllDeep(e){return new A(document).querySelectorAllDeep(e)}static querySelectorAll(e){return-1!=e.indexOf("/shadow/")?new A(document)._querySelectorAllDeep(e):new A(document)._querySelectorAll(e)}static byId(e,t=!1){return c(e)?t?new A(document).byIdDeep(e):new A(document).byId(e):new A(e)}static byTagName(e){return c(e)?new A(document).byTagName(e):new A(e)}static globalEval(e,t){return new A(document).globalEval(e,t)}static globalEvalSticky(e,t){return new A(document).globalEvalSticky(e,t)}static fromMarkup(e){const t=document.implementation.createHTMLDocument("");let n=(e=u(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 A(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 A(document.createElement("div"));return t(n,"thead")||t(n,"tbody")?(r.html(`<table>${e}</table>`),r.querySelectorAll("table").get(0).childNodes.detach()):t(n,"tfoot")?(r.html(`<table><thead></thead><tbody><tbody${e}</table>`),r.querySelectorAll("table").get(2).childNodes.detach()):t(n,"tr")?(r.html(`<table><tbody>${e}</tbody></table>`),r.querySelectorAll("tbody").get(0).childNodes.detach()):t(n,"td")?(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 A(this.rootNode[e]):A.absent}getAsElem(e,t=s.Optional.absent){return e<this.rootNode.length?s.Optional.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(...new a.Es2019Array(...(null==this?void 0:this.rootNode)||[]).filter((t=>e==t.id)).map((e=>new A(e))))),n=n.concat(this.querySelectorAll(`[id="${e}"]`)),new A(...n)}byIdDeep(e,t){let n=[];t&&(n=n.concat(new a.Es2019Array(...(null==this?void 0:this.rootNode)||[]).filter((t=>e==t.id)).map((e=>new A(e)))));let r=this.querySelectorAllDeep(`[id="${e}"]`);return r.length&&n.push(r),new A(...n)}byTagName(e,t,n){var r;let s=[];return t&&(s=new a.Es2019Array(...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 A(...s)}attr(e,t=null){return new f(this,e,t)}style(e,t=null){return new p(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 s.Optional.fromNullable(e).isAbsent()?this.isPresent()?s.Optional.fromNullable(this.innerHTML):s.Optional.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._mozMatchesSelector(n,e)&&t.push(n)})),new A(...t)}matchesSelector(e){return this.asArray.some((t=>this._mozMatchesSelector(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>1&&e(this.rootNode[0],0),this}lastElem(e=e=>e){return this.rootNode.length>1&&e(this.rootNode[this.rootNode.length-1],0),this}each(e){return new a.Es2019Array(...this.rootNode).forEach(((t,n)=>{if(null!=t)return e(A.byId(t),n)})),this}replace(e){return this.each((t=>{let n=t.getAsElem(0).value,r=n.parentElement,s=n.nextElementSibling,l=n.previousElementSibling;null!=s?new A(s).insertBefore(e):l?new A(l).insertAfter(e):new A(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 A(...t)}globalEval(e,t){var n,r,s;const l=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],o=document.createElement("script");t&&(void 0!==(null==o?void 0:o.nonce)?o.nonce=t:o.setAttribute("nonce",t)),o.type="text/javascript",o.innerHTML=e;let i=l.appendChild(o);return l.removeChild(i),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.Lang.isString(e)?(this.appendTo(A.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 A(...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 A(...t)}orElse(...e){return this.isPresent()?this:new A(...e)}orElseLazy(e){return this.isPresent()?this:new A(e())}allParents(e){let t=this.parent(),n=[];for(;t.isPresent();)t.matchesSelector(e)&&n.push(t),t=t.parent();return new A(...n)}firstParent(e){let t=this.parent();for(;t.isPresent();){if(t.matchesSelector(e))return t;t=t.parent()}return A.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 A(...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 A(...e)}copyAttrs(e){return e.eachElem((e=>{let t=h(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 l=null===(s=null===document||void 0===document?void 0:document.activeElement)||void 0===s?void 0:s.id,o=l?A.getCaretPosition(document.activeElement):null,i=A.fromMarkup(e),a=[],u=this.getAsElem(0).value,c=i.get(0),d=u.parentNode,h=c.getAsElem(0).value;if(d.replaceChild(h,u),a.push(new A(h)),this.isAbsent())return this;let E=[];i.length>1&&(E=E.concat(...i.values.slice(1)),a.push(A.byId(h).insertAfter(new A(...E)))),t&&this.runScripts(),n&&this.runCss();let v=A.byId(l);return l&&v.isPresent()&&null!=o&&void 0!==o&&v.eachElem((e=>A.setCaretPosition(e,o))),i}runScripts(e=!1,t=T){const n=t=>{if(t.length){let n=[];new a.Es2019Array(...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"],l=l=>{var o,i,a,c;let h=l.tagName,E=(null!==(o=null==l?void 0:l.type)&&void 0!==o?o:"").toLowerCase();if(h&&d(h,"script")&&-1!=s.indexOf(E)){let s=l.getAttribute("src");if(void 0!==s&&null!=s&&s.length>0){let o=null!==(i=null==l?void 0:l.nonce)&&void 0!==i?i:l.getAttribute("nonce").value;t(s)&&(r=n(r),e?o?this.loadScriptEvalSticky(s,0,o):this.loadScriptEvalSticky(s,0):o?this.loadScriptEval(s,0,o):this.loadScriptEval(s,0))}else{let e=u(l.text||l.innerText||l.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!==(c=null!==(a=null==l?void 0:l.nonce)&&void 0!==a?a:l.getAttribute("nonce").value)&&void 0!==c?c:"";r.push({nonce:n,evalText:e})}}};try{new A(this.filterSelector("script"),this.querySelectorAll("script")).asArray.flatMap((e=>[...e.values])).sort(((e,t)=>t.compareDocumentPosition(e)-3)).forEach((e=>l(e))),n(r)}catch(e){console&&console.error&&console.error(e.message||e.description)}finally{l=null}return this}runCss(){return new A(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=A.byId(e),n=t.tagName.orElse("").value;let r=A.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=(0,E.simpleShallowMerge)(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=(0,E.simpleShallowMerge)(e);return this.each((e=>{var n,r;if(e.name.isAbsent())return;let s=e.name.value,l=e.tagName.orElse("__none__").value.toLowerCase(),o=e.type.orElse("__none__").value.toLowerCase();if(o=o.toLowerCase(),("input"==l||"textarea"==l||"select"==l)&&null!=s&&""!=s&&!e.disabled){if("select"==l){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];(0,E.append)(t,s).value=null!=e.getAttribute("value")?e.value:e.text}}}if(l!=_.SELECT&&o!=_.BUTTON&&o!=_.RESET&&o!=_.SUBMIT&&o!=_.IMAGE&&(o!=_.CHECKBOX&&o!=_.RADIO||e.checked)){let l=null===(r=null===(n=e.value)||void 0===n?void 0:n.value)||void 0===r?void 0:r.files,o=null!=l?l:[];if(null==o?void 0:o.length)(0,E.assign)(t,s).value=Array.from(o);else{if(l)return;(0,E.append)(t,s).value=e.inputValue.value}}}})),t}get cDATAAsString(){return 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}),[]).join("")}subNodes(e,t){return s.Optional.fromNullable(t).isAbsent()&&(t=this.length),new A(...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 A(this.values[this.pos])):null}lookAhead(e=1){return this.values.length-1<this.pos+e?l.ITERATION_STATUS.EO_STRM:new A(this.values[this.pos+e])}current(){return-1==this.pos?l.ITERATION_STATUS.BEF_STRM:new A(this.values[this.pos])}reset(){this.pos=-1}attachShadow(e={mode:"open"}){let t=[];return this.eachElem((n=>{let r;if(!(null==n?void 0:n.attachShadow))throw new Error("Shadow dom creation not supported by the browser, please use a shim, to gain this functionality");r=A.byId(n.attachShadow(e)),t.push(r)})),new A(...t)}waitUntilDom(e,t={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}){return r(this,void 0,void 0,(function*(){return function(e,t,n={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}){return new Promise(((r,s)=>{let l=null;const o=new Error("Mutation observer timeout");function i(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=i(a,t))r(new A(a));else if("undefined"!=typeof MutationObserver){const i=setTimeout((()=>(l.disconnect(),s(o))),n.timeout),a=n=>{const s=new A(n.map((e=>e.target))).filter((e=>t(e))).first();s.isPresent()&&(clearTimeout(i),l.disconnect(),r(new A(s||e)))};l=new MutationObserver(a);let u=Object.assign({},n);delete u.timeout,e.eachElem((e=>{l.observe(e,u)}))}else{let l=setInterval((()=>{let n=i(e,t);n&&(a&&(clearTimeout(a),clearInterval(l),l=null),r(new A(n||e)))}),n.interval),a=setTimeout((()=>{l&&(clearInterval(l),s(o))}),n.timeout)}}))}(this,e,t)}))}get shadowElements(){let e=(this.querySelectorAll("*").filter((e=>e.hasShadow)).allElems()||[]).map((e=>e.shadowRoot));return new A(...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 A(...e)}get hasShadow(){for(let e=0;e<this.rootNode.length;e++)if(this.rootNode[e].shadowRoot)return!0;return!1}static getCaretPosition(e){let t=0;try{if(null===document||void 0===document?void 0:document.selection){e.focus();let n=document.selection.createRange();n.moveStart("character",-e.value.length),t=n.text.length}}catch(e){}return t}static setCaretPosition(e,t){(null==e?void 0:e.focus)&&(null==e||e.focus()),(null==e?void 0:e.setSelectiongRange)&&(null==e||e.setSelectiongRange(t,t))}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}concat(e,t=!0){let n=this.asArray;const r=new A(...n.concat(e.asArray));if(!t)return r;let s={};return new A(...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=>{e.prepend(...this.allElems())})),this}prepend(e){return this.eachElem((t=>{t.prepend(...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(...h(s))}return new A(...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 A(...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 A(...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 A(...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}_mozMatchesSelector(e,t){let n=e,r=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(t){let n=(document||ownerDocument).querySelectorAll(t),r=n.length;for(;--r>=0&&n.item(r)!==e;);return r>-1};return r.call(e,t)}_loadScriptEval(e,t,n=0,r){let s=this.createSourceNode(t,r),l=this.createSourceNode(null,r),o=`nonce_${Date.now()}_${Math.random()}`;l.innerHTML=`document.head["${o}"] = true`;let i=document.head;if(i.appendChild(l),i.removeChild(l),i[o]){try{n?setTimeout((()=>{i.appendChild(s),e||i.removeChild(s)}),n):(i.appendChild(s),e||i.removeChild(s))}finally{delete i[o]}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))}}t.DomQuery=A,A.absent=new A,A.global=i._global$,t.DomQueryCollector=class{constructor(){this.data=[]}collect(e){this.data.push(e)}get finalValue(){return new A(...this.data)}},t.DQ=A,t.DQ$=A.querySelectorAll},86:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Es2019Array=t._Es2019Array=void 0;class n extends Array{constructor(...e){super(...e),e._another?this._another=e._another:this._another=e,this.flatMap=e=>this._flatMap(e),this.flat=(e=1)=>this._flat(e)}map(e,t){return new r(...Array.prototype.map.call(this._another,e,t))}concat(...e){return new r(...Array.prototype.concat.call(this._another,...e))}reverse(){return new r(...Array.prototype.reverse.call(this._another))}slice(e,t){return new r(...Array.prototype.slice.call(this._another,e,t))}splice(e,t){return new r(...Array.prototype.splice.call(this._another,e,t))}filter(e,t){return new r(...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,n=1){if(0==n)return e;let r=[];return e.forEach((e=>{e=Array.isArray(e)?e:[e];let t=this._flatResolve(e,n-1);r=r.concat(t)})),new t.Es2019Array(...r)}_flatMap(e){let t=this.map((t=>e(t)));return this._flatResolve(t)}}function r(...e){let t=new n(...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)})}t._Es2019Array=r,t.Es2019Array=Array.prototype.flatMap?function(...e){return(null==e?void 0:e.flatMap)?e:r(...e)}:r},228:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._global$=void 0,t._global$=function(){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}},519:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Lang=void 0;const r=n(204),s=n(86);var l;!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 r.Optional.fromNullable(null!=n?n:t)}catch(e){return r.Optional.absent}},e.saveResolveLazy=function(e,t=null){try{let n=e();return r.Optional.fromNullable(null!=n?n:t())}catch(e){return r.Optional.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:new s.Es2019Array(...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).filter((e=>Object.prototype.hasOwnProperty.call(t,e))).forEach((e=>n[e]=t[e]))})),n)}}(l||(t.Lang=l={}))},204:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueEmbedder=t.Optional=t.Monad=void 0;const r=n(86);class s{constructor(e){this._value=e}get value(){return this._value}map(e){e||(e=e=>e);let t=e(this.value);return new s(t)}flatMap(e){let t=this.map(e);for(;(null==t?void 0:t.value)instanceof s;)t=t.value;return t}}t.Monad=s;class l extends s{constructor(e){super(e)}get value(){return this._value instanceof s?this._value.flatMap().value:this._value}static fromNullable(e){return new l(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?l.absent:this.flatMap((()=>e))}orElseLazy(e){return this.isPresent()?this:this.flatMap(e)}flatMap(e){let t=super.flatMap(e);return t instanceof l?t.flatMap():l.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=l.absent){return this.isAbsent()?this.getClass().fromNullable(e).flatMap():this.getClass().fromNullable(this.value).flatMap()}toJson(){return JSON.stringify(this.value)}getClass(){return l}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 l.absent;try{return l.fromNullable(e(this.value))}catch(e){return l.absent}}preprocessKeys(...e){return new r.Es2019Array(...e).flatMap((e=>new r.Es2019Array(...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)))))}}t.Optional=l,l.absent=l.fromNullable(null);class o extends l{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 o(t,this.key)}orElseLazy(e){if(this.isPresent())return this;{let t={};return t[this.key]=e(),new o(t,this.key)}}getClass(){return o}static fromNullable(e,t="value"){return new o(e,t)}}t.ValueEmbedder=o,o.absent=o.fromNullable(null)},785:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayCollector=t.QueryFormStringCollector=t.QueryFormDataCollector=t.FormDataCollector=t.ConfigCollector=t.AssocArrayCollector=t.Run=t.ArrayAssocArrayCollector=t.InverseArrayCollector=t.ShimArrayCollector=t.MappedStreamDataSource=t.FilteredStreamDatasource=t.ArrayStreamDataSource=t.SequenceDataSource=t.MultiStreamDatasource=t.calculateSkips=t.ITERATION_STATUS=void 0;const r=n(86),s=n(517);var l;function o(e){let t=1;for(;e.lookAhead(t)!=l.EO_STRM;)t++;return--t}!function(e){e.EO_STRM="__EO_STRM__",e.BEF_STRM="___BEF_STRM__"}(l||(t.ITERATION_STATUS=l={})),t.calculateSkips=o,t.MultiStreamDatasource=class{constructor(e,...t){this.first=e,this.selectedPos=0,this.strms=[e].concat(...t),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 l.EO_STRM;const n=[...t];for(;n.length;){let t=n.shift(),r=t.lookAhead(e);if(r!=l.EO_STRM)return r;e-=o(t)}return l.EO_STRM}next(){return this.activeStrm.hasNext()?this.activeStrm.next():(this.selectedPos=this.findNextStrm(),-1==this.selectedPos?l.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()}},t.SequenceDataSource=class{constructor(e,t){this.total=t,this.start=e,this.value=e-1}hasNext(){return this.value<this.total-1}next(){return this.value++,this.value<=this.total-1?this.value:l.EO_STRM}lookAhead(e=1){return this.value+e>this.total-1?l.EO_STRM:this.value+e}reset(){this.value=this.start-1}current(){return this.start-1?l.BEF_STRM:this.value}},t.ArrayStreamDataSource=class{constructor(...e){this.dataPos=-1,this.value=e}lookAhead(e=1){return this.dataPos+e>this.value.length-1?l.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:l.EO_STRM}reset(){this.dataPos=-1}current(){return this.value[Math.max(0,this.dataPos)]}},t.FilteredStreamDatasource=class{constructor(e,t){this._current=l.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))!=l.EO_STRM;)this.filterFunc(e)?(this._filterIdx[this._unfilteredPos+t]=!0,n=!0):t++;return n}next(){var e,t;let n=l.EO_STRM;for(;this.inputDataSource.hasNext();){this._unfilteredPos++;let r=this.inputDataSource.next();if(r!=l.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;for(let r=1;e>0&&(n=this.inputDataSource.lookAhead(r))!=l.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=l.BEF_STRM,this._filterIdx={},this._unfilteredPos=0,this.inputDataSource.reset()}},t.MappedStreamDataSource=class{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==l.EO_STRM?t:this.mapFunc(t)}},t.ShimArrayCollector=class{constructor(){this.data=new r.Es2019Array(...[])}collect(e){this.data.push(e)}get finalValue(){return this.data}},t.InverseArrayCollector=class{constructor(){this.data=[]}collect(e){this.data.unshift(e)}get finalValue(){return this.data}},t.ArrayAssocArrayCollector=class{constructor(){this.finalValue={}}collect(e){var t,n,r,s;let l=null!==(t=null==e?void 0:e[0])&&void 0!==t?t:e;this.finalValue[l]=null!==(r=null===(n=this.finalValue)||void 0===n?void 0:n[l])&&void 0!==r?r:[],this.finalValue[l].push(null===(s=null==e?void 0:e[1])||void 0===s||s)}},t.Run=class{collect(e){}get finalValue(){return null}},t.AssocArrayCollector=class{constructor(){this.finalValue={}}collect(e){var t,n;this.finalValue[null!==(t=e[0])&&void 0!==t?t:e]=null===(n=e[1])||void 0===n||n}},t.ConfigCollector=class{constructor(){this.finalValue=new s.Config({})}collect(e){this.finalValue.append(e.key).value=e.value}},t.FormDataCollector=class{constructor(){this.finalValue=new FormData}collect(e){this.finalValue.append(e.key,e.value)}},t.QueryFormDataCollector=class{constructor(){this.finalValue=new FormData}collect(e){let t=e.encodeFormElement();t.isPresent()&&this.finalValue.append(e.name.value,t.get(e.name).value)}},t.QueryFormStringCollector=class{constructor(){this.formData=[]}collect(e){let t=e.encodeFormElement();t.isPresent()&&this.formData.push([e.name.value,t.get(e.name).value])}get finalValue(){return new r.Es2019Array(...this.formData).map((e=>e.join("="))).reduce(((e,t)=>[e,t].join("&")))}},t.ArrayCollector=class{constructor(){this.data=[]}collect(e){this.data.push(e)}get finalValue(){return this.data}}},100:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XQ=t.XMLQuery=void 0;const r=n(519),s=n(331);var l=r.Lang.isString;const o=n(228);class i extends s.DomQuery{constructor(e,t="text/xml"){var n;l(e)?super(null==(n=e)?null:r.Lang.saveResolveLazy((()=>new((0,o._global$)().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,l;let i=null!==(l=null===(s=null===(r=null===(n=(0,o._global$)())||void 0===n?void 0:n.XMLSerializer)||void 0===r?void 0:r.constructor())||void 0===s?void 0:s.serializeToString(t))&&void 0!==l?l:null==t?void 0:t.xml;i&&e.push(i)})),e.join("")}parserErrorText(e){return this.querySelectorAll("parsererror").textContent(e)}static parseXML(e){return new i(e)}static parseHTML(e){return new i(e,"text/html")}static fromString(e,t="text/xml"){return new i(e,t)}}t.XMLQuery=i,t.XQ=i},257:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t._Es2019Array=t.Es2019Array=t.Assoc=t.CONFIG_VALUE=t.CONFIG_ANY=t.Config=t.shallowMerge=t.simpleShallowMerge=t.append=t.assignIf=t.assign=t.XQ=t.XMLQuery=t.ValueEmbedder=t.Optional=t.Monad=t.Lang=t.DQ$=t.DQ=t.DomQueryCollector=t.ElementAttribute=t.DomQuery=void 0;var o=n(331);Object.defineProperty(t,"DomQuery",{enumerable:!0,get:function(){return o.DomQuery}}),Object.defineProperty(t,"ElementAttribute",{enumerable:!0,get:function(){return o.ElementAttribute}}),Object.defineProperty(t,"DomQueryCollector",{enumerable:!0,get:function(){return o.DomQueryCollector}}),Object.defineProperty(t,"DQ",{enumerable:!0,get:function(){return o.DQ}}),Object.defineProperty(t,"DQ$",{enumerable:!0,get:function(){return o.DQ$}});var i=n(519);Object.defineProperty(t,"Lang",{enumerable:!0,get:function(){return i.Lang}});var a=n(204);Object.defineProperty(t,"Monad",{enumerable:!0,get:function(){return a.Monad}}),Object.defineProperty(t,"Optional",{enumerable:!0,get:function(){return a.Optional}}),Object.defineProperty(t,"ValueEmbedder",{enumerable:!0,get:function(){return a.ValueEmbedder}});var u=n(100);Object.defineProperty(t,"XMLQuery",{enumerable:!0,get:function(){return u.XMLQuery}}),Object.defineProperty(t,"XQ",{enumerable:!0,get:function(){return u.XQ}});var c=n(771);Object.defineProperty(t,"assign",{enumerable:!0,get:function(){return c.assign}}),Object.defineProperty(t,"assignIf",{enumerable:!0,get:function(){return c.assignIf}}),Object.defineProperty(t,"append",{enumerable:!0,get:function(){return c.append}}),Object.defineProperty(t,"simpleShallowMerge",{enumerable:!0,get:function(){return c.simpleShallowMerge}}),Object.defineProperty(t,"shallowMerge",{enumerable:!0,get:function(){return c.shallowMerge}});var d=n(517);Object.defineProperty(t,"Config",{enumerable:!0,get:function(){return d.Config}});var h=n(517);Object.defineProperty(t,"CONFIG_ANY",{enumerable:!0,get:function(){return h.CONFIG_ANY}});var E=n(517);Object.defineProperty(t,"CONFIG_VALUE",{enumerable:!0,get:function(){return E.CONFIG_VALUE}}),t.Assoc=l(n(771));var v=n(86);Object.defineProperty(t,"Es2019Array",{enumerable:!0,get:function(){return v.Es2019Array}}),Object.defineProperty(t,"_Es2019Array",{enumerable:!0,get:function(){return v._Es2019Array}})},973:(e,t,n)=>{t.$A=t.J_=void 0;const r=n(644),s=n(54),l=n(19),o=n(351);var i,a;!function(e){let t,n,l;e.specversion=4e5,e.implversion=0,e.separatorchar=function(){const e="#{facesContext.namingContainerSeparatorChar}";return e.match(/\#\{facesContext.namingContainerSeparatorChar\}/gi)?r.Implementation.getSeparatorChar():e}(),e.contextpath="#{facesContext.externalContext.requestContextPath}",e.getProjectStage=function(){return r.Implementation.getProjectStage()},e.getViewState=function(e){return r.Implementation.getViewState(e)},e.getClientWindow=function(e){return r.Implementation.getClientWindow(e)},function(e){e.request=function(e,t,n){r.Implementation.request(e,t,n)},e.response=function(e,t){r.Implementation.response(e,t)},e.addOnError=function(e){r.Implementation.addOnError(e)},e.addOnEvent=function(e){r.Implementation.addOnEvent(e)}}(t=e.ajax||(e.ajax={})),function(e){e.chain=function(e,t,...n){return r.Implementation.chain(e,t,...n)}}(n=e.util||(e.util={})),function(e){e.init=function(e,t,n,r,l,o,i,a,u){s.PushImpl.init(e,t,n,r,l,o,i,a,u)},e.open=function(e){s.PushImpl.open(e)},e.close=function(e){s.PushImpl.close(e)}}(l=e.push||(e.push={}))}(i||(t.J_=i={})),function(e){e.ab=function(e,t,n,r,s,l={},i={}){var a,u;l||(l={}),i||(i={}),n&&(l[o.CTX_OPTIONS_PARAMS]=null!==(a=null==l?void 0:l[o.CTX_OPTIONS_PARAMS])&&void 0!==a?a:{},l[o.CTX_OPTIONS_PARAMS][(0,o.$nsp)(o.P_BEHAVIOR_EVENT)]=n),r&&(l[o.CTX_OPTIONS_EXECUTE]=r),s&&(l[o.CTX_PARAM_RENDER]=s),l.params||(l.params={});for(let e in i)l.params[e]=i[e];(null!==(u=null===window||void 0===window?void 0:window.faces)&&void 0!==u?u:window.jsf).ajax.request(e,t,l)};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.oam=l.oam}(a||(t.$A=a={}))},644:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Implementation=void 0;const r=n(121),s=n(229),l=n(257),o=n(22),i=n(780),a=n(234),u=n(471),c=n(351),d=n(7),h=n(680),E=n(666);var v,_,f;!function(e){e.Production="Production",e.Development="Development",e.SystemTest="SystemTest",e.UnitTest="UnitTest"}(v||(v={})),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"}(_||(_={})),function(e){var t=l.Lang.trim,n=u.ExtLang.getMessage,f=u.ExtLang.getGlobalConfig,p=o.Assertions.assert,T=u.ExtLang.ofAssoc,A=u.ExtLang.collectAssoc;let m=null,R=null,g=[],S=[];function y(){const e=i.ExtDomQuery.searchJsfJsFor(/stage=([^&;]*)/).value;return e in v?e:v.Production}function O(e,t=function(e){}){t(e),S.forEach((t=>{t(e)})),f("defaultErrorOutput",console?console.error:alert)(e)}function P(e,t){const n=(0,d.resolveViewRootId)(t);n&&(e.assign(c.NAMED_VIEWROOT).value=!0,e.assign(c.NAMING_CONTAINER_ID).value=n)}function M(e,n,r,s,o,i=""){const a=(0,c.$faces)().separatorchar;let u=r?t(r).split(/\s+/gi):[],d=[],h={};const E=e=>{const t=i.length?i+a:c.EMPTY_STR;let n=s.id.value;const r=n.substring(0,n.lastIndexOf(a)),o=r.length?r+a:c.EMPTY_STR,u=0===e.indexOf(a);let d;return u||i.length&&0==e.indexOf(t)?d=[t,e=0==(e=u?e.substring(1):e).indexOf(t)?e.substring(t.length):e].join(c.EMPTY_STR):(0==n.indexOf(t)&&(n=n.substring(t.length)),d=0==e.indexOf(n)?[t,e].join(c.EMPTY_STR):[o,e].join(c.EMPTY_STR)),l.DQ.byId(d).isPresent()?d:e};for(let t=0;t<u.length;t++)if(!(u[t]in h))switch(u[t]){case c.IDENT_NONE:return e.delete(n);case c.IDENT_ALL:return e.assign(n).value=c.IDENT_ALL,e;case c.IDENT_FORM:d.push(E(s.id.value)),h[s.id.value]=!0;break;case c.IDENT_THIS:o in h||(d.push(E(o)),h[o]=!0);break;default:d.push(E(u[t])),h[u[t]]=!0}return e.assign(n).value=d.join(" "),e}function I(){var e,t;return null!==(t=null===(e=null===window||void 0===window?void 0:window[c.MYFACES])||void 0===e?void 0:e.config)&&void 0!==t?t:{}}e.requestQueue=null,e.getSeparatorChar=function(){var e,t,n;return null!==(n=null!==(t=null===(e=I())||void 0===e?void 0:e.separator)&&void 0!==t?t:null==this?void 0:this.separator)&&void 0!==n?n:R=i.ExtDomQuery.searchJsfJsFor(/separator=([^&;]*)/).orElse(":").value},e.reset=function(){m=null,R=null,g=[],S=[],e.requestQueue=null},e.getProjectStage=function(){var e,t,n;return null!==(n=n