jdoms
Version:
jDoms is an interactive Javascript library for DOM manipulations and most regulars functions related with DOM.
2 lines • 49.5 kB
JavaScript
/*! jDoms JavaScript Library v1.1.0 (https://mamedul.gitlab.io/dev-projects/jdoms)- Copyright (c) 2021-2022 by MAMEDUL ISLAM and Licensed under the MIT license */
!function(t,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e():function(t){if(!t.document)throw new Error("jDoms requires a document which has a window");return e()}:"function"==typeof define&&define.amd?(define(e),e()):e(),void 0!==t&&(t=window||globalThis||self||this),t.jDoms=e()}("undefined"!=typeof window?window||globalThis:this||self,function(){"use strict";"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Array.prototype.filter||(Array.prototype.filter=function(t){var e=this.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=[],r=arguments[1],i=0;i<e;i++)if(i in this){var o=this[i];t.call(r,o,i,this)&&n.push(o)}return n}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){for(var n=e||0,r=this.length;n<r;n++)if(this[n]===t)return n;return-1});var t=function(t){return void 0===t},n=function(t){return void 0!==t},r=function(t){return"string"==typeof t},o=function(t){return"number"==typeof t},s=function(t){return"number"==typeof t&&parseInt(t)===t},a=function(t){return"boolean"==typeof t},u=function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t},h=function(t){return"undefined"!=typeof Array&&void 0!==Array.isArray?Array.isArray(t):!(!t.constructor||!t.constructor.name||"Array"!=t.constructor.name)||("undefined"!=typeof Object&&Object.prototype&&Object.prototype.toString&&Object.prototype.toString.call&&Object.prototype.toString.call(t),!0)},c=function(t){return"function"==typeof t},l=function(t){return"object"==typeof t},f=function(t){return"object"==typeof t&&"undefined"!=typeof Object&&t===Object(t)},d=function(t){return"function"==typeof t&&"jDoms"==t.name||"object"==typeof t&&void 0!==t.constructor&&void 0!==t.constructor.name&&"jDoms"==t.constructor.name},p=function(t){var e=0;if("boolean"==typeof t||"function"==typeof t||"symbol"==typeof t)e=1;else if("bigint"==typeof t)e="function"==typeof BigInt&&"function"==typeof BigInt.valueOf?(""+BigInt(t).valueOf()).length:(""+t).length+1;else if("string"==typeof t||"number"==typeof t)e=(""+t).length;else if("object"==typeof t){var r;if("function"==typeof Object&&"function"==typeof Object.keys&&(e=Object.keys(t).length),0==e)for(r in t)n(t.hasOwnProperty)&&t.hasOwnProperty(r)&&e++;0==e&&void 0!==t.nodeName&&void 0!==t.nodeType&&void 0!==t.nodeValue&&e++}return e},g=function(t){try{if(r(t))return t.trim?t.trim():t.replace(/^\s+|\s+$/gm,"");if(h(t)||l(t)){for(var e in t)t[e]=g(t[e]);return t}}catch(t){}return t},m=function(t){if(h(t))t=t.filter(function(t,e,n){return n.indexOf(t)===e});else if(r(t)||o(t)){var e="";t=""+t;for(var n=0;n<t.length;n++)e.indexOf(t[n])<0&&(e+=t[n]);return e}return t},v=function(t){try{return encodeURI(t)}catch(t){}return""},y=function(t){try{return decodeURI(t)}catch(t){}return t},b=function(t){if(n(btoa))return btoa(t);var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t){var n,r,i,o,s,a,u,h="",c=0;for(t=function(t){t=t.replace(/\r\n/g,"\n");for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e+=String.fromCharCode(r):r>127&&r<2048?(e+=String.fromCharCode(r>>6|192),e+=String.fromCharCode(63&r|128)):(e+=String.fromCharCode(r>>12|224),e+=String.fromCharCode(r>>6&63|128),e+=String.fromCharCode(63&r|128))}return e}(t);c<t.length;)o=(n=t.charCodeAt(c++))>>2,s=(3&n)<<4|(r=t.charCodeAt(c++))>>4,a=(15&r)<<2|(i=t.charCodeAt(c++))>>6,u=63&i,isNaN(r)?a=u=64:isNaN(i)&&(u=64),h=h+e.charAt(o)+e.charAt(s)+e.charAt(a)+e.charAt(u);return h}(t)},w=function(t){if(n(atob))return atob(t);var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t){var n,r,i,o,s,a,u="",h=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<t.length;)n=e.indexOf(t.charAt(h++))<<2|(o=e.indexOf(t.charAt(h++)))>>4,r=(15&o)<<4|(s=e.indexOf(t.charAt(h++)))>>2,i=(3&s)<<6|(a=e.indexOf(t.charAt(h++))),u+=String.fromCharCode(n),64!=s&&(u+=String.fromCharCode(r)),64!=a&&(u+=String.fromCharCode(i));return u=function(t){for(var e="",n=0,r=0,i=0;n<t.length;)(r=t.charCodeAt(n))<128?(e+=String.fromCharCode(r),n++):r>191&&r<224?(i=t.charCodeAt(n+1),e+=String.fromCharCode((31&r)<<6|63&i),n+=2):(i=t.charCodeAt(n+1),c3=t.charCodeAt(n+2),e+=String.fromCharCode((15&r)<<12|(63&i)<<6|63&c3),n+=3);return e}(u)}(t)},T=function(){function t(t){return a.lastIndex=0,a.test(t)?'"'+t.replace(a,function(t){var e=u[t];return r(e)?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function e(r,a){var u,h,l,f,d,p,g=i;try{if((d=a[r])&&"object"==typeof d&&c(d.toJSON)&&(d=d.toJSON(r)),d instanceof HTMLElement)return function(e){var n=e.tagName.toLowerCase(),r="<"+n;return e.attributes.length>0&&(r+=" "),(r+=Array.prototype.map.call(e.attributes,function(e){return""===e.value?e.name:e.name+"="+t(e.value)}).join(" "))+(["!doctype","br","hr","img","link","meta","input"].indexOf(n)>-1?">":">"+e.innerHTML+"</"+n+">")}(d);if(d instanceof RegExp)return String(d);if(d instanceof MimeType||d instanceof Plugin)return Object.prototype.toString.call(d);switch(typeof d){case"string":return t(d);case"boolean":case"null":case"number":case"undefined":return String(d);case"function":case"object":if(!d)return"null";var m=s.indexOf(d)+1;if(m>0)return"/**ref:"+m.toString(16)+"**/";if(s.push(d),p="/**id:"+(m=s.length).toString(16)+"**/",c(d))return p+" "+String(d);if(i+=o,f=[],"[object Array]"===Object.prototype.toString.apply(d)){for(l=d.length,u=0;u<l;u+=1)f[u]=e(u,d)||"null";return h=0===f.length?"[]":"[\n"+i+p+"\n"+i+f.join(",\n"+i)+"\n"+g+"]",i=g,h}var v,y=function(t){var e=[];for(var n in t)e=e.concat(n);return e}(d);for(var b in y)n(y.hasOwnProperty)&&!y.hasOwnProperty(b)||(h=e(v=y[b],d))&&f.push(t(v)+": "+h);return h=0===f.length?"{}":"{\n"+i+p+"\n"+i+f.join(",\n"+i)+"\n"+g+"}",i=g,h}}catch(t){return""}}var i,o,s,a=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,u={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return{quote:t,getString:function(t){if(r(t))return t;i="",o=" ",s=[];for(var n=e("",{"":t}),a=s.length;a;)new RegExp("/\\*\\*ref:"+a.toString(16)+"\\*\\*/").test(n)||(n=n.replace(new RegExp("[\r\n\t ]*/\\*\\*id:"+a.toString(16)+"\\*\\*/","g"),"")),a--;return s=null,n}}}(),C=function(t){return Date.parse(t)},S=function(t){var e=location||window.location,n={hash:e.hash||"",host:e.host||"",hostname:e.hostname||"",href:e||"",origin:e.origin||"",password:e.password||"",pathname:e.pathname||"",port:e.port||"",protocol:e.protocol||"",search:e.search||"",username:e.username||""},r=document.createElement("a");return r.href=t,n.hash=r.hash,n.host=r.host,n.hostname=r.hostname,n.href=r.href,n.origin=r.origin,n.password=r.password,n.pathname=r.pathname,n.port=r.port,n.protocol=r.protocol,n.search=r.search,n.username=r.username,n},E=function(t){var e={};if(l(JSON)&&c(JSON.parse))try{e=JSON.parse(t)}catch(t){}else if(l(Components)&&c(Components.classes)&&c(Components.interfaces))try{e=Components.classes["@mozilla.org/dom/json;1"].createInstance(Components.interfaces.nsIJSON).decode(t)}catch(t){}else{var n=t.replace(/^\s+/,"").replace(/\s+$/,""),r=function(t){if(/^[\],:{}\s]*$/.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return new Function("return "+n)()}();e=r||e}return e},O=function(t){if(window.DOMParser)return(new DOMParser).parseFromString(t,"text/xml");if(n(ActiveXObject)){var e=new ActiveXObject("Microsoft.XMLDOM");return e.async=!1,e.loadXML(t)}return{}},A=function(t){if(0===t.toLowerCase().replace(/^\s+|\s+$/gm,"").indexOf("<!doctype")&&document.implementation&&document.implementation.createHTMLDocument){var e=document.implementation.createHTMLDocument("");return e.documentElement.innerHTML=t,e}if("content"in document.createElement("template")){var n=document.createElement("template");return n.innerHTML=t,n.content}var r=document.createDocumentFragment(),o=document.createElement("body");for(o.innerHTML=t,i=0;0<o.childNodes.length;)r.appendChild(o.childNodes[i]);return r},L=function(t){for(var e={altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,touches:!0,which:!0},r=N(L.that).doms(L.selectors),i=0;i<r.length;i++){var o=(t=t||window.event).target||t.currentTarget||t.srcElement;if(r[i]==o||N(r[i]).child(o).length>0||n(r[i].compareDocumentPosition)&&16==r[i].compareDocumentPosition(o)||n(r[i].contains)&&r[i].contains(o)){for(var s in t)n(t.hasOwnProperty)&&!t.hasOwnProperty(s)||(e[s]=t[s]);o=["target","targetElement","srcElement"];for(var a=0;a<o.length;a++)e[o[a]]=r[i],n(Object.defineProperty)&&Object.defineProperty(e,o[a],{writable:!1,value:r[i]});L.callback(e)}}this.that=null,this.selectors=null,this.callback=null};L.type=null,L.that=null,L.selectors=null,L.callback=null;var x={version:"1.1.0",length:function(){return this.length||0},doms:function(t){var e=arguments||[];t=t||e[0];var n=e[1]||"",r=[];if(this.length>0)for(var i=0;i<this.length;i++)for(var o=N(t,n,this[i]),s=0;s<o.length;s++)r=r.concat(o[s]);return N(r)},find:function(t){var e=arguments[1]||"";return this.doms(t,e)},search:function(t){var e=arguments[1]||"";return this.doms(t,e)},index:function(t){try{return 0==this.length?this._[parseInt(t)]:this[parseInt(t)]}catch(t){}return null},domIndex:function(t){var e=[];try{e=this[parseInt(t)]}catch(t){}return N(e)},key:function(t){try{if(n(this._.hasOwnProperty))return this._[t]}catch(t){}return null},each:function(t){for(var e=0;e<this.length;e++)t(this[e],e,this);return this},parent:function(){for(var t=(arguments||[])[0],e=[],r=[],i=0;i<this.length;i++)if(e=e.concat(this[i].parentElement||this[i].parentNode),n(t))for(var o=N(t,"",this[i].ownerDocument||document),s=0;s<o.length;s++)r=r.concat(o[s]);return n(t)&&(r.length>1&&(r=r.filter(function(t,e,n){return n.indexOf(t)===e})),e=e.filter(function(t){return-1!==r.indexOf(t)})),e=m(e),N(e)},closest:function(t){window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var n,r=new N.jDomsList(t,"",this.document||this.ownerDocument||document),i=this;do{for(n=r.length;--n>=0&&r.item(n)!==i;);}while(n<0&&(i=i.parentElement||i.parentNode));return i||[]});for(var e=[],r=0;r<this.length;r++)if(n(this[r].closest))for(var i=this[r].closest(t),o=0;o<i.length;o++)e=e.concat(i[o]);return e=m(e),N(e)},child:function(){for(var t,e,r=(arguments||[])[0],i=[],o=[],s=0;s<this.length;s++){if(n(this[s].children))for(t=this[s].children,e=0;e<t.length;e++)i=i.concat(t[e]);else if(n(this[s].childNodes))for(t=this[s].childNodes,e=0;e<t.length;e++)t[s].nodeName&&t[s].nodeType==Node.ELEMENT_NODE&&(i=i.concat(t[e]));if(i=i.concat(),n(r))for(var a=N(r,"",this[s].ownerDocument||document),u=0;u<a.length;u++)o=o.concat(a[u])}return n(r)&&(o.length>1&&(o=o.filter(function(t,e,n){return n.indexOf(t)===e})),i=i.filter(function(t){return-1!==o.indexOf(t)})),i=m(i),N(i)},children:function(){var t=(arguments||[])[0];return this.child(t)},match:function(t){var e=arguments||[];t=t||e[0]||[];for(var r=e[1]||"",i=n(e[2])?e[2]:document,o=[],s=[],a=0;a<this.length;a++)o=o.concat(this[a]);for(var u=N(t,r,i),h=0;h<u.length;h++)s=s.concat(u[h]);return n(t)&&(s.length>1&&(s=s.filter(function(t,e,n){return n.indexOf(t)===e})),o=o.filter(function(t){return-1!==s.indexOf(t)})),o=m(o),N(o)},matchTo:function(t){var e=arguments||[];t=t||e[0]||[];for(var r=e[1]||"",i=n(e[2])?e[2]:document,o=[],s=[],a=0;a<this.length;a++)o=o.concat(this[a]);for(var u=N(t,r,i),h=0;h<u.length;h++)s=s.concat(u[h]);return n(t)&&(s.length>1&&(s=s.filter(function(t,e,n){return n.indexOf(t)===e})),s=s.filter(function(t){return-1!==o.indexOf(t)})),s=m(s),N(s)},merge:function(t){var e=arguments||[];t=t||e[0]||[];for(var r=e[1]||"",i=n(e[2])?e[2]:document,o=[],s=[],a=0;a<this.length;a++)o=o.concat(this[a]);for(var u=N(t,r,i),h=0;h<u.length;h++)s=s.concat(u[h]);if(n(t))for(var c=0;c<s.length;c++)o.indexOf(s[c])<0&&(o=o.concat(s[c]));return o=m(o),N(o)},unique:function(){for(var t=[],e=0;e<this.length;e++)t=t.concat(this[e]);return t=m(t),N(t)},not:function(t){var e=arguments||[];t=t||e[0];for(var r=e[1]||"",i=n(e[2])?e[2]:document,o=[],s=[],a=0;a<this.length;a++)o=o.concat(this[a]);for(var u=N(t,r,i),h=0;h<u.length;h++)s=s.concat(u[h]);return n(t)&&(s.length>1&&(s=s.filter(function(t,e,n){return n.indexOf(t)===e})),o=o.filter(function(t){return-1===s.indexOf(t)})),o=m(o),N(o)},is:function(e){if(t(this[0]))return!1;for(var n=[this[0]],r=[],i=N(this[0]).match(e),o=0;o<i.length;o++)r=r.concat(i[o]);return(n=n.filter(function(t){return-1!==r.indexOf(t)})).length>0},isSame:function(t){var e=arguments||[];t=t||e[0]||[];for(var r=e[1]||"",i=n(e[2])?e[2]:document,o=[],s=[],a=0;a<this.length;a++)o=o.concat(this[a]);for(var u=N(t,r,i),h=0;h<u.length;h++)s=s.concat(u[h]);if(o=N.unique(o),s=N.unique(s),o.length!==s.length)return!1;if(o===s)return!0;for(var c=0;c<o.length;c++)if(-1==s.indexOf(o[c]))return!1;return!0},isContains:function(t){var e=arguments||[];t=t||e[0];var r=e[1]||"",i=n(e[2])?e[2]:document,o=this[0],s=N(t,r,i)[0];return!!(n(o)&&n(s)&&n(o.contains))&&o.contains(s)},isContainsBy:function(t){var e=arguments||[];t=t||e[0];var r=e[1]||"",i=n(e[2])?e[2]:document,o=this[0],s=N(t,r,i)[0];return!!(n(s)&&n(o)&&n(s.contains))&&s.contains(o)},previous:function(){for(var t=(arguments||[])[0],e=[],r=[],i=0;i<this.length;i++){for(var o=this[i].previousSibling;o&&1!=o.nodeType;)o=o.previousSibling;if(e=e.concat(o),n(t))for(var s=N(t,"",this[i].ownerDocument||document),a=0;a<s.length;a++)r=r.concat(s[a])}return n(t)&&(r.length>1&&(r=r.filter(function(t,e,n){return n.indexOf(t)===e})),e=e.filter(function(t){return-1!==r.indexOf(t)})),e=m(e),N(e)},next:function(){for(var t=(arguments||[])[0],e=[],r=[],i=0;i<this.length;i++){for(var o=this[i].nextSibling;o&&1!=o.nodeType;)o=o.nextSibling;if(e=e.concat(o),n(t))for(var s=N(t,"",this[i].ownerDocument||document),a=0;a<s.length;a++)r=r.concat(s[a])}return n(t)&&(r.length>1&&(r=r.filter(function(t,e,n){return n.indexOf(t)===e})),e=e.filter(function(t){return-1!==r.indexOf(t)})),e=m(e),N(e)},first:function(){var t=this[0]?[this[0]]:[];if(!t)return N(t);var e=(arguments||[])[0],r=[];if(n(e))for(var i=N(e,"",t[0].ownerDocument||document),o=0;o<i.length;o++)r=r.concat(i[o]);return n(e)&&(r.length>1&&(r=r.filter(function(t,e,n){return n.indexOf(t)===e})),t=t.filter(function(t){return-1!==r.indexOf(t)})),t=m(t),N(t)},last:function(){var t=this[this.length-1]?[this[this.length-1]]:[];if(!t)return N(t);var e=(arguments||[])[0],r=[];if(n(e))for(var i=N(e,"",t[0].ownerDocument||document),o=0;o<i.length;o++)r=r.concat(i[o]);return n(e)&&(r.length>1&&(r=r.filter(function(t,e,n){return n.indexOf(t)===e})),t=t.filter(function(t){return-1!==r.indexOf(t)})),t=m(t),N(t)},clone:function(){for(var t=arguments,e=!n(t[0])||!1!==t[0],r=0;r<this.length;r++)if(n(this[r].cloneNode))return this[r].cloneNode(e);return this},addEvent:function(t){var e,r,i=arguments,o=!1,s=(t=t||i[0]||"").split(" ");n(i[3])?(e=i[1],r=i[2],o=!0===i[3]):n(i[2])?(e=i[1],r=i[2]):n(i[1])&&(r=i[1]);for(var a,u,h=0;h<this.length;h++)for(u=this[h],a=0;a<s.length;a++)n(e)?(L.that=this[h],L.selectors=e,L.callback=r,L.type=s[a],N(u).setProperty("jDomsEvent-"+s[a]+"-"+r.name,r.name),this[h].addEventListener?this[h].addEventListener(s[a],L,o):this[h].attachEvent&&this[h].attachEvent("on"+s[a],L)):this[h].addEventListener?this[h].addEventListener(s[a],r,o):this[h].attachEvent&&this[h].attachEvent("on"+s[a],r)},on:function(t){var e=arguments;t=e[0];var n=e[1],r=e[2],i=e[3];return this.addEvent(t,n,r,i)},removeEvent:function(t){var e,r,i=arguments,o=!1,s=(t=t||i[0]||"").split(" ");n(i[3])?(e=i[1],r=i[2],o=!0===i[3]):n(i[2])?(e=i[1],r=i[2]):n(i[1])&&(r=i[1]);var a,u;if(c(r))for(var h=0;h<this.length;h++)for(u=this[h],a=0;a<s.length;a++)n(e)?N(u).getProperty("jDomsEvent-"+s[a]+"-"+r.name)==r.name&&(this[h].removeEventListener?this[h].removeEventListener(s[a],L,o):this[h].detachEvent&&this[h].detachEvent("on"+s[a],L)):this[h].removeEventListener?this[h].removeEventListener(s[a],r,o):this[h].detachEvent&&this[h].detachEvent("on"+s[a],r)},off:function(t){var e=arguments;t=e[0];var n=e[1],r=e[2],i=e[3];return this.removeEvent(t,n,r,i)},fireEvent:function(t){for(var e=0;e<this.length;e++){var r=document;if(this[e].ownerDocument?r=this[e].ownerDocument:9==this[e].nodeType&&(r=this[e]),this[e].dispatchEvent){var i="";switch(t){case"click":case"mousedown":case"mouseup":i="MouseEvents";break;case"focus":case"change":case"blur":case"select":i="HTMLEvents"}var o=r.createEvent(i),s="change"!=t;n(o.initEvent)&&o.initEvent(t,s,!0),o.synthetic=!0,this[e].dispatchEvent(o,!0)}else if(this[e].fireEvent&&r.createEventObject){(o=r.createEventObject()).synthetic=!0,this[e].fireEvent("on"+t,o)}}return this},trigger:function(t){return this.fireEvent(t)},create:function(){var t=[];if(r(this._))for(var e,i,o=this._.replace(/(?:\s*-\s*)+|\s{2,}/g," ").split(" "),s=0;s<o.length;s++){if(e=null,i=o[s].replace(/[^A-Za-z]/gi,""),r(this.__)&&(e=document.createElementNS(this.__,i),l(this.___)))try{for(var a in this.___)n(this.__.hasOwnProperty)&&!this.__.hasOwnProperty(a)||e.setAttribute(a,this.___[a])}catch(t){}if(l(this.__))try{for(var u in e=document.createElement(i),this.__)n(this.__.hasOwnProperty)&&!this.__.hasOwnProperty(u)||e.setAttribute(u,this.__[u]);e.innerHTML=this.___}catch(t){}if(e){if(n(arguments[0])){var h=arguments[0];if(l(h))try{for(var c in h)n(h.hasOwnProperty)&&!h.hasOwnProperty(c)||(e[c]=h[c])}catch(t){}}t=t.concat(e)}}return N(t)},createElement:function(){return this.create(arguments[0])},getHtml:function(){for(var t=arguments||[],r=0;r<this.length;r++){if(n(t[0])&&!0===t[0]){if(n(this[r].outerHTML))return this[r].outerHTML;e.insertAdjacentHTML("beforeBegin",code);e.previousSibling;e.parentElement.removeChild(e);var i="";if((n(this[r].nodeName)||n(this[r].tagName))&&n(this[r].attributes)){var o=this[r].nodeName||this[r].tagName;o=o.toLowerCase();for(var s="",a=0;a<this[r].attributes.length;a++)s+=this[r].attributes[a].nodeName,s+=this[r].attributes[a].nodeValue.indexOf('"')>-1?"'":'"',s+=this[r].attributes[a].nodeValue,s+=this[r].attributes[a].nodeValue.indexOf('"')>-1?"'":'"';return i=n(this[r].innerHTML)?this[r].innerHTML:"","<"+o+(""==s?"":" "+s)+(["!doctype","br","hr","img","link","meta","input"].indexOf(o)>-1?"/>":">"+i+"<"+o+">")}}if(n(this[r].innerHTML))return this[r].innerHTML}return""},setHtml:function(t){for(var r=arguments||[],i=0;i<this.length;i++){if(n(r[1])&&!0===r[1])if(n(this[i].outerHTML))this[i].outerHTML=t;else this[i].insertAdjacentHTML("beforeBegin",code),(this[i].parentElement||this[i].parentNode).removeChild(e);else n(this[i].innerHTML)&&(this[i].innerHTML=t)}return this},html:function(){var t=arguments||[],e=n(t[0]),r=!0===(n(t[1])&&!0===t[1]);return e?this.setHtml(t[0],r):this.getHtml(r)},appendHtml:function(t){for(var e=0;e<this.length;e++)try{if(l(t)&&o(t.length)||h(t))for(var r=0;r<t.length;r++)this[e].appendChild(t[r]);else if(n(t.nodeType))this[e].appendChild(t);else{var i=document.createDocumentFragment(),s=document.createElement("span");s.innerHTML=t;for(var a=0;a<s.childNodes.length;a++)i.appendChild(s.childNodes[a]);this[e].appendChild(i)}}catch(t){}return this},append:function(t){return this.appendHtml(t)},prependHtml:function(t){for(var e=0;e<this.length;e++)try{if(l(t))if(n(t.hasOwnProperty))for(var r in t)t.hasOwnProperty(r)&&(this[e].firstChild?this[e].insertBefore(t[r],this[e].firstChild):this[e].appendChild(t[r]));else n(t.nodeType)&&(this[e].firstChild?this[e].insertBefore(t,this[e].firstChild):this[e].appendChild(t));else{var i=document.createDocumentFragment(),o=document.createElement("span");o.innerHTML=t;for(var s=0;s<o.childNodes.length;s++)i.appendChild(o.childNodes[s]);this[e].firstChild?this[e].insertBefore(i,this[e].firstChild):this[e].appendChild(i)}}catch(t){}return this},prepend:function(t){return this.prependHtml(t)},appendHtmlTo:function(t){var e=arguments;t=e[0]||t||[];var r=e[1]||"",i=n(e[2])?e[2]:document;return N(t,r,i).appendHtml(this)},appendTo:function(t){var e=arguments;t=e[0]||t||[];var r=e[1]||"",i=n(e[2])?e[2]:document;return this.appendHtmlTo(t,r,i)},prependHtmlTo:function(t){var e=arguments||[];t=t||e[0]||[];var r=e[1]||"",i=n(e[2])?e[2]:document;return N(t,r,i).prependHtml(this)},prependTo:function(t){var e=arguments;t=e[0]||t||[];var r=e[1]||"",i=n(e[2])?e[2]:document;return this.prependHtmlTo(t,r,i)},addBefore:function(t){for(var e=0;e<this.length;e++)try{if(l(t)){if(n(t.innerHTML)&&n(t.nodeName)&&n(t.nodeType)&&1==t.nodeType)this[e].insertAdjacentElement("beforebegin",t);else if(h(t)||d(t))for(var r=0;r<t.length;r++)t[r]&&n(t[r].innerHTML)&&n(t[r].nodeName)&&n(t[r].nodeType)&&1==t[r].nodeType?this[e].insertAdjacentElement("beforebegin",t[r]):u(t[r])&&this[e].insertAdjacentHTML("beforebegin",t[r]);else if(n(t.hasOwnProperty))for(var i in t)n(t.hasOwnProperty(i))&&(t[i]&&n(t[i].innerHTML)&&n(t[i].nodeName)&&n(t[i].nodeType)&&1==t[i].nodeType?this[e].insertAdjacentElement("beforebegin",t[i]):u(t[i])&&this[e].insertAdjacentHTML("beforebegin",t[i]))}else u(t)&&this[e].insertAdjacentHTML("beforebegin",t)}catch(t){}return this},addAfter:function(t){for(var e=0;e<this.length;e++)try{if(l(t)){if(n(t.innerHTML)&&n(t.nodeName)&&n(t.nodeType)&&1==t.nodeType)n(this[e].insertAdjacentElement)&&this[e].insertAdjacentElement("afterend",t);else if(h(t)||d(t))for(var r=0;r<t.length;r++)t[r]&&n(t[r].innerHTML)&&n(t[r].nodeName)&&n(t[r].nodeType)&&1==t[r].nodeType?this[e].insertAdjacentElement("afterend",t[r]):u(t[r])&&n(this[e].insertAdjacentHTML)&&this[e].insertAdjacentHTML("afterend",t[r]);else if(n(t.hasOwnProperty))for(var i in t)n(t.hasOwnProperty(i))&&(t[i]&&n(t[i].innerHTML)&&n(t[i].nodeName)&&n(t[i].nodeType)&&1==t[i].nodeType?this[e].insertAdjacentElement("afterend",t[i]):u(t[i])&&n(this[e].insertAdjacentHTML)&&this[e].insertAdjacentHTML("afterend",t[i]))}else u(t)&&n(this[e].insertAdjacentHTML)&&this[e].insertAdjacentHTML("afterend",t)}catch(t){}return this},before:function(t){return this.addBefore(t)},after:function(t){return this.addAfter(t)},setText:function(t){for(var e=arguments||[],r=!0===(n(e[1])&&!0===e[1]),i=0;i<this.length;i++)try{this[i]&&(r?n(this[i].outerText)?this[i].outerText=t:(t=document.createTextNode(t),N(this[i]).setHtml(t)):n(this[i].textContent)?this[i].textContent=t:n(this[i].innerText)?this[i].innerText=t:(t=document.createTextNode(t),N(this[i]).setHtml(t)))}catch(t){}return this},getText:function(){for(var t=arguments||[],e=!0===(n(t[1])&&!0===t[1]),r=0;r<this.length;r++)try{if(this[r])return e?n(this[r].outerText)?this[r].outerText:N(this[r]).getHtml():n(this[r].textContent)?this[r].textContent:n(this[r].innerText)?this[r].innerText:N(this[r]).getHtml(content,e)}catch(t){}return""},text:function(){var t=arguments||[],e=n(t[0]),r=!0===(n(t[1])&&!0===t[1]);return e?this.setText(t[0],r):this.getText(r)},attributesList:function(){for(var t={},e=0;e<this.length;e++){if(this[e].attributes){t={};for(var r=0;r<this[e].attributes.length;r++)n(this[e].attributes[r].name)&&(t[this[e].attributes[r].name]=this[e].attributes[r].value)}return t}return t},attrList:function(){return this.attributesList()},setAttribute:function(){for(var t=arguments||[],e=t[0]||"",i=t[1],o=0;o<this.length;o++)if(l(e)){for(var s in e)if(n(this[o].setAttribute))try{this[o].setAttribute(s,e[s])}catch(t){}}else if(r(e)&&n(i))try{this[o].setAttribute(e,i)}catch(t){}return this},setAttr:function(){var t=arguments||[],e=t[0]||"",n=t[1];return this.getAttribute(e,n)},getAttribute:function(t){for(var e=0;e<this.length;e++)if(r(t))return this[e].getAttribute(t);return null},getAttr:function(t){return this.getAttribute(t)},attribute:function(){for(var e=arguments||[],i=e[0],o=e[1],s=0;s<this.length;s++)return l(i)?this.setAttribute(i,o):r(i)&&n(o)?this.setAttribute(i,o):r(i)&&t(o)&&this[s]&&this[s].getAttribute?this.getAttribute(i)||null:this.attributesList();return[]},attr:function(){var t=arguments||[],e=t[0],n=t[1];return this.attribute(e,n)},removeAttribute:function(t){for(var e=0;e<this.length;e++)if(this[e]&&n(this[e].removeAttribute))if(r(t))this[e].removeAttribute(t);else if(h(t))for(var i=0;i<t.length;i++)this[e].removeAttribute(t[i]);else if(f(t))for(var o in t)n(t.hasOwnProperty)&&!t.hasOwnProperty(o)||this[e].removeAttribute(t[o]);return this},removeAttr:function(t){return this.removeAttribute(t)},setProperty:function(t,e){for(var n=0;n<this.length;n++)if(this[n])if(l(t))for(var i in t)try{this[n][i]=t[i]}catch(t){}else if(r(t))try{this[n][t]=e}catch(t){}return this},setProp:function(t,e){return this.setProperty(t,e)},getProperty:function(t){for(var e=0;e<this.length;e++)if(r(t))try{return this[e][t]}catch(t){return null}return null},getProp:function(t){return this.getProperty(t)},property:function(){for(var e=arguments||[],i=e[0],o=e[2],s=0;s<this.length;s++){if(l(i))return this.setProperty(i);if(r(i)&&n(o))return this.setProperty(i,o);if(r(i)&&t(o))return this.getProperty(i)}return this},prop:function(){var t=arguments||[],e=t[0],n=t[2];return this.property(e,n)},removeProperty:function(t){for(var e=0;e<this.length;e++)if(n(this[e]))try{delete this[e][t],c(this[e].removeAttribute)&&this[e].removeAttribute(t)}catch(t){}return this},removeProp:function(t){return this.removeProperty(t)},getStyle:function(t){for(var e=0;e<this.length;e++)if(r(t)){var i=(this[e].ownerDocument||document).defaultView||window;if(i&&n(i.getComputedStyle))return i.getComputedStyle(this[e],null).getPropertyValue(t);if(this[e].currentStyle)return this[e].currentStyle[t];if(this[e].style)return this[e].style.getPropertyValue?this[e].style.getPropertyValue(t):this[e].style[t]}return""},setStyle:function(t){var e=arguments||[];t=t||e[0];var i=e[1],o=e[2];o=n(o)&&("important"==o||!0===o)?"important":"";for(var s=0;s<this.length;s++)if(l(t)){for(var a in t)if(this[s].style)try{this[s].style.setProperty&&(this[s].style[a]=t[a],this[s].style.setProperty(a,t[a],o))}catch(t){}}else if(r(t)&&n(i)&&this[s].style)try{this[s].style.setProperty&&(this[s].style[t]=i,this[s].style.setProperty(t,i,o))}catch(t){}return this},removeStyle:function(t){for(var e=0;e<this.length;e++)if(l(t)){t=Object.entries(t);for(var i=0;i<t.length;i++)this[e].style&&(this[e].style[t[i]]="",this[e].style[t[i]]=null,n(this[e].style.removeProperty)&&this[e].style.removeProperty(t[i]))}else r(t)&&this[e].style&&(this[e].style[t]="",this[e].style[t]=null,n(this[e].style.removeProperty)&&this[e].style.removeProperty(t));return this},style:function(){for(var e=arguments||[],i=e[0],o=e[1],s=e[2],a=0;a<this.length;a++)if(l(i))this.setStyle(i,o,s);else if(r(i)&&n(o))this.setStyle(i,o,s);else if(r(i)&&t(o))return this.getStyle(i);return this},css:function(){var t=arguments||[],e=t[0],n=t[1],r=t[2];return this.style(e,n,r)},getValue:function(){for(var t=0;t<this.length;t++)if(n(this[t].value))return this[t].value;return""},getVal:function(){return this.getValue()},setValue:function(t){for(var e=0;e<this.length;e++)if(n(this[e])&&n(t)&&n(this[e].value))try{this[e].value=t}catch(t){}return this},setVal:function(){return this.getValue()},value:function(){for(var t=(arguments||[])[0],e=0;e<this.length;e++)if(n(this[e])){if(!n(t))return n(this[e].value)?this[e].value:"";if(n(this[e].value))try{this[e].value=t}catch(t){}}return n(t)?this:""},val:function(){var t=(arguments||[])[0];return this.value(t)},remove:function(){for(var t=0;t<this.length;t++)try{this[t]&&this[t].remove?this[t].remove():this[t]&&this[t].parentNode&&this[t].parentNode.removeChild(this[t])}catch(t){}return this},hide:function(){for(var t=arguments,e=n(t[0])&&!1===t[0]?"":"important",r=0;r<this.length;r++)this[r]&&this[r].style&&this[r].style.setProperty("display","none",e);return this},show:function(){var t=arguments,e=n(t[0])?t[0]:"block";try{e=e&&["inherit","initial","inline","block","contents","flex","grid","inline-block","inline-flex","inline-grid","inline-table","list-item","run-in","table","table-caption","table-header-group","table-footer-group","table-column","table-column-group","table-row","table-row-group","table-cell"].indexOf(e)>-1?e.toLowerCase():"block"}catch(t){e="block"}return this.setStyle("display",e,"important")},classList:function(){for(var t=[],e=0;e<this.length;e++){if(n(this[0].classList))return this[e].classList;if(n(this[e].getAttribute)){t=[];var r=n(this[e].getAttribute);if(r)for(var i=r.split(" "),o=0;o<i.length;o++)""!=i[e]&&(t=t.concat(i[e]));return t}}return t},hasClass:function(t){for(var e=0;e<this.length;e++)return this.classList().indexOf(t)>-1;return!1},addClass:function(t){if(r(t))for(var e,i,o=0;o<this.length;o++)try{this[o]&&n(this[o].classList)?this[o].classList.add(t):(e=N(this[o]),-1==(i=N(this[o]).classList()).indexOf(t)&&(i=i.concat(t),e.setAttribute("class",i.join(" "))))}catch(t){}return this},removeClass:function(t){if(r(t))for(var e,i,o=0;o<this.length;o++)try{if(this[o]&&n(this[o].classList))this[o].classList.remove(t);else if(e=N(this[o]),i=N(this[o]).classList(),(i=N.unique(i)).indexOf(t)>-1){for(var s=0;s<i.length;s++)if(i[s]==t){i.splice(s,1);break}e.setAttribute("class",i.join(" "))}}catch(t){}return this},class:function(){return this.classList()},empty:function(){for(var t=0;t<this.length;t++)this[t]&&(n(this[t].value)?this[t].value="":n(this[t].innerHTML)&&(this[t].innerHTML=""));return this},normalize:function(){for(var t=0;t<this.length;t++)n(this[t].normalize)&&this[t].normalize();return this},getWidth:function(){for(var t=0;t<this.length;t++)return this[t].clientWidth?this[t].clientWidth:0;return 0},getHeight:function(){for(var t=0;t<this.length;t++)return this[t].clientHeight?this[t].clientHeight:0;return 0},setWidth:function(t){return o(t)&&(t+="px"),this.setStyle("width",t)},setHeight:function(t){return o(t)&&(t+="px"),this.setStyle("height",t)},width:function(){var t=(arguments||[])[0];return n(t)?this.setWidth(t):this.getWidth()},height:function(){var t=(arguments||[])[0];return n(t)?this.setHeight(t):this.getHeight()},offsetWidth:function(){for(var t=0;t<this.length;t++)return this[t].offsetWidth?this[t].offsetWidth:this[t].getBoundingClientRect?this[t].getBoundingClientRect().width:0;return 0},offsetHeight:function(){for(var t=0;t<this.length;t++)return this[t].offsetHeight?this[t].offsetHeight:this[t].getBoundingClientRect?this[t].getBoundingClientRect().height:0;return 0},offsetLeft:function(){for(var t=0;t<this.length;t++)return this[t].offsetLeft?this[t].offsetLeft:this[t].getBoundingClientRect?this[t].getBoundingClientRect().left:0;return 0},offsetTop:function(){for(var t=0;t<this.length;t++)return this[t].offsetTop?this[t].offsetTop:this[t].getBoundingClientRect?this[t].getBoundingClientRect().top:0;return 0},offset:function(){for(var t={left:0,top:0,x:0,y:0},e=0;e<this.length;e++){if(n(this[e].offsetLeft)&&(t.left=t.x=this[e].offsetLeft),n(this[e].offsetTop)&&(t.top=t.y=this[e].offsetTop),n(this[e].getBoundingClientRect)){var r=this[e].getBoundingClientRect();t.left,r.left,t.x=r.x,t.top,r.top,t.y=r.y}return t}return t},innerWidth:function(){for(var t=0;t<this.length;t++){var e=N(this[t]).getStyle("width");e=isNaN(parseFloat(e))?0:parseFloat(e);var r=N(this[t]).getStyle("padding-left");r=isNaN(parseFloat(r))?0:parseFloat(r);var i=N(this[t]).getStyle("padding-right");i=isNaN(parseFloat(i))?0:parseFloat(i);var o=N(this[t]).getStyle("border-left");o=isNaN(parseFloat(o))?0:parseFloat(o);var s=N(this[t]).getStyle("border-right");s=isNaN(parseFloat(s))?0:parseFloat(s);var a=N(this[t]).getStyle("box-sizing");return e||(n(this[t].offsetWidth)?"border-box"==a?this[t].offsetWidth:this[t].offsetWidth-(r+i):n(this[t].getBoundingClientRect)?"border-box"==a?this[t].getBoundingClientRect().width:this[t].getBoundingClientRect().width-(r+i+o+s):0)}return 0},innerHeight:function(){for(var t=0;t<this.length;t++){var e=N(this[t]).getStyle("height");e=isNaN(parseFloat(e))?0:parseFloat(e);var r=N(this[t]).getStyle("padding-top");r=isNaN(parseFloat(r))?0:parseFloat(r);var i=N(this[t]).getStyle("padding-bottom");i=isNaN(parseFloat(i))?0:parseFloat(i);var o=N(this[t]).getStyle("border-top");o=isNaN(parseFloat(o))?0:parseFloat(o);var s=N(this[t]).getStyle("border-bottom");s=isNaN(parseFloat(s))?0:parseFloat(s);var a=N(this[t]).getStyle("box-sizing");return e||(n(this[t].offsetHeight)?"border-box"==a?this[t].offsetHeight:this[t].offsetHeight-(r+i):n(this[t].getBoundingClientRect)?"border-box"==a?this[t].getBoundingClientRect().height:this[t].getBoundingClientRect().height-(r+i+o+s):0)}return 0},outerWidth:function(){for(var t=0;t<this.length;t++){var e=N(this[t]).getStyle("width");e=isNaN(parseFloat(e))?0:parseFloat(e);var r=N(this[t]).getStyle("padding-left");r=isNaN(parseFloat(r))?0:parseFloat(r);var i=N(this[t]).getStyle("padding-right");i=isNaN(parseFloat(i))?0:parseFloat(i);var o=N(this[t]).getStyle("border-left");o=isNaN(parseFloat(o))?0:parseFloat(o);var s=N(this[t]).getStyle("border-right");s=isNaN(parseFloat(s))?0:parseFloat(s);var a=N(this[t]).getStyle("margin-left");a=isNaN(parseFloat(a))?0:parseFloat(a);var u=N(this[t]).getStyle("margin-right");u=isNaN(parseFloat(u))?0:parseFloat(u);var h=N(this[t]).getStyle("box-sizing");return n(this[t].getBoundingClientRect)?this[t].getBoundingClientRect().width+(a+u):n(this[t].clientWidth)?this[t].clientWidth+(a+u):"border-box"==h?e+a:e+(r+i+o+s+a+u)}return 0},outerHeight:function(){for(var t=0;t<this.length;t++){var e=N(this[t]).getStyle("height");e=isNaN(parseFloat(e))?0:parseFloat(e);var r=N(this[t]).getStyle("padding-top");r=isNaN(parseFloat(r))?0:parseFloat(r);var i=N(this[t]).getStyle("padding-bottom");i=isNaN(parseFloat(i))?0:parseFloat(i);var o=N(this[t]).getStyle("border-top");o=isNaN(parseFloat(o))?0:parseFloat(o);var s=N(this[t]).getStyle("border-bottom");s=isNaN(parseFloat(s))?0:parseFloat(s);var a=N(this[t]).getStyle("margin-top");a=isNaN(parseFloat(a))?0:parseFloat(a);var u=N(this[t]).getStyle("margin-bottom");u=isNaN(parseFloat(u))?0:parseFloat(u);var h=N(this[t]).getStyle("box-sizing");return n(this[t].getBoundingClientRect)?this[t].getBoundingClientRect().height+a+u:n(this[t].clientHeight)?this[t].clientHeight+a+u:"border-box"==h?e+a+u:e+r+i+o+s+a+u}return 0},scrollWidth:function(){for(var t=0;t<this.length;t++)return this[t]&&n(this[t].scrollWidth)?this[t].scrollWidth:0;return 0},scrollHeight:function(){for(var t=0;t<this.length;t++)return this[t]&&n(this[t].scrollHeight)?this[t].scrollHeight:0;return 0},scrollTop:function(){for(var t=0;t<this.length;t++)return this[t]&&n(this[t].scrollTop)?this[t].scrollTop:0;return 0},scrollLeft:function(){for(var t=0;t<this.length;t++)return this[t]&&n(this[t].scrollLeft)?this[t].scrollLeft:0;return 0},scrollTo:function(){for(var e=arguments||[],r=e[0],i=e[1],s=0;s<this.length;s++)try{n(this[s].scrollTo)&&(f(r)?(t(r.top)&&n(r.y)&&(r.top=r.y),t(r.left)&&n(r.x)&&(r.left=r.x),this[s].scrollTo(r)):!o(r)||!o(i)&&n(i)||this[s].scrollTo(r,i||0))}catch(t){}return this},scrollBy:function(){for(var e=arguments||[],r=e[0],i=e[1],s=0;s<this.length;s++)try{n(this[s].scrollBy)&&(f(r)?(t(r.top)&&n(r.y)&&(r.top=r.y),t(r.left)&&n(r.x)&&(r.left=r.x),this[s].scrollBy(r)):!o(r)||!o(i)&&n(i)||this[s].scrollBy(r,i||0))}catch(t){}return this},click:function(){for(var t=0;t<this.length;t++)if(this[t].click)return this[t].click(),N(this[t]);return null},focus:function(){for(var t=0;t<this.length;t++)if(this[t].focus)return this[t].focus(),N(this[t]);return null},blur:function(){for(var t=0;t<this.length;t++)if(this[t].blur)return this[t].blur(),N(this[t]);return null},select:function(){for(var t=0;t<this.length;t++)if(this[t].select)return this[t].select(),N(this[t]);return null},delay:function(t,e){var n;return(n=0,function(t,e){clearTimeout(n),n=setTimeout(t,e)})(t,e)},openFullscreen:function(){for(var t=0;t<this.length;t++)return this[t].requestFullscreen?(this[t].requestFullscreen(),!0):this[t].webkitRequestFullscreen?(this[t].webkitRequestFullscreen(),!0):!!this[t].msRequestFullscreen&&(this[t].msRequestFullscreen(),!0);return!1},document:function(){for(var t=0;t<this.length;t++)return this[t].nodeType&&9==this[t].nodeType?this[t]:this[t].ownerDocument||this.ownerDocument||document;return this.ownerDocument||window.document||document||null},window:function(){for(var t=this.document||document,e=0;e<this.length;e++)t=this[e].nodeType&&9==this[e].nodeType?this[e]:this[e].ownerDocument||this.ownerDocument||document;return t.defaultView||window||this.window||globalThis||null},buildQuery:function(){var t=arguments||[],e="",r=n(t[0])?t[0]:n(this[0])&&n(this[0].elements)?this[0].elements:this._;if(l(r)){if(s(r.length))for(var i=0;i<r.length;i++)r[i].name&&("radio"==r[i].type.toLowerCase()||"checkbox"==r[i].type.toLowerCase()?1==r[i].checked&&(e+=r[i].name+"="+encodeURIComponent(r[i].value)+"&"):e+=r[i].name+"="+encodeURIComponent(r[i].value)+"&");else for(var o in r)if(n(r.hasOwnProperty)&&r.hasOwnProperty(o))try{e+=o+"="+encodeURIComponent(r[o])+"&"}catch(t){}}else if(h(r))for(var o in r)try{e+=o+"="+encodeURIComponent(r[o])+"&"}catch(t){}return e.length>2&&(e=e.substring(0,e.length-1)),e},buildFormData:function(){return c(FormData)&&n(this[0])&&n(this[0].elements)?new FormData(this[0]):null},dateParse:function(){var t=this._||{};return C(t)},urlParse:function(){var t=this._||{};return S(t)},xmlParse:function(){var t=arguments||[];if(n(t[0]))return O(t[0]);for(var e=0;e<this.length;e++)return O(this[e]);return O({})},htmlParse:function(){var t=arguments||[];if(n(t[0]))return A(t[0]);for(var e=0;e<this.length;e++)return A(this[e]);return A({})},jsonParse:function(){var t=arguments||[];if(n(t[0]))return E(t[0]);for(var e=0;e<this.length;e++)return E(this[e]);return E({})}},N=function(){var e=arguments||[],r=e[0]||[],i=e[1]||"",o=n(e[2])?e[2]:document,s=new N.jDomsList(r,i,o);for(var a in N.jDomsList.prototype.constructor=N,N.jDomsList.prototype.version="1.1.0",N.jDomsList.prototype.developer="MAMEDUL ISLAM",N.jDomsList.prototype._=r,N.jDomsList.prototype.__=i,N.jDomsList.prototype.___=o,x)n(x.hasOwnProperty)&&!x.hasOwnProperty(a)||t(a)||t(x[a])||(N.jDomsList.prototype[a]=x[a]);for(var u in N.fnc)n(N.fnc.hasOwnProperty)&&!N.fnc.hasOwnProperty(u)||t(u)||t(N.fnc[u])||n(x[u])||(N.jDomsList.prototype[u]=N.fnc[u]);return s};return N.jDomsList=function(t){var e=arguments||[];t=t||e[0]||[];var i=e[1]||"",o=n(e[2])?e[2]:document,s=[],a=null,u=0;try{if(t==window)s=[window],a="window";else if(t==document)s=[document],a="document";else if(t&&"object"==typeof t)if(d(t)){for(var c=0;c<t.length;c++)n(t[c])&&(s=s.concat(t[c]));a="jDoms"}else h(t)?(s=t,a="array"):n(t.nodeType)&&n(t.nodeName)&&n(t.nodeValue)?(s=[t],a="node"):(s=t,a="object");else if(r(t))if(n(o.querySelectorAll))s=o.querySelectorAll(t),a="query_selector_all";else if("#"==t.substr(0,1)&&t.replace(/[\.\/\`\'\=\<\>\~\%\(\)\[\]\{\}\|\*\^\:\"\s\\]/gi,"")==t&&n(o.getElementById)){var l=o.getElementById(t.substr(1));s=null==l?[]:[l],a="id"}else"."==t.substr(0,1)&&t.replace(/[\#\/\\\"\`\'\=\<\>\~\%\(\)\[\]\{\}\|\*\^\:\s]/gi,"")==t&&n(o.getElementsByClassName)?(s=null==(s=o.getElementsByClassName(t.substr(1)))?[]:s,a="class_name"):"[name="==t.substr(0,6)&&"]"==t.substr(-1)&&t.substr(6,t.length-7).replace(/^[\s+\"\']|[\s+\"\']$/gm,"")==t.substr(6,t.length-7).replace(/[^A-Za-z0-9_-]/gi,"")&&n(o.getElementsByName)?(s=null==(s=o.getElementsByName(t.substr(6,t.length-7).replace(/^[\s+\"\']|[\s+\"\']$/gm,"")))?[]:s,a="name"):t.replace(/[^A-Za-z0-9_-]/gi,"")==t&&n(o.getElementsByTagName)?(s=null==(s=o.getElementsByTagName(t))?[]:s,a="tag_name"):r(i)&&(s=null==(s=o.getElementsByTagNameNS(i,t))?[]:s,a="tag_name_ns")}catch(t){s=[],a="error_catch"}for(var f in"object"!=typeof s||["window","document","jDoms","object","array","id","node"].indexOf(a)>-1||(s="function"!=typeof Array||"function"!=typeof Array.from||"function"!=typeof Array.isArray||Array.isArray(s)?"function"==typeof Object&&"function"==typeof Object.entries?Object.entries(s):s:Array.from(s)),s)s[f]&&(this[parseInt(f)]=s[f],u++);return this.length=u||0,this},N.fnc=N.prototype={},N.version="1.1.0",N.developer="MAMEDUL ISLAM",N.isUndefined=function(e){return t(e)},N.isDefined=function(t){return function(t){return void 0!==t}(t)},N.isSet=function(t){return n(t)},N.isString=function(t){return r(t)},N.isNumber=function(t){return o(t)},N.isInt=function(t){return s(t)},N.isInteger=function(t){return s(t)},N.isFinite=function(t){return function(t){return isFinite(t)}(t)},N.isInfinity=function(t){return function(t){return"number"==typeof t&&!isFinite(t)}(t)},N.isBoolean=function(t){return a(t)},N.isBigInt=function(t){return function(t){return"bigint"==typeof t}(t)},N.isFlatten=function(t){return u(t)},N.isEmpty=function(t){return function(t){return void 0===t||""===t||0===t||t===[]||t==={}||!1===t||null===t||NaN==t}(t)},N.isArray=function(t){return h(t)},N.isFunction=function(t){return c(t)},N.isObject=function(t){return l(t)},N.isPureObject=function(t){return f(t)},N.isSymbol=function(t){return function(t){return void 0===t}(t)},N.isjDoms=function(t){return d(t)},N.isUnique=function(t){return function(t){return p(t)==p(m(t))}(t)},N.sizeOf=function(t){return p(t)},N.trim=function(t){return g(t)},N.unique=function(t){return m(t)},N.merge=function(t,e){return function(t,e){if(l(t)&&l(e))for(var n in e)try{e[n].constructor==Object?t[n]=MergeRecursive(t[n],e[n]):t[n]=e[n]}catch(r){t[n]=e[n]}return t}(t,e)},N.escape=function(t){return v(t)},N.encodeString=function(t){return v(t)},N.unescape=function(t){return y(t)},N.decodeString=function(t){return y(t)},N.encodeBase64=function(t){return b(t)},N.decodeBase64=function(t){return w(t)},N.stringify=function(t){return T.getString(t)},N.delay=function(t,e){return function(t,e){var n;return(n=0,function(t,e){clearTimeout(n),n=setTimeout(t,e||0)})(t,e)}(t,e)},N.now=function(){return(new Date).getTime()},N.promise=function(t,e){return function(t,e){var n=function(t){this.state="pending",this.value=void 0,this.consumers=[],t(this.resolve.bind(this),this.reject.bind(this))};return n.prototype.fulfill=function(t){"pending"===this.state&&(this.state="fulfilled",this.value=t,this.done())},n.prototype.reject=function(t){"pending"===this.state&&(this.state="rejected",this.value=t,this.done())},n.prototype.then=function(t,e){var r=new n(function(){});return r.onFulfilled=c(t)?t:null,r.onRejected=c(e)?e:null,this.consumers=this.consumers.concat(r),this.done(),r},n.prototype.done=function(){var t=this;if("pending"!==this.state){var e="fulfilled"==this.state?"onFulfilled":"onRejected",n="fulfilled"==this.state?"resolve":"reject";setTimeout(function(){var r=t.consumers.splice(0);for(var i in r){var o=r[i];try{var s=o[e];s?o.resolve(s(t.value)):o[n](t.value)}catch(t){o.reject(t)}}},0)}},n.prototype.resolve=function(t){var e,r;if(this===t)throw new TypeError("Circular reference: promise value is promise itself");if(t instanceof n)t.then(this.resolve.bind(this),this.reject.bind(this));else if(t===Object(t))try{r=t.then,c(r)?r.call(t,function(t){e||(e=!0,this.resolve(t))}.bind(this),function(t){e||(e=!0,this.reject(t))}.bind(this)):this.fulfill(t)}catch(t){if(e)return;this.reject(t)}else this.fulfill(t)},new n(t,e)}(t,e)},N.dateParse=function(t){return C(t)},N.urlParse=function(t){return S(t)},N.jsonParse=function(t){return E(t)},N.xmlParse=function(t){return O(t)},N.htmlParse=function(t){return A(t)},N.ajax=function(e){return function(e){var i;window.XMLHttpRequest?i=new XMLHttpRequest:window.ActiveXObject&&(i=new ActiveXObject("Microsoft.XMLHTTP")),e.xhr&&(c(e.method)||l(e.method))&&(i=e.xhr);e.enctype&&r(e.method)&&("multipart/form-data"==e.method||e.method);var s="";(r(e.method)||o(e.method))&&(s=e.url);var f="GET";r(e.method)&&r(e.method)&&["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"].indexOf(e.method.toUpperCase())>-1&&(f=e.method.toUpperCase());a(e.async)&&(i.async=e.async),e.onBefore&&e.onBefore(i);var d=c(FormData)?new FormData:"";if(e.data&&l(e.data))for(var p in e.data)if(c(FormData))d.append(p,e.data[p]);else try{d=(d+=p=+encodeURIComponent(e.data[p])+"&").substring(0,d.length-1)}catch(t){}if(r(e.data)&&(d=e.data,"GET"!=f&&"PUT"!=f||(s+="?"==d[0]?d:"?"+d)),i.withCredentials=S(s).hostname!=window.location.hostname,a(e.credentials)&&(i.withCredentials=e.credentials),r(e.type)&&(i.responseType=e.type),i.open(f,s,!0),r(e.method)&&"POST"==e.method.toUpperCase()&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),r(e.username)||o(e.username)||r(e.password)||o(e.password)){var g="Basic";r(e.authType)&&(g=e.authType);var m="";n(e.username)&&n(e.password)?m=b(e.username+":"+e.password):n(e.username)&&t(e.password)?m=b(e.username):t(e.username)&&n(e.password)&&(m=b(e.password)),i.setRequestHeader("Authorization",g+" "+m),g=null,m=null}if(u(e.cache)&&i.setRequestHeader("Cache-control",e.cache),l(e.headers)||h(e.headers))for(var p in e.headers)try{i.setRequestHeader(p,e.headers[p])}catch(t){}return e.timeout&&u(e.timeout)&&(i.timeout=parseInt(e.timeout)),i.onreadystatechange=function(){e.onReadyStateChange&&e.onReadyStateChange(i,this.readyState,this.status),0==this.readyState&&e.onNotConnected&&e.onNotConnected(i),1==this.readyState&&e.onConnected&&e.onNotConnected(i),2==this.readyState&&e.onReceived&&e.onReceived(i),3==this.readyState&&e.onLoading&&e.onReceived(i),4==this.readyState&&(e.onComplete&&e.onComplete(i),200==this.status&&e.onSuccess&&e.onSuccess(i))},i.onloadstart=function(t){e.onLoadStart&&e.onLoadStart(t)},i.onloadend=function(t){e.onLoadEnd&&e.onLoadEnd(t)},i.ontimeout=function(t){if(e.onTimeout){var n=!1,r=!1;t.lengthComputable&&(n=t.loaded||t.position,r=t.loaded),e.onTimeout(i,n,r)}},i.onload=function(t){e.onLoad&&e.onLoad(t)},i.onprogress=function(t){if(e.onProgress){var n=!1,r=!1;t.lengthComputable&&(n=t.loaded||t.position,r=t.loaded),e.onProgress(i,n,r)}},i.onabort=function(t){e.onAbort&&e.onAbort(t)},i.onerror=function(t){e.onError&&e.onError(t)},i.send(d),i}(e)},N.document=function(){for(var t=0;t<this.length;t++)return this[t].nodeType&&9==this[t].nodeType?this[t]:this[t].ownerDocument||this.ownerDocument||document;return this.ownerDocument||window.document||document||null},N.window=function(){for(var t=this.document||document,e=0;e<this.length;e++)t=this[e].nodeType&&9==this[e].nodeType?this[e]:this[e].ownerDocument||this.ownerDocument||document;return t.defaultView||window||this.window||globalThis||null},N.userAgent=function(){return n(window.navigator)&&n(window.navigator.userAgent)?window.navigator.userAgent:""},N.isCookie=function(){return!(!n(window.navigator)||!n(window.navigator.cookieEnabled))&&navigator.cookieEnabled},N.setCookie=function(t,e,n){try{if(!navigator||!navigator.cookieEnabled)return!1;var r=(arguments||[])[3]||"/",i="https:"==window.location.protocol,o=new Date;o.setTime(o.getTime()+parseInt(n));var s="expires="+o.toUTCString();return document.cookie=t+"="+e+";"+s+";path="+r+";"+(i?"SameSite=None; Secure;":""),!0}catch(t){return!1}},N.getCookie=function(t){for(var e=t+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1);if(0==i.indexOf(e))return i.substring(e.length,i.length)}return null},N.removeCookie=function(t){try{var e=new Date(0);return document.cookie=t+"=; path=/; expires="+e.toUTCString()+";",!0}catch(t){return!1}},N.geo=function(t){var e={result:!1,accuracy:null,altitude:null,altitudeAccuracy:null,heading:null,latitude:null,longitude:null,speed:null,timestamp:(new Date).getTime()};n(window.navigator)&&n(window.navigator.geolocation)?navigator.geolocation.getCurrentPosition(function(n){e.result=n.coords.result=!0,e.accuracy=n.coords.accuracy||null,e.altitude=n.coords.altitude||null,e.altitudeAccuracy=n.coords.altitudeAccuracy||null,e.heading=n.coords.heading||null,e.latitude=n.coords.latitude||null,e.longitude=n.coords.longitude||null,e.speed=n.coords.speed||null,e.timestamp=(new Date).getTime(),t(e)}):(e.timestamp=(new Date).getTime(),t(e))},N.closeFullscreen=function(){return document.exitFullscreen?(document.exitFullscreen(),!0):document.webkitExitFullscreen?(document.webkitExitFullscreen(),!0):!!document.msExitFullscreen&&(document.msExitFullscreen(),!0)},N.active=function(){return N(N.document().activeElement)},N.activeDom=function(){return N(N.document().activeElement)},N.domReady=function(t){var e=!1,n=!0,r=!1,i=window||globalThis||self,o=i.document,s=o.documentElement,a=o.addEventListener?"addEventListener":"attachEvent",u=o.addEventListener?"removeEventListener":"detachEvent",h=o.addEventListener?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=o.readyState||(("load"==n.type?i:o)[u](h+n.type,c,!1),!e&&(e=!0)&&(r||(r=!0,t.call(i,n.type||n))))},l=function(){try{s.doScroll("left")}catch(t){return void setTimeout(l,50)}c("poll")};if("complete"==o.readyState)r||(r=!0,t.call(i,"lazy"));else{if(o.createEventObject&&s.doScroll){try{n=!i.frameElement}catch(t){}n&&l()}o[a](h+"DOMContentLoaded",c,!1),o[a](h+"readystatechange",c,!1),i[a](h+"load",c,!1)}},N.domsReady=N.domReady,N.docReady=N.domReady,N.ready=N.domReady,window.jDoms=N,N});