UNPKG

jdoms

Version:

jDoms is a fast, powerful, and zero-dependency JavaScript library for modern DOM manipulation, traversal, event handling, and more

2 lines 48 kB
/*! jDoms JavaScript Library v1.0.0 (https://mamedul.gitlab.io/dev-projects/jdoms)- Copyright (c) 2021 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"boolean"==typeof t},a=function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t},u=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)},h=function(t){return"function"==typeof t},c=function(t){return"object"==typeof t},l=function(t){return"object"==typeof t&&"undefined"!=typeof Object&&t===Object(t)},f=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},d=function(t){try{if(r(t))return t.trim?t.trim():t.replace(/^\s+|\s+$/gm,"");if(u(t)||c(t)){for(var e in t)t[e]=d(t[e]);return t}}catch(t){}return t},p=function(t){if(u(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},g=function(t){try{return encodeURI(t)}catch(t){}return""},m=function(t){try{return decodeURI(t)}catch(t){}return t},v=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)},y=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)},b=function(){function t(t){return s.lastIndex=0,s.test(t)?'"'+t.replace(s,function(t){var e=a[t];return r(e)?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function e(r,s){var a,u,c,l,f,d,p=n;try{if((f=s[r])&&"object"==typeof f&&h(f.toJSON)&&(f=f.toJSON(r)),f 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+">")}(f);if(f instanceof RegExp)return String(f);if(f instanceof MimeType||f instanceof Plugin)return Object.prototype.toString.call(f);switch(typeof f){case"string":return t(f);case"boolean":case"null":case"number":case"undefined":return String(f);case"function":case"object":if(!f)return"null";var g=o.indexOf(f)+1;if(g>0)return"/**ref:"+g.toString(16)+"**/";if(o.push(f),d="/**id:"+(g=o.length).toString(16)+"**/",h(f))return d+" "+String(f);if(n+=i,l=[],"[object Array]"===Object.prototype.toString.apply(f)){for(c=f.length,a=0;a<c;a+=1)l[a]=e(a,f)||"null";return u=0===l.length?"[]":"[\n"+n+d+"\n"+n+l.join(",\n"+n)+"\n"+p+"]",n=p,u}var m,v=function(t){var e=[];for(var n in t)e=e.concat(n);return e}(f);for(var y in v)v.hasOwnProperty(y)&&(u=e(m=v[y],f))&&l.push(t(m)+": "+u);return u=0===l.length?"{}":"{\n"+n+d+"\n"+n+l.join(",\n"+n)+"\n"+p+"}",n=p,u}}catch(t){return""}}var n,i,o,s=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return{quote:t,getString:function(t){if(r(t))return t;n="",i=" ",o=[];for(var s=e("",{"":t}),a=o.length;a;)new RegExp("/\\*\\*ref:"+a.toString(16)+"\\*\\*/").test(s)||(s=s.replace(new RegExp("[\r\n\t ]*/\\*\\*id:"+a.toString(16)+"\\*\\*/","g"),"")),a--;return o=null,s}}}(),w=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=C(w.that).doms(w.selectors),i=0;i<r.length;i++){var o=(t=t||window.event).target||t.currentTarget||t.srcElement;if(r[i]==o||C(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)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]});w.callback(e)}}this.that=null,this.selectors=null,this.callback=null};w.type=null,w.that=null,w.selectors=null,w.callback=null;var T={version:"1.0.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=C(t,n,this[i]),s=0;s<o.length;s++)r=r.concat(o[s]);return C(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 C(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=C(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=p(e),C(e)},closest:function(t){window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var n,r=new C.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=p(e),C(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=C(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=p(i),C(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=C(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=p(o),C(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=C(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=p(s),C(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=C(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=p(o),C(o)},unique:function(){for(var t=[],e=0;e<this.length;e++)t=t.concat(this[e]);return t=p(t),C(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=C(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=p(o),C(o)},is:function(e){if(t(this[0]))return!1;for(var n=[this[0]],r=[],i=C(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=C(t,r,i),h=0;h<u.length;h++)s=s.concat(u[h]);if(o=C.unique(o),s=C.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=C(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=C(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=C(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=p(e),C(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=C(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=p(e),C(e)},first:function(){var t=this[0]?[this[0]]:[];if(!t)return C(t);var e=(arguments||[])[0],r=[];if(n(e))for(var i=C(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=p(t),C(t)},last:function(){var t=this[this.length-1]?[this[this.length-1]]:[];if(!t)return C(t);var e=(arguments||[])[0],r=[];if(n(e))for(var i=C(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=p(t),C(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)?(w.that=this[h],w.selectors=e,w.callback=r,w.type=s[a],C(u).setProperty("jDomsEvent-"+s[a]+"-"+r.name,r.name),this[h].addEventListener?this[h].addEventListener(s[a],w,o):this[h].attachEvent&&this[h].attachEvent("on"+s[a],w)):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(h(r))for(var c=0;c<this.length;c++)for(u=this[c],a=0;a<s.length;a++)n(e)?C(u).getProperty("jDomsEvent-"+s[a]+"-"+r.name)==r.name&&(this[c].removeEventListener?this[c].removeEventListener(s[a],w,o):this[c].detachEvent&&this[c].detachEvent("on"+s[a],w)):this[c].removeEventListener?this[c].removeEventListener(s[a],r,o):this[c].detachEvent&&this[c].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 n=document;if(this[e].ownerDocument?n=this[e].ownerDocument:9==this[e].nodeType&&(n=this[e]),this[e].dispatchEvent){var r="";switch(t){case"click":case"mousedown":case"mouseup":r="MouseEvents";break;case"focus":case"change":case"blur":case"select":r="HTMLEvents"}var i="change"!=t;(o=n.createEvent(r)).initEvent&&o.initEvent(t,i,!0),o.synthetic=!0,this[e].dispatchEvent(o,!0)}else if(this[e].fireEvent&&n.createEventObject){var o;(o=n.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),c(this.___)))try{for(var a in this.___)this.__.hasOwnProperty(a)&&e.setAttribute(a,this.___[a])}catch(t){}if(c(this.__))try{for(var u in e=document.createElement(i),this.__)this.__.hasOwnProperty(u)&&e.setAttribute(u,this.__[u]);e.innerHTML=this.___}catch(t){}if(e){if(n(arguments[0])){var h=arguments[0];if(c(h))try{for(var l in h)h.hasOwnProperty(l)&&(e[l]=h[l])}catch(t){}}t=t.concat(e)}}return C(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(c(t)&&o(t.length)||u(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(c(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 C(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 C(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(c(t)){if(n(t.innerHTML)&&n(t.nodeName)&&n(t.nodeType)&&1==t.nodeType)this[e].insertAdjacentElement("beforebegin",t);else if(u(t)||f(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]):a(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]):a(t[i])&&this[e].insertAdjacentHTML("beforebegin",t[i]))}else a(t)&&this[e].insertAdjacentHTML("beforebegin",t)}catch(t){}return this},addAfter:function(t){for(var e=0;e<this.length;e++)try{if(c(t)){if(n(t.innerHTML)&&n(t.nodeName)&&n(t.nodeType)&&1==t.nodeType)this[e].insertAdjacentElement("afterend",t);else if(u(t)||f(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]):a(t[r])&&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]):a(t[i])&&this[e].insertAdjacentHTML("afterend",t[i]))}else a(t)&&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),C(this[i]).setHtml(t)):n(this[i].textContent)?this[i].textContent=t:n(this[i].innerText)?this[i].innerText=t:(t=document.createTextNode(t),C(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:C(this[r]).getHtml():n(this[r].textContent)?this[r].textContent:n(this[r].innerText)?this[r].innerText:C(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},setAttribute:function(){for(var t=arguments||[],e=t[0]||"",i=t[1],o=0;o<this.length;o++)if(c(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 c(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]&&this[e].removeAttribute)if(r(t))this[e].removeAttribute(t);else if(u(t))for(var n=0;n<t.length;n++)this[e].removeAttribute(t[n]);else if(l(t))for(var i in t)t.hasOwnProperty(i)&&this[e].removeAttribute(t[i]);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(c(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(c(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],h(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(c(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(c(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(c(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=C(this[o]),-1==(i=C(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=C(this[o]),i=C(this[o]).classList(),(i=C.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=C(this[t]).getStyle("width");e=isNaN(parseFloat(e))?0:parseFloat(e);var r=C(this[t]).getStyle("padding-left");r=isNaN(parseFloat(r))?0:parseFloat(r);var i=C(this[t]).getStyle("padding-right");i=isNaN(parseFloat(i))?0:parseFloat(i);var o=C(this[t]).getStyle("border-left");o=isNaN(parseFloat(o))?0:parseFloat(o);var s=C(this[t]).getStyle("border-right");s=isNaN(parseFloat(s))?0:parseFloat(s);var a=C(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=C(this[t]).getStyle("height");e=isNaN(parseFloat(e))?0:parseFloat(e);var r=C(this[t]).getStyle("padding-top");r=isNaN(parseFloat(r))?0:parseFloat(r);var i=C(this[t]).getStyle("padding-bottom");i=isNaN(parseFloat(i))?0:parseFloat(i);var o=C(this[t]).getStyle("border-top");o=isNaN(parseFloat(o))?0:parseFloat(o);var s=C(this[t]).getStyle("border-bottom");s=isNaN(parseFloat(s))?0:parseFloat(s);var a=C(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=C(this[t]).getStyle("width");e=isNaN(parseFloat(e))?0:parseFloat(e);var r=C(this[t]).getStyle("padding-left");r=isNaN(parseFloat(r))?0:parseFloat(r);var i=C(this[t]).getStyle("padding-right");i=isNaN(parseFloat(i))?0:parseFloat(i);var o=C(this[t]).getStyle("border-left");o=isNaN(parseFloat(o))?0:parseFloat(o);var s=C(this[t]).getStyle("border-right");s=isNaN(parseFloat(s))?0:parseFloat(s);var a=C(this[t]).getStyle("margin-left");a=isNaN(parseFloat(a))?0:parseFloat(a);var u=C(this[t]).getStyle("margin-right");u=isNaN(parseFloat(u))?0:parseFloat(u);var h=C(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=C(this[t]).getStyle("height");e=isNaN(parseFloat(e))?0:parseFloat(e);var r=C(this[t]).getStyle("padding-top");r=isNaN(parseFloat(r))?0:parseFloat(r);var i=C(this[t]).getStyle("padding-bottom");i=isNaN(parseFloat(i))?0:parseFloat(i);var o=C(this[t]).getStyle("border-top");o=isNaN(parseFloat(o))?0:parseFloat(o);var s=C(this[t]).getStyle("border-bottom");s=isNaN(parseFloat(s))?0:parseFloat(s);var a=C(this[t]).getStyle("margin-top");a=isNaN(parseFloat(a))?0:parseFloat(a);var u=C(this[t]).getStyle("margin-bottom");u=isNaN(parseFloat(u))?0:parseFloat(u);var h=C(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)&&(l(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)&&(l(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(),C(this[t]);return null},focus:function(){for(var t=0;t<this.length;t++)if(this[t].focus)return this[t].focus(),C(this[t]);return null},blur:function(){for(var t=0;t<this.length;t++)if(this[t].blur)return this[t].blur(),C(this[t]);return null},select:function(){for(var t=0;t<this.length;t++)if(this[t].select)return this[t].select(),C(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])?C(t[0]):n(this[0])&&n(this[0].elements)?this[0].elements:[];if(r)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)+"&");return e.length>2&&(e=e.substring(0,e.length-1)),e},buildFormData:function(){var t=h(FormData)?new FormData:null;if(null!=t&&this[0]&&this[0].elements)for(var e=this[0].elements,n=0;n<e.length;n++)if(e[n].name)if("radio"==e[n].type.toLowerCase()||"checkbox"==e[n].type.toLowerCase())1==e[n].checked&&t.append(e[n].name,e[n].value);else if("file"==e[n].type.toLowerCase())for(var r=0;r<e[n].files.length;r++)t.append(e[n].name+"[]",e[n].files[r]);else t.append(e[n].name,e[n].value);return t},dateParse:function(){var t=this._||{};return C.dateParse(t)},urlParse:function(){var t=this._||{};return C.urlParse(t)},xmlParse:function(){var t=arguments||[];if(n(t[0]))return C.xmlParse(t[0]);for(var e=0;e<this.length;e++)return C.xmlParse(this[e]);return C.xmlParse({})},htmlParse:function(){var t=arguments||[];if(n(t[0]))return C.htmlParse(t[0]);for(var e=0;e<this.length;e++)return C.htmlParse(this[e]);return C.htmlParse({})},jsonParse:function(){var t=arguments||[];if(n(t[0]))return C.jsonParse(t[0]);for(var e=0;e<this.length;e++)return C.jsonParse(this[e]);return C.jsonParse({})}},C=function(){var e=arguments||[],r=e[0]||[],i=e[1]||"",o=n(e[2])?e[2]:document,s=new C.jDomsList(r,i,o);for(var a in C.jDomsList.prototype.constructor=C,C.jDomsList.prototype.version="1.0.0",C.jDomsList.prototype._=r,C.jDomsList.prototype.__=i,C.jDomsList.prototype.___=o,T)T.hasOwnProperty(a)&&(t(a)||t(T[a])||(C.jDomsList.prototype[a]=T[a]));for(var u in C.fnc)C.fnc.hasOwnProperty(u)&&(t(u)||t(C.fnc[u])||n(T[u])||(C.jDomsList.prototype[u]=C.fnc[u]));return s};return C.jDomsList=function(t){var e=arguments||[];t=t||e[0]||[];var i=e[1]||"",o=n(e[2])?e[2]:document,s=[],a=null,h=0;try{if(t==window)s=[window],a="window";else if(t==document)s=[document],a="document";else if(t&&"object"==typeof t)if(f(t)){for(var c=0;c<t.length;c++)n(t[c])&&(s=s.concat(t[c]));a="jDoms"}else u(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 d 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[d]&&(this[parseInt(d)]=s[d],h++);return this.length=h||0,this},C.fnc=C.prototype={},C.version="1.0.0",C.developer="MAMEDUL ISLAM",C.isUndefined=function(e){return t(e)},C.isSet=function(t){return n(t)},C.isString=function(t){return r(t)},C.isNumber=function(t){return o(t)},C.isFinite=function(t){return function(t){return isFinite(t)}(t)},C.isInfinity=function(t){return function(t){return"number"==typeof t&&!isFinite(t)}(t)},C.isBoolean=function(t){return s(t)},C.isBigInt=function(t){return function(t){return"bigint"==typeof t}(t)},C.isFlatten=function(t){return a(t)},C.isEmpty=function(t){return function(t){return!(void 0!==t&&""!==t&&0!==t&&t!==[]&&t!=={}&&!1!==t&&null!==t&&!isNaN(t)&&t!==function(){})}(t)},C.isArray=function(t){return u(t)},C.isFunction=function(t){return h(t)},C.isObject=function(t){return c(t)},C.isPureObject=function(t){return l(t)},C.isSymbol=function(t){return function(t){return void 0===t}(t)},C.isjDoms=function(t){return f(t)},C.sizeOf=function(t){return 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 n;if("function"==typeof Object&&"function"==typeof Object.keys&&(e=Object.keys(t).length),0==e)for(n in t)t.hasOwnProperty(n)&&e++;0==e&&void 0!==t.nodeName&&void 0!==t.nodeType&&void 0!==t.nodeValue&&e++}return e}(t)},C.trim=function(t){return d(t)},C.unique=function(t){return p(t)},C.merge=function(t,e){return function(t,e){if(c(t)&&c(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)},C.escape=function(t){return g(t)},C.encodeString=function(t){return g(t)},C.unescape=function(t){return m(t)},C.decodeString=function(t){return m(t)},C.encodeBase64=function(t){return v(t)},C.decodeBase64=function(t){return y(t)},C.stringify=function(t){return b.getString(t)},C.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)},C.now=function(){return(new Date).getTime()},C.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=h(t)?t:null,r.onRejected=h(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,h(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)},C.dateParse=function(t){return function(t){return Date.parse(t)}(t)},C.urlParse=function(t){return 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}(t)},C.jsonParse=function(t){return function(t){var e={};if(c(JSON)&&h(JSON.parse))try{e=JSON.parse(t)}catch(t){}else if(c(Components)&&h(Components.classes)&&h(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}(t)},C.xmlParse=function(t){return 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{}}(t)},C.htmlParse=function(t){return 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}(t)},C.ajax=function(t){return function(t){var e;window.XMLHttpRequest?e=new XMLHttpRequest:window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLHTTP")),t.xhr&&(h(t.method)||c(t.method))&&(e=t.xhr);t.enctype&&r(t.method)&&("multipart/form-data"==t.method||t.method);var n="";t.url&&r(t.method)&&(n=t.url);var i="GET";t.method&&r(t.method)&&["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"].indexOf(t.method.toUpperCase())>-1&&(i=t.method.toUpperCase());t.async&&s(t.async)&&(e.async=t.async),t.onBefore&&t.onBefore(e);var a=new FormData;if(t.data&&c(t.data))for(var u in t.data)a.append(u,t.data[u]);return t.data&&r(t.data)&&(a=t.data,"GET"!=i&&"PUT"!=i||(n+="?"==a[0]?a:"?"+a)),e.open(i,n,!0),t.method&&r(t.method)&&"POST"==t.method.toUpperCase()&&e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.timeout&&(r(t.timeout)||o(t.timeout))&&(e.timeout=parseInt(t.timeout)),e.onreadystatechange=function(){t.onReadyStateChange&&t.onReadyStateChange(e,this.readyState,this.status),0==this.readyState&&t.onNotConnected&&t.onNotConnected(e),1==this.readyState&&t.onConnected&&t.onNotConnected(e),2==this.readyState&&t.onReceived&&t.onReceived(e),3==this.readyState&&t.onLoading&&t.onReceived(e),4==this.readyState&&(t.onComplete&&t.onComplete(e),200==this.status&&t.onSuccess&&t.onSuccess(e))},e.onloadstart=function(e){t.onLoadStart&&t.onLoadStart(e)},e.onloadend=function(e){t.onLoadEnd&&t.onLoadEnd(e)},e.ontimeout=function(n){if(t.onTimeout){var r=!1,i=!1;n.lengthComputable&&(r=n.loaded||n.position,i=n.loaded),t.onTimeout(e,r,i)}},e.onload=function(e){t.onLoad&&t.onLoad(e)},e.onprogress=function(n){if(t.onProgress){var r=!1,i=!1;n.lengthComputable&&(r=n.loaded||n.position,i=n.loaded),t.onProgress(e,r,i)}},e.onabort=function(e){t.onAbort&&t.onAbort(e)},e.onerror=function(e){t.onError&&t.onError(e)},e.send(a),e}(t)},C.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},C.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},C.userAgent=function(){return navigator.userAgent},C.isCookie=function(){return navigator.cookieEnabled},C.setCookie=function(t,e,n){if(!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},C.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},C.removeCookie=function(t){var e=new Date(0);return document.cookie=t+"=; path=/; expires="+e.toUTCString()+";",!0},C.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()};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))},C.closeFullscreen=function(){return document.exitFullscreen?(document.exitFullscreen(),!0):document.webkitExitFullscreen?(document.webkitExitFullscreen(),!0):!!document.msExitFullscreen&&(document.msExitFullscreen(),!0)},C.active=function(){return C(C.document().activeElement)},C.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)}},C.docReady=C.domReady,C.ready=C.domReady,C});