const __$_events__={},__$_default_display_inline__=["a","i","script","abbr","iframe","select","acronym","img","slot","audio","input","small","b","ins","span","bdi","kbd","strong","bdo","label","sub","big","map","sup","br","mark","svg","button","meter","template","canvas","noscript","textarea","cite","object","time","code","output","u","data","picture","tt","datalist","progress","var","del","q","video","dfn","ruby","wbr","em","s","embed","samp"];class _$ extends Array{constructor(e,t){super(),e instanceof Function?window.addEventListener("load",()=>{Reflect.apply(e,null,[])}):this.push(..._$._STD(e,t))}static _STD(e,t){const n=[];if(e instanceof Element||e instanceof Document||e instanceof Window)n.push(e);else if(e instanceof _$||e instanceof NodeList||e instanceof Array)n.push(...e);else if("string"==typeof e)try{const s=(t||document).querySelectorAll(e);n.push(...s)}catch(t){const s=document.createElement("template");s.innerHTML=e,n.push(...s.content.childNodes)}return n}static _toFragment(e){const t=document.createDocumentFragment(),n=[...e];for(;n[0];)t.appendChild(n.shift());return t}add(e,t){return e instanceof _$?this.push(...e):this.push(..._$._STD(e,t)),this}addClass(e){return this.forEach(t=>{t.classList.add(...e.split(/\s+/))}),this}after(...e){return this.forEach(t=>{let n=t;e.forEach(e=>{n=_$.insert(e,"after",n)})}),this}append(...e){return this.forEach(t=>{e.forEach(e=>{_$.insert(e,"end",t)})}),this}appendTo(e){return _$.insert(this,"end",e),this}attr(e,t){return void 0===t?this.length?this[0].getAttribute(e):null:(this.forEach(n=>{n.setAttribute(e,t)}),this)}before(...e){return this.forEach(t=>{e.forEach(e=>{_$.insert(e,"before",t)})}),this}blur(){return this.forEach(e=>{e.blur()}),this}children(e){const t=[];return this.forEach(n=>{[...n.children].forEach(n=>{e&&!n.matches(e)||t.push(n)})}),new _$([...new Set(t)])}clone(e=!0){return new _$(this.map(t=>t.cloneNode(e)))}closest(e){return new _$(this.map(t=>t.closest(e)).filter(e=>e))}contents(){return new _$(this.reduce((e,t)=>(e.push(...t.childNodes),e),[]))}css(e,t){if("string"==typeof e){if(!t)return this.length?this[0].style[e]||getComputedStyle(this[0])[e]:null;this.forEach(n=>{n.style[e]=t})}else this.forEach(t=>{Object.entries(e).forEach(([e,n])=>{t.style[e]=n})});return this}detach(){return this.forEach(e=>{e.parentElement.removeChild(e)}),this}each(e){return this.forEach((t,n)=>{Reflect.apply(e,t,[n,t])}),this}empty(){return this.forEach(e=>{e.innerHTML=""}),this}eq(e){return this.length?new _$(this[e>=0?e:this.length+e]):new _$([])}filter(e){const t=[];return this.forEach((n,s)=>{e instanceof Function?Reflect.apply(e,n,[n,s])&&t.push(n):n.matches(e)&&t.push(n)}),new _$([...new Set(t)])}find(e){const t=[];return this.forEach(n=>{t.push(...n.querySelectorAll(e))}),new _$([...new Set(t)])}first(){return this.eq(0)}get(e){return e?this[e]:[...this]}has(e){return e instanceof Element?new _$(this.filter(t=>t.contains(e))):new _$(this.filter(t=>t.querySelector(e)))}hasClass(e){return!!this.filter(t=>t.classList.contains(e)).length}height(){return this.length?this[0]instanceof Document||this[0]instanceof Window?document.documentElement.clientHeight:this[0].clientHeight:null}hide(){return this.forEach(e=>{e.style.display="none"}),this}html(e){return e?(this.forEach(t=>{t.innerHTML=e}),this):this.length?this[0].innerHTML:null}index(){return this.length?[...this[0].parentElement.children].indexOf(this[0]):null}static insert(e,t,n){const s=[];return _$._STD(n).forEach(n=>{const r=_$._STD(e),i=_$._toFragment(r);s.push(...r),"before"==t?n.parentNode.insertBefore(i,n):"start"==t?n.insertBefore(i,n.firstChild):"end"==t?n.appendChild(i):"after"==t&&n.parentNode.insertBefore(i,n.nextElementSibling)}),new _$(s)}insertAfter(e){return _$.insert(this,"after",e),this}insertBefore(e){return _$.insert(this,"before",e),this}is(e){return e instanceof _$?!!this.filter(t=>e.includes(t)).length:e instanceof Function?!!this.filter((t,n)=>Reflect.apply(e,t,[n,t])).length:e instanceof Element?!!this.filter(t=>e.isSameNode(t)).length:!!this.filter(t=>t.matches(e)).length}static ajax(e,t){new Promise(e=>{if("function"==typeof AjaxSender)e();else{const t=document.createElement("script");t.src="https://gitcdn.link/repo/Zenoo/ajax-sender/v0.1.7/AjaxSender.min.js",t.onload=()=>{e()},document.querySelector("head").appendChild(t)}}).then(()=>(t||(e=(t=e).url),new AjaxSender(e,{method:t.method||"GET",data:t.data,responseType:t.dataType||"json",header:t.headers,load:t.success,error:t.error}).xhr))}static get(e,t,n,s){return _$.ajax(e,{data:t,success:n,dataType:s})}last(){return this.eq(this.length-1)}next(e){return this.map(t=>e?t.nextElementSibling.matches(e)?t.nextElementSibling:null:t.nextElementSibling).filter(Boolean)}nextAll(e){const t=[];return this.forEach(e=>{const n=[...e.parentElement.children],s=n.indexOf(e);t.push(...n.slice(s+1,n.length))}),new _$([...new Set(e?t.filter(t=>t.matches(e)):t)])}not(e){const t=[];return this.forEach((n,s)=>{e instanceof Function?Reflect.apply(e,n,[s,n])||t.push(n):e instanceof _$?e.includes(n)||t.push(n):_$._STD(e).includes(n)||t.push(n)}),new _$([...new Set(t)])}off(e,t,n){const s=e.split(/\s+/),r=[];return s.forEach(e=>{t?n?r.push(...__$_events__[e].filter(e=>this.includes(e.element)&&e.selector==t&&e.handler==n)):r.push(...__$_events__[e].filter(e=>this.includes(e.element)&&e.selector==t)):r.push(...__$_events__[e].filter(e=>this.includes(e.element)))}),r.forEach(e=>{e.element.removeEventListener(e.eventName,e.silentHandler),__$_events__[e.eventName]=__$_events__[e.eventName].filter(t=>t!=e)}),this}offset(){return this.length?this[0].getBoundingClientRect():null}on(e,t,n,s){const r=e.split(/\s+/);return t instanceof Function&&(s=n,n=t,t=null),r.forEach(e=>{this.forEach(r=>{const i=e=>{if(t){const i=e.target.closest(t);r.contains(i)&&(e.data=s,Reflect.apply(n,i,[e]))}else e.data=s,Reflect.apply(n,r,[e])};r.addEventListener(e,i),__$_events__[e]||(__$_events__[e]=[]),__$_events__[e].push({eventName:e,element:r,selector:t,handler:n,silentHandler:i})})}),this}parent(e){return new _$([...new Set(e?this.map(t=>t.parentElement.matches(e)?t.parentElement:null).filter(Boolean):this.map(e=>e.parentElement))])}parents(e){const t=new Set;return this.forEach(n=>{let s=n.parentElement;for(;s;)e?s.matches(e)&&t.add(s):t.add(s),s=s.parentElement}),new _$([...t])}prepend(...e){return this.forEach(t=>{_$.insert(e.reduce((e,t)=>e.add(t),new _$),"start",t)}),this}prependTo(e){return _$.insert(this,"start",e),this}prev(e){return this.map(t=>e?t.previousElementSibling.matches(e)?t.previousElementSibling:null:t.previousElementSibling).filter(Boolean)}prevAll(e){const t=[];return this.forEach(e=>{const n=[...e.parentElement.children],s=n.indexOf(e);t.push(...n.slice(0,s))}),new _$([...new Set(e?t.filter(t=>t.matches(e)):t)])}remove(){return this.forEach(e=>{e.remove()}),this}removeAttr(e){return this.forEach(t=>{t.removeAttribute(e)}),this}removeClass(e){return this.forEach(t=>{t.classList.remove(...e.split(/\s+/))}),this}replaceAll(e){return _$._STD(e).forEach(e=>{this.insertAfter(e),e.remove()}),this}replaceWith(e){return this.forEach(t=>{_$.insert(e,"before",t),t.remove()}),this}scrollLeft(e){return isNaN(e)?this.length?this[0]instanceof Document?this[0].scrollingElement.scrollLeft:this[0]instanceof Window?this[0].document.scrollingElement.scrollLeft:this[0].scrollLeft:null:(this.forEach(t=>{t instanceof Document?t.scrollingElement.scrollLeft=e:t.scrollLeft=e}),this)}scrollTop(e){return isNaN(e)?this.length?this[0]instanceof Document?this[0].scrollingElement.scrollTop:this[0]instanceof Window?this[0].document.scrollingElement.scrollTop:this[0].scrollTop:null:(this.forEach(t=>{t instanceof Document?t.scrollingElement.scrollTop=e:t.scrollTop=e}),this)}serialize(){let e="";return this.forEach(t=>{t instanceof HTMLFormElement?e+=Array.from(new FormData(t),e=>e.map(encodeURIComponent).join("=")).join("&"):void 0!==t.value&&void 0!==t.name&&(e.length&&(e+="&"),e+=encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),e}serializeArray(){const e=[];return this.forEach(t=>{t instanceof HTMLFormElement?e.push(...Array.from(new FormData(t),([e,t])=>({name:e,value:t}))):void 0!==t.value&&void 0!==t.name&&e.push({name:t.name,value:t.value})}),e}show(){return this.forEach(e=>{e.style&&"none"==e.style.display&&(e.style.display=""),e instanceof Element&&"none"==getComputedStyle(e).display&&(e.style.display=__$_default_display_inline__[e.nodeName.toLowerCase()]?"inline":"block")}),this}siblings(e){const t=[];return this.forEach(e=>{t.push(...[...e.parentElement.children].filter(e=>!this.includes(e)))}),new _$([...new Set(e?t.filter(t=>t.matches(e)):t)])}text(e){return void 0===e?this.reduce((e,t)=>e+(t.innerText||t.textContent),""):(this.forEach(t=>{t.innerText=e}),this)}toggle(e){return this.forEach(t=>{t.style&&(void 0!==e?t.style.display=e?__$_default_display_inline__[t.nodeName.toLowerCase()]?"inline":"block":"none":"none"==t.style.display?t.style.display="":"none"==getComputedStyle(t).display?t.style.display=__$_default_display_inline__[t.nodeName.toLowerCase()]?"inline":"block":t.style.display="none")}),this}toggleClass(e){return this.forEach(t=>{e.split(/\s+/).forEach(e=>{t.classList.toggle(e)})}),this}trigger(e){this.forEach(t=>{const n=new Event(e);t.dispatchEvent(n)})}unwrap(e){return this.reduce((e,t)=>e.add(t.parentNode),new Set).forEach(t=>{e&&!t.matches(e)||t.parentElement.replaceChild(_$._toFragment(t.childNodes),t)}),this}val(e){return void 0===e?this.length?this[0].value:null:(this.forEach(t=>{void 0!==t.value&&(t.value=e)}),this)}width(){return this.length?this[0]instanceof Document||this[0]instanceof Window?document.documentElement.clientWidth:this[0].clientWidth:null}wrap(e){return this.forEach(t=>{const n=_$._STD(e);if(n.length){const e=n[0].cloneNode(!0);_$.insert(e,"after",t),_$.insert(t,"start",e)}}),this}wrapAll(e){const t=[],n=_$._STD(e);return n.length&&(this.forEach(e=>{const n=t.findIndex(t=>[...e.parentElement.children].includes(t[0]));n>-1?t[n].push(e):t.push([e])}),t.forEach(e=>{const t=n[0].cloneNode(!0);_$.insert(t,"before",e[0]),_$.insert(e,"start",t)})),this}}const $=e=>new _$(e);$.ajax=_$.ajax,$.get=_$.get,$.insert=_$.insert;