-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathksa-1.0.min.js
12 lines (12 loc) · 35.3 KB
/
ksa-1.0.min.js
1
2
3
4
5
6
7
8
9
10
11
12
/**
* KSA前端底层驱动 V1.0
*
* 目前版本还处于开发中,请勿保存并用于生产环境!
*
* ---------------------------------------
* 待正式发布版本后,源代码将会公开开源
*
* Author : ksaos.com && cr180.com(Mr Wu - ChenJun)
* Update : 2020年7月29日
*/
function debug(m){console.log.apply(this,arguments)}var consoleGroupN={};function debugTime(m){consoleGroupN[m]=0<=consoleGroupN[m]?consoleGroupN[m]+1:0;m=m+"-"+consoleGroupN[m];console.time(m);return function(){console.timeEnd(m)}}(function(m,t,h){function J(a){a&&(a.isStop=!1,a.stop=function(){this.stopPropagation();this.preventDefault();this.isStop=!0});return a}function y(a,b){var d=m.createDocumentFragment(),f=(O.exec(a)||["",""])[1].toLowerCase(),f=u[f]||u._default,d=d.appendChild(m.createElement("div"));d.innerHTML=f[1]+a+f[2];for(f=f[0];f--;)d=d.lastChild;var g={},k={},p;c(d).find("script").map(function(a){var b=m.createElement("script");c.loop(c.attrs(a),function(a,c){b[c]=a});var d=c.objectID(b);a.src&&(k[d]=a,b.onload=function(){delete k[d];c.isEmpty(k)&&c.loop(g[d],function(a){a[0].text=a[1]})},p=d);p?a.text&&(g[p]=g[p]?g[p]:[],g[p].push([b,a.text])):b.text=a.text;c(a).after(b).remove()});var n=[];c.loop(d.childNodes,function(a){(!b||3!==a.nodeType&&8!==a.nodeType)&&n.push(a)});return n}function z(a,b,d){var f,g=c.isFunction(a);a instanceof c?f=a:c.isDomAll(a)?f=a instanceof NodeList?a:[a]:c.isArray(a)?f=a:c.isString(a)&&(f=y(a));var k=this.length;c.loop(this,function(p,n){var l=n!==k-1;if(g){f=a.call(p,n,p.innerHTML);c.isString(f)&&(f=y(f),l=0);if(f instanceof c)f=[f[0]],l=0;else if(f instanceof HTMLElement||f instanceof Node)l=0;f=c.toArray(f)}for(var q=d?0:f.length,w=d?f.length-1:0;d?0<=w:w<q;){var h=f[w],h=l?c(h).clone(!0,!0)[0]:h;b.call(p,p,h);d?w--:w++}});return this}function v(a,b){if(!b||!a||1!==a.nodeType)return!1;var c=a.matches||a.matchesSelector||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector;try{return c.call(a,C(b))}catch(f){console.error(Error("\u9009\u62e9\u5668\u8bed\u6cd5\u53ef\u80fd\u6709\u9519\u8bef\uff1a"+b))}}function D(a,b,d){var f=[];c.loop(a,function(a){for(;a=a[b];)d&&!v(a,d)||f.push(a)});return f}function C(a){a&&(a=a.trim(),a=a.replace(/(:selected)/g,":checked"));return a}function E(a,b){b=C(b);"\x3e"==b.substr(0,1)&&(b=":scope "+b);var c=a.querySelectorAll(b);c.length||-1!==b.indexOf("[")||(c=a.querySelectorAll('[ks-selector\x3d"'+b+'"]'));return c}function c(a){a=new L(a);a.__proto__=h;return a}function L(a){if(a){if(a instanceof c)return a;if(c.isWindow(a)||c.isDomAll(a))a=[a];else if(c.isString(a))a=C(a),a=0===a.indexOf("\x3c")&&3<=a.length?y(a,!0):[].slice.call(E(m,a));else if(c.isFunction(a)){c.ready(a);return}var b=a.length,d={};c.loop(a,function(a,b){d[b]=a});a=d;a.length=b}else a={length:0};a.length&&(c.arrayMerge(this,a),this.length=a.length);return this}function M(a,b,d,f){function g(){var f=a.getAttribute("class")||"",g={};c.loop(c.explode(" ",f+" "+b,""),function(a){(a=a.trim())&&(g[a]=1)});d&&(b=c.explode(" ",b,""),c.loop(g,function(a,d){c.inArray(d,b)&&delete g[d]}));(g=c.implode(" ",Object.keys(g)))&&g!=f?a.className=g:g||a.removeAttribute("class")}b&&(0<f?window.setTimeout(g,f):g())}function B(a,b,d){var f=c.isset(b);b=!!b;if(!f){if(f=this[0]){if("INPUT"===f.tagName&&c.inArray(a,["checked"]))return f[a];var g=f.getAttribute(a);c.isNull(g)&&(g=f[a]);g=""===g?!0:g;return c.inArray(g,["false","undefined","null"])?!1:!!g}}else if(c.isset(b))return this.map(function(f){var g=f[a];g!==b&&(b?(f[a]=b,f.setAttribute(a,a)):(d?delete f[a]:f[a]=!1,f.removeAttribute(a)),c(f).trigger("KSADOMchange",["attr."+a,b,g]))}),this}function P(a){a=(""+a).split(".");return{evn:a[0],scope:a[1]||""}}function F(a,b){c.isObject(a)||c.isArray(a)?c.loop(a,function(c,f){a[f]=F(c,b)}):a=(b?parseFloat(a):parseInt(a))||0;return a}var r={},u={thead:[1,"\x3ctable\x3e","\x3c/table\x3e"],col:[2,"\x3ctable\x3e\x3ccolgroup\x3e","\x3c/colgroup\x3e\x3c/table\x3e"],tr:[2,"\x3ctable\x3e\x3ctbody\x3e","\x3c/tbody\x3e\x3c/table\x3e"],td:[3,"\x3ctable\x3e\x3ctbody\x3e\x3ctr\x3e","\x3c/tr\x3e\x3c/tbody\x3e\x3c/table\x3e"],_default:[0,"",""]};u.tbody=u.tfoot=u.colgroup=u.caption=u.thead;u.th=u.td;var O=/<([a-z][^\/>\x20\t\r\n\f]*)/i;c.getScript=function(a,b){var d=m.createElement("script");d.src=a;d.onload=function(){b&&b()};c("head").append(d)};c.getCSS=function(a,b){var d=m.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=a;d.onload=function(){b&&b()};c("head").append(d)};L.prototype=c.prototype=h={};var G=[];h.ready=function(a){this.map(function(b){b===m||b===window?G.push(function(){a.call(b)}):b.addEventListener("DOMContentLoaded",function(){a.call(b)},!1)});return this};h.DOMchange=function(a,b){this.map(function(d){var f=d.KSADOMchangeEvent?!0:!1;d.KSADOMchangeEvent||(d.KSADOMchangeEvent={});c.loop(c.explode(" ",a,""),function(a){a=a.toLowerCase();d.KSADOMchangeEvent[a]||(d.KSADOMchangeEvent[a]=[]);d.KSADOMchangeEvent[a].push(b)});if(!f)c(d).on("KSADOMchange",function(a){var b=this,d=a.KSAcallbackArgs;d[0]=d[0].toLowerCase();this.KSADOMchangeEvent&&this.KSADOMchangeEvent[d[0]]&&c.loop(this.KSADOMchangeEvent[d[0]],function(a){a.apply(b,[d[1],d[2]])})})});return this};h.clone=function(a,b){var d=c();this.each(function(f,g){var k=c.objectID(g),k=r[k],p=g.cloneNode(a);c.objectID(p,"");if(b&&k){var n=c(p);c.loop(k,function(a,b){c.loop(a,function(a){n.on(b,a.selector,a.callback)})})}d.push(p)});return d};c.dom=function(a){a=y(a);return 1===a.length?a[0]:a};h.addClass=function(a,b){if(a){var d=b&&c.isArray(b)?b:null;this.each(function(c,g){M(g,a,!1,d?d[c]:b)})}return this};h.removeClass=function(a,b){if(a){var d=b&&c.isArray(b)?b:null;this.each(function(c,g){M(g,a,!0,d?d[c]:b)})}return this};h.hasClass=function(a){for(var b,d=0;b=this[d++];)if(1===b.nodeType&&(b=b.getAttribute("class"))&&b.length&&c.inArray(a,c.explode(" ",b,"")))return!0;return!1};h.prop=function(a,b){a=c.explode(" ",a,"");if(c.isset(b))return b=""===b?null:b,this.map(function(d){c.loop(a,function(a){if(null===b)delete d[a];else if(c.isset(b)){var f=d[a];f!==b&&(d[a]=b,c(d).trigger("KSADOMchange",["attr."+a,b,f]))}})}),this;var d=this[0];if(d){var f={};c.loop(a,function(b){f[a]=d[a]});return 1===a.length?f[a[0]]:f}};var Q="active checked selected async autofocus autoplay controls defer disabled hidden ismap loop multiple open readonly required scoped".split(" ");c.attrs=function(a){if(a&&a.attributes){var b={};c.loop(a.attributes,function(d){var f=d.value;c.inArray(d.name,Q)&&(f=c.inArray(d.name,["checked","selected"])?a[d.name]:f,f=""===f?!0:!!f);b[d.name]=f});return b}};h.checked=function(a){return B.call(this,"checked",a)};h.selected=function(a){return B.call(this,"selected",a)};h.disabled=function(a){return B.call(this,"disabled",a)};h.active=function(a){return B.call(this,"active",a,1)};h.attr=function(a,b){b=""===b?null:b;var d=null===b,f=c.isset(a),g=c.isObject(a),k=c.isset(b),p="";g||f&&k&&!d?p="set":f&&d?p="del":f&&g||k||(p="get");g||(a=c.explode(" ",a,""));var n={};if("get"==p){var l=this[0];if(l){var q={};k||f?c.loop(a,function(a){var b=l.getAttribute(a);c.isNull(b)||(q[a]=b)}):q=c.attrs(l);return 1===a.length?q[a[0]]:q}}else{if("set"==p){var h;g?h=a:(h={},c.loop(a,function(a){h[a]=b}));h&&this.map(function(a){var b=c.attrs(a),d;c.loop(h,function(f,g){var k=""===b[g]?!0:b[g];k&&f===k||(""===f||c.isNull(f)?a.removeAttribute(g):a.setAttribute(g,!0===f?"":f),c(a).trigger("KSADOMchange",["attr."+g,f,k]),0===g.indexOf("data-")&&(n[g.substr(5)]=f),d=1)});d&&c(a).trigger("KSADOMchange",["attr"])});c.isEmpty(n)||this.data(n);return this}if("del"==p)return this.map(function(b){var d=c.attrs(b);c.loop(a,function(a){0===a.indexOf("data-")&&(n[a.substr(5)]=null);b.removeAttribute(a);c.isset(d[a])&&c(b).trigger("KSADOMchange",["attr."+a])})}),c.isEmpty(n)||this.data(n),this}};h.removeAttr=function(a){a&&this.attr(a,null);return this};h.data=function(a,b){b=""===b?null:b;var d=null===b,f=c.isset(a),g=c.isObject(a),k=c.isset(b),p="";g||f&&k&&!d?p="set":f&&d?p="del":f&&g||k||(p="get");a=a&&!g?c.explode(" ",a,""):a;if("set"==p)return this.map(function(d){d._KSAOS_COM_ELE_DATA||(d._KSAOS_COM_ELE_DATA={});var f=d._KSAOS_COM_ELE_DATA,k={};g?k=a:c.loop(a,function(a){k[a]=b});c.loop(k,function(a,b){a=""===a?null:a;var g="data-"+b;c.isObject(a)?f[b]=a:c.isNull(a)?(d.removeAttribute(g),c.isset(f[b])&&delete f[b],c(d).trigger("KSADOMchange",["data."+b])):f[b]!==a&&(d.setAttribute(g,a),c(d).trigger("KSADOMchange",["data."+b,a,f[b]]),f[b]=a)})}),this;if("get"==p){var n=this[0];if(n){n._KSAOS_COM_ELE_DATA||(n._KSAOS_COM_ELE_DATA={});if(a){var l={};c.loop(a,function(a){var b=n._KSAOS_COM_ELE_DATA[a];c.isset(b)||(b=n.getAttribute("data-"+a));c.isNull(b)||(l[a]=b)});return 1===a.length?l[a[0]]:l}l=n._KSAOS_COM_ELE_DATA||{};c.loop(this.attr(),function(a,b){0===b.indexOf("data-")&&(l[b.substr(5)]=a)});if(!c.isEmpty(l))return l}}else if("del"===p)return this.map(function(b){var d=b._KSAOS_COM_ELE_DATA;d&&c.loop(a,function(a){c.isset(d[a])&&(c(b).trigger("KSADOMchange",["data."+a,t,d[a]]),b.removeAttribute("data-"+a),delete d[a])})}),this};h.removeData=function(a){a&&this.data(a,null);return this};h.empty=function(){this.map(function(a){var b=a.innerHTML;a.innerHTML="";c(a).trigger("KSADOMchange",["html","",b])});return this};h.val=function(a){if(c.isset(a)&&null!==a)return this.map(function(b,d){if(c.inArray(b.tagName,["INPUT","SELECT","TEXTAREA"])){if(c.isFunction(a)){var f=b.value;"SELECT"==b.tagName&&b.multiple&&(f=[],c.loop(b.options,function(a){a.selected&&f.push(a.value)}));a=a.call(b,d,f)}switch(b.tagName){case "INPUT":var g=b.getAttribute("type"),g=0===g.indexOf("ks-")?g.substr(3):g;"checkbox"===g?(g=c(b).attr("value"),c.isset(g)?c(b).checked(c.isArray(a)?c.inArray(g,a):g==a):c(b).checked(c.isObject(a)?c.isEmpty(a):!!a)):"radio"===g?c(b).checked(c(b).attr("value")==a):b.value=a;break;case "SELECT":a=c.isArray(a)?a:[a];b.options&&(1==a.length?b.value=a[0]:c.loop(b.options,function(b){var d=c.inArray(b.value,a);d!=b.selected&&(b.selected=d,c(b).attr("selected","selected"))}));c(b).trigger("ksachange");break;case "TEXTAREA":b.value=a}c(b).trigger("KSADOMchange",["val",a])}}),this;var b=[],d=this[0];if(d&&!d.disabled){switch(d.tagName){case "INPUT":var f=d.getAttribute("type"),f=0===f.indexOf("ks-")?f.substr(3):f;c.inArray(f,["checkbox","radio"])?d.checked&&b.push(d.value):b.push(d.value);break;case "SELECT":c(d).find("option:selected").map(function(a){b.push(a.value)});break;case "TEXTAREA":b.push(d.value)}return 1===b.length?b[0]:b}};h.text=function(a){if(c.isset(a))return this.map(function(b,f){if(1===b.nodeType||11===b.nodeType||9===b.nodeType){var d=b.textContent;d!=a&&(b.textContent=c.isFunction(a)?a.call(b,f,d):a,c(b).trigger("KSADOMchange",["html",a,d]))}else 3===b.nodeType&&(d=b.textContent,b.textContent=c.isFunction(a)?a.call(b,f,d):a,c(b).trigger("KSADOMchange",["html",a,d]))}),this;var b=[];this.map(function(a){b.push(a.textContent||"")});return b.join("\n")};h.contents=function(){var a=c();this.map(function(b){c.loop(b.childNodes,function(b){a.push(b)})});return a};h.html=function(a){if(c.isset(a))return this.map(function(b,f){c(b).empty().append(c.isFunction(a)?a.call(b,f,b.innerHTML):a);c(b).trigger("KSADOMchange",["html",a])}),this;var b=[];this.map(function(a){b.push(a.innerHTML||a.textContent)});return b.join("")};h.outerHtml=function(){var a=[];this.map(function(b){a.push(b.outerHTML||b.textContent)});return a.join("")};h.formData=function(a){var b={},d=this[0];a?b=new FormData(d):c(d).find("input, textarea, select").each(function(a,d){d=c(d);var f=d.attr("name");if(f=f?f.trim():""){var g=d.val(),h=d.attr("type"),l=/\[\]$/.test(f);l&&(f=f.replace(/(.*?)\[\]&/ig,"$1"));l?(b[f]||(b[f]=[]),"file"===h?b[f].push(d[0].files.length?d[0].files[0]:""):c.inArray(h,["radio","checkbox"])?d.checked()&&b[f].push(g):c.isArray(g)?c.loop(g,function(a){b[f].push(a)}):b[f].push(g)):"file"===h?b[f]=d[0].files.length?d[0].files[0]:"":c.inArray(h,["radio","checkbox"])?d.checked()&&(b[f]=g):b[f]=g}});return b};h.serialize=function(){var a=this.formData();return c.urlGetString(a,!0)};h.remove=function(){this.map(function(a){a.parentNode&&(a.parentNode.removeChild(a),c(a).trigger("KSADOMchange",["remove"]),c(a.parentNode).trigger("KSADOMchange",["html"]))});return this};h.after=function(a){return z.call(this,a,function(b,d){b.parentNode&&(b.parentNode.insertBefore(d,b.nextSibling),c(b).trigger("KSADOMchange",["after",a]),c(b.parentNode).trigger("KSADOMchange",["html"]))},!0)};h.before=function(a){return z.call(this,a,function(b,d){b.parentNode&&(b.parentNode.insertBefore(d,b),c(b).trigger("KSADOMchange",["before",a]))})};h.append=function(a){return z.call(this,a,function(b,d){d&&(b.appendChild(d),c(b).trigger("KSADOMchange",["append",a]))})};h.prepend=function(a){return z.call(this,a,function(b,d){b.insertBefore(d,b.firstChild);c(b).trigger("KSADOMchange",["prepend",a])},!0)};h.wrap=function(a){this.map(function(b,d){var f=c.dom(c.isFunction(a)?a.call(b,d):a);c(b).after(f);c(f).html(b)});return this};h.wrapAll=function(a){a=c(c.isFunction(a)?a.call(e,index):a);c(this[0]).before(a);a.html(this);return this};h.wrapInner=function(a){this.map(function(b){b=c(b);var d=c(c.isFunction(a)?a.call(b,index):a);d.html(b.contents());b.html(d)});return this};h.height=function(a,b){if(c.isset(a)&&!0!==a)return this.css("height",c.isNumber(a)?a+"px":a),this;var d=this[0];if(d){if(d===window||d===m)return m.documentElement.clientHeight||m.body.clientHeight;var d=d.offsetHeight,f=c.intval(this.css("paddingBottom paddingTop borderBottomWidth borderTopWidth marginBottom marginTop"));!0!==a&&(d-=f.paddingBottom+f.paddingTop+f.borderBottomWidth+f.borderTopWidth);!0===b&&(d+=f.marginBottom+f.marginTop);return d}};h.width=function(a,b){if(c.isset(a)&&!0!==a)return this.css("width",c.isNumber(a)?a+"px":a),this;var d=this[0];if(d===window||d===m)return m.documentElement.clientWidth||m.body.clientWidth;var d=d.offsetWidth,f=c.intval(this.css("paddingLeft paddingRight borderLeftWidth borderRightWidth marginLeft marginRight"));!0!==a&&(d-=f.paddingLeft+f.paddingRight+f.borderLeftWidth+f.borderRightWidth);!0===b&&(d+=f.marginLeft+f.marginRight);return d};h.offset=function(){var a=this[0];if(a){if(!a.getClientRects().length)return{top:0,left:0};var b=a.getBoundingClientRect(),a=a.ownerDocument.defaultView;return{top:b.top+a.pageYOffset,left:b.left+a.pageXOffset}}};h.show=function(){this.map(function(a){a.style.display="";var b="none"===m.defaultView.getComputedStyle(a,null).display;a.style.display=b?"block":"";c(a).trigger("KSADOMchange",["show"])});return this};h.hide=function(){this.map(function(a){a.style.display="none";c(a).trigger("KSADOMchange",["hide"])});return this};c.AnimationFrame=function(a,b,d){function f(a,c){c=parseFloat(c).toFixed(0);var d=Math.min((c/b).toFixed(2),1);return parseInt(a*d)}function g(p){n.start||(n.start=p);h=n.start;var A=p-h;l||(l=p-m);var K;if(0<l&&A<=b){q++;if(w){var r=[];c.loop(w,function(a){r.push(f(a,A))})}else r=f(a,A);K=d.call("",r,q,l)}!1===K||A>=b?(window.cancelAnimationFrame(n.AnimationID),delete c.AnimationFrameCache[k]):(window.cancelAnimationFrame(n.AnimationID),n.AnimationID=window.requestAnimationFrame(g));m=p}c.AnimationFrameCache||(c.AnimationFrameCache={_index:0});if(a){b=parseInt(b||0)||2E3;var k=c.AnimationFrameCache._index++,h,n=c.AnimationFrameCache[k]={},l=0,q=0,w=c.isArray(a),m;n.AnimationID=window.requestAnimationFrame(g);return n}};h.scrollTop=function(a,b){if(c.isset(a))return this.map(function(d){var f=d.scrollTop,k=a-f;b&&-5<=k&&5>=k&&(b=!1);b?(b=!0===b?500:b,c.AnimationFrame(k,b,function(a){if(Math.abs(a)>Math.abs(k))return!1;d.scrollTop=f+a})):d.scrollTop=f+k}),this;var d=this[0];d===m&&(d=d.scrollingElement);return d?d.scrollTop:0};h.reachBottom=function(a,b){b=b?b:50;this.map(function(d){var f=d===m,g,k;c(d).scroll(function(){var h=c(this),n=h.scrollTop(),h=h.height(!0),l=f?c("html")[0].scrollHeight:this.scrollHeight,n=Math.abs(n-(l-h));!g&&n<b?(a.call(d,d),g=!0):n>b&&(k&&window.clearTimeout(k),k=window.setTimeout(function(){g=!1},300))})})};h.scrollLeft=function(a,b){return c.isset(a)?(this.map(function(d){d.scrollLeft=parseFloat(a);var f=d.scrollLeft,g=a-f;b&&-5<=g&&5>=g&&(b=!1);b?(b=!0===b?500:b,c.AnimationFrame(g,b,function(a){if(Math.abs(a)>Math.abs(g))return!1;d.scrollLeft=f+a})):d.scrollLeft=f+g}),this):this[0]?this[0].scrollLeft:0};h.css=function(a,b){var d="animationIterationCount columnCount fillOpacity flexGrow flexShrink fontWeight gridArea gridColumn gridColumnEnd gridColumnStart gridRow gridRowEnd gridRowStart lineHeight opacity order orphans widows zIndex zoom".split(" ");b=""===b?null:b;var f,g={},k=c.isObject(a),h=c.isset(b);if(a){!h&&k?f=a:h&&(f={},f[a]=b);var n=[];c.loop(f,function(a,b){b=b.replace(/-([a-z]{1})/g,function(a,b){return b.toUpperCase()+""});var g=b.replace(/^(-moz-|-ms-|-webkit-|-o-|\+|_|\*)/ig,"");!c.inArray(g,d)&&c.isNumber(a)&&(a+="px");f[b]=a;n.push(b+":"+a)});n=n.length?c.implode("; ",n):"";if(f)return this.map(function(a){var b;c.loop(f,function(d,f){if(a.style[f]!=d){var g=a.style[f];a.style[f]=d;c(a).trigger("KSADOMchange",["css."+f,d,g]);b=1}});b&&c(a).trigger("KSADOMchange",["css"])}),this;if(this[0]){var k=c.explode(" ",a,""),l=window.getComputedStyle(this[0],null);c.loop(k,function(a){g[a]=l[a]});return 1===k.length?g[k[0]]:g}}};c.loop=function(a,b,d){if(a)if(a instanceof c||c.isArrayLike(a)){var f=a.length;if(f)for(k=0;k<a.length;k++){var g=a[k];if(d&&("first"===d||"last"===d&&k===f-1)||!0===b(g,k,k))return g}}else if(c.isNumber(a))for(k=1;k<=a;k++){if(d&&("first"===d||"last"===d&&k===a-1)||!0===b(k,k-1,k-1))return k}else if(c.isObject(a)){var f=Object.keys(a),k=0,h=f.length,n;if(h)for(n in f){var l=f[n],g=a[l];if(d&&("first"===d||"last"===d&&k===h-1)||!0===b(g,l,k))return g;k++}}};h.each=function(a){c.loop(this,function(b,c){a&&a.call(b,c,b)});return this};c.map=h.map=function(a,b){var d=!1;!b&&c.isFunction(a)&&(b=a,a=this,d=!0);var f=[],g=0;c.loop(a,function(a,h){var k=b.call(d?a:window,a,h,g);null!==k&&c.isset(k)&&f.push(k);g++});d&&(f=c(f));return f};c.slice=h.slice=function(){var a=c();c.loop([].slice.apply(this,arguments),function(b){a.push(b)});return a};h.push=function(a){var b=this,d=b.length?b.length:0;a instanceof c?a.each(function(a,c){b[d]=c;d++}):c.isArray(a)?c.loop(a,function(a){b[d]=a;d++}):(b[d]=a,d++);d&&(b.length=d);return b};h.eq=function(a){var b=c.isArray(a),d=c();this.map(function(f,g){(b&&c.inArray(g,a)||!b&&g==a)&&d.push(f)});return d};h.index=function(){var a=this[0],b=-1;a&&c(a).parent().children().each(function(c,f){f==a&&(b=c)});return b};h.first=function(){return c(this[0])};h.last=function(){return c(this[1<this.length?this.length-1:0])};h.is=function(a){var b=!1;this.map(function(c){v(c,a)&&(b=!0)});return b};h.find=function(a){a=a||"*";var b=c();this.map(function(d){c.loop(E(d,a),function(a){b.push(a)})});return b};h.filter=function(a){a=a||"*";return this.map(function(b){if(v(b,a))return b})};h.children=function(a){a=a||"*";var b=c(),d=0;this.map(function(f){c.loop(f.childNodes,function(c){v(c,a)&&(b[d]=c,d++)})});b.length=d;return b};h.childAll=function(){var a=c(),b=0;this.map(function(d){c.loop(d.childNodes,function(c){a[b]=c;b++})});a.length=b;return a};h.siblings=function(a){a=a||"*";var b=c(),d=0;this.map(function(f){c.loop(f.parentNode.childNodes,function(c){c!=f&&v(c,a)&&(b[d]=c,d++)})});b.length=d;return b};h.parent=function(a){a=a||"*";var b=c(),d=0;this.map(function(c){var f=c.parentNode;f!=c&&v(f,a)&&(b[d]=f,d++)});b.length=d;return b};h.parents=function(a){var b=c(),d=0;c.loop(D(this,"parentNode",a),function(a){b[d]=a;d++});b.length=d;return b};h.prev=function(a){a=a||"*";var b=c(),d=0;this.map(function(c,g){v(c.previousElementSibling,a)&&(b[d]=c.previousElementSibling,d++)});b.length=d;return b};h.prevAll=function(a,b){var d=c(),f=0;c.loop(D(this,b?"previousSibling":"previousElementSibling",a),function(a){d[f]=a;f++});d.length=f;return d};h.next=function(a){a=a||"*";var b=c(),d=0;this.map(function(c){v(c.nextElementSibling,a)&&(b[d]=c.nextElementSibling,d++)});b.length=d;return b};h.nextAll=function(a,b){var d=c(),f=0;this.map(D(this,b?"nextSibling":"nextElementSibling",a),function(a){d[f]=a;f++},b);d.length=f;return d};h.on=function(a,b,d){c.isFunction(b)&&!d&&(d=b,b=null);d=d?d:function(){return!1};a=a.split(/\s/);return this.each(function(f,g){var k=c.objectID(g);r[k]=r[k]||{};c.loop(a,function(a){if("ready"==a)return c(m).ready(d);var f=P(a);f.fun=d;f.selector=b;f.call=function(a){J(a);if(a.isStop||"KS-BTN"===a.target.nodeName&&c(a.target).disabled())return!1;var f=arguments;if(b){var k=E(g,b),h=a.composedPath&&a.composedPath()||a.path;c.loop(h,function(b){c.inArray(b,k)&&!1===d.apply(b,f)&&a.stop()})}else!1===d.apply(g,f)&&a.stop()};r[k][a]=r[k][a]||[];r[k][a].push({callback:d,selector:b,useCapture:!1,handler:f});a=a.replace(/\..*/,"");g.addEventListener(a,f.call,!1)})})};h.off=function(a,b){var d=b?1:0;b=b?b:function(){return!1};a=c.explode(" ",a,"");this.map(function(f){var g=c.objectID(f);c.loop(a,function(a){var k=r[g]&&r[g][a]?r[g][a]:null;a=a.replace(/\..*/,"");if(k){var h=0;c.loop(k,function(c,g){!c||d&&c.callback!==b||(f.removeEventListener(a,c.handler.call,c.useCapture),k[g]=null,h++)});k.length===h&&delete r[g][a]}else f.removeEventListener(a,b,!1),f.removeEventListener(a,b,!0)});c.isset(r[g])&&c.isEmpty(r[g])&&delete r[g]});return this};h.hover=function(a,b){return this.mouseenter(a).mouseleave(b||a)};h.select=function(a){if(c.isset(a)){if(c.isFunction(a))this.on("select",function(b){var c=window.getSelection?window.getSelection().toString():m.selection.createRange().text;a.call(this,b,c)})}else this.map(function(a){c.isFunction(a.select)&&a.select()})};h.touchlong=function(a,b,d){var f,g=0,k=0,h=0,n=0;this.on("touchstart touchmove touchend mousedown mouseup mouseout mouseleave",function(l){if(c.inArray(l.type,["touchstart","mousedown"]))"touchstart"==l.type&&(g=(l.targetTouches?l.targetTouches[0].pageX:l.pageX)||0,k=(l.targetTouches?l.targetTouches[0].pageY:l.pageY)||0),l.stop(),f=setTimeout(function(){l.ksaX=g;l.ksaY=k;a.call(l.target,l);c(m).on("touchmove.touchlong mouseleave.touchlong",function(a){h=(a.targetTouches?a.targetTouches[0].pageX:a.pageX)||0;n=(a.targetTouches?a.targetTouches[0].pageY:a.pageY)||0;a.ksaX=h;a.ksaY=n;b&&b.call(l.target,a)});c(m).on("touchend.touchlong mouseup.touchlong",function(a){m.elementFromPoint(h,n);a.ksaX=h;a.ksaY=n;d&&d.call(l.target,a);c(m).off("touchmove.touchlong mouseleave.touchlong touchend.touchlong mouseup.touchlong")})},400);else if(c.inArray(l.type,["touchmove","mouseleave"])){var p=(l.changedTouches?l.changedTouches[0].pageY:l.pageY)||0;(25<Math.abs(((l.changedTouches?l.changedTouches[0].pageX:l.pageX)||0)-g)||25<Math.abs(p-k))&&clearTimeout(f)}else clearTimeout(f)});return this};h.touch=function(a,b,d,f){var g=0,k=0,h,n,l;this.on("ontouchstart"in m.documentElement?"touchstart touchmove touchend":"mousedown mousemove mouseup",function(q){var m,p,r,t;if(c.inArray(q.type,["touchstart","mousedown"]))g=m=(q.targetTouches?q.targetTouches[0].pageX:q.pageX)||0,k=p=(q.targetTouches?q.targetTouches[0].pageY:q.pageY)||0,a&&a.call("",q,{currentX:m,currentY:p,startX:g,startY:k}),n=!0,l=q.timeStamp;else if(n&&c.inArray(q.type,["touchmove","mousemove"])){if(m=(q.targetTouches?q.targetTouches[0].pageX:q.pageX)||0,p=(q.targetTouches?q.targetTouches[0].pageY:q.pageY)||0,r=m-g,t=p-k,!h&&(8<Math.abs(r)||8<Math.abs(t))&&(h=15>c.rightTriangleAge(r,t).scale?0<r?"right":"left":0<t?"down":"up"),h&&b&&b.call("",q,{action:h,moveX:r,moveY:t,currentX:m,currentY:p,startX:g,startY:k}),!f||"X"===f&&c.inArray(h,["left","right"])||"Y"===f&&c.inArray(h,["up","down"]))return!1}else if(n){m=(q.changedTouches?q.changedTouches[0].pageX:q.pageX)||0;p=(q.changedTouches?q.changedTouches[0].pageY:q.pageY)||0;r=m-g;t=p-k;var u=q.timeStamp-l,v=c.inArray(h,["left","right"]),x=c.inArray(h,["up","down"]),y=Math.abs(r)/c(this).width(!0)*100,z=Math.abs(t)/c(this).height(!0)*100;800<=u&&(v&&50>y||x&&50>z)&&(h="");(!f||"X"===f&&v||"Y"===f&&x)&&d&&d.call("",q,{action:h,moveX:r,moveY:t,currentX:m,currentY:p,startX:g,startY:k,scaleX:y,scaleY:z});k=g=0;n=h=null}});return this};c.Event=function(a){var b;try{b=new Event(a,{bubbles:!0,cancelable:!0})}catch(d){b=m.createEvent("Events"),b.initEvent(a,!0,!0)}J(b);return b};h.addEvent=function(a,b,d,f,g){this.map(function(h){var k=c.Event(a);h.addEventListener(a,b,d);f&&h.dispatchEvent(k);g&&c(h).removeEvent(a,b,d)});return this};h.removeEvent=function(a,b,c){this.map(function(d){d.removeEventListener(a,b,c)})};h.trigger=function(a,b){this.map(function(d){if(c.isFunction(d[a.type]))d[a.type]();else{var f=c.Event(a);f.KSAcallbackArgs=b;d.dispatchEvent(f)}});return this};h.submit=function(a){return a?this.on("submit",a):this.trigger("submit")};c.rightTriangleAge=function(a,b){a=Math.abs(a);b=Math.abs(b);var c=Math.sqrt(a*a+b*b),f=Math.acos((a*a+c*c-b*b)/(2*a*c)),f=parseInt(f/Math.PI*18E5)/1E4;return{scale:f,a:a,b:b,c:c,age:{ab:90,ac:90-f,bc:f}}};c.url=function(a,b){var d=[];a&&(d=a.match(/^((\w+:)?\/\/)?(.+\.\w+)?(:\d+)?([^?#]+)([^#]*)(#.*)?$/i));var f={url:a?a:location.href,origin:a?d[1]||"":location.origin,https:a?d[2]&&"https"===d[2]?!0:!1:location.protocol,host:a?d[3]||"":location.hostname,port:a?d[4]?d[4].substr(1):"":location.port,pathname:a?d[5]||"":location.pathname,search:a?d[6]||"":location.search,paths:[],get:{},hash:a?d[7]?d[7]:"":location.hash};f.get=c.urlGetObject(f.search);d=!1;b&&!c.isEmpty(b)&&(b=c.isString(b)?c.urlGetObject(b):b,d=!0);d&&(f.get=c.arrayMerge(f.get,b),f.search=c.isEmpty(f.get)?"":"?"+c.urlGetString(f.get));f.pathname&&c.loop(f.pathname.split("/"),function(a,b){""!==a&&f.paths.push(a)});d&&(f.url=f.origin+f.host+(f.port?":"+f.port:"")+f.pathname+f.search+f.hash);return f};c.urlAdd=function(a,b){return c.url(a,b).url};c.urlGetObject=function(a){var b={};c.isString(a)&&("?"==a.substr(0,1)&&(a=a.substr(1)),c.loop(a.split("\x26"),function(a){a=a.split("\x3d");a["1"]&&(a["1"]=decodeURIComponent(a["1"]),b[a["0"]]=a["1"])}));return b};c.urlGetString=function(a,b){var d="";if(c.isObject(a)){var f=[];c.loop(a,function(a,c){a===t&&(a="");b&&(a=encodeURIComponent(a));c&&a&&f.push(c+"\x3d"+a)});d=c.implode("\x26",f)}return d};var R=1;c.ajax=function(a){var b=a.type?a.type.toUpperCase():"GET",d=a.header||{},f=a.dataType?a.dataType.toLowerCase():"html",g=a.jsonpCallback||"",h;a.data=a.data?a.data:{};a.data.KAJAX=!0;a.async=a.async===t?!0:a.async;if("jsonp"==f){var p=c.isFunction(g)?"jsonpCallback"+R++:g;window[p]=function(){h=arguments};a.data.jsonpCallback=p;b=m.createElement("script");b.src=c.urlAdd(a.url,a.data);b.type="text/javascript";c(b).on("load",function(b){var d=h[0];c(this).remove();g==p&&(window[g]=window[g]);h&&c.isFunction(g)&&g.call(this,d);"error"==b.type?c.isFunction(a.error)&&a.error.call(this,d):c.isFunction(a.success)&&a.success.call(this,d);a.complete&&a.complete.call(this,d)});m.head.appendChild(b);p=h=null}else{if("POST"==b){if(!(a.data instanceof FormData)){var n=new FormData;c.loop(a.data,function(a,b){c.isObject(a)?c.loop(a,function(a,c){n.append(b+"["+c+"]",a)}):n.append(b,a)});a.data=n;n=""}}else"GET"==b&&(a.url=c.urlAdd(a.url,a.data));var l=new XMLHttpRequest;l.open(b,a.url,a.async);c.loop(d,function(a,b){l.setRequestHeader(b,a)});l.send(a.data);l.onreadystatechange=function(){if(4===l.readyState){var b=l.responseText;200===l.status?("script"===f?(0,eval)(b):"xml"===f?b=l.responseXML:"json"===f&&(b=/^\s*$/.test(b)?null:JSON.parse(b)),c.isFunction(a.success)&&a.success.call(this,b)):c.isFunction(a.error)&&a.error.call(this,b,l.status);a.complete&&a.complete.call(this,b,l.status)}};!1===a.async&&4===l.readyState&&c.isFunction(a.success)&&a.success(l.responseText);0<a.timeout&&setTimeout(function(){l.onreadystatechange=function(){};l.abort();c.isFunction(a.error)&&a.error.call(this,result,l.status);a.complete&&a.complete.call(this,result,l.status)},a.timeout)}};c.getIncludeFunc=function(a){var b=a.callee.toString().match(/^function(\s[^(]+)?\(([^)]+)?\){/);if(b&&b[2]){var d={},b=c.explode(",",b[2],"");c.loop(b,function(b,c){b=b.trim();d[b]=a[c]});return d}};c.setTimeout=function(a,b,c){this.setTimeoutMap||(this.setTimeoutMap={});this.setTimeoutMap[a]&&(window.clearTimeout(this.setTimeoutMap[a]),delete this.setTimeoutMap[a]);this.setTimeoutMap[a]=window.setTimeout(b,c)};var H={};c.autoID=function(a){H[a]||(H[a]=0);return H[a]++};var I=1;c.objectID=function(a,b){var d=c.isset(b),f=""===b;if(a instanceof HTMLElement)return f?c.isset(a._uniqueID_)&&delete a._uniqueID_:d?a._uniqueID_=b:a._uniqueID_||(a._uniqueID_=I++),a._uniqueID_;if(c.isWindow(a))return 0;if(c.isObject(a))if(f)c.isset(a._uniqueID_)&&delete a._uniqueID_;else{if(d)return c.objectID(a),Object.defineProperty(a,"_uniqueID_",{value:b,enumerable:!1,writable:!0}),b;c.isset(a._uniqueID_)||(Object.defineProperty(a,"_uniqueIDFunc_",{value:function(){c.isset(this._uniqueID_)||Object.defineProperty(this,"_uniqueID_",{value:I++,enumerable:!1,writable:!0});return this._uniqueID_},enumerable:!1,writable:!1}),a._uniqueIDFunc_());return a._uniqueID_}else if(c.isFunction(a))if(f)c.isset(a.prototype._uniqueID_)&&delete a.prototype._uniqueID_;else if(d)a.prototype._uniqueID_=b;else return a.prototype._uniqueID_||(a.prototype._uniqueID_=I++),a.prototype._uniqueID_};c.tplSet=function(){Vue.set.apply(Vue,arguments)};c.tplDelete=function(){Vue["delete"].apply(Vue,arguments)};c.tpl=function(a){var b,d;a.el&&(b=c(a.el),d="SCRIPT"===b[0].tagName,a.tpl||(a.tpl=b.html()));a.methods=a.methods?a.methods:{};var f=a.render;delete a.render;return{Template:a.tpl.trim(),el:"",init:function(){this.formatHTML();a.mounted=function(){a.methods.$data=a.data;this.methods=a.methods;a.init&&a.init.call(a,b);a.el=b;this.$nextTick(function(){var d=[].slice.call(this.$el.childNodes);c(this.$el).after(d).remove();f&&f.call(a,b)})};a.el=this.el;return new Vue(a)},formatHTML:function(){var a="\x3cdiv\x3e"+this.Template+"\x3c/div\x3e",a=a.replace(/{{(.*?)}}/g,function(a,b){var c=b.trim(),c=c.replace("\x26lt;","\x3c"),c=c.replace("\x26gt;","\x3e"),c=c.replace("\x26amp;","\x26"),c=c.replace("\x26quot;",'"'),c=c.replace("\x26nbsp;"," ");return"{{"+c+"}}"}),a=a.replace(/{{(((if|loop)(\s+.*?))|(\/(if|loop)))}}/g,function(){var a=arguments;if("/"===a[1].substr(0,1))return"\x3c/template\x3e";a[4]=a[4].trim();return"loop"===a[3]?(a=a[4].split(" "),a[2]?'\x3ctemplate v-for\x3d"('+a[2]+", "+a[1]+") in "+a[0]+'"\x3e':'\x3ctemplate v-for\x3d"'+a[1]+" in "+a[0]+'"\x3e'):'\x3ctemplate v-if\x3d"'+a[4]+'"\x3e'}),a=a.replace(/{{elseif\s(.*?)}}/g,function(a,b){return'\x3c/template\x3e\x3ctemplate v-else-if\x3d"'+b+'"\x3e'}),a=a.replace(/{{else}}/g,function(){return"\x3c/template\x3e\x3ctemplate v-else\x3e"});this.el=m.createRange().createContextualFragment(a).childNodes[0];this.el.style.display="none";d?(b.after(this.el).remove(),b=this.el):b.html(this.el)}}.init()};c.isWindow=function(a){return c.isObject(a)&&a===a.window};c.isDocument=function(a){return c.isObject(a)&&a.nodeType==a.DOCUMENT_NODE};c.isArray=function(a){return c.isObject(a)&&a.constructor==Array};c.isset=function(a,b){return b!==t?-1===a.indexOf(b):"undefined"!==typeof a};c.isTrue=function(a){return!0===a};c.isFalse=function(a){return!1===a};c.isArrayLike=function(a){if(c.isFunction(a)||c.isWindow(a)||c.isString(a)||c.isNumber(a))return!1;var b=!!a&&"length"in a&&a.length;return"array"===typeof a||0===b||"number"===typeof b&&0<b&&b-1 in a};c.isLoop=function(a){var b=!!a&&"length"in a&&a.length;return"array"===typeof a||0===b||"number"===typeof b&&0<b&&b-1 in a};c.isNumber=function(a){var b=typeof a;return("string"===b||"number"===b)&&!isNaN(a)};c.isBool=function(a){return"boolean"===typeof a};c.isObject=function(a){return a&&"object"===typeof a};c.isObjectPlain=function(a){return c.isObject(a)&&!c.isWindow(a)&&Object.getPrototypeOf(a)===Object.prototype};c.isString=function(a){return"string"===typeof a};c.isFunction=function(a){return a&&"function"===typeof a};c.isEmpty=function(a){return c.isObject(a)?0===Object.keys(a).length:""===a||a===t};c.isDomAll=function(a){if(a&&!c.isString(a))return a instanceof HTMLElement||a instanceof Node||a instanceof NodeList||c.isObject(a)&&a.nodeType&&c.isString(a.nodeName)};c.isIndom=function(a){return a&&a instanceof HTMLElement&&!c.inArray(m.compareDocumentPosition(a),[35,37])};c.isNull=function(a){return null===a};c.inArray=function(a,b,d){var f=!1,g=c.isArray(a);c.loop(b,function(b,h){if(g&&c.inArray(b,a)||!g&&a==b)return f=d?h:!0});return f};c.count=function(a){if(c.isObject(a)){var b=0;c.loop(a,function(){b++});return b}return 0};c.arrayMerge=function(){var a=arguments[0]||{};c.loop(arguments,function(b,d){0<d&&c.isObject(b)&&c.loop(b,function(b,c){a[c]=b})});return a};c.toArray=function(a){var b=typeof a;if(c.isArray(a))return a;if("object"===b){if(a instanceof HTMLElement||a instanceof Node)return[a];if(a instanceof NodeList)return[].slice.call(a);if(a instanceof c){var d=[];a.each(function(a,b){d.push(b)});return d}}else return[a]};c.explode=function(a,b,d){b=a&&b?b.toString().split(a):[];if(!b.length)return[];if(c.isset(d)){var f=[];c.loop(b,function(a){a!=d&&f.push(a)});b=f}return b};c.implode=function(a,b){var d="",f="";c.loop(b,function(b){f+=d+b;d=a});return f};c.unset=function(a,b){var d=c.isObject(a)?"object":c.isArray(a)?"array":null;d&&(b=c.explode(" ",b,""),c.loop(a,function(f,g){c.inArray(g,b)&&("object"==d?delete a[g]:a.splice(g,1))}));return a};c.trim=function(a,b){a=a.toString();b?(a=a.replace(new RegExp("^\\"+b+"+","g"),""),a=a.replace(new RegExp("\\"+b+"+$","g"),"")):a=a.trim();return a};c.intval=function(a){return F(a)};c.floatval=function(a){return F(a,!0)};c.strpos=function(a,b,d){a=a.toString();a=0<d?a.substr(d):a;if(c.isArray(b)){var f=!1;c.loop(b,function(b){if(-1!==a.indexOf(b))return f=!0});return f}return-1!==a.indexOf(b)};c.strlen=function(a){return a.toString().length};c.copy=function(a){var b=c(m.createElement("textarea"));c("body").append(b);b.val(a);b[0].select();b.css({position:"absolute"});m.execCommand("Copy");b.remove()};h.focus=function(a){if(a)this.on("focus",a);else this[0]&&this[0].focus();return this};c.loopFieldValue=function(a,b){a=a===t?[]:a;b=b===t?[]:b;var c={};Array.isArray(a)?a.forEach(function(a){Array.isArray(b)?b.forEach(function(b,d){a[b]&&(c[d][a[b]]=a[b])}):a[b]&&(c[a[b]]=a[b])}):"object"===typeof a&&Object.values(a).forEach(function(a){Array.isArray(b)?b.forEach(function(b,d){a[b]&&(c[d][a[b]]=a[b])}):a[b]&&(c[a[b]]=a[b])});return c};c.ArrayFieldValue=function(a,b,c){a=a===t?[]:a;b=b===t?"":b;c=c===t?"":c;var d={};Array.isArray(a)?a.forEach(function(a){a[b]&&a[c]&&(d[a[b]]=a[c])}):"object"===typeof a&&Object.values(a).forEach(function(a){a[b]&&a[c]&&(d[a[b]]=a[c])});return d};c.callStrEvent=function(a,b){a=a.trim();var d=window[a]?window[a]:new Function("return "+a);return d&&c.isArray(b)?d.apply(this,b):d.call(this,b)};c.loop("input blur focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change keydown keypress keyup contextmenu touchstart touchmove touchend".split(" "),function(a){h[a]=function(b,c){return 0<arguments.length?this.on(a,null,b,c):this.trigger(a)}});c(m).on("DOMContentLoaded.ksa",function(){c.loop(G,function(a){a()});G=[];c(m).off("DOMContentLoaded.ksa")});c.extend=c.arrayMerge;h.innerWidth=function(){return this.width(!0)};h.innerHeight=function(){return this.height(!0)};h.outerWidth=function(){return this.width(!0,!0)};h.outerHeight=function(){return this.height(!0,!0)};c.plugin=c.prototype;window.KSA=window.$=c;var x=m.currentScript?m.currentScript:m.scripts[m.scripts.length-1],N=x.src.substr(0,x.src.lastIndexOf("/")+1);c.require=function(a){c.isArray(a)||(a=c.explode(" ",a,""));c.loop(a,function(a){if(a){var b=a.substr(a.lastIndexOf(".")),b=b?b.toLowerCase():b,f=".css"===b;a="module/"+a+(b?"":".js");var g=m.createElement(f?"link":"script");f?(g.href=N+a,g.type="text/css",g.rel="stylesheet",c(x).after(g)):c.ajax({url:N+a,type:"GET",async:!1,dataType:"script",success:function(a){g.text=a;g.type="text/javascript";c(x).after(g);c(g).remove()}})}})};c.require(x.getAttribute("module"));return c})(document);