/*================================================== Copyright (c) 2013-2015 司徒正美 and other contributors http://www.cnblogs.com/rubylouvre/ https://github.com/RubyLouvre http://weibo.com/jslouvre/ Released under the MIT license avalon.js 1.4.7.2 built in 2016.1.22 support IE6+ and other browsers ==================================================*/ (function(e,t){typeof module=="object"&&typeof module.exports=="object"?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("Avalon requires a window with a document");return t(e)}:t(e)})(typeof window!="undefined"?window:this,function(e,t){function u(){e.console&&avalon.config.debug&&Function.apply.call(console.log,console,arguments)}function N(){}function C(e,t){typeof e=="string"&&(e=e.match(c)||[]);var n={},r=t!==void 0?t:1;for(var i=0,s=e.length;i>>0){var n=g.call(e).slice(8,-1);if(/(?:regexp|string|function|window|global)$/i.test(n))return!1;if(n==="Array")return!0;try{return{}.propertyIsEnumerable.call(e,"length")===!1?/^\s?function/.test(e.item||e.callee):!0}catch(r){return!e.window}}return!1}function W(e,t,n){var r="for(var "+e+"i=0,n = this.length; i < n; i++){"+t.replace("_","((i in this) && fn.call(scope,this[i],i,this))")+"}"+n;return Function("fn,scope",r)}function X(e,t){try{while(t=t.parentNode)if(t===e)return!0;return!1}catch(n){return!1}}function V(){return(new XMLSerializer).serializeToString(this)}function G(e){var t={};for(var n in e)t[n]=e[n];var i=t.target=e.srcElement;if(e.type.indexOf("key")===0)t.which=e.charCode!=null?e.charCode:e.keyCode;else if(Q.test(e.type)){var s=i.ownerDocument||r,o=s.compatMode==="BackCompat"?s.body:s.documentElement;t.pageX=e.clientX+(o.scrollLeft>>0)-(o.clientLeft>>0),t.pageY=e.clientY+(o.scrollTop>>0)-(o.clientTop>>0),t.wheelDeltaY=t.wheelDelta,t.wheelDeltaX=0}return t.timeStamp=new Date-0,t.originalEvent=e,t.preventDefault=function(){e.returnValue=!1},t.stopPropagation=function(){e.cancelBubble=!0},t}function tt(e){for(var t in e){if(!m.call(e,t))continue;var n=e[t];typeof tt.plugins[t]=="function"?tt.plugins[t](n):typeof tt[t]=="object"?avalon.mix(tt[t],n):tt[t]=n}return this}function at(e){return(e+"").replace(ut,"\\$&")}function bt(e,t,n){if(Array.isArray(e)){var r=e.concat();e.length=0;var i=Dt(e);return i.pushArray(r),i}if(!e||e.$id&&e.$events||e.nodeType>0&&e.nodeName)return e;var s=Array.isArray(e.$skipArray)?e.$skipArray:[];s.$special=t||{};var o={};n=n||{};var u={},a={},f=[];dt.forEach(function(t){delete e[t]});var l=Object.keys(e);l.forEach(function(t,r){var i=e[t];n[t]=i;if(Lt(t,i,s)){u[t]=[];var o=avalon.type(i);o==="object"&&O(i.get)&&Object.keys(i).length<=2?(r=St(t,i),f.push(r)):h.test(o)?r=xt(t,i,o,u[t],n):r=Et(t,i),a[t]=r}}),o=gt(o,Ot(a),e);for(var c=0;c0?(!l&&!kt(e,t)&&(n.updateValue(this,e),n.notify(this,e,t)),this):(It.collectDependency(this,n),t)}return Ct(n,e),n._value=t,n}function St(e,t){function n(t){var r=n._value,i="_value"in n;if(arguments.length>0){if(l)return this;if(typeof n.set=="function"&&n.oldArgs!==t){n.oldArgs=t;var s=this.$events,o=s[e];s[e]=[],n.set.call(this,t),s[e]=o,t=n.get.call(this),t!==r&&(n.updateValue(this,t),n.notify(this,t,r))}return this}return t=n.get.call(this),n.updateValue(this,t),i&&r!==t&&n.notify(this,t,r),t}return n.set=t.set,n.get=t.get,Ct(n,e),n}function xt(e,t,n,r,i){function s(t){var r=s._value,i=s._vmodel;if(arguments.length>0){if(l)return this;if(n==="array"){var o=i,u=t,a=o.length,c=u.length;o.$lock=!0,a>c?o.splice(c,a-c):c>a&&o.push.apply(o,u.slice(a));var h=Math.min(a,c);for(var p=0;p0)return!1;if(n.indexOf(e)!==-1)return!1;var r=n.$special;return e&&e.charAt(0)==="$"&&!r[e]?!1:!0}function At(e){var t=Object.keys(e.$model?e.$model:e);for(var n=0;n444&&Qt())}function Ut(e){if(e&&e.length){new Date-Xt>444&&typeof e[0]=="object"&&Qt();var t=b.call(arguments,1);for(var n=e.length,r;r=e[--n];){var i=r.element;if(i&&i.parentNode)try{var s=r.evaluator;if(r.$repeat)r.handler.apply(r,t);else if("$repeat"in r||!s)H[r.type](r,r.vmodels);else if(r.type!=="on"){var o=s.apply(0,r.args||[]);r.handler(o,i,r)}}catch(u){console.log(u)}}}}function $t(e,t){return!e.uuid&&!t&&(e.uuid=++zt),e.uuid}function Jt(e,t){var n=e.element;e.uuid||(n.nodeType!==1?e.uuid=e.type+$t(n.parentNode)+"-"+ ++zt:e.uuid=e.name+"-"+$t(n)),Wt[e.uuid]||(e.list=t,e.i=~~e.i,Wt[e.uuid]="__",Wt.push(e))}function Qt(e){var t=Kt||Wt.length,n=0;while(e=Wt[--t])if(e.i<7){if(e.element===null){Wt.splice(t,1),e.list&&(avalon.Array.remove(e.list,e),delete Wt[e.uuid]);continue}if(e.element&&Yt(e.element)){Wt.splice(t,1),avalon.Array.remove(e.list,e),Gt(e);if(n++>500){Kt=t;break}continue}e.i++,e.i===7&&(e.i=14)}else e.i--;Xt=new Date}function Gt(e){delete Wt[e.uuid],e.element=null,e.rollback&&e.rollback();for(var t in e)e[t]=null}function Yt(e){try{var t=e.parentNode.nodeType}catch(n){return!0}return e.ifRemove&&!E.contains(e.ifRemove)&&s===e.parentNode?(e.parentNode&&e.parentNode.removeChild(e),!0):e.msRetain?0:e.nodeType===1?!E.contains(e):!avalon.contains(E,e)}function an(e){var t=e.nodeName;return t.toLowerCase()===t&&e.scopeName&&e.outerText===""}function fn(e){e.currentStyle.behavior!=="url(#default#VML)"&&(e.style.behavior="url(#default#VML)",e.style.display="inline-block",e.style.zoom=1)}function ln(e){return e.replace(/([a-z\d])([A-Z]+)/g,"$1-$2").toLowerCase()}function cn(e){return!e||e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(/[-_][^-_]/g,function(e){return e.charAt(1).toUpperCase()})}function pn(e){if(!("classList"in e)){e.classList={node:e};for(var t in hn)e.classList[t.slice(1)]=hn[t]}return e.classList}function dn(e){try{if(typeof e=="object")return e;e=e==="true"?!0:e==="false"?!1:e==="null"?null:+e+""===e?+e:vn.test(e)?avalon.parseJSON(e):e}catch(t){}return e}function wn(e){return e.window&&e.document?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}function _n(e,t){if(e.offsetWidth<=0){if(Mn.test(En["@:get"](e,"display"))){var n={node:e};for(var r in On)n[r]=e.style[r],e.style[r]=On[r];t.push(n)}var i=e.parentNode;i&&i.nodeType===1&&_n(i,t)}}function Dn(e){var t=e.tagName.toLowerCase();return t==="input"&&/checkbox|radio/.test(e.type)?"checked":t}function Vn(e,t,n,r){var i=[],s=" = "+n+".";for(var o=e.length,u;u=e[--o];)t.hasOwnProperty(u)&&(i.push(u+s+u),r.vars.push(u),r.type==="duplex"&&(e.get=n+"."+u),e.splice(o,1));return i}function $n(e){var t=[],n={};for(var r=0;r-1||e.indexOf("&&")>-1)&&r.vars.forEach(function(t){var n=new RegExp("\\b"+t+"(?:\\.\\w+|\\[\\w+\\])+","ig");e=e.replace(n,function(n,r){var i=n.charAt(t.length),s=e.slice(r+n.length),o=/^\s*\(/.test(s);if(i==="."||i==="["||o){var u="var"+String(Math.random()).replace(/^0\./,"");if(o){var a=n.split(".");if(a.length>2){var l=a.pop();return f.push(u+" = "+a.join(".")),u+"."+l}return n}return f.push(u+" = "+n),u}return n})}),r.args=c,delete r.vars;var m=Jn.get(o);if(m){r.evaluator=m;return}h=f.join(", "),h&&(h="var "+h);if(/\S/.test(s)){if(!/text|html/.test(r.type))throw Error("ms-"+r.type+"不支持过滤器");e="\nvar ret"+n+" = "+e+";\r\n",e+=nr("ret"+n,s);try{m=Function.apply(N,l.concat("\n"+h+e)),r.evaluator=Jn.put(o,function(){return m.apply(avalon,arguments)})}catch(g){u("debug: parse error,"+g.message)}a=f=l=null;return}if(i==="duplex"){var y="\nreturn function(vvv){\n "+h+";\n if(!arguments.length){\n return "+e+"\n }\n "+(Kn.test(e)?e:a.get)+"= vvv;\n} ";try{m=Function.apply(N,l.concat(y)),r.evaluator=Jn.put(o,m)}catch(g){u("debug: parse error,"+g.message)}a=f=l=null;return}if(i==="on"){e.indexOf("(")===-1?e+=".call(this, $event)":e=e.replace("(",".call(this,"),l.push("$event"),e="\nreturn "+e+";";var b=e.lastIndexOf("\nreturn"),w=e.slice(0,b),E=e.slice(b);e=w+"\n"+E}else e="\nreturn "+e+";";try{m=Function.apply(N,l.concat("\n"+h+e)),r.evaluator=Jn.put(o,m)}catch(g){u("debug: parse error,"+g.message)}a=f=l=null}function ir(e){var t=it.test(e);if(t){var n=jr(e);return n.length===1?n[0].value:n.map(function(e){return e.expr?"("+e.value+")":jn(e.value)}).join(" + ")}return e}function sr(e,t,n,r){e=e||"",rr(e,t,n),n.evaluator&&!r&&(n.handler=B[n.handlerName||n.type],avalon.injectBinding(n))}function ur(e,t,n){var r=setTimeout(function(){var i=e.innerHTML;clearTimeout(r),i===n?t():ur(e,t,i)})}function ar(e,t){var n=e.getAttribute("avalonctrl")||t.$id;e.setAttribute("avalonctrl",n),t.$events.expr=e.tagName+'[avalonctrl="'+n+'"]'}function lr(e,t){for(var n=0,r;r=e[n++];)r.vmodels=t,H[r.type](r,t),r.evaluator&&r.element&&r.element.nodeType===1&&r.element.removeAttribute(r.name);e.length=0}function gr(e,t){return e.priority-t.priority}function yr(e,t,n){var r=!0;if(t.length){var i=Cr?Cr(e):e.attributes,s=[],o=[],a={},f={};for(var l=0,c;c=i[l++];)if(c.specified)if(n=c.name.match(pr)){var h=n[1],p=n[2]||"",d=c.value,v=c.name;if(f[v])continue;f[v]=1,vr[h]?(p=h,h="on"):mr[h]&&(h==="enabled"&&(u("warning!ms-enabled或ms-attr-enabled已经被废弃"),h="disabled",d="!("+d+")"),p=h,h="attr",v="ms-"+h+"-"+p,o.push([c.name,v,d])),a[v]=d;if(typeof H[h]=="function"){var m=d.replace(hr,""),g=d!==m,y={type:h,param:p,element:e,name:v,value:m,oneTime:g,uuid:v+"-"+$t(e),priority:(dr[h]||h.charCodeAt(0)*10)+(Number(p.replace(/\D/g,""))||0)};if(h==="html"||h==="text"){var b=Br(d);avalon.mix(y,b),y.filters=y.filters.replace(Or,function(){return y.type="html",y.group=1,""})}else if(h==="duplex")var w=v;else v==="ms-if-loop"&&(y.priority+=100);s.push(y),h==="widget"&&(e.msData=e.msData||a)}}if(s.length){s.sort(gr),o.forEach(function(t){u("warning!请改用"+t[1]+"代替"+t[0]+"!"),e.removeAttribute(t[0]),e.setAttribute(t[1],t[2])}),w&&a["ms-attr-value"]&&!e.scopeName&&e.type==="text"&&u("warning!一个控件不能同时定义ms-attr-value与"+w);for(l=0;y=s[l];l++){h=y.type;if(br.test(h))return lr(s.slice(0,l+1),t);r&&(r=!wr.test(h))}lr(s,t)}}r&&!or[e.tagName]&&ot.test(e.innerHTML.replace(_r,"<").replace(Dr,">"))&&(cr&&cr(e),kr(e,t))}function kr(e,t){var n=avalon.slice(e.childNodes);Lr(n,t)}function Lr(e,t){for(var n=0,r;r=e[n++];)switch(r.nodeType){case 1:Ar(r,t),r.msCallback&&(r.msCallback(),r.msCallback=void 0);break;case 3:it.test(r.nodeValue)&&Fr(r,t,n)}}function Ar(e,t,n){var r=e.getAttribute("ms-skip");if(!e.getAttributeNode)return u("warning "+e.tagName+" no getAttributeNode method");var i=e.getAttributeNode("ms-important"),s=e.getAttributeNode("ms-controller");if(typeof r=="string")return;if(n=i||s){var o=avalon.vmodels[n.value];if(!o)return;t=n===i?[o]:[o].concat(t);var a=n.name;e.removeAttribute(a),avalon(e).removeClass(a),ar(e,o)}yr(e,t)}function Br(e){if(e.indexOf("|")>0){var t=e.replace(Pr,function(e){return Array(e.length+1).join("1")}),n=t.replace(Mr,"??").indexOf("|");if(n>-1)return{filters:e.slice(n),value:e.slice(0,n),expr:!0}}return{value:e,filters:"",expr:!0}}function jr(e){var t=[],n,r=0,i;do{i=e.indexOf(nt,r);if(i===-1)break;n=e.slice(r,i),n&&t.push({value:n,filters:"",expr:!1}),r=i+nt.length,i=e.indexOf(rt,r);if(i===-1)break;n=e.slice(r,i),n&&t.push(Br(n.replace(Hr,""))),r=i+rt.length}while(1);return n=e.slice(r),n&&t.push({value:n,expr:!1,filters:""}),t}function Fr(e,t){var n=[],i=jr(e.data);if(i.length){for(var s=0,o;o=i[s++];){var u=r.createTextNode(o.value);o.expr&&(o.value=o.value.replace(hr,function(){return o.oneTime=!0,""}),o.type="text",o.element=u,o.filters=o.filters.replace(Or,function(e,t,n){return o.type="html",""}),n.push(o)),S.appendChild(u)}e.parentNode.replaceChild(S,e),n.length&&lr(n,t)}}function $r(e,t,n){var i=e.templateCache&&e.templateCache[t];if(i){var s=r.createDocumentFragment(),o;while(o=i.firstChild)s.appendChild(o);return s}return avalon.parseHTML(n)}function Kr(e){return e==null?"":e}function Qr(e,t,n,r){return t.param.replace(/\w+/g,function(r){var i=avalon.duplexHooks[r];i&&typeof i[n]=="function"&&(e=i[n](e,t))}),e}function Zr(){for(var e=Yr.length-1;e>=0;e--){var t=Yr[e];t()===!1&&Yr.splice(e,1)}Yr.length||clearInterval(Gr)}function ni(e){var t=NaN,n=NaN;if(e.setSelectionRange)t=e.selectionStart,n=e.selectionEnd;else{var r=document.selection.createRange();t=0-r.duplicate().moveStart("character",-1e5),n=t+r.text.length}return{start:t,end:n}}function ri(e,t,n){if(!e.value||e.readOnly)return;if(e.createTextRange){var r=e.createTextRange();r.collapse(!0),r.moveStart("character",t),r.select()}else e.selectionStart=t,e.selectionEnd=n}function si(e,t,n,i){var s=e.template.cloneNode(!0),o=avalon.slice(s.childNodes);s.insertBefore(r.createComment(e.signature),s.firstChild),t.appendChild(s);var u=[n].concat(e.vmodels),a={nodes:o,vmodels:u};i.push(a)}function oi(e){var t=[],n=e.element.parentNode.childNodes;for(var r=0,i;i=n[r++];)if(i.nodeValue===e.signature)t.push(i);else if(i.nodeValue===e.signature+":end")break;return t}function ui(e,t,n){for(;;){var r=t.previousSibling;if(!r)break;r.parentNode.removeChild(r),n&&n.call(r);if(r===e)break}}function fi(){var e=bt({$key:"",$outer:{},$host:{},$val:{get:function(){return this.$host[this.$key]},set:function(e){this.$host[this.$key]=e}}},{$val:1});return e.$id=k("$proxy$with"),e}function li(e,t,n){e=e||ai.pop(),e?e.$reinitialize():e=fi();var r=n.$repeat;return e.$key=t,e.$host=r,e.$outer=n.$outer,r.$events?e.$events.$val=r.$events[t]:e.$events={},e}function ci(e){hi(e)}function hi(e){e.forEach(function(e){mi(e,pi)}),e.length=0}function di(e){var t={$host:[],$outer:{},$index:0,$first:!1,$last:!1,$remove:avalon.noop};t[e]={get:function(){var t=this.$events,n=t.$index;t.$index=t[e];try{return this.$host[this.$index]}finally{t.$index=n}},set:function(e){try{var t=this.$events,n=t.$index;t.$index=[],this.$host.set(this.$index,e)}finally{t.$index=n}}};var n={$last:1,$first:1,$index:1},r=bt(t,n);return r.$id=k("$proxy$each"),r}function vi(e,t){var n=t.param||"el",r;for(var i=0,s=pi.length;itt.maxRepeatSize&&t.pop()}function gi(e,t){var n="_"+e;if(!gi[n]){var i=r.createElement(e);E.appendChild(i),w?t=getComputedStyle(i,null).display:t=i.currentStyle.display,E.removeChild(i),gi[n]=t}return gi[n]}function Ni(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var i=isFinite(+e)?+e:0,s=isFinite(+t)?Math.abs(t):3,o=r||",",u=n||".",a="",f=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return a=(s?f(i,s):""+Math.round(i)).split("."),a[0].length>3&&(a[0]=a[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(a[1]||"").length.avalonHide{ display: none!important }",s.setAttribute("ms-skip","1"),s.className="avalonHide";var o=/\[native code\]/,f="$"+n,l=!1,c=/[^, ]+/g,h=/^(?:object|array)$/,p=/^\[object SVG\w*Element\]$/,d=/^\[object (?:Window|DOMWindow|global)\]$/,v=Object.prototype,m=v.hasOwnProperty,g=v.toString,y=Array.prototype,b=y.slice,w=e.dispatchEvent,E=r.documentElement,S=r.createDocumentFragment(),x=r.createElement("div"),T={};"Boolean Number String Function Array Date RegExp Object Error".replace(c,function(e){T["[object "+e+"]"]=e.toLowerCase()});var k=function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(/\d\.\d{4}/,e)},A=L();avalon=function(e){return new avalon.init(e)},avalon.profile=function(){e.console&&avalon.config.profile&&Function.apply.call(console.log,console,arguments)},avalon.nextTick=new function(){function o(){var e=s.length;for(var t=0;t=0;r--)if(this[r]===e)return r;return-1},forEach:W("","_",""),filter:W("r=[],j=0,","if(_)r[j++]=this[i]","return r"),map:W("r=[],","r[i]=_","return r"),some:W("","if(_)return true","return false"),every:W("","if(!_)return false","return true")}),avalon.contains=X,r.contains||(r.contains=function(e){return X(r,e)});if(e.SVGElement){r.createTextNode("x").contains||(Node.prototype.contains=function(e){return!!(this.compareDocumentPosition(e)&16)});var $="http://www.w3.org/2000/svg",J=r.createElementNS($,"svg");J.innerHTML='';if(!p.test(J.firstChild)){function K(e,t){if(e&&e.childNodes){var n=e.childNodes;for(var i=0,s;s=n[i++];)if(s.tagName){var o=r.createElementNS($,s.tagName.toLowerCase());y.forEach.call(s.attributes,function(e){o.setAttribute(e.name,e.value)}),K(s,o),t.appendChild(o)}}}Object.defineProperties(SVGElement.prototype,{outerHTML:{enumerable:!0,configurable:!0,get:V,set:function(e){var t=this.tagName.toLowerCase(),n=this.parentNode,i=avalon.parseHTML(e);if(t==="svg")n.insertBefore(i,this);else{var s=r.createDocumentFragment();K(i,s),n.insertBefore(s,this)}n.removeChild(this)}},innerHTML:{enumerable:!0,configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);K(t,this)}}}})}}!E.outerHTML&&e.HTMLElement&&HTMLElement.prototype.__defineGetter__("outerHTML",V);var Q=/^(?:mouse|contextmenu|drag)|click/,Y=avalon.eventHooks;"onmouseenter"in E||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Y[e]={type:t,fn:function(t,n){return function(r){var i=r.relatedTarget;if(!i||i!==t&&!(t.compareDocumentPosition(i)&16))return delete r.type,r.type=e,n.call(t,r)}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(t,n){e[t]&&!Y.animationend&&(Y.animationend={type:n})}),"oninput"in r.createElement("input")||(Y.input={type:"propertychange",fn:function(e,t){return function(n){if(n.propertyName==="value")return n.type="input",t.call(e,n)}}});if(r.onmousewheel===void 0){var Z=r.onwheel!==void 0?"wheel":"DOMMouseScroll",et=Z==="wheel"?"deltaY":"detail";Y.mousewheel={type:Z,fn:function(e,t){return function(n){n.wheelDeltaY=n.wheelDelta=n[et]>0?-120:120,n.wheelDeltaX=0,Object.defineProperty&&Object.defineProperty(n,"type",{value:"mousewheel"}),t.call(e,n)}}}}var nt,rt,it,st,ot,ut=/[-.*+?^${}()|[\]\/\\]/g,ft={interpolate:function(e){nt=e[0],rt=e[1];if(nt===rt)throw new SyntaxError("openTag===closeTag");var t=nt+"test"+rt;x.innerHTML=t;if(x.innerHTML!==t&&x.innerHTML.indexOf("<")>-1)throw new SyntaxError("此定界符不合法");tt.openTag=nt,tt.closeTag=rt,x.innerHTML="";var n=at(nt),r=at(rt);it=new RegExp(n+"([\\s\\S]*)"+r),st=new RegExp(n+"([\\s\\S]*)"+r,"g"),ot=new RegExp(n+"[\\s\\S]*"+r+"|\\sms-")}};tt.debug=!0,tt.plugins=ft,tt.plugins.interpolate(["{{","}}"]),tt.paths={},tt.shim={},tt.maxRepeatSize=100,avalon.config=tt;var lt=/(\w+)\[(avalonctrl)="(\S+)"\]/,ct=r.querySelectorAll?function(e){return r.querySelectorAll(e)}:function(e){var t=e.match(lt),n=r.getElementsByTagName(t[1]),i=[];for(var s=0,o;o=n[s++];)o.getAttribute(t[2])===t[3]&&i.push(o);return i},ht={$watch:function(e,t){if(typeof t=="function"){var n=this.$events[e];n?n.push(t):this.$events[e]=[t]}else this.$events=this.$watch.backup;return this},$unwatch:function(e,t){var n=arguments.length;if(n===0)this.$watch.backup=this.$events,this.$events={};else if(n===1)this.$events[e]=[];else{var r=this.$events[e]||[],i=r.length;while(~--i<0)if(r[i]===t)return r.splice(i,1)}return this},$fire:function(e){var t,n,i,s;/^(\w+)!(\S+)$/.test(e)&&(t=RegExp.$1,e=RegExp.$2);var o=this.$events;if(!o)return;var u=b.call(arguments,1),a=[e].concat(u);if(t==="all")for(n in avalon.vmodels)i=avalon.vmodels[n],i!==this&&i.$fire.apply(i,a);else if(t==="up"||t==="down"){var f=o.expr?ct(o.expr):[];if(f.length===0)return;for(n in avalon.vmodels){i=avalon.vmodels[n];if(i!==this&&i.$events.expr){var l=ct(i.$events.expr);if(l.length===0)continue;y.forEach.call(l,function(e){y.forEach.call(f,function(n){var r=t==="down"?n.contains(e):e.contains(n);r&&(e._avalon=i)})})}}var c=r.getElementsByTagName("*"),h=[];y.forEach.call(c,function(e){e._avalon&&(h.push(e._avalon),e._avalon="",e.removeAttribute("_avalon"))}),t==="up"&&h.reverse();for(n=0;s=h[n++];)if(s.$fire.apply(s,a)===!1)break}else{var p=o[e]||[],d=o.$all||[];for(n=0;s=p[n++];)O(s)&&s.apply(this,u);for(n=0;s=d[n++];)O(s)&&s.apply(this,arguments)}}},pt=avalon.vmodels={};avalon.define=function(e,t){var n=e.$id||e;n||u("warning: vm必须指定$id"),pt[n]&&u("warning: "+n+" 已经存在于avalon.vmodels中");if(typeof e=="object")var r=bt(e);else{var i={$watch:N};t(i),r=bt(i),l=!0,t(r),l=!1}return r.$id=n,pt[n]=r};var dt=String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray,$reinitialize").match(c),vt=Object.defineProperty,mt=!0;try{vt({},"_",{value:"x"});var gt=Object.defineProperties}catch(yt){mt=!1}var kt=Object.is||function(e,t){return e===0&&t===0?1/e===1/t:e!==e?t!==t:e===t},Ot=w?function(e){var t={};for(var n in e)t[n]={get:e[n],set:e[n],enumerable:!0,configurable:!0};return t}:function(e){return e};if(!mt){"__defineGetter__"in avalon&&(vt=function(e,t,n){return"value"in n&&(e[t]=n.value),"get"in n&&e.__defineGetter__(t,n.get),"set"in n&&e.__defineSetter__(t,n.set),e},gt=function(e,t){for(var n in t)t.hasOwnProperty(n)&&vt(e,n,t[n]);return e});if(A){var Mt={};e.execScript(["Function parseVB(code)"," ExecuteGlobal(code)","End Function"].join("\n"),"VBScript");function _t(e,t,n,r){var i=t[n];if(arguments.length!==4)return i.call(e);i.call(e,r)}gt=function(t,r,i){var s=[];s.push("\r\n Private [__data__], [__proxy__]"," Public Default Function [__const__](d"+n+", p"+n+")"," Set [__data__] = d"+n+": set [__proxy__] = p"+n," Set [__const__] = Me"," End Function");for(t in i)r.hasOwnProperty(t)||s.push(" Public ["+t+"]");dt.forEach(function(e){r.hasOwnProperty(e)||s.push(" Public ["+e+"]")}),s.push(" Public [hasOwnProperty]");for(t in r)s.push(" Public Property Let ["+t+"](val"+n+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+n+")"," End Property"," Public Property Set ["+t+"](val"+n+")",' Call [__proxy__](Me,[__data__], "'+t+'", val'+n+")"," End Property"," Public Property Get ["+t+"]"," On Error Resume Next"," Set["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," If Err.Number <> 0 Then"," ["+t+'] = [__proxy__](Me,[__data__],"'+t+'")'," End If"," On Error Goto 0"," End Property");s.push("End Class");var o=s.join("\r\n"),u=Mt[o];u||(u=k("VBClass"),e.parseVB("Class "+u+o),e.parseVB(["Function "+u+"Factory(a, b)"," Dim o"," Set o = (New "+u+")(a, b)"," Set "+u+"Factory = o","End Function"].join("\r\n")),Mt[o]=u);var a=e[u+"Factory"](r,_t);return a}}}var Ht=y.splice,Bt={_splice:Ht,_fire:function(e,t,n){Ut(this.$events[f],e,t,n)},size:function(){return this._.length},pushArray:function(e){var t=e.length,n=this.length;return t&&(y.push.apply(this.$model,e),Pt.call(this,"add",n,t,Math.max(0,n-1))),t+n},push:function(){var e=[],t,n=arguments.length;for(t=0;t2&&(r?n.splice(3,1,0,"add",e,t-2):n.push("add",e,t-2,0),r=!0),r?Pt.apply(this,n):[]},contains:function(e){return this.indexOf(e)!==-1},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>=0?(this.$model.splice(e,1),Pt.call(this,"del",e,1,0)):[]},clear:function(){return this.$model.length=this.length=this._.length=0,this._fire("clear",0),this},removeAll:function(e){if(Array.isArray(e))for(var t=this.length-1;t>=0;t--)e.indexOf(this[t])!==-1&&this.removeAt(t);else if(typeof e=="function")for(t=this.length-1;t>=0;t--){var n=this[t];e(n,t)&&this.removeAt(t)}else this.clear()},ensure:function(e){return this.contains(e)||this.push(e),this},set:function(e,t){if(e-1){var n=avalon.type(t);t&&t.$model&&(t=t.$model);var r=this[e];if(n==="object")for(var i in t)r.hasOwnProperty(i)&&(r[i]=t[i]);else n==="array"?r.clear().push.apply(r,t):r!==t&&(this[e]=t,this.$model[e]=t,this._fire("set",e,t))}return this}};"sort,reverse".replace(c,function(e){Bt[e]=function(){var t=this.$model,n=t.concat(),r=Math.random(),i=[],s;y[e].apply(t,arguments);for(var o=0,u=n.length;o",""],param:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],option:[1,""],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],g:[1,'',""],_default:w?[0,"",""]:[1,"X
","
"]};Zt.th=Zt.td,Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(c,function(e){Zt[e]=Zt.g});var en=/<([\w:]+)/,tn=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,nn=w?/[^\d\D]/:/(<(?:script|link|style|meta|noscript))/ig,rn=C(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]),sn=/<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/,on=r.createElement("script"),un=/<|&#?\w+;/;avalon.parseHTML=function(e){var t=S.cloneNode(!1);if(typeof e!="string")return t;if(!un.test(e))return t.appendChild(r.createTextNode(e)),t;e=e.replace(tn,"<$1>").trim();var n=(en.exec(e)||["",""])[1].toLowerCase(),i=Zt[n]||Zt._default,s=x,o,u;w||(e=e.replace(nn,"
$1")),s.innerHTML=i[1]+e+i[2];var a=s.getElementsByTagName("script");if(a.length)for(var f=0,l;l=a[f++];)rn[l.type]&&(u=on.cloneNode(!1),y.forEach.call(l.attributes,function(e){e&&e.specified&&(u[e.name]=e.value,u.setAttribute(e.name,e.value))}),u.text=l.text,l.parentNode.replaceChild(u,l));if(!w){var c=i[1]==="X
"?s.lastChild.firstChild:s.lastChild;if(c&&c.tagName==="TABLE"&&n!=="tbody")for(a=c.childNodes,f=0;l=a[f++];)if(l.tagName==="TBODY"&&!l.innerHTML){c.removeChild(l);break}a=s.getElementsByTagName("br");var h=a.length;while(l=a[--h])l.className==="msNoScope"&&l.parentNode.removeChild(l);for(a=s.all,f=0;l=a[f++];)an(l)&&fn(l)}for(f=i[0];f--;s=s.lastChild);while(o=s.firstChild)t.appendChild(o);return t},avalon.innerHTML=function(e,t){if(!w&&!nn.test(t)&&!sn.test(t))try{e.innerHTML=t;return}catch(n){}var r=this.parseHTML(t);this.clearHTML(e).appendChild(r)},avalon.clearHTML=function(e){e.textContent="";while(e.firstChild)e.removeChild(e.firstChild);return e};var hn={_toString:function(){var e=this.node,t=e.className,n=typeof t=="string"?t:t.baseVal;return n.split(/\s+/).join(" ")},_contains:function(e){return(" "+this+" ").indexOf(" "+e+" ")>-1},_add:function(e){this.contains(e)||this._set(this+" "+e)},_remove:function(e){this._set((" "+this+" ").replace(" "+e+" "," "))},__set:function(e){e=e.trim();var t=this.node;p.test(t)?t.setAttribute("class",e):t.className=e}};"add,remove".replace(c,function(e){avalon.fn[e+"Class"]=function(t){var n=this[0];return t&&typeof t=="string"&&n&&n.nodeType===1&&t.replace(/\S+/g,function(t){pn(n)[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return t.nodeType===1&&pn(t).contains(e)},toggleClass:function(e,t){var n,r=0,i=String(e).split(/\s+/),s=typeof t=="boolean";while(n=i[r++]){var o=s?t:!this.hasClass(n);this[o?"addClass":"removeClass"](n)}return this},attr:function(e,t){return arguments.length===2?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},data:function(e,t){e="data-"+ln(e||"");switch(arguments.length){case 2:return this.attr(e,t),this;case 1:var n=this.attr(e);return dn(n);case 0:var r={};return y.forEach.call(this[0].attributes,function(t){t&&(e=t.name,e.indexOf("data-")||(e=cn(e.slice(5)),r[e]=dn(t.value)))}),r}},removeData:function(e){return e="data-"+ln(e),this[0].removeAttribute(e),this},css:function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var r=avalon.css(this,e,t);return r!==void 0?r:this},position:function(){var e,t,n=this[0],r={top:0,left:0};if(!n)return;return this.css("position")==="fixed"?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),e[0].tagName!=="HTML"&&(r=e.offset()),r.top+=avalon.css(e[0],"borderTopWidth",!0),r.left+=avalon.css(e[0],"borderLeftWidth",!0),r.top-=e.scrollTop(),r.left-=e.scrollLeft()),{top:t.top-r.top-avalon.css(n,"marginTop",!0),left:t.left-r.left-avalon.css(n,"marginLeft",!0)}},offsetParent:function(){var e=this[0].offsetParent;while(e&&avalon.css(e,"position")==="static")e=e.offsetParent;return avalon(e||E)},bind:function(e,t,n){if(this[0])return avalon.bind(this[0],e,t,n)},unbind:function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},val:function(e){var t=this[0];if(t&&t.nodeType===1){var n=arguments.length===0,r=n?":get":":set",i=Hn[Dn(t)+r];if(i)var s=i(t,e);else{if(n)return(t.value||"").replace(/\r/g,"");t.value=e}}return n?s:this}});var vn=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mn=/^[\],:{}\s]*$/,gn=/(?:^|:|,)(?:\s*\[)+/g,yn=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,bn=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;avalon.parseJSON=e.JSON?JSON.parse:function(e){if(typeof e=="string"){e=e.trim();if(e&&mn.test(e.replace(yn,"@").replace(bn,"]").replace(gn,"")))return(new Function("return "+e))();avalon.error("Invalid JSON: "+e)}return e},avalon.fireDom=function(e,t,n){if(r.createEvent){var i=r.createEvent("Events");i.initEvent(t,!0,!0),avalon.mix(i,n),e.dispatchEvent(i)}else try{i=r.createEventObject(),avalon.mix(i,n),e.fireEvent("on"+t,i)}catch(s){}},avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var r=this[0]||{},i=wn(r),s=e==="scrollTop";if(!arguments.length)return i?t in i?i[t]:E[e]:r[e];i?i.scrollTo(s?avalon(i).scrollLeft():n,s?n:avalon(i).scrollTop()):r[e]=n}});var En=avalon.cssHooks={},Sn=["","-webkit-","-o-","-moz-","-ms-"],xn={"float":w?"cssFloat":"styleFloat"};avalon.cssNumber=C("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(xn[e])return xn[e];t=t||E.style;for(var r=0,i=Sn.length;r]+))?)*\s+value[\s=]/i,Hn={"option:get":A?function(e){return Pn.test(e.outerHTML)?e.value:e.text.trim()}:function(e){return e.value},"select:get":function(e,t){var n,r=e.options,i=e.selectedIndex,s=Hn["option:get"],o=e.type==="select-one"||i<0,u=o?null:[],a=o?i+1:r.length,f=i<0?a:o?i:0;for(;f-1)n=!0;n||(e.selectedIndex=-1)}},Bn={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},jn=e.JSON&&JSON.stringify||function(e){return'"'+e.replace(/[\\\"\x00-\x1f]/g,function(e){var t=Bn[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"'},Fn=["break,case,catch,continue,debugger,default,delete,do,else,false","finally,for,function,if,in,instanceof,new,null,return,switch,this","throw,true,try,typeof,var,void,while,with","abstract,boolean,byte,char,class,const,double,enum,export,extends","final,float,goto,implements,import,int,interface,long,native","package,private,protected,public,short,static,super,synchronized","throws,transient,volatile","arguments,let,yield,undefined"].join(","),In=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g,qn=/[^\w$]+/g,Rn=new RegExp(["\\b"+Fn.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),Un=/\b\d[^,]*/g,zn=/^,+|,+$/g,Wn=new F(512),Xn=function(e){var t=","+e.trim(),n=Wn.get(t);if(n)return n;var r=e.replace(In,"").replace(qn,",").replace(Rn,"").replace(Un,"").replace(zn,"").split(/^$|,+/);return Wn.put(t,$n(r))},Jn=new F(128),Kn=/\w\[.*\]|\w\.\w/,Qn=/(\$proxy\$[a-z]+)\d+$/,Gn=/\)\s*$/,Yn=/\)\s*\|/g,Zn=/\|\s*([$\w]+)/g,er=/"\s*\["/g,tr=/"\s*\(/g;avalon.parseExprProxy=sr,avalon.scan=function(e,t){e=e||E;var n=t?[].concat(t):[];Ar(e,n)};var or=C("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase()),fr=function(e,t,n){var r=e.getAttribute(t);if(r)for(var i=0,s;s=n[i++];)if(s.hasOwnProperty(r)&&typeof s[r]=="function")return s[r]},cr=A&&e.MutationObserver?function(e){var t=e.firstChild,n;while(t){var r=t.nextSibling;t.nodeType===3?n?(n.nodeValue+=t.nodeValue,e.removeChild(t)):n=t:n=null,t=r}}:0,hr=/^\s*::/,pr=/ms-(\w+)-?(.*)/,dr={"if":10,repeat:90,data:100,widget:110,each:1400,"with":1500,duplex:2e3,on:3e3},vr=C("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit"),mr=C("value,title,alt,checked,selected,disabled,readonly,enabled"),br=/^if|widget|repeat$/,wr=/^each|with|html|include$/;if(!w)var Er=new F(512),Sr=/\s+(ms-[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,xr=/^['"]/,Tr=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,Nr=/&/g,Cr=function(e){var t=e.outerHTML;if(t.slice(0,2)===""&&(n=n.slice(0,-1));var r=[],i,s,o,u=Er.get(n);if(u)return u;while(s=Sr.exec(n)){o=s[2],o&&(o=(xr.test(o)?o.slice(1,-1):o).replace(Nr,"&"));var a=s[1].toLowerCase(),f={name:a,specified:!0,value:o||""};r.push(f)}return Er.put(n,r)};var Or=/\|\s*html(?:\b|$)/,Mr=/\|\|/g,_r=/</g,Dr=/>/g,Pr=/(['"])(\\\1|.)+?\1/g,Hr=/\r?\n/g,Ir=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected","contentEditable,isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(","),qr={};Ir.replace(c,function(e){qr[e.toLowerCase()]=e});var Rr={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},Ur=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight","rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");Ur.replace(c,function(e){Rr[e.toLowerCase()]=e});var zr=/(?:[\s\S]+?)<\/noscript>/img,Wr=/([\s\S]+?)<\/noscript>/im,Xr=function(){return new(e.XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP")},Vr=avalon.templateCache={};H.attr=function(e,t){var n=ir(e.value.trim());if(e.type==="include"){var i=e.element;e.includeRendered=fr(i,"data-include-rendered",t),e.includeLoaded=fr(i,"data-include-loaded",t);var s=e.includeReplace=!!avalon(i).data("includeReplace");avalon(i).data("includeCache")&&(e.templateCache={}),e.startInclude=r.createComment("ms-include"),e.endInclude=r.createComment("ms-include-end"),s?(e.element=e.startInclude,i.parentNode.insertBefore(e.startInclude,i),i.parentNode.insertBefore(e.endInclude,i.nextSibling)):(i.insertBefore(e.startInclude,i.firstChild),i.appendChild(e.endInclude))}e.handlerName="attr",sr(n,t,e)},B.attr=function(t,n,i){var o=i.type,u=i.param;if(o==="css")avalon(n).css(u,t);else if(o==="attr"){var a=t===!1||t===null||t===void 0;!w&&Rr[u]&&(u=Rr[u]);var f=qr[u];typeof n[f]=="boolean"&&(n[f]=!!t,t||(a=!0));if(a)return n.removeAttribute(u);var l=p.test(n)?!1:r.namespaces&&an(n)?!0:u in n.cloneNode(!1);l?n[u]=t+"":n.setAttribute(u,t)}else if(o==="include"&&t){var c=i.vmodels,h=i.includeRendered,d=i.includeLoaded,v=i.includeReplace,m=v?n.parentNode:n,g=function(e){if(i.vmodels===null)return;if(d){var n=d.apply(m,[e].concat(c));typeof n=="string"&&(e=n)}h&&ur(m,function(){h.call(m)},NaN);var o=i.includeLastID;if(i.templateCache&&o&&o!==t){var u=i.templateCache[o];u||(u=i.templateCache[o]=r.createElement("div"),s.appendChild(u))}i.includeLastID=t;while(i.startInclude){var a=i.startInclude.nextSibling;if(!a||a===i.endInclude)break;m.removeChild(a),u&&u.appendChild(a)}var f=$r(i,t,e),l=avalon.slice(f.childNodes);m.insertBefore(f,i.endInclude),Lr(l,c)};if(i.param==="src")if(typeof Vr[t]=="string")avalon.nextTick(function(){g(Vr[t])});else if(Array.isArray(Vr[t]))Vr[t].push(g);else{var y=Xr();y.onreadystatechange=function(){if(y.readyState===4){var e=y.status;if(e>=200&&e<300||e===304||e===1223){var n=y.responseText;for(var r=0,i;i=Vr[t][r++];)i(n);Vr[t]=n}}},Vr[t]=[g],y.open("GET",t,!0),"withCredentials"in y&&(y.withCredentials=!0),y.setRequestHeader("X-Requested-With","XMLHttpRequest"),y.send(null)}else{var b=t&&t.nodeType===1?t:r.getElementById(t);if(b){if(b.tagName==="NOSCRIPT"&&!b.innerHTML&&!b.fixIE78){y=Xr(),y.open("GET",location,!1),y.send(null);var S=r.getElementsByTagName("noscript"),x=(y.responseText||"").match(zr)||[],T=x.length;for(var N=0;N-1},i(w?"change":"click",p);else{var v=e.getAttribute("data-duplex-event")||"input";e.attributes["data-event"]&&u("data-event指令已经废弃,请改用data-duplex-event");function m(e){setTimeout(function(){p(e)})}v.replace(c,function(e){switch(e){case"input":A?(A>8?(A===9&&i("keyup",p),i("input",p)):i("propertychange",function(e){e.propertyName==="value"&&p()}),i("dragend",m)):(i("input",p),i("compositionstart",f),i("compositionend",l),i("DOMAutoComplete",p));break;default:i(e,p)}}),ti.test(e.type)||(e.type!=="hidden"&&(i("focus",function(){e.msFocus=!0}),i("blur",function(){e.msFocus=!1})),e.avalonSetter=p,ei(function(){if(E.contains(e))e.msFocus||p();else if(!e.msRetain)return!1}))}avalon.injectBinding(n),a.call(e,e.value)},Jr.TEXTAREA=Jr.INPUT,Jr.SELECT=function(e,t,n){function i(){if(r.data("duplexObserve")!==!1){var i=r.val();Array.isArray(i)?i=i.map(function(e){return n.pipe(e,n,"get")}):i=n.pipe(i,n,"get"),i+""!==e.oldValue&&t(i),n.changed.call(e,i,n)}}var r=avalon(e);n.handler=function(){var n=t();n=n&&n.$model||n,Array.isArray(n)?e.multiple||u("ms-duplex在不能对应一个数组"),n=Array.isArray(n)?n.map(String):n+"",n+""!==e.oldValue&&(r.val(n),e.oldValue=n+"")},n.bound("change",i),e.msCallback=function(){avalon.injectBinding(n),n.changed.call(e,t(),n)}},B.html=function(e,t,n){var i=t.nodeType!==1,s=i?t.parentNode:t;if(!s)return;e=e==null?"":e;if(n.oldText===e)return;n.oldText=e;if(t.nodeType===3){var o=k("html");s.insertBefore(r.createComment(o),t),n.element=r.createComment(o+":end"),s.replaceChild(n.element,t),t=n.element}if(typeof e!="object")var u=avalon.parseHTML(String(e));else if(e.nodeType===11)u=e;else if(e.nodeType===1||e.item){var a=e.nodeType===1?e.childNodes:e.item;u=S.cloneNode(!0);while(a[0])u.appendChild(a[0])}a=avalon.slice(u.childNodes);if(i){var f=t.nodeValue.slice(0,-4);for(;;){var l=t.previousSibling;if(!l||l.nodeType===8&&l.nodeValue===f)break;s.removeChild(l)}s.insertBefore(u,t)}else avalon.clearHTML(t).appendChild(u);Lr(a,n.vmodels)},H["if"]=H.data=H.text=H.html=function(e,t){sr(e.value,t,e)},B["if"]=function(e,t,n){try{if(!t.parentNode)return}catch(i){return}if(e)t.nodeType===8&&(t.parentNode.replaceChild(n.template,t),t.ifRemove=null,t=n.element=n.template),t.getAttribute(n.name)&&(t.removeAttribute(n.name),yr(t,n.vmodels)),n.rollback=null;else if(t.nodeType===1){var o=n.element=r.createComment("ms-if");t.parentNode.replaceChild(o,t),t.ifRemove=o,n.template=t,s.appendChild(t),n.rollback=function(){t.parentNode===s&&s.removeChild(t)}}};var ii=/\(([^)]*)\)/;H.on=function(e,t){var n=e.value;e.type="on";var r=e.param.replace(/-\d+$/,"");typeof H.on[r+"Hook"]=="function"&&H.on[r+"Hook"](e);if(n.indexOf("(")>0&&n.indexOf(")")>-1){var i=(n.match(ii)||["",""])[1].trim();if(i===""||i==="$event")n=n.replace(ii,"")}sr(n,t,e)},B.on=function(e,t,n){e=function(e){var t=n.evaluator||N;return t.apply(this,n.args.concat(e))};var r=n.param.replace(/-\d+$/,"");if(r==="scan")e.call(t,{type:r});else if(typeof n.specialBind=="function")n.specialBind(t,e);else var i=avalon.bind(t,r,e);n.rollback=function(){typeof n.specialUnbind=="function"?n.specialUnbind():avalon.unbind(t,r,i)}},H.repeat=function(e,t){var n=e.type;sr(e.value,t,e,1),e.proxies=[];var i=!1;try{var s=e.$repeat=e.evaluator.apply(0,e.args||[]),o=avalon.type(s);o!=="object"&&o!=="array"?(i=!0,avalon.log("warning:"+e.value+"只能是对象或数组")):e.xtype=o}catch(u){i=!0}var a=e.value.split(".")||[];if(a.length>1){a.pop();var l=a[0];for(var c=0,h;h=t[c++];)if(h&&h.hasOwnProperty(l)){var p=h[l].$events||{};p[f]=p[f]||[],Rt(p[f],e);break}}var d=e.handler;e.handler=N,avalon.injectBinding(e),e.handler=d;var v=e.element;if(v.nodeType===1){v.removeAttribute(e.name),e.sortedCallback=fr(v,"data-with-sorted",t),e.renderedCallback=fr(v,"data-"+n+"-rendered",t);var m=k(n),g=r.createComment(m),y=r.createComment(m+":end");e.signature=m,e.template=S.cloneNode(!1);if(n==="repeat"){var b=v.parentNode;b.replaceChild(y,v),b.insertBefore(g,y),e.template.appendChild(v)}else{while(v.firstChild)e.template.appendChild(v.firstChild);v.appendChild(g),v.appendChild(y)}e.element=y,e.handler=B.repeat,e.rollback=function(){var t=e.element;if(!t)return;e.handler("clear")}}if(i)return;e.$outer={};var w="$key",E="$val";Array.isArray(s)&&(w="$first",E="$last");for(c=0;h=t[c++];)if(h.hasOwnProperty(w)&&h.hasOwnProperty(E)){e.$outer=h;break}var x=s.$events,T=(x||{})[f];Rt(T,e),o==="object"?e.handler("append"):s.length&&e.handler("add",0,s.length)},B.repeat=function(e,t,n){var r=this;if(!e&&r.xtype){var i=r.$repeat,s=r.evaluator.apply(0,r.args||[]);if(r.xtype==="array"){if(i.length===s.length){if(!(i!==s&&i.length>0))return;B.repeat.call(this,"clear",t,n)}e="add",t=0,r.$repeat=s,n=s.length}else{if(At(i).join(";;")===At(s).join(";;"))return;e="append",r.$repeat=s}}if(e){var o,u,a=r.element,f=oi(r),l=a.parentNode,c=r.proxies,h=S.cloneNode(!1);switch(e){case"add":var p=t+n,d=[];for(var v=t;v]*>([\S\s]*?)<\/script\s*>/gim,wi=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Ei=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/ig,Si={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/ig,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/ig,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/ig},xi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ti=/([^\#-~| |!])/g,Ci=avalon.filters={uppercase:function(e){return e.toUpperCase()},lowercase:function(e){return e.toLowerCase()},truncate:function(e,t,n){return t=t||30,n=typeof n=="string"?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},$filter:function(e){for(var t=1,n=arguments.length;t/g,">")},currency:function(e,t,n){return(t||"¥")+Ni(e,isFinite(n)?n:2)},number:Ni};new function(){function e(e){return parseInt(e,10)||0}function t(e,t,n){var r="";e<0&&(r="-",e=-e),e=""+e;while(e.length0||o>-r)o+=r;return o===0&&r===-12&&(o=12),t(o,n,i)}}function r(e,t){return function(n,r){var i=n["get"+e](),s=(t?"SHORT"+e:e).toUpperCase();return r[s][i]}}function i(e){var n=-1*e.getTimezoneOffset(),r=n>=0?"+":"";return r+=t(Math[n>0?"floor":"ceil"](n/60),2)+t(Math.abs(n%60),2),r}function s(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}var o={yyyy:n("FullYear",4),yy:n("FullYear",2,0,!0),y:n("FullYear",1),MMMM:r("Month"),MMM:r("Month",!0),MM:n("Month",2,1),M:n("Month",1,1),dd:n("Date",2),d:n("Date",1),HH:n("Hours",2),H:n("Hours",1),hh:n("Hours",2,-12),h:n("Hours",1,-12),mm:n("Minutes",2),m:n("Minutes",1),ss:n("Seconds",2),s:n("Seconds",1),sss:n("Milliseconds",3),EEEE:r("Day"),EEE:r("Day",!0),a:s,Z:i},u=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,a=/^\/Date\((\d+)\)\/$/;Ci.date=function(t,n){var r=Ci.date.locate,i="",s=[],f,l;n=n||"mediumDate",n=r[n]||n;if(typeof t=="string")if(/^\d+$/.test(t))t=e(t);else if(a.test(t))t=+RegExp.$1;else{var c=t.trim(),h=[0,0,0,0,0,0,0],p=new Date(0);c=c.replace(/^(\d+)\D(\d+)\D(\d+)/,function(t,n,r,i){var s=i.length===4?[i,n,r]:[n,r,i];return h[0]=e(s[0]),h[1]=e(s[1])-1,h[2]=e(s[2]),""});var d=p.setFullYear,v=p.setHours;c=c.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(t,n,r,i,s){return h[3]=e(n),h[4]=e(r),h[5]=e(i),s&&(h[6]=Math.round(parseFloat("0."+s)*1e3)),""});var m=0,g=0;c=c.replace(/Z|([+-])(\d\d):?(\d\d)/,function(t,n,r,i){return d=p.setUTCFullYear,v=p.setUTCHours,n&&(m=e(n+r),g=e(n+i)),""}),h[3]-=m,h[4]-=g,d.apply(p,h.slice(0,3)),v.apply(p,h.slice(3)),t=p}typeof t=="number"&&(t=new Date(t));if(avalon.type(t)!=="date")return;while(n)l=u.exec(n),l?(s=s.concat(l.slice(1)),n=s.pop()):(s.push(n),n=null);return s.forEach(function(e){f=o[e],i+=f?f(t,r):e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),i};var f={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};f.SHORTMONTH=f.MONTH,Ci.date.locate=f};var ki=avalon.modules={"domReady!":{exports:avalon,state:3},avalon:{exports:avalon,state:4}},Li=e.require,Ai=e.define,Oi;ft.loader=function(t){var n=Oi&&t;e.require=n?Oi:Li,e.define=n?Oi.define:Ai},ki.exports=ki.avalon,new function(){function o(e,t){var n="js";e=e.replace(/^(\w+)\!/,function(e,t){return n=t,""}),n==="ready"&&(u("debug: ready!已经被废弃,请使用domReady!"),n="domReady");var r="";e=e.replace(T,function(e){return r=e,""});var i="."+n,s=/js|css/.test(i)?i:"";e=e.replace(/\.[a-z0-9]+$/g,function(e){return e===i?(s=e,""):e});var o=avalon.mix({query:r,ext:s,res:n,name:e,toUrl:_},t);return o.toUrl(e),o}function l(e){var t=e.name,n=e.res,r=ki[t],i=t&&e.urlNoQuery;if(r&&r.state>=1)return t;r=ki[i];if(r&&r.state>=3)return Oi(r.deps||[],r.factory,i),i;if(t&&!r){r=ki[i]={id:i,state:1};var s=function(i){x[n]=i,i.load(t,e,function(e){arguments.length&&e!==void 0&&(r.exports=e),r.state=4,w()})};x[n]?s(x[n]):Oi([n],s)}return t?i:n+"!"}function y(e,t){for(var n=0,r;r=e[n++];)if(ki[r].state!==4&&(r===t||y(ki[r].deps,t)))return!0}function b(e,t,n){var r=C(e.src);e.onload=e.onreadystatechange=e.onerror=null;if(!(t||n&&ki[r]&&!ki[r].state))return!0;setTimeout(function(){i.removeChild(e),e=null}),u("debug: 加载 "+r+" 失败"+t+" "+!ki[r].state)}function w(){e:for(var e=t.length,n;n=t[--e];){var r=ki[n],i=r.deps;if(!i)continue;for(var s=0,o;o=i[s];s++)if(Object(ki[o]).state!==4)continue e;r.state!==4&&(t.splice(e,1),M(r.id,r.deps,r.factory),w())}}function S(e,s,o){function h(){var r=n.pop();r&&r.require(s),o&&o(),b(a,!1,!l)&&(u("debug: 已成功加载 "+e),s&&t.push(s),w())}var a=r.createElement("script");a.className=f;var l="onload"in a,c=l?"onload":"onreadystatechange",p=0,d;a[c]=l?h:function(){E.test(a.readyState)&&(++p,p===1?d=setTimeout(h,500):(clearTimeout(d),h()))},a.onerror=function(){b(a,!0)},i.insertBefore(a,i.firstChild),a.src=e,u("debug: 正准备加载 "+e)}function C(e){return(e||"").replace(T,"")}function k(e){return/^(?:[a-z]+:)?\/\//i.test(String(e))}function L(e,t){return"1"[0]?e[t]:e.getAttribute(t,4)}function A(){var t;try{a.b.c()}catch(n){t=n.stack,!t&&e.opera&&(t=(String(n).match(/of linked script \S+/g)||[]).join(" "))}if(t)return t=t.split(/[@ ]/g).pop(),t=t[0]==="("?t.slice(1,-1):t.replace(/\s/,""),C(t.replace(/(:\d+)?:\d+$/i,""));var r=i.getElementsByTagName("script");for(var s=r.length,o;o=r[--s];)if(o.className===f&&o.readyState==="interactive"){var u=L(o,"src");return o.className=C(u)}}function M(t,n,r){var i=Object(ki[t]);i.state=4;for(var s=0,o=[],a;a=n[s++];)if(a==="exports"){var f=i.exports||(i.exports={});o.push(f)}else o.push(ki[a].exports);try{var l=r.apply(e,o)}catch(c){u("执行["+t+"]模块的factory抛错: ",c)}return l!==void 0&&(i.exports=l),O.test(t)&&delete ki[t],delete i.factory,l}function _(e){e.indexOf(this.res+"!")===0&&(e=e.slice(this.res.length+1));var t=e,n=0,r=this.baseUrl,i=this.parentUrl||r;j(e,tt.paths,function(e,r){t=t.replace(r,e),n=1}),n||j(e,tt.packages,function(e,n,r){t=t.replace(r.name,r.location)}),this.mapUrl&&j(this.mapUrl,tt.map,function(e){j(t,e,function(e,n){t=t.replace(n,e),i=r})});var s=this.ext;s&&n&&t.slice(-s.length)===s&&(t=t.slice(0,-s.length)),k(t)||(i=this.built||/^\w/.test(t)?r:i,t=q(i,t));var o=t+s;return t=o+this.query,o=t.replace(T,function(e){return this.query=e,""}),j(e,tt.urlArgs,function(e){t+=(t.indexOf("?")===-1?"?":"&")+e}),this.url=t,this.urlNoQuery=o}function D(e,t,n){var r=B(e,t,n);return r.sort(F),r}function P(e){return new RegExp("^"+e+"(/|$)")}function H(t){return function(){var n;return t.init&&(n=t.init.apply(e,arguments)),n||t.exports&&R(t.exports)}}function B(e,t,n){var r=[];for(var i in e)if(m.call(e,i)){var s={name:i,val:e[i]};r.push(s),s.reg=i==="*"&&t?/^/:P(i),n&&i!=="*"&&(s.reg=new RegExp("/"+i.replace(/^\//,"")+"(/|$)"))}return r}function j(e,t,n){t=t||[];for(var r=0,i;i=t[r++];)if(i.reg.test(e))return n(i.val,i.name,i),!1}function F(e,t){var n=e.name,r=t.name;return r==="*"?-1:n==="*"?1:r.length-n.length}function q(e,t){e.charAt(e.length-1)!=="/"&&(e+="/");if(t.slice(0,2)==="./")return e+t.slice(2);if(t.slice(0,2)===".."){e+=t;while(I.test(e))e=e.replace(I,"");return e}return t.slice(0,1)==="/"?e+t.slice(1):e+t}function R(t){if(!t)return t;var n=e;return t.split(".").forEach(function(e){n=n[e]}),n}var t=[],n=[],s=/\.js$/i,c=[],h=!1;Oi=avalon.require=function(e,n,r,i){if(!h){c.push(avalon.slice(arguments));if(arguments.length<=2){h=!0;var u=c.splice(0,c.length),a;while(a=u.shift())Oi.apply(null,a)}return}Array.isArray(e)||avalon.error("require方法的第一个参数应为数组 "+e);var f=[],p={},d=r||"callback"+setTimeout("1");i=i||{},i.baseUrl=tt.baseUrl;var v=!!i.built;r&&(i.parentUrl=r.substr(0,r.lastIndexOf("/")),i.mapUrl=r.replace(s,""));if(v){var m=o(i.defineName,i);d=m.urlNoQuery}else e.forEach(function(e){var t=o(e,i),n=l(t);n&&(p[n]||(f.push(n),p[n]="司徒正美"))});var g=ki[d];if(!g||g.state!==4)ki[d]={id:d,deps:v?e.concat():f,factory:n||N,state:3};g||t.push(d),w()},Oi.define=function(e,t,r){typeof e!="string"&&(r=t,t=e,e="anonymous"),Array.isArray(t)||(r=t,t=[]);var i={built:!h,defineName:e},s=[t,r,i];r.require=function(e){s.splice(2,0,e);if(ki[e]){ki[e].state=3;var t=!1;try{t=y(ki[e].deps,e)}catch(n){}t&&avalon.error(e+"模块与之前的模块存在循环依赖,请不要直接用script标签引入"+e+"模块")}delete r.require,Oi.apply(null,s)};var o=i.built?"unknown":A();if(o){var u=ki[o];u&&(u.state=2),r.require(o)}else n.push(r)},Oi.config=tt,Oi.define.amd=ki;var p=tt["orig.paths"]={},d=tt["orig.map"]={},v=tt.packages=[],g=tt["orig.args"]={};avalon.mix(ft,{paths:function(e){avalon.mix(p,e),tt.paths=D(p)},map:function(e){avalon.mix(d,e);var t=D(d,1,1);avalon.each(t,function(e,t){t.val=D(t.val)}),tt.map=t},packages:function(e){e=e.concat(v);var t={},n=[];for(var r=0,i;i=e[r++];){i=typeof i=="string"?{name:i}:i;var o=i.name;if(!t[o]){var u=q(i.location||o,i.main||"main");u=u.replace(s,""),n.push(i),t[o]=i.location=u,i.reg=P(o)}}tt.packages=n.sort()},urlArgs:function(e){typeof e=="string"&&(e={"*":e}),avalon.mix(g,e),tt.urlArgs=D(g,1)},baseUrl:function(e){if(!k(e)){var t=i.getElementsByTagName("base")[0];t&&i.removeChild(t);var n=r.createElement("a");n.href=e,e=L(n,"href"),t&&i.insertBefore(t,i.firstChild)}e.length>3&&(tt.baseUrl=e)},shim:function(e){for(var t in e){var n=e[t];Array.isArray(n)&&(n=e[t]={deps:n}),!n.exportsFn&&(n.exports||n.init)&&(n.exportsFn=H(n))}tt.shim=e}});var E=/complete|loaded/,x=Oi.plugins={ready:{load:N},js:{load:function(e,t,n){var r=t.url,i=t.urlNoQuery,o=tt.shim[e.replace(s,"")];o?Oi(o.deps||[],function(){var e=avalon.slice(arguments);S(r,i,function(){n(o.exportsFn?o.exportsFn.apply(0,e):void 0)})}):S(r,i)}},css:{load:function(e,t,n){var s=t.url,o=r.createElement("link");o.rel="stylesheet",o.href=s,i.insertBefore(o,i.firstChild),u("debug: 已成功加载 "+s),n()}},text:{load:function(e,t,n){var r=t.url,i=Xr();i.onreadystatechange=function(){if(i.readyState===4){var e=i.status;e>399&&e<600?avalon.error(r+" 对应资源不存在或没有开启 CORS"):(u("debug: 已成功加载 "+r),n(i.responseText))}};var s="_="+(new Date-0),o=r.indexOf("?")===-1?r+"?"+s:r+"&"+s;i.open("GET",o,!0),"withCredentials"in i&&(i.withCredentials=!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(),u("debug: 正准备加载 "+r)}}};Oi.checkDeps=w;var T=/(\?[^#]*)$/,O=/^callback\d+$/,I=/\/\w+\/\.\./,U=r.scripts[r.scripts.length-1],z=U.getAttribute("data-main");if(z){ft.baseUrl(z);var W=tt.baseUrl;tt.baseUrl=W.slice(0,W.lastIndexOf("/")+1),S(W.replace(s,"")+".js")}else{var X=C(L(U,"src"));tt.baseUrl=X.slice(0,X.lastIndexOf("/")+1)}};var Mi=[],_i,Di=function(e){_i=!0;var t=avalon.require;t&&t.checkDeps&&(ki["domReady!"].state=4,t.checkDeps());while(e=Mi.shift())e(avalon)};if(r.readyState==="complete")setTimeout(Di);else if(w)r.addEventListener("DOMContentLoaded",Di);else{r.attachEvent("onreadystatechange",function(){r.readyState==="complete"&&Di()});try{var Hi=e.frameElement===null}catch(yt){}E.doScroll&&Hi&&e.external&&Pi()}avalon.bind(e,"load",Di),avalon.ready=function(e){_i?e(avalon):Mi.push(e)},avalon.config({loader:!0}),avalon.ready(function(){avalon.scan(r.body)}),typeof define=="function"&&define.amd&&define("avalon",[],function(){return avalon});var Bi=e.avalon;return avalon.noConflict=function(t){return t&&e.avalon===avalon&&(e.avalon=Bi),avalon},t===void 0&&(e.avalon=avalon),avalon}),!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function g(e){var t="length"in e&&e.length,n=h.type(e);return"function"===n||h.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function S(e,t,n){if(h.isFunction(t))return h.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return h.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(E.test(t))return h.filter(t,e,n);t=h.filter(t,e)}return h.grep(e,function(e){return h.inArray(e,t)>=0!==n})}function A(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function _(e){var t=M[e]={};return h.each(e.match(O)||[],function(e,n){t[n]=!0}),t}function P(){T.addEventListener?(T.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(T.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))}function H(){(T.addEventListener||"load"===event.type||"complete"===T.readyState)&&(P(),h.ready())}function q(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(I,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:F.test(n)?h.parseJSON(n):n}catch(i){}h.data(e,t,n)}else n=void 0}return n}function R(e){var t;for(t in e)if(("data"!==t||!h.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function U(e,t,r,i){if(h.acceptData(e)){var s,o,u=h.expando,a=e.nodeType,f=a?h.cache:e,l=a?e[u]:e[u]&&u;if(l&&f[l]&&(i||f[l].data)||void 0!==r||"string"!=typeof t)return l||(l=a?e[u]=n.pop()||h.guid++:u),f[l]||(f[l]=a?{}:{toJSON:h.noop}),("object"==typeof t||"function"==typeof t)&&(i?f[l]=h.extend(f[l],t):f[l].data=h.extend(f[l].data,t)),o=f[l],i||(o.data||(o.data={}),o=o.data),void 0!==r&&(o[h.camelCase(t)]=r),"string"==typeof t?(s=o[t],null==s&&(s=o[h.camelCase(t)])):s=o,s}}function z(e,t,n){if(h.acceptData(e)){var r,i,s=e.nodeType,o=s?h.cache:e,u=s?e[h.expando]:h.expando;if(o[u]){if(t&&(r=n?o[u]:o[u].data)){h.isArray(t)?t=t.concat(h.map(t,h.camelCase)):t in r?t=[t]:(t=h.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!R(r):!h.isEmptyObject(r))return}(n||(delete o[u].data,R(o[u])))&&(s?h.cleanData([e],!0):l.deleteExpando||o!=o.window?delete o[u]:o[u]=null)}}}function et(){return!0}function tt(){return!1}function nt(){try{return T.activeElement}catch(e){}}function rt(e){var t=it.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function wt(e,t){var n,r,i=0,s=typeof e.getElementsByTagName!==B?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==B?e.querySelectorAll(t||"*"):void 0;if(!s)for(s=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||h.nodeName(r,t)?s.push(r):h.merge(s,wt(r,t));return void 0===t||t&&h.nodeName(e,t)?h.merge([e],s):s}function Et(e){J.test(e.type)&&(e.defaultChecked=e.checked)}function St(e,t){return h.nodeName(e,"table")&&h.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function xt(e){return e.type=(null!==h.find.attr(e,"type"))+"/"+e.type,e}function Tt(e){var t=vt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Nt(e,t){for(var n,r=0;null!=(n=e[r]);r++)h._data(n,"globalEval",!t||h._data(t[r],"globalEval"))}function Ct(e,t){if(1===t.nodeType&&h.hasData(e)){var n,r,i,s=h._data(e),o=h._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;i>r;r++)h.event.add(t,n,u[n][r])}o.data&&(o.data=h.extend({},o.data))}}function kt(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!l.noCloneEvent&&t[h.expando]){i=h._data(t);for(r in i.events)h.removeEvent(t,r,i.handle);t.removeAttribute(h.expando)}"script"===n&&t.text!==e.text?(xt(t).text=e.text,Tt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),l.html5Clone&&e.innerHTML&&!h.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&J.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function Ot(t,n){var r,i=h(n.createElement(t)).appendTo(n.body),s=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:h.css(i[0],"display");return i.detach(),s}function Mt(e){var t=T,n=At[e];return n||(n=Ot(e,t),"none"!==n&&n||(Lt=(Lt||h("