dygraphs
Version:
dygraphs is a fast, flexible open source JavaScript charting library.
1 lines • 325 kB
JavaScript
!function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/version.js",["jquery"],factory):factory(jQuery)}(function($){"use strict";return $.ui=$.ui||{},$.ui.version="1.13.2"}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/data",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";return $.extend($.expr.pseudos,{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])}})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/disable-selection",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";return $.fn.extend({disableSelection:(eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(eventType+".ui-disableSelection",function(event){event.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});var eventType}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/jquery-var-for-color.js",["jquery","./version"],factory):factory(jQuery)}(function($){}),function(root,factory){"function"==typeof define&&define.amd?define("ui/vendor/jquery-color/jquery.color.js",["jquery"],factory):"object"==typeof exports?module.exports=factory(require("jquery")):factory(root.jQuery)}(this,function(jQuery,undefined){var colors,class2type={},toString=class2type.toString,rplusequals=/^([\-+])=\s*(\d+\.?\d*)/,stringParsers=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return[2.55*execResult[1],2.55*execResult[2],2.55*execResult[3],execResult[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16),execResult[4]?(parseInt(execResult[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(execResult){return[parseInt(execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3]+execResult[3],16),execResult[4]?(parseInt(execResult[4]+execResult[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(execResult){return[execResult[1],execResult[2]/100,execResult[3]/100,execResult[4]]}}],color=jQuery.Color=function(color,green,blue,alpha){return new jQuery.Color.fn.parse(color,green,blue,alpha)},spaces={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},propTypes={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},support=color.support={},supportElem=jQuery("<p>")[0],each=jQuery.each;function getType(obj){return null==obj?obj+"":"object"==typeof obj?class2type[toString.call(obj)]||"object":typeof obj}function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};return null==value?allowEmpty||!prop.def?null:prop.def:(value=type.floor?~~value:parseFloat(value),isNaN(value)?prop.def:type.mod?(value+type.mod)%type.mod:Math.min(type.max,Math.max(0,value)))}function stringParse(string){var inst=color(),rgba=inst._rgba=[];return string=string.toLowerCase(),each(stringParsers,function(_i,parser){var match=parser.re.exec(string),match=match&&parser.parse(match),parser=parser.space||"rgba";if(match)return match=inst[parser](match),inst[spaces[parser].cache]=match[spaces[parser].cache],rgba=inst._rgba=match._rgba,!1}),rgba.length?("0,0,0,0"===rgba.join()&&jQuery.extend(rgba,colors.transparent),inst):colors[string]}function hue2rgb(p,q,h){return 6*(h=(h+1)%1)<1?p+(q-p)*h*6:2*h<1?q:3*h<2?p+(q-p)*(2/3-h)*6:p}supportElem.style.cssText="background-color:rgba(1,1,1,.5)",support.rgba=-1<supportElem.style.backgroundColor.indexOf("rgba"),each(spaces,function(spaceName,space){space.cache="_"+spaceName,space.props.alpha={idx:3,type:"percent",def:1}}),jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(_i,name){class2type["[object "+name+"]"]=name.toLowerCase()}),(color.fn=jQuery.extend(color.prototype,{parse:function(red,green,blue,alpha){if(red===undefined)return this._rgba=[null,null,null,null],this;(red.jquery||red.nodeType)&&(red=jQuery(red).css(green),green=undefined);var inst=this,type=getType(red),rgba=this._rgba=[];return green!==undefined&&(red=[red,green,blue,alpha],type="array"),"string"===type?this.parse(stringParse(red)||colors._default):"array"===type?(each(spaces.rgba.props,function(_key,prop){rgba[prop.idx]=clamp(red[prop.idx],prop)}),this):"object"===type?(red instanceof color?each(spaces,function(_spaceName,space){red[space.cache]&&(inst[space.cache]=red[space.cache].slice())}):each(spaces,function(_spaceName,space){var cache=space.cache;each(space.props,function(key,prop){if(!inst[cache]&&space.to){if("alpha"===key||null==red[key])return;inst[cache]=space.to(inst._rgba)}inst[cache][prop.idx]=clamp(red[key],prop,!0)}),inst[cache]&&jQuery.inArray(null,inst[cache].slice(0,3))<0&&(null==inst[cache][3]&&(inst[cache][3]=1),space.from&&(inst._rgba=space.from(inst[cache])))}),this):void 0},is:function(compare){var is=color(compare),same=!0,inst=this;return each(spaces,function(_,space){var localCache,isCache=is[space.cache];return isCache&&(localCache=inst[space.cache]||space.to&&space.to(inst._rgba)||[],each(space.props,function(_,prop){if(null!=isCache[prop.idx])return same=isCache[prop.idx]===localCache[prop.idx]})),same}),same},_space:function(){var used=[],inst=this;return each(spaces,function(spaceName,space){inst[space.cache]&&used.push(spaceName)}),used.pop()},transition:function(other,distance){var other=(end=color(other))._space(),space=spaces[other],startColor=0===this.alpha()?color("transparent"):this,start=startColor[space.cache]||space.to(startColor._rgba),result=start.slice(),end=end[space.cache];return each(space.props,function(_key,prop){var index=prop.idx,startValue=start[index],endValue=end[index],type=propTypes[prop.type]||{};null!==endValue&&(null===startValue?result[index]=endValue:(type.mod&&(endValue-startValue>type.mod/2?startValue+=type.mod:startValue-endValue>type.mod/2&&(startValue-=type.mod)),result[index]=clamp((endValue-startValue)*distance+startValue,prop)))}),this[other](result)},blend:function(opaque){if(1===this._rgba[3])return this;var rgb=this._rgba.slice(),a=rgb.pop(),blend=color(opaque)._rgba;return color(jQuery.map(rgb,function(v,i){return(1-a)*blend[i]+a*v}))},toRgbaString:function(){var prefix="rgba(",rgba=jQuery.map(this._rgba,function(v,i){return null!=v?v:2<i?1:0});return 1===rgba[3]&&(rgba.pop(),prefix="rgb("),prefix+rgba.join()+")"},toHslaString:function(){var prefix="hsla(",hsla=jQuery.map(this.hsla(),function(v,i){return null==v&&(v=2<i?1:0),v=i&&i<3?Math.round(100*v)+"%":v});return 1===hsla[3]&&(hsla.pop(),prefix="hsl("),prefix+hsla.join()+")"},toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();return includeAlpha&&rgba.push(~~(255*alpha)),"#"+jQuery.map(rgba,function(v){return 1===(v=(v||0).toString(16)).length?"0"+v:v}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=color.fn,spaces.hsla.to=function(rgba){if(null==rgba[0]||null==rgba[1]||null==rgba[2])return[null,null,null,rgba[3]];var r=rgba[0]/255,g=rgba[1]/255,b=rgba[2]/255,rgba=rgba[3],max=Math.max(r,g,b),min=Math.min(r,g,b),diff=max-min,add=max+min,l=.5*add,min=min===max?0:r===max?60*(g-b)/diff+360:g===max?60*(b-r)/diff+120:60*(r-g)/diff+240,max=0==diff?0:l<=.5?diff/add:diff/(2-add);return[Math.round(min)%360,max,l,null==rgba?1:rgba]},spaces.hsla.from=function(hsla){if(null==hsla[0]||null==hsla[1]||null==hsla[2])return[null,null,null,hsla[3]];var h=hsla[0]/360,s=hsla[1],l=hsla[2],hsla=hsla[3],s=l<=.5?l*(1+s):l+s-l*s,l=2*l-s;return[Math.round(255*hue2rgb(l,s,h+1/3)),Math.round(255*hue2rgb(l,s,h)),Math.round(255*hue2rgb(l,s,h-1/3)),hsla]},each(spaces,function(spaceName,space){var props=space.props,cache=space.cache,to=space.to,from=space.from;color.fn[spaceName]=function(value){if(to&&!this[cache]&&(this[cache]=to(this._rgba)),value===undefined)return this[cache].slice();var ret,type=getType(value),arr="array"===type||"object"===type?value:arguments,local=this[cache].slice();return each(props,function(key,prop){key=arr["object"===type?key:prop.idx];null==key&&(key=local[prop.idx]),local[prop.idx]=clamp(key,prop)}),from?((ret=color(from(local)))[cache]=local,ret):color(local)},each(props,function(key,prop){color.fn[key]||(color.fn[key]=function(value){var vtype=getType(value),fn="alpha"===key?this._hsla?"hsla":"rgba":spaceName,local=this[fn](),cur=local[prop.idx];return"undefined"===vtype?cur:("function"===vtype&&(vtype=getType(value=value.call(this,cur))),null==value&&prop.empty?this:("string"===vtype&&(vtype=rplusequals.exec(value))&&(value=cur+parseFloat(vtype[2])*("+"===vtype[1]?1:-1)),local[prop.idx]=value,this[fn](local)))})})}),(color.hook=function(hook){hook=hook.split(" ");each(hook,function(_i,hook){jQuery.cssHooks[hook]={set:function(elem,value){var parsed,curElem,backgroundColor="";if("transparent"!==value&&("string"!==getType(value)||(parsed=stringParse(value)))){if(value=color(parsed||value),!support.rgba&&1!==value._rgba[3]){for(curElem="backgroundColor"===hook?elem.parentNode:elem;(""===backgroundColor||"transparent"===backgroundColor)&&curElem&&curElem.style;)try{backgroundColor=jQuery.css(curElem,"backgroundColor"),curElem=curElem.parentNode}catch(e){}value=value.blend(backgroundColor&&"transparent"!==backgroundColor?backgroundColor:"_default")}value=value.toRgbaString()}try{elem.style[hook]=value}catch(e){}}},jQuery.fx.step[hook]=function(fx){fx.colorInit||(fx.start=color(fx.elem,hook),fx.end=color(fx.end),fx.colorInit=!0),jQuery.cssHooks[hook].set(fx.elem,fx.start.transition(fx.end,fx.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),jQuery.cssHooks.borderColor={expand:function(value){var expanded={};return each(["Top","Right","Bottom","Left"],function(_i,part){expanded["border"+part+"Color"]=value}),expanded}},colors=jQuery.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effect",["jquery","./jquery-var-for-color","./vendor/jquery-color/jquery.color","./version"],factory):factory(jQuery)}(function($){"use strict";var orig,classAnimationActions,shorthandStyles,baseEasings;function getElementStyles(elem){var key,len,style=elem.ownerDocument.defaultView?elem.ownerDocument.defaultView.getComputedStyle(elem,null):elem.currentStyle,styles={};if(style&&style.length&&style[0]&&style[style[0]])for(len=style.length;len--;)"string"==typeof style[key=style[len]]&&(styles[key.replace(/-([\da-z])/gi,function(all,letter){return letter.toUpperCase()})]=style[key]);else for(key in style)"string"==typeof style[key]&&(styles[key]=style[key]);return styles}return $.effects={effect:{}},classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},$.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(_,prop){$.fx.step[prop]=function(fx){("none"!==fx.end&&!fx.setAttr||1===fx.pos&&!fx.setAttr)&&(jQuery.style(fx.elem,prop,fx.end),fx.setAttr=!0)}}),$.fn.addBack||($.fn.addBack=function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}),$.effects.animateClass=function(value,duration,easing,callback){var o=$.speed(duration,easing,callback);return this.queue(function(){var animated=$(this),baseClass=animated.attr("class")||"",allAnimations=(allAnimations=o.children?animated.find("*").addBack():animated).map(function(){return{el:$(this),start:getElementStyles(this)}}),applyClassChange=function(){$.each(classAnimationActions,function(i,action){value[action]&&animated[action+"Class"](value[action])})};applyClassChange(),allAnimations=allAnimations.map(function(){return this.end=getElementStyles(this.el[0]),this.diff=function(oldStyle,newStyle){var name,value,diff={};for(name in newStyle)value=newStyle[name],oldStyle[name]===value||shorthandStyles[name]||!$.fx.step[name]&&isNaN(parseFloat(value))||(diff[name]=value);return diff}(this.start,this.end),this}),animated.attr("class",baseClass),allAnimations=allAnimations.map(function(){var styleInfo=this,dfd=$.Deferred(),opts=$.extend({},o,{queue:!1,complete:function(){dfd.resolve(styleInfo)}});return this.el.animate(this.diff,opts),dfd.promise()}),$.when.apply($,allAnimations.get()).done(function(){applyClassChange(),$.each(arguments,function(){var el=this.el;$.each(this.diff,function(key){el.css(key,"")})}),o.complete.call(animated[0])})})},$.fn.extend({addClass:(orig=$.fn.addClass,function(classNames,speed,easing,callback){return speed?$.effects.animateClass.call(this,{add:classNames},speed,easing,callback):orig.apply(this,arguments)}),removeClass:function(orig){return function(classNames,speed,easing,callback){return 1<arguments.length?$.effects.animateClass.call(this,{remove:classNames},speed,easing,callback):orig.apply(this,arguments)}}($.fn.removeClass),toggleClass:function(orig){return function(classNames,force,speed,easing,callback){return"boolean"==typeof force||void 0===force?speed?$.effects.animateClass.call(this,force?{add:classNames}:{remove:classNames},speed,easing,callback):orig.apply(this,arguments):$.effects.animateClass.call(this,{toggle:classNames},force,speed,easing)}}($.fn.toggleClass),switchClass:function(remove,add,speed,easing,callback){return $.effects.animateClass.call(this,{add:add,remove:remove},speed,easing,callback)}}),function(){var orig;function _normalizeArguments(effect,options,speed,callback){return effect={effect:effect=$.isPlainObject(effect)?(options=effect).effect:effect},"function"==typeof(options=null==options?{}:options)&&(callback=options,speed=null,options={}),"number"!=typeof options&&!$.fx.speeds[options]||(callback=speed,speed=options,options={}),"function"==typeof speed&&(callback=speed,speed=null),options&&$.extend(effect,options),speed=speed||options.duration,effect.duration=$.fx.off?0:"number"==typeof speed?speed:speed in $.fx.speeds?$.fx.speeds[speed]:$.fx.speeds._default,effect.complete=callback||options.complete,effect}function standardAnimationOption(option){return!option||"number"==typeof option||$.fx.speeds[option]||("string"==typeof option&&!$.effects.effect[option]||("function"==typeof option||"object"==typeof option&&!option.effect))}function parseClip(str,element){var outerWidth=element.outerWidth(),element=element.outerHeight(),str=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(str)||["",0,outerWidth,element,0];return{top:parseFloat(str[1])||0,right:"auto"===str[2]?outerWidth:parseFloat(str[2]),bottom:"auto"===str[3]?element:parseFloat(str[3]),left:parseFloat(str[4])||0}}$.expr&&$.expr.pseudos&&$.expr.pseudos.animated&&($.expr.pseudos.animated=(orig=$.expr.pseudos.animated,function(elem){return!!$(elem).data("ui-effects-animated")||orig(elem)})),!1!==$.uiBackCompat&&$.extend($.effects,{save:function(element,set){for(var i=0,length=set.length;i<length;i++)null!==set[i]&&element.data("ui-effects-"+set[i],element[0].style[set[i]])},restore:function(element,set){for(var val,i=0,length=set.length;i<length;i++)null!==set[i]&&(val=element.data("ui-effects-"+set[i]),element.css(set[i],val))},setMode:function(el,mode){return mode="toggle"===mode?el.is(":hidden")?"show":"hide":mode},createWrapper:function(element){if(element.parent().is(".ui-effects-wrapper"))return element.parent();var props={width:element.outerWidth(!0),height:element.outerHeight(!0),float:element.css("float")},wrapper=$("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),size={width:element.width(),height:element.height()},active=document.activeElement;try{active.id}catch(e){active=document.body}return element.wrap(wrapper),element[0]!==active&&!$.contains(element[0],active)||$(active).trigger("focus"),wrapper=element.parent(),"static"===element.css("position")?(wrapper.css({position:"relative"}),element.css({position:"relative"})):($.extend(props,{position:element.css("position"),zIndex:element.css("z-index")}),$.each(["top","left","bottom","right"],function(i,pos){props[pos]=element.css(pos),isNaN(parseInt(props[pos],10))&&(props[pos]="auto")}),element.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),element.css(size),wrapper.css(props).show()},removeWrapper:function(element){var active=document.activeElement;return element.parent().is(".ui-effects-wrapper")&&(element.parent().replaceWith(element),element[0]!==active&&!$.contains(element[0],active)||$(active).trigger("focus")),element}}),$.extend($.effects,{version:"1.13.2",define:function(name,mode,effect){return effect||(effect=mode,mode="effect"),$.effects.effect[name]=effect,$.effects.effect[name].mode=mode,effect},scaledDimensions:function(element,percent,direction){if(0===percent)return{height:0,width:0,outerHeight:0,outerWidth:0};var x="horizontal"!==direction?(percent||100)/100:1,direction="vertical"!==direction?(percent||100)/100:1;return{height:element.height()*direction,width:element.width()*x,outerHeight:element.outerHeight()*direction,outerWidth:element.outerWidth()*x}},clipToBox:function(animation){return{width:animation.clip.right-animation.clip.left,height:animation.clip.bottom-animation.clip.top,left:animation.clip.left,top:animation.clip.top}},unshift:function(element,queueLength,count){var queue=element.queue();1<queueLength&&queue.splice.apply(queue,[1,0].concat(queue.splice(queueLength,count))),element.dequeue()},saveStyle:function(element){element.data("ui-effects-style",element[0].style.cssText)},restoreStyle:function(element){element[0].style.cssText=element.data("ui-effects-style")||"",element.removeData("ui-effects-style")},mode:function(element,mode){element=element.is(":hidden");return"toggle"===mode&&(mode=element?"show":"hide"),mode=(element?"hide"===mode:"show"===mode)?"none":mode},getBaseline:function(origin,original){var y,x;switch(origin[0]){case"top":y=0;break;case"middle":y=.5;break;case"bottom":y=1;break;default:y=origin[0]/original.height}switch(origin[1]){case"left":x=0;break;case"center":x=.5;break;case"right":x=1;break;default:x=origin[1]/original.width}return{x:x,y:y}},createPlaceholder:function(element){var placeholder,cssPosition=element.css("position"),position=element.position();return element.css({marginTop:element.css("marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),marginRight:element.css("marginRight")}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()),/^(static|relative)/.test(cssPosition)&&(cssPosition="absolute",placeholder=$("<"+element[0].nodeName+">").insertAfter(element).css({display:/^(inline|ruby)/.test(element.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:element.css("marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),marginRight:element.css("marginRight"),float:element.css("float")}).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()).addClass("ui-effects-placeholder"),element.data("ui-effects-placeholder",placeholder)),element.css({position:cssPosition,left:position.left,top:position.top}),placeholder},removePlaceholder:function(element){var dataKey="ui-effects-placeholder",placeholder=element.data(dataKey);placeholder&&(placeholder.remove(),element.removeData(dataKey))},cleanUp:function(element){$.effects.restoreStyle(element),$.effects.removePlaceholder(element)},setTransition:function(element,list,factor,value){return value=value||{},$.each(list,function(i,x){var unit=element.cssUnit(x);0<unit[0]&&(value[x]=unit[0]*factor+unit[1])}),value}}),$.fn.extend({effect:function(){function prefilter(next){var el=$(this),normalizedMode=$.effects.mode(el,mode)||defaultMode;el.data("ui-effects-animated",!0),modes.push(normalizedMode),defaultMode&&("show"===normalizedMode||normalizedMode===defaultMode&&"hide"===normalizedMode)&&el.show(),defaultMode&&"none"===normalizedMode||$.effects.saveStyle(el),"function"==typeof next&&next()}var args=_normalizeArguments.apply(this,arguments),effectMethod=$.effects.effect[args.effect],defaultMode=effectMethod.mode,queue=args.queue,queueName=queue||"fx",complete=args.complete,mode=args.mode,modes=[];return $.fx.off||!effectMethod?mode?this[mode](args.duration,complete):this.each(function(){complete&&complete.call(this)}):!1===queue?this.each(prefilter).each(run):this.queue(queueName,prefilter).queue(queueName,run);function run(next){var elem=$(this);function done(){"function"==typeof complete&&complete.call(elem[0]),"function"==typeof next&&next()}args.mode=modes.shift(),!1===$.uiBackCompat||defaultMode?"none"===args.mode?(elem[mode](),done()):effectMethod.call(elem[0],args,function(){elem.removeData("ui-effects-animated"),$.effects.cleanUp(elem),"hide"===args.mode&&elem.hide(),done()}):(elem.is(":hidden")?"hide"===mode:"show"===mode)?(elem[mode](),done()):effectMethod.call(elem[0],args,done)}},show:function(orig){return function(option){return standardAnimationOption(option)?orig.apply(this,arguments):((option=_normalizeArguments.apply(this,arguments)).mode="show",this.effect.call(this,option))}}($.fn.show),hide:function(orig){return function(option){return standardAnimationOption(option)?orig.apply(this,arguments):((option=_normalizeArguments.apply(this,arguments)).mode="hide",this.effect.call(this,option))}}($.fn.hide),toggle:function(orig){return function(option){return standardAnimationOption(option)||"boolean"==typeof option?orig.apply(this,arguments):((option=_normalizeArguments.apply(this,arguments)).mode="toggle",this.effect.call(this,option))}}($.fn.toggle),cssUnit:function(key){var style=this.css(key),val=[];return $.each(["em","px","%","pt"],function(i,unit){0<style.indexOf(unit)&&(val=[parseFloat(style),unit])}),val},cssClip:function(clipObj){return clipObj?this.css("clip","rect("+clipObj.top+"px "+clipObj.right+"px "+clipObj.bottom+"px "+clipObj.left+"px)"):parseClip(this.css("clip"),this)},transfer:function(options,done){var element=$(this),target=$(options.to),targetFixed="fixed"===target.css("position"),body=$("body"),fixTop=targetFixed?body.scrollTop():0,body=targetFixed?body.scrollLeft():0,endPosition=target.offset(),endPosition={top:endPosition.top-fixTop,left:endPosition.left-body,height:target.innerHeight(),width:target.innerWidth()},target=element.offset(),transfer=$("<div class='ui-effects-transfer'></div>");transfer.appendTo("body").addClass(options.className).css({top:target.top-fixTop,left:target.left-body,height:element.innerHeight(),width:element.innerWidth(),position:targetFixed?"fixed":"absolute"}).animate(endPosition,options.duration,options.easing,function(){transfer.remove(),"function"==typeof done&&done()})}}),$.fx.step.clip=function(fx){fx.clipInit||(fx.start=$(fx.elem).cssClip(),"string"==typeof fx.end&&(fx.end=parseClip(fx.end,fx.elem)),fx.clipInit=!0),$(fx.elem).cssClip({top:fx.pos*(fx.end.top-fx.start.top)+fx.start.top,right:fx.pos*(fx.end.right-fx.start.right)+fx.start.right,bottom:fx.pos*(fx.end.bottom-fx.start.bottom)+fx.start.bottom,left:fx.pos*(fx.end.left-fx.start.left)+fx.start.left})}}(),baseEasings={},$.each(["Quad","Cubic","Quart","Quint","Expo"],function(i,name){baseEasings[name]=function(p){return Math.pow(p,i+2)}}),$.extend(baseEasings,{Sine:function(p){return 1-Math.cos(p*Math.PI/2)},Circ:function(p){return 1-Math.sqrt(1-p*p)},Elastic:function(p){return 0===p||1===p?p:-Math.pow(2,8*(p-1))*Math.sin((80*(p-1)-7.5)*Math.PI/15)},Back:function(p){return p*p*(3*p-2)},Bounce:function(p){for(var pow2,bounce=4;p<((pow2=Math.pow(2,--bounce))-1)/11;);return 1/Math.pow(4,3-bounce)-7.5625*Math.pow((3*pow2-2)/22-p,2)}}),$.each(baseEasings,function(name,easeIn){$.easing["easeIn"+name]=easeIn,$.easing["easeOut"+name]=function(p){return 1-easeIn(1-p)},$.easing["easeInOut"+name]=function(p){return p<.5?easeIn(2*p)/2:1-easeIn(-2*p+2)/2}}),$.effects}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-blind.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("blind","hide",function(options,done){var map={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},element=$(this),direction=options.direction||"up",start=element.cssClip(),animate={clip:$.extend({},start)},placeholder=$.effects.createPlaceholder(element);animate.clip[map[direction][0]]=animate.clip[map[direction][1]],"show"===options.mode&&(element.cssClip(animate.clip),placeholder&&placeholder.css($.effects.clipToBox(animate)),animate.clip=start),placeholder&&placeholder.animate($.effects.clipToBox(animate),options.duration,options.easing),element.animate(animate,{queue:!1,duration:options.duration,easing:options.easing,complete:done})})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-bounce.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("bounce",function(options,done){var upAnim,downAnim,element=$(this),mode=options.mode,hide="hide"===mode,mode="show"===mode,direction=options.direction||"up",distance=options.distance,times=options.times||5,anims=2*times+(mode||hide?1:0),speed=options.duration/anims,easing=options.easing,ref="up"===direction||"down"===direction?"top":"left",motion="up"===direction||"left"===direction,i=0,options=element.queue().length;for($.effects.createPlaceholder(element),direction=element.css(ref),distance=distance||element["top"==ref?"outerHeight":"outerWidth"]()/3,mode&&((downAnim={opacity:1})[ref]=direction,element.css("opacity",0).css(ref,motion?2*-distance:2*distance).animate(downAnim,speed,easing)),hide&&(distance/=Math.pow(2,times-1)),(downAnim={})[ref]=direction;i<times;i++)(upAnim={})[ref]=(motion?"-=":"+=")+distance,element.animate(upAnim,speed,easing).animate(downAnim,speed,easing),distance=hide?2*distance:distance/2;hide&&((upAnim={opacity:0})[ref]=(motion?"-=":"+=")+distance,element.animate(upAnim,speed,easing)),element.queue(done),$.effects.unshift(element,options,1+anims)})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-clip.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("clip","hide",function(options,done){var animate={},element=$(this),direction=options.direction||"vertical",both="both"===direction,horizontal=both||"horizontal"===direction,both=both||"vertical"===direction,direction=element.cssClip();animate.clip={top:both?(direction.bottom-direction.top)/2:direction.top,right:horizontal?(direction.right-direction.left)/2:direction.right,bottom:both?(direction.bottom-direction.top)/2:direction.bottom,left:horizontal?(direction.right-direction.left)/2:direction.left},$.effects.createPlaceholder(element),"show"===options.mode&&(element.cssClip(animate.clip),animate.clip=direction),element.animate(animate,{queue:!1,duration:options.duration,easing:options.easing,complete:done})})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-drop.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("drop","hide",function(options,done){var distance,element=$(this),show="show"===options.mode,direction=options.direction||"left",ref="up"===direction||"down"===direction?"top":"left",direction="up"===direction||"left"===direction?"-=":"+=",oppositeMotion="+="==direction?"-=":"+=",animation={opacity:0};$.effects.createPlaceholder(element),distance=options.distance||element["top"==ref?"outerHeight":"outerWidth"](!0)/2,animation[ref]=direction+distance,show&&(element.css(animation),animation[ref]=oppositeMotion+distance,animation.opacity=1),element.animate(animation,{queue:!1,duration:options.duration,easing:options.easing,complete:done})})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-explode.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("explode","hide",function(options,done){var i,j,left,top,mx,my,rows=options.pieces?Math.round(Math.sqrt(options.pieces)):3,cells=rows,element=$(this),show="show"===options.mode,offset=element.show().css("visibility","hidden").offset(),width=Math.ceil(element.outerWidth()/cells),height=Math.ceil(element.outerHeight()/rows),pieces=[];function childComplete(){pieces.push(this),pieces.length===rows*cells&&(element.css({visibility:"visible"}),$(pieces).remove(),done())}for(i=0;i<rows;i++)for(top=offset.top+i*height,my=i-(rows-1)/2,j=0;j<cells;j++)left=offset.left+j*width,mx=j-(cells-1)/2,element.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*width,top:-i*height}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:width,height:height,left:left+(show?mx*width:0),top:top+(show?my*height:0),opacity:show?0:1}).animate({left:left+(show?0:mx*width),top:top+(show?0:my*height),opacity:show?1:0},options.duration||500,options.easing,childComplete)})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-fade.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("fade","toggle",function(options,done){var show="show"===options.mode;$(this).css("opacity",show?0:1).animate({opacity:show?1:0},{queue:!1,duration:options.duration,easing:options.easing,complete:done})})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-fold.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("fold","hide",function(options,done){var element=$(this),mode=options.mode,show="show"===mode,mode="hide"===mode,size=options.size||15,percent=/([0-9]+)%/.exec(size),ref=!!options.horizFirst?["right","bottom"]:["bottom","right"],duration=options.duration/2,placeholder=$.effects.createPlaceholder(element),start=element.cssClip(),animation1={clip:$.extend({},start)},animation2={clip:$.extend({},start)},distance=[start[ref[0]],start[ref[1]]],queuelen=element.queue().length;percent&&(size=parseInt(percent[1],10)/100*distance[mode?0:1]),animation1.clip[ref[0]]=size,animation2.clip[ref[0]]=size,animation2.clip[ref[1]]=0,show&&(element.cssClip(animation2.clip),placeholder&&placeholder.css($.effects.clipToBox(animation2)),animation2.clip=start),element.queue(function(next){placeholder&&placeholder.animate($.effects.clipToBox(animation1),duration,options.easing).animate($.effects.clipToBox(animation2),duration,options.easing),next()}).animate(animation1,duration,options.easing).animate(animation2,duration,options.easing).queue(done),$.effects.unshift(element,queuelen,4)})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-highlight.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("highlight","show",function(options,done){var element=$(this),animation={backgroundColor:element.css("backgroundColor")};"hide"===options.mode&&(animation.opacity=0),$.effects.saveStyle(element),element.css({backgroundImage:"none",backgroundColor:options.color||"#ffff99"}).animate(animation,{queue:!1,duration:options.duration,easing:options.easing,complete:done})})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-size.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("size",function(options,done){var factor,element=$(this),cProps=["fontSize"],vProps=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],hProps=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],mode=options.mode,restore="effect"!==mode,scale=options.scale||"both",origin=options.origin||["middle","center"],position=element.css("position"),pos=element.position(),original=$.effects.scaledDimensions(element),from=options.from||original,to=options.to||$.effects.scaledDimensions(element,0);$.effects.createPlaceholder(element),"show"===mode&&(mode=from,from=to,to=mode),factor={from:{y:from.height/original.height,x:from.width/original.width},to:{y:to.height/original.height,x:to.width/original.width}},"box"!==scale&&"both"!==scale||(factor.from.y!==factor.to.y&&(from=$.effects.setTransition(element,vProps,factor.from.y,from),to=$.effects.setTransition(element,vProps,factor.to.y,to)),factor.from.x!==factor.to.x&&(from=$.effects.setTransition(element,hProps,factor.from.x,from),to=$.effects.setTransition(element,hProps,factor.to.x,to))),"content"!==scale&&"both"!==scale||factor.from.y!==factor.to.y&&(from=$.effects.setTransition(element,cProps,factor.from.y,from),to=$.effects.setTransition(element,cProps,factor.to.y,to)),origin&&(mode=$.effects.getBaseline(origin,original),from.top=(original.outerHeight-from.outerHeight)*mode.y+pos.top,from.left=(original.outerWidth-from.outerWidth)*mode.x+pos.left,to.top=(original.outerHeight-to.outerHeight)*mode.y+pos.top,to.left=(original.outerWidth-to.outerWidth)*mode.x+pos.left),delete from.outerHeight,delete from.outerWidth,element.css(from),"content"!==scale&&"both"!==scale||(vProps=vProps.concat(["marginTop","marginBottom"]).concat(cProps),hProps=hProps.concat(["marginLeft","marginRight"]),element.find("*[width]").each(function(){var child=$(this),childOriginal=$.effects.scaledDimensions(child),childFrom={height:childOriginal.height*factor.from.y,width:childOriginal.width*factor.from.x,outerHeight:childOriginal.outerHeight*factor.from.y,outerWidth:childOriginal.outerWidth*factor.from.x},childOriginal={height:childOriginal.height*factor.to.y,width:childOriginal.width*factor.to.x,outerHeight:childOriginal.height*factor.to.y,outerWidth:childOriginal.width*factor.to.x};factor.from.y!==factor.to.y&&(childFrom=$.effects.setTransition(child,vProps,factor.from.y,childFrom),childOriginal=$.effects.setTransition(child,vProps,factor.to.y,childOriginal)),factor.from.x!==factor.to.x&&(childFrom=$.effects.setTransition(child,hProps,factor.from.x,childFrom),childOriginal=$.effects.setTransition(child,hProps,factor.to.x,childOriginal)),restore&&$.effects.saveStyle(child),child.css(childFrom),child.animate(childOriginal,options.duration,options.easing,function(){restore&&$.effects.restoreStyle(child)})})),element.animate(to,{queue:!1,duration:options.duration,easing:options.easing,complete:function(){var offset=element.offset();0===to.opacity&&element.css("opacity",from.opacity),restore||(element.css("position","static"===position?"relative":position).offset(offset),$.effects.saveStyle(element)),done()}})})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-scale.js",["jquery","../version","../effect","./effect-size"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("scale",function(options,done){var el=$(this),mode=options.mode,mode=parseInt(options.percent,10)||(0===parseInt(options.percent,10)||"effect"!==mode?0:100),el=$.extend(!0,{from:$.effects.scaledDimensions(el),to:$.effects.scaledDimensions(el,mode,options.direction||"both"),origin:options.origin||["middle","center"]},options);options.fade&&(el.from.opacity=1,el.to.opacity=0),$.effects.effect.size.call(this,el,done)})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-puff.js",["jquery","../version","../effect","./effect-scale"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("puff","hide",function(options,done){options=$.extend(!0,{},options,{fade:!0,percent:parseInt(options.percent,10)||150});$.effects.effect.scale.call(this,options,done)})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-pulsate.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("pulsate","show",function(options,done){var element=$(this),mode=options.mode,show="show"===mode,anims=2*(options.times||5)+(show||"hide"===mode?1:0),duration=options.duration/anims,animateTo=0,i=1,mode=element.queue().length;for(!show&&element.is(":visible")||(element.css("opacity",0).show(),animateTo=1);i<anims;i++)element.animate({opacity:animateTo},duration,options.easing),animateTo=1-animateTo;element.animate({opacity:animateTo},duration,options.easing),element.queue(done),$.effects.unshift(element,mode,1+anims)})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-shake.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("shake",function(options,done){var i=1,element=$(this),direction=options.direction||"left",distance=options.distance||20,times=options.times||3,anims=2*times+1,speed=Math.round(options.duration/anims),ref="up"===direction||"down"===direction?"top":"left",direction="up"===direction||"left"===direction,animation={},animation1={},animation2={},queuelen=element.queue().length;for($.effects.createPlaceholder(element),animation[ref]=(direction?"-=":"+=")+distance,animation1[ref]=(direction?"+=":"-=")+2*distance,animation2[ref]=(direction?"-=":"+=")+2*distance,element.animate(animation,speed,options.easing);i<times;i++)element.animate(animation1,speed,options.easing).animate(animation2,speed,options.easing);element.animate(animation1,speed,options.easing).animate(animation,speed/2,options.easing).queue(done),$.effects.unshift(element,queuelen,1+anims)})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-slide.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";return $.effects.define("slide","show",function(options,done){var startClip,startRef,element=$(this),map={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},mode=options.mode,direction=options.direction||"left",ref="up"===direction||"down"===direction?"top":"left",positiveMotion="up"===direction||"left"===direction,distance=options.distance||element["top"==ref?"outerHeight":"outerWidth"](!0),animation={};$.effects.createPlaceholder(element),startClip=element.cssClip(),startRef=element.position()[ref],animation[ref]=(positiveMotion?-1:1)*distance+startRef,animation.clip=element.cssClip(),animation.clip[map[direction][1]]=animation.clip[map[direction][0]],"show"===mode&&(element.cssClip(animation.clip),element.css(ref,animation[ref]),animation.clip=startClip,animation[ref]=startRef),element.animate(animation,{queue:!1,duration:options.duration,easing:options.easing,complete:done})})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/effects/effect-transfer.js",["jquery","../version","../effect"],factory):factory(jQuery)}(function($){"use strict";var effect;return effect=!1!==$.uiBackCompat?$.effects.define("transfer",function(options,done){$(this).transfer(options,done)}):effect}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/focusable",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";return $.ui.focusable=function(element,hasTabindex){var map,focusableIfVisible,mapName,nodeName=element.nodeName.toLowerCase();return"area"===nodeName?(mapName=(map=element.parentNode).name,!(!element.href||!mapName||"map"!==map.nodeName.toLowerCase())&&(0<(map=$("img[usemap='#"+mapName+"']")).length&&map.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(nodeName)?(focusableIfVisible=!element.disabled)&&(mapName=$(element).closest("fieldset")[0])&&(focusableIfVisible=!mapName.disabled):focusableIfVisible="a"===nodeName&&element.href||hasTabindex,focusableIfVisible&&$(element).is(":visible")&&function(element){var visibility=element.css("visibility");for(;"inherit"===visibility;)element=element.parent(),visibility=element.css("visibility");return"visible"===visibility}($(element)))},$.extend($.expr.pseudos,{focusable:function(element){return $.ui.focusable(element,null!=$.attr(element,"tabindex"))}}),$.ui.focusable}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/form.js",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";return $.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):$(this[0].form)}}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/form-reset-mixin",["jquery","./form","./version"],factory):factory(jQuery)}(function($){"use strict";return $.ui.formResetMixin={_formResetHandler:function(){var form=$(this);setTimeout(function(){var instances=form.data("ui-form-reset-instances");$.each(instances,function(){this.refresh()})})},_bindFormResetHandler:function(){var instances;this.form=this.element._form(),this.form.length&&((instances=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),instances.push(this),this.form.data("ui-form-reset-instances",instances))},_unbindFormResetHandler:function(){var instances;this.form.length&&((instances=this.form.data("ui-form-reset-instances")).splice($.inArray(this,instances),1),instances.length?this.form.data("ui-form-reset-instances",instances):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}}}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/ie",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";return $.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/jquery-patch.js",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";var rcssescape,fcssescape;$.expr.pseudos||($.expr.pseudos=$.expr[":"]),$.uniqueSort||($.uniqueSort=$.unique),$.escapeSelector||(rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){return asCodePoint?"\0"===ch?"�":ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" ":"\\"+ch},$.escapeSelector=function(sel){return(sel+"").replace(rcssescape,fcssescape)}),$.fn.even&&$.fn.odd||$.fn.extend({even:function(){return this.filter(function(i){return i%2==0})},odd:function(){return this.filter(function(i){return i%2==1})}})}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/keycode",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";return $.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/labels",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";return $.fn.labels=function(){var id,labels,ancestor;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(labels=this.eq(0).parents("label"),(id=this.attr("id"))&&(ancestor=(ancestor=this.eq(0).parents().last()).add((ancestor.length?ancestor:this).siblings()),id="label[for='"+$.escapeSelector(id)+"']",labels=labels.add(ancestor.find(id).addBack(id))),this.pushStack(labels)):this.pushStack([])}}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/plugin",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";return $.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set)proto.plugins[i]=proto.plugins[i]||[],proto.plugins[i].push([option,set[i]])},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(set&&(allowDisconnected||instance.element[0].parentNode&&11!==instance.element[0].parentNode.nodeType))for(i=0;i<set.length;i++)instance.options[set[i][0]]&&set[i][1].apply(instance.element,args)}}}),function(factory){"use strict";"function"==typeof define&&define.amd?define("ui/position",["jquery","./version"],factory):factory(jQuery)}(function($){"use strict";function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)]}function parseCss(element,property){return parseInt($.css(element,property),10)||0}function isWindow(obj){return null!=obj&&obj===obj.window}var cachedScrollbarWidth,max,abs,rhorizontal,rvertical,roffset,rposition,rpercent,_position;return max=Math.max,abs=Math.abs,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position,$.position={scrollbarWidth:function(){if(void 0!==cachedScrollbarWidth)return cachedScrollbarWidth;var w1,div=$("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),innerDiv=div.children()[0];return $("body").append(div),w1=innerDiv.offsetWidth,div.css("overflow","scroll"),w1===(innerDiv=innerDiv.offsetWidth)&&(innerDiv=div[0].clientWidth),div.remove(),cachedScrollbarWidth=w1-innerDiv},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),overflowX="scroll"===overflowX||"auto"===overflowX&&within.width<within.element[0].scrollWidth;return{width:"scroll"===overflowY||"auto"===overflowY&&within.height<within.element[0].scrollHeight?$.position.scrollbarWidth():0,height:overflowX?$.position.scrollbarWidth():0}},getWithinInfo:function(element){var withinElement=$(element||window),isElemWindow=isWindow(withinElement[0]),isDocument=!!withinElement[0]&&9===withinElement[0].nodeType;return{element:withinElement,isWindow:isElemWindow,isDocument:isDocument,offset:!isElemWindow&&!isDocument?$(element).offset():{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:withinElement.outerWidth(),height:withinElement.outerHeight()}}},$.fn.position=function(options){if(!options||!options.of)return _position.apply(this,arguments);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,elem,target="string"==typeof(options=$.extend({},options)).of?$(document).find(options.of):$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={},raw=9===(raw=(elem=target)[0]).nodeType?{width:elem.width(),height:elem.height(),offset:{top:0,left:0}}:isWindow(raw)?{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}}:raw.preventDefault?{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}}:{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()};return target[0].preventDefault&&(options.at="left top"),targetWidth=raw.width,targetHeight=raw.height,basePosition=$.extend({},targetOffset=raw.offset),$.each(["my","at"],function(){var horizontalOffset,verticalOffset,pos=(options[this]||"").split(" ");(pos=1===pos.length?rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"]:pos)[0]=rhorizontal.test(pos[0])?pos[0]:"center",pos[1]=rvertical.test(pos[1])?pos[1]:"center",horizontalOffset=roffset.exec(pos[0]),verticalOffset=roffset.exec(pos[1]),offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0],options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]]}),1===collision.length&&(collision[1]=collision[0]),"right"===options.at[0]?basePosition.left+=targetWidth:"center"===options.at[0]&&(basePosition.left+=targetWidth/2),"bottom"===options.at[1]?basePosition.top+=targetHeight:"center"===options.at[1]&&(basePosition.top+=targetHeight/2),atOffset=getOffsets(offsets.at,targetWidth,targetHeight),basePosition.left+=atOffset[0],basePosition.top+=atOffset[1],this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());"right"===options.my[0]?position.left-=elemWidth:"center"===options.my[0]&&(position.left-=elemWidth/2),"bottom"===options.my[1]?position.top-=elemHeight:"center"===options.my[1]&&(position.top-=elemHeight/2),position.left+=myOffset[0],position.top+