/*
Copyright 2012, KISSY UI Library v1.30rc
MIT Licensed
build time: Jul 11 21:21
*/
KISSY.add("component/base",function(d,f,e){return{Manager:e,UIBase:f,create:function(c,b){var a;if(c&&(a=c.xclass))b&&!c.prefixCls&&(c.prefixCls=b.get("prefixCls")),a=e.getConstructorByXClass(a),c=new a(c);return c}}},{requires:["./uibase","./manager"]});KISSY.add("component",function(d,f,e,c,b,a,g,m){d.mix(f,{Controller:e,Render:c,Container:b,DelegateChildren:a,DecorateChild:m,DecorateChildren:g});return f},{requires:"component/base,component/controller,component/render,component/container,component/delegateChildren,component/decorateChildren,component/decorateChild".split(",")});
KISSY.add("component/container",function(d,f,e,c){return f.extend([e,c],{})},{requires:["./controller","./delegateChildren","./decorateChildren"]});
KISSY.add("component/controller",function(d,f,e,c,b,a,g){function m(b){return function(i){if(this==i.target){var i=i.newVal,a=this.get("view");a&&a.set(b,i)}}}function h(b){return function(i){var a=this.get("view");return i===g?a&&a.get(b):i}}function o(b,i){var a=b.relatedTarget;return a&&(a===i[0]||i.contains(a))}var l=c.extend([c.Box],{getCssClassWithPrefix:b.getCssClassWithPrefix,initializer:function(){this.get("view")},createDom:function(){for(var a=this.get("view"),i=this.constructor,c=[];i&&
i!=l;){var d=b.getXClassByConstructor(i);d&&c.push(d);i=i.superclass&&i.superclass.constructor}a.__componentClasses=c.join(" ");a.create();i=a.getKeyEventTarget();this.get("allowTextSelection")||i.unselectable(g);this.__set("view",a)},renderUI:function(){var a,i,b;this.get("view").render();i=this.get("children").concat();for(a=this.get("children").length=0;a<i.length;a++)b=this.addChild(i[a]),b.render()},_uiSetFocusable:function(a){var i=this.getKeyEventTarget();if(a)i.attr("tabIndex",0).on("focus",
this.handleFocus,this).on("blur",this.handleBlur,this).on("keydown",this.handleKeydown,this);else i.removeAttr("tabIndex").detach("focus",this.handleFocus,this).detach("blur",this.handleBlur,this).detach("keydown",this.handleKeydown,this)},_uiSetHandleMouseEvents:function(a){var i=this.get("el");if(a)i.on("mouseenter",this.handleMouseEnter,this).on("mouseleave",this.handleMouseLeave,this).on("contextmenu",this.handleContextMenu,this).on("mousedown",this.handleMouseDown,this).on("mouseup",this.handleMouseUp,
this).on("dblclick",this.handleDblClick,this);else i.detach("mouseenter",this.handleMouseEnter,this).detach("mouseleave",this.handleMouseLeave,this).detach("contextmenu",this.handleContextMenu,this).detach("mousedown",this.handleMouseDown,this).detach("mouseup",this.handleMouseUp,this).detach("dblclick",this.handleDblClick,this)},_uiSetFocused:function(a){a&&this.getKeyEventTarget()[0].focus()},getContentElement:function(){var a=this.get("view");return a&&a.getContentElement()},getKeyEventTarget:function(){var a=
this.get("view");return a&&a.getKeyEventTarget()},addChild:function(a,i){var b=this.get("children"),c;i===g&&(i=b.length);c=b[i]&&b[i].get("el")||null;var d=a;this.create();var f=this.getContentElement(),d=e.create(d,this);d.__set("parent",this);d.set("render",f);d.set("elBefore",c);d.create(g);a=d;b.splice(i,0,a);this.get("rendered")&&a.render();this.fire("addChild",{child:a});return a},removeChild:function(a,i){var b=this.get("children"),c=d.indexOf(a,b);-1!=c&&b.splice(c,1);i&&a.destroy&&a.destroy();
this.fire("removeChild",{child:a});return a},removeChildren:function(a){var i,b=[].concat(this.get("children"));for(i=0;i<b.length;i++)this.removeChild(b[i],a);this.__set("children",[])},getChildAt:function(a){return this.get("children")[a]||null},handleDblClick:function(a){if(this.get("disabled"))return!0;this.performActionInternal(a)},handleMouseOver:function(a){var b=this.get("el");if(this.get("disabled"))return!0;o(a,b)||this.handleMouseEnter(a)},handleMouseOut:function(a){var b=this.get("el");
if(this.get("disabled"))return!0;o(a,b)||this.handleMouseLeave(a)},handleMouseEnter:function(a){if(this.get("disabled"))return!0;this.set("highlighted",!!a)},handleMouseLeave:function(a){if(this.get("disabled"))return!0;this.set("active",!1);this.set("highlighted",!a)},handleMouseDown:function(a){var b=1==a.which;if(this.get("disabled"))return!0;if(b&&(b=this.getKeyEventTarget(),this.get("activeable")&&this.set("active",!0),this.get("focusable")&&(b[0].focus(),this.set("focused",!0)),!this.get("allowTextSelection")))b=
(b=a.target.nodeName)&&b.toLowerCase(),"input"!=b&&"textarea"!=b&&a.preventDefault()},handleMouseUp:function(a){if(this.get("disabled"))return!0;this.get("active")&&1==a.which&&(this.performActionInternal(a),this.set("active",!1))},handleContextMenu:function(){},handleFocus:function(a){this.set("focused",!!a);this.fire("focus")},handleBlur:function(a){this.set("focused",!a);this.fire("blur")},handleKeyEventInternal:function(a){if(a.keyCode==f.KeyCodes.ENTER)return this.performActionInternal(a)},handleKeydown:function(a){if(this.get("disabled"))return!0;
this.handleKeyEventInternal(a)&&a.halt()},performActionInternal:function(){},destructor:function(){var a,b=this.get("children");for(a=0;a<b.length;a++)b[a].destroy&&b[a].destroy();(a=this.get("view"))&&a.destroy()}},{ATTRS:{handleMouseEvents:{value:!0},focusable:{value:!0,view:1},allowTextSelection:{value:!1},activeable:{value:!0},focused:{view:1},active:{view:1},highlighted:{view:1},children:{value:[]},prefixCls:{value:"ks-",view:1},parent:{setter:function(a){this.addTarget(a)}},view:{valueFn:function(){var a;
var b,c,e={},f,o=this.get("xrender");if(o){a=this.getAttrs();for(c in a)if(a.hasOwnProperty(c)&&(b=a[c],b.view)){if((f=this.get(c))!==g)e[c]=f;this.on("after"+d.ucfirst(c)+"Change",m(c));b.getter=h(c)}a=new o(e)}else a=0;return a}},disabled:{view:1},xrender:{value:a}}},{xclass:"controller"});return l},{requires:["event","./base","./uibase","./manager","./render"]});
KISSY.add("component/decorateChild",function(d,f){function e(){}d.augment(e,f,{decorateInternal:function(c){this.set("el",c);var b=this.get("decorateChildCls");if(c=c.one("."+b))(b=this.findUIConstructorByNode(c,1))?this.decorateChildrenInternal(b,c):this.decorateChildren(c)}});return e},{requires:["./decorateChildren"]});
KISSY.add("component/decorateChildren",function(d,f){function e(){}d.augment(e,{decorateInternal:function(c){this.set("el",c);this.decorateChildren(c)},findUIConstructorByNode:function(c){var c=c.attr("class")||"",b=this.get("prefixCls"),c=c.replace(RegExp("\\b"+b,"ig"),"");return f.getConstructorByXClass(c)},decorateChildrenInternal:function(c,b){this.addChild(new c({srcNode:b,prefixCls:this.get("prefixCls")}))},decorateChildren:function(c){var b=this;c.children().each(function(a){var c=b.findUIConstructorByNode(a);
b.decorateChildrenInternal(c,a)})}});return e},{requires:["./manager"]});
KISSY.add("component/delegateChildren",function(d){function f(){}function e(c){var b=this.getOwnerControl(c.target,c);if(b)switch(c.type){case "mousedown":b.handleMouseDown(c);break;case "mouseup":b.handleMouseUp(c);break;case "mouseover":b.handleMouseOver(c);break;case "mouseout":b.handleMouseOut(c);break;case "contextmenu":b.handleContextMenu(c);break;case "dblclick":b.handleDblClick(c)}}d.augment(f,{__bindUI:function(){this.get("el").on("mousedown mouseup mouseover mouseout dblclick contextmenu",e,
this)},getOwnerControl:function(c){for(var b=this.get("children"),a=b.length,g=this.get("el")[0];c&&c!==g;){for(var d=0;d<a;d++)if(b[d].get("el")[0]===c)return b[d];c=c.parentNode}return null}});return f});
KISSY.add("component/manager",function(d){function f(a){for(var a=d.trim(a).split(/\s+/),b=0;b<a.length;b++)a[b]&&(a[b]=this.get("prefixCls")+a[b]);return a.join(" ")}var e={},c={},b={__instances:c,addComponent:function(a,b){c[a]=b},removeComponent:function(a){delete c[a]},getComponent:function(a){return c[a]},getCssClassWithPrefix:f,getXClassByConstructor:function(a){for(var b in e)if(e[b].constructor==a)return b;return 0},getConstructorByXClass:function(a){for(var a=a.split(/\s+/),b=-1,c,d=null,
f=0;f<a.length;f++){var l=e[a[f]];if(l&&(c=l.priority)>b)b=c,d=l.constructor}return d},setConstructorByXClass:function(a,b){d.isFunction(b)?e[a]={constructor:b,priority:0}:(b.priority=b.priority||0,e[a]=b)}};b.getCssClassWithPrefix=f;return b});
KISSY.add("component/render",function(d,f,e,c){return e.extend([e.Box.Render],{getComponentCssClassWithState:function(b){var a=this.__componentClasses,b=b||"";return this.getCssClassWithPrefix(a.split(/\s+/).join(b+" ")+b)},getCssClassWithPrefix:c.getCssClassWithPrefix,createDom:function(){this.get("el").addClass(this.getComponentCssClassWithState())},getKeyEventTarget:function(){return this.get("el")},_uiSetHighlighted:function(b){var a=this.getComponentCssClassWithState("-hover");this.get("el")[b?
"addClass":"removeClass"](a)},_uiSetDisabled:function(b){var a=this.getComponentCssClassWithState("-disabled");this.get("el")[b?"addClass":"removeClass"](a).attr("aria-disabled",b);this.get("focusable")&&this.getKeyEventTarget().attr("tabIndex",b?-1:0)},_uiSetActive:function(b){var a=this.getComponentCssClassWithState("-active");this.get("el")[b?"addClass":"removeClass"](a).attr("aria-pressed",!!b)},_uiSetFocused:function(b){var a=this.get("el"),c=this.getComponentCssClassWithState("-focused");a[b?
"addClass":"removeClass"](c)},getContentElement:function(){return this.get("contentEl")||this.get("el")}},{ATTRS:{prefixCls:{value:"ks-"},focusable:{value:!0},focused:{},active:{},disabled:{},highlighted:{}}})},{requires:["./base","./uibase","./manager"]});
KISSY.add("component/uibase",function(d,f,e,c,b,a,g,m,h,o,l,p,i,u,t,r,s,n,j,k,v){a.Render=g;p.Render=i;u.Render=t;r.Render=s;k.Render=v;c.Render=b;h.Render=o;d.mix(f,{Align:e,Box:c,Close:a,Constrain:m,ContentBox:h,Drag:l,Loading:p,Mask:u,Position:r,Shim:{Render:n},Resize:j,StdMod:k});return f},{requires:"./uibase/base,./uibase/align,./uibase/box,./uibase/boxrender,./uibase/close,./uibase/closerender,./uibase/constrain,./uibase/contentbox,./uibase/contentboxrender,./uibase/drag,./uibase/loading,./uibase/loadingrender,./uibase/mask,./uibase/maskrender,./uibase/position,./uibase/positionrender,./uibase/shimrender,./uibase/resize,./uibase/stdmod,./uibase/stdmodrender".split(",")});
KISSY.add("component/uibase/align",function(d,f,e,c){function b(a){var b=a.ownerDocument.body,c=e.css(a,"position");if(!("fixed"==c||"absolute"==c))return"html"==a.nodeName.toLowerCase()?null:a.parentNode;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=e.css(a,"position"),"static"!=c)return a;return null}function a(a){var c,d,g={left:0,right:Infinity,top:0,bottom:Infinity},h;d=a.ownerDocument;c=d.body;for(d=d.documentElement;a=b(a);)if((!f.ie||0!=a.clientWidth)&&a!=c&&a!=d&&"visible"!=e.css(a,"overflow"))h=
e.offset(a),h.left+=a.clientLeft,h.top+=a.clientTop,g.top=Math.max(g.top,h.top),g.right=Math.min(g.right,h.left+a.clientWidth),g.bottom=Math.min(g.bottom,h.top+a.clientHeight),g.left=Math.max(g.left,h.left);a=e.scrollLeft();h=e.scrollTop();g.left=Math.max(g.left,a);g.top=Math.max(g.top,h);c=e.viewportWidth();d=e.viewportHeight();g.right=Math.min(g.right,a+c);g.bottom=Math.min(g.bottom,h+d);return 0<=g.top&&0<=g.left&&g.bottom>g.top&&g.right>g.left?g:null}function g(a,b,c,d){var g,e;g=a.left;e=a.top;
b=l(b,c[0]);a=l(a,c[1]);a=[a.left-b.left,a.top-b.top];return{left:g-a[0]+ +d[0],top:e-a[1]+ +d[1]}}function m(a,b,c){var g=[];d.each(a,function(a){g.push(a.replace(b,function(a){return c[a]}))});return g}function h(){}function o(a){var b,c;d.isWindow(a[0])?(b={left:e.scrollLeft(),top:e.scrollTop()},c=e.viewportWidth(),a=e.viewportHeight()):(b=a.offset(),c=a.outerWidth(),a=a.outerHeight());b.width=c;b.height=a;return b}function l(a,b){var c=b.charAt(0),d=b.charAt(1),g=a.width,e=a.height,f,k;f=a.left;
k=a.top;"c"===c?k+=e/2:"b"===c&&(k+=e);"c"===d?f+=g/2:"r"===d&&(f+=g);return{left:f,top:k}}var p=d.Env.host;h.__getOffsetParent=b;h.__getVisibleRectForElement=a;h.ATTRS={align:{value:{}}};h.prototype={_uiSetAlign:function(a){a&&a.points&&this.align(a.node,a.points,a.offset,a.overflow)},align:function(b,e,f,h){var b=c.one(b||p),f=f&&[].concat(f)||[0,0],h=h||{},l=this.get("el"),n=0,j=a(l[0]),k=o(l),v=o(b),b=g(k,v,e,f),q=d.merge(k,b);if(j&&(h.adjustX||h.adjustY)){if(b.left<j.left||b.left+k.width>j.right)n=
1,e=m(e,/[lr]/ig,{l:"r",r:"l"}),f[0]=-f[0];if(b.top<j.top||b.top+k.height>j.bottom)n=1,e=m(e,/[tb]/ig,{t:"b",b:"t"}),f[1]=-f[1];n&&(b=g(k,v,e,f),d.mix(q,b));e={};e.adjustX=h.adjustX&&(b.left<j.left||b.left+k.width>j.right);e.adjustY=h.adjustY&&(b.top<j.top||b.top+k.height>j.bottom);if(e.adjustX||e.adjustY)h=d.clone(b),n={width:k.width,height:k.height},e.adjustX&&h.left<j.left&&(h.left=j.left),e.resizeWidth&&h.left>=j.left&&h.left+n.width>j.right&&(n.width-=h.left+n.width-j.right),e.adjustX&&h.left+
n.width>j.right&&(h.left=Math.max(j.right-n.width,j.left)),e.adjustY&&h.top<j.top&&(h.top=j.top),e.resizeHeight&&h.top>=j.top&&h.top+n.height>j.bottom&&(n.height-=h.top+n.height-j.bottom),e.adjustY&&h.top+n.height>j.bottom&&(h.top=Math.max(j.bottom-n.height,j.top)),q=d.mix(h,n)}q.left!=k.left&&this.set("x",q.left);q.top!=k.top&&this.set("y",q.top);q.width!=k.width&&l.width(l.width()+q.width-k.width);q.height!=k.height&&l.height(l.height()+q.height-k.height);return this},center:function(a){this.set("align",
{node:a,points:["cc","cc"],offset:[0,0]});return this}};return h},{requires:["ua","dom","node"]});
KISSY.add("component/uibase/base",function(d,f,e,c,b){function a(a){var j;f.apply(this,arguments);(j=this.get("id"))&&c.addComponent(j,this);j=a;for(var k=this.constructor;k;){if(j&&j[i]&&k[t]&&(j[i]=e.one(j[i]))){var l=j,q=k[t],m=void 0,p=void 0,w=l[i];for(m in q)q.hasOwnProperty(m)&&l[m]===b&&(p=q[m],d.isFunction(p)?this.__set(m,p.call(this,w)):d.isString(p)?this.__set(m,w.one(p)):d.isArray(p)&&p[0]&&this.__set(m,w.all(p[0])))}k=k.superclass&&k.superclass.constructor}g(this,"initializer","constructor");
var x,k=this.get("plugins");j=this.get("listeners");h(k);o(this,k,"initializer");for(x in j)k=j[x],this.on(x,k.fn||k,k.scope);a&&a.autoRender&&this.render()}function g(a,b,c){for(var d=a.constructor,e=[],g,f,h,i;d;){i=[];if(h=d.__ks_exts)for(var l=0;l<h.length;l++)if(g=h[l])"constructor"!=c&&(g=g.prototype.hasOwnProperty(c)?g.prototype[c]:null),g&&i.push(g);d.prototype.hasOwnProperty(b)&&(f=d.prototype[b])&&i.push(f);i.length&&e.push.apply(e,i.reverse());d=d.superclass&&d.superclass.constructor}for(l=
e.length-1;0<=l;l--)e[l]&&e[l].call(a)}function m(a){var b=a.getAttrs(),c,d;for(c in b)b.hasOwnProperty(c)&&(d=p+r(c),a[d]&&function(b,c){a.on("after"+r(b)+"Change",function(b){if(b.target===a)a[c](b.newVal,b)})}(c,d))}function h(a){d.each(a,function(b,c){d.isFunction(b)&&(a[c]=new b)})}function o(a,b,c){d.each(b,function(b){if(b[c])b[c](a)})}function l(b,c,e,g){function f(){a.apply(this,arguments)}var h=d.makeArray(arguments);d.isObject(c)&&(g=e,e=c,c=[]);d.isString(h[h.length-1]);d.extend(f,b,e,
g);if(c){f.__ks_exts=c;var i={},h=c.concat(f);d.each(h,function(a){a&&d.each([u,t],function(b){if(a[b]){i[b]=i[b]||{};d.mix(i[b],a[b],{deep:true})}})});d.each(i,function(a,b){f[b]=a});var l={};d.each(h,function(a){if(a){var a=a.prototype,b;for(b in a)a.hasOwnProperty(b)&&(l[b]=a[b])}});d.each(l,function(a,b){f.prototype[b]=a})}return f}var p="_uiSet",i="srcNode",u="ATTRS",t="HTML_PARSER",r=d.ucfirst,s=d.noop;d.extend(a,f,{create:function(){this.get("created")||(this.fire("beforeCreateDom"),g(this,
"createDom","__createDom"),this.__set("created",!0),this.fire("afterCreateDom"),o(this,this.get("plugins"),"createDom"));return this},render:function(){if(!this.get("rendered")){var a=this.get("plugins");this.create(b);this.fire("beforeRenderUI");g(this,"renderUI","__renderUI");this.fire("afterRenderUI");o(this,a,"renderUI");this.fire("beforeBindUI");m(this);g(this,"bindUI","__bindUI");this.fire("afterBindUI");o(this,a,"bindUI");this.fire("beforeSyncUI");var c,d,e=this.getAttrs(),f;for(f in e)e.hasOwnProperty(f)&&
(d=this[p+r(f)])&&!1!==e[f].sync&&(c=this.get(f))!==b&&d.call(this,c);g(this,"syncUI","__syncUI");this.fire("afterSyncUI");o(this,a,"syncUI");this.__set("rendered",!0)}return this},createDom:s,renderUI:s,bindUI:s,syncUI:s,destroy:function(){var a,b=this.get("plugins");o(this,b,"destructor");for(var b=this.constructor,d,e,g;b;){b.prototype.hasOwnProperty("destructor")&&b.prototype.destructor.apply(this);if(d=b.__ks_exts)for(g=d.length-1;0<=g;g--)(e=d[g]&&d[g].prototype.__destructor)&&e.apply(this);
b=b.superclass&&b.superclass.constructor}this.fire("destroy");this.detach();(a=this.get("id"))&&c.removeComponent(a);return this}},{ATTRS:{rendered:{value:!1},created:{value:!1},listeners:{value:{}},plugins:{value:[]},xclass:{valueFn:function(){return c.getXClassByConstructor(this.constructor)}}}});d.mix(a,{HTML_PARSER:{},extend:function j(b,e,g){var f=d.makeArray(arguments),h=f[f.length-1];f.unshift(this);h.xclass&&(f.pop(),f.push(h.xclass));f=l.apply(a,f);h.xclass&&c.setConstructorByXClass(h.xclass,
{constructor:f,priority:h.priority});f.extend=j;return f}});return a},{requires:["base","node","../manager"]});
KISSY.add("component/uibase/box",function(d){function f(){}f.ATTRS={content:{view:1},width:{view:1},height:{view:1},elCls:{view:1},elStyle:{view:1},elAttrs:{view:1},elBefore:{view:1},el:{view:1},render:{view:1},visibleMode:{view:1},visible:{value:!0,view:1},srcNode:{view:1}};f.HTML_PARSER={el:function(e){this.decorateInternal&&this.decorateInternal(d.one(e));return e}};f.prototype={__bindUI:function(){this.on("afterVisibleChange",function(d){this.fire(d.newVal?"show":"hide")})},show:function(){this.render();
this.set("visible",!0);return this},hide:function(){this.set("visible",!1);return this}};return f});
KISSY.add("component/uibase/boxrender",function(d){function f(){}var e=d.all,c=d.Env.host.document;f.ATTRS={el:{setter:function(b){return e(b)}},elCls:{},elStyle:{},width:{},height:{},elTagName:{value:"div"},elAttrs:{},content:{},elBefore:{},render:{},visible:{value:!0},visibleMode:{value:"display"},contentEl:{valueFn:function(){return this.get("el")}}};f.HTML_PARSER={content:function(b){var a=this.get("contentElCls");return(a?b.one("."+a):b).html()}};f.prototype={__renderUI:function(){if(!this.get("srcNode")){var b=
this.get("render"),a=this.get("el"),d=this.get("elBefore");d?a.insertBefore(d,void 0):b?a.appendTo(b,void 0):a.appendTo(c.body,void 0)}},__createDom:function(){if(!this.get("srcNode")){var b,a=this.get("contentEl");b=e("<"+this.get("elTagName")+">");a&&b.append(a);this.__set("el",b);a||this.__set("contentEl",b)}},_uiSetElAttrs:function(b){this.get("el").attr(b)},_uiSetElCls:function(b){this.get("el").addClass(b)},_uiSetElStyle:function(b){this.get("el").css(b)},_uiSetWidth:function(b){this.get("el").width(b)},
_uiSetHeight:function(b){this.get("el").height(b)},_uiSetContent:function(b){var a;if(!this.get("srcNode")||this.get("rendered"))a=this.get("contentEl"),"string"==typeof b?a.html(b):b&&a.empty().append(b)},_uiSetVisible:function(b){var a=this.get("el");"visibility"==this.get("visibleMode")?a.css("visibility",b?"visible":"hidden"):a.css("display",b?"":"none")},__destructor:function(){var b=this.get("el");b&&b.remove()}};return f},{requires:["node"]});
KISSY.add("component/uibase/close",function(){function d(){}d.ATTRS={closable:{view:1},closeBtn:{view:1},closeAction:{value:"hide"}};var f={hide:"hide",destroy:"destroy"};d.prototype={_uiSetClosable:function(d){var c=this;d&&!c.__bindCloseEvent&&(c.__bindCloseEvent=1,c.get("closeBtn").on("click",function(b){c[f[c.get("closeAction")]||"hide"]();b.preventDefault()}))},__destructor:function(){var d=this.get("closeBtn");d&&d.detach()}};return d});
KISSY.add("component/uibase/closerender",function(d,f){function e(){}e.ATTRS={closable:{value:!0},closeBtn:{}};e.HTML_PARSER={closeBtn:function(c){return c.one(".ks-ext-close")}};e.prototype={_uiSetClosable:function(c){var b=this.get("closeBtn");c?(b||this.__set("closeBtn",b=new f("<a tabindex='0' href='javascript:void(\"\u5173\u95ed\")' role='button' class='ks-ext-close'><span class='ks-ext-close-x'>\u5173\u95ed</span></a>")),b.appendTo(this.get("el"),void 0)):b&&b.remove()}};return e},{requires:["node"]});
KISSY.add("component/uibase/constrain",function(d,f,e){function c(){}function b(a){var b=null;if(!a)return b;var c=this.get("el");!0!==a?(a=e.one(a),b=a.offset(),d.mix(b,{maxLeft:b.left+a.outerWidth()-c.outerWidth(),maxTop:b.top+a.outerHeight()-c.outerHeight()})):(b={left:f.scrollLeft(),top:f.scrollTop()},d.mix(b,{maxLeft:b.left+f.viewportWidth()-c.outerWidth(),maxTop:b.top+f.viewportHeight()-c.outerHeight()}));return b}c.ATTRS={constrain:{value:!1}};c.prototype={__renderUI:function(){var a=this,
c=a.getAttrs(),d=c.x,c=c.y,e=d.setter,f=c.setter;d.setter=function(c){var d=e&&e.call(a,c);void 0===d&&(d=c);if(!a.get("constrain"))return d;c=b.call(a,a.get("constrain"));return Math.min(Math.max(d,c.left),c.maxLeft)};c.setter=function(c){var d=f&&f.call(a,c);void 0===d&&(d=c);if(!a.get("constrain"))return d;c=b.call(a,a.get("constrain"));return Math.min(Math.max(d,c.top),c.maxTop)};a.addAttr("x",d);a.addAttr("y",c)}};return c},{requires:["dom","node"]});
KISSY.add("component/uibase/contentbox",function(){function d(){}d.ATTRS={contentEl:{view:1}};return d});KISSY.add("component/uibase/contentboxrender",function(d,f,e,c){function b(){}b.ATTRS={contentEl:{}};b.prototype={__createDom:function(){var a,b=this.get("el");a=b[0].childNodes;a=a.length&&c.nodeListToFragment(a);a=f.all("<div class='ks-contentbox'></div>").append(a);b.append(a);this.__set("contentEl",a)}};return b},{requires:["node","./boxrender","dom"]});
KISSY.add("component/uibase/drag",function(d){function f(){}function e(c){this.set("xy",[c.left,c.top])}f.ATTRS={handlers:{value:[]},draggable:{value:!0}};f.prototype={_uiSetHandlers:function(c){var b;c&&0<c.length&&(b=this.__drag)&&b.set("handlers",c)},__bindUI:function(){var c=d.require("dd")||{},b=c.Draggable,a=this,f=a.get("draggable"),m=a.get("el");if(f&&b){!0===f&&(f={});b=a.__drag=new b({node:m,move:f.proxy});if(f.proxy){f.proxy.moveOnEnd=!1;b.on("dragend",function(){var b=h.get("proxyNode").offset();
m.css("visibility","");a.set("x",b.left);a.set("y",b.top)});var h=a.__proxy=new c.Proxy(f.proxy);h.attachDrag(b)}else b.on("drag",e,a);f.scroll&&(a.__scroll=new c.Scroll(f.scroll)).attachDrag(b)}},_uiSetDraggable:function(c){var b=this.__drag;b&&b.set("disabled",!c)},__destructor:function(){var c=this.__proxy,b=this.__scroll,a=this.__drag;a&&a.destroy();b&&b.destroy();c&&c.destroy()}};return f});
KISSY.add("component/uibase/loading",function(){function d(){}d.prototype={loading:function(){this.get("view").loading();return this},unloading:function(){this.get("view").unloading();return this}};return d});
KISSY.add("component/uibase/loadingrender",function(d,f){function e(){}e.prototype={loading:function(){this._loadingExtEl||(this._loadingExtEl=(new f("<div class='ks-ext-loading' style='position: absolute;border: none;width: 100%;top: 0;left: 0;z-index: 99999;height:100%;*height: expression(this.parentNode.offsetHeight);'/>")).appendTo(this.get("el")));this._loadingExtEl.show()},unloading:function(){var c=this._loadingExtEl;c&&c.hide()}};return e},{requires:["node"]});
KISSY.add("component/uibase/mask",function(){function d(){}d.ATTRS={mask:{value:!1},maskNode:{view:1},maskShared:{view:1}};d.prototype={__bindUI:function(){var d=this.get("view"),e=d._maskExtShow,c=d._maskExtHide;this.get("mask")&&(this.on("show",e,d),this.on("hide",c,d))}};return d},{requires:["ua"]});
KISSY.add("component/uibase/maskrender",function(d,f,e){function c(a){a=m("<div  style='width:"+(g?"expression(KISSY.DOM.docWidth())":"100%")+";left:0;top:0;height:"+(g?"expression(KISSY.DOM.docHeight())":"100%")+";position:"+(g?"absolute":"fixed")+";' class='"+a+"'>"+(g?"<iframe style='position:absolute;left:0;top:0;background:red;width: expression(this.parentNode.offsetWidth);height: expression(this.parentNode.offsetHeight);filter:alpha(opacity=0);z-index:-1;'></iframe>":"")+"</div>").prependTo("body");
a.unselectable();a.on("mousedown",function(a){a.preventDefault()});return a}function b(){}var a={},g=6===f.ie,m=e.all;b.ATTRS={maskShared:{value:!0}};b.prototype={_maskExtShow:function(){var b=this.get("prefixCls")+"ext-mask",d=a[b],f=this.get("maskShared"),e=this.get("maskNode");e||(f?d?e=d.node:(e=c(b),d=a[b]={num:0,node:e}):e=c(b),this.__set("maskNode",e));e.css("z-index",this.get("zIndex")-1);f&&d.num++;(!f||1==d.num)&&e.show()},_maskExtHide:function(){var b=this.get("prefixCls")+"ext-mask",b=
a[b],c=this.get("maskShared"),d=this.get("maskNode");c&&b?(b.num=Math.max(b.num-1,0),0==b.num&&d.hide()):d.hide()},__destructor:function(){var a=this.get("maskShared"),b=this.get("maskNode");this.get("maskNode")&&(a?this.get("visible")&&this._maskExtHide():b.remove())}};return b},{requires:["ua","node"]});
KISSY.add("component/uibase/position",function(d){function f(){}f.ATTRS={x:{view:1},y:{view:1},xy:{setter:function(e){var c=d.makeArray(e);c.length&&(c[0]&&this.set("x",c[0]),c[1]&&this.set("y",c[1]));return e},getter:function(){return[this.get("x"),this.get("y")]}},zIndex:{view:1},visible:{value:!1}};f.prototype={move:function(e,c){d.isArray(e)&&(c=e[1],e=e[0]);this.set("xy",[e,c]);return this}};return f});
KISSY.add("component/uibase/positionrender",function(){function d(){}d.ATTRS={x:{valueFn:function(){return this.get("el")&&this.get("el").offset().left}},y:{valueFn:function(){return this.get("el")&&this.get("el").offset().top}},zIndex:{value:9999}};d.prototype={__createDom:function(){this.get("el").addClass("ks-ext-position")},_uiSetZIndex:function(d){this.get("el").css("z-index",d)},_uiSetX:function(d){this.get("el").offset({left:d})},_uiSetY:function(d){this.get("el").offset({top:d})}};return d});
KISSY.add("component/uibase/resize",function(d){function f(){}f.ATTRS={resize:{value:{}}};f.prototype={__destructor:function(){var d=this.resizer;d&&d.destroy()},_uiSetResize:function(e){var c=d.require("resizable");this.resizer&&this.resizer.destroy();c&&e&&(e.node=this.get("el"),this.resizer=new c(e))}};return f});
KISSY.add("component/uibase/shimrender",function(){function d(){}d.prototype={__createDom:function(){this.get("el").prepend("<iframe style='position: absolute;border: none;width: expression(this.parentNode.offsetWidth);top: 0;opacity: 0;filter: alpha(opacity=0);left: 0;z-index: -1;height: expression(this.parentNode.offsetHeight);'/>")}};return d});
KISSY.add("component/uibase/stdmod",function(){function d(){}d.ATTRS={header:{view:1},body:{view:1},footer:{view:1},bodyStyle:{view:1},footerStyle:{view:1},headerStyle:{view:1},headerContent:{view:1},bodyContent:{view:1},footerContent:{view:1}};return d});
KISSY.add("component/uibase/stdmodrender",function(d,f){function e(){}function c(b,c){var d=b.get("contentEl"),e=b.get(c);e||(e=new f("<div class='"+a+c+"'  ></div>"),e.appendTo(d),b.__set(c,e))}function b(a,b,c){b=a.get(b);d.isString(c)?b.html(c):b.html("").append(c)}var a="ks-stdmod-";e.ATTRS={header:{},body:{},footer:{},bodyStyle:{},footerStyle:{},headerStyle:{},headerContent:{},bodyContent:{},footerContent:{}};e.HTML_PARSER={header:function(b){return b.one("."+a+"header")},body:function(b){return b.one("."+
a+"body")},footer:function(b){return b.one("."+a+"footer")}};e.prototype={__createDom:function(){c(this,"header");c(this,"body");c(this,"footer")},_uiSetBodyStyle:function(a){this.get("body").css(a)},_uiSetHeaderStyle:function(a){this.get("header").css(a)},_uiSetFooterStyle:function(a){this.get("footer").css(a)},_uiSetBodyContent:function(a){b(this,"body",a)},_uiSetHeaderContent:function(a){b(this,"header",a)},_uiSetFooterContent:function(a){b(this,"footer",a)}};return e},{requires:["node"]});
