From 01e5b2efbc3859f7205cfce022001ac2e66277bd Mon Sep 17 00:00:00 2001 From: Kevin Martin Date: Fri, 19 Dec 2014 12:26:34 -0500 Subject: [PATCH] Redo dist --- dist/z.js | 4 ++-- dist/z.min.js | 2 +- dist/z.sm.js | 6 +++--- dist/z.sm.min.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/z.js b/dist/z.js index 3eef982..8311912 100644 --- a/dist/z.js +++ b/dist/z.js @@ -6,7 +6,7 @@ * Released under the MIT license * https://github.com/NEURS/z.js/blob/master/LICENSE * - * Date: 2014-12-19T15:33Z + * Date: 2014-12-19T17:13Z */ ;(function (window, document) { @@ -855,7 +855,7 @@ function _eachNew(fn) { ret = fn.apply(this[i], arguments); if (ret) { - if (Array.isArray(ret) && ret.length) { + if (Array.isArray(ret) && ret.length || ret instanceof HTMLCollection) { arr.push.apply(arr, ret); } else { arr.push(ret); diff --git a/dist/z.min.js b/dist/z.min.js index 4c44f0c..1797eb5 100644 --- a/dist/z.min.js +++ b/dist/z.min.js @@ -1 +1 @@ -!function(t,e){function n(t,e){if(t instanceof g)return t;if(t instanceof Element||t instanceof Window||t instanceof Document)return new g(t);if(void 0===t||null===t)return new g;if("string"!=typeof t)throw new Error("First parameter is invalid");if(e){if(!p(e))throw new Error("Second parameter is invalid");e=n(e)}else e=w;return u(e,t)}function r(){}function i(t,e){var n;return e?this.responseXML?this.responseXML:(n=new DOMParser,n.parseFromString(t,"application/xml")):(n=new XMLSerializer,n.serializeToString(t))}function s(t,e){return e.call(t,t)}function o(t,e){return t===e}function a(t){var e,r=0,i=[];for(t=n(t),e=t.find("script");re;e++)t.apply(this[e],arguments);return this}}function v(t){return function(){for(var e,n=0,r=this.length,i=new g;r>n;n++)e=t.apply(this[n],arguments),e&&(Array.isArray(e)&&e.length?i.push.apply(i,e):i.push(e));return i}}function m(t,e){for(var n=new g;t[e]&&1===t.nodeType;)t=t[e],n.push(t);return n}var g,y,w,E;try{E=e.createElement("iframe"),E.style.width=0,E.style.height=0,E.style.borderStyle="none",e.body.appendChild(E),g=E.contentWindow.Array,e.body.removeChild(E)}catch(x){g=Array}t.z=n,n.fn=g.prototype,y=n(t),w=n(e),n.fn.find=function(t){if("string"!=typeof t)throw new Error("First paramater of z#find() should be a string");return u(this,t)};var T,S,b={};T={method:"GET",requestType:"text",responseType:"text",url:t.location+"",query:null,data:null,setup:r,success:r,error:r},S={text:function(t){return(t||"")+""}},n.ajax=function(t){var e=new XMLHttpRequest;if(t=n.extend({context:e},T,t),!S[t.requestType])throw new Error("Invalid option `requestType`");if(!S[t.responseType])throw new Error("Invalid option `responseType`");t.query&&~["HEAD","GET"].indexOf(t.method.toUpperCase())&&(t.url+=~t.url.indexOf("?")?"&":"?",t.url+=n.queryString(t.query),t.url=t.url.replace(/(\?|&)&/g,"$1")),e.open(t.method,t.url,!0),e.onload=function(){var n;e.status>=200&&e.status<400?(n=S[t.responseType].call(e,e.responseText,!0),t.success.call(t.context,n)):t.error.call(t.context,e.status,e.statusText)},e.onerror=function(){t.error.call(t.context,e.status,e.statusText)},~["HEAD","GET"].indexOf(t.method.toUpperCase())||e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.data&&(t.data=S[t.requestType].call(e,t.data,!1)),t.setup.call(e,e),e.send(t.data)},T.requestType="detect",T.responseType="detect",n.registerAjaxType=function(t,e,n){n||"function"!=typeof e||(n=e,e=!1),S[t]=n,e&&(b[e]=t)},n.registerAjaxType("detect",function(t,e){var n,r="text";return e?(n=this.getResponseHeader("Content-Type")||"",n=n.split(";")[0].trim(),r=b[n]||"text"):t&&"object"==typeof t&&t.toString==={}.toString&&(r="json"),S[r].call(this,t,e)}),n.registerAjaxType("json","application/json",function(t,e){return e?JSON.parse(t):JSON.stringify(t)}),n.registerAjaxType("html","text/html",function(t,n){var r,i;return n?(i=new g,r=e.implementation.createHTMLDocument(),r.documentElement.innerHTML=t,i.push.apply(i,i.slice.call(r.body.children,0)),i):t.outerHTML}),n.registerAjaxType("xml","text/xml",i),n.registerAjaxType("xml","application/xml",i),n.fn.data="dataset"in e.body?function(t,e){var n,r;if(this.length){if(void 0===t)return this[0].dataset;if(void 0===e)return this[0].dataset[t];for(n=0,r=this.length;r>n;n++)this[n].dataset[t]=e;return this}}:function(t,e){var n,r,i="data-"+(t||"");if(this.length){if(void 0===t)return n={},[].forEach.call(this[0].attributes,function(t){return n[t.name]=t.value}),n;if(void 0===e)return this[0].attributes[i];for(n=0,r=this.length;r>n;n++)this[n].dataset[i]=e;return this}},n.data=function(t,e,r){n(t).data(e,r)},n.fn.on=n.fn.bind=d(function(t,e){this.addEventListener(t,e,!1)}),n.fn.one=d(function(t,e){var r=!1;n(this).on(t,function i(s){r||(r=!0,n(this).off(t,i),e.call(this,s))})}),n.fn.off=n.fn.unbind=d(function(t,e){this.removeEventListener(t,e,!1)}),n.fn.trigger=function(t,n){var r,i=0,s=this.length;void 0===n&&(n={}),n.event=n;try{r=new CustomEvent(t,{detail:n})}catch(o){r=e.createEvent("CustomEvent"),r.initCustomEvent(t,!0,!0,n)}for(;s>i;i++)this[i].dispatchEvent(r);return this},n.fn.is=function(){var t,n=e.body;return t=n.matches||n.matchesSelector||n.msMatchesSelector,t=t||n.mozMatchesSelector||n.webkitMatchesSelector||n.oMatchesSelector,function(e){var n,r,i=0,a=this.length;switch(typeof e){case"string":n=t;break;case"function":n=s;break;case"object":if(!(e instanceof Element||e instanceof Window||e instanceof Document))throw new Error("First parameter of z#is is invalid");n=o;default:throw new Error("First parameter of z#is is invalid")}for(;a>i;i++)if(r=n(this[i],e))return r;return!1}}(),n.fn.hide=d(function(){return this.style.display="none",this}),n.fn.show=d(function(){return this.style.display="",this}),n.fn.clone=function(t){var e=0;for((void 0===t||null===t)&&(t=!1);ee;e++)this[e].innerHTML=t;return this},n.fn.text=function(t){var e,n;if(void 0===t)return this.textContent;for(e=0,n=this.length;n>e;e++)this[e].textContent=t;return this},n.fn.getAttr=function(t){if(!t)throw new Error("First parameter of z#getAttr is required");return this[0]&&this[0].getAttribute(t)},n.fn.setAttr=d(function(t,e){if(!t)throw new Error("First parameter of z#setAttr is required");if(void 0===e)throw new Error("Second parameter of z#setAttr is required");return this.setAttribute(t,e),this}),n.fn.attr=function(t,e){return void 0===e?this.getAttr(t):(this.setAttr(t,e),this)},n.fn.replaceWith=n.fn.replace=d(function(t){var e;void 0===t||null===t?this.remove():t instanceof g||t instanceof EventTarget?(e=a(t),t instanceof g&&(t=t[0]),this.parentNode.replaceChild(t,this),f(e)):this.outerHTML=t}),"classList"in e.documentElement?(n.fn.addClass=d(function(t){this.classList.add(t)}),n.fn.removeClass=d(function(t){this.classList.remove(t)}),n.fn.toggleClass=d(function(t,e){return void 0===e?void this.classList.toggle(t):void this.classList[e?"add":"remove"](t)}),n.fn.hasClass=function(t){for(var e=0,n=this.length;n>e;e++)if(this[e].classList.contains(t))return!0;return!1}):(n.fn.addClass=d(function(t){this.className+=" "+t}),n.fn.removeClass=d(function(t){this.className+=this.className.replace(new RegExp("(^|\\b)"+t+"(\\b|$)","g")," ")}),n.fn.toggleClass=function(t,e){return this[e?"addClass":"removeClass"](t),this},n.fn.hasClass=function(t){for(var e=0,n=this.length,r=new RegExp("(^| )"+t+"( |$)","gi");n>e;e++)if(r.test(this[e].className))return!0;return!1}),n.fn.append=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#append is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("beforeend",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].appendChild(t);return this},n.fn.prepend=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#prepend is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("afterbegin",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].insertBefore(t,this[e].firstChild);return this},n.fn.after=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#append is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("afterend",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].insertAdjacentHTML("afterend",t.outerHTML);return this},n.fn.css=function(t,e){var n=0,r=this.length;if(void 0===t)throw new Error("First parameter of z#css is required.");if(void 0===e)return getComputedStyle(this[0])[t];for(t=t.replace(/-./g,function(t){return t.substr(1).toUpperCase()});r>n;n++)this[n].style[t]=e;return this},n.fn.remove=d(function(){this.parentNode.removeChild(this)}),n.fn.empty=d(function(){this.innerHTML=""});var C,A={};n.registerSelector=function(t,e){if(!t||"string"!=typeof t)throw new Error("First parameter of z#registerSelector must be a string selector");if(!e||"function"!=typeof e)throw new Error("Second parameter of z#registerSelector must be a function");":"!==t[0]&&(t=":"+t),C=!1,A[t]=e},n.registerSelector(":first",function(t){return n(this.querySelector(t))}),n.registerSelector(":input",function(){function t(t){return~e.indexOf(t.tagName)}var e="INPUT,TEXTAREA,SELECT,BUTTON".split(",");return function(e){var n=new g;return n.push.apply(n,[].filter.call(this.querySelectorAll(e),t)),n}}()),n.fn.parent=v(function(){return this.parentNode}),n.fn.next=v(function(){return this.nextElementSibling}),n.fn.prev=n.fn.previous=v(function(){return this.previousElementSibling}),n.fn.siblings=v(function(){return[].filter.call(this.parentNode.children,function(t){return t!==this},this)}),n.fn.prevAll=v(function(){return m(this,"previousElementSibling")}),n.fn.children=v(function(){return this.children}),n.deepExtend=function q(t){var e,n,r=2;for("object"==typeof t?(n=t||{},t=1/0):(t=t===!0?1/0:0|t,n=arguments[1]||{});re;e++)t.apply(this[e],arguments);return this}}function v(t){return function(){for(var e,n=0,r=this.length,i=new g;r>n;n++)e=t.apply(this[n],arguments),e&&(Array.isArray(e)&&e.length||e instanceof HTMLCollection?i.push.apply(i,e):i.push(e));return i}}function m(t,e){for(var n=new g;t[e]&&1===t.nodeType;)t=t[e],n.push(t);return n}var g,y,w,E;try{E=e.createElement("iframe"),E.style.width=0,E.style.height=0,E.style.borderStyle="none",e.body.appendChild(E),g=E.contentWindow.Array,e.body.removeChild(E)}catch(x){g=Array}t.z=n,n.fn=g.prototype,y=n(t),w=n(e),n.fn.find=function(t){if("string"!=typeof t)throw new Error("First paramater of z#find() should be a string");return u(this,t)};var T,C,S={};T={method:"GET",requestType:"text",responseType:"text",url:t.location+"",query:null,data:null,setup:r,success:r,error:r},C={text:function(t){return(t||"")+""}},n.ajax=function(t){var e=new XMLHttpRequest;if(t=n.extend({context:e},T,t),!C[t.requestType])throw new Error("Invalid option `requestType`");if(!C[t.responseType])throw new Error("Invalid option `responseType`");t.query&&~["HEAD","GET"].indexOf(t.method.toUpperCase())&&(t.url+=~t.url.indexOf("?")?"&":"?",t.url+=n.queryString(t.query),t.url=t.url.replace(/(\?|&)&/g,"$1")),e.open(t.method,t.url,!0),e.onload=function(){var n;e.status>=200&&e.status<400?(n=C[t.responseType].call(e,e.responseText,!0),t.success.call(t.context,n)):t.error.call(t.context,e.status,e.statusText)},e.onerror=function(){t.error.call(t.context,e.status,e.statusText)},~["HEAD","GET"].indexOf(t.method.toUpperCase())||e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.data&&(t.data=C[t.requestType].call(e,t.data,!1)),t.setup.call(e,e),e.send(t.data)},T.requestType="detect",T.responseType="detect",n.registerAjaxType=function(t,e,n){n||"function"!=typeof e||(n=e,e=!1),C[t]=n,e&&(S[e]=t)},n.registerAjaxType("detect",function(t,e){var n,r="text";return e?(n=this.getResponseHeader("Content-Type")||"",n=n.split(";")[0].trim(),r=S[n]||"text"):t&&"object"==typeof t&&t.toString==={}.toString&&(r="json"),C[r].call(this,t,e)}),n.registerAjaxType("json","application/json",function(t,e){return e?JSON.parse(t):JSON.stringify(t)}),n.registerAjaxType("html","text/html",function(t,n){var r,i;return n?(i=new g,r=e.implementation.createHTMLDocument(),r.documentElement.innerHTML=t,i.push.apply(i,i.slice.call(r.body.children,0)),i):t.outerHTML}),n.registerAjaxType("xml","text/xml",i),n.registerAjaxType("xml","application/xml",i),n.fn.data="dataset"in e.body?function(t,e){var n,r;if(this.length){if(void 0===t)return this[0].dataset;if(void 0===e)return this[0].dataset[t];for(n=0,r=this.length;r>n;n++)this[n].dataset[t]=e;return this}}:function(t,e){var n,r,i="data-"+(t||"");if(this.length){if(void 0===t)return n={},[].forEach.call(this[0].attributes,function(t){return n[t.name]=t.value}),n;if(void 0===e)return this[0].attributes[i];for(n=0,r=this.length;r>n;n++)this[n].dataset[i]=e;return this}},n.data=function(t,e,r){n(t).data(e,r)},n.fn.on=n.fn.bind=d(function(t,e){this.addEventListener(t,e,!1)}),n.fn.one=d(function(t,e){var r=!1;n(this).on(t,function i(s){r||(r=!0,n(this).off(t,i),e.call(this,s))})}),n.fn.off=n.fn.unbind=d(function(t,e){this.removeEventListener(t,e,!1)}),n.fn.trigger=function(t,n){var r,i=0,s=this.length;void 0===n&&(n={}),n.event=n;try{r=new CustomEvent(t,{detail:n})}catch(o){r=e.createEvent("CustomEvent"),r.initCustomEvent(t,!0,!0,n)}for(;s>i;i++)this[i].dispatchEvent(r);return this},n.fn.is=function(){var t,n=e.body;return t=n.matches||n.matchesSelector||n.msMatchesSelector,t=t||n.mozMatchesSelector||n.webkitMatchesSelector||n.oMatchesSelector,function(e){var n,r,i=0,a=this.length;switch(typeof e){case"string":n=t;break;case"function":n=s;break;case"object":if(!(e instanceof Element||e instanceof Window||e instanceof Document))throw new Error("First parameter of z#is is invalid");n=o;default:throw new Error("First parameter of z#is is invalid")}for(;a>i;i++)if(r=n(this[i],e))return r;return!1}}(),n.fn.hide=d(function(){return this.style.display="none",this}),n.fn.show=d(function(){return this.style.display="",this}),n.fn.clone=function(t){var e=0;for((void 0===t||null===t)&&(t=!1);ee;e++)this[e].innerHTML=t;return this},n.fn.text=function(t){var e,n;if(void 0===t)return this.textContent;for(e=0,n=this.length;n>e;e++)this[e].textContent=t;return this},n.fn.getAttr=function(t){if(!t)throw new Error("First parameter of z#getAttr is required");return this[0]&&this[0].getAttribute(t)},n.fn.setAttr=d(function(t,e){if(!t)throw new Error("First parameter of z#setAttr is required");if(void 0===e)throw new Error("Second parameter of z#setAttr is required");return this.setAttribute(t,e),this}),n.fn.attr=function(t,e){return void 0===e?this.getAttr(t):(this.setAttr(t,e),this)},n.fn.replaceWith=n.fn.replace=d(function(t){var e;void 0===t||null===t?this.remove():t instanceof g||t instanceof EventTarget?(e=a(t),t instanceof g&&(t=t[0]),this.parentNode.replaceChild(t,this),f(e)):this.outerHTML=t}),"classList"in e.documentElement?(n.fn.addClass=d(function(t){this.classList.add(t)}),n.fn.removeClass=d(function(t){this.classList.remove(t)}),n.fn.toggleClass=d(function(t,e){return void 0===e?void this.classList.toggle(t):void this.classList[e?"add":"remove"](t)}),n.fn.hasClass=function(t){for(var e=0,n=this.length;n>e;e++)if(this[e].classList.contains(t))return!0;return!1}):(n.fn.addClass=d(function(t){this.className+=" "+t}),n.fn.removeClass=d(function(t){this.className+=this.className.replace(new RegExp("(^|\\b)"+t+"(\\b|$)","g")," ")}),n.fn.toggleClass=function(t,e){return this[e?"addClass":"removeClass"](t),this},n.fn.hasClass=function(t){for(var e=0,n=this.length,r=new RegExp("(^| )"+t+"( |$)","gi");n>e;e++)if(r.test(this[e].className))return!0;return!1}),n.fn.append=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#append is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("beforeend",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].appendChild(t);return this},n.fn.prepend=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#prepend is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("afterbegin",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].insertBefore(t,this[e].firstChild);return this},n.fn.after=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#append is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("afterend",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].insertAdjacentHTML("afterend",t.outerHTML);return this},n.fn.css=function(t,e){var n=0,r=this.length;if(void 0===t)throw new Error("First parameter of z#css is required.");if(void 0===e)return getComputedStyle(this[0])[t];for(t=t.replace(/-./g,function(t){return t.substr(1).toUpperCase()});r>n;n++)this[n].style[t]=e;return this},n.fn.remove=d(function(){this.parentNode.removeChild(this)}),n.fn.empty=d(function(){this.innerHTML=""});var b,A={};n.registerSelector=function(t,e){if(!t||"string"!=typeof t)throw new Error("First parameter of z#registerSelector must be a string selector");if(!e||"function"!=typeof e)throw new Error("Second parameter of z#registerSelector must be a function");":"!==t[0]&&(t=":"+t),b=!1,A[t]=e},n.registerSelector(":first",function(t){return n(this.querySelector(t))}),n.registerSelector(":input",function(){function t(t){return~e.indexOf(t.tagName)}var e="INPUT,TEXTAREA,SELECT,BUTTON".split(",");return function(e){var n=new g;return n.push.apply(n,[].filter.call(this.querySelectorAll(e),t)),n}}()),n.fn.parent=v(function(){return this.parentNode}),n.fn.next=v(function(){return this.nextElementSibling}),n.fn.prev=n.fn.previous=v(function(){return this.previousElementSibling}),n.fn.siblings=v(function(){return[].filter.call(this.parentNode.children,function(t){return t!==this},this)}),n.fn.prevAll=v(function(){return m(this,"previousElementSibling")}),n.fn.children=v(function(){return this.children}),n.deepExtend=function L(t){var e,n,r=2;for("object"==typeof t?(n=t||{},t=1/0):(t=t===!0?1/0:0|t,n=arguments[1]||{});re;e++)t.apply(this[e],arguments);return this}}function v(t){return function(){for(var e,n=0,r=this.length,i=new g;r>n;n++)e=t.apply(this[n],arguments),e&&(Array.isArray(e)&&e.length?i.push.apply(i,e):i.push(e));return i}}function m(t,e){for(var n=new g;t[e]&&1===t.nodeType;)t=t[e],n.push(t);return n}var g,y,w,E;try{E=e.createElement("iframe"),E.style.width=0,E.style.height=0,E.style.borderStyle="none",e.body.appendChild(E),g=E.contentWindow.Array,e.body.removeChild(E)}catch(x){g=Array}t.z=n,n.fn=g.prototype,y=n(t),w=n(e),n.fn.find=function(t){if("string"!=typeof t)throw new Error("First paramater of z#find() should be a string");return u(this,t)};var T,S,b={};T={method:"GET",requestType:"text",responseType:"text",url:t.location+"",query:null,data:null,setup:r,success:r,error:r},S={text:function(t){return(t||"")+""}},n.ajax=function(t){var e=new XMLHttpRequest;if(t=n.extend({context:e},T,t),!S[t.requestType])throw new Error("Invalid option `requestType`");if(!S[t.responseType])throw new Error("Invalid option `responseType`");t.query&&~["HEAD","GET"].indexOf(t.method.toUpperCase())&&(t.url+=~t.url.indexOf("?")?"&":"?",t.url+=n.queryString(t.query),t.url=t.url.replace(/(\?|&)&/g,"$1")),e.open(t.method,t.url,!0),e.onload=function(){var n;e.status>=200&&e.status<400?(n=S[t.responseType].call(e,e.responseText,!0),t.success.call(t.context,n)):t.error.call(t.context,e.status,e.statusText)},e.onerror=function(){t.error.call(t.context,e.status,e.statusText)},~["HEAD","GET"].indexOf(t.method.toUpperCase())||e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.data&&(t.data=S[t.requestType].call(e,t.data,!1)),t.setup.call(e,e),e.send(t.data)},T.requestType="detect",T.responseType="detect",n.registerAjaxType=function(t,e,n){n||"function"!=typeof e||(n=e,e=!1),S[t]=n,e&&(b[e]=t)},n.registerAjaxType("detect",function(t,e){var n,r="text";return e?(n=this.getResponseHeader("Content-Type")||"",n=n.split(";")[0].trim(),r=b[n]||"text"):t&&"object"==typeof t&&t.toString==={}.toString&&(r="json"),S[r].call(this,t,e)}),n.registerAjaxType("json","application/json",function(t,e){return e?JSON.parse(t):JSON.stringify(t)}),n.registerAjaxType("html","text/html",function(t,n){var r,i;return n?(i=new g,r=e.implementation.createHTMLDocument(),r.documentElement.innerHTML=t,i.push.apply(i,i.slice.call(r.body.children,0)),i):t.outerHTML}),n.registerAjaxType("xml","text/xml",i),n.registerAjaxType("xml","application/xml",i),n.fn.data="dataset"in e.body?function(t,e){var n,r;if(this.length){if(void 0===t)return this[0].dataset;if(void 0===e)return this[0].dataset[t];for(n=0,r=this.length;r>n;n++)this[n].dataset[t]=e;return this}}:function(t,e){var n,r,i="data-"+(t||"");if(this.length){if(void 0===t)return n={},[].forEach.call(this[0].attributes,function(t){return n[t.name]=t.value}),n;if(void 0===e)return this[0].attributes[i];for(n=0,r=this.length;r>n;n++)this[n].dataset[i]=e;return this}},n.data=function(t,e,r){n(t).data(e,r)},n.fn.on=n.fn.bind=d(function(t,e){this.addEventListener(t,e,!1)}),n.fn.one=d(function(t,e){var r=!1;n(this).on(t,function i(s){r||(r=!0,n(this).off(t,i),e.call(this,s))})}),n.fn.off=n.fn.unbind=d(function(t,e){this.removeEventListener(t,e,!1)}),n.fn.trigger=function(t,n){var r,i=0,s=this.length;void 0===n&&(n={}),n.event=n;try{r=new CustomEvent(t,{detail:n})}catch(o){r=e.createEvent("CustomEvent"),r.initCustomEvent(t,!0,!0,n)}for(;s>i;i++)this[i].dispatchEvent(r);return this},n.fn.is=function(){var t,n=e.body;return t=n.matches||n.matchesSelector||n.msMatchesSelector,t=t||n.mozMatchesSelector||n.webkitMatchesSelector||n.oMatchesSelector,function(e){var n,r,i=0,a=this.length;switch(typeof e){case"string":n=t;break;case"function":n=s;break;case"object":if(!(e instanceof Element||e instanceof Window||e instanceof Document))throw new Error("First parameter of z#is is invalid");n=o;default:throw new Error("First parameter of z#is is invalid")}for(;a>i;i++)if(r=n(this[i],e))return r;return!1}}(),n.fn.hide=d(function(){return this.style.display="none",this}),n.fn.show=d(function(){return this.style.display="",this}),n.fn.clone=function(t){var e=0;for((void 0===t||null===t)&&(t=!1);ee;e++)this[e].innerHTML=t;return this},n.fn.text=function(t){var e,n;if(void 0===t)return this.textContent;for(e=0,n=this.length;n>e;e++)this[e].textContent=t;return this},n.fn.getAttr=function(t){if(!t)throw new Error("First parameter of z#getAttr is required");return this[0]&&this[0].getAttribute(t)},n.fn.setAttr=d(function(t,e){if(!t)throw new Error("First parameter of z#setAttr is required");if(void 0===e)throw new Error("Second parameter of z#setAttr is required");return this.setAttribute(t,e),this}),n.fn.attr=function(t,e){return void 0===e?this.getAttr(t):(this.setAttr(t,e),this)},n.fn.replaceWith=n.fn.replace=d(function(t){var e;void 0===t||null===t?this.remove():t instanceof g||t instanceof EventTarget?(e=a(t),t instanceof g&&(t=t[0]),this.parentNode.replaceChild(t,this),f(e)):this.outerHTML=t}),"classList"in e.documentElement?(n.fn.addClass=d(function(t){this.classList.add(t)}),n.fn.removeClass=d(function(t){this.classList.remove(t)}),n.fn.toggleClass=d(function(t,e){return void 0===e?void this.classList.toggle(t):void this.classList[e?"add":"remove"](t)}),n.fn.hasClass=function(t){for(var e=0,n=this.length;n>e;e++)if(this[e].classList.contains(t))return!0;return!1}):(n.fn.addClass=d(function(t){this.className+=" "+t}),n.fn.removeClass=d(function(t){this.className+=this.className.replace(new RegExp("(^|\\b)"+t+"(\\b|$)","g")," ")}),n.fn.toggleClass=function(t,e){return this[e?"addClass":"removeClass"](t),this},n.fn.hasClass=function(t){for(var e=0,n=this.length,r=new RegExp("(^| )"+t+"( |$)","gi");n>e;e++)if(r.test(this[e].className))return!0;return!1}),n.fn.append=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#append is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("beforeend",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].appendChild(t);return this},n.fn.prepend=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#prepend is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("afterbegin",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].insertBefore(t,this[e].firstChild);return this},n.fn.after=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#append is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("afterend",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].insertAdjacentHTML("afterend",t.outerHTML);return this},n.fn.css=function(t,e){var n=0,r=this.length;if(void 0===t)throw new Error("First parameter of z#css is required.");if(void 0===e)return getComputedStyle(this[0])[t];for(t=t.replace(/-./g,function(t){return t.substr(1).toUpperCase()});r>n;n++)this[n].style[t]=e;return this},n.fn.remove=d(function(){this.parentNode.removeChild(this)}),n.fn.empty=d(function(){this.innerHTML=""});var C,A={};n.registerSelector=function(t,e){if(!t||"string"!=typeof t)throw new Error("First parameter of z#registerSelector must be a string selector");if(!e||"function"!=typeof e)throw new Error("Second parameter of z#registerSelector must be a function");":"!==t[0]&&(t=":"+t),C=!1,A[t]=e},n.registerSelector(":first",function(t){return n(this.querySelector(t))}),n.registerSelector(":input",function(){function t(t){return~e.indexOf(t.tagName)}var e="INPUT,TEXTAREA,SELECT,BUTTON".split(",");return function(e){var n=new g;return n.push.apply(n,[].filter.call(this.querySelectorAll(e),t)),n}}()),n.fn.parent=v(function(){return this.parentNode}),n.fn.next=v(function(){return this.nextElementSibling}),n.fn.prev=n.fn.previous=v(function(){return this.previousElementSibling}),n.fn.siblings=v(function(){return[].filter.call(this.parentNode.children,function(t){return t!==this},this)}),n.fn.prevAll=v(function(){return m(this,"previousElementSibling")}),n.fn.children=v(function(){return this.children}),n.deepExtend=function q(t){var e,n,r=2;for("object"==typeof t?(n=t||{},t=1/0):(t=t===!0?1/0:0|t,n=arguments[1]||{});re;e++)t.apply(this[e],arguments);return this}}function v(t){return function(){for(var e,n=0,r=this.length,i=new g;r>n;n++)e=t.apply(this[n],arguments),e&&(Array.isArray(e)&&e.length||e instanceof HTMLCollection?i.push.apply(i,e):i.push(e));return i}}function m(t,e){for(var n=new g;t[e]&&1===t.nodeType;)t=t[e],n.push(t);return n}var g,y,w,E;try{E=e.createElement("iframe"),E.style.width=0,E.style.height=0,E.style.borderStyle="none",e.body.appendChild(E),g=E.contentWindow.Array,e.body.removeChild(E)}catch(x){g=Array}t.z=n,n.fn=g.prototype,y=n(t),w=n(e),n.fn.find=function(t){if("string"!=typeof t)throw new Error("First paramater of z#find() should be a string");return u(this,t)};var T,C,S={};T={method:"GET",requestType:"text",responseType:"text",url:t.location+"",query:null,data:null,setup:r,success:r,error:r},C={text:function(t){return(t||"")+""}},n.ajax=function(t){var e=new XMLHttpRequest;if(t=n.extend({context:e},T,t),!C[t.requestType])throw new Error("Invalid option `requestType`");if(!C[t.responseType])throw new Error("Invalid option `responseType`");t.query&&~["HEAD","GET"].indexOf(t.method.toUpperCase())&&(t.url+=~t.url.indexOf("?")?"&":"?",t.url+=n.queryString(t.query),t.url=t.url.replace(/(\?|&)&/g,"$1")),e.open(t.method,t.url,!0),e.onload=function(){var n;e.status>=200&&e.status<400?(n=C[t.responseType].call(e,e.responseText,!0),t.success.call(t.context,n)):t.error.call(t.context,e.status,e.statusText)},e.onerror=function(){t.error.call(t.context,e.status,e.statusText)},~["HEAD","GET"].indexOf(t.method.toUpperCase())||e.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.data&&(t.data=C[t.requestType].call(e,t.data,!1)),t.setup.call(e,e),e.send(t.data)},T.requestType="detect",T.responseType="detect",n.registerAjaxType=function(t,e,n){n||"function"!=typeof e||(n=e,e=!1),C[t]=n,e&&(S[e]=t)},n.registerAjaxType("detect",function(t,e){var n,r="text";return e?(n=this.getResponseHeader("Content-Type")||"",n=n.split(";")[0].trim(),r=S[n]||"text"):t&&"object"==typeof t&&t.toString==={}.toString&&(r="json"),C[r].call(this,t,e)}),n.registerAjaxType("json","application/json",function(t,e){return e?JSON.parse(t):JSON.stringify(t)}),n.registerAjaxType("html","text/html",function(t,n){var r,i;return n?(i=new g,r=e.implementation.createHTMLDocument(),r.documentElement.innerHTML=t,i.push.apply(i,i.slice.call(r.body.children,0)),i):t.outerHTML}),n.registerAjaxType("xml","text/xml",i),n.registerAjaxType("xml","application/xml",i),n.fn.data="dataset"in e.body?function(t,e){var n,r;if(this.length){if(void 0===t)return this[0].dataset;if(void 0===e)return this[0].dataset[t];for(n=0,r=this.length;r>n;n++)this[n].dataset[t]=e;return this}}:function(t,e){var n,r,i="data-"+(t||"");if(this.length){if(void 0===t)return n={},[].forEach.call(this[0].attributes,function(t){return n[t.name]=t.value}),n;if(void 0===e)return this[0].attributes[i];for(n=0,r=this.length;r>n;n++)this[n].dataset[i]=e;return this}},n.data=function(t,e,r){n(t).data(e,r)},n.fn.on=n.fn.bind=d(function(t,e){this.addEventListener(t,e,!1)}),n.fn.one=d(function(t,e){var r=!1;n(this).on(t,function i(s){r||(r=!0,n(this).off(t,i),e.call(this,s))})}),n.fn.off=n.fn.unbind=d(function(t,e){this.removeEventListener(t,e,!1)}),n.fn.trigger=function(t,n){var r,i=0,s=this.length;void 0===n&&(n={}),n.event=n;try{r=new CustomEvent(t,{detail:n})}catch(o){r=e.createEvent("CustomEvent"),r.initCustomEvent(t,!0,!0,n)}for(;s>i;i++)this[i].dispatchEvent(r);return this},n.fn.is=function(){var t,n=e.body;return t=n.matches||n.matchesSelector||n.msMatchesSelector,t=t||n.mozMatchesSelector||n.webkitMatchesSelector||n.oMatchesSelector,function(e){var n,r,i=0,a=this.length;switch(typeof e){case"string":n=t;break;case"function":n=s;break;case"object":if(!(e instanceof Element||e instanceof Window||e instanceof Document))throw new Error("First parameter of z#is is invalid");n=o;default:throw new Error("First parameter of z#is is invalid")}for(;a>i;i++)if(r=n(this[i],e))return r;return!1}}(),n.fn.hide=d(function(){return this.style.display="none",this}),n.fn.show=d(function(){return this.style.display="",this}),n.fn.clone=function(t){var e=0;for((void 0===t||null===t)&&(t=!1);ee;e++)this[e].innerHTML=t;return this},n.fn.text=function(t){var e,n;if(void 0===t)return this.textContent;for(e=0,n=this.length;n>e;e++)this[e].textContent=t;return this},n.fn.getAttr=function(t){if(!t)throw new Error("First parameter of z#getAttr is required");return this[0]&&this[0].getAttribute(t)},n.fn.setAttr=d(function(t,e){if(!t)throw new Error("First parameter of z#setAttr is required");if(void 0===e)throw new Error("Second parameter of z#setAttr is required");return this.setAttribute(t,e),this}),n.fn.attr=function(t,e){return void 0===e?this.getAttr(t):(this.setAttr(t,e),this)},n.fn.replaceWith=n.fn.replace=d(function(t){var e;void 0===t||null===t?this.remove():t instanceof g||t instanceof EventTarget?(e=a(t),t instanceof g&&(t=t[0]),this.parentNode.replaceChild(t,this),f(e)):this.outerHTML=t}),"classList"in e.documentElement?(n.fn.addClass=d(function(t){this.classList.add(t)}),n.fn.removeClass=d(function(t){this.classList.remove(t)}),n.fn.toggleClass=d(function(t,e){return void 0===e?void this.classList.toggle(t):void this.classList[e?"add":"remove"](t)}),n.fn.hasClass=function(t){for(var e=0,n=this.length;n>e;e++)if(this[e].classList.contains(t))return!0;return!1}):(n.fn.addClass=d(function(t){this.className+=" "+t}),n.fn.removeClass=d(function(t){this.className+=this.className.replace(new RegExp("(^|\\b)"+t+"(\\b|$)","g")," ")}),n.fn.toggleClass=function(t,e){return this[e?"addClass":"removeClass"](t),this},n.fn.hasClass=function(t){for(var e=0,n=this.length,r=new RegExp("(^| )"+t+"( |$)","gi");n>e;e++)if(r.test(this[e].className))return!0;return!1}),n.fn.append=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#append is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("beforeend",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].appendChild(t);return this},n.fn.prepend=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#prepend is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("afterbegin",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].insertBefore(t,this[e].firstChild);return this},n.fn.after=function(t){var e=0,n=this.length;if(void 0===t)throw new Error("First parameter of z#append is required.");if("string"==typeof t){for(;n>e;e++)this[e].insertAdjacentHTML("afterend",t);return this}for(t instanceof g&&(t=t[0]);n>e;e++)this[e].insertAdjacentHTML("afterend",t.outerHTML);return this},n.fn.css=function(t,e){var n=0,r=this.length;if(void 0===t)throw new Error("First parameter of z#css is required.");if(void 0===e)return getComputedStyle(this[0])[t];for(t=t.replace(/-./g,function(t){return t.substr(1).toUpperCase()});r>n;n++)this[n].style[t]=e;return this},n.fn.remove=d(function(){this.parentNode.removeChild(this)}),n.fn.empty=d(function(){this.innerHTML=""});var b,A={};n.registerSelector=function(t,e){if(!t||"string"!=typeof t)throw new Error("First parameter of z#registerSelector must be a string selector");if(!e||"function"!=typeof e)throw new Error("Second parameter of z#registerSelector must be a function");":"!==t[0]&&(t=":"+t),b=!1,A[t]=e},n.registerSelector(":first",function(t){return n(this.querySelector(t))}),n.registerSelector(":input",function(){function t(t){return~e.indexOf(t.tagName)}var e="INPUT,TEXTAREA,SELECT,BUTTON".split(",");return function(e){var n=new g;return n.push.apply(n,[].filter.call(this.querySelectorAll(e),t)),n}}()),n.fn.parent=v(function(){return this.parentNode}),n.fn.next=v(function(){return this.nextElementSibling}),n.fn.prev=n.fn.previous=v(function(){return this.previousElementSibling}),n.fn.siblings=v(function(){return[].filter.call(this.parentNode.children,function(t){return t!==this},this)}),n.fn.prevAll=v(function(){return m(this,"previousElementSibling")}),n.fn.children=v(function(){return this.children}),n.deepExtend=function L(t){var e,n,r=2;for("object"==typeof t?(n=t||{},t=1/0):(t=t===!0?1/0:0|t,n=arguments[1]||{});r